davemds pushed a commit to branch master.

commit 6873820e957c38d0749e772b38767e992d7eb418
Author: davemds <[email protected]>
Date:   Mon Aug 19 20:49:18 2013 +0200

    PythonEFL: implemented some missed apis in edje
---
 api_coverage.py              |  1 +
 efl/edje/efl.edje.pyx        | 11 ++++++
 efl/edje/efl.edje_object.pxi | 93 +++++++++++++++++++++++++++++++++++++++++++-
 include/efl.edje.pxd         | 17 ++++++++
 4 files changed, 121 insertions(+), 1 deletion(-)

diff --git a/api_coverage.py b/api_coverage.py
index 6b6f714..1e6f2ef 100755
--- a/api_coverage.py
+++ b/api_coverage.py
@@ -15,6 +15,7 @@ c_exclude_list = [
     "evas_gl_", # ditto
     "elm_quicklaunch", # Is quicklaunch relevant for us?
     "emotion_object_extension_may_play_fast_get", # this optimization does not 
work from py
+    "edje_edit_", # edje edit is not there for users to use
 ]
 c_excludes = "|".join(c_exclude_list)
 
diff --git a/efl/edje/efl.edje.pyx b/efl/edje/efl.edje.pyx
index c0a3750..92087df 100644
--- a/efl/edje/efl.edje.pyx
+++ b/efl/edje/efl.edje.pyx
@@ -214,6 +214,17 @@ def collection_cache_get():
 def collection_cache_flush():
     edje_collection_cache_flush()
 
+def scale_set(double scale):
+    edje_scale_set(scale)
+
+def scale_get():
+    return edje_scale_get()
+
+def password_show_last_set(int show_last):
+    edje_password_show_last_set(show_last)
+
+def password_show_last_timeout_set(double timeout):
+    edje_password_show_last_timeout_set(timeout)
 
 def color_class_set(color_class,
                     int r, int g, int b, int a,
diff --git a/efl/edje/efl.edje_object.pxi b/efl/edje/efl.edje_object.pxi
index 555aa56..9f189b6 100644
--- a/efl/edje/efl.edje_object.pxi
+++ b/efl/edje/efl.edje_object.pxi
@@ -276,6 +276,22 @@ cdef class Edje(Object):
         "Thaw (unfreeze) the object."
         return edje_object_thaw(self.obj)
 
+    def preload(self, int cancel):
+        """Preload the images on the Edje Object in the background.
+
+        This function requests the preload of all data images in the 
background.
+        The work is queued before being processed (because there might be other
+        pending requests of this type). It emits the signal "preload,done"
+        when finished.
+
+        :param cancel: *True* will add it the preloading work queue, *False*
+                       will remove it (if it was issued before).
+        :type cancel: bool
+        :rtype: bool
+
+        """
+        return bool(edje_object_preload(self.obj, cancel))
+
     def color_class_set(self, color_class,
                         int r, int g, int b, int a,
                         int r2, int g2, int b2, int a2,
@@ -344,6 +360,32 @@ cdef class Edje(Object):
             <const_char *>font if font is not None else NULL,
             size)
 
+    property scale:
+        """The scaling factor for a given Edje object."""
+        def __set__(self, double scale):
+            edje_object_scale_set(self.obj, scale)
+
+        def __get__(self):
+            return edje_object_scale_get(self.obj)
+
+    cpdef scale_set(self, double scale): 
+        edje_object_scale_set(self.obj, scale)
+    cpdef scale_get(self):
+        return edje_object_scale_get(self.obj)
+
+    property mirrored:
+        """The RTL orientation for this object."""
+        def __set__(self, int rtl):
+            edje_object_mirrored_set(self.obj, rtl)
+
+        def __get__(self):
+            return bool(edje_object_mirrored_get(self.obj))
+
+    def mirrored_set(self, int rtl):
+        edje_object_mirrored_set(self.obj, rtl)
+    def mirrored_get(self):
+        return bool(edje_object_mirrored_get(self.obj))
+    
     def size_min_get(self):
         ":rtype: tuple of int"
         cdef int w, h
@@ -374,11 +416,61 @@ cdef class Edje(Object):
         edje_object_size_min_calc(self.obj, &w, &h)
         return (w, h)
 
+    def size_min_restricted_calc(self, minw, minh):
+        """
+        This call will trigger an internal recalculation of all parts of
+        the object, in order to return its minimum required dimensions for
+        width and height. The user might choose to *impose* those minimum 
sizes,
+        making the resulting calculation to get values equal or bigger than
+        minw and minh, for width and height, respectively.
+ 
+        :note: At the end of this call, the object won't be automatically
+               resized to new dimensions, but just return the calculated
+               sizes. The caller is the one up to change its geometry or not.
+ 
+        :warning: Be advised that invisible parts in the object obj will be
+                  taken into account in this calculation.
+
+        """
+        cdef int w, h
+        edje_object_size_min_restricted_calc(self.obj, &w, &h, minw, minh)
+        return (w, h)
+
     def parts_extends_calc(self):
+        """
+        Calculate the geometry of the region, relative to a given Edje
+        object's area, *occupied by all parts in the object*
+
+        :return: (x, y, w, h)
+        :rtype: tuple of 4 ints
+
+        """
         cdef int x, y, w, h
         edje_object_parts_extends_calc(self.obj, &x, &y, &w, &h)
         return (x, y, w, h)
 
+    property update_hints:
+        """ Edje will automatically update the size hints on itself.
+
+        By default edje doesn't set size hints on itself. With this property
+        set to *True* it will do so. Be carefully, it cost a lot to
+        trigger this feature as it will recalc the object every time it make
+        sense to be sure that's its minimal size hint is always accurate.
+
+        :type: bool
+
+        """
+        def __get__(self):
+            return bool(edje_object_update_hints_get(self.obj))
+
+        def __set__(self, update):
+            edje_object_update_hints_set(self.obj, update)
+
+    def update_hints_get(self):
+        return bool(edje_object_update_hints_get(self.obj))
+    def update_hints_set(self, update):
+        edje_object_update_hints_set(self.obj, update)
+
     def part_exists(self, part):
         ":rtype: bool"
         if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
@@ -473,7 +565,6 @@ cdef class Edje(Object):
         return _ctouni(edje_object_part_text_get(self.obj,
                         <const_char *>part if part is not None else NULL))
 
-
     def part_text_select_all(self, part):
         "Select all the text of the given TEXT or TEXTBLOCK part"
         if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
diff --git a/include/efl.edje.pxd b/include/efl.edje.pxd
index 242c396..9c170fd 100644
--- a/include/efl.edje.pxd
+++ b/include/efl.edje.pxd
@@ -189,6 +189,12 @@ cdef extern from "Edje.h":
     void edje_text_class_del(char *text_class)
     Eina_List * edje_text_class_list()
 
+    void edje_scale_set(double scale)
+    double edje_scale_get()
+
+    void edje_password_show_last_set(Eina_Bool password_show_last)
+    void edje_password_show_last_timeout_set(double password_show_last_timeout)
+    
     void edje_extern_object_min_size_set(Evas_Object *obj, Evas_Coord minw, 
Evas_Coord minh)
     void edje_extern_object_max_size_set(Evas_Object *obj, Evas_Coord maxw, 
Evas_Coord maxh)
     void edje_extern_object_aspect_set(Evas_Object *obj, Edje_Aspect_Control 
aspect, Evas_Coord aw, Evas_Coord ah)
@@ -213,6 +219,16 @@ cdef extern from "Edje.h":
     int edje_object_freeze(Evas_Object *obj)
     int edje_object_thaw(Evas_Object *obj)
 
+    Eina_Bool edje_object_preload(Evas_Object *obj, Eina_Bool cancel)
+    Eina_Bool edje_object_scale_set(Evas_Object *obj, double scale)
+    double edje_object_scale_get(Evas_Object *obj)
+
+    void edje_object_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+    Eina_Bool edje_object_mirrored_get(Evas_Object *obj)
+
+    void edje_object_update_hints_set(Evas_Object *obj, Eina_Bool update)
+    Eina_Bool edje_object_update_hints_get(Evas_Object *obj)
+
     void edje_object_color_class_set(Evas_Object *obj, char *color_class, int 
r, int g, int b, int a, int r2, int g2, int b2, int a2, int r3, int g3, int b3, 
int a3)
     void edje_object_color_class_get(Evas_Object *obj, char *color_class, int 
*r, int *g, int *b, int *a, int *r2, int *g2, int *b2, int *a2, int *r3, int 
*g3, int *b3, int *a3)
     void edje_object_color_class_del(Evas_Object *obj, char *color_class)
@@ -222,6 +238,7 @@ cdef extern from "Edje.h":
     void edje_object_size_max_get(Evas_Object *obj, Evas_Coord *maxw, 
Evas_Coord *maxh)
     void edje_object_calc_force(Evas_Object *obj)
     void edje_object_size_min_calc(Evas_Object *obj, Evas_Coord *minw, 
Evas_Coord *minh)
+    void edje_object_size_min_restricted_calc(Evas_Object *obj, Evas_Coord 
*minw, Evas_Coord *minh, Evas_Coord restrictedw, Evas_Coord restrictedh)
     Eina_Bool edje_object_parts_extends_calc(Evas_Object *obj, Evas_Coord *x, 
Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
 
     int edje_object_part_exists(Evas_Object *obj, char *part)

-- 

------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk

Reply via email to