Enlightenment CVS committal Author : barbieri Project : e17 Module : proto/python-efl
Dir : e17/proto/python-efl/python-ecore/ecore/x Modified Files: __init__.py ecore.x.c_ecore_x.pyx ecore.x.c_ecore_x_window.pxi Added Files: ecore.x.c_ecore_x_events.pxi Log Message: Ecore events support and ecore.x.Window improvements, with examples. ecore now provides event support, it's generic, but types need to be registered with ecore._event_mapping_register(type, class) before they're used. ecore.x was improved to handle almost all events, example were added to examples/x. =================================================================== RCS file: /cvs/e/e17/proto/python-efl/python-ecore/ecore/x/__init__.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- __init__.py 5 Nov 2007 22:52:56 -0000 1.3 +++ __init__.py 12 Nov 2007 01:55:04 -0000 1.4 @@ -121,3 +121,118 @@ ECORE_X_GRAVITY_S = 8 ECORE_X_GRAVITY_SE = 9 ECORE_X_GRAVITY_STATIC = 10 + +ECORE_X_WINDOW_STATE_ICONIFIED = 0 +ECORE_X_WINDOW_STATE_MODAL = 1 +ECORE_X_WINDOW_STATE_STICKY = 2 +ECORE_X_WINDOW_STATE_MAXIMIZED_VERT = 3 +ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ = 4 +ECORE_X_WINDOW_STATE_SHADED = 5 +ECORE_X_WINDOW_STATE_SKIP_TASKBAR = 6 +ECORE_X_WINDOW_STATE_SKIP_PAGER = 7 +ECORE_X_WINDOW_STATE_HIDDEN = 8 +ECORE_X_WINDOW_STATE_FULLSCREEN = 9 +ECORE_X_WINDOW_STATE_ABOVE = 10 +ECORE_X_WINDOW_STATE_BELOW = 11 +ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION = 12 +ECORE_X_WINDOW_STATE_UNKNOWN = 13 + +ECORE_X_WINDOW_STATE_ACTION_REMOVE = 0 +ECORE_X_WINDOW_STATE_ACTION_ADD = 1 +ECORE_X_WINDOW_STATE_ACTION_TOGGLE = 2 + +ECORE_X_WINDOW_STACK_ABOVE = 0 +ECORE_X_WINDOW_STACK_BELOW = 1 +ECORE_X_WINDOW_STACK_TOP_IF = 2 +ECORE_X_WINDOW_STACK_BOTTOM_IF = 3 +ECORE_X_WINDOW_STACK_OPPOSITE = 4 + +ECORE_X_RANDR_ROT_0 = 1 +ECORE_X_RANDR_ROT_90 = 2 +ECORE_X_RANDR_ROT_180 = 4 +ECORE_X_RANDR_ROT_270 = 8, +ECORE_X_RANDR_FLIP_X = 16, +ECORE_X_RANDR_FLIP_Y = 32 + +ECORE_X_SHAPE_BOUNDING = 0 +ECORE_X_SHAPE_CLIP = 1 + +ECORE_X_WM_PROTOCOL_DELETE_REQUEST = 0 +ECORE_X_WM_PROTOCOL_TAKE_FOCUS = 1 +ECORE_X_NET_WM_PROTOCOL_PING = 2 +ECORE_X_NET_WM_PROTOCOL_SYNC_REQUEST = 3 +ECORE_X_WM_PROTOCOL_NUM = 4 + +ECORE_X_WINDOW_INPUT_MODE_NONE = 0 +ECORE_X_WINDOW_INPUT_MODE_PASSIVE = 1 +ECORE_X_WINDOW_INPUT_MODE_ACTIVE_LOCAL = 2 +ECORE_X_WINDOW_INPUT_MODE_ACTIVE_GLOBAL = 3 + +ECORE_X_WINDOW_STATE_HINT_NONE = -1 +ECORE_X_WINDOW_STATE_HINT_WITHDRAWN = 0 +ECORE_X_WINDOW_STATE_HINT_NORMAL = 1 +ECORE_X_WINDOW_STATE_HINT_ICONIC = 2 + +ECORE_X_WINDOW_TYPE_DESKTOP = 0 +ECORE_X_WINDOW_TYPE_DOCK = 1 +ECORE_X_WINDOW_TYPE_TOOLBAR = 2 +ECORE_X_WINDOW_TYPE_MENU = 3 +ECORE_X_WINDOW_TYPE_UTILITY = 4 +ECORE_X_WINDOW_TYPE_SPLASH = 5 +ECORE_X_WINDOW_TYPE_DIALOG = 6 +ECORE_X_WINDOW_TYPE_NORMAL = 7 +ECORE_X_WINDOW_TYPE_UNKNOWN = 8 + +ECORE_X_ACTION_MOVE = 0 +ECORE_X_ACTION_RESIZE = 1 +ECORE_X_ACTION_MINIMIZE = 2 +ECORE_X_ACTION_SHADE = 3 +ECORE_X_ACTION_STICK = 4 +ECORE_X_ACTION_MAXIMIZE_HORZ = 5 +ECORE_X_ACTION_MAXIMIZE_VERT = 6 +ECORE_X_ACTION_FULLSCREEN = 7 +ECORE_X_ACTION_CHANGE_DESKTOP = 8 +ECORE_X_ACTION_CLOSE = 9 + +ECORE_X_WINDOW_CONFIGURE_MASK_X = 1 +ECORE_X_WINDOW_CONFIGURE_MASK_Y = 2 +ECORE_X_WINDOW_CONFIGURE_MASK_W = 4 +ECORE_X_WINDOW_CONFIGURE_MASK_H = 8 +ECORE_X_WINDOW_CONFIGURE_MASK_BORDER_WIDTH = 16 +ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING = 32 +ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE = 64 + +ECORE_X_WINDOW_LAYER_BELOW = 2 +ECORE_X_WINDOW_LAYER_NORMAL = 4 +ECORE_X_WINDOW_LAYER_ABOVE = 6 + +ECORE_X_PROP_LIST_REMOVE = 0 +ECORE_X_PROP_LIST_ADD = 1 +ECORE_X_PROP_LIST_TOGGLE = 2 + +ECORE_X_MWM_HINT_FUNC_ALL = 1 +ECORE_X_MWM_HINT_FUNC_RESIZE = 2 +ECORE_X_MWM_HINT_FUNC_MOVE = 4 +ECORE_X_MWM_HINT_FUNC_MINIMIZE = 8 +ECORE_X_MWM_HINT_FUNC_MAXIMIZE = 16 +ECORE_X_MWM_HINT_FUNC_CLOSE = 32 + +ECORE_X_MWM_HINT_DECOR_ALL = 1 +ECORE_X_MWM_HINT_DECOR_BORDER = 2 +ECORE_X_MWM_HINT_DECOR_RESIZEH = 4 +ECORE_X_MWM_HINT_DECOR_TITLE = 8 +ECORE_X_MWM_HINT_DECOR_MENU = 16 +ECORE_X_MWM_HINT_DECOR_MINIMIZE = 32 +ECORE_X_MWM_HINT_DECOR_MAXIMIZE = 64 + +ECORE_X_MWM_HINT_INPUT_MODELESS = 0 +ECORE_X_MWM_HINT_INPUT_PRIMARY_APPLICATION_MODAL = 1 +ECORE_X_MWM_HINT_INPUT_SYSTEM_MODAL = 2 +ECORE_X_MWM_HINT_INPUT_FULL_APPLICATION_MODAL = 3 + +ECORE_X_DAMAGE_REPORT_RAW_RECTANGLES = 0 +ECORE_X_DAMAGE_REPORT_DELTA_RECTANGLES = 1 +ECORE_X_DAMAGE_REPORT_BOUNDING_BOX = 2 +ECORE_X_DAMAGE_REPORT_NON_EMPTY = 3 + +init() =================================================================== RCS file: /cvs/e/e17/proto/python-efl/python-ecore/ecore/x/ecore.x.c_ecore_x.pyx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ecore.x.c_ecore_x.pyx 5 Nov 2007 21:50:55 -0000 1.1 +++ ecore.x.c_ecore_x.pyx 12 Nov 2007 01:55:04 -0000 1.2 @@ -12,11 +12,14 @@ @rtype: int """ cdef char *s + cdef int i if name is None: s = NULL else: s = name - return ecore_x_init(s) + i = ecore_x_init(s) + x_events_register() + return i def shutdown(): @@ -213,3 +216,4 @@ include "ecore.x.c_ecore_x_window.pxi" +include "ecore.x.c_ecore_x_events.pxi" =================================================================== RCS file: /cvs/e/e17/proto/python-efl/python-ecore/ecore/x/ecore.x.c_ecore_x_window.pxi,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ecore.x.c_ecore_x_window.pxi 5 Nov 2007 21:50:55 -0000 1.1 +++ ecore.x.c_ecore_x_window.pxi 12 Nov 2007 01:55:04 -0000 1.2 @@ -42,6 +42,42 @@ raise ValueError("object already wraps an X Window.") return 0 + def __str__(self): + cdef int x, y, w, h, visible + cdef unsigned int parent + + ecore_x_window_geometry_get(self.xid, &x, &y, &w, &h) + parent = ecore_x_window_parent_get(self.xid) + visible = ecore_x_window_visible_get(self.xid) + return "%s(xid=%#x, parent=%#x, x=%d, y=%d, w=%d, h=%d, visible=%s)" % \ + (self.__class__.__name__, self.xid, parent, x, y, w, h, + bool(visible)) + + def __repr__(self): + cdef int x, y, w, h + cdef unsigned int parent + + ecore_x_window_geometry_get(self.xid, &x, &y, &w, &h) + parent = ecore_x_window_parent_get(self.xid) + return "%s(%#x, xid=%#x, parent=%#x, x=%d, y=%d, w=%d, h=%d)" % \ + (self.__class__.__name__, <unsigned long>self, + self.xid, parent, x, y, w, h) + + def __richcmp__(self, other, int op): + if op == 2: # equal + if self is other: + return 1 + else: + return self.xid == int(other) + else: + return 0 + + def __int__(self): + return self.xid + + def __long__(self): + return self.xid + def delete(self): "Deletes the current window." if self.xid != 0: @@ -304,16 +340,18 @@ def background_color_set(self, int r, int g, int b): """Set background color. - @parm r: red - @parm g: green - @parm b: blue + @parm r: red (0...65536, 16 bits) + @parm g: green (0...65536, 16 bits) + @parm b: blue (0...65536, 16 bits) """ ecore_x_window_background_color_set(self.xid, r, g, b) def area_clear(self, int x, int y, int w, int h): + "Paints the specified area with background's color or pixmap." ecore_x_window_area_clear(self.xid, x, y, w, h) def area_expose(self, int x, int y, int w, int h): + "Like L{area_clear()}, but generates exposures." ecore_x_window_area_expose(self.xid, x, y, w, h) def override_set(self, int setting): @@ -341,6 +379,7 @@ """Create a Python wrapper for given window id. @parm xid: window id. + @rtype: L{Window} """ cdef Window w w = Window.__new__(Window) ------------------------------------------------------------------------- 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