Enlightenment CVS committal

Author  : barbieri
Project : e17
Module  : proto/python-efl

Dir     : e17/proto/python-efl/python-edje/edje


Modified Files:
        edje.c_edje_object.pxi 
Added Files:
        decorators.py 


Log Message:
Decorators to make development easier, less error prone and more consistent.

===================================================================
RCS file: /cvs/e/e17/proto/python-efl/python-edje/edje/edje.c_edje_object.pxi,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- edje.c_edje_object.pxi      19 Jul 2007 15:06:44 -0000      1.12
+++ edje.c_edje_object.pxi      15 Aug 2007 15:09:09 -0000      1.13
@@ -40,6 +40,19 @@
             traceback.print_exc()
 
 
+cdef _register_decorated_callbacks(obj):
+    for attr_name in dir(obj):
+        attr_value = getattr(obj, attr_name)
+        if callable(attr_value):
+            if hasattr(attr_value, "edje_signal_callback"):
+                emission, source = getattr(attr_value, "edje_signal_callback")
+                obj.signal_callback_add(emission, source, attr_value)
+            elif hasattr(attr_value, "edje_text_change_callback"):
+                obj.text_change_cb_set(attr_value)
+            elif hasattr(attr_value, "edje_message_handler"):
+                obj.message_handler_set(attr_value)
+
+
 class EdjeLoadError(Exception):
     def __init__(self, int code):
         if code == EDJE_LOAD_ERROR_NONE:
@@ -70,6 +83,7 @@
     def _new_obj(self):
         if self.obj == NULL:
             self._set_obj(edje_object_add(self._evas.obj))
+            _register_decorated_callbacks(self)
 
     def _set_common_params(self, file=None, group=None, size=None, pos=None,
                            geometry=None, color=None, name=None):



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to