Support guide popup in common profile 49/250849/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Tue, 5 Jan 2021 07:06:18 +0000 (16:06 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 5 Jan 2021 07:06:18 +0000 (16:06 +0900)
Change-Id: Ic53670548772586652ae68e07c48a432a8d953a3
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
CMakeLists.txt
src/include/ise.h
src/ise-emoticon-mode.cpp
src/ise.cpp

index 099112b..fb53741 100644 (file)
@@ -177,6 +177,7 @@ ADD_CUSTOM_TARGET(
 ADD_DEPENDENCIES(${PROJECT_NAME} layout_keypad.edj)
 INSTALL(FILES ${CMAKE_BINARY_DIR}/layout_keypad.edj DESTINATION ${ISE_RESDIR}/edje)
 
+if(${TARGET} STREQUAL "mobile")
 ADD_CUSTOM_TARGET( customised_ctxpopup.edj COMMAND edje_cc
         -id ${CMAKE_CURRENT_SOURCE_DIR}/edje/mobile
         -sd ${CMAKE_CURRENT_SOURCE_DIR}/edje/mobile
@@ -185,6 +186,7 @@ ADD_CUSTOM_TARGET( customised_ctxpopup.edj COMMAND edje_cc
         DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/data/edc/customised_ctxpopup.edc)
 ADD_DEPENDENCIES(${PROJECT_NAME} customised_ctxpopup.edj)
 INSTALL(FILES ${CMAKE_BINARY_DIR}/customised_ctxpopup.edj DESTINATION ${ISE_RESDIR}/edje/mobile)
+endif()
 
 if(${TARGET} STREQUAL "wearable")
 file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/res/wearable/edje)
@@ -300,6 +302,15 @@ ADD_DEPENDENCIES(${PROJECT_NAME} main_layout.edj)
 INSTALL(FILES ${CMAKE_BINARY_DIR}/res/common/edje/main_layout.edj DESTINATION
 ${ISE_RESDIR}/edje/common)
 
+ADD_CUSTOM_TARGET( customised_ctxpopup.edj COMMAND edje_cc
+        -id ${CMAKE_CURRENT_SOURCE_DIR}/edje/common
+        -sd ${CMAKE_CURRENT_SOURCE_DIR}/edje/common
+        ${CMAKE_CURRENT_SOURCE_DIR}/data/edc/customised_ctxpopup.edc
+        ${CMAKE_BINARY_DIR}/customised_ctxpopup.edj
+        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/data/edc/customised_ctxpopup.edc)
+ADD_DEPENDENCIES(${PROJECT_NAME} customised_ctxpopup.edj)
+INSTALL(FILES ${CMAKE_BINARY_DIR}/customised_ctxpopup.edj DESTINATION ${ISE_RESDIR}/edje/common)
+
 else()
 file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/res/mobile/edje)
 ADD_CUSTOM_TARGET(w-input-stt.edj COMMAND edje_cc
index 9b009e9..b60b25c 100644 (file)
@@ -231,4 +231,6 @@ void ise_get_language_locale(char **locale);
 void ise_update_table(const std::vector<std::string> &vec_str);
 void ise_process_key_event(scim::KeyEvent &key, sclu32 &ret);
 
+bool get_landscape_device(int degree);
+
 #endif
index 8691aa7..58849e4 100644 (file)
@@ -189,29 +189,6 @@ static Eina_Bool _focus_done(void *data);
 static void _multi_down(void *data, Evas *e, Evas_Object *o, void *event_info);
 static void _multi_up(void *data, Evas *e, Evas_Object *o, void *event_info);
 
-static bool get_landscape_device(int degree)
-{
-    sclint width = 0;
-    sclint height = 0;
-    bool landscape_device = false;
-
-    CSCLUI *ui = get_ui();
-    if (!ui) return false;
-
-    ui->get_screen_resolution(&width, &height);
-
-    if (degree == 0 || degree == 180) {
-        if (width > height)
-            landscape_device = true;
-    }
-    else {
-        if (width < height)
-            landscape_device = true;
-    }
-
-    return landscape_device;
-}
-
 void ise_read_recent_emoticon_list_from_scim(void)
 {
     LOGD("Enter\n");
index bb4fdcc..a7a0992 100644 (file)
@@ -51,7 +51,7 @@
 #include "ise-floating-mode.h"
 #include "ise-dbus.h"
 
-#define EDJ_FILE                        RESDIR"/edje/mobile/customised_ctxpopup.edj"
+#define EDJ_FILE                        RESDIR"/edje/" PROFILE_NAME"/customised_ctxpopup.edj"
 
 #define EXIT_ISE_ON_HIDE 0
 #define DEFER_ISE_CREATION 0
@@ -907,6 +907,29 @@ void _guideline_popup_space_cb(void *data, Evas_Object *obj, void *event_info)
     write_ise_config_values();
 }
 
+bool get_landscape_device(int degree)
+{
+    sclint width = 0;
+    sclint height = 0;
+    bool landscape_device = false;
+
+    CSCLUI *ui = get_ui();
+    if (!ui) return false;
+
+    ui->get_screen_resolution(&width, &height);
+
+    if (degree == 0 || degree == 180) {
+        if (width > height)
+            landscape_device = true;
+    }
+    else {
+        if (width < height)
+            landscape_device = true;
+    }
+
+    return landscape_device;
+}
+
 void ise_show_help_popup(sclulong keyEvent)
 {
     char buf[2048] = {0, };
@@ -955,10 +978,11 @@ void ise_show_help_popup(sclulong keyEvent)
     }
 
     int rotation = elm_win_rotation_get(NATIVE_WINDOW_CAST(ime_get_main_window()));
+    bool landscape_device = get_landscape_device(rotation);
     if (rotation == 0 || rotation == 180) {
-        elm_object_style_set(ctxpopup, "customised_guideline_popup");
+        elm_object_style_set(ctxpopup, landscape_device ? "customised_guideline_popup_landscape" : "customised_guideline_popup");
     } else {
-        elm_object_style_set(ctxpopup, "customised_guideline_popup_landscape");
+        elm_object_style_set(ctxpopup, landscape_device ?  "customised_guideline_popup" : "customised_guideline_popup_landscape");
     }
 
     elm_ctxpopup_direction_priority_set(ctxpopup, ELM_CTXPOPUP_DIRECTION_UP,
@@ -1026,7 +1050,7 @@ SCLEventReturnType CUIEventCallback::on_event_drag_state_changed(SclUIEventDesc
         if (g_floating_mode)
             ime_set_floating_drag_end();
     } else if (event_desc.event_type == EVENT_TYPE_PRESS) {
-#ifdef _MOBILE
+#if defined(_MOBILE) || defined(_COMMON)
         CONFIG_VALUES *config_values = get_config_values();
 
         if (config_values && (!config_values->first_guideset) && event_desc.key_value && (strncmp(event_desc.key_value, "OPTION", strlen(event_desc.key_value)) == 0)) {
@@ -1259,7 +1283,7 @@ SCLEventReturnType CUIEventCallback::on_event_key_clicked(SclUIEventDesc event_d
                 break;
            }
         case KEY_TYPE_MODECHANGE:
-#ifdef _MOBILE
+#if defined(_MOBILE) || defined(_COMMON)
             if (_guide_popup_setting != NULL) {//popup is showing
                 break;
             }
@@ -1734,7 +1758,7 @@ ise_show(int ic)
         ui->enable_button("CM_KEY", false);
 #endif
 
-#ifdef _MOBILE
+#if defined(_MOBILE) || defined(_COMMON)
         if (ise_is_guideline_popup_enable_layout()) {
             if ((config_values && config_values->first_guidechange) && (_language_manager.get_enabled_languages_num() > 1)) {
                 ise_show_help_popup(MVK_space);