4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
6 * Contact: MyoungJune Park <mj2004.park@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
23 #include <setting-profile.h>
25 /*///////////////////////////////////////////////////////////////////////////////////////// */
26 /* Player related codes - End */
27 /*///////////////////////////////////////////////////////////////////////////////////////// */
28 static void vp_del_win(void *data, Evas_Object *obj, void *event)
34 static Evas_Object *vp_create_win(const char *name, bool transparent)
40 eo = elm_win_add(NULL, name, ELM_WIN_BASIC);
43 elm_win_title_set(eo, name);
44 elm_win_conformant_set(eo, EINA_TRUE);
47 elm_win_alpha_set(eo, EINA_TRUE);
50 unsigned int opaqueVal = 1;
51 Ecore_X_Atom opaqueAtom = ecore_x_atom_get("_E_ILLUME_WINDOW_REGION_OPAQUE");
52 Ecore_X_Window xwin = elm_win_xwindow_get(eo);
53 ecore_x_window_prop_card32_set(xwin, opaqueAtom, &opaqueVal, 1);
57 evas_object_smart_callback_add(eo, "delete,request", vp_del_win, NULL);
58 //ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
59 //evas_object_resize(eo, w, h);
60 /*elm_win_screen_size_get(eo, NULL, NULL, &w, &h); */
61 /*evas_object_resize(eo, 100, 100); */
70 static void _vp_rot_changed_cb(void *data, Evas_Object *obj, void *event_info)
76 * The function is called to create Setting view widgets
78 static bool vp_app_create(void *data)
82 SettingProfileUG *ad = data;
85 ad->win_get = vp_create_win("org.tizen.setting.volume", TRUE);
86 if (ad->win_get == NULL) {
87 SETTING_TRACE("Can't create window");
91 UG_INIT_EFL(ad->win_get, UG_OPT_INDICATOR_DISABLE);
92 ad->evas = evas_object_evas_get(ad->win_get);
93 ad->viewtype = strdup(VOLUME_APP_NAME);
94 setting_sound_init(ad);
101 * The function is called when Setting is terminated
103 static void vp_app_terminate(void *data)
107 SettingProfileUG *ad = data;
109 SETTING_TRACE("volume_popup_terminate!");
111 evas_object_smart_callback_del(ad->win_get, "wm,rotation,changed", _vp_rot_changed_cb);
112 setting_sound_deinit(ad);
114 evas_object_del(ad->win_get);
121 * The function is called when Setting begins run in background from forground
123 static void vp_app_pause(void *data)
130 * The function is called when Setting begins run in forground from background
132 static void vp_app_resume(void *data)
138 * The function is called by app-fwk after app_create. It always do the process which cost much time.
140 static void vp_app_reset(app_control_h service, void *data)
144 /*SettingProfileUG *ad = data; */
147 static void vp_app_lang_changed(app_event_info_h event_info, void *data)
150 /*fingerprint_manager_appdata *ad = data; */
153 lang = vconf_get_str(VCONFKEY_LANGSET);
155 elm_language_set((const char *)lang);
161 int main(int argc, char *argv[])
167 ui_app_lifecycle_callback_s ops = {
168 .create = vp_app_create,
169 .terminate = vp_app_terminate,
170 .pause = vp_app_pause,
172 .resume = vp_app_resume,
173 .app_control = vp_app_reset,
177 app_event_handler_h handlers[5] = {NULL, };
178 ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, NULL, NULL);
179 ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, vp_app_lang_changed, NULL);
180 ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, NULL, NULL);
181 ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, NULL, NULL);
183 memset(&ad, 0x00, sizeof(SettingProfileUG));
185 r = ui_app_main(argc, argv, &ops, &ad);
186 SETTING_TRACE("r = %d", r);
189 SETTING_TRACE_ERROR("ui_app_main() returns -1");