From: InHong Han Date: Wed, 10 Jan 2018 12:03:06 +0000 (+0900) Subject: Add isf_control_prelaunch_ise() API X-Git-Tag: accepted/tizen/unified/20180129.073416~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ca998d29276da7d72e930e473986714286a2d69c;p=platform%2Fcore%2Fuifw%2Fisf.git Add isf_control_prelaunch_ise() API Change-Id: Iee05522423b724922611f00ffb9811840c079efd --- diff --git a/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp b/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp index 2a0f3ff..1f19192 100644 --- a/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp +++ b/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp @@ -3205,6 +3205,16 @@ private: trans.put_command(SCIM_TRANS_CMD_OK); trans.write_to_socket(client_socket); m_info_manager->hide_helper_ise (); + } else if (cmd == ISM_TRANS_CMD_LAUNCH_ISE) { + m_info_manager->launch_helper_ise(); + + Transaction trans; + Socket client_socket(client_id); + + trans.clear(); + trans.put_command(SCIM_TRANS_CMD_REPLY); + trans.put_command(SCIM_TRANS_CMD_OK); + trans.write_to_socket(client_socket); } else { LOGW ("unknown cmd: %d", cmd); } diff --git a/ism/src/isf_control.cpp b/ism/src/isf_control.cpp index d4bda76..b769dc0 100644 --- a/ism/src/isf_control.cpp +++ b/ism/src/isf_control.cpp @@ -581,6 +581,25 @@ EXAPI int isf_control_hide_ime (void) return ret; } +EXAPI int isf_control_prelaunch_ise (void) +{ + IMControlClient imcontrol_client; + int ret = 0; + + if (!imcontrol_client.open_connection ()) + return -1; + + imcontrol_client.prepare (); + if (!imcontrol_client.launch_helper_ise ()) { + LOGW ("launch_helper_ise failed"); + ret = -1; + } + + imcontrol_client.close_connection (); + + return ret; +} + /* vi:ts=4:nowrap:ai:expandtab diff --git a/ism/src/isf_control.h b/ism/src/isf_control.h index 00824f5..22c3e0e 100644 --- a/ism/src/isf_control.h +++ b/ism/src/isf_control.h @@ -340,6 +340,15 @@ int isf_control_get_recent_ime_geometry_with_rotation_angle (int angle, int *x, */ int isf_control_hide_ime (void); +/** + * @brief Requests to pre-launch the ISE. + * + * @since_tizen 5.0 + * + * @return 0 on success, otherwise return -1 + */ +int isf_control_prelaunch_ise (void); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/ism/src/isf_imcontrol_client.cpp b/ism/src/isf_imcontrol_client.cpp index fe1778d..155fff5 100644 --- a/ism/src/isf_imcontrol_client.cpp +++ b/ism/src/isf_imcontrol_client.cpp @@ -583,6 +583,24 @@ public: return false; } } + + bool launch_helper_ise (void) { + int cmd; + m_trans.put_command (ISM_TRANS_CMD_LAUNCH_ISE); + m_trans.write_to_socket (m_socket_imclient2panel); + if (!m_trans.read_from_socket (m_socket_imclient2panel, m_socket_timeout)) { + std::cerr << __func__ << " read_from_socket() may be timeout \n"; + return false; + } + + if (m_trans.get_command (cmd) && cmd == SCIM_TRANS_CMD_REPLY && + m_trans.get_command (cmd) && cmd == SCIM_TRANS_CMD_OK) { + return true; + } else { + std::cerr << __func__ << " get_command() or get_data() may fail!!!\n"; + return false; + } + } }; IMControlClient::IMControlClient () @@ -713,6 +731,11 @@ bool IMControlClient::hide_helper_ise (void) { return m_impl->hide_helper_ise (); } + +bool IMControlClient::launch_helper_ise (void) +{ + return m_impl->launch_helper_ise (); +} }; /* diff --git a/ism/src/isf_imcontrol_client.h b/ism/src/isf_imcontrol_client.h index fb55db4..10685b8 100644 --- a/ism/src/isf_imcontrol_client.h +++ b/ism/src/isf_imcontrol_client.h @@ -67,6 +67,7 @@ public: bool hide_helper_ise (void); void enable_remote_input (void); void disable_remote_input (void); + bool launch_helper_ise (void); }; } diff --git a/ism/src/isf_info_manager.cpp b/ism/src/isf_info_manager.cpp index 9680d2c..5261802 100644 --- a/ism/src/isf_info_manager.cpp +++ b/ism/src/isf_info_manager.cpp @@ -1483,6 +1483,11 @@ public: #endif } + void launch_helper_ise (void) { + SCIM_DEBUG_MAIN (4) << "InfoManager::launch_helper_ise ()\n"; + m_signal_start_default_ise (); + } + void set_default_ise (const DEFAULT_ISE_T& ise) { LOGD ("set default ise : %s", ise.uuid.c_str()); scim_global_config_write (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), ise.uuid); @@ -4561,6 +4566,12 @@ void InfoManager::hide_helper_ise (void) m_impl->hide_helper_ise (); } +//ISM_TRANS_CMD_LAUNCH_ISE from ISF control +void InfoManager::launch_helper_ise (void) +{ + m_impl->launch_helper_ise (); +} + //SCIM_TRANS_CMD_PROCESS_KEY_EVENT bool InfoManager::process_key_event (KeyEvent& key, uint32 serial) { diff --git a/ism/src/isf_info_manager.h b/ism/src/isf_info_manager.h index 8e0f6ec..9b8bbb5 100644 --- a/ism/src/isf_info_manager.h +++ b/ism/src/isf_info_manager.h @@ -615,6 +615,9 @@ public: //ISM_TRANS_CMD_HIDE_ISE_PANEL from ISF control void hide_helper_ise (void); + //ISM_TRANS_CMD_LAUNCH_ISE + void launch_helper_ise (void); + //SCIM_TRANS_CMD_PROCESS_KEY_EVENT bool process_key_event (KeyEvent& key, uint32 serial); diff --git a/ism/src/scim_trans_commands.h b/ism/src/scim_trans_commands.h index 119da05..1bce735 100644 --- a/ism/src/scim_trans_commands.h +++ b/ism/src/scim_trans_commands.h @@ -646,6 +646,7 @@ const int ISM_REMOTE_TRANS_CMD_RECV_SURROUNDING_TEXT = 1029; const int ISM_REMOTE_TRANS_CMD_RECV_INPUT_RESOURCE = 1030; const int ISM_REMOTE_TRANS_CMD_CHECK_PRIVILEGE = 1031; const int ISM_REMOTE_TRANS_CMD_DELETE_SURROUNDING_TEXT = 1032; +const int ISM_TRANS_CMD_LAUNCH_ISE = 1033; /* IMControl to ISE */ const int ISM_TRANS_CMD_SET_ISE_MODE = 1108;