Enlightenment CVS committal

Author  : urandom
Project : e_modules
Module  : deskshow

Dir     : e_modules/deskshow


Modified Files:
        e_mod_main.c 


Log Message:
the module now indicates whether the deskshow is toggled for each desk.

===================================================================
RCS file: /cvs/e/e_modules/deskshow/e_mod_main.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- e_mod_main.c        21 Jul 2006 00:48:13 -0000      1.8
+++ e_mod_main.c        21 Jul 2006 02:17:08 -0000      1.9
@@ -11,6 +11,7 @@
 static void _gc_orient (E_Gadcon_Client * gcc);
 static char *_gc_label (void);
 static Evas_Object *_gc_icon (Evas * evas);
+static int _deskshow_cb_event_desk_show(void *data, int type, void *event);
 
 /* and actually define the gadcon class that this module provides (just 1) */
 static const E_Gadcon_Client_Class _gadcon_class = {
@@ -32,6 +33,7 @@
                                   void *event_info);
 
 static E_Module *desk_module = NULL;
+Ecore_Event_Handler *handler;
 
 static E_Gadcon_Client *
 _gc_init (E_Gadcon * gc, const char *name, const char *id, const char *style)
@@ -62,6 +64,8 @@
 
   evas_object_event_callback_add (o, EVAS_CALLBACK_MOUSE_DOWN,
                                  _button_cb_mouse_down, inst);
+   handler = ecore_event_handler_add(E_EVENT_DESK_SHOW, 
+       _deskshow_cb_event_desk_show, inst);
   return gcc;
 }
 
@@ -159,6 +163,23 @@
     }
 }
 
+static int
+_deskshow_cb_event_desk_show(void *data, int type, void *event)
+{
+   E_Event_Desk_Show *ev;
+   E_Desk *desk;
+   Instance *inst;
+
+   inst = data;
+   ev = event;
+   desk = ev->desk;
+
+   if (desk->deskshow_toggle)
+     edje_object_signal_emit(inst->o_button, "active", "");
+   else
+     edje_object_signal_emit(inst->o_button, "passive", "");
+}
+
 /* module setup */
 EAPI E_Module_Api e_modapi = {
   E_MODULE_API_VERSION,
@@ -168,15 +189,16 @@
 EAPI void *
 e_modapi_init (E_Module * m)
 {
-  desk_module = m;
-  e_gadcon_provider_register (&_gadcon_class);
-  return desk_module;
+   desk_module = m;
+   e_gadcon_provider_register (&_gadcon_class);
+   return desk_module;
 }
 
 EAPI int
 e_modapi_shutdown (E_Module * m)
 {
   desk_module = NULL;
+  ecore_event_handler_del(handler);
   e_gadcon_provider_unregister (&_gadcon_class);
   return 1;
 }



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to