davemds pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=634c56d14ca142e46f9bcfc380aded081a5ef3be

commit 634c56d14ca142e46f9bcfc380aded081a5ef3be
Author: Dave Andreoli <d...@gurumeditation.it>
Date:   Mon Aug 3 18:16:26 2015 +0200

    New 1.15 API: Window.autohide
---
 doc/elementary/elementary.rst      |  6 ++++++
 efl/elementary/elementary_cdef.pxi |  1 +
 efl/elementary/window.pxi          | 29 +++++++++++++++++++++++++++++
 efl/elementary/window_cdef.pxi     |  2 ++
 4 files changed, 38 insertions(+)

diff --git a/doc/elementary/elementary.rst b/doc/elementary/elementary.rst
index 197ca59..6349fa0 100644
--- a/doc/elementary/elementary.rst
+++ b/doc/elementary/elementary.rst
@@ -115,6 +115,12 @@ Quit policy types
 
     Quit when the application's last window is closed
 
+.. data:: ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN
+
+    Quit when the application's last window is hidden
+    
+    .. versionadded:: 1.15
+
 
 .. _Elm_Policy_Exit:
 
diff --git a/efl/elementary/elementary_cdef.pxi 
b/efl/elementary/elementary_cdef.pxi
index bc1a105..2e3c1cc 100644
--- a/efl/elementary/elementary_cdef.pxi
+++ b/efl/elementary/elementary_cdef.pxi
@@ -66,6 +66,7 @@ cdef extern from "Elementary.h":
     cpdef enum Elm_Policy_Quit:
         ELM_POLICY_QUIT_NONE
         ELM_POLICY_QUIT_LAST_WINDOW_CLOSED
+        ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN
     ctypedef enum Elm_Policy_Quit:
         pass
 
diff --git a/efl/elementary/window.pxi b/efl/elementary/window.pxi
index e57e84c..ae0665f 100644
--- a/efl/elementary/window.pxi
+++ b/efl/elementary/window.pxi
@@ -209,6 +209,35 @@ cdef class Window(Object):
     def autodel_get(self):
         return elm_win_autodel_get(self.obj)
 
+    property autohide:
+        """The window's autohide state.
+
+        This property works similarly to :func:`autodel`, automatically 
handling
+        "delete,request" signals when set to ``True``, with the difference
+        that it will hide the window, instead of destroying it.
+
+        It is specially designed to work together with 
+        ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN which allows exiting Elementary's
+        main loop when all the windows are hidden.
+        
+        .. note:: :func:`autodel` and :func:`autohide` are not mutually 
exclusive.
+                  The window will be deleted if both are set to ``True``.
+
+        :type: bool
+        
+        .. versionadded:: 1.15
+
+        """
+        def __get__(self):
+            return elm_win_autohide_get(self.obj)
+        def __set__(self, autohide):
+            elm_win_autohide_set(self.obj, autohide)
+
+    def autohide_set(self, autohide):
+        elm_win_autohide_set(self.obj, autohide)
+    def autohide_get(self):
+        return elm_win_autohide_get(self.obj)
+
     def activate(self):
         """Activate a window object.
 
diff --git a/efl/elementary/window_cdef.pxi b/efl/elementary/window_cdef.pxi
index bc9caee..2485c46 100644
--- a/efl/elementary/window_cdef.pxi
+++ b/efl/elementary/window_cdef.pxi
@@ -81,6 +81,8 @@ cdef extern from "Elementary.h":
     const Evas_Object       *elm_win_icon_object_get(const Evas_Object*)
     void                     elm_win_autodel_set(Evas_Object *obj, Eina_Bool 
autodel)
     Eina_Bool                elm_win_autodel_get(const Evas_Object *obj)
+    void                     elm_win_autohide_set(Evas_Object *obj, Eina_Bool 
autodel)
+    Eina_Bool                elm_win_autohide_get(const Evas_Object *obj)
     void                     elm_win_activate(Evas_Object *obj)
     void                     elm_win_lower(Evas_Object *obj)
     void                     elm_win_raise(Evas_Object *obj)

-- 


Reply via email to