void (*hide)(int type, void *event, void *data);
void (*lower)(int type, void *event, void *data);
void (*visibility)(int type, void *event, void *data);
+ void (*pre_visibility)(int type, void *event, void *data);
} appcore_ui_base_window_ops;
typedef struct _appcore_multiwindow_base_ops {
void appcore_multiwindow_base_window_on_hide(int type, void *event);
void appcore_multiwindow_base_window_on_lower(int type, void *event);
void appcore_multiwindow_base_window_on_visibility(int type, void *event);
+void appcore_multiwindow_base_window_on_pre_visibility(int type, void *event);
void appcore_multiwindow_base_window_bind(appcore_multiwindow_base_instance_h h, Evas_Object *win);
appcore_multiwindow_base_class appcore_multiwindow_base_class_get_default(void);
void (*hide)(int type, void *event, void *data);
void (*lower)(int type, void *event, void *data);
void (*visibility)(int type, void *event, void *data);
+ void (*pre_visibility)(int type, void *event, void *data);
} appcore_ui_base_window_ops;
typedef struct _appcore_ui_base_ops {
void appcore_ui_base_window_on_hide(int type, void *event);
void appcore_ui_base_window_on_lower(int type, void *event);
void appcore_ui_base_window_on_visibility(int type, void *event);
+void appcore_ui_base_window_on_pre_visibility(int type, void *event);
int appcore_ui_base_init(appcore_ui_base_ops ops, int argc, char **argv,
void *data, unsigned int hint);
void appcore_ui_base_fini(void);
return ECORE_CALLBACK_RENEW;
}
+static Eina_Bool __stub_pre_visibility_cb(void *data, int type, void *event)
+{
+ if (_appcore_mw_context.ops.window.pre_visibility)
+ _appcore_mw_context.ops.window.pre_visibility(type, event, _appcore_mw_context.data);
+
+ return ECORE_CALLBACK_RENEW;
+}
+
EXPORT_API int appcore_multiwindow_base_init(appcore_multiwindow_base_ops ops, int argc, char **argv, void *data)
{
_appcore_mw_context.ops = ops;
_appcore_mw_context.hlower = NULL;
}
+ if (_appcore_mw_context.hpvchange) {
+ ecore_event_handler_del(_appcore_mw_context.hpvchange);
+ _appcore_mw_context.hpvchange = NULL;
+ }
+
appcore_base_fini();
}
appcore_multiwindow_base_window_on_visibility(type, event);
}
+static void __window_on_pre_visibility(int type, void *event, void *data)
+{
+ appcore_multiwindow_base_window_on_pre_visibility(type, event);
+}
+
static void __run(void *data)
{
elm_run();
ops.window.hide = __window_on_hide;
ops.window.lower = __window_on_lower;
ops.window.visibility = __window_on_visibility;
+ ops.window.pre_visibility = __window_on_pre_visibility;
return ops;
}
_appcore_mw_context.hvchange = ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_VISIBILITY_CHANGE,
__stub_visibility_cb, NULL);
_appcore_mw_context.hlower = ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_LOWER, __stub_lower_cb, NULL);
+ _appcore_mw_context.hpvchange = ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_PRE_VISIBILITY_CHANGE,
+ __stub_pre_visibility_cb, NULL);
return 0;
}
Ecore_Event_Handler *hhide;
Ecore_Event_Handler *hvchange;
Ecore_Event_Handler *hlower;
+ Ecore_Event_Handler *hpvchange;
} appcore_multiwindow_base_context;
typedef struct _appcore_multiwindow_base_instance {
appcore_multiwindow_base_instance_resume(cxt->inst);
}
+EXPORT_API void appcore_multiwindow_base_window_on_pre_visibility(int type, void *event)
+{
+ Ecore_Wl_Event_Window_Pre_Visibility_Change *ev = event;
+ win_context *cxt = __find_win_context_by_wid(ev->win);
+
+ if (!cxt)
+ return;
+
+ if (ev->type == ECORE_WL_WINDOW_VISIBILITY_TYPE_PRE_UNOBSCURED)
+ appcore_multiwindow_base_instance_resume(cxt->inst);
+}
+
EXPORT_API void appcore_multiwindow_base_window_bind(appcore_multiwindow_base_instance_h h, Evas_Object *win)
{
win_context *cxt;
Ecore_Event_Handler *hhide;
Ecore_Event_Handler *hvchange;
Ecore_Event_Handler *hlower;
+ Ecore_Event_Handler *hpvchange;
} appcore_ui_base_context;
return ECORE_CALLBACK_RENEW;
}
+static Eina_Bool __stub_pre_visibility_cb(void *data, int type, void *event)
+{
+ if (__context.ops.window.pre_visibility)
+ __context.ops.window.pre_visibility(type, event, __context.data);
+
+ return ECORE_CALLBACK_RENEW;
+}
+
static void __prepare_to_suspend(void)
{
int suspend = APPCORE_BASE_SUSPENDED_STATE_WILL_ENTER_SUSPEND;
__context.hvchange = ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_VISIBILITY_CHANGE,
__stub_visibility_cb, NULL);
__context.hlower = ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_LOWER, __stub_lower_cb, NULL);
+ __context.hpvchange = ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_PRE_VISIBILITY_CHANGE,
+ __stub_pre_visibility_cb, NULL);
__context.state = AS_CREATED;
LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:create:done]", __context.appid);
}
+EXPORT_API void appcore_ui_base_window_on_pre_visibility(int type, void *event)
+{
+ Ecore_Wl_Event_Window_Pre_Visibility_Change *ev = event;
+ bool bvisibility;
+
+ if (ev && ev->type == ECORE_WL_WINDOW_VISIBILITY_TYPE_PRE_UNOBSCURED) {
+ __update_win((unsigned int)ev->win, 0, false);
+ bvisibility = __check_visible();
+
+ _DBG("bvisibility %d, b_active %d", bvisibility, b_active);
+ if (bvisibility && b_active == FALSE) {
+ _DBG(" Go to Resume state\n");
+ b_active = TRUE;
+ __do_resume();
+ }
+ }
+}
+
EXPORT_API int appcore_ui_base_init(appcore_ui_base_ops ops, int argc, char **argv,
void *data, unsigned int hint)
{
ecore_event_handler_del(__context.hvchange);
if (__context.hlower)
ecore_event_handler_del(__context.hlower);
+ if (__context.hpvchange)
+ ecore_event_handler_del(__context.hpvchange);
__finish_wl();
appcore_ui_base_window_on_visibility(type, event);
}
+static void __window_on_pre_visibility(int type, void *event, void *data)
+{
+ appcore_ui_base_window_on_pre_visibility(type, event);
+}
+
EXPORT_API appcore_ui_base_ops appcore_ui_base_get_default_ops(void)
{
appcore_ui_base_ops ops;
ops.window.hide = __window_on_hide;
ops.window.lower = __window_on_lower;
ops.window.visibility = __window_on_visibility;
+ ops.window.pre_visibility = __window_on_pre_visibility;
return ops;
}