diff options
author | ChunEon Park <hermet@hermet.pe.kr> | 2012-10-23 08:44:11 +0000 |
---|---|---|
committer | ChunEon Park <hermet@hermet.pe.kr> | 2012-10-23 08:44:11 +0000 |
commit | d115ff8e3b8efe97d4b0db17a801e301acd5cf9c (patch) | |
tree | c044bf321e043f82fcbb96e68d8ef2262b9f5a6d | |
parent | 7f71bab887be46ee71cdc6e6312c255bfbe997d2 (diff) |
evas/proxy - added 2 more apis. not enough yet. will fix them soon.
evas_object_image_source_events_set/get
SVN revision: 78361
-rw-r--r-- | legacy/evas/src/lib/Evas.h | 62 | ||||
-rw-r--r-- | legacy/evas/src/lib/canvas/evas_events.c | 306 | ||||
-rw-r--r-- | legacy/evas/src/lib/canvas/evas_object_image.c | 64 | ||||
-rw-r--r-- | legacy/evas/src/lib/include/evas_private.h | 2 |
4 files changed, 397 insertions, 37 deletions
diff --git a/legacy/evas/src/lib/Evas.h b/legacy/evas/src/lib/Evas.h index 35e50a05a3..46b0ea789f 100644 --- a/legacy/evas/src/lib/Evas.h +++ b/legacy/evas/src/lib/Evas.h | |||
@@ -9160,6 +9160,44 @@ EAPI void evas_object_image_source_visible_set(Evas_Obj | |||
9160 | EAPI Eina_Bool evas_object_image_source_visible_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); | 9160 | EAPI Eina_Bool evas_object_image_source_visible_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); |
9161 | 9161 | ||
9162 | /** | 9162 | /** |
9163 | * Set whether an Evas object is to source events. | ||
9164 | * | ||
9165 | * @param obj Proxy (image) object. | ||
9166 | * @param source whether @p obj is to pass events (@c EINA_TRUE) or not | ||
9167 | * (@c EINA_FALSE) | ||
9168 | * | ||
9169 | * Set whether an Evas object is to repeat events to source. | ||
9170 | * | ||
9171 | * If @p source is @c EINA_TRUE, it will make events on @p obj to also be | ||
9172 | * repeated for the source object (see evas_object_image_source_set()). Even the | ||
9173 | * @p obj and source geometries are different, the event position will be | ||
9174 | * transformed to the source object's space. | ||
9175 | * | ||
9176 | * If @p source is @c EINA_FALSE, events occurring on @p obj will be | ||
9177 | * processed only on it. | ||
9178 | * | ||
9179 | * @see evas_object_image_source_get() | ||
9180 | * @see evas_object_image_source_visible_set() | ||
9181 | * @see evas_object_source_events_set() | ||
9182 | * @since 1.8 | ||
9183 | */ | ||
9184 | EAPI void evas_object_image_source_events_set(Evas_Object *obj, Eina_Bool source) EINA_ARG_NONNULL(1); | ||
9185 | |||
9186 | /** | ||
9187 | * Determine whether an object is set to source events. | ||
9188 | * | ||
9189 | * @param obj Proxy (image) object. | ||
9190 | * @return source whether @p obj is set to source events (@c EINA_TRUE) or not | ||
9191 | * (@c EINA_FALSE) | ||
9192 | * | ||
9193 | * @see evas_object_image_source_set() | ||
9194 | * @see evas_object_image_source_visible_set() | ||
9195 | * @see evas_object_source_events_set() | ||
9196 | * @since 1.8 | ||
9197 | */ | ||
9198 | EAPI Eina_Bool evas_object_image_source_events_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); | ||
9199 | |||
9200 | /** | ||
9163 | * Check if a file extension may be supported by @ref Evas_Object_Image. | 9201 | * Check if a file extension may be supported by @ref Evas_Object_Image. |
9164 | * | 9202 | * |
9165 | * @param file The file to check | 9203 | * @param file The file to check |
@@ -18047,6 +18085,8 @@ enum | |||
18047 | EVAS_OBJ_IMAGE_SUB_ID_ANIMATED_FRAME_SET, | 18085 | EVAS_OBJ_IMAGE_SUB_ID_ANIMATED_FRAME_SET, |
18048 | EVAS_OBJ_IMAGE_SUB_ID_SOURCE_VISIBLE_SET, | 18086 | EVAS_OBJ_IMAGE_SUB_ID_SOURCE_VISIBLE_SET, |
18049 | EVAS_OBJ_IMAGE_SUB_ID_SOURCE_VISIBLE_GET, | 18087 | EVAS_OBJ_IMAGE_SUB_ID_SOURCE_VISIBLE_GET, |
18088 | EVAS_OBJ_IMAGE_SUB_ID_SOURCE_EVENTS_SET, | ||
18089 | EVAS_OBJ_IMAGE_SUB_ID_SOURCE_EVENTS_GET, | ||
18050 | EVAS_OBJ_IMAGE_SUB_ID_LAST | 18090 | EVAS_OBJ_IMAGE_SUB_ID_LAST |
18051 | }; | 18091 | }; |
18052 | 18092 | ||
@@ -18151,6 +18191,28 @@ enum | |||
18151 | #define evas_obj_image_source_visible_get(visible) EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_VISIBLE_GET), EO_TYPECHECK(Eina_Bool *, visible) | 18191 | #define evas_obj_image_source_visible_get(visible) EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_VISIBLE_GET), EO_TYPECHECK(Eina_Bool *, visible) |
18152 | 18192 | ||
18153 | /** | 18193 | /** |
18194 | * @def evas_obj_image_source_events_set | ||
18195 | * | ||
18196 | * Set events to be repeated to the source object. | ||
18197 | * | ||
18198 | * @param[in] source in | ||
18199 | * | ||
18200 | * @see evas_object_image_source_events_get | ||
18201 | */ | ||
18202 | #define evas_obj_image_source_events_set(source) EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_EVENTS_SET), EO_TYPECHECK(Eina_Bool, source) | ||
18203 | |||
18204 | /** | ||
18205 | * @def evas_obj_image_source_events_get | ||
18206 | * | ||
18207 | * Get the state of the source event. | ||
18208 | * | ||
18209 | * @param[out] source out | ||
18210 | * | ||
18211 | * @see evas_obj_image_source_event_set | ||
18212 | */ | ||
18213 | #define evas_obj_image_source_events_get(source) EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_EVENTS_GET), EO_TYPECHECK(Eina_Bool *, source) | ||
18214 | |||
18215 | /** | ||
18154 | * @def evas_obj_image_border_set | 18216 | * @def evas_obj_image_border_set |
18155 | * @since 1.8 | 18217 | * @since 1.8 |
18156 | * | 18218 | * |
diff --git a/legacy/evas/src/lib/canvas/evas_events.c b/legacy/evas/src/lib/canvas/evas_events.c index a41f5e3815..c143e08a0d 100644 --- a/legacy/evas/src/lib/canvas/evas_events.c +++ b/legacy/evas/src/lib/canvas/evas_events.c | |||
@@ -4,7 +4,7 @@ | |||
4 | static Eina_List * | 4 | static Eina_List * |
5 | _evas_event_object_list_in_get(Evas *eo_e, Eina_List *in, | 5 | _evas_event_object_list_in_get(Evas *eo_e, Eina_List *in, |
6 | const Eina_Inlist *list, Evas_Object *stop, | 6 | const Eina_Inlist *list, Evas_Object *stop, |
7 | int x, int y, int *no_rep); | 7 | int x, int y, int *no_rep, Eina_Bool source); |
8 | 8 | ||
9 | static void | 9 | static void |
10 | _evas_event_havemap_adjust(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Coord *x, Evas_Coord *y, Eina_Bool mouse_grabbed) | 10 | _evas_event_havemap_adjust(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Coord *x, Evas_Coord *y, Eina_Bool mouse_grabbed) |
@@ -42,7 +42,7 @@ _evas_event_framespace_adjust(Evas_Object *eo_obj, Evas_Coord *x, Evas_Coord *y) | |||
42 | static Eina_List * | 42 | static Eina_List * |
43 | _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in, | 43 | _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in, |
44 | const Eina_Inlist *list, Evas_Object *stop, | 44 | const Eina_Inlist *list, Evas_Object *stop, |
45 | int x, int y, int *no_rep) | 45 | int x, int y, int *no_rep, Eina_Bool source) |
46 | { | 46 | { |
47 | Evas_Object *eo_obj; | 47 | Evas_Object *eo_obj; |
48 | Evas_Object_Protected_Data *obj; | 48 | Evas_Object_Protected_Data *obj; |
@@ -59,11 +59,14 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in, | |||
59 | *no_rep = 1; | 59 | *no_rep = 1; |
60 | return in; | 60 | return in; |
61 | } | 61 | } |
62 | if (evas_event_passes_through(eo_obj, obj)) continue; | 62 | if (!source) |
63 | if (evas_object_is_source_invisible(eo_obj, obj)) continue; | 63 | { |
64 | if ((obj->cur.visible) && (obj->delete_me == 0) && | 64 | if (evas_event_passes_through(eo_obj, obj)) continue; |
65 | (!obj->clip.clipees) && | 65 | if (evas_object_is_source_invisible(eo_obj, obj)) continue; |
66 | (evas_object_clippers_is_visible(eo_obj, obj))) | 66 | } |
67 | if ((obj->delete_me == 0) && | ||
68 | ((source) || ((obj->cur.visible) && (!obj->clip.clipees) && | ||
69 | evas_object_clippers_is_visible(eo_obj, obj)))) | ||
67 | { | 70 | { |
68 | if (obj->is_smart) | 71 | if (obj->is_smart) |
69 | { | 72 | { |
@@ -89,7 +92,7 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in, | |||
89 | stop, | 92 | stop, |
90 | obj->cur.geometry.x + obj->cur.map->mx, | 93 | obj->cur.geometry.x + obj->cur.map->mx, |
91 | obj->cur.geometry.y + obj->cur.map->my, | 94 | obj->cur.geometry.y + obj->cur.map->my, |
92 | &norep); | 95 | &norep, source); |
93 | } | 96 | } |
94 | } | 97 | } |
95 | } | 98 | } |
@@ -108,7 +111,7 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in, | |||
108 | obj->cur.geometry.y + obj->cur.geometry.h >= y)) | 111 | obj->cur.geometry.y + obj->cur.geometry.h >= y)) |
109 | in = _evas_event_object_list_in_get | 112 | in = _evas_event_object_list_in_get |
110 | (eo_e, in, evas_object_smart_members_get_direct(eo_obj), | 113 | (eo_e, in, evas_object_smart_members_get_direct(eo_obj), |
111 | stop, x, y, &norep); | 114 | stop, x, y, &norep, source); |
112 | } | 115 | } |
113 | if (norep) | 116 | if (norep) |
114 | { | 117 | { |
@@ -154,14 +157,61 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in, | |||
154 | return in; | 157 | return in; |
155 | } | 158 | } |
156 | 159 | ||
160 | static void | ||
161 | _evas_object_source_event(Evas_Object *eo_obj, Evas *eo_e, Evas_Callback_Type type, void *ev, int event_id) | ||
162 | { | ||
163 | Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); | ||
164 | Evas_Object *src_eo = _evas_object_image_source_get(eo_obj); | ||
165 | Evas_Object_Protected_Data *src = eo_data_get(src_eo, | ||
166 | EVAS_OBJ_CLASS); | ||
167 | Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS); | ||
168 | //FIXME: consider coord transformation for map. | ||
169 | Evas_Coord w1 = obj->cur.geometry.w; | ||
170 | Evas_Coord h1 = obj->cur.geometry.h; | ||
171 | Evas_Coord w2 = src->cur.geometry.w; | ||
172 | Evas_Coord h2 = src->cur.geometry.h; | ||
173 | Evas_Coord tx = e->pointer.x - obj->cur.geometry.x; | ||
174 | Evas_Coord ty = e->pointer.y - obj->cur.geometry.y; | ||
175 | if (w1 != w2) | ||
176 | tx = (Evas_Coord) ((float)tx * ((float)w2 / (float)w1)); | ||
177 | if (h1 != h2) | ||
178 | ty = (Evas_Coord) ((float)ty * ((float)w2 / (float)w1)); | ||
179 | Evas_Coord x = src->cur.geometry.x + tx; | ||
180 | Evas_Coord y = src->cur.geometry.y + ty; | ||
181 | if (src->is_smart) | ||
182 | { | ||
183 | Eina_List *in = NULL, *l = NULL; | ||
184 | Evas_Object *child_eo; | ||
185 | Evas_Object_Protected_Data *child; | ||
186 | int no_rep = 0; | ||
187 | //Optimize Here: Keep this list in proxy image for up and move | ||
188 | in = _evas_event_object_list_raw_in_get(eo_e, in, | ||
189 | evas_object_smart_members_get_direct(src_eo), NULL, x, y, &no_rep, EINA_TRUE); | ||
190 | EINA_LIST_FOREACH(in, l, child_eo) | ||
191 | { | ||
192 | if (obj->delete_me || src->delete_me) return; | ||
193 | child = eo_data_get(child_eo, EVAS_OBJ_CLASS); | ||
194 | if (child->delete_me) continue; | ||
195 | //FIXME: trasform the ev coords in src space also. | ||
196 | evas_object_event_callback_call(child_eo, child, | ||
197 | type, | ||
198 | ev, | ||
199 | event_id); | ||
200 | } | ||
201 | eina_list_free(in); | ||
202 | } | ||
203 | else | ||
204 | evas_object_event_callback_call(src_eo, src, type, ev, event_id); | ||
205 | } | ||
206 | |||
157 | static Eina_List * | 207 | static Eina_List * |
158 | _evas_event_object_list_in_get(Evas *eo_e, Eina_List *in, | 208 | _evas_event_object_list_in_get(Evas *eo_e, Eina_List *in, |
159 | const Eina_Inlist *list, Evas_Object *stop, | 209 | const Eina_Inlist *list, Evas_Object *stop, |
160 | int x, int y, int *no_rep) | 210 | int x, int y, int *no_rep, Eina_Bool source) |
161 | { | 211 | { |
162 | if (!list) return NULL; | 212 | if (!list) return NULL; |
163 | return _evas_event_object_list_raw_in_get(eo_e, in, list->last, stop, x, y, | 213 | return _evas_event_object_list_raw_in_get(eo_e, in, list->last, stop, x, y, |
164 | no_rep); | 214 | no_rep, source); |
165 | } | 215 | } |
166 | 216 | ||
167 | Eina_List * | 217 | Eina_List * |
@@ -177,7 +227,7 @@ evas_event_objects_event_list(Evas *eo_e, Evas_Object *stop, int x, int y) | |||
177 | int no_rep = 0; | 227 | int no_rep = 0; |
178 | in = _evas_event_object_list_in_get(eo_e, in, | 228 | in = _evas_event_object_list_in_get(eo_e, in, |
179 | EINA_INLIST_GET(lay->objects), | 229 | EINA_INLIST_GET(lay->objects), |
180 | stop, x, y, &no_rep); | 230 | stop, x, y, &no_rep, EINA_FALSE); |
181 | if (no_rep) return in; | 231 | if (no_rep) return in; |
182 | } | 232 | } |
183 | return in; | 233 | return in; |
@@ -411,7 +461,18 @@ _canvas_event_feed_mouse_down(Eo *eo_e, void *_pd, va_list *list) | |||
411 | _evas_event_havemap_adjust(eo_obj, obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed); | 461 | _evas_event_havemap_adjust(eo_obj, obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed); |
412 | 462 | ||
413 | if (!e->is_frozen) | 463 | if (!e->is_frozen) |
414 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_DOWN, &ev, event_id); | 464 | { |
465 | evas_object_event_callback_call(eo_obj, obj, | ||
466 | EVAS_CALLBACK_MOUSE_DOWN, &ev, | ||
467 | event_id); | ||
468 | //pass event to source | ||
469 | if (obj->proxy.is_proxy) | ||
470 | { | ||
471 | printf("MOUSE DOWN! %d\n", EVAS_CALLBACK_MOUSE_DOWN); | ||
472 | _evas_object_source_event(eo_obj, eo_e, EVAS_CALLBACK_MOUSE_DOWN, | ||
473 | &ev, event_id); | ||
474 | } | ||
475 | } | ||
415 | if (e->delete_me) break; | 476 | if (e->delete_me) break; |
416 | if (obj->pointer_mode == EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN) | 477 | if (obj->pointer_mode == EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN) |
417 | break; | 478 | break; |
@@ -469,7 +530,16 @@ _post_up_handle(Evas *eo_e, unsigned int timestamp, const void *data) | |||
469 | { | 530 | { |
470 | obj->mouse_in = 0; | 531 | obj->mouse_in = 0; |
471 | if (!e->is_frozen) | 532 | if (!e->is_frozen) |
472 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, &ev, event_id); | 533 | { |
534 | evas_object_event_callback_call(eo_obj, obj, | ||
535 | EVAS_CALLBACK_MOUSE_OUT, | ||
536 | &ev, event_id); | ||
537 | //pass event to source | ||
538 | if (obj->proxy.is_proxy) | ||
539 | _evas_object_source_event(eo_obj, eo_e, | ||
540 | EVAS_CALLBACK_MOUSE_OUT, | ||
541 | &ev, event_id); | ||
542 | } | ||
473 | } | 543 | } |
474 | } | 544 | } |
475 | if (e->delete_me) break; | 545 | if (e->delete_me) break; |
@@ -509,7 +579,15 @@ _post_up_handle(Evas *eo_e, unsigned int timestamp, const void *data) | |||
509 | { | 579 | { |
510 | obj_itr->mouse_in = 1; | 580 | obj_itr->mouse_in = 1; |
511 | if (!e->is_frozen) | 581 | if (!e->is_frozen) |
512 | evas_object_event_callback_call(eo_obj_itr, obj_itr, EVAS_CALLBACK_MOUSE_IN, &ev_in, event_id); | 582 | { |
583 | evas_object_event_callback_call(eo_obj_itr, obj_itr, | ||
584 | EVAS_CALLBACK_MOUSE_IN, &ev_in, event_id); | ||
585 | //pass event to source | ||
586 | if (obj_itr->proxy.is_proxy) | ||
587 | _evas_object_source_event(eo_obj_itr, eo_e, | ||
588 | EVAS_CALLBACK_MOUSE_IN, | ||
589 | &ev, event_id); | ||
590 | } | ||
513 | } | 591 | } |
514 | } | 592 | } |
515 | if (e->delete_me) break; | 593 | if (e->delete_me) break; |
@@ -613,7 +691,16 @@ _canvas_event_feed_mouse_up(Eo *eo_e, void *_pd, va_list *list) | |||
613 | { | 691 | { |
614 | if ((!e->is_frozen) && | 692 | if ((!e->is_frozen) && |
615 | (!evas_event_freezes_through(eo_obj, obj))) | 693 | (!evas_event_freezes_through(eo_obj, obj))) |
616 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_UP, &ev, event_id); | 694 | { |
695 | evas_object_event_callback_call(eo_obj, obj, | ||
696 | EVAS_CALLBACK_MOUSE_UP, | ||
697 | &ev, event_id); | ||
698 | //pass event to source | ||
699 | if (obj->proxy.is_proxy) | ||
700 | _evas_object_source_event(eo_obj, eo_e, | ||
701 | EVAS_CALLBACK_MOUSE_UP, | ||
702 | &ev, event_id); | ||
703 | } | ||
617 | } | 704 | } |
618 | if (e->delete_me) break; | 705 | if (e->delete_me) break; |
619 | if (obj->pointer_mode == EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN) | 706 | if (obj->pointer_mode == EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN) |
@@ -730,7 +817,16 @@ _canvas_event_feed_mouse_wheel(Eo *eo_e, void *_pd, va_list *list) | |||
730 | _evas_event_framespace_adjust(eo_obj, &ev.canvas.x, &ev.canvas.y); | 817 | _evas_event_framespace_adjust(eo_obj, &ev.canvas.x, &ev.canvas.y); |
731 | _evas_event_havemap_adjust(eo_obj, obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed); | 818 | _evas_event_havemap_adjust(eo_obj, obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed); |
732 | if ((!e->is_frozen) && !evas_event_freezes_through(eo_obj, obj)) | 819 | if ((!e->is_frozen) && !evas_event_freezes_through(eo_obj, obj)) |
733 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_WHEEL, &ev, event_id); | 820 | { |
821 | evas_object_event_callback_call(eo_obj, obj, | ||
822 | EVAS_CALLBACK_MOUSE_WHEEL, &ev, | ||
823 | event_id); | ||
824 | //pass event to source | ||
825 | if (obj->proxy.is_proxy) | ||
826 | _evas_object_source_event(eo_obj, eo_e, | ||
827 | EVAS_CALLBACK_MOUSE_WHEEL, &ev, | ||
828 | event_id); | ||
829 | } | ||
734 | if (e->delete_me) break; | 830 | if (e->delete_me) break; |
735 | } | 831 | } |
736 | if (copy) copy = eina_list_free(copy); | 832 | if (copy) copy = eina_list_free(copy); |
@@ -832,7 +928,14 @@ _canvas_event_feed_mouse_move(Eo *eo_e, void *_pd, va_list *list) | |||
832 | (!obj->clip.clipees)) | 928 | (!obj->clip.clipees)) |
833 | { | 929 | { |
834 | if ((px != x) || (py != y)) | 930 | if ((px != x) || (py != y)) |
835 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id); | 931 | { |
932 | evas_object_event_callback_call(eo_obj, obj, | ||
933 | EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id); | ||
934 | //pass event to source | ||
935 | if (obj->proxy.is_proxy) | ||
936 | _evas_object_source_event(eo_obj, eo_e, | ||
937 | EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id); | ||
938 | } | ||
836 | } | 939 | } |
837 | else | 940 | else |
838 | outs = eina_list_append(outs, eo_obj); | 941 | outs = eina_list_append(outs, eo_obj); |
@@ -889,7 +992,15 @@ _canvas_event_feed_mouse_move(Eo *eo_e, void *_pd, va_list *list) | |||
889 | if (!obj->delete_me) | 992 | if (!obj->delete_me) |
890 | { | 993 | { |
891 | if (!e->is_frozen) | 994 | if (!e->is_frozen) |
892 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, &ev, event_id); | 995 | { |
996 | evas_object_event_callback_call(eo_obj, | ||
997 | obj, | ||
998 | EVAS_CALLBACK_MOUSE_OUT, &ev, event_id); | ||
999 | //pass event to source | ||
1000 | if (obj->proxy.is_proxy) | ||
1001 | _evas_object_source_event(eo_obj, eo_e, | ||
1002 | EVAS_CALLBACK_MOUSE_OUT, &ev, event_id); | ||
1003 | } | ||
893 | } | 1004 | } |
894 | } | 1005 | } |
895 | } | 1006 | } |
@@ -981,6 +1092,11 @@ _canvas_event_feed_mouse_move(Eo *eo_e, void *_pd, va_list *list) | |||
981 | ev.cur.canvas.y = e->pointer.y; | 1092 | ev.cur.canvas.y = e->pointer.y; |
982 | _evas_event_havemap_adjust(eo_obj, obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed); | 1093 | _evas_event_havemap_adjust(eo_obj, obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed); |
983 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id); | 1094 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id); |
1095 | //pass event to source | ||
1096 | if (obj->proxy.is_proxy) | ||
1097 | _evas_object_source_event(eo_obj, eo_e, | ||
1098 | EVAS_CALLBACK_MOUSE_MOVE, | ||
1099 | &ev, event_id); | ||
984 | } | 1100 | } |
985 | } | 1101 | } |
986 | /* otherwise it has left the object */ | 1102 | /* otherwise it has left the object */ |
@@ -994,7 +1110,15 @@ _canvas_event_feed_mouse_move(Eo *eo_e, void *_pd, va_list *list) | |||
994 | _evas_event_framespace_adjust(eo_obj, &ev2.canvas.x, &ev2.canvas.y); | 1110 | _evas_event_framespace_adjust(eo_obj, &ev2.canvas.x, &ev2.canvas.y); |
995 | _evas_event_havemap_adjust(eo_obj, obj, &ev2.canvas.x, &ev2.canvas.y, obj->mouse_grabbed); | 1111 | _evas_event_havemap_adjust(eo_obj, obj, &ev2.canvas.x, &ev2.canvas.y, obj->mouse_grabbed); |
996 | if (!e->is_frozen) | 1112 | if (!e->is_frozen) |
997 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, &ev2, event_id); | 1113 | { |
1114 | evas_object_event_callback_call(eo_obj, obj, | ||
1115 | EVAS_CALLBACK_MOUSE_OUT, &ev2, event_id); | ||
1116 | //pass event to source | ||
1117 | if (obj->proxy.is_proxy) | ||
1118 | _evas_object_source_event(eo_obj, eo_e, | ||
1119 | EVAS_CALLBACK_MOUSE_OUT, | ||
1120 | &ev2, event_id); | ||
1121 | } | ||
998 | } | 1122 | } |
999 | } | 1123 | } |
1000 | if (e->delete_me) break; | 1124 | if (e->delete_me) break; |
@@ -1020,7 +1144,16 @@ _canvas_event_feed_mouse_move(Eo *eo_e, void *_pd, va_list *list) | |||
1020 | { | 1144 | { |
1021 | obj->mouse_in = 1; | 1145 | obj->mouse_in = 1; |
1022 | if (!e->is_frozen) | 1146 | if (!e->is_frozen) |
1023 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_IN, &ev3, event_id2); | 1147 | { |
1148 | evas_object_event_callback_call(eo_obj, obj, | ||
1149 | EVAS_CALLBACK_MOUSE_IN, &ev3, event_id2); | ||
1150 | //pass event to source | ||
1151 | if (obj->proxy.is_proxy) | ||
1152 | _evas_object_source_event(eo_obj, eo_e, | ||
1153 | EVAS_CALLBACK_MOUSE_IN, | ||
1154 | &ev3, event_id2); | ||
1155 | |||
1156 | } | ||
1024 | } | 1157 | } |
1025 | } | 1158 | } |
1026 | if (e->delete_me) break; | 1159 | if (e->delete_me) break; |
@@ -1118,7 +1251,7 @@ nogrep: | |||
1118 | ins = _evas_event_object_list_raw_in_get(eo_e, NULL, | 1251 | ins = _evas_event_object_list_raw_in_get(eo_e, NULL, |
1119 | EINA_INLIST_GET(below_obj), NULL, | 1252 | EINA_INLIST_GET(below_obj), NULL, |
1120 | e->pointer.x, e->pointer.y, | 1253 | e->pointer.x, e->pointer.y, |
1121 | &norep); | 1254 | &norep, EINA_FALSE); |
1122 | } | 1255 | } |
1123 | EINA_LIST_FOREACH(copy, l, eo_obj) | 1256 | EINA_LIST_FOREACH(copy, l, eo_obj) |
1124 | { | 1257 | { |
@@ -1156,6 +1289,11 @@ nogrep: | |||
1156 | _evas_event_framespace_adjust(eo_obj, &ev.cur.canvas.x, &ev.cur.canvas.y); | 1289 | _evas_event_framespace_adjust(eo_obj, &ev.cur.canvas.x, &ev.cur.canvas.y); |
1157 | _evas_event_havemap_adjust(eo_obj, obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed); | 1290 | _evas_event_havemap_adjust(eo_obj, obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed); |
1158 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id); | 1291 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id); |
1292 | //pass event to source | ||
1293 | if (obj->proxy.is_proxy) | ||
1294 | _evas_object_source_event(eo_obj, eo_e, | ||
1295 | EVAS_CALLBACK_MOUSE_MOVE, | ||
1296 | &ev, event_id); | ||
1159 | } | 1297 | } |
1160 | } | 1298 | } |
1161 | /* otherwise it has left the object */ | 1299 | /* otherwise it has left the object */ |
@@ -1169,7 +1307,15 @@ nogrep: | |||
1169 | _evas_event_framespace_adjust(eo_obj, &ev2.canvas.x, &ev2.canvas.y); | 1307 | _evas_event_framespace_adjust(eo_obj, &ev2.canvas.x, &ev2.canvas.y); |
1170 | _evas_event_havemap_adjust(eo_obj, obj, &ev2.canvas.x, &ev2.canvas.y, obj->mouse_grabbed); | 1308 | _evas_event_havemap_adjust(eo_obj, obj, &ev2.canvas.x, &ev2.canvas.y, obj->mouse_grabbed); |
1171 | if (!e->is_frozen) | 1309 | if (!e->is_frozen) |
1172 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, &ev2, event_id); | 1310 | { |
1311 | evas_object_event_callback_call(eo_obj, obj, | ||
1312 | EVAS_CALLBACK_MOUSE_OUT, &ev2, event_id); | ||
1313 | //pass event to source | ||
1314 | if (obj->proxy.is_proxy) | ||
1315 | _evas_object_source_event(eo_obj, eo_e, | ||
1316 | EVAS_CALLBACK_MOUSE_OUT, | ||
1317 | &ev2, event_id); | ||
1318 | } | ||
1173 | } | 1319 | } |
1174 | } | 1320 | } |
1175 | if (e->delete_me) break; | 1321 | if (e->delete_me) break; |
@@ -1195,7 +1341,15 @@ nogrep: | |||
1195 | { | 1341 | { |
1196 | obj->mouse_in = 1; | 1342 | obj->mouse_in = 1; |
1197 | if (!e->is_frozen) | 1343 | if (!e->is_frozen) |
1198 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_IN, &ev3, event_id2); | 1344 | { |
1345 | evas_object_event_callback_call(eo_obj, obj, | ||
1346 | EVAS_CALLBACK_MOUSE_IN, &ev3, event_id2); | ||
1347 | //pass event to source | ||
1348 | if (obj->proxy.is_proxy) | ||
1349 | _evas_object_source_event(eo_obj, eo_e, | ||
1350 | EVAS_CALLBACK_MOUSE_IN, | ||
1351 | &ev3, event_id2); | ||
1352 | } | ||
1199 | } | 1353 | } |
1200 | } | 1354 | } |
1201 | if (e->delete_me) break; | 1355 | if (e->delete_me) break; |
@@ -1273,7 +1427,16 @@ _canvas_event_feed_mouse_in(Eo *eo_e, void *_pd, va_list *list) | |||
1273 | { | 1427 | { |
1274 | obj->mouse_in = 1; | 1428 | obj->mouse_in = 1; |
1275 | if (!e->is_frozen) | 1429 | if (!e->is_frozen) |
1276 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_IN, &ev, event_id); | 1430 | { |
1431 | evas_object_event_callback_call(eo_obj, obj, | ||
1432 | EVAS_CALLBACK_MOUSE_IN, | ||
1433 | &ev, event_id); | ||
1434 | //pass event to source | ||
1435 | if (obj->proxy.is_proxy) | ||
1436 | _evas_object_source_event(eo_obj, eo_e, | ||
1437 | EVAS_CALLBACK_MOUSE_IN, | ||
1438 | &ev, event_id); | ||
1439 | } | ||
1277 | } | 1440 | } |
1278 | } | 1441 | } |
1279 | if (e->delete_me) break; | 1442 | if (e->delete_me) break; |
@@ -1350,7 +1513,15 @@ _canvas_event_feed_mouse_out(Eo *eo_e, void *_pd, va_list *list) | |||
1350 | if (!obj->delete_me) | 1513 | if (!obj->delete_me) |
1351 | { | 1514 | { |
1352 | if (!e->is_frozen) | 1515 | if (!e->is_frozen) |
1353 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, &ev, event_id); | 1516 | { |
1517 | evas_object_event_callback_call(eo_obj, obj, | ||
1518 | EVAS_CALLBACK_MOUSE_OUT, &ev, event_id); | ||
1519 | //pass event to source | ||
1520 | if (obj->proxy.is_proxy) | ||
1521 | _evas_object_source_event(eo_obj, eo_e, | ||
1522 | EVAS_CALLBACK_MOUSE_OUT, | ||
1523 | &ev, event_id); | ||
1524 | } | ||
1354 | } | 1525 | } |
1355 | obj->mouse_grabbed = 0; | 1526 | obj->mouse_grabbed = 0; |
1356 | } | 1527 | } |
@@ -1465,7 +1636,15 @@ _canvas_event_feed_multi_down(Eo *eo_e, void *_pd, va_list *list) | |||
1465 | if (y != ev.canvas.y) | 1636 | if (y != ev.canvas.y) |
1466 | ev.canvas.ysub = ev.canvas.y; // fixme - lost precision | 1637 | ev.canvas.ysub = ev.canvas.y; // fixme - lost precision |
1467 | if (!e->is_frozen) | 1638 | if (!e->is_frozen) |
1468 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_DOWN, &ev, event_id); | 1639 | { |
1640 | evas_object_event_callback_call(eo_obj, obj, | ||
1641 | EVAS_CALLBACK_MULTI_DOWN, &ev, | ||
1642 | event_id); | ||
1643 | //pass event to source | ||
1644 | if (obj->proxy.is_proxy) | ||
1645 | _evas_object_source_event(eo_obj, eo_e, EVAS_CALLBACK_MULTI_DOWN, | ||
1646 | &ev, event_id); | ||
1647 | } | ||
1469 | if (e->delete_me) break; | 1648 | if (e->delete_me) break; |
1470 | } | 1649 | } |
1471 | if (copy) eina_list_free(copy); | 1650 | if (copy) eina_list_free(copy); |
@@ -1568,7 +1747,15 @@ _canvas_event_feed_multi_up(Eo *eo_e, void *_pd, va_list *list) | |||
1568 | e->pointer.mouse_grabbed--; | 1747 | e->pointer.mouse_grabbed--; |
1569 | } | 1748 | } |
1570 | if (!e->is_frozen) | 1749 | if (!e->is_frozen) |
1571 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_UP, &ev, event_id); | 1750 | { |
1751 | evas_object_event_callback_call(eo_obj, obj, | ||
1752 | EVAS_CALLBACK_MULTI_UP, &ev, | ||
1753 | event_id); | ||
1754 | //pass event to source | ||
1755 | if (obj->proxy.is_proxy) | ||
1756 | _evas_object_source_event(eo_obj, eo_e, EVAS_CALLBACK_MULTI_UP, | ||
1757 | &ev, event_id); | ||
1758 | } | ||
1572 | if (e->delete_me) break; | 1759 | if (e->delete_me) break; |
1573 | } | 1760 | } |
1574 | if (copy) copy = eina_list_free(copy); | 1761 | if (copy) copy = eina_list_free(copy); |
@@ -1675,7 +1862,12 @@ _canvas_event_feed_multi_move(Eo *eo_e, void *_pd, va_list *list) | |||
1675 | ev.cur.canvas.xsub = ev.cur.canvas.x; // fixme - lost precision | 1862 | ev.cur.canvas.xsub = ev.cur.canvas.x; // fixme - lost precision |
1676 | if (y != ev.cur.canvas.y) | 1863 | if (y != ev.cur.canvas.y) |
1677 | ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision | 1864 | ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision |
1678 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_MOVE, &ev, event_id); | 1865 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_MOVE, &ev, event_id); |
1866 | //pass event to source | ||
1867 | if (obj->proxy.is_proxy) | ||
1868 | _evas_object_source_event(eo_obj, eo_e, | ||
1869 | EVAS_CALLBACK_MULTI_MOVE, &ev, | ||
1870 | event_id); | ||
1679 | } | 1871 | } |
1680 | if (e->delete_me) break; | 1872 | if (e->delete_me) break; |
1681 | } | 1873 | } |
@@ -1747,6 +1939,11 @@ _canvas_event_feed_multi_move(Eo *eo_e, void *_pd, va_list *list) | |||
1747 | if (y != ev.cur.canvas.y) | 1939 | if (y != ev.cur.canvas.y) |
1748 | ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision | 1940 | ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision |
1749 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_MOVE, &ev, event_id); | 1941 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_MOVE, &ev, event_id); |
1942 | //pass event to source | ||
1943 | if (obj->proxy.is_proxy) | ||
1944 | _evas_object_source_event(eo_obj, eo_e, | ||
1945 | EVAS_CALLBACK_MULTI_MOVE, &ev, | ||
1946 | event_id); | ||
1750 | } | 1947 | } |
1751 | if (e->delete_me) break; | 1948 | if (e->delete_me) break; |
1752 | } | 1949 | } |
@@ -1841,6 +2038,11 @@ _canvas_event_feed_key_down(Eo *eo_e, void *_pd, va_list *list) | |||
1841 | evas_object_event_callback_call(g->object, object_obj, | 2038 | evas_object_event_callback_call(g->object, object_obj, |
1842 | EVAS_CALLBACK_KEY_DOWN, | 2039 | EVAS_CALLBACK_KEY_DOWN, |
1843 | &ev, event_id); | 2040 | &ev, event_id); |
2041 | //pass event to source | ||
2042 | if (object_obj->proxy.is_proxy) | ||
2043 | _evas_object_source_event(g->object, eo_e, | ||
2044 | EVAS_CALLBACK_KEY_DOWN, | ||
2045 | &ev, event_id); | ||
1844 | if (g->exclusive) exclusive = EINA_TRUE; | 2046 | if (g->exclusive) exclusive = EINA_TRUE; |
1845 | } | 2047 | } |
1846 | } | 2048 | } |
@@ -1870,8 +2072,17 @@ _canvas_event_feed_key_down(Eo *eo_e, void *_pd, va_list *list) | |||
1870 | { | 2072 | { |
1871 | Evas_Object_Protected_Data *focused_obj = eo_data_get(e->focused, EVAS_OBJ_CLASS); | 2073 | Evas_Object_Protected_Data *focused_obj = eo_data_get(e->focused, EVAS_OBJ_CLASS); |
1872 | if (!e->is_frozen && !evas_event_freezes_through(e->focused, focused_obj)) | 2074 | if (!e->is_frozen && !evas_event_freezes_through(e->focused, focused_obj)) |
1873 | evas_object_event_callback_call(e->focused, focused_obj, EVAS_CALLBACK_KEY_DOWN, | 2075 | { |
1874 | &ev, event_id); | 2076 | evas_object_event_callback_call(e->focused, focused_obj, |
2077 | EVAS_CALLBACK_KEY_DOWN, | ||
2078 | &ev, event_id); | ||
2079 | //pass event to source | ||
2080 | if (focused_obj->proxy.is_proxy) | ||
2081 | _evas_object_source_event(e->focused, eo_e, | ||
2082 | EVAS_CALLBACK_KEY_DOWN, | ||
2083 | &ev, event_id); | ||
2084 | |||
2085 | } | ||
1875 | } | 2086 | } |
1876 | _evas_post_event_callback_call(eo_e, e); | 2087 | _evas_post_event_callback_call(eo_e, e); |
1877 | if (ev.dev) _evas_device_unref(ev.dev); | 2088 | if (ev.dev) _evas_device_unref(ev.dev); |
@@ -1946,8 +2157,16 @@ _canvas_event_feed_key_up(Eo *eo_e, void *_pd, va_list *list) | |||
1946 | Evas_Object_Protected_Data *object_obj = eo_data_get(g->object, EVAS_OBJ_CLASS); | 2157 | Evas_Object_Protected_Data *object_obj = eo_data_get(g->object, EVAS_OBJ_CLASS); |
1947 | if (!e->is_frozen && | 2158 | if (!e->is_frozen && |
1948 | !evas_event_freezes_through(g->object, object_obj)) | 2159 | !evas_event_freezes_through(g->object, object_obj)) |
1949 | evas_object_event_callback_call(g->object, object_obj, | 2160 | { |
1950 | EVAS_CALLBACK_KEY_UP, &ev, event_id); | 2161 | evas_object_event_callback_call(g->object, object_obj, |
2162 | EVAS_CALLBACK_KEY_UP, | ||
2163 | &ev, event_id); | ||
2164 | //pass event to source | ||
2165 | if (object_obj->proxy.is_proxy) | ||
2166 | _evas_object_source_event(g->object, eo_e, | ||
2167 | EVAS_CALLBACK_KEY_UP, | ||
2168 | &ev, event_id); | ||
2169 | } | ||
1951 | if (g->exclusive) exclusive = EINA_TRUE; | 2170 | if (g->exclusive) exclusive = EINA_TRUE; |
1952 | } | 2171 | } |
1953 | if (e->delete_me) break; | 2172 | if (e->delete_me) break; |
@@ -1978,8 +2197,16 @@ _canvas_event_feed_key_up(Eo *eo_e, void *_pd, va_list *list) | |||
1978 | { | 2197 | { |
1979 | Evas_Object_Protected_Data *focused_obj = eo_data_get(e->focused, EVAS_OBJ_CLASS); | 2198 | Evas_Object_Protected_Data *focused_obj = eo_data_get(e->focused, EVAS_OBJ_CLASS); |
1980 | if (!e->is_frozen && !evas_event_freezes_through(e->focused, focused_obj)) | 2199 | if (!e->is_frozen && !evas_event_freezes_through(e->focused, focused_obj)) |
1981 | evas_object_event_callback_call(e->focused, focused_obj, EVAS_CALLBACK_KEY_UP, | 2200 | { |
1982 | &ev, event_id); | 2201 | evas_object_event_callback_call(e->focused, focused_obj, |
2202 | EVAS_CALLBACK_KEY_UP, | ||
2203 | &ev, event_id); | ||
2204 | //pass event to source | ||
2205 | if (focused_obj->proxy.is_proxy) | ||
2206 | _evas_object_source_event(e->focused, eo_e, | ||
2207 | EVAS_CALLBACK_KEY_UP, | ||
2208 | &ev, event_id); | ||
2209 | } | ||
1983 | } | 2210 | } |
1984 | _evas_post_event_callback_call(eo_e, e); | 2211 | _evas_post_event_callback_call(eo_e, e); |
1985 | if (ev.dev) _evas_device_unref(ev.dev); | 2212 | if (ev.dev) _evas_device_unref(ev.dev); |
@@ -2024,7 +2251,14 @@ _canvas_event_feed_hold(Eo *eo_e, void *_pd, va_list *list) | |||
2024 | { | 2251 | { |
2025 | Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); | 2252 | Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); |
2026 | if ((!e->is_frozen) && !evas_event_freezes_through(eo_obj, obj)) | 2253 | if ((!e->is_frozen) && !evas_event_freezes_through(eo_obj, obj)) |
2027 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_HOLD, &ev, event_id); | 2254 | { |
2255 | evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_HOLD, | ||
2256 | &ev, event_id); | ||
2257 | //pass event to source | ||
2258 | if (obj->proxy.is_proxy) | ||
2259 | _evas_object_source_event(eo_obj, eo_e, EVAS_CALLBACK_HOLD, &ev, | ||
2260 | event_id); | ||
2261 | } | ||
2028 | if (e->delete_me) break; | 2262 | if (e->delete_me) break; |
2029 | } | 2263 | } |
2030 | if (copy) copy = eina_list_free(copy); | 2264 | if (copy) copy = eina_list_free(copy); |
diff --git a/legacy/evas/src/lib/canvas/evas_object_image.c b/legacy/evas/src/lib/canvas/evas_object_image.c index 80bc20f7ed..5d109e698b 100644 --- a/legacy/evas/src/lib/canvas/evas_object_image.c +++ b/legacy/evas/src/lib/canvas/evas_object_image.c | |||
@@ -89,6 +89,7 @@ struct _Evas_Object_Image | |||
89 | Eina_Bool filled : 1; | 89 | Eina_Bool filled : 1; |
90 | Eina_Bool proxyrendering : 1; | 90 | Eina_Bool proxyrendering : 1; |
91 | Eina_Bool source_invisible : 1; | 91 | Eina_Bool source_invisible : 1; |
92 | Eina_Bool source_events: 1; | ||
92 | Eina_Bool preloading : 1; | 93 | Eina_Bool preloading : 1; |
93 | Eina_Bool video_surface : 1; | 94 | Eina_Bool video_surface : 1; |
94 | Eina_Bool video_visible : 1; | 95 | Eina_Bool video_visible : 1; |
@@ -541,7 +542,7 @@ evas_object_image_source_get(const Evas_Object *eo_obj) | |||
541 | } | 542 | } |
542 | 543 | ||
543 | static void | 544 | static void |
544 | _image_source_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) | 545 | _image_source_get(Eo *eo_obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list) |
545 | { | 546 | { |
546 | const Evas_Object_Image *o = _pd; | 547 | const Evas_Object_Image *o = _pd; |
547 | Evas_Object **source = va_arg(*list, Evas_Object **); | 548 | Evas_Object **source = va_arg(*list, Evas_Object **); |
@@ -557,6 +558,52 @@ evas_object_image_source_unset(Evas_Object *eo_obj) | |||
557 | } | 558 | } |
558 | 559 | ||
559 | EAPI void | 560 | EAPI void |
561 | evas_object_image_source_events_set(Evas_Object *eo_obj, Eina_Bool source_events) | ||
562 | { | ||
563 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); | ||
564 | return; | ||
565 | MAGIC_CHECK_END(); | ||
566 | |||
567 | eo_do(eo_obj, evas_obj_image_source_events_set(source_events)); | ||
568 | } | ||
569 | |||
570 | static void | ||
571 | _image_source_events_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) | ||
572 | { | ||
573 | Evas_Object_Image *o = _pd; | ||
574 | Eina_Bool source_events = va_arg(*list, int); | ||
575 | |||
576 | source_events = !!source_events; | ||
577 | if (o->source_events == source_events) return; | ||
578 | o->source_events = source_events; | ||
579 | if (!o->cur.source) return; | ||
580 | if ((o->source_invisible) || (!source_events)) return; | ||
581 | //FIXME: Feed mouse events here. | ||
582 | } | ||
583 | |||
584 | EAPI Eina_Bool | ||
585 | evas_object_image_source_events_get(const Evas_Object *eo_obj) | ||
586 | { | ||
587 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); | ||
588 | return EINA_FALSE; | ||
589 | MAGIC_CHECK_END(); | ||
590 | |||
591 | Eina_Bool source_events; | ||
592 | eo_do((Eo*)eo_obj, evas_obj_image_source_events_get(&source_events)); | ||
593 | |||
594 | return source_events; | ||
595 | } | ||
596 | |||
597 | static void | ||
598 | _image_source_events_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) | ||
599 | { | ||
600 | Evas_Object_Image *o = _pd; | ||
601 | Eina_Bool *source_events = va_arg(*list, Eina_Bool *); | ||
602 | if (!source_events) return; | ||
603 | *source_events = o->source_events; | ||
604 | } | ||
605 | |||
606 | EAPI void | ||
560 | evas_object_image_source_visible_set(Evas_Object *eo_obj, Eina_Bool visible) | 607 | evas_object_image_source_visible_set(Evas_Object *eo_obj, Eina_Bool visible) |
561 | { | 608 | { |
562 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); | 609 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); |
@@ -583,6 +630,7 @@ _image_source_visible_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) | |||
583 | evas_object_smart_member_cache_invalidate(o->cur.source, EINA_FALSE, | 630 | evas_object_smart_member_cache_invalidate(o->cur.source, EINA_FALSE, |
584 | EINA_FALSE, EINA_TRUE); | 631 | EINA_FALSE, EINA_TRUE); |
585 | evas_object_change(o->cur.source, src_obj); | 632 | evas_object_change(o->cur.source, src_obj); |
633 | if ((!visible) || (!o->source_events)) return; | ||
586 | //FIXME: Feed mouse events here. | 634 | //FIXME: Feed mouse events here. |
587 | } | 635 | } |
588 | 636 | ||
@@ -2619,8 +2667,10 @@ _proxy_unset(Evas_Object *proxy) | |||
2619 | if (!o->cur.source) return; | 2667 | if (!o->cur.source) return; |
2620 | 2668 | ||
2621 | Evas_Object_Protected_Data *cur_source = eo_data_get(o->cur.source, EVAS_OBJ_CLASS); | 2669 | Evas_Object_Protected_Data *cur_source = eo_data_get(o->cur.source, EVAS_OBJ_CLASS); |
2670 | Evas_Object_Protected_Data *cur_proxy = eo_data_get(proxy, EVAS_OBJ_CLASS); | ||
2622 | 2671 | ||
2623 | cur_source->proxy.proxies = eina_list_remove(cur_source->proxy.proxies, proxy); | 2672 | cur_source->proxy.proxies = eina_list_remove(cur_source->proxy.proxies, proxy); |
2673 | cur_proxy->proxy.is_proxy = EINA_FALSE; | ||
2624 | 2674 | ||
2625 | if (cur_source->proxy.source_invisible) | 2675 | if (cur_source->proxy.source_invisible) |
2626 | { | 2676 | { |
@@ -2642,10 +2692,12 @@ static void | |||
2642 | _proxy_set(Evas_Object *eo_proxy, Evas_Object *eo_src) | 2692 | _proxy_set(Evas_Object *eo_proxy, Evas_Object *eo_src) |
2643 | { | 2693 | { |
2644 | Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS); | 2694 | Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS); |
2695 | Evas_Object_Protected_Data *proxy = eo_data_get(eo_proxy, EVAS_OBJ_CLASS); | ||
2645 | Evas_Object_Image *o = eo_data_get(eo_proxy, MY_CLASS); | 2696 | Evas_Object_Image *o = eo_data_get(eo_proxy, MY_CLASS); |
2646 | 2697 | ||
2647 | evas_object_image_file_set(eo_proxy, NULL, NULL); | 2698 | evas_object_image_file_set(eo_proxy, NULL, NULL); |
2648 | 2699 | ||
2700 | proxy->proxy.is_proxy = EINA_TRUE; | ||
2649 | o->cur.source = eo_src; | 2701 | o->cur.source = eo_src; |
2650 | o->load_error = EVAS_LOAD_ERROR_NONE; | 2702 | o->load_error = EVAS_LOAD_ERROR_NONE; |
2651 | 2703 | ||
@@ -4340,6 +4392,12 @@ evas_object_image_filled_resize_listener(void *data __UNUSED__, Evas *e __UNUSED | |||
4340 | evas_object_image_fill_set(obj, 0, 0, w, h); | 4392 | evas_object_image_fill_set(obj, 0, 0, w, h); |
4341 | } | 4393 | } |
4342 | 4394 | ||
4395 | Evas_Object * | ||
4396 | _evas_object_image_source_get(Evas_Object *eo_obj) | ||
4397 | { | ||
4398 | Evas_Object_Image *o = eo_data_get(eo_obj, MY_CLASS); | ||
4399 | return o->cur.source; | ||
4400 | } | ||
4343 | 4401 | ||
4344 | Eina_Bool | 4402 | Eina_Bool |
4345 | _evas_object_image_preloading_get(const Evas_Object *eo_obj) | 4403 | _evas_object_image_preloading_get(const Evas_Object *eo_obj) |
@@ -4489,6 +4547,8 @@ _class_constructor(Eo_Class *klass) | |||
4489 | EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_ANIMATED_FRAME_SET), _image_animated_frame_set), | 4547 | EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_ANIMATED_FRAME_SET), _image_animated_frame_set), |
4490 | EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_VISIBLE_SET), _image_source_visible_set), | 4548 | EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_VISIBLE_SET), _image_source_visible_set), |
4491 | EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_VISIBLE_GET), _image_source_visible_get), | 4549 | EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_VISIBLE_GET), _image_source_visible_get), |
4550 | EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_EVENTS_SET), _image_source_events_set), | ||
4551 | EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_EVENTS_GET), _image_source_events_get), | ||
4492 | EO_OP_FUNC_SENTINEL | 4552 | EO_OP_FUNC_SENTINEL |
4493 | }; | 4553 | }; |
4494 | 4554 | ||
@@ -4562,6 +4622,8 @@ static const Eo_Op_Description op_desc[] = { | |||
4562 | EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_ANIMATED_FRAME_SET, "Set the frame to current frame of an image object."), | 4622 | EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_ANIMATED_FRAME_SET, "Set the frame to current frame of an image object."), |
4563 | EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_VISIBLE_SET, "Set the source object visibility of a given image object being used as a proxy."), | 4623 | EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_VISIBLE_SET, "Set the source object visibility of a given image object being used as a proxy."), |
4564 | EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_VISIBLE_GET, "Get the source object visibility of a given image object being used as a proxy."), | 4624 | EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_VISIBLE_GET, "Get the source object visibility of a given image object being used as a proxy."), |
4625 | EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_EVENTS_SET, "Set the events to be repeated to the source object."), | ||
4626 | EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_SOURCE_EVENTS_GET, "Get the state of the source events."), | ||
4565 | EO_OP_DESCRIPTION_SENTINEL | 4627 | EO_OP_DESCRIPTION_SENTINEL |
4566 | }; | 4628 | }; |
4567 | 4629 | ||
diff --git a/legacy/evas/src/lib/include/evas_private.h b/legacy/evas/src/lib/include/evas_private.h index 7001f7680a..d76bbea6c2 100644 --- a/legacy/evas/src/lib/include/evas_private.h +++ b/legacy/evas/src/lib/include/evas_private.h | |||
@@ -595,6 +595,7 @@ struct _Evas_Object_Protected_Data | |||
595 | Eina_List *proxies; | 595 | Eina_List *proxies; |
596 | void *surface; | 596 | void *surface; |
597 | int w,h; | 597 | int w,h; |
598 | Eina_Bool is_proxy : 1; | ||
598 | Eina_Bool redraw : 1; | 599 | Eina_Bool redraw : 1; |
599 | Eina_Bool source_invisible : 1; | 600 | Eina_Bool source_invisible : 1; |
600 | } proxy; | 601 | } proxy; |
@@ -1013,6 +1014,7 @@ void evas_smart_cb_descriptions_fix(Evas_Smart_Cb_Description_Array *a) EINA_ARG | |||
1013 | Eina_Bool evas_smart_cb_descriptions_resize(Evas_Smart_Cb_Description_Array *a, unsigned int size) EINA_ARG_NONNULL(1); | 1014 | Eina_Bool evas_smart_cb_descriptions_resize(Evas_Smart_Cb_Description_Array *a, unsigned int size) EINA_ARG_NONNULL(1); |
1014 | const Evas_Smart_Cb_Description *evas_smart_cb_description_find(const Evas_Smart_Cb_Description_Array *a, const char *name) EINA_ARG_NONNULL(1, 2) EINA_PURE; | 1015 | const Evas_Smart_Cb_Description *evas_smart_cb_description_find(const Evas_Smart_Cb_Description_Array *a, const char *name) EINA_ARG_NONNULL(1, 2) EINA_PURE; |
1015 | 1016 | ||
1017 | Evas_Object *_evas_object_image_source_get(Evas_Object *obj); | ||
1016 | Eina_Bool _evas_object_image_preloading_get(const Evas_Object *obj); | 1018 | Eina_Bool _evas_object_image_preloading_get(const Evas_Object *obj); |
1017 | void _evas_object_image_preloading_set(Evas_Object *obj, Eina_Bool preloading); | 1019 | void _evas_object_image_preloading_set(Evas_Object *obj, Eina_Bool preloading); |
1018 | void _evas_object_image_preloading_check(Evas_Object *obj); | 1020 | void _evas_object_image_preloading_check(Evas_Object *obj); |