{
/* Handle the launch request. */
appdata *ad = (appdata *)data;
+ char* type = NULL;
+ int res;
+
LOGD("");
- if(ad->app_state == APP_STATE_PAUSE || ad->app_state == APP_STATE_RESUME)
+ if (!ad)
+ return;
+
+ if (ad->app_state == APP_STATE_PAUSE || ad->app_state == APP_STATE_RESUME)
{
if (ad->win)
{
return;
}
- char* type = NULL;
- int res = app_control_get_extra_data(app_control, "caller", &type);
- if(APP_CONTROL_ERROR_NONE == res && NULL != type && strcmp(type, "settings") == 0)
- {
- ad->app_type = APP_TYPE_SETTING;
- }
- else
- {
- ad->app_type = APP_TYPE_NORMAL;
+ ad->app_type = APP_TYPE_NORMAL;
+
+ res = app_control_get_extra_data(app_control, "caller", &type);
+ if (APP_CONTROL_ERROR_NONE == res && NULL != type) {
+ if (strcmp(type, "settings") == 0)
+ {
+ ad->app_type = APP_TYPE_SETTING;
+ }
+ else if (strcmp(type, "settings_no_rotation") == 0)
+ {
+ ad->app_type = APP_TYPE_SETTING_NO_ROTATION;
+ }
}
+
ad->app_state = APP_STATE_SERVICE;
im_setting_list_app_create(ad);
- if(NULL != type)
+ if (NULL != type)
{
free(type);
}
static void
app_pause(void *data)
{
+ appdata *ad = (appdata *)data;
LOGD("");
/* Take necessary actions when application becomes invisible. */
-// action_on_pause(data);
- appdata *ad = (appdata *)data;
+ if (!ad)
+ return;
ad->app_state = APP_STATE_PAUSE;
}
static void
app_resume(void *data)
{
+ appdata *ad = (appdata *)data;
LOGD("");
/* Take necessary actions when application becomes visible. */
-// action_on_resume(data);
- appdata *ad = (appdata *)data;
- if(ad->app_state == APP_STATE_PAUSE)
+
+ if (!ad)
+ return;
+ if (ad->app_state == APP_STATE_PAUSE)
{
if (ad->win)
{
static void
app_terminate(void *data)
{
+ appdata *ad = (appdata *)data;
LOGD("");
/* Release all resources. */
-// action_on_destroy(data);
- appdata *ad = (appdata *)data;
+
+ if (!ad)
+ return;
ad->app_state = APP_STATE_TERMINATE;
im_setting_list_app_terminate(ad);
}
{
LOGD("");
/*APP_EVENT_LANGUAGE_CHANGED*/
-/* char *locale = vconf_get_str(VCONFKEY_LANGSET);
- if (locale) {
- elm_language_set(locale);
- elm_config_all_flush();
- }
-*/
}
static void
{
LOGD("");
/*APP_EVENT_DEVICE_ORIENTATION_CHANGED*/
- return;
}
static void
enum {
APP_TYPE_SETTING = 1,
+ APP_TYPE_SETTING_NO_ROTATION,
APP_TYPE_NORMAL,
};
}
static Evas_Object *
-im_setting_list_main_window_create(const char *name)
+im_setting_list_main_window_create(const char *name, int app_type)
{
Evas_Object *eo = NULL;
int w = -1, h = -1;
return NULL;
}
evas_object_resize(eo, w, h);
- int rots[4] = {0, 90, 180, 270};
- elm_win_wm_rotation_available_rotations_set(eo, rots, 4);
+ if (app_type != APP_TYPE_SETTING_NO_ROTATION) {
+ int rots[4] = {0, 90, 180, 270};
+ elm_win_wm_rotation_available_rotations_set(eo, rots, 4);
+ }
}
return eo;
}
return;
}
if (result == APP_CONTROL_RESULT_SUCCEEDED) {
- char *value = NULL;
- int res = app_control_get_extra_data(reply, "result", &value);
- if (APP_CONTROL_ERROR_NONE == res && NULL != value) {
- im_setting_list_update_window(user_data);
- }
- if (value){
- free(value);
- }
+ im_setting_list_update_window(user_data);
}
}
static void im_setting_list_show_ime_selector(void *data)
{
int ret;
+ appdata *ad = (appdata *)data;
app_control_h app_control;
- const char *app_id = "org.tizen.inputmethod-setting-selector"; // This is temporary. AppId can be got using pkgmgr-info later.
+ const char *app_id = "org.tizen.inputmethod-setting-selector";
+
+ if (!ad)
+ return;
+
ret = app_control_create (&app_control);
if (ret != APP_CONTROL_ERROR_NONE) {
- LOGD("app_control_create returned %d", ret);
- return;
+ LOGD("app_control_create returned %d", ret);
+ return;
}
ret = app_control_set_operation (app_control, APP_CONTROL_OPERATION_DEFAULT);
if (ret != APP_CONTROL_ERROR_NONE) {
- LOGD("app_control_set_operation returned %d", ret);
- app_control_destroy(app_control);
- return;
- }
-
- ret = app_control_set_app_id (app_control, app_id);
- if (ret != APP_CONTROL_ERROR_NONE) {
- LOGD("app_control_set_app_id returned %d", ret);
- app_control_destroy(app_control);
- return;
- }
-
- app_control_add_extra_data(app_control, "caller", "settings");
- ret = app_control_send_launch_request(app_control, im_setting_list_app_control_reply_cb, data);
- if (ret != APP_CONTROL_ERROR_NONE) {
- LOGD("app_control_send_launch_request returned %d, %s\n", ret, get_error_message(ret));
- app_control_destroy(app_control);
- return;
- }
- app_control_destroy(app_control);
+ LOGD("app_control_set_operation returned %d", ret);
+ app_control_destroy(app_control);
+ return;
+ }
+
+ ret = app_control_set_app_id (app_control, app_id);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ LOGD("app_control_set_app_id returned %d", ret);
+ app_control_destroy(app_control);
+ return;
+ }
+
+ if (ad->app_type == APP_TYPE_SETTING_NO_ROTATION)
+ app_control_add_extra_data(app_control, "caller", "settings_no_rotation");
+ else
+ app_control_add_extra_data(app_control, "caller", "settings");
+
+ ret = app_control_send_launch_request(app_control, im_setting_list_app_control_reply_cb, data);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ LOGD("app_control_send_launch_request returned %d, %s\n", ret, get_error_message(ret));
+ app_control_destroy(app_control);
+ return;
+ }
+ app_control_destroy(app_control);
}
static void
im_setting_list_app_create(void *data)
{
appdata *ad = (appdata *)data;
+ if (!ad)
+ return;
im_setting_list_text_domain_set();
- ad->win = im_setting_list_main_window_create(PACKAGE);
+ ad->win = im_setting_list_main_window_create(PACKAGE, ad->app_type);
im_setting_list_bg_create(ad->win);
im_setting_list_load_ime_info();
{
/* Handle the launch request. */
appdata *ad = (appdata *)data;
+ int res;
char* type = NULL;
LOGD("");
- int res = app_control_get_extra_data(app_control, "caller", &type);
- if(APP_CONTROL_ERROR_NONE == res && NULL != type && strcmp(type,"settings") == 0)
- {
- ad->app_type = APP_TYPE_SETTING;
- app_control_clone(&(ad->caller), app_control);
- }
- else
- {
- ad->app_type = APP_TYPE_NORMAL;
+ if (!ad)
+ return;
+
+ ad->app_type = APP_TYPE_NORMAL;
+
+ res = app_control_get_extra_data(app_control, "caller", &type);
+ if (APP_CONTROL_ERROR_NONE == res && NULL != type) {
+ if (strcmp(type,"settings") == 0)
+ {
+ ad->app_type = APP_TYPE_SETTING;
+ app_control_clone(&(ad->caller), app_control);
+ }
+ else if (strcmp(type, "settings_no_rotation") == 0)
+ {
+ ad->app_type = APP_TYPE_SETTING_NO_ROTATION;
+ app_control_clone(&(ad->caller), app_control);
+ }
}
+
ad->app_state = APP_STATE_SERVICE;
im_setting_selector_app_create(ad);
- if(NULL != type)
+ if (NULL != type)
{
free(type);
}
static void
app_pause(void *data)
{
+ appdata *ad = (appdata *)data;
LOGD("");
/* Take necessary actions when application becomes invisible. */
- appdata *ad = (appdata *)data;
+
+ if (!ad)
+ return;
ad->app_state = APP_STATE_PAUSE;
im_setting_selector_app_pause(ad);
}
static void
app_resume(void *data)
{
+ appdata *ad = (appdata *)data;
LOGD("");
/* Take necessary actions when application becomes visible. */
- appdata *ad = (appdata *)data;
+
+ if (!ad)
+ return;
ad->app_state = APP_STATE_RESUME;
}
static void
app_terminate(void *data)
{
+ appdata *ad = (appdata *)data;
LOGD("");
/* Release all resources. */
- appdata *ad = (appdata *)data;
+
+ if (!ad)
+ return;
ad->app_state = APP_STATE_TERMINATE;
im_setting_selector_app_terminate(ad);
- app_control_destroy(ad->caller);
+ if (ad->caller)
+ app_control_destroy(ad->caller);
}
static void
{
LOGD("");
/*APP_EVENT_LANGUAGE_CHANGED*/
-/* char *locale = vconf_get_str(VCONFKEY_LANGSET);
- if (locale) {
- elm_language_set(locale);
- elm_config_all_flush();
- }
-*/
}
static void
{
LOGD("");
/*APP_EVENT_DEVICE_ORIENTATION_CHANGED*/
- return;
}
static void
enum {
APP_TYPE_SETTING = 1,
+ APP_TYPE_SETTING_NO_ROTATION,
APP_TYPE_NORMAL,
};
}
static Evas_Object *
-im_setting_selector_main_window_create(const char *name)
+im_setting_selector_main_window_create(const char *name, int app_type)
{
Evas_Object *eo = NULL;
int w = -1, h = -1;
return NULL;
}
evas_object_resize(eo, w, h);
- int rots[4] = {0, 90, 180, 270};
- elm_win_wm_rotation_available_rotations_set(eo, rots, 4);
+ if (app_type != APP_TYPE_SETTING_NO_ROTATION) {
+ int rots[4] = {0, 90, 180, 270};
+ elm_win_wm_rotation_available_rotations_set(eo, rots, 4);
+ }
}
return eo;
}
{
int ret;
app_control_h app_control;
- const char *app_id = "org.tizen.inputmethod-setting-list"; // This is temporary. AppId can be got using pkgmgr-info later.
+ const char *app_id = "org.tizen.inputmethod-setting-list";
ret = app_control_create (&app_control);
if (ret != APP_CONTROL_ERROR_NONE) {
LOGD("app_control_create returned %d", ret);
return;
}
- app_control_add_extra_data(app_control, "caller", "verify");
ret = app_control_send_launch_request(app_control, NULL, NULL);
if (ret != APP_CONTROL_ERROR_NONE) {
LOGD("app_control_send_launch_request returned %d, %s\n", ret, get_error_message(ret));
if(ad->caller){
app_control_h reply;
app_control_create(&reply);
- app_control_add_extra_data(reply, "result", g_ime_info_list[g_active_ime_id].appid);
app_control_reply_to_launch_request(reply, ad->caller, APP_CONTROL_RESULT_SUCCEEDED);
app_control_destroy(reply);
}
im_setting_selector_app_create(void *data)
{
appdata *ad = (appdata *)data;
+ if (!ad)
+ return;
im_setting_selector_text_domain_set();
- ad->win = im_setting_selector_main_window_create(PACKAGE);
+ ad->win = im_setting_selector_main_window_create(PACKAGE, ad->app_type);
im_setting_selector_load_ime_info();
im_setting_selector_popup_create(ad);