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.
22 #include <Elementary.h>
24 #include "appcore_efl_base_private.h"
25 #include "appcore_efl_base.h"
27 static int __efl_app_init(int argc, char **argv, void *data)
34 hint = appcore_efl_base_get_hint();
35 if (hint & APPCORE_EFL_BASE_HINT_HW_ACC_CONTROL) {
36 hwacc = getenv("HWACC");
38 _DBG("elm_config_accel_preference_set is not called");
39 } else if (strcmp(hwacc, "USE") == 0) {
40 elm_config_accel_preference_set("hw");
41 _DBG("elm_config_accel_preference_set : hw");
42 } else if (strcmp(hwacc, "NOT_USE") == 0) {
43 elm_config_accel_preference_set("none");
44 _DBG("elm_config_accel_preference_set : none");
46 _DBG("elm_config_accel_preference_set is not called");
53 static void __efl_app_finish(void)
57 /* Check loader case */
58 if (getenv("AUL_LOADER_INIT")) {
59 unsetenv("AUL_LOADER_INIT");
64 static void __efl_app_run(void *data)
69 static void __efl_app_exit(void *data)
74 EXPORT_API int appcore_efl_base_init(appcore_efl_base_ops ops, int argc,
75 char **argv, void *data, unsigned int hint)
77 return appcore_ui_base_init(ops.ui_base, argc, argv, data, hint);
80 EXPORT_API void appcore_efl_base_fini(void)
82 appcore_ui_base_fini();
85 EXPORT_API appcore_efl_base_ops appcore_efl_base_get_default_ops(void)
87 appcore_efl_base_ops ops;
89 ops.ui_base = appcore_ui_base_get_default_ops();
91 /* override methods */
92 ops.ui_base.base.init = __efl_app_init;
93 ops.ui_base.base.finish = __efl_app_finish;
94 ops.ui_base.base.run = __efl_app_run;
95 ops.ui_base.base.exit = __efl_app_exit;
100 EXPORT_API int appcore_efl_base_on_receive(aul_type type, bundle *b)
102 return appcore_ui_base_on_receive(type, b);
105 EXPORT_API int appcore_efl_base_on_create(void)
107 return appcore_ui_base_on_create();
110 EXPORT_API int appcore_efl_base_on_terminate(void)
112 return appcore_ui_base_on_terminate();
115 EXPORT_API int appcore_efl_base_on_pause(void)
117 return appcore_ui_base_on_pause();
120 EXPORT_API int appcore_efl_base_on_resume(void)
122 return appcore_ui_base_on_resume();
125 EXPORT_API int appcore_efl_base_on_control(bundle *b)
127 return appcore_ui_base_on_control(b);
130 EXPORT_API void appcore_efl_base_window_on_show(int type, void *event)
132 appcore_ui_base_window_on_show(type, event);
135 EXPORT_API void appcore_efl_base_window_on_hide(int type, void *event)
137 appcore_ui_base_window_on_hide(type, event);
140 EXPORT_API void appcore_efl_base_window_on_lower(int type, void *event)
142 appcore_ui_base_window_on_lower(type, event);
145 EXPORT_API void appcore_efl_base_window_on_visibility(int type, void *event)
147 appcore_ui_base_window_on_visibility(type, event);
150 EXPORT_API void appcore_efl_base_pause(void)
152 appcore_ui_base_pause();
155 EXPORT_API void appcore_efl_base_resume(void)
157 appcore_ui_base_resume();
160 EXPORT_API bool appcore_efl_base_is_resumed(void)
162 return appcore_ui_base_is_resumed();
165 EXPORT_API void appcore_efl_base_exit(void)
167 appcore_ui_base_exit();
170 EXPORT_API void appcore_efl_base_group_add(void)
172 appcore_ui_base_group_add();
175 EXPORT_API void appcore_efl_base_group_remove(void)
177 appcore_ui_base_group_remove();
180 EXPORT_API unsigned int appcore_efl_base_get_main_window(void)
182 return appcore_ui_base_get_main_window();
185 EXPORT_API unsigned int appcore_efl_base_get_main_surface(void)
187 return appcore_ui_base_get_main_surface();
190 EXPORT_API int appcore_efl_base_get_hint(void)
192 return appcore_ui_base_get_hint();
195 EXPORT_API bool appcore_efl_base_get_bg_state(void)
197 return appcore_ui_base_get_bg_state();
200 EXPORT_API void appcore_efl_base_set_bg_state(bool bg_state)
202 appcore_ui_base_set_bg_state(bg_state);