Sanitized Edje::Edje reference lookup.
authorTilman Sauerbeck <tilman@code-monkey.de>
Sat, 11 Nov 2006 12:14:24 +0000 (12:14 +0000)
committerTilman Sauerbeck <tilman@code-monkey.de>
Sat, 11 Nov 2006 12:14:24 +0000 (12:14 +0000)
Also require the edje module.

src/esmart_file_dialog/rb_esmart_file_dialog.c

index 4c60feccdbf2b1d1e4cf6bfd5f7ca0bbf66ab390..ba62e24992fbb3b39d45e227b582b6f488e80325 100644 (file)
@@ -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);