Enlightenment CVS committal

Author  : rephorm
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/modules/gadget_test


Modified Files:
        e_mod_main.c 


Log Message:

pass a single struct to e_gadget_new() instead of a ton of functions.

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/apps/e/src/modules/gadget_test/e_mod_main.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- e_mod_main.c        1 Dec 2005 05:19:19 -0000       1.1
+++ e_mod_main.c        18 Dec 2005 07:37:53 -0000      1.2
@@ -20,18 +20,29 @@
 void *
 e_modapi_init(E_Module *m)
 {
+   E_Gadget_Api *api = NULL;
    E_Gadget *gad = NULL;
-   
+  
    Test *t = E_NEW(Test, 1);
+   if (!t) return;
+   api = E_NEW(E_Gadget_Api, 1);
+   if (!api) return;
+
+   /*
+    * set up gadget -- only module and name are required, but the gadget would
+    * be pretty useless without func_face_*
+    */
+   
+   api->module = m;
+   api->name = "test_gadget";
+   api->func_face_init = _test_face_init;
+   api->func_face_free = _test_face_free;
+   api->func_change = _test_face_change;
+   api->func_menu_init = _test_menu_init;
+   api->func_face_menu_init = _test_face_menu_init;
+   api->data = t;
 
-   gad = e_gadget_new(m,
-        "test_gadget",
-        _test_face_init,
-        _test_face_free,
-        _test_face_change,
-        _test_menu_init,
-        _test_face_menu_init,
-        t);
+   gad = e_gadget_new(api);
 
    return gad;
 }




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to