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>
22 #include <voice_control_elm.h>
23 #include <voice_control_elm_private.h>
25 #include "appcore_efl_base_private.h"
26 #include "appcore_efl_base.h"
28 static int __efl_app_init(int argc, char **argv, void *data)
32 int is_vc_vt_automode = 0;
37 r = vc_elm_is_supported_vt_auto(&is_vc_vt_automode);
39 _ERR("[VC] Failed to get vconfkey of vt_automode");
41 if (is_vc_vt_automode) {
43 vc_elm_set_auto_register_mode(2, 0);
47 hint = appcore_efl_base_get_hint();
48 if (hint & APPCORE_EFL_BASE_HINT_HW_ACC_CONTROL) {
49 hwacc = getenv("HWACC");
51 _DBG("elm_config_accel_preference_set is not called");
52 } else if (strcmp(hwacc, "USE") == 0) {
53 elm_config_accel_preference_set("hw");
54 _DBG("elm_config_accel_preference_set : hw");
55 } else if (strcmp(hwacc, "NOT_USE") == 0) {
56 elm_config_accel_preference_set("none");
57 _DBG("elm_config_accel_preference_set : none");
59 _DBG("elm_config_accel_preference_set is not called");
66 static void __efl_app_finish(void)
69 int is_vc_vt_automode = 0;
71 r = vc_elm_is_supported_vt_auto(&is_vc_vt_automode);
73 _ERR("[VC] Failed to get vconfkey of vt_automode");
75 if (is_vc_vt_automode)
76 vc_elm_deinitialize();
81 /* Check loader case */
82 if (getenv("AUL_LOADER_INIT")) {
83 unsetenv("AUL_LOADER_INIT");
88 static void __efl_app_run(void *data)
93 static void __efl_app_exit(void *data)
98 EXPORT_API int appcore_efl_base_init(appcore_efl_base_ops ops, int argc,
99 char **argv, void *data, unsigned int hint)
101 return appcore_ui_base_init(ops.ui_base, argc, argv, data, hint);
104 EXPORT_API void appcore_efl_base_fini(void)
106 appcore_ui_base_fini();
109 EXPORT_API appcore_efl_base_ops appcore_efl_base_get_default_ops(void)
111 appcore_efl_base_ops ops;
113 ops.ui_base = appcore_ui_base_get_default_ops();
115 /* override methods */
116 ops.ui_base.base.init = __efl_app_init;
117 ops.ui_base.base.finish = __efl_app_finish;
118 ops.ui_base.base.run = __efl_app_run;
119 ops.ui_base.base.exit = __efl_app_exit;
124 EXPORT_API int appcore_efl_base_on_receive(aul_type type, bundle *b)
126 return appcore_ui_base_on_receive(type, b);
129 EXPORT_API int appcore_efl_base_on_create(void)
131 return appcore_ui_base_on_create();
134 EXPORT_API int appcore_efl_base_on_terminate(void)
136 return appcore_ui_base_on_terminate();
139 EXPORT_API int appcore_efl_base_on_pause(void)
141 return appcore_ui_base_on_pause();
144 EXPORT_API int appcore_efl_base_on_resume(void)
146 return appcore_ui_base_on_resume();
149 EXPORT_API int appcore_efl_base_on_control(bundle *b)
151 return appcore_ui_base_on_control(b);
154 EXPORT_API void appcore_efl_base_window_on_show(int type, void *event)
156 appcore_ui_base_window_on_show(type, event);
159 EXPORT_API void appcore_efl_base_window_on_hide(int type, void *event)
161 appcore_ui_base_window_on_hide(type, event);
164 EXPORT_API void appcore_efl_base_window_on_lower(int type, void *event)
166 appcore_ui_base_window_on_lower(type, event);
169 EXPORT_API void appcore_efl_base_window_on_visibility(int type, void *event)
171 appcore_ui_base_window_on_visibility(type, event);
174 EXPORT_API void appcore_efl_base_pause(void)
176 appcore_ui_base_pause();
179 EXPORT_API void appcore_efl_base_resume(void)
181 appcore_ui_base_resume();
184 EXPORT_API bool appcore_efl_base_is_resumed(void)
186 return appcore_ui_base_is_resumed();
189 EXPORT_API void appcore_efl_base_exit(void)
191 appcore_ui_base_exit();
194 EXPORT_API void appcore_efl_base_group_add(void)
196 appcore_ui_base_group_add();
199 EXPORT_API void appcore_efl_base_group_remove(void)
201 appcore_ui_base_group_remove();
204 EXPORT_API unsigned int appcore_efl_base_get_main_window(void)
206 return appcore_ui_base_get_main_window();
209 EXPORT_API unsigned int appcore_efl_base_get_main_surface(void)
211 return appcore_ui_base_get_main_surface();
214 EXPORT_API int appcore_efl_base_get_hint(void)
216 return appcore_ui_base_get_hint();