Disable open input feature 34/124934/3
authorJihoon Kim <jihoon48.kim@samsung.com>
Thu, 13 Apr 2017 05:32:14 +0000 (14:32 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Thu, 13 Apr 2017 07:07:27 +0000 (16:07 +0900)
Change-Id: I8abbc65024f00c364a3450cdddbeb55aa1a0f419
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
configure.ac
ism/data/Makefile.am
ism/data/remote-input/Makefile.am
ism/extras/efl_panel/Makefile.am
ism/extras/efl_panel/remote_input.cpp
packaging/isf.spec

index 2238ef9..37914e5 100644 (file)
@@ -535,6 +535,11 @@ AC_ARG_ENABLE(panel-efl,
               enable_panel_efl=no,
               enable_panel_efl=check)
 
+AC_ARG_ENABLE(open-input,
+              [  --disable-open-input     Do not build Open Input],
+              enable_open_input=no,
+              enable_open_input=check)
+
 AC_ARG_ENABLE(tray-icon,
               [  --disable-tray-icon       Do not build Tray Icon],
               enable_tray_icon=no,
@@ -687,16 +692,26 @@ if test "$enable_panel_efl" != "no"; then
   fi
 fi
 
+ISF_BUILD_OPEN_INPUT=0
 ISF_BUILD_REMOTE_INPUT=0
-if test "$enable_remote_input" != "no"; then
-  enable_remote_input=no
-  if test "$ISF_HAS_LIBWEBSOCKETS" = "yes" && test "$enable_libwebsocket" = "yes"; then
-    ISF_BUILD_REMOTE_INPUT=1
-    enable_remote_input=yes
+if test "$enable_remote_input" = "yes"; then
+  ISF_BUILD_REMOTE_INPUT=1
+  enable_remote_input=yes
+  AC_DEFINE(ENABLE_REMOTE_INPUT,1,[Enable remote input.])
+  if test "$enable_open_input" = "yes" && test "$ISF_HAS_LIBWEBSOCKETS" = "yes" && test "$enable_libwebsocket" = "yes"; then
+    ISF_BUILD_OPEN_INPUT=1
+    enable_open_input=yes
+    AC_DEFINE(ENABLE_OPEN_INPUT,1,[Enable open input.])
+  else
+    enable_open_input=no
   fi
+
   if test "$enable_libwebsocket" = "no"; then
     AC_MSG_NOTICE([LIBWEBSOCKET forced disable.])
   fi
+else
+  enable_open_input=no
+  enable_remote_input=no
 fi
 
 #if nothing needs libscim-gtkutils, just disable it
@@ -770,6 +785,9 @@ AM_CONDITIONAL(ISF_BUILD_PANEL_EFL,
 AM_CONDITIONAL(ISF_BUILD_REMOTE_INPUT,
                 [test "$enable_remote_input" = "yes"])
 
+AM_CONDITIONAL(ISF_BUILD_OPEN_INPUT,
+                [test "$enable_open_input" = "yes"])
+
 AM_CONDITIONAL(ISF_BUILD_DB_UTIL,
                 [test "$ISF_HAS_DB_UTIL" = "yes"])
 
@@ -792,6 +810,7 @@ AC_SUBST(SCIM_BUILD_X11_UTILS)
 AC_SUBST(ISF_BUILD_EFL_IMMODULE)
 AC_SUBST(ISF_BUILD_PANEL_EFL)
 AC_SUBST(ISF_BUILD_REMOTE_INPUT)
+AC_SUBST(ISF_BUILD_OPEN_INPUT)
 AC_SUBST(ISF_BUILD_DB_UTIL)
 AC_SUBST(ISF_INSTALL_SYSTEMD_SCRIPT)
 AC_SUBST(ISF_BUILD_KBD_MODE_CHANGER)
@@ -900,5 +919,6 @@ Module options:
   Enable LazyLaunch        $enable_lazy_launch
   Enable IME Embed         $enable_ime_embed_app
   Enable Remote Input      $enable_remote_input
+  Enable OpenInput         $enable_open_input
 ])
 
index c148933..1252852 100644 (file)
@@ -23,7 +23,7 @@ SUBDIRS                       = icons pixmaps
 isfshelldir    = /etc/profile.d/
 isfshell_DATA  = isf.sh
 
-if ISF_BUILD_REMOTE_INPUT
+if ISF_BUILD_OPEN_INPUT
 webdir = /usr/share/scim/remote-input
 web_DATA =  remote-input/*
-endif
\ No newline at end of file
+endif
index 38f12a9..95dd143 100644 (file)
@@ -13,6 +13,7 @@ icon_DATA             = @ISE_NAME@.png
 helpdir                        = @ISF_MODULEDIR@/Helper
 help_DATA               = @ISE_NAME@.help
 
+if ISF_BUILD_OPEN_INPUT
 webdir = /usr/share/scim/remote-input
 web_DATA = index.htm\
             ajaxCaller.js\
@@ -61,3 +62,4 @@ web_DATA = index.htm\
             keyboard.png\
             scrollbar.png\
             wifikeyboard.png
+endif
index 0c1c67e..fdad64b 100644 (file)
@@ -32,8 +32,10 @@ isf_panel_efl_SOURCES  = isf_panel_efl.cpp \
                          isf_panel_utility.cpp
 
 if ISF_BUILD_REMOTE_INPUT
-isf_panel_efl_SOURCES  += remote_input.cpp \
-                          websocketserver.cpp
+isf_panel_efl_SOURCES  += remote_input.cpp
+if ISF_BUILD_OPEN_INPUT
+isf_panel_efl_SOURCES  += websocketserver.cpp
+endif
 endif
 
 isf_panel_efl_CXXFLAGS = @ECOREX_CFLAGS@ \
index c7e14f4..e898923 100644 (file)
@@ -59,7 +59,9 @@ static char* surrounding_text = 0;
 static int cursor_pos = 0;
 
 static bool launch_web_server = false;
+#ifdef ENABLE_OPEN_INPUT
 static WebSocketServer *g_web_socket_server = NULL;
+#endif
 Remote_Input* Remote_Input::m_instance = NULL;
 Ecore_Event_Handler *keymap_update_handler = NULL;
 
@@ -155,6 +157,8 @@ void Remote_Input::init (InfoManager* info_manager)
     LOGD("Remote Input init");
 
     launch_web_server = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_WEB_SERVER), launch_web_server);
+
+#ifdef ENABLE_OPEN_INPUT
     /* Create web socket server for remote input */
     if (launch_web_server) {
         g_web_socket_server = new WebSocketServer();
@@ -163,6 +167,7 @@ void Remote_Input::init (InfoManager* info_manager)
             g_web_socket_server->init();
         }
     }
+#endif
 
     /* Create uinput device for remote input */
     if (!init_uinput_keyboard_device()) {
@@ -182,8 +187,10 @@ void Remote_Input::init (InfoManager* info_manager)
 
 void Remote_Input::exit()
 {
+#ifdef ENABLE_OPEN_INPUT
     /* Delete web socket server */
     if (g_web_socket_server) delete g_web_socket_server;
+#endif
 
     /* Close uinput device */
     if (ioctl(fd_uinput_keyboard, UI_DEV_DESTROY) < 0) {
@@ -511,8 +518,10 @@ void Remote_Input::handle_recv_panel_message(int mode, const char* text, int cur
             if (cursor_pos != cursor || strcmp (surrounding_text, text) != 0) {
                 cursor_pos = cursor;
                 surrounding_text = strdup(text);
+#ifdef ENABLE_OPEN_INPUT
                 if (g_web_socket_server)
                     g_web_socket_server->get_surrounding_text(cursor, text);
+#endif
             }
             break;
         }
index 6a435cc..e9913c9 100644 (file)
@@ -50,8 +50,6 @@ Requires:     org.tizen.isf-kbd-mode-changer
 
 # Mobile/Common ONLY
 BuildRequires:  pkgconfig(notification)
-# TV ONLY
-BuildRequires:  pkgconfig(libwebsockets)
 
 %define APP_PREFIX %{TZ_SYS_RO_APP}/org.tizen.isf-kbd-mode-changer/bin/
 
@@ -134,8 +132,8 @@ CXXFLAGS+=" -D_MOBILE";
 %endif
 
 %if "%{profile}" == "tv"
-CFLAGS+=" -D_TV -DENABLE_REMOTE_INPUT=1";
-CXXFLAGS+=" -D_TV -DENABLE_REMOTE_INPUT=1";
+CFLAGS+=" -D_TV";
+CXXFLAGS+=" -D_TV";
 %endif
 
 export GC_SECTIONS_FLAGS="-fdata-sections -ffunction-sections -Wl,--gc-sections"
@@ -150,8 +148,8 @@ export CXXFLAGS_BASIS="$CXXFLAGS"
 # if tv or unified
 %if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "ivi"
 mkdir -p build_tv
-export CFLAGS="$CFLAGS_BASIS -D_TV -DENABLE_REMOTE_INPUT=1";
-export CXXFLAGS="$CFLAGS_BASIS -D_TV -DENABLE_REMOTE_INPUT=1";
+export CFLAGS="$CFLAGS_BASIS -D_TV";
+export CXXFLAGS="$CFLAGS_BASIS -D_TV";
 %configure --disable-static \
                --disable-tray-icon \
                --disable-filter-sctc \
@@ -163,7 +161,8 @@ export CXXFLAGS="$CFLAGS_BASIS -D_TV -DENABLE_REMOTE_INPUT=1";
                --disable-multiwindow-support \
                --disable-ime-embed-app \
                --with-ro-app-dir=%{TZ_SYS_RO_APP} \
-               --with-ro-packages-dir=%{TZ_SYS_RO_PACKAGES}
+               --with-ro-packages-dir=%{TZ_SYS_RO_PACKAGES} \
+               --enable-remote-input
 make %{?_smp_mflags}
 # Install essential profile-tv files into build_tv
 %make_install
@@ -171,7 +170,6 @@ mkdir -p build_tv/bin
 mkdir -p build_tv/lib
 mv %{buildroot}%{_bindir}/* build_tv/bin/
 mv %{buildroot}%{_libdir}/* build_tv/lib/
-mv %{buildroot}%{_datadir}/scim/remote-input build_tv/
 ls -la build_tv/bin/
 ls -la build_tv/lib/
 ls -la build_tv/
@@ -255,9 +253,7 @@ cp 500.isf_upgrade_24to30.sh %{buildroot}/usr/share/upgrade/scripts/
 %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
-rm -rf %{buildroot}%{_datadir}/scim/remote-input
 mkdir -p %{buildroot}%{_datadir}/scim
-mv -f build_tv/remote-input %{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
@@ -355,8 +351,6 @@ fi
 %{_bindir}/isf-panel-efl.tv
 %{_libdir}/scim-1.0/scim-helper-launcher.tv
 %{_libdir}/libscim-*.so*.tv
-# TV Only: remote-input
-%attr(755,root,root) %{_datadir}/scim/remote-input/*
 %endif
 
 %files -f isf.lang