diff options
author | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
commit | 825a3d837a33f226c879cd02ad15c3fba57e8b2c (patch) | |
tree | 75f57bd9c4253508d338dc79ba8e57a7abc42255 /libraries/evas/src/lib/canvas | |
parent | Add ability to disable the test harness, or the Lua compile test. (diff) | |
download | SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.zip SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.gz SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.bz2 SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.xz |
Update the EFL to what I'm actually using, coz I'm using some stuff not yet released.
Diffstat (limited to 'libraries/evas/src/lib/canvas')
19 files changed, 1539 insertions, 671 deletions
diff --git a/libraries/evas/src/lib/canvas/Makefile.in b/libraries/evas/src/lib/canvas/Makefile.in index 0b4e15d..75da67a 100644 --- a/libraries/evas/src/lib/canvas/Makefile.in +++ b/libraries/evas/src/lib/canvas/Makefile.in | |||
@@ -211,8 +211,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
211 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 211 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
212 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 212 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
213 | PKG_CONFIG = @PKG_CONFIG@ | 213 | PKG_CONFIG = @PKG_CONFIG@ |
214 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
215 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
216 | PNG_CFLAGS = @PNG_CFLAGS@ | 214 | PNG_CFLAGS = @PNG_CFLAGS@ |
217 | PNG_LIBS = @PNG_LIBS@ | 215 | PNG_LIBS = @PNG_LIBS@ |
218 | RANLIB = @RANLIB@ | 216 | RANLIB = @RANLIB@ |
@@ -229,6 +227,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
229 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 227 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
230 | VERSION = @VERSION@ | 228 | VERSION = @VERSION@ |
231 | VMAJ = @VMAJ@ | 229 | VMAJ = @VMAJ@ |
230 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
231 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
232 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 232 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
233 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 233 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
234 | XCB_CFLAGS = @XCB_CFLAGS@ | 234 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -310,6 +310,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
310 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 310 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
311 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 311 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
312 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 312 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
313 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
314 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
315 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
316 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
313 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 317 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
314 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 318 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
315 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 319 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/lib/canvas/evas_callbacks.c b/libraries/evas/src/lib/canvas/evas_callbacks.c index 33b93bc..93f34f2 100644 --- a/libraries/evas/src/lib/canvas/evas_callbacks.c +++ b/libraries/evas/src/lib/canvas/evas_callbacks.c | |||
@@ -23,7 +23,7 @@ _evas_post_event_callback_call(Evas *e) | |||
23 | { | 23 | { |
24 | if (!pc->func((void*)pc->data, e)) skip = 1; | 24 | if (!pc->func((void*)pc->data, e)) skip = 1; |
25 | } | 25 | } |
26 | EVAS_MEMPOOL_FREE(_mp_pc, pc); | 26 | EVAS_MEMPOOL_FREE(_mp_pc, pc); |
27 | } | 27 | } |
28 | _evas_unwalk(e); | 28 | _evas_unwalk(e); |
29 | } | 29 | } |
@@ -32,10 +32,10 @@ void | |||
32 | _evas_post_event_callback_free(Evas *e) | 32 | _evas_post_event_callback_free(Evas *e) |
33 | { | 33 | { |
34 | Evas_Post_Callback *pc; | 34 | Evas_Post_Callback *pc; |
35 | 35 | ||
36 | EINA_LIST_FREE(e->post_events, pc) | 36 | EINA_LIST_FREE(e->post_events, pc) |
37 | { | 37 | { |
38 | EVAS_MEMPOOL_FREE(_mp_pc, pc); | 38 | EVAS_MEMPOOL_FREE(_mp_pc, pc); |
39 | } | 39 | } |
40 | _evas_unwalk(e); | 40 | _evas_unwalk(e); |
41 | } | 41 | } |
@@ -48,15 +48,15 @@ evas_event_callback_list_post_free(Eina_Inlist **list) | |||
48 | /* MEM OK */ | 48 | /* MEM OK */ |
49 | for (l = *list; l;) | 49 | for (l = *list; l;) |
50 | { | 50 | { |
51 | Evas_Func_Node *fn; | 51 | Evas_Func_Node *fn; |
52 | 52 | ||
53 | fn = (Evas_Func_Node *)l; | 53 | fn = (Evas_Func_Node *)l; |
54 | l = l->next; | 54 | l = l->next; |
55 | if (fn->delete_me) | 55 | if (fn->delete_me) |
56 | { | 56 | { |
57 | *list = eina_inlist_remove(*list, EINA_INLIST_GET(fn)); | 57 | *list = eina_inlist_remove(*list, EINA_INLIST_GET(fn)); |
58 | EVAS_MEMPOOL_FREE(_mp_fn, fn); | 58 | EVAS_MEMPOOL_FREE(_mp_fn, fn); |
59 | } | 59 | } |
60 | } | 60 | } |
61 | } | 61 | } |
62 | 62 | ||
@@ -70,7 +70,7 @@ evas_object_event_callback_clear(Evas_Object *obj) | |||
70 | if (!obj->callbacks->callbacks) | 70 | if (!obj->callbacks->callbacks) |
71 | { | 71 | { |
72 | EVAS_MEMPOOL_FREE(_mp_cb, obj->callbacks); | 72 | EVAS_MEMPOOL_FREE(_mp_cb, obj->callbacks); |
73 | obj->callbacks = NULL; | 73 | obj->callbacks = NULL; |
74 | } | 74 | } |
75 | } | 75 | } |
76 | 76 | ||
@@ -84,7 +84,7 @@ evas_event_callback_clear(Evas *e) | |||
84 | if (!e->callbacks->callbacks) | 84 | if (!e->callbacks->callbacks) |
85 | { | 85 | { |
86 | EVAS_MEMPOOL_FREE(_mp_cb, e->callbacks); | 86 | EVAS_MEMPOOL_FREE(_mp_cb, e->callbacks); |
87 | e->callbacks = NULL; | 87 | e->callbacks = NULL; |
88 | } | 88 | } |
89 | } | 89 | } |
90 | 90 | ||
@@ -95,7 +95,7 @@ evas_object_event_callback_all_del(Evas_Object *obj) | |||
95 | 95 | ||
96 | if (!obj->callbacks) return; | 96 | if (!obj->callbacks) return; |
97 | EINA_INLIST_FOREACH(obj->callbacks->callbacks, fn) | 97 | EINA_INLIST_FOREACH(obj->callbacks->callbacks, fn) |
98 | fn->delete_me = 1; | 98 | fn->delete_me = 1; |
99 | } | 99 | } |
100 | 100 | ||
101 | void | 101 | void |
@@ -115,7 +115,7 @@ evas_event_callback_all_del(Evas *e) | |||
115 | 115 | ||
116 | if (!e->callbacks) return; | 116 | if (!e->callbacks) return; |
117 | EINA_INLIST_FOREACH(e->callbacks->callbacks, fn) | 117 | EINA_INLIST_FOREACH(e->callbacks->callbacks, fn) |
118 | fn->delete_me = 1; | 118 | fn->delete_me = 1; |
119 | } | 119 | } |
120 | 120 | ||
121 | void | 121 | void |
@@ -136,25 +136,25 @@ evas_event_callback_call(Evas *e, Evas_Callback_Type type, void *event_info) | |||
136 | _evas_walk(e); | 136 | _evas_walk(e); |
137 | if (e->callbacks) | 137 | if (e->callbacks) |
138 | { | 138 | { |
139 | l_mod = &e->callbacks->callbacks; | 139 | l_mod = &e->callbacks->callbacks; |
140 | e->callbacks->walking_list++; | 140 | e->callbacks->walking_list++; |
141 | for (l = *l_mod; l; l = l->next) | 141 | for (l = *l_mod; l; l = l->next) |
142 | { | 142 | { |
143 | Evas_Func_Node *fn; | 143 | Evas_Func_Node *fn; |
144 | 144 | ||
145 | fn = (Evas_Func_Node *)l; | 145 | fn = (Evas_Func_Node *)l; |
146 | if ((fn->type == type) && (!fn->delete_me)) | 146 | if ((fn->type == type) && (!fn->delete_me)) |
147 | { | 147 | { |
148 | Evas_Event_Cb func = fn->func; | 148 | Evas_Event_Cb func = fn->func; |
149 | if (func) | 149 | if (func) |
150 | func(fn->data, e, event_info); | 150 | func(fn->data, e, event_info); |
151 | } | 151 | } |
152 | if (e->delete_me) break; | 152 | if (e->delete_me) break; |
153 | } | 153 | } |
154 | e->callbacks->walking_list--; | 154 | e->callbacks->walking_list--; |
155 | if (!e->callbacks->walking_list) | 155 | if (!e->callbacks->walking_list) |
156 | { | 156 | { |
157 | evas_event_callback_clear(e); | 157 | evas_event_callback_clear(e); |
158 | l_mod = NULL; | 158 | l_mod = NULL; |
159 | } | 159 | } |
160 | } | 160 | } |
@@ -162,7 +162,7 @@ evas_event_callback_call(Evas *e, Evas_Callback_Type type, void *event_info) | |||
162 | } | 162 | } |
163 | 163 | ||
164 | void | 164 | void |
165 | evas_object_event_callback_call(Evas_Object *obj, Evas_Callback_Type type, void *event_info) | 165 | evas_object_event_callback_call(Evas_Object *obj, Evas_Callback_Type type, void *event_info, int event_id) |
166 | { | 166 | { |
167 | /* MEM OK */ | 167 | /* MEM OK */ |
168 | Eina_Inlist **l_mod = NULL, *l; | 168 | Eina_Inlist **l_mod = NULL, *l; |
@@ -170,67 +170,67 @@ evas_object_event_callback_call(Evas_Object *obj, Evas_Callback_Type type, void | |||
170 | Evas *e; | 170 | Evas *e; |
171 | 171 | ||
172 | if ((obj->delete_me) || (!obj->layer)) return; | 172 | if ((obj->delete_me) || (!obj->layer)) return; |
173 | if ((obj->last_event == _evas_event_counter) && | 173 | if ((obj->last_event == event_id) && |
174 | (obj->last_event_type == type)) return; | 174 | (obj->last_event_type == type)) return; |
175 | obj->last_event = _evas_event_counter; | 175 | obj->last_event = event_id; |
176 | obj->last_event_type = type; | 176 | obj->last_event_type = type; |
177 | if (!(e = obj->layer->evas)) return; | 177 | if (!(e = obj->layer->evas)) return; |
178 | 178 | ||
179 | _evas_walk(e); | 179 | _evas_walk(e); |
180 | if (obj->callbacks) | 180 | if (obj->callbacks) |
181 | { | 181 | { |
182 | l_mod = &obj->callbacks->callbacks; | 182 | l_mod = &obj->callbacks->callbacks; |
183 | switch (type) | 183 | switch (type) |
184 | { | 184 | { |
185 | case EVAS_CALLBACK_MOUSE_DOWN: | 185 | case EVAS_CALLBACK_MOUSE_DOWN: |
186 | { | 186 | { |
187 | Evas_Event_Mouse_Down *ev = event_info; | 187 | Evas_Event_Mouse_Down *ev = event_info; |
188 | 188 | ||
189 | flags = ev->flags; | 189 | flags = ev->flags; |
190 | if (ev->flags & (EVAS_BUTTON_DOUBLE_CLICK | EVAS_BUTTON_TRIPLE_CLICK)) | 190 | if (ev->flags & (EVAS_BUTTON_DOUBLE_CLICK | EVAS_BUTTON_TRIPLE_CLICK)) |
191 | { | 191 | { |
192 | if (obj->last_mouse_down_counter < (e->last_mouse_down_counter - 1)) | 192 | if (obj->last_mouse_down_counter < (e->last_mouse_down_counter - 1)) |
193 | ev->flags &= ~(EVAS_BUTTON_DOUBLE_CLICK | EVAS_BUTTON_TRIPLE_CLICK); | 193 | ev->flags &= ~(EVAS_BUTTON_DOUBLE_CLICK | EVAS_BUTTON_TRIPLE_CLICK); |
194 | } | 194 | } |
195 | obj->last_mouse_down_counter = e->last_mouse_down_counter; | 195 | obj->last_mouse_down_counter = e->last_mouse_down_counter; |
196 | break; | 196 | break; |
197 | } | 197 | } |
198 | case EVAS_CALLBACK_MOUSE_UP: | 198 | case EVAS_CALLBACK_MOUSE_UP: |
199 | { | 199 | { |
200 | Evas_Event_Mouse_Up *ev = event_info; | 200 | Evas_Event_Mouse_Up *ev = event_info; |
201 | 201 | ||
202 | flags = ev->flags; | 202 | flags = ev->flags; |
203 | if (ev->flags & (EVAS_BUTTON_DOUBLE_CLICK | EVAS_BUTTON_TRIPLE_CLICK)) | 203 | if (ev->flags & (EVAS_BUTTON_DOUBLE_CLICK | EVAS_BUTTON_TRIPLE_CLICK)) |
204 | { | 204 | { |
205 | if (obj->last_mouse_up_counter < (e->last_mouse_up_counter - 1)) | 205 | if (obj->last_mouse_up_counter < (e->last_mouse_up_counter - 1)) |
206 | ev->flags &= ~(EVAS_BUTTON_DOUBLE_CLICK | EVAS_BUTTON_TRIPLE_CLICK); | 206 | ev->flags &= ~(EVAS_BUTTON_DOUBLE_CLICK | EVAS_BUTTON_TRIPLE_CLICK); |
207 | } | 207 | } |
208 | obj->last_mouse_up_counter = e->last_mouse_up_counter; | 208 | obj->last_mouse_up_counter = e->last_mouse_up_counter; |
209 | break; | 209 | break; |
210 | } | 210 | } |
211 | default: | 211 | default: |
212 | break; | 212 | break; |
213 | } | 213 | } |
214 | obj->callbacks->walking_list++; | 214 | obj->callbacks->walking_list++; |
215 | for (l = *l_mod; l; l = l->next) | 215 | for (l = *l_mod; l; l = l->next) |
216 | { | 216 | { |
217 | Evas_Func_Node *fn; | 217 | Evas_Func_Node *fn; |
218 | 218 | ||
219 | fn = (Evas_Func_Node *)l; | 219 | fn = (Evas_Func_Node *)l; |
220 | if ((fn->type == type) && (!fn->delete_me)) | 220 | if ((fn->type == type) && (!fn->delete_me)) |
221 | { | 221 | { |
222 | Evas_Object_Event_Cb func = fn->func; | 222 | Evas_Object_Event_Cb func = fn->func; |
223 | if (func) | 223 | if (func) |
224 | func(fn->data, obj->layer->evas, obj, event_info); | 224 | func(fn->data, obj->layer->evas, obj, event_info); |
225 | } | 225 | } |
226 | if (obj->delete_me) break; | 226 | if (obj->delete_me) break; |
227 | } | 227 | } |
228 | obj->callbacks->walking_list--; | 228 | obj->callbacks->walking_list--; |
229 | if (!obj->callbacks->walking_list) | 229 | if (!obj->callbacks->walking_list) |
230 | { | 230 | { |
231 | evas_object_event_callback_clear(obj); | 231 | evas_object_event_callback_clear(obj); |
232 | l_mod = NULL; | 232 | l_mod = NULL; |
233 | } | 233 | } |
234 | 234 | ||
235 | if (type == EVAS_CALLBACK_MOUSE_DOWN) | 235 | if (type == EVAS_CALLBACK_MOUSE_DOWN) |
236 | { | 236 | { |
@@ -246,12 +246,12 @@ evas_object_event_callback_call(Evas_Object *obj, Evas_Callback_Type type, void | |||
246 | 246 | ||
247 | if (!((obj->no_propagate) && (l_mod) && (*l_mod))) | 247 | if (!((obj->no_propagate) && (l_mod) && (*l_mod))) |
248 | { | 248 | { |
249 | if (!obj->no_propagate) | 249 | if (!obj->no_propagate) |
250 | { | 250 | { |
251 | if ((obj->smart.parent) && (type != EVAS_CALLBACK_FREE) && | 251 | if ((obj->smart.parent) && (type != EVAS_CALLBACK_FREE) && |
252 | (type <= EVAS_CALLBACK_KEY_UP)) | 252 | (type <= EVAS_CALLBACK_KEY_UP)) |
253 | evas_object_event_callback_call(obj->smart.parent, type, event_info); | 253 | evas_object_event_callback_call(obj->smart.parent, type, event_info, event_id); |
254 | } | 254 | } |
255 | } | 255 | } |
256 | _evas_unwalk(e); | 256 | _evas_unwalk(e); |
257 | } | 257 | } |
@@ -263,16 +263,16 @@ _callback_priority_cmp(const void *_a, const void *_b) | |||
263 | a = EINA_INLIST_CONTAINER_GET(_a, Evas_Func_Node); | 263 | a = EINA_INLIST_CONTAINER_GET(_a, Evas_Func_Node); |
264 | b = EINA_INLIST_CONTAINER_GET(_b, Evas_Func_Node); | 264 | b = EINA_INLIST_CONTAINER_GET(_b, Evas_Func_Node); |
265 | if (a->priority < b->priority) | 265 | if (a->priority < b->priority) |
266 | return -1; | 266 | return -1; |
267 | else | 267 | else |
268 | return 1; | 268 | return 1; |
269 | } | 269 | } |
270 | 270 | ||
271 | EAPI void | 271 | EAPI void |
272 | evas_object_event_callback_add(Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data) | 272 | evas_object_event_callback_add(Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data) |
273 | { | 273 | { |
274 | evas_object_event_callback_priority_add(obj, type, | 274 | evas_object_event_callback_priority_add(obj, type, |
275 | EVAS_CALLBACK_PRIORITY_DEFAULT, func, data); | 275 | EVAS_CALLBACK_PRIORITY_DEFAULT, func, data); |
276 | } | 276 | } |
277 | 277 | ||
278 | EAPI void | 278 | EAPI void |
@@ -294,7 +294,7 @@ evas_object_event_callback_priority_add(Evas_Object *obj, Evas_Callback_Type typ | |||
294 | if (!obj->callbacks) return; | 294 | if (!obj->callbacks) return; |
295 | EVAS_MEMPOOL_PREP(_mp_cb, obj->callbacks, Evas_Callbacks); | 295 | EVAS_MEMPOOL_PREP(_mp_cb, obj->callbacks, Evas_Callbacks); |
296 | } | 296 | } |
297 | 297 | ||
298 | EVAS_MEMPOOL_INIT(_mp_fn, "evas_func_node", Evas_Func_Node, 2048, ); | 298 | EVAS_MEMPOOL_INIT(_mp_fn, "evas_func_node", Evas_Func_Node, 2048, ); |
299 | fn = EVAS_MEMPOOL_ALLOC(_mp_fn, Evas_Func_Node); | 299 | fn = EVAS_MEMPOOL_ALLOC(_mp_fn, Evas_Func_Node); |
300 | if (!fn) return; | 300 | if (!fn) return; |
@@ -305,8 +305,8 @@ evas_object_event_callback_priority_add(Evas_Object *obj, Evas_Callback_Type typ | |||
305 | fn->priority = priority; | 305 | fn->priority = priority; |
306 | 306 | ||
307 | obj->callbacks->callbacks = | 307 | obj->callbacks->callbacks = |
308 | eina_inlist_sorted_insert(obj->callbacks->callbacks, EINA_INLIST_GET(fn), | 308 | eina_inlist_sorted_insert(obj->callbacks->callbacks, EINA_INLIST_GET(fn), |
309 | _callback_priority_cmp); | 309 | _callback_priority_cmp); |
310 | } | 310 | } |
311 | 311 | ||
312 | EAPI void * | 312 | EAPI void * |
@@ -325,17 +325,17 @@ evas_object_event_callback_del(Evas_Object *obj, Evas_Callback_Type type, Evas_O | |||
325 | 325 | ||
326 | EINA_INLIST_FOREACH(obj->callbacks->callbacks, fn) | 326 | EINA_INLIST_FOREACH(obj->callbacks->callbacks, fn) |
327 | { | 327 | { |
328 | if ((fn->func == func) && (fn->type == type) && (!fn->delete_me)) | 328 | if ((fn->func == func) && (fn->type == type) && (!fn->delete_me)) |
329 | { | 329 | { |
330 | void *tmp; | 330 | void *tmp; |
331 | 331 | ||
332 | tmp = fn->data; | 332 | tmp = fn->data; |
333 | fn->delete_me = 1; | 333 | fn->delete_me = 1; |
334 | obj->callbacks->deletions_waiting = 1; | 334 | obj->callbacks->deletions_waiting = 1; |
335 | if (!obj->callbacks->walking_list) | 335 | if (!obj->callbacks->walking_list) |
336 | evas_object_event_callback_clear(obj); | 336 | evas_object_event_callback_clear(obj); |
337 | return tmp; | 337 | return tmp; |
338 | } | 338 | } |
339 | } | 339 | } |
340 | return NULL; | 340 | return NULL; |
341 | } | 341 | } |
@@ -356,17 +356,17 @@ evas_object_event_callback_del_full(Evas_Object *obj, Evas_Callback_Type type, E | |||
356 | 356 | ||
357 | EINA_INLIST_FOREACH(obj->callbacks->callbacks, fn) | 357 | EINA_INLIST_FOREACH(obj->callbacks->callbacks, fn) |
358 | { | 358 | { |
359 | if ((fn->func == func) && (fn->type == type) && (fn->data == data) && (!fn->delete_me)) | 359 | if ((fn->func == func) && (fn->type == type) && (fn->data == data) && (!fn->delete_me)) |
360 | { | 360 | { |
361 | void *tmp; | 361 | void *tmp; |
362 | 362 | ||
363 | tmp = fn->data; | 363 | tmp = fn->data; |
364 | fn->delete_me = 1; | 364 | fn->delete_me = 1; |
365 | obj->callbacks->deletions_waiting = 1; | 365 | obj->callbacks->deletions_waiting = 1; |
366 | if (!obj->callbacks->walking_list) | 366 | if (!obj->callbacks->walking_list) |
367 | evas_object_event_callback_clear(obj); | 367 | evas_object_event_callback_clear(obj); |
368 | return tmp; | 368 | return tmp; |
369 | } | 369 | } |
370 | } | 370 | } |
371 | return NULL; | 371 | return NULL; |
372 | } | 372 | } |
@@ -375,7 +375,7 @@ EAPI void | |||
375 | evas_event_callback_add(Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data) | 375 | evas_event_callback_add(Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data) |
376 | { | 376 | { |
377 | evas_event_callback_priority_add(e, type, EVAS_CALLBACK_PRIORITY_DEFAULT, | 377 | evas_event_callback_priority_add(e, type, EVAS_CALLBACK_PRIORITY_DEFAULT, |
378 | func, data); | 378 | func, data); |
379 | } | 379 | } |
380 | 380 | ||
381 | EAPI void | 381 | EAPI void |
@@ -397,7 +397,7 @@ evas_event_callback_priority_add(Evas *e, Evas_Callback_Type type, Evas_Callback | |||
397 | if (!e->callbacks) return; | 397 | if (!e->callbacks) return; |
398 | EVAS_MEMPOOL_PREP(_mp_cb, e->callbacks, Evas_Callbacks); | 398 | EVAS_MEMPOOL_PREP(_mp_cb, e->callbacks, Evas_Callbacks); |
399 | } | 399 | } |
400 | 400 | ||
401 | EVAS_MEMPOOL_INIT(_mp_fn, "evas_func_node", Evas_Func_Node, 2048, ); | 401 | EVAS_MEMPOOL_INIT(_mp_fn, "evas_func_node", Evas_Func_Node, 2048, ); |
402 | fn = EVAS_MEMPOOL_ALLOC(_mp_fn, Evas_Func_Node); | 402 | fn = EVAS_MEMPOOL_ALLOC(_mp_fn, Evas_Func_Node); |
403 | if (!fn) return; | 403 | if (!fn) return; |
@@ -408,7 +408,7 @@ evas_event_callback_priority_add(Evas *e, Evas_Callback_Type type, Evas_Callback | |||
408 | fn->priority = priority; | 408 | fn->priority = priority; |
409 | 409 | ||
410 | e->callbacks->callbacks = eina_inlist_sorted_insert(e->callbacks->callbacks, | 410 | e->callbacks->callbacks = eina_inlist_sorted_insert(e->callbacks->callbacks, |
411 | EINA_INLIST_GET(fn), _callback_priority_cmp); | 411 | EINA_INLIST_GET(fn), _callback_priority_cmp); |
412 | } | 412 | } |
413 | 413 | ||
414 | EAPI void * | 414 | EAPI void * |
@@ -427,17 +427,17 @@ evas_event_callback_del(Evas *e, Evas_Callback_Type type, Evas_Event_Cb func) | |||
427 | 427 | ||
428 | EINA_INLIST_FOREACH(e->callbacks->callbacks, fn) | 428 | EINA_INLIST_FOREACH(e->callbacks->callbacks, fn) |
429 | { | 429 | { |
430 | if ((fn->func == func) && (fn->type == type) && (!fn->delete_me)) | 430 | if ((fn->func == func) && (fn->type == type) && (!fn->delete_me)) |
431 | { | 431 | { |
432 | void *data; | 432 | void *data; |
433 | 433 | ||
434 | data = fn->data; | 434 | data = fn->data; |
435 | fn->delete_me = 1; | 435 | fn->delete_me = 1; |
436 | e->callbacks->deletions_waiting = 1; | 436 | e->callbacks->deletions_waiting = 1; |
437 | if (!e->callbacks->walking_list) | 437 | if (!e->callbacks->walking_list) |
438 | evas_event_callback_clear(e); | 438 | evas_event_callback_clear(e); |
439 | return data; | 439 | return data; |
440 | } | 440 | } |
441 | } | 441 | } |
442 | return NULL; | 442 | return NULL; |
443 | } | 443 | } |
@@ -458,17 +458,17 @@ evas_event_callback_del_full(Evas *e, Evas_Callback_Type type, Evas_Event_Cb fun | |||
458 | 458 | ||
459 | EINA_INLIST_FOREACH(e->callbacks->callbacks, fn) | 459 | EINA_INLIST_FOREACH(e->callbacks->callbacks, fn) |
460 | { | 460 | { |
461 | if ((fn->func == func) && (fn->type == type) && (fn->data == data) && (!fn->delete_me)) | 461 | if ((fn->func == func) && (fn->type == type) && (fn->data == data) && (!fn->delete_me)) |
462 | { | 462 | { |
463 | void *tmp; | 463 | void *tmp; |
464 | 464 | ||
465 | tmp = fn->data; | 465 | tmp = fn->data; |
466 | fn->delete_me = 1; | 466 | fn->delete_me = 1; |
467 | e->callbacks->deletions_waiting = 1; | 467 | e->callbacks->deletions_waiting = 1; |
468 | if (!e->callbacks->walking_list) | 468 | if (!e->callbacks->walking_list) |
469 | evas_event_callback_clear(e); | 469 | evas_event_callback_clear(e); |
470 | return tmp; | 470 | return tmp; |
471 | } | 471 | } |
472 | } | 472 | } |
473 | return NULL; | 473 | return NULL; |
474 | } | 474 | } |
@@ -477,17 +477,17 @@ EAPI void | |||
477 | evas_post_event_callback_push(Evas *e, Evas_Object_Event_Post_Cb func, const void *data) | 477 | evas_post_event_callback_push(Evas *e, Evas_Object_Event_Post_Cb func, const void *data) |
478 | { | 478 | { |
479 | Evas_Post_Callback *pc; | 479 | Evas_Post_Callback *pc; |
480 | 480 | ||
481 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | 481 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); |
482 | return; | 482 | return; |
483 | MAGIC_CHECK_END(); | 483 | MAGIC_CHECK_END(); |
484 | 484 | ||
485 | EVAS_MEMPOOL_INIT(_mp_pc, "evas_post_callback", Evas_Post_Callback, 64, ); | 485 | EVAS_MEMPOOL_INIT(_mp_pc, "evas_post_callback", Evas_Post_Callback, 64, ); |
486 | pc = EVAS_MEMPOOL_ALLOC(_mp_pc, Evas_Post_Callback); | 486 | pc = EVAS_MEMPOOL_ALLOC(_mp_pc, Evas_Post_Callback); |
487 | if (!pc) return; | 487 | if (!pc) return; |
488 | EVAS_MEMPOOL_PREP(_mp_pc, pc, Evas_Post_Callback); | 488 | EVAS_MEMPOOL_PREP(_mp_pc, pc, Evas_Post_Callback); |
489 | if (e->delete_me) return; | 489 | if (e->delete_me) return; |
490 | 490 | ||
491 | pc->func = func; | 491 | pc->func = func; |
492 | pc->data = data; | 492 | pc->data = data; |
493 | e->post_events = eina_list_prepend(e->post_events, pc); | 493 | e->post_events = eina_list_prepend(e->post_events, pc); |
@@ -498,11 +498,11 @@ evas_post_event_callback_remove(Evas *e, Evas_Object_Event_Post_Cb func) | |||
498 | { | 498 | { |
499 | Evas_Post_Callback *pc; | 499 | Evas_Post_Callback *pc; |
500 | Eina_List *l; | 500 | Eina_List *l; |
501 | 501 | ||
502 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | 502 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); |
503 | return; | 503 | return; |
504 | MAGIC_CHECK_END(); | 504 | MAGIC_CHECK_END(); |
505 | 505 | ||
506 | EINA_LIST_FOREACH(e->post_events, l, pc) | 506 | EINA_LIST_FOREACH(e->post_events, l, pc) |
507 | { | 507 | { |
508 | if (pc->func == func) | 508 | if (pc->func == func) |
@@ -518,11 +518,11 @@ evas_post_event_callback_remove_full(Evas *e, Evas_Object_Event_Post_Cb func, co | |||
518 | { | 518 | { |
519 | Evas_Post_Callback *pc; | 519 | Evas_Post_Callback *pc; |
520 | Eina_List *l; | 520 | Eina_List *l; |
521 | 521 | ||
522 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | 522 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); |
523 | return; | 523 | return; |
524 | MAGIC_CHECK_END(); | 524 | MAGIC_CHECK_END(); |
525 | 525 | ||
526 | EINA_LIST_FOREACH(e->post_events, l, pc) | 526 | EINA_LIST_FOREACH(e->post_events, l, pc) |
527 | { | 527 | { |
528 | if ((pc->func == func) && (pc->data == data)) | 528 | if ((pc->func == func) && (pc->data == data)) |
diff --git a/libraries/evas/src/lib/canvas/evas_events.c b/libraries/evas/src/lib/canvas/evas_events.c index 99ecf8c..9b7077e 100644 --- a/libraries/evas/src/lib/canvas/evas_events.c +++ b/libraries/evas/src/lib/canvas/evas_events.c | |||
@@ -1,6 +1,11 @@ | |||
1 | #include "evas_common.h" | 1 | #include "evas_common.h" |
2 | #include "evas_private.h" | 2 | #include "evas_private.h" |
3 | 3 | ||
4 | static Eina_List * | ||
5 | _evas_event_object_list_in_get(Evas *e, Eina_List *in, | ||
6 | const Eina_Inlist *list, Evas_Object *stop, | ||
7 | int x, int y, int *no_rep); | ||
8 | |||
4 | static void | 9 | static void |
5 | _evas_event_havemap_adjust(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Eina_Bool mouse_grabbed) | 10 | _evas_event_havemap_adjust(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Eina_Bool mouse_grabbed) |
6 | { | 11 | { |
@@ -16,13 +21,17 @@ _evas_event_havemap_adjust(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Eina_ | |||
16 | } | 21 | } |
17 | 22 | ||
18 | static Eina_List * | 23 | static Eina_List * |
19 | _evas_event_object_list_in_get(Evas *e, Eina_List *in, | 24 | _evas_event_object_list_raw_in_get(Evas *e, Eina_List *in, |
20 | const Eina_Inlist *list, Evas_Object *stop, | 25 | const Eina_Inlist *list, Evas_Object *stop, |
21 | int x, int y, int *no_rep) | 26 | int x, int y, int *no_rep) |
22 | { | 27 | { |
23 | Evas_Object *obj; | 28 | Evas_Object *obj; |
29 | int inside; | ||
30 | |||
24 | if (!list) return in; | 31 | if (!list) return in; |
25 | EINA_INLIST_REVERSE_FOREACH(list, obj) | 32 | for (obj = _EINA_INLIST_CONTAINER(obj, list); |
33 | obj; | ||
34 | obj = _EINA_INLIST_CONTAINER(obj, EINA_INLIST_GET(obj)->prev)) | ||
26 | { | 35 | { |
27 | if (obj == stop) | 36 | if (obj == stop) |
28 | { | 37 | { |
@@ -37,9 +46,9 @@ _evas_event_object_list_in_get(Evas *e, Eina_List *in, | |||
37 | if (obj->smart.smart) | 46 | if (obj->smart.smart) |
38 | { | 47 | { |
39 | int norep = 0; | 48 | int norep = 0; |
40 | int inside; | ||
41 | 49 | ||
42 | if (((obj->cur.usemap) && (obj->cur.map) && (obj->cur.map->count == 4))) | 50 | if ((obj->cur.usemap) && (obj->cur.map) && |
51 | (obj->cur.map->count == 4)) | ||
43 | { | 52 | { |
44 | inside = evas_object_is_in_output_rect(obj, x, y, 1, 1); | 53 | inside = evas_object_is_in_output_rect(obj, x, y, 1, 1); |
45 | if (inside) | 54 | if (inside) |
@@ -57,7 +66,8 @@ _evas_event_object_list_in_get(Evas *e, Eina_List *in, | |||
57 | evas_object_smart_members_get_direct(obj), | 66 | evas_object_smart_members_get_direct(obj), |
58 | stop, | 67 | stop, |
59 | obj->cur.geometry.x + obj->cur.map->mx, | 68 | obj->cur.geometry.x + obj->cur.map->mx, |
60 | obj->cur.geometry.y + obj->cur.map->my, &norep); | 69 | obj->cur.geometry.y + obj->cur.map->my, |
70 | &norep); | ||
61 | } | 71 | } |
62 | } | 72 | } |
63 | } | 73 | } |
@@ -69,19 +79,24 @@ _evas_event_object_list_in_get(Evas *e, Eina_List *in, | |||
69 | } | 79 | } |
70 | if (norep) | 80 | if (norep) |
71 | { | 81 | { |
72 | if (!obj->repeat_events) *no_rep = 1; | 82 | if (!obj->repeat_events) |
73 | return in; | 83 | { |
84 | *no_rep = 1; | ||
85 | return in; | ||
86 | } | ||
74 | } | 87 | } |
75 | } | 88 | } |
76 | else | 89 | else |
77 | { | 90 | { |
78 | int inside = evas_object_is_in_output_rect(obj, x, y, 1, 1); | 91 | inside = evas_object_is_in_output_rect(obj, x, y, 1, 1); |
79 | 92 | ||
80 | if (((obj->cur.usemap) && (obj->cur.map) && (obj->cur.map->count == 4))) | 93 | if ((obj->cur.usemap) && (obj->cur.map) && |
94 | (obj->cur.map->count == 4)) | ||
81 | { | 95 | { |
82 | if ((inside) && (!evas_map_coords_get(obj->cur.map, x, y, | 96 | if ((inside) && |
83 | &(obj->cur.map->mx), | 97 | (!evas_map_coords_get(obj->cur.map, x, y, |
84 | &(obj->cur.map->my), 0))) | 98 | &(obj->cur.map->mx), |
99 | &(obj->cur.map->my), 0))) | ||
85 | { | 100 | { |
86 | inside = 0; | 101 | inside = 0; |
87 | } | 102 | } |
@@ -105,6 +120,16 @@ _evas_event_object_list_in_get(Evas *e, Eina_List *in, | |||
105 | return in; | 120 | return in; |
106 | } | 121 | } |
107 | 122 | ||
123 | static Eina_List * | ||
124 | _evas_event_object_list_in_get(Evas *e, Eina_List *in, | ||
125 | const Eina_Inlist *list, Evas_Object *stop, | ||
126 | int x, int y, int *no_rep) | ||
127 | { | ||
128 | if (!list) return NULL; | ||
129 | return _evas_event_object_list_raw_in_get(e, in, list->last, stop, | ||
130 | x, y, no_rep); | ||
131 | } | ||
132 | |||
108 | Eina_List * | 133 | Eina_List * |
109 | evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y) | 134 | evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y) |
110 | { | 135 | { |
@@ -136,6 +161,24 @@ evas_event_list_copy(Eina_List *list) | |||
136 | /* public functions */ | 161 | /* public functions */ |
137 | 162 | ||
138 | EAPI void | 163 | EAPI void |
164 | evas_event_default_flags_set(Evas *e, Evas_Event_Flags flags) | ||
165 | { | ||
166 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | ||
167 | return; | ||
168 | MAGIC_CHECK_END(); | ||
169 | e->default_event_flags = flags; | ||
170 | } | ||
171 | |||
172 | EAPI Evas_Event_Flags | ||
173 | evas_event_default_flags_get(const Evas *e) | ||
174 | { | ||
175 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | ||
176 | return EVAS_EVENT_FLAG_ON_HOLD; | ||
177 | MAGIC_CHECK_END(); | ||
178 | return e->default_event_flags; | ||
179 | } | ||
180 | |||
181 | EAPI void | ||
139 | evas_event_freeze(Evas *e) | 182 | evas_event_freeze(Evas *e) |
140 | { | 183 | { |
141 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | 184 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); |
@@ -197,6 +240,8 @@ evas_event_feed_mouse_down(Evas *e, int b, Evas_Button_Flags flags, unsigned int | |||
197 | Eina_List *l, *copy; | 240 | Eina_List *l, *copy; |
198 | Evas_Event_Mouse_Down ev; | 241 | Evas_Event_Mouse_Down ev; |
199 | Evas_Object *obj; | 242 | Evas_Object *obj; |
243 | int addgrab = 0; | ||
244 | int event_id = 0; | ||
200 | 245 | ||
201 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | 246 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); |
202 | return; | 247 | return; |
@@ -205,12 +250,14 @@ evas_event_feed_mouse_down(Evas *e, int b, Evas_Button_Flags flags, unsigned int | |||
205 | if ((b < 1) || (b > 32)) return; | 250 | if ((b < 1) || (b > 32)) return; |
206 | 251 | ||
207 | e->pointer.button |= (1 << (b - 1)); | 252 | e->pointer.button |= (1 << (b - 1)); |
253 | e->pointer.downs++; | ||
208 | 254 | ||
209 | if (e->events_frozen > 0) return; | 255 | if (e->events_frozen > 0) return; |
210 | e->last_timestamp = timestamp; | 256 | e->last_timestamp = timestamp; |
211 | 257 | ||
212 | _evas_object_event_new(); | 258 | _evas_object_event_new(); |
213 | 259 | ||
260 | event_id = _evas_event_counter; | ||
214 | ev.button = b; | 261 | ev.button = b; |
215 | ev.output.x = e->pointer.x; | 262 | ev.output.x = e->pointer.x; |
216 | ev.output.y = e->pointer.y; | 263 | ev.output.y = e->pointer.y; |
@@ -221,7 +268,7 @@ evas_event_feed_mouse_down(Evas *e, int b, Evas_Button_Flags flags, unsigned int | |||
221 | ev.locks = &(e->locks); | 268 | ev.locks = &(e->locks); |
222 | ev.flags = flags; | 269 | ev.flags = flags; |
223 | ev.timestamp = timestamp; | 270 | ev.timestamp = timestamp; |
224 | ev.event_flags = EVAS_EVENT_FLAG_NONE; | 271 | ev.event_flags = e->default_event_flags; |
225 | 272 | ||
226 | _evas_walk(e); | 273 | _evas_walk(e); |
227 | /* append new touch point to the touch point list */ | 274 | /* append new touch point to the touch point list */ |
@@ -238,14 +285,23 @@ evas_event_feed_mouse_down(Evas *e, int b, Evas_Button_Flags flags, unsigned int | |||
238 | e->pointer.object.in = eina_list_free(e->pointer.object.in); | 285 | e->pointer.object.in = eina_list_free(e->pointer.object.in); |
239 | /* and set up the new one */ | 286 | /* and set up the new one */ |
240 | e->pointer.object.in = ins; | 287 | e->pointer.object.in = ins; |
288 | /* adjust grabbed count by the nuymber of currently held down | ||
289 | * fingers/buttons */ | ||
290 | if (e->pointer.downs > 1) addgrab = e->pointer.downs - 1; | ||
241 | } | 291 | } |
242 | copy = evas_event_list_copy(e->pointer.object.in); | 292 | copy = evas_event_list_copy(e->pointer.object.in); |
243 | EINA_LIST_FOREACH(copy, l, obj) | 293 | EINA_LIST_FOREACH(copy, l, obj) |
244 | { | 294 | { |
245 | if (obj->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB) | 295 | if ((obj->pointer_mode == EVAS_OBJECT_POINTER_MODE_AUTOGRAB) || |
296 | (obj->pointer_mode == EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN)) | ||
246 | { | 297 | { |
247 | obj->mouse_grabbed++; | 298 | obj->mouse_grabbed += addgrab + 1; |
248 | e->pointer.mouse_grabbed++; | 299 | e->pointer.mouse_grabbed += addgrab + 1; |
300 | if (obj->pointer_mode == EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN) | ||
301 | { | ||
302 | e->pointer.nogrep++; | ||
303 | break; | ||
304 | } | ||
249 | } | 305 | } |
250 | } | 306 | } |
251 | EINA_LIST_FOREACH(copy, l, obj) | 307 | EINA_LIST_FOREACH(copy, l, obj) |
@@ -256,8 +312,10 @@ evas_event_feed_mouse_down(Evas *e, int b, Evas_Button_Flags flags, unsigned int | |||
256 | _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed); | 312 | _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed); |
257 | 313 | ||
258 | if (e->events_frozen <= 0) | 314 | if (e->events_frozen <= 0) |
259 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_DOWN, &ev); | 315 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_DOWN, &ev, event_id); |
260 | if (e->delete_me) break; | 316 | if (e->delete_me) break; |
317 | if (obj->pointer_mode == EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN) | ||
318 | break; | ||
261 | } | 319 | } |
262 | if (copy) eina_list_free(copy); | 320 | if (copy) eina_list_free(copy); |
263 | e->last_mouse_down_counter++; | 321 | e->last_mouse_down_counter++; |
@@ -274,9 +332,11 @@ _post_up_handle(Evas *e, unsigned int timestamp, const void *data) | |||
274 | Evas_Event_Mouse_Out ev; | 332 | Evas_Event_Mouse_Out ev; |
275 | Evas_Object *obj; | 333 | Evas_Object *obj; |
276 | int post_called = 0; | 334 | int post_called = 0; |
335 | int event_id = 0; | ||
277 | 336 | ||
278 | _evas_object_event_new(); | 337 | _evas_object_event_new(); |
279 | 338 | ||
339 | event_id = _evas_event_counter; | ||
280 | ev.buttons = e->pointer.button; | 340 | ev.buttons = e->pointer.button; |
281 | ev.output.x = e->pointer.x; | 341 | ev.output.x = e->pointer.x; |
282 | ev.output.y = e->pointer.y; | 342 | ev.output.y = e->pointer.y; |
@@ -286,7 +346,7 @@ _post_up_handle(Evas *e, unsigned int timestamp, const void *data) | |||
286 | ev.modifiers = &(e->modifiers); | 346 | ev.modifiers = &(e->modifiers); |
287 | ev.locks = &(e->locks); | 347 | ev.locks = &(e->locks); |
288 | ev.timestamp = timestamp; | 348 | ev.timestamp = timestamp; |
289 | ev.event_flags = EVAS_EVENT_FLAG_NONE; | 349 | ev.event_flags = e->default_event_flags; |
290 | 350 | ||
291 | /* get new list of ins */ | 351 | /* get new list of ins */ |
292 | ins = evas_event_objects_event_list(e, NULL, e->pointer.x, e->pointer.y); | 352 | ins = evas_event_objects_event_list(e, NULL, e->pointer.x, e->pointer.y); |
@@ -304,7 +364,7 @@ _post_up_handle(Evas *e, unsigned int timestamp, const void *data) | |||
304 | { | 364 | { |
305 | obj->mouse_in = 0; | 365 | obj->mouse_in = 0; |
306 | if (e->events_frozen <= 0) | 366 | if (e->events_frozen <= 0) |
307 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev); | 367 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev, event_id); |
308 | } | 368 | } |
309 | } | 369 | } |
310 | if (e->delete_me) break; | 370 | if (e->delete_me) break; |
@@ -319,6 +379,7 @@ _post_up_handle(Evas *e, unsigned int timestamp, const void *data) | |||
319 | 379 | ||
320 | _evas_object_event_new(); | 380 | _evas_object_event_new(); |
321 | 381 | ||
382 | event_id = _evas_event_counter; | ||
322 | ev_in.buttons = e->pointer.button; | 383 | ev_in.buttons = e->pointer.button; |
323 | ev_in.output.x = e->pointer.x; | 384 | ev_in.output.x = e->pointer.x; |
324 | ev_in.output.y = e->pointer.y; | 385 | ev_in.output.y = e->pointer.y; |
@@ -328,7 +389,7 @@ _post_up_handle(Evas *e, unsigned int timestamp, const void *data) | |||
328 | ev_in.modifiers = &(e->modifiers); | 389 | ev_in.modifiers = &(e->modifiers); |
329 | ev_in.locks = &(e->locks); | 390 | ev_in.locks = &(e->locks); |
330 | ev_in.timestamp = timestamp; | 391 | ev_in.timestamp = timestamp; |
331 | ev_in.event_flags = EVAS_EVENT_FLAG_NONE; | 392 | ev_in.event_flags = e->default_event_flags; |
332 | 393 | ||
333 | EINA_LIST_FOREACH(ins, l, obj_itr) | 394 | EINA_LIST_FOREACH(ins, l, obj_itr) |
334 | { | 395 | { |
@@ -341,7 +402,7 @@ _post_up_handle(Evas *e, unsigned int timestamp, const void *data) | |||
341 | { | 402 | { |
342 | obj_itr->mouse_in = 1; | 403 | obj_itr->mouse_in = 1; |
343 | if (e->events_frozen <= 0) | 404 | if (e->events_frozen <= 0) |
344 | evas_object_event_callback_call(obj_itr, EVAS_CALLBACK_MOUSE_IN, &ev_in); | 405 | evas_object_event_callback_call(obj_itr, EVAS_CALLBACK_MOUSE_IN, &ev_in, event_id); |
345 | } | 406 | } |
346 | } | 407 | } |
347 | if (e->delete_me) break; | 408 | if (e->delete_me) break; |
@@ -383,6 +444,7 @@ evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int t | |||
383 | if ((b < 1) || (b > 32)) return; | 444 | if ((b < 1) || (b > 32)) return; |
384 | 445 | ||
385 | e->pointer.button &= ~(1 << (b - 1)); | 446 | e->pointer.button &= ~(1 << (b - 1)); |
447 | e->pointer.downs--; | ||
386 | 448 | ||
387 | if (e->events_frozen > 0) return; | 449 | if (e->events_frozen > 0) return; |
388 | e->last_timestamp = timestamp; | 450 | e->last_timestamp = timestamp; |
@@ -390,9 +452,11 @@ evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int t | |||
390 | { | 452 | { |
391 | Evas_Event_Mouse_Up ev; | 453 | Evas_Event_Mouse_Up ev; |
392 | Evas_Object *obj; | 454 | Evas_Object *obj; |
455 | int event_id = 0; | ||
393 | 456 | ||
394 | _evas_object_event_new(); | 457 | _evas_object_event_new(); |
395 | 458 | ||
459 | event_id = _evas_event_counter; | ||
396 | ev.button = b; | 460 | ev.button = b; |
397 | ev.output.x = e->pointer.x; | 461 | ev.output.x = e->pointer.x; |
398 | ev.output.y = e->pointer.y; | 462 | ev.output.y = e->pointer.y; |
@@ -403,7 +467,7 @@ evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int t | |||
403 | ev.locks = &(e->locks); | 467 | ev.locks = &(e->locks); |
404 | ev.flags = flags; | 468 | ev.flags = flags; |
405 | ev.timestamp = timestamp; | 469 | ev.timestamp = timestamp; |
406 | ev.event_flags = EVAS_EVENT_FLAG_NONE; | 470 | ev.event_flags = e->default_event_flags; |
407 | 471 | ||
408 | _evas_walk(e); | 472 | _evas_walk(e); |
409 | /* update released touch point */ | 473 | /* update released touch point */ |
@@ -414,7 +478,7 @@ evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int t | |||
414 | ev.canvas.x = e->pointer.x; | 478 | ev.canvas.x = e->pointer.x; |
415 | ev.canvas.y = e->pointer.y; | 479 | ev.canvas.y = e->pointer.y; |
416 | _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed); | 480 | _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed); |
417 | if ((obj->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB) && | 481 | if ((obj->pointer_mode == EVAS_OBJECT_POINTER_MODE_AUTOGRAB) && |
418 | (obj->mouse_grabbed > 0)) | 482 | (obj->mouse_grabbed > 0)) |
419 | { | 483 | { |
420 | obj->mouse_grabbed--; | 484 | obj->mouse_grabbed--; |
@@ -423,9 +487,14 @@ evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int t | |||
423 | if (!obj->delete_me) | 487 | if (!obj->delete_me) |
424 | { | 488 | { |
425 | if (e->events_frozen <= 0) | 489 | if (e->events_frozen <= 0) |
426 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_UP, &ev); | 490 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_UP, &ev, event_id); |
427 | } | 491 | } |
428 | if (e->delete_me) break; | 492 | if (e->delete_me) break; |
493 | if (obj->pointer_mode == EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN) | ||
494 | { | ||
495 | if (e->pointer.nogrep > 0) e->pointer.nogrep--; | ||
496 | break; | ||
497 | } | ||
429 | } | 498 | } |
430 | if (copy) copy = eina_list_free(copy); | 499 | if (copy) copy = eina_list_free(copy); |
431 | e->last_mouse_up_counter++; | 500 | e->last_mouse_up_counter++; |
@@ -442,9 +511,9 @@ evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int t | |||
442 | ERR("BUG? e->pointer.mouse_grabbed (=%d) < 0!", | 511 | ERR("BUG? e->pointer.mouse_grabbed (=%d) < 0!", |
443 | e->pointer.mouse_grabbed); | 512 | e->pointer.mouse_grabbed); |
444 | } | 513 | } |
445 | /* remove released touch point from the touch point list */ | 514 | /* remove released touch point from the touch point list */ |
446 | _evas_touch_point_remove(e, 0); | 515 | _evas_touch_point_remove(e, 0); |
447 | 516 | ||
448 | _evas_unwalk(e); | 517 | _evas_unwalk(e); |
449 | } | 518 | } |
450 | 519 | ||
@@ -465,6 +534,7 @@ evas_event_feed_mouse_cancel(Evas *e, unsigned int timestamp, const void *data) | |||
465 | if ((e->pointer.button & (1 << i))) | 534 | if ((e->pointer.button & (1 << i))) |
466 | evas_event_feed_mouse_up(e, i + 1, 0, timestamp, data); | 535 | evas_event_feed_mouse_up(e, i + 1, 0, timestamp, data); |
467 | } | 536 | } |
537 | // FIXME: multi cancel too? | ||
468 | _evas_unwalk(e); | 538 | _evas_unwalk(e); |
469 | } | 539 | } |
470 | 540 | ||
@@ -474,6 +544,7 @@ evas_event_feed_mouse_wheel(Evas *e, int direction, int z, unsigned int timestam | |||
474 | Eina_List *l, *copy; | 544 | Eina_List *l, *copy; |
475 | Evas_Event_Mouse_Wheel ev; | 545 | Evas_Event_Mouse_Wheel ev; |
476 | Evas_Object *obj; | 546 | Evas_Object *obj; |
547 | int event_id = 0; | ||
477 | 548 | ||
478 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | 549 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); |
479 | return; | 550 | return; |
@@ -484,6 +555,7 @@ evas_event_feed_mouse_wheel(Evas *e, int direction, int z, unsigned int timestam | |||
484 | 555 | ||
485 | _evas_object_event_new(); | 556 | _evas_object_event_new(); |
486 | 557 | ||
558 | event_id = _evas_event_counter; | ||
487 | ev.direction = direction; | 559 | ev.direction = direction; |
488 | ev.z = z; | 560 | ev.z = z; |
489 | ev.output.x = e->pointer.x; | 561 | ev.output.x = e->pointer.x; |
@@ -494,7 +566,7 @@ evas_event_feed_mouse_wheel(Evas *e, int direction, int z, unsigned int timestam | |||
494 | ev.modifiers = &(e->modifiers); | 566 | ev.modifiers = &(e->modifiers); |
495 | ev.locks = &(e->locks); | 567 | ev.locks = &(e->locks); |
496 | ev.timestamp = timestamp; | 568 | ev.timestamp = timestamp; |
497 | ev.event_flags = EVAS_EVENT_FLAG_NONE; | 569 | ev.event_flags = e->default_event_flags; |
498 | 570 | ||
499 | _evas_walk(e); | 571 | _evas_walk(e); |
500 | copy = evas_event_list_copy(e->pointer.object.in); | 572 | copy = evas_event_list_copy(e->pointer.object.in); |
@@ -505,7 +577,7 @@ evas_event_feed_mouse_wheel(Evas *e, int direction, int z, unsigned int timestam | |||
505 | ev.canvas.y = e->pointer.y; | 577 | ev.canvas.y = e->pointer.y; |
506 | _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed); | 578 | _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed); |
507 | if ((e->events_frozen <= 0) && !evas_event_freezes_through(obj)) | 579 | if ((e->events_frozen <= 0) && !evas_event_freezes_through(obj)) |
508 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_WHEEL, &ev); | 580 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_WHEEL, &ev, event_id); |
509 | if (e->delete_me) break; | 581 | if (e->delete_me) break; |
510 | } | 582 | } |
511 | if (copy) copy = eina_list_free(copy); | 583 | if (copy) copy = eina_list_free(copy); |
@@ -517,6 +589,7 @@ evas_event_feed_mouse_wheel(Evas *e, int direction, int z, unsigned int timestam | |||
517 | EAPI void | 589 | EAPI void |
518 | evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const void *data) | 590 | evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const void *data) |
519 | { | 591 | { |
592 | Evas_Object *nogrep_obj = NULL; | ||
520 | int px, py; | 593 | int px, py; |
521 | //// Evas_Coord pcx, pcy; | 594 | //// Evas_Coord pcx, pcy; |
522 | 595 | ||
@@ -553,9 +626,11 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const | |||
553 | { | 626 | { |
554 | Evas_Event_Mouse_Move ev; | 627 | Evas_Event_Mouse_Move ev; |
555 | Evas_Object *obj; | 628 | Evas_Object *obj; |
629 | int event_id = 0; | ||
556 | 630 | ||
557 | _evas_object_event_new(); | 631 | _evas_object_event_new(); |
558 | 632 | ||
633 | event_id = _evas_event_counter; | ||
559 | ev.buttons = e->pointer.button; | 634 | ev.buttons = e->pointer.button; |
560 | ev.cur.output.x = e->pointer.x; | 635 | ev.cur.output.x = e->pointer.x; |
561 | ev.cur.output.y = e->pointer.y; | 636 | ev.cur.output.y = e->pointer.y; |
@@ -569,7 +644,7 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const | |||
569 | ev.modifiers = &(e->modifiers); | 644 | ev.modifiers = &(e->modifiers); |
570 | ev.locks = &(e->locks); | 645 | ev.locks = &(e->locks); |
571 | ev.timestamp = timestamp; | 646 | ev.timestamp = timestamp; |
572 | ev.event_flags = EVAS_EVENT_FLAG_NONE; | 647 | ev.event_flags = e->default_event_flags; |
573 | copy = evas_event_list_copy(e->pointer.object.in); | 648 | copy = evas_event_list_copy(e->pointer.object.in); |
574 | EINA_LIST_FOREACH(copy, l, obj) | 649 | EINA_LIST_FOREACH(copy, l, obj) |
575 | { | 650 | { |
@@ -586,19 +661,28 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const | |||
586 | (!obj->clip.clipees)) | 661 | (!obj->clip.clipees)) |
587 | { | 662 | { |
588 | if ((px != x) || (py != y)) | 663 | if ((px != x) || (py != y)) |
589 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_MOVE, &ev); | 664 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id); |
590 | } | 665 | } |
591 | else | 666 | else |
592 | outs = eina_list_append(outs, obj); | 667 | outs = eina_list_append(outs, obj); |
668 | if ((obj->pointer_mode == EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN) && | ||
669 | (e->pointer.nogrep > 0)) | ||
670 | { | ||
671 | eina_list_free(copy); | ||
672 | nogrep_obj = obj; | ||
673 | goto nogrep; | ||
674 | } | ||
593 | if (e->delete_me) break; | 675 | if (e->delete_me) break; |
594 | } | 676 | } |
595 | _evas_post_event_callback_call(e); | 677 | _evas_post_event_callback_call(e); |
596 | } | 678 | } |
597 | { | 679 | { |
598 | Evas_Event_Mouse_Out ev; | 680 | Evas_Event_Mouse_Out ev; |
681 | int event_id = 0; | ||
599 | 682 | ||
600 | _evas_object_event_new(); | 683 | _evas_object_event_new(); |
601 | 684 | ||
685 | event_id = _evas_event_counter; | ||
602 | ev.buttons = e->pointer.button; | 686 | ev.buttons = e->pointer.button; |
603 | ev.output.x = e->pointer.x; | 687 | ev.output.x = e->pointer.x; |
604 | ev.output.y = e->pointer.y; | 688 | ev.output.y = e->pointer.y; |
@@ -608,7 +692,7 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const | |||
608 | ev.modifiers = &(e->modifiers); | 692 | ev.modifiers = &(e->modifiers); |
609 | ev.locks = &(e->locks); | 693 | ev.locks = &(e->locks); |
610 | ev.timestamp = timestamp; | 694 | ev.timestamp = timestamp; |
611 | ev.event_flags = EVAS_EVENT_FLAG_NONE; | 695 | ev.event_flags = e->default_event_flags; |
612 | 696 | ||
613 | if (copy) eina_list_free(copy); | 697 | if (copy) eina_list_free(copy); |
614 | while (outs) | 698 | while (outs) |
@@ -629,7 +713,7 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const | |||
629 | if (!obj->delete_me) | 713 | if (!obj->delete_me) |
630 | { | 714 | { |
631 | if (e->events_frozen <= 0) | 715 | if (e->events_frozen <= 0) |
632 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev); | 716 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev, event_id); |
633 | } | 717 | } |
634 | } | 718 | } |
635 | } | 719 | } |
@@ -645,9 +729,11 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const | |||
645 | Evas_Event_Mouse_Out ev2; | 729 | Evas_Event_Mouse_Out ev2; |
646 | Evas_Event_Mouse_In ev3; | 730 | Evas_Event_Mouse_In ev3; |
647 | Evas_Object *obj; | 731 | Evas_Object *obj; |
732 | int event_id = 0, event_id2 = 0; | ||
648 | 733 | ||
649 | _evas_object_event_new(); | 734 | _evas_object_event_new(); |
650 | 735 | ||
736 | event_id = _evas_event_counter; | ||
651 | ev.buttons = e->pointer.button; | 737 | ev.buttons = e->pointer.button; |
652 | ev.cur.output.x = e->pointer.x; | 738 | ev.cur.output.x = e->pointer.x; |
653 | ev.cur.output.y = e->pointer.y; | 739 | ev.cur.output.y = e->pointer.y; |
@@ -661,7 +747,7 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const | |||
661 | ev.modifiers = &(e->modifiers); | 747 | ev.modifiers = &(e->modifiers); |
662 | ev.locks = &(e->locks); | 748 | ev.locks = &(e->locks); |
663 | ev.timestamp = timestamp; | 749 | ev.timestamp = timestamp; |
664 | ev.event_flags = EVAS_EVENT_FLAG_NONE; | 750 | ev.event_flags = e->default_event_flags; |
665 | 751 | ||
666 | ev2.buttons = e->pointer.button; | 752 | ev2.buttons = e->pointer.button; |
667 | ev2.output.x = e->pointer.x; | 753 | ev2.output.x = e->pointer.x; |
@@ -672,7 +758,7 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const | |||
672 | ev2.modifiers = &(e->modifiers); | 758 | ev2.modifiers = &(e->modifiers); |
673 | ev2.locks = &(e->locks); | 759 | ev2.locks = &(e->locks); |
674 | ev2.timestamp = timestamp; | 760 | ev2.timestamp = timestamp; |
675 | ev2.event_flags = EVAS_EVENT_FLAG_NONE; | 761 | ev2.event_flags = e->default_event_flags; |
676 | 762 | ||
677 | ev3.buttons = e->pointer.button; | 763 | ev3.buttons = e->pointer.button; |
678 | ev3.output.x = e->pointer.x; | 764 | ev3.output.x = e->pointer.x; |
@@ -683,7 +769,7 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const | |||
683 | ev3.modifiers = &(e->modifiers); | 769 | ev3.modifiers = &(e->modifiers); |
684 | ev3.locks = &(e->locks); | 770 | ev3.locks = &(e->locks); |
685 | ev3.timestamp = timestamp; | 771 | ev3.timestamp = timestamp; |
686 | ev3.event_flags = EVAS_EVENT_FLAG_NONE; | 772 | ev3.event_flags = e->default_event_flags; |
687 | 773 | ||
688 | /* get all new in objects */ | 774 | /* get all new in objects */ |
689 | ins = evas_event_objects_event_list(e, NULL, x, y); | 775 | ins = evas_event_objects_event_list(e, NULL, x, y); |
@@ -711,7 +797,7 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const | |||
711 | ev.cur.canvas.x = e->pointer.x; | 797 | ev.cur.canvas.x = e->pointer.x; |
712 | ev.cur.canvas.y = e->pointer.y; | 798 | ev.cur.canvas.y = e->pointer.y; |
713 | _evas_event_havemap_adjust(obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed); | 799 | _evas_event_havemap_adjust(obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed); |
714 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_MOVE, &ev); | 800 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id); |
715 | } | 801 | } |
716 | } | 802 | } |
717 | /* otherwise it has left the object */ | 803 | /* otherwise it has left the object */ |
@@ -724,7 +810,7 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const | |||
724 | ev2.canvas.y = e->pointer.y; | 810 | ev2.canvas.y = e->pointer.y; |
725 | _evas_event_havemap_adjust(obj, &ev2.canvas.x, &ev2.canvas.y, obj->mouse_grabbed); | 811 | _evas_event_havemap_adjust(obj, &ev2.canvas.x, &ev2.canvas.y, obj->mouse_grabbed); |
726 | if (e->events_frozen <= 0) | 812 | if (e->events_frozen <= 0) |
727 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev2); | 813 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev2, event_id); |
728 | } | 814 | } |
729 | } | 815 | } |
730 | if (e->delete_me) break; | 816 | if (e->delete_me) break; |
@@ -733,6 +819,7 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const | |||
733 | 819 | ||
734 | _evas_object_event_new(); | 820 | _evas_object_event_new(); |
735 | 821 | ||
822 | event_id2 = _evas_event_counter; | ||
736 | if (copy) copy = eina_list_free(copy); | 823 | if (copy) copy = eina_list_free(copy); |
737 | /* go thru our current list of ins */ | 824 | /* go thru our current list of ins */ |
738 | EINA_LIST_FOREACH(ins, l, obj) | 825 | EINA_LIST_FOREACH(ins, l, obj) |
@@ -747,7 +834,7 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const | |||
747 | { | 834 | { |
748 | obj->mouse_in = 1; | 835 | obj->mouse_in = 1; |
749 | if (e->events_frozen <= 0) | 836 | if (e->events_frozen <= 0) |
750 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_IN, &ev3); | 837 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_IN, &ev3, event_id2); |
751 | } | 838 | } |
752 | } | 839 | } |
753 | if (e->delete_me) break; | 840 | if (e->delete_me) break; |
@@ -766,6 +853,160 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const | |||
766 | } | 853 | } |
767 | _evas_post_event_callback_call(e); | 854 | _evas_post_event_callback_call(e); |
768 | } | 855 | } |
856 | _evas_unwalk(e); | ||
857 | return; | ||
858 | nogrep: | ||
859 | { | ||
860 | Eina_List *ins = NULL; | ||
861 | Eina_List *newin = NULL; | ||
862 | Eina_List *l, *copy, *lst = NULL; | ||
863 | Evas_Event_Mouse_Move ev; | ||
864 | Evas_Event_Mouse_Out ev2; | ||
865 | Evas_Event_Mouse_In ev3; | ||
866 | Evas_Object *obj, *below_obj; | ||
867 | int event_id = 0, event_id2 = 0; | ||
868 | int norep = 0, breaknext = 0; | ||
869 | |||
870 | _evas_object_event_new(); | ||
871 | |||
872 | event_id = _evas_event_counter; | ||
873 | ev.buttons = e->pointer.button; | ||
874 | ev.cur.output.x = e->pointer.x; | ||
875 | ev.cur.output.y = e->pointer.y; | ||
876 | ev.cur.canvas.x = e->pointer.x; | ||
877 | ev.cur.canvas.y = e->pointer.y; | ||
878 | ev.prev.output.x = px; | ||
879 | ev.prev.output.y = py; | ||
880 | ev.prev.canvas.x = px; | ||
881 | ev.prev.canvas.y = py; | ||
882 | ev.data = (void *)data; | ||
883 | ev.modifiers = &(e->modifiers); | ||
884 | ev.locks = &(e->locks); | ||
885 | ev.timestamp = timestamp; | ||
886 | ev.event_flags = e->default_event_flags; | ||
887 | |||
888 | ev2.buttons = e->pointer.button; | ||
889 | ev2.output.x = e->pointer.x; | ||
890 | ev2.output.y = e->pointer.y; | ||
891 | ev2.canvas.x = e->pointer.x; | ||
892 | ev2.canvas.y = e->pointer.y; | ||
893 | ev2.data = (void *)data; | ||
894 | ev2.modifiers = &(e->modifiers); | ||
895 | ev2.locks = &(e->locks); | ||
896 | ev2.timestamp = timestamp; | ||
897 | ev2.event_flags = e->default_event_flags; | ||
898 | |||
899 | ev3.buttons = e->pointer.button; | ||
900 | ev3.output.x = e->pointer.x; | ||
901 | ev3.output.y = e->pointer.y; | ||
902 | ev3.canvas.x = e->pointer.x; | ||
903 | ev3.canvas.y = e->pointer.y; | ||
904 | ev3.data = (void *)data; | ||
905 | ev3.modifiers = &(e->modifiers); | ||
906 | ev3.locks = &(e->locks); | ||
907 | ev3.timestamp = timestamp; | ||
908 | ev3.event_flags = e->default_event_flags; | ||
909 | |||
910 | /* go thru old list of in objects */ | ||
911 | copy = evas_event_list_copy(e->pointer.object.in); | ||
912 | EINA_LIST_FOREACH(copy, l, obj) | ||
913 | { | ||
914 | if (breaknext) | ||
915 | { | ||
916 | lst = l; | ||
917 | break; | ||
918 | } | ||
919 | if (obj == nogrep_obj) breaknext = 1; | ||
920 | } | ||
921 | |||
922 | /* get all new in objects */ | ||
923 | below_obj = evas_object_below_get(nogrep_obj); | ||
924 | if (below_obj) | ||
925 | ins = _evas_event_object_list_raw_in_get(e, NULL, | ||
926 | EINA_INLIST_GET(below_obj), NULL, | ||
927 | e->pointer.x, e->pointer.y, | ||
928 | &norep); | ||
929 | EINA_LIST_FOREACH(copy, l, obj) | ||
930 | { | ||
931 | newin = eina_list_append(newin, obj); | ||
932 | if (obj == nogrep_obj) break; | ||
933 | } | ||
934 | EINA_LIST_FOREACH(ins, l, obj) | ||
935 | { | ||
936 | newin = eina_list_append(newin, obj); | ||
937 | } | ||
938 | |||
939 | EINA_LIST_FOREACH(lst, l, obj) | ||
940 | { | ||
941 | /* if its under the pointer and its visible and its in the new */ | ||
942 | /* in list */ | ||
943 | // FIXME: i don't think we need this | ||
944 | // evas_object_clip_recalc(obj); | ||
945 | if ((e->events_frozen <= 0) && | ||
946 | evas_object_is_in_output_rect(obj, x, y, 1, 1) && | ||
947 | (evas_object_clippers_is_visible(obj) || | ||
948 | obj->mouse_grabbed) && | ||
949 | eina_list_data_find(newin, obj) && | ||
950 | (!evas_event_passes_through(obj)) && | ||
951 | (!evas_event_freezes_through(obj)) && | ||
952 | (!obj->clip.clipees) && | ||
953 | ((!obj->precise_is_inside) || evas_object_is_inside(obj, x, y)) | ||
954 | ) | ||
955 | { | ||
956 | if ((px != x) || (py != y)) | ||
957 | { | ||
958 | ev.cur.canvas.x = e->pointer.x; | ||
959 | ev.cur.canvas.y = e->pointer.y; | ||
960 | _evas_event_havemap_adjust(obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed); | ||
961 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id); | ||
962 | } | ||
963 | } | ||
964 | /* otherwise it has left the object */ | ||
965 | else | ||
966 | { | ||
967 | if (obj->mouse_in) | ||
968 | { | ||
969 | obj->mouse_in = 0; | ||
970 | ev2.canvas.x = e->pointer.x; | ||
971 | ev2.canvas.y = e->pointer.y; | ||
972 | _evas_event_havemap_adjust(obj, &ev2.canvas.x, &ev2.canvas.y, obj->mouse_grabbed); | ||
973 | if (e->events_frozen <= 0) | ||
974 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev2, event_id); | ||
975 | } | ||
976 | } | ||
977 | if (e->delete_me) break; | ||
978 | } | ||
979 | _evas_post_event_callback_call(e); | ||
980 | |||
981 | _evas_object_event_new(); | ||
982 | |||
983 | event_id2 = _evas_event_counter; | ||
984 | if (copy) copy = eina_list_free(copy); | ||
985 | /* go thru our current list of ins */ | ||
986 | EINA_LIST_FOREACH(newin, l, obj) | ||
987 | { | ||
988 | ev3.canvas.x = e->pointer.x; | ||
989 | ev3.canvas.y = e->pointer.y; | ||
990 | _evas_event_havemap_adjust(obj, &ev3.canvas.x, &ev3.canvas.y, obj->mouse_grabbed); | ||
991 | /* if its not in the old list of ins send an enter event */ | ||
992 | if (!eina_list_data_find(e->pointer.object.in, obj)) | ||
993 | { | ||
994 | if (!obj->mouse_in) | ||
995 | { | ||
996 | obj->mouse_in = 1; | ||
997 | if (e->events_frozen <= 0) | ||
998 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_IN, &ev3, event_id2); | ||
999 | } | ||
1000 | } | ||
1001 | if (e->delete_me) break; | ||
1002 | } | ||
1003 | /* free our old list of ins */ | ||
1004 | eina_list_free(e->pointer.object.in); | ||
1005 | /* and set up the new one */ | ||
1006 | e->pointer.object.in = newin; | ||
1007 | |||
1008 | _evas_post_event_callback_call(e); | ||
1009 | } | ||
769 | _evas_unwalk(e); | 1010 | _evas_unwalk(e); |
770 | } | 1011 | } |
771 | 1012 | ||
@@ -776,6 +1017,7 @@ evas_event_feed_mouse_in(Evas *e, unsigned int timestamp, const void *data) | |||
776 | Eina_List *l; | 1017 | Eina_List *l; |
777 | Evas_Event_Mouse_In ev; | 1018 | Evas_Event_Mouse_In ev; |
778 | Evas_Object *obj; | 1019 | Evas_Object *obj; |
1020 | int event_id = 0; | ||
779 | 1021 | ||
780 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | 1022 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); |
781 | return; | 1023 | return; |
@@ -789,6 +1031,7 @@ evas_event_feed_mouse_in(Evas *e, unsigned int timestamp, const void *data) | |||
789 | 1031 | ||
790 | _evas_object_event_new(); | 1032 | _evas_object_event_new(); |
791 | 1033 | ||
1034 | event_id = _evas_event_counter; | ||
792 | ev.buttons = e->pointer.button; | 1035 | ev.buttons = e->pointer.button; |
793 | ev.output.x = e->pointer.x; | 1036 | ev.output.x = e->pointer.x; |
794 | ev.output.y = e->pointer.y; | 1037 | ev.output.y = e->pointer.y; |
@@ -798,7 +1041,7 @@ evas_event_feed_mouse_in(Evas *e, unsigned int timestamp, const void *data) | |||
798 | ev.modifiers = &(e->modifiers); | 1041 | ev.modifiers = &(e->modifiers); |
799 | ev.locks = &(e->locks); | 1042 | ev.locks = &(e->locks); |
800 | ev.timestamp = timestamp; | 1043 | ev.timestamp = timestamp; |
801 | ev.event_flags = EVAS_EVENT_FLAG_NONE; | 1044 | ev.event_flags = e->default_event_flags; |
802 | 1045 | ||
803 | _evas_walk(e); | 1046 | _evas_walk(e); |
804 | /* get new list of ins */ | 1047 | /* get new list of ins */ |
@@ -814,7 +1057,7 @@ evas_event_feed_mouse_in(Evas *e, unsigned int timestamp, const void *data) | |||
814 | { | 1057 | { |
815 | obj->mouse_in = 1; | 1058 | obj->mouse_in = 1; |
816 | if (e->events_frozen <= 0) | 1059 | if (e->events_frozen <= 0) |
817 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_IN, &ev); | 1060 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_IN, &ev, event_id); |
818 | } | 1061 | } |
819 | } | 1062 | } |
820 | if (e->delete_me) break; | 1063 | if (e->delete_me) break; |
@@ -832,6 +1075,7 @@ EAPI void | |||
832 | evas_event_feed_mouse_out(Evas *e, unsigned int timestamp, const void *data) | 1075 | evas_event_feed_mouse_out(Evas *e, unsigned int timestamp, const void *data) |
833 | { | 1076 | { |
834 | Evas_Event_Mouse_Out ev; | 1077 | Evas_Event_Mouse_Out ev; |
1078 | int event_id = 0; | ||
835 | 1079 | ||
836 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | 1080 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); |
837 | return; | 1081 | return; |
@@ -843,6 +1087,7 @@ evas_event_feed_mouse_out(Evas *e, unsigned int timestamp, const void *data) | |||
843 | 1087 | ||
844 | _evas_object_event_new(); | 1088 | _evas_object_event_new(); |
845 | 1089 | ||
1090 | event_id = _evas_event_counter; | ||
846 | ev.buttons = e->pointer.button; | 1091 | ev.buttons = e->pointer.button; |
847 | ev.output.x = e->pointer.x; | 1092 | ev.output.x = e->pointer.x; |
848 | ev.output.y = e->pointer.y; | 1093 | ev.output.y = e->pointer.y; |
@@ -852,11 +1097,10 @@ evas_event_feed_mouse_out(Evas *e, unsigned int timestamp, const void *data) | |||
852 | ev.modifiers = &(e->modifiers); | 1097 | ev.modifiers = &(e->modifiers); |
853 | ev.locks = &(e->locks); | 1098 | ev.locks = &(e->locks); |
854 | ev.timestamp = timestamp; | 1099 | ev.timestamp = timestamp; |
855 | ev.event_flags = EVAS_EVENT_FLAG_NONE; | 1100 | ev.event_flags = e->default_event_flags; |
856 | 1101 | ||
857 | _evas_walk(e); | 1102 | _evas_walk(e); |
858 | /* if our mouse button is grabbed to any objects */ | 1103 | /* if our mouse button is inside any objects */ |
859 | if (e->pointer.mouse_grabbed == 0) | ||
860 | { | 1104 | { |
861 | /* go thru old list of in objects */ | 1105 | /* go thru old list of in objects */ |
862 | Eina_List *l, *copy; | 1106 | Eina_List *l, *copy; |
@@ -874,14 +1118,16 @@ evas_event_feed_mouse_out(Evas *e, unsigned int timestamp, const void *data) | |||
874 | if (!obj->delete_me) | 1118 | if (!obj->delete_me) |
875 | { | 1119 | { |
876 | if (e->events_frozen <= 0) | 1120 | if (e->events_frozen <= 0) |
877 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev); | 1121 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev, event_id); |
878 | } | 1122 | } |
1123 | obj->mouse_grabbed = 0; | ||
879 | } | 1124 | } |
880 | if (e->delete_me) break; | 1125 | if (e->delete_me) break; |
881 | } | 1126 | } |
882 | if (copy) copy = eina_list_free(copy); | 1127 | if (copy) copy = eina_list_free(copy); |
883 | /* free our old list of ins */ | 1128 | /* free our old list of ins */ |
884 | e->pointer.object.in = eina_list_free(e->pointer.object.in); | 1129 | e->pointer.object.in = eina_list_free(e->pointer.object.in); |
1130 | e->pointer.mouse_grabbed = 0; | ||
885 | _evas_post_event_callback_call(e); | 1131 | _evas_post_event_callback_call(e); |
886 | } | 1132 | } |
887 | _evas_unwalk(e); | 1133 | _evas_unwalk(e); |
@@ -899,16 +1145,20 @@ evas_event_feed_multi_down(Evas *e, | |||
899 | Eina_List *l, *copy; | 1145 | Eina_List *l, *copy; |
900 | Evas_Event_Multi_Down ev; | 1146 | Evas_Event_Multi_Down ev; |
901 | Evas_Object *obj; | 1147 | Evas_Object *obj; |
1148 | int addgrab = 0; | ||
1149 | int event_id = 0; | ||
902 | 1150 | ||
903 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | 1151 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); |
904 | return; | 1152 | return; |
905 | MAGIC_CHECK_END(); | 1153 | MAGIC_CHECK_END(); |
906 | 1154 | ||
1155 | e->pointer.downs++; | ||
907 | if (e->events_frozen > 0) return; | 1156 | if (e->events_frozen > 0) return; |
908 | e->last_timestamp = timestamp; | 1157 | e->last_timestamp = timestamp; |
909 | 1158 | ||
910 | _evas_object_event_new(); | 1159 | _evas_object_event_new(); |
911 | 1160 | ||
1161 | event_id = _evas_event_counter; | ||
912 | ev.device = d; | 1162 | ev.device = d; |
913 | ev.output.x = x; | 1163 | ev.output.x = x; |
914 | ev.output.y = y; | 1164 | ev.output.y = y; |
@@ -926,18 +1176,22 @@ evas_event_feed_multi_down(Evas *e, | |||
926 | ev.locks = &(e->locks); | 1176 | ev.locks = &(e->locks); |
927 | ev.flags = flags; | 1177 | ev.flags = flags; |
928 | ev.timestamp = timestamp; | 1178 | ev.timestamp = timestamp; |
929 | ev.event_flags = EVAS_EVENT_FLAG_NONE; | 1179 | ev.event_flags = e->default_event_flags; |
930 | 1180 | ||
931 | _evas_walk(e); | 1181 | _evas_walk(e); |
932 | /* append new touch point to the touch point list */ | 1182 | /* append new touch point to the touch point list */ |
933 | _evas_touch_point_append(e, d, x, y); | 1183 | _evas_touch_point_append(e, d, x, y); |
1184 | if (e->pointer.mouse_grabbed == 0) | ||
1185 | { | ||
1186 | if (e->pointer.downs > 1) addgrab = e->pointer.downs - 1; | ||
1187 | } | ||
934 | copy = evas_event_list_copy(e->pointer.object.in); | 1188 | copy = evas_event_list_copy(e->pointer.object.in); |
935 | EINA_LIST_FOREACH(copy, l, obj) | 1189 | EINA_LIST_FOREACH(copy, l, obj) |
936 | { | 1190 | { |
937 | if (obj->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB) | 1191 | if (obj->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB) |
938 | { | 1192 | { |
939 | obj->mouse_grabbed++; | 1193 | obj->mouse_grabbed += addgrab + 1; |
940 | e->pointer.mouse_grabbed++; | 1194 | e->pointer.mouse_grabbed += addgrab + 1; |
941 | } | 1195 | } |
942 | } | 1196 | } |
943 | EINA_LIST_FOREACH(copy, l, obj) | 1197 | EINA_LIST_FOREACH(copy, l, obj) |
@@ -952,7 +1206,7 @@ evas_event_feed_multi_down(Evas *e, | |||
952 | if (y != ev.canvas.y) | 1206 | if (y != ev.canvas.y) |
953 | ev.canvas.ysub = ev.canvas.y; // fixme - lost precision | 1207 | ev.canvas.ysub = ev.canvas.y; // fixme - lost precision |
954 | if (e->events_frozen <= 0) | 1208 | if (e->events_frozen <= 0) |
955 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_DOWN, &ev); | 1209 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_DOWN, &ev, event_id); |
956 | if (e->delete_me) break; | 1210 | if (e->delete_me) break; |
957 | } | 1211 | } |
958 | if (copy) eina_list_free(copy); | 1212 | if (copy) eina_list_free(copy); |
@@ -974,16 +1228,19 @@ evas_event_feed_multi_up(Evas *e, | |||
974 | Eina_List *l, *copy; | 1228 | Eina_List *l, *copy; |
975 | Evas_Event_Multi_Up ev; | 1229 | Evas_Event_Multi_Up ev; |
976 | Evas_Object *obj; | 1230 | Evas_Object *obj; |
1231 | int event_id = 0; | ||
977 | 1232 | ||
978 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | 1233 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); |
979 | return; | 1234 | return; |
980 | MAGIC_CHECK_END(); | 1235 | MAGIC_CHECK_END(); |
981 | 1236 | ||
1237 | e->pointer.downs--; | ||
982 | if (e->events_frozen > 0) return; | 1238 | if (e->events_frozen > 0) return; |
983 | e->last_timestamp = timestamp; | 1239 | e->last_timestamp = timestamp; |
984 | 1240 | ||
985 | _evas_object_event_new(); | 1241 | _evas_object_event_new(); |
986 | 1242 | ||
1243 | event_id = _evas_event_counter; | ||
987 | ev.device = d; | 1244 | ev.device = d; |
988 | ev.output.x = x; | 1245 | ev.output.x = x; |
989 | ev.output.y = y; | 1246 | ev.output.y = y; |
@@ -1001,7 +1258,7 @@ evas_event_feed_multi_up(Evas *e, | |||
1001 | ev.locks = &(e->locks); | 1258 | ev.locks = &(e->locks); |
1002 | ev.flags = flags; | 1259 | ev.flags = flags; |
1003 | ev.timestamp = timestamp; | 1260 | ev.timestamp = timestamp; |
1004 | ev.event_flags = EVAS_EVENT_FLAG_NONE; | 1261 | ev.event_flags = e->default_event_flags; |
1005 | 1262 | ||
1006 | _evas_walk(e); | 1263 | _evas_walk(e); |
1007 | /* update released touch point */ | 1264 | /* update released touch point */ |
@@ -1025,7 +1282,7 @@ evas_event_feed_multi_up(Evas *e, | |||
1025 | e->pointer.mouse_grabbed--; | 1282 | e->pointer.mouse_grabbed--; |
1026 | } | 1283 | } |
1027 | if (e->events_frozen <= 0) | 1284 | if (e->events_frozen <= 0) |
1028 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_UP, &ev); | 1285 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_UP, &ev, event_id); |
1029 | if (e->delete_me) break; | 1286 | if (e->delete_me) break; |
1030 | } | 1287 | } |
1031 | if (copy) copy = eina_list_free(copy); | 1288 | if (copy) copy = eina_list_free(copy); |
@@ -1051,7 +1308,7 @@ evas_event_feed_multi_move(Evas *e, | |||
1051 | if (e->events_frozen > 0) return; | 1308 | if (e->events_frozen > 0) return; |
1052 | e->last_timestamp = timestamp; | 1309 | e->last_timestamp = timestamp; |
1053 | 1310 | ||
1054 | if (!e->pointer.inside) return; | 1311 | if ((!e->pointer.inside) && (e->pointer.mouse_grabbed == 0)) return; |
1055 | 1312 | ||
1056 | _evas_walk(e); | 1313 | _evas_walk(e); |
1057 | /* update moved touch point */ | 1314 | /* update moved touch point */ |
@@ -1063,9 +1320,11 @@ evas_event_feed_multi_move(Evas *e, | |||
1063 | Eina_List *l, *copy; | 1320 | Eina_List *l, *copy; |
1064 | Evas_Event_Multi_Move ev; | 1321 | Evas_Event_Multi_Move ev; |
1065 | Evas_Object *obj; | 1322 | Evas_Object *obj; |
1323 | int event_id = 0; | ||
1066 | 1324 | ||
1067 | _evas_object_event_new(); | 1325 | _evas_object_event_new(); |
1068 | 1326 | ||
1327 | event_id = _evas_event_counter; | ||
1069 | ev.device = d; | 1328 | ev.device = d; |
1070 | ev.cur.output.x = x; | 1329 | ev.cur.output.x = x; |
1071 | ev.cur.output.y = y; | 1330 | ev.cur.output.y = y; |
@@ -1082,7 +1341,7 @@ evas_event_feed_multi_move(Evas *e, | |||
1082 | ev.modifiers = &(e->modifiers); | 1341 | ev.modifiers = &(e->modifiers); |
1083 | ev.locks = &(e->locks); | 1342 | ev.locks = &(e->locks); |
1084 | ev.timestamp = timestamp; | 1343 | ev.timestamp = timestamp; |
1085 | ev.event_flags = EVAS_EVENT_FLAG_NONE; | 1344 | ev.event_flags = e->default_event_flags; |
1086 | 1345 | ||
1087 | copy = evas_event_list_copy(e->pointer.object.in); | 1346 | copy = evas_event_list_copy(e->pointer.object.in); |
1088 | EINA_LIST_FOREACH(copy, l, obj) | 1347 | EINA_LIST_FOREACH(copy, l, obj) |
@@ -1102,7 +1361,7 @@ evas_event_feed_multi_move(Evas *e, | |||
1102 | ev.cur.canvas.xsub = ev.cur.canvas.x; // fixme - lost precision | 1361 | ev.cur.canvas.xsub = ev.cur.canvas.x; // fixme - lost precision |
1103 | if (y != ev.cur.canvas.y) | 1362 | if (y != ev.cur.canvas.y) |
1104 | ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision | 1363 | ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision |
1105 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_MOVE, &ev); | 1364 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_MOVE, &ev, event_id); |
1106 | } | 1365 | } |
1107 | if (e->delete_me) break; | 1366 | if (e->delete_me) break; |
1108 | } | 1367 | } |
@@ -1114,9 +1373,11 @@ evas_event_feed_multi_move(Evas *e, | |||
1114 | Eina_List *l, *copy; | 1373 | Eina_List *l, *copy; |
1115 | Evas_Event_Multi_Move ev; | 1374 | Evas_Event_Multi_Move ev; |
1116 | Evas_Object *obj; | 1375 | Evas_Object *obj; |
1376 | int event_id = 0; | ||
1117 | 1377 | ||
1118 | _evas_object_event_new(); | 1378 | _evas_object_event_new(); |
1119 | 1379 | ||
1380 | event_id = _evas_event_counter; | ||
1120 | ev.device = d; | 1381 | ev.device = d; |
1121 | ev.cur.output.x = x; | 1382 | ev.cur.output.x = x; |
1122 | ev.cur.output.y = y; | 1383 | ev.cur.output.y = y; |
@@ -1133,7 +1394,7 @@ evas_event_feed_multi_move(Evas *e, | |||
1133 | ev.modifiers = &(e->modifiers); | 1394 | ev.modifiers = &(e->modifiers); |
1134 | ev.locks = &(e->locks); | 1395 | ev.locks = &(e->locks); |
1135 | ev.timestamp = timestamp; | 1396 | ev.timestamp = timestamp; |
1136 | ev.event_flags = EVAS_EVENT_FLAG_NONE; | 1397 | ev.event_flags = e->default_event_flags; |
1137 | 1398 | ||
1138 | /* get all new in objects */ | 1399 | /* get all new in objects */ |
1139 | ins = evas_event_objects_event_list(e, NULL, x, y); | 1400 | ins = evas_event_objects_event_list(e, NULL, x, y); |
@@ -1165,7 +1426,7 @@ evas_event_feed_multi_move(Evas *e, | |||
1165 | ev.cur.canvas.xsub = ev.cur.canvas.x; // fixme - lost precision | 1426 | ev.cur.canvas.xsub = ev.cur.canvas.x; // fixme - lost precision |
1166 | if (y != ev.cur.canvas.y) | 1427 | if (y != ev.cur.canvas.y) |
1167 | ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision | 1428 | ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision |
1168 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_MOVE, &ev); | 1429 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_MOVE, &ev, event_id); |
1169 | } | 1430 | } |
1170 | if (e->delete_me) break; | 1431 | if (e->delete_me) break; |
1171 | } | 1432 | } |
@@ -1190,6 +1451,7 @@ evas_event_feed_multi_move(Evas *e, | |||
1190 | EAPI void | 1451 | EAPI void |
1191 | evas_event_feed_key_down(Evas *e, const char *keyname, const char *key, const char *string, const char *compose, unsigned int timestamp, const void *data) | 1452 | evas_event_feed_key_down(Evas *e, const char *keyname, const char *key, const char *string, const char *compose, unsigned int timestamp, const void *data) |
1192 | { | 1453 | { |
1454 | int event_id = 0; | ||
1193 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | 1455 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); |
1194 | return; | 1456 | return; |
1195 | MAGIC_CHECK_END(); | 1457 | MAGIC_CHECK_END(); |
@@ -1204,6 +1466,7 @@ evas_event_feed_key_down(Evas *e, const char *keyname, const char *key, const ch | |||
1204 | 1466 | ||
1205 | _evas_object_event_new(); | 1467 | _evas_object_event_new(); |
1206 | 1468 | ||
1469 | event_id = _evas_event_counter; | ||
1207 | exclusive = EINA_FALSE; | 1470 | exclusive = EINA_FALSE; |
1208 | ev.keyname = (char *)keyname; | 1471 | ev.keyname = (char *)keyname; |
1209 | ev.data = (void *)data; | 1472 | ev.data = (void *)data; |
@@ -1213,7 +1476,7 @@ evas_event_feed_key_down(Evas *e, const char *keyname, const char *key, const ch | |||
1213 | ev.string = string; | 1476 | ev.string = string; |
1214 | ev.compose = compose; | 1477 | ev.compose = compose; |
1215 | ev.timestamp = timestamp; | 1478 | ev.timestamp = timestamp; |
1216 | ev.event_flags = EVAS_EVENT_FLAG_NONE; | 1479 | ev.event_flags = e->default_event_flags; |
1217 | 1480 | ||
1218 | if (e->grabs) | 1481 | if (e->grabs) |
1219 | { | 1482 | { |
@@ -1239,7 +1502,7 @@ evas_event_feed_key_down(Evas *e, const char *keyname, const char *key, const ch | |||
1239 | !evas_event_freezes_through(g->object)) | 1502 | !evas_event_freezes_through(g->object)) |
1240 | evas_object_event_callback_call(g->object, | 1503 | evas_object_event_callback_call(g->object, |
1241 | EVAS_CALLBACK_KEY_DOWN, | 1504 | EVAS_CALLBACK_KEY_DOWN, |
1242 | &ev); | 1505 | &ev, event_id); |
1243 | if (g->exclusive) exclusive = EINA_TRUE; | 1506 | if (g->exclusive) exclusive = EINA_TRUE; |
1244 | } | 1507 | } |
1245 | } | 1508 | } |
@@ -1266,7 +1529,7 @@ evas_event_feed_key_down(Evas *e, const char *keyname, const char *key, const ch | |||
1266 | { | 1529 | { |
1267 | if (e->events_frozen <= 0 && !evas_event_freezes_through(e->focused)) | 1530 | if (e->events_frozen <= 0 && !evas_event_freezes_through(e->focused)) |
1268 | evas_object_event_callback_call(e->focused, EVAS_CALLBACK_KEY_DOWN, | 1531 | evas_object_event_callback_call(e->focused, EVAS_CALLBACK_KEY_DOWN, |
1269 | &ev); | 1532 | &ev, event_id); |
1270 | } | 1533 | } |
1271 | _evas_post_event_callback_call(e); | 1534 | _evas_post_event_callback_call(e); |
1272 | _evas_unwalk(e); | 1535 | _evas_unwalk(e); |
@@ -1275,6 +1538,7 @@ evas_event_feed_key_down(Evas *e, const char *keyname, const char *key, const ch | |||
1275 | EAPI void | 1538 | EAPI void |
1276 | evas_event_feed_key_up(Evas *e, const char *keyname, const char *key, const char *string, const char *compose, unsigned int timestamp, const void *data) | 1539 | evas_event_feed_key_up(Evas *e, const char *keyname, const char *key, const char *string, const char *compose, unsigned int timestamp, const void *data) |
1277 | { | 1540 | { |
1541 | int event_id = 0; | ||
1278 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | 1542 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); |
1279 | return; | 1543 | return; |
1280 | MAGIC_CHECK_END(); | 1544 | MAGIC_CHECK_END(); |
@@ -1288,6 +1552,7 @@ evas_event_feed_key_up(Evas *e, const char *keyname, const char *key, const char | |||
1288 | 1552 | ||
1289 | _evas_object_event_new(); | 1553 | _evas_object_event_new(); |
1290 | 1554 | ||
1555 | event_id = _evas_event_counter; | ||
1291 | exclusive = EINA_FALSE; | 1556 | exclusive = EINA_FALSE; |
1292 | ev.keyname = (char *)keyname; | 1557 | ev.keyname = (char *)keyname; |
1293 | ev.data = (void *)data; | 1558 | ev.data = (void *)data; |
@@ -1297,7 +1562,7 @@ evas_event_feed_key_up(Evas *e, const char *keyname, const char *key, const char | |||
1297 | ev.string = string; | 1562 | ev.string = string; |
1298 | ev.compose = compose; | 1563 | ev.compose = compose; |
1299 | ev.timestamp = timestamp; | 1564 | ev.timestamp = timestamp; |
1300 | ev.event_flags = EVAS_EVENT_FLAG_NONE; | 1565 | ev.event_flags = e->default_event_flags; |
1301 | 1566 | ||
1302 | if (e->grabs) | 1567 | if (e->grabs) |
1303 | { | 1568 | { |
@@ -1322,7 +1587,7 @@ evas_event_feed_key_up(Evas *e, const char *keyname, const char *key, const char | |||
1322 | if (e->events_frozen <= 0 && | 1587 | if (e->events_frozen <= 0 && |
1323 | !evas_event_freezes_through(g->object)) | 1588 | !evas_event_freezes_through(g->object)) |
1324 | evas_object_event_callback_call(g->object, | 1589 | evas_object_event_callback_call(g->object, |
1325 | EVAS_CALLBACK_KEY_UP, &ev); | 1590 | EVAS_CALLBACK_KEY_UP, &ev, event_id); |
1326 | if (g->exclusive) exclusive = EINA_TRUE; | 1591 | if (g->exclusive) exclusive = EINA_TRUE; |
1327 | } | 1592 | } |
1328 | if (e->delete_me) break; | 1593 | if (e->delete_me) break; |
@@ -1349,7 +1614,7 @@ evas_event_feed_key_up(Evas *e, const char *keyname, const char *key, const char | |||
1349 | { | 1614 | { |
1350 | if (e->events_frozen <= 0 && !evas_event_freezes_through(e->focused)) | 1615 | if (e->events_frozen <= 0 && !evas_event_freezes_through(e->focused)) |
1351 | evas_object_event_callback_call(e->focused, EVAS_CALLBACK_KEY_UP, | 1616 | evas_object_event_callback_call(e->focused, EVAS_CALLBACK_KEY_UP, |
1352 | &ev); | 1617 | &ev, event_id); |
1353 | } | 1618 | } |
1354 | _evas_post_event_callback_call(e); | 1619 | _evas_post_event_callback_call(e); |
1355 | _evas_unwalk(e); | 1620 | _evas_unwalk(e); |
@@ -1361,6 +1626,7 @@ evas_event_feed_hold(Evas *e, int hold, unsigned int timestamp, const void *data | |||
1361 | Eina_List *l, *copy; | 1626 | Eina_List *l, *copy; |
1362 | Evas_Event_Hold ev; | 1627 | Evas_Event_Hold ev; |
1363 | Evas_Object *obj; | 1628 | Evas_Object *obj; |
1629 | int event_id = 0; | ||
1364 | 1630 | ||
1365 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | 1631 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); |
1366 | return; | 1632 | return; |
@@ -1371,17 +1637,18 @@ evas_event_feed_hold(Evas *e, int hold, unsigned int timestamp, const void *data | |||
1371 | 1637 | ||
1372 | _evas_object_event_new(); | 1638 | _evas_object_event_new(); |
1373 | 1639 | ||
1640 | event_id = _evas_event_counter; | ||
1374 | ev.hold = hold; | 1641 | ev.hold = hold; |
1375 | ev.data = (void *)data; | 1642 | ev.data = (void *)data; |
1376 | ev.timestamp = timestamp; | 1643 | ev.timestamp = timestamp; |
1377 | ev.event_flags = EVAS_EVENT_FLAG_NONE; | 1644 | ev.event_flags = e->default_event_flags; |
1378 | 1645 | ||
1379 | _evas_walk(e); | 1646 | _evas_walk(e); |
1380 | copy = evas_event_list_copy(e->pointer.object.in); | 1647 | copy = evas_event_list_copy(e->pointer.object.in); |
1381 | EINA_LIST_FOREACH(copy, l, obj) | 1648 | EINA_LIST_FOREACH(copy, l, obj) |
1382 | { | 1649 | { |
1383 | if ((e->events_frozen <= 0) && !evas_event_freezes_through(obj)) | 1650 | if ((e->events_frozen <= 0) && !evas_event_freezes_through(obj)) |
1384 | evas_object_event_callback_call(obj, EVAS_CALLBACK_HOLD, &ev); | 1651 | evas_object_event_callback_call(obj, EVAS_CALLBACK_HOLD, &ev, event_id); |
1385 | if (e->delete_me) break; | 1652 | if (e->delete_me) break; |
1386 | } | 1653 | } |
1387 | if (copy) copy = eina_list_free(copy); | 1654 | if (copy) copy = eina_list_free(copy); |
@@ -1528,75 +1795,84 @@ evas_object_pointer_mode_get(const Evas_Object *obj) | |||
1528 | EAPI void | 1795 | EAPI void |
1529 | evas_event_refeed_event(Evas *e, void *event_copy, Evas_Callback_Type event_type) | 1796 | evas_event_refeed_event(Evas *e, void *event_copy, Evas_Callback_Type event_type) |
1530 | { | 1797 | { |
1531 | switch(event_type) | 1798 | switch (event_type) |
1532 | { | 1799 | { |
1533 | case EVAS_CALLBACK_MOUSE_IN: | 1800 | case EVAS_CALLBACK_MOUSE_IN: |
1534 | { | 1801 | { |
1535 | Evas_Event_Mouse_In *ev = event_copy; | 1802 | Evas_Event_Mouse_In *ev = event_copy; |
1536 | evas_event_feed_mouse_in(e, ev->timestamp, ev->data); | 1803 | evas_event_feed_mouse_in(e, ev->timestamp, ev->data); |
1537 | break; | 1804 | break; |
1538 | } | 1805 | } |
1539 | case EVAS_CALLBACK_MOUSE_OUT: | 1806 | case EVAS_CALLBACK_MOUSE_OUT: |
1540 | { | 1807 | { |
1541 | Evas_Event_Mouse_Out *ev = event_copy; | 1808 | Evas_Event_Mouse_Out *ev = event_copy; |
1542 | evas_event_feed_mouse_out(e, ev->timestamp, ev->data); | 1809 | evas_event_feed_mouse_out(e, ev->timestamp, ev->data); |
1543 | break; | 1810 | break; |
1544 | } | 1811 | } |
1545 | case EVAS_CALLBACK_MOUSE_DOWN: | 1812 | case EVAS_CALLBACK_MOUSE_DOWN: |
1546 | { | 1813 | { |
1547 | Evas_Event_Mouse_Down *ev = event_copy; | 1814 | Evas_Event_Mouse_Down *ev = event_copy; |
1548 | evas_event_feed_mouse_down(e, ev->button, ev->flags, ev-> timestamp, ev->data); | 1815 | evas_event_feed_mouse_down(e, ev->button, ev->flags, ev-> timestamp, ev->data); |
1549 | break; | 1816 | break; |
1550 | } | 1817 | } |
1551 | case EVAS_CALLBACK_MOUSE_UP: | 1818 | case EVAS_CALLBACK_MOUSE_UP: |
1552 | { | 1819 | { |
1553 | Evas_Event_Mouse_Up *ev = event_copy; | 1820 | Evas_Event_Mouse_Up *ev = event_copy; |
1554 | evas_event_feed_mouse_up(e, ev->button, ev->flags, ev-> timestamp, ev->data); | 1821 | evas_event_feed_mouse_up(e, ev->button, ev->flags, ev-> timestamp, ev->data); |
1555 | break; | 1822 | break; |
1556 | } | 1823 | } |
1557 | case EVAS_CALLBACK_MOUSE_MOVE: | 1824 | case EVAS_CALLBACK_MOUSE_MOVE: |
1558 | { | 1825 | { |
1559 | Evas_Event_Mouse_Move *ev = event_copy; | 1826 | Evas_Event_Mouse_Move *ev = event_copy; |
1560 | evas_event_feed_mouse_move(e, ev->cur.canvas.x, ev->cur.canvas.y, ev->timestamp, ev->data); | 1827 | evas_event_feed_mouse_move(e, ev->cur.canvas.x, ev->cur.canvas.y, ev->timestamp, ev->data); |
1561 | break; | 1828 | break; |
1562 | } | 1829 | } |
1563 | case EVAS_CALLBACK_MOUSE_WHEEL: | 1830 | case EVAS_CALLBACK_MOUSE_WHEEL: |
1564 | { | 1831 | { |
1565 | Evas_Event_Mouse_Wheel *ev = event_copy; | 1832 | Evas_Event_Mouse_Wheel *ev = event_copy; |
1566 | evas_event_feed_mouse_wheel(e, ev->direction, ev-> z, ev->timestamp, ev->data); | 1833 | evas_event_feed_mouse_wheel(e, ev->direction, ev-> z, ev->timestamp, ev->data); |
1567 | break; | 1834 | break; |
1568 | } | 1835 | } |
1569 | case EVAS_CALLBACK_MULTI_DOWN: | 1836 | case EVAS_CALLBACK_MULTI_DOWN: |
1570 | { | 1837 | { |
1571 | Evas_Event_Multi_Down *ev = event_copy; | 1838 | Evas_Event_Multi_Down *ev = event_copy; |
1572 | evas_event_feed_multi_down(e, ev->device, ev->canvas.x, ev->canvas.y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, ev->canvas.xsub, ev->canvas.ysub, ev->flags, ev->timestamp, ev->data); | 1839 | evas_event_feed_multi_down(e, ev->device, ev->canvas.x, ev->canvas.y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, ev->canvas.xsub, ev->canvas.ysub, ev->flags, ev->timestamp, ev->data); |
1573 | break; | 1840 | break; |
1574 | } | 1841 | } |
1575 | case EVAS_CALLBACK_MULTI_UP: | 1842 | case EVAS_CALLBACK_MULTI_UP: |
1576 | { | 1843 | { |
1577 | Evas_Event_Multi_Up *ev = event_copy; | 1844 | Evas_Event_Multi_Up *ev = event_copy; |
1578 | evas_event_feed_multi_up(e, ev->device, ev->canvas.x, ev->canvas.y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, ev->canvas.xsub, ev->canvas.ysub, ev->flags, ev->timestamp, ev->data); | 1845 | evas_event_feed_multi_up(e, ev->device, ev->canvas.x, ev->canvas.y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, ev->canvas.xsub, ev->canvas.ysub, ev->flags, ev->timestamp, ev->data); |
1579 | break; | 1846 | break; |
1580 | } | 1847 | } |
1581 | case EVAS_CALLBACK_MULTI_MOVE: | 1848 | case EVAS_CALLBACK_MULTI_MOVE: |
1582 | { | 1849 | { |
1583 | Evas_Event_Multi_Move *ev = event_copy; | 1850 | Evas_Event_Multi_Move *ev = event_copy; |
1584 | evas_event_feed_multi_move(e, ev->device, ev->cur.canvas.x, ev->cur.canvas.y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, ev->cur.canvas.xsub, ev->cur.canvas.ysub, ev->timestamp, ev->data); | 1851 | evas_event_feed_multi_move(e, ev->device, ev->cur.canvas.x, ev->cur.canvas.y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, ev->cur.canvas.xsub, ev->cur.canvas.ysub, ev->timestamp, ev->data); |
1585 | break; | 1852 | break; |
1586 | } | 1853 | } |
1587 | case EVAS_CALLBACK_KEY_DOWN: | 1854 | case EVAS_CALLBACK_KEY_DOWN: |
1588 | { | 1855 | { |
1589 | Evas_Event_Key_Down *ev = event_copy; | 1856 | Evas_Event_Key_Down *ev = event_copy; |
1590 | evas_event_feed_key_down(e, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, ev->data); | 1857 | evas_event_feed_key_down(e, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, ev->data); |
1591 | break; | 1858 | break; |
1592 | } | 1859 | } |
1593 | case EVAS_CALLBACK_KEY_UP: | 1860 | case EVAS_CALLBACK_KEY_UP: |
1594 | { | 1861 | { |
1595 | Evas_Event_Key_Up *ev = event_copy; | 1862 | Evas_Event_Key_Up *ev = event_copy; |
1596 | evas_event_feed_key_up(e, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, ev->data); | 1863 | evas_event_feed_key_up(e, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, ev->data); |
1597 | break; | 1864 | break; |
1598 | } | 1865 | } |
1599 | default: /* All non-input events are not handeled */ | 1866 | default: /* All non-input events are not handeled */ |
1600 | break; | 1867 | break; |
1601 | } | 1868 | } |
1602 | } | 1869 | } |
1870 | |||
1871 | EAPI int | ||
1872 | evas_event_down_count_get(const Evas *e) | ||
1873 | { | ||
1874 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | ||
1875 | return 0; | ||
1876 | MAGIC_CHECK_END(); | ||
1877 | return e->pointer.downs; | ||
1878 | } | ||
diff --git a/libraries/evas/src/lib/canvas/evas_focus.c b/libraries/evas/src/lib/canvas/evas_focus.c index a1a3bca..29da7e7 100644 --- a/libraries/evas/src/lib/canvas/evas_focus.c +++ b/libraries/evas/src/lib/canvas/evas_focus.c | |||
@@ -10,29 +10,31 @@ | |||
10 | EAPI void | 10 | EAPI void |
11 | evas_object_focus_set(Evas_Object *obj, Eina_Bool focus) | 11 | evas_object_focus_set(Evas_Object *obj, Eina_Bool focus) |
12 | { | 12 | { |
13 | int event_id = 0; | ||
13 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 14 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
14 | return; | 15 | return; |
15 | MAGIC_CHECK_END(); | 16 | MAGIC_CHECK_END(); |
16 | 17 | ||
17 | _evas_object_event_new(); | 18 | _evas_object_event_new(); |
18 | 19 | ||
20 | event_id = _evas_event_counter; | ||
19 | if (focus) | 21 | if (focus) |
20 | { | 22 | { |
21 | if (obj->focused) goto end; | 23 | if (obj->focused) goto end; |
22 | if (obj->layer->evas->focused) | 24 | if (obj->layer->evas->focused) |
23 | evas_object_focus_set(obj->layer->evas->focused, 0); | 25 | evas_object_focus_set(obj->layer->evas->focused, 0); |
24 | obj->focused = 1; | 26 | obj->focused = 1; |
25 | obj->layer->evas->focused = obj; | 27 | obj->layer->evas->focused = obj; |
26 | evas_object_event_callback_call(obj, EVAS_CALLBACK_FOCUS_IN, NULL); | 28 | evas_object_event_callback_call(obj, EVAS_CALLBACK_FOCUS_IN, NULL, event_id); |
27 | evas_event_callback_call(obj->layer->evas, | 29 | evas_event_callback_call(obj->layer->evas, |
28 | EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, obj); | 30 | EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, obj); |
29 | } | 31 | } |
30 | else | 32 | else |
31 | { | 33 | { |
32 | if (!obj->focused) goto end; | 34 | if (!obj->focused) goto end; |
33 | obj->focused = 0; | 35 | obj->focused = 0; |
34 | obj->layer->evas->focused = NULL; | 36 | obj->layer->evas->focused = NULL; |
35 | evas_object_event_callback_call(obj, EVAS_CALLBACK_FOCUS_OUT, NULL); | 37 | evas_object_event_callback_call(obj, EVAS_CALLBACK_FOCUS_OUT, NULL, event_id); |
36 | evas_event_callback_call(obj->layer->evas, | 38 | evas_event_callback_call(obj->layer->evas, |
37 | EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, obj); | 39 | EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, obj); |
38 | } | 40 | } |
diff --git a/libraries/evas/src/lib/canvas/evas_gl.c b/libraries/evas/src/lib/canvas/evas_gl.c index 47bb583..85ed851 100644 --- a/libraries/evas/src/lib/canvas/evas_gl.c +++ b/libraries/evas/src/lib/canvas/evas_gl.c | |||
@@ -37,6 +37,13 @@ evas_gl_new(Evas *e) | |||
37 | evas_gl->magic = MAGIC_EVAS_GL; | 37 | evas_gl->magic = MAGIC_EVAS_GL; |
38 | evas_gl->evas = e; | 38 | evas_gl->evas = e; |
39 | 39 | ||
40 | if (!evas_gl->evas->engine.func->gl_context_create) | ||
41 | { | ||
42 | ERR("GL engine not available\n"); | ||
43 | free(evas_gl); | ||
44 | return NULL; | ||
45 | } | ||
46 | |||
40 | return evas_gl; | 47 | return evas_gl; |
41 | } | 48 | } |
42 | 49 | ||
@@ -60,6 +67,24 @@ evas_gl_free(Evas_GL *evas_gl) | |||
60 | free(evas_gl); | 67 | free(evas_gl); |
61 | } | 68 | } |
62 | 69 | ||
70 | EAPI Evas_GL_Config * | ||
71 | evas_gl_config_new() | ||
72 | { | ||
73 | Evas_GL_Config *cfg; | ||
74 | |||
75 | cfg = calloc(1, sizeof(Evas_GL_Config)); | ||
76 | |||
77 | if (!cfg) return NULL; | ||
78 | |||
79 | return cfg; | ||
80 | } | ||
81 | |||
82 | EAPI void | ||
83 | evas_gl_config_free(Evas_GL_Config *cfg) | ||
84 | { | ||
85 | if (cfg) free(cfg); | ||
86 | } | ||
87 | |||
63 | EAPI Evas_GL_Surface * | 88 | EAPI Evas_GL_Surface * |
64 | evas_gl_surface_create(Evas_GL *evas_gl, Evas_GL_Config *config, int width, int height) | 89 | evas_gl_surface_create(Evas_GL *evas_gl, Evas_GL_Config *config, int width, int height) |
65 | { | 90 | { |
@@ -77,6 +102,8 @@ evas_gl_surface_create(Evas_GL *evas_gl, Evas_GL_Config *config, int width, int | |||
77 | 102 | ||
78 | surf = calloc(1, sizeof(Evas_GL_Surface)); | 103 | surf = calloc(1, sizeof(Evas_GL_Surface)); |
79 | 104 | ||
105 | if (!surf) return NULL; | ||
106 | |||
80 | surf->data = evas_gl->evas->engine.func->gl_surface_create(evas_gl->evas->engine.data.output, config, width, height); | 107 | surf->data = evas_gl->evas->engine.func->gl_surface_create(evas_gl->evas->engine.data.output, config, width, height); |
81 | 108 | ||
82 | if (!surf->data) | 109 | if (!surf->data) |
diff --git a/libraries/evas/src/lib/canvas/evas_main.c b/libraries/evas/src/lib/canvas/evas_main.c index 0a37b2c..687744f 100644 --- a/libraries/evas/src/lib/canvas/evas_main.c +++ b/libraries/evas/src/lib/canvas/evas_main.c | |||
@@ -118,12 +118,16 @@ evas_new(void) | |||
118 | e->output.render_method = RENDER_METHOD_INVALID; | 118 | e->output.render_method = RENDER_METHOD_INVALID; |
119 | e->viewport.w = 1; | 119 | e->viewport.w = 1; |
120 | e->viewport.h = 1; | 120 | e->viewport.h = 1; |
121 | e->framespace.x = 0; | ||
122 | e->framespace.y = 0; | ||
123 | e->framespace.w = 0; | ||
124 | e->framespace.h = 0; | ||
121 | e->hinting = EVAS_FONT_HINTING_BYTECODE; | 125 | e->hinting = EVAS_FONT_HINTING_BYTECODE; |
122 | e->name_hash = eina_hash_string_superfast_new(NULL); | 126 | e->name_hash = eina_hash_string_superfast_new(NULL); |
123 | eina_clist_init(&e->calc_list); | 127 | eina_clist_init(&e->calc_list); |
124 | eina_clist_init(&e->calc_done); | 128 | eina_clist_init(&e->calc_done); |
125 | 129 | ||
126 | #define EVAS_ARRAY_SET(E, Array) \ | 130 | #define EVAS_ARRAY_SET(E, Array) \ |
127 | eina_array_step_set(&E->Array, sizeof (E->Array), 4096); | 131 | eina_array_step_set(&E->Array, sizeof (E->Array), 4096); |
128 | 132 | ||
129 | EVAS_ARRAY_SET(e, delete_objects); | 133 | EVAS_ARRAY_SET(e, delete_objects); |
@@ -408,6 +412,41 @@ evas_output_viewport_get(const Evas *e, Evas_Coord *x, Evas_Coord *y, Evas_Coord | |||
408 | if (h) *h = e->viewport.h; | 412 | if (h) *h = e->viewport.h; |
409 | } | 413 | } |
410 | 414 | ||
415 | EAPI void | ||
416 | evas_output_framespace_set(Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) | ||
417 | { | ||
418 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | ||
419 | return; | ||
420 | MAGIC_CHECK_END(); | ||
421 | |||
422 | if ((x == e->framespace.x) && (y == e->framespace.y) && | ||
423 | (w == e->framespace.w) && (h == e->framespace.h)) return; | ||
424 | e->framespace.x = x; | ||
425 | e->framespace.y = y; | ||
426 | e->framespace.w = w; | ||
427 | e->framespace.h = h; | ||
428 | e->framespace.changed = 1; | ||
429 | e->output_validity++; | ||
430 | e->changed = 1; | ||
431 | } | ||
432 | |||
433 | EAPI void | ||
434 | evas_output_framespace_get(const Evas *e, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) | ||
435 | { | ||
436 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | ||
437 | if (x) *x = 0; | ||
438 | if (y) *y = 0; | ||
439 | if (w) *w = 0; | ||
440 | if (h) *h = 0; | ||
441 | return; | ||
442 | MAGIC_CHECK_END(); | ||
443 | |||
444 | if (x) *x = e->framespace.x; | ||
445 | if (y) *y = e->framespace.y; | ||
446 | if (w) *w = e->framespace.w; | ||
447 | if (h) *h = e->framespace.h; | ||
448 | } | ||
449 | |||
411 | EAPI Evas_Coord | 450 | EAPI Evas_Coord |
412 | evas_coord_screen_x_to_world(const Evas *e, int x) | 451 | evas_coord_screen_x_to_world(const Evas *e, int x) |
413 | { | 452 | { |
diff --git a/libraries/evas/src/lib/canvas/evas_map.c b/libraries/evas/src/lib/canvas/evas_map.c index fca8b3a..2359d5a 100644 --- a/libraries/evas/src/lib/canvas/evas_map.c +++ b/libraries/evas/src/lib/canvas/evas_map.c | |||
@@ -81,17 +81,19 @@ _evas_map_calc_map_geometry(Evas_Object *obj) | |||
81 | 81 | ||
82 | p = obj->cur.map->points; | 82 | p = obj->cur.map->points; |
83 | p_end = p + obj->cur.map->count; | 83 | p_end = p + obj->cur.map->count; |
84 | x1 = lround(p->x); | 84 | x1 = x2 = lround(p->x); |
85 | x2 = lround(p->x); | 85 | y1 = y2 = lround(p->y); |
86 | y1 = lround(p->y); | ||
87 | y2 = lround(p->y); | ||
88 | p++; | 86 | p++; |
89 | for (; p < p_end; p++) | 87 | for (; p < p_end; p++) |
90 | { | 88 | { |
91 | if (p->x < x1) x1 = p->x; | 89 | Evas_Coord x, y; |
92 | if (p->x > x2) x2 = p->x; | 90 | |
93 | if (p->y < y1) y1 = p->y; | 91 | x = lround(p->x); |
94 | if (p->y > y2) y2 = p->y; | 92 | y = lround(p->y); |
93 | if (x < x1) x1 = x; | ||
94 | if (x > x2) x2 = x; | ||
95 | if (y < y1) y1 = y; | ||
96 | if (y > y2) y2 = y; | ||
95 | } | 97 | } |
96 | // this causes clip-out bugs now mapped objs canbe opaque!!! | 98 | // this causes clip-out bugs now mapped objs canbe opaque!!! |
97 | // // add 1 pixel of fuzz around the map region to ensure updates are correct | 99 | // // add 1 pixel of fuzz around the map region to ensure updates are correct |
diff --git a/libraries/evas/src/lib/canvas/evas_name.c b/libraries/evas/src/lib/canvas/evas_name.c index c42f941..1a9d20f 100644 --- a/libraries/evas/src/lib/canvas/evas_name.c +++ b/libraries/evas/src/lib/canvas/evas_name.c | |||
@@ -38,3 +38,35 @@ evas_object_name_find(const Evas *e, const char *name) | |||
38 | if (!name) return NULL; | 38 | if (!name) return NULL; |
39 | return (Evas_Object *)eina_hash_find(e->name_hash, name); | 39 | return (Evas_Object *)eina_hash_find(e->name_hash, name); |
40 | } | 40 | } |
41 | |||
42 | static Evas_Object * | ||
43 | _evas_object_name_child_find(const Evas_Object *obj, const char *name, int recurse) | ||
44 | { | ||
45 | const Eina_Inlist *lst; | ||
46 | Evas_Object *child; | ||
47 | |||
48 | if (!obj->smart.smart) return NULL; | ||
49 | lst = evas_object_smart_members_get_direct(obj); | ||
50 | EINA_INLIST_FOREACH(lst, child) | ||
51 | { | ||
52 | if (child->delete_me) continue; | ||
53 | if (!child->name) continue; | ||
54 | if (!strcmp(name, child->name)) return child; | ||
55 | if (recurse != 0) | ||
56 | { | ||
57 | if ((obj = _evas_object_name_child_find(child, name, recurse - 1))) | ||
58 | return (Evas_Object *)obj; | ||
59 | } | ||
60 | } | ||
61 | return NULL; | ||
62 | } | ||
63 | |||
64 | EAPI Evas_Object * | ||
65 | evas_object_name_child_find(const Evas_Object *obj, const char *name, int recurse) | ||
66 | { | ||
67 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | ||
68 | return NULL; | ||
69 | MAGIC_CHECK_END(); | ||
70 | if (!name) return NULL; | ||
71 | return _evas_object_name_child_find(obj, name, recurse); | ||
72 | } | ||
diff --git a/libraries/evas/src/lib/canvas/evas_object_box.c b/libraries/evas/src/lib/canvas/evas_object_box.c index ab2f222..228d37c 100644 --- a/libraries/evas/src/lib/canvas/evas_object_box.c +++ b/libraries/evas/src/lib/canvas/evas_object_box.c | |||
@@ -1363,7 +1363,7 @@ _evas_object_box_layout_flow_horizontal_row_info_collect(Evas_Object_Box_Data *p | |||
1363 | EAPI void | 1363 | EAPI void |
1364 | evas_object_box_layout_flow_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data __UNUSED__) | 1364 | evas_object_box_layout_flow_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data __UNUSED__) |
1365 | { | 1365 | { |
1366 | int n_children, v_justify; | 1366 | int n_children; |
1367 | int r, row_count = 0; | 1367 | int r, row_count = 0; |
1368 | int min_w = 0, min_h = 0; | 1368 | int min_w = 0, min_h = 0; |
1369 | int max_h, inc_y; | 1369 | int max_h, inc_y; |
@@ -1398,7 +1398,6 @@ evas_object_box_layout_flow_horizontal(Evas_Object *o, Evas_Object_Box_Data *pri | |||
1398 | (priv, w, &row_count, row_max_h, row_break, row_width, &offset_y, &max_h); | 1398 | (priv, w, &row_count, row_max_h, row_break, row_width, &offset_y, &max_h); |
1399 | 1399 | ||
1400 | inc_y = 0; | 1400 | inc_y = 0; |
1401 | v_justify = 0; | ||
1402 | remain_y = h - (offset_y + max_h); | 1401 | remain_y = h - (offset_y + max_h); |
1403 | 1402 | ||
1404 | if (remain_y > 0) | 1403 | if (remain_y > 0) |
diff --git a/libraries/evas/src/lib/canvas/evas_object_grid.c b/libraries/evas/src/lib/canvas/evas_object_grid.c index ac96f04..db0f43d 100644 --- a/libraries/evas/src/lib/canvas/evas_object_grid.c +++ b/libraries/evas/src/lib/canvas/evas_object_grid.c | |||
@@ -1,5 +1,5 @@ | |||
1 | #include <errno.h> | ||
2 | #include "evas_common.h" | 1 | #include "evas_common.h" |
2 | #include <errno.h> | ||
3 | 3 | ||
4 | typedef struct _Evas_Object_Grid_Data Evas_Object_Grid_Data; | 4 | typedef struct _Evas_Object_Grid_Data Evas_Object_Grid_Data; |
5 | typedef struct _Evas_Object_Grid_Option Evas_Object_Grid_Option; | 5 | typedef struct _Evas_Object_Grid_Option Evas_Object_Grid_Option; |
diff --git a/libraries/evas/src/lib/canvas/evas_object_image.c b/libraries/evas/src/lib/canvas/evas_object_image.c index 7f757a6..d9f6378 100644 --- a/libraries/evas/src/lib/canvas/evas_object_image.c +++ b/libraries/evas/src/lib/canvas/evas_object_image.c | |||
@@ -1,7 +1,13 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include "config.h" /* so that EAPI in Evas.h is correctly defined */ | ||
3 | #endif | ||
4 | |||
1 | #include <sys/types.h> | 5 | #include <sys/types.h> |
2 | #include <unistd.h> | 6 | #include <unistd.h> |
3 | #include <stdlib.h> | 7 | #include <stdlib.h> |
4 | #include <sys/mman.h> | 8 | #ifdef HAVE_SYS_MMAN_H |
9 | # include <sys/mman.h> | ||
10 | #endif | ||
5 | #include <math.h> | 11 | #include <math.h> |
6 | 12 | ||
7 | #include "evas_common.h" | 13 | #include "evas_common.h" |
@@ -192,8 +198,9 @@ evas_object_image_filled_add(Evas *e) | |||
192 | static void | 198 | static void |
193 | _cleanup_tmpf(Evas_Object *obj) | 199 | _cleanup_tmpf(Evas_Object *obj) |
194 | { | 200 | { |
201 | #ifdef HAVE_SYS_MMAN_H | ||
195 | Evas_Object_Image *o; | 202 | Evas_Object_Image *o; |
196 | 203 | ||
197 | o = (Evas_Object_Image *)(obj->object_data); | 204 | o = (Evas_Object_Image *)(obj->object_data); |
198 | if (!o->tmpf) return; | 205 | if (!o->tmpf) return; |
199 | #ifdef __linux__ | 206 | #ifdef __linux__ |
@@ -204,11 +211,15 @@ _cleanup_tmpf(Evas_Object *obj) | |||
204 | eina_stringshare_del(o->tmpf); | 211 | eina_stringshare_del(o->tmpf); |
205 | o->tmpf_fd = -1; | 212 | o->tmpf_fd = -1; |
206 | o->tmpf = NULL; | 213 | o->tmpf = NULL; |
214 | #else | ||
215 | (void) obj; | ||
216 | #endif | ||
207 | } | 217 | } |
208 | 218 | ||
209 | static void | 219 | static void |
210 | _create_tmpf(Evas_Object *obj, void *data, int size, char *format __UNUSED__) | 220 | _create_tmpf(Evas_Object *obj, void *data, int size, char *format __UNUSED__) |
211 | { | 221 | { |
222 | #ifdef HAVE_SYS_MMAN_H | ||
212 | Evas_Object_Image *o; | 223 | Evas_Object_Image *o; |
213 | char buf[4096]; | 224 | char buf[4096]; |
214 | void *dst; | 225 | void *dst; |
@@ -253,6 +264,12 @@ _create_tmpf(Evas_Object *obj, void *data, int size, char *format __UNUSED__) | |||
253 | o->tmpf = eina_stringshare_add(buf); | 264 | o->tmpf = eina_stringshare_add(buf); |
254 | memcpy(dst, data, size); | 265 | memcpy(dst, data, size); |
255 | munmap(dst, size); | 266 | munmap(dst, size); |
267 | #else | ||
268 | (void) obj; | ||
269 | (void) data; | ||
270 | (void) size; | ||
271 | (void) format; | ||
272 | #endif | ||
256 | } | 273 | } |
257 | 274 | ||
258 | EAPI void | 275 | EAPI void |
@@ -1917,6 +1934,24 @@ evas_object_image_content_hint_get(const Evas_Object *obj) | |||
1917 | return o->content_hint; | 1934 | return o->content_hint; |
1918 | } | 1935 | } |
1919 | 1936 | ||
1937 | EAPI Eina_Bool | ||
1938 | evas_object_image_region_support_get(const Evas_Object *obj) | ||
1939 | { | ||
1940 | Evas_Object_Image *o; | ||
1941 | |||
1942 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | ||
1943 | return EINA_FALSE; | ||
1944 | MAGIC_CHECK_END(); | ||
1945 | o = (Evas_Object_Image *) (obj->object_data); | ||
1946 | MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE); | ||
1947 | return EINA_FALSE; | ||
1948 | MAGIC_CHECK_END(); | ||
1949 | |||
1950 | return obj->layer->evas->engine.func->image_can_region_get( | ||
1951 | obj->layer->evas->engine.data.output, | ||
1952 | o->engine_data); | ||
1953 | } | ||
1954 | |||
1920 | /* animated feature */ | 1955 | /* animated feature */ |
1921 | EAPI Eina_Bool | 1956 | EAPI Eina_Bool |
1922 | evas_object_image_animated_get(const Evas_Object *obj) | 1957 | evas_object_image_animated_get(const Evas_Object *obj) |
@@ -3770,8 +3805,7 @@ evas_object_image_data_convert_internal(Evas_Object_Image *o, void *data, Evas_C | |||
3770 | to_cspace); | 3805 | to_cspace); |
3771 | break; | 3806 | break; |
3772 | case EVAS_COLORSPACE_YCBCR422601_PL: | 3807 | case EVAS_COLORSPACE_YCBCR422601_PL: |
3773 | fprintf(stderr, "EVAS_COLORSPACE_YCBCR422601_PL:\n"); | 3808 | out = evas_common_convert_yuv_422_601_to(data, |
3774 | out = evas_common_convert_yuv_422_601_to(data, | ||
3775 | o->cur.image.w, | 3809 | o->cur.image.w, |
3776 | o->cur.image.h, | 3810 | o->cur.image.h, |
3777 | to_cspace); | 3811 | to_cspace); |
@@ -3795,7 +3829,7 @@ evas_object_image_data_convert_internal(Evas_Object_Image *o, void *data, Evas_C | |||
3795 | to_cspace); | 3829 | to_cspace); |
3796 | break; | 3830 | break; |
3797 | default: | 3831 | default: |
3798 | fprintf(stderr, "unknow colorspace: %i\n", o->cur.cspace); | 3832 | WRN("unknow colorspace: %i\n", o->cur.cspace); |
3799 | break; | 3833 | break; |
3800 | } | 3834 | } |
3801 | 3835 | ||
@@ -3806,9 +3840,7 @@ static void | |||
3806 | evas_object_image_filled_resize_listener(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *einfo __UNUSED__) | 3840 | evas_object_image_filled_resize_listener(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *einfo __UNUSED__) |
3807 | { | 3841 | { |
3808 | Evas_Coord w, h; | 3842 | Evas_Coord w, h; |
3809 | Evas_Object_Image *o; | ||
3810 | 3843 | ||
3811 | o = obj->object_data; | ||
3812 | evas_object_geometry_get(obj, NULL, NULL, &w, &h); | 3844 | evas_object_geometry_get(obj, NULL, NULL, &w, &h); |
3813 | evas_object_image_fill_set(obj, 0, 0, w, h); | 3845 | evas_object_image_fill_set(obj, 0, 0, w, h); |
3814 | } | 3846 | } |
diff --git a/libraries/evas/src/lib/canvas/evas_object_inform.c b/libraries/evas/src/lib/canvas/evas_object_inform.c index bc09eb9..302da42 100644 --- a/libraries/evas/src/lib/canvas/evas_object_inform.c +++ b/libraries/evas/src/lib/canvas/evas_object_inform.c | |||
@@ -8,7 +8,7 @@ evas_object_inform_call_show(Evas_Object *obj) | |||
8 | { | 8 | { |
9 | _evas_object_event_new(); | 9 | _evas_object_event_new(); |
10 | 10 | ||
11 | evas_object_event_callback_call(obj, EVAS_CALLBACK_SHOW, NULL); | 11 | evas_object_event_callback_call(obj, EVAS_CALLBACK_SHOW, NULL, _evas_event_counter); |
12 | _evas_post_event_callback_call(obj->layer->evas); | 12 | _evas_post_event_callback_call(obj->layer->evas); |
13 | } | 13 | } |
14 | 14 | ||
@@ -17,7 +17,7 @@ evas_object_inform_call_hide(Evas_Object *obj) | |||
17 | { | 17 | { |
18 | _evas_object_event_new(); | 18 | _evas_object_event_new(); |
19 | 19 | ||
20 | evas_object_event_callback_call(obj, EVAS_CALLBACK_HIDE, NULL); | 20 | evas_object_event_callback_call(obj, EVAS_CALLBACK_HIDE, NULL, _evas_event_counter); |
21 | _evas_post_event_callback_call(obj->layer->evas); | 21 | _evas_post_event_callback_call(obj->layer->evas); |
22 | } | 22 | } |
23 | 23 | ||
@@ -26,7 +26,7 @@ evas_object_inform_call_move(Evas_Object *obj) | |||
26 | { | 26 | { |
27 | _evas_object_event_new(); | 27 | _evas_object_event_new(); |
28 | 28 | ||
29 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOVE, NULL); | 29 | evas_object_event_callback_call(obj, EVAS_CALLBACK_MOVE, NULL, _evas_event_counter); |
30 | _evas_post_event_callback_call(obj->layer->evas); | 30 | _evas_post_event_callback_call(obj->layer->evas); |
31 | } | 31 | } |
32 | 32 | ||
@@ -35,7 +35,7 @@ evas_object_inform_call_resize(Evas_Object *obj) | |||
35 | { | 35 | { |
36 | _evas_object_event_new(); | 36 | _evas_object_event_new(); |
37 | 37 | ||
38 | evas_object_event_callback_call(obj, EVAS_CALLBACK_RESIZE, NULL); | 38 | evas_object_event_callback_call(obj, EVAS_CALLBACK_RESIZE, NULL, _evas_event_counter); |
39 | _evas_post_event_callback_call(obj->layer->evas); | 39 | _evas_post_event_callback_call(obj->layer->evas); |
40 | } | 40 | } |
41 | 41 | ||
@@ -44,7 +44,7 @@ evas_object_inform_call_restack(Evas_Object *obj) | |||
44 | { | 44 | { |
45 | _evas_object_event_new(); | 45 | _evas_object_event_new(); |
46 | 46 | ||
47 | evas_object_event_callback_call(obj, EVAS_CALLBACK_RESTACK, NULL); | 47 | evas_object_event_callback_call(obj, EVAS_CALLBACK_RESTACK, NULL, _evas_event_counter); |
48 | _evas_post_event_callback_call(obj->layer->evas); | 48 | _evas_post_event_callback_call(obj->layer->evas); |
49 | } | 49 | } |
50 | 50 | ||
@@ -53,7 +53,7 @@ evas_object_inform_call_changed_size_hints(Evas_Object *obj) | |||
53 | { | 53 | { |
54 | _evas_object_event_new(); | 54 | _evas_object_event_new(); |
55 | 55 | ||
56 | evas_object_event_callback_call(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, NULL); | 56 | evas_object_event_callback_call(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, NULL, _evas_event_counter); |
57 | _evas_post_event_callback_call(obj->layer->evas); | 57 | _evas_post_event_callback_call(obj->layer->evas); |
58 | } | 58 | } |
59 | 59 | ||
@@ -65,7 +65,7 @@ evas_object_inform_call_image_preloaded(Evas_Object *obj) | |||
65 | _evas_object_image_preloading_set(obj, 0); | 65 | _evas_object_image_preloading_set(obj, 0); |
66 | _evas_object_event_new(); | 66 | _evas_object_event_new(); |
67 | 67 | ||
68 | evas_object_event_callback_call(obj, EVAS_CALLBACK_IMAGE_PRELOADED, NULL); | 68 | evas_object_event_callback_call(obj, EVAS_CALLBACK_IMAGE_PRELOADED, NULL, _evas_event_counter); |
69 | _evas_post_event_callback_call(obj->layer->evas); | 69 | _evas_post_event_callback_call(obj->layer->evas); |
70 | } | 70 | } |
71 | 71 | ||
@@ -74,6 +74,6 @@ evas_object_inform_call_image_unloaded(Evas_Object *obj) | |||
74 | { | 74 | { |
75 | _evas_object_event_new(); | 75 | _evas_object_event_new(); |
76 | 76 | ||
77 | evas_object_event_callback_call(obj, EVAS_CALLBACK_IMAGE_UNLOADED, NULL); | 77 | evas_object_event_callback_call(obj, EVAS_CALLBACK_IMAGE_UNLOADED, NULL, _evas_event_counter); |
78 | _evas_post_event_callback_call(obj->layer->evas); | 78 | _evas_post_event_callback_call(obj->layer->evas); |
79 | } | 79 | } |
diff --git a/libraries/evas/src/lib/canvas/evas_object_intercept.c b/libraries/evas/src/lib/canvas/evas_object_intercept.c index c3e5e24..54f7265 100644 --- a/libraries/evas/src/lib/canvas/evas_object_intercept.c +++ b/libraries/evas/src/lib/canvas/evas_object_intercept.c | |||
@@ -9,7 +9,6 @@ static void evas_object_intercept_deinit(Evas_Object *obj); | |||
9 | static void | 9 | static void |
10 | evas_object_intercept_init(Evas_Object *obj) | 10 | evas_object_intercept_init(Evas_Object *obj) |
11 | { | 11 | { |
12 | /* MEM OK */ | ||
13 | if (!obj->interceptors) | 12 | if (!obj->interceptors) |
14 | obj->interceptors = evas_mem_calloc(sizeof(Evas_Intercept_Func)); | 13 | obj->interceptors = evas_mem_calloc(sizeof(Evas_Intercept_Func)); |
15 | } | 14 | } |
@@ -17,7 +16,6 @@ evas_object_intercept_init(Evas_Object *obj) | |||
17 | static void | 16 | static void |
18 | evas_object_intercept_deinit(Evas_Object *obj) | 17 | evas_object_intercept_deinit(Evas_Object *obj) |
19 | { | 18 | { |
20 | /* MEM OK */ | ||
21 | if (!obj->interceptors) return; | 19 | if (!obj->interceptors) return; |
22 | if ((obj->interceptors->show.func) || | 20 | if ((obj->interceptors->show.func) || |
23 | (obj->interceptors->hide.func) || | 21 | (obj->interceptors->hide.func) || |
@@ -41,199 +39,186 @@ evas_object_intercept_deinit(Evas_Object *obj) | |||
41 | void | 39 | void |
42 | evas_object_intercept_cleanup(Evas_Object *obj) | 40 | evas_object_intercept_cleanup(Evas_Object *obj) |
43 | { | 41 | { |
44 | /* MEM OK */ | ||
45 | if (obj->interceptors) free(obj->interceptors); | 42 | if (obj->interceptors) free(obj->interceptors); |
46 | } | 43 | } |
47 | 44 | ||
48 | int | 45 | int |
49 | evas_object_intercept_call_show(Evas_Object *obj) | 46 | evas_object_intercept_call_show(Evas_Object *obj) |
50 | { | 47 | { |
51 | /* MEM OK */ | ||
52 | int ret; | 48 | int ret; |
53 | 49 | ||
54 | if (!obj->interceptors) return 0; | 50 | if (!obj->interceptors) return 0; |
55 | if (obj->intercepted) return 0; | 51 | if (obj->intercepted) return 0; |
56 | obj->intercepted = 1; | 52 | obj->intercepted = EINA_TRUE; |
57 | ret = !!(obj->interceptors->show.func); | 53 | ret = !!(obj->interceptors->show.func); |
58 | if (obj->interceptors->show.func) | 54 | if (ret) |
59 | obj->interceptors->show.func(obj->interceptors->show.data, obj); | 55 | obj->interceptors->show.func(obj->interceptors->show.data, obj); |
60 | obj->intercepted = 0; | 56 | obj->intercepted = EINA_FALSE; |
61 | return ret; | 57 | return ret; |
62 | } | 58 | } |
63 | 59 | ||
64 | int | 60 | int |
65 | evas_object_intercept_call_hide(Evas_Object *obj) | 61 | evas_object_intercept_call_hide(Evas_Object *obj) |
66 | { | 62 | { |
67 | /* MEM OK */ | ||
68 | int ret; | 63 | int ret; |
69 | 64 | ||
70 | if (!obj->interceptors) return 0; | 65 | if (!obj->interceptors) return 0; |
71 | if (obj->intercepted) return 0; | 66 | if (obj->intercepted) return 0; |
72 | obj->intercepted = 1; | 67 | obj->intercepted = EINA_TRUE; |
73 | ret = !!(obj->interceptors->hide.func); | 68 | ret = !!(obj->interceptors->hide.func); |
74 | if (obj->interceptors->hide.func) | 69 | if (ret) |
75 | obj->interceptors->hide.func(obj->interceptors->hide.data, obj); | 70 | obj->interceptors->hide.func(obj->interceptors->hide.data, obj); |
76 | obj->intercepted = 0; | 71 | obj->intercepted = EINA_FALSE; |
77 | return ret; | 72 | return ret; |
78 | } | 73 | } |
79 | 74 | ||
80 | int | 75 | int |
81 | evas_object_intercept_call_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) | 76 | evas_object_intercept_call_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) |
82 | { | 77 | { |
83 | /* MEM OK */ | ||
84 | int ret; | 78 | int ret; |
85 | 79 | ||
86 | if (!obj->interceptors) return 0; | 80 | if (!obj->interceptors) return 0; |
87 | if (obj->intercepted) return 0; | 81 | if (obj->intercepted) return 0; |
88 | obj->intercepted = 1; | 82 | obj->intercepted = EINA_TRUE; |
89 | ret = !!(obj->interceptors->move.func); | 83 | ret = !!(obj->interceptors->move.func); |
90 | if (obj->interceptors->move.func) | 84 | if (ret) |
91 | obj->interceptors->move.func(obj->interceptors->move.data, obj, x, y); | 85 | obj->interceptors->move.func(obj->interceptors->move.data, obj, x, y); |
92 | obj->intercepted = 0; | 86 | obj->intercepted = EINA_FALSE; |
93 | return ret; | 87 | return ret; |
94 | } | 88 | } |
95 | 89 | ||
96 | int | 90 | int |
97 | evas_object_intercept_call_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) | 91 | evas_object_intercept_call_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) |
98 | { | 92 | { |
99 | /* MEM OK */ | ||
100 | int ret; | 93 | int ret; |
101 | 94 | ||
102 | if (!obj->interceptors) return 0; | 95 | if (!obj->interceptors) return 0; |
103 | if (obj->intercepted) return 0; | 96 | if (obj->intercepted) return 0; |
104 | obj->intercepted = 1; | 97 | obj->intercepted = EINA_TRUE; |
105 | ret = !!(obj->interceptors->resize.func); | 98 | ret = !!(obj->interceptors->resize.func); |
106 | if (obj->interceptors->resize.func) | 99 | if (ret) |
107 | obj->interceptors->resize.func(obj->interceptors->resize.data, obj, w, h); | 100 | obj->interceptors->resize.func(obj->interceptors->resize.data, obj, w, h); |
108 | obj->intercepted = 0; | 101 | obj->intercepted = EINA_FALSE; |
109 | return ret; | 102 | return ret; |
110 | } | 103 | } |
111 | 104 | ||
112 | int | 105 | int |
113 | evas_object_intercept_call_raise(Evas_Object *obj) | 106 | evas_object_intercept_call_raise(Evas_Object *obj) |
114 | { | 107 | { |
115 | /* MEM OK */ | ||
116 | int ret; | 108 | int ret; |
117 | 109 | ||
118 | if (!obj->interceptors) return 0; | 110 | if (!obj->interceptors) return 0; |
119 | if (obj->intercepted) return 0; | 111 | if (obj->intercepted) return 0; |
120 | obj->intercepted = 1; | 112 | obj->intercepted = EINA_TRUE; |
121 | ret = !!(obj->interceptors->raise.func); | 113 | ret = !!(obj->interceptors->raise.func); |
122 | if (obj->interceptors->raise.func) | 114 | if (ret) |
123 | obj->interceptors->raise.func(obj->interceptors->raise.data, obj); | 115 | obj->interceptors->raise.func(obj->interceptors->raise.data, obj); |
124 | obj->intercepted = 0; | 116 | obj->intercepted = EINA_FALSE; |
125 | return ret; | 117 | return ret; |
126 | } | 118 | } |
127 | 119 | ||
128 | int | 120 | int |
129 | evas_object_intercept_call_lower(Evas_Object *obj) | 121 | evas_object_intercept_call_lower(Evas_Object *obj) |
130 | { | 122 | { |
131 | /* MEM OK */ | ||
132 | int ret; | 123 | int ret; |
133 | 124 | ||
134 | if (!obj->interceptors) return 0; | 125 | if (!obj->interceptors) return 0; |
135 | if (obj->intercepted) return 0; | 126 | if (obj->intercepted) return 0; |
136 | obj->intercepted = 1; | 127 | obj->intercepted = EINA_TRUE; |
137 | ret = !!(obj->interceptors->lower.func); | 128 | ret = !!(obj->interceptors->lower.func); |
138 | if (obj->interceptors->lower.func) | 129 | if (ret) |
139 | obj->interceptors->lower.func(obj->interceptors->lower.data, obj); | 130 | obj->interceptors->lower.func(obj->interceptors->lower.data, obj); |
140 | obj->intercepted = 0; | 131 | obj->intercepted = EINA_FALSE; |
141 | return ret; | 132 | return ret; |
142 | } | 133 | } |
143 | 134 | ||
144 | int | 135 | int |
145 | evas_object_intercept_call_stack_above(Evas_Object *obj, Evas_Object *above) | 136 | evas_object_intercept_call_stack_above(Evas_Object *obj, Evas_Object *above) |
146 | { | 137 | { |
147 | /* MEM OK */ | ||
148 | int ret; | 138 | int ret; |
149 | 139 | ||
150 | if (!obj->interceptors) return 0; | 140 | if (!obj->interceptors) return 0; |
151 | if (obj->intercepted) return 0; | 141 | if (obj->intercepted) return 0; |
152 | obj->intercepted = 1; | 142 | obj->intercepted = EINA_TRUE; |
153 | ret = !!(obj->interceptors->stack_above.func); | 143 | ret = !!(obj->interceptors->stack_above.func); |
154 | if (obj->interceptors->stack_above.func) | 144 | if (ret) |
155 | obj->interceptors->stack_above.func(obj->interceptors->stack_above.data, obj, above); | 145 | obj->interceptors->stack_above.func(obj->interceptors->stack_above.data, obj, above); |
156 | obj->intercepted = 0; | 146 | obj->intercepted = EINA_FALSE; |
157 | return ret; | 147 | return ret; |
158 | } | 148 | } |
159 | 149 | ||
160 | int | 150 | int |
161 | evas_object_intercept_call_stack_below(Evas_Object *obj, Evas_Object *below) | 151 | evas_object_intercept_call_stack_below(Evas_Object *obj, Evas_Object *below) |
162 | { | 152 | { |
163 | /* MEM OK */ | ||
164 | int ret; | 153 | int ret; |
165 | 154 | ||
166 | if (!obj->interceptors) return 0; | 155 | if (!obj->interceptors) return 0; |
167 | if (obj->intercepted) return 0; | 156 | if (obj->intercepted) return 0; |
168 | obj->intercepted = 1; | 157 | obj->intercepted = EINA_TRUE; |
169 | ret = !!(obj->interceptors->stack_below.func); | 158 | ret = !!(obj->interceptors->stack_below.func); |
170 | if (obj->interceptors->stack_below.func) | 159 | if (ret) |
171 | obj->interceptors->stack_below.func(obj->interceptors->stack_below.data, obj, below); | 160 | obj->interceptors->stack_below.func(obj->interceptors->stack_below.data, obj, below); |
172 | obj->intercepted = 0; | 161 | obj->intercepted = EINA_FALSE; |
173 | return ret; | 162 | return ret; |
174 | } | 163 | } |
175 | 164 | ||
176 | int | 165 | int |
177 | evas_object_intercept_call_layer_set(Evas_Object *obj, int l) | 166 | evas_object_intercept_call_layer_set(Evas_Object *obj, int l) |
178 | { | 167 | { |
179 | /* MEM OK */ | ||
180 | int ret; | 168 | int ret; |
181 | 169 | ||
182 | if (!obj->interceptors) return 0; | 170 | if (!obj->interceptors) return 0; |
183 | if (obj->intercepted) return 0; | 171 | if (obj->intercepted) return 0; |
184 | obj->intercepted = 1; | 172 | obj->intercepted = EINA_TRUE; |
185 | ret = !!(obj->interceptors->layer_set.func); | 173 | ret = !!(obj->interceptors->layer_set.func); |
186 | if (obj->interceptors->layer_set.func) | 174 | if (ret) |
187 | obj->interceptors->layer_set.func(obj->interceptors->layer_set.data, obj, l); | 175 | obj->interceptors->layer_set.func(obj->interceptors->layer_set.data, obj, l); |
188 | obj->intercepted = 0; | 176 | obj->intercepted = EINA_FALSE; |
189 | return ret; | 177 | return ret; |
190 | } | 178 | } |
191 | 179 | ||
192 | int | 180 | int |
193 | evas_object_intercept_call_color_set(Evas_Object *obj, int r, int g, int b, int a) | 181 | evas_object_intercept_call_color_set(Evas_Object *obj, int r, int g, int b, int a) |
194 | { | 182 | { |
195 | /* MEM OK */ | ||
196 | int ret; | 183 | int ret; |
197 | 184 | ||
198 | if (!obj->interceptors) return 0; | 185 | if (!obj->interceptors) return 0; |
199 | if (obj->intercepted) return 0; | 186 | if (obj->intercepted) return 0; |
200 | obj->intercepted = 1; | 187 | obj->intercepted = EINA_TRUE; |
201 | ret = !!(obj->interceptors->color_set.func); | 188 | ret = !!(obj->interceptors->color_set.func); |
202 | if (obj->interceptors->color_set.func) | 189 | if (ret) |
203 | obj->interceptors->color_set.func(obj->interceptors->color_set.data, obj, r, g, b, a); | 190 | obj->interceptors->color_set.func(obj->interceptors->color_set.data, obj, r, g, b, a); |
204 | obj->intercepted = 0; | 191 | obj->intercepted = EINA_FALSE; |
205 | return ret; | 192 | return ret; |
206 | } | 193 | } |
207 | 194 | ||
208 | int | 195 | int |
209 | evas_object_intercept_call_clip_set(Evas_Object *obj, Evas_Object *clip) | 196 | evas_object_intercept_call_clip_set(Evas_Object *obj, Evas_Object *clip) |
210 | { | 197 | { |
211 | /* MEM OK */ | ||
212 | int ret; | 198 | int ret; |
213 | 199 | ||
214 | if (!obj->interceptors) return 0; | 200 | if (!obj->interceptors) return 0; |
215 | if (obj->intercepted) return 0; | 201 | if (obj->intercepted) return 0; |
216 | obj->intercepted = 1; | 202 | obj->intercepted = EINA_TRUE; |
217 | ret = !!(obj->interceptors->clip_set.func); | 203 | ret = !!(obj->interceptors->clip_set.func); |
218 | if (obj->interceptors->clip_set.func) | 204 | if (ret) |
219 | obj->interceptors->clip_set.func(obj->interceptors->clip_set.data, obj, clip); | 205 | obj->interceptors->clip_set.func(obj->interceptors->clip_set.data, obj, clip); |
220 | obj->intercepted = 0; | 206 | obj->intercepted = EINA_FALSE; |
221 | return ret; | 207 | return ret; |
222 | } | 208 | } |
223 | 209 | ||
224 | int | 210 | int |
225 | evas_object_intercept_call_clip_unset(Evas_Object *obj) | 211 | evas_object_intercept_call_clip_unset(Evas_Object *obj) |
226 | { | 212 | { |
227 | /* MEM OK */ | ||
228 | int ret; | 213 | int ret; |
229 | 214 | ||
230 | if (!obj->interceptors) return 0; | 215 | if (!obj->interceptors) return 0; |
231 | if (obj->intercepted) return 0; | 216 | if (obj->intercepted) return 0; |
232 | obj->intercepted = 1; | 217 | obj->intercepted = EINA_TRUE; |
233 | ret = !!(obj->interceptors->clip_unset.func); | 218 | ret = !!(obj->interceptors->clip_unset.func); |
234 | if (obj->interceptors->clip_unset.func) | 219 | if (ret) |
235 | obj->interceptors->clip_unset.func(obj->interceptors->clip_unset.data, obj); | 220 | obj->interceptors->clip_unset.func(obj->interceptors->clip_unset.data, obj); |
236 | obj->intercepted = 0; | 221 | obj->intercepted = EINA_FALSE; |
237 | return ret; | 222 | return ret; |
238 | } | 223 | } |
239 | 224 | ||
@@ -242,8 +227,6 @@ evas_object_intercept_call_clip_unset(Evas_Object *obj) | |||
242 | EAPI void | 227 | EAPI void |
243 | evas_object_intercept_show_callback_add(Evas_Object *obj, Evas_Object_Intercept_Show_Cb func, const void *data) | 228 | evas_object_intercept_show_callback_add(Evas_Object *obj, Evas_Object_Intercept_Show_Cb func, const void *data) |
244 | { | 229 | { |
245 | /* MEM OK */ | ||
246 | |||
247 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 230 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
248 | return; | 231 | return; |
249 | MAGIC_CHECK_END(); | 232 | MAGIC_CHECK_END(); |
@@ -257,7 +240,6 @@ evas_object_intercept_show_callback_add(Evas_Object *obj, Evas_Object_Intercept_ | |||
257 | EAPI void * | 240 | EAPI void * |
258 | evas_object_intercept_show_callback_del(Evas_Object *obj, Evas_Object_Intercept_Show_Cb func) | 241 | evas_object_intercept_show_callback_del(Evas_Object *obj, Evas_Object_Intercept_Show_Cb func) |
259 | { | 242 | { |
260 | /* MEM OK */ | ||
261 | void *data; | 243 | void *data; |
262 | 244 | ||
263 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 245 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
@@ -275,7 +257,6 @@ evas_object_intercept_show_callback_del(Evas_Object *obj, Evas_Object_Intercept_ | |||
275 | EAPI void | 257 | EAPI void |
276 | evas_object_intercept_hide_callback_add(Evas_Object *obj, Evas_Object_Intercept_Hide_Cb func, const void *data) | 258 | evas_object_intercept_hide_callback_add(Evas_Object *obj, Evas_Object_Intercept_Hide_Cb func, const void *data) |
277 | { | 259 | { |
278 | /* MEM OK */ | ||
279 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 260 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
280 | return; | 261 | return; |
281 | MAGIC_CHECK_END(); | 262 | MAGIC_CHECK_END(); |
@@ -289,7 +270,6 @@ evas_object_intercept_hide_callback_add(Evas_Object *obj, Evas_Object_Intercept_ | |||
289 | EAPI void * | 270 | EAPI void * |
290 | evas_object_intercept_hide_callback_del(Evas_Object *obj, Evas_Object_Intercept_Hide_Cb func) | 271 | evas_object_intercept_hide_callback_del(Evas_Object *obj, Evas_Object_Intercept_Hide_Cb func) |
291 | { | 272 | { |
292 | /* MEM OK */ | ||
293 | void *data; | 273 | void *data; |
294 | 274 | ||
295 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 275 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
@@ -307,7 +287,6 @@ evas_object_intercept_hide_callback_del(Evas_Object *obj, Evas_Object_Intercept_ | |||
307 | EAPI void | 287 | EAPI void |
308 | evas_object_intercept_move_callback_add(Evas_Object *obj, Evas_Object_Intercept_Move_Cb func, const void *data) | 288 | evas_object_intercept_move_callback_add(Evas_Object *obj, Evas_Object_Intercept_Move_Cb func, const void *data) |
309 | { | 289 | { |
310 | /* MEM OK */ | ||
311 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 290 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
312 | return; | 291 | return; |
313 | MAGIC_CHECK_END(); | 292 | MAGIC_CHECK_END(); |
@@ -321,7 +300,6 @@ evas_object_intercept_move_callback_add(Evas_Object *obj, Evas_Object_Intercept_ | |||
321 | EAPI void * | 300 | EAPI void * |
322 | evas_object_intercept_move_callback_del(Evas_Object *obj, Evas_Object_Intercept_Move_Cb func) | 301 | evas_object_intercept_move_callback_del(Evas_Object *obj, Evas_Object_Intercept_Move_Cb func) |
323 | { | 302 | { |
324 | /* MEM OK */ | ||
325 | void *data; | 303 | void *data; |
326 | 304 | ||
327 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 305 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
@@ -339,7 +317,6 @@ evas_object_intercept_move_callback_del(Evas_Object *obj, Evas_Object_Intercept_ | |||
339 | EAPI void | 317 | EAPI void |
340 | evas_object_intercept_resize_callback_add(Evas_Object *obj, Evas_Object_Intercept_Resize_Cb func, const void *data) | 318 | evas_object_intercept_resize_callback_add(Evas_Object *obj, Evas_Object_Intercept_Resize_Cb func, const void *data) |
341 | { | 319 | { |
342 | /* MEM OK */ | ||
343 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 320 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
344 | return; | 321 | return; |
345 | MAGIC_CHECK_END(); | 322 | MAGIC_CHECK_END(); |
@@ -353,7 +330,6 @@ evas_object_intercept_resize_callback_add(Evas_Object *obj, Evas_Object_Intercep | |||
353 | EAPI void * | 330 | EAPI void * |
354 | evas_object_intercept_resize_callback_del(Evas_Object *obj, Evas_Object_Intercept_Resize_Cb func) | 331 | evas_object_intercept_resize_callback_del(Evas_Object *obj, Evas_Object_Intercept_Resize_Cb func) |
355 | { | 332 | { |
356 | /* MEM OK */ | ||
357 | void *data; | 333 | void *data; |
358 | 334 | ||
359 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 335 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
@@ -371,7 +347,6 @@ evas_object_intercept_resize_callback_del(Evas_Object *obj, Evas_Object_Intercep | |||
371 | EAPI void | 347 | EAPI void |
372 | evas_object_intercept_raise_callback_add(Evas_Object *obj, Evas_Object_Intercept_Raise_Cb func, const void *data) | 348 | evas_object_intercept_raise_callback_add(Evas_Object *obj, Evas_Object_Intercept_Raise_Cb func, const void *data) |
373 | { | 349 | { |
374 | /* MEM OK */ | ||
375 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 350 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
376 | return; | 351 | return; |
377 | MAGIC_CHECK_END(); | 352 | MAGIC_CHECK_END(); |
@@ -385,7 +360,6 @@ evas_object_intercept_raise_callback_add(Evas_Object *obj, Evas_Object_Intercept | |||
385 | EAPI void * | 360 | EAPI void * |
386 | evas_object_intercept_raise_callback_del(Evas_Object *obj, Evas_Object_Intercept_Raise_Cb func) | 361 | evas_object_intercept_raise_callback_del(Evas_Object *obj, Evas_Object_Intercept_Raise_Cb func) |
387 | { | 362 | { |
388 | /* MEM OK */ | ||
389 | void *data; | 363 | void *data; |
390 | 364 | ||
391 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 365 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
@@ -403,7 +377,6 @@ evas_object_intercept_raise_callback_del(Evas_Object *obj, Evas_Object_Intercept | |||
403 | EAPI void | 377 | EAPI void |
404 | evas_object_intercept_lower_callback_add(Evas_Object *obj, Evas_Object_Intercept_Lower_Cb func, const void *data) | 378 | evas_object_intercept_lower_callback_add(Evas_Object *obj, Evas_Object_Intercept_Lower_Cb func, const void *data) |
405 | { | 379 | { |
406 | /* MEM OK */ | ||
407 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 380 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
408 | return; | 381 | return; |
409 | MAGIC_CHECK_END(); | 382 | MAGIC_CHECK_END(); |
@@ -417,7 +390,6 @@ evas_object_intercept_lower_callback_add(Evas_Object *obj, Evas_Object_Intercept | |||
417 | EAPI void * | 390 | EAPI void * |
418 | evas_object_intercept_lower_callback_del(Evas_Object *obj, Evas_Object_Intercept_Lower_Cb func) | 391 | evas_object_intercept_lower_callback_del(Evas_Object *obj, Evas_Object_Intercept_Lower_Cb func) |
419 | { | 392 | { |
420 | /* MEM OK */ | ||
421 | void *data; | 393 | void *data; |
422 | 394 | ||
423 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 395 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
@@ -435,7 +407,6 @@ evas_object_intercept_lower_callback_del(Evas_Object *obj, Evas_Object_Intercept | |||
435 | EAPI void | 407 | EAPI void |
436 | evas_object_intercept_stack_above_callback_add(Evas_Object *obj, Evas_Object_Intercept_Stack_Above_Cb func, const void *data) | 408 | evas_object_intercept_stack_above_callback_add(Evas_Object *obj, Evas_Object_Intercept_Stack_Above_Cb func, const void *data) |
437 | { | 409 | { |
438 | /* MEM OK */ | ||
439 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 410 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
440 | return; | 411 | return; |
441 | MAGIC_CHECK_END(); | 412 | MAGIC_CHECK_END(); |
@@ -449,7 +420,6 @@ evas_object_intercept_stack_above_callback_add(Evas_Object *obj, Evas_Object_Int | |||
449 | EAPI void * | 420 | EAPI void * |
450 | evas_object_intercept_stack_above_callback_del(Evas_Object *obj, Evas_Object_Intercept_Stack_Above_Cb func) | 421 | evas_object_intercept_stack_above_callback_del(Evas_Object *obj, Evas_Object_Intercept_Stack_Above_Cb func) |
451 | { | 422 | { |
452 | /* MEM OK */ | ||
453 | void *data; | 423 | void *data; |
454 | 424 | ||
455 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 425 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
@@ -467,7 +437,6 @@ evas_object_intercept_stack_above_callback_del(Evas_Object *obj, Evas_Object_Int | |||
467 | EAPI void | 437 | EAPI void |
468 | evas_object_intercept_stack_below_callback_add(Evas_Object *obj, Evas_Object_Intercept_Stack_Below_Cb func, const void *data) | 438 | evas_object_intercept_stack_below_callback_add(Evas_Object *obj, Evas_Object_Intercept_Stack_Below_Cb func, const void *data) |
469 | { | 439 | { |
470 | /* MEM OK */ | ||
471 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 440 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
472 | return; | 441 | return; |
473 | MAGIC_CHECK_END(); | 442 | MAGIC_CHECK_END(); |
@@ -481,7 +450,6 @@ evas_object_intercept_stack_below_callback_add(Evas_Object *obj, Evas_Object_Int | |||
481 | EAPI void * | 450 | EAPI void * |
482 | evas_object_intercept_stack_below_callback_del(Evas_Object *obj, Evas_Object_Intercept_Stack_Below_Cb func) | 451 | evas_object_intercept_stack_below_callback_del(Evas_Object *obj, Evas_Object_Intercept_Stack_Below_Cb func) |
483 | { | 452 | { |
484 | /* MEM OK */ | ||
485 | void *data; | 453 | void *data; |
486 | 454 | ||
487 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 455 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
@@ -499,7 +467,6 @@ evas_object_intercept_stack_below_callback_del(Evas_Object *obj, Evas_Object_Int | |||
499 | EAPI void | 467 | EAPI void |
500 | evas_object_intercept_layer_set_callback_add(Evas_Object *obj, Evas_Object_Intercept_Layer_Set_Cb func, const void *data) | 468 | evas_object_intercept_layer_set_callback_add(Evas_Object *obj, Evas_Object_Intercept_Layer_Set_Cb func, const void *data) |
501 | { | 469 | { |
502 | /* MEM OK */ | ||
503 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 470 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
504 | return; | 471 | return; |
505 | MAGIC_CHECK_END(); | 472 | MAGIC_CHECK_END(); |
@@ -513,7 +480,6 @@ evas_object_intercept_layer_set_callback_add(Evas_Object *obj, Evas_Object_Inter | |||
513 | EAPI void * | 480 | EAPI void * |
514 | evas_object_intercept_layer_set_callback_del(Evas_Object *obj, Evas_Object_Intercept_Layer_Set_Cb func) | 481 | evas_object_intercept_layer_set_callback_del(Evas_Object *obj, Evas_Object_Intercept_Layer_Set_Cb func) |
515 | { | 482 | { |
516 | /* MEM OK */ | ||
517 | void *data; | 483 | void *data; |
518 | 484 | ||
519 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 485 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
@@ -531,7 +497,6 @@ evas_object_intercept_layer_set_callback_del(Evas_Object *obj, Evas_Object_Inter | |||
531 | EAPI void | 497 | EAPI void |
532 | evas_object_intercept_color_set_callback_add(Evas_Object *obj, Evas_Object_Intercept_Color_Set_Cb func, const void *data) | 498 | evas_object_intercept_color_set_callback_add(Evas_Object *obj, Evas_Object_Intercept_Color_Set_Cb func, const void *data) |
533 | { | 499 | { |
534 | /* MEM OK */ | ||
535 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 500 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
536 | return; | 501 | return; |
537 | MAGIC_CHECK_END(); | 502 | MAGIC_CHECK_END(); |
@@ -545,7 +510,6 @@ evas_object_intercept_color_set_callback_add(Evas_Object *obj, Evas_Object_Inter | |||
545 | EAPI void * | 510 | EAPI void * |
546 | evas_object_intercept_color_set_callback_del(Evas_Object *obj, Evas_Object_Intercept_Color_Set_Cb func) | 511 | evas_object_intercept_color_set_callback_del(Evas_Object *obj, Evas_Object_Intercept_Color_Set_Cb func) |
547 | { | 512 | { |
548 | /* MEM OK */ | ||
549 | void *data; | 513 | void *data; |
550 | 514 | ||
551 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 515 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
@@ -563,7 +527,6 @@ evas_object_intercept_color_set_callback_del(Evas_Object *obj, Evas_Object_Inter | |||
563 | EAPI void | 527 | EAPI void |
564 | evas_object_intercept_clip_set_callback_add(Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func, const void *data) | 528 | evas_object_intercept_clip_set_callback_add(Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func, const void *data) |
565 | { | 529 | { |
566 | /* MEM OK */ | ||
567 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 530 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
568 | return; | 531 | return; |
569 | MAGIC_CHECK_END(); | 532 | MAGIC_CHECK_END(); |
@@ -577,7 +540,6 @@ evas_object_intercept_clip_set_callback_add(Evas_Object *obj, Evas_Object_Interc | |||
577 | EAPI void * | 540 | EAPI void * |
578 | evas_object_intercept_clip_set_callback_del(Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func) | 541 | evas_object_intercept_clip_set_callback_del(Evas_Object *obj, Evas_Object_Intercept_Clip_Set_Cb func) |
579 | { | 542 | { |
580 | /* MEM OK */ | ||
581 | void *data; | 543 | void *data; |
582 | 544 | ||
583 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 545 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
@@ -595,7 +557,6 @@ evas_object_intercept_clip_set_callback_del(Evas_Object *obj, Evas_Object_Interc | |||
595 | EAPI void | 557 | EAPI void |
596 | evas_object_intercept_clip_unset_callback_add(Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func, const void *data) | 558 | evas_object_intercept_clip_unset_callback_add(Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func, const void *data) |
597 | { | 559 | { |
598 | /* MEM OK */ | ||
599 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 560 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
600 | return; | 561 | return; |
601 | MAGIC_CHECK_END(); | 562 | MAGIC_CHECK_END(); |
@@ -609,7 +570,6 @@ evas_object_intercept_clip_unset_callback_add(Evas_Object *obj, Evas_Object_Inte | |||
609 | EAPI void * | 570 | EAPI void * |
610 | evas_object_intercept_clip_unset_callback_del(Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func) | 571 | evas_object_intercept_clip_unset_callback_del(Evas_Object *obj, Evas_Object_Intercept_Clip_Unset_Cb func) |
611 | { | 572 | { |
612 | /* MEM OK */ | ||
613 | void *data; | 573 | void *data; |
614 | 574 | ||
615 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 575 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
diff --git a/libraries/evas/src/lib/canvas/evas_object_main.c b/libraries/evas/src/lib/canvas/evas_object_main.c index 3eaded9..86ab498 100644 --- a/libraries/evas/src/lib/canvas/evas_object_main.c +++ b/libraries/evas/src/lib/canvas/evas_object_main.c | |||
@@ -25,6 +25,7 @@ evas_object_new(Evas *e __UNUSED__) | |||
25 | obj->magic = MAGIC_OBJ; | 25 | obj->magic = MAGIC_OBJ; |
26 | obj->cur.scale = 1.0; | 26 | obj->cur.scale = 1.0; |
27 | obj->prev.scale = 1.0; | 27 | obj->prev.scale = 1.0; |
28 | obj->is_frame = EINA_FALSE; | ||
28 | 29 | ||
29 | return obj; | 30 | return obj; |
30 | } | 31 | } |
@@ -99,7 +100,8 @@ evas_object_change(Evas_Object *obj) | |||
99 | /* set changed flag on all objects this one clips too */ | 100 | /* set changed flag on all objects this one clips too */ |
100 | if (!((movch) && (obj->is_static_clip))) | 101 | if (!((movch) && (obj->is_static_clip))) |
101 | { | 102 | { |
102 | EINA_LIST_FOREACH(obj->clip.clipees, l, obj2) evas_object_change(obj2); | 103 | EINA_LIST_FOREACH(obj->clip.clipees, l, obj2) |
104 | evas_object_change(obj2); | ||
103 | } | 105 | } |
104 | EINA_LIST_FOREACH(obj->proxy.proxies, l, obj2) | 106 | EINA_LIST_FOREACH(obj->proxy.proxies, l, obj2) |
105 | { | 107 | { |
@@ -111,8 +113,8 @@ evas_object_change(Evas_Object *obj) | |||
111 | void | 113 | void |
112 | evas_object_render_pre_visible_change(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v) | 114 | evas_object_render_pre_visible_change(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v) |
113 | { | 115 | { |
114 | if (obj->smart.smart) return ; | 116 | if (obj->smart.smart) return; |
115 | if (is_v == was_v) return ; | 117 | if (is_v == was_v) return; |
116 | if (is_v) | 118 | if (is_v) |
117 | { | 119 | { |
118 | evas_add_rect(rects, | 120 | evas_add_rect(rects, |
@@ -134,8 +136,8 @@ evas_object_render_pre_visible_change(Eina_Array *rects, Evas_Object *obj, int i | |||
134 | void | 136 | void |
135 | evas_object_render_pre_clipper_change(Eina_Array *rects, Evas_Object *obj) | 137 | evas_object_render_pre_clipper_change(Eina_Array *rects, Evas_Object *obj) |
136 | { | 138 | { |
137 | if (obj->smart.smart) return ; | 139 | if (obj->smart.smart) return; |
138 | if (obj->cur.clipper == obj->prev.clipper) return ; | 140 | if (obj->cur.clipper == obj->prev.clipper) return; |
139 | if ((obj->cur.clipper) && (obj->prev.clipper)) | 141 | if ((obj->cur.clipper) && (obj->prev.clipper)) |
140 | { | 142 | { |
141 | /* get difference rects between clippers */ | 143 | /* get difference rects between clippers */ |
@@ -223,7 +225,8 @@ evas_object_clip_changes_clean(Evas_Object *obj) | |||
223 | { | 225 | { |
224 | Eina_Rectangle *r; | 226 | Eina_Rectangle *r; |
225 | 227 | ||
226 | EINA_LIST_FREE(obj->clip.changes, r) eina_rectangle_free(r); | 228 | EINA_LIST_FREE(obj->clip.changes, r) |
229 | eina_rectangle_free(r); | ||
227 | } | 230 | } |
228 | 231 | ||
229 | void | 232 | void |
@@ -408,11 +411,11 @@ evas_object_del(Evas_Object *obj) | |||
408 | obj->focused = 0; | 411 | obj->focused = 0; |
409 | obj->layer->evas->focused = NULL; | 412 | obj->layer->evas->focused = NULL; |
410 | _evas_object_event_new(); | 413 | _evas_object_event_new(); |
411 | evas_object_event_callback_call(obj, EVAS_CALLBACK_FOCUS_OUT, NULL); | 414 | evas_object_event_callback_call(obj, EVAS_CALLBACK_FOCUS_OUT, NULL, _evas_event_counter); |
412 | _evas_post_event_callback_call(obj->layer->evas); | 415 | _evas_post_event_callback_call(obj->layer->evas); |
413 | } | 416 | } |
414 | _evas_object_event_new(); | 417 | _evas_object_event_new(); |
415 | evas_object_event_callback_call(obj, EVAS_CALLBACK_DEL, NULL); | 418 | evas_object_event_callback_call(obj, EVAS_CALLBACK_DEL, NULL, _evas_event_counter); |
416 | _evas_post_event_callback_call(obj->layer->evas); | 419 | _evas_post_event_callback_call(obj->layer->evas); |
417 | if (obj->mouse_grabbed > 0) | 420 | if (obj->mouse_grabbed > 0) |
418 | obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed; | 421 | obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed; |
@@ -426,9 +429,6 @@ evas_object_del(Evas_Object *obj) | |||
426 | evas_object_free(obj, 1); | 429 | evas_object_free(obj, 1); |
427 | return; | 430 | return; |
428 | } | 431 | } |
429 | obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed; | ||
430 | obj->mouse_grabbed = 0; | ||
431 | obj->mouse_in = 0; | ||
432 | evas_object_grabs_cleanup(obj); | 432 | evas_object_grabs_cleanup(obj); |
433 | while (obj->clip.clipees) | 433 | while (obj->clip.clipees) |
434 | evas_object_clip_unset(obj->clip.clipees->data); | 434 | evas_object_clip_unset(obj->clip.clipees->data); |
@@ -438,7 +438,7 @@ evas_object_del(Evas_Object *obj) | |||
438 | if (obj->smart.smart) evas_object_smart_del(obj); | 438 | if (obj->smart.smart) evas_object_smart_del(obj); |
439 | evas_object_map_set(obj, NULL); | 439 | evas_object_map_set(obj, NULL); |
440 | _evas_object_event_new(); | 440 | _evas_object_event_new(); |
441 | evas_object_event_callback_call(obj, EVAS_CALLBACK_FREE, NULL); | 441 | evas_object_event_callback_call(obj, EVAS_CALLBACK_FREE, NULL, _evas_event_counter); |
442 | _evas_post_event_callback_call(obj->layer->evas); | 442 | _evas_post_event_callback_call(obj->layer->evas); |
443 | evas_object_smart_cleanup(obj); | 443 | evas_object_smart_cleanup(obj); |
444 | obj->delete_me = 1; | 444 | obj->delete_me = 1; |
@@ -449,18 +449,38 @@ EAPI void | |||
449 | evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) | 449 | evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) |
450 | { | 450 | { |
451 | int is, was = 0, pass = 0, freeze = 0; | 451 | int is, was = 0, pass = 0, freeze = 0; |
452 | int nx = 0, ny = 0; | ||
452 | 453 | ||
453 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 454 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
454 | return; | 455 | return; |
455 | MAGIC_CHECK_END(); | 456 | MAGIC_CHECK_END(); |
456 | if (obj->delete_me) return; | 457 | if (obj->delete_me) return; |
457 | if (evas_object_intercept_call_move(obj, x, y)) return; | 458 | |
459 | nx = x; | ||
460 | ny = y; | ||
461 | |||
462 | if (!obj->is_frame) | ||
463 | { | ||
464 | int fx, fy; | ||
465 | |||
466 | evas_output_framespace_get(obj->layer->evas, &fx, &fy, NULL, NULL); | ||
467 | if (!obj->smart.parent) | ||
468 | { | ||
469 | nx += fx; | ||
470 | ny += fy; | ||
471 | } | ||
472 | } | ||
473 | |||
474 | if (evas_object_intercept_call_move(obj, nx, ny)) return; | ||
475 | |||
458 | if (obj->doing.in_move > 0) | 476 | if (obj->doing.in_move > 0) |
459 | { | 477 | { |
460 | WRN("evas_object_move() called on object %p when in the middle of moving the same object", obj); | 478 | WRN("evas_object_move() called on object %p when in the middle of moving the same object", obj); |
461 | return; | 479 | return; |
462 | } | 480 | } |
463 | if ((obj->cur.geometry.x == x) && (obj->cur.geometry.y == y)) return; | 481 | |
482 | if ((obj->cur.geometry.x == nx) && (obj->cur.geometry.y == ny)) return; | ||
483 | |||
464 | if (obj->layer->evas->events_frozen <= 0) | 484 | if (obj->layer->evas->events_frozen <= 0) |
465 | { | 485 | { |
466 | pass = evas_event_passes_through(obj); | 486 | pass = evas_event_passes_through(obj); |
@@ -471,13 +491,16 @@ evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) | |||
471 | obj->layer->evas->pointer.y, 1, 1); | 491 | obj->layer->evas->pointer.y, 1, 1); |
472 | } | 492 | } |
473 | obj->doing.in_move++; | 493 | obj->doing.in_move++; |
494 | |||
474 | if (obj->smart.smart) | 495 | if (obj->smart.smart) |
475 | { | 496 | { |
476 | if (obj->smart.smart->smart_class->move) | 497 | if (obj->smart.smart->smart_class->move) |
477 | obj->smart.smart->smart_class->move(obj, x, y); | 498 | obj->smart.smart->smart_class->move(obj, nx, ny); |
478 | } | 499 | } |
479 | obj->cur.geometry.x = x; | 500 | |
480 | obj->cur.geometry.y = y; | 501 | obj->cur.geometry.x = nx; |
502 | obj->cur.geometry.y = ny; | ||
503 | |||
481 | //// obj->cur.cache.geometry.validity = 0; | 504 | //// obj->cur.cache.geometry.validity = 0; |
482 | obj->changed_move = 1; | 505 | obj->changed_move = 1; |
483 | evas_object_change(obj); | 506 | evas_object_change(obj); |
@@ -509,19 +532,40 @@ EAPI void | |||
509 | evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) | 532 | evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) |
510 | { | 533 | { |
511 | int is, was = 0, pass = 0, freeze =0; | 534 | int is, was = 0, pass = 0, freeze =0; |
535 | int nw = 0, nh = 0; | ||
512 | 536 | ||
513 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | 537 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); |
514 | return; | 538 | return; |
515 | MAGIC_CHECK_END(); | 539 | MAGIC_CHECK_END(); |
516 | if (obj->delete_me) return; | 540 | if (obj->delete_me) return; |
517 | if (w < 0) w = 0; if (h < 0) h = 0; | 541 | if (w < 0) w = 0; if (h < 0) h = 0; |
518 | if (evas_object_intercept_call_resize(obj, w, h)) return; | 542 | |
543 | nw = w; | ||
544 | nh = h; | ||
545 | if (!obj->is_frame) | ||
546 | { | ||
547 | int fw, fh; | ||
548 | |||
549 | evas_output_framespace_get(obj->layer->evas, NULL, NULL, &fw, &fh); | ||
550 | if (!obj->smart.parent) | ||
551 | { | ||
552 | nw = w - fw; | ||
553 | nh = h - fh; | ||
554 | if (nw < 0) nw = 0; | ||
555 | if (nh < 0) nh = 0; | ||
556 | } | ||
557 | } | ||
558 | |||
559 | if (evas_object_intercept_call_resize(obj, nw, nh)) return; | ||
560 | |||
519 | if (obj->doing.in_resize > 0) | 561 | if (obj->doing.in_resize > 0) |
520 | { | 562 | { |
521 | WRN("evas_object_resize() called on object %p when in the middle of resizing the same object", obj); | 563 | WRN("evas_object_resize() called on object %p when in the middle of resizing the same object", obj); |
522 | return; | 564 | return; |
523 | } | 565 | } |
524 | if ((obj->cur.geometry.w == w) && (obj->cur.geometry.h == h)) return; | 566 | |
567 | if ((obj->cur.geometry.w == nw) && (obj->cur.geometry.h == nh)) return; | ||
568 | |||
525 | if (obj->layer->evas->events_frozen <= 0) | 569 | if (obj->layer->evas->events_frozen <= 0) |
526 | { | 570 | { |
527 | pass = evas_event_passes_through(obj); | 571 | pass = evas_event_passes_through(obj); |
@@ -532,13 +576,16 @@ evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) | |||
532 | obj->layer->evas->pointer.y, 1, 1); | 576 | obj->layer->evas->pointer.y, 1, 1); |
533 | } | 577 | } |
534 | obj->doing.in_resize++; | 578 | obj->doing.in_resize++; |
579 | |||
535 | if (obj->smart.smart) | 580 | if (obj->smart.smart) |
536 | { | 581 | { |
537 | if (obj->smart.smart->smart_class->resize) | 582 | if (obj->smart.smart->smart_class->resize) |
538 | obj->smart.smart->smart_class->resize(obj, w, h); | 583 | obj->smart.smart->smart_class->resize(obj, nw, nh); |
539 | } | 584 | } |
540 | obj->cur.geometry.w = w; | 585 | |
541 | obj->cur.geometry.h = h; | 586 | obj->cur.geometry.w = nw; |
587 | obj->cur.geometry.h = nh; | ||
588 | |||
542 | //// obj->cur.cache.geometry.validity = 0; | 589 | //// obj->cur.cache.geometry.validity = 0; |
543 | evas_object_change(obj); | 590 | evas_object_change(obj); |
544 | evas_object_clip_dirty(obj); | 591 | evas_object_clip_dirty(obj); |
@@ -581,6 +628,7 @@ evas_object_geometry_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, E | |||
581 | if (x) *x = 0; if (y) *y = 0; if (w) *w = 0; if (h) *h = 0; | 628 | if (x) *x = 0; if (y) *y = 0; if (w) *w = 0; if (h) *h = 0; |
582 | return; | 629 | return; |
583 | } | 630 | } |
631 | |||
584 | if (x) *x = obj->cur.geometry.x; | 632 | if (x) *x = obj->cur.geometry.x; |
585 | if (y) *y = obj->cur.geometry.y; | 633 | if (y) *y = obj->cur.geometry.y; |
586 | if (w) *w = obj->cur.geometry.w; | 634 | if (w) *w = obj->cur.geometry.w; |
@@ -1084,8 +1132,7 @@ evas_object_render_op_set(Evas_Object *obj, Evas_Render_Op render_op) | |||
1084 | return; | 1132 | return; |
1085 | MAGIC_CHECK_END(); | 1133 | MAGIC_CHECK_END(); |
1086 | if (obj->delete_me) return; | 1134 | if (obj->delete_me) return; |
1087 | if ((Evas_Render_Op)obj->cur.render_op == render_op) | 1135 | if (obj->cur.render_op == render_op) return; |
1088 | return; | ||
1089 | obj->cur.render_op = render_op; | 1136 | obj->cur.render_op = render_op; |
1090 | evas_object_change(obj); | 1137 | evas_object_change(obj); |
1091 | } | 1138 | } |
@@ -1317,3 +1364,20 @@ evas_object_static_clip_get(const Evas_Object *obj) | |||
1317 | return obj->is_static_clip; | 1364 | return obj->is_static_clip; |
1318 | } | 1365 | } |
1319 | 1366 | ||
1367 | EAPI void | ||
1368 | evas_object_is_frame_object_set(Evas_Object *obj, Eina_Bool is_frame) | ||
1369 | { | ||
1370 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | ||
1371 | return; | ||
1372 | MAGIC_CHECK_END(); | ||
1373 | obj->is_frame = is_frame; | ||
1374 | } | ||
1375 | |||
1376 | EAPI Eina_Bool | ||
1377 | evas_object_is_frame_object_get(Evas_Object *obj) | ||
1378 | { | ||
1379 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | ||
1380 | return EINA_FALSE; | ||
1381 | MAGIC_CHECK_END(); | ||
1382 | return obj->is_frame; | ||
1383 | } | ||
diff --git a/libraries/evas/src/lib/canvas/evas_object_smart.c b/libraries/evas/src/lib/canvas/evas_object_smart.c index a7dfcdf..69d7f3b 100644 --- a/libraries/evas/src/lib/canvas/evas_object_smart.c +++ b/libraries/evas/src/lib/canvas/evas_object_smart.c | |||
@@ -402,6 +402,37 @@ evas_object_smart_callback_del(Evas_Object *obj, const char *event, Evas_Smart_C | |||
402 | return NULL; | 402 | return NULL; |
403 | } | 403 | } |
404 | 404 | ||
405 | EAPI void * | ||
406 | evas_object_smart_callback_del_full(Evas_Object *obj, const char *event, Evas_Smart_Cb func, const void *data) | ||
407 | { | ||
408 | Evas_Object_Smart *o; | ||
409 | Eina_List *l; | ||
410 | Evas_Smart_Callback *cb; | ||
411 | |||
412 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | ||
413 | return NULL; | ||
414 | MAGIC_CHECK_END(); | ||
415 | o = (Evas_Object_Smart *)(obj->object_data); | ||
416 | MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART); | ||
417 | return NULL; | ||
418 | MAGIC_CHECK_END(); | ||
419 | if (!event) return NULL; | ||
420 | EINA_LIST_FOREACH(o->callbacks, l, cb) | ||
421 | { | ||
422 | if ((!strcmp(cb->event, event)) && (cb->func == func) && (cb->func_data == data)) | ||
423 | { | ||
424 | void *ret; | ||
425 | |||
426 | ret = cb->func_data; | ||
427 | cb->delete_me = 1; | ||
428 | o->deletions_waiting = 1; | ||
429 | evas_object_smart_callbacks_clear(obj); | ||
430 | return ret; | ||
431 | } | ||
432 | } | ||
433 | return NULL; | ||
434 | } | ||
435 | |||
405 | EAPI void | 436 | EAPI void |
406 | evas_object_smart_callback_call(Evas_Object *obj, const char *event, void *event_info) | 437 | evas_object_smart_callback_call(Evas_Object *obj, const char *event, void *event_info) |
407 | { | 438 | { |
diff --git a/libraries/evas/src/lib/canvas/evas_object_table.c b/libraries/evas/src/lib/canvas/evas_object_table.c index 6e28fce..cdfa07f 100644 --- a/libraries/evas/src/lib/canvas/evas_object_table.c +++ b/libraries/evas/src/lib/canvas/evas_object_table.c | |||
@@ -1,5 +1,5 @@ | |||
1 | #include <errno.h> | ||
2 | #include "evas_common.h" | 1 | #include "evas_common.h" |
2 | #include <errno.h> | ||
3 | 3 | ||
4 | typedef struct _Evas_Object_Table_Data Evas_Object_Table_Data; | 4 | typedef struct _Evas_Object_Table_Data Evas_Object_Table_Data; |
5 | typedef struct _Evas_Object_Table_Option Evas_Object_Table_Option; | 5 | typedef struct _Evas_Object_Table_Option Evas_Object_Table_Option; |
diff --git a/libraries/evas/src/lib/canvas/evas_object_text.c b/libraries/evas/src/lib/canvas/evas_object_text.c index 6c30fcc..dbe5e08 100644 --- a/libraries/evas/src/lib/canvas/evas_object_text.c +++ b/libraries/evas/src/lib/canvas/evas_object_text.c | |||
@@ -531,8 +531,9 @@ _evas_object_text_layout(Evas_Object *obj, Evas_Object_Text *o, const Eina_Unico | |||
531 | { | 531 | { |
532 | EvasBiDiStrIndex *v_to_l = NULL; | 532 | EvasBiDiStrIndex *v_to_l = NULL; |
533 | size_t pos, visual_pos; | 533 | size_t pos, visual_pos; |
534 | int len = eina_unicode_strlen(text), par_len; | 534 | int len = eina_unicode_strlen(text); |
535 | #ifdef BIDI_SUPPORT | 535 | #ifdef BIDI_SUPPORT |
536 | int par_len = len; | ||
536 | int *segment_idxs = NULL; | 537 | int *segment_idxs = NULL; |
537 | if (o->bidi_delimiters) | 538 | if (o->bidi_delimiters) |
538 | segment_idxs = evas_bidi_segment_idxs_get(text, o->bidi_delimiters); | 539 | segment_idxs = evas_bidi_segment_idxs_get(text, o->bidi_delimiters); |
@@ -543,7 +544,6 @@ _evas_object_text_layout(Evas_Object *obj, Evas_Object_Text *o, const Eina_Unico | |||
543 | #endif | 544 | #endif |
544 | visual_pos = pos = 0; | 545 | visual_pos = pos = 0; |
545 | 546 | ||
546 | par_len = len; | ||
547 | while (len > 0) | 547 | while (len > 0) |
548 | { | 548 | { |
549 | Evas_Font_Instance *script_fi = NULL; | 549 | Evas_Font_Instance *script_fi = NULL; |
diff --git a/libraries/evas/src/lib/canvas/evas_object_textblock.c b/libraries/evas/src/lib/canvas/evas_object_textblock.c index 7941a45..568911c 100644 --- a/libraries/evas/src/lib/canvas/evas_object_textblock.c +++ b/libraries/evas/src/lib/canvas/evas_object_textblock.c | |||
@@ -61,13 +61,13 @@ | |||
61 | * @subsection textblock_layout The layout system | 61 | * @subsection textblock_layout The layout system |
62 | * @todo write @ref textblock_layout | 62 | * @todo write @ref textblock_layout |
63 | */ | 63 | */ |
64 | #include <stdlib.h> | ||
65 | |||
66 | #include "evas_common.h" | 64 | #include "evas_common.h" |
67 | #include "evas_private.h" | 65 | #include "evas_private.h" |
66 | #include <stdlib.h> | ||
68 | 67 | ||
69 | #ifdef HAVE_LINEBREAK | 68 | #ifdef HAVE_LINEBREAK |
70 | #include "linebreak.h" | 69 | #include "linebreak.h" |
70 | #include "wordbreak.h" | ||
71 | #endif | 71 | #endif |
72 | 72 | ||
73 | /* save typing */ | 73 | /* save typing */ |
@@ -78,12 +78,19 @@ | |||
78 | static const char o_type[] = "textblock"; | 78 | static const char o_type[] = "textblock"; |
79 | 79 | ||
80 | /* The char to be inserted instead of visible formats */ | 80 | /* The char to be inserted instead of visible formats */ |
81 | #define EVAS_TEXTBLOCK_REPLACEMENT_CHAR 0xFFFC | 81 | #define _REPLACEMENT_CHAR 0xFFFC |
82 | #define _PARAGRAPH_SEPARATOR 0x2029 | 82 | #define _PARAGRAPH_SEPARATOR 0x2029 |
83 | #define _NEWLINE '\n' | ||
84 | #define _TAB '\t' | ||
85 | |||
86 | #define _REPLACEMENT_CHAR_UTF8 "\xEF\xBF\xBC" | ||
87 | #define _PARAGRAPH_SEPARATOR_UTF8 "\xE2\x80\xA9" | ||
88 | #define _NEWLINE_UTF8 "\n" | ||
89 | #define _TAB_UTF8 "\t" | ||
83 | #define EVAS_TEXTBLOCK_IS_VISIBLE_FORMAT_CHAR(ch) \ | 90 | #define EVAS_TEXTBLOCK_IS_VISIBLE_FORMAT_CHAR(ch) \ |
84 | (((ch) == EVAS_TEXTBLOCK_REPLACEMENT_CHAR) || \ | 91 | (((ch) == _REPLACEMENT_CHAR) || \ |
85 | ((ch) == '\n') || \ | 92 | ((ch) == _NEWLINE) || \ |
86 | ((ch) == '\t') || \ | 93 | ((ch) == _TAB) || \ |
87 | ((ch) == _PARAGRAPH_SEPARATOR)) | 94 | ((ch) == _PARAGRAPH_SEPARATOR)) |
88 | 95 | ||
89 | /* private struct for textblock object internal data */ | 96 | /* private struct for textblock object internal data */ |
@@ -101,6 +108,12 @@ typedef struct _Evas_Object_Textblock Evas_Object_Textblock; | |||
101 | typedef struct _Evas_Object_Style_Tag Evas_Object_Style_Tag; | 108 | typedef struct _Evas_Object_Style_Tag Evas_Object_Style_Tag; |
102 | /** | 109 | /** |
103 | * @internal | 110 | * @internal |
111 | * @typedef Evas_Object_Style_Tag | ||
112 | * The structure used for finding style tags. | ||
113 | */ | ||
114 | typedef struct _Evas_Object_Style_Tag_Base Evas_Object_Style_Tag_Base; | ||
115 | /** | ||
116 | * @internal | ||
104 | * @typedef Evas_Object_Textblock_Node_Text | 117 | * @typedef Evas_Object_Textblock_Node_Text |
105 | * A text node. | 118 | * A text node. |
106 | */ | 119 | */ |
@@ -195,21 +208,26 @@ typedef struct _Evas_Object_Textblock_Format Evas_Object_Textblock_Format; | |||
195 | * Returns true if closer is the closer of base. | 208 | * Returns true if closer is the closer of base. |
196 | */ | 209 | */ |
197 | #define _FORMAT_IS_CLOSER_OF(base, closer, closer_len) \ | 210 | #define _FORMAT_IS_CLOSER_OF(base, closer, closer_len) \ |
198 | (!strncmp(base + 1, closer, closer_len) && \ | 211 | (!strncmp(base, closer, closer_len) && \ |
199 | (!base[closer_len + 1] || \ | 212 | (!base[closer_len] || \ |
200 | (base[closer_len + 1] == '=') || \ | 213 | (base[closer_len] == '=') || \ |
201 | _is_white(base[closer_len + 1]))) | 214 | _is_white(base[closer_len]))) |
202 | 215 | ||
203 | /*FIXME: document the structs and struct items. */ | 216 | /*FIXME: document the structs and struct items. */ |
204 | struct _Evas_Object_Style_Tag | 217 | struct _Evas_Object_Style_Tag_Base |
205 | { | 218 | { |
206 | EINA_INLIST; | ||
207 | char *tag; | 219 | char *tag; |
208 | char *replace; | 220 | char *replace; |
209 | size_t tag_len; | 221 | size_t tag_len; |
210 | size_t replace_len; | 222 | size_t replace_len; |
211 | }; | 223 | }; |
212 | 224 | ||
225 | struct _Evas_Object_Style_Tag | ||
226 | { | ||
227 | EINA_INLIST; | ||
228 | Evas_Object_Style_Tag_Base tag; | ||
229 | }; | ||
230 | |||
213 | struct _Evas_Object_Textblock_Node_Text | 231 | struct _Evas_Object_Textblock_Node_Text |
214 | { | 232 | { |
215 | EINA_INLIST; | 233 | EINA_INLIST; |
@@ -229,11 +247,18 @@ struct _Evas_Object_Textblock_Node_Format | |||
229 | Evas_Object_Textblock_Node_Text *text_node; | 247 | Evas_Object_Textblock_Node_Text *text_node; |
230 | size_t offset; | 248 | size_t offset; |
231 | unsigned char anchor : 2; | 249 | unsigned char anchor : 2; |
250 | Eina_Bool opener : 1; | ||
251 | Eina_Bool own_closer : 1; | ||
232 | Eina_Bool visible : 1; | 252 | Eina_Bool visible : 1; |
233 | Eina_Bool format_change : 1; | 253 | Eina_Bool format_change : 1; |
234 | Eina_Bool is_new : 1; | 254 | Eina_Bool is_new : 1; |
235 | }; | 255 | }; |
236 | 256 | ||
257 | /* The default tags to use */ | ||
258 | static const Evas_Object_Style_Tag_Base default_tags[] = { | ||
259 | { "b", "+ font_weight=Bold", 1, 18 }, | ||
260 | { "i", "+ font_style=Italic", 1, 19 }}; | ||
261 | |||
237 | #define ANCHOR_NONE 0 | 262 | #define ANCHOR_NONE 0 |
238 | #define ANCHOR_A 1 | 263 | #define ANCHOR_A 1 |
239 | #define ANCHOR_ITEM 2 | 264 | #define ANCHOR_ITEM 2 |
@@ -538,8 +563,8 @@ _style_replace(Evas_Textblock_Style *ts, const char *style_text) | |||
538 | 563 | ||
539 | tag = (Evas_Object_Style_Tag *)ts->tags; | 564 | tag = (Evas_Object_Style_Tag *)ts->tags; |
540 | ts->tags = (Evas_Object_Style_Tag *)eina_inlist_remove(EINA_INLIST_GET(ts->tags), EINA_INLIST_GET(tag)); | 565 | ts->tags = (Evas_Object_Style_Tag *)eina_inlist_remove(EINA_INLIST_GET(ts->tags), EINA_INLIST_GET(tag)); |
541 | free(tag->tag); | 566 | free(tag->tag.tag); |
542 | free(tag->replace); | 567 | free(tag->tag.replace); |
543 | free(tag); | 568 | free(tag); |
544 | } | 569 | } |
545 | ts->default_tag = NULL; | 570 | ts->default_tag = NULL; |
@@ -567,19 +592,38 @@ _style_clear(Evas_Textblock_Style *ts) | |||
567 | * @return The replacement string found. | 592 | * @return The replacement string found. |
568 | */ | 593 | */ |
569 | static inline const char * | 594 | static inline const char * |
570 | _style_match_tag(Evas_Textblock_Style *ts, const char *s, size_t tag_len, size_t *replace_len) | 595 | _style_match_tag(const Evas_Textblock_Style *ts, const char *s, size_t tag_len, size_t *replace_len) |
571 | { | 596 | { |
572 | Evas_Object_Style_Tag *tag; | 597 | Evas_Object_Style_Tag *tag; |
573 | 598 | ||
599 | /* Try the style tags */ | ||
574 | EINA_INLIST_FOREACH(ts->tags, tag) | 600 | EINA_INLIST_FOREACH(ts->tags, tag) |
575 | { | 601 | { |
576 | if (tag->tag_len != tag_len) continue; | 602 | if (tag->tag.tag_len != tag_len) continue; |
577 | if (!strncmp(tag->tag, s, tag_len)) | 603 | if (!strncmp(tag->tag.tag, s, tag_len)) |
578 | { | 604 | { |
579 | *replace_len = tag->replace_len; | 605 | *replace_len = tag->tag.replace_len; |
580 | return tag->replace; | 606 | return tag->tag.replace; |
581 | } | 607 | } |
582 | } | 608 | } |
609 | |||
610 | /* Try the default tags */ | ||
611 | { | ||
612 | size_t i; | ||
613 | const Evas_Object_Style_Tag_Base *btag; | ||
614 | for (btag = default_tags, i = 0 ; | ||
615 | i < (sizeof(default_tags) / sizeof(default_tags[0])) ; | ||
616 | btag++, i++) | ||
617 | { | ||
618 | if (btag->tag_len != tag_len) continue; | ||
619 | if (!strncmp(btag->tag, s, tag_len)) | ||
620 | { | ||
621 | *replace_len = btag->replace_len; | ||
622 | return btag->replace; | ||
623 | } | ||
624 | } | ||
625 | } | ||
626 | |||
583 | *replace_len = 0; | 627 | *replace_len = 0; |
584 | return NULL; | 628 | return NULL; |
585 | } | 629 | } |
@@ -1689,8 +1733,8 @@ _format_fill(Evas_Object *obj, Evas_Object_Textblock_Format *fmt, const char *st | |||
1689 | 1733 | ||
1690 | s = str; | 1734 | s = str; |
1691 | 1735 | ||
1692 | /* get rid of anything +s or -s off the start of the string */ | 1736 | /* get rid of any spaces at the start of the string */ |
1693 | while ((*s == ' ') || (*s == '+') || (*s == '-')) s++; | 1737 | while (*s == ' ') s++; |
1694 | 1738 | ||
1695 | while ((item = _format_parse(&s))) | 1739 | while ((item = _format_parse(&s))) |
1696 | { | 1740 | { |
@@ -2131,7 +2175,6 @@ _layout_format_pop(Ctxt *c, const char *format) | |||
2131 | if ((c->format_stack) && (c->format_stack->next)) | 2175 | if ((c->format_stack) && (c->format_stack->next)) |
2132 | { | 2176 | { |
2133 | Eina_List *redo_nodes = NULL; | 2177 | Eina_List *redo_nodes = NULL; |
2134 | format++; /* Skip the '-' */ | ||
2135 | 2178 | ||
2136 | /* Generic pop, should just pop. */ | 2179 | /* Generic pop, should just pop. */ |
2137 | if (((format[0] == ' ') && !format[1]) || | 2180 | if (((format[0] == ' ') && !format[1]) || |
@@ -2994,21 +3037,29 @@ _format_finalize(Evas_Object *obj, Evas_Object_Textblock_Format *fmt) | |||
2994 | * @def _IS_TAB(item) | 3037 | * @def _IS_TAB(item) |
2995 | */ | 3038 | */ |
2996 | #define _IS_TAB(item) \ | 3039 | #define _IS_TAB(item) \ |
2997 | (!strcmp(item, "\t") || !strcmp(item, "\\t")) | 3040 | (!strcmp(item, "tab") || !strcmp(item, "\t") || !strcmp(item, "\\t")) |
2998 | /** | 3041 | /** |
2999 | * @internal | 3042 | * @internal |
3000 | * Returns true if the item is a line spearator, false otherwise | 3043 | * Returns true if the item is a line spearator, false otherwise |
3001 | * @def _IS_LINE_SEPARATOR(item) | 3044 | * @def _IS_LINE_SEPARATOR(item) |
3002 | */ | 3045 | */ |
3003 | #define _IS_LINE_SEPARATOR(item) \ | 3046 | #define _IS_LINE_SEPARATOR(item) \ |
3004 | (!strcmp(item, "\n") || !strcmp(item, "\\n")) | 3047 | (!strcmp(item, "br") || !strcmp(item, "\n") || !strcmp(item, "\\n")) |
3005 | /** | 3048 | /** |
3006 | * @internal | 3049 | * @internal |
3007 | * Returns true if the item is a paragraph separator, false otherwise | 3050 | * Returns true if the item is a paragraph separator, false otherwise |
3008 | * @def _IS_PARAGRAPH_SEPARATOR(item) | 3051 | * @def _IS_PARAGRAPH_SEPARATOR(item) |
3009 | */ | 3052 | */ |
3053 | #define _IS_PARAGRAPH_SEPARATOR_SIMPLE(item) \ | ||
3054 | (!strcmp(item, "ps")) | ||
3055 | /** | ||
3056 | * @internal | ||
3057 | * Returns true if the item is a paragraph separator, false otherwise | ||
3058 | * takes legacy mode into account. | ||
3059 | * @def _IS_PARAGRAPH_SEPARATOR(item) | ||
3060 | */ | ||
3010 | #define _IS_PARAGRAPH_SEPARATOR(o, item) \ | 3061 | #define _IS_PARAGRAPH_SEPARATOR(o, item) \ |
3011 | (!strcmp(item, "ps") || \ | 3062 | (_IS_PARAGRAPH_SEPARATOR_SIMPLE(item) || \ |
3012 | (o->legacy_newline && _IS_LINE_SEPARATOR(item))) /* Paragraph separator */ | 3063 | (o->legacy_newline && _IS_LINE_SEPARATOR(item))) /* Paragraph separator */ |
3013 | 3064 | ||
3014 | /** | 3065 | /** |
@@ -3041,7 +3092,7 @@ _layout_do_format(const Evas_Object *obj __UNUSED__, Ctxt *c, | |||
3041 | int handled = 0; | 3092 | int handled = 0; |
3042 | 3093 | ||
3043 | s = n->format; | 3094 | s = n->format; |
3044 | if (!strncmp(s, "+ item ", 7)) | 3095 | if (!strncmp(s, "item ", 5)) |
3045 | { | 3096 | { |
3046 | // one of: | 3097 | // one of: |
3047 | // item size=20x10 href=name | 3098 | // item size=20x10 href=name |
@@ -3133,16 +3184,14 @@ _layout_do_format(const Evas_Object *obj __UNUSED__, Ctxt *c, | |||
3133 | if (!handled) | 3184 | if (!handled) |
3134 | { | 3185 | { |
3135 | Eina_Bool push_fmt = EINA_FALSE; | 3186 | Eina_Bool push_fmt = EINA_FALSE; |
3136 | if (s[0] == '+') | 3187 | if (n->opener && !n->own_closer) |
3137 | { | 3188 | { |
3138 | fmt = _layout_format_push(c, fmt, n); | 3189 | fmt = _layout_format_push(c, fmt, n); |
3139 | s++; | ||
3140 | push_fmt = EINA_TRUE; | 3190 | push_fmt = EINA_TRUE; |
3141 | } | 3191 | } |
3142 | else if (s[0] == '-') | 3192 | else if (!n->opener) |
3143 | { | 3193 | { |
3144 | fmt = _layout_format_pop(c, n->orig_format); | 3194 | fmt = _layout_format_pop(c, n->orig_format); |
3145 | s++; | ||
3146 | } | 3195 | } |
3147 | while ((item = _format_parse(&s))) | 3196 | while ((item = _format_parse(&s))) |
3148 | { | 3197 | { |
@@ -3166,7 +3215,7 @@ _layout_do_format(const Evas_Object *obj __UNUSED__, Ctxt *c, | |||
3166 | 3215 | ||
3167 | fi->parent.w = fi->parent.adv = 0; | 3216 | fi->parent.w = fi->parent.adv = 0; |
3168 | } | 3217 | } |
3169 | else if ((!strcmp(item, "\t")) || (!strcmp(item, "\\t"))) | 3218 | else if (_IS_TAB(item)) |
3170 | { | 3219 | { |
3171 | Evas_Object_Textblock_Format_Item *fi; | 3220 | Evas_Object_Textblock_Format_Item *fi; |
3172 | 3221 | ||
@@ -3215,28 +3264,33 @@ _layout_update_par(Ctxt *c) | |||
3215 | /* -1 means no wrap */ | 3264 | /* -1 means no wrap */ |
3216 | static int | 3265 | static int |
3217 | _layout_get_charwrap(Ctxt *c, Evas_Object_Textblock_Format *fmt, | 3266 | _layout_get_charwrap(Ctxt *c, Evas_Object_Textblock_Format *fmt, |
3218 | const Evas_Object_Textblock_Text_Item *ti, size_t line_start, | 3267 | const Evas_Object_Textblock_Item *it, size_t line_start, |
3219 | const char *breaks) | 3268 | const char *breaks) |
3220 | { | 3269 | { |
3221 | int wrap; | 3270 | int wrap; |
3222 | size_t uwrap; | 3271 | size_t uwrap; |
3223 | size_t len = eina_ustrbuf_length_get(ti->parent.text_node->unicode); | 3272 | size_t len = eina_ustrbuf_length_get(it->text_node->unicode); |
3224 | /* Currently not being used, because it doesn't contain relevant | 3273 | /* Currently not being used, because it doesn't contain relevant |
3225 | * information */ | 3274 | * information */ |
3226 | (void) breaks; | 3275 | (void) breaks; |
3227 | 3276 | ||
3228 | { | 3277 | { |
3229 | wrap = _layout_text_cutoff_get(c, fmt, ti); | 3278 | if (it->type == EVAS_TEXTBLOCK_ITEM_FORMAT) |
3279 | wrap = 0; | ||
3280 | else | ||
3281 | wrap = _layout_text_cutoff_get(c, fmt, _ITEM_TEXT(it)); | ||
3282 | |||
3230 | if (wrap < 0) | 3283 | if (wrap < 0) |
3231 | return -1; | 3284 | return -1; |
3232 | uwrap = (size_t) wrap + ti->parent.text_pos; | 3285 | uwrap = (size_t) wrap + it->text_pos; |
3233 | } | 3286 | } |
3234 | 3287 | ||
3235 | 3288 | ||
3236 | if (uwrap == line_start) | 3289 | if ((uwrap == line_start) && (it->type == EVAS_TEXTBLOCK_ITEM_TEXT)) |
3237 | { | 3290 | { |
3238 | uwrap = ti->parent.text_pos + | 3291 | uwrap = it->text_pos + |
3239 | (size_t) evas_common_text_props_cluster_next(&ti->text_props, wrap); | 3292 | (size_t) evas_common_text_props_cluster_next( |
3293 | &_ITEM_TEXT(it)->text_props, wrap); | ||
3240 | } | 3294 | } |
3241 | if ((uwrap <= line_start) || (uwrap > len)) | 3295 | if ((uwrap <= line_start) || (uwrap > len)) |
3242 | return -1; | 3296 | return -1; |
@@ -3259,16 +3313,16 @@ _layout_get_charwrap(Ctxt *c, Evas_Object_Textblock_Format *fmt, | |||
3259 | #endif | 3313 | #endif |
3260 | static int | 3314 | static int |
3261 | _layout_get_word_mixwrap_common(Ctxt *c, Evas_Object_Textblock_Format *fmt, | 3315 | _layout_get_word_mixwrap_common(Ctxt *c, Evas_Object_Textblock_Format *fmt, |
3262 | const Evas_Object_Textblock_Text_Item *ti, Eina_Bool mixed_wrap, | 3316 | const Evas_Object_Textblock_Item *it, Eina_Bool mixed_wrap, |
3263 | size_t line_start, const char *breaks) | 3317 | size_t line_start, const char *breaks) |
3264 | { | 3318 | { |
3265 | Eina_Bool wrap_after = EINA_FALSE; | 3319 | Eina_Bool wrap_after = EINA_FALSE; |
3266 | size_t wrap; | 3320 | size_t wrap; |
3267 | size_t orig_wrap; | 3321 | size_t orig_wrap; |
3268 | const Eina_Unicode *str = eina_ustrbuf_string_get( | 3322 | const Eina_Unicode *str = eina_ustrbuf_string_get( |
3269 | ti->parent.text_node->unicode); | 3323 | it->text_node->unicode); |
3270 | int item_start = ti->parent.text_pos; | 3324 | int item_start = it->text_pos; |
3271 | size_t len = eina_ustrbuf_length_get(ti->parent.text_node->unicode); | 3325 | size_t len = eina_ustrbuf_length_get(it->text_node->unicode); |
3272 | #ifndef HAVE_LINEBREAK | 3326 | #ifndef HAVE_LINEBREAK |
3273 | /* Not used without liblinebreak ATM. */ | 3327 | /* Not used without liblinebreak ATM. */ |
3274 | (void) breaks; | 3328 | (void) breaks; |
@@ -3276,7 +3330,10 @@ _layout_get_word_mixwrap_common(Ctxt *c, Evas_Object_Textblock_Format *fmt, | |||
3276 | 3330 | ||
3277 | { | 3331 | { |
3278 | int swrap = -1; | 3332 | int swrap = -1; |
3279 | swrap = _layout_text_cutoff_get(c, fmt, ti); | 3333 | if (it->type == EVAS_TEXTBLOCK_ITEM_FORMAT) |
3334 | swrap = 0; | ||
3335 | else | ||
3336 | swrap = _layout_text_cutoff_get(c, fmt, _ITEM_TEXT(it)); | ||
3280 | /* Avoiding too small textblocks to even contain one char. | 3337 | /* Avoiding too small textblocks to even contain one char. |
3281 | * FIXME: This can cause breaking inside ligatures. */ | 3338 | * FIXME: This can cause breaking inside ligatures. */ |
3282 | 3339 | ||
@@ -3331,7 +3388,7 @@ _layout_get_word_mixwrap_common(Ctxt *c, Evas_Object_Textblock_Format *fmt, | |||
3331 | { | 3388 | { |
3332 | if (mixed_wrap) | 3389 | if (mixed_wrap) |
3333 | { | 3390 | { |
3334 | return _layout_get_charwrap(c, fmt, ti, | 3391 | return _layout_get_charwrap(c, fmt, it, |
3335 | line_start, breaks); | 3392 | line_start, breaks); |
3336 | } | 3393 | } |
3337 | else | 3394 | else |
@@ -3362,20 +3419,20 @@ _layout_get_word_mixwrap_common(Ctxt *c, Evas_Object_Textblock_Format *fmt, | |||
3362 | /* -1 means no wrap */ | 3419 | /* -1 means no wrap */ |
3363 | static int | 3420 | static int |
3364 | _layout_get_wordwrap(Ctxt *c, Evas_Object_Textblock_Format *fmt, | 3421 | _layout_get_wordwrap(Ctxt *c, Evas_Object_Textblock_Format *fmt, |
3365 | const Evas_Object_Textblock_Text_Item *ti, size_t line_start, | 3422 | const Evas_Object_Textblock_Item *it, size_t line_start, |
3366 | const char *breaks) | 3423 | const char *breaks) |
3367 | { | 3424 | { |
3368 | return _layout_get_word_mixwrap_common(c, fmt, ti, EINA_FALSE, line_start, | 3425 | return _layout_get_word_mixwrap_common(c, fmt, it, EINA_FALSE, line_start, |
3369 | breaks); | 3426 | breaks); |
3370 | } | 3427 | } |
3371 | 3428 | ||
3372 | /* -1 means no wrap */ | 3429 | /* -1 means no wrap */ |
3373 | static int | 3430 | static int |
3374 | _layout_get_mixedwrap(Ctxt *c, Evas_Object_Textblock_Format *fmt, | 3431 | _layout_get_mixedwrap(Ctxt *c, Evas_Object_Textblock_Format *fmt, |
3375 | const Evas_Object_Textblock_Text_Item *ti, size_t line_start, | 3432 | const Evas_Object_Textblock_Item *it, size_t line_start, |
3376 | const char *breaks) | 3433 | const char *breaks) |
3377 | { | 3434 | { |
3378 | return _layout_get_word_mixwrap_common(c, fmt, ti, EINA_TRUE, line_start, | 3435 | return _layout_get_word_mixwrap_common(c, fmt, it, EINA_TRUE, line_start, |
3379 | breaks); | 3436 | breaks); |
3380 | } | 3437 | } |
3381 | 3438 | ||
@@ -3503,7 +3560,7 @@ _layout_paragraph_reorder_lines(Evas_Object_Textblock_Paragraph *par) | |||
3503 | 3560 | ||
3504 | static void | 3561 | static void |
3505 | _layout_paragraph_render(Evas_Object_Textblock *o, | 3562 | _layout_paragraph_render(Evas_Object_Textblock *o, |
3506 | Evas_Object_Textblock_Paragraph *par) | 3563 | Evas_Object_Textblock_Paragraph *par) |
3507 | { | 3564 | { |
3508 | if (par->rendered) | 3565 | if (par->rendered) |
3509 | return; | 3566 | return; |
@@ -3521,6 +3578,8 @@ _layout_paragraph_render(Evas_Object_Textblock *o, | |||
3521 | par->bidi_props = NULL; | 3578 | par->bidi_props = NULL; |
3522 | } | 3579 | } |
3523 | } | 3580 | } |
3581 | #else | ||
3582 | (void) o; | ||
3524 | #endif | 3583 | #endif |
3525 | } | 3584 | } |
3526 | 3585 | ||
@@ -3656,120 +3715,127 @@ _layout_par(Ctxt *c) | |||
3656 | else if ((it->format->wrap_word || it->format->wrap_char || | 3715 | else if ((it->format->wrap_word || it->format->wrap_char || |
3657 | it->format->wrap_mixed) && it->text_node) | 3716 | it->format->wrap_mixed) && it->text_node) |
3658 | { | 3717 | { |
3659 | if (it->type == EVAS_TEXTBLOCK_ITEM_FORMAT) | 3718 | size_t line_start; |
3719 | size_t it_len; | ||
3720 | |||
3721 | it_len = (it->type == EVAS_TEXTBLOCK_ITEM_FORMAT) ? | ||
3722 | 1 : _ITEM_TEXT(it)->text_props.text_len; | ||
3723 | |||
3724 | |||
3725 | #ifdef HAVE_LINEBREAK | ||
3726 | /* If we haven't calculated the linebreaks yet, | ||
3727 | * do */ | ||
3728 | if (!line_breaks) | ||
3660 | { | 3729 | { |
3661 | /* Don't wrap if it's the only item */ | 3730 | /* Only relevant in those cases */ |
3662 | if (c->ln->items) | 3731 | if (it->format->wrap_word || it->format->wrap_mixed) |
3663 | { | 3732 | { |
3664 | /*FIXME: I should handle format correctly, | 3733 | const char *lang; |
3665 | i.e verify we are allowed to break here */ | 3734 | lang = (it->format->font.fdesc) ? |
3666 | _layout_line_advance(c, it->format); | 3735 | it->format->font.fdesc->lang : ""; |
3667 | wrap = -1; | 3736 | size_t len = |
3737 | eina_ustrbuf_length_get( | ||
3738 | it->text_node->unicode); | ||
3739 | line_breaks = malloc(len); | ||
3740 | set_linebreaks_utf32((const utf32_t *) | ||
3741 | eina_ustrbuf_string_get( | ||
3742 | it->text_node->unicode), | ||
3743 | len, lang, line_breaks); | ||
3668 | } | 3744 | } |
3669 | } | 3745 | } |
3746 | #endif | ||
3747 | if (c->ln->items) | ||
3748 | line_start = c->ln->items->text_pos; | ||
3670 | else | 3749 | else |
3671 | { | 3750 | line_start = it->text_pos; |
3672 | Evas_Object_Textblock_Text_Item *ti = _ITEM_TEXT(it); | ||
3673 | size_t line_start; | ||
3674 | 3751 | ||
3675 | #ifdef HAVE_LINEBREAK | 3752 | adv_line = 1; |
3676 | /* If we haven't calculated the linebreaks yet, | 3753 | /* If we don't already have a wrap point from before */ |
3677 | * do */ | 3754 | if (wrap < 0) |
3678 | if (!line_breaks) | 3755 | { |
3679 | { | 3756 | if (it->format->wrap_word) |
3680 | /* Only relevant in those cases */ | 3757 | wrap = _layout_get_wordwrap(c, it->format, it, |
3681 | if (it->format->wrap_word || it->format->wrap_mixed) | 3758 | line_start, line_breaks); |
3682 | { | 3759 | else if (it->format->wrap_char) |
3683 | const char *lang; | 3760 | wrap = _layout_get_charwrap(c, it->format, it, |
3684 | lang = (it->format->font.fdesc) ? | 3761 | line_start, line_breaks); |
3685 | it->format->font.fdesc->lang : ""; | 3762 | else if (it->format->wrap_mixed) |
3686 | size_t len = | 3763 | wrap = _layout_get_mixedwrap(c, it->format, it, |
3687 | eina_ustrbuf_length_get( | 3764 | line_start, line_breaks); |
3688 | it->text_node->unicode); | ||
3689 | line_breaks = malloc(len); | ||
3690 | set_linebreaks_utf32((const utf32_t *) | ||
3691 | eina_ustrbuf_string_get( | ||
3692 | it->text_node->unicode), | ||
3693 | len, lang, line_breaks); | ||
3694 | } | ||
3695 | } | ||
3696 | #endif | ||
3697 | if (c->ln->items) | ||
3698 | line_start = c->ln->items->text_pos; | ||
3699 | else | 3765 | else |
3700 | line_start = ti->parent.text_pos; | 3766 | wrap = -1; |
3701 | 3767 | } | |
3702 | adv_line = 1; | ||
3703 | /* If we don't already have a wrap point from before */ | ||
3704 | if (wrap < 0) | ||
3705 | { | ||
3706 | if (it->format->wrap_word) | ||
3707 | wrap = _layout_get_wordwrap(c, it->format, ti, | ||
3708 | line_start, line_breaks); | ||
3709 | else if (it->format->wrap_char) | ||
3710 | wrap = _layout_get_charwrap(c, it->format, ti, | ||
3711 | line_start, line_breaks); | ||
3712 | else if (it->format->wrap_mixed) | ||
3713 | wrap = _layout_get_mixedwrap(c, it->format, ti, | ||
3714 | line_start, line_breaks); | ||
3715 | else | ||
3716 | wrap = -1; | ||
3717 | } | ||
3718 | 3768 | ||
3719 | /* If it's before the item, rollback and apply. | 3769 | /* If it's before the item, rollback and apply. |
3720 | if it's in the item, cut. | 3770 | if it's in the item, cut. |
3721 | If it's after the item, delay the cut */ | 3771 | If it's after the item, delay the cut */ |
3722 | if (wrap > 0) | 3772 | if (wrap > 0) |
3773 | { | ||
3774 | size_t uwrap = (size_t) wrap; | ||
3775 | if (uwrap < it->text_pos) | ||
3723 | { | 3776 | { |
3724 | size_t uwrap = (size_t) wrap; | 3777 | /* Rollback latest additions, and cut that |
3725 | if (uwrap < ti->parent.text_pos) | 3778 | item */ |
3779 | i = eina_list_prev(i); | ||
3780 | it = eina_list_data_get(i); | ||
3781 | while (uwrap < it->text_pos) | ||
3726 | { | 3782 | { |
3727 | /* Rollback latest additions, and cut that | ||
3728 | item */ | ||
3729 | i = eina_list_prev(i); | ||
3730 | it = eina_list_data_get(i); | ||
3731 | while (uwrap < it->text_pos) | ||
3732 | { | ||
3733 | c->ln->items = _ITEM( | ||
3734 | eina_inlist_remove( | ||
3735 | EINA_INLIST_GET(c->ln->items), | ||
3736 | EINA_INLIST_GET(it))); | ||
3737 | i = eina_list_prev(i); | ||
3738 | it = eina_list_data_get(i); | ||
3739 | } | ||
3740 | c->x = it->x; | ||
3741 | c->ln->items = _ITEM( | 3783 | c->ln->items = _ITEM( |
3742 | eina_inlist_remove( | 3784 | eina_inlist_remove( |
3743 | EINA_INLIST_GET(c->ln->items), | 3785 | EINA_INLIST_GET(c->ln->items), |
3744 | EINA_INLIST_GET(it))); | 3786 | EINA_INLIST_GET(it))); |
3745 | continue; | 3787 | i = eina_list_prev(i); |
3788 | it = eina_list_data_get(i); | ||
3746 | } | 3789 | } |
3747 | /* If it points to the end, it means the previous | 3790 | c->x = it->x; |
3748 | * char is a whitespace we should remove, so this | 3791 | c->ln->items = _ITEM( |
3749 | * is a wanted cutting point. */ | 3792 | eina_inlist_remove( |
3750 | else if (uwrap > ti->parent.text_pos + | 3793 | EINA_INLIST_GET(c->ln->items), |
3751 | ti->text_props.text_len) | 3794 | EINA_INLIST_GET(it))); |
3752 | wrap = -1; /* Delay the cut in a smart way | 3795 | continue; |
3753 | i.e use the item_pos as the line_start, because | ||
3754 | there's already no cut before*/ | ||
3755 | else | ||
3756 | wrap -= ti->parent.text_pos; /* Cut here */ | ||
3757 | } | 3796 | } |
3758 | 3797 | /* If it points to the end, it means the previous | |
3759 | if (wrap > 0) | 3798 | * char is a whitespace we should remove, so this |
3799 | * is a wanted cutting point. */ | ||
3800 | else if (uwrap > it->text_pos + it_len) | ||
3760 | { | 3801 | { |
3761 | _layout_item_text_split_strip_white(c, ti, i, wrap); | 3802 | /* FIXME: Should redo the ellipsis handling. |
3762 | } | 3803 | * If we can do ellipsis, just cut here. */ |
3763 | else if (wrap == 0) | 3804 | if (it->format->ellipsis == 1.0) |
3805 | { | ||
3806 | _layout_handle_ellipsis(c, it, i); | ||
3807 | ret = 1; | ||
3808 | goto end; | ||
3809 | } | ||
3810 | else | ||
3811 | { | ||
3812 | /* Delay the cut in a smart way i.e use the | ||
3813 | item_pos as the line_start, because | ||
3814 | there's already no cut before*/ | ||
3815 | wrap = -1; | ||
3816 | } | ||
3817 | } | ||
3818 | else | ||
3819 | wrap -= it->text_pos; /* Cut here */ | ||
3820 | } | ||
3821 | |||
3822 | if (wrap > 0) | ||
3823 | { | ||
3824 | if (it->type == EVAS_TEXTBLOCK_ITEM_TEXT) | ||
3764 | { | 3825 | { |
3765 | /* Should wrap before the item */ | 3826 | _layout_item_text_split_strip_white(c, |
3766 | adv_line = 0; | 3827 | _ITEM_TEXT(it), i, wrap); |
3767 | redo_item = 1; | ||
3768 | _layout_line_advance(c, it->format); | ||
3769 | } | 3828 | } |
3770 | /* Reset wrap */ | ||
3771 | wrap = -1; | ||
3772 | } | 3829 | } |
3830 | else if (wrap == 0) | ||
3831 | { | ||
3832 | /* Should wrap before the item */ | ||
3833 | adv_line = 0; | ||
3834 | redo_item = 1; | ||
3835 | _layout_line_advance(c, it->format); | ||
3836 | } | ||
3837 | /* Reset wrap */ | ||
3838 | wrap = -1; | ||
3773 | } | 3839 | } |
3774 | } | 3840 | } |
3775 | 3841 | ||
@@ -3844,18 +3910,16 @@ _format_changes_invalidate_text_nodes(Ctxt *c) | |||
3844 | const char *fstr = fnode->orig_format; | 3910 | const char *fstr = fnode->orig_format; |
3845 | /* balance < 0 means we gave up and everything should be | 3911 | /* balance < 0 means we gave up and everything should be |
3846 | * invalidated */ | 3912 | * invalidated */ |
3847 | if (*fstr == '+') | 3913 | if (fnode->opener && !fnode->own_closer) |
3848 | { | 3914 | { |
3849 | balance++; | 3915 | balance++; |
3850 | if (!fstack) | 3916 | if (!fstack) |
3851 | start_n = fnode->text_node; | 3917 | start_n = fnode->text_node; |
3852 | fstack = eina_list_prepend(fstack, fnode); | 3918 | fstack = eina_list_prepend(fstack, fnode); |
3853 | } | 3919 | } |
3854 | else if (*fstr == '-') | 3920 | else if (!fnode->opener) |
3855 | { | 3921 | { |
3856 | size_t fstr_len; | 3922 | size_t fstr_len; |
3857 | /* Skip the '-' */ | ||
3858 | fstr++; | ||
3859 | fstr_len = strlen(fstr); | 3923 | fstr_len = strlen(fstr); |
3860 | /* Generic popper, just pop */ | 3924 | /* Generic popper, just pop */ |
3861 | if (((fstr[0] == ' ') && !fstr[1]) || !fstr[0]) | 3925 | if (((fstr[0] == ' ') && !fstr[1]) || !fstr[0]) |
@@ -4429,12 +4493,12 @@ evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) | |||
4429 | { | 4493 | { |
4430 | if (!key_start) | 4494 | if (!key_start) |
4431 | { | 4495 | { |
4432 | if (!isspace(*p)) | 4496 | if (!isspace((unsigned char)(*p))) |
4433 | key_start = p; | 4497 | key_start = p; |
4434 | } | 4498 | } |
4435 | else if (!key_stop) | 4499 | else if (!key_stop) |
4436 | { | 4500 | { |
4437 | if ((*p == '=') || (isspace(*p))) | 4501 | if ((*p == '=') || (isspace((unsigned char)(*p)))) |
4438 | key_stop = p; | 4502 | key_stop = p; |
4439 | } | 4503 | } |
4440 | else if (!val_start) | 4504 | else if (!val_start) |
@@ -4479,10 +4543,10 @@ evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) | |||
4479 | tag = calloc(1, sizeof(Evas_Object_Style_Tag)); | 4543 | tag = calloc(1, sizeof(Evas_Object_Style_Tag)); |
4480 | if (tag) | 4544 | if (tag) |
4481 | { | 4545 | { |
4482 | tag->tag = tags; | 4546 | tag->tag.tag = tags; |
4483 | tag->replace = replaces; | 4547 | tag->tag.replace = replaces; |
4484 | tag->tag_len = tag_len; | 4548 | tag->tag.tag_len = tag_len; |
4485 | tag->replace_len = replace_len; | 4549 | tag->tag.replace_len = replace_len; |
4486 | ts->tags = (Evas_Object_Style_Tag *)eina_inlist_append(EINA_INLIST_GET(ts->tags), EINA_INLIST_GET(tag)); | 4550 | ts->tags = (Evas_Object_Style_Tag *)eina_inlist_append(EINA_INLIST_GET(ts->tags), EINA_INLIST_GET(tag)); |
4487 | } | 4551 | } |
4488 | else | 4552 | else |
@@ -4689,7 +4753,11 @@ _escaped_char_match(const char *s, int *adv) | |||
4689 | while ((*mc) && (*sc)) | 4753 | while ((*mc) && (*sc)) |
4690 | { | 4754 | { |
4691 | if ((unsigned char)*sc < (unsigned char)*mc) return NULL; | 4755 | if ((unsigned char)*sc < (unsigned char)*mc) return NULL; |
4692 | if (*sc != *mc) match = 0; | 4756 | if (*sc != *mc) |
4757 | { | ||
4758 | match = 0; | ||
4759 | break; | ||
4760 | } | ||
4693 | mc++; | 4761 | mc++; |
4694 | sc++; | 4762 | sc++; |
4695 | } | 4763 | } |
@@ -4723,7 +4791,7 @@ _escaped_char_get(const char *s, const char *s_end) | |||
4723 | int base = 10; | 4791 | int base = 10; |
4724 | s += 2; /* Skip "&#" */ | 4792 | s += 2; /* Skip "&#" */ |
4725 | 4793 | ||
4726 | if (tolower(*s) == 'x') | 4794 | if (tolower((unsigned char)(*s)) == 'x') |
4727 | { | 4795 | { |
4728 | s++; | 4796 | s++; |
4729 | base = 16; | 4797 | base = 16; |
@@ -4876,6 +4944,7 @@ evas_object_textblock_text_markup_prepend(Evas_Textblock_Cursor *cur, const char | |||
4876 | * NULL is reached. */ | 4944 | * NULL is reached. */ |
4877 | for (;;) | 4945 | for (;;) |
4878 | { | 4946 | { |
4947 | size_t text_len; | ||
4879 | /* If we got to the end of string or just finished/started tag | 4948 | /* If we got to the end of string or just finished/started tag |
4880 | * or escape sequence handling. */ | 4949 | * or escape sequence handling. */ |
4881 | if ((*p == 0) || | 4950 | if ((*p == 0) || |
@@ -4953,14 +5022,22 @@ evas_object_textblock_text_markup_prepend(Evas_Textblock_Cursor *cur, const char | |||
4953 | } | 5022 | } |
4954 | } | 5023 | } |
4955 | /* Unicode object replcament char */ | 5024 | /* Unicode object replcament char */ |
4956 | else if (!strncmp("\xEF\xBF\xBC", p, 3)) | 5025 | else if (!strncmp(_REPLACEMENT_CHAR_UTF8, p, |
5026 | text_len = strlen(_REPLACEMENT_CHAR_UTF8)) || | ||
5027 | !strncmp(_NEWLINE_UTF8, p, | ||
5028 | text_len = strlen(_NEWLINE_UTF8)) || | ||
5029 | !strncmp(_TAB_UTF8, p, | ||
5030 | text_len = strlen(_TAB_UTF8)) || | ||
5031 | !strncmp(_PARAGRAPH_SEPARATOR_UTF8, p, | ||
5032 | text_len = strlen(_PARAGRAPH_SEPARATOR_UTF8))) | ||
4957 | { | 5033 | { |
4958 | /*FIXME: currently just remove them, maybe do something | 5034 | /*FIXME: currently just remove them, maybe do something |
4959 | * fancier in the future, atm it breaks if this char | 5035 | * fancier in the future, atm it breaks if this char |
4960 | * is inside <> */ | 5036 | * is inside <> */ |
4961 | _prepend_text_run(cur, s, p); | 5037 | _prepend_text_run(cur, s, p); |
4962 | p += 2; /* it's also advanced later in this loop need +3 | 5038 | /* it's also advanced later in this loop need +text_len |
4963 | * in total*/ | 5039 | in total*/ |
5040 | p += text_len - 1; | ||
4964 | s = p + 1; /* One after the end of the replacement char */ | 5041 | s = p + 1; /* One after the end of the replacement char */ |
4965 | } | 5042 | } |
4966 | p++; | 5043 | p++; |
@@ -4979,19 +5056,19 @@ evas_object_textblock_text_markup_prepend(Evas_Textblock_Cursor *cur, const char | |||
4979 | * @param fnode the format node to process. | 5056 | * @param fnode the format node to process. |
4980 | */ | 5057 | */ |
4981 | static void | 5058 | static void |
4982 | _markup_get_format_append(Evas_Object_Textblock *o __UNUSED__, Eina_Strbuf *txt, Evas_Object_Textblock_Node_Format *fnode) | 5059 | _markup_get_format_append(Eina_Strbuf *txt, Evas_Object_Textblock_Node_Format *fnode) |
4983 | { | 5060 | { |
4984 | eina_strbuf_append_char(txt, '<'); | 5061 | eina_strbuf_append_char(txt, '<'); |
4985 | { | 5062 | { |
4986 | const char *s; | 5063 | const char *s; |
4987 | int pop = 0; | ||
4988 | 5064 | ||
4989 | // FIXME: need to escape | 5065 | // FIXME: need to escape |
4990 | s = fnode->orig_format; | 5066 | s = fnode->orig_format; |
4991 | if (*s == '-') pop = 1; | 5067 | if (!fnode->opener && !fnode->own_closer) |
4992 | while ((*s == ' ') || (*s == '+') || (*s == '-')) s++; | 5068 | eina_strbuf_append_char(txt, '/'); |
4993 | if (pop) eina_strbuf_append_char(txt, '/'); | ||
4994 | eina_strbuf_append(txt, s); | 5069 | eina_strbuf_append(txt, s); |
5070 | if (fnode->own_closer) | ||
5071 | eina_strbuf_append_char(txt, '/'); | ||
4995 | } | 5072 | } |
4996 | eina_strbuf_append_char(txt, '>'); | 5073 | eina_strbuf_append_char(txt, '>'); |
4997 | } | 5074 | } |
@@ -5061,7 +5138,7 @@ evas_object_textblock_text_markup_get(const Evas_Object *obj) | |||
5061 | tmp_ch = text[off]; | 5138 | tmp_ch = text[off]; |
5062 | text[off] = 0; /* Null terminate the part of the string */ | 5139 | text[off] = 0; /* Null terminate the part of the string */ |
5063 | _markup_get_text_append(txt, text); | 5140 | _markup_get_text_append(txt, text); |
5064 | _markup_get_format_append(o, txt, fnode); | 5141 | _markup_get_format_append(txt, fnode); |
5065 | text[off] = tmp_ch; /* Restore the char */ | 5142 | text[off] = tmp_ch; /* Restore the char */ |
5066 | text += off; | 5143 | text += off; |
5067 | if (fnode->visible) | 5144 | if (fnode->visible) |
@@ -5086,6 +5163,190 @@ evas_object_textblock_text_markup_get(const Evas_Object *obj) | |||
5086 | return o->markup_text; | 5163 | return o->markup_text; |
5087 | } | 5164 | } |
5088 | 5165 | ||
5166 | EAPI char * | ||
5167 | evas_textblock_text_markup_to_utf8(const Evas_Object *obj, const char *text) | ||
5168 | { | ||
5169 | /* FIXME: Redundant and awful, should be merged with markup_prepend */ | ||
5170 | Eina_Strbuf *sbuf; | ||
5171 | char *s, *p, *ret; | ||
5172 | char *tag_start, *tag_end, *esc_start, *esc_end; | ||
5173 | |||
5174 | if (!text) return NULL; | ||
5175 | |||
5176 | |||
5177 | tag_start = tag_end = esc_start = esc_end = NULL; | ||
5178 | sbuf = eina_strbuf_new(); | ||
5179 | p = (char *)text; | ||
5180 | s = p; | ||
5181 | /* This loop goes through all of the mark up text until it finds format | ||
5182 | * tags, escape sequences or the terminating NULL. When it finds either | ||
5183 | * of those, it appends the text found up until that point to the textblock | ||
5184 | * proccesses whatever found. It repeats itself until the termainating | ||
5185 | * NULL is reached. */ | ||
5186 | for (;;) | ||
5187 | { | ||
5188 | /* If we got to the end of string or just finished/started tag | ||
5189 | * or escape sequence handling. */ | ||
5190 | if ((*p == 0) || | ||
5191 | (tag_end) || (esc_end) || | ||
5192 | (tag_start) || (esc_start)) | ||
5193 | { | ||
5194 | if (tag_end) | ||
5195 | { | ||
5196 | /* If we reached to a tag ending, analyze the tag */ | ||
5197 | char *ttag; | ||
5198 | size_t ttag_len; | ||
5199 | |||
5200 | tag_start++; /* Skip the < */ | ||
5201 | tag_end--; /* Skip the > */ | ||
5202 | if ((tag_end > tag_start) && (*(tag_end - 1) == '/')) | ||
5203 | { | ||
5204 | tag_end --; /* Skip the terminating '/' */ | ||
5205 | while (*(tag_end - 1) == ' ') | ||
5206 | tag_end--; /* skip trailing ' ' */ | ||
5207 | } | ||
5208 | |||
5209 | ttag_len = tag_end - tag_start; | ||
5210 | |||
5211 | ttag = malloc(ttag_len + 1); | ||
5212 | if (ttag) | ||
5213 | { | ||
5214 | const char *match = NULL; | ||
5215 | size_t replace_len; | ||
5216 | memcpy(ttag, tag_start, ttag_len); | ||
5217 | ttag[ttag_len] = 0; | ||
5218 | |||
5219 | |||
5220 | if (obj) | ||
5221 | { | ||
5222 | match = _style_match_tag( | ||
5223 | evas_object_textblock_style_get(obj), | ||
5224 | ttag, ttag_len, &replace_len); | ||
5225 | } | ||
5226 | |||
5227 | if (!match) match = ttag; | ||
5228 | |||
5229 | if (_IS_PARAGRAPH_SEPARATOR_SIMPLE(match)) | ||
5230 | eina_strbuf_append(sbuf, _PARAGRAPH_SEPARATOR_UTF8); | ||
5231 | else if (_IS_LINE_SEPARATOR(match)) | ||
5232 | eina_strbuf_append(sbuf, _NEWLINE_UTF8); | ||
5233 | else if (_IS_TAB(match)) | ||
5234 | eina_strbuf_append(sbuf, _TAB_UTF8); | ||
5235 | else if (!strncmp(match, "item", 4)) | ||
5236 | eina_strbuf_append(sbuf, _REPLACEMENT_CHAR_UTF8); | ||
5237 | |||
5238 | free(ttag); | ||
5239 | } | ||
5240 | tag_start = tag_end = NULL; | ||
5241 | } | ||
5242 | else if (esc_end) | ||
5243 | { | ||
5244 | const char *escape; | ||
5245 | |||
5246 | escape = _escaped_char_get(esc_start, esc_end + 1); | ||
5247 | eina_strbuf_append(sbuf, escape); | ||
5248 | esc_start = esc_end = NULL; | ||
5249 | } | ||
5250 | else if (*p == 0) | ||
5251 | { | ||
5252 | eina_strbuf_append_length(sbuf, s, p - s); | ||
5253 | s = NULL; | ||
5254 | } | ||
5255 | if (*p == 0) | ||
5256 | break; | ||
5257 | } | ||
5258 | if (*p == '<') | ||
5259 | { | ||
5260 | if (!esc_start) | ||
5261 | { | ||
5262 | /* Append the text prior to this to the textblock and | ||
5263 | * mark the start of the tag */ | ||
5264 | tag_start = p; | ||
5265 | tag_end = NULL; | ||
5266 | eina_strbuf_append_length(sbuf, s, p - s); | ||
5267 | s = NULL; | ||
5268 | } | ||
5269 | } | ||
5270 | else if (*p == '>') | ||
5271 | { | ||
5272 | if (tag_start) | ||
5273 | { | ||
5274 | tag_end = p + 1; | ||
5275 | s = p + 1; | ||
5276 | } | ||
5277 | } | ||
5278 | else if (*p == '&') | ||
5279 | { | ||
5280 | if (!tag_start) | ||
5281 | { | ||
5282 | /* Append the text prior to this to the textblock and mark | ||
5283 | * the start of the escape sequence */ | ||
5284 | esc_start = p; | ||
5285 | esc_end = NULL; | ||
5286 | eina_strbuf_append_length(sbuf, s, p - s); | ||
5287 | s = NULL; | ||
5288 | } | ||
5289 | } | ||
5290 | else if (*p == ';') | ||
5291 | { | ||
5292 | if (esc_start) | ||
5293 | { | ||
5294 | esc_end = p; | ||
5295 | s = p + 1; | ||
5296 | } | ||
5297 | } | ||
5298 | p++; | ||
5299 | } | ||
5300 | |||
5301 | ret = eina_strbuf_string_steal(sbuf); | ||
5302 | eina_strbuf_free(sbuf); | ||
5303 | return ret; | ||
5304 | } | ||
5305 | |||
5306 | EAPI char * | ||
5307 | evas_textblock_text_utf8_to_markup(const Evas_Object *obj, const char *text) | ||
5308 | { | ||
5309 | Eina_Strbuf *sbuf; | ||
5310 | char *str = NULL; | ||
5311 | int ch, pos = 0, pos2 = 0; | ||
5312 | |||
5313 | (void) obj; | ||
5314 | |||
5315 | if (!text) return NULL; | ||
5316 | |||
5317 | sbuf = eina_strbuf_new(); | ||
5318 | |||
5319 | for (;;) | ||
5320 | { | ||
5321 | pos = pos2; | ||
5322 | pos2 = evas_string_char_next_get(text, pos2, &ch); | ||
5323 | if ((ch <= 0) || (pos2 <= 0)) break; | ||
5324 | |||
5325 | if (ch == _NEWLINE) | ||
5326 | eina_strbuf_append(sbuf, "<br/>"); | ||
5327 | else if (ch == _TAB) | ||
5328 | eina_strbuf_append(sbuf, "<tab/>"); | ||
5329 | else if (ch == '<') | ||
5330 | eina_strbuf_append(sbuf, "<"); | ||
5331 | else if (ch == '>') | ||
5332 | eina_strbuf_append(sbuf, ">"); | ||
5333 | else if (ch == '&') | ||
5334 | eina_strbuf_append(sbuf, "&"); | ||
5335 | else if (ch == _PARAGRAPH_SEPARATOR) | ||
5336 | eina_strbuf_append(sbuf, "<ps/>"); | ||
5337 | else if (ch == _REPLACEMENT_CHAR) | ||
5338 | eina_strbuf_append(sbuf, ""); | ||
5339 | else | ||
5340 | { | ||
5341 | eina_strbuf_append_length(sbuf, text + pos, pos2 - pos); | ||
5342 | } | ||
5343 | } | ||
5344 | str = eina_strbuf_string_steal(sbuf); | ||
5345 | eina_strbuf_free(sbuf); | ||
5346 | return str; | ||
5347 | |||
5348 | } | ||
5349 | |||
5089 | /* cursors */ | 5350 | /* cursors */ |
5090 | 5351 | ||
5091 | /** | 5352 | /** |
@@ -5453,15 +5714,13 @@ evas_textblock_node_format_remove_pair(Evas_Object *obj, | |||
5453 | { | 5714 | { |
5454 | const char *fstr = fmt->orig_format; | 5715 | const char *fstr = fmt->orig_format; |
5455 | 5716 | ||
5456 | if (fstr && (*fstr == '+')) | 5717 | if (fmt->opener && !fmt->own_closer) |
5457 | { | 5718 | { |
5458 | fstack = eina_list_prepend(fstack, fmt); | 5719 | fstack = eina_list_prepend(fstack, fmt); |
5459 | } | 5720 | } |
5460 | else if (fstr && (*fstr == '-')) | 5721 | else if (fstr && !fmt->opener) |
5461 | { | 5722 | { |
5462 | size_t fstr_len; | 5723 | size_t fstr_len; |
5463 | /* Skip the '-' */ | ||
5464 | fstr++; | ||
5465 | fstr_len = strlen(fstr); | 5724 | fstr_len = strlen(fstr); |
5466 | /* Generic popper, just pop */ | 5725 | /* Generic popper, just pop */ |
5467 | if (((fstr[0] == ' ') && !fstr[1]) || !fstr[0]) | 5726 | if (((fstr[0] == ' ') && !fstr[1]) || !fstr[0]) |
@@ -5708,6 +5967,111 @@ evas_textblock_cursor_format_prev(Evas_Textblock_Cursor *cur) | |||
5708 | return EINA_FALSE; | 5967 | return EINA_FALSE; |
5709 | } | 5968 | } |
5710 | 5969 | ||
5970 | #ifdef HAVE_LINEBREAK | ||
5971 | |||
5972 | /* BREAK_AFTER: true if we can break after the current char. | ||
5973 | * Both macros assume str[i] is not the terminating nul */ | ||
5974 | #define BREAK_AFTER(i) \ | ||
5975 | (breaks[i] == WORDBREAK_BREAK) | ||
5976 | |||
5977 | #else | ||
5978 | |||
5979 | #define BREAK_AFTER(i) \ | ||
5980 | ((!str[i + 1]) || \ | ||
5981 | (_is_white(str[i]) && !_is_white(str[i + 1])) || \ | ||
5982 | (!_is_white(str[i]) && _is_white(str[i + 1]))) | ||
5983 | |||
5984 | #endif | ||
5985 | |||
5986 | EAPI Eina_Bool | ||
5987 | evas_textblock_cursor_word_start(Evas_Textblock_Cursor *cur) | ||
5988 | { | ||
5989 | const Eina_Unicode *text; | ||
5990 | size_t i; | ||
5991 | #ifdef HAVE_LINEBREAK | ||
5992 | char *breaks; | ||
5993 | #endif | ||
5994 | |||
5995 | if (!cur) return EINA_FALSE; | ||
5996 | if (!cur->node) return EINA_FALSE; | ||
5997 | |||
5998 | text = eina_ustrbuf_string_get(cur->node->unicode); | ||
5999 | |||
6000 | #ifdef HAVE_LINEBREAK | ||
6001 | { | ||
6002 | const char *lang = ""; /* FIXME: get lang */ | ||
6003 | size_t len = eina_ustrbuf_length_get(cur->node->unicode); | ||
6004 | breaks = malloc(len); | ||
6005 | set_wordbreaks_utf32((const utf32_t *) text, len, lang, breaks); | ||
6006 | } | ||
6007 | #endif | ||
6008 | |||
6009 | i = cur->pos; | ||
6010 | |||
6011 | /* Skip the first one. This ensures we don't point to the nul, and also | ||
6012 | * we just don't care about it anyway. */ | ||
6013 | if (i > 0) i--; | ||
6014 | |||
6015 | for ( ; i > 0 ; i--) | ||
6016 | { | ||
6017 | if (BREAK_AFTER(i)) | ||
6018 | { | ||
6019 | /* Advance to the current char */ | ||
6020 | i++; | ||
6021 | break; | ||
6022 | } | ||
6023 | } | ||
6024 | |||
6025 | cur->pos = i; | ||
6026 | |||
6027 | #ifdef HAVE_LINEBREAK | ||
6028 | free(breaks); | ||
6029 | #endif | ||
6030 | return EINA_TRUE; | ||
6031 | } | ||
6032 | |||
6033 | EAPI Eina_Bool | ||
6034 | evas_textblock_cursor_word_end(Evas_Textblock_Cursor *cur) | ||
6035 | { | ||
6036 | const Eina_Unicode *text; | ||
6037 | size_t i; | ||
6038 | #ifdef HAVE_LINEBREAK | ||
6039 | char *breaks; | ||
6040 | #endif | ||
6041 | |||
6042 | if (!cur) return EINA_FALSE; | ||
6043 | if (!cur->node) return EINA_FALSE; | ||
6044 | |||
6045 | text = eina_ustrbuf_string_get(cur->node->unicode); | ||
6046 | |||
6047 | #ifdef HAVE_LINEBREAK | ||
6048 | { | ||
6049 | const char *lang = ""; /* FIXME: get lang */ | ||
6050 | size_t len = eina_ustrbuf_length_get(cur->node->unicode); | ||
6051 | breaks = malloc(len); | ||
6052 | set_wordbreaks_utf32((const utf32_t *) text, len, lang, breaks); | ||
6053 | } | ||
6054 | #endif | ||
6055 | |||
6056 | i = cur->pos; | ||
6057 | |||
6058 | for ( ; text[i] ; i++) | ||
6059 | { | ||
6060 | if (BREAK_AFTER(i)) | ||
6061 | { | ||
6062 | /* This is the one to break after. */ | ||
6063 | break; | ||
6064 | } | ||
6065 | } | ||
6066 | |||
6067 | cur->pos = i; | ||
6068 | |||
6069 | #ifdef HAVE_LINEBREAK | ||
6070 | free(breaks); | ||
6071 | #endif | ||
6072 | return EINA_TRUE;; | ||
6073 | } | ||
6074 | |||
5711 | EAPI Eina_Bool | 6075 | EAPI Eina_Bool |
5712 | evas_textblock_cursor_char_next(Evas_Textblock_Cursor *cur) | 6076 | evas_textblock_cursor_char_next(Evas_Textblock_Cursor *cur) |
5713 | { | 6077 | { |
@@ -5887,10 +6251,9 @@ _evas_textblock_format_is_visible(Evas_Object_Textblock_Node_Format *fnode, | |||
5887 | fnode->anchor = ANCHOR_NONE; | 6251 | fnode->anchor = ANCHOR_NONE; |
5888 | if (!s) return; | 6252 | if (!s) return; |
5889 | 6253 | ||
5890 | if (s[0] == '+' || s[0] == '-') | 6254 | if (!fnode->own_closer) |
5891 | { | 6255 | { |
5892 | is_opener = (s[0] == '+'); | 6256 | is_opener = fnode->opener; |
5893 | s++; | ||
5894 | fnode->format_change = EINA_TRUE; | 6257 | fnode->format_change = EINA_TRUE; |
5895 | } | 6258 | } |
5896 | 6259 | ||
@@ -5902,6 +6265,8 @@ _evas_textblock_format_is_visible(Evas_Object_Textblock_Node_Format *fnode, | |||
5902 | * closing */ | 6265 | * closing */ |
5903 | if ((!strncmp(item, "\n", itlen) || !strncmp(item, "\\n", itlen)) || | 6266 | if ((!strncmp(item, "\n", itlen) || !strncmp(item, "\\n", itlen)) || |
5904 | (!strncmp(item, "\t", itlen) || !strncmp(item, "\\t", itlen)) || | 6267 | (!strncmp(item, "\t", itlen) || !strncmp(item, "\\t", itlen)) || |
6268 | (!strncmp(item, "br", itlen) && (itlen >= 2)) || | ||
6269 | (!strncmp(item, "tab", itlen) && (itlen >= 3)) || | ||
5905 | (!strncmp(item, "ps", itlen) && (itlen >= 2)) || | 6270 | (!strncmp(item, "ps", itlen) && (itlen >= 2)) || |
5906 | (!strncmp(item, "item", itlen) && (itlen >= 4) && is_opener)) | 6271 | (!strncmp(item, "item", itlen) && (itlen >= 4) && is_opener)) |
5907 | { | 6272 | { |
@@ -5986,19 +6351,17 @@ _evas_textblock_node_format_remove_matching(Evas_Object_Textblock *o, | |||
5986 | } | 6351 | } |
5987 | 6352 | ||
5988 | 6353 | ||
5989 | if (fstr && (*fstr == '+')) | 6354 | if (fmt->opener && !fmt->own_closer) |
5990 | { | 6355 | { |
5991 | formats = eina_list_prepend(formats, fmt); | 6356 | formats = eina_list_prepend(formats, fmt); |
5992 | } | 6357 | } |
5993 | else if (fstr && (*fstr == '-')) | 6358 | else if (fstr && !fmt->opener) |
5994 | { | 6359 | { |
5995 | Evas_Object_Textblock_Node_Format *fnode; | 6360 | Evas_Object_Textblock_Node_Format *fnode; |
5996 | size_t fstr_len; | 6361 | size_t fstr_len; |
5997 | /* Skip the '-' */ | ||
5998 | fstr++; | ||
5999 | fstr_len = strlen(fstr); | 6362 | fstr_len = strlen(fstr); |
6000 | /* Generic popper, just pop */ | 6363 | /* Generic popper, just pop (if there's anything to pop). */ |
6001 | if (((fstr[0] == ' ') && !fstr[1]) || !fstr[0]) | 6364 | if (formats && (((fstr[0] == ' ') && !fstr[1]) || !fstr[0])) |
6002 | { | 6365 | { |
6003 | fnode = eina_list_data_get(formats); | 6366 | fnode = eina_list_data_get(formats); |
6004 | formats = eina_list_remove_list(formats, formats); | 6367 | formats = eina_list_remove_list(formats, formats); |
@@ -6855,6 +7218,7 @@ _evas_textblock_node_format_new(Evas_Object_Textblock *o, const char *_format) | |||
6855 | { | 7218 | { |
6856 | Evas_Object_Textblock_Node_Format *n; | 7219 | Evas_Object_Textblock_Node_Format *n; |
6857 | const char *format = _format; | 7220 | const char *format = _format; |
7221 | const char *pre_stripped_format = NULL; | ||
6858 | 7222 | ||
6859 | n = calloc(1, sizeof(Evas_Object_Textblock_Node_Format)); | 7223 | n = calloc(1, sizeof(Evas_Object_Textblock_Node_Format)); |
6860 | /* Create orig_format and format */ | 7224 | /* Create orig_format and format */ |
@@ -6866,62 +7230,80 @@ _evas_textblock_node_format_new(Evas_Object_Textblock *o, const char *_format) | |||
6866 | 7230 | ||
6867 | format++; /* Advance after '<' */ | 7231 | format++; /* Advance after '<' */ |
6868 | format_len = strlen(format); | 7232 | format_len = strlen(format); |
6869 | if (format[format_len - 1] == '>') | 7233 | if ((format_len > 0) && format[format_len - 1] == '>') |
6870 | format_len--; /* We don't care about '>' */ | 7234 | { |
7235 | format_len--; /* We don't care about '>' */ | ||
7236 | /* Check if it closes itself. Skip the </> case. */ | ||
7237 | if ((format_len > 1) && format[format_len - 1] == '/') | ||
7238 | { | ||
7239 | format_len--; /* We don't care about '/' */ | ||
7240 | n->own_closer = EINA_TRUE; | ||
7241 | } | ||
7242 | } | ||
6871 | 7243 | ||
6872 | match = _style_match_tag(o->style, format, format_len, &replace_len); | 7244 | match = _style_match_tag(o->style, format, format_len, &replace_len); |
6873 | if (match) | 7245 | if (match) |
6874 | { | 7246 | { |
6875 | if ((match[0] == '+') || (match[0] == '-')) | 7247 | if (match[0] != '-') |
6876 | { | ||
6877 | char *norm_format; | ||
6878 | norm_format = malloc(format_len + 2 + 1); | ||
6879 | memcpy(norm_format, match, 2); | ||
6880 | memcpy(norm_format + 2, format, format_len); | ||
6881 | norm_format[format_len + 2] = '\0'; | ||
6882 | n->orig_format = | ||
6883 | eina_stringshare_add_length(norm_format, format_len + 2); | ||
6884 | free(norm_format); | ||
6885 | } | ||
6886 | else | ||
6887 | { | 7248 | { |
6888 | n->orig_format = | 7249 | n->opener = EINA_TRUE; |
6889 | eina_stringshare_add_length(format, format_len); | 7250 | if (match[0] != '+') |
7251 | { | ||
7252 | n->own_closer = EINA_TRUE; | ||
7253 | } | ||
6890 | } | 7254 | } |
6891 | n->format = eina_stringshare_add(match); | 7255 | |
7256 | pre_stripped_format = match; | ||
6892 | } | 7257 | } |
6893 | else | 7258 | else |
6894 | { | 7259 | { |
6895 | char *norm_format; | 7260 | if (format[0] == '/') |
6896 | |||
6897 | norm_format = malloc(format_len + 2 + 1); | ||
6898 | if (norm_format) | ||
6899 | { | 7261 | { |
6900 | if (format[0] == '/') | 7262 | format++; |
6901 | { | 7263 | format_len--; |
6902 | memcpy(norm_format, "- ", 2); | 7264 | } |
6903 | memcpy(norm_format + 2, format + 1, format_len - 1); | 7265 | else |
6904 | norm_format[format_len + 2 - 1] = '\0'; | 7266 | { |
6905 | } | 7267 | n->opener = EINA_TRUE; |
6906 | else | ||
6907 | { | ||
6908 | memcpy(norm_format, "+ ", 2); | ||
6909 | memcpy(norm_format + 2, format, format_len); | ||
6910 | norm_format[format_len + 2] = '\0'; | ||
6911 | } | ||
6912 | n->orig_format = eina_stringshare_add(norm_format); | ||
6913 | free(norm_format); | ||
6914 | } | 7268 | } |
6915 | n->format = eina_stringshare_ref(n->orig_format); | ||
6916 | } | 7269 | } |
7270 | |||
7271 | n->orig_format = eina_stringshare_add_length(format, format_len); | ||
7272 | |||
7273 | if (!pre_stripped_format) | ||
7274 | pre_stripped_format = n->orig_format; | ||
6917 | } | 7275 | } |
6918 | /* Just use as is, it's a special format. */ | 7276 | /* Just use as is, it's a special format. */ |
6919 | else | 7277 | else |
6920 | { | 7278 | { |
6921 | n->orig_format = eina_stringshare_add(format); | 7279 | const char *tmp = format; |
6922 | n->format = eina_stringshare_ref(n->orig_format); | 7280 | if (format[0] != '-') |
7281 | { | ||
7282 | n->opener = EINA_TRUE; | ||
7283 | if (format[0] != '+') | ||
7284 | { | ||
7285 | n->own_closer = EINA_TRUE; | ||
7286 | } | ||
7287 | } | ||
7288 | if ((*tmp == '+') || (*tmp == '-')) | ||
7289 | { | ||
7290 | tmp++; | ||
7291 | while (*tmp == ' ') tmp++; | ||
7292 | } | ||
7293 | n->orig_format = eina_stringshare_add(tmp); | ||
7294 | pre_stripped_format = n->orig_format; | ||
6923 | } | 7295 | } |
6924 | 7296 | ||
7297 | /* Strip format */ | ||
7298 | { | ||
7299 | const char *tmp = pre_stripped_format; | ||
7300 | if ((*tmp == '+') || (*tmp == '-')) | ||
7301 | { | ||
7302 | tmp++; | ||
7303 | while (*tmp == ' ') tmp++; | ||
7304 | } | ||
7305 | n->format = eina_stringshare_add(tmp); | ||
7306 | } | ||
6925 | format = n->format; | 7307 | format = n->format; |
6926 | 7308 | ||
6927 | _evas_textblock_format_is_visible(n, format); | 7309 | _evas_textblock_format_is_visible(n, format); |
@@ -7051,11 +7433,11 @@ evas_textblock_cursor_format_append(Evas_Textblock_Cursor *cur, const char *form | |||
7051 | if (_IS_PARAGRAPH_SEPARATOR(o, format)) | 7433 | if (_IS_PARAGRAPH_SEPARATOR(o, format)) |
7052 | insert_char = _PARAGRAPH_SEPARATOR; | 7434 | insert_char = _PARAGRAPH_SEPARATOR; |
7053 | else if (_IS_LINE_SEPARATOR(format)) | 7435 | else if (_IS_LINE_SEPARATOR(format)) |
7054 | insert_char = '\n'; | 7436 | insert_char = _NEWLINE; |
7055 | else if (_IS_TAB(format)) | 7437 | else if (_IS_TAB(format)) |
7056 | insert_char = '\t'; | 7438 | insert_char = _TAB; |
7057 | else | 7439 | else |
7058 | insert_char = EVAS_TEXTBLOCK_REPLACEMENT_CHAR; | 7440 | insert_char = _REPLACEMENT_CHAR; |
7059 | 7441 | ||
7060 | eina_ustrbuf_insert_char(cur->node->unicode, insert_char, cur->pos); | 7442 | eina_ustrbuf_insert_char(cur->node->unicode, insert_char, cur->pos); |
7061 | 7443 | ||
@@ -7142,7 +7524,7 @@ evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur) | |||
7142 | should_merge = EINA_TRUE; | 7524 | should_merge = EINA_TRUE; |
7143 | } | 7525 | } |
7144 | /* If a singnular, mark as invisible, so we'll delete it. */ | 7526 | /* If a singnular, mark as invisible, so we'll delete it. */ |
7145 | if (!format || ((*format != '+') && (*format != '-'))) | 7527 | if (!format || last_fmt->own_closer) |
7146 | { | 7528 | { |
7147 | last_fmt->visible = EINA_FALSE; | 7529 | last_fmt->visible = EINA_FALSE; |
7148 | } | 7530 | } |
@@ -7271,60 +7653,40 @@ evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_C | |||
7271 | EAPI char * | 7653 | EAPI char * |
7272 | evas_textblock_cursor_content_get(const Evas_Textblock_Cursor *cur) | 7654 | evas_textblock_cursor_content_get(const Evas_Textblock_Cursor *cur) |
7273 | { | 7655 | { |
7274 | const Eina_Unicode *ustr; | ||
7275 | Eina_Unicode buf[2]; | ||
7276 | char *s; | ||
7277 | if (!cur || !cur->node) return NULL; | 7656 | if (!cur || !cur->node) return NULL; |
7278 | if (evas_textblock_cursor_format_is_visible_get(cur)) | 7657 | if (evas_textblock_cursor_format_is_visible_get(cur)) |
7279 | { | 7658 | { |
7280 | size_t len; | 7659 | Eina_Strbuf *buf; |
7281 | const char *fstr; | 7660 | Evas_Object_Textblock_Node_Format *fnode; |
7282 | char *ret; | 7661 | char *ret; |
7283 | int pop = 0; | 7662 | fnode = _evas_textblock_node_visible_at_pos_get( |
7284 | fstr = evas_textblock_node_format_text_get( | 7663 | evas_textblock_cursor_format_get(cur)); |
7285 | _evas_textblock_node_visible_at_pos_get( | ||
7286 | evas_textblock_cursor_format_get(cur))); | ||
7287 | |||
7288 | if (!fstr) | ||
7289 | return NULL; | ||
7290 | 7664 | ||
7291 | if (*fstr == '-') pop = 1; | 7665 | buf = eina_strbuf_new(); |
7292 | while ((*fstr == ' ') || (*fstr == '+') || (*fstr == '-')) fstr++; | 7666 | _markup_get_format_append(buf, fnode); |
7293 | len = strlen(fstr); | 7667 | ret = eina_strbuf_string_steal(buf); |
7294 | 7668 | eina_strbuf_free(buf); | |
7295 | { | ||
7296 | char *tmp; | ||
7297 | if (pop) | ||
7298 | { | ||
7299 | ret = tmp = malloc(len + 3 + 1); /* </> and the null */ | ||
7300 | memcpy(tmp, "</", 2); | ||
7301 | tmp += 2; | ||
7302 | } | ||
7303 | else | ||
7304 | { | ||
7305 | ret = tmp = malloc(len + 2 + 1); /* <> and the null */ | ||
7306 | *tmp = '<'; | ||
7307 | tmp++; | ||
7308 | } | ||
7309 | memcpy(tmp, fstr, len); | ||
7310 | memcpy(tmp + len, ">", 2); /* Including the null */ | ||
7311 | } | ||
7312 | 7669 | ||
7313 | return ret; | 7670 | return ret; |
7314 | } | 7671 | } |
7672 | else | ||
7673 | { | ||
7674 | const Eina_Unicode *ustr; | ||
7675 | Eina_Unicode buf[2]; | ||
7676 | char *s; | ||
7315 | 7677 | ||
7316 | ustr = eina_ustrbuf_string_get(cur->node->unicode); | 7678 | ustr = eina_ustrbuf_string_get(cur->node->unicode); |
7317 | buf[0] = ustr[cur->pos]; | 7679 | buf[0] = ustr[cur->pos]; |
7318 | buf[1] = 0; | 7680 | buf[1] = 0; |
7319 | s = eina_unicode_unicode_to_utf8(buf, NULL); | 7681 | s = eina_unicode_unicode_to_utf8(buf, NULL); |
7320 | 7682 | ||
7321 | return s; | 7683 | return s; |
7684 | } | ||
7322 | } | 7685 | } |
7323 | 7686 | ||
7324 | static char * | 7687 | static char * |
7325 | _evas_textblock_cursor_range_text_markup_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *_cur2) | 7688 | _evas_textblock_cursor_range_text_markup_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *_cur2) |
7326 | { | 7689 | { |
7327 | Evas_Object_Textblock *o; | ||
7328 | Evas_Object_Textblock_Node_Text *tnode; | 7690 | Evas_Object_Textblock_Node_Text *tnode; |
7329 | Eina_Strbuf *buf; | 7691 | Eina_Strbuf *buf; |
7330 | Evas_Textblock_Cursor *cur2; | 7692 | Evas_Textblock_Cursor *cur2; |
@@ -7333,7 +7695,6 @@ _evas_textblock_cursor_range_text_markup_get(const Evas_Textblock_Cursor *cur1, | |||
7333 | if (!cur1 || !cur1->node) return NULL; | 7695 | if (!cur1 || !cur1->node) return NULL; |
7334 | if (!_cur2 || !_cur2->node) return NULL; | 7696 | if (!_cur2 || !_cur2->node) return NULL; |
7335 | if (cur1->obj != _cur2->obj) return NULL; | 7697 | if (cur1->obj != _cur2->obj) return NULL; |
7336 | o = (Evas_Object_Textblock *)(cur1->obj->object_data); | ||
7337 | if (evas_textblock_cursor_compare(cur1, _cur2) > 0) | 7698 | if (evas_textblock_cursor_compare(cur1, _cur2) > 0) |
7338 | { | 7699 | { |
7339 | const Evas_Textblock_Cursor *tc; | 7700 | const Evas_Textblock_Cursor *tc; |
@@ -7401,7 +7762,7 @@ _evas_textblock_cursor_range_text_markup_get(const Evas_Textblock_Cursor *cur1, | |||
7401 | tmp_ch = text[off]; | 7762 | tmp_ch = text[off]; |
7402 | text[off] = 0; /* Null terminate the part of the string */ | 7763 | text[off] = 0; /* Null terminate the part of the string */ |
7403 | _markup_get_text_append(buf, text); | 7764 | _markup_get_text_append(buf, text); |
7404 | _markup_get_format_append(o, buf, fnode); | 7765 | _markup_get_format_append(buf, fnode); |
7405 | text[off] = tmp_ch; /* Restore the char */ | 7766 | text[off] = tmp_ch; /* Restore the char */ |
7406 | text += off; | 7767 | text += off; |
7407 | if (fnode->visible) | 7768 | if (fnode->visible) |
@@ -7623,8 +7984,27 @@ evas_textblock_cursor_format_get(const Evas_Textblock_Cursor *cur) | |||
7623 | EAPI const char * | 7984 | EAPI const char * |
7624 | evas_textblock_node_format_text_get(const Evas_Object_Textblock_Node_Format *fmt) | 7985 | evas_textblock_node_format_text_get(const Evas_Object_Textblock_Node_Format *fmt) |
7625 | { | 7986 | { |
7987 | static char *ret = NULL; | ||
7988 | char *tmp; | ||
7989 | |||
7626 | if (!fmt) return NULL; | 7990 | if (!fmt) return NULL; |
7627 | return fmt->orig_format; | 7991 | |
7992 | if (ret) free(ret); | ||
7993 | ret = malloc(strlen(fmt->orig_format) + 2 + 1); | ||
7994 | tmp = ret; | ||
7995 | |||
7996 | if (fmt->opener && !fmt->own_closer) | ||
7997 | { | ||
7998 | *(tmp++) = '+'; | ||
7999 | *(tmp++) = ' '; | ||
8000 | } | ||
8001 | else if (!fmt->opener) | ||
8002 | { | ||
8003 | *(tmp++) = '-'; | ||
8004 | *(tmp++) = ' '; | ||
8005 | } | ||
8006 | strcpy(tmp, fmt->orig_format); | ||
8007 | return ret; | ||
7628 | } | 8008 | } |
7629 | 8009 | ||
7630 | EAPI void | 8010 | EAPI void |
@@ -7673,7 +8053,9 @@ evas_textblock_cursor_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord | |||
7673 | * the position of the previous */ | 8053 | * the position of the previous */ |
7674 | if ((cur->pos > 0) && !_evas_textblock_cursor_is_at_the_end(cur)) | 8054 | if ((cur->pos > 0) && !_evas_textblock_cursor_is_at_the_end(cur)) |
7675 | { | 8055 | { |
8056 | #ifdef BIDI_SUPPORT | ||
7676 | Eina_Bool before_char = EINA_FALSE; | 8057 | Eina_Bool before_char = EINA_FALSE; |
8058 | #endif | ||
7677 | cur2.obj = cur->obj; | 8059 | cur2.obj = cur->obj; |
7678 | evas_textblock_cursor_copy(cur, &cur2); | 8060 | evas_textblock_cursor_copy(cur, &cur2); |
7679 | evas_textblock_cursor_char_prev(&cur2); | 8061 | evas_textblock_cursor_char_prev(&cur2); |
@@ -7683,12 +8065,16 @@ evas_textblock_cursor_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord | |||
7683 | if (!fmt || !_IS_LINE_SEPARATOR(fmt->format)) | 8065 | if (!fmt || !_IS_LINE_SEPARATOR(fmt->format)) |
7684 | { | 8066 | { |
7685 | dir_cur = &cur2; | 8067 | dir_cur = &cur2; |
8068 | #ifdef BIDI_SUPPORT | ||
7686 | before_char = EINA_FALSE; | 8069 | before_char = EINA_FALSE; |
8070 | #endif | ||
7687 | } | 8071 | } |
8072 | #ifdef BIDI_SUPPORT | ||
7688 | else | 8073 | else |
7689 | { | 8074 | { |
7690 | before_char = EINA_TRUE; | 8075 | before_char = EINA_TRUE; |
7691 | } | 8076 | } |
8077 | #endif | ||
7692 | ret = evas_textblock_cursor_pen_geometry_get( | 8078 | ret = evas_textblock_cursor_pen_geometry_get( |
7693 | dir_cur, &x, &y, &w, &h); | 8079 | dir_cur, &x, &y, &w, &h); |
7694 | #ifdef BIDI_SUPPORT | 8080 | #ifdef BIDI_SUPPORT |
@@ -8788,6 +9174,7 @@ evas_object_textblock_init(Evas_Object *obj) | |||
8788 | { | 9174 | { |
8789 | linebreak_init = EINA_TRUE; | 9175 | linebreak_init = EINA_TRUE; |
8790 | init_linebreak(); | 9176 | init_linebreak(); |
9177 | init_wordbreak(); | ||
8791 | } | 9178 | } |
8792 | #endif | 9179 | #endif |
8793 | 9180 | ||
diff --git a/libraries/evas/src/lib/canvas/evas_render.c b/libraries/evas/src/lib/canvas/evas_render.c index 0abee97..cdedaec 100644 --- a/libraries/evas/src/lib/canvas/evas_render.c +++ b/libraries/evas/src/lib/canvas/evas_render.c | |||
@@ -1139,7 +1139,7 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, | |||
1139 | } | 1139 | } |
1140 | } | 1140 | } |
1141 | } | 1141 | } |
1142 | if (surface == e->engine.data.output) | 1142 | // if (surface == e->engine.data.output) |
1143 | e->engine.func->context_clip_clip(e->engine.data.output, | 1143 | e->engine.func->context_clip_clip(e->engine.data.output, |
1144 | e->engine.data.context, | 1144 | e->engine.data.context, |
1145 | ecx, ecy, ecw, ech); | 1145 | ecx, ecy, ecw, ech); |
@@ -1360,6 +1360,8 @@ evas_render_updates_internal(Evas *e, | |||
1360 | 1360 | ||
1361 | RD("[--- RENDER EVAS (size: %ix%i)\n", e->viewport.w, e->viewport.h); | 1361 | RD("[--- RENDER EVAS (size: %ix%i)\n", e->viewport.w, e->viewport.h); |
1362 | 1362 | ||
1363 | evas_event_callback_call(e, EVAS_CALLBACK_RENDER_PRE, NULL); | ||
1364 | |||
1363 | /* Check if the modified object mean recalculating every thing */ | 1365 | /* Check if the modified object mean recalculating every thing */ |
1364 | if (!e->invalidate) | 1366 | if (!e->invalidate) |
1365 | _evas_render_check_pending_objects(&e->pending_objects, e); | 1367 | _evas_render_check_pending_objects(&e->pending_objects, e); |
@@ -1399,6 +1401,7 @@ evas_render_updates_internal(Evas *e, | |||
1399 | _evas_render_prev_cur_clip_cache_add(e, obj); | 1401 | _evas_render_prev_cur_clip_cache_add(e, obj); |
1400 | } | 1402 | } |
1401 | eina_array_clean(&e->restack_objects); | 1403 | eina_array_clean(&e->restack_objects); |
1404 | |||
1402 | /* phase 3. add exposes */ | 1405 | /* phase 3. add exposes */ |
1403 | EINA_LIST_FREE(e->damages, r) | 1406 | EINA_LIST_FREE(e->damages, r) |
1404 | { | 1407 | { |
@@ -1406,7 +1409,20 @@ evas_render_updates_internal(Evas *e, | |||
1406 | r->x, r->y, r->w, r->h); | 1409 | r->x, r->y, r->w, r->h); |
1407 | eina_rectangle_free(r); | 1410 | eina_rectangle_free(r); |
1408 | } | 1411 | } |
1409 | /* phase 4. output & viewport changes */ | 1412 | |
1413 | /* phase 4. framespace, output & viewport changes */ | ||
1414 | if (e->framespace.changed) | ||
1415 | { | ||
1416 | int fx, fy, fw, fh; | ||
1417 | |||
1418 | fx = e->viewport.x - e->framespace.x; | ||
1419 | fy = e->viewport.y - e->framespace.y; | ||
1420 | fw = e->viewport.w + e->framespace.w; | ||
1421 | fh = e->viewport.h + e->framespace.h; | ||
1422 | e->engine.func->output_redraws_rect_add(e->engine.data.output, | ||
1423 | fx, fy, fw, fh); | ||
1424 | } | ||
1425 | |||
1410 | if (e->viewport.changed) | 1426 | if (e->viewport.changed) |
1411 | { | 1427 | { |
1412 | e->engine.func->output_redraws_rect_add(e->engine.data.output, | 1428 | e->engine.func->output_redraws_rect_add(e->engine.data.output, |
@@ -1431,6 +1447,7 @@ evas_render_updates_internal(Evas *e, | |||
1431 | 0, 0, | 1447 | 0, 0, |
1432 | e->output.w, e->output.h); | 1448 | e->output.w, e->output.h); |
1433 | } | 1449 | } |
1450 | |||
1434 | /* phase 5. add obscures */ | 1451 | /* phase 5. add obscures */ |
1435 | EINA_LIST_FOREACH(e->obscures, ll, r) | 1452 | EINA_LIST_FOREACH(e->obscures, ll, r) |
1436 | { | 1453 | { |
@@ -1562,13 +1579,6 @@ evas_render_updates_internal(Evas *e, | |||
1562 | else | 1579 | else |
1563 | e->engine.func->context_mask_unset(e->engine.data.output, | 1580 | e->engine.func->context_mask_unset(e->engine.data.output, |
1564 | e->engine.data.context); | 1581 | e->engine.data.context); |
1565 | if (obj->cur.clipper) | ||
1566 | e->engine.func->context_clip_set(e->engine.data.output, | ||
1567 | e->engine.data.context, | ||
1568 | x, y, w, h); | ||
1569 | else | ||
1570 | e->engine.func->context_clip_unset(e->engine.data.output, | ||
1571 | e->engine.data.context); | ||
1572 | #if 1 /* FIXME: this can slow things down... figure out optimum... coverage */ | 1582 | #if 1 /* FIXME: this can slow things down... figure out optimum... coverage */ |
1573 | for (j = offset; j < e->temporary_objects.count; ++j) | 1583 | for (j = offset; j < e->temporary_objects.count; ++j) |
1574 | { | 1584 | { |
@@ -1671,6 +1681,7 @@ evas_render_updates_internal(Evas *e, | |||
1671 | e->changed = 0; | 1681 | e->changed = 0; |
1672 | e->viewport.changed = 0; | 1682 | e->viewport.changed = 0; |
1673 | e->output.changed = 0; | 1683 | e->output.changed = 0; |
1684 | e->framespace.changed = 0; | ||
1674 | e->invalidate = 0; | 1685 | e->invalidate = 0; |
1675 | 1686 | ||
1676 | /* If their are some object to restack or some object to delete, | 1687 | /* If their are some object to restack or some object to delete, |
@@ -1686,6 +1697,8 @@ evas_render_updates_internal(Evas *e, | |||
1686 | } | 1697 | } |
1687 | 1698 | ||
1688 | evas_module_clean(); | 1699 | evas_module_clean(); |
1700 | |||
1701 | evas_event_callback_call(e, EVAS_CALLBACK_RENDER_POST, NULL); | ||
1689 | 1702 | ||
1690 | RD("---]\n"); | 1703 | RD("---]\n"); |
1691 | 1704 | ||