summaryrefslogtreecommitdiff
path: root/efl
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2015-01-04 21:29:40 +0100
committerDave Andreoli <dave@gurumeditation.it>2015-01-04 21:29:40 +0100
commit419405e456c3b774ea726d199dbef07ac734a11b (patch)
treece1f41a9aa6a3f73de698a1c5023be97adadd369 /efl
parentf9e890672447aea2f1b9dcdd945ecaff304037e8 (diff)
New style enums for ecore
Diffstat (limited to 'efl')
-rw-r--r--efl/ecore/efl.ecore.pyx69
-rw-r--r--efl/ecore/efl.ecore_events.pxi10
-rw-r--r--efl/ecore/efl.ecore_exe.pxi64
-rw-r--r--efl/elementary/gengrid.pxd2
4 files changed, 53 insertions, 92 deletions
diff --git a/efl/ecore/efl.ecore.pyx b/efl/ecore/efl.ecore.pyx
index 1c16c07..1ddb182 100644
--- a/efl/ecore/efl.ecore.pyx
+++ b/efl/ecore/efl.ecore.pyx
@@ -158,6 +158,10 @@ Position mappings for the animation
158 158
159 Start at 0.0 then "wobble" like a spring rest position 1.0, and wobble v2 times, with decay factor of v1 159 Start at 0.0 then "wobble" like a spring rest position 1.0, and wobble v2 times, with decay factor of v1
160 160
161.. data:: ECORE_POS_MAP_CUBIC_BEZIER
162
163 TODO: Follow the cubic-bezier curve calculated with the control points (x1, y1), (x2, y2)
164
161 165
162.. _Ecore_Animator_Source: 166.. _Ecore_Animator_Source:
163 167
@@ -218,50 +222,7 @@ import traceback
218from efl.eo cimport Eo, PY_REFCOUNT 222from efl.eo cimport Eo, PY_REFCOUNT
219from efl.utils.conversions cimport _ctouni 223from efl.utils.conversions cimport _ctouni
220from cpython cimport Py_INCREF, Py_DECREF 224from cpython cimport Py_INCREF, Py_DECREF
221cimport efl.ecore.enums as enums 225
222
223ECORE_CALLBACK_CANCEL = enums.ECORE_CALLBACK_CANCEL
224ECORE_CALLBACK_RENEW = enums.ECORE_CALLBACK_RENEW
225
226ECORE_CALLBACK_PASS_ON = enums.ECORE_CALLBACK_PASS_ON
227ECORE_CALLBACK_DONE = enums.ECORE_CALLBACK_DONE
228
229# Ecore_Fd_Handler_Flags:
230ECORE_FD_READ = enums.ECORE_FD_READ
231ECORE_FD_WRITE = enums.ECORE_FD_WRITE
232ECORE_FD_ERROR = enums.ECORE_FD_ERROR
233ECORE_FD_ALL = 7
234
235# Ecore_Exe_Flags:
236ECORE_EXE_PIPE_READ = enums.ECORE_EXE_PIPE_READ
237ECORE_EXE_PIPE_WRITE = enums.ECORE_EXE_PIPE_WRITE
238ECORE_EXE_PIPE_ERROR = enums.ECORE_EXE_PIPE_ERROR
239ECORE_EXE_PIPE_READ_LINE_BUFFERED = enums.ECORE_EXE_PIPE_READ_LINE_BUFFERED
240ECORE_EXE_PIPE_ERROR_LINE_BUFFERED = enums.ECORE_EXE_PIPE_ERROR_LINE_BUFFERED
241ECORE_EXE_PIPE_AUTO = enums.ECORE_EXE_PIPE_AUTO
242ECORE_EXE_RESPAWN = enums.ECORE_EXE_RESPAWN
243ECORE_EXE_USE_SH = enums.ECORE_EXE_USE_SH
244ECORE_EXE_NOT_LEADER = enums.ECORE_EXE_NOT_LEADER
245ECORE_EXE_TERM_WITH_PARENT = enums.ECORE_EXE_TERM_WITH_PARENT
246
247ECORE_EXE_PRIORITY_INHERIT = 9999
248
249# Ecore_File_Progress_Return:
250ECORE_FILE_PROGRESS_CONTINUE = 0
251ECORE_FILE_PROGRESS_ABORT = 1
252
253# Ecore_File_Event
254ECORE_FILE_EVENT_NONE = enums.ECORE_FILE_EVENT_NONE
255ECORE_FILE_EVENT_CREATED_FILE = enums.ECORE_FILE_EVENT_CREATED_FILE
256ECORE_FILE_EVENT_CREATED_DIRECTORY = enums.ECORE_FILE_EVENT_CREATED_DIRECTORY
257ECORE_FILE_EVENT_DELETED_FILE = enums.ECORE_FILE_EVENT_DELETED_FILE
258ECORE_FILE_EVENT_DELETED_DIRECTORY = enums.ECORE_FILE_EVENT_DELETED_DIRECTORY
259ECORE_FILE_EVENT_DELETED_SELF = enums.ECORE_FILE_EVENT_DELETED_SELF
260ECORE_FILE_EVENT_MODIFIED = enums.ECORE_FILE_EVENT_MODIFIED
261ECORE_FILE_EVENT_CLOSED = enums.ECORE_FILE_EVENT_CLOSED
262
263# Ecore_Poller_Type:
264ECORE_POLLER_CORE = enums.ECORE_POLLER_CORE
265 226
266 227
267cdef Eina_Bool _ecore_task_cb(void *data) with gil: 228cdef Eina_Bool _ecore_task_cb(void *data) with gil:
@@ -293,16 +254,16 @@ def init():
293 254
294 global _event_type_mapping 255 global _event_type_mapping
295 _event_type_mapping = { 256 _event_type_mapping = {
296 enums.ECORE_EVENT_SIGNAL_USER: EventSignalUser, 257 ECORE_EVENT_SIGNAL_USER: EventSignalUser,
297 enums.ECORE_EVENT_SIGNAL_HUP: EventSignalHup, 258 ECORE_EVENT_SIGNAL_HUP: EventSignalHup,
298 enums.ECORE_EVENT_SIGNAL_EXIT: EventSignalExit, 259 ECORE_EVENT_SIGNAL_EXIT: EventSignalExit,
299 enums.ECORE_EVENT_SIGNAL_POWER: EventSignalPower, 260 ECORE_EVENT_SIGNAL_POWER: EventSignalPower,
300 enums.ECORE_EVENT_SIGNAL_REALTIME: EventSignalRealtime, 261 ECORE_EVENT_SIGNAL_REALTIME: EventSignalRealtime,
301 enums.ECORE_EXE_EVENT_ADD: EventExeAdd, 262 ECORE_EXE_EVENT_ADD: EventExeAdd,
302 enums.ECORE_EXE_EVENT_DEL: EventExeDel, 263 ECORE_EXE_EVENT_DEL: EventExeDel,
303 enums.ECORE_EXE_EVENT_DATA: EventExeData, 264 ECORE_EXE_EVENT_DATA: EventExeData,
304 enums.ECORE_EXE_EVENT_ERROR: EventExeData, 265 ECORE_EXE_EVENT_ERROR: EventExeData,
305 } 266 }
306 267
307 ecore_file_init() 268 ecore_file_init()
308 return r 269 return r
diff --git a/efl/ecore/efl.ecore_events.pxi b/efl/ecore/efl.ecore_events.pxi
index 685aafe..e80b3a2 100644
--- a/efl/ecore/efl.ecore_events.pxi
+++ b/efl/ecore/efl.ecore_events.pxi
@@ -166,7 +166,7 @@ cdef class EventSignalUser2(EventSignalUser):
166 166
167cdef class EventHandlerSignalUser(EventHandler): 167cdef class EventHandlerSignalUser(EventHandler):
168 def __init__(self, func, *args, **kargs): 168 def __init__(self, func, *args, **kargs):
169 EventHandler.__init__(self, enums.ECORE_EVENT_SIGNAL_USER, 169 EventHandler.__init__(self, ECORE_EVENT_SIGNAL_USER,
170 func, *args, **kargs) 170 func, *args, **kargs)
171 171
172 cdef Eina_Bool _exec(self, void *event) except 2: 172 cdef Eina_Bool _exec(self, void *event) except 2:
@@ -198,7 +198,7 @@ cdef class EventSignalHup(Event):
198 198
199 199
200def on_signal_hup(func, *args, **kargs): 200def on_signal_hup(func, *args, **kargs):
201 return EventHandler(enums.ECORE_EVENT_SIGNAL_HUP, func, *args, **kargs) 201 return EventHandler(ECORE_EVENT_SIGNAL_HUP, func, *args, **kargs)
202 202
203 203
204cdef class EventSignalExit(Event): 204cdef class EventSignalExit(Event):
@@ -245,7 +245,7 @@ cdef class EventSignalTerminate(EventSignalExit):
245 245
246cdef class EventHandlerSignalExit(EventHandler): 246cdef class EventHandlerSignalExit(EventHandler):
247 def __init__(self, func, *args, **kargs): 247 def __init__(self, func, *args, **kargs):
248 EventHandler.__init__(self, enums.ECORE_EVENT_SIGNAL_EXIT, 248 EventHandler.__init__(self, ECORE_EVENT_SIGNAL_EXIT,
249 func, *args, **kargs) 249 func, *args, **kargs)
250 250
251 cdef Eina_Bool _exec(self, void *event) except 2: 251 cdef Eina_Bool _exec(self, void *event) except 2:
@@ -279,7 +279,7 @@ cdef class EventSignalPower(Event):
279 279
280 280
281def on_signal_power(func, *args, **kargs): 281def on_signal_power(func, *args, **kargs):
282 return EventHandler(enums.ECORE_EVENT_SIGNAL_POWER, func, *args, **kargs) 282 return EventHandler(ECORE_EVENT_SIGNAL_POWER, func, *args, **kargs)
283 283
284 284
285cdef class EventSignalRealtime(Event): 285cdef class EventSignalRealtime(Event):
@@ -297,7 +297,7 @@ cdef class EventSignalRealtime(Event):
297 297
298 298
299def on_signal_realtime(func, *args, **kargs): 299def on_signal_realtime(func, *args, **kargs):
300 return EventHandler(enums.ECORE_EVENT_SIGNAL_REALTIME, func, *args, **kargs) 300 return EventHandler(ECORE_EVENT_SIGNAL_REALTIME, func, *args, **kargs)
301 301
302 302
303cdef class CustomEvent(Event): 303cdef class CustomEvent(Event):
diff --git a/efl/ecore/efl.ecore_exe.pxi b/efl/ecore/efl.ecore_exe.pxi
index c5979ad..14a3410 100644
--- a/efl/ecore/efl.ecore_exe.pxi
+++ b/efl/ecore/efl.ecore_exe.pxi
@@ -25,23 +25,23 @@ cdef extern from "Python.h":
25 25
26cdef exe_flags2str(int value): 26cdef exe_flags2str(int value):
27 flags = [] 27 flags = []
28 if value & enums.ECORE_EXE_PIPE_READ: 28 if value & ECORE_EXE_PIPE_READ:
29 flags.append("PIPE_READ") 29 flags.append("PIPE_READ")
30 if value & enums.ECORE_EXE_PIPE_WRITE: 30 if value & ECORE_EXE_PIPE_WRITE:
31 flags.append("PIPE_WRITE") 31 flags.append("PIPE_WRITE")
32 if value & enums.ECORE_EXE_PIPE_ERROR: 32 if value & ECORE_EXE_PIPE_ERROR:
33 flags.append("PIPE_ERROR") 33 flags.append("PIPE_ERROR")
34 if value & enums.ECORE_EXE_PIPE_READ_LINE_BUFFERED: 34 if value & ECORE_EXE_PIPE_READ_LINE_BUFFERED:
35 flags.append("PIPE_READ_LINE_BUFFERED") 35 flags.append("PIPE_READ_LINE_BUFFERED")
36 if value & enums.ECORE_EXE_PIPE_ERROR_LINE_BUFFERED: 36 if value & ECORE_EXE_PIPE_ERROR_LINE_BUFFERED:
37 flags.append("PIPE_ERROR_LINE_BUFFERED") 37 flags.append("PIPE_ERROR_LINE_BUFFERED")
38 if value & enums.ECORE_EXE_PIPE_AUTO: 38 if value & ECORE_EXE_PIPE_AUTO:
39 flags.append("PIPE_AUTO") 39 flags.append("PIPE_AUTO")
40 if value & enums.ECORE_EXE_RESPAWN: 40 if value & ECORE_EXE_RESPAWN:
41 flags.append("RESPAWN") 41 flags.append("RESPAWN")
42 if value & enums.ECORE_EXE_USE_SH: 42 if value & ECORE_EXE_USE_SH:
43 flags.append("USE_SH") 43 flags.append("USE_SH")
44 if value & enums.ECORE_EXE_NOT_LEADER: 44 if value & ECORE_EXE_NOT_LEADER:
45 flags.append("NOT_LEADER") 45 flags.append("NOT_LEADER")
46 return ", ".join(flags) 46 return ", ".join(flags)
47 47
@@ -58,17 +58,17 @@ cdef Eina_Bool _exe_event_filter_cb(void *data, int type, void *event) with gil:
58 58
59 try: 59 try:
60 assert self.event_type == type, "event is not what we asked? impossible" 60 assert self.event_type == type, "event is not what we asked? impossible"
61 if type == enums.ECORE_EXE_EVENT_ADD: 61 if type == ECORE_EXE_EVENT_ADD:
62 e_add = <Ecore_Exe_Event_Add *>event 62 e_add = <Ecore_Exe_Event_Add *>event
63 if e_add.exe != self.exe: 63 if e_add.exe != self.exe:
64 return 1 64 return 1
65 e = EventExeAdd() 65 e = EventExeAdd()
66 elif type == enums.ECORE_EXE_EVENT_DEL: 66 elif type == ECORE_EXE_EVENT_DEL:
67 e_del = <Ecore_Exe_Event_Del *>event 67 e_del = <Ecore_Exe_Event_Del *>event
68 if e_del.exe != self.exe: 68 if e_del.exe != self.exe:
69 return 1 69 return 1
70 e = EventExeDel() 70 e = EventExeDel()
71 elif type == enums.ECORE_EXE_EVENT_DATA or type == enums.ECORE_EXE_EVENT_ERROR: 71 elif type == ECORE_EXE_EVENT_DATA or type == ECORE_EXE_EVENT_ERROR:
72 e_data = <Ecore_Exe_Event_Data *>event 72 e_data = <Ecore_Exe_Event_Data *>event
73 if e_data.exe != self.exe: 73 if e_data.exe != self.exe:
74 return 1 74 return 1
@@ -632,10 +632,10 @@ cdef class Exe(object):
632 :see: on_exe_add_event_add() 632 :see: on_exe_add_event_add()
633 633
634 """ 634 """
635 filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_ADD) 635 filter = self.__callbacks.get(ECORE_EXE_EVENT_ADD)
636 if filter is None: 636 if filter is None:
637 filter = ExeEventFilter(self, enums.ECORE_EXE_EVENT_ADD) 637 filter = ExeEventFilter(self, ECORE_EXE_EVENT_ADD)
638 self.__callbacks[enums.ECORE_EXE_EVENT_ADD] = filter 638 self.__callbacks[ECORE_EXE_EVENT_ADD] = filter
639 filter.callback_add(func, args, kargs) 639 filter.callback_add(func, args, kargs)
640 640
641 def on_add_event_del(self, func, *args, **kargs): 641 def on_add_event_del(self, func, *args, **kargs):
@@ -646,7 +646,7 @@ cdef class Exe(object):
646 :raise ValueError: if parameters don't match an already 646 :raise ValueError: if parameters don't match an already
647 registered callback. 647 registered callback.
648 """ 648 """
649 filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_ADD) 649 filter = self.__callbacks.get(ECORE_EXE_EVENT_ADD)
650 if filter is None: 650 if filter is None:
651 raise ValueError("callback not registered %s, args=%s, kargs=%s" % 651 raise ValueError("callback not registered %s, args=%s, kargs=%s" %
652 (func, args, kargs)) 652 (func, args, kargs))
@@ -668,10 +668,10 @@ cdef class Exe(object):
668 :see: on_del_event_del() 668 :see: on_del_event_del()
669 :see: on_exe_del_event_add() 669 :see: on_exe_del_event_add()
670 """ 670 """
671 filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_DEL) 671 filter = self.__callbacks.get(ECORE_EXE_EVENT_DEL)
672 if filter is None: 672 if filter is None:
673 filter = ExeEventFilter(self, enums.ECORE_EXE_EVENT_DEL) 673 filter = ExeEventFilter(self, ECORE_EXE_EVENT_DEL)
674 self.__callbacks[enums.ECORE_EXE_EVENT_DEL] = filter 674 self.__callbacks[ECORE_EXE_EVENT_DEL] = filter
675 filter.callback_add(func, args, kargs) 675 filter.callback_add(func, args, kargs)
676 676
677 def on_del_event_del(self, func, *args, **kargs): 677 def on_del_event_del(self, func, *args, **kargs):
@@ -682,7 +682,7 @@ cdef class Exe(object):
682 :raise ValueError: if parameters don't match an already 682 :raise ValueError: if parameters don't match an already
683 registered callback. 683 registered callback.
684 """ 684 """
685 filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_DEL) 685 filter = self.__callbacks.get(ECORE_EXE_EVENT_DEL)
686 if filter is None: 686 if filter is None:
687 raise ValueError("callback not registered %s, args=%s, kargs=%s" % 687 raise ValueError("callback not registered %s, args=%s, kargs=%s" %
688 (func, args, kargs)) 688 (func, args, kargs))
@@ -704,10 +704,10 @@ cdef class Exe(object):
704 :see: on_data_event_del() 704 :see: on_data_event_del()
705 :see: on_exe_data_event_add() 705 :see: on_exe_data_event_add()
706 """ 706 """
707 filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_DATA) 707 filter = self.__callbacks.get(ECORE_EXE_EVENT_DATA)
708 if filter is None: 708 if filter is None:
709 filter = ExeEventFilter(self, enums.ECORE_EXE_EVENT_DATA) 709 filter = ExeEventFilter(self, ECORE_EXE_EVENT_DATA)
710 self.__callbacks[enums.ECORE_EXE_EVENT_DATA] = filter 710 self.__callbacks[ECORE_EXE_EVENT_DATA] = filter
711 filter.callback_add(func, args, kargs) 711 filter.callback_add(func, args, kargs)
712 712
713 def on_data_event_del(self, func, *args, **kargs): 713 def on_data_event_del(self, func, *args, **kargs):
@@ -718,7 +718,7 @@ cdef class Exe(object):
718 :raise ValueError: if parameters don't match an already 718 :raise ValueError: if parameters don't match an already
719 registered callback. 719 registered callback.
720 """ 720 """
721 filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_DATA) 721 filter = self.__callbacks.get(ECORE_EXE_EVENT_DATA)
722 if filter is None: 722 if filter is None:
723 raise ValueError("callback not registered %s, args=%s, kargs=%s" % 723 raise ValueError("callback not registered %s, args=%s, kargs=%s" %
724 (func, args, kargs)) 724 (func, args, kargs))
@@ -740,10 +740,10 @@ cdef class Exe(object):
740 :see: on_error_event_del() 740 :see: on_error_event_del()
741 :see: on_exe_error_event_add() 741 :see: on_exe_error_event_add()
742 """ 742 """
743 filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_ERROR) 743 filter = self.__callbacks.get(ECORE_EXE_EVENT_ERROR)
744 if filter is None: 744 if filter is None:
745 filter = ExeEventFilter(self, enums.ECORE_EXE_EVENT_ERROR) 745 filter = ExeEventFilter(self, ECORE_EXE_EVENT_ERROR)
746 self.__callbacks[enums.ECORE_EXE_EVENT_ERROR] = filter 746 self.__callbacks[ECORE_EXE_EVENT_ERROR] = filter
747 filter.callback_add(func, args, kargs) 747 filter.callback_add(func, args, kargs)
748 748
749 def on_error_event_del(self, func, *args, **kargs): 749 def on_error_event_del(self, func, *args, **kargs):
@@ -754,7 +754,7 @@ cdef class Exe(object):
754 :raise ValueError: if parameters don't match an already 754 :raise ValueError: if parameters don't match an already
755 registered callback. 755 registered callback.
756 """ 756 """
757 filter = self.__callbacks.get(enums.ECORE_EXE_EVENT_ERROR) 757 filter = self.__callbacks.get(ECORE_EXE_EVENT_ERROR)
758 if filter is None: 758 if filter is None:
759 raise ValueError("callback not registered %s, args=%s, kargs=%s" % 759 raise ValueError("callback not registered %s, args=%s, kargs=%s" %
760 (func, args, kargs)) 760 (func, args, kargs))
@@ -880,7 +880,7 @@ def on_exe_add_event_add(func, *args, **kargs):
880 :see: EventHandler 880 :see: EventHandler
881 :see: EventHandlerExe 881 :see: EventHandlerExe
882 """ 882 """
883 return EventHandlerExe(enums.ECORE_EXE_EVENT_ADD, func, *args, **kargs) 883 return EventHandlerExe(ECORE_EXE_EVENT_ADD, func, *args, **kargs)
884 884
885 885
886def on_exe_del_event_add(func, *args, **kargs): 886def on_exe_del_event_add(func, *args, **kargs):
@@ -889,7 +889,7 @@ def on_exe_del_event_add(func, *args, **kargs):
889 :see: EventHandler 889 :see: EventHandler
890 :see: EventHandlerExe 890 :see: EventHandlerExe
891 """ 891 """
892 return EventHandlerExe(enums.ECORE_EXE_EVENT_DEL, func, *args, **kargs) 892 return EventHandlerExe(ECORE_EXE_EVENT_DEL, func, *args, **kargs)
893 893
894 894
895def on_exe_data_event_add(func, *args, **kargs): 895def on_exe_data_event_add(func, *args, **kargs):
@@ -898,7 +898,7 @@ def on_exe_data_event_add(func, *args, **kargs):
898 :see: EventHandler 898 :see: EventHandler
899 :see: EventHandlerExe 899 :see: EventHandlerExe
900 """ 900 """
901 return EventHandlerExe(enums.ECORE_EXE_EVENT_DATA, func, *args, **kargs) 901 return EventHandlerExe(ECORE_EXE_EVENT_DATA, func, *args, **kargs)
902 902
903 903
904def on_exe_error_event_add(func, *args, **kargs): 904def on_exe_error_event_add(func, *args, **kargs):
@@ -907,4 +907,4 @@ def on_exe_error_event_add(func, *args, **kargs):
907 :see: :py:class:`EventHandler` 907 :see: :py:class:`EventHandler`
908 :see: :py:class:`EventHandlerExe` 908 :see: :py:class:`EventHandlerExe`
909 """ 909 """
910 return EventHandlerExe(enums.ECORE_EXE_EVENT_ERROR, func, *args, **kargs) 910 return EventHandlerExe(ECORE_EXE_EVENT_ERROR, func, *args, **kargs)
diff --git a/efl/elementary/gengrid.pxd b/efl/elementary/gengrid.pxd
index 3d166d7..07e6f04 100644
--- a/efl/elementary/gengrid.pxd
+++ b/efl/elementary/gengrid.pxd
@@ -5,7 +5,7 @@ from object_item cimport Elm_Object_Item
5from general cimport Elm_Tooltip_Item_Content_Cb 5from general cimport Elm_Tooltip_Item_Content_Cb
6from enums cimport Elm_Genlist_Item_Scrollto_Type, Elm_Object_Select_Mode, \ 6from enums cimport Elm_Genlist_Item_Scrollto_Type, Elm_Object_Select_Mode, \
7 Elm_Object_Multi_Select_Mode, Elm_Glob_Match_Flags, Elm_Gengrid_Reorder_Type 7 Elm_Object_Multi_Select_Mode, Elm_Glob_Match_Flags, Elm_Gengrid_Reorder_Type
8from efl.ecore.enums cimport Ecore_Pos_Map 8from efl.ecore cimport Ecore_Pos_Map
9 9
10cdef extern from "Elementary.h": 10cdef extern from "Elementary.h":
11 ctypedef char *(*GengridItemLabelGetFunc) (void *data, Evas_Object *obj, const char *part) 11 ctypedef char *(*GengridItemLabelGetFunc) (void *data, Evas_Object *obj, const char *part)