Modified to use avaiable_rotations instead of listening to sensor event 74/17274/1
authorJi-hoon Lee <dalton.lee@samsung.com>
Thu, 27 Jun 2013 07:17:21 +0000 (16:17 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Thu, 6 Mar 2014 06:52:14 +0000 (15:52 +0900)
Change-Id: Id5d79e377393bd0bb655acfc2d8dc59ba1315b49

CMakeLists.txt
packaging/ise-default.spec
src/include/ise.h
src/option.cpp

index adb373b..48439ff 100644 (file)
@@ -32,7 +32,6 @@ INCLUDE(FindPkgConfig)
 pkg_check_modules(ISE_PKGS REQUIRED
         elementary
         efl-assist
-        sensor
         dlog
         libscl-ui
         ecore-imf
@@ -93,7 +92,6 @@ INCLUDE(FindPkgConfig)
 pkg_check_modules(SETUP_PKGS REQUIRED
         elementary
         efl-assist
-        sensor
         dlog
         libscl-ui
         ecore-imf
index 3943e31..4190681 100644 (file)
@@ -1,6 +1,6 @@
 Name:       ise-default
 Summary:    Tizen keyboard
-Version:    0.9.7
+Version:    0.9.8
 Release:    1
 Group:      TO BE / FILLED IN
 License:    TO BE / FILLED IN
@@ -14,7 +14,6 @@ BuildRequires:  pkgconfig(utilX)
 BuildRequires:  pkgconfig(isf)
 BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(aul)
-BuildRequires:  pkgconfig(sensor)
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(x11)
 BuildRequires:  pkgconfig(libscl-ui)
index 3e9a36b..a49cfb4 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "languages.h"
 
-#define ISE_VERSION "0.9.7-1"
+#define ISE_VERSION "0.9.8-1"
 #define LOCALEDIR "/usr/share/locale"
 
 #define PRIMARY_LATIN_LANGUAGE "English"
index d20959f..a794faa 100644 (file)
@@ -25,7 +25,6 @@
 #include <glib.h>
 #include <Elementary.h>
 #include <efl_assist.h>
-#include <sensor.h>
 #include <vconf.h>
 
 #include "option.h"
@@ -95,39 +94,6 @@ ILanguageOption* LanguageOptionManager::get_language_option_info(scluint index)
     return ((index < language_option_vector.size()) ? language_option_vector.at(index) : NULL);
 }
 
-static int sensor_handle = -1;
-static void rotation_callback_func(unsigned int event_type, sensor_event_data_t *event, void *data)
-{
-    const int MAX_MANIPULATED_ANGLES = 4;
-    const int manipulated_angles[MAX_MANIPULATED_ANGLES][2] = {
-        {ROTATION_EVENT_0, PORTRAIT_DEGREE_0},
-        {ROTATION_EVENT_90, LANDSCAPE_DEGREE_270},
-        {ROTATION_EVENT_180, PORTRAIT_DEGREE_180},
-        {ROTATION_EVENT_270, LANDSCAPE_DEGREE_90},
-    };
-
-    int *my_event_data = NULL;
-
-    int lock=0;
-    vconf_get_bool(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, &lock);
-    if(!lock)
-        return;
-
-    if (event_type != ACCELEROMETER_EVENT_ROTATION_CHECK || event == NULL) {
-        return;
-    }
-    my_event_data = (int *)(event->event_data);
-
-    if (my_event_data) {
-        LOGD("*my_event_data : %d\n", *my_event_data);
-        for (int loop = 0;loop < MAX_MANIPULATED_ANGLES;loop++) {
-            if (*my_event_data == manipulated_angles[loop][0]) {
-                elm_win_rotation_with_resize_set(ad.option_window, manipulated_angles[loop][1]);
-            }
-        }
-    }
-}
-
 static Evas_Object*
 create_main_window(int degree)
 {
@@ -139,6 +105,9 @@ create_main_window(int degree)
     elm_win_borderless_set(window, EINA_TRUE);
     elm_win_rotation_with_resize_set(window, degree);
 
+    int rots[] = { 0, 90, 180, 270 };
+    elm_win_wm_rotation_available_rotations_set(window, rots, (sizeof(rots) / sizeof(int)));
+
     evas_object_show(window);
 
     return window;
@@ -530,6 +499,7 @@ _naviframe_back_cb (void *data, Evas_Object *obj, void *event_info)
     language_selection_finished_cb(NULL, NULL, NULL);
     if (top_it && bottom_it &&
             (elm_object_item_content_get(top_it) == elm_object_item_content_get(bottom_it))) {
+        //ea_object_event_callback_del(ad.naviframe, EA_CALLBACK_BACK, _naviframe_back_cb);
         close_option_window();
     } else {
         elm_naviframe_item_pop(obj);
@@ -616,22 +586,6 @@ close_option_window()
         ad.event_handler = NULL;
     }
 
-    if (sensor_handle >= 0) {
-        int ret = 0;
-        ret = sf_unregister_event(sensor_handle, ACCELEROMETER_EVENT_ROTATION_CHECK);
-        if (ret < 0) {
-            LOGD("sf_unregister_event() has failed.\n");
-        }
-        ret = sf_stop(sensor_handle);
-        if (ret < 0) {
-            LOGD("sf_stop() has failed.\n");
-        }
-        ret = sf_disconnect(sensor_handle);
-        if (ret < 0) {
-            LOGD("sf_disconnect() has failed.\n");
-        }
-        sensor_handle = -1;
-    }
     destroy_genlist_item_classes();
 }
 
@@ -748,22 +702,6 @@ open_option_window(Evas_Object *parent, sclint degree)
     //Ecore_X_Window xAppWindow = get_isf_active_window();
     //if (ad.option_window && elm_win_xwindow_get(ad.option_window) == xAppWindow) return;
 
-    sensor_handle = sf_connect(ACCELEROMETER_SENSOR);
-    if (sensor_handle < 0) {
-        LOGD("sensor attach fail\n");
-
-    } else {
-        int state = sf_register_event(sensor_handle, ACCELEROMETER_EVENT_ROTATION_CHECK, NULL , rotation_callback_func, NULL);
-        if (state < 0) {
-            LOGD("sensor_register_cb fail\n");
-        }
-
-        state = sf_start(sensor_handle, 0);
-        if (state < 0) {
-            LOGD("SLP_sensor_start fail\n");
-        }
-    }
-
     read_ise_config_values();
 
     /* To make sure there is no temporary language in the enabled language list */