aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/evas/canvas/evas_callbacks.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-06-09 20:16:08 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-06-09 20:06:19 -0400
commit7fafbdee28e2255b67b84995f10383073018bb43 (patch)
tree38a2218de25d8ebbee25d868d018d187a42022e3 /src/lib/evas/canvas/evas_callbacks.c
parentevas: remove null check, passthrough list in _evas_event_object_list_in_get() (diff)
downloadefl-7fafbdee28e2255b67b84995f10383073018bb43.tar.gz
evas: add new event_grabber smart-ish object
adding an "event rect" is a common use case for rectangles, but I needed a smarter event rect so I sent one off to school and it came back like this. an event_grabber is a smart object which functions like a normal event rect which has color(0,0,0,0), but with an important difference: it can have smart members. event propagation works differently for an event_grabber: normal: event -> layer -> smart(obj1,obj2,obj3) ->(?) other objects in this case, obj1,obj2,obj3 are all "inside" the smart object and their stacking will always be considered as being inside the smart object. rendering is also tied to the smart object in this case, as is clipping. an event which reaches a smart object will be sent to the objects inside, and then may continue through the smart object if there are no objects which block repeating. event_grabber: event -> layer -> event_grabber -> obj1,obj2,obj3 -> STOP in this case, obj1,obj2,obj3 are unmodified after being added to the event_grabber and can be stacked, rendered, and clipped completely independently of the event_grabber. the event_grabber is considered an "event_parent" for this case. member objects are not "inside" the event_grabber, and they are unable to receive events on their own. instead, the event_grabber, which must be stacked above all its members, receives events and propagates them top->down through its member objects. if none of the member objects block the repeat of an event then the event will still be blocked from further propagation past the event_grabber. object lifetimes are independent of the event_grabber; deleting the event_grabber has no effect on its members. @feature
Diffstat (limited to 'src/lib/evas/canvas/evas_callbacks.c')
-rw-r--r--src/lib/evas/canvas/evas_callbacks.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/evas/canvas/evas_callbacks.c b/src/lib/evas/canvas/evas_callbacks.c
index e3d2643bad..822baa2133 100644
--- a/src/lib/evas/canvas/evas_callbacks.c
+++ b/src/lib/evas/canvas/evas_callbacks.c
@@ -436,11 +436,15 @@ evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data
nothing_here:
if (!obj->no_propagate)
{
- if ((obj->smart.parent) && (type != EVAS_CALLBACK_FREE) &&
+ if ((obj->smart.parent || obj->event.parent) && (type != EVAS_CALLBACK_FREE) &&
(type <= EVAS_CALLBACK_KEY_UP))
{
- Evas_Object_Protected_Data *smart_parent = efl_data_scope_get(obj->smart.parent, EFL_CANVAS_OBJECT_CLASS);
- evas_object_event_callback_call(obj->smart.parent, smart_parent, type, event_info, event_id, efl_event_desc);
+ Evas_Object_Protected_Data *parent_obj;
+ Eo *parent;
+
+ parent = obj->event.parent ?: obj->smart.parent;
+ parent_obj = efl_data_scope_get(parent, EFL_CANVAS_OBJECT_CLASS);
+ evas_object_event_callback_call(parent, parent_obj, type, event_info, event_id, efl_event_desc);
}
}
_evas_unwalk(e);