1 /** @file isf_info_manager.cpp
2 * @brief Implementation of class InfoManager.
5 /* ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable. */
8 * Smart Common Input Method
10 * Copyright (c) 2005 James Su <suzhe@tsinghua.org.cn>
11 * Copyright (c) 2012-2016 Samsung Electronics Co., Ltd.
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License for more details.
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this program; if not, write to the
26 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
27 * Boston, MA 02111-1307 USA
29 * Modifications by Samsung Electronics Co., Ltd.
31 * a. m_signal_set_keyboard_ise and m_signal_get_keyboard_ise
32 * b. m_signal_focus_in and m_signal_focus_out
33 * c. m_signal_expand_candidate, m_signal_contract_candidate and m_signal_set_candidate_ui
34 * d. m_signal_get_ise_list, m_signal_get_keyboard_ise_list, m_signal_update_ise_geometry and m_signal_get_ise_information
35 * e. m_signal_set_active_ise_by_uuid and m_signal_get_ise_info_by_uuid
36 * f. m_signal_accept_connection, m_signal_close_connection and m_signal_exit
37 * 2. Add new interface APIs in PanelClient class
38 * a. get_helper_manager_id (), has_helper_manager_pending_event () and filter_helper_manager_event ()
39 * b. update_candidate_panel_event (), update_input_panel_event () and select_aux ()
40 * c. candidate_more_window_show () and candidate_more_window_hide ()
41 * d. update_displayed_candidate_number () and update_candidate_item_layout ()
42 * e. stop_helper (), send_longpress_event () and update_ise_list ()
43 * f. filter_event (), filter_exception_event () and get_server_id ()
44 * 3. Donot use thread to receive message
45 * 4. Monitor socket frontend for self-recovery function
47 * $Id: scim_panel_agent.cpp,v 1.8.2.1 2006/01/09 14:32:18 suzhe Exp $
52 #define Uses_SCIM_PANEL_AGENT
53 #define Uses_SCIM_HELPER
54 #define Uses_SCIM_EVENT
55 #define Uses_SCIM_CONFIG
56 #define Uses_SCIM_CONFIG_MODULE
57 #define Uses_SCIM_CONFIG_PATH
58 #define Uses_SCIM_UTILITY
61 #include <sys/types.h>
62 #include <sys/times.h>
65 #include "scim_private.h"
67 #include "scim_stl_map.h"
68 #include "isf_panel_agent_manager.h"
69 #include "isf_debug.h"
75 #define LOG_TAG "ISF_PANEL_EFL"
77 #define MIN_REPEAT_TIME 2.0
83 InfoManagerSignalVoid;
85 typedef Signal1<void, int>
88 typedef Signal1<void, int&>
89 InfoManagerSignalInt2;
91 typedef Signal1<void, const String&>
92 InfoManagerSignalString;
94 typedef Signal2<void, const String&, bool>
95 InfoManagerSignalStringBool;
97 typedef Signal2<void, String&, String&>
98 InfoManagerSignalString2;
100 typedef Signal2<void, int, const String&>
101 InfoManagerSignalIntString;
103 typedef Signal1<void, const PanelFactoryInfo&>
104 InfoManagerSignalFactoryInfo;
106 typedef Signal1<void, const std::vector <PanelFactoryInfo> &>
107 InfoManagerSignalFactoryInfoVector;
109 typedef Signal1<void, const LookupTable&>
110 InfoManagerSignalLookupTable;
112 typedef Signal1<void, const Property&>
113 InfoManagerSignalProperty;
115 typedef Signal1<void, const PropertyList&>
116 InfoManagerSignalPropertyList;
118 typedef Signal2<void, int, int>
119 InfoManagerSignalIntInt;
121 typedef Signal2<void, int&, int&>
122 InfoManagerSignalIntInt2;
124 typedef Signal3<void, int, int, int>
125 InfoManagerSignalIntIntInt;
127 typedef Signal3<void, const String &, const String &, const String &>
128 InfoManagerSignalString3;
130 typedef Signal4<void, int, int, int, int>
131 InfoManagerSignalIntIntIntInt;
133 typedef Signal2<void, int, const Property&>
134 InfoManagerSignalIntProperty;
136 typedef Signal2<void, int, const PropertyList&>
137 InfoManagerSignalIntPropertyList;
139 typedef Signal2<void, int, const HelperInfo&>
140 InfoManagerSignalIntHelperInfo;
142 typedef Signal3<void, const String&, const AttributeList&, int>
143 InfoManagerSignalAttributeStringInt;
145 typedef Signal5<void, int, int, const String&, const String&, const AttributeList&>
146 InfoManagerSignalAttributeInt2String2;
148 typedef Signal2<void, const String&, const AttributeList&>
149 InfoManagerSignalAttributeString;
151 typedef Signal1<void, std::vector <String> &>
152 InfoManagerSignalStringVector;
154 typedef Signal1<bool, HELPER_ISE_INFO&>
155 InfoManagerSignalBoolHelperInfo;
157 typedef Signal1<bool, std::vector <String> &>
158 InfoManagerSignalBoolStringVector;
160 typedef Signal2<void, char*, std::vector <String> &>
161 InfoManagerSignalStrStringVector;
163 typedef Signal2<bool, const String&, ISE_INFO&>
164 InfoManagerSignalStringISEINFO;
166 typedef Signal2<bool, String, int&>
167 InfoManagerSignalStringInt;
169 typedef Signal1<void, const KeyEvent&>
170 InfoManagerSignalKeyEvent;
172 typedef Signal1<void, struct rectinfo&>
173 InfoManagerSignalRect;
175 typedef Signal6<bool, String, String&, String&, int&, int&, String&>
176 InfoManagerSignalBoolString4int2;
178 typedef Signal2<void, int, struct rectinfo&>
179 InfoManagerSignalIntRect;
181 typedef Signal2<bool, int, String>
182 InfoManagerSignalIntString2;
184 typedef Signal1<bool, String>
185 InfoManagerSignalBoolString;
187 struct HelperClientStub {
191 HelperClientStub (int i = 0, int r = 0) : id (i), ref (r) { }
194 struct IMControlStub {
195 std::vector<ISE_INFO> info;
196 std::vector<int> count;
199 #define DEFAULT_CONTEXT_VALUE 0xfff
201 #if SCIM_USE_STL_EXT_HASH_MAP
202 typedef __gnu_cxx::hash_map <int, ClientInfo, __gnu_cxx::hash <int> > ClientRepository;
203 typedef __gnu_cxx::hash_map <int, HelperInfo, __gnu_cxx::hash <int> > HelperInfoRepository;
204 typedef __gnu_cxx::hash_map <uint32, String, __gnu_cxx::hash <unsigned int> > ClientContextUUIDRepository;
205 typedef __gnu_cxx::hash_map <String, HelperClientStub, scim_hash_string> HelperClientIndex;
206 typedef __gnu_cxx::hash_map <String, std::vector < std::pair <uint32, String> >, scim_hash_string> StartHelperICIndex;
207 #elif SCIM_USE_STL_HASH_MAP
208 typedef std::hash_map <int, ClientInfo, std::hash <int> > ClientRepository;
209 typedef std::hash_map <int, HelperInfo, std::hash <int> > HelperInfoRepository;
210 typedef std::hash_map <uint32, String, std::hash <unsigned int> > ClientContextUUIDRepository;
211 typedef std::hash_map <String, HelperClientStub, scim_hash_string> HelperClientIndex;
212 typedef std::hash_map <String, std::vector < std::pair <uint32, String> >, scim_hash_string> StartHelperICIndex;
214 typedef std::map <int, ClientInfo> ClientRepository;
215 typedef std::map <int, HelperInfo> HelperInfoRepository;
216 typedef std::map <uint32, String> ClientContextUUIDRepository;
217 typedef std::map <String, HelperClientStub> HelperClientIndex;
218 typedef std::map <String, std::vector < std::pair <uint32, String> > > StartHelperICIndex;
221 typedef std::map <String, uint32> UUIDCountRepository;
222 typedef std::map <String, enum HelperState> UUIDStateRepository;
223 typedef std::map <String, int> StringIntRepository;
224 typedef std::map <int, struct IMControlStub> IMControlRepository;
225 typedef std::map <int, int> IntIntRepository;
228 get_helper_ic (int client, uint32 context)
230 return (uint32) (client & 0xFFFF) | ((context & 0x7FFF) << 16);
234 get_imengine_client_context (uint32 helper_ic, int& client, uint32& context)
236 client = (int) (helper_ic & 0xFFFF);
237 context = ((helper_ic >> 16) & 0x7FFF);
241 clients_equal (int first, int second)
243 return ((first & 0xFFFF) == (second & 0xFFFF));
247 contexts_equal (uint32 first, uint32 second)
249 return ((first & 0x7FFF) == (second & 0x7FFF));
252 //==================================== InfoManager ===========================
253 class InfoManager::InfoManagerImpl
255 int m_current_screen;
257 String m_config_name;
258 String m_display_name;
260 int m_current_socket_client;
261 uint32 m_current_client_context;
262 String m_current_context_uuid;
263 TOOLBAR_MODE_T m_current_toolbar_mode;
264 uint32 m_current_helper_option;
265 String m_current_helper_uuid;
266 String m_last_helper_uuid;
267 String m_current_ise_name;
268 int m_pending_active_imcontrol_id;
269 int m_show_request_client_id;
270 int m_active_client_id;
271 IntIntRepository m_panel_client_map;
272 IntIntRepository m_imcontrol_map;
273 bool m_should_shared_ise;
275 bool m_is_imengine_aux;
276 bool m_is_imengine_candidate;
277 bool m_reshow_needed;
279 std::vector<int> m_current_send_remoteinput_id;
280 std::vector<int> m_current_recv_remoteinput_id;
282 int m_last_socket_client;
283 uint32 m_last_client_context;
284 String m_last_context_uuid;
286 char* m_ise_context_buffer;
287 size_t m_ise_context_length;
289 ClientRepository m_client_repository;
291 * Each Helper ISE has two socket connect between InfoManager and HelperAgent.
292 * m_helper_info_repository records the active connection.
293 * m_helper_active_info_repository records the passive connection.
295 HelperInfoRepository m_helper_info_repository;
296 HelperInfoRepository m_helper_active_info_repository;
297 HelperClientIndex m_helper_client_index;
299 /* when helper register, notify imcontrol client */
300 StringIntRepository m_ise_pending_repository;
301 IMControlRepository m_imcontrol_repository;
303 StartHelperICIndex m_start_helper_ic_index;
306 ClientContextUUIDRepository m_client_context_uuids;
309 ClientContextUUIDRepository m_client_context_helper;
310 UUIDCountRepository m_helper_uuid_count;
312 InfoManagerSignalVoid m_signal_turn_on;
313 InfoManagerSignalVoid m_signal_turn_off;
314 InfoManagerSignalVoid m_signal_show_panel;
315 InfoManagerSignalVoid m_signal_hide_panel;
316 InfoManagerSignalInt m_signal_update_screen;
317 InfoManagerSignalIntIntInt m_signal_update_spot_location;
318 InfoManagerSignalFactoryInfo m_signal_update_factory_info;
319 InfoManagerSignalVoid m_signal_start_default_ise;
320 InfoManagerSignalVoid m_signal_stop_default_ise;
321 InfoManagerSignalIntInt m_signal_update_input_context;
322 InfoManagerSignalString m_signal_update_language_locale;
323 InfoManagerSignalIntInt m_signal_set_candidate_ui;
324 InfoManagerSignalIntInt2 m_signal_get_candidate_ui;
325 InfoManagerSignalIntInt m_signal_set_candidate_position;
326 InfoManagerSignalRect m_signal_get_candidate_geometry;
327 InfoManagerSignalRect m_signal_get_input_panel_geometry;
328 InfoManagerSignalString m_signal_set_keyboard_ise;
329 InfoManagerSignalString2 m_signal_get_keyboard_ise;
330 InfoManagerSignalString m_signal_show_help;
331 InfoManagerSignalFactoryInfoVector m_signal_show_factory_menu;
332 InfoManagerSignalVoid m_signal_show_preedit_string;
333 InfoManagerSignalVoid m_signal_show_aux_string;
334 InfoManagerSignalVoid m_signal_show_lookup_table;
335 InfoManagerSignalVoid m_signal_show_associate_table;
336 InfoManagerSignalVoid m_signal_hide_preedit_string;
337 InfoManagerSignalVoid m_signal_hide_aux_string;
338 InfoManagerSignalVoid m_signal_hide_lookup_table;
339 InfoManagerSignalVoid m_signal_hide_associate_table;
340 InfoManagerSignalAttributeStringInt m_signal_update_preedit_string;
341 InfoManagerSignalAttributeInt2String2 m_signal_recapture_string;
342 InfoManagerSignalInt m_signal_update_preedit_caret;
343 InfoManagerSignalAttributeString m_signal_update_aux_string;
344 InfoManagerSignalLookupTable m_signal_update_lookup_table;
345 InfoManagerSignalLookupTable m_signal_update_associate_table;
346 InfoManagerSignalPropertyList m_signal_register_properties;
347 InfoManagerSignalProperty m_signal_update_property;
348 InfoManagerSignalIntPropertyList m_signal_register_helper_properties;
349 InfoManagerSignalIntProperty m_signal_update_helper_property;
350 InfoManagerSignalIntHelperInfo m_signal_register_helper;
351 InfoManagerSignalInt m_signal_remove_helper;
352 InfoManagerSignalStringBool m_signal_set_active_ise_by_uuid;
353 InfoManagerSignalVoid m_signal_focus_in;
354 InfoManagerSignalVoid m_signal_focus_out;
355 InfoManagerSignalVoid m_signal_expand_candidate;
356 InfoManagerSignalVoid m_signal_contract_candidate;
357 InfoManagerSignalInt m_signal_select_candidate;
358 InfoManagerSignalBoolStringVector m_signal_get_ise_list;
359 InfoManagerSignalBoolHelperInfo m_signal_get_all_helper_ise_info;
360 InfoManagerSignalStringBool m_signal_set_has_option_helper_ise_info;
361 InfoManagerSignalStringBool m_signal_set_enable_helper_ise_info;
362 InfoManagerSignalVoid m_signal_show_helper_ise_list;
363 InfoManagerSignalVoid m_signal_show_helper_ise_selector;
364 InfoManagerSignalStringInt m_signal_is_helper_ise_enabled;
365 InfoManagerSignalBoolString4int2 m_signal_get_ise_information;
366 InfoManagerSignalBoolStringVector m_signal_get_keyboard_ise_list;
367 InfoManagerSignalIntIntIntInt m_signal_update_ise_geometry;
368 InfoManagerSignalStringVector m_signal_get_language_list;
369 InfoManagerSignalStringVector m_signal_get_all_language;
370 InfoManagerSignalStrStringVector m_signal_get_ise_language;
371 InfoManagerSignalStringISEINFO m_signal_get_ise_info_by_uuid;
372 InfoManagerSignalKeyEvent m_signal_send_key_event;
374 InfoManagerSignalInt m_signal_accept_connection;
375 InfoManagerSignalInt m_signal_close_connection;
376 InfoManagerSignalVoid m_signal_exit;
378 InfoManagerSignalVoid m_signal_transaction_start;
379 InfoManagerSignalVoid m_signal_transaction_end;
381 InfoManagerSignalVoid m_signal_lock;
382 InfoManagerSignalVoid m_signal_unlock;
384 InfoManagerSignalVoid m_signal_show_ise;
385 InfoManagerSignalVoid m_signal_hide_ise;
387 InfoManagerSignalVoid m_signal_will_show_ack;
388 InfoManagerSignalVoid m_signal_will_hide_ack;
390 InfoManagerSignalInt m_signal_set_keyboard_mode;
392 InfoManagerSignalVoid m_signal_candidate_will_hide_ack;
393 InfoManagerSignalInt2 m_signal_get_ise_state;
394 InfoManagerSignalString3 m_signal_run_helper;
396 InfoManagerSignalIntRect m_signal_get_recent_ise_geometry;
398 InfoManagerSignalStringBool m_signal_remoteinput_send_input_message;
399 InfoManagerSignalIntString m_signal_remoteinput_send_surrounding_text;
401 InfoManagerSignalIntString2 m_signal_check_privilege_by_sockfd;
403 InfoManagerSignalBoolString m_signal_launch_option_application;
405 PanelAgentManager m_panel_agent_manager;
410 : m_current_screen (0),
411 m_current_socket_client (-1), m_current_client_context (0),
412 m_current_toolbar_mode (TOOLBAR_KEYBOARD_MODE),
413 m_current_helper_option (0),
414 m_pending_active_imcontrol_id (-1),
415 m_show_request_client_id (-1),
416 m_active_client_id (-1),
417 m_should_shared_ise (false),
418 m_ise_exiting (false), m_is_imengine_aux (false), m_is_imengine_candidate (false),
419 m_reshow_needed (false),
420 m_last_socket_client (-1), m_last_client_context (0),
421 m_ise_context_buffer (NULL), m_ise_context_length (0) {
422 m_current_ise_name = String (_ ("English Keyboard"));
423 m_imcontrol_repository.clear ();
424 m_imcontrol_map.clear ();
425 m_current_send_remoteinput_id.clear ();
426 m_current_recv_remoteinput_id.clear ();
427 m_panel_client_map.clear ();
430 ~InfoManagerImpl () {
431 delete_ise_context_buffer ();
434 void delete_ise_context_buffer (void) {
435 if (m_ise_context_buffer != NULL) {
436 delete[] m_ise_context_buffer;
437 m_ise_context_buffer = NULL;
438 m_ise_context_length = 0;
442 bool initialize (InfoManager* info_manager, const ConfigPointer& config, const String& display, bool resident) {
444 m_config_name = "socket";
445 m_display_name = display;
447 return m_panel_agent_manager.initialize (info_manager, config, display, resident);
450 bool valid (void) const {
451 return m_panel_agent_manager.valid ();
457 SCIM_DEBUG_MAIN (1) << "InfoManager::stop ()\n";
459 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
460 String helper_uuid = get_current_helper_uuid ();
461 hide_helper (helper_uuid);
462 stop_helper (helper_uuid, -2, 0);
465 m_panel_agent_manager.stop ();
468 TOOLBAR_MODE_T get_current_toolbar_mode () const {
469 return m_current_toolbar_mode;
472 String get_current_ise_name () const {
473 return m_current_ise_name;
476 String get_current_helper_uuid () const {
477 return m_current_helper_uuid;
480 uint32 get_current_helper_option () const {
481 return m_current_helper_option;
484 void set_current_ise_name (String& name) {
485 m_current_ise_name = name;
488 void set_current_toolbar_mode (TOOLBAR_MODE_T mode) {
489 m_current_toolbar_mode = mode;
492 void set_current_helper_option (uint32 option) {
493 m_current_helper_option = option;
496 void update_panel_event (int cmd, uint32 nType, uint32 nValue) {
498 uint32 focused_context;
499 get_focused_context (focused_client, focused_context);
501 if (focused_client == -1 && m_active_client_id != -1) {
502 focused_client = m_panel_client_map[m_active_client_id];
506 SCIM_DEBUG_MAIN (1) << __func__ << " (" << nType << ", " << nValue << "), client=" << focused_client << "\n";
507 ClientInfo client_info = socket_get_client_info (focused_client);
509 if (client_info.type == FRONTEND_CLIENT) {
510 m_panel_agent_manager.update_panel_event (focused_client, focused_context, cmd, nType, nValue);
512 std::cerr << __func__ << " focused client is not existed!!!" << "\n";
515 if (m_panel_client_map[m_show_request_client_id] != focused_client) {
516 client_info = socket_get_client_info (m_panel_client_map[m_show_request_client_id]);
518 if (client_info.type == FRONTEND_CLIENT) {
519 m_panel_agent_manager.update_panel_event (m_panel_client_map[m_show_request_client_id], 0, cmd, nType, nValue);
520 std::cerr << __func__ << " show request client=" << m_panel_client_map[m_show_request_client_id] << "\n";
522 std::cerr << __func__ << " show request client is not existed!!!" << "\n";
527 bool move_preedit_caret (uint32 position) {
528 SCIM_DEBUG_MAIN (1) << "InfoManager::move_preedit_caret (" << position << ")\n";
532 get_focused_context (client, context);
535 m_panel_agent_manager.update_preedit_caret (client, context, position);
543 bool request_help (void) {
544 SCIM_DEBUG_MAIN (1) << "InfoManager::request_help ()\n";
548 get_focused_context (client, context);
551 m_panel_agent_manager.request_help (client, context);
558 bool request_factory_menu (void) {
559 SCIM_DEBUG_MAIN (1) << "InfoManager::request_factory_menu ()\n";
563 get_focused_context (client, context);
566 m_panel_agent_manager.request_factory_menu (client, context);
574 //ISM_TRANS_CMD_PANEL_RESET_KEYBOARD_ISE
575 bool reset_keyboard_ise (void) {
576 SCIM_DEBUG_MAIN (1) << "InfoManager::reset_keyboard_ise ()\n";
580 get_focused_context (client, context);
583 m_panel_agent_manager.reset_keyboard_ise (client, context);
590 bool update_keyboard_ise_list (void) {
591 SCIM_DEBUG_MAIN (1) << "InfoManager::update_keyboard_ise_list ()\n";
595 get_focused_context (client, context);
598 m_panel_agent_manager.update_keyboard_ise_list (client, context);
605 bool change_factory (const String& uuid) {
606 SCIM_DEBUG_MAIN (1) << "InfoManager::change_factory (" << uuid << ")\n";
610 if (scim_global_config_read (SCIM_GLOBAL_CONFIG_PRELOAD_KEYBOARD_ISE, false))
611 m_helper_manager.preload_keyboard_ise (uuid);
614 get_focused_context (client, context);
617 m_panel_agent_manager.change_factory (client, context, uuid);
624 bool helper_candidate_show (void) {
625 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
630 get_focused_context (client, context);
632 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
633 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
635 if (it != m_helper_client_index.end ()) {
636 uint32 ctx = get_helper_ic (client, context);
637 m_panel_agent_manager.helper_candidate_show (it->second.id, ctx, m_current_helper_uuid);
642 /* Inform wayland module that we are showing candidate window */
644 uint32 focused_context;
645 String focused_uuid = get_focused_context(focused_client, focused_context);
646 m_panel_agent_manager.helper_candidate_show(focused_client, focused_context, focused_uuid);
651 bool helper_candidate_hide (void) {
652 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
657 get_focused_context (client, context);
659 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
660 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
662 if (it != m_helper_client_index.end ()) {
663 uint32 ctx = get_helper_ic (client, context);
664 m_panel_agent_manager.helper_candidate_hide (it->second.id, ctx, m_current_helper_uuid);
669 /* Inform wayland module that we are hiding candidate window */
671 uint32 focused_context;
672 String focused_uuid = get_focused_context(focused_client, focused_context);
673 m_panel_agent_manager.helper_candidate_hide(focused_client, focused_context, focused_uuid);
678 bool candidate_more_window_show (void) {
679 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
682 get_focused_context (client, context);
684 if (m_is_imengine_candidate) {
686 m_panel_agent_manager.candidate_more_window_show (client, context);
690 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
691 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
693 if (it != m_helper_client_index.end ()) {
694 uint32 ctx = get_helper_ic (client, context);
695 m_panel_agent_manager.candidate_more_window_show (it->second.id, ctx);
704 bool candidate_more_window_hide (void) {
705 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
708 get_focused_context (client, context);
710 if (m_is_imengine_candidate) {
712 m_panel_agent_manager.candidate_more_window_hide (client, context);
716 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
717 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
719 if (it != m_helper_client_index.end ()) {
720 uint32 ctx = get_helper_ic (client, context);
721 m_panel_agent_manager.candidate_more_window_hide (it->second.id, ctx);
730 bool update_helper_lookup_table (const LookupTable& table) {
731 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
735 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
736 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
738 if (it != m_helper_client_index.end ()) {
740 get_focused_context (client, context);
741 ctx = get_helper_ic (client, context);
742 m_panel_agent_manager.update_helper_lookup_table (it->second.id, ctx, m_current_helper_uuid, table);
750 bool select_aux (uint32 item) {
751 SCIM_DEBUG_MAIN (1) << "InfoManager::select_aux (" << item << ")\n";
755 get_focused_context (client, context);
757 if (m_is_imengine_aux) {
759 m_panel_agent_manager.select_aux (client, context, item);
762 helper_select_aux (item);
769 bool select_candidate (uint32 item) {
770 SCIM_DEBUG_MAIN (1) << "InfoManager::select_candidate (" << item << ")\n";
774 get_focused_context (client, context);
776 if (m_is_imengine_candidate) {
778 m_panel_agent_manager.select_candidate (client, context, item);
781 helper_select_candidate (item);
788 bool lookup_table_page_up (void) {
789 SCIM_DEBUG_MAIN (1) << "InfoManager::lookup_table_page_up ()\n";
793 get_focused_context (client, context);
795 if (m_is_imengine_candidate) {
797 m_panel_agent_manager.lookup_table_page_up (client, context);
800 helper_lookup_table_page_up ();
807 bool lookup_table_page_down (void) {
808 SCIM_DEBUG_MAIN (1) << "InfoManager::lookup_table_page_down ()\n";
812 get_focused_context (client, context);
814 if (m_is_imengine_candidate) {
816 m_panel_agent_manager.lookup_table_page_down (client, context);
819 helper_lookup_table_page_down ();
826 bool update_lookup_table_page_size (uint32 size) {
827 SCIM_DEBUG_MAIN (1) << "InfoManager::update_lookup_table_page_size (" << size << ")\n";
831 get_focused_context (client, context);
833 if (m_is_imengine_candidate) {
835 m_panel_agent_manager.update_lookup_table_page_size (client, context, size);
838 helper_update_lookup_table_page_size (size);
845 bool update_candidate_item_layout (const std::vector<uint32>& row_items) {
846 SCIM_DEBUG_MAIN (1) << __func__ << " (" << row_items.size () << ")\n";
850 get_focused_context (client, context);
852 if (m_is_imengine_candidate) {
854 m_panel_agent_manager.update_candidate_item_layout (client, context, row_items);
857 helper_update_candidate_item_layout (row_items);
864 bool select_associate (uint32 item) {
865 SCIM_DEBUG_MAIN (1) << "InfoManager::select_associate (" << item << ")\n";
869 get_focused_context (client, context);
872 m_panel_agent_manager.select_associate (client, context, item);
876 helper_select_associate (item);
880 bool associate_table_page_up (void) {
881 SCIM_DEBUG_MAIN (1) << "InfoManager::associate_table_page_up ()\n";
885 get_focused_context (client, context);
888 m_panel_agent_manager.associate_table_page_up (client, context);
892 helper_associate_table_page_up ();
896 bool associate_table_page_down (void) {
897 SCIM_DEBUG_MAIN (1) << "InfoManager::associate_table_page_down ()\n";
901 get_focused_context (client, context);
904 m_panel_agent_manager.associate_table_page_down (client, context);
908 helper_associate_table_page_down ();
912 bool update_associate_table_page_size (uint32 size) {
913 SCIM_DEBUG_MAIN (1) << "InfoManager::update_associate_table_page_size (" << size << ")\n";
917 get_focused_context (client, context);
920 m_panel_agent_manager.update_associate_table_page_size (client, context, size);
924 helper_update_associate_table_page_size (size);
928 bool update_displayed_candidate_number (uint32 size) {
929 SCIM_DEBUG_MAIN (1) << __func__ << " (" << size << ")\n";
933 get_focused_context (client, context);
935 if (m_is_imengine_candidate) {
937 m_panel_agent_manager.update_displayed_candidate_number (client, context, size);
940 helper_update_displayed_candidate_number (size);
947 void send_longpress_event (int type, int index) {
948 SCIM_DEBUG_MAIN (1) << __func__ << " (" << type << ", " << index << ")\n";
951 get_focused_context (client, context);
953 if (m_is_imengine_candidate) {
955 m_panel_agent_manager.send_longpress_event (client, context, index);
958 helper_longpress_candidate (index);
962 bool trigger_property (const String& property) {
963 SCIM_DEBUG_MAIN (1) << "InfoManager::trigger_property (" << property << ")\n";
967 get_focused_context (client, context);
970 m_panel_agent_manager.trigger_property (client, context, property);
977 bool start_helper (const String& uuid, int client, uint32 context) {
978 SCIM_DEBUG_MAIN (1) << "InfoManager::start_helper (" << uuid << ")\n";
979 LOGD ("start ISE(%s)", uuid.c_str ());
981 if (uuid.length () <= 0)
985 /*if (m_current_toolbar_mode != TOOLBAR_HELPER_MODE || m_current_helper_uuid.compare (uuid) != 0)*/ {
986 SCIM_DEBUG_MAIN (1) << "Run_helper\n";
988 uint32 ic = get_helper_ic (m_panel_client_map[client], context);
990 /* Get the context uuid from the client context registration table. */
992 ClientContextUUIDRepository::iterator it =
993 m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client], context));
995 if (it != m_client_context_uuids.end ())
996 ic_uuid = it->second;
998 m_start_helper_ic_index [uuid].push_back (std::make_pair (ic, ic_uuid));
999 m_signal_run_helper (uuid, m_config_name, m_display_name);
1001 m_current_helper_uuid = uuid;
1006 bool stop_helper (const String& uuid, int client, uint32 context) {
1007 char buf[256] = {0};
1008 snprintf (buf, sizeof (buf), "time:%ld pid:%d %s %s prepare to stop ISE(%s)\n",
1009 time (0), getpid (), __FILE__, __func__, uuid.c_str ());
1010 LOGD ("prepare to stop ISE(%s)", uuid.c_str ());
1011 SCIM_DEBUG_MAIN (1) << "InfoManager::stop_helper (" << uuid << ")\n";
1013 if (uuid.length () <= 0)
1017 uint32 ctx = get_helper_ic (client, context);
1018 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
1020 if (it != m_helper_client_index.end ()) {
1021 m_ise_exiting = true;
1022 m_current_helper_uuid = String ("");
1023 m_panel_agent_manager.exit (it->second.id, ctx);
1024 SCIM_DEBUG_MAIN (1) << "Stop helper\n";
1025 ISF_SAVE_LOG ("send SCIM_TRANS_CMD_EXIT message to %s", uuid.c_str ());
1028 /* Since we are stopping this helper, erase information from start_helper_ic_index too */
1029 m_start_helper_ic_index.erase (uuid);
1035 void focus_out_helper (const String& uuid, int client, uint32 context) {
1036 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1038 if (it != m_helper_client_index.end ()) {
1039 uint32 ctx = get_helper_ic (client, context);
1040 m_panel_agent_manager.focus_out_helper (it->second.id, ctx, uuid);
1044 void focus_in_helper (const String& uuid, int client, uint32 context) {
1045 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1047 if (it != m_helper_client_index.end ()) {
1048 uint32 ctx = get_helper_ic (client, context);
1049 m_panel_agent_manager.focus_in_helper (it->second.id, ctx, uuid);
1053 bool show_helper (const String& uuid, char* data, size_t& len, uint32 ctx) {
1054 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1056 if (it != m_helper_client_index.end ()) {
1057 Socket client_socket (it->second.id);
1058 m_panel_agent_manager.show_helper (it->second.id, ctx, uuid, data, len);
1059 m_reshow_needed = false;
1063 LOGW ("Can't find %s", m_current_helper_uuid.c_str ());
1064 m_reshow_needed = true;
1069 void hide_helper (const String& uuid, uint32 ctx = 0) {
1070 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1072 m_reshow_needed = false;
1073 if (it != m_helper_client_index.end ()) {
1078 get_focused_context (client, context);
1079 ctx = get_helper_ic (client, context);
1082 m_panel_agent_manager.hide_helper (it->second.id, ctx, uuid);
1086 bool set_helper_mode (const String& uuid, uint32& mode) {
1087 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1089 if (it != m_helper_client_index.end ()) {
1093 get_focused_context (client, context);
1094 ctx = get_helper_ic (client, context);
1095 m_panel_agent_manager.set_helper_mode (it->second.id, ctx, uuid, mode);
1102 bool set_helper_language (const String& uuid, uint32& language) {
1103 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1105 if (it != m_helper_client_index.end ()) {
1109 get_focused_context (client, context);
1110 ctx = get_helper_ic (client, context);
1111 m_panel_agent_manager.set_helper_language (it->second.id, ctx, uuid, language);
1118 bool set_helper_imdata (const String& uuid, const char* imdata, size_t& len) {
1119 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1121 if (it != m_helper_client_index.end ()) {
1125 get_focused_context (client, context);
1126 ctx = get_helper_ic (client, context);
1127 m_panel_agent_manager.set_helper_imdata (it->second.id, ctx, uuid, imdata, len);
1134 bool set_helper_return_key_type (const String& uuid, int type) {
1135 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1137 if (it != m_helper_client_index.end ()) {
1141 get_focused_context (client, context);
1142 ctx = get_helper_ic (client, context);
1143 m_panel_agent_manager.set_helper_return_key_type (it->second.id, ctx, uuid, type);
1150 bool get_helper_return_key_type (const String& uuid, uint32& type) {
1151 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1153 if (it != m_helper_client_index.end ()) {
1157 get_focused_context (client, context);
1158 ctx = get_helper_ic (client, context);
1159 m_panel_agent_manager.get_helper_return_key_type (it->second.id, ctx, uuid, type);
1166 bool set_helper_return_key_disable (const String& uuid, bool disabled) {
1167 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1169 if (it != m_helper_client_index.end ()) {
1173 get_focused_context (client, context);
1174 ctx = get_helper_ic (client, context);
1175 m_panel_agent_manager.set_helper_return_key_disable (it->second.id, ctx, uuid, disabled);
1182 bool get_helper_return_key_disable (const String& uuid, uint32& disabled) {
1183 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1185 if (it != m_helper_client_index.end ()) {
1189 get_focused_context (client, context);
1190 ctx = get_helper_ic (client, context);
1191 m_panel_agent_manager.get_helper_return_key_disable (it->second.id, ctx, uuid, disabled);
1198 bool set_helper_layout (const String& uuid, uint32& layout) {
1199 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1201 if (it != m_helper_client_index.end ()) {
1205 get_focused_context (client, context);
1206 ctx = get_helper_ic (client, context);
1207 m_panel_agent_manager.set_helper_layout (it->second.id, ctx, uuid, layout);
1214 bool set_helper_input_mode (const String& uuid, uint32& mode) {
1215 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1217 if (it != m_helper_client_index.end ()) {
1221 get_focused_context (client, context);
1222 ctx = get_helper_ic (client, context);
1223 m_panel_agent_manager.set_helper_input_mode (it->second.id, ctx, uuid, mode);
1230 bool set_helper_input_hint (const String& uuid, uint32& hint) {
1231 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1233 if (it != m_helper_client_index.end ()) {
1237 get_focused_context (client, context);
1238 ctx = get_helper_ic (client, context);
1239 m_panel_agent_manager.set_helper_input_hint (it->second.id, ctx, uuid, hint);
1246 bool set_helper_bidi_direction (const String& uuid, uint32& direction) {
1247 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1249 if (it != m_helper_client_index.end ()) {
1253 get_focused_context (client, context);
1254 ctx = get_helper_ic (client, context);
1255 m_panel_agent_manager.set_helper_bidi_direction (it->second.id, ctx, uuid, direction);
1262 bool set_helper_caps_mode (const String& uuid, uint32& mode) {
1263 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1265 if (it != m_helper_client_index.end ()) {
1269 get_focused_context (client, context);
1270 ctx = get_helper_ic (client, context);
1271 m_panel_agent_manager.set_helper_caps_mode (it->second.id, ctx, uuid, mode);
1278 bool show_helper_option_window (const String& uuid) {
1279 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1281 if (it != m_helper_client_index.end ()) {
1285 get_focused_context (client, context);
1286 ctx = get_helper_ic (client, context);
1288 if (!m_signal_launch_option_application (uuid)) {
1289 LOGD ("call show helper option");
1290 m_panel_agent_manager.show_helper_option_window (it->second.id, ctx, uuid);
1299 bool resume_helper_option_window (const String& uuid) {
1300 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1302 if (it != m_helper_client_index.end ()) {
1306 get_focused_context (client, context);
1307 ctx = get_helper_ic (client, context);
1308 m_panel_agent_manager.resume_helper_option_window (it->second.id, ctx, uuid);
1315 bool set_helper_keyboard_mode (const String& uuid, uint32& mode) {
1316 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1318 if (it != m_helper_client_index.end ()) {
1322 get_focused_context (client, context);
1323 ctx = get_helper_ic (client, context);
1324 m_panel_agent_manager.set_helper_keyboard_mode (it->second.id, ctx, uuid, mode);
1331 bool set_helper_prediction_hint (const String& uuid, String prediction_hint) {
1332 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1334 if (it != m_helper_client_index.end ()) {
1338 get_focused_context (client, context);
1339 ctx = get_helper_ic (client, context);
1340 m_panel_agent_manager.set_helper_prediction_hint (it->second.id, ctx, uuid, prediction_hint);
1347 bool set_helper_mime_type (const String& uuid, String mime_type) {
1348 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1350 if (it != m_helper_client_index.end ()) {
1354 get_focused_context (client, context);
1355 ctx = get_helper_ic (client, context);
1356 m_panel_agent_manager.set_helper_mime_type (it->second.id, ctx, uuid, mime_type);
1363 bool finalize_content_helper (const String& uuid, String text, uint32 cursor_pos) {
1364 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1366 if (it != m_helper_client_index.end ()) {
1370 get_focused_context (client, context);
1371 ctx = get_helper_ic (client, context);
1372 m_panel_agent_manager.finalize_content_helper (it->second.id, ctx, uuid, text, cursor_pos);
1379 bool set_helper_prediction_hint_data (const String& uuid, String key, String value) {
1380 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1382 if (it != m_helper_client_index.end ()) {
1386 get_focused_context (client, context);
1387 ctx = get_helper_ic (client, context);
1388 m_panel_agent_manager.set_helper_prediction_hint_data (it->second.id, ctx, uuid, key, value);
1395 //ISM_TRANS_CMD_SHOW_ISF_CONTROL
1396 void show_isf_panel (int client_id) {
1397 SCIM_DEBUG_MAIN (4) << "InfoManager::show_isf_panel ()\n";
1398 m_signal_show_panel ();
1401 //ISM_TRANS_CMD_SEND_REMOTE_INPUT_MESSAGE
1402 bool send_remote_input_message (int client_id, char* buf, size_t len) {
1403 SCIM_DEBUG_MAIN(4) << "InfoManager::send_remote_input_message ()\n";
1405 if (buf && len > 0) {
1407 m_signal_remoteinput_send_input_message (msg, true);
1414 void send_remote_surrounding_text (const char* text, uint32 cursor) {
1415 SCIM_DEBUG_MAIN(4) << "InfoManager::send_remote_surrounding_text ()\n";
1417 m_signal_remoteinput_send_surrounding_text (cursor, text);
1420 //ISM_TRANS_CMD_HIDE_ISF_CONTROL
1421 void hide_isf_panel (int client_id) {
1422 SCIM_DEBUG_MAIN (4) << "InfoManager::hide_isf_panel ()\n";
1423 m_signal_hide_panel ();
1426 //ISM_TRANS_CMD_SHOW_ISE_PANEL
1427 void show_ise_panel (int client_id, uint32 client, uint32 context, char* data, size_t len) {
1428 SCIM_DEBUG_MAIN (4) << "InfoManager::show_ise_panel ()\n";
1429 String initial_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
1430 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
1431 LOGD ("prepare to show ISE %d [%s] [%s]", client_id, initial_uuid.c_str (), default_uuid.c_str ());
1433 m_show_request_client_id = client_id;
1434 m_active_client_id = client_id;
1435 SCIM_DEBUG_MAIN (4) << __func__ << " (client:" << client << " context:" << context << ")\n";
1437 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode) {
1438 uint32 ctx = get_helper_ic (client, context);
1439 ret = show_helper (m_current_helper_uuid, data, len, ctx);
1442 /* Save ISE context for ISE panel re-showing */
1443 if (data && len > 0) {
1444 delete_ise_context_buffer ();
1445 m_ise_context_buffer = new char [len];
1447 if (m_ise_context_buffer) {
1448 m_ise_context_length = len;
1449 memcpy (m_ise_context_buffer, data, m_ise_context_length);
1454 m_signal_show_ise ();
1456 m_signal_start_default_ise ();
1460 //ISM_TRANS_CMD_HIDE_ISE_PANEL
1461 void hide_ise_panel (int client_id, uint32 client, uint32 context) {
1462 SCIM_DEBUG_MAIN (4) << "InfoManager::hide_ise_panel ()\n";
1463 LOGD ("prepare to hide ISE, %d %d", client_id, m_show_request_client_id);
1464 SCIM_DEBUG_MAIN (4) << __func__ << " (client:" << client << " context:" << context << ")\n";
1466 if (m_panel_client_map[client_id] == m_current_socket_client || client_id == m_show_request_client_id) {
1467 // && (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
1469 uint32 focused_context;
1470 get_focused_context (focused_client, focused_context);
1472 if (focused_client == -1 && m_active_client_id != -1) {
1473 focused_client = m_panel_client_map[m_active_client_id];
1474 focused_context = 0;
1477 m_signal_hide_ise ();
1480 /* Release ISE context buffer */
1481 delete_ise_context_buffer ();
1484 void hide_helper_ise (void) {
1487 uint32 focused_context;
1488 get_focused_context (focused_client, focused_context);
1489 m_panel_agent_manager.hide_helper_ise (focused_client, focused_context);
1491 m_signal_hide_ise ();
1495 void launch_helper_ise (void) {
1496 SCIM_DEBUG_MAIN (4) << "InfoManager::launch_helper_ise ()\n";
1497 m_signal_start_default_ise ();
1500 void set_default_ise (const DEFAULT_ISE_T& ise) {
1501 LOGD ("set default ise : %s", ise.uuid.c_str());
1502 scim_global_config_write (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), ise.uuid);
1503 scim_global_config_flush ();
1506 void set_should_shared_ise (const bool should_shared_ise) {
1507 m_should_shared_ise = should_shared_ise;
1509 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
1510 bool process_key_event (KeyEvent& key, uint32 serial) {
1511 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1513 if (it != m_helper_client_index.end ()) {
1517 get_focused_context (client, context);
1518 ctx = get_helper_ic (client, context);
1519 return m_panel_agent_manager.process_key_event (it->second.id, ctx, m_current_helper_uuid, key, serial);
1525 //ISM_TRANS_CMD_PROCESS_INPUT_DEVICE_EVENT
1526 bool process_input_device_event(int client_id, uint32 type, const char *data, size_t len, _OUT_ uint32& result) {
1527 SCIM_DEBUG_MAIN(4) << "InfoManager::process_input_device_event ()\n";
1528 HelperClientIndex::iterator it = m_helper_client_index.find(m_current_helper_uuid);
1530 if (it != m_helper_client_index.end()) {
1534 get_focused_context(client, context);
1535 ctx = get_helper_ic(client, context);
1536 return m_panel_agent_manager.process_input_device_event(it->second.id, ctx, m_current_helper_uuid, type, data, len, result);
1542 bool get_helper_geometry (String& uuid, struct rectinfo& info) {
1543 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1545 if (it != m_helper_client_index.end ()) {
1549 get_focused_context (client, context);
1550 ctx = get_helper_ic (client, context);
1551 return m_panel_agent_manager.get_helper_geometry (it->second.id, ctx, uuid, info);
1557 bool get_helper_imdata (String& uuid, char** imdata, size_t& len) {
1558 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1560 if (it != m_helper_client_index.end ()) {
1564 get_focused_context (client, context);
1565 ctx = get_helper_ic (client, context);
1566 m_panel_agent_manager.get_helper_imdata (it->second.id, ctx, uuid, imdata, len);
1573 bool get_helper_layout (String& uuid, uint32& layout) {
1574 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1576 if (it != m_helper_client_index.end ()) {
1580 get_focused_context (client, context);
1581 ctx = get_helper_ic (client, context);
1582 m_panel_agent_manager.get_helper_layout (it->second.id, ctx, uuid, layout);
1588 //ISM_TRANS_CMD_GET_ACTIVE_ISE_GEOMETRY
1589 void get_input_panel_geometry (int client_id, _OUT_ struct rectinfo& info) {
1590 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1591 m_signal_get_input_panel_geometry (info);
1593 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
1594 void get_candidate_window_geometry (int client_id, _OUT_ struct rectinfo& info) {
1595 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1596 m_signal_get_candidate_geometry (info);
1598 //ISM_TRANS_CMD_GET_ISE_LANGUAGE_LOCALE
1599 void get_ise_language_locale (int client_id, _OUT_ char** data, _OUT_ size_t& len) {
1600 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1601 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
1602 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1604 if (it != m_helper_client_index.end ()) {
1607 get_focused_context (client, context);
1608 uint32 ctx = get_helper_ic (client, context);
1609 m_panel_agent_manager.get_ise_language_locale (it->second.id, ctx, m_current_helper_uuid, data, len);
1614 void get_current_ise_geometry (rectinfo& rect) {
1615 SCIM_DEBUG_MAIN (4) << __func__ << " \n";
1618 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1619 ret = get_helper_geometry (m_current_helper_uuid, rect);
1629 void set_ise_mode (int client_id, uint32 mode) {
1630 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_mode ()\n";
1632 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1633 set_helper_mode (m_current_helper_uuid, mode);
1635 //ISM_TRANS_CMD_SET_LAYOUT
1636 void set_ise_layout (int client_id, uint32 layout) {
1637 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_layout ()\n";
1639 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1640 set_helper_layout (m_current_helper_uuid, layout);
1642 //ISM_TRANS_CMD_SET_INPUT_MODE
1643 void set_ise_input_mode (int client_id, uint32 input_mode) {
1644 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_input_mode ()\n";
1646 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1647 set_helper_input_mode (m_current_helper_uuid, input_mode);
1649 //ISM_TRANS_CMD_SET_INPUT_HINT
1650 void set_ise_input_hint (int client_id, uint32 input_hint) {
1651 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_input_hint ()\n";
1653 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1654 set_helper_input_hint (m_current_helper_uuid, input_hint);
1656 //ISM_TRANS_CMD_UPDATE_BIDI_DIRECTION
1657 void update_ise_bidi_direction (int client_id, uint32 bidi_direction) {
1658 SCIM_DEBUG_MAIN (4) << "InfoManager::update_ise_bidi_direction ()\n";
1660 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1661 set_helper_bidi_direction (m_current_helper_uuid, bidi_direction);
1663 //ISM_TRANS_CMD_SET_ISE_LANGUAGE
1664 void set_ise_language (int client_id, uint32 language) {
1665 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_language ()\n";
1667 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1668 set_helper_language (m_current_helper_uuid, language);
1670 //ISM_TRANS_CMD_SET_ISE_IMDATA
1671 void set_ise_imdata (int client_id, const char* imdata, size_t len) {
1672 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_imdata ()\n";
1674 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1675 set_helper_imdata (m_current_helper_uuid, imdata, len);
1677 //ISM_TRANS_CMD_GET_ISE_IMDATA
1678 bool get_ise_imdata (int client_id, _OUT_ char** imdata, _OUT_ size_t& len) {
1679 SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_imdata ()\n";
1682 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1683 ret = get_helper_imdata (m_current_helper_uuid, imdata, len);
1687 //ISM_TRANS_CMD_GET_LAYOUT
1688 bool get_ise_layout (int client_id, _OUT_ uint32& layout) {
1689 SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_layout ()\n";
1692 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1693 ret = get_helper_layout (m_current_helper_uuid, layout);
1697 //ISM_TRANS_CMD_GET_ISE_STATE
1698 void get_ise_state (int client_id, _OUT_ int& state) {
1699 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1700 m_signal_get_ise_state (state);
1702 //ISM_TRANS_CMD_GET_ACTIVE_ISE
1703 void get_active_ise (int client_id, _OUT_ String& default_uuid) {
1704 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1705 default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
1707 //ISM_TRANS_CMD_GET_ISE_LIST
1708 void get_ise_list (int client_id, _OUT_ std::vector<String>& strlist) {
1709 SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_list ()\n";
1710 m_signal_get_ise_list (strlist);
1712 //ISM_TRANS_CMD_GET_ALL_HELPER_ISE_INFO
1713 void get_all_helper_ise_info (int client_id, _OUT_ HELPER_ISE_INFO& info) {
1714 SCIM_DEBUG_MAIN (4) << "InfoManager::get_all_helper_ise_info ()\n";
1715 m_signal_get_all_helper_ise_info (info);
1717 //1 Check if the current IME's option (setting) is available or not.
1718 for (uint32 i = 0; i < info.appid.size (); i++) {
1719 if (m_current_helper_uuid.compare (info.appid [i]) == 0) { // Find the current IME
1720 // If the current IME's "has_option" is unknown (-1), get it through ISM_TRANS_CMD_CHECK_OPTION_WINDOW command.
1721 // And it's saved to ime_info DB. Then next time this will be skipped.
1722 if (info.has_option [i] >= 2) {
1723 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1725 if (it != m_helper_client_index.end ()) {
1728 get_focused_context (client, context);
1729 uint32 ctx = get_helper_ic (client, context);
1730 uint32 avail = static_cast<uint32> (-1);
1731 m_panel_agent_manager.check_option_window (it->second.id, ctx, m_current_helper_uuid, avail);
1734 String setting_app = isf_pkg_get_setting_app (m_current_helper_uuid);
1735 if (setting_app.length () > 0)
1740 info.has_option [i] = avail;
1741 // Update "has_option" column of ime_info DB and global variable.
1742 m_signal_set_has_option_helper_ise_info (info.appid [i], static_cast<bool> (avail));
1749 //ISM_TRANS_CMD_SET_ENABLE_HELPER_ISE_INFO
1750 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1751 void set_enable_helper_ise_info (int client_id, String appid, uint32 is_enabled) {
1752 SCIM_DEBUG_MAIN (4) << "InfoManager::set_enable_helper_ise_info ()\n";
1753 m_signal_set_enable_helper_ise_info (appid, static_cast<bool> (is_enabled));
1755 //ISM_TRANS_CMD_SHOW_HELPER_ISE_LIST
1756 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1757 void show_helper_ise_list (int client_id) {
1758 SCIM_DEBUG_MAIN (4) << "InfoManager::show_helper_ise_list ()\n";
1759 m_signal_show_helper_ise_list ();
1761 //ISM_TRANS_CMD_SHOW_HELPER_ISE_SELECTOR
1762 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1763 void show_helper_ise_selector (int client_id) {
1764 SCIM_DEBUG_MAIN (4) << "InfoManager::show_helper_ise_selector ()\n";
1765 m_signal_show_helper_ise_selector ();
1767 //ISM_TRANS_CMD_IS_HELPER_ISE_ENABLED
1769 void is_helper_ise_enabled (int client_id, String strAppid, _OUT_ uint32& nEnabled) {
1770 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1772 m_signal_is_helper_ise_enabled (strAppid, _nEnabled);
1773 nEnabled = (uint32)_nEnabled;
1775 //ISM_TRANS_CMD_GET_ISE_INFORMATION
1776 void get_ise_information (int client_id, String strUuid, _OUT_ String& strName, _OUT_ String& strLanguage,
1777 _OUT_ int& nType, _OUT_ int& nOption, _OUT_ String& strModuleName) {
1778 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1779 m_signal_get_ise_information (strUuid, strName, strLanguage, nType, nOption, strModuleName);
1784 void get_language_list (int client_id, _OUT_ std::vector<String>& strlist) {
1785 SCIM_DEBUG_MAIN (4) << "InfoManager::get_language_list ()\n";
1786 m_signal_get_language_list (strlist);
1789 void get_all_language (int client_id, _OUT_ std::vector<String>& strlist) {
1790 SCIM_DEBUG_MAIN (4) << "InfoManager::get_all_language ()\n";
1791 m_signal_get_all_language (strlist);
1796 void get_ise_language (int client_id, char* buf, size_t len, _OUT_ std::vector<String>& strlist) {
1797 SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_language ()\n";
1798 m_signal_get_ise_language (buf, strlist);
1800 //ISM_TRANS_CMD_RESET_ISE_OPTION
1801 //reply SCIM_TRANS_CMD_OK
1802 bool reset_ise_option (int client_id) {
1803 SCIM_DEBUG_MAIN (1) << "InfoManager::resect_ise_option ()\n";
1807 ClientContextUUIDRepository::iterator it = m_client_context_uuids.begin ();
1809 if (it != m_client_context_uuids.end ()) {
1810 get_imengine_client_context (it->first, client, context);
1814 m_panel_agent_manager.reset_ise_option (client, context);
1821 bool find_active_ise_by_uuid (String uuid) {
1822 HelperInfoRepository::iterator iter = m_helper_info_repository.begin ();
1824 for (; iter != m_helper_info_repository.end (); iter++) {
1825 if (!uuid.compare (iter->second.uuid))
1831 //ISM_TRANS_CMD_SET_ACTIVE_ISE_BY_UUID
1833 bool set_active_ise_by_uuid (int client_id, char* buf, size_t len) {
1834 SCIM_DEBUG_MAIN (4) << "InfoManager::set_active_ise_by_uuid ()\n";
1843 if (!m_signal_get_ise_info_by_uuid (uuid, info)) {
1847 if (info.type == TOOLBAR_KEYBOARD_MODE) {
1848 m_signal_set_active_ise_by_uuid (uuid, 1);
1851 m_signal_set_active_ise_by_uuid (uuid, 1);
1856 if (find_active_ise_by_uuid (uuid)) {
1859 m_ise_pending_repository[uuid] = client_id;
1863 //ISM_TRANS_CMD_SET_INITIAL_ISE_BY_UUID
1864 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1865 void set_initial_ise_by_uuid (int client_id, char* buf, size_t len) {
1866 SCIM_DEBUG_MAIN (4) << "InfoManager::set_initial_ise_by_uuid ()\n";
1873 scim_global_config_write (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (uuid));
1874 scim_global_config_flush ();
1876 //ISM_TRANS_CMD_SET_RETURN_KEY_TYPE
1877 void set_ise_return_key_type (int client_id, uint32 type) {
1878 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1880 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1881 set_helper_return_key_type (m_current_helper_uuid, type);
1883 //ISM_TRANS_CMD_GET_RETURN_KEY_TYPE
1885 bool get_ise_return_key_type (int client_id, _OUT_ uint32& type) {
1886 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1889 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1890 ret = get_helper_return_key_type (m_current_helper_uuid, type);
1894 //ISM_TRANS_CMD_SET_RETURN_KEY_DISABLE
1895 void set_ise_return_key_disable (int client_id, uint32 disabled) {
1896 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1898 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1899 set_helper_return_key_disable (m_current_helper_uuid, disabled);
1901 //ISM_TRANS_CMD_GET_RETURN_KEY_DISABLE
1902 bool get_ise_return_key_disable (int client_id, _OUT_ uint32& disabled) {
1903 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1906 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1907 ret = get_helper_return_key_disable (m_current_helper_uuid, disabled);
1912 void reset_helper_context (const String& uuid) {
1913 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1915 if (it != m_helper_client_index.end ()) {
1919 get_focused_context (client, context);
1920 ctx = get_helper_ic (client, context);
1921 m_panel_agent_manager.reset_helper_context (it->second.id, ctx, uuid);
1927 void reset_ise_context (int client_id) {
1928 SCIM_DEBUG_MAIN (4) << "InfoManager::reset_ise_context ()\n";
1930 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1931 reset_helper_context (m_current_helper_uuid);
1933 //ISM_TRANS_CMD_SET_CAPS_MODE
1934 void set_ise_caps_mode (int client_id, uint32 mode) {
1935 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_caps_mode ()\n";
1937 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1938 set_helper_caps_mode (m_current_helper_uuid, mode);
1941 //SCIM_TRANS_CMD_RELOAD_CONFIG
1942 void reload_config (void) {
1943 SCIM_DEBUG_MAIN (1) << "InfoManager::reload_config ()\n";
1946 for (ClientRepository::iterator it = m_client_repository.begin (); it != m_client_repository.end (); ++it) {
1947 if (it->second.type == FRONTEND_CLIENT || it->second.type == HELPER_CLIENT) {
1948 m_panel_agent_manager.reload_config (it->first);
1956 SCIM_DEBUG_MAIN (1) << "InfoManager::exit ()\n";
1959 for (ClientRepository::iterator it = m_client_repository.begin (); it != m_client_repository.end (); ++it) {
1960 m_panel_agent_manager.exit (it->first, 0);
1968 void update_ise_list (std::vector<String>& strList) {
1969 /* request PanelClient to update keyboard ise list */
1970 update_keyboard_ise_list ();
1972 //ISM_TRANS_CMD_SEND_WILL_SHOW_ACK
1973 void will_show_ack (int client_id) {
1974 SCIM_DEBUG_MAIN (4) << "InfoManager::will_show_ack ()\n";
1975 m_signal_will_show_ack ();
1977 //ISM_TRANS_CMD_SEND_WILL_HIDE_ACK
1978 void will_hide_ack (int client_id) {
1979 SCIM_DEBUG_MAIN (4) << "InfoManager::will_hide_ack ()\n";
1980 m_signal_will_hide_ack ();
1982 //ISM_TRANS_CMD_RESET_DEFAULT_ISE
1983 void reset_default_ise (int client_id) {
1984 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1985 String initial_ise = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
1987 if (initial_ise.length () > 0)
1988 m_signal_set_active_ise_by_uuid (initial_ise, 1);
1990 std::cerr << "Read SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID is failed!!!\n";
1992 //ISM_TRANS_CMD_SET_HARDWARE_KEYBOARD_MODE
1993 void set_keyboard_mode (int client_id, uint32 mode) {
1994 SCIM_DEBUG_MAIN (4) << "InfoManager::set_keyboard_mode ()\n";
1995 m_signal_set_keyboard_mode (mode);
1996 set_ise_keyboard_mode (client_id, mode);
1998 //ISM_TRANS_CMD_SEND_CANDIDATE_WILL_HIDE_ACK
1999 void candidate_will_hide_ack (int client_id) {
2000 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "\n";
2001 m_signal_candidate_will_hide_ack ();
2004 //ISM_TRANS_CMD_GET_ACTIVE_HELPER_OPTION
2005 void get_active_helper_option (int client_id, _OUT_ uint32& option) {
2006 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
2007 option = get_current_helper_option ();
2009 //ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW
2010 void show_ise_option_window (int client_id) {
2011 SCIM_DEBUG_MAIN (4) << "InfoManager::show_ise_option_window ()\n";
2012 String initial_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
2013 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
2014 LOGD ("prepare to show ISE option window %d [%s] [%s]", client_id, initial_uuid.c_str (), default_uuid.c_str ());
2016 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode) {
2017 show_helper_option_window (m_current_helper_uuid);
2021 //ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW
2022 void resume_ise_option_window (int client_id) {
2023 SCIM_DEBUG_MAIN (4) << "InfoManager::resume_ise_option_window ()\n";
2024 String initial_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
2025 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
2026 LOGD ("prepare to resume ISE option window %d [%s] [%s]", client_id, initial_uuid.c_str (), default_uuid.c_str ());
2028 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode) {
2029 resume_helper_option_window (m_current_helper_uuid);
2033 //ISM_TRANS_CMD_SET_KEYBOARD_MODE
2034 void set_ise_keyboard_mode (int client_id, uint32 mode) {
2035 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_keyboard_mode ()\n";
2036 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2037 set_helper_keyboard_mode (m_current_helper_uuid, mode);
2040 //ISM_TRANS_CMD_SET_PREDICTION_HINT
2041 void set_prediction_hint (int client_id, String prediction_hint) {
2042 SCIM_DEBUG_MAIN (4) << "InfoManager::set_prediction_hint ()\n";
2043 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2044 set_helper_prediction_hint (m_current_helper_uuid, prediction_hint);
2047 //ISM_TRANS_CMD_SET_MIME_TYPE
2048 void set_ise_mime_type (int client_id, String mime_type) {
2049 SCIM_DEBUG_MAIN (4) << "InfoManager::set_mime_type ()\n";
2050 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2051 set_helper_mime_type (m_current_helper_uuid, mime_type);
2054 //ISM_TRANS_CMD_FINALIZE_CONTENT
2055 void finalize_content (int client_id, String text, uint32 cursor_pos) {
2056 SCIM_DEBUG_MAIN (4) << "InfoManager::finalize_content ()\n";
2057 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2058 finalize_content_helper (m_current_helper_uuid, text, cursor_pos);
2061 //ISM_TRANS_CMD_SET_PREDICTION_HINT_DATA
2062 void set_prediction_hint_data (int client_id, String key, String value) {
2063 SCIM_DEBUG_MAIN (4) << "InfoManager::set_prediction_hint_data ()\n";
2064 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2065 set_helper_prediction_hint_data (m_current_helper_uuid, key, value);
2068 //ISM_TRANS_CMD_EXPAND_CANDIDATE
2069 void expand_candidate () {
2071 m_signal_expand_candidate ();
2074 //ISM_TRANS_CMD_CONTRACT_CANDIDATE
2075 void contract_candidate () {
2077 m_signal_contract_candidate ();
2079 //ISM_TRANS_CMD_GET_RECENT_ISE_GEOMETRY
2080 void get_recent_ise_geometry (int client_id, uint32 angle, _OUT_ struct rectinfo& info) {
2081 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
2083 m_signal_get_recent_ise_geometry (angle, info);
2086 bool check_privilege_by_sockfd (int client_id, const String& privilege) {
2087 return m_signal_check_privilege_by_sockfd (client_id, privilege);
2090 bool remoteinput_update_preedit_string (WideString str, AttributeList &attrs, uint32 caret)
2092 SCIM_DEBUG_MAIN(1) << "PanelAgent::update_preedit_string ()\n";
2098 get_focused_context (client, context);
2100 m_panel_agent_manager.remote_update_preedit_string (client, context, str, str, attrs, caret);
2108 bool remoteinput_commit_string (const WideString &str)
2110 SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_commit_string ()\n";
2116 get_focused_context (client, context);
2118 m_panel_agent_manager.remote_commit_string (client, context, str);
2126 bool remoteinput_send_key_event (const KeyEvent &key)
2128 SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_send_key_event ()\n";
2132 get_focused_context (client, context);
2134 m_panel_agent_manager.remote_send_key_event (client, context, key);
2140 bool remoteinput_forward_key_event (const KeyEvent &key)
2142 SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_forward_key_event ()\n";
2146 get_focused_context (client, context);
2148 m_panel_agent_manager.remote_forward_key_event (client, context, key);
2154 bool remoteinput_delete_surrounding_text (uint32 offset, uint32 len)
2156 SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_delete_surrounding_text ()\n";
2160 get_focused_context (client, context);
2162 m_panel_agent_manager.remote_delete_surrounding_text (client, context, offset, len);
2168 void reshow_input_panel () {
2169 if (!m_reshow_needed) return;
2171 /* Check whether application is already focus_in */
2172 if (m_current_socket_client != -1) {
2173 LOGD ("Re-focus in");
2174 SCIM_DEBUG_MAIN (2) << "Application is already focus_in!\n";
2176 focus_in_helper (m_current_helper_uuid, m_current_socket_client, m_current_client_context);
2177 reset_keyboard_ise ();
2180 /* Check whether ISE panel is already shown */
2181 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode && m_ise_context_length > 0) {
2182 LOGD ("Re-show input_panel");
2183 SCIM_DEBUG_MAIN (2) << "Re-show ISE panel!\n";
2186 uint32 focused_context;
2188 get_focused_context (focused_client, focused_context);
2189 if (focused_client == -1 && m_active_client_id != -1) {
2190 focused_client = m_panel_client_map[m_active_client_id];
2191 focused_context = 0;
2194 m_panel_agent_manager.update_entry_metadata (focused_client, focused_context);
2195 uint32 ctx = get_helper_ic (focused_client, focused_context);
2196 bool ret = show_helper (m_current_helper_uuid, m_ise_context_buffer, m_ise_context_length, ctx);
2198 m_signal_show_ise ();
2202 Connection signal_connect_turn_on (InfoManagerSlotVoid* slot) {
2203 return m_signal_turn_on.connect (slot);
2206 Connection signal_connect_turn_off (InfoManagerSlotVoid* slot) {
2207 return m_signal_turn_off.connect (slot);
2210 Connection signal_connect_show_panel (InfoManagerSlotVoid* slot) {
2211 return m_signal_show_panel.connect (slot);
2214 Connection signal_connect_hide_panel (InfoManagerSlotVoid* slot) {
2215 return m_signal_hide_panel.connect (slot);
2218 Connection signal_connect_update_screen (InfoManagerSlotInt* slot) {
2219 return m_signal_update_screen.connect (slot);
2222 Connection signal_connect_update_spot_location (InfoManagerSlotIntIntInt* slot) {
2223 return m_signal_update_spot_location.connect (slot);
2226 Connection signal_connect_update_factory_info (InfoManagerSlotFactoryInfo* slot) {
2227 return m_signal_update_factory_info.connect (slot);
2230 Connection signal_connect_start_default_ise (InfoManagerSlotVoid* slot) {
2231 return m_signal_start_default_ise.connect (slot);
2234 Connection signal_connect_stop_default_ise (InfoManagerSlotVoid* slot) {
2235 return m_signal_stop_default_ise.connect (slot);
2238 Connection signal_connect_set_candidate_ui (InfoManagerSlotIntInt* slot) {
2239 return m_signal_set_candidate_ui.connect (slot);
2242 Connection signal_connect_get_candidate_ui (InfoManagerSlotIntInt2* slot) {
2243 return m_signal_get_candidate_ui.connect (slot);
2246 Connection signal_connect_set_candidate_position (InfoManagerSlotIntInt* slot) {
2247 return m_signal_set_candidate_position.connect (slot);
2250 Connection signal_connect_get_candidate_geometry (InfoManagerSlotRect* slot) {
2251 return m_signal_get_candidate_geometry.connect (slot);
2254 Connection signal_connect_get_input_panel_geometry (InfoManagerSlotRect* slot) {
2255 return m_signal_get_input_panel_geometry.connect (slot);
2258 Connection signal_connect_set_keyboard_ise (InfoManagerSlotString* slot) {
2259 return m_signal_set_keyboard_ise.connect (slot);
2262 Connection signal_connect_get_keyboard_ise (InfoManagerSlotString2* slot) {
2263 return m_signal_get_keyboard_ise.connect (slot);
2266 Connection signal_connect_show_help (InfoManagerSlotString* slot) {
2267 return m_signal_show_help.connect (slot);
2270 Connection signal_connect_show_factory_menu (InfoManagerSlotFactoryInfoVector* slot) {
2271 return m_signal_show_factory_menu.connect (slot);
2274 Connection signal_connect_show_preedit_string (InfoManagerSlotVoid* slot) {
2275 return m_signal_show_preedit_string.connect (slot);
2278 Connection signal_connect_show_aux_string (InfoManagerSlotVoid* slot) {
2279 return m_signal_show_aux_string.connect (slot);
2282 Connection signal_connect_show_lookup_table (InfoManagerSlotVoid* slot) {
2283 return m_signal_show_lookup_table.connect (slot);
2286 Connection signal_connect_show_associate_table (InfoManagerSlotVoid* slot) {
2287 return m_signal_show_associate_table.connect (slot);
2290 Connection signal_connect_hide_preedit_string (InfoManagerSlotVoid* slot) {
2291 return m_signal_hide_preedit_string.connect (slot);
2294 Connection signal_connect_hide_aux_string (InfoManagerSlotVoid* slot) {
2295 return m_signal_hide_aux_string.connect (slot);
2298 Connection signal_connect_hide_lookup_table (InfoManagerSlotVoid* slot) {
2299 return m_signal_hide_lookup_table.connect (slot);
2302 Connection signal_connect_hide_associate_table (InfoManagerSlotVoid* slot) {
2303 return m_signal_hide_associate_table.connect (slot);
2306 Connection signal_connect_update_preedit_string (InfoManagerSlotAttributeStringInt* slot) {
2307 return m_signal_update_preedit_string.connect (slot);
2310 Connection signal_connect_update_preedit_caret (InfoManagerSlotInt* slot) {
2311 return m_signal_update_preedit_caret.connect (slot);
2314 Connection signal_connect_recapture_string (InfoManagerSlotAttributeInt2String2* slot) {
2315 return m_signal_recapture_string.connect (slot);
2318 Connection signal_connect_update_aux_string (InfoManagerSlotAttributeString* slot) {
2319 return m_signal_update_aux_string.connect (slot);
2322 Connection signal_connect_update_lookup_table (InfoManagerSlotLookupTable* slot) {
2323 return m_signal_update_lookup_table.connect (slot);
2326 Connection signal_connect_update_associate_table (InfoManagerSlotLookupTable* slot) {
2327 return m_signal_update_associate_table.connect (slot);
2330 Connection signal_connect_register_properties (InfoManagerSlotPropertyList* slot) {
2331 return m_signal_register_properties.connect (slot);
2334 Connection signal_connect_update_property (InfoManagerSlotProperty* slot) {
2335 return m_signal_update_property.connect (slot);
2338 Connection signal_connect_register_helper_properties (InfoManagerSlotIntPropertyList* slot) {
2339 return m_signal_register_helper_properties.connect (slot);
2342 Connection signal_connect_update_helper_property (InfoManagerSlotIntProperty* slot) {
2343 return m_signal_update_helper_property.connect (slot);
2346 Connection signal_connect_register_helper (InfoManagerSlotIntHelperInfo* slot) {
2347 return m_signal_register_helper.connect (slot);
2350 Connection signal_connect_remove_helper (InfoManagerSlotInt* slot) {
2351 return m_signal_remove_helper.connect (slot);
2354 Connection signal_connect_set_active_ise_by_uuid (InfoManagerSlotStringBool* slot) {
2355 return m_signal_set_active_ise_by_uuid.connect (slot);
2358 Connection signal_connect_focus_in (InfoManagerSlotVoid* slot) {
2359 return m_signal_focus_in.connect (slot);
2362 Connection signal_connect_focus_out (InfoManagerSlotVoid* slot) {
2363 return m_signal_focus_out.connect (slot);
2366 Connection signal_connect_expand_candidate (InfoManagerSlotVoid* slot) {
2367 return m_signal_expand_candidate.connect (slot);
2370 Connection signal_connect_contract_candidate (InfoManagerSlotVoid* slot) {
2371 return m_signal_contract_candidate.connect (slot);
2374 Connection signal_connect_select_candidate (InfoManagerSlotInt* slot) {
2375 return m_signal_select_candidate.connect (slot);
2378 Connection signal_connect_get_ise_list (InfoManagerSlotBoolStringVector* slot) {
2379 return m_signal_get_ise_list.connect (slot);
2382 Connection signal_connect_get_all_helper_ise_info (InfoManagerSlotBoolHelperInfo* slot) {
2383 return m_signal_get_all_helper_ise_info.connect (slot);
2386 Connection signal_connect_set_has_option_helper_ise_info (InfoManagerSlotStringBool* slot) {
2387 return m_signal_set_has_option_helper_ise_info.connect (slot);
2390 Connection signal_connect_set_enable_helper_ise_info (InfoManagerSlotStringBool* slot) {
2391 return m_signal_set_enable_helper_ise_info.connect (slot);
2394 Connection signal_connect_show_helper_ise_list (InfoManagerSlotVoid* slot) {
2395 return m_signal_show_helper_ise_list.connect (slot);
2398 Connection signal_connect_show_helper_ise_selector (InfoManagerSlotVoid* slot) {
2399 return m_signal_show_helper_ise_selector.connect (slot);
2402 Connection signal_connect_is_helper_ise_enabled (InfoManagerSlotStringInt* slot) {
2403 return m_signal_is_helper_ise_enabled.connect (slot);
2406 Connection signal_connect_get_ise_information (InfoManagerSlotBoolString4int2* slot) {
2407 return m_signal_get_ise_information.connect (slot);
2410 Connection signal_connect_get_keyboard_ise_list (InfoManagerSlotBoolStringVector* slot) {
2411 return m_signal_get_keyboard_ise_list.connect (slot);
2414 Connection signal_connect_update_ise_geometry (InfoManagerSlotIntIntIntInt* slot) {
2415 return m_signal_update_ise_geometry.connect (slot);
2418 Connection signal_connect_get_language_list (InfoManagerSlotStringVector* slot) {
2419 return m_signal_get_language_list.connect (slot);
2422 Connection signal_connect_get_all_language (InfoManagerSlotStringVector* slot) {
2423 return m_signal_get_all_language.connect (slot);
2426 Connection signal_connect_get_ise_language (InfoManagerSlotStrStringVector* slot) {
2427 return m_signal_get_ise_language.connect (slot);
2430 Connection signal_connect_get_ise_info_by_uuid (InfoManagerSlotStringISEINFO* slot) {
2431 return m_signal_get_ise_info_by_uuid.connect (slot);
2434 Connection signal_connect_send_key_event (InfoManagerSlotKeyEvent* slot) {
2435 return m_signal_send_key_event.connect (slot);
2438 Connection signal_connect_accept_connection (InfoManagerSlotInt* slot) {
2439 return m_signal_accept_connection.connect (slot);
2442 Connection signal_connect_close_connection (InfoManagerSlotInt* slot) {
2443 return m_signal_close_connection.connect (slot);
2446 Connection signal_connect_exit (InfoManagerSlotVoid* slot) {
2447 return m_signal_exit.connect (slot);
2450 Connection signal_connect_transaction_start (InfoManagerSlotVoid* slot) {
2451 return m_signal_transaction_start.connect (slot);
2454 Connection signal_connect_transaction_end (InfoManagerSlotVoid* slot) {
2455 return m_signal_transaction_end.connect (slot);
2458 Connection signal_connect_lock (InfoManagerSlotVoid* slot) {
2459 return m_signal_lock.connect (slot);
2462 Connection signal_connect_unlock (InfoManagerSlotVoid* slot) {
2463 return m_signal_unlock.connect (slot);
2466 Connection signal_connect_update_input_context (InfoManagerSlotIntInt* slot) {
2467 return m_signal_update_input_context.connect (slot);
2470 Connection signal_connect_update_language_locale(InfoManagerSlotString* slot) {
2471 return m_signal_update_language_locale.connect(slot);
2474 Connection signal_connect_show_ise (InfoManagerSlotVoid* slot) {
2475 return m_signal_show_ise.connect (slot);
2478 Connection signal_connect_hide_ise (InfoManagerSlotVoid* slot) {
2479 return m_signal_hide_ise.connect (slot);
2482 Connection signal_connect_will_show_ack (InfoManagerSlotVoid* slot) {
2483 return m_signal_will_show_ack.connect (slot);
2486 Connection signal_connect_will_hide_ack (InfoManagerSlotVoid* slot) {
2487 return m_signal_will_hide_ack.connect (slot);
2490 Connection signal_connect_set_keyboard_mode (InfoManagerSlotInt* slot) {
2491 return m_signal_set_keyboard_mode.connect (slot);
2494 Connection signal_connect_candidate_will_hide_ack (InfoManagerSlotVoid* slot) {
2495 return m_signal_candidate_will_hide_ack.connect (slot);
2498 Connection signal_connect_get_ise_state (InfoManagerSlotInt2* slot) {
2499 return m_signal_get_ise_state.connect (slot);
2502 Connection signal_connect_run_helper (InfoManagerSlotString3* slot)
2504 return m_signal_run_helper.connect (slot);
2507 Connection signal_connect_launch_option_application (InfoManagerSlotBoolString* slot)
2509 return m_signal_launch_option_application.connect (slot);
2512 Connection signal_connect_get_recent_ise_geometry (InfoManagerSlotIntRect* slot) {
2513 return m_signal_get_recent_ise_geometry.connect (slot);
2516 Connection signal_connect_check_privilege_by_sockfd (InfoManagerSlotIntString2* slot)
2518 return m_signal_check_privilege_by_sockfd.connect (slot);
2521 Connection signal_connect_remoteinput_send_input_message (InfoManagerSlotStringBool* slot)
2523 return m_signal_remoteinput_send_input_message.connect (slot);
2526 Connection signal_connect_remoteinput_send_surrounding_text (InfoManagerSlotIntString* slot)
2528 return m_signal_remoteinput_send_surrounding_text.connect (slot);
2531 //ISM_TRANS_CMD_REGISTER_PANEL_CLIENT
2532 void register_panel_client (uint32 client_id, uint32 id) {
2533 m_panel_client_map [client_id] = (int)id;
2535 //SCIM_TRANS_CMD_PANEL_REGISTER_INPUT_CONTEXT
2536 void register_input_context (uint32 client_id, uint32 context, String uuid) {
2537 uint32 ctx = get_helper_ic (m_panel_client_map[client_id], context);
2538 m_client_context_uuids [ctx] = uuid;
2540 //SCIM_TRANS_CMD_PANEL_REMOVE_INPUT_CONTEXT
2541 void remove_input_context (uint32 client_id, uint32 context) {
2542 uint32 ctx = get_helper_ic (m_panel_client_map[client_id], context);
2543 m_client_context_uuids.erase (ctx);
2545 if (ctx == get_helper_ic (m_current_socket_client, m_current_client_context)) {
2547 m_current_socket_client = m_last_socket_client;
2548 m_current_client_context = m_last_client_context;
2549 m_current_context_uuid = m_last_context_uuid;
2550 m_last_socket_client = -1;
2551 m_last_client_context = 0;
2552 m_last_context_uuid = String ("");
2554 if (m_current_socket_client == -1) {
2556 socket_update_control_panel ();
2560 } else if (ctx == get_helper_ic (m_last_socket_client, m_last_client_context)) {
2562 m_last_socket_client = -1;
2563 m_last_client_context = 0;
2564 m_last_context_uuid = String ("");
2568 if (m_client_context_uuids.size () == 0)
2569 m_signal_stop_default_ise ();
2572 //SCIM_TRANS_CMD_PANEL_RESET_INPUT_CONTEXT
2573 void socket_reset_input_context (int client_id, uint32 context) {
2574 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_reset_input_context \n";
2576 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2577 socket_reset_helper_input_context (m_current_helper_uuid, m_panel_client_map[client_id], context);
2580 //SCIM_TRANS_CMD_FOCUS_IN
2581 void focus_in (int client_id, uint32 context, String uuid) {
2582 m_signal_focus_in ();
2583 focus_in_helper (m_current_helper_uuid, m_panel_client_map[client_id], context);
2584 SCIM_DEBUG_MAIN (2) << "PanelAgent::focus_in (" << client_id << "," << context << "," << uuid << ")\n";
2585 m_active_client_id = client_id;
2588 if (m_current_socket_client >= 0) {
2589 m_last_socket_client = m_current_socket_client;
2590 m_last_client_context = m_current_client_context;
2591 m_last_context_uuid = m_current_context_uuid;
2594 m_current_socket_client = m_panel_client_map[client_id];
2595 m_current_client_context = context;
2596 m_current_context_uuid = uuid;
2599 bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false);
2600 if (!m_ise_exiting && launch_ise_on_request) {
2601 m_ise_exiting = true;
2602 m_signal_start_default_ise ();
2606 //SCIM_TRANS_CMD_FOCUS_OUT
2607 void focus_out (int client_id, uint32 context) {
2608 m_signal_focus_out ();
2610 focus_out_helper (m_current_helper_uuid, m_panel_client_map[client_id], context);
2612 if (m_current_socket_client >= 0) {
2613 m_last_socket_client = m_current_socket_client;
2614 m_last_client_context = m_current_client_context;
2615 m_last_context_uuid = m_current_context_uuid;
2618 m_current_socket_client = -1;
2619 m_current_client_context = 0;
2620 m_current_context_uuid = String ("");
2624 //ISM_TRANS_CMD_TURN_ON_LOG
2625 void socket_turn_on_log (uint32 isOn) {
2627 DebugOutput::enable_debug (SCIM_DEBUG_AllMask);
2628 DebugOutput::set_verbose_level (7);
2629 SCIM_DEBUG_MAIN (4) << __func__ << " on\n";
2631 SCIM_DEBUG_MAIN (4) << __func__ << " off\n";
2632 DebugOutput::disable_debug (SCIM_DEBUG_AllMask);
2633 DebugOutput::set_verbose_level (0);
2637 uint32 focused_context;
2638 get_focused_context (focused_client, focused_context);
2640 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
2641 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
2643 if (it != m_helper_client_index.end ()) {
2644 //uint32 ctx = get_helper_ic (focused_client, focused_context);
2646 //m_panel_agent_manager.socket_turn_on_log (it->second.id, ctx, m_current_helper_uuid, isOn);
2650 if (focused_client == -1) {
2651 std::cerr << __func__ << " get_focused_context is failed!!!\n";
2655 ClientInfo client_info = socket_get_client_info (focused_client);
2657 if (client_info.type == FRONTEND_CLIENT) {
2659 //m_panel_agent_manager.socket_turn_on_log (focused_client, focused_context, isOn);
2664 void add_client (int client_id, uint32 key, ClientType type) {
2665 LOGD ("id:%d, key:%d, type:%d", client_id, key, type);
2669 SCIM_DEBUG_MAIN (4) << "Add client to repository. Type=" << type << " key=" << key << "\n";
2671 m_client_repository [client_id] = info;
2673 if (info.type == IMCONTROL_ACT_CLIENT) {
2674 m_pending_active_imcontrol_id = client_id;
2675 } else if (info.type == IMCONTROL_CLIENT) {
2676 m_imcontrol_map [m_pending_active_imcontrol_id] = client_id;
2677 m_pending_active_imcontrol_id = -1;
2678 } else if (info.type == REMOTEINPUT_ACT_CLIENT) {
2679 m_current_send_remoteinput_id.push_back (client_id);
2680 } else if (info.type == REMOTEINPUT_CLIENT) {
2681 m_current_recv_remoteinput_id.push_back (client_id);
2684 LOGD ("%d clients connecting", m_client_repository.size());
2689 void del_client (int client_id) {
2690 ClientRepository::iterator iter = m_client_repository.find(client_id);
2691 if (iter == m_client_repository.end()) {
2692 LOGW("The client with id %d does not exist in our client repository, returning", client_id);
2696 m_signal_close_connection (client_id);
2697 ClientInfo client_info = socket_get_client_info (client_id);
2698 m_client_repository.erase (client_id);
2699 LOGD ("id:%d, type:%d", client_id, client_info.type);
2700 #ifdef PANEL_SERVER_AUTO_EXIT
2701 /* Exit panel if there is no connected client anymore. */
2702 if (client_info.type != UNKNOWN_CLIENT && m_client_repository.size () == 0 && !m_should_resident) {
2703 SCIM_DEBUG_MAIN (4) << "Exit Socket Server Thread.\n";
2704 server->shutdown ();
2705 m_signal_exit.emit ();
2710 if (client_info.type == FRONTEND_CLIENT) {
2711 SCIM_DEBUG_MAIN (4) << "It's a FrontEnd client.\n";
2713 /* The focused client is closed. */
2714 if (m_current_socket_client == client_id) {
2715 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2716 hide_helper (m_current_helper_uuid);
2719 m_current_socket_client = -1;
2720 m_current_client_context = 0;
2721 m_current_context_uuid = String ("");
2723 socket_transaction_start ();
2725 socket_transaction_end ();
2728 if (m_last_socket_client == client_id) {
2730 m_last_socket_client = -1;
2731 m_last_client_context = 0;
2732 m_last_context_uuid = String ("");
2736 /* Erase all associated Client Context UUIDs. */
2737 std::vector <uint32> ctx_list;
2738 ClientContextUUIDRepository::iterator it = m_client_context_uuids.begin ();
2740 for (; it != m_client_context_uuids.end (); ++it) {
2741 if ((it->first & 0xFFFF) == (client_id & 0xFFFF))
2742 ctx_list.push_back (it->first);
2745 for (size_t i = 0; i < ctx_list.size (); ++i)
2746 m_client_context_uuids.erase (ctx_list [i]);
2748 /* Erase all helperise info associated with the client */
2750 it = m_client_context_helper.begin ();
2752 for (; it != m_client_context_helper.end (); ++it) {
2753 if ((it->first & 0xFFFF) == (client_id & 0xFFFF)) {
2754 ctx_list.push_back (it->first);
2755 /* similar to stop_helper except that it will not call get_focused_context() */
2756 String uuid = it->second;
2758 if (m_helper_uuid_count.find (uuid) != m_helper_uuid_count.end ()) {
2759 uint32 count = m_helper_uuid_count[uuid];
2762 m_helper_uuid_count.erase (uuid);
2763 HelperClientIndex::iterator pise = m_helper_client_index.find (uuid);
2765 if (pise != m_helper_client_index.end ()) {
2766 stop_helper (uuid, pise->second.id, it->first);
2769 SCIM_DEBUG_MAIN (1) << "Stop HelperISE " << uuid << " ...\n";
2771 m_helper_uuid_count[uuid] = count - 1;
2772 focus_out_helper (uuid, (it->first & 0xFFFF), ((it->first >> 16) & 0x7FFF));
2773 SCIM_DEBUG_MAIN (1) << "Decrement usage count of HelperISE " << uuid
2774 << " to " << m_helper_uuid_count[uuid] << "\n";
2780 for (size_t i = 0; i < ctx_list.size (); ++i)
2781 m_client_context_helper.erase (ctx_list [i]);
2783 HelperInfoRepository::iterator iter = m_helper_info_repository.begin ();
2785 for (; iter != m_helper_info_repository.end (); iter++) {
2786 if (!m_current_helper_uuid.compare (iter->second.uuid))
2787 if (! (iter->second.option & ISM_ISE_HIDE_IN_CONTROL_PANEL))
2788 socket_update_control_panel ();
2790 } else if (client_info.type == FRONTEND_ACT_CLIENT) {
2791 SCIM_DEBUG_MAIN (4) << "It's a FRONTEND_ACT_CLIENT client.\n";
2792 IntIntRepository::iterator iter2 = m_panel_client_map.find (client_id);
2794 if (iter2 != m_panel_client_map.end ())
2795 m_panel_client_map.erase (iter2);
2796 } else if (client_info.type == HELPER_CLIENT) {
2797 SCIM_DEBUG_MAIN (4) << "It's a Helper client.\n";
2799 HelperInfoRepository::iterator hiit = m_helper_info_repository.find (client_id);
2801 if (hiit != m_helper_info_repository.end ()) {
2802 bool restart = false;
2803 String uuid = hiit->second.uuid;
2804 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
2806 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
2807 if ((hiit->second.option & SCIM_HELPER_AUTO_RESTART) &&
2808 (default_uuid.compare (uuid) == 0 || default_uuid.compare ("") == 0) &&
2809 (it != m_helper_client_index.end () && it->second.ref > 0)) {
2813 m_helper_client_index.erase (uuid);
2814 m_helper_info_repository.erase (hiit);
2816 m_signal_stop_default_ise ();
2818 bool launch_ise_on_request = false;
2819 launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), launch_ise_on_request);
2820 if (restart && !m_ise_exiting && !launch_ise_on_request) {
2821 struct tms tiks_buf;
2822 static clock_t start_tiks = times (&tiks_buf);
2823 static double clock_tiks = (double)sysconf (_SC_CLK_TCK);
2824 clock_t curr_tiks = times (&tiks_buf);
2825 double secs = (double) (curr_tiks - start_tiks) / clock_tiks;
2826 //LOGE ("time second:%f", secs);
2827 static String restart_uuid;
2829 if (restart_uuid != uuid || secs > MIN_REPEAT_TIME) {
2830 scim_usleep (100000);
2834 get_focused_context(client, context);
2836 uint32 ic = get_helper_ic (client, context);
2838 /* Get the context uuid from the client context registration table. */
2840 ClientContextUUIDRepository::iterator it =
2841 m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client], context));
2843 if (it != m_client_context_uuids.end ())
2844 ic_uuid = it->second;
2847 m_start_helper_ic_index[uuid].push_back(std::make_pair(ic, ic_uuid));
2848 m_signal_run_helper (uuid, m_config_name, m_display_name);
2849 restart_uuid = uuid;
2850 LOGE ("Auto restart soft ISE:%s", uuid.c_str ());
2852 reset_default_ise (0);
2853 ISF_SAVE_LOG ("Auto restart is abnormal, reset default ISE");
2856 start_tiks = curr_tiks;
2860 m_ise_exiting = false;
2862 socket_transaction_start ();
2863 m_signal_remove_helper (client_id);
2864 socket_transaction_end ();
2865 } else if (client_info.type == HELPER_ACT_CLIENT) {
2866 SCIM_DEBUG_MAIN (4) << "It's a Helper passive client.\n";
2868 HelperInfoRepository::iterator hiit = m_helper_active_info_repository.find (client_id);
2870 if (hiit != m_helper_active_info_repository.end ())
2871 m_helper_active_info_repository.erase (hiit);
2874 } else if (client_info.type == IMCONTROL_ACT_CLIENT) {
2875 SCIM_DEBUG_MAIN (4) << "It's a IMCONTROL_ACT_CLIENT client.\n";
2876 IMControlRepository::iterator iter = m_imcontrol_repository.find (client_id);
2878 if (iter != m_imcontrol_repository.end ()) {
2879 int size = iter->second.info.size ();
2883 stop_helper ((iter->second.info)[i].uuid, (iter->second.count)[i], DEFAULT_CONTEXT_VALUE);
2885 if ((iter->second.info)[i].option & ISM_ISE_HIDE_IN_CONTROL_PANEL)
2886 m_current_helper_uuid = m_last_helper_uuid;
2891 m_imcontrol_repository.erase (iter);
2894 IntIntRepository::iterator iter2 = m_imcontrol_map.find (client_id);
2896 if (iter2 != m_imcontrol_map.end ())
2897 m_imcontrol_map.erase (iter2);
2898 } else if (client_info.type == REMOTEINPUT_ACT_CLIENT) {
2899 SCIM_DEBUG_MAIN (4) << "It's a REMOTEINPUT_ACT_CLIENT client.\n";
2901 for (unsigned int i = 0; i < m_current_send_remoteinput_id.size (); i++) {
2902 if (m_current_send_remoteinput_id.at (i) == client_id) {
2903 m_current_send_remoteinput_id.erase (m_current_send_remoteinput_id.begin () + i);
2907 } else if (client_info.type == REMOTEINPUT_CLIENT) {
2908 SCIM_DEBUG_MAIN (4) << "It's a REMOTEINPUT_CLIENT client.\n";
2910 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
2911 if (m_current_recv_remoteinput_id.at (i) == client_id) {
2912 m_current_recv_remoteinput_id.erase (m_current_recv_remoteinput_id.begin () + i);
2916 } else if (client_info.type == CONFIG_CLIENT) {
2917 SCIM_DEBUG_MAIN(4) << "It's a CONFIG_CLIENT client.\n";
2919 LOGI ("clients: %d, panel clients: %d, imcontrols size: %d, helper infos: %d, \
2920 helper active infos: %d, helper client indexs: %d, ises pending: %d, \
2921 imcontrols: %d, start helper ic indexs: %d, client context uuids: %d, \
2922 client context helpers: %d, helpers uuid count: %d",
2923 m_client_repository.size(),
2924 m_panel_client_map.size(),
2925 m_imcontrol_map.size(),
2926 m_helper_info_repository.size(),
2927 m_helper_active_info_repository.size(),
2928 m_helper_client_index.size(),
2929 m_ise_pending_repository.size(),
2930 m_imcontrol_repository.size(),
2931 m_start_helper_ic_index.size(),
2932 m_client_context_uuids.size(),
2933 m_client_context_helper.size(),
2934 m_helper_uuid_count.size());
2937 const ClientInfo& socket_get_client_info (int client) {
2938 static ClientInfo null_client = { 0, UNKNOWN_CLIENT };
2939 ClientRepository::iterator it = m_client_repository.find (client);
2941 if (it != m_client_repository.end ())
2947 //SCIM_TRANS_CMD_PANEL_TURN_ON
2948 void socket_turn_on (void) {
2949 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_turn_on ()\n";
2950 m_signal_turn_on ();
2952 //SCIM_TRANS_CMD_PANEL_TURN_OFF
2953 void socket_turn_off (void) {
2954 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_turn_off ()\n";
2955 m_signal_turn_off ();
2957 //SCIM_TRANS_CMD_UPDATE_SCREEN
2958 void socket_update_screen (int client_id, uint32 num) {
2959 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_screen ()\n";
2961 if (((int) num) != m_current_screen) {
2962 SCIM_DEBUG_MAIN (4) << "New Screen number = " << num << "\n";
2963 m_signal_update_screen ((int) num);
2964 helper_all_update_screen ((int) num);
2965 m_current_screen = (num);
2968 //SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
2969 void socket_update_spot_location (uint32 x, uint32 y, uint32 top_y) {
2970 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_spot_location ()\n";
2971 SCIM_DEBUG_MAIN (4) << "New Spot location x=" << x << " y=" << y << "\n";
2972 m_signal_update_spot_location ((int)x, (int)y, (int)top_y);
2973 helper_all_update_spot_location ((int)x, (int)y);
2975 //ISM_TRANS_CMD_UPDATE_CURSOR_POSITION
2976 void socket_update_cursor_position (uint32 cursor_pos) {
2977 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_cursor_position ()\n";
2978 SCIM_DEBUG_MAIN (4) << "New cursor position pos=" << cursor_pos << "\n";
2979 helper_all_update_cursor_position ((int)cursor_pos);
2981 //ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT
2982 void socket_update_surrounding_text (String text, uint32 cursor) {
2983 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
2984 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
2986 if (it != m_helper_client_index.end ()) {
2991 get_focused_context (client, context);
2992 ctx = get_helper_ic (client, context);
2993 m_panel_agent_manager.socket_update_surrounding_text (it->second.id, ctx, m_current_helper_uuid, text, cursor);
2998 void remoteinput_callback_focus_in () {
2999 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3001 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3003 m_panel_agent_manager.socket_remoteinput_focus_in (m_current_recv_remoteinput_id.at (i));
3008 void remoteinput_callback_focus_out () {
3009 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3011 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3013 m_panel_agent_manager.socket_remoteinput_focus_out (m_current_recv_remoteinput_id.at (i));
3018 void remoteinput_callback_entry_metadata (uint32 hint, uint32 layout, int variation, uint32 autocapital_type, int return_key_disabled) {
3019 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3021 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3023 m_panel_agent_manager.socket_remoteinput_entry_metadata (m_current_recv_remoteinput_id.at (i), hint, layout, variation, autocapital_type, return_key_disabled);
3028 void remoteinput_callback_surrounding_text (String text, uint32 cursor) {
3029 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3031 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3033 m_panel_agent_manager.socket_remoteinput_surrounding_text (m_current_recv_remoteinput_id.at (i), text, cursor);
3038 void remoteinput_callback_input_resource (uint32 input_resource) {
3039 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3041 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3043 m_panel_agent_manager.socket_remoteinput_input_resource (m_current_recv_remoteinput_id.at (i), input_resource);
3048 //ISM_TRANS_CMD_UPDATE_SELECTION
3049 void socket_update_selection (String text) {
3050 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3051 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3053 if (it != m_helper_client_index.end ()) {
3058 get_focused_context (client, context);
3059 ctx = get_helper_ic (client, context);
3060 m_panel_agent_manager.socket_update_selection (it->second.id, ctx, m_current_helper_uuid, text);
3064 //SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO
3065 void socket_update_factory_info (PanelFactoryInfo& info) {
3066 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_factory_info ()\n";
3067 SCIM_DEBUG_MAIN (4) << "New Factory info uuid=" << info.uuid << " name=" << info.name << "\n";
3068 info.lang = scim_get_normalized_language (info.lang);
3069 m_signal_update_factory_info (info);
3071 //SCIM_TRANS_CMD_PANEL_SHOW_HELP
3072 void socket_show_help (String help) {
3073 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_help ()\n";
3074 m_signal_show_help (help);
3076 //SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU
3077 void socket_show_factory_menu (std::vector <PanelFactoryInfo>& vec) {
3078 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_factory_menu ()\n";
3081 m_signal_show_factory_menu (vec);
3084 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
3085 void socket_show_preedit_string (void) {
3086 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_preedit_string ()\n";
3087 m_signal_show_preedit_string ();
3089 //SCIM_TRANS_CMD_SHOW_AUX_STRING
3090 void socket_show_aux_string (void) {
3091 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_aux_string ()\n";
3092 m_signal_show_aux_string ();
3094 //SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE
3095 void socket_show_lookup_table (void) {
3096 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_lookup_table ()\n";
3097 m_signal_show_lookup_table ();
3099 //ISM_TRANS_CMD_SHOW_ASSOCIATE_TABLE
3100 void socket_show_associate_table (void) {
3101 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_associate_table ()\n";
3102 m_signal_show_associate_table ();
3104 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
3105 void socket_hide_preedit_string (void) {
3106 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_preedit_string ()\n";
3107 m_signal_hide_preedit_string ();
3109 //SCIM_TRANS_CMD_HIDE_AUX_STRING
3110 void socket_hide_aux_string (void) {
3111 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_aux_string ()\n";
3112 m_signal_hide_aux_string ();
3114 //SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE
3115 void socket_hide_lookup_table (void) {
3116 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_lookup_table ()\n";
3117 m_signal_hide_lookup_table ();
3119 //ISM_TRANS_CMD_HIDE_ASSOCIATE_TABLE
3120 void socket_hide_associate_table (void) {
3121 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_associate_table ()\n";
3122 m_signal_hide_associate_table ();
3124 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
3125 void socket_update_preedit_string (String& str, const AttributeList& attrs, uint32 caret) {
3126 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_string ()\n";
3127 m_signal_update_preedit_string (str, attrs, (int) caret);
3129 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
3130 void socket_update_preedit_caret (uint32 caret) {
3131 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_caret ()\n";
3132 m_signal_update_preedit_caret ((int) caret);
3134 //ISM_TRANS_CMD_RECAPTURE_STRING
3135 void socket_recapture_string (int offset, int len, String& preedit, String& commit, const AttributeList& attrs) {
3136 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_caret ()\n";
3137 m_signal_recapture_string (offset, len, preedit, commit, attrs);
3139 //SCIM_TRANS_CMD_UPDATE_AUX_STRING
3140 void socket_update_aux_string (String& str, const AttributeList& attrs) {
3141 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_aux_string ()\n";
3142 m_signal_update_aux_string (str, attrs);
3143 m_is_imengine_aux = true;
3145 //SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE
3146 void socket_update_lookup_table (const LookupTable& table) {
3147 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_lookup_table ()\n";
3149 //g_isf_candidate_table = _isf_candidate_table;
3150 m_signal_update_lookup_table (table);
3151 m_is_imengine_candidate = true;
3153 //ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE
3154 void socket_update_associate_table (const LookupTable& table) {
3155 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_associate_table ()\n";
3156 m_signal_update_associate_table (table);
3159 void socket_update_control_panel (void) {
3160 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_control_panel ()\n";
3162 m_signal_get_keyboard_ise (name, uuid);
3163 PanelFactoryInfo info;
3165 if (name.length () > 0)
3166 info = PanelFactoryInfo (uuid, name, String (""), String (""));
3168 info = PanelFactoryInfo (String (""), String (_ ("English Keyboard")), String ("C"), String (SCIM_KEYBOARD_ICON_FILE));
3170 m_signal_update_factory_info (info);
3172 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
3173 void socket_register_properties (const PropertyList& properties) {
3174 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_register_properties ()\n";
3175 m_signal_register_properties (properties);
3177 //SCIM_TRANS_CMD_UPDATE_PROPERTY
3178 void socket_update_property (const Property& property) {
3179 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_property ()\n";
3180 m_signal_update_property (property);
3182 //ISM_TRANS_CMD_GET_KEYBOARD_ISE_LIST
3183 void socket_get_keyboard_ise_list (String& uuid) {
3184 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_keyboard_ise_list ()\n";
3185 std::vector<String> list;
3187 m_signal_get_keyboard_ise_list (list);
3188 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3190 if (it != m_helper_client_index.end ()) {
3193 get_focused_context (client, context);
3194 uint32 ctx = get_helper_ic (client, context);
3195 m_panel_agent_manager.socket_get_keyboard_ise_list (it->second.id, ctx, uuid, list);
3198 //ISM_TRANS_CMD_SET_CANDIDATE_UI
3199 void socket_set_candidate_ui (uint32 portrait_line, uint32 mode) {
3200 SCIM_DEBUG_MAIN (4) << __func__ << " \n";
3201 m_signal_set_candidate_ui (portrait_line, mode);
3203 //ISM_TRANS_CMD_GET_CANDIDATE_UI
3204 void socket_get_candidate_ui (String uuid) {
3205 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_candidate_ui ()\n";
3206 int style = 0, mode = 0;
3207 m_signal_get_candidate_ui (style, mode);
3208 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3210 if (it != m_helper_client_index.end ()) {
3213 get_focused_context (client, context);
3214 uint32 ctx = get_helper_ic (client, context);
3215 m_panel_agent_manager.socket_get_candidate_ui (it->second.id, ctx, uuid, style, mode);
3218 //ISM_TRANS_CMD_SET_CANDIDATE_POSITION
3219 void socket_set_candidate_position (uint32 left, uint32 top) {
3220 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_candidate_position ()\n";
3221 m_signal_set_candidate_position (left, top);
3223 //ISM_TRANS_CMD_HIDE_CANDIDATE
3224 void socket_hide_candidate (void) {
3225 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_candidate ()\n";
3226 m_signal_hide_preedit_string ();
3227 m_signal_hide_aux_string ();
3228 m_signal_hide_lookup_table ();
3229 m_signal_hide_associate_table ();
3231 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
3232 void socket_get_candidate_geometry (String& uuid) {
3233 SCIM_DEBUG_MAIN (4) << __func__ << " \n";
3234 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3236 if (it != m_helper_client_index.end ()) {
3237 struct rectinfo info = {0, 0, 0, 0};
3238 m_signal_get_candidate_geometry (info);
3241 get_focused_context (client, context);
3242 uint32 ctx = get_helper_ic (client, context);
3243 m_panel_agent_manager.socket_get_candidate_geometry (it->second.id, ctx, uuid, info);
3246 //ISM_TRANS_CMD_SET_KEYBOARD_ISE_BY_UUID
3247 void socket_set_keyboard_ise (String uuid) {
3248 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_keyboard_ise ()\n";
3250 m_signal_set_keyboard_ise (uuid);
3252 //ISM_TRANS_CMD_SELECT_CANDIDATE
3253 void socket_helper_select_candidate (uint32 index) {
3254 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_keyboard_ise ()\n";
3256 m_signal_select_candidate (index);
3258 //ISM_TRANS_CMD_UPDATE_ISE_GEOMETRY
3259 void socket_helper_update_ise_geometry (int client, uint32 x, uint32 y, uint32 width, uint32 height) {
3260 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3263 uint32 focused_context;
3264 HelperInfoRepository::iterator it = m_helper_active_info_repository.find (client);
3266 if (it != m_helper_active_info_repository.end ()) {
3267 if (it->second.uuid == m_current_helper_uuid) {
3268 m_signal_update_ise_geometry (x, y, width, height);
3270 get_focused_context (focused_client, focused_context);
3271 ClientInfo client_info = socket_get_client_info (focused_client);
3272 if (client_info.type == FRONTEND_CLIENT) {
3273 m_panel_agent_manager.update_ise_geometry (focused_client, focused_context, x, y, width, height);
3278 //ISM_TRANS_CMD_GET_KEYBOARD_ISE
3279 void socket_get_keyboard_ise (String uuid) {
3280 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_keyboard_ise ()\n";
3281 String ise_name, ise_uuid;
3285 get_focused_context (client, context);
3286 ctx = get_helper_ic (client, context);
3288 if (m_client_context_uuids.find (ctx) != m_client_context_uuids.end ())
3289 ise_uuid = m_client_context_uuids[ctx];
3291 m_signal_get_keyboard_ise (ise_name, ise_uuid);
3292 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3294 if (it != m_helper_client_index.end ()) {
3295 get_focused_context (client, context);
3296 ctx = get_helper_ic (client, context);
3297 m_panel_agent_manager.socket_get_keyboard_ise (it->second.id, ctx, uuid, ise_name, ise_uuid);
3301 //SCIM_TRANS_CMD_START_HELPER
3302 void socket_start_helper (int client_id, uint32 context, String uuid) {
3303 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_start_helper ()\n";
3304 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3306 uint32 ic = get_helper_ic (m_panel_client_map[client_id], context);
3308 /* Get the context uuid from the client context registration table. */
3310 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3312 if (it != m_client_context_uuids.end ())
3313 ic_uuid = it->second;
3316 if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3317 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3318 } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3319 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3322 if (it == m_helper_client_index.end ()) {
3323 SCIM_DEBUG_MAIN (5) << "Run this Helper.\n";
3324 m_start_helper_ic_index [uuid].push_back (std::make_pair (ic, ic_uuid));
3325 m_signal_run_helper (uuid, m_config_name, m_display_name);
3327 SCIM_DEBUG_MAIN (5) << "Increase the Reference count.\n";
3328 m_panel_agent_manager.socket_start_helper (it->second.id, ic, ic_uuid);
3334 //SCIM_TRANS_CMD_STOP_HELPER
3335 void socket_stop_helper (int client_id, uint32 context, String uuid) {
3336 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_stop_helper ()\n";
3337 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3339 uint32 ic = get_helper_ic (m_panel_client_map[client_id], context);
3341 if (it != m_helper_client_index.end ()) {
3342 SCIM_DEBUG_MAIN (5) << "Decrase the Reference count.\n";
3345 /* Get the context uuid from the client context registration table. */
3347 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3349 if (it != m_client_context_uuids.end ())
3350 ic_uuid = it->second;
3353 if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3354 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3355 } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3356 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3359 m_panel_agent_manager.helper_detach_input_context (it->second.id, ic, ic_uuid);
3361 if (it->second.ref <= 0)
3362 m_panel_agent_manager.exit (it->second.id, ic);
3367 //SCIM_TRANS_CMD_SEND_HELPER_EVENT
3368 void socket_send_helper_event (int client_id, uint32 context, String uuid, const Transaction& _nest_trans) {
3369 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_send_helper_event ()\n";
3370 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3372 if (it != m_helper_client_index.end ()) {
3374 /* Get the context uuid from the client context registration table. */
3376 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3378 if (it != m_client_context_uuids.end ())
3379 ic_uuid = it->second;
3382 if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3383 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3384 } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3385 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3388 m_panel_agent_manager.helper_process_imengine_event (it->second.id, get_helper_ic (m_panel_client_map[client_id], context), ic_uuid, _nest_trans);
3392 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
3393 void socket_helper_register_properties (int client, PropertyList& properties) {
3394 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_properties (" << client << ")\n";
3395 m_signal_register_helper_properties (client, properties);
3397 #if 0 //why? remove if useless, infinite loop
3398 /* Check whether application is already focus_in */
3399 if (m_current_socket_client != -1) {
3400 SCIM_DEBUG_MAIN (2) << "Application is already focus_in!\n";
3401 focus_in_helper (m_current_helper_uuid, m_current_socket_client, m_current_client_context);
3402 reset_keyboard_ise ();
3405 /* Check whether ISE panel is already shown */
3406 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode && m_ise_context_length > 0) {
3407 SCIM_DEBUG_MAIN (2) << "Re-show ISE panel!\n";
3409 uint32 focused_context;
3410 get_focused_context (focused_client, focused_context);
3412 if (focused_client == -1 && m_active_client_id != -1) {
3413 focused_client = m_panel_client_map[m_active_client_id];
3414 focused_context = 0;
3417 uint32 ctx = get_helper_ic (focused_client, focused_context);
3418 bool ret = show_helper (m_current_helper_uuid, m_ise_context_buffer, m_ise_context_length, ctx);
3421 m_signal_show_ise ();
3425 //SCIM_TRANS_CMD_UPDATE_PROPERTY
3426 void socket_helper_update_property (int client, Property& property) {
3427 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_property (" << client << ")\n";
3428 m_signal_update_helper_property (client, property);
3430 //SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT
3431 void socket_helper_send_imengine_event (int client, uint32 target_ic, String target_uuid , Transaction& nest_trans) {
3432 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_send_imengine_event (" << client << ")\n";
3433 HelperInfoRepository::iterator hiit = m_helper_active_info_repository.find (client);
3435 if (hiit != m_helper_active_info_repository.end ()) {
3437 uint32 target_context;
3438 get_imengine_client_context (target_ic, target_client, target_context);
3440 uint32 focused_context;
3441 String focused_uuid;
3442 focused_uuid = get_focused_context (focused_client, focused_context);
3444 if (target_ic == (uint32) (-1)) {
3445 target_client = focused_client;
3446 target_context = focused_context;
3449 if (target_uuid.length () == 0)
3450 target_uuid = focused_uuid;
3452 ClientInfo client_info = socket_get_client_info (target_client);
3453 SCIM_DEBUG_MAIN (5) << "Target UUID = " << target_uuid << " Focused UUId = " << focused_uuid << "\nTarget Client = " << target_client << "\n";
3455 if (client_info.type == FRONTEND_CLIENT) {
3456 /* If the original context value is greater than 0x7FFF, the line below would not work properly
3457 since the target_context acquired by get_imengnie_client_context() is always smaller than 0x7FFF.
3458 But since the send_imengine_event() of scim_helper module will call IMEngine's
3459 process_helper_event() function directly, instead of sending SEND_IMENGINE_EVENT message.
3460 So we are not going to handle this kind of exceptional case for now. */
3461 m_panel_agent_manager.process_helper_event (target_client, target_context, target_uuid, hiit->second.uuid, nest_trans);
3466 void socket_helper_key_event_op (int client, int cmd, uint32 target_ic, String& target_uuid, KeyEvent& key) {
3467 if (!key.empty ()) {
3469 uint32 target_context;
3470 get_imengine_client_context (target_ic, target_client, target_context);
3472 uint32 focused_context;
3473 String focused_uuid;
3474 focused_uuid = get_focused_context (focused_client, focused_context);
3476 if (target_ic == (uint32) (-1)) {
3477 target_client = focused_client;
3478 target_context = focused_context;
3481 if (target_uuid.length () == 0)
3482 target_uuid = focused_uuid;
3484 if (target_client == -1) {
3485 /* FIXUP: monitor 'Invalid Window' error */
3486 LOGW ("focused target client is NULL");
3487 } else if (target_uuid == focused_uuid &&
3488 clients_equal (target_client, focused_client) &&
3489 contexts_equal (target_context, focused_context)) {
3490 ClientInfo client_info = socket_get_client_info (focused_client);
3492 if (client_info.type == FRONTEND_CLIENT) {
3493 m_panel_agent_manager.socket_helper_key_event (focused_client, focused_context, cmd, key);
3496 LOGD ("[target_client : %d, focused_client : %d] => %d, [target_context : %u, focused_context : %u] => %d",
3497 target_client, focused_client, clients_equal (target_client, focused_client),
3498 target_context, focused_context, contexts_equal (target_context, focused_context));
3502 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
3503 //SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT
3504 void socket_helper_send_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key) {
3505 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_send_key_event (" << client << ")\n";
3506 ISF_PROF_DEBUG ("first message")
3507 socket_helper_key_event_op (client, SCIM_TRANS_CMD_PROCESS_KEY_EVENT, target_ic, target_uuid, key);
3509 //SCIM_TRANS_CMD_FORWARD_KEY_EVENT
3510 void socket_helper_forward_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key) {
3511 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_forward_key_event (" << client << ")\n";
3512 socket_helper_key_event_op (client, SCIM_TRANS_CMD_FORWARD_KEY_EVENT, target_ic, target_uuid, key);
3515 //SCIM_TRANS_CMD_COMMIT_STRING
3516 void socket_helper_commit_string (int client, uint32 target_ic, String target_uuid, WideString wstr) {
3517 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_commit_string (" << client << ")\n";
3519 if (wstr.length ()) {
3521 uint32 target_context;
3522 get_imengine_client_context (target_ic, target_client, target_context);
3524 uint32 focused_context;
3525 String focused_uuid;
3526 focused_uuid = get_focused_context (focused_client, focused_context);
3528 if (target_ic == (uint32) (-1)) {
3529 target_client = focused_client;
3530 target_context = focused_context;
3533 if (target_uuid.length () == 0)
3534 target_uuid = focused_uuid;
3536 if (target_uuid == focused_uuid &&
3537 clients_equal (target_client, focused_client) &&
3538 contexts_equal (target_context, focused_context)) {
3539 ClientInfo client_info = socket_get_client_info (focused_client);
3541 if (client_info.type == FRONTEND_CLIENT) {
3542 m_panel_agent_manager.commit_string (focused_client, focused_context, wstr);
3544 std::cerr << "target client is not existed!!!" << "\n";
3549 //SCIM_TRANS_CMD_GET_SURROUNDING_TEXT
3550 void socket_helper_get_surrounding_text (int client, String uuid, uint32 maxlen_before, uint32 maxlen_after) {
3551 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3553 uint32 focused_context;
3554 get_focused_context (focused_client, focused_context);
3555 ClientInfo client_info = socket_get_client_info (focused_client);
3557 /* If the get_surrounding_text was received when there is no client available,
3558 * return empty surrounding text since the sender would be waiting for reply */
3559 if (focused_client == -1) {
3560 socket_update_surrounding_text("", 0);
3562 if (client_info.type == FRONTEND_CLIENT) {
3563 m_panel_agent_manager.socket_helper_get_surrounding_text (focused_client, focused_context, maxlen_before, maxlen_after);
3567 //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT
3568 void socket_helper_delete_surrounding_text (int client, uint32 offset, uint32 len) {
3569 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3571 uint32 focused_context;
3572 get_focused_context (focused_client, focused_context);
3573 ClientInfo client_info = socket_get_client_info (focused_client);
3575 if (client_info.type == FRONTEND_CLIENT) {
3576 m_panel_agent_manager.socket_helper_delete_surrounding_text (focused_client, focused_context, offset, len);
3579 //SCIM_TRANS_CMD_GET_SELECTION
3580 void socket_helper_get_selection (int client, String uuid) {
3581 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3583 uint32 focused_context;
3584 get_focused_context (focused_client, focused_context);
3585 ClientInfo client_info = socket_get_client_info (focused_client);
3587 if (client_info.type == FRONTEND_CLIENT) {
3588 m_panel_agent_manager.socket_helper_get_selection (focused_client, focused_context);
3591 //SCIM_TRANS_CMD_SET_SELECTION
3592 void socket_helper_set_selection (int client, uint32 start, uint32 end) {
3593 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3595 uint32 focused_context;
3596 get_focused_context (focused_client, focused_context);
3597 ClientInfo client_info = socket_get_client_info (focused_client);
3599 if (client_info.type == FRONTEND_CLIENT) {
3600 m_panel_agent_manager.socket_helper_set_selection (focused_client, focused_context, start, end);
3604 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
3605 void socket_helper_show_preedit_string (int client, uint32 target_ic, String target_uuid) {
3606 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_show_preedit_string (" << client << ")\n";
3608 uint32 target_context;
3609 get_imengine_client_context (target_ic, target_client, target_context);
3611 uint32 focused_context;
3612 String focused_uuid = get_focused_context (focused_client, focused_context);
3614 if (target_ic == (uint32) (-1)) {
3615 target_client = focused_client;
3616 target_context = focused_context;
3619 if (target_uuid.length () == 0)
3620 target_uuid = focused_uuid;
3622 if (target_uuid == focused_uuid &&
3623 clients_equal (target_client, focused_client) &&
3624 contexts_equal (target_context, focused_context)) {
3625 ClientInfo client_info = socket_get_client_info (focused_client);
3627 if (client_info.type == FRONTEND_CLIENT) {
3628 m_panel_agent_manager.show_preedit_string (focused_client, focused_context);
3632 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
3633 void socket_helper_hide_preedit_string (int client, uint32 target_ic, String target_uuid) {
3634 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_hide_preedit_string (" << client << ")\n";
3636 uint32 target_context;
3637 get_imengine_client_context (target_ic, target_client, target_context);
3639 uint32 focused_context;
3640 String focused_uuid = get_focused_context (focused_client, focused_context);
3642 if (target_ic == (uint32) (-1)) {
3643 target_client = focused_client;
3644 target_context = focused_context;
3647 if (target_uuid.length () == 0)
3648 target_uuid = focused_uuid;
3650 if (target_uuid == focused_uuid &&
3651 clients_equal (target_client, focused_client) &&
3652 contexts_equal (target_context, focused_context)) {
3653 ClientInfo client_info = socket_get_client_info (focused_client);
3655 if (client_info.type == FRONTEND_CLIENT) {
3656 m_panel_agent_manager.hide_preedit_string (focused_client, focused_context);
3660 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
3661 void socket_helper_update_preedit_string (int client, uint32 target_ic, String target_uuid, WideString preedit, WideString commit, AttributeList& attrs, uint32 caret) {
3662 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_preedit_string (" << client << ")\n";
3664 uint32 target_context;
3665 get_imengine_client_context (target_ic, target_client, target_context);
3667 uint32 focused_context;
3668 String focused_uuid;
3669 focused_uuid = get_focused_context (focused_client, focused_context);
3671 if (target_ic == (uint32) (-1)) {
3672 target_client = focused_client;
3673 target_context = focused_context;
3676 if (target_uuid.length () == 0)
3677 target_uuid = focused_uuid;
3679 if (target_uuid == focused_uuid &&
3680 clients_equal (target_client, focused_client) &&
3681 contexts_equal (target_context, focused_context)) {
3682 ClientInfo client_info = socket_get_client_info (focused_client);
3684 if (client_info.type == FRONTEND_CLIENT) {
3685 m_panel_agent_manager.update_preedit_string (focused_client, focused_context, preedit, commit, attrs, caret);
3689 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
3690 void socket_helper_update_preedit_caret (int client, uint32 caret) {
3691 SCIM_DEBUG_MAIN (4) << __func__ << " (" << client << ")\n";
3693 uint32 focused_context;
3694 String focused_uuid;
3695 focused_uuid = get_focused_context (focused_client, focused_context);
3696 ClientInfo client_info = socket_get_client_info (focused_client);
3698 if (client_info.type == FRONTEND_CLIENT) {
3699 m_panel_agent_manager.update_preedit_caret (focused_client, focused_context, caret);
3703 //ISM_TRANS_CMD_RECAPTURE_STRING
3704 void socket_helper_recapture_string (int client, uint32 target_ic, String target_uuid, int offset, int len, WideString preedit,
3705 WideString commit, AttributeList& attrs) {
3706 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_recapture_string (" << client << ")\n";
3708 uint32 target_context;
3709 get_imengine_client_context (target_ic, target_client, target_context);
3711 uint32 focused_context;
3712 String focused_uuid;
3713 focused_uuid = get_focused_context (focused_client, focused_context);
3715 if (target_ic == (uint32) (-1)) {
3716 target_client = focused_client;
3717 target_context = focused_context;
3720 if (target_uuid.length () == 0)
3721 target_uuid = focused_uuid;
3723 if (target_uuid == focused_uuid &&
3724 clients_equal (target_client, focused_client) &&
3725 contexts_equal (target_context, focused_context)) {
3726 ClientInfo client_info = socket_get_client_info (focused_client);
3728 if (client_info.type == FRONTEND_CLIENT) {
3729 m_panel_agent_manager.recapture_string (focused_client, focused_context, offset, len, preedit, commit, attrs);
3734 //SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
3735 void socket_helper_register_helper (int client, HelperInfo& info) {
3736 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_helper (" << client << ")\n";
3737 bool result = false;
3744 if (!m_signal_get_ise_information (info.uuid, info.name, language, type, option, module_name)) {
3745 LOGW ("This helper (%s) is not IME", info.uuid.c_str ());
3749 info.option = option;
3751 if (info.uuid.length ()) {
3752 SCIM_DEBUG_MAIN (4) << "New Helper uuid=" << info.uuid << " name=" << info.name << "\n";
3753 HelperClientIndex::iterator it = m_helper_client_index.find (info.uuid);
3755 if (it == m_helper_client_index.end ()) {
3756 m_helper_info_repository [client] = info;
3757 m_helper_client_index [info.uuid] = HelperClientStub (client, 1);
3758 StartHelperICIndex::iterator icit = m_start_helper_ic_index.find (info.uuid);
3760 if (icit != m_start_helper_ic_index.end ()) {
3761 m_panel_agent_manager.helper_attach_input_context_and_update_screen (client, icit->second, m_current_screen);
3762 m_start_helper_ic_index.erase (icit);
3765 LOGW ("Failed to register IME : %s", info.uuid.c_str ());
3766 m_panel_agent_manager.send_fail_reply(client);
3769 LOGW ("Failed to register IME : %s", info.uuid.c_str ());
3770 m_panel_agent_manager.send_fail_reply(client);
3777 LOGD ("Succeed to regster IME : %s", info.uuid.c_str ());
3778 m_signal_register_helper (client, info);
3782 //SCIM_TRANS_CMD_PANEL_REGISTER_ACTIVE_HELPER
3783 void socket_helper_register_helper_passive (int client, HelperInfo& info) {
3784 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_helper_passive (" << client << ")\n";
3791 if (!m_signal_get_ise_information (info.uuid, info.name, language, type, option, module_name)) {
3792 LOGW ("This helper (%s) is not IME", info.uuid.c_str ());
3796 info.option = option;
3798 if (info.uuid.length ()) {
3799 SCIM_DEBUG_MAIN (4) << "New Helper Passive uuid=" << info.uuid << " name=" << info.name << "\n";
3800 HelperInfoRepository::iterator it = m_helper_active_info_repository.find (client);
3802 if (it == m_helper_active_info_repository.end ()) {
3803 m_helper_active_info_repository[client] = info;
3806 StringIntRepository::iterator iter = m_ise_pending_repository.find (info.uuid);
3808 if (iter != m_ise_pending_repository.end ()) {
3809 m_ise_pending_repository.erase (iter);
3812 iter = m_ise_pending_repository.find (info.name);
3814 if (iter != m_ise_pending_repository.end ()) {
3815 m_ise_pending_repository.erase (iter);
3821 //ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
3822 void socket_helper_update_input_context (int client, uint32 type, uint32 value) {
3823 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_input_context (" << client << ")\n";
3824 m_signal_update_input_context ((int)type, (int)value);
3826 uint32 focused_context;
3827 get_focused_context (focused_client, focused_context);
3828 ClientInfo client_info = socket_get_client_info (focused_client);
3830 if (client_info.type == FRONTEND_CLIENT) {
3831 m_panel_agent_manager.update_ise_input_context (focused_client, focused_context, type, value);
3833 std::cerr << "focused client is not existed!!!" << "\n";
3836 //ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE
3837 void socket_helper_update_language_locale(int client, String locale) {
3838 SCIM_DEBUG_MAIN(4) << "InfoManager::socket_helper_update_language_locale (" << client << ")\n";
3839 m_signal_update_language_locale(locale);
3842 uint32 focused_context;
3843 get_focused_context(focused_client, focused_context);
3844 ClientInfo client_info = socket_get_client_info(focused_client);
3846 if (client_info.type == FRONTEND_CLIENT) {
3847 m_panel_agent_manager.update_ise_language_locale(focused_client, focused_context, locale);
3849 std::cerr << "focused client is not existed!!!" << "\n";
3852 //SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
3853 void socket_helper_send_private_command (int client, String command) {
3854 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3856 uint32 focused_context;
3857 get_focused_context (focused_client, focused_context);
3858 ClientInfo client_info = socket_get_client_info (focused_client);
3860 if (client_info.type == FRONTEND_CLIENT) {
3861 m_panel_agent_manager.send_private_command (focused_client, focused_context, command);
3864 //SCIM_TRANS_CMD_COMMIT_CONTENT
3865 void socket_helper_commit_content (int client, String content, String description, String mime_types) {
3866 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3868 uint32 focused_context;
3869 get_focused_context (focused_client, focused_context);
3870 ClientInfo client_info = socket_get_client_info (focused_client);
3872 if (client_info.type == FRONTEND_CLIENT) {
3873 m_panel_agent_manager.commit_content (focused_client, focused_context, content, description, mime_types);
3876 //ISM_TRANS_CMD_UPDATE_ISE_EXIT
3877 //void UPDATE_ISE_EXIT (int client) {
3879 // HelperInfoRepository::iterator hiit = m_helper_active_info_repository.find (client);
3881 // if (hiit != m_helper_active_info_repository.end ()) {
3882 // String l_uuid = hiit->second.uuid;
3883 // HelperClientIndex::iterator it = m_helper_client_index.find (l_uuid);
3885 // if (it != m_helper_client_index.end ()) {
3886 // del_client (it->second.id);
3890 // del_client (client);
3893 void process_key_event_done (KeyEvent &key, uint32 ret, uint32 serial) {
3895 uint32 focused_context;
3896 get_focused_context (focused_client, focused_context);
3897 ClientInfo client_info = socket_get_client_info (focused_client);
3899 if (client_info.type == FRONTEND_CLIENT) {
3900 m_panel_agent_manager.process_key_event_done (focused_client, focused_context, key, ret, serial);
3904 //ISM_TRANS_CMD_REQUEST_ISE_HIDE
3905 void request_ise_hide () {
3907 uint32 focused_context;
3908 get_focused_context (focused_client, focused_context);
3909 ClientInfo client_info = socket_get_client_info (focused_client);
3911 if (client_info.type == FRONTEND_CLIENT) {
3912 m_panel_agent_manager.request_ise_hide (focused_client, focused_context);
3916 void socket_reset_helper_input_context (const String& uuid, int client, uint32 context) {
3917 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3919 if (it != m_helper_client_index.end ()) {
3920 uint32 ctx = get_helper_ic (client, context);
3921 m_panel_agent_manager.reset_helper_context (it->second.id, ctx, uuid);
3925 bool helper_select_aux (uint32 item) {
3926 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_aux \n";
3928 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3929 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3931 if (it != m_helper_client_index.end ()) {
3935 get_focused_context (client, context);
3936 ctx = get_helper_ic (client, context);
3937 m_panel_agent_manager.select_aux (it->second.id, ctx, item);
3945 bool helper_select_candidate (uint32 item) {
3946 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_candidate \n";
3948 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3949 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3951 if (it != m_helper_client_index.end ()) {
3955 get_focused_context (client, context);
3956 ctx = get_helper_ic (client, context);
3957 m_panel_agent_manager.select_candidate (it->second.id, ctx, item);
3965 bool helper_lookup_table_page_up (void) {
3966 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_lookup_table_page_up \n";
3968 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3969 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3971 if (it != m_helper_client_index.end ()) {
3975 get_focused_context (client, context);
3976 ctx = get_helper_ic (client, context);
3977 m_panel_agent_manager.lookup_table_page_up (it->second.id, ctx);
3985 bool helper_lookup_table_page_down (void) {
3986 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_lookup_table_page_down \n";
3988 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3989 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3991 if (it != m_helper_client_index.end ()) {
3995 get_focused_context (client, context);
3996 ctx = get_helper_ic (client, context);
3997 m_panel_agent_manager.lookup_table_page_down (it->second.id, ctx);
4005 bool helper_update_lookup_table_page_size (uint32 size) {
4006 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_update_lookup_table_page_size \n";
4008 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4009 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4011 if (it != m_helper_client_index.end ()) {
4015 get_focused_context (client, context);
4016 ctx = get_helper_ic (client, context);
4017 m_panel_agent_manager.update_lookup_table_page_size (it->second.id, ctx, size);
4025 bool helper_update_candidate_item_layout (const std::vector<uint32>& row_items) {
4026 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4028 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4029 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4031 if (it != m_helper_client_index.end ()) {
4035 get_focused_context (client, context);
4036 ctx = get_helper_ic (client, context);
4037 m_panel_agent_manager.update_candidate_item_layout (it->second.id, ctx, row_items);
4045 bool helper_select_associate (uint32 item) {
4046 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_associate \n";
4048 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4049 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4051 if (it != m_helper_client_index.end ()) {
4055 get_focused_context (client, context);
4056 ctx = get_helper_ic (client, context);
4057 m_panel_agent_manager.select_associate (it->second.id, ctx, item);
4065 bool helper_associate_table_page_up (void) {
4066 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_associate_table_page_up \n";
4068 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4069 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4071 if (it != m_helper_client_index.end ()) {
4075 get_focused_context (client, context);
4076 ctx = get_helper_ic (client, context);
4077 m_panel_agent_manager.associate_table_page_up (it->second.id, ctx);
4085 bool helper_associate_table_page_down (void) {
4086 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_associate_table_page_down \n";
4088 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4089 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4091 if (it != m_helper_client_index.end ()) {
4095 get_focused_context (client, context);
4096 ctx = get_helper_ic (client, context);
4097 m_panel_agent_manager.associate_table_page_down (it->second.id, ctx);
4105 bool helper_update_associate_table_page_size (uint32 size) {
4106 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_update_associate_table_page_size \n";
4108 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4109 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4111 if (it != m_helper_client_index.end ()) {
4115 get_focused_context (client, context);
4116 ctx = get_helper_ic (client, context);
4117 m_panel_agent_manager.update_associate_table_page_size (it->second.id, ctx, size);
4125 bool helper_update_displayed_candidate_number (uint32 size) {
4126 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4128 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4129 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4131 if (it != m_helper_client_index.end ()) {
4135 get_focused_context (client, context);
4136 ctx = get_helper_ic (client, context);
4137 m_panel_agent_manager.update_displayed_candidate_number (it->second.id, ctx, size);
4145 bool helper_longpress_candidate (uint32 index) {
4146 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4148 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4149 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4151 if (it != m_helper_client_index.end ()) {
4155 get_focused_context (client, context);
4156 ctx = get_helper_ic (client, context);
4157 m_panel_agent_manager.send_longpress_event (it->second.id, ctx, index);
4162 std::cerr << __func__ << " is failed!!!\n";
4166 void helper_all_update_spot_location (int x, int y) {
4167 SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_spot_location (" << x << "," << y << ")\n";
4168 HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
4171 String uuid = get_focused_context (client, context);
4173 for (; hiit != m_helper_info_repository.end (); ++ hiit) {
4174 if (hiit->second.option & SCIM_HELPER_NEED_SPOT_LOCATION_INFO) {
4175 m_panel_agent_manager.helper_all_update_spot_location (hiit->first, get_helper_ic (client, context), uuid, x, y);
4180 void helper_all_update_cursor_position (int cursor_pos) {
4181 SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_cursor_position (" << cursor_pos << ")\n";
4182 HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
4185 String uuid = get_focused_context (client, context);
4187 for (; hiit != m_helper_info_repository.end (); ++ hiit) {
4188 m_panel_agent_manager.helper_all_update_cursor_position (hiit->first, get_helper_ic (client, context), uuid, cursor_pos);
4192 void helper_all_update_screen (int screen) {
4193 SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_screen (" << screen << ")\n";
4194 HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
4198 uuid = get_focused_context (client, context);
4200 for (; hiit != m_helper_info_repository.end (); ++ hiit) {
4201 if (hiit->second.option & SCIM_HELPER_NEED_SCREEN_INFO) {
4202 m_panel_agent_manager.helper_all_update_screen (hiit->first, get_helper_ic (client, context), uuid, screen);
4207 bool set_autocapital_type (int mode) {
4208 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4210 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || (m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
4211 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4213 if (it != m_helper_client_index.end ()) {
4217 get_focused_context (client, context);
4218 ctx = get_helper_ic (client, context);
4219 m_panel_agent_manager.set_autocapital_type (it->second.id, ctx, m_current_helper_uuid, mode);
4224 std::cerr << __func__ << " is failed!!!\n";
4228 bool set_prediction_allow (int client, int mode) {
4229 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4231 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || (m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
4232 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4234 if (it != m_helper_client_index.end ()) {
4236 uint32 focused_context;
4238 get_focused_context (focused_client, focused_context);
4239 ctx = get_helper_ic (focused_client, focused_context);
4240 m_panel_agent_manager.set_prediction_allow (it->second.id, ctx, m_current_helper_uuid, mode);
4245 std::cerr << __func__ << " is failed!!!\n";
4249 const String& get_focused_context (int& client, uint32& context, bool force_last_context = false) const {
4250 if (m_current_socket_client >= 0) {
4251 client = m_current_socket_client;
4252 context = m_current_client_context;
4253 return m_current_context_uuid;
4255 client = m_last_socket_client;
4256 context = m_last_client_context;
4257 return m_last_context_uuid;
4262 void socket_transaction_start (void) {
4263 m_signal_transaction_start ();
4266 void socket_transaction_end (void) {
4267 m_signal_transaction_end ();
4273 void unlock (void) {
4278 InfoManager::InfoManager ()
4279 : m_impl (new InfoManagerImpl ())
4283 InfoManager::~InfoManager ()
4289 InfoManager::initialize (InfoManager* info_manager, const ConfigPointer& config, const String& display, bool resident)
4291 return m_impl->initialize (info_manager, config, display, resident);
4295 InfoManager::valid (void) const
4297 return m_impl->valid ();
4301 InfoManager::stop (void)
4308 InfoManager::socket_get_client_info (int client) const
4310 return m_impl->socket_get_client_info (client);
4313 void InfoManager::hide_helper (const String& uuid)
4315 m_impl->hide_helper (uuid);
4318 InfoManager::get_current_toolbar_mode () const
4320 return m_impl->get_current_toolbar_mode ();
4324 InfoManager::get_current_ise_geometry (rectinfo& rect)
4326 m_impl->get_current_ise_geometry (rect);
4330 InfoManager::get_current_helper_uuid () const
4332 return m_impl->get_current_helper_uuid ();
4336 InfoManager::get_current_ise_name () const
4338 return m_impl->get_current_ise_name ();
4342 InfoManager::set_current_toolbar_mode (TOOLBAR_MODE_T mode)
4344 m_impl->set_current_toolbar_mode (mode);
4348 InfoManager::set_current_ise_name (String& name)
4350 m_impl->set_current_ise_name (name);
4354 InfoManager::set_current_helper_option (uint32 option)
4356 m_impl->set_current_helper_option (option);
4360 InfoManager::update_candidate_panel_event (uint32 nType, uint32 nValue)
4362 m_impl->update_panel_event (ISM_TRANS_CMD_UPDATE_ISF_CANDIDATE_PANEL, nType, nValue);
4366 InfoManager::update_input_panel_event (uint32 nType, uint32 nValue)
4368 m_impl->update_panel_event (ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT, nType, nValue);
4372 InfoManager::move_preedit_caret (uint32 position)
4374 return m_impl->move_preedit_caret (position);
4380 InfoManager::request_help (void)
4382 return m_impl->request_help ();
4386 InfoManager::request_factory_menu (void)
4388 return m_impl->request_factory_menu ();
4393 InfoManager::change_factory (const String& uuid)
4395 return m_impl->change_factory (uuid);
4399 InfoManager::helper_candidate_show (void)
4401 return m_impl->helper_candidate_show ();
4405 InfoManager::helper_candidate_hide (void)
4407 return m_impl->helper_candidate_hide ();
4411 InfoManager::candidate_more_window_show (void)
4413 return m_impl->candidate_more_window_show ();
4417 InfoManager::candidate_more_window_hide (void)
4419 return m_impl->candidate_more_window_hide ();
4423 InfoManager::update_helper_lookup_table (const LookupTable& table)
4425 return m_impl->update_helper_lookup_table (table);
4429 InfoManager::select_aux (uint32 item)
4431 return m_impl->select_aux (item);
4435 InfoManager::select_candidate (uint32 item)
4437 return m_impl->select_candidate (item);
4441 InfoManager::lookup_table_page_up (void)
4443 return m_impl->lookup_table_page_up ();
4447 InfoManager::lookup_table_page_down (void)
4449 return m_impl->lookup_table_page_down ();
4453 InfoManager::update_lookup_table_page_size (uint32 size)
4455 return m_impl->update_lookup_table_page_size (size);
4459 InfoManager::update_candidate_item_layout (const std::vector<uint32>& row_items)
4461 return m_impl->update_candidate_item_layout (row_items);
4465 InfoManager::select_associate (uint32 item)
4467 return m_impl->select_associate (item);
4471 InfoManager::associate_table_page_up (void)
4473 return m_impl->associate_table_page_up ();
4477 InfoManager::associate_table_page_down (void)
4479 return m_impl->associate_table_page_down ();
4483 InfoManager::update_associate_table_page_size (uint32 size)
4485 return m_impl->update_associate_table_page_size (size);
4489 InfoManager::update_displayed_candidate_number (uint32 size)
4491 return m_impl->update_displayed_candidate_number (size);
4495 InfoManager::send_longpress_event (int type, int index)
4497 m_impl->send_longpress_event (type, index);
4501 InfoManager::trigger_property (const String& property)
4503 return m_impl->trigger_property (property);
4507 InfoManager::start_helper (const String& uuid)
4509 return m_impl->start_helper (uuid, -2, 0);
4513 InfoManager::stop_helper (const String& uuid)
4515 return m_impl->stop_helper (uuid, -2, 0);
4519 InfoManager::set_default_ise (const DEFAULT_ISE_T& ise)
4521 m_impl->set_default_ise (ise);
4525 InfoManager::set_should_shared_ise (const bool should_shared_ise)
4527 m_impl->set_should_shared_ise (should_shared_ise);
4531 //InfoManager::reload_config (void)
4533 // m_impl->reload_config ();
4537 InfoManager::exit (void)
4539 return m_impl->exit ();
4542 InfoManager::update_ise_list (std::vector<String>& strList)
4544 m_impl->update_ise_list (strList);
4548 InfoManager::remoteinput_update_preedit_string (WideString str, AttributeList &attrs, uint32 caret)
4550 return m_impl->remoteinput_update_preedit_string (str, attrs, caret);
4554 InfoManager::remoteinput_commit_string (const WideString &str)
4556 return m_impl->remoteinput_commit_string (str);
4560 InfoManager::remoteinput_send_key_event (const KeyEvent &key)
4562 return m_impl->remoteinput_send_key_event (key);
4566 InfoManager::remoteinput_forward_key_event (const KeyEvent &key)
4568 return m_impl->remoteinput_forward_key_event (key);
4572 InfoManager::remoteinput_delete_surrounding_text (uint32 offset, uint32 len)
4574 return m_impl->remoteinput_delete_surrounding_text (offset, len);
4577 /////////////////////////////////Message function begin/////////////////////////////////////////
4579 //ISM_TRANS_CMD_PANEL_RESET_KEYBOARD_ISE
4580 bool InfoManager:: reset_keyboard_ise (void)
4582 return m_impl->reset_keyboard_ise ();
4585 //ISM_TRANS_CMD_SHOW_ISF_CONTROL
4586 void InfoManager::show_isf_panel (int client_id)
4588 m_impl->show_isf_panel (client_id);
4591 //ISM_TRANS_CMD_HIDE_ISF_CONTROL
4592 void InfoManager::hide_isf_panel (int client_id)
4594 m_impl->hide_isf_panel (client_id);
4597 //ISM_TRANS_CMD_SHOW_ISE_PANEL
4598 void InfoManager::show_ise_panel (int client_id, uint32 client, uint32 context, char* data, size_t len)
4600 m_impl->show_ise_panel (client_id, client, context, data, len);
4603 //ISM_TRANS_CMD_HIDE_ISE_PANEL
4604 void InfoManager::hide_ise_panel (int client_id, uint32 client, uint32 context)
4606 m_impl->hide_ise_panel (client_id, client, context);
4609 //ISM_TRANS_CMD_HIDE_ISE_PANEL from ISF control
4610 void InfoManager::hide_helper_ise (void)
4612 m_impl->hide_helper_ise ();
4615 //ISM_TRANS_CMD_LAUNCH_ISE from ISF control
4616 void InfoManager::launch_helper_ise (void)
4618 m_impl->launch_helper_ise ();
4621 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
4622 bool InfoManager::process_key_event (KeyEvent& key, uint32 serial)
4624 return m_impl->process_key_event (key, serial);
4627 //ISM_TRANS_CMD_GET_ACTIVE_ISE_GEOMETRY
4628 void InfoManager::get_input_panel_geometry (int client_id, _OUT_ struct rectinfo& info)
4630 m_impl->get_input_panel_geometry (client_id, info);
4633 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
4634 void InfoManager::get_candidate_window_geometry (int client_id, _OUT_ struct rectinfo& info)
4636 m_impl->get_candidate_window_geometry (client_id, info);
4639 //ISM_TRANS_CMD_GET_ISE_LANGUAGE_LOCALE
4640 void InfoManager::get_ise_language_locale (int client_id, _OUT_ char** data, _OUT_ size_t& len)
4642 m_impl->get_ise_language_locale (client_id, data, len);
4645 //ISM_TRANS_CMD_SET_LAYOUT
4646 void InfoManager::set_ise_layout (int client_id, uint32 layout)
4648 m_impl->set_ise_layout (client_id, layout);
4651 //ISM_TRANS_CMD_SET_INPUT_MODE
4652 void InfoManager::set_ise_input_mode (int client_id, uint32 input_mode)
4654 m_impl->set_ise_input_mode (client_id, input_mode);
4657 //ISM_TRANS_CMD_SET_INPUT_HINT
4658 void InfoManager::set_ise_input_hint (int client_id, uint32 input_hint)
4660 m_impl->set_ise_input_hint (client_id, input_hint);
4663 //ISM_TRANS_CMD_UPDATE_BIDI_DIRECTION
4664 void InfoManager::update_ise_bidi_direction (int client_id, uint32 bidi_direction)
4666 m_impl->update_ise_bidi_direction (client_id, bidi_direction);
4670 //ISM_TRANS_CMD_SET_ISE_LANGUAGE
4671 void InfoManager::set_ise_language (int client_id, uint32 language)
4673 m_impl->set_ise_language (client_id, language);
4676 //ISM_TRANS_CMD_SET_ISE_IMDATA
4677 void InfoManager::set_ise_imdata (int client_id, const char* imdata, size_t len)
4679 m_impl->set_ise_imdata (client_id, imdata, len);
4682 //ISM_TRANS_CMD_GET_ISE_IMDATA
4683 bool InfoManager:: get_ise_imdata (int client_id, _OUT_ char** imdata, _OUT_ size_t& len)
4685 return m_impl->get_ise_imdata (client_id, imdata, len);
4688 //ISM_TRANS_CMD_GET_LAYOUT
4689 bool InfoManager:: get_ise_layout (int client_id, _OUT_ uint32& layout)
4691 return m_impl->get_ise_layout (client_id, layout);
4694 //ISM_TRANS_CMD_GET_ISE_STATE
4695 void InfoManager::get_ise_state (int client_id, _OUT_ int& state)
4697 m_impl->get_ise_state (client_id, state);
4700 //ISM_TRANS_CMD_GET_ACTIVE_ISE
4701 void InfoManager::get_active_ise (int client_id, _OUT_ String& default_uuid)
4703 m_impl->get_active_ise (client_id, default_uuid);
4706 //ISM_TRANS_CMD_GET_ISE_LIST
4707 void InfoManager::get_ise_list (int client_id, _OUT_ std::vector<String>& strlist)
4709 m_impl->get_ise_list (client_id, strlist);
4713 //ISM_TRANS_CMD_GET_ALL_HELPER_ISE_INFO
4714 void InfoManager::get_all_helper_ise_info (int client_id, _OUT_ HELPER_ISE_INFO& info)
4716 m_impl->get_all_helper_ise_info (client_id, info);
4719 //ISM_TRANS_CMD_SET_ENABLE_HELPER_ISE_INFO
4720 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4721 void InfoManager::set_enable_helper_ise_info (int client_id, String appid, uint32 is_enabled)
4723 m_impl->set_enable_helper_ise_info (client_id, appid, is_enabled);
4726 //ISM_TRANS_CMD_SHOW_HELPER_ISE_LIST
4727 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4728 void InfoManager::show_helper_ise_list (int client_id)
4730 m_impl->show_helper_ise_list (client_id);
4734 //ISM_TRANS_CMD_SHOW_HELPER_ISE_SELECTOR
4735 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4736 void InfoManager::show_helper_ise_selector (int client_id)
4738 m_impl->show_helper_ise_selector (client_id);
4741 //ISM_TRANS_CMD_IS_HELPER_ISE_ENABLED
4743 void InfoManager::is_helper_ise_enabled (int client_id, String strAppid, _OUT_ uint32& nEnabled)
4745 m_impl->is_helper_ise_enabled (client_id, strAppid, nEnabled);
4748 //ISM_TRANS_CMD_GET_ISE_INFORMATION
4749 void InfoManager::get_ise_information (int client_id, String strUuid, _OUT_ String& strName, _OUT_ String& strLanguage,
4750 _OUT_ int& nType, _OUT_ int& nOption, _OUT_ String& strModuleName)
4752 m_impl->get_ise_information (client_id, strUuid, strName, strLanguage, nType, nOption, strModuleName);
4755 //ISM_TRANS_CMD_RESET_ISE_OPTION
4756 //reply SCIM_TRANS_CMD_OK
4757 bool InfoManager:: reset_ise_option (int client_id)
4759 return m_impl->reset_ise_option (client_id);
4762 //ISM_TRANS_CMD_SET_ACTIVE_ISE_BY_UUID
4764 bool InfoManager:: set_active_ise_by_uuid (int client_id, char* buf, size_t len)
4766 return m_impl->set_active_ise_by_uuid (client_id, buf, len);
4769 //ISM_TRANS_CMD_SET_INITIAL_ISE_BY_UUID
4770 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4771 void InfoManager::set_initial_ise_by_uuid (int client_id, char* buf, size_t len)
4773 m_impl->set_initial_ise_by_uuid (client_id, buf, len);
4776 //ISM_TRANS_CMD_SET_RETURN_KEY_TYPE
4777 void InfoManager::set_ise_return_key_type (int client_id, uint32 type)
4779 m_impl->set_ise_return_key_type (client_id, type);
4782 //ISM_TRANS_CMD_GET_RETURN_KEY_TYPE
4784 bool InfoManager:: get_ise_return_key_type (int client_id, _OUT_ uint32& type)
4786 return m_impl->get_ise_return_key_type (client_id, type);
4790 //ISM_TRANS_CMD_SET_RETURN_KEY_DISABLE
4791 void InfoManager::set_ise_return_key_disable (int client_id, uint32 disabled)
4793 m_impl->set_ise_return_key_disable (client_id, disabled);
4796 //ISM_TRANS_CMD_GET_RETURN_KEY_DISABLE
4797 bool InfoManager::get_ise_return_key_disable (int client_id, _OUT_ uint32& disabled)
4799 return m_impl->get_ise_return_key_disable (client_id, disabled);
4802 //ISM_TRANS_CMD_SET_CAPS_MODE
4803 void InfoManager::set_ise_caps_mode (int client_id, uint32 mode)
4805 m_impl->set_ise_caps_mode (client_id, mode);
4808 //SCIM_TRANS_CMD_RELOAD_CONFIG
4809 void InfoManager::reload_config (void)
4811 m_impl->reload_config ();
4814 //ISM_TRANS_CMD_SEND_WILL_SHOW_ACK
4815 void InfoManager::will_show_ack (int client_id)
4817 m_impl->will_show_ack (client_id);
4820 //ISM_TRANS_CMD_SEND_WILL_HIDE_ACK
4821 void InfoManager::will_hide_ack (int client_id)
4823 m_impl->will_hide_ack (client_id);
4826 //ISM_TRANS_CMD_RESET_DEFAULT_ISE
4827 void InfoManager::reset_default_ise (int client_id)
4829 m_impl->reset_default_ise (client_id);
4832 //ISM_TRANS_CMD_SET_HARDWARE_KEYBOARD_MODE
4833 void InfoManager::set_keyboard_mode (int client_id, uint32 mode)
4835 m_impl->set_keyboard_mode (client_id, mode);
4838 //ISM_TRANS_CMD_SEND_CANDIDATE_WILL_HIDE_ACK
4839 void InfoManager::candidate_will_hide_ack (int client_id)
4841 m_impl->candidate_will_hide_ack (client_id);
4844 //ISM_TRANS_CMD_GET_ACTIVE_HELPER_OPTION
4845 void InfoManager::get_active_helper_option (int client_id, _OUT_ uint32& option)
4847 m_impl->get_active_helper_option (client_id, option);
4850 //ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW
4851 void InfoManager::show_ise_option_window (int client_id)
4853 m_impl->show_ise_option_window (client_id);
4856 //ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW
4857 void InfoManager::resume_ise_option_window (int client_id)
4859 m_impl->resume_ise_option_window (client_id);
4862 //ISM_TRANS_CMD_SET_KEYBOARD_MODE
4863 void InfoManager::set_ise_keyboard_mode (int client_id, uint32 mode)
4865 m_impl->set_ise_keyboard_mode (client_id, mode);
4868 //ISM_TRANS_CMD_SET_PREDICTION_HINT
4869 void InfoManager::set_prediction_hint (int client_id, String prediction_hint)
4871 m_impl->set_prediction_hint (client_id, prediction_hint);
4874 //ISM_TRANS_CMD_SET_MIME_TYPE
4875 void InfoManager::set_ise_mime_type (int client_id, String mime_type)
4877 m_impl->set_ise_mime_type (client_id, mime_type);
4880 //ISM_TRANS_CMD_FINALIZE_CONTENT
4881 void InfoManager::finalize_content (int client_id, String text, uint32 cursor_pos)
4883 m_impl->finalize_content (client_id, text, cursor_pos);
4886 //ISM_TRANS_CMD_SET_PREDICTION_HINT_DATA
4887 void InfoManager::set_prediction_hint_data (int client_id, String key, String value)
4889 m_impl->set_prediction_hint_data (client_id, key, value);
4892 //ISM_TRANS_CMD_EXPAND_CANDIDATE
4893 void InfoManager::expand_candidate ()
4895 m_impl->expand_candidate ();
4898 //ISM_TRANS_CMD_CONTRACT_CANDIDATE
4899 void InfoManager::contract_candidate ()
4901 m_impl->contract_candidate ();
4904 //ISM_TRANS_CMD_GET_RECENT_ISE_GEOMETRY
4905 void InfoManager::get_recent_ise_geometry (int client_id, uint32 angle, _OUT_ struct rectinfo& info)
4907 m_impl->get_recent_ise_geometry (client_id, angle, info);
4910 //ISM_TRANS_CMD_SEND_REMOTE_INPUT_MESSAGE
4911 bool InfoManager::remoteinput_send_input_message (int client_id, char* buf, size_t len)
4913 return m_impl->send_remote_input_message (client_id, buf, len);
4916 void InfoManager::remoteinput_send_surrounding_text (const char* text, uint32 cursor)
4918 return m_impl->send_remote_surrounding_text (text, cursor);
4921 //ISM_TRANS_CMD_REGISTER_PANEL_CLIENT
4922 void InfoManager::register_panel_client (uint32 client_id, uint32 id)
4924 m_impl->register_panel_client (client_id, id);
4927 //SCIM_TRANS_CMD_PANEL_REGISTER_INPUT_CONTEXT
4928 void InfoManager::register_input_context (uint32 client_id, uint32 context, String uuid)
4930 m_impl->register_input_context (client_id, context, uuid);
4933 //SCIM_TRANS_CMD_PANEL_REMOVE_INPUT_CONTEXT
4934 void InfoManager::remove_input_context (uint32 client_id, uint32 context)
4936 m_impl->remove_input_context (client_id, context);
4939 //SCIM_TRANS_CMD_PANEL_RESET_INPUT_CONTEXT
4940 void InfoManager::socket_reset_input_context (int client_id, uint32 context)
4942 m_impl->socket_reset_input_context (client_id, context);
4945 //SCIM_TRANS_CMD_FOCUS_IN
4946 void InfoManager::focus_in (int client_id, uint32 context, String uuid)
4948 m_impl->focus_in (client_id, context, uuid);
4951 //SCIM_TRANS_CMD_FOCUS_OUT
4952 void InfoManager::focus_out (int client_id, uint32 context)
4954 m_impl->focus_out (client_id, context);
4957 //ISM_TRANS_CMD_PROCESS_INPUT_DEVICE_EVENT
4958 bool InfoManager::process_input_device_event(int client, uint32 type, const char *data, size_t len, _OUT_ uint32& result)
4960 return m_impl->process_input_device_event(client, type, data, len, result);
4963 //ISM_TRANS_CMD_TURN_ON_LOG
4964 void InfoManager::socket_turn_on_log (uint32 isOn)
4966 m_impl->socket_turn_on_log (isOn);
4969 //SCIM_TRANS_CMD_PANEL_TURN_ON
4970 void InfoManager::socket_turn_on (void)
4972 m_impl->socket_turn_on ();
4975 //SCIM_TRANS_CMD_PANEL_TURN_OFF
4976 void InfoManager::socket_turn_off (void)
4978 m_impl->socket_turn_off ();
4981 //SCIM_TRANS_CMD_UPDATE_SCREEN
4982 void InfoManager::socket_update_screen (int client_id, uint32 num)
4984 m_impl->socket_update_screen (client_id, num);
4987 //SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
4988 void InfoManager::socket_update_spot_location (uint32 x, uint32 y, uint32 top_y)
4990 m_impl->socket_update_spot_location (x, y, top_y);
4993 //ISM_TRANS_CMD_UPDATE_CURSOR_POSITION
4994 void InfoManager::socket_update_cursor_position (uint32 cursor_pos)
4996 m_impl->socket_update_cursor_position (cursor_pos);
4999 //ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT
5000 void InfoManager::socket_update_surrounding_text (String text, uint32 cursor)
5002 m_impl->socket_update_surrounding_text (text, cursor);
5005 void InfoManager::remoteinput_callback_focus_in (void)
5007 m_impl->remoteinput_callback_focus_in ();
5010 void InfoManager::remoteinput_callback_focus_out (void)
5012 m_impl->remoteinput_callback_focus_out ();
5015 void InfoManager::remoteinput_callback_entry_metadata (uint32 hint, uint32 layout, int variation, uint32 autocapital_type, int return_key_disabled)
5017 m_impl->remoteinput_callback_entry_metadata (hint, layout, variation, autocapital_type, return_key_disabled);
5020 void InfoManager::remoteinput_callback_surrounding_text (String text, uint32 cursor)
5022 m_impl->remoteinput_callback_surrounding_text (text, cursor);
5025 void InfoManager::remoteinput_callback_input_resource (uint32 input_resource)
5027 m_impl->remoteinput_callback_input_resource (input_resource);
5030 //ISM_TRANS_CMD_UPDATE_SELECTION
5031 void InfoManager::socket_update_selection (String text)
5033 m_impl->socket_update_selection (text);
5036 //FIXME: useless anymore
5037 //SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO
5038 void InfoManager::socket_update_factory_info (PanelFactoryInfo& info)
5040 m_impl->socket_update_factory_info (info);
5043 //SCIM_TRANS_CMD_PANEL_SHOW_HELP
5044 void InfoManager::socket_show_help (String help)
5046 m_impl->socket_show_help (help);
5049 //SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU
5050 void InfoManager::socket_show_factory_menu (std::vector <PanelFactoryInfo>& vec)
5052 m_impl->socket_show_factory_menu (vec);
5055 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
5056 void InfoManager::socket_show_preedit_string (void)
5058 m_impl->socket_show_preedit_string ();
5061 //SCIM_TRANS_CMD_SHOW_AUX_STRING
5062 void InfoManager::socket_show_aux_string (void)
5064 m_impl->socket_show_aux_string ();
5067 //SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE
5068 void InfoManager::socket_show_lookup_table (void)
5070 m_impl->socket_show_lookup_table ();
5073 //ISM_TRANS_CMD_SHOW_ASSOCIATE_TABLE
5074 void InfoManager::socket_show_associate_table (void)
5076 m_impl->socket_show_associate_table ();
5079 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
5080 void InfoManager::socket_hide_preedit_string (void)
5082 m_impl->socket_hide_preedit_string ();
5085 //SCIM_TRANS_CMD_HIDE_AUX_STRING
5086 void InfoManager::socket_hide_aux_string (void)
5088 m_impl->socket_hide_aux_string ();
5091 //SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE
5092 void InfoManager::socket_hide_lookup_table (void)
5094 m_impl->socket_hide_lookup_table ();
5097 //ISM_TRANS_CMD_HIDE_ASSOCIATE_TABLE
5098 void InfoManager::socket_hide_associate_table (void)
5100 m_impl->socket_hide_associate_table ();
5103 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
5104 void InfoManager::socket_update_preedit_string (String& str, const AttributeList& attrs, uint32 caret)
5106 m_impl->socket_update_preedit_string (str, attrs, caret);
5109 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
5110 void InfoManager::socket_update_preedit_caret (uint32 caret)
5112 m_impl->socket_update_preedit_caret (caret);
5115 //ISM_TRANS_CMD_RECAPTURE_STRING
5116 void InfoManager::socket_recapture_string (int offset, int len, String& preedit, String& commit, const AttributeList& attrs)
5118 m_impl->socket_recapture_string (offset, len, preedit, commit, attrs);
5121 //SCIM_TRANS_CMD_UPDATE_AUX_STRING
5122 void InfoManager::socket_update_aux_string (String& str, const AttributeList& attrs)
5124 m_impl->socket_update_aux_string (str, attrs);
5127 //SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE
5128 void InfoManager::socket_update_lookup_table (const LookupTable& table)
5130 m_impl->socket_update_lookup_table (table);
5133 //ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE
5134 void InfoManager::socket_update_associate_table (const LookupTable& table)
5136 m_impl->socket_update_associate_table (table);
5139 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
5140 void InfoManager::socket_register_properties (const PropertyList& properties)
5142 m_impl->socket_register_properties (properties);
5145 //SCIM_TRANS_CMD_UPDATE_PROPERTY
5146 void InfoManager::socket_update_property (const Property& property)
5148 m_impl->socket_update_property (property);
5151 //ISM_TRANS_CMD_GET_KEYBOARD_ISE_LIST
5152 void InfoManager::socket_get_keyboard_ise_list (String& uuid)
5154 m_impl->socket_get_keyboard_ise_list (uuid);
5157 //ISM_TRANS_CMD_SET_CANDIDATE_UI
5158 void InfoManager::socket_set_candidate_ui (uint32 portrait_line, uint32 mode)
5160 m_impl->socket_set_candidate_ui (portrait_line, mode);
5163 //ISM_TRANS_CMD_GET_CANDIDATE_UI
5164 void InfoManager::socket_get_candidate_ui (String uuid)
5166 m_impl->socket_get_candidate_ui (uuid);
5169 //ISM_TRANS_CMD_SET_CANDIDATE_POSITION
5170 void InfoManager::socket_set_candidate_position (uint32 left, uint32 top)
5172 m_impl->socket_set_candidate_position (left, top);
5175 //ISM_TRANS_CMD_HIDE_CANDIDATE
5176 void InfoManager::socket_hide_candidate (void)
5178 m_impl->socket_hide_candidate ();
5181 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
5182 void InfoManager::socket_get_candidate_geometry (String& uuid)
5184 m_impl->socket_get_candidate_geometry (uuid);
5187 //ISM_TRANS_CMD_SET_KEYBOARD_ISE_BY_UUID
5188 void InfoManager::socket_set_keyboard_ise (String uuid)
5190 m_impl->socket_set_keyboard_ise (uuid);
5193 //ISM_TRANS_CMD_SELECT_CANDIDATE
5194 void InfoManager::socket_helper_select_candidate (uint32 index)
5196 m_impl->socket_helper_select_candidate (index);
5199 //ISM_TRANS_CMD_UPDATE_ISE_GEOMETRY
5200 void InfoManager::socket_helper_update_ise_geometry (int client, uint32 x, uint32 y, uint32 width, uint32 height)
5202 m_impl->socket_helper_update_ise_geometry (client, x, y, width, height);
5205 //ISM_TRANS_CMD_GET_KEYBOARD_ISE
5206 void InfoManager::socket_get_keyboard_ise (String uuid)
5208 m_impl->socket_get_keyboard_ise (uuid);
5211 //SCIM_TRANS_CMD_START_HELPER
5212 void InfoManager::socket_start_helper (int client_id, uint32 context, String uuid)
5214 m_impl->socket_start_helper (client_id, context, uuid);
5217 //SCIM_TRANS_CMD_STOP_HELPER
5218 void InfoManager::socket_stop_helper (int client_id, uint32 context, String uuid)
5220 m_impl->socket_stop_helper (client_id, context, uuid);
5223 //SCIM_TRANS_CMD_SEND_HELPER_EVENT
5224 void InfoManager::socket_send_helper_event (int client_id, uint32 context, String uuid, const Transaction& _nest_trans)
5226 m_impl->socket_send_helper_event (client_id, context, uuid, _nest_trans);
5229 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
5230 void InfoManager::socket_helper_register_properties (int client, PropertyList& properties)
5232 m_impl->socket_helper_register_properties (client, properties);
5235 //SCIM_TRANS_CMD_UPDATE_PROPERTY
5236 void InfoManager::socket_helper_update_property (int client, Property& property)
5238 m_impl->socket_helper_update_property (client, property);
5241 //SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT
5242 void InfoManager::socket_helper_send_imengine_event (int client, uint32 target_ic, String target_uuid , Transaction& nest_trans)
5244 m_impl->socket_helper_send_imengine_event (client, target_ic, target_uuid, nest_trans);
5247 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
5248 //SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT
5249 void InfoManager::socket_helper_send_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key)
5251 m_impl->socket_helper_send_key_event (client, target_ic, target_uuid, key);
5254 //SCIM_TRANS_CMD_FORWARD_KEY_EVENT
5255 void InfoManager::socket_helper_forward_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key)
5257 m_impl->socket_helper_forward_key_event (client, target_ic, target_uuid, key);
5260 //SCIM_TRANS_CMD_COMMIT_STRING
5261 void InfoManager::socket_helper_commit_string (int client, uint32 target_ic, String target_uuid, WideString wstr)
5263 m_impl->socket_helper_commit_string (client, target_ic, target_uuid, wstr);
5266 //SCIM_TRANS_CMD_GET_SURROUNDING_TEXT
5267 void InfoManager::socket_helper_get_surrounding_text (int client, String uuid, uint32 maxlen_before, uint32 maxlen_after)
5269 m_impl->socket_helper_get_surrounding_text (client, uuid, maxlen_before, maxlen_after);
5272 //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT
5273 void InfoManager::socket_helper_delete_surrounding_text (int client, uint32 offset, uint32 len)
5275 m_impl->socket_helper_delete_surrounding_text (client, offset, len);
5278 //SCIM_TRANS_CMD_GET_SELECTION
5279 void InfoManager::socket_helper_get_selection (int client, String uuid)
5281 m_impl->socket_helper_get_selection (client, uuid);
5284 //SCIM_TRANS_CMD_SET_SELECTION
5285 void InfoManager::socket_helper_set_selection (int client, uint32 start, uint32 end)
5287 m_impl->socket_helper_set_selection (client, start, end);
5290 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
5291 void InfoManager::socket_helper_show_preedit_string (int client, uint32 target_ic, String target_uuid)
5293 m_impl->socket_helper_show_preedit_string (client, target_ic, target_uuid);
5296 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
5297 void InfoManager::socket_helper_hide_preedit_string (int client, uint32 target_ic, String target_uuid)
5299 m_impl->socket_helper_hide_preedit_string (client, target_ic, target_uuid);
5302 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
5303 void InfoManager::socket_helper_update_preedit_string (int client, uint32 target_ic, String target_uuid, WideString preedit,
5304 WideString commit, AttributeList& attrs, uint32 caret)
5306 m_impl->socket_helper_update_preedit_string (client, target_ic, target_uuid, preedit, commit, attrs, caret);
5309 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
5310 void InfoManager::socket_helper_update_preedit_caret (int client, uint32 caret)
5312 m_impl->socket_helper_update_preedit_caret (client, caret);
5315 //ISM_TRANS_CMD_RECAPTURE_STRING
5316 void InfoManager::socket_helper_recapture_string (int client, uint32 target_ic, String target_uuid, int offset, int len, WideString preedit,
5317 WideString commit, AttributeList& attrs)
5319 m_impl->socket_helper_recapture_string (client, target_ic, target_uuid, offset, len, preedit, commit, attrs);
5322 //SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
5323 void InfoManager::socket_helper_register_helper (int client, HelperInfo& info)
5325 m_impl->socket_helper_register_helper (client, info);
5328 //SCIM_TRANS_CMD_PANEL_REGISTER_ACTIVE_HELPER
5329 void InfoManager::socket_helper_register_helper_passive (int client, HelperInfo& info)
5331 m_impl->socket_helper_register_helper_passive (client, info);
5334 //ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
5335 void InfoManager::socket_helper_update_input_context (int client, uint32 type, uint32 value)
5337 m_impl->socket_helper_update_input_context (client, type, value);
5340 //ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE
5341 void InfoManager::socket_helper_update_language_locale(int client, String locale)
5343 m_impl->socket_helper_update_language_locale(client, locale);
5346 //SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
5347 void InfoManager::socket_helper_send_private_command (int client, String command)
5349 m_impl->socket_helper_send_private_command (client, command);
5352 //SCIM_TRANS_CMD_COMMIT_CONTENT
5353 void InfoManager::socket_helper_commit_content (int client, String content, String description, String mime_types)
5355 m_impl->socket_helper_commit_content (client, content, description, mime_types);
5358 //ISM_TRANS_CMD_UPDATE_ISE_EXIT
5359 //void InfoManager::UPDATE_ISE_EXIT (int client)
5361 // m_impl->UPDATE_ISE_EXIT (client);
5364 //ISM_TRANS_CMD_PROCESS_KEY_EVENT_DONE
5365 void InfoManager::process_key_event_done (KeyEvent &key, uint32 ret, uint32 serial)
5367 m_impl->process_key_event_done (key, ret, serial);
5370 //ISM_TRANS_CMD_REQUEST_ISE_HIDE
5371 void InfoManager::request_ise_hide ()
5373 m_impl->request_ise_hide ();
5376 bool InfoManager::check_privilege_by_sockfd (int client_id, const String& privilege) {
5377 return m_impl->check_privilege_by_sockfd (client_id, privilege);
5380 void InfoManager::add_client (int client_id, uint32 key, ClientType type)
5382 m_impl->add_client (client_id, key, type);
5385 void InfoManager::del_client (int client_id)
5387 m_impl->del_client (client_id);
5390 bool InfoManager::set_autocapital_type (int mode)
5392 return m_impl->set_autocapital_type (mode);
5395 void InfoManager::set_prediction_allow (int client, bool mode)
5397 m_impl->set_prediction_allow (client, mode);
5400 void InfoManager::reshow_input_panel ()
5402 m_impl->reshow_input_panel ();
5405 //////////////////////////////////Message function end/////////////////////////////////////////
5408 InfoManager::signal_connect_turn_on (InfoManagerSlotVoid* slot)
5410 return m_impl->signal_connect_turn_on (slot);
5414 InfoManager::signal_connect_turn_off (InfoManagerSlotVoid* slot)
5416 return m_impl->signal_connect_turn_off (slot);
5420 InfoManager::signal_connect_show_panel (InfoManagerSlotVoid* slot)
5422 return m_impl->signal_connect_show_panel (slot);
5426 InfoManager::signal_connect_hide_panel (InfoManagerSlotVoid* slot)
5428 return m_impl->signal_connect_hide_panel (slot);
5432 InfoManager::signal_connect_update_screen (InfoManagerSlotInt* slot)
5434 return m_impl->signal_connect_update_screen (slot);
5438 InfoManager::signal_connect_update_spot_location (InfoManagerSlotIntIntInt* slot)
5440 return m_impl->signal_connect_update_spot_location (slot);
5444 InfoManager::signal_connect_update_factory_info (InfoManagerSlotFactoryInfo* slot)
5446 return m_impl->signal_connect_update_factory_info (slot);
5450 InfoManager::signal_connect_start_default_ise (InfoManagerSlotVoid* slot)
5452 return m_impl->signal_connect_start_default_ise (slot);
5456 InfoManager::signal_connect_stop_default_ise (InfoManagerSlotVoid* slot)
5458 return m_impl->signal_connect_stop_default_ise (slot);
5462 InfoManager::signal_connect_set_candidate_ui (InfoManagerSlotIntInt* slot)
5464 return m_impl->signal_connect_set_candidate_ui (slot);
5468 InfoManager::signal_connect_get_candidate_ui (InfoManagerSlotIntInt2* slot)
5470 return m_impl->signal_connect_get_candidate_ui (slot);
5474 InfoManager::signal_connect_set_candidate_position (InfoManagerSlotIntInt* slot)
5476 return m_impl->signal_connect_set_candidate_position (slot);
5480 InfoManager::signal_connect_get_candidate_geometry (InfoManagerSlotRect* slot)
5482 return m_impl->signal_connect_get_candidate_geometry (slot);
5486 InfoManager::signal_connect_get_input_panel_geometry (InfoManagerSlotRect* slot)
5488 return m_impl->signal_connect_get_input_panel_geometry (slot);
5492 InfoManager::signal_connect_set_keyboard_ise (InfoManagerSlotString* slot)
5494 return m_impl->signal_connect_set_keyboard_ise (slot);
5498 InfoManager::signal_connect_get_keyboard_ise (InfoManagerSlotString2* slot)
5500 return m_impl->signal_connect_get_keyboard_ise (slot);
5504 InfoManager::signal_connect_show_help (InfoManagerSlotString* slot)
5506 return m_impl->signal_connect_show_help (slot);
5510 InfoManager::signal_connect_show_factory_menu (InfoManagerSlotFactoryInfoVector* slot)
5512 return m_impl->signal_connect_show_factory_menu (slot);
5516 InfoManager::signal_connect_show_preedit_string (InfoManagerSlotVoid* slot)
5518 return m_impl->signal_connect_show_preedit_string (slot);
5522 InfoManager::signal_connect_show_aux_string (InfoManagerSlotVoid* slot)
5524 return m_impl->signal_connect_show_aux_string (slot);
5528 InfoManager::signal_connect_show_lookup_table (InfoManagerSlotVoid* slot)
5530 return m_impl->signal_connect_show_lookup_table (slot);
5534 InfoManager::signal_connect_show_associate_table (InfoManagerSlotVoid* slot)
5536 return m_impl->signal_connect_show_associate_table (slot);
5540 InfoManager::signal_connect_hide_preedit_string (InfoManagerSlotVoid* slot)
5542 return m_impl->signal_connect_hide_preedit_string (slot);
5546 InfoManager::signal_connect_hide_aux_string (InfoManagerSlotVoid* slot)
5548 return m_impl->signal_connect_hide_aux_string (slot);
5552 InfoManager::signal_connect_hide_lookup_table (InfoManagerSlotVoid* slot)
5554 return m_impl->signal_connect_hide_lookup_table (slot);
5558 InfoManager::signal_connect_hide_associate_table (InfoManagerSlotVoid* slot)
5560 return m_impl->signal_connect_hide_associate_table (slot);
5564 InfoManager::signal_connect_update_preedit_string (InfoManagerSlotAttributeStringInt* slot)
5566 return m_impl->signal_connect_update_preedit_string (slot);
5570 InfoManager::signal_connect_update_preedit_caret (InfoManagerSlotInt* slot)
5572 return m_impl->signal_connect_update_preedit_caret (slot);
5576 InfoManager::signal_connect_update_aux_string (InfoManagerSlotAttributeString* slot)
5578 return m_impl->signal_connect_update_aux_string (slot);
5582 InfoManager::signal_connect_update_lookup_table (InfoManagerSlotLookupTable* slot)
5584 return m_impl->signal_connect_update_lookup_table (slot);
5588 InfoManager::signal_connect_update_associate_table (InfoManagerSlotLookupTable* slot)
5590 return m_impl->signal_connect_update_associate_table (slot);
5594 InfoManager::signal_connect_register_properties (InfoManagerSlotPropertyList* slot)
5596 return m_impl->signal_connect_register_properties (slot);
5600 InfoManager::signal_connect_update_property (InfoManagerSlotProperty* slot)
5602 return m_impl->signal_connect_update_property (slot);
5606 InfoManager::signal_connect_register_helper_properties (InfoManagerSlotIntPropertyList* slot)
5608 return m_impl->signal_connect_register_helper_properties (slot);
5612 InfoManager::signal_connect_update_helper_property (InfoManagerSlotIntProperty* slot)
5614 return m_impl->signal_connect_update_helper_property (slot);
5618 InfoManager::signal_connect_register_helper (InfoManagerSlotIntHelperInfo* slot)
5620 return m_impl->signal_connect_register_helper (slot);
5624 InfoManager::signal_connect_remove_helper (InfoManagerSlotInt* slot)
5626 return m_impl->signal_connect_remove_helper (slot);
5630 InfoManager::signal_connect_set_active_ise_by_uuid (InfoManagerSlotStringBool* slot)
5632 return m_impl->signal_connect_set_active_ise_by_uuid (slot);
5636 InfoManager::signal_connect_focus_in (InfoManagerSlotVoid* slot)
5638 return m_impl->signal_connect_focus_in (slot);
5642 InfoManager::signal_connect_focus_out (InfoManagerSlotVoid* slot)
5644 return m_impl->signal_connect_focus_out (slot);
5648 InfoManager::signal_connect_expand_candidate (InfoManagerSlotVoid* slot)
5650 return m_impl->signal_connect_expand_candidate (slot);
5654 InfoManager::signal_connect_contract_candidate (InfoManagerSlotVoid* slot)
5656 return m_impl->signal_connect_contract_candidate (slot);
5660 InfoManager::signal_connect_select_candidate (InfoManagerSlotInt* slot)
5662 return m_impl->signal_connect_select_candidate (slot);
5666 InfoManager::signal_connect_get_ise_list (InfoManagerSlotBoolStringVector* slot)
5668 return m_impl->signal_connect_get_ise_list (slot);
5672 InfoManager::signal_connect_get_all_helper_ise_info (InfoManagerSlotBoolHelperInfo* slot)
5674 return m_impl->signal_connect_get_all_helper_ise_info (slot);
5678 InfoManager::signal_connect_set_has_option_helper_ise_info (InfoManagerSlotStringBool* slot)
5680 return m_impl->signal_connect_set_has_option_helper_ise_info (slot);
5684 InfoManager::signal_connect_set_enable_helper_ise_info (InfoManagerSlotStringBool* slot)
5686 return m_impl->signal_connect_set_enable_helper_ise_info (slot);
5690 InfoManager::signal_connect_show_helper_ise_list (InfoManagerSlotVoid* slot)
5692 return m_impl->signal_connect_show_helper_ise_list (slot);
5696 InfoManager::signal_connect_show_helper_ise_selector (InfoManagerSlotVoid* slot)
5698 return m_impl->signal_connect_show_helper_ise_selector (slot);
5702 InfoManager::signal_connect_is_helper_ise_enabled (InfoManagerSlotStringInt* slot)
5704 return m_impl->signal_connect_is_helper_ise_enabled (slot);
5708 InfoManager::signal_connect_get_ise_information (InfoManagerSlotBoolString4int2* slot)
5710 return m_impl->signal_connect_get_ise_information (slot);
5714 InfoManager::signal_connect_get_keyboard_ise_list (InfoManagerSlotBoolStringVector* slot)
5716 return m_impl->signal_connect_get_keyboard_ise_list (slot);
5720 InfoManager::signal_connect_update_ise_geometry (InfoManagerSlotIntIntIntInt* slot)
5722 return m_impl->signal_connect_update_ise_geometry (slot);
5726 InfoManager::signal_connect_get_language_list (InfoManagerSlotStringVector* slot)
5728 return m_impl->signal_connect_get_language_list (slot);
5732 InfoManager::signal_connect_get_all_language (InfoManagerSlotStringVector* slot)
5734 return m_impl->signal_connect_get_all_language (slot);
5738 InfoManager::signal_connect_get_ise_language (InfoManagerSlotStrStringVector* slot)
5740 return m_impl->signal_connect_get_ise_language (slot);
5744 InfoManager::signal_connect_get_ise_info_by_uuid (InfoManagerSlotStringISEINFO* slot)
5746 return m_impl->signal_connect_get_ise_info_by_uuid (slot);
5750 InfoManager::signal_connect_send_key_event (InfoManagerSlotKeyEvent* slot)
5752 return m_impl->signal_connect_send_key_event (slot);
5756 InfoManager::signal_connect_accept_connection (InfoManagerSlotInt* slot)
5758 return m_impl->signal_connect_accept_connection (slot);
5762 InfoManager::signal_connect_close_connection (InfoManagerSlotInt* slot)
5764 return m_impl->signal_connect_close_connection (slot);
5768 InfoManager::signal_connect_exit (InfoManagerSlotVoid* slot)
5770 return m_impl->signal_connect_exit (slot);
5774 InfoManager::signal_connect_transaction_start (InfoManagerSlotVoid* slot)
5776 return m_impl->signal_connect_transaction_start (slot);
5780 InfoManager::signal_connect_transaction_end (InfoManagerSlotVoid* slot)
5782 return m_impl->signal_connect_transaction_end (slot);
5786 InfoManager::signal_connect_lock (InfoManagerSlotVoid* slot)
5788 return m_impl->signal_connect_lock (slot);
5792 InfoManager::signal_connect_unlock (InfoManagerSlotVoid* slot)
5794 return m_impl->signal_connect_unlock (slot);
5798 InfoManager::signal_connect_update_input_context (InfoManagerSlotIntInt* slot)
5800 return m_impl->signal_connect_update_input_context (slot);
5804 InfoManager::signal_connect_show_ise (InfoManagerSlotVoid* slot)
5806 return m_impl->signal_connect_show_ise (slot);
5810 InfoManager::signal_connect_hide_ise (InfoManagerSlotVoid* slot)
5812 return m_impl->signal_connect_hide_ise (slot);
5816 InfoManager::signal_connect_will_show_ack (InfoManagerSlotVoid* slot)
5818 return m_impl->signal_connect_will_show_ack (slot);
5822 InfoManager::signal_connect_will_hide_ack (InfoManagerSlotVoid* slot)
5824 return m_impl->signal_connect_will_hide_ack (slot);
5828 InfoManager::signal_connect_set_keyboard_mode (InfoManagerSlotInt* slot)
5830 return m_impl->signal_connect_set_keyboard_mode (slot);
5834 InfoManager::signal_connect_candidate_will_hide_ack (InfoManagerSlotVoid* slot)
5836 return m_impl->signal_connect_candidate_will_hide_ack (slot);
5840 InfoManager::signal_connect_get_ise_state (InfoManagerSlotInt2* slot)
5842 return m_impl->signal_connect_get_ise_state (slot);
5846 InfoManager::signal_connect_run_helper (InfoManagerSlotString3* slot)
5848 return m_impl->signal_connect_run_helper (slot);
5852 InfoManager::signal_connect_launch_option_application (InfoManagerSlotBoolString* slot)
5854 return m_impl->signal_connect_launch_option_application (slot);
5858 InfoManager::signal_connect_get_recent_ise_geometry (InfoManagerSlotIntRect* slot)
5860 return m_impl->signal_connect_get_recent_ise_geometry (slot);
5864 InfoManager::signal_connect_check_privilege_by_sockfd (InfoManagerSlotIntString2* slot)
5866 return m_impl->signal_connect_check_privilege_by_sockfd (slot);
5870 InfoManager::signal_connect_remoteinput_send_input_message (InfoManagerSlotStringBool* slot)
5872 return m_impl->signal_connect_remoteinput_send_input_message (slot);
5876 InfoManager::signal_connect_remoteinput_send_surrounding_text (InfoManagerSlotIntString* slot)
5878 return m_impl->signal_connect_remoteinput_send_surrounding_text (slot);
5881 } /* namespace scim */
5884 vi:ts=4:nowrap:ai:expandtab