Make the configuration for the web_server(open_input server) logic. 67/114067/1
authorWonkeun Oh <wonkeun.oh@samsung.com>
Fri, 10 Feb 2017 01:19:36 +0000 (10:19 +0900)
committerWonkeun Oh <wonkeun.oh@samsung.com>
Fri, 10 Feb 2017 01:32:25 +0000 (10:32 +0900)
Change-Id: Ie8e95d6c25b9c24594bf571685ac9dbd49a2a278

ism/configs/global
ism/extras/efl_panel/remote_input.cpp
ism/src/scim_config_path.h

index 600b976..d948e6e 100755 (executable)
@@ -19,3 +19,4 @@
 /DefaultKbdModeChangerProgram = org.tizen.isf-kbd-mode-changer
 /LockScreenClassName = LOCK_SCREEN, hub-idlescreen
 /LaunchRemoteInput = true
+/LaunchWebServer = true
index 1e94cc1..cc71c24 100644 (file)
@@ -22,6 +22,8 @@
  *
  */
 
+#define Uses_SCIM_CONFIG_PATH
+
 #include "remote_input.h"
 #include "remote_input_keycode.h"
 #include <iostream>
@@ -56,6 +58,7 @@ static int fd_uinput_mouse = 0;
 static char* surrounding_text = 0;
 static int cursor_pos = 0;
 
+static bool launch_web_server = false;
 static WebSocketServer *g_web_socket_server = NULL;
 Remote_Input* Remote_Input::m_instance = NULL;
 Ecore_Event_Handler *keymap_update_handler = NULL;
@@ -151,10 +154,15 @@ Remote_Input::get_instance()
 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);
     /* Create web socket server for remote input */
-    g_web_socket_server = new WebSocketServer();
-    if (g_web_socket_server) {
-        g_web_socket_server->init();
+    if (launch_web_server) {
+        g_web_socket_server = new WebSocketServer();
+        LOGD("Lanuched Web server!");
+        if (g_web_socket_server) {
+            g_web_socket_server->init();
+        }
     }
 
     /* Create uinput device for remote input */
@@ -530,7 +538,8 @@ 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);
-                g_web_socket_server->get_surrounding_text(cursor, text);
+                if (g_web_socket_server)
+                    g_web_socket_server->get_surrounding_text(cursor, text);
             }
             break;
         }
index 0bc9b93..34e1251 100644 (file)
@@ -93,6 +93,7 @@ namespace scim {
 #define SCIM_GLOBAL_CONFIG_DEFAULT_KBD_MODE_CHANGER_PROGRAM         "/DefaultKbdModeChangerProgram"
 #define SCIM_GLOBAL_CONFIG_LAUNCH_REMOTE_INPUT                      "/LaunchRemoteInput"
 #define SCIM_GLOBAL_CONFIG_LOCK_SCREEN_CLASS_NAME                   "/LockScreenClassName"
+#define SCIM_GLOBAL_CONFIG_LAUNCH_WEB_SERVER                        "/LaunchWebServer"
 
 #define ISF_CONFIG_HARDWARE_KEYBOARD_DETECT                         "/isf/hw_keyboard_detect"