}
static void
+_win_effect_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
+{
+ const char *type_name;
+ Elm_Win_Effect_Type type = (Elm_Win_Effect_Type)(event_info);
+
+ switch (type)
+ {
+ case ELM_WIN_EFFECT_TYPE_SHOW:
+ type_name = eina_stringshare_add("SHOW");
+ break;
+ case ELM_WIN_EFFECT_TYPE_HIDE:
+ type_name = eina_stringshare_add("HIDE");
+ break;
+ case ELM_WIN_EFFECT_TYPE_RESTACK:
+ type_name = eina_stringshare_add("RESTACK");
+ break;
+ default:
+ type_name = eina_stringshare_add("UNKNOWN");
+ }
+
+ printf("EFFECT: %s %s\n", type_name, (char *)data);
+ eina_stringshare_del(type_name);
+}
+
+static void
_win_show(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
printf("win: show\n");
evas_object_smart_callback_add(win, "delete,request", _win_state_print_cb, "delete,request");
evas_object_smart_callback_add(win, "wm,rotation,changed", _win_state_print_cb, "wm,rotation,changed");
evas_object_smart_callback_add(win, "visibility,changed", _win_state_visibility_cb, "visibility,changed");
+ evas_object_smart_callback_add(win, "effect,started", _win_effect_cb, "effect,started");
+ evas_object_smart_callback_add(win, "effect,done", _win_effect_cb, "effect,done");
elm_win_autodel_set(win, EINA_TRUE);
bg = elm_bg_add(win);
{
Ecore_Wl_Window *win;
Eina_Bool opaque_dirty : 1;
+ Ecore_Event_Handler *effect_start_handler;
+ Ecore_Event_Handler *effect_end_handler;
} wl;
#endif
static const char SIG_CONFORMANT_CHANGED[] = "conformant,changed";
static const char SIG_AUX_HINT_ALLOWED[] = "aux,hint,allowed";
static const char SIG_VISIBILITY_CHANGED[] = "visibility,changed";
+static const char SIG_EFFECT_STARTED[] = "effect,started";
+static const char SIG_EFFECT_DONE[] = "effect,done";
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_DELETE_REQUEST, ""},
{SIG_CONFORMANT_CHANGED, ""},
{SIG_AUX_HINT_ALLOWED, ""},
{SIG_VISIBILITY_CHANGED, ""},
+ {SIG_EFFECT_STARTED, ""},
+ {SIG_EFFECT_DONE, ""},
{NULL, NULL}
};
{
sd->wl.win = _elm_ee_wlwin_get(sd->ee);
}
+
+static Eina_Bool
+_elm_win_wl_effect_start(void *data, int type EINA_UNUSED, void *event)
+{
+ ELM_WIN_DATA_GET(data, sd);
+ Ecore_Wl_Event_Effect_Start *e = event;
+
+ if (!sd->wl.win) return ECORE_CALLBACK_PASS_ON;
+
+ if ((ecore_wl_window_id_get(sd->wl.win) != e->win))
+ return ECORE_CALLBACK_PASS_ON;
+
+ evas_object_smart_callback_call(data, SIG_EFFECT_STARTED, (void*)e->type);
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool
+_elm_win_wl_effect_end(void *data, int type EINA_UNUSED, void *event)
+{
+ ELM_WIN_DATA_GET(data, sd);
+ Ecore_Wl_Event_Effect_End *e = event;
+
+ if (!sd->wl.win) return ECORE_CALLBACK_PASS_ON;
+
+ if ((ecore_wl_window_id_get(sd->wl.win) != e->win))
+ return ECORE_CALLBACK_PASS_ON;
+
+ evas_object_smart_callback_call(data, SIG_EFFECT_DONE, (void*)e->type);
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
#endif
#ifdef HAVE_ELEMENTARY_X
(ECORE_X_EVENT_WINDOW_PROPERTY, _elm_win_property_change, obj);
}
#endif
+#ifdef HAVE_ELEMENTARY_WAYLAND
+ else if ((engine) &&
+ ((!strcmp(engine, ELM_WAYLAND_SHM)) ||
+ (!strcmp(engine, ELM_WAYLAND_EGL))))
+ {
+ sd->wl.effect_start_handler = ecore_event_handler_add
+ (ECORE_WL_EVENT_EFFECT_START, _elm_win_wl_effect_start, obj);
+ sd->wl.effect_end_handler = ecore_event_handler_add
+ (ECORE_WL_EVENT_EFFECT_END, _elm_win_wl_effect_end, obj);
+ }
+#endif
else if ((engine) && (!strncmp(engine, "shot:", 5)))
_shot_init(sd);