2 * Copyright (c) 2017 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.
21 #include <Elementary.h>
23 #include "appcore_efl_base_private.h"
24 #include "appcore_efl_base.h"
26 static int __efl_app_init(int argc, char **argv, void *data)
33 hint = appcore_efl_base_get_hint();
34 if (hint & APPCORE_EFL_BASE_HINT_HW_ACC_CONTROL) {
35 hwacc = getenv("HWACC");
37 _DBG("elm_config_accel_preference_set is not called");
38 } else if (strcmp(hwacc, "USE") == 0) {
39 elm_config_accel_preference_set("hw");
40 _DBG("elm_config_accel_preference_set : hw");
41 } else if (strcmp(hwacc, "NOT_USE") == 0) {
42 elm_config_accel_preference_set("none");
43 _DBG("elm_config_accel_preference_set : none");
45 _DBG("elm_config_accel_preference_set is not called");
52 static void __efl_app_finish(void)
56 /* Check loader case */
57 if (getenv("AUL_LOADER_INIT")) {
58 unsetenv("AUL_LOADER_INIT");
63 static void __efl_app_run(void *data)
68 static void __efl_app_exit(void *data)
73 EXPORT_API int appcore_efl_base_init(appcore_efl_base_ops ops, int argc,
74 char **argv, void *data, unsigned int hint)
76 return appcore_ui_base_init(ops.ui_base, argc, argv, data, hint);
79 EXPORT_API void appcore_efl_base_fini(void)
81 appcore_ui_base_fini();
84 EXPORT_API appcore_efl_base_ops appcore_efl_base_get_default_ops(void)
86 appcore_efl_base_ops ops;
88 ops.ui_base = appcore_ui_base_get_default_ops();
90 /* override methods */
91 ops.ui_base.base.init = __efl_app_init;
92 ops.ui_base.base.finish = __efl_app_finish;
93 ops.ui_base.base.run = __efl_app_run;
94 ops.ui_base.base.exit = __efl_app_exit;
99 EXPORT_API int appcore_efl_base_on_receive(aul_type type, bundle *b)
101 return appcore_ui_base_on_receive(type, b);
104 EXPORT_API int appcore_efl_base_on_create(void)
106 return appcore_ui_base_on_create();
109 EXPORT_API int appcore_efl_base_on_terminate(void)
111 return appcore_ui_base_on_terminate();
114 EXPORT_API int appcore_efl_base_on_pause(void)
116 return appcore_ui_base_on_pause();
119 EXPORT_API int appcore_efl_base_on_resume(void)
121 return appcore_ui_base_on_resume();
124 EXPORT_API int appcore_efl_base_on_control(bundle *b)
126 return appcore_ui_base_on_control(b);
129 EXPORT_API void appcore_efl_base_window_on_show(int type, void *event)
131 appcore_ui_base_window_on_show(type, event);
134 EXPORT_API void appcore_efl_base_window_on_hide(int type, void *event)
136 appcore_ui_base_window_on_hide(type, event);
139 EXPORT_API void appcore_efl_base_window_on_lower(int type, void *event)
141 appcore_ui_base_window_on_lower(type, event);
144 EXPORT_API void appcore_efl_base_window_on_visibility(int type, void *event)
146 appcore_ui_base_window_on_visibility(type, event);
149 EXPORT_API void appcore_efl_base_pause(void)
151 appcore_ui_base_pause();
154 EXPORT_API void appcore_efl_base_resume(void)
156 appcore_ui_base_resume();
159 EXPORT_API bool appcore_efl_base_is_resumed(void)
161 return appcore_ui_base_is_resumed();
164 EXPORT_API void appcore_efl_base_exit(void)
166 appcore_ui_base_exit();
169 EXPORT_API void appcore_efl_base_group_add(void)
171 appcore_ui_base_group_add();
174 EXPORT_API void appcore_efl_base_group_remove(void)
176 appcore_ui_base_group_remove();
179 EXPORT_API unsigned int appcore_efl_base_get_main_window(void)
181 return appcore_ui_base_get_main_window();
184 EXPORT_API unsigned int appcore_efl_base_get_main_surface(void)
186 return appcore_ui_base_get_main_surface();
189 EXPORT_API int appcore_efl_base_get_hint(void)
191 return appcore_ui_base_get_hint();