Fix JIRA issue (N_SE-42183)
authorDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 20 Jun 2013 12:27:45 +0000 (21:27 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 20 Jun 2013 12:32:00 +0000 (21:32 +0900)
Set the initial rotate moe

Change-Id: I0e635ef3568995951b2c0e8b52a3e87ba31fcafc

src/ui/bt-main-ug.c

index 2a208e4..ffe4b5e 100644 (file)
@@ -233,6 +233,44 @@ static void __bt_ug_release_memory(bt_ug_data *ugd)
        FN_END;
 }
 
+void __bt_ug_set_rotation(Evas_Object *win)
+{
+       FN_START;
+
+       enum appcore_rm curr;
+       int rotate = 0;
+
+       if (appcore_get_rotation_state(&curr) < 0) {
+               BT_ERR("Fail to get rotation");
+               return;
+       }
+
+       switch (curr) {
+       case APPCORE_RM_PORTRAIT_NORMAL:
+               rotate = 0;
+               break;
+       case APPCORE_RM_PORTRAIT_REVERSE:
+               rotate = 180;
+               break;
+       case APPCORE_RM_LANDSCAPE_NORMAL:
+               rotate = 90;
+               break;
+       case APPCORE_RM_LANDSCAPE_REVERSE:
+               rotate = 270;
+               break;
+       default:
+               BT_ERR("Unknown value");
+               return;
+       }
+
+       BT_DBG("rotate: %d", rotate);
+
+       elm_win_rotation_with_resize_set(win, rotate);
+
+       FN_END;
+}
+
+
 static void *__on_create(ui_gadget_h ug, enum ug_mode mode, service_h service,
                         void *priv)
 {
@@ -254,6 +292,8 @@ static void *__on_create(ui_gadget_h ug, enum ug_mode mode, service_h service,
        if (!ugd->win_main)
                return NULL;
 
+       __bt_ug_set_rotation(ugd->win_main);
+
        if (mode == UG_MODE_FULLVIEW) {
                ugd->base = __bt_create_fullview(ugd->win_main, ugd);
                bg = _bt_create_bg(ugd->win_main, "group_list");