* setting
* Copyright (c) 2012 Samsung Electronics Co., Ltd.
*
- * Licensed under the Flora License, Version 1.0 (the License);
+ * Licensed under the Flora License, Version 1.1 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
#include <Ecore_X.h>
#include <sensor.h>
#include <aul.h>
-#include "setting-plugin.h"
+#include "setting-common-plugin.h"
#include "setting-main.h"
#include <elm_object.h>
#include <appsvc.h>
#endif
}
+static void _rot_changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ SETTING_TRACE_BEGIN;
+ setting_main_appdata *ad = (setting_main_appdata *)data;
+ if (ad == NULL || ad->win_main == NULL )
+ return;
+ int change_ang = elm_win_rotation_get(ad->win_main);
+ SETTING_TRACE("....change_ang:%d",change_ang);
+ SETTING_TRACE("current_rotation:%d",ad->current_rotation);
+ //Send the rotation event to UGs..
+ enum ug_event event = UG_EVENT_ROTATE_PORTRAIT;
+ switch (change_ang) {
+ case APP_DEVICE_ORIENTATION_0:
+ event = UG_EVENT_ROTATE_PORTRAIT;
+ break;
+ case APP_DEVICE_ORIENTATION_180:
+ event = UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN;
+ break;
+ case APP_DEVICE_ORIENTATION_270:
+ event = UG_EVENT_ROTATE_LANDSCAPE;
+ break;
+ case APP_DEVICE_ORIENTATION_90:
+ event = UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN;
+ break;
+ default:
+ return;
+ }
+ SETTING_TRACE("diff:%d",elm_win_rotation_get(ad->win_main) - ad->current_rotation);
+
+ if (change_ang != ad->current_rotation)
+ {
+ ug_send_event(event);
+ ad->current_rotation = change_ang;
+ }
+}
#endif
/**
if (item_to_update->chk_status) //rotation function is not blocked
{
SETTING_TRACE("Rotation function is on, it is necessary to adjust the device orientation");
- int mode = APP_DEVICE_ORIENTATION_0;
- mode = app_get_device_orientation();
- elm_win_rotation_with_resize_set(ad->win_main, mode);
+ //int mode = APP_DEVICE_ORIENTATION_0;
+ //mode = app_get_device_orientation();
+ //elm_win_rotation_with_resize_set(ad->win_main, mode);
}
return;
}
else if (!safeStrCmp(vconf_name, VCONFKEY_CALL_STATE)) {
// do handling in case of VCONFKEY_CALL_STATE
- //In call situation : Wi-fi / Tethering / Network menu dimmed
+ // In call situation : Wi-fi / Tethering / Network menu dimmed
+ // -- Only Wi-fi should be dimmed (2013.04.04) --
if (VCONFKEY_CALL_OFF != status)
{
if (ad->data_network)
setting_disable_genlist_item(ad->data_network->item);
- if (ad->data_wifi)
- setting_disable_genlist_item(ad->data_wifi->item);
}
else
{
if (ad->data_network)
setting_enable_genlist_item(ad->data_network->item);
- if (ad->data_wifi)
- setting_enable_genlist_item(ad->data_wifi->item);
}
} else if (!safeStrCmp(vconf_name, VCONFKEY_BT_STATUS)) {
evas_object_show(ad->win_main);
UG_INIT_EFL(ad->win_main, UG_OPT_INDICATOR_ENABLE);
ad->evas = evas_object_evas_get(ad->win_main);
+ ad->current_rotation = elm_win_rotation_get(ad->win_main);
+ SETTING_TRACE("ad->current_rotation:%d",ad->current_rotation);
+ 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);
+ }
+ evas_object_smart_callback_add(ad->win_main, "wm,rotation,changed", _rot_changed_cb, ad);
/* load config file */
int cfg_operation_ret = setting_cfg_init();
SETTING_TRACE_BEGIN;
setting_main_appdata *ad = data;
//vconf_set_bool (VCONFKEY_SETAPPL_ROTATE_HOLD_BOOL, FALSE);
- PLUGIN_FINI;
+
setting_cfg_exit();
clear_system_service_data();
if (value) //rotation function is not blocked
{
SETTING_TRACE("Rotation function is on, it is necessary to adjust the device orientation");
- int mode = APP_DEVICE_ORIENTATION_0;
- mode = app_get_device_orientation();
- elm_win_rotation_with_resize_set(ad->win_main, mode);
+ //int mode = APP_DEVICE_ORIENTATION_0;
+ //mode = app_get_device_orientation();
+ //elm_win_rotation_with_resize_set(ad->win_main, mode);
}
vconf_callback_fn cb = NULL;
.low_battery = setting_main_low_battery_cb,
.language_changed = setting_main_lang_changed_cb,
.region_format_changed = setting_main_region_changed_cb,
- .device_orientation = setting_main_rotate,
+ .device_orientation = NULL,
};