summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-11-07 13:08:12 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-11-07 13:08:12 -0500
commit50e4a3012632105dcfb49c50dce7acb4f993850c (patch)
treead5443e41e08fe1c276680e118ad952f1a011b07
parentd4614e1aadc7cc4a68cf526497c6708082bbf9b9 (diff)
downloadenlightenment-50e4a3012632105dcfb49c50dce7acb4f993850c.tar.gz
add counter and smart callbacks for comp object visible mirrors
ref T2788
-rw-r--r--src/bin/e_comp_object.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c
index fd411bd19f..90c0d9f0b2 100644
--- a/src/bin/e_comp_object.c
+++ b/src/bin/e_comp_object.c
@@ -99,6 +99,7 @@ typedef struct _E_Comp_Object
unsigned int animating; // it's busy animating
unsigned int failures; //number of consecutive e_pixmap_image_draw() failures
+ unsigned int force_visible; //number of visible obj_mirror objects
Eina_Bool delete_pending : 1; // delete pending
Eina_Bool defer_hide : 1; // flag to get hide to work on deferred hide
Eina_Bool showing : 1; // object is currently in "show" animation
@@ -191,6 +192,26 @@ _e_comp_object_cb_mirror_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj,
cw->obj_mirror = eina_list_remove(cw->obj_mirror, obj);
}
+static void
+_e_comp_object_cb_mirror_show(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ E_Comp_Object *cw = data;
+
+ if ((!cw->force_visible) && (!e_object_is_del(E_OBJECT(cw->ec))))
+ evas_object_smart_callback_call(cw->smart_obj, "visibility_force", cw->ec);
+ cw->force_visible++;
+}
+
+static void
+_e_comp_object_cb_mirror_hide(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ E_Comp_Object *cw = data;
+
+ cw->force_visible--;
+ if ((!cw->force_visible) && (!e_object_is_del(E_OBJECT(cw->ec))))
+ evas_object_smart_callback_call(cw->smart_obj, "visibility_normal", cw->ec);
+}
+
/////////////////////////////////////
static inline Eina_Bool
@@ -3756,6 +3777,8 @@ e_comp_object_util_mirror_add(Evas_Object *obj)
evas_object_image_smooth_scale_set(o, e_comp_config_get()->smooth_windows);
cw->obj_mirror = eina_list_append(cw->obj_mirror, o);
evas_object_event_callback_add(o, EVAS_CALLBACK_DEL, _e_comp_object_cb_mirror_del, cw);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_SHOW, _e_comp_object_cb_mirror_show, cw);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_HIDE, _e_comp_object_cb_mirror_hide, cw);
evas_object_data_set(o, "E_Client", cw->ec);
evas_object_data_set(o, "comp_mirror", cw);