From: Tilman Sauerbeck Date: Sat, 11 Nov 2006 12:14:24 +0000 (+0000) Subject: Sanitized Edje::Edje reference lookup. X-Git-Url: http://git.code-monkey.de/?p=ruby-esmart.git;a=commitdiff_plain;h=6f0fed37e64e6ec18bd73544528a652a229aee66 Sanitized Edje::Edje reference lookup. Also require the edje module. --- diff --git a/src/esmart_file_dialog/rb_esmart_file_dialog.c b/src/esmart_file_dialog/rb_esmart_file_dialog.c index 4c60fec..ba62e24 100644 --- a/src/esmart_file_dialog/rb_esmart_file_dialog.c +++ b/src/esmart_file_dialog/rb_esmart_file_dialog.c @@ -1,5 +1,5 @@ /* - * $Id: rb_esmart_file_dialog.c 356 2006-02-10 18:27:31Z tilman $ + * $Id: rb_esmart_file_dialog.c 391 2006-11-11 12:14:24Z tilman $ * * Copyright (C) 2005 Tilman Sauerbeck (tilman at code-monkey de) * @@ -35,6 +35,8 @@ typedef struct { static void on_action (void *data, Evas_Object *edje, Esmart_File_Dialog_Op op); +static VALUE cEdje; + static void c_mark (RbFileDialog *e) { c_evas_object_mark (&e->real); @@ -122,20 +124,12 @@ static void on_action (void *data, Evas_Object *edje, static VALUE c_edje_get (VALUE self) { Evas_Object *e; - VALUE mEdje, cEdje, s; - ID const_get; GET_OBJ (self, RbFileDialog, fd); if (!NIL_P (fd->edje)) return fd->edje; - const_get = rb_intern ("const_get"); - s = rb_str_new2 ("Edje"); - - mEdje = rb_funcall (rb_cModule, const_get, 1, s); - cEdje = rb_funcall (mEdje, const_get, 1, s); - e = esmart_file_dialog_edje_get (fd->real.real); fd->edje = rb_funcall (cEdje, rb_intern ("new_from_pointer"), 2, TO_EVAS (self, evas_object_evas_get (e)), @@ -176,9 +170,13 @@ static VALUE c_current_directory_get (VALUE self) void Init_esmart_file_dialog (void) { - VALUE c; + VALUE m, c; rb_require ("esmart"); + rb_require ("edje"); + + m = rb_const_get (rb_cModule, rb_intern ("Edje")); + cEdje = rb_const_get (m, rb_intern ("Edje")); c = rb_define_class_under (mEsmart, "FileDialog", cEvasObject);