efl.canvas.group: add events for member add/remove
authorMike Blumenkrantz <zmike@samsung.com>
Wed, 27 Feb 2019 18:17:22 +0000 (13:17 -0500)
committerWonki Kim <wonki_.kim@samsung.com>
Fri, 8 Mar 2019 11:49:36 +0000 (20:49 +0900)
Summary:
ref T7554

Depends on D8032

Reviewers: segfaultxavi, bu5hm4n

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7554

Differential Revision: https://phab.enlightenment.org/D8034

src/lib/evas/canvas/efl_canvas_group.eo
src/lib/evas/canvas/evas_object_smart.c

index f21ffda..5ef8016 100644 (file)
@@ -123,6 +123,10 @@ class @beta Efl.Canvas.Group extends Efl.Canvas.Object
          }
       }
    }
+   events {
+      member,added: Efl.Gfx.Entity; [[Called when a member is added to the group.]]
+      member,removed: Efl.Gfx.Entity; [[Called when a member is removed from the group.]]
+   }
    implements {
       class.constructor;
       class.destructor;
index 2c73e82..efbf5cf 100644 (file)
@@ -333,6 +333,7 @@ _efl_canvas_group_group_member_add(Eo *smart_obj, Evas_Smart_Data *o, Evas_Objec
    if (smart->smart.smart && smart->smart.smart->smart_class->member_add)
      smart->smart.smart->smart_class->member_add(smart_obj, eo_obj);
    evas_object_update_bounding_box(eo_obj, obj, member_o);
+   efl_event_callback_call(smart_obj, EFL_CANVAS_GROUP_EVENT_MEMBER_ADDED, eo_obj);
 }
 
 EAPI void
@@ -359,6 +360,8 @@ _efl_canvas_group_group_member_del(Eo *smart_obj, Evas_Smart_Data *_pd EINA_UNUS
 
    evas_object_async_block(obj);
 
+   efl_event_callback_call(smart_obj, EFL_CANVAS_GROUP_EVENT_MEMBER_REMOVED, eo_obj);
+
    smart = efl_data_scope_get(smart_obj, EFL_CANVAS_OBJECT_CLASS);
    if (smart->smart.smart && smart->smart.smart->smart_class->member_del)
      smart->smart.smart->smart_class->member_del(smart_obj, eo_obj);