diff --git a/doc/ecore/ecore.rst b/doc/ecore/ecore.rst index e208150..f675f33 100644 --- a/doc/ecore/ecore.rst +++ b/doc/ecore/ecore.rst @@ -89,6 +89,7 @@ API Reference :maxdepth: 4 ecore_module + x timer animator poller diff --git a/doc/ecore/x.rst b/doc/ecore/x.rst new file mode 100644 index 0000000..b369834 --- /dev/null +++ b/doc/ecore/x.rst @@ -0,0 +1,8 @@ +:mod:`efl.ecore.x` Module +-------------------------- + +.. automodule:: efl.ecore.x + +.. inheritance-diagram:: + efl.ecore.x + :parts: 2 diff --git a/efl/ecore/__init__.pxd b/efl/ecore/__init__.pxd index 29758c1..2516ab3 100644 --- a/efl/ecore/__init__.pxd +++ b/efl/ecore/__init__.pxd @@ -346,3 +346,6 @@ cdef class FileMonitor: cdef readonly object kargs cdef object _exec_monitor(self, Ecore_File_Event event, const char *path) + +cdef object _event_mapping_register(int type, cls) +cdef object _event_mapping_unregister(int type) diff --git a/efl/ecore/efl.ecore_events.pxi b/efl/ecore/efl.ecore_events.pxi index 5e55edc..1320f9a 100644 --- a/efl/ecore/efl.ecore_events.pxi +++ b/efl/ecore/efl.ecore_events.pxi @@ -18,7 +18,7 @@ cdef object _event_type_mapping = dict() -def _event_mapping_register(int type, cls): +cdef object _event_mapping_register(int type, cls): if type in _event_type_mapping: raise ValueError("event type '%d' already registered." % type) if not issubclass(cls, Event): @@ -26,7 +26,7 @@ def _event_mapping_register(int type, cls): _event_type_mapping[type] = cls -def _event_mapping_unregister(int type): +cdef object _event_mapping_unregister(int type): _event_type_mapping.pop(type) diff --git a/efl/ecore/x.pxd b/efl/ecore/x.pxd new file mode 100644 index 0000000..12dd83b --- /dev/null +++ b/efl/ecore/x.pxd @@ -0,0 +1,1612 @@ +# Copyright (C) 2007-2014 various contributors (see AUTHORS) +# +# This file is part of Python-EFL. +# +# Python-EFL is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 3 of the License, or (at your option) any later version. +# +# Python-EFL is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this Python-EFL. If not, see . + +cdef extern from "sys/types.h": + ctypedef long pid_t + +cdef extern from "Eina.h": + ctypedef unsigned char Eina_Bool + +cdef extern from "Ecore_Input.h": + int ECORE_EVENT_KEY_DOWN + int ECORE_EVENT_KEY_UP + int ECORE_EVENT_MOUSE_BUTTON_DOWN + int ECORE_EVENT_MOUSE_BUTTON_UP + int ECORE_EVENT_MOUSE_MOVE + int ECORE_EVENT_MOUSE_IN + int ECORE_EVENT_MOUSE_OUT + int ECORE_EVENT_MOUSE_WHEEL + + ctypedef void *Ecore_Window + + ctypedef struct _Ecore_Point: + int x + int y + + ctypedef struct Ecore_Event_Key: + char *keyname + char *key + char *string + char *compose + Ecore_Window window + Ecore_Window root_window + Ecore_Window event_window + unsigned int timestamp + unsigned int modifiers + int same_screen + + + ctypedef struct Ecore_Event_Mouse_Button: + Ecore_Window window + Ecore_Window root_window + Ecore_Window event_window + unsigned int timestamp + unsigned int modifiers + unsigned int buttons + unsigned int double_click + unsigned int triple_click + int same_screen + int x + int y + _Ecore_Point root + + + ctypedef struct Ecore_Event_Mouse_Move: + Ecore_Window window + Ecore_Window root_window + Ecore_Window event_window + unsigned int timestamp + unsigned int modifiers + int same_screen + int x + int y + _Ecore_Point root + + + ctypedef struct Ecore_Event_Mouse_IO: + Ecore_Window window + Ecore_Window event_window + unsigned int timestamp + unsigned int modifiers + int x + int y + + + ctypedef struct Ecore_Event_Mouse_Wheel: + Ecore_Window window + Ecore_Window root_window + Ecore_Window event_window + unsigned int timestamp + unsigned int modifiers + int same_screen + int direction + int z + int x + int y + _Ecore_Point root + + +cdef extern from "Ecore_X.h": + #################################################################### + # Data Types + # + ctypedef unsigned int Ecore_X_ID + ctypedef Ecore_X_ID Ecore_X_Window + ctypedef void *Ecore_X_Visual + ctypedef Ecore_X_ID Ecore_X_Pixmap + ctypedef Ecore_X_ID Ecore_X_Drawable + ctypedef void *Ecore_X_GC + ctypedef Ecore_X_ID Ecore_X_Atom + ctypedef Ecore_X_ID Ecore_X_Colormap + ctypedef Ecore_X_ID Ecore_X_Time + ctypedef Ecore_X_ID Ecore_X_Cursor + ctypedef void Ecore_X_Display + ctypedef void Ecore_X_Connection + ctypedef void Ecore_X_Screen + ctypedef Ecore_X_ID Ecore_X_Sync_Counter + ctypedef Ecore_X_ID Ecore_X_Sync_Alarm + ctypedef unsigned short Ecore_X_Randr_Size_ID + + ctypedef struct Ecore_X_Rectangle: + int x + int y + unsigned int width + unsigned int height + + ctypedef struct Ecore_X_Icon: + unsigned int width + unsigned int height + unsigned int *data + + ctypedef enum Ecore_X_Randr_Orientation: + ECORE_X_RANDR_ORIENTATION_ROT_0 + ECORE_X_RANDR_ORIENTATION_ROT_90 + ECORE_X_RANDR_ORIENTATION_ROT_180 + ECORE_X_RANDR_ORIENTATION_ROT_270 + ECORE_X_RANDR_ORIENTATION_FLIP_X + ECORE_X_RANDR_ORIENTATION_FLIP_Y + + ctypedef enum Ecore_X_Render_Subpixel_Order: + ECORE_X_RENDER_SUBPIXEL_ORDER_UNKNOWN + ECORE_X_RENDER_SUBPIXEL_ORDER_HORIZONTAL_RGB + ECORE_X_RENDER_SUBPIXEL_ORDER_HORIZONTAL_BGR + ECORE_X_RENDER_SUBPIXEL_ORDER_VERTICAL_RGB + ECORE_X_RENDER_SUBPIXEL_ORDER_VERTICAL_BGR + ECORE_X_RENDER_SUBPIXEL_ORDER_NONE + + ctypedef enum Ecore_X_Window_State: + ECORE_X_WINDOW_STATE_UNKNOWN + ECORE_X_WINDOW_STATE_ICONIFIED + ECORE_X_WINDOW_STATE_MODAL + ECORE_X_WINDOW_STATE_STICKY + ECORE_X_WINDOW_STATE_MAXIMIZED_VERT + ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ + ECORE_X_WINDOW_STATE_SHADED + ECORE_X_WINDOW_STATE_SKIP_TASKBAR + ECORE_X_WINDOW_STATE_SKIP_PAGER + ECORE_X_WINDOW_STATE_HIDDEN + ECORE_X_WINDOW_STATE_FULLSCREEN + ECORE_X_WINDOW_STATE_ABOVE + ECORE_X_WINDOW_STATE_BELOW + ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION + + ctypedef enum Ecore_X_Window_State_Action: + ECORE_X_WINDOW_STATE_ACTION_REMOVE + ECORE_X_WINDOW_STATE_ACTION_ADD + ECORE_X_WINDOW_STATE_ACTION_TOGGLE + + ctypedef enum Ecore_X_Window_Stack_Mode: + ECORE_X_WINDOW_STACK_ABOVE + ECORE_X_WINDOW_STACK_BELOW + ECORE_X_WINDOW_STACK_TOP_IF + ECORE_X_WINDOW_STACK_BOTTOM_IF + ECORE_X_WINDOW_STACK_OPPOSITE + + ctypedef enum Ecore_X_Randr_Rotation: + ECORE_X_RANDR_ROT_0 + ECORE_X_RANDR_ROT_90 + ECORE_X_RANDR_ROT_180 + ECORE_X_RANDR_ROT_270 + ECORE_X_RANDR_FLIP_X + ECORE_X_RANDR_FLIP_Y + + char *ECORE_X_SELECTION_TARGET_TARGETS + char *ECORE_X_SELECTION_TARGET_TEXT + char *ECORE_X_SELECTION_TARGET_COMPOUND_TEXT + char *ECORE_X_SELECTION_TARGET_STRING + char *ECORE_X_SELECTION_TARGET_UTF8_STRING + char *ECORE_X_SELECTION_TARGET_FILENAME + + int ECORE_X_DND_VERSION + + Ecore_X_Atom ECORE_X_DND_ACTION_COPY + Ecore_X_Atom ECORE_X_DND_ACTION_MOVE + Ecore_X_Atom ECORE_X_DND_ACTION_LINK + Ecore_X_Atom ECORE_X_DND_ACTION_ASK + Ecore_X_Atom ECORE_X_DND_ACTION_PRIVATE + + ctypedef enum Ecore_X_Selection: + ECORE_X_SELECTION_PRIMARY + ECORE_X_SELECTION_SECONDARY + ECORE_X_SELECTION_XDND + ECORE_X_SELECTION_CLIPBOARD + + ctypedef enum Ecore_X_Event_Mode: + ECORE_X_EVENT_MODE_NORMAL + ECORE_X_EVENT_MODE_WHILE_GRABBED + ECORE_X_EVENT_MODE_GRAB + ECORE_X_EVENT_MODE_UNGRAB + + ctypedef enum Ecore_X_Event_Detail: + ECORE_X_EVENT_DETAIL_ANCESTOR + ECORE_X_EVENT_DETAIL_VIRTUAL + ECORE_X_EVENT_DETAIL_INFERIOR + ECORE_X_EVENT_DETAIL_NON_LINEAR + ECORE_X_EVENT_DETAIL_NON_LINEAR_VIRTUAL + ECORE_X_EVENT_DETAIL_POINTER + ECORE_X_EVENT_DETAIL_POINTER_ROOT + ECORE_X_EVENT_DETAIL_DETAIL_NONE + + ctypedef enum Ecore_X_Event_Mask: + ECORE_X_EVENT_MASK_NONE + ECORE_X_EVENT_MASK_KEY_DOWN + ECORE_X_EVENT_MASK_KEY_UP + ECORE_X_EVENT_MASK_MOUSE_DOWN + ECORE_X_EVENT_MASK_MOUSE_UP + ECORE_X_EVENT_MASK_MOUSE_IN + ECORE_X_EVENT_MASK_MOUSE_OUT + ECORE_X_EVENT_MASK_MOUSE_MOVE + ECORE_X_EVENT_MASK_WINDOW_DAMAGE + ECORE_X_EVENT_MASK_WINDOW_VISIBILITY + ECORE_X_EVENT_MASK_WINDOW_CONFIGURE + ECORE_X_EVENT_MASK_WINDOW_RESIZE_MANAGE + ECORE_X_EVENT_MASK_WINDOW_MANAGE + ECORE_X_EVENT_MASK_WINDOW_CHILD_CONFIGURE + ECORE_X_EVENT_MASK_WINDOW_FOCUS_CHANGE + ECORE_X_EVENT_MASK_WINDOW_PROPERTY + ECORE_X_EVENT_MASK_WINDOW_COLORMAP + ECORE_X_EVENT_MASK_WINDOW_GRAB + ECORE_X_EVENT_MASK_MOUSE_WHEEL + ECORE_X_EVENT_MASK_WINDOW_FOCUS_IN + ECORE_X_EVENT_MASK_WINDOW_FOCUS_OUT + + ctypedef enum Ecore_X_Gravity: + ECORE_X_GRAVITY_FORGET + ECORE_X_GRAVITY_UNMAP + ECORE_X_GRAVITY_NW + ECORE_X_GRAVITY_N + ECORE_X_GRAVITY_NE + ECORE_X_GRAVITY_W + ECORE_X_GRAVITY_CENTER + ECORE_X_GRAVITY_E + ECORE_X_GRAVITY_SW + ECORE_X_GRAVITY_S + ECORE_X_GRAVITY_SE + ECORE_X_GRAVITY_STATIC + + ctypedef enum Ecore_X_Shape_Type: + ECORE_X_SHAPE_BOUNDING + ECORE_X_SHAPE_CLIP + + ctypedef struct Ecore_X_Event_Window_Focus_In: + Ecore_X_Window win + Ecore_X_Event_Mode mode + Ecore_X_Event_Detail detail + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Window_Focus_Out: + Ecore_X_Window win + Ecore_X_Event_Mode mode + Ecore_X_Event_Detail detail + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Window_Keymap: + Ecore_X_Window win + + + ctypedef struct Ecore_X_Event_Window_Damage: + Ecore_X_Window win + int x + int y + int w + int h + int count + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Window_Visibility_Change: + Ecore_X_Window win + int fully_obscured + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Window_Create: + Ecore_X_Window win + int override + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Window_Destroy: + Ecore_X_Window win + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Window_Hide: + Ecore_X_Window win + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Window_Show: + Ecore_X_Window win + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Window_Show_Request: + Ecore_X_Window win + Ecore_X_Window parent + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Window_Reparent: + Ecore_X_Window win + Ecore_X_Window parent + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Window_Configure: + Ecore_X_Window win + Ecore_X_Window abovewin + int x + int y + int w + int h + int border + unsigned int override + unsigned int from_wm + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Window_Configure_Request: + Ecore_X_Window win + Ecore_X_Window abovewin + int x + int y + int w + int h + int border + Ecore_X_Window_Stack_Mode detail + unsigned long value_mask + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Window_Gravity: + Ecore_X_Window win + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Window_Resize_Request: + Ecore_X_Window win + int w + int h + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Window_Stack: + Ecore_X_Window win + Ecore_X_Window event_win + Ecore_X_Window_Stack_Mode detail + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Window_Stack_Request: + Ecore_X_Window win + Ecore_X_Window parent + Ecore_X_Window_Stack_Mode detail + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Window_Property: + Ecore_X_Window win + Ecore_X_Atom atom + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Window_Colormap: + Ecore_X_Window win + Ecore_X_Colormap cmap + int installed + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Selection_Clear: + Ecore_X_Window win + Ecore_X_Selection selection + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Selection_Request: + Ecore_X_Window owner + Ecore_X_Window requestor + Ecore_X_Time time + Ecore_X_Atom selection + Ecore_X_Atom target + Ecore_X_Atom property + + + ctypedef struct Ecore_X_Event_Selection_Notify: + Ecore_X_Window win + Ecore_X_Time time + Ecore_X_Selection selection + char *target + void *data + + + ctypedef enum _Ecore_X_Selection_Data_Content: + ECORE_X_SELECTION_CONTENT_NONE + ECORE_X_SELECTION_CONTENT_TEXT + ECORE_X_SELECTION_CONTENT_FILES + ECORE_X_SELECTION_CONTENT_TARGETS + ECORE_X_SELECTION_CONTENT_CUSTOM + + + ctypedef struct Ecore_X_Selection_Data: + _Ecore_X_Selection_Data_Content content + unsigned char *data + int length + int format + int (*free)(void *data) + + + ctypedef struct Ecore_X_Selection_Data_Files: + Ecore_X_Selection_Data data + char **files + int num_files + + + ctypedef struct Ecore_X_Selection_Data_Text: + Ecore_X_Selection_Data data + char *text + + + ctypedef struct Ecore_X_Selection_Data_Targets: + Ecore_X_Selection_Data data + char **targets + int num_targets + + + ctypedef struct Ecore_X_Event_Xdnd_Enter: + Ecore_X_Window win + Ecore_X_Window source + char **types + int num_types + + + ctypedef struct Ecore_X_Event_Xdnd_Position: + Ecore_X_Window win + Ecore_X_Window source + _Ecore_Point position + Ecore_X_Atom action + + + ctypedef struct Ecore_X_Event_Xdnd_Status: + Ecore_X_Window win + Ecore_X_Window target + int will_accept + Ecore_X_Rectangle rectangle + Ecore_X_Atom action + + + ctypedef struct Ecore_X_Event_Xdnd_Leave: + Ecore_X_Window win + Ecore_X_Window source + + + ctypedef struct Ecore_X_Event_Xdnd_Drop: + Ecore_X_Window win + Ecore_X_Window source + Ecore_X_Atom action + _Ecore_Point position + + + ctypedef struct Ecore_X_Event_Xdnd_Finished: + Ecore_X_Window win + Ecore_X_Window target + int completed + Ecore_X_Atom action + + + ctypedef union _Ecore_X_Event_Client_Message_Data: + char b[20] + short s[10] + long l[5] + + ctypedef struct Ecore_X_Event_Client_Message: + Ecore_X_Window win + Ecore_X_Atom message_type + int format + _Ecore_X_Event_Client_Message_Data data + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Window_Shape: + Ecore_X_Window win + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Screensaver_Notify: + Ecore_X_Window win + int on + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Sync_Counter: + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Sync_Alarm: + Ecore_X_Time time + Ecore_X_Sync_Alarm alarm + + + ctypedef struct Ecore_X_Randr_Screen_Size_MM: + int width + int height + int width_mm + int height_mm + + + ctypedef struct Ecore_X_Event_Screen_Change: + Ecore_X_Window win + Ecore_X_Window root + Ecore_X_Randr_Screen_Size_MM size + Ecore_X_Time time + Ecore_X_Time config_time + Ecore_X_Randr_Orientation orientation + Ecore_X_Render_Subpixel_Order subpixel_order + Ecore_X_Randr_Size_ID size_id + + + ctypedef struct Ecore_X_Event_Window_Delete_Request: + Ecore_X_Window win + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Startup_Sequence: + Ecore_X_Window win + + + ctypedef struct Ecore_X_Event_Window_Move_Resize_Request: + Ecore_X_Window win + int x + int y + int direction + int button + int source + + + ctypedef struct Ecore_X_Event_Window_State_Request: + Ecore_X_Window win + Ecore_X_Window_State_Action action + Ecore_X_Window_State state[2] + int source + + + ctypedef struct Ecore_X_Event_Frame_Extents_Request: + Ecore_X_Window win + + + ctypedef struct Ecore_X_Event_Ping: + Ecore_X_Window win + Ecore_X_Window event_win + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Desktop_Change: + Ecore_X_Window win + unsigned int desk + int source + + + ctypedef struct Ecore_X_Event_Startup_Sequence: + Ecore_X_Window win + + + ctypedef struct Ecore_X_Event_Window_Move_Resize_Request: + Ecore_X_Window win + int x + int y + int direction + int button + int source + + + ctypedef struct Ecore_X_Event_Window_State_Request: + Ecore_X_Window win + Ecore_X_Window_State_Action action + Ecore_X_Window_State state[2] + int source + + + ctypedef struct Ecore_X_Event_Frame_Extents_Request: + Ecore_X_Window win + + + ctypedef struct Ecore_X_Event_Ping: + Ecore_X_Window win + Ecore_X_Window event_win + Ecore_X_Time time + + + ctypedef struct Ecore_X_Event_Desktop_Change: + Ecore_X_Window win + unsigned int desk + int source + + int ECORE_X_EVENT_MOUSE_IN + int ECORE_X_EVENT_MOUSE_OUT + int ECORE_X_EVENT_WINDOW_FOCUS_IN + int ECORE_X_EVENT_WINDOW_FOCUS_OUT + int ECORE_X_EVENT_WINDOW_KEYMAP + int ECORE_X_EVENT_WINDOW_DAMAGE + int ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE + int ECORE_X_EVENT_WINDOW_CREATE + int ECORE_X_EVENT_WINDOW_DESTROY + int ECORE_X_EVENT_WINDOW_HIDE + int ECORE_X_EVENT_WINDOW_SHOW + int ECORE_X_EVENT_WINDOW_SHOW_REQUEST + int ECORE_X_EVENT_WINDOW_REPARENT + int ECORE_X_EVENT_WINDOW_CONFIGURE + int ECORE_X_EVENT_WINDOW_CONFIGURE_REQUEST + int ECORE_X_EVENT_WINDOW_GRAVITY + int ECORE_X_EVENT_WINDOW_RESIZE_REQUEST + int ECORE_X_EVENT_WINDOW_STACK + int ECORE_X_EVENT_WINDOW_STACK_REQUEST + int ECORE_X_EVENT_WINDOW_PROPERTY + int ECORE_X_EVENT_WINDOW_COLORMAP + int ECORE_X_EVENT_WINDOW_MAPPING + int ECORE_X_EVENT_SELECTION_CLEAR + int ECORE_X_EVENT_SELECTION_REQUEST + int ECORE_X_EVENT_SELECTION_NOTIFY + int ECORE_X_EVENT_CLIENT_MESSAGE + int ECORE_X_EVENT_WINDOW_SHAPE + int ECORE_X_EVENT_SCREENSAVER_NOTIFY + int ECORE_X_EVENT_SYNC_COUNTER + int ECORE_X_EVENT_SYNC_ALARM + int ECORE_X_EVENT_SCREEN_CHANGE + int ECORE_X_EVENT_RANDR_CRTC_CHANGE + int ECORE_X_EVENT_RANDR_OUTPUT_CHANGE + int ECORE_X_EVENT_RANDR_OUTPUT_PROPERTY_NOTIFY + int ECORE_X_EVENT_DAMAGE_NOTIFY + + int ECORE_X_EVENT_WINDOW_DELETE_REQUEST + + int ECORE_X_EVENT_WINDOW_MOVE_RESIZE_REQUEST + int ECORE_X_EVENT_WINDOW_STATE_REQUEST + int ECORE_X_EVENT_FRAME_EXTENTS_REQUEST + int ECORE_X_EVENT_PING + int ECORE_X_EVENT_DESKTOP_CHANGE + + int ECORE_X_EVENT_STARTUP_SEQUENCE_NEW + int ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE + int ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE + + int ECORE_X_EVENT_XDND_ENTER + int ECORE_X_EVENT_XDND_POSITION + int ECORE_X_EVENT_XDND_STATUS + int ECORE_X_EVENT_XDND_LEAVE + int ECORE_X_EVENT_XDND_DROP + int ECORE_X_EVENT_XDND_FINISHED + + int ECORE_X_MODIFIER_SHIFT + int ECORE_X_MODIFIER_CTRL + int ECORE_X_MODIFIER_ALT + int ECORE_X_MODIFIER_WIN + + int ECORE_X_LOCK_SCROLL + int ECORE_X_LOCK_NUM + int ECORE_X_LOCK_CAPS + + ctypedef enum Ecore_X_WM_Protocol: + ECORE_X_WM_PROTOCOL_DELETE_REQUEST + ECORE_X_WM_PROTOCOL_TAKE_FOCUS + ECORE_X_NET_WM_PROTOCOL_PING + ECORE_X_NET_WM_PROTOCOL_SYNC_REQUEST + ECORE_X_WM_PROTOCOL_NUM + + ctypedef enum Ecore_X_Window_Input_Mode: + ECORE_X_WINDOW_INPUT_MODE_NONE + ECORE_X_WINDOW_INPUT_MODE_PASSIVE + ECORE_X_WINDOW_INPUT_MODE_ACTIVE_LOCAL + ECORE_X_WINDOW_INPUT_MODE_ACTIVE_GLOBAL + + ctypedef enum Ecore_X_Window_State_Hint: + ECORE_X_WINDOW_STATE_HINT_NONE + ECORE_X_WINDOW_STATE_HINT_WITHDRAWN + ECORE_X_WINDOW_STATE_HINT_NORMAL + ECORE_X_WINDOW_STATE_HINT_ICONIC + + ctypedef enum Ecore_X_Window_Type: + ECORE_X_WINDOW_TYPE_UNKNOWN + ECORE_X_WINDOW_TYPE_DESKTOP + ECORE_X_WINDOW_TYPE_DOCK + ECORE_X_WINDOW_TYPE_TOOLBAR + ECORE_X_WINDOW_TYPE_MENU + ECORE_X_WINDOW_TYPE_UTILITY + ECORE_X_WINDOW_TYPE_SPLASH + ECORE_X_WINDOW_TYPE_DIALOG + ECORE_X_WINDOW_TYPE_NORMAL + + ctypedef enum Ecore_X_Action: + ECORE_X_ACTION_MOVE + ECORE_X_ACTION_RESIZE + ECORE_X_ACTION_MINIMIZE + ECORE_X_ACTION_SHADE + ECORE_X_ACTION_STICK + ECORE_X_ACTION_MAXIMIZE_HORZ + ECORE_X_ACTION_MAXIMIZE_VERT + ECORE_X_ACTION_FULLSCREEN + ECORE_X_ACTION_CHANGE_DESKTOP + ECORE_X_ACTION_CLOSE + + ctypedef enum Ecore_X_Window_Configure_Mask: + ECORE_X_WINDOW_CONFIGURE_MASK_X + ECORE_X_WINDOW_CONFIGURE_MASK_Y + ECORE_X_WINDOW_CONFIGURE_MASK_W + ECORE_X_WINDOW_CONFIGURE_MASK_H + ECORE_X_WINDOW_CONFIGURE_MASK_BORDER_WIDTH + ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING + ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE + + int ECORE_X_WINDOW_LAYER_BELOW + int ECORE_X_WINDOW_LAYER_NORMAL + int ECORE_X_WINDOW_LAYER_ABOVE + int ECORE_X_PROP_LIST_REMOVE + int ECORE_X_PROP_LIST_ADD + int ECORE_X_PROP_LIST_TOGGLE + + ctypedef enum Ecore_X_MWM_Hint_Func: + ECORE_X_MWM_HINT_FUNC_ALL + ECORE_X_MWM_HINT_FUNC_RESIZE + ECORE_X_MWM_HINT_FUNC_MOVE + ECORE_X_MWM_HINT_FUNC_MINIMIZE + ECORE_X_MWM_HINT_FUNC_MAXIMIZE + ECORE_X_MWM_HINT_FUNC_CLOSE + + ctypedef enum Ecore_X_MWM_Hint_Decor: + ECORE_X_MWM_HINT_DECOR_ALL + ECORE_X_MWM_HINT_DECOR_BORDER + ECORE_X_MWM_HINT_DECOR_RESIZEH + ECORE_X_MWM_HINT_DECOR_TITLE + ECORE_X_MWM_HINT_DECOR_MENU + ECORE_X_MWM_HINT_DECOR_MINIMIZE + ECORE_X_MWM_HINT_DECOR_MAXIMIZE + + ctypedef enum Ecore_X_MWM_Hint_Input: + ECORE_X_MWM_HINT_INPUT_MODELESS + ECORE_X_MWM_HINT_INPUT_PRIMARY_APPLICATION_MODAL + ECORE_X_MWM_HINT_INPUT_SYSTEM_MODAL + ECORE_X_MWM_HINT_INPUT_FULL_APPLICATION_MODAL + + ctypedef struct _Ecore_X_Window_Attributes_Event_Mask: + Ecore_X_Event_Mask mine + Ecore_X_Event_Mask all + Ecore_X_Event_Mask no_propagate + + ctypedef struct Ecore_X_Window_Attributes: + Ecore_X_Window root + int x + int y + int w + int h + int border + int depth + unsigned char visible + unsigned char viewable + unsigned char override + unsigned char input_only + unsigned char save_under + _Ecore_X_Window_Attributes_Event_Mask event_mask + Ecore_X_Gravity window_gravity + Ecore_X_Gravity pixel_gravity + Ecore_X_Colormap colormap + Ecore_X_Visual visual + + ctypedef struct Ecore_X_Screen_Size: + int width + int height + + ctypedef struct Ecore_X_Screen_Refresh_Rate: + int rate + + ctypedef Ecore_X_ID Ecore_X_Picture + ctypedef Ecore_X_ID Ecore_X_Region + ctypedef enum Ecore_X_Region_Type: + ECORE_X_REGION_BOUNDING + ECORE_X_REGION_CLIP + + ctypedef Ecore_X_ID Ecore_X_Picture + ctypedef Ecore_X_ID Ecore_X_Region + ctypedef enum Ecore_X_Region_Type: + ECORE_X_REGION_BOUNDING + ECORE_X_REGION_CLIP + + ctypedef Ecore_X_ID Ecore_X_Damage + + ctypedef enum Ecore_X_Damage_Report_Level: + ECORE_X_DAMAGE_REPORT_RAW_RECTANGLES + ECORE_X_DAMAGE_REPORT_DELTA_RECTANGLES + ECORE_X_DAMAGE_REPORT_BOUNDING_BOX + ECORE_X_DAMAGE_REPORT_NON_EMPTY + + ctypedef struct Ecore_X_Event_Damage: + Ecore_X_Damage_Report_Level level + Ecore_X_Drawable drawable + Ecore_X_Damage damage + int more + Ecore_X_Time time + Ecore_X_Rectangle area + Ecore_X_Rectangle geometry + + + #################################################################### + # Functions + # + int ecore_x_init(char *name) + int ecore_x_shutdown() + int ecore_x_disconnect() + Ecore_X_Display *ecore_x_display_get() + Ecore_X_Connection *ecore_x_connection_get() + int ecore_x_fd_get() + Ecore_X_Screen *ecore_x_default_screen_get() + void ecore_x_double_click_time_set(double t) + double ecore_x_double_click_time_get() + void ecore_x_flush() + void ecore_x_sync() + void ecore_x_killall(Ecore_X_Window root) + void ecore_x_kill(Ecore_X_Window win) + + Ecore_X_Time ecore_x_current_time_get() + + void ecore_x_error_handler_set(void (*func) (void *data), void *data) + void ecore_x_io_error_handler_set(void (*func) (void *data), void *data) + int ecore_x_error_request_get() + int ecore_x_error_code_get() + + void ecore_x_event_mask_set(Ecore_X_Window w, Ecore_X_Event_Mask mask) + void ecore_x_event_mask_unset(Ecore_X_Window w, Ecore_X_Event_Mask mask) + + int ecore_x_selection_notify_send(Ecore_X_Window requestor, Ecore_X_Atom selection, Ecore_X_Atom target, Ecore_X_Atom property, Ecore_X_Time time) + void ecore_x_selection_primary_prefetch() + void ecore_x_selection_primary_fetch() + int ecore_x_selection_primary_set(Ecore_X_Window w, void *data, int size) + int ecore_x_selection_primary_clear() + void ecore_x_selection_secondary_prefetch() + void ecore_x_selection_secondary_fetch() + int ecore_x_selection_secondary_set(Ecore_X_Window w, void *data, int size) + int ecore_x_selection_secondary_clear() + void ecore_x_selection_xdnd_prefetch() + void ecore_x_selection_xdnd_fetch() + int ecore_x_selection_xdnd_set(Ecore_X_Window w, void *data, int size) + int ecore_x_selection_xdnd_clear() + void ecore_x_selection_clipboard_prefetch() + void ecore_x_selection_clipboard_fetch() + int ecore_x_selection_clipboard_set(Ecore_X_Window w, void *data, int size) + int ecore_x_selection_clipboard_clear() + void ecore_x_selection_primary_request(Ecore_X_Window w, char *target) + void ecore_x_selection_secondary_request(Ecore_X_Window w, char *target) + void ecore_x_selection_xdnd_request(Ecore_X_Window w, char *target) + void ecore_x_selection_clipboard_request(Ecore_X_Window w, char *target) + int ecore_x_selection_convert(Ecore_X_Atom selection, Ecore_X_Atom target, void **data_ret) + void ecore_x_selection_converter_add(char *target, int (*func)(char *target, void *data, int size, void **data_ret, int *size_ret)) + void ecore_x_selection_converter_atom_add(Ecore_X_Atom target, int (*func)(char *target, void *data, int size, void **data_ret, int *size_ret)) + void ecore_x_selection_converter_del(char *target) + void ecore_x_selection_converter_atom_del(Ecore_X_Atom target) + void ecore_x_selection_parser_add(char *target, void *(*func)(char *target, void *data, int size, int format)) + void ecore_x_selection_parser_del(char *target) + + void ecore_x_dnd_aware_set(Ecore_X_Window win, int on) + void ecore_x_dnd_version_get_prefetch(Ecore_X_Window window) + void ecore_x_dnd_version_get_fetch() + int ecore_x_dnd_version_get(Ecore_X_Window win) + void ecore_x_dnd_type_get_prefetch(Ecore_X_Window window) + void ecore_x_dnd_type_get_fetch() + int ecore_x_dnd_type_isset(Ecore_X_Window win, char *type) + void ecore_x_dnd_type_set(Ecore_X_Window win, char *type, int on) + void ecore_x_dnd_types_set(Ecore_X_Window win, char **types, unsigned int num_types) + void ecore_x_dnd_actions_set(Ecore_X_Window win, Ecore_X_Atom *actions, unsigned int num_actions) + void ecore_x_dnd_begin_prefetch(Ecore_X_Window source) + void ecore_x_dnd_begin_fetch() + int ecore_x_dnd_begin(Ecore_X_Window source, unsigned char *data, int size) + int ecore_x_dnd_drop() + void ecore_x_dnd_send_status(int will_accept, int suppress, Ecore_X_Rectangle rectangle, Ecore_X_Atom action) + void ecore_x_dnd_send_finished() + + Ecore_X_Window ecore_x_window_new(Ecore_X_Window parent, int x, int y, int w, int h) + Ecore_X_Window ecore_x_window_override_new(Ecore_X_Window parent, int x, int y, int w, int h) + int ecore_x_window_argb_get(Ecore_X_Window win) + Ecore_X_Window ecore_x_window_manager_argb_new(Ecore_X_Window parent, int x, int y, int w, int h) + Ecore_X_Window ecore_x_window_argb_new(Ecore_X_Window parent, int x, int y, int w, int h) + Ecore_X_Window ecore_x_window_override_argb_new(Ecore_X_Window parent, int x, int y, int w, int h) + Ecore_X_Window ecore_x_window_input_new(Ecore_X_Window parent, int x, int y, int w, int h) + void ecore_x_window_configure(Ecore_X_Window win, Ecore_X_Window_Configure_Mask mask, int x, int y, int w, int h, int border_width, Ecore_X_Window sibling, int stack_mode) + void ecore_x_window_cursor_set(Ecore_X_Window win, Ecore_X_Cursor c) + void ecore_x_window_free(Ecore_X_Window win) + void ecore_x_window_ignore_set(Ecore_X_Window win, int ignore) + Ecore_X_Window *ecore_x_window_ignore_list(int *num) + + void ecore_x_window_delete_request_send(Ecore_X_Window win) + void ecore_x_window_show(Ecore_X_Window win) + void ecore_x_window_hide(Ecore_X_Window win) + void ecore_x_window_move(Ecore_X_Window win, int x, int y) + void ecore_x_window_resize(Ecore_X_Window win, int w, int h) + void ecore_x_window_move_resize(Ecore_X_Window win, int x, int y, int w, int h) + void ecore_x_window_focus(Ecore_X_Window win) + void ecore_x_window_focus_at_time(Ecore_X_Window win, Ecore_X_Time t) + void ecore_x_get_input_focus_prefetch() + void ecore_x_get_input_focus_fetch() + Ecore_X_Window ecore_x_window_focus_get() + void ecore_x_window_raise(Ecore_X_Window win) + void ecore_x_window_lower(Ecore_X_Window win) + void ecore_x_window_reparent(Ecore_X_Window win, Ecore_X_Window new_parent, int x, int y) + void ecore_x_window_size_get(Ecore_X_Window win, int *w, int *h) + void ecore_x_window_geometry_get(Ecore_X_Window win, int *x, int *y, int *w, int *h) + int ecore_x_window_border_width_get(Ecore_X_Window win) + void ecore_x_window_border_width_set(Ecore_X_Window win, int width) + int ecore_x_window_depth_get(Ecore_X_Window win) + void ecore_x_window_cursor_show(Ecore_X_Window win, int show) + void ecore_x_window_defaults_set(Ecore_X_Window win) + int ecore_x_window_visible_get(Ecore_X_Window win) + Ecore_X_Window ecore_x_window_shadow_tree_at_xy_with_skip_get(Ecore_X_Window base, int x, int y, Ecore_X_Window *skip, int skip_num) + void ecore_x_window_shadow_tree_flush() + Ecore_X_Window ecore_x_window_root_get(Ecore_X_Window win) + Ecore_X_Window ecore_x_window_at_xy_get(int x, int y) + Ecore_X_Window ecore_x_window_at_xy_with_skip_get(int x, int y, Ecore_X_Window *skip, int skip_num) + Ecore_X_Window ecore_x_window_at_xy_begin_get(Ecore_X_Window begin, int x, int y) + void ecore_x_query_tree_prefetch(Ecore_X_Window window) + void ecore_x_query_tree_fetch() + Ecore_X_Window ecore_x_window_parent_get(Ecore_X_Window win) + + void ecore_x_window_background_color_set(Ecore_X_Window win, unsigned short r, unsigned short g, unsigned short b) + void ecore_x_window_gravity_set(Ecore_X_Window win, Ecore_X_Gravity grav) + void ecore_x_window_pixel_gravity_set(Ecore_X_Window win, Ecore_X_Gravity grav) + void ecore_x_window_pixmap_set(Ecore_X_Window win, Ecore_X_Pixmap pmap) + void ecore_x_window_area_clear(Ecore_X_Window win, int x, int y, int w, int h) + void ecore_x_window_area_expose(Ecore_X_Window win, int x, int y, int w, int h) + void ecore_x_window_override_set(Ecore_X_Window win, int override) + + void ecore_x_window_prop_card32_set(Ecore_X_Window win, Ecore_X_Atom atom, unsigned int *val, unsigned int num) + void ecore_x_window_prop_card32_get_prefetch(Ecore_X_Window window, Ecore_X_Atom atom) + void ecore_x_window_prop_card32_get_fetch() + int ecore_x_window_prop_card32_get(Ecore_X_Window win, Ecore_X_Atom atom, unsigned int *val, unsigned int len) + int ecore_x_window_prop_card32_list_get(Ecore_X_Window win, Ecore_X_Atom atom, unsigned int **plst) + + void ecore_x_window_prop_xid_set(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom type, Ecore_X_ID * lst, unsigned int num) + void ecore_x_window_prop_xid_get_prefetch(Ecore_X_Window window, Ecore_X_Atom atom, Ecore_X_Atom type) + void ecore_x_window_prop_xid_get_fetch() + int ecore_x_window_prop_xid_get(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom type, Ecore_X_ID * lst, unsigned int len) + int ecore_x_window_prop_xid_list_get(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom type, Ecore_X_ID ** plst) + void ecore_x_window_prop_xid_list_change(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom type, Ecore_X_ID item, int op) + void ecore_x_window_prop_atom_set(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom * val, unsigned int num) + void ecore_x_window_prop_atom_get_prefetch(Ecore_X_Window window, Ecore_X_Atom atom) + void ecore_x_window_prop_atom_get_fetch() + int ecore_x_window_prop_atom_get(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom * val, unsigned int len) + int ecore_x_window_prop_atom_list_get(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom ** plst) + void ecore_x_window_prop_atom_list_change(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom item, int op) + void ecore_x_window_prop_window_set(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Window * val, unsigned int num) + void ecore_x_window_prop_window_get_prefetch(Ecore_X_Window window, Ecore_X_Atom atom) + void ecore_x_window_prop_window_get_fetch() + int ecore_x_window_prop_window_get(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Window * val, unsigned int len) + int ecore_x_window_prop_window_list_get(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Window ** plst) + + Ecore_X_Atom ecore_x_window_prop_any_type() + void ecore_x_window_prop_property_set(Ecore_X_Window win, Ecore_X_Atom type, Ecore_X_Atom format, int size, void *data, int number) + void ecore_x_window_prop_property_get_prefetch(Ecore_X_Window window, Ecore_X_Atom property, Ecore_X_Atom type) + void ecore_x_window_prop_property_get_fetch() + int ecore_x_window_prop_property_get(Ecore_X_Window win, Ecore_X_Atom property, Ecore_X_Atom type, int size, unsigned char **data, int *num) + void ecore_x_window_prop_property_del(Ecore_X_Window win, Ecore_X_Atom property) + void ecore_x_window_prop_list_prefetch(Ecore_X_Window window) + void ecore_x_window_prop_list_fetch() + Ecore_X_Atom *ecore_x_window_prop_list(Ecore_X_Window win, int *num_ret) + void ecore_x_window_prop_string_set(Ecore_X_Window win, Ecore_X_Atom type, char *str) + void ecore_x_window_prop_string_get_prefetch(Ecore_X_Window window, Ecore_X_Atom type) + void ecore_x_window_prop_string_get_fetch() + char *ecore_x_window_prop_string_get(Ecore_X_Window win, Ecore_X_Atom type) + int ecore_x_window_prop_protocol_isset(Ecore_X_Window win, Ecore_X_WM_Protocol protocol) + Ecore_X_WM_Protocol *ecore_x_window_prop_protocol_list_get(Ecore_X_Window win, int *num_ret) + + void ecore_x_window_shape_mask_set(Ecore_X_Window win, Ecore_X_Pixmap mask) + void ecore_x_window_shape_window_set(Ecore_X_Window win, Ecore_X_Window shape_win) + void ecore_x_window_shape_window_set_xy(Ecore_X_Window win, Ecore_X_Window shape_win, int x, int y) + void ecore_x_window_shape_rectangle_set(Ecore_X_Window win, int x, int y, int w, int h) + void ecore_x_window_shape_rectangles_set(Ecore_X_Window win, Ecore_X_Rectangle *rects, int num) + void ecore_x_window_shape_window_add(Ecore_X_Window win, Ecore_X_Window shape_win) + void ecore_x_window_shape_window_add_xy(Ecore_X_Window win, Ecore_X_Window shape_win, int x, int y) + void ecore_x_window_shape_rectangle_add(Ecore_X_Window win, int x, int y, int w, int h) + void ecore_x_window_shape_rectangle_clip(Ecore_X_Window win, int x, int y, int w, int h) + void ecore_x_window_shape_rectangles_add(Ecore_X_Window win, Ecore_X_Rectangle *rects, int num) + void ecore_x_window_shape_rectangles_get_prefetch(Ecore_X_Window window) + void ecore_x_window_shape_rectangles_get_fetch() + Ecore_X_Rectangle *ecore_x_window_shape_rectangles_get(Ecore_X_Window win, int *num_ret) + void ecore_x_window_shape_events_select(Ecore_X_Window win, int on) + + Ecore_X_Pixmap ecore_x_pixmap_new(Ecore_X_Window win, int w, int h, int dep) + void ecore_x_pixmap_del(Ecore_X_Pixmap pmap) + void ecore_x_pixmap_paste(Ecore_X_Pixmap pmap, Ecore_X_Drawable dest, Ecore_X_GC gc, int sx, int sy, int w, int h, int dx, int dy) + void ecore_x_pixmap_geometry_get(Ecore_X_Pixmap pmap, int *x, int *y, int *w, int *h) + int ecore_x_pixmap_depth_get(Ecore_X_Pixmap pmap) + + Ecore_X_GC ecore_x_gc_new(Ecore_X_Drawable draw) + void ecore_x_gc_del(Ecore_X_GC gc) + + int ecore_x_client_message32_send(Ecore_X_Window win, Ecore_X_Atom type, Ecore_X_Event_Mask mask, long d0, long d1, long d2, long d3, long d4) + int ecore_x_client_message8_send(Ecore_X_Window win, Ecore_X_Atom type, void *data, int len) + int ecore_x_mouse_move_send(Ecore_X_Window win, int x, int y) + int ecore_x_mouse_down_send(Ecore_X_Window win, int x, int y, int b) + int ecore_x_mouse_up_send(Ecore_X_Window win, int x, int y, int b) + + void ecore_x_drawable_geometry_get_prefetch(Ecore_X_Drawable drawable) + void ecore_x_drawable_geometry_get_fetch() + void ecore_x_drawable_geometry_get(Ecore_X_Drawable d, int *x, int *y, int *w, int *h) + int ecore_x_drawable_border_width_get(Ecore_X_Drawable d) + int ecore_x_drawable_depth_get(Ecore_X_Drawable d) + + int ecore_x_cursor_color_supported_get() + Ecore_X_Cursor ecore_x_cursor_new(Ecore_X_Window win, int *pixels, int w, int h, int hot_x, int hot_y) + void ecore_x_cursor_free(Ecore_X_Cursor c) + Ecore_X_Cursor ecore_x_cursor_shape_get(int shape) + void ecore_x_cursor_size_set(int size) + int ecore_x_cursor_size_get() + + Ecore_X_Window *ecore_x_window_root_list(int *num_ret) + Ecore_X_Window ecore_x_window_root_first_get() + int ecore_x_window_manage(Ecore_X_Window win) + void ecore_x_window_container_manage(Ecore_X_Window win) + void ecore_x_window_client_manage(Ecore_X_Window win) + void ecore_x_window_sniff(Ecore_X_Window win) + void ecore_x_window_client_sniff(Ecore_X_Window win) + void ecore_x_atom_get_prefetch(char *name) + void ecore_x_atom_get_fetch() + Ecore_X_Atom ecore_x_atom_get(char *name) + + void ecore_x_icccm_init() + void ecore_x_icccm_state_set(Ecore_X_Window win, Ecore_X_Window_State_Hint state) + Ecore_X_Window_State_Hint ecore_x_icccm_state_get(Ecore_X_Window win) + void ecore_x_icccm_delete_window_send(Ecore_X_Window win, Ecore_X_Time t) + void ecore_x_icccm_take_focus_send(Ecore_X_Window win, Ecore_X_Time t) + void ecore_x_icccm_save_yourself_send(Ecore_X_Window win, Ecore_X_Time t) + void ecore_x_icccm_move_resize_send(Ecore_X_Window win, int x, int y, int w, int h) + void ecore_x_icccm_hints_set(Ecore_X_Window win, int accepts_focus, Ecore_X_Window_State_Hint initial_state, Ecore_X_Pixmap icon_pixmap, Ecore_X_Pixmap icon_mask, Ecore_X_Window icon_window, Ecore_X_Window window_group, int is_urgent) + int ecore_x_icccm_hints_get(Ecore_X_Window win, Eina_Bool *accepts_focus, Ecore_X_Window_State_Hint *initial_state, Ecore_X_Pixmap *icon_pixmap, Ecore_X_Pixmap *icon_mask, Ecore_X_Window *icon_window, Ecore_X_Window *window_group, Eina_Bool *is_urgent) + void ecore_x_icccm_size_pos_hints_set(Ecore_X_Window win, int request_pos, Ecore_X_Gravity gravity, int min_w, int min_h, int max_w, int max_h, int base_w, int base_h, int step_x, int step_y, double min_aspect, double max_aspect) + int ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win, int *request_pos, Ecore_X_Gravity *gravity, int *min_w, int *min_h, int *max_w, int *max_h, int *base_w, int *base_h, int *step_x, int *step_y, double *min_aspect, double *max_aspect) + void ecore_x_icccm_title_set(Ecore_X_Window win, char *t) + char *ecore_x_icccm_title_get(Ecore_X_Window win) + void ecore_x_icccm_protocol_set(Ecore_X_Window win, Ecore_X_WM_Protocol protocol, int on) + int ecore_x_icccm_protocol_isset(Ecore_X_Window win, Ecore_X_WM_Protocol protocol) + void ecore_x_icccm_name_class_set(Ecore_X_Window win, char *n, char *c) + void ecore_x_icccm_name_class_get(Ecore_X_Window win, char **n, char **c) + char *ecore_x_icccm_client_machine_get(Ecore_X_Window win) + void ecore_x_icccm_command_set(Ecore_X_Window win, int argc, char **argv) + void ecore_x_icccm_command_get(Ecore_X_Window win, int *argc, char ***argv) + char *ecore_x_icccm_icon_name_get(Ecore_X_Window win) + void ecore_x_icccm_icon_name_set(Ecore_X_Window win, char *t) + void ecore_x_icccm_colormap_window_set(Ecore_X_Window win, Ecore_X_Window subwin) + void ecore_x_icccm_colormap_window_unset(Ecore_X_Window win, Ecore_X_Window subwin) + void ecore_x_icccm_transient_for_set(Ecore_X_Window win, Ecore_X_Window forwin) + void ecore_x_icccm_transient_for_unset(Ecore_X_Window win) + Ecore_X_Window ecore_x_icccm_transient_for_get(Ecore_X_Window win) + void ecore_x_icccm_window_role_set(Ecore_X_Window win, char *role) + char *ecore_x_icccm_window_role_get(Ecore_X_Window win) + void ecore_x_icccm_client_leader_set(Ecore_X_Window win, Ecore_X_Window l) + Ecore_X_Window ecore_x_icccm_client_leader_get(Ecore_X_Window win) + void ecore_x_icccm_iconic_request_send(Ecore_X_Window win, Ecore_X_Window root) + + void ecore_x_mwm_hints_get_prefetch(Ecore_X_Window window) + void ecore_x_mwm_hints_get_fetch() + int ecore_x_mwm_hints_get(Ecore_X_Window win, Ecore_X_MWM_Hint_Func *fhint, Ecore_X_MWM_Hint_Decor *dhint, Ecore_X_MWM_Hint_Input *ihint) + void ecore_x_mwm_borderless_set(Ecore_X_Window win, int borderless) + + void ecore_x_netwm_init() + void ecore_x_netwm_shutdown() + void ecore_x_netwm_wm_identify(Ecore_X_Window root, Ecore_X_Window check, char *wm_name) + void ecore_x_netwm_supported_set(Ecore_X_Window root, Ecore_X_Atom *supported, int num) + void ecore_x_netwm_supported_get_prefetch(Ecore_X_Window root) + void ecore_x_netwm_supported_get_fetch() + int ecore_x_netwm_supported_get(Ecore_X_Window root, Ecore_X_Atom **supported, int *num) + void ecore_x_netwm_desk_count_set(Ecore_X_Window root, unsigned int n_desks) + void ecore_x_netwm_desk_roots_set(Ecore_X_Window root, Ecore_X_Window *vroots, unsigned int n_desks) + void ecore_x_netwm_desk_names_set(Ecore_X_Window root, char **names, unsigned int n_desks) + void ecore_x_netwm_desk_size_set(Ecore_X_Window root, unsigned int width, unsigned int height) + void ecore_x_netwm_desk_workareas_set(Ecore_X_Window root, unsigned int *areas, unsigned int n_desks) + void ecore_x_netwm_desk_current_set(Ecore_X_Window root, unsigned int desk) + void ecore_x_netwm_desk_viewports_set(Ecore_X_Window root, unsigned int *origins, unsigned int n_desks) + void ecore_x_netwm_desk_layout_set(Ecore_X_Window root, int orientation, int columns, int rows, int starting_corner) + void ecore_x_netwm_showing_desktop_set(Ecore_X_Window root, int on) + void ecore_x_netwm_client_list_set(Ecore_X_Window root, Ecore_X_Window *p_clients, unsigned int n_clients) + void ecore_x_netwm_client_list_stacking_set(Ecore_X_Window root, Ecore_X_Window *p_clients, unsigned int n_clients) + void ecore_x_netwm_client_active_set(Ecore_X_Window root, Ecore_X_Window win) + void ecore_x_netwm_name_set(Ecore_X_Window win, char *name) + void ecore_x_netwm_name_get_prefetch(Ecore_X_Window window) + void ecore_x_netwm_name_get_fetch() + int ecore_x_netwm_name_get(Ecore_X_Window win, char **name) + void ecore_x_netwm_startup_id_set(Ecore_X_Window win, char *id) + void ecore_x_netwm_startup_id_get_prefetch(Ecore_X_Window window) + void ecore_x_netwm_startup_id_get_fetch() + int ecore_x_netwm_startup_id_get(Ecore_X_Window win, char **id) + void ecore_x_netwm_visible_name_set(Ecore_X_Window win, char *name) + void ecore_x_netwm_visible_name_get_prefetch(Ecore_X_Window window) + void ecore_x_netwm_visible_name_get_fetch() + int ecore_x_netwm_visible_name_get(Ecore_X_Window win, char **name) + void ecore_x_netwm_icon_name_set(Ecore_X_Window win, char *name) + void ecore_x_netwm_icon_name_get_prefetch(Ecore_X_Window window) + void ecore_x_netwm_icon_name_get_fetch() + int ecore_x_netwm_icon_name_get(Ecore_X_Window win, char **name) + void ecore_x_netwm_visible_icon_name_set(Ecore_X_Window win, char *name) + void ecore_x_netwm_visible_icon_name_get_prefetch(Ecore_X_Window window) + void ecore_x_netwm_visible_icon_name_get_fetch() + int ecore_x_netwm_visible_icon_name_get(Ecore_X_Window win, char **name) + void ecore_x_netwm_desktop_set(Ecore_X_Window win, unsigned int desk) + void ecore_x_netwm_desktop_get_prefetch(Ecore_X_Window window) + void ecore_x_netwm_desktop_get_fetch() + int ecore_x_netwm_desktop_get(Ecore_X_Window win, unsigned int *desk) + void ecore_x_netwm_strut_set(Ecore_X_Window win, int left, int right, int top, int bottom) + void ecore_x_netwm_strut_get_prefetch(Ecore_X_Window window) + void ecore_x_netwm_strut_get_fetch() + int ecore_x_netwm_strut_get(Ecore_X_Window win, int *left, int *right, int *top, int *bottom) + void ecore_x_netwm_strut_partial_set(Ecore_X_Window win, int left, int right, int top, int bottom, int left_start_y, int left_end_y, int right_start_y, int right_end_y, int top_start_x, int top_end_x, int bottom_start_x, int bottom_end_x) + void ecore_x_netwm_strut_partial_get_prefetch(Ecore_X_Window window) + void ecore_x_netwm_strut_partial_get_fetch() + int ecore_x_netwm_strut_partial_get(Ecore_X_Window win, int *left, int *right, int *top, int *bottom, int *left_start_y, int *left_end_y, int *right_start_y, int *right_end_y, int *top_start_x, int *top_end_x, int *bottom_start_x, int *bottom_end_x) + void ecore_x_netwm_icons_get_prefetch(Ecore_X_Window window) + void ecore_x_netwm_icons_get_fetch() + int ecore_x_netwm_icons_get(Ecore_X_Window win, Ecore_X_Icon **icon, int *num) + void ecore_x_netwm_icon_geometry_set(Ecore_X_Window win, int x, int y, int width, int height) + void ecore_x_netwm_icon_geometry_get_prefetch(Ecore_X_Window window) + void ecore_x_netwm_icon_geometry_get_fetch() + int ecore_x_netwm_icon_geometry_get(Ecore_X_Window win, int *x, int *y, int *width, int *height) + void ecore_x_netwm_pid_set(Ecore_X_Window win, int pid) + void ecore_x_netwm_pid_get_prefetch(Ecore_X_Window window) + void ecore_x_netwm_pid_get_fetch() + int ecore_x_netwm_pid_get(Ecore_X_Window win, int *pid) + void ecore_x_netwm_handled_icons_set(Ecore_X_Window win) + void ecore_x_netwm_handled_icons_get_prefetch(Ecore_X_Window window) + void ecore_x_netwm_handled_icons_get_fetch() + int ecore_x_netwm_handled_icons_get(Ecore_X_Window win) + void ecore_x_netwm_user_time_set(Ecore_X_Window win, unsigned int time) + void ecore_x_netwm_user_time_get_prefetch(Ecore_X_Window window) + void ecore_x_netwm_user_time_get_fetch() + int ecore_x_netwm_user_time_get(Ecore_X_Window win, unsigned int *time) + void ecore_x_netwm_window_state_set(Ecore_X_Window win, Ecore_X_Window_State *state, unsigned int num) + void ecore_x_netwm_window_state_get_prefetch(Ecore_X_Window window) + void ecore_x_netwm_window_state_get_fetch() + int ecore_x_netwm_window_state_get(Ecore_X_Window win, Ecore_X_Window_State **state, unsigned int *num) + void ecore_x_netwm_window_type_set(Ecore_X_Window win, Ecore_X_Window_Type type) + void ecore_x_netwm_window_type_get_prefetch(Ecore_X_Window window) + void ecore_x_netwm_window_type_get_fetch() + int ecore_x_netwm_window_type_get(Ecore_X_Window win, Ecore_X_Window_Type *type) + int ecore_x_netwm_allowed_action_isset(Ecore_X_Window win, Ecore_X_Action action) + void ecore_x_netwm_allowed_action_set(Ecore_X_Window win, Ecore_X_Action *action, unsigned int num) + void ecore_x_netwm_allowed_action_get_prefetch(Ecore_X_Window window) + void ecore_x_netwm_allowed_action_get_fetch() + int ecore_x_netwm_allowed_action_get(Ecore_X_Window win, Ecore_X_Action **action, unsigned int *num) + void ecore_x_netwm_opacity_set(Ecore_X_Window win, unsigned int opacity) + void ecore_x_netwm_opacity_get_prefetch(Ecore_X_Window window) + void ecore_x_netwm_opacity_get_fetch() + int ecore_x_netwm_opacity_get(Ecore_X_Window win, unsigned int *opacity) + void ecore_x_netwm_frame_size_set(Ecore_X_Window win, int fl, int fr, int ft, int fb) + void ecore_x_netwm_frame_size_get_prefetch(Ecore_X_Window window) + void ecore_x_netwm_frame_size_get_fetch() + int ecore_x_netwm_frame_size_get(Ecore_X_Window win, int *fl, int *fr, int *ft, int *fb) + void ecore_x_netwm_sync_counter_get_prefetch(Ecore_X_Window window) + void ecore_x_netwm_sync_counter_get_fetch() + int ecore_x_netwm_sync_counter_get(Ecore_X_Window win, Ecore_X_Sync_Counter *counter) + void ecore_x_netwm_ping_send(Ecore_X_Window win) + void ecore_x_netwm_sync_request_send(Ecore_X_Window win, unsigned int serial) + void ecore_x_netwm_state_request_send(Ecore_X_Window win, Ecore_X_Window root, Ecore_X_Window_State s1, Ecore_X_Window_State s2, int set) + void ecore_x_netwm_desktop_request_send(Ecore_X_Window win, Ecore_X_Window root, unsigned int desktop) + + void ecore_x_e_init() + void ecore_x_e_frame_size_set(Ecore_X_Window win, int fl, int fr, int ft, int fb) + + void ecore_x_xinerama_query_screens_prefetch() + void ecore_x_xinerama_query_screens_fetch() + int ecore_x_xinerama_screen_count_get() + int ecore_x_xinerama_screen_geometry_get(int screen, int *x, int *y, int *w, int *h) + + void ecore_x_get_window_attributes_prefetch(Ecore_X_Window window) + void ecore_x_get_window_attributes_fetch() + int ecore_x_window_attributes_get(Ecore_X_Window win, Ecore_X_Window_Attributes *att_ret) + void ecore_x_window_save_set_add(Ecore_X_Window win) + void ecore_x_window_save_set_del(Ecore_X_Window win) + Ecore_X_Window *ecore_x_window_children_get(Ecore_X_Window win, int *num) + + int ecore_x_pointer_control_set(int accel_num, int accel_denom, int threshold) + void ecore_x_pointer_control_get_prefetch() + void ecore_x_pointer_control_get_fetch() + int ecore_x_pointer_control_get(int *accel_num, int *accel_denom, int *threshold) + int ecore_x_pointer_grab(Ecore_X_Window win) + int ecore_x_pointer_confine_grab(Ecore_X_Window win) + void ecore_x_pointer_ungrab() + int ecore_x_pointer_warp(Ecore_X_Window win, int x, int y) + int ecore_x_keyboard_grab(Ecore_X_Window win) + void ecore_x_keyboard_ungrab() + void ecore_x_grab() + void ecore_x_ungrab() + void ecore_x_passive_grab_replay_func_set(int (*func) (void *data, int event_type, void *event), void *data) + void ecore_x_window_button_grab(Ecore_X_Window win, int button, Ecore_X_Event_Mask event_mask, int mod, int any_mod) + void ecore_x_window_button_ungrab(Ecore_X_Window win, int button, int mod, int any_mod) + void ecore_x_window_key_grab(Ecore_X_Window win, char *key, int mod, int any_mod) + void ecore_x_window_key_ungrab(Ecore_X_Window win, char *key, int mod, int any_mod) + + void ecore_x_focus_reset() + void ecore_x_events_allow_all() + void ecore_x_pointer_last_xy_get(int *x, int *y) + void ecore_x_pointer_xy_get_prefetch(Ecore_X_Window window) + void ecore_x_pointer_xy_get_fetch() + void ecore_x_pointer_xy_get(Ecore_X_Window win, int *x, int *y) + + Ecore_X_Sync_Alarm ecore_x_sync_alarm_new(Ecore_X_Sync_Counter counter) + int ecore_x_sync_alarm_free(Ecore_X_Sync_Alarm alarm) + + int ecore_x_randr_events_select(Ecore_X_Window win, int on) + void ecore_x_randr_get_screen_info_prefetch(Ecore_X_Window window) + void ecore_x_randr_get_screen_info_fetch() + Ecore_X_Randr_Rotation ecore_x_randr_screen_rotations_get(Ecore_X_Window root) + Ecore_X_Randr_Rotation ecore_x_randr_screen_rotation_get(Ecore_X_Window root) + void ecore_x_randr_screen_rotation_set(Ecore_X_Window root, Ecore_X_Randr_Rotation rot) + Ecore_X_Screen_Size *ecore_x_randr_screen_sizes_get(Ecore_X_Window root, int *num) + Ecore_X_Screen_Size ecore_x_randr_current_screen_size_get(Ecore_X_Window root) + int ecore_x_randr_screen_size_set(Ecore_X_Window root, Ecore_X_Screen_Size size) + + Ecore_X_Screen_Refresh_Rate *ecore_x_randr_screen_refresh_rates_get(Ecore_X_Window root, int size_id, int *num) + Ecore_X_Screen_Refresh_Rate ecore_x_randr_current_screen_refresh_rate_get(Ecore_X_Window root) + + int ecore_x_randr_screen_refresh_rate_set(Ecore_X_Window root, Ecore_X_Screen_Size size, Ecore_X_Screen_Refresh_Rate rate) + + Ecore_X_Region ecore_x_region_new(Ecore_X_Rectangle *rects, int num) + Ecore_X_Region ecore_x_region_new_from_bitmap(Ecore_X_Pixmap bitmap) + Ecore_X_Region ecore_x_region_new_from_window(Ecore_X_Window win, Ecore_X_Region_Type type) + Ecore_X_Region ecore_x_region_new_from_gc(Ecore_X_GC gc) + Ecore_X_Region ecore_x_region_new_from_picture(Ecore_X_Picture picture) + void ecore_x_region_del(Ecore_X_Region region) + void ecore_x_region_set(Ecore_X_Region region, Ecore_X_Rectangle *rects, int num) + void ecore_x_region_copy(Ecore_X_Region dest, Ecore_X_Region source) + void ecore_x_region_combine(Ecore_X_Region dest, Ecore_X_Region source1, Ecore_X_Region source2) + void ecore_x_region_intersect(Ecore_X_Region dest, Ecore_X_Region source1, Ecore_X_Region source2) + void ecore_x_region_subtract(Ecore_X_Region dest, Ecore_X_Region source1, Ecore_X_Region source2) + void ecore_x_region_invert(Ecore_X_Region dest, Ecore_X_Rectangle *bounds, Ecore_X_Region source) + void ecore_x_region_translate(Ecore_X_Region region, int dx, int dy) + void ecore_x_region_extents(Ecore_X_Region dest, Ecore_X_Region source) + void ecore_x_region_fetch_prefetch(Ecore_X_Region region) + void ecore_x_region_fetch_fetch() + Ecore_X_Rectangle * ecore_x_region_fetch(Ecore_X_Region region, int *num, Ecore_X_Rectangle *bounds) + void ecore_x_region_expand(Ecore_X_Region dest, Ecore_X_Region source, unsigned int left, unsigned int right, unsigned int top, unsigned int bottom) + void ecore_x_region_gc_clip_set(Ecore_X_Region region, Ecore_X_GC gc, int x_origin, int y_origin) + void ecore_x_region_window_shape_set(Ecore_X_Region region, Ecore_X_Window win, Ecore_X_Shape_Type type, int x_offset, int y_offset) + void ecore_x_region_picture_clip_set(Ecore_X_Region region, Ecore_X_Picture picture, int x_origin, int y_origin) + + int ecore_x_composite_query() + + int ecore_x_damage_query() + Ecore_X_Damage ecore_x_damage_new(Ecore_X_Drawable d, Ecore_X_Damage_Report_Level level) + void ecore_x_damage_del(Ecore_X_Damage damage) + void ecore_x_damage_subtract(Ecore_X_Damage damage, Ecore_X_Region repair, Ecore_X_Region parts) + + int ecore_x_screen_is_composited(int screen) + + int ecore_x_dpms_query() + void ecore_x_dpms_capable_get_prefetch() + void ecore_x_dpms_capable_get_fetch() + int ecore_x_dpms_capable_get() + void ecore_x_dpms_enable_get_prefetch() + void ecore_x_dpms_enable_get_fetch() + int ecore_x_dpms_enabled_get() + void ecore_x_dpms_enabled_set(int enabled) + void ecore_x_dpms_timeouts_get_prefetch() + void ecore_x_dpms_timeouts_get_fetch() + void ecore_x_dpms_timeouts_get(unsigned int *standby, unsigned int *suspend, unsigned int *off) + int ecore_x_dpms_timeouts_set(unsigned int standby, unsigned int suspend, unsigned int off) + unsigned int ecore_x_dpms_timeout_standby_get() + unsigned int ecore_x_dpms_timeout_suspend_get() + unsigned int ecore_x_dpms_timeout_off_get() + void ecore_x_dpms_timeout_standby_set(unsigned int new_timeout) + void ecore_x_dpms_timeout_suspend_set(unsigned int new_timeout) + void ecore_x_dpms_timeout_off_set(unsigned int new_timeout) + + ctypedef enum Ecore_X_Virtual_Keyboard_State: + ECORE_X_VIRTUAL_KEYBOARD_STATE_UNKNOWN + ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF + ECORE_X_VIRTUAL_KEYBOARD_STATE_ON + ECORE_X_VIRTUAL_KEYBOARD_STATE_ALPHA + ECORE_X_VIRTUAL_KEYBOARD_STATE_NUMERIC + ECORE_X_VIRTUAL_KEYBOARD_STATE_PIN + ECORE_X_VIRTUAL_KEYBOARD_STATE_PHONE_NUMBER + ECORE_X_VIRTUAL_KEYBOARD_STATE_HEX + ECORE_X_VIRTUAL_KEYBOARD_STATE_TERMINAL + ECORE_X_VIRTUAL_KEYBOARD_STATE_PASSWORD + + void ecore_x_e_virtual_keyboard_state_set(Ecore_X_Window win, Ecore_X_Virtual_Keyboard_State state) + + +from efl.ecore cimport Event + + +cdef class Window: + cdef readonly Ecore_X_Window xid + + cdef int _set_xid(self, Ecore_X_Window xid) + + +cdef class EventKey(Event): + cdef readonly object keyname + cdef readonly object key + cdef readonly object string + cdef readonly object compose + cdef readonly Window window + cdef readonly Window root_window + cdef readonly Window event_window + cdef readonly unsigned int modifiers + cdef readonly unsigned int timestamp + cdef readonly int same_screen + + +cdef class EventPoint: + cdef readonly int x + cdef readonly int y + + +cdef class EventMouseButton(Event): + cdef readonly Window window + cdef readonly Window root_window + cdef readonly Window event_window + cdef readonly unsigned int modifiers + cdef readonly unsigned int timestamp + cdef readonly unsigned int buttons + cdef readonly unsigned int double_click + cdef readonly unsigned int triple_click + cdef readonly int same_screen + cdef readonly int x + cdef readonly int y + cdef readonly EventPoint root + + +cdef class EventMouseMove(Event): + cdef readonly Window window + cdef readonly Window root_window + cdef readonly Window event_window + cdef readonly unsigned int modifiers + cdef readonly unsigned int timestamp + cdef readonly int same_screen + cdef readonly int x + cdef readonly int y + cdef readonly EventPoint root + + +cdef class EventMouseIO(Event): + cdef readonly Window window + cdef readonly Window event_window + cdef readonly unsigned int modifiers + cdef readonly unsigned int timestamp + cdef readonly int x + cdef readonly int y + + +cdef class EventMouseWheel(Event): + cdef readonly Window window + cdef readonly Window root_window + cdef readonly Window event_window + cdef readonly unsigned int modifiers + cdef readonly unsigned int timestamp + cdef readonly int same_screen + cdef readonly int direction + cdef readonly int z + cdef readonly int x + cdef readonly int y + cdef readonly EventPoint root + + +cdef class EventWindowFocusIn(Event): + cdef readonly Window win + cdef readonly int mode + cdef readonly int detail + cdef readonly unsigned int time + + +cdef class EventWindowFocusOut(Event): + cdef readonly Window win + cdef readonly int mode + cdef readonly int detail + cdef readonly unsigned int time + + +cdef class EventWindowKeymap(Event): + cdef readonly Window win + + +cdef class EventWindowDamage(Event): + cdef readonly Window win + cdef readonly int x + cdef readonly int y + cdef readonly int w + cdef readonly int h + cdef readonly int count + cdef readonly unsigned int time + + +cdef class EventWindowVisibilityChange(Event): + cdef readonly Window win + cdef readonly int fully_obscured + cdef readonly unsigned int time + + +cdef class EventWindowCreate(Event): + cdef readonly Window win + cdef readonly int override + cdef readonly unsigned int time + + +cdef class EventWindowDestroy(Event): + cdef readonly Window win + cdef readonly unsigned int time + + +cdef class EventWindowHide(Event): + cdef readonly Window win + cdef readonly unsigned int time + + +cdef class EventWindowShow(Event): + cdef readonly Window win + cdef readonly unsigned int time + + +cdef class EventWindowShowRequest(Event): + cdef readonly Window win + cdef readonly Window parent + cdef readonly unsigned int time + + +cdef class EventWindowReparent(Event): + cdef readonly Window win + cdef readonly Window parent + cdef readonly unsigned int time + + +cdef class EventWindowConfigure(Event): + cdef readonly Window win + cdef readonly Window above_win + cdef readonly int x + cdef readonly int y + cdef readonly int w + cdef readonly int h + cdef readonly int border + cdef readonly unsigned int override + cdef readonly unsigned int from_wm + cdef readonly unsigned int time + + +cdef class EventWindowConfigureRequest(Event): + cdef readonly Window win + cdef readonly Window above_win + cdef readonly int x + cdef readonly int y + cdef readonly int w + cdef readonly int h + cdef readonly int border + cdef readonly int stack_mode + cdef readonly unsigned long value_mask + cdef readonly unsigned int time + + +cdef class EventWindowGravity(Event): + cdef readonly Window win + cdef readonly unsigned int time + + +cdef class EventWindowResizeRequest(Event): + cdef readonly Window win + cdef readonly int w + cdef readonly int h + cdef readonly unsigned int time + + +cdef class EventWindowStack(Event): + cdef readonly Window win + cdef readonly Window event_win + cdef readonly int stack_mode + cdef readonly unsigned int time + + +cdef class EventWindowStackRequest(Event): + cdef readonly Window win + cdef readonly Window parent + cdef readonly int stack_mode + cdef readonly unsigned int time + + +cdef class EventDesktopChange(Event): + cdef readonly Window win + cdef readonly long desktop + cdef readonly unsigned int time + + +cdef class EventPing(Event): + cdef readonly Window win + cdef readonly Window event_win + cdef readonly unsigned int time + + +cdef class EventWindowStateRequest(Event): + cdef readonly Window win + cdef readonly int action + cdef readonly int state1 + cdef readonly int state2 + cdef readonly int source + + +cdef class EventFrameExtentsRequest(Event): + cdef readonly Window win + + +cdef class EventWindowShape(Event): + cdef readonly Window win + cdef readonly unsigned int time + + +cdef class EventScreensaverNotify(Event): + cdef readonly Window win + cdef readonly int on + cdef readonly unsigned int time + + +cdef class EventSyncCounter(Event): + cdef readonly unsigned int time + + +cdef class EventSyncAlarm(Event): + cdef readonly unsigned int time + cdef readonly unsigned int alarm + + +cdef class EventScreenChange(Event): + cdef readonly Window win + cdef readonly Window root + cdef readonly int width + cdef readonly int height + + +cdef class EventWindowDeleteRequest(Event): + cdef readonly Window win + cdef readonly unsigned int time + + +cdef class EventWindowMoveResizeRequest(Event): + cdef readonly Window win + cdef readonly int x + cdef readonly int y + cdef readonly int button + cdef readonly int source + + + + +## cdef class EventWindowProperty(Event): +## cdef readonly Window win +## Atom atom +## cdef readonly unsigned int time + + +## cdef class EventWindowColormap(Event): +## cdef readonly Window win +## Colormap cmap +## cdef readonly int installed +## cdef readonly unsigned int time + + +## cdef class EventSelectionClear(Event): +## cdef readonly Window win +## Selection selection +## cdef readonly unsigned int time + + +## cdef class EventSelectionRequest(Event): +## cdef readonly Window owner +## cdef readonly Window requestor +## cdef readonly unsigned int time +## Atom selection +## Atom target +## Atom property + + +## cdef class EventSelectionNotify(Event): +## cdef readonly Window win +## cdef readonly unsigned int time +## Selection selection +## cdef readonly object target +## void *data + + +## cdef class EventDamage(Event): +## cdef readonly int level +## Ecore_X_Drawable drawable +## Ecore_X_Damage damage +## cdef readonly int more +## cdef readonly unsigned int time +## cdef readonly EventRectangle area +## cdef readonly EventRectangle geometry diff --git a/efl/ecore/x.pyx b/efl/ecore/x.pyx new file mode 100644 index 0000000..045be39 --- /dev/null +++ b/efl/ecore/x.pyx @@ -0,0 +1,237 @@ +# Copyright (C) 2007-2014 various contributors (see AUTHORS) +# +# This file is part of Python-EFL. +# +# Python-EFL is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 3 of the License, or (at your option) any later version. +# +# Python-EFL is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this Python-EFL. If not, see . + +#from cpython cimport PyObject, Py_INCREF, Py_DECREF +from cpython cimport PyMem_Malloc, PyMem_Free + + +def init(name=None): + """Initialize the X display connection to the given display. + + :param name: display target name, if None, default will be used. + :rtype: int + """ + cdef char *s + cdef int i + if name is None: + s = NULL + else: + s = name + i = ecore_x_init(s) + x_events_register() + return i + + +def shutdown(): + """Shuts down the Ecore X library. + + In shutting down the library, the X display connection is terminated + and any event handlers for it are removed. + + :rtype: int + """ + return ecore_x_shutdown() + + +def disconnect(): + """Shuts down the Ecore X library. + + As ecore_x_shutdown, except do not close Display, only connection. + + :rtype: int + """ + return ecore_x_disconnect() + + +def fd_get(): + """Retrieves the X display file descriptor. + + :rtype: int + """ + return ecore_x_fd_get() + + +def double_click_time_set(double t): + """Sets the timeout for a double and triple clicks to be flagged. + + This sets the time between clicks before the double_click flag is + set in a button down event. If 3 clicks occur within double this + time, the triple_click flag is also set. + """ + ecore_x_double_click_time_set(t) + +def double_click_time_get(): + ":rtype: float" + return ecore_x_double_click_time_get() + + +def flush(): + "Sends all X commands in the X Display buffer." + ecore_x_flush() + + +def sync(): + "Flushes the command buffer and waits until all requests have been" + ecore_x_sync() + + +def current_time_get(): + "Return the last event time." + return ecore_x_current_time_get() + + +def error_request_get(): + """Get the request code that caused the error. + + :rtype: int + """ + return ecore_x_error_request_get() + + +def error_code_get(): + """Get the error code from the error. + + :rtype: int + """ + return ecore_x_error_code_get() + + +def window_focus_get(): + """Returns the window that has the focus. + + :rtype: L{Window} + """ + cdef Ecore_X_Window xid + xid = ecore_x_window_focus_get() + return Window_from_xid(xid) + + +cdef int _skip_list_build(skip_list, Ecore_X_Window **pskips, int *pskip_num) except 0: + cdef Window win + cdef int i + + if skip_list: + pskip_num[0] = len(skip_list) + else: + pskip_num[0] = 0 + + if pskip_num[0] == 0: + pskips[0] = NULL + return 1 + else: + pskips[0] = PyMem_Malloc(pskip_num[0] * sizeof(Ecore_X_Window)) + i = 0 + try: + for w in skip_list: + win = w + pskips[0][i] = win.xid + i += 1 + except: + pskip_num[0] = 0 + PyMem_Free(pskips[0]) + raise + return 1 + + +def window_shadow_tree_at_xy_with_skip_get(Window base, int x, int y, skip_list=None): + """Retrieves the top, visible window at the given location, + but skips the windows in the list. This uses a shadow tree built from the + window tree that is only updated the first time + L{window_shadow_tree_at_xy_with_skip_get()} is called, or the next time + it is called after a L{window_shadow_tree_flush()}. + + :param base: Window to use as base, or None to use root window. + :param x: The given X position. + :param y: The given Y position. + :rtype: Window + """ + cdef: + Ecore_X_Window base_xid, ret_xid + Ecore_X_Window *skips + int skip_num + if base is None: + base_xid = 0 + else: + base_xid = base.xid + + _skip_list_build(skip_list, &skips, &skip_num) + ret_xid = ecore_x_window_shadow_tree_at_xy_with_skip_get(base_xid, x, y, + skips, skip_num) + if skips != NULL: + PyMem_Free(skips) + + return Window_from_xid(ret_xid) + + +def window_shadow_tree_flush(): + "Flushes the window shadow tree so nothing is stored." + ecore_x_window_shadow_tree_flush() + + +def window_at_xy_get(int x, int y): + """Retrieves the top, visible window at the given location. + + :param x: horizontal position. + :param y: vertical position. + :rtype: Window + """ + cdef Ecore_X_Window xid + xid = ecore_x_window_at_xy_get(x, y) + return Window_from_xid(xid) + + +def window_at_xy_with_skip_get(int x, int y, skip_list=None): + """Retrieves the top, visible window at the given location. + + :param x: horizontal position. + :param y: vertical position. + :rtype: Window + """ + cdef: + Ecore_X_Window xid + Ecore_X_Window *skips + int skip_num + + _skip_list_build(skip_list, &skips, &skip_num) + xid = ecore_x_window_at_xy_with_skip_get(x, y, skips, skip_num) + + if skips != NULL: + PyMem_Free(skips) + + return Window_from_xid(xid) + + +def window_at_xy_begin_get(Window begin, int x, int y): + """Retrieves the top, visible window at the given location, starting from + begin. + + :param begin: Window to start at. + :param x: horizontal position. + :param y: vertical position. + :rtype: Window + """ + cdef Ecore_X_Window xid, begin_xid + if begin is None: + begin_xid = 0 + else: + begin_xid = begin.xid + xid = ecore_x_window_at_xy_begin_get(begin_xid, x, y) + return Window_from_xid(xid) + + +include "x_window.pxi" +include "x_events.pxi" diff --git a/efl/ecore/x_events.pxi b/efl/ecore/x_events.pxi new file mode 100644 index 0000000..680239e --- /dev/null +++ b/efl/ecore/x_events.pxi @@ -0,0 +1,1038 @@ +# Copyright (C) 2007-2014 various contributors (see AUTHORS) +# +# This file is part of Python-EFL. +# +# Python-EFL is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 3 of the License, or (at your option) any later version. +# +# Python-EFL is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this Python-EFL. If not, see . + +from efl.ecore cimport EventHandler + +cdef object _charp_to_str(const char *p): + if p != NULL: + return p + else: + return None + + +cdef class EventKey(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_Event_Key *obj + obj = o + self.keyname = _charp_to_str(obj.keyname) + self.key = _charp_to_str(obj.key) + self.string = _charp_to_str(obj.string) + self.compose = _charp_to_str(obj.compose) + self.window = Window_from_xid(obj.window) + self.root_window = Window_from_xid(obj.root_window) + self.event_window = Window_from_xid(obj.event_window) + self.timestamp = obj.timestamp + self.modifiers = obj.modifiers + self.same_screen = obj.same_screen + return 1 + + +cdef class EventPoint: + def __init__(self, int x, int y): + self.x = x + self.y = y + + +cdef class EventMouseButton(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_Event_Mouse_Button *obj + obj = o + self.window = Window_from_xid(obj.window) + self.root_window = Window_from_xid(obj.root_window) + self.event_window = Window_from_xid(obj.event_window) + self.timestamp = obj.timestamp + self.modifiers = obj.modifiers + self.buttons = obj.buttons + self.double_click = obj.double_click + self.triple_click = obj.triple_click + self.same_screen = obj.same_screen + self.x = obj.x + self.y = obj.y + self.root = EventPoint(obj.root.x, obj.root.y) + return 1 + + +cdef class EventMouseMove(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_Event_Mouse_Move *obj + obj = o + self.window = Window_from_xid(obj.window) + self.root_window = Window_from_xid(obj.root_window) + self.event_window = Window_from_xid(obj.event_window) + self.timestamp = obj.timestamp + self.modifiers = obj.modifiers + self.same_screen = obj.same_screen + self.x = obj.x + self.y = obj.y + self.root = EventPoint(obj.root.x, obj.root.y) + return 1 + + +cdef class EventMouseIO(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_Event_Mouse_IO *obj + obj = o + self.window = Window_from_xid(obj.window) + self.event_window = Window_from_xid(obj.event_window) + self.timestamp = obj.timestamp + self.modifiers = obj.modifiers + self.x = obj.x + self.y = obj.y + return 1 + + +cdef class EventMouseWheel(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_Event_Mouse_Wheel *obj + obj = o + self.window = Window_from_xid(obj.window) + self.root_window = Window_from_xid(obj.root_window) + self.event_window = Window_from_xid(obj.event_window) + self.timestamp = obj.timestamp + self.modifiers = obj.modifiers + self.same_screen = obj.same_screen + self.direction = obj.direction + self.z = obj.z + self.x = obj.x + self.y = obj.y + self.root = EventPoint(obj.root.x, obj.root.y) + return 1 + + +cdef class EventWindowFocusIn(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Window_Focus_In *obj + obj = o + self.win = Window_from_xid(obj.win) + self.mode = obj.mode + self.detail = obj.detail + self.time = obj.time + return 1 + + +cdef class EventWindowFocusOut(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Window_Focus_Out *obj + obj = o + self.win = Window_from_xid(obj.win) + self.mode = obj.mode + self.detail = obj.detail + self.time = obj.time + return 1 + + +cdef class EventWindowKeymap(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Window_Keymap *obj + obj = o + self.win = Window_from_xid(obj.win) + return 1 + + +cdef class EventWindowDamage(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Window_Damage *obj + obj = o + self.win = Window_from_xid(obj.win) + self.x = obj.x + self.y = obj.y + self.w = obj.w + self.h = obj.h + self.count = obj.count + self.time = obj.time + return 1 + + +cdef class EventWindowVisibilityChange(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Window_Visibility_Change *obj + obj = o + self.win = Window_from_xid(obj.win) + self.fully_obscured = obj.fully_obscured + self.time = obj.time + return 1 + + +cdef class EventWindowCreate(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Window_Create *obj + obj = o + self.win = Window_from_xid(obj.win) + self.override = obj.override + self.time = obj.time + return 1 + + +cdef class EventWindowDestroy(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Window_Destroy *obj + obj = o + self.win = Window_from_xid(obj.win) + self.time = obj.time + return 1 + + +cdef class EventWindowHide(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Window_Hide *obj + obj = o + self.win = Window_from_xid(obj.win) + self.time = obj.time + return 1 + + +cdef class EventWindowShow(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Window_Show *obj + obj = o + self.win = Window_from_xid(obj.win) + self.time = obj.time + return 1 + + +cdef class EventWindowShowRequest(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Window_Show_Request *obj + obj = o + self.win = Window_from_xid(obj.win) + self.parent = Window_from_xid(obj.parent) + self.time = obj.time + return 1 + + +cdef class EventWindowReparent(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Window_Reparent *obj + obj = o + self.win = Window_from_xid(obj.win) + self.parent = Window_from_xid(obj.parent) + self.time = obj.time + return 1 + + +cdef class EventWindowConfigure(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Window_Configure *obj + obj = o + self.win = Window_from_xid(obj.win) + self.above_win = Window_from_xid(obj.abovewin) + self.x = obj.x + self.y = obj.y + self.w = obj.w + self.h = obj.h + self.border = obj.border + self.override = obj.override + self.from_wm = obj.from_wm + self.time = obj.time + return 1 + + +cdef class EventWindowConfigureRequest(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Window_Configure_Request *obj + obj = o + self.win = Window_from_xid(obj.win) + self.above_win = Window_from_xid(obj.abovewin) + self.x = obj.x + self.y = obj.y + self.w = obj.w + self.h = obj.h + self.border = obj.border + self.stack_mode = obj.detail + self.value_mask = obj.value_mask + self.time = obj.time + return 1 + + +cdef class EventWindowGravity(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Window_Gravity *obj + obj = o + self.win = Window_from_xid(obj.win) + self.time = obj.time + return 1 + + +cdef class EventWindowResizeRequest(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Window_Resize_Request *obj + obj = o + self.win = Window_from_xid(obj.win) + self.w = obj.w + self.h = obj.h + self.time = obj.time + return 1 + + +cdef class EventWindowStack(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Window_Stack *obj + obj = o + self.win = Window_from_xid(obj.win) + self.event_win = Window_from_xid(obj.event_win) + self.stack_mode = obj.detail + self.time = obj.time + return 1 + + +cdef class EventWindowStackRequest(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Window_Stack_Request *obj + obj = o + self.win = Window_from_xid(obj.win) + self.parent = Window_from_xid(obj.parent) + self.stack_mode = obj.detail + self.time = obj.time + return 1 + + +cdef class EventPing(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Ping *obj + obj = o + self.win = Window_from_xid(obj.win) + self.event_win = Window_from_xid(obj.event_win) + self.time = obj.time + return 1 + + +cdef class EventWindowStateRequest(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Window_State_Request *obj + obj = o + self.win = Window_from_xid(obj.win) + self.action = obj.action + self.state1 = obj.state[0] + self.state2 = obj.state[1] + self.source = obj.source + return 1 + + +cdef class EventFrameExtentsRequest(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Frame_Extents_Request *obj + obj = o + self.win = Window_from_xid(obj.win) + return 1 + + +cdef class EventWindowShape(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Window_Shape *obj + obj = o + self.win = Window_from_xid(obj.win) + self.time = obj.time + return 1 + + +cdef class EventScreensaverNotify(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Screensaver_Notify *obj + obj = o + self.win = Window_from_xid(obj.win) + self.on = obj.on + self.time = obj.time + return 1 + + +cdef class EventSyncCounter(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Sync_Counter *obj + obj = o + self.time = obj.time + return 1 + + +cdef class EventSyncAlarm(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Sync_Alarm *obj + obj = o + self.time = obj.time + self.alarm = obj.alarm + return 1 + + +cdef class EventScreenChange(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Screen_Change *obj + obj = o + self.win = Window_from_xid(obj.win) + self.root = Window_from_xid(obj.root) + + mmsize = (obj.size.width, obj.size.height, + obj.size.width_mm, obj.size.height_mm) + + self.size = mmsize + self.time = obj.time + self.config_time = obj.config_time + self.orientation = obj.orientation + self.subpixel_order = obj.subpixel_order + self.size_id = obj.size_id + return 1 + + +cdef class EventWindowDeleteRequest(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Window_Delete_Request *obj + obj = o + self.win = Window_from_xid(obj.win) + self.time = obj.time + return 1 + + +cdef class EventWindowMoveResizeRequest(Event): + cdef int _set_obj(self, void *o) except 0: + cdef Ecore_X_Event_Window_Move_Resize_Request *obj + obj = o + self.win = Window_from_xid(obj.win) + self.x = obj.x + self.y = obj.y + self.button = obj.button + self.source = obj.source + return 1 + + +cdef class _Events: + property KEY_DOWN: + def __get__(self): + return ECORE_EVENT_KEY_DOWN + + property KEY_UP: + def __get__(self): + return ECORE_EVENT_KEY_UP + + property MOUSE_BUTTON_DOWN: + def __get__(self): + return ECORE_EVENT_MOUSE_BUTTON_DOWN + + property MOUSE_BUTTON_UP: + def __get__(self): + return ECORE_EVENT_MOUSE_BUTTON_UP + + property MOUSE_MOVE: + def __get__(self): + return ECORE_EVENT_MOUSE_MOVE + + property MOUSE_IN: + def __get__(self): + return ECORE_EVENT_MOUSE_IN + + property MOUSE_OUT: + def __get__(self): + return ECORE_EVENT_MOUSE_OUT + + property MOUSE_WHEEL: + def __get__(self): + return ECORE_EVENT_MOUSE_WHEEL + + property WINDOW_FOCUS_IN: + def __get__(self): + return ECORE_X_EVENT_WINDOW_FOCUS_IN + + property WINDOW_FOCUS_OUT: + def __get__(self): + return ECORE_X_EVENT_WINDOW_FOCUS_OUT + + property WINDOW_KEYMAP: + def __get__(self): + return ECORE_X_EVENT_WINDOW_KEYMAP + + property WINDOW_DAMAGE: + def __get__(self): + return ECORE_X_EVENT_WINDOW_DAMAGE + + property WINDOW_VISIBILITY_CHANGE: + def __get__(self): + return ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE + + property WINDOW_CREATE: + def __get__(self): + return ECORE_X_EVENT_WINDOW_CREATE + + property WINDOW_DESTROY: + def __get__(self): + return ECORE_X_EVENT_WINDOW_DESTROY + + property WINDOW_HIDE: + def __get__(self): + return ECORE_X_EVENT_WINDOW_HIDE + + property WINDOW_SHOW: + def __get__(self): + return ECORE_X_EVENT_WINDOW_SHOW + + property WINDOW_SHOW_REQUEST: + def __get__(self): + return ECORE_X_EVENT_WINDOW_SHOW_REQUEST + + property WINDOW_REPARENT: + def __get__(self): + return ECORE_X_EVENT_WINDOW_REPARENT + + property WINDOW_CONFIGURE: + def __get__(self): + return ECORE_X_EVENT_WINDOW_CONFIGURE + + property WINDOW_CONFIGURE_REQUEST: + def __get__(self): + return ECORE_X_EVENT_WINDOW_CONFIGURE_REQUEST + + property WINDOW_GRAVITY: + def __get__(self): + return ECORE_X_EVENT_WINDOW_GRAVITY + + property WINDOW_RESIZE_REQUEST: + def __get__(self): + return ECORE_X_EVENT_WINDOW_RESIZE_REQUEST + + property WINDOW_STACK: + def __get__(self): + return ECORE_X_EVENT_WINDOW_STACK + + property WINDOW_STACK_REQUEST: + def __get__(self): + return ECORE_X_EVENT_WINDOW_STACK_REQUEST + + property WINDOW_PROPERTY: + def __get__(self): + return ECORE_X_EVENT_WINDOW_PROPERTY + + property WINDOW_COLORMAP: + def __get__(self): + return ECORE_X_EVENT_WINDOW_COLORMAP + + property WINDOW_MAPPING: + def __get__(self): + return ECORE_X_EVENT_WINDOW_MAPPING + + property SELECTION_CLEAR: + def __get__(self): + return ECORE_X_EVENT_SELECTION_CLEAR + + property SELECTION_REQUEST: + def __get__(self): + return ECORE_X_EVENT_SELECTION_REQUEST + + property SELECTION_NOTIFY: + def __get__(self): + return ECORE_X_EVENT_SELECTION_NOTIFY + + property CLIENT_MESSAGE: + def __get__(self): + return ECORE_X_EVENT_CLIENT_MESSAGE + + property WINDOW_SHAPE: + def __get__(self): + return ECORE_X_EVENT_WINDOW_SHAPE + + property SCREENSAVER_NOTIFY: + def __get__(self): + return ECORE_X_EVENT_SCREENSAVER_NOTIFY + + property SYNC_COUNTER: + def __get__(self): + return ECORE_X_EVENT_SYNC_COUNTER + + property SYNC_ALARM: + def __get__(self): + return ECORE_X_EVENT_SYNC_ALARM + + property SCREEN_CHANGE: + def __get__(self): + return ECORE_X_EVENT_SCREEN_CHANGE + + property DAMAGE_NOTIFY: + def __get__(self): + return ECORE_X_EVENT_DAMAGE_NOTIFY + + property WINDOW_DELETE_REQUEST: + def __get__(self): + return ECORE_X_EVENT_WINDOW_DELETE_REQUEST + + property WINDOW_MOVE_RESIZE_REQUEST: + def __get__(self): + return ECORE_X_EVENT_WINDOW_MOVE_RESIZE_REQUEST + + property WINDOW_STATE_REQUEST: + def __get__(self): + return ECORE_X_EVENT_WINDOW_STATE_REQUEST + + property FRAME_EXTENTS_REQUEST: + def __get__(self): + return ECORE_X_EVENT_FRAME_EXTENTS_REQUEST + + property PING: + def __get__(self): + return ECORE_X_EVENT_PING + + property DESKTOP_CHANGE: + def __get__(self): + return ECORE_X_EVENT_DESKTOP_CHANGE + + property STARTUP_SEQUENCE_NEW: + def __get__(self): + return ECORE_X_EVENT_STARTUP_SEQUENCE_NEW + + property STARTUP_SEQUENCE_CHANGE: + def __get__(self): + return ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE + + property STARTUP_SEQUENCE_REMOVE: + def __get__(self): + return ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE + +Events = _Events() + + +cdef int _x_events_registered = 0 +from efl.ecore cimport _event_mapping_register as reg + +# Just call after ecore_x_init() is done, otherwise all event type will be 0. +cdef int x_events_register() except 0: + global _x_events_registered + if _x_events_registered != 0: + return 1 + _x_events_registered = 1 + + reg(ECORE_EVENT_KEY_DOWN, EventKey) + reg(ECORE_EVENT_KEY_UP, EventKey) + reg(ECORE_EVENT_MOUSE_BUTTON_DOWN, EventMouseButton) + reg(ECORE_EVENT_MOUSE_BUTTON_UP, EventMouseButton) + reg(ECORE_EVENT_MOUSE_MOVE, EventMouseMove) + reg(ECORE_EVENT_MOUSE_IN, EventMouseIO) + reg(ECORE_EVENT_MOUSE_OUT, EventMouseIO) + reg(ECORE_EVENT_MOUSE_WHEEL, EventMouseWheel) + reg(ECORE_X_EVENT_WINDOW_FOCUS_IN, EventWindowFocusIn) + reg(ECORE_X_EVENT_WINDOW_FOCUS_OUT, EventWindowFocusOut) + reg(ECORE_X_EVENT_WINDOW_KEYMAP, EventWindowKeymap) + reg(ECORE_X_EVENT_WINDOW_DAMAGE, EventWindowDamage) + reg(ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE, EventWindowVisibilityChange) + reg(ECORE_X_EVENT_WINDOW_CREATE, EventWindowCreate) + reg(ECORE_X_EVENT_WINDOW_DESTROY, EventWindowDestroy) + reg(ECORE_X_EVENT_WINDOW_HIDE, EventWindowHide) + reg(ECORE_X_EVENT_WINDOW_SHOW, EventWindowShow) + reg(ECORE_X_EVENT_WINDOW_SHOW_REQUEST, EventWindowShowRequest) + reg(ECORE_X_EVENT_WINDOW_REPARENT, EventWindowReparent) + reg(ECORE_X_EVENT_WINDOW_CONFIGURE, EventWindowConfigure) + reg(ECORE_X_EVENT_WINDOW_CONFIGURE_REQUEST, EventWindowConfigureRequest) + reg(ECORE_X_EVENT_WINDOW_GRAVITY, EventWindowGravity) + reg(ECORE_X_EVENT_WINDOW_RESIZE_REQUEST, EventWindowResizeRequest) + reg(ECORE_X_EVENT_WINDOW_STACK, EventWindowStack) + reg(ECORE_X_EVENT_WINDOW_STACK_REQUEST, EventWindowStackRequest) +## reg(ECORE_X_EVENT_WINDOW_PROPERTY, EventWindowProperty) # TODO +## reg(ECORE_X_EVENT_WINDOW_COLORMAP, EventWindowColormap) # TODO +## reg(ECORE_X_EVENT_WINDOW_MAPPING, EventWindowMapping) # ? +## reg(ECORE_X_EVENT_SELECTION_CLEAR, EventSelectionClear) # TODO +## reg(ECORE_X_EVENT_SELECTION_REQUEST, EventSelectionRequest) # TODO +## reg(ECORE_X_EVENT_SELECTION_NOTIFY, EventSelectionNotify) # TODO +## reg(ECORE_X_EVENT_CLIENT_MESSAGE, EventClientMessage) + reg(ECORE_X_EVENT_WINDOW_SHAPE, EventWindowShape) + reg(ECORE_X_EVENT_SCREENSAVER_NOTIFY, EventScreensaverNotify) + reg(ECORE_X_EVENT_SYNC_COUNTER, EventSyncCounter) + reg(ECORE_X_EVENT_SYNC_ALARM, EventSyncAlarm) + reg(ECORE_X_EVENT_SCREEN_CHANGE, EventScreenChange) +## reg(ECORE_X_EVENT_DAMAGE_NOTIFY, EventDamage) + reg(ECORE_X_EVENT_WINDOW_DELETE_REQUEST, EventWindowDeleteRequest) + reg(ECORE_X_EVENT_WINDOW_MOVE_RESIZE_REQUEST, EventWindowMoveResizeRequest) + reg(ECORE_X_EVENT_WINDOW_STATE_REQUEST, EventWindowStateRequest) + reg(ECORE_X_EVENT_FRAME_EXTENTS_REQUEST, EventFrameExtentsRequest) + reg(ECORE_X_EVENT_PING, EventPing) + reg(ECORE_X_EVENT_DESKTOP_CHANGE, EventDesktopChange) +## reg(ECORE_X_EVENT_STARTUP_SEQUENCE_NEW, EventSTartupSequenceNew) #? +## reg(ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE, EventStartupSequenceChange) #? +## reg(ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE, EventStartupSequenceRemove) #? + + return 1 + + +def on_key_down_add(func, *args, **kargs): + """Creates an ecore event handler for ECORE_EVENT_KEY_DOWN. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_EVENT_KEY_DOWN, + func, *args, **kargs) + +def on_key_up_add(func, *args, **kargs): + """Creates an ecore event handler for ECORE_EVENT_KEY_UP. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_EVENT_KEY_UP, + func, *args, **kargs) + + +def on_mouse_button_down_add(func, *args, **kargs): + """Creates an ecore event handler for ECORE_EVENT_MOUSE_BUTTON_DOWN. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_EVENT_MOUSE_BUTTON_DOWN, + func, *args, **kargs) + +def on_mouse_button_up_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_EVENT_MOUSE_BUTTON_UP. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_EVENT_MOUSE_BUTTON_UP, + func, *args, **kargs) + +def on_mouse_move_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_EVENT_MOUSE_MOVE. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_EVENT_MOUSE_MOVE, + func, *args, **kargs) + +def on_mouse_in_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_EVENT_MOUSE_IN. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_EVENT_MOUSE_IN, + func, *args, **kargs) + +def on_mouse_out_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_EVENT_MOUSE_OUT. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_EVENT_MOUSE_OUT, + func, *args, **kargs) + +def on_mouse_wheel_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_EVENT_MOUSE_WHEEL. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_EVENT_MOUSE_WHEEL, + func, *args, **kargs) + +def on_window_focus_in_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_WINDOW_FOCUS_IN. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_WINDOW_FOCUS_IN, + func, *args, **kargs) + +def on_window_focus_out_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_WINDOW_FOCUS_OUT. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_WINDOW_FOCUS_OUT, + func, *args, **kargs) + +def on_window_keymap_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_WINDOW_KEYMAP. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_WINDOW_KEYMAP, + func, *args, **kargs) + +def on_window_damage_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_WINDOW_DAMAGE. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_WINDOW_DAMAGE, + func, *args, **kargs) + +def on_window_visibility_change_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE, + func, *args, **kargs) + +def on_window_create_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_WINDOW_CREATE. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_WINDOW_CREATE, + func, *args, **kargs) + +def on_window_destroy_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_WINDOW_DESTROY. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_WINDOW_DESTROY, + func, *args, **kargs) + +def on_window_hide_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_WINDOW_HIDE. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_WINDOW_HIDE, + func, *args, **kargs) + +def on_window_show_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_WINDOW_SHOW. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_WINDOW_SHOW, + func, *args, **kargs) + +def on_window_show_request_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_WINDOW_SHOW_REQUEST. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_WINDOW_SHOW_REQUEST, + func, *args, **kargs) + +def on_window_reparent_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_WINDOW_REPARENT. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_WINDOW_REPARENT, + func, *args, **kargs) + +def on_window_configure_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_WINDOW_CONFIGURE. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_WINDOW_CONFIGURE, + func, *args, **kargs) + +def on_window_configure_request_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_WINDOW_CONFIGURE_REQUEST. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_WINDOW_CONFIGURE_REQUEST, + func, *args, **kargs) + +def on_window_gravity_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_WINDOW_GRAVITY. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_WINDOW_GRAVITY, + func, *args, **kargs) + +def on_window_resize_request_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_WINDOW_RESIZE_REQUEST. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_WINDOW_RESIZE_REQUEST, + func, *args, **kargs) + +def on_window_stack_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_WINDOW_STACK. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_WINDOW_STACK, + func, *args, **kargs) + +def on_window_stack_request_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_WINDOW_STACK_REQUEST. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_WINDOW_STACK_REQUEST, + func, *args, **kargs) + +## def on_window_property_add(func, *args, **kargs): +## """Create an ecore event handler for ECORE_X_EVENT_WINDOW_PROPERTY. + +## :see: :py:class:`efl.ecore.EventHandler` +## """ +## return EventHandler(ECORE_X_EVENT_WINDOW_PROPERTY, +## func, *args, **kargs) + +## def on_window_colormap_add(func, *args, **kargs): +## """Create an ecore event handler for ECORE_X_EVENT_WINDOW_COLORMAP. + +## :see: :py:class:`efl.ecore.EventHandler` +## """ +## return EventHandler(ECORE_X_EVENT_WINDOW_COLORMAP, +## func, *args, **kargs) + +## def on_window_mapping_add(func, *args, **kargs): +## """Create an ecore event handler for ECORE_X_EVENT_WINDOW_MAPPING. + +## :see: :py:class:`efl.ecore.EventHandler` +## """ +## return EventHandler(ECORE_X_EVENT_WINDOW_MAPPING, +## func, *args, **kargs) + +## def on_selection_clear_add(func, *args, **kargs): +## """Create an ecore event handler for ECORE_X_EVENT_SELECTION_CLEAR. + +## :see: :py:class:`efl.ecore.EventHandler` +## """ +## return EventHandler(ECORE_X_EVENT_SELECTION_CLEAR, +## func, *args, **kargs) + +## def on_selection_request_add(func, *args, **kargs): +## """Create an ecore event handler for ECORE_X_EVENT_SELECTION_REQUEST. + +## :see: :py:class:`efl.ecore.EventHandler` +## """ +## return EventHandler(ECORE_X_EVENT_SELECTION_REQUEST, +## func, *args, **kargs) + +## def on_selection_notify_add(func, *args, **kargs): +## """Create an ecore event handler for ECORE_X_EVENT_SELECTION_NOTIFY. + +## :see: :py:class:`efl.ecore.EventHandler` +## """ +## return EventHandler(ECORE_X_EVENT_SELECTION_NOTIFY, +## func, *args, **kargs) + +## def on_client_message_add(func, *args, **kargs): +## """Create an ecore event handler for ECORE_X_EVENT_CLIENT_MESSAGE. + +## :see: :py:class:`efl.ecore.EventHandler` +## """ +## return EventHandler(ECORE_X_EVENT_CLIENT_MESSAGE, +## func, *args, **kargs) + +def on_window_shape_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_WINDOW_SHAPE. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_WINDOW_SHAPE, + func, *args, **kargs) + +def on_screensaver_notify_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_SCREENSAVER_NOTIFY. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_SCREENSAVER_NOTIFY, + func, *args, **kargs) + +def on_sync_counter_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_SYNC_COUNTER. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_SYNC_COUNTER, + func, *args, **kargs) + +def on_sync_alarm_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_SYNC_ALARM. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_SYNC_ALARM, + func, *args, **kargs) + +def on_screen_change_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_SCREEN_CHANGE. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_SCREEN_CHANGE, + func, *args, **kargs) + +## def on_damage_notify_add(func, *args, **kargs): +## """Create an ecore event handler for ECORE_X_EVENT_DAMAGE_NOTIFY. + +## :see: :py:class:`efl.ecore.EventHandler` +## """ +## return EventHandler(ECORE_X_EVENT_DAMAGE_NOTIFY, +## func, *args, **kargs) + +def on_window_delete_request_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_WINDOW_DELETE_REQUEST. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_WINDOW_DELETE_REQUEST, + func, *args, **kargs) + +def on_window_move_resize_request_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_WINDOW_MOVE_RESIZE_REQUEST. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_WINDOW_MOVE_RESIZE_REQUEST, + func, *args, **kargs) + +def on_window_state_request_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_WINDOW_STATE_REQUEST. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_WINDOW_STATE_REQUEST, + func, *args, **kargs) + +def on_frame_extents_request_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_FRAME_EXTENTS_REQUEST. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_FRAME_EXTENTS_REQUEST, + func, *args, **kargs) + +def on_ping_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_PING. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_PING, + func, *args, **kargs) + +def on_desktop_change_add(func, *args, **kargs): + """Create an ecore event handler for ECORE_X_EVENT_DESKTOP_CHANGE. + + :see: :py:class:`efl.ecore.EventHandler` + """ + return EventHandler(ECORE_X_EVENT_DESKTOP_CHANGE, + func, *args, **kargs) + +## def on_startup_sequence_new_add(func, *args, **kargs): +## """Create an ecore event handler for ECORE_X_EVENT_STARTUP_SEQUENCE_NEW. + +## :see: :py:class:`efl.ecore.EventHandler` +## """ +## return EventHandler(ECORE_X_EVENT_STARTUP_SEQUENCE_NEW, +## func, *args, **kargs) + +## def on_startup_sequence_change_add(func, *args, **kargs): +## """Create an ecore event handler for ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE. + +## :see: :py:class:`efl.ecore.EventHandler` +## """ +## return EventHandler(ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE, +## func, *args, **kargs) + +## def on_startup_sequence_remove_add(func, *args, **kargs): +## """Create an ecore event handler for ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE. + +## :see: :py:class:`efl.ecore.EventHandler` +## """ +## return EventHandler(ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE, +## func, *args, **kargs) + diff --git a/efl/ecore/x_window.pxi b/efl/ecore/x_window.pxi new file mode 100644 index 0000000..dd6cda9 --- /dev/null +++ b/efl/ecore/x_window.pxi @@ -0,0 +1,463 @@ +# Copyright (C) 2007-2014 various contributors (see AUTHORS) +# +# This file is part of Python-EFL. +# +# Python-EFL is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 3 of the License, or (at your option) any later version. +# +# Python-EFL is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this Python-EFL. If not, see . + +cdef class Window: + def __init__(self, Window parent=None, int x=0, int y=0, int w=1, int h=1, + input=False, argb=False, override_redirect=False): + """Create a new X window. + + :param parent: window to use as parent, or None to use the + root window. + :param x: horizontal position. + :param y: vertical position. + :param w: horizontal size. + :param h: vertical size. + :param input: if should be an input-only window or not. + :param argb: if window should be ARGB. + :param override_redirect: if override redirect attribute must be set. + """ + cdef Ecore_X_Window p_xid, xid + if parent is None: + p_xid = 0 + else: + p_xid = parent.xid + + if not input and not argb and not override_redirect: + xid = ecore_x_window_new(p_xid, x, y, w, h) + elif argb: + if not override_redirect: + xid = ecore_x_window_argb_new(p_xid, x, y, w, h) + else: + xid = ecore_x_window_override_argb_new(p_xid, x, y, w, h) + elif input: + xid = ecore_x_window_input_new(p_xid, x, y, w, h) + elif override_redirect: + xid = ecore_x_window_override_new(p_xid, x, y, w, h) + else: + raise ValueError("not able to create window!") + + self._set_xid(xid) + + cdef int _set_xid(self, Ecore_X_Window xid) except 0: + if self.xid == 0: + self.xid = xid + return 1 + else: + raise ValueError("object already wraps an X Window.") + + 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__, 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: + ecore_x_window_free(self.xid) + self.xid = 0 + + def delete_request_send(self): + "Sends a delete request to this window." + ecore_x_window_delete_request_send(self.xid) + + def root_get(self): + ":rtype: Window" + cdef Ecore_X_Window xid + xid = ecore_x_window_root_get(self.xid) + return Window_from_xid(xid) + + def reparent(self, Window new_parent=None, int x=0, int y=0): + """Moves this window to within another window at a given position. + + :param new_parent: window to use as parent, or None to use the root + window. + :param x: horizontal position within the new parent. + :param y: vertical position within the new parent. + """ + cdef Ecore_X_Window p_xid + if new_parent is None: + p_xid = 0 + else: + p_xid = new_parent.xid + ecore_x_window_reparent(self.xid, p_xid, x, y) + + def parent_set(self, Window new_parent=None): + """Set window parent. + + :param new_parent: window to use as parent, or None to use the root + window. + :see: same as :py:meth:`reparent` with both x and y being 0. + """ + cdef Ecore_X_Window p_xid + if new_parent is None: + p_xid = 0 + else: + p_xid = new_parent.xid + ecore_x_window_reparent(self.xid, p_xid, 0, 0) + + def parent_get(self): + ":rtype: Window" + cdef Ecore_X_Window xid + xid = ecore_x_window_parent_get(self.xid) + return Window_from_xid(xid) + + property parent: + def __set__(self, value): + self.parent_set(value) + + def __get__(self): + return self.parent_get() + + def show(self): + """Shows this window. + + Synonymous to "mapping" a window in X Window System terminology. + """ + ecore_x_window_show(self.xid) + + def hide(self): + """Hides a window. + + Synonymous to "unmapping" a window in X Window System terminology. + """ + ecore_x_window_hide(self.xid) + + def visible_set(self, value): + if value: + self.show() + else: + self.hide() + + def visible_get(self): + ":rtype: bool" + return bool(ecore_x_window_visible_get(self.xid)) + + def focus(self): + "Give focus to this windows." + ecore_x_window_focus(self.xid) + + def focus_at_time(self, Ecore_X_Time time): + """Sets the focus this window at a specific time. + + :param time: time specification, see :py:meth:`current_time_get`. + """ + ecore_x_window_focus_at_time(self.xid, time) + + def ignore_set(self, int setting): + ecore_x_window_ignore_set(self.xid, bool(setting)) + + def raise_(self): + "Raises this window." + ecore_x_window_raise(self.xid) + + def lower(self): + "Lowers this window." + ecore_x_window_lower(self.xid) + + def move(self, int x, int y): + """Set window position. + + :param x: horizontal. + :param y: vertical. + """ + ecore_x_window_move(self.xid, x, y) + + def pos_set(self, int x, int y): + """Set window position. + + :param x: horizontal. + :param y: vertical. + + .. note:: alias for :py:meth:`move` + """ + ecore_x_window_move(self.xid, x, y) + + def pos_get(self): + ":rtype: tuple of int" + cdef int x, y, w, h + ecore_x_window_geometry_get(self.xid, &x, &y, &w, &h) + return (x, y) + + property pos: + def __set__(self, spec): + self.pos_set(*spec) + + def __get__(self): + return self.pos_get() + + def resize(self, int w, int h): + """Set window size. + + :param w: horizontal. + :param h: vertical. + """ + ecore_x_window_resize(self.xid, w, h) + + def size_set(self, int w, int h): + """Set window size. + + :param w: horizontal. + :param h: vertical. + + .. note:: alias for :py:meth:`resize` + """ + ecore_x_window_resize(self.xid, w, h) + + def size_get(self): + ":rtype: tuple of int" + cdef int w, h + ecore_x_window_size_get(self.xid, &w, &h) + return (w, h) + + property size: + def __set__(self, spec): + self.size_set(*spec) + + def __get__(self): + return self.size_get() + + def move_resize(self, int x, int y, int w, int h): + """Set both position and size. + + :param x: horizontal position. + :param y: vertical position. + :param w: horizontal size. + :param h: vertical size. + """ + ecore_x_window_move_resize(self.xid, x, y, w, h) + + def geometry_set(self, int x, int y, int w, int h): + """Set both position and size. + + :param x: horizontal position. + :param y: vertical position. + :param w: horizontal size. + :param h: vertical size. + """ + ecore_x_window_move_resize(self.xid, x, y, w, h) + + def geometry_get(self): + ":rtype: tuple of int" + cdef int x, y, w, h + ecore_x_window_geometry_get(self.xid, &x, &y, &w, &h) + return (x, y, w, h) + + property geometry: + def __set__(self, spec): + self.geometry_set(*spec) + + def __get__(self): + return self.geometry_get() + + def border_width_set(self, int width): + """Sets the width of the border of this window. + + :param width: border width, in pixels. + """ + ecore_x_window_border_width_set(self.xid, width) + + def border_width_get(self): + ":rtype: int" + return ecore_x_window_border_width_get(self.xid) + + property border_width: + def __set__(self, spec): + self.border_width_set(*spec) + + def __get__(self): + return self.border_width_get() + + def depth_get(self): + ":rtype: int" + return ecore_x_window_depth_get(self.xid) + + property depth: + def __get__(self): + return self.depth_get() + + def configure(self, int mask, int x, int y, int w, int h, int border_width, + Window sibling, int stack_mode): + cdef Ecore_X_Window sibling_xid + if sibling is None: + sibling_xid = 0 + else: + sibling_xid = sibling.xid + ecore_x_window_configure(self.xid, mask, + x, y, w, h, border_width, sibling_xid, + stack_mode) + + def cursor_show(self): + ecore_x_window_cursor_show(self.xid, 1) + + def cursor_hide(self): + ecore_x_window_cursor_show(self.xid, 0) + + def cursor_set(self, Ecore_X_Cursor cursor): + ecore_x_window_cursor_set(self.xid, cursor) + + def pointer_warp(self, int x, int y): + ecore_x_pointer_warp(self.xid, x, y) + + def pointer_xy_get(self): + cdef int x, y + ecore_x_pointer_xy_get(self.xid, &x, &y); + return (x, y) + + def defaults_set(self): + """Sets the default properties for the given window. + + The default properties set for the window are WM_CLIENT_MACHINE and + _NET_WM_PID. + """ + ecore_x_window_defaults_set(self.xid) + + def killall_children(self): + "Kill all clients with subwindows under this window." + ecore_x_killall(self.xid) + + def kill(self): + "Kill this specific client" + ecore_x_kill(self.xid) + + def background_color_set(self, int r, int g, int b): + """Set background color. + + :param r: red (0...65536, 16 bits) + :param g: green (0...65536, 16 bits) + :param 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 :py:meth:`area_clear`, but generates exposures." + ecore_x_window_area_expose(self.xid, x, y, w, h) + + def override_set(self, int setting): + ecore_x_window_override_set(self.xid, bool(setting)) + + def argb_get(self): + ":rtype: bool" + return bool(ecore_x_window_argb_get(self.xid)) + + def gravity_set(self, int gravity): + ecore_x_window_gravity_set(self.xid, gravity) + + def pixel_gravity_set(self, int gravity): + ecore_x_window_pixel_gravity_set(self.xid, gravity) + + def event_mask_set(self, int mask): + ecore_x_event_mask_set(self.xid, mask) + + def event_mask_unset(self, int mask): + ecore_x_event_mask_unset(self.xid, mask) + + def icccm_hints_set(self, int accepts_focus, int initial_state, + int icon_pixmap, int icon_mask, int icon_window, + int window_group, int is_urgent): + """Set ICCCM window hints. + + :param accepts_focus: if window accepts focus or not. + :param initial_state: one of ECORE_X_WINDOW_STATE_HINT_*. + :param icon_pixmap: pixmap id to be used as icon. + :param icon_mask: pixmap id to be used as icon mask. + :param icon_window: window id to be used as icon. + :param window_group: window id representing the group. + :param is_urgent: if window is urgent or not. + """ + ecore_x_icccm_hints_set(self.xid, accepts_focus, + initial_state, + icon_pixmap, icon_mask, icon_window, + window_group, is_urgent) + + def icccm_hints_get(self): + """Get ICCCM window hints. + + :see: :py:meth:`icccm_hints_set` + :return: tuple with: accepts_focus, initial_state, icon_pixmap, + icon_mask, icon_window, window_group, is_urgent + """ + cdef Eina_Bool accepts_focus, is_urgent + cdef int initial_state, icon_pixmap, icon_mask, \ + icon_window, window_group + ecore_x_icccm_hints_get(self.xid, &accepts_focus, + &initial_state, + &icon_pixmap, + &icon_mask, + &icon_window, + &window_group, + &is_urgent) + return (bool(accepts_focus), initial_state, icon_pixmap, icon_mask, + icon_window, window_group, bool(is_urgent)) + + def type_set(self, int type): + ecore_x_netwm_window_type_set(self.xid, type) + + def state_set(self, states): + # building list + cdef Ecore_X_Window_State *_states + _states = PyMem_Malloc(len(states) * sizeof(Ecore_X_Window_State)) + for i in xrange(len(states)): + _states[i] = states[i] + + ecore_x_netwm_window_state_set(self.xid, _states, len(states)) + PyMem_Free(_states) + +def Window_from_xid(unsigned long xid): + """Create a Python wrapper for given window id. + + :param xid: window id. + :rtype: L{Window} + """ + cdef Window w + w = Window.__new__(Window) + w._set_xid(xid) + return w diff --git a/examples/ecore/x/mplayer_embed.py b/examples/ecore/x/mplayer_embed.py new file mode 100644 index 0000000..079ded0 --- /dev/null +++ b/examples/ecore/x/mplayer_embed.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python + +import sys +import efl.ecore +from efl.ecore.x import init, Window, on_window_configure_add +from subprocess import Popen, PIPE + +init() + +try: + filename = sys.argv[1] +except IndexError, e: + raise SystemExit("Usage: %s " % sys.argv[0]) + +main_window = Window(w=800, h=600) +main_window.background_color_set(0xffff, 0, 0) +main_window.show() + +sub_window = Window(main_window, 10, 10, 780, 580) +sub_window.background_color_set(0, 0, 0xffff) +sub_window.show() + +cmd = ["/usr/bin/mplayer", "-slave", "-nomouseinput", "-quiet", + "-wid", str(sub_window.xid), filename] +p = Popen(cmd, stdin=PIPE, stdout=PIPE, close_fds=True) + + +def handle_read(fd_handler, file): + line = file.read(1) + r = bool(line and not fd_handler.has_error()) + if not r: + efl.ecore.main_loop_quit() + return r + + +def on_configure(event, main_window, sub_window): + if event.win == main_window: + sub_window.resize(event.w - 20, event.h - 20) + return True +on_window_configure_add(on_configure, main_window, sub_window) + +efl.ecore.fd_handler_add( + p.stdout, efl.ecore.ECORE_FD_ALL, handle_read, p.stdout) +efl.ecore.main_loop_begin() diff --git a/examples/ecore/x/window_creation.py b/examples/ecore/x/window_creation.py new file mode 100644 index 0000000..61c455a --- /dev/null +++ b/examples/ecore/x/window_creation.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python + +import efl.ecore +from efl.ecore.x import init, Window, on_window_configure_add + +init() + +# method 1 +main_window = Window(w=800, h=600) +main_window.background_color_set(0xffff, 0, 0) +main_window.show() + +sub_window = Window(main_window, 10, 10, 780, 580) +sub_window.background_color_set(0, 0, 0xffff) +sub_window.show() + + +def cb_on_configure(event, main_window, sub_window): + if event.win == main_window: + sub_window.resize(event.w - 20, event.h - 20) + return True +on_window_configure_add(cb_on_configure, main_window, sub_window) + + +# method 2: inheritance +class MyWindow(Window): + def __init__(self, w, h): + Window.__init__(self, w=w, h=h) + self.background_color_set(0xffff, 0, 0) + self.sub_window = Window(self, 10, 10, w - 20, h - 20) + self.sub_window.background_color_set(0, 0, 0xffff) + self.sub_window.show() + on_window_configure_add(self._cb_on_configure) + + def _cb_on_configure(self, event): + if event.win == self: + self.sub_window.resize(event.w - 20, event.h - 20) + return True + +other_window = MyWindow(400, 300) +other_window.show() + +efl.ecore.main_loop_begin() diff --git a/setup.py b/setup.py index 090070b..73b12f9 100755 --- a/setup.py +++ b/setup.py @@ -232,13 +232,32 @@ if set(("build", "build_ext", "install", "bdist", "sdist")) & set(sys.argv): ecore_cflags, ecore_libs = pkg_config('Ecore', 'ecore', EFL_MIN_VERSION) ecore_file_cflags, ecore_file_libs = pkg_config( 'EcoreFile', 'ecore-file', EFL_MIN_VERSION) - ecore_ext = Extension( - "ecore.__init__", ["efl/ecore/__init__" + module_suffix], - include_dirs=['include/'], - extra_compile_args=list(set(ecore_cflags + ecore_file_cflags)), - extra_link_args=ecore_libs + ecore_file_libs + eina_libs + evas_libs, - ) - modules.append(ecore_ext) + ecore_input_cflags, ecore_input_libs = pkg_config( + 'EcoreInput', 'ecore-input', EFL_MIN_VERSION) + ecore_x_cflags, ecore_x_libs = pkg_config( + 'EcoreX', 'ecore-x', EFL_MIN_VERSION) + ecore_exts = ( + Extension( + "ecore.__init__", ["efl/ecore/__init__" + module_suffix], + include_dirs=['include/'], + extra_compile_args=list(set(ecore_cflags + ecore_file_cflags)), + extra_link_args=ecore_libs + ecore_file_libs + eina_libs + + evas_libs + ), + Extension( + "ecore.x", ["efl/ecore/x" + module_suffix], + include_dirs=['include/'], + extra_compile_args= + list(set( + ecore_cflags + ecore_file_cflags + ecore_x_cflags + + ecore_input_cflags + )), + extra_link_args= + ecore_libs + ecore_file_libs + ecore_x_libs + ecore_input_libs + + eina_libs + evas_libs, + ) + ) + modules += ecore_exts packages.append("efl.ecore") # compatibility