Remove profile build 08/126308/8
authorJihoon Kim <jihoon48.kim@samsung.com>
Wed, 19 Apr 2017 00:34:09 +0000 (09:34 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Wed, 10 May 2017 07:48:27 +0000 (07:48 +0000)
Change-Id: Ib5df02985234612135ff338e0b3aea988ae53817
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
20 files changed:
configure.ac
ism/demos/Makefile.am
ism/demos/isf_demo_efl.cpp
ism/extras/efl_panel/Makefile.am
ism/extras/efl_panel/isf_panel_efl.cpp
ism/extras/kbd_mode_changer/Makefile.am
ism/extras/wayland_immodule/Makefile.am
ism/extras/wayland_immodule/wayland_imcontext.c
ism/modules/config/Makefile.am
ism/modules/frontend/Makefile.am
ism/modules/panelagent/ecoresocket/Makefile.am
ism/modules/panelagent/wayland/Makefile.am
ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp
ism/src/Makefile.am
ism/src/isf_debug.h
ism/src/isf_pkg.cpp
ism/src/scim_helper.cpp
ism/src/tizen_profile.cpp [new file with mode: 0644]
ism/src/tizen_profile.h [new file with mode: 0644]
packaging/isf.spec

index 68ada62..182a7c4 100644 (file)
@@ -297,6 +297,9 @@ PKG_CHECK_MODULES(NOTIFICATION, [notification],
                   [ISF_HAS_NOTIFICATION=yes],
                   [ISF_HAS_NOTIFICATION=no])
 
+# Check system info library
+PKG_CHECK_MODULES(SYSTEM_INFO, [capi-system-info])
+
 # Check tts library
 PKG_CHECK_MODULES(TTS, [tts],
                   [ISF_HAS_TTS=yes],
index e646b23..ecb8b3c 100644 (file)
@@ -59,4 +59,5 @@ isf_demo_efl_LDFLAGS  = @LTLIBINTL@ -rpath $(libdir) \
                         @DLOG_LIBS@ \
                         -pie
 
-isf_demo_efl_LDADD    = $(top_builddir)/ism/src/libscim@SCIM_EPOCH@.la
+isf_demo_efl_LDADD    = $(top_builddir)/ism/src/libscim@SCIM_EPOCH@.la \
+                        $(top_builddir)/ism/src/libprofile.la
index 29212c3..08ab021 100644 (file)
@@ -46,6 +46,7 @@
 #include "isf_input_hint_efl.h"
 #include "isf_password_mode_efl.h"
 #include "isf_demo_autotest.h"
+#include "tizen_profile.h"
 
 #include <string>
 #include <algorithm>
@@ -375,11 +376,11 @@ static int app_create (void *data)
     ad->conformant = create_conformant (ad);
 
     // Indicator
-#ifdef _MOBILE
-    elm_win_indicator_mode_set (ad->win_main, ELM_WIN_INDICATOR_SHOW);
-#else
-    elm_win_indicator_mode_set (ad->win_main, ELM_WIN_INDICATOR_HIDE);
-#endif
+    if (_MOBILE) {
+        elm_win_indicator_mode_set (ad->win_main, ELM_WIN_INDICATOR_SHOW);
+    } else {
+        elm_win_indicator_mode_set (ad->win_main, ELM_WIN_INDICATOR_HIDE);
+    }
 
     // Navigation Bar
     ad->naviframe = _create_naviframe_layout (ad->conformant);
@@ -492,10 +493,8 @@ EXAPI int main (int argc, char *argv[])
 Elm_Object_Item *naviframe_item_push (Evas_Object *nf, const char *title, Evas_Object *back_btn, Evas_Object *content)
 {
     Elm_Object_Item *navi_it = elm_naviframe_item_push (nf, title, back_btn, NULL, content, NULL);
-#ifdef _WEARABLE
-    if (navi_it)
+    if (_WEARABLE && navi_it)
         elm_naviframe_item_title_enabled_set (navi_it, EINA_FALSE, EINA_FALSE);
-#endif
 
     return navi_it;
 }
index fdad64b..a814004 100644 (file)
@@ -81,4 +81,5 @@ isf_panel_efl_LDFLAGS  = @LTLIBINTL@ -rpath $(libdir) \
 
 isf_panel_efl_LDADD    = $(top_builddir)/ism/src/libscim@SCIM_EPOCH@.la \
                          $(top_builddir)/ism/src/libisf_pkg.la \
+                         $(top_builddir)/ism/src/libprofile.la \
                          $(top_builddir)/ism/src/libprivilege_checker.la
index 950d373..c3af24e 100644 (file)
 #include <package_manager.h>
 #include <pkgmgr-info.h>
 #endif
+#include <app_control.h>
+#include <aul.h>
+
 #include "isf_panel_efl.h"
 #include "isf_panel_utility.h"
 #include "isf_query_utility.h"
-#include <app_control.h>
 #include "isf_pkg.h"
 #include "privilege_checker.h"
-#include <aul.h>
-
 #include "remote_input.h"
+#include "tizen_profile.h"
 
 using namespace scim;
 
@@ -660,6 +661,8 @@ static void delete_notification (NotificationData *noti_data)
 {
     SCIM_DEBUG_MAIN (3) << __FUNCTION__ << "...\n";
 
+    if (!_MOBILE) return;
+
     if (noti_data->noti_id != 0) {
         notification_delete_by_priv_id ("isf-panel-efl", NOTIFICATION_TYPE_ONGOING, noti_data->noti_id);
         LOGD ("deleted notification : %s\n", noti_data->launch_app.c_str ());
@@ -674,6 +677,8 @@ static void create_notification (NotificationData *noti_data)
     notification_h notification = NULL;
     int ret;
 
+    if (!_MOBILE) return;
+
     if (noti_data->noti_id != 0) {
         notification_delete_by_priv_id ("isf-panel-efl", NOTIFICATION_TYPE_ONGOING, noti_data->noti_id);
         noti_data->noti_id = 0;
@@ -4375,23 +4380,25 @@ static void slot_update_factory_info (const PanelFactoryInfo &info)
         _info_manager->set_current_ise_name (ise_name);
 
 #ifdef HAVE_NOTIFICATION
-    if (old_ise != ise_name) {
-        if (TOOLBAR_KEYBOARD_MODE == mode) {
-            char noti_msg[256] = {0};
-            unsigned int keyboard_ise_count = get_ise_count (TOOLBAR_KEYBOARD_MODE, false);
-            if (keyboard_ise_count == 0) {
-                LOGD ("the number of keyboard ise is %d\n", keyboard_ise_count);
-                return;
-            }
-            else if (keyboard_ise_count >= 2) {
-                snprintf (noti_msg, sizeof (noti_msg), _("%s selected"), ise_name.c_str ());
-            }
-            else if (keyboard_ise_count == 1) {
-                snprintf (noti_msg, sizeof (noti_msg), _("Only %s available"), ise_name.c_str ());
-            }
+    if (_MOBILE) {
+        if (old_ise != ise_name) {
+            if (TOOLBAR_KEYBOARD_MODE == mode) {
+                char noti_msg[256] = {0};
+                unsigned int keyboard_ise_count = get_ise_count (TOOLBAR_KEYBOARD_MODE, false);
+                if (keyboard_ise_count == 0) {
+                    LOGD ("the number of keyboard ise is %d\n", keyboard_ise_count);
+                    return;
+                }
+                else if (keyboard_ise_count >= 2) {
+                    snprintf (noti_msg, sizeof (noti_msg), _("%s selected"), ise_name.c_str ());
+                }
+                else if (keyboard_ise_count == 1) {
+                    snprintf (noti_msg, sizeof (noti_msg), _("Only %s available"), ise_name.c_str ());
+                }
 
-            notification_status_message_post (noti_msg);
-            LOGD ("%s\n", noti_msg);
+                notification_status_message_post (noti_msg);
+                LOGD ("%s\n", noti_msg);
+            }
         }
     }
 #endif
@@ -6579,13 +6586,15 @@ static void change_keyboard_mode (TOOLBAR_MODE_T mode)
 #endif
 
 #ifdef HAVE_NOTIFICATION
-        notification_status_message_post (_("Input detected from hardware keyboard"));
+        if (_MOBILE) {
+            notification_status_message_post (_("Input detected from hardware keyboard"));
 
-        /* Read configuations for notification app (isf-kbd-mode-changer) */
-        String kbd_mode_changer = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_KBD_MODE_CHANGER_PROGRAM), String (""));
-        hwkbd_module_noti.launch_app = kbd_mode_changer;
-        LOGD ("Create kbd_mode_changer notification with : %s\n", kbd_mode_changer.c_str ());
-        create_notification (&hwkbd_module_noti);
+            /* Read configuations for notification app (isf-kbd-mode-changer) */
+            String kbd_mode_changer = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_KBD_MODE_CHANGER_PROGRAM), String (""));
+            hwkbd_module_noti.launch_app = kbd_mode_changer;
+            LOGD ("Create kbd_mode_changer notification with : %s\n", kbd_mode_changer.c_str ());
+            create_notification (&hwkbd_module_noti);
+        }
 #endif
 
 #ifdef HAVE_VCONF
@@ -6668,6 +6677,9 @@ static void _bt_cb_hid_state_changed (int result, bool connected, const char *re
 static void show_ime_selector_notification ()
 {
     String ise_name;
+
+    if (!_MOBILE) return;
+
     unsigned int idx = get_ise_index (_info_manager->get_current_helper_uuid ());
     if (idx < _ime_info.size ())
         ise_name = _ime_info[idx].label;
index 74467c7..448fa6c 100644 (file)
@@ -37,3 +37,5 @@ isf_kbd_mode_changer_LDFLAGS  = @VCONF_LIBS@ -rpath $(libdir)\
                                 @DLOG_LIBS@ \
                                 @APPFW_LIBS@ \
                                 -pie
+
+isf_kbd_mode_changer_LDADD    = $(top_builddir)/ism/src/libprofile.la
index 8624461..d22ec54 100644 (file)
@@ -41,4 +41,5 @@ module_la_LIBADD   = $(LD_VERSION_SCRIPT_OPTION) \
                      @ECORE_WL_LIBS@ \
                      @WL_TEXT_INPUT_LIBS@ \
                      @DLOG_LIBS@ \
-                     @VCONF_LIBS@
+                     @VCONF_LIBS@ \
+                     $(top_builddir)/ism/src/libprofile.la
index b56224b..13a9693 100644 (file)
@@ -33,8 +33,8 @@
 #include <vconf.h>
 #endif
 #include "isf_debug.h"
-
 #include "wayland_imcontext.h"
+#include "tizen_profile.h"
 
 #ifdef LOG_TAG
 # undef LOG_TAG
@@ -711,11 +711,10 @@ key_down_filter_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
             return EINA_FALSE; /* the event is removed from the queue */
         }
 
-#ifdef _TV
-        return EINA_TRUE; /* the event is kept */
-#else
-        return EINA_FALSE; /* the event is removed from the queue */
-#endif /* _TV */
+        if (_TV)
+            return EINA_TRUE; /* the event is kept */
+        else
+            return EINA_FALSE; /* the event is removed from the queue */
     }
     return EINA_TRUE; /* the event is kept */
 }
@@ -753,17 +752,16 @@ key_up_filter_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
     else {
         ecore_imf_context_reset(active_ctx);
 
-#ifdef _TV
-        return EINA_TRUE; /* the event is kept */
-#else
-        _input_panel_hide(active_ctx, EINA_TRUE);
+        if (_TV)
+            return EINA_TRUE; /* the event is kept */
+        else {
+            _input_panel_hide(active_ctx, EINA_TRUE);
 
-        return EINA_FALSE; /* the event is removed from the queue */
-#endif /* _TV */
+            return EINA_FALSE; /* the event is removed from the queue */
+        }
     }
 }
 
-#ifdef _WEARABLE
 static Eina_Bool
 rotary_event_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
 {
@@ -789,7 +787,6 @@ rotary_event_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
 
     return EINA_FALSE;
 }
-#endif
 
 static Eina_Bool
 _ecore_event_filter_cb(void *data, void *loop_data EINA_UNUSED, int type, void *event)
@@ -800,12 +797,10 @@ _ecore_event_filter_cb(void *data, void *loop_data EINA_UNUSED, int type, void *
     else if (type == ECORE_EVENT_KEY_UP) {
         return key_up_filter_cb(data, type, event);
     }
-#ifdef _WEARABLE
     /* The IME needs to process Rotary event prior to client application */
     else if (type == ECORE_EVENT_DETENT_ROTATE) {
         return rotary_event_cb(data, type, event);
     }
-#endif
 
     return EINA_TRUE;
 }
@@ -1004,9 +999,10 @@ _hide_timer_handler(void *data)
         LOGD("No need to reset conformant, sending ACK right away");
         _send_will_hide_ack((WaylandIMContext *)ecore_imf_context_data_get(ctx));
     }
-#ifdef _TV
-    reset_keyboard_geometry();
-#endif
+
+    if (_TV)
+        reset_keyboard_geometry();
+
     _hide_timer = NULL;
     return ECORE_CALLBACK_CANCEL;
 }
@@ -1036,9 +1032,9 @@ _input_panel_hide(Ecore_IMF_Context *ctx, Eina_Bool instant)
             LOGD("No need to reset conformant, sending ACK right away");
             _send_will_hide_ack((WaylandIMContext *)ecore_imf_context_data_get(ctx));
         }
-#ifdef _TV
-        reset_keyboard_geometry();
-#endif
+
+        if (_TV)
+            reset_keyboard_geometry();
     } else {
         _input_panel_hide_timer_start(ctx);
         // TIZEN_ONLY(20150708): Support back key
@@ -1100,27 +1096,28 @@ update_state(WaylandIMContext *imcontext)
 static Eina_Bool
 check_serial(WaylandIMContext *imcontext, uint32_t serial)
 {
-#ifdef _TV
-    return EINA_TRUE;
-#endif
-    Ecore_IMF_Preedit_Attr *attr;
+    if (_TV)
+        return EINA_TRUE;
+    else {
+        Ecore_IMF_Preedit_Attr *attr;
+
+        if ((imcontext->serial - serial) >
+                (imcontext->serial - imcontext->reset_serial)) {
+            LOGD("outdated serial: %u, current: %u, reset: %u",
+                    serial, imcontext->serial, imcontext->reset_serial);
 
-    if ((imcontext->serial - serial) >
-        (imcontext->serial - imcontext->reset_serial)) {
-        LOGD("outdated serial: %u, current: %u, reset: %u",
-                serial, imcontext->serial, imcontext->reset_serial);
+            imcontext->pending_preedit.cursor = 0;
 
-        imcontext->pending_preedit.cursor = 0;
+            if (imcontext->pending_preedit.attrs) {
+                EINA_LIST_FREE(imcontext->pending_preedit.attrs, attr) free(attr);
+                imcontext->pending_preedit.attrs = NULL;
+            }
 
-        if (imcontext->pending_preedit.attrs) {
-            EINA_LIST_FREE(imcontext->pending_preedit.attrs, attr) free(attr);
-            imcontext->pending_preedit.attrs = NULL;
+            return EINA_FALSE;
         }
 
-        return EINA_FALSE;
+        return EINA_TRUE;
     }
-
-    return EINA_TRUE;
 }
 
 static void
@@ -1451,18 +1448,21 @@ static Eina_Bool _conformant_change_cb(void *data, int ev_type, void *ev)
             evas_event_callback_del(_active_context_canvas, EVAS_CALLBACK_RENDER_POST, _render_post_cb);
         }
 
-#ifdef _TV
-        /* TV IME consists of two or three windows, so ecore_wl_window_keyboard_geometry_get() may return wrong size. */
-        int x = _keyboard_geometry.x, y = _keyboard_geometry.y, w = _keyboard_geometry.w, h = _keyboard_geometry.h;
-        Eina_Bool result = EINA_TRUE;
-        if (_keyboard_geometry.w == 0 || _keyboard_geometry.h == 0) {
+        Eina_Bool result = EINA_FALSE;
+        int x = 0, y = 0, w = 0, h = 0;
+
+        if (_TV) {
+            /* TV IME consists of two or three windows, so ecore_wl_window_keyboard_geometry_get() may return wrong size. */
+            x = _keyboard_geometry.x, y = _keyboard_geometry.y, w = _keyboard_geometry.w, h = _keyboard_geometry.h;
+            if (_keyboard_geometry.w == 0 || _keyboard_geometry.h == 0) {
+                result = ecore_wl_window_keyboard_geometry_get(window, &x, &y, &w, &h);
+            }
+        } else {
+            /* Since the input_panel_geometry is not delivered right at the moment, we use conformant geometry instead */
+            x = 0, y = 0, w = 0, h = 0;
             result = ecore_wl_window_keyboard_geometry_get(window, &x, &y, &w, &h);
         }
-#else
-        /* Since the input_panel_geometry is not delivered right at the moment, we use conformant geometry instead */
-        int x = 0, y = 0, w = 0, h = 0;
-        Eina_Bool result = ecore_wl_window_keyboard_geometry_get(window, &x, &y, &w, &h);
-#endif
+
         if (result) {
             Evas_Coord scr_w = 0, scr_h = 0;
             ecore_wl_sync();
@@ -2422,7 +2422,6 @@ keyboard_mode_changed_cb (keynode_t *key, void* data)
     }
 }
 
-#ifdef _TV
 static Eina_Bool read_devices = EINA_FALSE;
 char ** device_names = NULL;
 
@@ -2456,7 +2455,6 @@ filter_devices (const char *dev_name)
     return EINA_FALSE;
 }
 #endif
-#endif
 
 void wayland_im_initialize ()
 {
@@ -2513,15 +2511,15 @@ void wayland_im_uninitialize ()
     vconf_ignore_key_changed (VCONFKEY_ISF_INPUT_LANGUAGE, input_language_changed_cb);
     vconf_ignore_key_changed (VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, keyboard_mode_changed_cb);
 
-#ifdef _TV
-    if (device_names) {
-        if (device_names[0])
-            free (device_names[0]);
-        free (device_names);
-        device_names = NULL;
+    if (_TV) {
+        if (device_names) {
+            if (device_names[0])
+                free (device_names[0]);
+            free (device_names);
+            device_names = NULL;
+        }
     }
 #endif
-#endif
 
     if (_ime_device) {
         ecore_device_del (_ime_device);
@@ -2958,18 +2956,18 @@ wayland_im_context_filter_event(Ecore_IMF_Context    *ctx,
             return EINA_FALSE;
         }
 
-#ifdef _TV
-        if (strcmp (ecore_key_ev.keyname, "Return") == 0 && type == ECORE_IMF_EVENT_KEY_DOWN && filter_devices (key_dev_name) && hw_keyboard_mode == EINA_TRUE) {
-            LOGD ("Changed keyboard mode from H/W to S/W ");
-            hw_keyboard_mode = EINA_FALSE;
-            vconf_set_bool (VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, 0);
+        if (_TV) {
+            if (strcmp (ecore_key_ev.keyname, "Return") == 0 && type == ECORE_IMF_EVENT_KEY_DOWN && filter_devices (key_dev_name) && hw_keyboard_mode == EINA_TRUE) {
+                LOGD ("Changed keyboard mode from H/W to S/W ");
+                hw_keyboard_mode = EINA_FALSE;
+                vconf_set_bool (VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, 0);
 
-            if (ecore_imf_context_input_panel_enabled_get (ctx)) {
-                ecore_imf_context_input_panel_show (ctx);
+                if (ecore_imf_context_input_panel_enabled_get (ctx)) {
+                    ecore_imf_context_input_panel_show (ctx);
+                }
+                return EINA_TRUE;
             }
-            return EINA_TRUE;
         }
-#endif
 
         do {
             if (!ecore_key_ev.timestamp && (ecore_key_ev.modifiers & MOD_Mod5_MASK)) {
index 47d4684..4aff2b2 100644 (file)
@@ -76,5 +76,5 @@ socket_la_LDFLAGS     = -avoid-version \
                          @LTLIBINTL@ \
                          @DLOG_LIBS@
 
-socket_la_LIBADD       = $(top_builddir)/ism/src/libscim@SCIM_EPOCH@.la
-
+socket_la_LIBADD       = $(top_builddir)/ism/src/libscim@SCIM_EPOCH@.la \
+                      $(top_builddir)/ism/src/libprofile.la
index 3c88453..a99b891 100644 (file)
@@ -83,5 +83,5 @@ socket_la_LDFLAGS  = -avoid-version \
                      @APP_CONTROL_LIBS@ \
                      @LIBTOOL_EXPORT_OPTIONS@
 
-socket_la_LIBADD   = $(top_builddir)/ism/src/libscim@SCIM_EPOCH@.la
-
+socket_la_LIBADD   = $(top_builddir)/ism/src/libscim@SCIM_EPOCH@.la \
+                     $(top_builddir)/ism/src/libprofile.la
index 3362103..b7f3e13 100644 (file)
@@ -45,4 +45,5 @@ ecoresocket_la_LDFLAGS  = -avoid-version \
                          @AUL_LIBS@ \
                          @ECORE_LIBS@
 
-ecoresocket_la_LIBADD    = $(top_builddir)/ism/src/libscim@SCIM_EPOCH@.la
+ecoresocket_la_LIBADD    = $(top_builddir)/ism/src/libscim@SCIM_EPOCH@.la \
+                           $(top_builddir)/ism/src/libprofile.la
index d0bf25d..9a1b097 100644 (file)
@@ -59,4 +59,5 @@ wayland_la_LDFLAGS  = -avoid-version \
                        @WL_INPUT_METHOD_LIBS@ \
                        @XKBCOMMON_LIBS@
 
-wayland_la_LIBADD    = $(top_builddir)/ism/src/libscim@SCIM_EPOCH@.la
+wayland_la_LIBADD    = $(top_builddir)/ism/src/libscim@SCIM_EPOCH@.la \
+                       $(top_builddir)/ism/src/libprofile.la
index ce5b218..57540b9 100644 (file)
@@ -56,6 +56,7 @@
 #include "scim.h"
 #include "isf_wsc_context.h"
 #include "isf_wsc_control_ui.h"
+#include "tizen_profile.h"
 
 #include <linux/input.h>
 
@@ -158,9 +159,7 @@ static void     _show_preedit_string          (int                     context);
 
 static void     panel_req_update_bidi_direction         (WSCContextISF     *ic, int direction);
 
-#if ENABLE_REMOTE_INPUT
 static void     remote_surrounding_get                  (WSCContextISF     *wsc_ctx);
-#endif
 
 static void     wl_im_destroy                           (void);
 
@@ -179,9 +178,7 @@ static void     finalize                                (void);
 
 static void     send_wl_key_event                       (WSCContextISF *ic, const KeyEvent &key, bool fake);
 static void     _hide_preedit_string                    (int context, bool update_preedit);
-#ifdef _TV
 static bool     filter_devices                          (const char *dev_name);
-#endif
 
 /* Local variables declaration */
 static String                                           _language;
@@ -208,10 +205,8 @@ static bool                                             _support_hw_keyboard_mod
 static bool                                             _x_key_event_is_valid       = false;
 
 static Ecore_Timer                                     *_resource_check_timer       = NULL;
-#ifdef _TV
 static std::vector <String>                             remote_control_devices;
 static bool                                             read_devices = false;
-#endif
 
 static bool                                             _need_wl_im_init           = false;
 static struct _wl_im                                    *_wl_im_ctx                = NULL;
@@ -298,10 +293,10 @@ _wsc_im_ctx_content_type (void *data, struct wl_input_method_context *im_ctx, ui
         }
     }
 
-#if ENABLE_REMOTE_INPUT
-    isf_wsc_context_send_entry_metadata (wsc_ctx, wsc_context_input_hint_get (wsc_ctx), wsc_context_input_panel_layout_get (wsc_ctx),
-        wsc_context_input_panel_layout_variation_get (wsc_ctx), wsc_context_autocapital_type_get (wsc_ctx), wsc_ctx->return_key_disabled);
-#endif
+    if (_TV) {
+        isf_wsc_context_send_entry_metadata (wsc_ctx, wsc_context_input_hint_get (wsc_ctx), wsc_context_input_panel_layout_get (wsc_ctx),
+                wsc_context_input_panel_layout_variation_get (wsc_ctx), wsc_context_autocapital_type_get (wsc_ctx), wsc_ctx->return_key_disabled);
+    }
 }
 
 static void
@@ -376,10 +371,9 @@ _wsc_im_ctx_return_key_disabled (void *data, struct wl_input_method_context *im_
     if (wsc_ctx->return_key_disabled != return_key_disabled) {
         wsc_ctx->return_key_disabled = return_key_disabled;
         isf_wsc_context_input_panel_return_key_disabled_set (wsc_ctx, wsc_ctx->return_key_disabled);
-#if ENABLE_REMOTE_INPUT
-        isf_wsc_context_send_entry_metadata (wsc_ctx, wsc_context_input_hint_get (wsc_ctx), wsc_context_input_panel_layout_get (wsc_ctx),
-        wsc_context_input_panel_layout_variation_get (wsc_ctx), wsc_context_autocapital_type_get (wsc_ctx), wsc_ctx->return_key_disabled);
-#endif
+        if (_TV)
+            isf_wsc_context_send_entry_metadata (wsc_ctx, wsc_context_input_hint_get (wsc_ctx), wsc_context_input_panel_layout_get (wsc_ctx),
+                    wsc_context_input_panel_layout_variation_get (wsc_ctx), wsc_context_autocapital_type_get (wsc_ctx), wsc_ctx->return_key_disabled);
     }
 }
 
@@ -430,9 +424,8 @@ _wsc_im_ctx_cursor_position (void *data, struct wl_input_method_context *im_ctx,
     LOGD ("wsc_ctx->surrounding_cursor = %d\n", wsc_ctx->surrounding_cursor);
     g_info_manager->socket_update_cursor_position (cursor_pos);
 
-#if ENABLE_REMOTE_INPUT
-    remote_surrounding_get (wsc_ctx);
-#endif
+    if (_TV)
+        remote_surrounding_get (wsc_ctx);
 }
 
 static void
@@ -820,9 +813,9 @@ _wsc_im_show_input_panel (void *data, struct wl_input_method *input_method, stru
 
     isf_wsc_context_input_panel_show (wsc->wsc_ctx);
     wsc->wsc_ctx->input_panel_shown = true;
-#if ENABLE_REMOTE_INPUT
-    remote_surrounding_get (wsc->wsc_ctx);
-#endif
+
+    if (_TV)
+        remote_surrounding_get (wsc->wsc_ctx);
 }
 
 static void
@@ -887,7 +880,6 @@ _wsc_setup (struct weescim *wsc)
 
 //////////////////////////////wayland_panel_agent_module end//////////////////////////////////////////////////
 
-#ifdef _TV
 static bool
 filter_devices (const char *dev_name)
 {
@@ -915,7 +907,6 @@ filter_devices (const char *dev_name)
 
     return false;
 }
-#endif
 
 WSCContextISF *
 get_focused_ic ()
@@ -1099,10 +1090,9 @@ check_input_resource (WSCContextISF* wsc_ctx, Input_Resource input_res)
         if (context_scim->impl->input_resource == input_res)
             return;
 
-#if ENABLE_REMOTE_INPUT
-        if (context_scim->impl->input_resource != input_res && input_res != INPUT_RESOURCE_NONE)
-            g_info_manager->remoteinput_callback_input_resource (input_res);
-#endif
+        if (_TV)
+            if (context_scim->impl->input_resource != input_res && input_res != INPUT_RESOURCE_NONE)
+                g_info_manager->remoteinput_callback_input_resource (input_res);
 
         if (context_scim->impl->input_resource == INPUT_RESOURCE_REMOTE && input_res == INPUT_RESOURCE_LOCAL) {
             if (context_scim->impl->need_commit_preedit) {
@@ -1352,9 +1342,8 @@ isf_wsc_context_focus_in (WSCContextISF *wsc_ctx)
 
         g_info_manager->get_active_helper_option (WAYLAND_MODULE_CLIENT_ID, _active_helper_option);
 
-#if ENABLE_REMOTE_INPUT
-        g_info_manager->remoteinput_callback_focus_in ();
-#endif
+        if (_TV)
+            g_info_manager->remoteinput_callback_focus_in ();
 
         context_scim->impl->init_remote_entry_metadata = false;
         context_scim->impl->init_remote_surrounding_text = false;
@@ -1391,9 +1380,8 @@ isf_wsc_context_focus_out (WSCContextISF *wsc_ctx)
 
         _focused_ic = 0;
 
-#if ENABLE_REMOTE_INPUT
+        if (_TV)
         g_info_manager->remoteinput_callback_focus_out ();
-#endif
 
         context_scim->impl->surrounding_text.clear ();
         context_scim->impl->preedit_string.clear ();
@@ -1499,27 +1487,28 @@ isf_wsc_context_send_surrounding_text (WSCContextISF* wsc_ctx, const char *text,
         context_scim->impl->surrounding_text = utf8_mbstowcs (String (text));
         context_scim->impl->cursor_pos = cursor;
 
-#if ENABLE_REMOTE_INPUT
-        if (context_scim->input_panel_shown && context_scim->impl->input_resource != INPUT_RESOURCE_REMOTE) {
-            String _text(text);
-            if (context_scim->impl->panel_layout == ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD) {
-                const unsigned char pw_char[5] = { 0xE2, 0x80, 0xA2, 0x2A, 0x00 };    // â€¢ U+2022 * U+002A
-                if (_text.find_first_not_of((char *)pw_char) != String::npos) {
-                    g_info_manager->remoteinput_callback_surrounding_text (_text, context_scim->impl->cursor_pos);
+        if (_TV) {
+            if (context_scim->input_panel_shown && context_scim->impl->input_resource != INPUT_RESOURCE_REMOTE) {
+                String _text(text);
+                if (context_scim->impl->panel_layout == ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD) {
+                    const unsigned char pw_char[5] = { 0xE2, 0x80, 0xA2, 0x2A, 0x00 };    // â€¢ U+2022 * U+002A
+                    if (_text.find_first_not_of((char *)pw_char) != String::npos) {
+                        g_info_manager->remoteinput_callback_surrounding_text (_text, context_scim->impl->cursor_pos);
+                    }
+                    else {
+                        String empty("");
+                        g_info_manager->remoteinput_callback_surrounding_text (empty, 0);
+                    }
                 }
                 else {
-                    String empty("");
-                    g_info_manager->remoteinput_callback_surrounding_text (empty, 0);
+                    g_info_manager->remoteinput_callback_surrounding_text (_text, context_scim->impl->cursor_pos);
                 }
+                context_scim->impl->init_remote_surrounding_text = true;
             }
-            else {
-                g_info_manager->remoteinput_callback_surrounding_text (_text, context_scim->impl->cursor_pos);
-            }
+        }
+        else {
             context_scim->impl->init_remote_surrounding_text = true;
         }
-#else
-        context_scim->impl->init_remote_surrounding_text = true;
-#endif
     }
     free (conv_text);
 }
@@ -1548,22 +1537,19 @@ isf_wsc_context_send_entry_metadata (WSCContextISF* wsc_ctx, Ecore_IMF_Input_Hin
             context_scim->impl->autocapital_type = type;
             context_scim->impl->return_key_disabled = return_key_disabled;
 
-#if ENABLE_REMOTE_INPUT
-            g_info_manager->remoteinput_callback_entry_metadata (context_scim->impl->input_hint, context_scim->impl->panel_layout,
-                context_scim->impl->variation, context_scim->impl->autocapital_type, context_scim->impl->return_key_disabled);
-#endif
+            if (_TV)
+                g_info_manager->remoteinput_callback_entry_metadata (context_scim->impl->input_hint, context_scim->impl->panel_layout,
+                        context_scim->impl->variation, context_scim->impl->autocapital_type, context_scim->impl->return_key_disabled);
 
             context_scim->impl->init_remote_entry_metadata = true;
 
-#if ENABLE_REMOTE_INPUT
-            remote_surrounding_get (wsc_ctx);
-#endif
+            if (_TV)
+                remote_surrounding_get (wsc_ctx);
         }
     }
 }
 
 #if ENABLE_GRAB_KEYBOARD
-#ifdef _TV
 static
 bool is_number_key (const char *str)
 {
@@ -1580,7 +1566,6 @@ bool is_number_key (const char *str)
     else
         return true;
 }
-#endif
 
 void
 isf_wsc_context_filter_key_event (WSCContextISF* wsc_ctx,
@@ -1608,23 +1593,31 @@ isf_wsc_context_filter_key_event (WSCContextISF* wsc_ctx,
                 timestamp > 1 &&
                 _support_hw_keyboard_mode &&
                 strncmp (keyname, "XF86", 4)) {
-#ifdef _TV
-                if (strcmp (keyname, "Down") &&
-                    strcmp (keyname, "KP_Down") &&
-                    strcmp (keyname, "Up") &&
-                    strcmp (keyname, "KP_Up") &&
-                    strcmp (keyname, "Right") &&
-                    strcmp (keyname, "KP_Right") &&
-                    strcmp (keyname, "Left") &&
-                    strcmp (keyname, "KP_Left") &&
-                    strcmp (keyname, "Return") &&
-                    strcmp (keyname, "Pause") &&
-                    strcmp (keyname, "NoSymbol") &&
-                    !is_number_key (keyname)) {
-#else
-                if (key.code != 0x1008ff26 && key.code != 0xFF69) {
-                    /* XF86back, Cancel (Power + Volume down) key */
-#endif
+                bool hw_key_detect = false;
+
+                if (_TV) {
+                    if (strcmp (keyname, "Down") &&
+                        strcmp (keyname, "KP_Down") &&
+                        strcmp (keyname, "Up") &&
+                        strcmp (keyname, "KP_Up") &&
+                        strcmp (keyname, "Right") &&
+                        strcmp (keyname, "KP_Right") &&
+                        strcmp (keyname, "Left") &&
+                        strcmp (keyname, "KP_Left") &&
+                        strcmp (keyname, "Return") &&
+                        strcmp (keyname, "Pause") &&
+                        strcmp (keyname, "NoSymbol") &&
+                        !is_number_key (keyname)) {
+                        hw_key_detect = true;
+                    }
+                } else {
+                    if (key.code != 0x1008ff26 && key.code != 0xFF69) {
+                        /* XF86back, Cancel (Power + Volume down) key */
+                        hw_key_detect = true;
+                    }
+                }
+
+                if (hw_key_detect) {
                     isf_wsc_context_set_keyboard_mode (wsc_ctx, TOOLBAR_KEYBOARD_MODE);
                     ISF_SAVE_LOG ("Changed keyboard mode from S/W to H/W (code: %x, name: %s)\n", key.code, keyname);
                     LOGD ("Hardware keyboard mode, active helper option: %d\n", _active_helper_option);
@@ -1697,23 +1690,31 @@ isf_wsc_context_filter_key_event (WSCContextISF* wsc_ctx,
                 timestamp > 1 &&
                 _support_hw_keyboard_mode &&
                 strncmp (keysym, "XF86", 4)) {
-#ifdef _TV
-                if (strcmp (keysym, "Down") &&
-                    strcmp (keysym, "KP_Down") &&
-                    strcmp (keysym, "Up") &&
-                    strcmp (keysym, "KP_Up") &&
-                    strcmp (keysym, "Right") &&
-                    strcmp (keysym, "KP_Right") &&
-                    strcmp (keysym, "Left") &&
-                    strcmp (keysym, "KP_Left") &&
-                    strcmp (keysym, "Return") &&
-                    strcmp (keysym, "Pause") &&
-                    strcmp (keysym, "NoSymbol") &&
-                    !filter_devices (dev_name)) {
-#else
-                if (key.code != 0x1008ff26 && key.code != 0xFF69) {
-                    /* XF86back, Cancel (Power + Volume down) key */
-#endif
+                bool hw_key_detect = false;
+
+                if (_TV) {
+                    if (strcmp (keysym, "Down") &&
+                        strcmp (keysym, "KP_Down") &&
+                        strcmp (keysym, "Up") &&
+                        strcmp (keysym, "KP_Up") &&
+                        strcmp (keysym, "Right") &&
+                        strcmp (keysym, "KP_Right") &&
+                        strcmp (keysym, "Left") &&
+                        strcmp (keysym, "KP_Left") &&
+                        strcmp (keysym, "Return") &&
+                        strcmp (keysym, "Pause") &&
+                        strcmp (keysym, "NoSymbol") &&
+                        !filter_devices (dev_name)) {
+                        hw_key_detect = true;
+                    }
+                } else {
+                    if (key.code != 0x1008ff26 && key.code != 0xFF69) {
+                        /* XF86back, Cancel (Power + Volume down) key */
+                        hw_key_detect = true;
+                    }
+                }
+
+                if (hw_key_detect) {
                     isf_wsc_context_set_keyboard_mode (wsc_ctx, TOOLBAR_KEYBOARD_MODE);
                     ISF_SAVE_LOG ("Changed keyboard mode from S/W to H/W (code: %x, key : %s)\n", key.code, keysym);
                     LOGD ("Hardware keyboard mode, active helper option: %d\n", _active_helper_option);
@@ -1928,7 +1929,6 @@ bool wsc_context_surrounding_get (WSCContextISF *wsc_ctx, char **text, int *curs
     return true;
 }
 
-#if ENABLE_REMOTE_INPUT
 static Eina_Bool
 remote_surrounding_text_fd_read_func (void* data, Ecore_Fd_Handler* fd_handler) {
     if (fd_handler == NULL || data == NULL)
@@ -2019,7 +2019,6 @@ remote_surrounding_get (WSCContextISF *wsc_ctx)
         }
     }
 }
-#endif
 
 Ecore_IMF_Input_Panel_Layout wsc_context_input_panel_layout_get (WSCContextISF *wsc_ctx)
 {
index dbd677d..22e38d5 100644 (file)
@@ -45,7 +45,8 @@ noinst_HEADERS                = ltdl.h \
                          scim_stl_map.h \
                          isf_query_utility.h \
                          isf_pkg.h \
-                         isf_debug.h
+                         isf_debug.h \
+                         tizen_profile.h
 
 libscimincludedir       = $(includedir)/scim@SCIM_EPOCH@
 
@@ -99,9 +100,10 @@ libsciminclude_HEADERS      = scim.h \
                          isf_panel_agent_module.h \
                          isf_message_queue.h \
                          isf_remote_control.h \
-                         isf_remote_client.h
+                         isf_remote_client.h \
+                         tizen_profile.h
 
-noinst_LTLIBRARIES     = libltdlc.la libprivilege_checker.la libisf_pkg.la
+noinst_LTLIBRARIES     = libltdlc.la libprivilege_checker.la libprofile.la libisf_pkg.la
 
 libltdlc_la_SOURCES    = ltdl.cpp
 libltdlc_la_LIBADD     = $(LIBADD_DL)
@@ -110,8 +112,12 @@ libprivilege_checker_la_SOURCES    = privilege_checker.cpp
 libprivilege_checker_la_CXXFLAGS = @DLOG_CFLAGS@ @CYNARA_CFLAGS@
 libprivilege_checker_la_LIBADD = @DLOG_LIBS@ @CYNARA_LIBS@
 
+libprofile_la_SOURCES  = tizen_profile.cpp
+libprofile_la_CXXFLAGS = @SYSTEM_INFO_CFLAGS@
+libprofile_la_LIBADD   = @SYSTEM_INFO_LIBS@
+
 libisf_pkg_la_SOURCES  = isf_pkg.cpp
-libisf_pkg_la_CXXFLAGS =  @DLOG_CFLAGS@ @PKGMGR_INFO_CFLAGS@ @PACKAGE_MANAGER_CFLAGS@ @TZPLATFORM_CONFIG_CFLAGS@
+libisf_pkg_la_CXXFLAGS = @DLOG_CFLAGS@ @PKGMGR_INFO_CFLAGS@ @PACKAGE_MANAGER_CFLAGS@ @TZPLATFORM_CONFIG_CFLAGS@
 libisf_pkg_la_LIBADD   = @DLOG_LIBS@ @PKGMGR_INFO_LIBS@  @PACKAGE_MANAGER_LIBS@ @TZPLATFORM_CONFIG_LIBS@
 
 if SCIM_LD_VERSION_SCRIPT
@@ -189,7 +195,7 @@ libscim@SCIM_EPOCH@_la_LDFLAGS  = -version-info $(SCIM_CURRENT):$(SCIM_REVISION)
                          @GLIB_LIBS@ \
                          -lstdc++
 
-libscim@SCIM_EPOCH@_la_LIBADD  = libltdlc.la
+libscim@SCIM_EPOCH@_la_LIBADD  = libltdlc.la libprofile.la
 
 libexecdir             = $(libdir)/scim@SCIM_EPOCH@
 libexec_PROGRAMS        = scim-helper-launcher
index ada9f0d..5d45867 100644 (file)
 #ifndef __ISF_DEBUG_H__
 #define __ISF_DEBUG_H__
 
-#ifdef _TV
+#include "tizen_profile.h"
+#include <dlog.h>
+
 #ifdef LOGD
 # undef LOGD
 #endif
-#define LOGD LOGI
+#define LOGD ISF_LOGD
 
 #ifdef SECURE_LOGD
 # undef SECURE_LOGD
 #endif
-#define SECURE_LOGD SECURE_LOGI
-#endif
+#define SECURE_LOGD ISF_SECURE_LOGD
 
-#endif /* __ISF_DEBUG_H__ */
+#define ISF_LOGD(format, arg...) \
+    ({ do { \
+        if (_TV) \
+            LOG_(LOG_ID_MAIN, DLOG_INFO, LOG_TAG, format, ##arg); \
+        else \
+            LOG_(LOG_ID_MAIN, DLOG_DEBUG, LOG_TAG, format, ##arg); \
+      } while (0); })
 
+#define ISF_SECURE_LOGD(format, arg...) \
+    ({ do { \
+        if (_TV) \
+            SECURE_LOG_(LOG_ID_MAIN, DLOG_INFO, LOG_TAG, format, ##arg); \
+        else \
+            SECURE_LOG_(LOG_ID_MAIN, DLOG_DEBUG, LOG_TAG, format, ##arg); \
+      } while (0); })
+
+#endif /* __ISF_DEBUG_H__ */
index ae3e4c8..7a206a9 100644 (file)
@@ -40,6 +40,7 @@
 #include "isf_query_utility.h"
 #include "isf_pkg.h"
 #include "isf_debug.h"
+#include "tizen_profile.h"
 
 #ifdef LOG_TAG
 # undef LOG_TAG
@@ -150,11 +151,11 @@ int isf_pkg_ime_app_list_cb (const pkgmgrinfo_appinfo_h handle, void *user_data)
         ime_db.mode = TOOLBAR_HELPER_MODE;
         if (ime_db.pkgtype.compare ("rpm") == 0) //1 Inhouse Helper ISE(IME)
         {
-#ifdef _TV
-            ime_db.options = SCIM_HELPER_STAND_ALONE | SCIM_HELPER_NEED_SCREEN_INFO | SCIM_HELPER_AUTO_RESTART | ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT;
-#else
-            ime_db.options = SCIM_HELPER_STAND_ALONE | SCIM_HELPER_NEED_SCREEN_INFO | SCIM_HELPER_AUTO_RESTART;
-#endif
+            if (_TV)
+                ime_db.options = SCIM_HELPER_STAND_ALONE | SCIM_HELPER_NEED_SCREEN_INFO | SCIM_HELPER_AUTO_RESTART | ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT;
+            else
+                ime_db.options = SCIM_HELPER_STAND_ALONE | SCIM_HELPER_NEED_SCREEN_INFO | SCIM_HELPER_AUTO_RESTART;
+
             ime_db.module_name = ime_db.pkgid;
 
             String module_path = String (path) + String ("/lib");
@@ -185,12 +186,12 @@ int isf_pkg_ime_app_list_cb (const pkgmgrinfo_appinfo_h handle, void *user_data)
                 ime_db.is_preinstalled = 1;
             }
             else {
-#ifdef _MOBILE
-               ime_db.is_enabled = 0;
-#else
-               ime_db.is_enabled = 1;
-#endif
-               ime_db.is_preinstalled = 0;
+                if (_MOBILE)
+                    ime_db.is_enabled = 0;
+                else
+                    ime_db.is_enabled = 1;
+
+                ime_db.is_preinstalled = 0;
             }
             ime_db.has_option = -1; // At this point, we can't know IME has an option (setting) or not; -1 means unknown.
         }
@@ -208,11 +209,11 @@ int isf_pkg_ime_app_list_cb (const pkgmgrinfo_appinfo_h handle, void *user_data)
                 ime_db.is_preinstalled = 1;
             }
             else {
-#ifdef _MOBILE
-                ime_db.is_enabled = 0;
-#else
-                ime_db.is_enabled = 1;
-#endif
+                if (_MOBILE)
+                    ime_db.is_enabled = 0;
+                else
+                    ime_db.is_enabled = 1;
+
                 ime_db.is_preinstalled = 0;
             }
             ime_db.has_option = -1; // At this point, we can't know IME has an option (setting) or not; -1 means unknown.
index 317c490..626ce13 100644 (file)
@@ -57,6 +57,7 @@
 #include <dlog.h>
 #include "isf_debug.h"
 #include "isf_message_queue.h"
+#include "tizen_profile.h"
 #ifdef HAVE_PKGMGR_INFO
 #include <pkgmgr-info.h>
 #endif // HAVE_PKGMGR_INFO
diff --git a/ism/src/tizen_profile.cpp b/ism/src/tizen_profile.cpp
new file mode 100644 (file)
index 0000000..6908469
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * ISF(Input Service Framework)
+ *
+ * ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable.
+ * Copyright (c) 2012-2017 Samsung Electronics Co., Ltd.
+ *
+ * Contact: Jihoon Kim <jihoon48.kim@samsung.com>
+ *
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include <system_info.h>
+#include <stdlib.h>
+#include "tizen_profile.h"
+
+tizen_profile_t _get_tizen_profile()
+{
+    static tizen_profile_t profile = TIZEN_PROFILE_UNKNOWN;
+    if (__builtin_expect(profile != TIZEN_PROFILE_UNKNOWN, 1))
+        return profile;
+
+    char *profileName;
+    system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+    switch (*profileName)
+    {
+        case 'm':
+        case 'M':
+            profile = TIZEN_PROFILE_MOBILE;
+            break;
+        case 'w':
+        case 'W':
+            profile = TIZEN_PROFILE_WEARABLE;
+            break;
+        case 't':
+        case 'T':
+            profile = TIZEN_PROFILE_TV;
+            break;
+        case 'i':
+        case 'I':
+            profile = TIZEN_PROFILE_IVI;
+            break;
+        default: // common or unknown ==> ALL ARE COMMON.
+            profile = TIZEN_PROFILE_COMMON;
+    }
+    free(profileName);
+
+    return profile;
+}
diff --git a/ism/src/tizen_profile.h b/ism/src/tizen_profile.h
new file mode 100644 (file)
index 0000000..836e2ce
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * ISF(Input Service Framework)
+ *
+ * ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable.
+ * Copyright (c) 2012-2017 Samsung Electronics Co., Ltd.
+ *
+ * Contact: Jihoon Kim <jihoon48.kim@samsung.com>
+ *
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifndef __ISF_TIZEN_PROFILE_H__
+#define __ISF_TIZEN_PROFILE_H__
+
+typedef enum {
+   TIZEN_PROFILE_UNKNOWN = 0,
+   TIZEN_PROFILE_MOBILE = 0x1,
+   TIZEN_PROFILE_WEARABLE = 0x2,
+   TIZEN_PROFILE_TV = 0x4,
+   TIZEN_PROFILE_IVI = 0x8,
+   TIZEN_PROFILE_COMMON = 0x10,
+} tizen_profile_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+extern tizen_profile_t _get_tizen_profile();
+
+#define _TV (_get_tizen_profile() == TIZEN_PROFILE_TV)
+#define _MOBILE (_get_tizen_profile() == TIZEN_PROFILE_MOBILE)
+#define _WEARABLE (_get_tizen_profile() == TIZEN_PROFILE_WEARABLE)
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __ISF_TIZEN_PROFILE_H__ */
index 8dd157b..9886610 100644 (file)
@@ -43,46 +43,16 @@ BuildRequires:  pkgconfig(cynara-client)
 BuildRequires:  pkgconfig(cynara-creds-socket)
 BuildRequires:  pkgconfig(cynara-session)
 BuildRequires:  pkgconfig(capi-appfw-package-manager)
+BuildRequires:  pkgconfig(capi-system-info)
+BuildRequires:  pkgconfig(notification)
 Requires(postun): /sbin/ldconfig
 Requires:      org.tizen.isf-kbd-mode-changer
 
-# Mobile/Common ONLY
-BuildRequires:  pkgconfig(notification)
-
 %define APP_PREFIX %{TZ_SYS_RO_APP}/org.tizen.isf-kbd-mode-changer/bin/
 
 %description
 Input Service Framewok (ISF) is an input method (IM) platform, and it has been derived from SCIM.
 
-# For product build optimization only. Not for Tizen 4.0 Unified.
-# if wearble or ivi or unified
-%if "%{?profile}" != "tv" && "%{?profile}" != "mobile" && "%{?profile}" != "common"
-%package profile_wearable
-Summary:       ISF bin for wearable/ivi
-Requires:      %{name} = %{version}-%{release}
-%description profile_wearable
-Compile isf with --disable-include-notification and --disable-include-libwebsocket
-%endif
-
-# For product build optimization only. Not for Tizen 4.0 Unified.
-# if common or mobile or unified
-%if "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
-%package profile_common
-Summary:       ISF bin for mobile/common
-Requires:      %{name} = %{version}-%{release}
-%description profile_common
-Compile isf with --disable-include-libwebsocket
-%endif
-
-# For product build optimization only. Not for Tizen 4.0 Unified.
-# if tv or unified
-%if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "ivi"
-%package profile_tv
-Summary:       ISF bin for TV
-Requires:      %{name} = %{version}-%{release}
-%description profile_tv
-Compile isf with --disable-include-notification
-%endif
 
 %package devel
 Summary:    ISF header files
@@ -111,21 +81,6 @@ export CFLAGS="$CFLAGS -DWAYLAND"
 export CXXFLAGS="$CXXFLAGS -DWAYLAND"
 %endif
 
-%if "%{profile}" == "wearable"
-CFLAGS+=" -D_WEARABLE";
-CXXFLAGS+=" -D_WEARABLE";
-%endif
-
-%if "%{profile}" == "mobile" || "%{profile}" == "common"
-CFLAGS+=" -D_MOBILE";
-CXXFLAGS+=" -D_MOBILE";
-%endif
-
-%if "%{profile}" == "tv"
-CFLAGS+=" -D_TV";
-CXXFLAGS+=" -D_TV";
-%endif
-
 export GC_SECTIONS_FLAGS="-fdata-sections -ffunction-sections -Wl,--gc-sections"
 export CFLAGS="$CFLAGS -fvisibility=hidden ${GC_SECTIONS_FLAGS} "
 export CXXFLAGS="$CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden ${GC_SECTIONS_FLAGS} "
@@ -133,17 +88,9 @@ export CFLAGS_BASIS="$CFLAGS"
 export CXXFLAGS_BASIS="$CXXFLAGS"
 
 %autogen
-
-# For product build optimization only. Not for Tizen 4.0 Unified.
-# if tv or unified
-%if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "ivi"
-mkdir -p build_tv
-export CFLAGS="$CFLAGS_BASIS -D_TV";
-export CXXFLAGS="$CFLAGS_BASIS -D_TV";
 %configure --disable-static \
                --disable-tray-icon \
                --disable-filter-sctc \
-               --disable-include-notification \
 %if %{with wayland}
         --disable-efl-immodule \
 %endif
@@ -154,78 +101,6 @@ export CXXFLAGS="$CFLAGS_BASIS -D_TV";
                --with-ro-packages-dir=%{TZ_SYS_RO_PACKAGES} \
                --enable-remote-input
 make %{?_smp_mflags}
-# Install essential profile-tv files into build_tv
-%make_install
-mkdir -p build_tv/bin
-mkdir -p build_tv/lib
-mv %{buildroot}%{_bindir}/* build_tv/bin/
-mv %{buildroot}%{_libdir}/* build_tv/lib/
-ls -la build_tv/bin/
-ls -la build_tv/lib/
-ls -la build_tv/
-# if unified
-%if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "ivi" && "%{?profile}" != "tv"
-make clean
-%endif
-
-%endif
-
-# For product build optimization only. Not for Tizen 4.0 Unified.
-# if wearble or ivi or unified
-%if "%{?profile}" != "tv" && "%{?profile}" != "mobile" && "%{?profile}" != "common"
-mkdir -p build_wearable
-export CFLAGS="$CFLAGS_BASIS -D_WEARABLE";
-export CXXFLAGS="$CXXFLAGS_BASIS -D_WEARABLE";
-%configure --disable-static \
-               --disable-tray-icon \
-               --disable-filter-sctc \
-               --disable-include-libwebsocket \
-               --disable-include-notification \
-%if %{with wayland}
-        --disable-efl-immodule \
-%endif
-               --disable-frontend-x11 \
-               --disable-multiwindow-support \
-               --disable-ime-embed-app \
-               --with-ro-app-dir=%{TZ_SYS_RO_APP} \
-               --with-ro-packages-dir=%{TZ_SYS_RO_PACKAGES}
-make %{?_smp_mflags}
-# Install essential profile-wearable files into build_wearable
-%make_install
-mkdir -p build_wearable/bin
-mkdir -p build_wearable/lib
-mv %{buildroot}%{_bindir}/* build_wearable/bin/
-mv %{buildroot}%{_libdir}/* build_wearable/lib/
-ls -la build_wearable/bin/
-ls -la build_wearable/lib/
-
-# if unified
-%if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "ivi" && "%{?profile}" != "tv"
-make clean
-%endif
-
-%endif
-
-# For product build optimization only. Not for Tizen 4.0 Unified.
-# if common or mobile or unified
-%if "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
-# mobile/common
-export CFLAGS="$CFLAGS_BASIS -D_MOBILE";
-export CXXFLAGS="$CXXFLAGS_BASIS -D_MOBILE";
-%configure --disable-static \
-               --disable-tray-icon \
-               --disable-filter-sctc \
-               --disable-include-libwebsocket \
-%if %{with wayland}
-        --disable-efl-immodule \
-%endif
-               --disable-frontend-x11 \
-               --disable-multiwindow-support \
-               --disable-ime-embed-app \
-               --with-ro-app-dir=%{TZ_SYS_RO_APP} \
-               --with-ro-packages-dir=%{TZ_SYS_RO_PACKAGES}
-make %{?_smp_mflags}
-%endif
 
 %install
 rm -rf %{buildroot}
@@ -237,40 +112,6 @@ mkdir -p %{buildroot}/etc/scim/conf
 mkdir -p %{buildroot}/usr/share/upgrade/scripts/
 cp 500.isf_upgrade_24to30.sh %{buildroot}/usr/share/upgrade/scripts/
 
-
-# For product build optimization only. Not for Tizen 4.0 Unified.
-# if tv or unified
-%if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "ivi"
-mv build_tv/bin/isf-demo-efl %{buildroot}%{_bindir}/isf-demo-efl.tv
-mv build_tv/bin/isf-panel-efl %{buildroot}%{_bindir}/isf-panel-efl.tv
-mkdir -p %{buildroot}%{_datadir}/scim
-#mv build_tv/lib/libscim-*.so* %{buildroot}%{_libdir}/libscim-*.so*.tv
-pushd build_tv/lib/
-for FILE in libscim-*.so*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE.tv"; done
-popd
-mv build_tv/lib/scim-1.0/scim-helper-launcher %{buildroot}%{_libdir}/scim-1.0/scim-helper-launcher.tv
-%endif
-
-# For product build optimization only. Not for Tizen 4.0 Unified.
-# if wearble or ivi or unified
-%if "%{?profile}" != "tv" && "%{?profile}" != "mobile" && "%{?profile}" != "common"
-mv build_wearable/bin/isf-demo-efl %{buildroot}%{_bindir}/isf-demo-efl.wearable
-mv build_wearable/bin/isf-panel-efl %{buildroot}%{_bindir}/isf-panel-efl.wearable
-#mv build_wearable/lib/libscim-*.so* %{buildroot}%{_libdir}/libscim-*.so*.wearable
-pushd build_wearable/lib/
-for FILE in libscim-*.so*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE.wearable"; done
-popd
-mv build_wearable/lib/scim-1.0/scim-helper-launcher %{buildroot}%{_libdir}/scim-1.0/scim-helper-launcher.wearable
-%endif
-
-# For product build optimization only. Not for Tizen 4.0 Unified.
-# If common/mobile is not required
-%if "%{?profile}" == "tv" || "%{?profile}" == "wearable" || "%{?profile}" == "ivi"
-rm %{buildroot}%{_bindir}/isf-demo-efl
-rm %{buildroot}%{_bindir}/isf-panel-efl
-rm %{buildroot}%{_libdir}/scim-1.0/scim-helper-launcher
-%endif
-
 %find_lang scim
 
 cat scim.lang > isf.lang
@@ -281,67 +122,6 @@ ln -sf "module.so" %{_libdir}/ecore_imf/modules/wayland/v-1.16/libwltextinputmod
 
 %postun -p /sbin/ldconfig
 
-# For product build optimization only. Not for Tizen 4.0 Unified.
-# if wearble or ivi or unified
-%if "%{?profile}" != "tv" && "%{?profile}" != "mobile" && "%{?profile}" != "common"
-%post profile_wearable
-ln -sf isf-demo-efl.wearable %{_bindir}/isf-demo-efl
-ln -sf isf-panel-efl.wearable %{_bindir}/isf-panel-efl
-ln -sf scim-helper-launcher.wearable %{_libdir}/scim-1.0/scim-helper-launcher
-pushd %{_libdir}
-for FILE in libscim-*.so*.wearable; do ln -sf "$FILE" "${FILE%.wearable}"; done
-popd
-
-%preun profile_wearable
-# Do not execute if upgrade
-if [ $1 -gt 0 ]; then
-rm %{_bindir}/isf-demo-efl
-rm %{_bindir}/isf-panel-efl
-rm %{_libdir}/scim-1.0/scim-helper-launcher
-pushd %{_libdir}
-for FILE in libscim-*.so*; do rm "$FILE"; done
-popd
-fi
-
-%files profile_wearable
-%manifest %{name}.manifest
-# files in bindir and libdir may differ.
-%{_bindir}/isf-demo-efl.wearable
-%{_bindir}/isf-panel-efl.wearable
-%{_libdir}/scim-1.0/scim-helper-launcher.wearable
-%{_libdir}/libscim-*.so*.wearable
-
-%endif
-
-# For product build optimization only. Not for Tizen 4.0 Unified.
-# if tv or unified
-%if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "ivi"
-%post profile_tv
-ln -sf isf-demo-efl.tv %{_bindir}/isf-demo-efl
-ln -sf isf-panel-efl.tv %{_bindir}/isf-panel-efl
-ln -sf scim-helper-launcher.tv %{_libdir}/scim-1.0/scim-helper-launcher
-pushd %{_libdir}
-for FILE in libscim-*.so*.tv; do ln -sf "$FILE" "${FILE%.tv}"; done
-popd
-%preun profile_tv
-# Do not execute if upgrade
-if [ $1 -gt 0 ]; then
-rm %{_bindir}/isf-demo-efl
-rm %{_bindir}/isf-panel-efl
-rm %{_libdir}/scim-1.0/scim-helper-launcher
-pushd %{_libdir}
-for FILE in libscim-*.so*; do rm "$FILE"; done
-popd
-fi
-
-%files profile_tv
-%manifest %{name}.manifest
-# files in bindir, lib/libscim*.so.* are different
-%{_bindir}/isf-demo-efl.tv
-%{_bindir}/isf-panel-efl.tv
-%{_libdir}/scim-1.0/scim-helper-launcher.tv
-%{_libdir}/libscim-*.so*.tv
-%endif
 
 %files -f isf.lang
 %manifest %{name}.manifest
@@ -351,36 +131,20 @@ fi
 %{_sysconfdir}/scim/global
 %{_sysconfdir}/scim/config
 %{_datadir}/scim/icons/*
+%{_bindir}/isf-demo-efl
+%{_bindir}/isf-panel-efl
 %{_libdir}/ecore_imf/modules/*/*/*.so
 %{_libdir}/scim-1.0/1.4.0/IMEngine/socket.so
 %{_libdir}/scim-1.0/1.4.0/PanelAgent/*.so
 %{_libdir}/scim-1.0/1.4.0/Config/simple.so
 %{_libdir}/scim-1.0/1.4.0/Config/socket.so
 %{_libdir}/scim-1.0/1.4.0/FrontEnd/*.so
-# Fortunately imeparser is not fragemented.
+%{_libdir}/scim-1.0/scim-helper-launcher
+%{_libdir}/libscim-*.so*
 %{TZ_SYS_RO_ETC}/package-manager/parserlib/category/libimeparser.so
 %license COPYING
 %{TZ_SYS_ETC}/dump.d/module.d/*
 /usr/share/upgrade/scripts/*
-# files in bindir, lib/libscim*.so.* are different
-%exclude %{_libdir}/libscim-*.so*.tv
-%exclude %{_libdir}/libscim-*.so*.wearable
-%{_libdir}/libscim-*.so*
-# All .so files that are required by other packages should be housed in the main package
-# although they might be overwritten by subpackages unless there is no possibilities of
-# have-choice issues.
-
-# For product build optimization only. Not for Tizen 4.0 Unified.
-# if common or mobile or unified
-%if "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
-%files profile_common
-%manifest %{name}.manifest
-# files in bindir, lib/libscim*.so.* are different
-%{_bindir}/isf-demo-efl
-%{_bindir}/isf-panel-efl
-%{_libdir}/scim-1.0/scim-helper-launcher
-# default .so are housed in the main pkg.
-%endif
 
 %files devel
 %defattr(-,root,root,-)