kuuko pushed a commit to branch master.

commit df1eecb4a01fde1d5308c7f3b2c6ccdaa388dca7
Author: Kai Huuhko <[email protected]>
Date:   Mon Apr 15 08:31:32 2013 +0000

    Elementary: Add missing callbacks for Window, and change socket_listen
    to raise RuntimeError instead of returning in case of error.
---
 efl/elementary/window.pyx | 41 +++++++++++++++++++++++++++++++++++++----
 1 file changed, 37 insertions(+), 4 deletions(-)

diff --git a/efl/elementary/window.pyx b/efl/elementary/window.pyx
index 4e45b73..3826253 100644
--- a/efl/elementary/window.pyx
+++ b/efl/elementary/window.pyx
@@ -99,6 +99,10 @@ Signals that you can add callbacks for are:
 - "unfullscreen": window has stopped being fullscreen
 - "maximized": window has been maximized
 - "unmaximized": window has stopped being maximized
+- "ioerr": there has been a low-level I/O error with the display system
+- "indicator,prop,changed": an indicator's property has been changed
+- "rotation,changed": window rotation has been changed
+- "profile,changed": profile of the window has been changed
 
 .. _Elm_Win_Type:
 
@@ -1421,7 +1425,7 @@ cdef class Window(Object):
         elm_win_screen_position_get(self.obj, &x, &y)
         return (x, y)
 
-    def socket_listen(self, svcname, svcnum, svcsys):
+    def socket_listen(self, svcname not None, svcnum, svcsys):
         """socket_listen(unicode svcname, int svcnum, bool svcsys)
 
         Create a socket to provide the service for Plug widget
@@ -1436,12 +1440,12 @@ cdef class Window(Object):
             system-wide service all users can connect to, otherwise the
             service is private to the user id that created the service.
         :type svcsys: bool
+        :raise RuntimeError: if the socket could not be created.
 
         """
         if isinstance(svcname, unicode): svcname = svcname.encode("UTF-8")
-        return bool(elm_win_socket_listen(self.obj,
-            <const_char *>svcname if svcname is not None else NULL,
-            svcnum, svcsys))
+        if not elm_win_socket_listen(self.obj, <const_char *>svcname, svcnum, 
svcsys):
+            raise RuntimeError("Could not create a socket.")
 
     property xwindow_xid:
         """Returns the X Window id.
@@ -1580,6 +1584,35 @@ cdef class Window(Object):
     def callback_unmaximized_del(self, func):
         self._callback_del("unmaximized")
 
+    def callback_ioerr_add(self, func, *args, **kwargs):
+        """there has been a low-level I/O error with the display system"""
+        self._callback_add("ioerr", func, *args, **kwargs)
+
+    def callback_ioerr_del(self, func):
+        self._callback_del("ioerr")
+
+    def callback_indicator_prop_changed_add(self, func, *args, **kwargs):
+        """an indicator's property has been changed"""
+        self._callback_add("indicator,prop,changed", func, *args, **kwargs)
+
+    def callback_indicator_prop_changed_del(self, func):
+        self._callback_del("indicator,prop,changed")
+
+    def callback_rotation_changed_add(self, func, *args, **kwargs):
+        """window rotation has been changed"""
+        self._callback_add("rotation,changed", func, *args, **kwargs)
+
+    def callback_rotation_changed_del(self, func):
+        self._callback_del("rotation,changed")
+
+    def callback_profile_changed_add(self, func, *args, **kwargs):
+        """profile of the window has been changed"""
+        self._callback_add("profile,changed", func, *args, **kwargs)
+
+    def callback_profile_changed_del(self, func):
+        self._callback_del("profile,changed")
+
+
 _object_mapping_register("elm_win", Window)
 
 

-- 

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter

Reply via email to