cw->set_mouse_callbacks = EINA_FALSE;
}
+static Eina_Bool
+_e_comp_object_color_visible_set(E_Comp_Object *cw, Eina_Bool set)
+{
+ if (cw->color_visible == set) return EINA_TRUE;
+
+ cw->color_visible = set;
+
+ ELOGF("COMP", "color_visible set:%d", cw->ec, set);
+
+ wl_signal_emit_mutable(&cw->events.color_visible_set, NULL);
+
+ return EINA_TRUE;
+}
+
+static void
+_e_comp_object_color_visible_update(E_Comp_Object *cw)
+{
+ int a;
+
+ e_comp_object_color_get(cw->smart_obj, NULL, NULL, NULL, &a);
+ if (a <= 0)
+ {
+ _e_comp_object_color_visible_set(cw, EINA_FALSE);
+ return;
+ }
+
+ if (cw->effect_obj)
+ {
+ evas_object_color_get(cw->effect_obj, NULL, NULL, NULL, &a);
+ if (a <= 0)
+ {
+ _e_comp_object_color_visible_set(cw, EINA_FALSE);
+ return;
+ }
+ }
+
+
+ if (cw->shobj)
+ {
+ evas_object_color_get(cw->shobj, NULL, NULL, NULL, &a);
+ if (a <= 0)
+ {
+ _e_comp_object_color_visible_set(cw, EINA_FALSE);
+ return;
+ }
+ }
+
+ if (cw->obj)
+ {
+ evas_object_color_get(cw->obj, NULL, NULL, NULL, &a);
+ if (a <= 0)
+ {
+ _e_comp_object_color_visible_set(cw, EINA_FALSE);
+ return;
+ }
+ }
+
+ _e_comp_object_color_visible_set(cw, EINA_TRUE);
+}
+
+static void
+_e_comp_intercept_effect_obj_color_set(void *data, Evas_Object *obj, int r, int g, int b, int a)
+{
+ E_Comp_Object *cw = data;
+
+ evas_object_color_set(obj, r, g, b, a);
+
+ _e_comp_object_color_visible_update(cw);
+}
+
+static void
+_e_comp_intercept_shobj_color_set(void *data, Evas_Object *obj, int r, int g, int b, int a)
+{
+ E_Comp_Object *cw = data;
+
+ evas_object_color_set(obj, r, g, b, a);
+
+ _e_comp_object_color_visible_update(cw);
+}
+
+static void
+_e_comp_intercept_obj_color_set(void *data, Evas_Object *obj, int r, int g, int b, int a)
+{
+ E_Comp_Object *cw = data;
+
+ evas_object_color_set(obj, r, g, b, a);
+
+ _e_comp_object_color_visible_update(cw);
+}
+
static void
_e_comp_object_setup(E_Comp_Object *cw)
{
evas_object_move(cw->effect_obj, cw->x, cw->y);
evas_object_clip_set(cw->effect_obj, cw->clip);
evas_object_smart_member_add(cw->effect_obj, cw->smart_obj);
+ evas_object_intercept_color_set_callback_add(cw->effect_obj, _e_comp_intercept_effect_obj_color_set, cw);
e_theme_edje_object_set(cw->effect_obj, "base/theme/comp", "e/comp/effects/none");
cw->shobj = edje_object_add(e_comp->evas);
evas_object_data_set(cw->shobj, "comp_smart_obj", cw->smart_obj);
edje_object_part_swallow(cw->effect_obj, "e.swallow.content", cw->shobj);
edje_object_signal_callback_add(cw->shobj, "e,action,*,done", "e", _e_comp_object_done_defer, cw);
+ evas_object_intercept_color_set_callback_add(cw->shobj, _e_comp_intercept_shobj_color_set, cw);
/* name objects appropriately for nicer printing when using e_comp_util_wins_print() */
if (cw->ec->override)
evas_object_image_smooth_scale_set(cw->obj, e_comp_config_get()->smooth_windows);
evas_object_name_set(cw->obj, "cw->obj");
evas_object_image_colorspace_set(cw->obj, EVAS_COLORSPACE_ARGB8888);
+ evas_object_intercept_color_set_callback_add(cw->obj, _e_comp_intercept_obj_color_set, cw);
}
_e_comp_object_alpha_set(cw);
}
wl_signal_emit_mutable(&cw->events.color_set, NULL);
+
+ _e_comp_object_color_visible_update(cw);
}
+
////////////////////////////////////////////////////
static void
wl_signal_init(&cw->events.render_op_set);
wl_signal_init(&cw->events.content_type_set);
wl_signal_init(&cw->events.color_set);
+ wl_signal_init(&cw->events.color_visible_set);
cw->smart_obj = obj;
cw->x = cw->y = cw->w = cw->h = -1;
cw->transform_bg_color.g = 0;
cw->transform_bg_color.b = 0;
cw->transform_bg_color.a = 255;
+ cw->color_visible = EINA_TRUE;
evas_object_data_set(obj, "comp_obj", cw);
evas_object_move(obj, -1, -1);
/* intercept ALL the callbacks! */
if (set)
{
evas_object_color_get(obj, &r, &g, &b, &a);
- evas_object_color_set(obj, 0, 0, 0, 0);
cw->transparent.user_r = r;
cw->transparent.user_g = g;
cw->transparent.user_b = b;
cw->transparent.user_a = a;
+ cw->transparent.setting = EINA_TRUE;
+ evas_object_color_set(obj, 0, 0, 0, 0);
+ cw->transparent.setting = EINA_FALSE;
+
ELOGF("COMP", "Transparent enabled user_color(%d,%d,%d,%d)",
cw->ec,
cw->transparent.user_r,
evas_object_image_smooth_scale_set(cw->obj, e_comp_config_get()->smooth_windows);
evas_object_name_set(cw->obj, "cw->obj");
evas_object_image_colorspace_set(cw->obj, EVAS_COLORSPACE_ARGB8888);
+ evas_object_intercept_color_set_callback_add(obj, _e_comp_intercept_obj_color_set, cw);
_e_comp_object_alpha_set(cw);
if (cw->shobj)
e_comp_object_color_visible_get(Evas_Object *obj)
{
API_ENTRY EINA_FALSE;
- int a;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(cw->ec, EINA_FALSE);
-
- e_comp_object_color_get(obj, NULL, NULL, NULL, &a);
- if (a <= 0)
- return EINA_FALSE;
-
- evas_object_color_get(cw->effect_obj, NULL, NULL, NULL, &a);
- if (a <= 0)
- return EINA_FALSE;
-
- evas_object_color_get(cw->shobj, NULL, NULL, NULL, &a);
- if (a <= 0)
- return EINA_FALSE;
-
- evas_object_color_get(cw->obj, NULL, NULL, NULL, &a);
- if (a <= 0)
- return EINA_FALSE;
- return EINA_TRUE;
+ return cw->color_visible;
}
E_API Eina_Bool
{
API_ENTRY;
- if (cw->transparent.set)
+ if ((cw->transparent.set) || (cw->transparent.setting))
{
if (r) *r = cw->transparent.user_r;
if (g) *g = cw->transparent.user_g;
API_ENTRY;
wl_signal_add(&cw->events.color_set, listener);
}
+
+EINTERN void
+e_comp_object_color_visible_set_listener_add(Evas_Object *obj, struct wl_listener *listener)
+{
+ API_ENTRY;
+ wl_signal_add(&cw->events.color_visible_set, listener);
+}