2 * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include <sys/types.h>
19 #include <sys/socket.h>
27 #include <linux/limits.h>
29 #include <Ecore_Wl2.h>
30 #include <wayland-client.h>
31 #include <wayland-tbm-client.h>
32 #include <tizen-extension-client-protocol.h>
35 #include <glib-object.h>
42 #include <bundle_internal.h>
45 #include "appcore_base.h"
46 #include "appcore_ui_base.h"
47 #include "appcore_ui_base_private.h"
48 #include "appcore_ui_plugin.h"
64 typedef struct _appcore_ui_base_context {
65 appcore_ui_base_ops ops;
73 bool resource_reclaiming;
76 Ecore_Event_Handler *hshow;
77 Ecore_Event_Handler *hhide;
78 Ecore_Event_Handler *hvchange;
79 Ecore_Event_Handler *hlower;
80 Ecore_Event_Handler *hpvchange;
81 } appcore_ui_base_context;
84 static int w_status = WS_NONE;
85 static bool first_launch = true;
93 static GSList *g_winnode_list;
94 static appcore_ui_base_context __context;
95 static struct wl_display *dsp;
96 static struct wl_registry *reg;
97 static struct tizen_policy *tz_policy;
99 static void _wl_cb_conformant(void *data,
100 struct tizen_policy *tizen_policy,
101 struct wl_surface *surface_resource,
102 uint32_t is_conformant)
107 static void _wl_cb_conformant_area(void *data,
108 struct tizen_policy *tizen_policy,
109 struct wl_surface *surface_resource,
110 uint32_t conformant_part,
112 int32_t x, int32_t y, int32_t w, int32_t h)
117 static void _wl_cb_notification_done(void *data,
118 struct tizen_policy *tizen_policy,
119 struct wl_surface *surface,
126 static void _wl_cb_transient_for_done(void *data,
127 struct tizen_policy *tizen_policy,
133 static void _wl_cb_scr_mode_done(void *data,
134 struct tizen_policy *tizen_policy,
135 struct wl_surface *surface,
142 static void _wl_cb_iconify_state_changed(void *data,
143 struct tizen_policy *tizen_policy,
144 struct wl_surface *surface_resource,
151 static void _wl_cb_supported_aux_hints(void *data,
152 struct tizen_policy *tizen_policy,
153 struct wl_surface *surface_resource,
154 struct wl_array *hints,
160 static void _wl_cb_allowed_aux_hint(void *data,
161 struct tizen_policy *tizen_policy,
162 struct wl_surface *surface_resource,
168 static void _wl_cb_aux_message(void *data,
169 struct tizen_policy *tizen_policy,
170 struct wl_surface *surface_resource,
173 struct wl_array *options)
178 static void _wl_cb_conformant_region(void *data,
179 struct tizen_policy *tizen_policy,
180 struct wl_surface *surface,
181 uint32_t conformant_part,
183 int32_t x, int32_t y, int32_t w, int32_t h,
189 static const struct tizen_policy_listener _tizen_policy_listener = {
191 _wl_cb_conformant_area,
192 _wl_cb_notification_done,
193 _wl_cb_transient_for_done,
194 _wl_cb_scr_mode_done,
195 _wl_cb_iconify_state_changed,
196 _wl_cb_supported_aux_hints,
197 _wl_cb_allowed_aux_hint,
199 _wl_cb_conformant_region,
202 static void __wl_listener_cb(void *data, struct wl_registry *reg,
203 uint32_t id, const char *interface, uint32_t ver)
205 if (interface && !strcmp(interface, "tizen_policy")) {
207 tz_policy = wl_registry_bind(reg, id,
208 &tizen_policy_interface, 7);
210 tizen_policy_add_listener(tz_policy, &_tizen_policy_listener, dsp);
215 static void __wl_listener_remove_cb(void *data, struct wl_registry *reg,
221 static const struct wl_registry_listener reg_listener = {
223 __wl_listener_remove_cb
226 static Eina_Bool __stub_show_cb(void *data, int type, void *event)
228 if (__context.ops.window.show)
229 __context.ops.window.show(type, event, __context.data);
231 return ECORE_CALLBACK_RENEW;
234 static Eina_Bool __stub_hide_cb(void *data, int type, void *event)
236 if (__context.ops.window.hide)
237 __context.ops.window.hide(type, event, __context.data);
239 return ECORE_CALLBACK_RENEW;
242 static Eina_Bool __stub_visibility_cb(void *data, int type, void *event)
244 if (__context.ops.window.visibility)
245 __context.ops.window.visibility(type, event, __context.data);
247 return ECORE_CALLBACK_RENEW;
250 static Eina_Bool __stub_lower_cb(void *data, int type, void *event)
252 if (__context.ops.window.lower)
253 __context.ops.window.lower(type, event, __context.data);
255 return ECORE_CALLBACK_RENEW;
258 static Eina_Bool __stub_pre_visibility_cb(void *data, int type, void *event)
260 if (__context.ops.window.pre_visibility)
261 __context.ops.window.pre_visibility(type, event, __context.data);
263 return ECORE_CALLBACK_RENEW;
266 static void __prepare_to_suspend(void)
268 int suspend = APPCORE_BASE_SUSPENDED_STATE_WILL_ENTER_SUSPEND;
270 if (appcore_base_is_bg_allowed() && !appcore_base_is_suspended()) {
271 appcore_base_raise_event((void *)&suspend, APPCORE_BASE_EVENT_SUSPENDED_STATE_CHANGE);
272 appcore_base_toggle_suspended_state();
276 static void __exit_from_suspend(void)
278 int suspend = APPCORE_BASE_SUSPENDED_STATE_DID_EXIT_FROM_SUSPEND;
280 if (appcore_base_is_suspended()) {
281 appcore_base_raise_event((void *)&suspend, APPCORE_BASE_EVENT_SUSPENDED_STATE_CHANGE);
282 appcore_base_toggle_suspended_state();
286 static void __do_pause(void)
290 if (__context.state == AS_RUNNING) {
291 if (__context.ops.pause) {
292 traceBegin(TTRACE_TAG_APPLICATION_MANAGER, "APPCORE:PAUSE");
293 _DBG("Call pause callback");
294 r = __context.ops.pause(__context.data);
295 traceEnd(TTRACE_TAG_APPLICATION_MANAGER);
298 if (r >= 0 && __context.resource_reclaiming)
299 appcore_base_add_suspend_timer();
301 __context.state = AS_PAUSED;
302 __prepare_to_suspend();
304 aul_status_update(STATUS_BG);
307 static void __do_resume(void)
309 if (__context.state == AS_PAUSED || __context.state == AS_CREATED) {
310 __exit_from_suspend();
311 if (__context.ops.resume) {
312 LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:resume:start]", __context.appid);
313 traceBegin(TTRACE_TAG_APPLICATION_MANAGER, "APPCORE:RESUME");
314 _DBG("Call resume callback");
315 __context.ops.resume(__context.data);
316 traceEnd(TTRACE_TAG_APPLICATION_MANAGER);
317 LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:resume:done]", __context.appid);
319 __context.state = AS_RUNNING;
322 aul_status_update(STATUS_VISIBLE);
325 static GSList *__find_win(unsigned int win)
330 for (iter = g_winnode_list; iter; iter = g_slist_next(iter)) {
332 if (t && t->win == win)
339 static int __get_main_window(void)
341 struct win_node *entry = NULL;
343 if (g_winnode_list != NULL) {
344 entry = g_winnode_list->data;
345 return (unsigned int) entry->win;
351 static int __get_main_surface(void)
353 struct win_node *entry = NULL;
355 if (g_winnode_list != NULL) {
356 entry = g_winnode_list->data;
357 return (unsigned int) entry->surf;
363 static bool __add_win(unsigned int win, unsigned int surf)
368 _DBG("[EVENT_TEST][EVENT] __add_win WIN:%x\n", win);
373 _DBG("[EVENT_TEST][EVENT] ERROR There is already window : %x \n", win);
377 t = calloc(1, sizeof(struct win_node));
383 t->bfobscured = FALSE;
385 g_winnode_list = g_slist_append(g_winnode_list, t);
390 static bool __delete_win(unsigned int win)
397 _DBG("[EVENT_TEST][EVENT] ERROR There is no window : %x \n",
403 g_winnode_list = g_slist_delete_link(g_winnode_list, f);
408 static bool __update_win(unsigned int win, unsigned int surf, bool bfobscured)
413 _DBG("[EVENT_TEST][EVENT] __update_win WIN:%x fully_obscured %d\n", win,
419 _DBG("[EVENT_TEST][EVENT] ERROR There is no window : %x \n", win);
423 t = (struct win_node *)f->data;
427 t->bfobscured = bfobscured;
432 static void __raise_win(void)
434 Ecore_Wl2_Window *win;
437 if (!(__context.hint & APPCORE_UI_BASE_HINT_WINDOW_STACK_CONTROL))
440 win_id = __get_main_window();
442 _DBG("Raise window: %d", win_id);
443 win = ecore_wl2_display_window_find(ecore_wl2_connected_display_get(NULL), win_id);
444 ecore_wl2_window_activate(win);
447 static void __pause_win(void)
449 Ecore_Wl2_Window *win;
450 GSList *wlist = g_winnode_list;
451 struct win_node *entry = NULL;
453 if (!(__context.hint & APPCORE_UI_BASE_HINT_WINDOW_STACK_CONTROL))
456 _DBG("Pause window");
461 _DBG("Pause window: %d", entry->win);
462 win = ecore_wl2_display_window_find(ecore_wl2_connected_display_get(NULL), entry->win);
463 ecore_wl2_window_iconified_set(win, EINA_TRUE);
469 static int __init_wl(void)
471 _DBG("initialize wayland");
472 dsp = wl_display_connect(NULL);
474 _ERR("Failed to connect wl display");
478 reg = wl_display_get_registry(dsp);
480 _ERR("Failed to get registry");
481 wl_display_disconnect(dsp);
485 wl_registry_add_listener(reg, ®_listener, NULL);
486 wl_display_roundtrip(dsp);
489 _ERR("Failed to get tizen policy interface");
490 wl_registry_destroy(reg);
491 wl_display_disconnect(dsp);
498 static void __finish_wl(void)
501 tizen_policy_destroy(tz_policy);
506 wl_registry_destroy(reg);
511 wl_display_disconnect(dsp);
516 static void __set_bg_state(void)
518 if (!tz_policy && __init_wl() < 0)
521 tizen_policy_set_background_state(tz_policy, getpid());
522 wl_display_roundtrip(dsp);
523 __context.bg_state = true;
524 _DBG("bg state: %d", __context.bg_state);
527 static void __unset_bg_state(void)
532 tizen_policy_unset_background_state(tz_policy, getpid());
533 wl_display_roundtrip(dsp);
534 __context.bg_state = false;
535 _DBG("bg state: %d", __context.bg_state);
538 static void __do_start(bundle *b)
540 const char *bg_launch;
541 const char *below_app;
543 if (__context.hint & APPCORE_UI_BASE_HINT_WINDOW_STACK_CONTROL) {
544 if (__context.below_app) {
545 free(__context.below_app);
546 __context.below_app = NULL;
549 below_app = bundle_get_val(b, AUL_SVC_K_RELOCATE_BELOW);
551 __context.below_app = strdup(below_app);
555 first_launch = FALSE;
559 if (__context.hint & APPCORE_UI_BASE_HINT_BG_LAUNCH_CONTROL) {
560 bg_launch = bundle_get_val(b, AUL_SVC_K_BG_LAUNCH);
561 if (bg_launch && strcmp(bg_launch, "enable") == 0) {
562 if (!__context.bg_state &&
563 __context.state != AS_RUNNING)
566 if (__context.bg_state)
571 if (__context.hint & APPCORE_UI_BASE_HINT_WINDOW_AUTO_CONTROL) {
572 if (!__context.bg_state)
577 static int __is_legacy_lifecycle(void)
579 static int is_legacy = -1;
580 const char *api_version;
585 api_version = getenv("TIZEN_API_VERSION");
587 if (strverscmp("2.4", api_version) > 0 &&
588 strverscmp("2.2.1", api_version) < 0)
599 EXPORT_API int appcore_ui_base_on_receive(aul_type type, bundle *b)
601 if (__context.state == AS_DYING) {
602 _ERR("Skip the event in dying state");
606 if (type == AUL_TERMINATE_BGAPP && __context.state != AS_PAUSED)
609 if (type == AUL_START)
610 __exit_from_suspend();
612 appcore_base_on_receive(type, b);
617 if (__context.hint & APPCORE_UI_BASE_HINT_LEGACY_CONTROL) {
618 if (!__context.bg_state && __is_legacy_lifecycle()) {
619 _DBG("Legacy lifecycle");
625 if (__context.bg_state)
631 case AUL_TERMINATE_BGAPP:
632 _DBG("[APP %d] is paused. TERMINATE", getpid());
633 __context.state = AS_DYING;
634 aul_status_update(STATUS_DYING);
635 if (__context.ops.base.exit)
636 __context.ops.base.exit(__context.data);
648 static void __add_ecore_events(void)
650 __context.hshow = ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_SHOW,
651 __stub_show_cb, NULL);
652 if (!__context.hshow)
653 _ERR("Failed to add ECORE_WL_EVENT_WINDOW_SHOW event");
655 __context.hhide = ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_HIDE,
656 __stub_hide_cb, NULL);
657 if (!__context.hhide)
658 _ERR("Failed to add ECORE_WL_EVENT_WINDOW_HIDE event");
660 __context.hvchange = ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_VISIBILITY_CHANGE,
661 __stub_visibility_cb, NULL);
662 if (!__context.hvchange)
663 _ERR("Failed to add ECORE_WL_EVENT_WINDOW_VISIBILITY_CHANGE event");
665 __context.hlower = ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_LOWER,
666 __stub_lower_cb, NULL);
667 if (!__context.hlower)
668 _ERR("Failed to add ECORE_WL_EVENT_WINDOW_LOWER event");
670 __context.hpvchange = ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_PRE_VISIBILITY_CHANGE,
671 __stub_pre_visibility_cb, NULL);
672 if (!__context.hpvchange)
673 _ERR("Failed to add ECORE_WL_EVENT_WINDOW_PRE_VISIBILITY_CHANGE event");
676 static void __del_ecore_events(void)
678 if (__context.hshow) {
679 ecore_event_handler_del(__context.hshow);
680 __context.hshow = NULL;
683 if (__context.hhide) {
684 ecore_event_handler_del(__context.hhide);
685 __context.hhide = NULL;
688 if (__context.hvchange) {
689 ecore_event_handler_del(__context.hvchange);
690 __context.hvchange = NULL;
693 if (__context.hlower) {
694 ecore_event_handler_del(__context.hlower);
695 __context.hlower = NULL;
698 if (__context.hpvchange) {
699 ecore_event_handler_del(__context.hpvchange);
700 __context.hpvchange = NULL;
704 EXPORT_API int appcore_ui_base_on_create(void)
706 __add_ecore_events();
707 appcore_base_on_create();
708 __context.state = AS_CREATED;
709 LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:create:done]", __context.appid);
714 EXPORT_API int appcore_ui_base_on_terminate(void)
716 if (__context.state == AS_RUNNING) {
717 if (__context.ops.pause) {
718 _DBG("Call pause callback");
719 __context.ops.pause(__context.data);
723 __context.state = AS_DYING;
725 appcore_base_on_terminate();
730 EXPORT_API int appcore_ui_base_on_pause(void)
735 EXPORT_API int appcore_ui_base_on_resume(void)
740 EXPORT_API int appcore_ui_base_on_control(bundle *b)
742 LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:reset:start]", __context.appid);
743 appcore_base_on_control(b);
744 LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:reset:done]", __context.appid);
749 static void __group_attach()
751 if (!(__context.hint & APPCORE_UI_BASE_HINT_WINDOW_GROUP_CONTROL))
754 appcore_ui_base_group_add();
757 static void __group_lower()
759 if (!(__context.hint & APPCORE_UI_BASE_HINT_WINDOW_GROUP_CONTROL))
761 appcore_ui_base_group_remove();
764 EXPORT_API void appcore_ui_base_group_add()
766 static bool attached = false;
768 _DBG("__group_attach");
772 int wid = __get_main_surface();
774 _ERR("window wasn't ready");
778 aul_app_group_set_window(wid);
782 EXPORT_API void appcore_ui_base_group_remove()
786 _DBG("__group_lower");
787 aul_app_group_lower(&exit);
789 _DBG("__group_lower : sub-app!");
790 if (__context.ops.base.exit)
791 __context.ops.base.exit(__context.data);
795 EXPORT_API void appcore_ui_base_window_on_show(int type, void *event)
797 Ecore_Wl2_Event_Window_Show *ev;
800 if (ev->parent_win != 0) {
801 /* This is child window. Skip!!! */
805 _DBG("[EVENT_TEST][EVENT] GET SHOW EVENT!!!. WIN:%x, %d\n", ev->win, ev->data[0]);
807 if (!__find_win((unsigned int)ev->win))
808 __add_win((unsigned int)ev->win, (unsigned int)ev->data[0]);
810 __update_win((unsigned int)ev->win, (unsigned int)ev->data[0], FALSE);
812 if (ev->data[0] != 0)
816 static bool __check_visible(void)
819 struct win_node *entry = NULL;
821 _DBG("[EVENT_TEST][EVENT] __check_visible\n");
823 for (iter = g_winnode_list; iter != NULL; iter = g_slist_next(iter)) {
825 _DBG("win : %x obscured : %d\n", entry->win, entry->bfobscured);
826 if (entry->bfobscured == FALSE)
833 EXPORT_API void appcore_ui_base_window_on_hide(int type, void *event)
835 Ecore_Wl2_Event_Window_Hide *ev;
839 _DBG("[EVENT_TEST][EVENT] GET HIDE EVENT!!!. WIN:%x\n", ev->win);
841 if (__find_win((unsigned int)ev->win)) {
842 __delete_win((unsigned int)ev->win);
843 bvisibility = __check_visible();
844 if (!bvisibility && w_status != WS_PAUSE) {
845 _DBG(" Go to Pasue state \n");
852 EXPORT_API void appcore_ui_base_window_on_lower(int type, void *event)
854 Ecore_Wl2_Event_Window_Lower *ev;
859 _DBG("ECORE_WL2_EVENT_WINDOW_LOWER window id:%u\n", ev->win);
863 EXPORT_API void appcore_ui_base_window_on_visibility(int type, void *event)
865 Ecore_Wl2_Event_Window_Visibility_Change *ev;
869 __update_win((unsigned int)ev->win, 0, ev->fully_obscured);
870 bvisibility = __check_visible();
872 _DBG("bvisibility %d, w_status %d", bvisibility, w_status);
874 if (bvisibility && (__context.hint & APPCORE_UI_BASE_HINT_WINDOW_STACK_CONTROL) &&
875 __context.below_app) {
876 aul_app_group_activate_below(__context.below_app);
877 free(__context.below_app);
878 __context.below_app = NULL;
881 if (bvisibility && w_status != WS_RESUME) {
882 _DBG(" Go to Resume state\n");
883 w_status = WS_RESUME;
885 } else if (!bvisibility && w_status != WS_PAUSE) {
886 _DBG(" Go to Pasue state \n");
890 _DBG(" No change state \n");
895 EXPORT_API void appcore_ui_base_window_on_pre_visibility(int type, void *event)
897 Ecore_Wl2_Event_Window_Pre_Visibility_Change *ev = event;
900 if (ev && ev->type == ECORE_WL2_WINDOW_VISIBILITY_TYPE_PRE_UNOBSCURED) {
901 __update_win((unsigned int)ev->win, 0, false);
902 bvisibility = __check_visible();
904 _DBG("bvisibility %d, w_status %d", bvisibility, w_status);
905 if (bvisibility && w_status != WS_RESUME) {
906 _DBG(" Go to Resume state\n");
907 w_status = WS_RESUME;
913 EXPORT_API int appcore_ui_base_init(appcore_ui_base_ops ops, int argc, char **argv,
914 void *data, unsigned int hint)
916 const char *bg_launch;
918 char appid[PATH_MAX] = {0, };
921 if (!ecore_wl2_init()) {
922 _ERR("could not wl2 init");
926 ecore_wl2_display_connect(NULL);
927 appcore_ui_plugin_init(&ops, argc, argv, &hint);
928 ret = aul_app_get_appid_bypid(getpid(), appid, sizeof(appid));
930 _ERR("Fail to get appid (%d)", getpid());
934 __context.data = data;
935 __context.argc = argc;
936 __context.argv = argv;
937 __context.hint = hint;
938 __context.state = AS_NONE;
939 __context.appid = strdup(appid);
940 __context.resource_reclaiming = true;
942 LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:main:done]", appid);
943 if (__context.hint & APPCORE_UI_BASE_HINT_BG_LAUNCH_CONTROL) {
944 b = bundle_import_from_argv(argc, argv);
946 bg_launch = bundle_get_val(b, AUL_SVC_K_BG_LAUNCH);
947 if (bg_launch && strcmp(bg_launch, "enable") == 0)
954 return appcore_base_init(ops.base, argc, argv, data);
957 EXPORT_API void appcore_ui_base_fini(void)
959 __del_ecore_events();
962 free(__context.appid);
963 __context.appid = NULL;
966 appcore_ui_plugin_fini();
967 _ERR("disconnect wl2_display");
968 ecore_wl2_display_disconnect(ecore_wl2_connected_display_get(NULL));
969 ecore_wl2_shutdown();
972 EXPORT_API void appcore_ui_base_pause(void)
977 EXPORT_API void appcore_ui_base_resume(void)
982 EXPORT_API bool appcore_ui_base_is_resumed(void)
984 return __context.state == AS_RUNNING;
987 EXPORT_API void appcore_ui_base_exit(void)
989 if (__context.ops.base.exit)
990 __context.ops.base.exit(__context.data);
993 EXPORT_API unsigned int appcore_ui_base_get_main_window(void)
995 return __get_main_window();
998 EXPORT_API unsigned int appcore_ui_base_get_main_surface(void)
1000 return __get_main_surface();
1003 EXPORT_API int appcore_ui_base_get_hint(void)
1005 return __context.hint;
1008 EXPORT_API bool appcore_ui_base_get_bg_state(void)
1010 return __context.bg_state;
1013 EXPORT_API void appcore_ui_base_set_bg_state(bool bg_state)
1015 __context.bg_state = bg_state;
1018 EXPORT_API void appcore_ui_base_set_system_resource_reclaiming(bool enable)
1020 __context.resource_reclaiming = enable;
1023 static int __on_receive(aul_type type, bundle *b, void *data)
1025 return appcore_ui_base_on_receive(type, b);
1028 static int __on_create(void *data)
1030 return appcore_ui_base_on_create();
1033 static int __on_terminate(void *data)
1035 return appcore_ui_base_on_terminate();
1038 static int __on_pause(void *data)
1040 return appcore_ui_base_on_pause();
1043 static int __on_resume(void *data)
1045 return appcore_ui_base_on_resume();
1048 static void __window_on_show(int type, void *event, void *data)
1050 appcore_ui_base_window_on_show(type, event);
1053 static void __window_on_hide(int type, void *event, void *data)
1055 appcore_ui_base_window_on_hide(type, event);
1058 static void __window_on_lower(int type, void *event, void *data)
1060 appcore_ui_base_window_on_lower(type, event);
1063 static void __window_on_visibility(int type, void *event, void *data)
1065 appcore_ui_base_window_on_visibility(type, event);
1068 static void __window_on_pre_visibility(int type, void *event, void *data)
1070 appcore_ui_base_window_on_pre_visibility(type, event);
1073 EXPORT_API appcore_ui_base_ops appcore_ui_base_get_default_ops(void)
1075 appcore_ui_base_ops ops;
1077 ops.base = appcore_base_get_default_ops();
1079 /* override methods */
1080 ops.base.create = __on_create;
1081 ops.base.terminate = __on_terminate;
1082 ops.base.receive = __on_receive;
1083 ops.base.init = NULL;
1084 ops.base.finish = NULL;
1085 ops.base.run = NULL;
1086 ops.base.exit = NULL;
1088 ops.pause = __on_pause;
1089 ops.resume = __on_resume;
1090 ops.window.show = __window_on_show;
1091 ops.window.hide = __window_on_hide;
1092 ops.window.lower = __window_on_lower;
1093 ops.window.visibility = __window_on_visibility;
1094 ops.window.pre_visibility = __window_on_pre_visibility;