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>
24 //#include <ui-gadget.h>
26 //#include <setting-common-general-func.h>
27 //#include <setting-common-draw-widget.h>
28 //#include <setting-common-resource.h>
30 ///////////////////////////////////////////////////////////////////////////////////////////
31 // Player related codes - End
32 ///////////////////////////////////////////////////////////////////////////////////////////
34 static void vp_del_win(void *data, Evas_Object *obj, void *event)
40 static Evas_Object *vp_create_win(const char *name, bool transparent)
46 eo = elm_win_add(NULL, name, ELM_WIN_BASIC);
50 elm_win_title_set(eo, name);
51 elm_win_conformant_set(eo,EINA_TRUE);
55 elm_win_alpha_set(eo, EINA_TRUE);
58 unsigned int opaqueVal = 1;
59 Ecore_X_Atom opaqueAtom = ecore_x_atom_get("_E_ILLUME_WINDOW_REGION_OPAQUE");
60 Ecore_X_Window xwin = elm_win_xwindow_get(eo);
61 ecore_x_window_prop_card32_set(xwin, opaqueAtom, &opaqueVal, 1);
65 evas_object_smart_callback_add(eo, "delete,request", vp_del_win, NULL);
66 //elm_win_screen_size_get(eo, NULL, NULL, &w, &h);
67 //ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
68 //evas_object_resize(eo, w, h);
69 //evas_object_resize(eo, 100, 100);
81 static void _vp_rot_changed_cb(void *data, Evas_Object *obj, void *event_info)
87 * The function is called to create Setting view widgets
89 static bool vp_app_create(void *data)
93 SettingProfileUG *ad = data;
96 ad->win_get = vp_create_win("org.tizen.setting.volume", TRUE);
97 //ad->win_get = vp_create_win("org.tizen.setting.volume", FALSE);
98 if(ad->win_get == NULL)
100 SETTING_TRACE("Can't create window");
104 #if 0 /*Fixed PLM bug P141120-07682, no need to support roation*/
105 if(elm_win_wm_rotation_supported_get(ad->win_get))
107 const int rots[4] = {0, 90, 180, 270};
108 elm_win_wm_rotation_available_rotations_set(ad->win_get, rots, 4);
110 evas_object_smart_callback_add(ad->win_get, "wm,rotation,changed", _vp_rot_changed_cb, ad);
113 //ea_theme_changeable_ui_enabled_set(TRUE);
115 UG_INIT_EFL(ad->win_get, UG_OPT_INDICATOR_DISABLE);
116 ad->evas = evas_object_evas_get(ad->win_get);
117 ad->viewtype = strdup(VOLUME_APP_NAME);
118 setting_sound_init(ad);
125 * The function is called when Setting is terminated
127 static void vp_app_terminate(void *data)
131 SettingProfileUG *ad = data;
133 SETTING_TRACE("volume_popup_terminate!");
135 evas_object_smart_callback_del(ad->win_get, "wm,rotation,changed", _vp_rot_changed_cb);
136 setting_sound_deinit(ad);
138 evas_object_del(ad->win_get);
147 * The function is called when Setting begins run in background from forground
149 static void vp_app_pause(void *data)
156 * The function is called when Setting begins run in forground from background
158 static void vp_app_resume(void *data)
164 * The function is called by app-fwk after app_create. It always do the process which cost much time.
166 static void vp_app_reset(app_control_h service, void *data)
170 //SettingProfileUG *ad = data;
173 static void vp_app_lang_changed(void *data)
176 //fingerprint_manager_appdata *ad = data;
179 lang = vconf_get_str(VCONFKEY_LANGSET);
182 elm_language_set((const char *)lang);
188 int main(int argc, char *argv[])
194 app_event_callback_s ops = {
195 .create = vp_app_create,
196 .terminate = vp_app_terminate,
197 .pause = vp_app_pause,
198 .resume = vp_app_resume,
199 .app_control = vp_app_reset,
201 .language_changed = vp_app_lang_changed,
202 .region_format_changed = NULL,
203 .device_orientation = NULL,
206 memset(&ad, 0x00, sizeof(SettingProfileUG));
208 r = app_efl_main(&argc, &argv, &ops, &ad);
209 SETTING_TRACE("r = %d", r);
213 SETTING_TRACE_ERROR("app_efl_main() returns -1");