Enlightenment CVS committal

Author  : lordchaos
Project : e17
Module  : proto

Dir     : e17/proto/entropy/src/plugins


Modified Files:
        layout_etk_simple.c 


Log Message:
* Window reference counting

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/proto/entropy/src/plugins/layout_etk_simple.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- layout_etk_simple.c 5 Mar 2006 05:42:37 -0000       1.25
+++ layout_etk_simple.c 5 Mar 2006 10:11:53 -0000       1.26
@@ -10,6 +10,9 @@
 
 //This is here mostly as a demo of the "widget library independence" of 
entropy, but is on hold
 //for the moment until ETK supports more widgets that we need
+//
+
+static int _etk_layout_window_count = 0;
 
 typedef struct entropy_layout_gui entropy_layout_gui;
 struct entropy_layout_gui
@@ -46,9 +49,18 @@
 static Etk_Bool
 _etk_window_deleted_cb (Etk_Object * object, void *data)
 {
-  entropy_core *core = (entropy_core *) data;
+  entropy_gui_component_instance* instance = data;
+       
+  /*Decrement window reference counter*/
+  _etk_layout_window_count--;
+
+  /*TODO - destroy this layout object, and deregister for events*/
 
-  layout_etk_simple_quit(core);
+  etk_object_destroy(ETK_OBJECT(instance->gui_object));
+  
+  if (_etk_layout_window_count == 0) {
+         layout_etk_simple_quit(instance->core);
+  }
 
   return ETK_TRUE;
 }
@@ -266,12 +278,13 @@
 
   /*Etk related init */
   window = etk_window_new ();
+  layout->gui_object = window;
   etk_signal_connect("key_down", ETK_OBJECT(window), 
ETK_CALLBACK(_entropy_etk_layout_key_down_cb), layout);
   
   gui->paned = etk_hpaned_new();
 
   etk_signal_connect ("delete_event", ETK_OBJECT (window),
-                     ETK_CALLBACK (_etk_window_deleted_cb), core);
+                     ETK_CALLBACK (_etk_window_deleted_cb), layout);
 
   etk_window_title_set(ETK_WINDOW(window), "Entropy");
   etk_window_wmclass_set(ETK_WINDOW(window), "entropy", "Entropy");
@@ -401,5 +414,8 @@
      
   etk_widget_show_all (window);
 
+  /*Increment the window counter*/
+  _etk_layout_window_count++;
+
   return layout;
 }




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to