diff options
Diffstat (limited to '')
-rw-r--r-- | efl/elementary/elementary_cdef.pxi | 2 | ||||
-rw-r--r-- | efl/elementary/systray.pxi | 130 | ||||
-rw-r--r-- | efl/elementary/systray_cdef.pxi | 34 | ||||
-rw-r--r-- | efl/eo/efl.eo.pyx | 62 | ||||
-rw-r--r-- | efl/evas/efl.evas_object_smart.pxi | 28 | ||||
-rw-r--r-- | include/efl.c_eo.pxd | 54 |
6 files changed, 128 insertions, 182 deletions
diff --git a/efl/elementary/elementary_cdef.pxi b/efl/elementary/elementary_cdef.pxi index 2e3c1cc..bf56d09 100644 --- a/efl/elementary/elementary_cdef.pxi +++ b/efl/elementary/elementary_cdef.pxi | |||
@@ -1,4 +1,4 @@ | |||
1 | from efl.c_eo cimport Eo as cEo, Eo_Class, eo_add, eo_do, eo_do_ret | 1 | from efl.c_eo cimport Eo as cEo, Eo_Class, eo_add |
2 | from efl.eina cimport Eina_Rectangle, Eina_Compare_Cb, \ | 2 | from efl.eina cimport Eina_Rectangle, Eina_Compare_Cb, \ |
3 | eina_list_free, eina_list_append, eina_stringshare_del | 3 | eina_list_free, eina_list_append, eina_stringshare_del |
4 | from efl.evas cimport Eina_List, Eina_Bool, Evas_Object, Evas_Font_Size, \ | 4 | from efl.evas cimport Eina_List, Eina_Bool, Evas_Object, Evas_Font_Size, \ |
diff --git a/efl/elementary/systray.pxi b/efl/elementary/systray.pxi index 7bf021b..e08cd80 100644 --- a/efl/elementary/systray.pxi +++ b/efl/elementary/systray.pxi | |||
@@ -37,27 +37,21 @@ cdef class Systray(Eo): | |||
37 | """ | 37 | """ |
38 | def __set__(self, value): | 38 | def __set__(self, value): |
39 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) | 39 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) |
40 | eo_do(self.obj, elm_obj_systray_id_set( | 40 | elm_obj_systray_id_set( |
41 | <const char *>value if value is not None else NULL | 41 | self.obj, <const char *>value if value is not None else NULL |
42 | ) | 42 | ) |
43 | ) | ||
44 | 43 | ||
45 | def __get__(self): | 44 | def __get__(self): |
46 | cdef const char *value = "" | 45 | return _ctouni(elm_obj_systray_id_get(self.obj)) |
47 | eo_do_ret(self.obj, value, elm_obj_systray_id_get()) | ||
48 | return _ctouni(value) | ||
49 | 46 | ||
50 | def id_set(self, value): | 47 | def id_set(self, value): |
51 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) | 48 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) |
52 | eo_do(self.obj, elm_obj_systray_id_set( | 49 | elm_obj_systray_id_set( |
53 | <const char *>value if value is not None else NULL | 50 | self.obj, <const char *>value if value is not None else NULL |
54 | ) | 51 | ) |
55 | ) | ||
56 | 52 | ||
57 | def id_get(self): | 53 | def id_get(self): |
58 | cdef const char *value = "" | 54 | return _ctouni(elm_obj_systray_id_get(self.obj)) |
59 | eo_do_ret(self.obj, value, elm_obj_systray_id_get()) | ||
60 | return _ctouni(value) | ||
61 | 55 | ||
62 | property category: | 56 | property category: |
63 | """ | 57 | """ |
@@ -68,20 +62,16 @@ cdef class Systray(Eo): | |||
68 | 62 | ||
69 | """ | 63 | """ |
70 | def __set__(self, Elm_Systray_Category value): | 64 | def __set__(self, Elm_Systray_Category value): |
71 | eo_do(self.obj, elm_obj_systray_category_set(value)) | 65 | elm_obj_systray_category_set(self.obj, value) |
72 | 66 | ||
73 | def __get__(self): | 67 | def __get__(self): |
74 | cdef Elm_Systray_Category value = ELM_SYSTRAY_CATEGORY_APP_STATUS | 68 | return <Elm_Systray_Category>elm_obj_systray_category_get(self.obj) |
75 | eo_do_ret(self.obj, value, elm_obj_systray_category_get()) | ||
76 | return <Elm_Systray_Category>value | ||
77 | 69 | ||
78 | def category_set(self, Elm_Systray_Category value): | 70 | def category_set(self, Elm_Systray_Category value): |
79 | eo_do(self.obj, elm_obj_systray_category_set(value)) | 71 | elm_obj_systray_category_set(self.obj, value) |
80 | 72 | ||
81 | def category_get(self): | 73 | def category_get(self): |
82 | cdef Elm_Systray_Category value = ELM_SYSTRAY_CATEGORY_APP_STATUS | 74 | return <Elm_Systray_Category>elm_obj_systray_category_get(self.obj) |
83 | eo_do_ret(self.obj, value, elm_obj_systray_category_get()) | ||
84 | return value | ||
85 | 75 | ||
86 | property icon_theme_path: | 76 | property icon_theme_path: |
87 | """The path to the theme where the icons can be found. | 77 | """The path to the theme where the icons can be found. |
@@ -92,27 +82,21 @@ cdef class Systray(Eo): | |||
92 | """ | 82 | """ |
93 | def __set__(self, value): | 83 | def __set__(self, value): |
94 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) | 84 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) |
95 | eo_do(self.obj, elm_obj_systray_icon_theme_path_set( | 85 | elm_obj_systray_icon_theme_path_set( |
96 | <const char *>value if value is not None else NULL | 86 | self.obj, <const char *>value if value is not None else NULL |
97 | ) | 87 | ) |
98 | ) | ||
99 | 88 | ||
100 | def __get__(self): | 89 | def __get__(self): |
101 | cdef const char *value = "" | 90 | return _ctouni(elm_obj_systray_icon_theme_path_get(self.obj)) |
102 | eo_do_ret(self.obj, value, elm_obj_systray_icon_theme_path_get()) | ||
103 | return _ctouni(value) | ||
104 | 91 | ||
105 | def icon_theme_path_set(self, value): | 92 | def icon_theme_path_set(self, value): |
106 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) | 93 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) |
107 | eo_do(self.obj, elm_obj_systray_icon_theme_path_set( | 94 | elm_obj_systray_icon_theme_path_set( |
108 | <const char *>value if value is not None else NULL | 95 | self.obj, <const char *>value if value is not None else NULL |
109 | ) | 96 | ) |
110 | ) | ||
111 | 97 | ||
112 | def icon_theme_path_get(self): | 98 | def icon_theme_path_get(self): |
113 | cdef const char *value = "" | 99 | return _ctouni(elm_obj_systray_icon_theme_path_get(self.obj)) |
114 | eo_do_ret(self.obj, value, elm_obj_systray_icon_theme_path_get()) | ||
115 | return _ctouni(value) | ||
116 | 100 | ||
117 | property menu: | 101 | property menu: |
118 | """The D-Bus Menu to be shown when the Status Notifier Item is activated by the user. | 102 | """The D-Bus Menu to be shown when the Status Notifier Item is activated by the user. |
@@ -120,20 +104,16 @@ cdef class Systray(Eo): | |||
120 | :type: :class:`~efl.elementary.menu.Menu` | 104 | :type: :class:`~efl.elementary.menu.Menu` |
121 | """ | 105 | """ |
122 | def __set__(self, Eo value): | 106 | def __set__(self, Eo value): |
123 | eo_do(self.obj, elm_obj_systray_menu_set(value.obj)) | 107 | elm_obj_systray_menu_set(self.obj, value.obj) |
124 | 108 | ||
125 | def __get__(self): | 109 | def __get__(self): |
126 | cdef const cEo *value = NULL | 110 | return object_from_instance(elm_obj_systray_menu_get(self.obj)) |
127 | eo_do_ret(self.obj, value, elm_obj_systray_menu_get()) | ||
128 | return object_from_instance(<cEo *>value) | ||
129 | 111 | ||
130 | def menu_set(self, Eo value): | 112 | def menu_set(self, Eo value): |
131 | eo_do(self.obj, elm_obj_systray_menu_set(value.obj)) | 113 | elm_obj_systray_menu_set(self.obj, value.obj) |
132 | 114 | ||
133 | def menu_get(self): | 115 | def menu_get(self): |
134 | cdef const cEo *value = NULL | 116 | return object_from_instance(elm_obj_systray_menu_get(self.obj)) |
135 | eo_do_ret(self.obj, value, elm_obj_systray_menu_get()) | ||
136 | return object_from_instance(<cEo *>value) | ||
137 | 117 | ||
138 | property att_icon_name: | 118 | property att_icon_name: |
139 | """The name of the attention icon to be used by the Status Notifier Item. | 119 | """The name of the attention icon to be used by the Status Notifier Item. |
@@ -142,27 +122,21 @@ cdef class Systray(Eo): | |||
142 | """ | 122 | """ |
143 | def __set__(self, value): | 123 | def __set__(self, value): |
144 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) | 124 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) |
145 | eo_do(self.obj, elm_obj_systray_att_icon_name_set( | 125 | elm_obj_systray_att_icon_name_set( |
146 | <const char *>value if value is not None else NULL | 126 | self.obj, <const char *>value if value is not None else NULL |
147 | ) | 127 | ) |
148 | ) | ||
149 | 128 | ||
150 | def __get__(self): | 129 | def __get__(self): |
151 | cdef const char *value = "" | 130 | return _ctouni(elm_obj_systray_att_icon_name_get(self.obj)) |
152 | eo_do_ret(self.obj, value, elm_obj_systray_att_icon_name_get()) | ||
153 | return _ctouni(value) | ||
154 | 131 | ||
155 | def att_icon_name_set(self, value): | 132 | def att_icon_name_set(self, value): |
156 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) | 133 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) |
157 | eo_do(self.obj, elm_obj_systray_att_icon_name_set( | 134 | elm_obj_systray_att_icon_name_set( |
158 | <const char *>value if value is not None else NULL | 135 | self.obj, <const char *>value if value is not None else NULL |
159 | ) | 136 | ) |
160 | ) | ||
161 | 137 | ||
162 | def att_icon_name_get(self): | 138 | def att_icon_name_get(self): |
163 | cdef const char *value = "" | 139 | return _ctouni(elm_obj_systray_att_icon_name_get(self.obj)) |
164 | eo_do_ret(self.obj, value, elm_obj_systray_att_icon_name_get()) | ||
165 | return _ctouni(value) | ||
166 | 140 | ||
167 | property status: | 141 | property status: |
168 | """The status of the Status Notifier Item. | 142 | """The status of the Status Notifier Item. |
@@ -170,20 +144,16 @@ cdef class Systray(Eo): | |||
170 | :type: :ref:`Elm_Systray_Status` | 144 | :type: :ref:`Elm_Systray_Status` |
171 | """ | 145 | """ |
172 | def __set__(self, Elm_Systray_Status value): | 146 | def __set__(self, Elm_Systray_Status value): |
173 | eo_do(self.obj, elm_obj_systray_status_set(value)) | 147 | elm_obj_systray_status_set(self.obj, value) |
174 | 148 | ||
175 | def __get__(self): | 149 | def __get__(self): |
176 | cdef Elm_Systray_Status value = ELM_SYSTRAY_STATUS_PASSIVE | 150 | return elm_obj_systray_status_get(self.obj) |
177 | eo_do_ret(self.obj, value, elm_obj_systray_status_get()) | ||
178 | return value | ||
179 | 151 | ||
180 | def status_set(self, Elm_Systray_Status value): | 152 | def status_set(self, Elm_Systray_Status value): |
181 | eo_do(self.obj, elm_obj_systray_status_set(value)) | 153 | elm_obj_systray_status_set(self.obj, value) |
182 | 154 | ||
183 | def status_get(self): | 155 | def status_get(self): |
184 | cdef Elm_Systray_Status value = ELM_SYSTRAY_STATUS_PASSIVE | 156 | return elm_obj_systray_status_get(self.obj) |
185 | eo_do_ret(self.obj, value, elm_obj_systray_status_get()) | ||
186 | return value | ||
187 | 157 | ||
188 | property icon_name: | 158 | property icon_name: |
189 | """The name of the icon to be used by the Status Notifier Item. | 159 | """The name of the icon to be used by the Status Notifier Item. |
@@ -192,27 +162,21 @@ cdef class Systray(Eo): | |||
192 | """ | 162 | """ |
193 | def __set__(self, value): | 163 | def __set__(self, value): |
194 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) | 164 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) |
195 | eo_do(self.obj, elm_obj_systray_icon_name_set( | 165 | elm_obj_systray_icon_name_set( |
196 | <const char *>value if value is not None else NULL | 166 | self.obj, <const char *>value if value is not None else NULL |
197 | ) | 167 | ) |
198 | ) | ||
199 | 168 | ||
200 | def __get__(self): | 169 | def __get__(self): |
201 | cdef const char *value = "" | 170 | return _ctouni(elm_obj_systray_icon_name_get(self.obj)) |
202 | eo_do_ret(self.obj, value, elm_obj_systray_icon_name_get()) | ||
203 | return _ctouni(value) | ||
204 | 171 | ||
205 | def icon_name_set(self, value): | 172 | def icon_name_set(self, value): |
206 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) | 173 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) |
207 | eo_do(self.obj, elm_obj_systray_icon_name_set( | 174 | elm_obj_systray_icon_name_set( |
208 | <const char *>value if value is not None else NULL | 175 | self.obj, <const char *>value if value is not None else NULL |
209 | ) | 176 | ) |
210 | ) | ||
211 | 177 | ||
212 | def icon_name_get(self): | 178 | def icon_name_get(self): |
213 | cdef const char *value = "" | 179 | return _ctouni(elm_obj_systray_icon_name_get(self.obj)) |
214 | eo_do_ret(self.obj, value, elm_obj_systray_icon_name_get()) | ||
215 | return _ctouni(value) | ||
216 | 180 | ||
217 | property title: | 181 | property title: |
218 | """The title of the Status Notifier Item. | 182 | """The title of the Status Notifier Item. |
@@ -221,27 +185,21 @@ cdef class Systray(Eo): | |||
221 | """ | 185 | """ |
222 | def __set__(self, value): | 186 | def __set__(self, value): |
223 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) | 187 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) |
224 | eo_do(self.obj, elm_obj_systray_title_set( | 188 | elm_obj_systray_title_set( |
225 | <const char *>value if value is not None else NULL | 189 | self.obj, <const char *>value if value is not None else NULL |
226 | ) | 190 | ) |
227 | ) | ||
228 | 191 | ||
229 | def __get__(self): | 192 | def __get__(self): |
230 | cdef const char *value = "" | 193 | return _ctouni(elm_obj_systray_title_get(self.obj)) |
231 | eo_do_ret(self.obj, value, elm_obj_systray_title_get()) | ||
232 | return _ctouni(value) | ||
233 | 194 | ||
234 | def title_set(self, value): | 195 | def title_set(self, value): |
235 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) | 196 | if isinstance(value, unicode): value = PyUnicode_AsUTF8String(value) |
236 | eo_do(self.obj, elm_obj_systray_title_set( | 197 | elm_obj_systray_title_set( |
237 | <const char *>value if value is not None else NULL | 198 | self.obj, <const char *>value if value is not None else NULL |
238 | ) | 199 | ) |
239 | ) | ||
240 | 200 | ||
241 | def title_get(self): | 201 | def title_get(self): |
242 | cdef const char *value = "" | 202 | return _ctouni(elm_obj_systray_title_get(self.obj)) |
243 | eo_do_ret(self.obj, value, elm_obj_systray_title_get()) | ||
244 | return _ctouni(value) | ||
245 | 203 | ||
246 | def register(self): | 204 | def register(self): |
247 | """Register this Status Notifier Item in the System Tray Watcher. | 205 | """Register this Status Notifier Item in the System Tray Watcher. |
@@ -251,9 +209,7 @@ cdef class Systray(Eo): | |||
251 | :func:`on_systray_ready`, is emitted. | 209 | :func:`on_systray_ready`, is emitted. |
252 | 210 | ||
253 | """ | 211 | """ |
254 | cdef Eina_Bool value = 0 | 212 | return elm_obj_systray_register(self.obj) |
255 | eo_do_ret(self.obj, value, elm_obj_systray_register()) | ||
256 | return value | ||
257 | 213 | ||
258 | 214 | ||
259 | def on_systray_ready(func, *args, **kwargs): | 215 | def on_systray_ready(func, *args, **kwargs): |
diff --git a/efl/elementary/systray_cdef.pxi b/efl/elementary/systray_cdef.pxi index f4b558f..62e8451 100644 --- a/efl/elementary/systray_cdef.pxi +++ b/efl/elementary/systray_cdef.pxi | |||
@@ -21,20 +21,20 @@ cdef extern from "Elementary.h": | |||
21 | 21 | ||
22 | const Eo_Class *elm_systray_class_get() | 22 | const Eo_Class *elm_systray_class_get() |
23 | 23 | ||
24 | void elm_obj_systray_id_set(const char *id) | 24 | void elm_obj_systray_id_set(cEo *obj, const char *id) |
25 | const char * elm_obj_systray_id_get() | 25 | const char * elm_obj_systray_id_get(const cEo *obj) |
26 | void elm_obj_systray_category_set(Elm_Systray_Category cat) | 26 | void elm_obj_systray_category_set(cEo *obj, Elm_Systray_Category cat) |
27 | Elm_Systray_Category elm_obj_systray_category_get() | 27 | Elm_Systray_Category elm_obj_systray_category_get(const cEo *obj) |
28 | void elm_obj_systray_icon_theme_path_set(const char *icon_theme_path) | 28 | void elm_obj_systray_icon_theme_path_set(cEo *obj, const char *icon_theme_path) |
29 | const char * elm_obj_systray_icon_theme_path_get() | 29 | const char * elm_obj_systray_icon_theme_path_get(const cEo *obj) |
30 | void elm_obj_systray_menu_set(const cEo *menu) | 30 | void elm_obj_systray_menu_set(cEo *obj, const cEo *menu) |
31 | const cEo * elm_obj_systray_menu_get() | 31 | const cEo * elm_obj_systray_menu_get(const cEo *obj) |
32 | void elm_obj_systray_att_icon_name_set(const char *att_icon_name) | 32 | void elm_obj_systray_att_icon_name_set(cEo *obj, const char *att_icon_name) |
33 | const char * elm_obj_systray_att_icon_name_get() | 33 | const char * elm_obj_systray_att_icon_name_get(const cEo *obj) |
34 | void elm_obj_systray_status_set(Elm_Systray_Status st) | 34 | void elm_obj_systray_status_set(cEo *obj, Elm_Systray_Status st) |
35 | Elm_Systray_Status elm_obj_systray_status_get() | 35 | Elm_Systray_Status elm_obj_systray_status_get(const cEo *obj) |
36 | void elm_obj_systray_icon_name_set(const char *icon_name) | 36 | void elm_obj_systray_icon_name_set(cEo *obj, const char *icon_name) |
37 | const char * elm_obj_systray_icon_name_get() | 37 | const char * elm_obj_systray_icon_name_get(const cEo *obj) |
38 | void elm_obj_systray_title_set(const char *title) | 38 | void elm_obj_systray_title_set(cEo *obj, const char *title) |
39 | const char * elm_obj_systray_title_get() | 39 | const char * elm_obj_systray_title_get(const cEo *obj) |
40 | Eina_Bool elm_obj_systray_register() | 40 | Eina_Bool elm_obj_systray_register(const cEo *obj) |
diff --git a/efl/eo/efl.eo.pyx b/efl/eo/efl.eo.pyx index 391c4a7..aa5bbaf 100644 --- a/efl/eo/efl.eo.pyx +++ b/efl/eo/efl.eo.pyx | |||
@@ -36,15 +36,15 @@ from efl.eina cimport Eina_Bool, \ | |||
36 | Eina_Hash, eina_hash_string_superfast_new, eina_hash_add, eina_hash_del, \ | 36 | Eina_Hash, eina_hash_string_superfast_new, eina_hash_add, eina_hash_del, \ |
37 | eina_hash_find, EINA_LOG_DOM_DBG, EINA_LOG_DOM_INFO, \ | 37 | eina_hash_find, EINA_LOG_DOM_DBG, EINA_LOG_DOM_INFO, \ |
38 | Eina_Iterator, eina_iterator_next, eina_iterator_free | 38 | Eina_Iterator, eina_iterator_next, eina_iterator_free |
39 | from efl.c_eo cimport Eo as cEo, eo_init, eo_shutdown, eo_del, eo_do, \ | 39 | from efl.c_eo cimport Eo as cEo, eo_init, eo_shutdown, eo_del, \ |
40 | eo_do_ret, eo_class_name_get, eo_class_get, eo_base_class_get,\ | 40 | eo_class_name_get, eo_class_get, eo_base_class_get,\ |
41 | eo_key_data_set, eo_key_data_get, eo_key_data_del, \ | 41 | eo_key_data_set, eo_key_data_get, eo_key_data_del, \ |
42 | eo_event_callback_add, eo_event_callback_del, EO_EV_DEL, \ | 42 | eo_event_callback_add, eo_event_callback_del, EO_EV_DEL, \ |
43 | eo_parent_get, eo_parent_set, Eo_Event_Description, \ | 43 | eo_parent_get, eo_parent_set, Eo_Event_Description, \ |
44 | eo_event_freeze, eo_event_thaw, eo_event_freeze_count_get, \ | 44 | eo_event_freeze, eo_event_thaw, eo_event_freeze_count_get, \ |
45 | eo_event_global_freeze, eo_event_global_thaw, \ | 45 | eo_event_global_freeze, eo_event_global_thaw, \ |
46 | eo_event_global_freeze_count_get, EO_CALLBACK_STOP, \ | 46 | eo_event_global_freeze_count_get, EO_CALLBACK_STOP, \ |
47 | eo_children_iterator_new | 47 | eo_children_iterator_new, Eo_Event2 |
48 | 48 | ||
49 | from efl.utils.logger cimport add_logger | 49 | from efl.utils.logger cimport add_logger |
50 | 50 | ||
@@ -71,18 +71,13 @@ init() | |||
71 | atexit.register(shutdown) | 71 | atexit.register(shutdown) |
72 | 72 | ||
73 | def event_global_freeze_count_get(): | 73 | def event_global_freeze_count_get(): |
74 | cdef int fcount = 0 | 74 | return eo_event_global_freeze_count_get(<const cEo *>eo_base_class_get()) |
75 | fcount = <int>eo_do_ret(<const cEo *>eo_base_class_get(), fcount, | ||
76 | eo_event_global_freeze_count_get()) | ||
77 | return fcount | ||
78 | 75 | ||
79 | def event_global_freeze(): | 76 | def event_global_freeze(): |
80 | eo_do(<const cEo *>eo_base_class_get(), | 77 | eo_event_global_freeze(<const cEo *>eo_base_class_get()) |
81 | eo_event_global_freeze()) | ||
82 | 78 | ||
83 | def event_global_thaw(): | 79 | def event_global_thaw(): |
84 | eo_do(<const cEo *>eo_base_class_get(), | 80 | eo_event_global_thaw(<const cEo *>eo_base_class_get()) |
85 | eo_event_global_thaw()) | ||
86 | 81 | ||
87 | ###################################################################### | 82 | ###################################################################### |
88 | 83 | ||
@@ -125,7 +120,7 @@ cdef api object object_from_instance(cEo *obj): | |||
125 | if obj == NULL: | 120 | if obj == NULL: |
126 | return None | 121 | return None |
127 | 122 | ||
128 | data = eo_do_ret(obj, data, eo_key_data_get("python-eo")) | 123 | data = eo_key_data_get(obj, "python-eo") |
129 | if data != NULL: | 124 | if data != NULL: |
130 | EINA_LOG_DOM_DBG(PY_EFL_EO_LOG_DOMAIN, | 125 | EINA_LOG_DOM_DBG(PY_EFL_EO_LOG_DOMAIN, |
131 | "Returning a Python object instance for Eo of type %s.", cls_name) | 126 | "Returning a Python object instance for Eo of type %s.", cls_name) |
@@ -187,18 +182,15 @@ cdef void _register_decorated_callbacks(Eo obj): | |||
187 | ###################################################################### | 182 | ###################################################################### |
188 | 183 | ||
189 | 184 | ||
190 | cdef Eina_Bool _eo_event_del_cb(void *data, cEo *obj, | 185 | cdef Eina_Bool _eo_event_del_cb(void *data, const Eo_Event2 *event) with gil: |
191 | const Eo_Event_Description *desc, | ||
192 | void *event_info) with gil: | ||
193 | cdef: | 186 | cdef: |
194 | Eo self = <Eo>data | 187 | Eo self = <Eo>data |
195 | const char *cls_name = eo_class_name_get(eo_class_get(obj)) | 188 | const char *cls_name = eo_class_name_get(eo_class_get(self.obj)) |
196 | 189 | ||
197 | EINA_LOG_DOM_DBG(PY_EFL_EO_LOG_DOMAIN, "Deleting Eo: %s", cls_name) | 190 | EINA_LOG_DOM_DBG(PY_EFL_EO_LOG_DOMAIN, "Deleting Eo: %s", cls_name) |
198 | 191 | ||
199 | eo_do(self.obj, | 192 | eo_event_callback_del(self.obj, EO_EV_DEL, _eo_event_del_cb, <const void *>self) |
200 | eo_event_callback_del(EO_EV_DEL, _eo_event_del_cb, <const void *>self)) | 193 | eo_key_data_del(self.obj, "python-eo") |
201 | eo_do(self.obj, eo_key_data_del("python-eo")) | ||
202 | self.obj = NULL | 194 | self.obj = NULL |
203 | Py_DECREF(self) | 195 | Py_DECREF(self) |
204 | 196 | ||
@@ -244,7 +236,7 @@ cdef class Eo(object): | |||
244 | def __repr__(self): | 236 | def __repr__(self): |
245 | cdef cEo *parent = NULL | 237 | cdef cEo *parent = NULL |
246 | if self.obj != NULL: | 238 | if self.obj != NULL: |
247 | parent = <cEo *>eo_do_ret(self.obj, parent, eo_parent_get()) | 239 | parent = eo_parent_get(self.obj) |
248 | return ("<%s object (Eo) at %#x (obj=%#x, parent=%#x, refcount=%d)>") % ( | 240 | return ("<%s object (Eo) at %#x (obj=%#x, parent=%#x, refcount=%d)>") % ( |
249 | type(self).__name__, | 241 | type(self).__name__, |
250 | <uintptr_t><void *>self, | 242 | <uintptr_t><void *>self, |
@@ -260,9 +252,8 @@ cdef class Eo(object): | |||
260 | assert obj != NULL, "Cannot set a NULL object" | 252 | assert obj != NULL, "Cannot set a NULL object" |
261 | 253 | ||
262 | self.obj = obj | 254 | self.obj = obj |
263 | eo_do(self.obj, eo_key_data_set("python-eo", <void *>self)) | 255 | eo_key_data_set(self.obj, "python-eo", <void *>self) |
264 | eo_do(self.obj, | 256 | eo_event_callback_add(self.obj, EO_EV_DEL, _eo_event_del_cb, <const void *>self) |
265 | eo_event_callback_add(EO_EV_DEL, _eo_event_del_cb, <const void *>self)) | ||
266 | Py_INCREF(self) | 257 | Py_INCREF(self) |
267 | 258 | ||
268 | return 1 | 259 | return 1 |
@@ -274,10 +265,7 @@ cdef class Eo(object): | |||
274 | return 1 | 265 | return 1 |
275 | 266 | ||
276 | def __iter__(self): | 267 | def __iter__(self): |
277 | cdef: | 268 | return EoIterator.create(eo_children_iterator_new(self.obj)) |
278 | void *tmp = NULL | ||
279 | eo_do_ret(self.obj, tmp, eo_children_iterator_new()) | ||
280 | return EoIterator.create(<Eina_Iterator *>tmp) | ||
281 | 269 | ||
282 | def delete(self): | 270 | def delete(self): |
283 | """Delete the object and free internal resources. | 271 | """Delete the object and free internal resources. |
@@ -305,28 +293,24 @@ cdef class Eo(object): | |||
305 | 293 | ||
306 | """ | 294 | """ |
307 | def __set__(self, Eo parent): | 295 | def __set__(self, Eo parent): |
308 | eo_do(self.obj, eo_parent_set(parent.obj)) | 296 | eo_parent_set(self.obj, parent.obj) |
309 | 297 | ||
310 | def __get__(self): | 298 | def __get__(self): |
311 | cdef cEo *parent = NULL | 299 | return object_from_instance(eo_parent_get(self.obj)) |
312 | parent = <cEo *>eo_do_ret(self.obj, parent, eo_parent_get()) | ||
313 | return object_from_instance(parent) | ||
314 | 300 | ||
315 | def parent_set(self, Eo parent): | 301 | def parent_set(self, Eo parent): |
316 | eo_do(self.obj, eo_parent_set(parent.obj)) | 302 | eo_parent_set(self.obj, parent.obj) |
317 | 303 | ||
318 | def parent_get(self): | 304 | def parent_get(self): |
319 | cdef cEo *parent = NULL | 305 | return object_from_instance(eo_parent_get(self.obj)) |
320 | parent = <cEo *>eo_do_ret(self.obj, parent, eo_parent_get()) | ||
321 | return object_from_instance(parent) | ||
322 | 306 | ||
323 | def event_freeze(self): | 307 | def event_freeze(self): |
324 | """Pause event propagation for this object.""" | 308 | """Pause event propagation for this object.""" |
325 | eo_do(self.obj, eo_event_freeze()) | 309 | eo_event_freeze(self.obj) |
326 | 310 | ||
327 | def event_thaw(self): | 311 | def event_thaw(self): |
328 | """Restart event propagation for this object.""" | 312 | """Restart event propagation for this object.""" |
329 | eo_do(self.obj, eo_event_thaw()) | 313 | eo_event_thaw(self.obj) |
330 | 314 | ||
331 | def event_freeze_count_get(self): | 315 | def event_freeze_count_get(self): |
332 | """Get the event freeze count for this object. | 316 | """Get the event freeze count for this object. |
@@ -335,6 +319,4 @@ cdef class Eo(object): | |||
335 | :rtype: int | 319 | :rtype: int |
336 | 320 | ||
337 | """ | 321 | """ |
338 | cdef int fcount = 0 | 322 | return eo_event_freeze_count_get(self.obj) |
339 | fcount = <int>eo_do_ret(self.obj, fcount, eo_event_freeze_count_get()) | ||
340 | return fcount | ||
diff --git a/efl/evas/efl.evas_object_smart.pxi b/efl/evas/efl.evas_object_smart.pxi index e74948c..931e581 100644 --- a/efl/evas/efl.evas_object_smart.pxi +++ b/efl/evas/efl.evas_object_smart.pxi | |||
@@ -16,7 +16,7 @@ | |||
16 | # along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>. | 16 | # along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | from efl.utils.conversions cimport eina_list_objects_to_python_list | 18 | from efl.utils.conversions cimport eina_list_objects_to_python_list |
19 | from efl.c_eo cimport eo_do, eo_do_ret, eo_key_data_del, eo_key_data_set, eo_key_data_get | 19 | from efl.c_eo cimport eo_key_data_del, eo_key_data_set, eo_key_data_get |
20 | from efl.eo cimport Eo, EoIterator | 20 | from efl.eo cimport Eo, EoIterator |
21 | 21 | ||
22 | from cpython cimport Py_INCREF, Py_DECREF, PyObject_Call, \ | 22 | from cpython cimport Py_INCREF, Py_DECREF, PyObject_Call, \ |
@@ -106,7 +106,7 @@ cdef void _smart_object_delete(Evas_Object *o) with gil: | |||
106 | return | 106 | return |
107 | cls = <Smart>tmp | 107 | cls = <Smart>tmp |
108 | 108 | ||
109 | eo_do_ret(o, tmp, eo_key_data_get("python-eo")) | 109 | tmp = eo_key_data_get(o, "python-eo") |
110 | if tmp == NULL: | 110 | if tmp == NULL: |
111 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) | 111 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) |
112 | obj = None | 112 | obj = None |
@@ -131,7 +131,7 @@ cdef void _smart_object_move(Evas_Object *o, Evas_Coord x, Evas_Coord y) with gi | |||
131 | return | 131 | return |
132 | cls = <Smart>tmp | 132 | cls = <Smart>tmp |
133 | 133 | ||
134 | eo_do_ret(o, tmp, eo_key_data_get("python-eo")) | 134 | tmp = eo_key_data_get(o, "python-eo") |
135 | if tmp == NULL: | 135 | if tmp == NULL: |
136 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) | 136 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) |
137 | obj = None | 137 | obj = None |
@@ -156,7 +156,7 @@ cdef void _smart_object_resize(Evas_Object *o, Evas_Coord w, Evas_Coord h) with | |||
156 | return | 156 | return |
157 | cls = <Smart>tmp | 157 | cls = <Smart>tmp |
158 | 158 | ||
159 | eo_do_ret(o, tmp, eo_key_data_get("python-eo")) | 159 | tmp = eo_key_data_get(o, "python-eo") |
160 | if tmp == NULL: | 160 | if tmp == NULL: |
161 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) | 161 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) |
162 | obj = None | 162 | obj = None |
@@ -181,7 +181,7 @@ cdef void _smart_object_show(Evas_Object *o) with gil: | |||
181 | return | 181 | return |
182 | cls = <Smart>tmp | 182 | cls = <Smart>tmp |
183 | 183 | ||
184 | eo_do_ret(o, tmp, eo_key_data_get("python-eo")) | 184 | tmp = eo_key_data_get(o, "python-eo") |
185 | if tmp == NULL: | 185 | if tmp == NULL: |
186 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) | 186 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) |
187 | obj = None | 187 | obj = None |
@@ -206,7 +206,7 @@ cdef void _smart_object_hide(Evas_Object *o) with gil: | |||
206 | return | 206 | return |
207 | cls = <Smart>tmp | 207 | cls = <Smart>tmp |
208 | 208 | ||
209 | eo_do_ret(o, tmp, eo_key_data_get("python-eo")) | 209 | tmp = eo_key_data_get(o, "python-eo") |
210 | if tmp == NULL: | 210 | if tmp == NULL: |
211 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) | 211 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) |
212 | obj = None | 212 | obj = None |
@@ -231,7 +231,7 @@ cdef void _smart_object_color_set(Evas_Object *o, int r, int g, int b, int a) wi | |||
231 | return | 231 | return |
232 | cls = <Smart>tmp | 232 | cls = <Smart>tmp |
233 | 233 | ||
234 | eo_do_ret(o, tmp, eo_key_data_get("python-eo")) | 234 | tmp = eo_key_data_get(o, "python-eo") |
235 | if tmp == NULL: | 235 | if tmp == NULL: |
236 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) | 236 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) |
237 | obj = None | 237 | obj = None |
@@ -257,7 +257,7 @@ cdef void _smart_object_clip_set(Evas_Object *o, Evas_Object *clip) with gil: | |||
257 | return | 257 | return |
258 | cls = <Smart>tmp | 258 | cls = <Smart>tmp |
259 | 259 | ||
260 | eo_do_ret(o, tmp, eo_key_data_get("python-eo")) | 260 | tmp = eo_key_data_get(o, "python-eo") |
261 | if tmp == NULL: | 261 | if tmp == NULL: |
262 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) | 262 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) |
263 | obj = None | 263 | obj = None |
@@ -284,7 +284,7 @@ cdef void _smart_object_clip_unset(Evas_Object *o) with gil: | |||
284 | return | 284 | return |
285 | cls = <Smart>tmp | 285 | cls = <Smart>tmp |
286 | 286 | ||
287 | eo_do_ret(o, tmp, eo_key_data_get("python-eo")) | 287 | tmp = eo_key_data_get(o, "python-eo") |
288 | if tmp == NULL: | 288 | if tmp == NULL: |
289 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) | 289 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) |
290 | obj = None | 290 | obj = None |
@@ -309,7 +309,7 @@ cdef void _smart_object_calculate(Evas_Object *o) with gil: | |||
309 | return | 309 | return |
310 | cls = <Smart>tmp | 310 | cls = <Smart>tmp |
311 | 311 | ||
312 | eo_do_ret(o, tmp, eo_key_data_get("python-eo")) | 312 | tmp = eo_key_data_get(o, "python-eo") |
313 | if tmp == NULL: | 313 | if tmp == NULL: |
314 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) | 314 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) |
315 | obj = None | 315 | obj = None |
@@ -335,7 +335,7 @@ cdef void _smart_object_member_add(Evas_Object *o, Evas_Object *clip) with gil: | |||
335 | return | 335 | return |
336 | cls = <Smart>tmp | 336 | cls = <Smart>tmp |
337 | 337 | ||
338 | eo_do_ret(o, tmp, eo_key_data_get("python-eo")) | 338 | tmp = eo_key_data_get(o, "python-eo") |
339 | if tmp == NULL: | 339 | if tmp == NULL: |
340 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) | 340 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) |
341 | obj = None | 341 | obj = None |
@@ -363,7 +363,7 @@ cdef void _smart_object_member_del(Evas_Object *o, Evas_Object *clip) with gil: | |||
363 | return | 363 | return |
364 | cls = <Smart>tmp | 364 | cls = <Smart>tmp |
365 | 365 | ||
366 | eo_do_ret(o, tmp, eo_key_data_get("python-eo")) | 366 | tmp = eo_key_data_get(o, "python-eo") |
367 | if tmp == NULL: | 367 | if tmp == NULL: |
368 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) | 368 | EINA_LOG_DOM_WARN(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) |
369 | obj = None | 369 | obj = None |
@@ -406,7 +406,7 @@ cdef void _smart_callback(void *data, Evas_Object *o, void *event_info) with gil | |||
406 | list tmp_args | 406 | list tmp_args |
407 | list lst | 407 | list lst |
408 | 408 | ||
409 | eo_do_ret(o, tmp, eo_key_data_get("python-eo")) | 409 | tmp = eo_key_data_get(o, "python-eo") |
410 | if tmp == NULL: | 410 | if tmp == NULL: |
411 | EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) | 411 | EINA_LOG_DOM_ERR(PY_EFL_EVAS_LOG_DOMAIN, "obj is NULL!", NULL) |
412 | return | 412 | return |
@@ -704,7 +704,7 @@ cdef class SmartObject(Object): | |||
704 | assert obj != NULL, "Cannot set a NULL object" | 704 | assert obj != NULL, "Cannot set a NULL object" |
705 | 705 | ||
706 | self.obj = obj | 706 | self.obj = obj |
707 | eo_do(self.obj, eo_key_data_set("python-eo", <void *>self)) | 707 | eo_key_data_set(self.obj, "python-eo", <void *>self) |
708 | evas_object_event_callback_add(obj, EVAS_CALLBACK_FREE, | 708 | evas_object_event_callback_add(obj, EVAS_CALLBACK_FREE, |
709 | obj_free_cb, <void *>self) | 709 | obj_free_cb, <void *>self) |
710 | Py_INCREF(self) | 710 | Py_INCREF(self) |
diff --git a/include/efl.c_eo.pxd b/include/efl.c_eo.pxd index 11cb094..66207ab 100644 --- a/include/efl.c_eo.pxd +++ b/include/efl.c_eo.pxd | |||
@@ -62,25 +62,35 @@ cdef extern from "Eo.h": | |||
62 | # Structures | 62 | # Structures |
63 | # | 63 | # |
64 | ctypedef struct Eo | 64 | ctypedef struct Eo |
65 | ctypedef Eo Eo_Base | ||
65 | 66 | ||
66 | ctypedef struct Eo_Class | 67 | ctypedef struct Eo_Class |
67 | 68 | ||
68 | ctypedef struct Eo_Event_Description: | 69 | ctypedef struct _Eo_Event_Description: |
69 | const char *name | 70 | const char *name # name of the event. |
70 | const char *doc | 71 | Eina_Bool unfreezable # Eina_True if the event cannot be frozen. |
71 | Eina_Bool unfreezable | 72 | Eina_Bool legacy_is # Internal use: if is a legacy event. |
73 | ctypedef _Eo_Event_Description Eo_Event_Description | ||
74 | |||
75 | ctypedef struct _Eo_Event: | ||
76 | Eo_Base *obj # The object the event was called on. */ | ||
77 | const Eo_Event_Description *desc # The event description. */ | ||
78 | void *event_info # Extra event information passed by the event caller. */ | ||
79 | ctypedef _Eo_Event Eo_Event | ||
80 | ctypedef _Eo_Event Eo_Event2 | ||
72 | 81 | ||
73 | 82 | ||
74 | #################################################################### | 83 | #################################################################### |
75 | # Eo Events | 84 | # Eo Events |
76 | # | 85 | # |
86 | |||
77 | cdef const Eo_Event_Description *EO_EV_DEL | 87 | cdef const Eo_Event_Description *EO_EV_DEL |
78 | 88 | ||
79 | 89 | ||
80 | #################################################################### | 90 | #################################################################### |
81 | # Other typedefs | 91 | # Other typedefs |
82 | # | 92 | # |
83 | ctypedef Eina_Bool (*Eo_Event_Cb)(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info) | 93 | ctypedef Eina_Bool (*Eo_Event_Cb)(void *data, const Eo_Event2 *event) |
84 | 94 | ||
85 | ctypedef void (*eo_key_data_free_func)(void *) | 95 | ctypedef void (*eo_key_data_free_func)(void *) |
86 | 96 | ||
@@ -99,32 +109,30 @@ cdef extern from "Eo.h": | |||
99 | 109 | ||
100 | void eo_wref_add(Eo **wref) | 110 | void eo_wref_add(Eo **wref) |
101 | 111 | ||
102 | void eo_do(Eo *obj, ...) | ||
103 | void *eo_do_ret(Eo *obj, ...) | ||
104 | const Eo_Class *eo_base_class_get() | 112 | const Eo_Class *eo_base_class_get() |
105 | 113 | ||
106 | void eo_key_data_set(const char *key, const void *data) | 114 | void eo_key_data_set(Eo *obj, const char *key, const void *data) |
107 | void *eo_key_data_get(const char *key) | 115 | void *eo_key_data_get(Eo *obj, const char *key) |
108 | void eo_key_data_del(const char *key) | 116 | void eo_key_data_del(Eo *obj, const char *key) |
109 | 117 | ||
110 | const Eo_Class *eo_class_get(const Eo *obj) | 118 | const Eo_Class *eo_class_get(const Eo *obj) |
111 | const char *eo_class_name_get(const Eo_Class *klass) | 119 | const char *eo_class_name_get(const Eo_Class *klass) |
112 | 120 | ||
113 | void eo_parent_set(Eo *parent) | 121 | void eo_parent_set(Eo *obj, Eo *parent) |
114 | Eo *eo_parent_get() | 122 | Eo *eo_parent_get(const Eo *obj) |
115 | 123 | ||
116 | void eo_event_callback_forwarder_add(const Eo_Event_Description *desc, Eo *new_obj) | 124 | void eo_event_callback_forwarder_add(Eo *obj, const Eo_Event_Description *desc, Eo *new_obj) |
117 | void eo_event_callback_forwarder_del(const Eo_Event_Description *desc, Eo *new_obj) | 125 | void eo_event_callback_forwarder_del(Eo *obj, const Eo_Event_Description *desc, Eo *new_obj) |
118 | 126 | ||
119 | void eo_event_freeze() | 127 | void eo_event_freeze(Eo *obj) |
120 | void eo_event_thaw() | 128 | void eo_event_thaw(Eo *obj) |
121 | int eo_event_freeze_count_get() | 129 | int eo_event_freeze_count_get(const Eo *obj) |
122 | 130 | ||
123 | void eo_event_global_freeze() | 131 | void eo_event_global_freeze(Eo *obj) |
124 | void eo_event_global_thaw() | 132 | void eo_event_global_thaw(Eo *obj) |
125 | int eo_event_global_freeze_count_get() | 133 | int eo_event_global_freeze_count_get(const Eo *obj) |
126 | 134 | ||
127 | void eo_event_callback_add(const Eo_Event_Description *desc, Eo_Event_Cb cb, const void *data) | 135 | void eo_event_callback_add(Eo *obj, const Eo_Event_Description *desc, Eo_Event_Cb cb, const void *data) |
128 | void eo_event_callback_del(const Eo_Event_Description *desc, Eo_Event_Cb cb, const void *data) | 136 | void eo_event_callback_del(Eo *obj, const Eo_Event_Description *desc, Eo_Event_Cb cb, const void *data) |
129 | 137 | ||
130 | Eina_Iterator * eo_children_iterator_new() | 138 | Eina_Iterator * eo_children_iterator_new(Eo *obj) |