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);
49 elm_win_title_set(eo, name);
50 elm_win_conformant_set(eo, EINA_TRUE);
53 elm_win_alpha_set(eo, EINA_TRUE);
56 unsigned int opaqueVal = 1;
57 Ecore_X_Atom opaqueAtom = ecore_x_atom_get("_E_ILLUME_WINDOW_REGION_OPAQUE");
58 Ecore_X_Window xwin = elm_win_xwindow_get(eo);
59 ecore_x_window_prop_card32_set(xwin, opaqueAtom, &opaqueVal, 1);
63 evas_object_smart_callback_add(eo, "delete,request", vp_del_win, NULL);
75 static void _vp_rot_changed_cb(void *data, Evas_Object *obj, void *event_info)
81 * The function is called to create Setting view widgets
83 static bool vp_app_create(void *data)
87 SettingProfileUG *ad = data;
90 ad->win_get = vp_create_win("org.tizen.setting.volume", TRUE);
91 /*ad->win_get = vp_create_win("org.tizen.setting.volume", FALSE); */
92 if (ad->win_get == NULL) {
93 SETTING_TRACE("Can't create window");
97 #if 0 /*Fixed PLM bug P141120-07682, no need to support roation*/
98 if (elm_win_wm_rotation_supported_get(ad->win_get)) {
99 const int rots[4] = {0, 90, 180, 270};
100 elm_win_wm_rotation_available_rotations_set(ad->win_get, rots, 4);
102 evas_object_smart_callback_add(ad->win_get, "wm,rotation,changed", _vp_rot_changed_cb, ad);
105 /*ea_theme_changeable_ui_enabled_set(TRUE); */
107 UG_INIT_EFL(ad->win_get, UG_OPT_INDICATOR_DISABLE);
108 ad->evas = evas_object_evas_get(ad->win_get);
109 ad->viewtype = strdup(VOLUME_APP_NAME);
110 setting_sound_init(ad);
117 * The function is called when Setting is terminated
119 static void vp_app_terminate(void *data)
123 SettingProfileUG *ad = data;
125 SETTING_TRACE("volume_popup_terminate!");
127 evas_object_smart_callback_del(ad->win_get, "wm,rotation,changed", _vp_rot_changed_cb);
128 setting_sound_deinit(ad);
130 evas_object_del(ad->win_get);
139 * The function is called when Setting begins run in background from forground
141 static void vp_app_pause(void *data)
148 * The function is called when Setting begins run in forground from background
150 static void vp_app_resume(void *data)
156 * The function is called by app-fwk after app_create. It always do the process which cost much time.
158 static void vp_app_reset(app_control_h service, void *data)
162 /*SettingProfileUG *ad = data; */
165 static void vp_app_lang_changed(void *data)
168 /*fingerprint_manager_appdata *ad = data; */
171 lang = vconf_get_str(VCONFKEY_LANGSET);
173 elm_language_set((const char *)lang);
179 int main(int argc, char *argv[])
185 app_event_callback_s ops = {
186 .create = vp_app_create,
187 .terminate = vp_app_terminate,
188 .pause = vp_app_pause,
189 .resume = vp_app_resume,
190 .app_control = vp_app_reset,
192 .language_changed = vp_app_lang_changed,
193 .region_format_changed = NULL,
194 .device_orientation = NULL,
197 memset(&ad, 0x00, sizeof(SettingProfileUG));
199 r = app_efl_main(&argc, &argv, &ops, &ad);
200 SETTING_TRACE("r = %d", r);
203 SETTING_TRACE_ERROR("app_efl_main() returns -1");