summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJinwoo Nam <jwoo.nam@samsung.com>2012-09-07 11:22:32 +0900
committerJinwoo Nam <jwoo.nam@samsung.com>2012-09-07 11:22:32 +0900
commit960022eec0500b27ec1dc8532a48b95bee574ef2 (patch)
tree2beec56ed7758ba7f6f55ffc6462c844eb1a429c
parent5964013ff6d59fa4fb35e3165845eb15f2c743d1 (diff)
downloadui-gadget-1-960022eec0500b27ec1dc8532a48b95bee574ef2.tar.gz
ui-gadget-1-960022eec0500b27ec1dc8532a48b95bee574ef2.tar.bz2
ui-gadget-1-960022eec0500b27ec1dc8532a48b95bee574ef2.zip
check rotation lock and set rotation info when ug launch
-rwxr-xr-xclient/CMakeLists.txt1
-rwxr-xr-xclient/ug-client.c14
-rwxr-xr-xpackaging/ui-gadget-1.spec1
3 files changed, 13 insertions, 3 deletions
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
index 941302b..cd31296 100755
--- a/client/CMakeLists.txt
+++ b/client/CMakeLists.txt
@@ -9,6 +9,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(CLIENT_PKGS REQUIRED
capi-appfw-application
+ capi-system-runtime-info
appcore-efl
appsvc
bundle
diff --git a/client/ug-client.c b/client/ug-client.c
index cbbe223..11f385f 100755
--- a/client/ug-client.c
+++ b/client/ug-client.c
@@ -26,6 +26,7 @@
#include <dlog.h>
#include <aul.h>
#include <appsvc.h>
+#include <runtime_info.h>
#include "ug-client.h"
@@ -65,10 +66,16 @@ static int rotate(enum appcore_rm m, void *data)
{
struct appdata *ad = data;
int r;
+ bool is_rotation_lock = false;
if (ad == NULL || ad->win == NULL)
return 0;
+ /* rotation lock */
+ r = runtime_info_get_value_bool(RUNTIME_INFO_KEY_ROTATION_LOCK_ENABLED, &is_rotation_lock);
+ if ( !r && is_rotation_lock)
+ m = APPCORE_RM_PORTRAIT_NORMAL;
+
switch (m) {
case APPCORE_RM_PORTRAIT_NORMAL:
ug_send_event(UG_EVENT_ROTATE_PORTRAIT);
@@ -91,9 +98,6 @@ static int rotate(enum appcore_rm m, void *data)
break;
}
- if (r >= 0)
- elm_win_rotation_with_resize_set(ad->win, r);
-
return 0;
}
@@ -209,6 +213,7 @@ static int lang_changed(void *data)
static int app_create(void *data)
{
struct appdata *ad = data;
+ enum appcore_rm rm;
Evas_Object *win;
Evas_Object *ly;
@@ -230,6 +235,9 @@ static int app_create(void *data)
lang_changed(ad);
+ if (appcore_get_rotation_state(&rm) == 0)
+ rotate(rm, ad);
+
appcore_set_rotation_cb(rotate, ad);
appcore_set_event_callback(APPCORE_EVENT_LOW_MEMORY, low_memory, ad);
appcore_set_event_callback(APPCORE_EVENT_LOW_BATTERY, low_battery, ad);
diff --git a/packaging/ui-gadget-1.spec b/packaging/ui-gadget-1.spec
index 0a60ef1..8d050ae 100755
--- a/packaging/ui-gadget-1.spec
+++ b/packaging/ui-gadget-1.spec
@@ -16,6 +16,7 @@ BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(appsvc)
BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(capi-system-runtime-info)
BuildRequires: cmake
BuildRequires: edje-bin