#include <linux/limits.h>
#include <Ecore_Wayland.h>
-#include <Elementary.h>
#include <glib-object.h>
#include <malloc.h>
#include <glib.h>
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.argc = argc;
_appcore_mw_context.argv = argv;
- elm_init(argc, argv);
- _appcore_mw_context.hshow = ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_SHOW, __stub_show_cb, NULL);
- _appcore_mw_context.hhide = ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_HIDE, __stub_hide_cb, NULL);
- _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);
-
return appcore_base_init(ops.base, argc, argv, data);
}
EXPORT_API void appcore_multiwindow_base_fini(void)
{
- appcore_base_fini();
-
__destroy_all();
g_list_free_full(_appcore_mw_context.classes, __free_class);
_appcore_mw_context.classes = NULL;
_appcore_mw_context.hlower = NULL;
}
- elm_shutdown();
-
- /* Check loader case */
- if (getenv("AUL_LOADER_INIT")) {
- unsetenv("AUL_LOADER_INIT");
- elm_shutdown();
+ if (_appcore_mw_context.hpvchange) {
+ ecore_event_handler_del(_appcore_mw_context.hpvchange);
+ _appcore_mw_context.hpvchange = NULL;
}
+
+ appcore_base_fini();
}
EXPORT_API void appcore_multiwindow_base_exit(void)
appcore_multiwindow_base_window_on_visibility(type, event);
}
-static void __run(void *data)
-{
- elm_run();
-}
-
-static void __exit(void *data)
+static void __window_on_pre_visibility(int type, void *event, void *data)
{
- elm_exit();
+ appcore_multiwindow_base_window_on_pre_visibility(type, event);
}
EXPORT_API appcore_multiwindow_base_ops appcore_multiwindow_base_get_default_ops(void)
ops.base.create = __on_create;
ops.base.terminate = __on_terminate;
ops.base.receive = __on_receive;
- ops.base.run = __run;
- ops.base.exit = __exit;
+ ops.base.init = NULL;
+ ops.base.finish = NULL;
+ ops.base.run = NULL;
+ ops.base.exit = NULL;
ops.window.show = __window_on_show;
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_base_on_create();
+ _appcore_mw_context.hshow = ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_SHOW, __stub_show_cb, NULL);
+ _appcore_mw_context.hhide = ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_HIDE, __stub_hide_cb, NULL);
+ _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;
}