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);
49 unsigned int opaqueVal = 1;
50 Ecore_X_Atom opaqueAtom = ecore_x_atom_get("_E_ILLUME_WINDOW_REGION_OPAQUE");
51 Ecore_X_Window xwin = elm_win_xwindow_get(eo);
52 ecore_x_window_prop_card32_set(xwin, opaqueAtom, &opaqueVal, 1);
55 evas_object_smart_callback_add(eo, "delete,request", vp_del_win, NULL);
56 //ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
57 //evas_object_resize(eo, w, h);
58 /*elm_win_screen_size_get(eo, NULL, NULL, &w, &h); */
59 /*evas_object_resize(eo, 100, 100); */
68 static void _vp_rot_changed_cb(void *data, Evas_Object *obj, void *event_info)
74 * The function is called to create Setting view widgets
76 static bool vp_app_create(void *data)
80 SettingProfileUG *ad = data;
83 ad->win_get = vp_create_win("org.tizen.setting.volume", TRUE);
84 if (ad->win_get == NULL) {
85 SETTING_TRACE("Can't create window");
89 UG_INIT_EFL(ad->win_get, UG_OPT_INDICATOR_DISABLE);
90 ad->evas = evas_object_evas_get(ad->win_get);
91 ad->viewtype = strdup(VOLUME_APP_NAME);
92 setting_sound_init(ad);
99 * The function is called when Setting is terminated
101 static void vp_app_terminate(void *data)
105 SettingProfileUG *ad = data;
107 SETTING_TRACE("volume_popup_terminate!");
109 evas_object_smart_callback_del(ad->win_get, "wm,rotation,changed", _vp_rot_changed_cb);
110 setting_sound_deinit(ad);
112 evas_object_del(ad->win_get);
119 * The function is called when Setting begins run in background from forground
121 static void vp_app_pause(void *data)
128 * The function is called when Setting begins run in forground from background
130 static void vp_app_resume(void *data)
136 * The function is called by app-fwk after app_create. It always do the process which cost much time.
138 static void vp_app_reset(app_control_h service, void *data)
142 /*SettingProfileUG *ad = data; */
145 static void vp_app_lang_changed(app_event_info_h event_info, void *data)
148 /*fingerprint_manager_appdata *ad = data; */
151 lang = vconf_get_str(VCONFKEY_LANGSET);
153 elm_language_set((const char *)lang);
159 int main(int argc, char *argv[])
165 ui_app_lifecycle_callback_s ops = {
166 .create = vp_app_create,
167 .terminate = vp_app_terminate,
168 .pause = vp_app_pause,
170 .resume = vp_app_resume,
171 .app_control = vp_app_reset,
175 app_event_handler_h handlers[5] = {NULL, };
176 ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, NULL, NULL);
177 ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, vp_app_lang_changed, NULL);
178 ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, NULL, NULL);
179 ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, NULL, NULL);
181 memset(&ad, 0x00, sizeof(SettingProfileUG));
183 r = ui_app_main(argc, argv, &ops, &ad);
184 SETTING_TRACE("r = %d", r);
187 SETTING_TRACE_ERROR("ui_app_main() returns -1");