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>
26 /*///////////////////////////////////////////////////////////////////////////////////////// */
27 /* Player related codes - End */
28 /*///////////////////////////////////////////////////////////////////////////////////////// */
29 static void vp_del_win(void *data, Evas_Object *obj, void *event)
35 static Evas_Object *vp_create_win(const char *name, bool transparent)
41 eo = elm_win_add(NULL, name, ELM_WIN_BASIC);
44 elm_win_title_set(eo, name);
45 elm_win_conformant_set(eo, EINA_TRUE);
48 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);
56 evas_object_smart_callback_add(eo, "delete,request", vp_del_win, NULL);
57 ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
58 evas_object_resize(eo, w, h);
59 /*elm_win_screen_size_get(eo, NULL, NULL, &w, &h); */
60 /*evas_object_resize(eo, 100, 100); */
69 static void _vp_rot_changed_cb(void *data, Evas_Object *obj, void *event_info)
75 * The function is called to create Setting view widgets
77 static bool vp_app_create(void *data)
81 SettingProfileUG *ad = data;
84 ad->win_get = vp_create_win("org.tizen.setting.volume", TRUE);
85 if (ad->win_get == NULL) {
86 SETTING_TRACE("Can't create window");
90 UG_INIT_EFL(ad->win_get, UG_OPT_INDICATOR_DISABLE);
91 ad->evas = evas_object_evas_get(ad->win_get);
92 ad->viewtype = strdup(VOLUME_APP_NAME);
93 setting_sound_init(ad);
100 * The function is called when Setting is terminated
102 static void vp_app_terminate(void *data)
106 SettingProfileUG *ad = data;
108 SETTING_TRACE("volume_popup_terminate!");
110 evas_object_smart_callback_del(ad->win_get, "wm,rotation,changed", _vp_rot_changed_cb);
111 setting_sound_deinit(ad);
113 evas_object_del(ad->win_get);
120 * The function is called when Setting begins run in background from forground
122 static void vp_app_pause(void *data)
129 * The function is called when Setting begins run in forground from background
131 static void vp_app_resume(void *data)
137 * The function is called by app-fwk after app_create. It always do the process which cost much time.
139 static void vp_app_reset(app_control_h service, void *data)
143 /*SettingProfileUG *ad = data; */
146 static void vp_app_lang_changed(app_event_info_h event_info, void *data)
149 /*fingerprint_manager_appdata *ad = data; */
152 lang = vconf_get_str(VCONFKEY_LANGSET);
154 elm_language_set((const char *)lang);
160 int main(int argc, char *argv[])
166 ui_app_lifecycle_callback_s ops = {
167 .create = vp_app_create,
168 .terminate = vp_app_terminate,
169 .pause = vp_app_pause,
171 .resume = vp_app_resume,
172 .app_control = vp_app_reset,
176 app_event_handler_h handlers[5] = {NULL, };
177 ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, NULL, NULL);
178 ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, vp_app_lang_changed, NULL);
179 ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, NULL, NULL);
180 ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, NULL, NULL);
182 memset(&ad, 0x00, sizeof(SettingProfileUG));
184 r = ui_app_main(argc, argv, &ops, &ad);
185 SETTING_TRACE("r = %d", r);
188 SETTING_TRACE_ERROR("ui_app_main() returns -1");