Enlightenment CVS committal

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

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


Modified Files:
        evas.c_evas_object_smart.pxi 


Log Message:
Method to move every children relatively.

This is required so users can override move() and still have a fast
way to move children since it does NOT work to call the parent class!
(it's just the Evas-virtual, not the book-keeping, obj->cur.geometry
is not updated).


===================================================================
RCS file: 
/cvs/e/e17/proto/python-efl/python-evas/evas/evas.c_evas_object_smart.pxi,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- evas.c_evas_object_smart.pxi        8 Oct 2007 15:09:01 -0000       1.21
+++ evas.c_evas_object_smart.pxi        29 Oct 2007 21:07:37 -0000      1.22
@@ -421,14 +421,15 @@
             itr = itr.next
         evas_list_free(lst)
 
-    def move(self, int x, int y):
-        "Default implementation to move all children."
+    def move_children_relative(self, int dx, int dy):
+        "Move all children relatively."
         cdef Evas_List *lst, *itr
         cdef Evas_Object *o
-        cdef int orig_x, orig_y, dx, dy
-        evas_object_geometry_get(self.obj, &orig_x, &orig_y, NULL, NULL)
-        dx = x - orig_x
-        dy = y - orig_y
+        cdef int orig_x, orig_y
+
+        if dx == 0 and dy == 0:
+            return
+
         lst = evas_object_smart_members_get(self.obj)
         itr = lst
         while itr:
@@ -437,6 +438,14 @@
             evas_object_move(o, orig_x + dx, orig_y + dy)
             itr = itr.next
         evas_list_free(lst)
+
+    def move(self, int x, int y):
+        "Default implementation to move all children."
+        cdef int orig_x, orig_y, dx, dy
+        evas_object_geometry_get(self.obj, &orig_x, &orig_y, NULL, NULL)
+        dx = x - orig_x
+        dy = y - orig_y
+        self.move_children_relative(dx, dy)
 
     def resize(self, int w, int h):
         "Virtual method resize(w, h) of SmartObject"



-------------------------------------------------------------------------
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