|author||Mike Blumenkrantz <email@example.com>||2017-06-09 20:16:08 -0400|
|committer||Mike Blumenkrantz <firstname.lastname@example.org>||2017-06-09 20:06:19 -0400|
|parent||evas: remove null check, passthrough list in _evas_event_object_list_in_get() (diff)|
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/Evas_Legacy.h')
1 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h
index a98aae4441..ac6c429ce4 100644
@@ -7666,3 +7666,29 @@ EAPI void evas_object_text_filter_program_set(Evas_Object *obj, const char *code
* @since 1.18
EAPI void evas_object_text_filter_source_set(Evas_Object *obj, const char *name, Evas_Object *source) EINA_DEPRECATED;
+ * Creates a new smart rectangle object on the given Evas @p e canvas.
+ * @param e The given canvas.
+ * @return The created object handle.
+ * This provides a smart version of the typical "event rectangle",
+ * which allows objects to set this as their parent and route events
+ * to a group of objects. Events will not propagate to non-member objects
+ * below this object.
+ * Adding members is done just like a normal smart object, using
+ * efl_canvas_group_member_add (Eo API) or evas_object_smart_member_add (legacy).
+ * Child objects are not modified in any way, unlike other types of smart objects.
+ * It is a user error for any child objects to be stacked above the event
+ * grabber parent while the event grabber is visible.
+ * A critical error will be raised if this is detected at any point.
+ * @since 1.20
+EAPI Evas_Object *evas_object_event_grabber_add(Evas *e);