1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
/*
* lbs-setting
*
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include <app.h>
#include <glib.h>
#include <vconf.h>
#include <Elementary.h>
#include <lbs-setting-common.h>
#include <Elementary.h>
#include <libintl.h>
#include <dlog.h>
#include <app_control.h>
#include <app_control_internal.h>
#include <efl_extension.h>
#include "lbs-setting-window.h"
#include "lbs-setting-help.h"
#include "lbs-setting-common.h"
static lbs_setting_app_data *global_ad;
lbs_setting_app_data *lbs_setting_common_get_app_data(void)
{
LS_FUNC_ENTER
return global_ad;
}
void lbs_setting_common_destroy_app_data(void)
{
LS_FUNC_ENTER
/* TODO */
LS_LOGI("Not Implemented");
return;
}
static bool _app_create_cb(void *user_data)
{
LS_FUNC_ENTER
return true;
}
static void _app_terminate_cb(void *user_data)
{
LS_FUNC_ENTER
}
static void _app_pause_cb(void *user_data)
{
LS_FUNC_ENTER
/* Nothing */
}
static void _app_resume_cb(void *user_data)
{
LS_FUNC_ENTER
/* Nothing coz thre is nothing when paused */
}
static void _app_control_cb(app_control_h app_control, void *user_data)
{
LS_FUNC_ENTER
gboolean ret = FALSE;
lbs_setting_app_data *ad = (lbs_setting_app_data *) user_data;
LS_RETURN_IF_FAILED(ad);
elm_app_base_scale_set(2.6);
elm_config_accel_preference_set("3d");
if (ad->win_main) {
evas_object_del(ad->win_main);
ad->win_main = NULL;
}
ad->win_main = create_win(LBS_SETTING_PKG);
ad->bg = create_bg(ad->win_main);
ad->conformant = create_conformant(ad->win_main);
create_indicator_bg(ad->conformant);
ad->layout_main = create_layout(ad->conformant);
ret = app_control_clone(&ad->prev_handler, app_control);
if (FALSE == ret)
LS_LOGE("app_control_clone. err=%d", ret);
char *caller = NULL;
ret = app_control_get_extra_data(app_control, LOCATION_UG_CALLER, &caller);
if (FALSE == ret)
LS_LOGE("app_control_get_extra_data. err=%d", ret);
if (caller != NULL && strcmp(caller, "pwlock") == 0) {
/* for wizard_view*/
} else {
__setting_location_init(ad);
__setting_location_create_view(ad);
}
if (elm_win_wm_rotation_supported_get(ad->win_main)) {
int rots[4] = { 0, 90, 180, 270 }; /* rotation value that app may want */
elm_win_wm_rotation_available_rotations_set(ad->win_main, rots, 4);
}
if (caller) {
free(caller);
caller = NULL;
}
/* LS_FUNC_EXIT */
}
static void _app_language_changed_cb(app_event_info_h event_info, void *user_data)
{
LS_FUNC_ENTER
char *locale = vconf_get_str(VCONFKEY_LANGSET);
if (locale) {
elm_language_set(locale);
free(locale);
locale = NULL;
}
}
int main(int argc, char *argv[])
{
LS_FUNC_ENTER
int ret = 0;
lbs_setting_app_data ad = {0,};
ui_app_lifecycle_callback_s event_callback = {0,};
app_event_handler_h handlers[5] = {NULL, };
event_callback.create = _app_create_cb;
event_callback.terminate = _app_terminate_cb;
event_callback.app_control = _app_control_cb;
event_callback.pause = _app_pause_cb;
event_callback.resume = _app_resume_cb;
ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, NULL, NULL);
ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, _app_language_changed_cb, &ad);
ret = APP_ERROR_NONE;
ret = ui_app_main(argc, argv, &event_callback, &ad);
if (ret != APP_ERROR_NONE)
LS_LOGE("ui_app_main() is failed. err=%d", ret);
LS_FUNC_EXIT
return 0;
}
|