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"
71 #include "ise_context.h"
76 #define LOG_TAG "ISF_PANEL_EFL"
78 #define MIN_REPEAT_TIME 2.0
84 InfoManagerSignalVoid;
86 typedef Signal1<void, int>
89 typedef Signal1<void, int&>
90 InfoManagerSignalInt2;
92 typedef Signal1<void, const String&>
93 InfoManagerSignalString;
95 typedef Signal2<void, const String&, bool>
96 InfoManagerSignalStringBool;
98 typedef Signal2<void, String&, String&>
99 InfoManagerSignalString2;
101 typedef Signal2<void, int, const String&>
102 InfoManagerSignalIntString;
104 typedef Signal1<void, const PanelFactoryInfo&>
105 InfoManagerSignalFactoryInfo;
107 typedef Signal1<void, const std::vector <PanelFactoryInfo> &>
108 InfoManagerSignalFactoryInfoVector;
110 typedef Signal1<void, const LookupTable&>
111 InfoManagerSignalLookupTable;
113 typedef Signal1<void, const Property&>
114 InfoManagerSignalProperty;
116 typedef Signal1<void, const PropertyList&>
117 InfoManagerSignalPropertyList;
119 typedef Signal2<void, int, int>
120 InfoManagerSignalIntInt;
122 typedef Signal2<void, int&, int&>
123 InfoManagerSignalIntInt2;
125 typedef Signal3<void, int, int, int>
126 InfoManagerSignalIntIntInt;
128 typedef Signal3<void, const String &, const String &, const String &>
129 InfoManagerSignalString3;
131 typedef Signal4<void, int, int, int, int>
132 InfoManagerSignalIntIntIntInt;
134 typedef Signal2<void, int, const Property&>
135 InfoManagerSignalIntProperty;
137 typedef Signal2<void, int, const PropertyList&>
138 InfoManagerSignalIntPropertyList;
140 typedef Signal2<void, int, const HelperInfo&>
141 InfoManagerSignalIntHelperInfo;
143 typedef Signal3<void, const String&, const AttributeList&, int>
144 InfoManagerSignalAttributeStringInt;
146 typedef Signal5<void, int, int, const String&, const String&, const AttributeList&>
147 InfoManagerSignalAttributeInt2String2;
149 typedef Signal2<void, const String&, const AttributeList&>
150 InfoManagerSignalAttributeString;
152 typedef Signal1<void, std::vector <String> &>
153 InfoManagerSignalStringVector;
155 typedef Signal1<bool, HELPER_ISE_INFO&>
156 InfoManagerSignalBoolHelperInfo;
158 typedef Signal1<bool, std::vector <String> &>
159 InfoManagerSignalBoolStringVector;
161 typedef Signal2<void, char*, std::vector <String> &>
162 InfoManagerSignalStrStringVector;
164 typedef Signal2<bool, const String&, ISE_INFO&>
165 InfoManagerSignalStringISEINFO;
167 typedef Signal2<bool, String, int&>
168 InfoManagerSignalStringInt;
170 typedef Signal1<void, const KeyEvent&>
171 InfoManagerSignalKeyEvent;
173 typedef Signal1<void, struct rectinfo&>
174 InfoManagerSignalRect;
176 typedef Signal6<bool, String, String&, String&, int&, int&, String&>
177 InfoManagerSignalBoolString4int2;
179 typedef Signal2<void, int, struct rectinfo&>
180 InfoManagerSignalIntRect;
182 typedef Signal2<bool, int, String>
183 InfoManagerSignalIntString2;
185 typedef Signal1<bool, String>
186 InfoManagerSignalBoolString;
188 typedef Signal1<void, bool>
189 InfoManagerSignalBool;
191 struct HelperClientStub {
195 HelperClientStub (int i = 0, int r = 0) : id (i), ref (r) { }
198 struct IMControlStub {
199 std::vector<ISE_INFO> info;
200 std::vector<int> count;
203 #define DEFAULT_CONTEXT_VALUE 0xfff
205 #if SCIM_USE_STL_EXT_HASH_MAP
206 typedef __gnu_cxx::hash_map <int, ClientInfo, __gnu_cxx::hash <int> > ClientRepository;
207 typedef __gnu_cxx::hash_map <int, HelperInfo, __gnu_cxx::hash <int> > HelperInfoRepository;
208 typedef __gnu_cxx::hash_map <uint32, String, __gnu_cxx::hash <unsigned int> > ClientContextUUIDRepository;
209 typedef __gnu_cxx::hash_map <String, HelperClientStub, scim_hash_string> HelperClientIndex;
210 typedef __gnu_cxx::hash_map <String, std::vector < std::pair <uint32, String> >, scim_hash_string> StartHelperICIndex;
211 #elif SCIM_USE_STL_HASH_MAP
212 typedef std::hash_map <int, ClientInfo, std::hash <int> > ClientRepository;
213 typedef std::hash_map <int, HelperInfo, std::hash <int> > HelperInfoRepository;
214 typedef std::hash_map <uint32, String, std::hash <unsigned int> > ClientContextUUIDRepository;
215 typedef std::hash_map <String, HelperClientStub, scim_hash_string> HelperClientIndex;
216 typedef std::hash_map <String, std::vector < std::pair <uint32, String> >, scim_hash_string> StartHelperICIndex;
218 typedef std::map <int, ClientInfo> ClientRepository;
219 typedef std::map <int, HelperInfo> HelperInfoRepository;
220 typedef std::map <uint32, String> ClientContextUUIDRepository;
221 typedef std::map <String, HelperClientStub> HelperClientIndex;
222 typedef std::map <String, std::vector < std::pair <uint32, String> > > StartHelperICIndex;
225 typedef std::map <String, uint32> UUIDCountRepository;
226 typedef std::map <String, enum HelperState> UUIDStateRepository;
227 typedef std::map <String, int> StringIntRepository;
228 typedef std::map <int, struct IMControlStub> IMControlRepository;
229 typedef std::map <int, int> IntIntRepository;
232 get_helper_ic (int client, uint32 context)
234 return (uint32) (client & 0xFFFF) | ((context & 0x7FFF) << 16);
238 get_imengine_client_context (uint32 helper_ic, int& client, uint32& context)
240 client = (int) (helper_ic & 0xFFFF);
241 context = ((helper_ic >> 16) & 0x7FFF);
245 clients_equal (int first, int second)
247 return ((first & 0xFFFF) == (second & 0xFFFF));
251 contexts_equal (uint32 first, uint32 second)
253 return ((first & 0x7FFF) == (second & 0x7FFF));
256 //==================================== InfoManager ===========================
257 class InfoManager::InfoManagerImpl
259 int m_current_screen;
261 String m_config_name;
262 String m_display_name;
264 int m_current_socket_client;
265 uint32 m_current_client_context;
266 String m_current_context_uuid;
267 TOOLBAR_MODE_T m_current_toolbar_mode;
268 uint32 m_current_helper_option;
269 String m_current_helper_uuid;
270 String m_last_helper_uuid;
271 String m_current_ise_name;
272 int m_pending_active_imcontrol_id;
273 int m_show_request_client_id;
274 int m_active_client_id;
275 IntIntRepository m_panel_client_map;
276 IntIntRepository m_imcontrol_map;
277 bool m_should_shared_ise;
279 bool m_is_imengine_aux;
280 bool m_is_imengine_candidate;
281 bool m_refocus_needed;
282 bool m_reshow_needed;
283 bool m_restart_needed;
285 std::vector<int> m_current_send_remoteinput_id;
286 std::vector<int> m_current_recv_remoteinput_id;
288 int m_last_socket_client;
289 uint32 m_last_client_context;
290 String m_last_context_uuid;
292 char* m_ise_context_buffer;
293 size_t m_ise_context_length;
294 char* m_imdata_buffer;
295 size_t m_imdata_length;
297 ClientRepository m_client_repository;
299 * Each Helper ISE has two socket connect between InfoManager and HelperAgent.
300 * m_helper_info_repository records the active connection.
301 * m_helper_active_info_repository records the passive connection.
303 HelperInfoRepository m_helper_info_repository;
304 HelperInfoRepository m_helper_active_info_repository;
305 HelperClientIndex m_helper_client_index;
307 /* when helper register, notify imcontrol client */
308 StringIntRepository m_ise_pending_repository;
309 IMControlRepository m_imcontrol_repository;
311 StartHelperICIndex m_start_helper_ic_index;
314 ClientContextUUIDRepository m_client_context_uuids;
317 ClientContextUUIDRepository m_client_context_helper;
318 UUIDCountRepository m_helper_uuid_count;
320 InfoManagerSignalVoid m_signal_turn_on;
321 InfoManagerSignalVoid m_signal_turn_off;
322 InfoManagerSignalVoid m_signal_show_panel;
323 InfoManagerSignalVoid m_signal_hide_panel;
324 InfoManagerSignalInt m_signal_update_screen;
325 InfoManagerSignalIntIntInt m_signal_update_spot_location;
326 InfoManagerSignalFactoryInfo m_signal_update_factory_info;
327 InfoManagerSignalVoid m_signal_start_default_ise;
328 InfoManagerSignalBool m_signal_stop_default_ise;
329 InfoManagerSignalIntInt m_signal_update_input_context;
330 InfoManagerSignalString m_signal_update_language_locale;
331 InfoManagerSignalIntInt m_signal_set_candidate_ui;
332 InfoManagerSignalIntInt2 m_signal_get_candidate_ui;
333 InfoManagerSignalIntInt m_signal_set_candidate_position;
334 InfoManagerSignalRect m_signal_get_candidate_geometry;
335 InfoManagerSignalRect m_signal_get_input_panel_geometry;
336 InfoManagerSignalString m_signal_set_keyboard_ise;
337 InfoManagerSignalString2 m_signal_get_keyboard_ise;
338 InfoManagerSignalString m_signal_show_help;
339 InfoManagerSignalFactoryInfoVector m_signal_show_factory_menu;
340 InfoManagerSignalVoid m_signal_show_preedit_string;
341 InfoManagerSignalVoid m_signal_show_aux_string;
342 InfoManagerSignalVoid m_signal_show_lookup_table;
343 InfoManagerSignalVoid m_signal_show_associate_table;
344 InfoManagerSignalVoid m_signal_hide_preedit_string;
345 InfoManagerSignalVoid m_signal_hide_aux_string;
346 InfoManagerSignalVoid m_signal_hide_lookup_table;
347 InfoManagerSignalVoid m_signal_hide_associate_table;
348 InfoManagerSignalAttributeStringInt m_signal_update_preedit_string;
349 InfoManagerSignalAttributeInt2String2 m_signal_recapture_string;
350 InfoManagerSignalInt m_signal_update_preedit_caret;
351 InfoManagerSignalAttributeString m_signal_update_aux_string;
352 InfoManagerSignalLookupTable m_signal_update_lookup_table;
353 InfoManagerSignalLookupTable m_signal_update_associate_table;
354 InfoManagerSignalPropertyList m_signal_register_properties;
355 InfoManagerSignalProperty m_signal_update_property;
356 InfoManagerSignalIntPropertyList m_signal_register_helper_properties;
357 InfoManagerSignalIntProperty m_signal_update_helper_property;
358 InfoManagerSignalIntHelperInfo m_signal_register_helper;
359 InfoManagerSignalInt m_signal_remove_helper;
360 InfoManagerSignalStringBool m_signal_set_active_ise_by_uuid;
361 InfoManagerSignalVoid m_signal_focus_in;
362 InfoManagerSignalVoid m_signal_focus_out;
363 InfoManagerSignalVoid m_signal_expand_candidate;
364 InfoManagerSignalVoid m_signal_contract_candidate;
365 InfoManagerSignalInt m_signal_select_candidate;
366 InfoManagerSignalBoolStringVector m_signal_get_ise_list;
367 InfoManagerSignalBoolHelperInfo m_signal_get_all_helper_ise_info;
368 InfoManagerSignalStringBool m_signal_set_has_option_helper_ise_info;
369 InfoManagerSignalStringBool m_signal_set_enable_helper_ise_info;
370 InfoManagerSignalVoid m_signal_show_helper_ise_list;
371 InfoManagerSignalVoid m_signal_show_helper_ise_selector;
372 InfoManagerSignalStringInt m_signal_is_helper_ise_enabled;
373 InfoManagerSignalBoolString4int2 m_signal_get_ise_information;
374 InfoManagerSignalBoolStringVector m_signal_get_keyboard_ise_list;
375 InfoManagerSignalIntIntIntInt m_signal_update_ise_geometry;
376 InfoManagerSignalStringVector m_signal_get_language_list;
377 InfoManagerSignalStringVector m_signal_get_all_language;
378 InfoManagerSignalStrStringVector m_signal_get_ise_language;
379 InfoManagerSignalStringISEINFO m_signal_get_ise_info_by_uuid;
380 InfoManagerSignalKeyEvent m_signal_send_key_event;
382 InfoManagerSignalInt m_signal_accept_connection;
383 InfoManagerSignalInt m_signal_close_connection;
384 InfoManagerSignalVoid m_signal_exit;
386 InfoManagerSignalVoid m_signal_transaction_start;
387 InfoManagerSignalVoid m_signal_transaction_end;
389 InfoManagerSignalVoid m_signal_lock;
390 InfoManagerSignalVoid m_signal_unlock;
392 InfoManagerSignalVoid m_signal_show_ise;
393 InfoManagerSignalVoid m_signal_hide_ise;
395 InfoManagerSignalVoid m_signal_will_show_ack;
396 InfoManagerSignalVoid m_signal_will_hide_ack;
398 InfoManagerSignalInt m_signal_set_keyboard_mode;
400 InfoManagerSignalVoid m_signal_candidate_will_hide_ack;
401 InfoManagerSignalInt2 m_signal_get_ise_state;
402 InfoManagerSignalString3 m_signal_run_helper;
404 InfoManagerSignalIntRect m_signal_get_recent_ise_geometry;
406 InfoManagerSignalStringBool m_signal_remoteinput_send_input_message;
407 InfoManagerSignalIntString m_signal_remoteinput_send_surrounding_text;
409 InfoManagerSignalIntString2 m_signal_check_privilege_by_sockfd;
411 InfoManagerSignalBoolString m_signal_launch_option_application;
413 PanelAgentManager m_panel_agent_manager;
415 void delete_ise_context_buffer (void) {
416 if (m_ise_context_buffer != NULL) {
417 delete[] m_ise_context_buffer;
418 m_ise_context_buffer = NULL;
419 m_ise_context_length = 0;
423 void delete_imdata_buffer (void) {
424 if (m_imdata_buffer != NULL) {
425 delete[] m_imdata_buffer;
426 m_imdata_buffer = NULL;
433 : m_current_screen (0),
434 m_current_socket_client (-1), m_current_client_context (0),
435 m_current_toolbar_mode (TOOLBAR_KEYBOARD_MODE),
436 m_current_helper_option (0),
437 m_pending_active_imcontrol_id (-1),
438 m_show_request_client_id (-1),
439 m_active_client_id (-1),
440 m_should_shared_ise (false),
441 m_ise_exiting (false), m_is_imengine_aux (false), m_is_imengine_candidate (false),
442 m_refocus_needed (false),
443 m_reshow_needed (false),
444 m_restart_needed (true),
445 m_last_socket_client (-1), m_last_client_context (0),
446 m_ise_context_buffer (NULL), m_ise_context_length (0),
447 m_imdata_buffer (NULL), m_imdata_length (0) {
448 m_current_ise_name = String (_ ("English Keyboard"));
449 m_imcontrol_repository.clear ();
450 m_imcontrol_map.clear ();
451 m_current_send_remoteinput_id.clear ();
452 m_current_recv_remoteinput_id.clear ();
453 m_panel_client_map.clear ();
456 ~InfoManagerImpl () {
457 delete_ise_context_buffer ();
458 delete_imdata_buffer ();
461 bool initialize (InfoManager* info_manager, const ConfigPointer& config, const String& display, bool resident) {
463 m_config_name = "socket";
464 m_display_name = display;
466 return m_panel_agent_manager.initialize (info_manager, config, display, resident);
469 bool valid (void) const {
470 return m_panel_agent_manager.valid ();
476 SCIM_DEBUG_MAIN (1) << "InfoManager::stop ()\n";
478 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
479 String helper_uuid = get_current_helper_uuid ();
480 hide_helper (helper_uuid);
481 stop_helper (helper_uuid, -2, 0);
484 m_panel_agent_manager.stop ();
487 TOOLBAR_MODE_T get_current_toolbar_mode () const {
488 return m_current_toolbar_mode;
491 String get_current_ise_name () const {
492 return m_current_ise_name;
495 String get_current_helper_uuid () const {
496 return m_current_helper_uuid;
499 uint32 get_current_helper_option () const {
500 return m_current_helper_option;
503 void set_current_ise_name (String& name) {
504 m_current_ise_name = name;
507 void set_current_toolbar_mode (TOOLBAR_MODE_T mode) {
508 m_current_toolbar_mode = mode;
511 void set_current_helper_option (uint32 option) {
512 m_current_helper_option = option;
515 void update_panel_event (int cmd, uint32 nType, uint32 nValue) {
517 uint32 focused_context;
518 get_focused_context (focused_client, focused_context);
520 if (focused_client == -1 && m_active_client_id != -1) {
521 focused_client = m_panel_client_map[m_active_client_id];
525 SCIM_DEBUG_MAIN (1) << __func__ << " (" << nType << ", " << nValue << "), client=" << focused_client << "\n";
526 ClientInfo client_info = socket_get_client_info (focused_client);
528 if (client_info.type == FRONTEND_CLIENT) {
529 m_panel_agent_manager.update_panel_event (focused_client, focused_context, cmd, nType, nValue);
531 std::cerr << __func__ << " focused client is not existed!!!" << "\n";
534 if (m_panel_client_map[m_show_request_client_id] != focused_client) {
535 client_info = socket_get_client_info (m_panel_client_map[m_show_request_client_id]);
537 if (client_info.type == FRONTEND_CLIENT) {
538 m_panel_agent_manager.update_panel_event (m_panel_client_map[m_show_request_client_id], 0, cmd, nType, nValue);
539 std::cerr << __func__ << " show request client=" << m_panel_client_map[m_show_request_client_id] << "\n";
541 std::cerr << __func__ << " show request client is not existed!!!" << "\n";
546 bool move_preedit_caret (uint32 position) {
547 SCIM_DEBUG_MAIN (1) << "InfoManager::move_preedit_caret (" << position << ")\n";
551 get_focused_context (client, context);
554 m_panel_agent_manager.update_preedit_caret (client, context, position);
562 bool request_help (void) {
563 SCIM_DEBUG_MAIN (1) << "InfoManager::request_help ()\n";
567 get_focused_context (client, context);
570 m_panel_agent_manager.request_help (client, context);
577 bool request_factory_menu (void) {
578 SCIM_DEBUG_MAIN (1) << "InfoManager::request_factory_menu ()\n";
582 get_focused_context (client, context);
585 m_panel_agent_manager.request_factory_menu (client, context);
593 //ISM_TRANS_CMD_PANEL_RESET_KEYBOARD_ISE
594 bool reset_keyboard_ise (void) {
595 SCIM_DEBUG_MAIN (1) << "InfoManager::reset_keyboard_ise ()\n";
599 get_focused_context (client, context);
602 m_panel_agent_manager.reset_keyboard_ise (client, context);
609 bool update_keyboard_ise_list (void) {
610 SCIM_DEBUG_MAIN (1) << "InfoManager::update_keyboard_ise_list ()\n";
614 get_focused_context (client, context);
617 m_panel_agent_manager.update_keyboard_ise_list (client, context);
624 bool change_factory (const String& uuid) {
625 SCIM_DEBUG_MAIN (1) << "InfoManager::change_factory (" << uuid << ")\n";
629 if (scim_global_config_read (SCIM_GLOBAL_CONFIG_PRELOAD_KEYBOARD_ISE, false))
630 m_helper_manager.preload_keyboard_ise (uuid);
633 get_focused_context (client, context);
636 m_panel_agent_manager.change_factory (client, context, uuid);
643 bool helper_candidate_show (void) {
644 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
649 get_focused_context (client, context);
651 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
652 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
654 if (it != m_helper_client_index.end ()) {
655 uint32 ctx = get_helper_ic (client, context);
656 m_panel_agent_manager.helper_candidate_show (it->second.id, ctx, m_current_helper_uuid);
661 /* Inform wayland module that we are showing candidate window */
663 uint32 focused_context;
664 String focused_uuid = get_focused_context(focused_client, focused_context);
665 m_panel_agent_manager.helper_candidate_show(focused_client, focused_context, focused_uuid);
670 bool helper_candidate_hide (void) {
671 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
676 get_focused_context (client, context);
678 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
679 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
681 if (it != m_helper_client_index.end ()) {
682 uint32 ctx = get_helper_ic (client, context);
683 m_panel_agent_manager.helper_candidate_hide (it->second.id, ctx, m_current_helper_uuid);
688 /* Inform wayland module that we are hiding candidate window */
690 uint32 focused_context;
691 String focused_uuid = get_focused_context(focused_client, focused_context);
692 m_panel_agent_manager.helper_candidate_hide(focused_client, focused_context, focused_uuid);
697 bool candidate_more_window_show (void) {
698 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
701 get_focused_context (client, context);
703 if (m_is_imengine_candidate) {
705 m_panel_agent_manager.candidate_more_window_show (client, context);
709 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
710 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
712 if (it != m_helper_client_index.end ()) {
713 uint32 ctx = get_helper_ic (client, context);
714 m_panel_agent_manager.candidate_more_window_show (it->second.id, ctx);
723 bool candidate_more_window_hide (void) {
724 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
727 get_focused_context (client, context);
729 if (m_is_imengine_candidate) {
731 m_panel_agent_manager.candidate_more_window_hide (client, context);
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 ()) {
739 uint32 ctx = get_helper_ic (client, context);
740 m_panel_agent_manager.candidate_more_window_hide (it->second.id, ctx);
749 bool update_helper_lookup_table (const LookupTable& table) {
750 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
754 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
755 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
757 if (it != m_helper_client_index.end ()) {
759 get_focused_context (client, context);
760 ctx = get_helper_ic (client, context);
761 m_panel_agent_manager.update_helper_lookup_table (it->second.id, ctx, m_current_helper_uuid, table);
769 bool select_aux (uint32 item) {
770 SCIM_DEBUG_MAIN (1) << "InfoManager::select_aux (" << item << ")\n";
774 get_focused_context (client, context);
776 if (m_is_imengine_aux) {
778 m_panel_agent_manager.select_aux (client, context, item);
781 helper_select_aux (item);
788 bool select_candidate (uint32 item) {
789 SCIM_DEBUG_MAIN (1) << "InfoManager::select_candidate (" << item << ")\n";
793 get_focused_context (client, context);
795 if (m_is_imengine_candidate) {
797 m_panel_agent_manager.select_candidate (client, context, item);
800 helper_select_candidate (item);
807 bool lookup_table_page_up (void) {
808 SCIM_DEBUG_MAIN (1) << "InfoManager::lookup_table_page_up ()\n";
812 get_focused_context (client, context);
814 if (m_is_imengine_candidate) {
816 m_panel_agent_manager.lookup_table_page_up (client, context);
819 helper_lookup_table_page_up ();
826 bool lookup_table_page_down (void) {
827 SCIM_DEBUG_MAIN (1) << "InfoManager::lookup_table_page_down ()\n";
831 get_focused_context (client, context);
833 if (m_is_imengine_candidate) {
835 m_panel_agent_manager.lookup_table_page_down (client, context);
838 helper_lookup_table_page_down ();
845 bool update_lookup_table_page_size (uint32 size) {
846 SCIM_DEBUG_MAIN (1) << "InfoManager::update_lookup_table_page_size (" << size << ")\n";
850 get_focused_context (client, context);
852 if (m_is_imengine_candidate) {
854 m_panel_agent_manager.update_lookup_table_page_size (client, context, size);
857 helper_update_lookup_table_page_size (size);
864 bool update_candidate_item_layout (const std::vector<uint32>& row_items) {
865 SCIM_DEBUG_MAIN (1) << __func__ << " (" << row_items.size () << ")\n";
869 get_focused_context (client, context);
871 if (m_is_imengine_candidate) {
873 m_panel_agent_manager.update_candidate_item_layout (client, context, row_items);
876 helper_update_candidate_item_layout (row_items);
883 bool select_associate (uint32 item) {
884 SCIM_DEBUG_MAIN (1) << "InfoManager::select_associate (" << item << ")\n";
888 get_focused_context (client, context);
891 m_panel_agent_manager.select_associate (client, context, item);
895 helper_select_associate (item);
899 bool associate_table_page_up (void) {
900 SCIM_DEBUG_MAIN (1) << "InfoManager::associate_table_page_up ()\n";
904 get_focused_context (client, context);
907 m_panel_agent_manager.associate_table_page_up (client, context);
911 helper_associate_table_page_up ();
915 bool associate_table_page_down (void) {
916 SCIM_DEBUG_MAIN (1) << "InfoManager::associate_table_page_down ()\n";
920 get_focused_context (client, context);
923 m_panel_agent_manager.associate_table_page_down (client, context);
927 helper_associate_table_page_down ();
931 bool update_associate_table_page_size (uint32 size) {
932 SCIM_DEBUG_MAIN (1) << "InfoManager::update_associate_table_page_size (" << size << ")\n";
936 get_focused_context (client, context);
939 m_panel_agent_manager.update_associate_table_page_size (client, context, size);
943 helper_update_associate_table_page_size (size);
947 bool update_displayed_candidate_number (uint32 size) {
948 SCIM_DEBUG_MAIN (1) << __func__ << " (" << size << ")\n";
952 get_focused_context (client, context);
954 if (m_is_imengine_candidate) {
956 m_panel_agent_manager.update_displayed_candidate_number (client, context, size);
959 helper_update_displayed_candidate_number (size);
966 void send_longpress_event (int type, int index) {
967 SCIM_DEBUG_MAIN (1) << __func__ << " (" << type << ", " << index << ")\n";
970 get_focused_context (client, context);
972 if (m_is_imengine_candidate) {
974 m_panel_agent_manager.send_longpress_event (client, context, index);
977 helper_longpress_candidate (index);
981 bool trigger_property (const String& property) {
982 SCIM_DEBUG_MAIN (1) << "InfoManager::trigger_property (" << property << ")\n";
986 get_focused_context (client, context);
989 m_panel_agent_manager.trigger_property (client, context, property);
996 bool start_helper (const String& uuid, int client, uint32 context) {
997 SCIM_DEBUG_MAIN (1) << "InfoManager::start_helper (" << uuid << ")\n";
998 LOGD ("start ISE(%s)", uuid.c_str ());
1000 if (uuid.length () <= 0)
1004 /*if (m_current_toolbar_mode != TOOLBAR_HELPER_MODE || m_current_helper_uuid.compare (uuid) != 0)*/ {
1005 SCIM_DEBUG_MAIN (1) << "Run_helper\n";
1007 uint32 ic = get_helper_ic (m_panel_client_map[client], context);
1009 /* Get the context uuid from the client context registration table. */
1011 ClientContextUUIDRepository::iterator it =
1012 m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client], context));
1014 if (it != m_client_context_uuids.end ())
1015 ic_uuid = it->second;
1017 m_start_helper_ic_index [uuid].push_back (std::make_pair (ic, ic_uuid));
1018 m_signal_run_helper (uuid, m_config_name, m_display_name);
1020 m_current_helper_uuid = uuid;
1025 bool stop_helper (const String& uuid, int client, uint32 context) {
1026 char buf[256] = {0};
1027 snprintf (buf, sizeof (buf), "time:%ld pid:%d %s %s prepare to stop ISE(%s)\n",
1028 time (0), getpid (), __FILE__, __func__, uuid.c_str ());
1029 LOGD ("prepare to stop ISE(%s)", uuid.c_str ());
1030 SCIM_DEBUG_MAIN (1) << "InfoManager::stop_helper (" << uuid << ")\n";
1032 if (uuid.length () <= 0)
1036 uint32 ctx = get_helper_ic (client, context);
1037 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
1039 if (it != m_helper_client_index.end ()) {
1040 m_ise_exiting = true;
1041 m_current_helper_uuid = String ("");
1042 m_panel_agent_manager.exit (it->second.id, ctx);
1043 SCIM_DEBUG_MAIN (1) << "Stop helper\n";
1044 ISF_SAVE_LOG ("send SCIM_TRANS_CMD_EXIT message to %s", uuid.c_str ());
1047 /* Since we are stopping this helper, erase information from start_helper_ic_index too */
1048 m_start_helper_ic_index.erase (uuid);
1054 void focus_out_helper (const String& uuid, int client, uint32 context) {
1055 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1057 if (it != m_helper_client_index.end ()) {
1058 uint32 ctx = get_helper_ic (client, context);
1059 m_panel_agent_manager.focus_out_helper (it->second.id, ctx, uuid);
1063 void focus_in_helper (const String& uuid, int client, uint32 context) {
1064 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1066 if (it != m_helper_client_index.end ()) {
1067 uint32 ctx = get_helper_ic (client, context);
1068 m_panel_agent_manager.focus_in_helper (it->second.id, ctx, uuid);
1072 bool show_helper (const String& uuid, char* data, size_t& len, uint32 ctx) {
1073 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1075 if (it != m_helper_client_index.end ()) {
1076 Socket client_socket (it->second.id);
1077 m_panel_agent_manager.show_helper (it->second.id, ctx, uuid, data, len);
1081 LOGW ("Can't find %s", m_current_helper_uuid.c_str ());
1086 void hide_helper (const String& uuid, uint32 ctx = 0) {
1087 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1089 if (it != m_helper_client_index.end ()) {
1094 get_focused_context (client, context);
1095 ctx = get_helper_ic (client, context);
1098 m_panel_agent_manager.hide_helper (it->second.id, ctx, uuid);
1102 bool set_helper_mode (const String& uuid, uint32& mode) {
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_mode (it->second.id, ctx, uuid, mode);
1118 bool set_helper_language (const String& uuid, uint32& language) {
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_language (it->second.id, ctx, uuid, language);
1134 bool set_helper_imdata (const String& uuid, const char* imdata, size_t& len) {
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_imdata (it->second.id, ctx, uuid, imdata, len);
1150 bool set_helper_return_key_type (const String& uuid, int 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.set_helper_return_key_type (it->second.id, ctx, uuid, type);
1166 bool get_helper_return_key_type (const String& uuid, uint32& type) {
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.get_helper_return_key_type (it->second.id, ctx, uuid, type);
1182 bool set_helper_return_key_disable (const String& uuid, bool 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.set_helper_return_key_disable (it->second.id, ctx, uuid, disabled);
1198 bool get_helper_return_key_disable (const String& uuid, uint32& disabled) {
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.get_helper_return_key_disable (it->second.id, ctx, uuid, disabled);
1214 bool set_helper_layout (const String& uuid, uint32& layout) {
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_layout (it->second.id, ctx, uuid, layout);
1230 bool set_helper_input_mode (const String& uuid, uint32& mode) {
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_mode (it->second.id, ctx, uuid, mode);
1246 bool set_helper_input_hint (const String& uuid, uint32& hint) {
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_input_hint (it->second.id, ctx, uuid, hint);
1262 bool set_helper_bidi_direction (const String& uuid, uint32& direction) {
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_bidi_direction (it->second.id, ctx, uuid, direction);
1278 bool set_helper_caps_mode (const String& uuid, uint32& mode) {
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);
1287 m_panel_agent_manager.set_helper_caps_mode (it->second.id, ctx, uuid, mode);
1294 bool show_helper_option_window (const String& uuid) {
1295 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1297 if (it != m_helper_client_index.end ()) {
1301 get_focused_context (client, context);
1302 ctx = get_helper_ic (client, context);
1304 if (!m_signal_launch_option_application (uuid)) {
1305 LOGD ("call show helper option");
1306 m_panel_agent_manager.show_helper_option_window (it->second.id, ctx, uuid);
1315 bool resume_helper_option_window (const String& uuid) {
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.resume_helper_option_window (it->second.id, ctx, uuid);
1331 bool set_helper_keyboard_mode (const String& uuid, uint32& mode) {
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_keyboard_mode (it->second.id, ctx, uuid, mode);
1347 bool set_helper_prediction_hint (const String& uuid, String prediction_hint) {
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_prediction_hint (it->second.id, ctx, uuid, prediction_hint);
1363 bool set_helper_mime_type (const String& uuid, String mime_type) {
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.set_helper_mime_type (it->second.id, ctx, uuid, mime_type);
1379 bool finalize_content_helper (const String& uuid, String text, uint32 cursor_pos) {
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.finalize_content_helper (it->second.id, ctx, uuid, text, cursor_pos);
1395 bool set_helper_prediction_hint_data (const String& uuid, String key, String value) {
1396 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1398 if (it != m_helper_client_index.end ()) {
1402 get_focused_context (client, context);
1403 ctx = get_helper_ic (client, context);
1404 m_panel_agent_manager.set_helper_prediction_hint_data (it->second.id, ctx, uuid, key, value);
1411 bool set_helper_optimization_hint(const String& uuid, uint32& hint) {
1412 HelperClientIndex::iterator it = m_helper_client_index.find(m_current_helper_uuid);
1414 if (it != m_helper_client_index.end()) {
1418 get_focused_context(client, context);
1419 ctx = get_helper_ic(client, context);
1420 m_panel_agent_manager.set_helper_optimization_hint(it->second.id, ctx, uuid, hint);
1427 //ISM_TRANS_CMD_SHOW_ISF_CONTROL
1428 void show_isf_panel (int client_id) {
1429 SCIM_DEBUG_MAIN (4) << "InfoManager::show_isf_panel ()\n";
1430 m_signal_show_panel ();
1433 //ISM_TRANS_CMD_SEND_REMOTE_INPUT_MESSAGE
1434 bool send_remote_input_message (int client_id, char* buf, size_t len) {
1435 SCIM_DEBUG_MAIN(4) << "InfoManager::send_remote_input_message ()\n";
1437 if (buf && len > 0) {
1439 m_signal_remoteinput_send_input_message (msg, true);
1446 void send_remote_surrounding_text (const char* text, uint32 cursor) {
1447 SCIM_DEBUG_MAIN(4) << "InfoManager::send_remote_surrounding_text ()\n";
1449 m_signal_remoteinput_send_surrounding_text (cursor, text);
1452 //ISM_TRANS_CMD_HIDE_ISF_CONTROL
1453 void hide_isf_panel (int client_id) {
1454 SCIM_DEBUG_MAIN (4) << "InfoManager::hide_isf_panel ()\n";
1455 m_signal_hide_panel ();
1458 //ISM_TRANS_CMD_SHOW_ISE_PANEL
1459 void show_ise_panel (int client_id, uint32 client, uint32 context, char* data, size_t len) {
1460 SCIM_DEBUG_MAIN (4) << "InfoManager::show_ise_panel ()\n";
1461 m_reshow_needed = true;
1462 String initial_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
1463 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
1464 LOGD ("prepare to show ISE %d [%s] [%s]", client_id, initial_uuid.c_str (), default_uuid.c_str ());
1466 m_show_request_client_id = client_id;
1467 m_active_client_id = client_id;
1468 SCIM_DEBUG_MAIN (4) << __func__ << " (client:" << client << " context:" << context << ")\n";
1470 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode) {
1471 uint32 ctx = get_helper_ic (client, context);
1472 ret = show_helper (m_current_helper_uuid, data, len, ctx);
1475 /* Save ISE context for ISE panel re-showing */
1476 /* The size of data can be bigger than Ise_Context size if there is IMDATA. */
1477 if (data && len > 0) {
1478 delete_imdata_buffer ();
1479 delete_ise_context_buffer ();
1480 m_ise_context_buffer = new char [len];
1481 if (m_ise_context_buffer) {
1482 m_ise_context_length = len;
1483 memcpy (m_ise_context_buffer, data, m_ise_context_length);
1488 m_signal_show_ise ();
1490 bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false);
1491 if (launch_ise_on_request)
1492 m_signal_start_default_ise ();
1496 //ISM_TRANS_CMD_HIDE_ISE_PANEL
1497 void hide_ise_panel (int client_id, uint32 client, uint32 context) {
1498 SCIM_DEBUG_MAIN (4) << "InfoManager::hide_ise_panel ()\n";
1499 LOGD ("prepare to hide ISE, %d %d", client_id, m_show_request_client_id);
1500 SCIM_DEBUG_MAIN (4) << __func__ << " (client:" << client << " context:" << context << ")\n";
1502 m_reshow_needed = false;
1503 if (m_panel_client_map[client_id] == m_current_socket_client || client_id == m_show_request_client_id) {
1504 // && (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
1506 uint32 focused_context;
1507 get_focused_context (focused_client, focused_context);
1509 if (focused_client == -1 && m_active_client_id != -1) {
1510 focused_client = m_panel_client_map[m_active_client_id];
1511 focused_context = 0;
1514 m_signal_hide_ise ();
1517 /* Release ISE context & IMDATA buffer */
1518 delete_imdata_buffer ();
1519 delete_ise_context_buffer ();
1522 void hide_helper_ise (void) {
1525 uint32 focused_context;
1526 get_focused_context (focused_client, focused_context);
1527 m_panel_agent_manager.hide_helper_ise (focused_client, focused_context);
1529 m_signal_hide_ise ();
1533 void prelaunch_helper_ise (void) {
1534 SCIM_DEBUG_MAIN (4) << "InfoManager::prelaunch_helper_ise ()\n";
1537 * Currenlty the SHOW_PREPARE hint is delivered only to the already-running ISEs.
1538 * If the newly launched ise also has to be notified of given optimization hint,
1539 * we'll need to mark the hint somewhere and send the message when a newly launched
1540 * ise connects to the panel.
1542 HelperClientIndex::iterator it = m_helper_client_index.find(m_current_helper_uuid);
1543 if (it != m_helper_client_index.end()) {
1547 get_focused_context(client, context);
1548 ctx = get_helper_ic(client, context);
1549 m_panel_agent_manager.set_helper_optimization_hint(it->second.id, ctx, m_current_helper_uuid, ISE_OPTIMIZATION_HINT_SHOW_PREPARE);
1552 m_signal_start_default_ise();
1555 void set_default_ise (const DEFAULT_ISE_T& ise) {
1556 LOGD ("set default ise : %s", ise.uuid.c_str());
1557 scim_global_config_write (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), ise.uuid);
1558 scim_global_config_flush ();
1561 void set_should_shared_ise (const bool should_shared_ise) {
1562 m_should_shared_ise = should_shared_ise;
1564 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
1565 bool process_key_event (KeyEvent& key, uint32 serial) {
1566 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1568 if (it != m_helper_client_index.end ()) {
1572 get_focused_context (client, context);
1573 ctx = get_helper_ic (client, context);
1574 return m_panel_agent_manager.process_key_event (it->second.id, ctx, m_current_helper_uuid, key, serial);
1580 //ISM_TRANS_CMD_PROCESS_INPUT_DEVICE_EVENT
1581 bool process_input_device_event(int client_id, uint32 type, const char *data, size_t len, _OUT_ uint32& result) {
1582 SCIM_DEBUG_MAIN(4) << "InfoManager::process_input_device_event ()\n";
1583 HelperClientIndex::iterator it = m_helper_client_index.find(m_current_helper_uuid);
1585 if (it != m_helper_client_index.end()) {
1589 get_focused_context(client, context);
1590 ctx = get_helper_ic(client, context);
1591 return m_panel_agent_manager.process_input_device_event(it->second.id, ctx, m_current_helper_uuid, type, data, len, result);
1597 bool get_helper_geometry (String& uuid, struct rectinfo& info) {
1598 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1600 if (it != m_helper_client_index.end ()) {
1604 get_focused_context (client, context);
1605 ctx = get_helper_ic (client, context);
1606 return m_panel_agent_manager.get_helper_geometry (it->second.id, ctx, uuid, info);
1612 bool get_helper_imdata (String& uuid, char** imdata, size_t& len) {
1613 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1615 if (it != m_helper_client_index.end ()) {
1619 get_focused_context (client, context);
1620 ctx = get_helper_ic (client, context);
1621 m_panel_agent_manager.get_helper_imdata (it->second.id, ctx, uuid, imdata, len);
1628 bool get_helper_layout (String& uuid, uint32& layout) {
1629 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1631 if (it != m_helper_client_index.end ()) {
1635 get_focused_context (client, context);
1636 ctx = get_helper_ic (client, context);
1637 m_panel_agent_manager.get_helper_layout (it->second.id, ctx, uuid, layout);
1643 //ISM_TRANS_CMD_GET_ACTIVE_ISE_GEOMETRY
1644 void get_input_panel_geometry (int client_id, _OUT_ struct rectinfo& info) {
1645 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1646 m_signal_get_input_panel_geometry (info);
1648 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
1649 void get_candidate_window_geometry (int client_id, _OUT_ struct rectinfo& info) {
1650 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1651 m_signal_get_candidate_geometry (info);
1653 //ISM_TRANS_CMD_GET_ISE_LANGUAGE_LOCALE
1654 void get_ise_language_locale (int client_id, _OUT_ char** data, _OUT_ size_t& len) {
1655 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1656 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
1657 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1659 if (it != m_helper_client_index.end ()) {
1662 get_focused_context (client, context);
1663 uint32 ctx = get_helper_ic (client, context);
1664 m_panel_agent_manager.get_ise_language_locale (it->second.id, ctx, m_current_helper_uuid, data, len);
1669 void get_current_ise_geometry (rectinfo& rect) {
1670 SCIM_DEBUG_MAIN (4) << __func__ << " \n";
1673 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1674 ret = get_helper_geometry (m_current_helper_uuid, rect);
1684 void set_ise_mode (int client_id, uint32 mode) {
1685 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_mode ()\n";
1687 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1688 set_helper_mode (m_current_helper_uuid, mode);
1690 //ISM_TRANS_CMD_SET_LAYOUT
1691 void set_ise_layout (int client_id, uint32 layout) {
1692 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_layout ()\n";
1693 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1694 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1695 iseContext->layout = static_cast<Ecore_IMF_Input_Panel_Layout>(layout);
1697 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1698 set_helper_layout (m_current_helper_uuid, layout);
1700 //ISM_TRANS_CMD_SET_INPUT_MODE
1701 void set_ise_input_mode (int client_id, uint32 input_mode) {
1702 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_input_mode ()\n";
1704 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1705 set_helper_input_mode (m_current_helper_uuid, input_mode);
1707 //ISM_TRANS_CMD_SET_INPUT_HINT
1708 void set_ise_input_hint (int client_id, uint32 input_hint) {
1709 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_input_hint ()\n";
1710 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1711 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1712 iseContext->input_hint = static_cast<Ecore_IMF_Input_Hints>(input_hint);
1714 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1715 set_helper_input_hint (m_current_helper_uuid, input_hint);
1717 //ISM_TRANS_CMD_UPDATE_BIDI_DIRECTION
1718 void update_ise_bidi_direction (int client_id, uint32 bidi_direction) {
1719 SCIM_DEBUG_MAIN (4) << "InfoManager::update_ise_bidi_direction ()\n";
1720 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1721 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1722 iseContext->bidi_direction = static_cast<Ecore_IMF_BiDi_Direction>(bidi_direction);
1724 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1725 set_helper_bidi_direction (m_current_helper_uuid, bidi_direction);
1727 //ISM_TRANS_CMD_SET_ISE_LANGUAGE
1728 void set_ise_language (int client_id, uint32 language) {
1729 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_language ()\n";
1730 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1731 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1732 iseContext->language = static_cast<Ecore_IMF_Input_Panel_Lang>(language);
1734 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1735 set_helper_language (m_current_helper_uuid, language);
1737 //ISM_TRANS_CMD_SET_ISE_IMDATA
1738 void set_ise_imdata (int client_id, const char* imdata, size_t len) {
1739 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_imdata ()\n";
1741 delete_imdata_buffer ();
1742 m_imdata_buffer = new char [len];
1743 if (m_imdata_buffer) {
1744 m_imdata_length = len;
1745 memcpy (m_imdata_buffer, imdata, m_imdata_length);
1747 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1748 set_helper_imdata (m_current_helper_uuid, imdata, len);
1750 //ISM_TRANS_CMD_GET_ISE_IMDATA
1751 bool get_ise_imdata (int client_id, _OUT_ char** imdata, _OUT_ size_t& len) {
1752 SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_imdata ()\n";
1755 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1756 ret = get_helper_imdata (m_current_helper_uuid, imdata, len);
1760 //ISM_TRANS_CMD_GET_LAYOUT
1761 bool get_ise_layout (int client_id, _OUT_ uint32& layout) {
1762 SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_layout ()\n";
1765 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1766 ret = get_helper_layout (m_current_helper_uuid, layout);
1770 //ISM_TRANS_CMD_GET_ISE_STATE
1771 void get_ise_state (int client_id, _OUT_ int& state) {
1772 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1773 m_signal_get_ise_state (state);
1775 //ISM_TRANS_CMD_GET_ACTIVE_ISE
1776 void get_active_ise (int client_id, _OUT_ String& default_uuid) {
1777 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1778 default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
1780 //ISM_TRANS_CMD_GET_ISE_LIST
1781 void get_ise_list (int client_id, _OUT_ std::vector<String>& strlist) {
1782 SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_list ()\n";
1783 m_signal_get_ise_list (strlist);
1785 //ISM_TRANS_CMD_GET_ALL_HELPER_ISE_INFO
1786 void get_all_helper_ise_info (int client_id, _OUT_ HELPER_ISE_INFO& info) {
1787 SCIM_DEBUG_MAIN (4) << "InfoManager::get_all_helper_ise_info ()\n";
1788 m_signal_get_all_helper_ise_info (info);
1790 //1 Check if the current IME's option (setting) is available or not.
1791 for (uint32 i = 0; i < info.appid.size (); i++) {
1792 if (m_current_helper_uuid.compare (info.appid [i]) == 0) { // Find the current IME
1793 // If the current IME's "has_option" is unknown (-1), get it through ISM_TRANS_CMD_CHECK_OPTION_WINDOW command.
1794 // And it's saved to ime_info DB. Then next time this will be skipped.
1795 if (info.has_option [i] >= 2) {
1796 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1798 if (it != m_helper_client_index.end ()) {
1801 get_focused_context (client, context);
1802 uint32 ctx = get_helper_ic (client, context);
1803 uint32 avail = static_cast<uint32> (-1);
1804 m_panel_agent_manager.check_option_window (it->second.id, ctx, m_current_helper_uuid, avail);
1807 String setting_app = isf_pkg_get_setting_app (m_current_helper_uuid);
1808 if (setting_app.length () > 0)
1813 info.has_option [i] = avail;
1814 // Update "has_option" column of ime_info DB and global variable.
1815 m_signal_set_has_option_helper_ise_info (info.appid [i], static_cast<bool> (avail));
1822 //ISM_TRANS_CMD_SET_ENABLE_HELPER_ISE_INFO
1823 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1824 void set_enable_helper_ise_info (int client_id, String appid, uint32 is_enabled) {
1825 SCIM_DEBUG_MAIN (4) << "InfoManager::set_enable_helper_ise_info ()\n";
1826 m_signal_set_enable_helper_ise_info (appid, static_cast<bool> (is_enabled));
1828 //ISM_TRANS_CMD_SHOW_HELPER_ISE_LIST
1829 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1830 void show_helper_ise_list (int client_id) {
1831 SCIM_DEBUG_MAIN (4) << "InfoManager::show_helper_ise_list ()\n";
1832 m_signal_show_helper_ise_list ();
1834 //ISM_TRANS_CMD_SHOW_HELPER_ISE_SELECTOR
1835 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1836 void show_helper_ise_selector (int client_id) {
1837 SCIM_DEBUG_MAIN (4) << "InfoManager::show_helper_ise_selector ()\n";
1838 m_signal_show_helper_ise_selector ();
1840 //ISM_TRANS_CMD_IS_HELPER_ISE_ENABLED
1842 void is_helper_ise_enabled (int client_id, String strAppid, _OUT_ uint32& nEnabled) {
1843 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1845 m_signal_is_helper_ise_enabled (strAppid, _nEnabled);
1846 nEnabled = (uint32)_nEnabled;
1848 //ISM_TRANS_CMD_GET_ISE_INFORMATION
1849 void get_ise_information (int client_id, String strUuid, _OUT_ String& strName, _OUT_ String& strLanguage,
1850 _OUT_ int& nType, _OUT_ int& nOption, _OUT_ String& strModuleName) {
1851 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1852 m_signal_get_ise_information (strUuid, strName, strLanguage, nType, nOption, strModuleName);
1857 void get_language_list (int client_id, _OUT_ std::vector<String>& strlist) {
1858 SCIM_DEBUG_MAIN (4) << "InfoManager::get_language_list ()\n";
1859 m_signal_get_language_list (strlist);
1862 void get_all_language (int client_id, _OUT_ std::vector<String>& strlist) {
1863 SCIM_DEBUG_MAIN (4) << "InfoManager::get_all_language ()\n";
1864 m_signal_get_all_language (strlist);
1869 void get_ise_language (int client_id, char* buf, size_t len, _OUT_ std::vector<String>& strlist) {
1870 SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_language ()\n";
1871 m_signal_get_ise_language (buf, strlist);
1873 //ISM_TRANS_CMD_RESET_ISE_OPTION
1874 //reply SCIM_TRANS_CMD_OK
1875 bool reset_ise_option (int client_id) {
1876 SCIM_DEBUG_MAIN (1) << "InfoManager::resect_ise_option ()\n";
1880 ClientContextUUIDRepository::iterator it = m_client_context_uuids.begin ();
1882 if (it != m_client_context_uuids.end ()) {
1883 get_imengine_client_context (it->first, client, context);
1887 m_panel_agent_manager.reset_ise_option (client, context);
1894 bool find_active_ise_by_uuid (String uuid) {
1895 HelperInfoRepository::iterator iter = m_helper_info_repository.begin ();
1897 for (; iter != m_helper_info_repository.end (); iter++) {
1898 if (!uuid.compare (iter->second.uuid))
1904 //ISM_TRANS_CMD_SET_ACTIVE_ISE_BY_UUID
1906 bool set_active_ise_by_uuid (int client_id, char* buf, size_t len) {
1907 SCIM_DEBUG_MAIN (4) << "InfoManager::set_active_ise_by_uuid ()\n";
1916 if (!m_signal_get_ise_info_by_uuid (uuid, info)) {
1920 if (info.type == TOOLBAR_KEYBOARD_MODE) {
1921 m_signal_set_active_ise_by_uuid (uuid, 1);
1924 m_signal_set_active_ise_by_uuid (uuid, 1);
1929 if (find_active_ise_by_uuid (uuid)) {
1932 m_ise_pending_repository[uuid] = client_id;
1936 //ISM_TRANS_CMD_SET_INITIAL_ISE_BY_UUID
1937 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1938 void set_initial_ise_by_uuid (int client_id, char* buf, size_t len) {
1939 SCIM_DEBUG_MAIN (4) << "InfoManager::set_initial_ise_by_uuid ()\n";
1946 scim_global_config_write (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (uuid));
1947 scim_global_config_flush ();
1949 //ISM_TRANS_CMD_SET_RETURN_KEY_TYPE
1950 void set_ise_return_key_type (int client_id, uint32 type) {
1951 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1952 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1953 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1954 iseContext->return_key_type = static_cast<Ecore_IMF_Input_Panel_Return_Key_Type>(type);
1956 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1957 set_helper_return_key_type (m_current_helper_uuid, type);
1959 //ISM_TRANS_CMD_GET_RETURN_KEY_TYPE
1961 bool get_ise_return_key_type (int client_id, _OUT_ uint32& type) {
1962 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1965 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1966 ret = get_helper_return_key_type (m_current_helper_uuid, type);
1970 //ISM_TRANS_CMD_SET_RETURN_KEY_DISABLE
1971 void set_ise_return_key_disable (int client_id, uint32 disabled) {
1972 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1973 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1974 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1975 iseContext->return_key_disabled = static_cast<Eina_Bool>(disabled);
1977 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1978 set_helper_return_key_disable (m_current_helper_uuid, disabled);
1980 //ISM_TRANS_CMD_GET_RETURN_KEY_DISABLE
1981 bool get_ise_return_key_disable (int client_id, _OUT_ uint32& disabled) {
1982 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1985 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1986 ret = get_helper_return_key_disable (m_current_helper_uuid, disabled);
1991 void reset_helper_context (const String& uuid) {
1992 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1994 if (it != m_helper_client_index.end ()) {
1998 get_focused_context (client, context);
1999 ctx = get_helper_ic (client, context);
2000 m_panel_agent_manager.reset_helper_context (it->second.id, ctx, uuid);
2006 void reset_ise_context (int client_id) {
2007 SCIM_DEBUG_MAIN (4) << "InfoManager::reset_ise_context ()\n";
2009 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2010 reset_helper_context (m_current_helper_uuid);
2012 //ISM_TRANS_CMD_SET_CAPS_MODE
2013 void set_ise_caps_mode (int client_id, uint32 mode) {
2014 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_caps_mode ()\n";
2015 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
2016 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
2017 iseContext->caps_mode = static_cast<Eina_Bool>(mode);
2019 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2020 set_helper_caps_mode (m_current_helper_uuid, mode);
2023 //SCIM_TRANS_CMD_RELOAD_CONFIG
2024 void reload_config (void) {
2025 SCIM_DEBUG_MAIN (1) << "InfoManager::reload_config ()\n";
2028 for (ClientRepository::iterator it = m_client_repository.begin (); it != m_client_repository.end (); ++it) {
2029 if (it->second.type == FRONTEND_CLIENT || it->second.type == HELPER_CLIENT) {
2030 m_panel_agent_manager.reload_config (it->first);
2038 SCIM_DEBUG_MAIN (1) << "InfoManager::exit ()\n";
2041 for (ClientRepository::iterator it = m_client_repository.begin (); it != m_client_repository.end (); ++it) {
2042 m_panel_agent_manager.exit (it->first, 0);
2050 void update_ise_list (std::vector<String>& strList) {
2051 /* request PanelClient to update keyboard ise list */
2052 update_keyboard_ise_list ();
2054 //ISM_TRANS_CMD_SEND_WILL_SHOW_ACK
2055 void will_show_ack (int client_id) {
2056 SCIM_DEBUG_MAIN (4) << "InfoManager::will_show_ack ()\n";
2057 m_signal_will_show_ack ();
2059 //ISM_TRANS_CMD_SEND_WILL_HIDE_ACK
2060 void will_hide_ack (int client_id) {
2061 SCIM_DEBUG_MAIN (4) << "InfoManager::will_hide_ack ()\n";
2062 m_signal_will_hide_ack ();
2064 //ISM_TRANS_CMD_RESET_DEFAULT_ISE
2065 void reset_default_ise (int client_id) {
2066 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
2067 String initial_ise = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
2069 if (initial_ise.length () > 0)
2070 m_signal_set_active_ise_by_uuid (initial_ise, 1);
2072 std::cerr << "Read SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID is failed!!!\n";
2074 //ISM_TRANS_CMD_SET_HARDWARE_KEYBOARD_MODE
2075 void set_keyboard_mode (int client_id, uint32 mode) {
2076 SCIM_DEBUG_MAIN (4) << "InfoManager::set_keyboard_mode ()\n";
2077 m_signal_set_keyboard_mode (mode);
2078 set_ise_keyboard_mode (client_id, mode);
2080 //ISM_TRANS_CMD_SEND_CANDIDATE_WILL_HIDE_ACK
2081 void candidate_will_hide_ack (int client_id) {
2082 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "\n";
2083 m_signal_candidate_will_hide_ack ();
2086 //ISM_TRANS_CMD_GET_ACTIVE_HELPER_OPTION
2087 void get_active_helper_option (int client_id, _OUT_ uint32& option) {
2088 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
2089 option = get_current_helper_option ();
2091 //ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW
2092 void show_ise_option_window (int client_id) {
2093 SCIM_DEBUG_MAIN (4) << "InfoManager::show_ise_option_window ()\n";
2094 String initial_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
2095 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
2096 LOGD ("prepare to show ISE option window %d [%s] [%s]", client_id, initial_uuid.c_str (), default_uuid.c_str ());
2098 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode) {
2099 show_helper_option_window (m_current_helper_uuid);
2103 //ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW
2104 void resume_ise_option_window (int client_id) {
2105 SCIM_DEBUG_MAIN (4) << "InfoManager::resume_ise_option_window ()\n";
2106 String initial_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
2107 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
2108 LOGD ("prepare to resume ISE option window %d [%s] [%s]", client_id, initial_uuid.c_str (), default_uuid.c_str ());
2110 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode) {
2111 resume_helper_option_window (m_current_helper_uuid);
2115 //ISM_TRANS_CMD_SET_KEYBOARD_MODE
2116 void set_ise_keyboard_mode (int client_id, uint32 mode) {
2117 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_keyboard_mode ()\n";
2118 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2119 set_helper_keyboard_mode (m_current_helper_uuid, mode);
2122 //ISM_TRANS_CMD_SET_PREDICTION_HINT
2123 void set_prediction_hint (int client_id, String prediction_hint) {
2124 SCIM_DEBUG_MAIN (4) << "InfoManager::set_prediction_hint ()\n";
2125 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2126 set_helper_prediction_hint (m_current_helper_uuid, prediction_hint);
2129 //ISM_TRANS_CMD_SET_MIME_TYPE
2130 void set_ise_mime_type (int client_id, String mime_type) {
2131 SCIM_DEBUG_MAIN (4) << "InfoManager::set_mime_type ()\n";
2132 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2133 set_helper_mime_type (m_current_helper_uuid, mime_type);
2136 //ISM_TRANS_CMD_FINALIZE_CONTENT
2137 void finalize_content (int client_id, String text, uint32 cursor_pos) {
2138 SCIM_DEBUG_MAIN (4) << "InfoManager::finalize_content ()\n";
2139 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2140 finalize_content_helper (m_current_helper_uuid, text, cursor_pos);
2143 //ISM_TRANS_CMD_SET_PREDICTION_HINT_DATA
2144 void set_prediction_hint_data (int client_id, String key, String value) {
2145 SCIM_DEBUG_MAIN (4) << "InfoManager::set_prediction_hint_data ()\n";
2146 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2147 set_helper_prediction_hint_data (m_current_helper_uuid, key, value);
2150 //ISM_TRANS_CMD_SET_OPTIMIZATION_HINT
2151 void set_optimization_hint(int client_id, uint32 hint) {
2152 SCIM_DEBUG_MAIN(4) << "InfoManager::set_optimization_hint ()\n";
2153 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2154 set_helper_optimization_hint(m_current_helper_uuid, hint);
2157 //ISM_TRANS_CMD_EXPAND_CANDIDATE
2158 void expand_candidate () {
2160 m_signal_expand_candidate ();
2163 //ISM_TRANS_CMD_CONTRACT_CANDIDATE
2164 void contract_candidate () {
2166 m_signal_contract_candidate ();
2168 //ISM_TRANS_CMD_GET_RECENT_ISE_GEOMETRY
2169 void get_recent_ise_geometry (int client_id, uint32 angle, _OUT_ struct rectinfo& info) {
2170 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
2172 m_signal_get_recent_ise_geometry (angle, info);
2175 bool check_privilege_by_sockfd (int client_id, const String& privilege) {
2176 return m_signal_check_privilege_by_sockfd (client_id, privilege);
2179 bool remoteinput_update_preedit_string (WideString str, AttributeList &attrs, uint32 caret)
2181 SCIM_DEBUG_MAIN(1) << "PanelAgent::update_preedit_string ()\n";
2187 get_focused_context (client, context);
2189 m_panel_agent_manager.remote_update_preedit_string (client, context, str, str, attrs, caret);
2197 bool remoteinput_commit_string (const WideString &str)
2199 SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_commit_string ()\n";
2205 get_focused_context (client, context);
2207 m_panel_agent_manager.remote_commit_string (client, context, str);
2215 bool remoteinput_send_key_event (const KeyEvent &key)
2217 SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_send_key_event ()\n";
2221 get_focused_context (client, context);
2223 m_panel_agent_manager.remote_send_key_event (client, context, key);
2229 bool remoteinput_forward_key_event (const KeyEvent &key)
2231 SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_forward_key_event ()\n";
2235 get_focused_context (client, context);
2237 m_panel_agent_manager.remote_forward_key_event (client, context, key);
2243 bool remoteinput_delete_surrounding_text (uint32 offset, uint32 len)
2245 SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_delete_surrounding_text ()\n";
2249 get_focused_context (client, context);
2251 m_panel_agent_manager.remote_delete_surrounding_text (client, context, offset, len);
2257 void reshow_input_panel () {
2258 /* Check whether application is already focus_in */
2259 if (m_refocus_needed) {
2260 LOGD ("Re-focus in");
2261 SCIM_DEBUG_MAIN (2) << "Application is already focus_in!\n";
2263 focus_in_helper (m_current_helper_uuid, m_current_socket_client, m_current_client_context);
2264 reset_keyboard_ise ();
2267 /* Check whether ISE panel is already shown */
2268 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode && m_ise_context_length > 0 && m_reshow_needed) {
2269 LOGD ("Re-show input_panel");
2270 SCIM_DEBUG_MAIN (2) << "Re-show ISE panel!\n";
2273 uint32 focused_context;
2275 get_focused_context (focused_client, focused_context);
2276 if (focused_client == -1 && m_active_client_id != -1) {
2277 focused_client = m_panel_client_map[m_active_client_id];
2278 focused_context = 0;
2281 m_panel_agent_manager.request_ise_reshow (focused_client, focused_context);
2282 m_panel_agent_manager.update_entry_metadata (focused_client, focused_context);
2283 uint32 ctx = get_helper_ic (focused_client, focused_context);
2284 bool ret = show_helper (m_current_helper_uuid, m_ise_context_buffer, m_ise_context_length, ctx);
2286 m_signal_show_ise ();
2288 if (m_imdata_buffer && m_imdata_length > 0 && m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2289 set_helper_imdata (m_current_helper_uuid, m_imdata_buffer, m_imdata_length);
2294 Connection signal_connect_turn_on (InfoManagerSlotVoid* slot) {
2295 return m_signal_turn_on.connect (slot);
2298 Connection signal_connect_turn_off (InfoManagerSlotVoid* slot) {
2299 return m_signal_turn_off.connect (slot);
2302 Connection signal_connect_show_panel (InfoManagerSlotVoid* slot) {
2303 return m_signal_show_panel.connect (slot);
2306 Connection signal_connect_hide_panel (InfoManagerSlotVoid* slot) {
2307 return m_signal_hide_panel.connect (slot);
2310 Connection signal_connect_update_screen (InfoManagerSlotInt* slot) {
2311 return m_signal_update_screen.connect (slot);
2314 Connection signal_connect_update_spot_location (InfoManagerSlotIntIntInt* slot) {
2315 return m_signal_update_spot_location.connect (slot);
2318 Connection signal_connect_update_factory_info (InfoManagerSlotFactoryInfo* slot) {
2319 return m_signal_update_factory_info.connect (slot);
2322 Connection signal_connect_start_default_ise (InfoManagerSlotVoid* slot) {
2323 return m_signal_start_default_ise.connect (slot);
2326 Connection signal_connect_stop_default_ise (InfoManagerSlotBool* slot) {
2327 return m_signal_stop_default_ise.connect (slot);
2330 Connection signal_connect_set_candidate_ui (InfoManagerSlotIntInt* slot) {
2331 return m_signal_set_candidate_ui.connect (slot);
2334 Connection signal_connect_get_candidate_ui (InfoManagerSlotIntInt2* slot) {
2335 return m_signal_get_candidate_ui.connect (slot);
2338 Connection signal_connect_set_candidate_position (InfoManagerSlotIntInt* slot) {
2339 return m_signal_set_candidate_position.connect (slot);
2342 Connection signal_connect_get_candidate_geometry (InfoManagerSlotRect* slot) {
2343 return m_signal_get_candidate_geometry.connect (slot);
2346 Connection signal_connect_get_input_panel_geometry (InfoManagerSlotRect* slot) {
2347 return m_signal_get_input_panel_geometry.connect (slot);
2350 Connection signal_connect_set_keyboard_ise (InfoManagerSlotString* slot) {
2351 return m_signal_set_keyboard_ise.connect (slot);
2354 Connection signal_connect_get_keyboard_ise (InfoManagerSlotString2* slot) {
2355 return m_signal_get_keyboard_ise.connect (slot);
2358 Connection signal_connect_show_help (InfoManagerSlotString* slot) {
2359 return m_signal_show_help.connect (slot);
2362 Connection signal_connect_show_factory_menu (InfoManagerSlotFactoryInfoVector* slot) {
2363 return m_signal_show_factory_menu.connect (slot);
2366 Connection signal_connect_show_preedit_string (InfoManagerSlotVoid* slot) {
2367 return m_signal_show_preedit_string.connect (slot);
2370 Connection signal_connect_show_aux_string (InfoManagerSlotVoid* slot) {
2371 return m_signal_show_aux_string.connect (slot);
2374 Connection signal_connect_show_lookup_table (InfoManagerSlotVoid* slot) {
2375 return m_signal_show_lookup_table.connect (slot);
2378 Connection signal_connect_show_associate_table (InfoManagerSlotVoid* slot) {
2379 return m_signal_show_associate_table.connect (slot);
2382 Connection signal_connect_hide_preedit_string (InfoManagerSlotVoid* slot) {
2383 return m_signal_hide_preedit_string.connect (slot);
2386 Connection signal_connect_hide_aux_string (InfoManagerSlotVoid* slot) {
2387 return m_signal_hide_aux_string.connect (slot);
2390 Connection signal_connect_hide_lookup_table (InfoManagerSlotVoid* slot) {
2391 return m_signal_hide_lookup_table.connect (slot);
2394 Connection signal_connect_hide_associate_table (InfoManagerSlotVoid* slot) {
2395 return m_signal_hide_associate_table.connect (slot);
2398 Connection signal_connect_update_preedit_string (InfoManagerSlotAttributeStringInt* slot) {
2399 return m_signal_update_preedit_string.connect (slot);
2402 Connection signal_connect_update_preedit_caret (InfoManagerSlotInt* slot) {
2403 return m_signal_update_preedit_caret.connect (slot);
2406 Connection signal_connect_recapture_string (InfoManagerSlotAttributeInt2String2* slot) {
2407 return m_signal_recapture_string.connect (slot);
2410 Connection signal_connect_update_aux_string (InfoManagerSlotAttributeString* slot) {
2411 return m_signal_update_aux_string.connect (slot);
2414 Connection signal_connect_update_lookup_table (InfoManagerSlotLookupTable* slot) {
2415 return m_signal_update_lookup_table.connect (slot);
2418 Connection signal_connect_update_associate_table (InfoManagerSlotLookupTable* slot) {
2419 return m_signal_update_associate_table.connect (slot);
2422 Connection signal_connect_register_properties (InfoManagerSlotPropertyList* slot) {
2423 return m_signal_register_properties.connect (slot);
2426 Connection signal_connect_update_property (InfoManagerSlotProperty* slot) {
2427 return m_signal_update_property.connect (slot);
2430 Connection signal_connect_register_helper_properties (InfoManagerSlotIntPropertyList* slot) {
2431 return m_signal_register_helper_properties.connect (slot);
2434 Connection signal_connect_update_helper_property (InfoManagerSlotIntProperty* slot) {
2435 return m_signal_update_helper_property.connect (slot);
2438 Connection signal_connect_register_helper (InfoManagerSlotIntHelperInfo* slot) {
2439 return m_signal_register_helper.connect (slot);
2442 Connection signal_connect_remove_helper (InfoManagerSlotInt* slot) {
2443 return m_signal_remove_helper.connect (slot);
2446 Connection signal_connect_set_active_ise_by_uuid (InfoManagerSlotStringBool* slot) {
2447 return m_signal_set_active_ise_by_uuid.connect (slot);
2450 Connection signal_connect_focus_in (InfoManagerSlotVoid* slot) {
2451 return m_signal_focus_in.connect (slot);
2454 Connection signal_connect_focus_out (InfoManagerSlotVoid* slot) {
2455 return m_signal_focus_out.connect (slot);
2458 Connection signal_connect_expand_candidate (InfoManagerSlotVoid* slot) {
2459 return m_signal_expand_candidate.connect (slot);
2462 Connection signal_connect_contract_candidate (InfoManagerSlotVoid* slot) {
2463 return m_signal_contract_candidate.connect (slot);
2466 Connection signal_connect_select_candidate (InfoManagerSlotInt* slot) {
2467 return m_signal_select_candidate.connect (slot);
2470 Connection signal_connect_get_ise_list (InfoManagerSlotBoolStringVector* slot) {
2471 return m_signal_get_ise_list.connect (slot);
2474 Connection signal_connect_get_all_helper_ise_info (InfoManagerSlotBoolHelperInfo* slot) {
2475 return m_signal_get_all_helper_ise_info.connect (slot);
2478 Connection signal_connect_set_has_option_helper_ise_info (InfoManagerSlotStringBool* slot) {
2479 return m_signal_set_has_option_helper_ise_info.connect (slot);
2482 Connection signal_connect_set_enable_helper_ise_info (InfoManagerSlotStringBool* slot) {
2483 return m_signal_set_enable_helper_ise_info.connect (slot);
2486 Connection signal_connect_show_helper_ise_list (InfoManagerSlotVoid* slot) {
2487 return m_signal_show_helper_ise_list.connect (slot);
2490 Connection signal_connect_show_helper_ise_selector (InfoManagerSlotVoid* slot) {
2491 return m_signal_show_helper_ise_selector.connect (slot);
2494 Connection signal_connect_is_helper_ise_enabled (InfoManagerSlotStringInt* slot) {
2495 return m_signal_is_helper_ise_enabled.connect (slot);
2498 Connection signal_connect_get_ise_information (InfoManagerSlotBoolString4int2* slot) {
2499 return m_signal_get_ise_information.connect (slot);
2502 Connection signal_connect_get_keyboard_ise_list (InfoManagerSlotBoolStringVector* slot) {
2503 return m_signal_get_keyboard_ise_list.connect (slot);
2506 Connection signal_connect_update_ise_geometry (InfoManagerSlotIntIntIntInt* slot) {
2507 return m_signal_update_ise_geometry.connect (slot);
2510 Connection signal_connect_get_language_list (InfoManagerSlotStringVector* slot) {
2511 return m_signal_get_language_list.connect (slot);
2514 Connection signal_connect_get_all_language (InfoManagerSlotStringVector* slot) {
2515 return m_signal_get_all_language.connect (slot);
2518 Connection signal_connect_get_ise_language (InfoManagerSlotStrStringVector* slot) {
2519 return m_signal_get_ise_language.connect (slot);
2522 Connection signal_connect_get_ise_info_by_uuid (InfoManagerSlotStringISEINFO* slot) {
2523 return m_signal_get_ise_info_by_uuid.connect (slot);
2526 Connection signal_connect_send_key_event (InfoManagerSlotKeyEvent* slot) {
2527 return m_signal_send_key_event.connect (slot);
2530 Connection signal_connect_accept_connection (InfoManagerSlotInt* slot) {
2531 return m_signal_accept_connection.connect (slot);
2534 Connection signal_connect_close_connection (InfoManagerSlotInt* slot) {
2535 return m_signal_close_connection.connect (slot);
2538 Connection signal_connect_exit (InfoManagerSlotVoid* slot) {
2539 return m_signal_exit.connect (slot);
2542 Connection signal_connect_transaction_start (InfoManagerSlotVoid* slot) {
2543 return m_signal_transaction_start.connect (slot);
2546 Connection signal_connect_transaction_end (InfoManagerSlotVoid* slot) {
2547 return m_signal_transaction_end.connect (slot);
2550 Connection signal_connect_lock (InfoManagerSlotVoid* slot) {
2551 return m_signal_lock.connect (slot);
2554 Connection signal_connect_unlock (InfoManagerSlotVoid* slot) {
2555 return m_signal_unlock.connect (slot);
2558 Connection signal_connect_update_input_context (InfoManagerSlotIntInt* slot) {
2559 return m_signal_update_input_context.connect (slot);
2562 Connection signal_connect_update_language_locale(InfoManagerSlotString* slot) {
2563 return m_signal_update_language_locale.connect(slot);
2566 Connection signal_connect_show_ise (InfoManagerSlotVoid* slot) {
2567 return m_signal_show_ise.connect (slot);
2570 Connection signal_connect_hide_ise (InfoManagerSlotVoid* slot) {
2571 return m_signal_hide_ise.connect (slot);
2574 Connection signal_connect_will_show_ack (InfoManagerSlotVoid* slot) {
2575 return m_signal_will_show_ack.connect (slot);
2578 Connection signal_connect_will_hide_ack (InfoManagerSlotVoid* slot) {
2579 return m_signal_will_hide_ack.connect (slot);
2582 Connection signal_connect_set_keyboard_mode (InfoManagerSlotInt* slot) {
2583 return m_signal_set_keyboard_mode.connect (slot);
2586 Connection signal_connect_candidate_will_hide_ack (InfoManagerSlotVoid* slot) {
2587 return m_signal_candidate_will_hide_ack.connect (slot);
2590 Connection signal_connect_get_ise_state (InfoManagerSlotInt2* slot) {
2591 return m_signal_get_ise_state.connect (slot);
2594 Connection signal_connect_run_helper (InfoManagerSlotString3* slot)
2596 return m_signal_run_helper.connect (slot);
2599 Connection signal_connect_launch_option_application (InfoManagerSlotBoolString* slot)
2601 return m_signal_launch_option_application.connect (slot);
2604 Connection signal_connect_get_recent_ise_geometry (InfoManagerSlotIntRect* slot) {
2605 return m_signal_get_recent_ise_geometry.connect (slot);
2608 Connection signal_connect_check_privilege_by_sockfd (InfoManagerSlotIntString2* slot)
2610 return m_signal_check_privilege_by_sockfd.connect (slot);
2613 Connection signal_connect_remoteinput_send_input_message (InfoManagerSlotStringBool* slot)
2615 return m_signal_remoteinput_send_input_message.connect (slot);
2618 Connection signal_connect_remoteinput_send_surrounding_text (InfoManagerSlotIntString* slot)
2620 return m_signal_remoteinput_send_surrounding_text.connect (slot);
2623 //ISM_TRANS_CMD_REGISTER_PANEL_CLIENT
2624 void register_panel_client (uint32 client_id, uint32 id) {
2625 m_panel_client_map [client_id] = (int)id;
2627 //SCIM_TRANS_CMD_PANEL_REGISTER_INPUT_CONTEXT
2628 void register_input_context (uint32 client_id, uint32 context, String uuid) {
2629 uint32 ctx = get_helper_ic (m_panel_client_map[client_id], context);
2630 m_client_context_uuids [ctx] = uuid;
2632 //SCIM_TRANS_CMD_PANEL_REMOVE_INPUT_CONTEXT
2633 void remove_input_context (uint32 client_id, uint32 context) {
2634 uint32 ctx = get_helper_ic (m_panel_client_map[client_id], context);
2635 m_client_context_uuids.erase (ctx);
2637 if (ctx == get_helper_ic (m_current_socket_client, m_current_client_context)) {
2639 m_current_socket_client = m_last_socket_client;
2640 m_current_client_context = m_last_client_context;
2641 m_current_context_uuid = m_last_context_uuid;
2642 m_last_socket_client = -1;
2643 m_last_client_context = 0;
2644 m_last_context_uuid = String ("");
2646 if (m_current_socket_client == -1) {
2648 socket_update_control_panel ();
2652 } else if (ctx == get_helper_ic (m_last_socket_client, m_last_client_context)) {
2654 m_last_socket_client = -1;
2655 m_last_client_context = 0;
2656 m_last_context_uuid = String ("");
2660 if (m_client_context_uuids.size () == 0)
2661 m_signal_stop_default_ise (true);
2664 //SCIM_TRANS_CMD_PANEL_RESET_INPUT_CONTEXT
2665 void socket_reset_input_context (int client_id, uint32 context) {
2666 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_reset_input_context \n";
2668 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2669 socket_reset_helper_input_context (m_current_helper_uuid, m_panel_client_map[client_id], context);
2672 //SCIM_TRANS_CMD_FOCUS_IN
2673 void focus_in (int client_id, uint32 context, String uuid) {
2674 m_refocus_needed = true;
2675 bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false);
2676 if (launch_ise_on_request)
2677 m_signal_start_default_ise ();
2679 m_signal_focus_in ();
2680 focus_in_helper (m_current_helper_uuid, m_panel_client_map[client_id], context);
2681 SCIM_DEBUG_MAIN (2) << "PanelAgent::focus_in (" << client_id << "," << context << "," << uuid << ")\n";
2682 m_active_client_id = client_id;
2685 if (m_current_socket_client >= 0) {
2686 m_last_socket_client = m_current_socket_client;
2687 m_last_client_context = m_current_client_context;
2688 m_last_context_uuid = m_current_context_uuid;
2691 m_current_socket_client = m_panel_client_map[client_id];
2692 m_current_client_context = context;
2693 m_current_context_uuid = uuid;
2697 //SCIM_TRANS_CMD_FOCUS_OUT
2698 void focus_out (int client_id, uint32 context) {
2699 m_refocus_needed = false;
2700 m_signal_focus_out ();
2702 focus_out_helper (m_current_helper_uuid, m_panel_client_map[client_id], context);
2704 if (m_current_socket_client >= 0) {
2705 m_last_socket_client = m_current_socket_client;
2706 m_last_client_context = m_current_client_context;
2707 m_last_context_uuid = m_current_context_uuid;
2710 m_current_socket_client = -1;
2711 m_current_client_context = 0;
2712 m_current_context_uuid = String ("");
2716 //ISM_TRANS_CMD_TURN_ON_LOG
2717 void socket_turn_on_log (uint32 isOn) {
2719 DebugOutput::enable_debug (SCIM_DEBUG_AllMask);
2720 DebugOutput::set_verbose_level (7);
2721 SCIM_DEBUG_MAIN (4) << __func__ << " on\n";
2723 SCIM_DEBUG_MAIN (4) << __func__ << " off\n";
2724 DebugOutput::disable_debug (SCIM_DEBUG_AllMask);
2725 DebugOutput::set_verbose_level (0);
2729 uint32 focused_context;
2730 get_focused_context (focused_client, focused_context);
2732 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
2733 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
2735 if (it != m_helper_client_index.end ()) {
2736 //uint32 ctx = get_helper_ic (focused_client, focused_context);
2738 //m_panel_agent_manager.socket_turn_on_log (it->second.id, ctx, m_current_helper_uuid, isOn);
2742 if (focused_client == -1) {
2743 std::cerr << __func__ << " get_focused_context is failed!!!\n";
2747 ClientInfo client_info = socket_get_client_info (focused_client);
2749 if (client_info.type == FRONTEND_CLIENT) {
2751 //m_panel_agent_manager.socket_turn_on_log (focused_client, focused_context, isOn);
2756 void add_client (int client_id, uint32 key, ClientType type) {
2757 LOGD ("id:%d, key:%d, type:%d", client_id, key, type);
2761 SCIM_DEBUG_MAIN (4) << "Add client to repository. Type=" << type << " key=" << key << "\n";
2763 m_client_repository [client_id] = info;
2765 if (info.type == IMCONTROL_ACT_CLIENT) {
2766 m_pending_active_imcontrol_id = client_id;
2767 } else if (info.type == IMCONTROL_CLIENT) {
2768 m_imcontrol_map [m_pending_active_imcontrol_id] = client_id;
2769 m_pending_active_imcontrol_id = -1;
2770 } else if (info.type == REMOTEINPUT_ACT_CLIENT) {
2771 m_current_send_remoteinput_id.push_back (client_id);
2772 } else if (info.type == REMOTEINPUT_CLIENT) {
2773 m_current_recv_remoteinput_id.push_back (client_id);
2776 LOGD ("%d clients connecting", m_client_repository.size());
2781 void del_client (int client_id) {
2782 ClientRepository::iterator iter = m_client_repository.find(client_id);
2783 if (iter == m_client_repository.end()) {
2784 LOGW("The client with id %d does not exist in our client repository, returning", client_id);
2788 m_signal_close_connection (client_id);
2789 ClientInfo client_info = socket_get_client_info (client_id);
2790 m_client_repository.erase (client_id);
2791 LOGD ("id:%d, type:%d", client_id, client_info.type);
2792 #ifdef PANEL_SERVER_AUTO_EXIT
2793 /* Exit panel if there is no connected client anymore. */
2794 if (client_info.type != UNKNOWN_CLIENT && m_client_repository.size () == 0 && !m_should_resident) {
2795 SCIM_DEBUG_MAIN (4) << "Exit Socket Server Thread.\n";
2796 server->shutdown ();
2797 m_signal_exit.emit ();
2802 if (client_info.type == FRONTEND_CLIENT) {
2803 SCIM_DEBUG_MAIN (4) << "It's a FrontEnd client.\n";
2805 /* The focused client is closed. */
2806 if (m_current_socket_client == client_id) {
2807 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2808 hide_helper (m_current_helper_uuid);
2811 m_current_socket_client = -1;
2812 m_current_client_context = 0;
2813 m_current_context_uuid = String ("");
2815 socket_transaction_start ();
2817 socket_transaction_end ();
2820 if (m_last_socket_client == client_id) {
2822 m_last_socket_client = -1;
2823 m_last_client_context = 0;
2824 m_last_context_uuid = String ("");
2828 /* Erase all associated Client Context UUIDs. */
2829 std::vector <uint32> ctx_list;
2830 ClientContextUUIDRepository::iterator it = m_client_context_uuids.begin ();
2832 for (; it != m_client_context_uuids.end (); ++it) {
2833 if ((it->first & 0xFFFF) == (client_id & 0xFFFF))
2834 ctx_list.push_back (it->first);
2837 for (size_t i = 0; i < ctx_list.size (); ++i)
2838 m_client_context_uuids.erase (ctx_list [i]);
2840 /* Erase all helperise info associated with the client */
2842 it = m_client_context_helper.begin ();
2844 for (; it != m_client_context_helper.end (); ++it) {
2845 if ((it->first & 0xFFFF) == (client_id & 0xFFFF)) {
2846 ctx_list.push_back (it->first);
2847 /* similar to stop_helper except that it will not call get_focused_context() */
2848 String uuid = it->second;
2850 if (m_helper_uuid_count.find (uuid) != m_helper_uuid_count.end ()) {
2851 uint32 count = m_helper_uuid_count[uuid];
2854 m_helper_uuid_count.erase (uuid);
2855 HelperClientIndex::iterator pise = m_helper_client_index.find (uuid);
2857 if (pise != m_helper_client_index.end ()) {
2858 stop_helper (uuid, pise->second.id, it->first);
2861 SCIM_DEBUG_MAIN (1) << "Stop HelperISE " << uuid << " ...\n";
2863 m_helper_uuid_count[uuid] = count - 1;
2864 focus_out_helper (uuid, (it->first & 0xFFFF), ((it->first >> 16) & 0x7FFF));
2865 SCIM_DEBUG_MAIN (1) << "Decrement usage count of HelperISE " << uuid
2866 << " to " << m_helper_uuid_count[uuid] << "\n";
2872 for (size_t i = 0; i < ctx_list.size (); ++i)
2873 m_client_context_helper.erase (ctx_list [i]);
2875 HelperInfoRepository::iterator iter = m_helper_info_repository.begin ();
2877 for (; iter != m_helper_info_repository.end (); iter++) {
2878 if (!m_current_helper_uuid.compare (iter->second.uuid))
2879 if (! (iter->second.option & ISM_ISE_HIDE_IN_CONTROL_PANEL))
2880 socket_update_control_panel ();
2882 } else if (client_info.type == FRONTEND_ACT_CLIENT) {
2883 SCIM_DEBUG_MAIN (4) << "It's a FRONTEND_ACT_CLIENT client.\n";
2884 IntIntRepository::iterator iter2 = m_panel_client_map.find (client_id);
2886 if (iter2 != m_panel_client_map.end ())
2887 m_panel_client_map.erase (iter2);
2888 } else if (client_info.type == HELPER_CLIENT) {
2889 SCIM_DEBUG_MAIN (4) << "It's a Helper client.\n";
2891 HelperInfoRepository::iterator hiit = m_helper_info_repository.find (client_id);
2893 if (hiit != m_helper_info_repository.end ()) {
2894 bool restart = false;
2895 String uuid = hiit->second.uuid;
2896 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
2898 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
2899 if ((hiit->second.option & SCIM_HELPER_AUTO_RESTART) &&
2900 (default_uuid.compare (uuid) == 0 || default_uuid.compare ("") == 0) &&
2901 (it != m_helper_client_index.end () && it->second.ref > 0)) {
2905 m_helper_client_index.erase (uuid);
2906 m_helper_info_repository.erase (hiit);
2908 m_signal_stop_default_ise (false);
2910 if (m_refocus_needed || m_reshow_needed)
2911 m_restart_needed = true;
2913 if (restart && !m_ise_exiting && m_restart_needed) {
2914 struct tms tiks_buf;
2915 static clock_t start_tiks = times (&tiks_buf);
2916 static double clock_tiks = (double)sysconf (_SC_CLK_TCK);
2917 clock_t curr_tiks = times (&tiks_buf);
2918 double secs = (double) (curr_tiks - start_tiks) / clock_tiks;
2919 //LOGE ("time second:%f", secs);
2920 static String restart_uuid;
2922 if (restart_uuid != uuid || secs > MIN_REPEAT_TIME) {
2923 scim_usleep (100000);
2927 get_focused_context(client, context);
2929 uint32 ic = get_helper_ic (client, context);
2931 /* Get the context uuid from the client context registration table. */
2933 ClientContextUUIDRepository::iterator it =
2934 m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client], context));
2936 if (it != m_client_context_uuids.end ())
2937 ic_uuid = it->second;
2940 m_start_helper_ic_index[uuid].push_back(std::make_pair(ic, ic_uuid));
2941 m_signal_run_helper (uuid, m_config_name, m_display_name);
2942 restart_uuid = uuid;
2943 LOGE ("Auto restart soft ISE:%s", uuid.c_str ());
2945 reset_default_ise (0);
2946 ISF_SAVE_LOG ("Auto restart is abnormal, reset default ISE");
2949 start_tiks = curr_tiks;
2953 m_ise_exiting = false;
2954 m_restart_needed = true;
2956 socket_transaction_start ();
2957 m_signal_remove_helper (client_id);
2958 socket_transaction_end ();
2959 } else if (client_info.type == HELPER_ACT_CLIENT) {
2960 SCIM_DEBUG_MAIN (4) << "It's a Helper passive client.\n";
2962 HelperInfoRepository::iterator hiit = m_helper_active_info_repository.find (client_id);
2964 if (hiit != m_helper_active_info_repository.end ())
2965 m_helper_active_info_repository.erase (hiit);
2968 } else if (client_info.type == IMCONTROL_ACT_CLIENT) {
2969 SCIM_DEBUG_MAIN (4) << "It's a IMCONTROL_ACT_CLIENT client.\n";
2970 IMControlRepository::iterator iter = m_imcontrol_repository.find (client_id);
2972 if (iter != m_imcontrol_repository.end ()) {
2973 int size = iter->second.info.size ();
2977 stop_helper ((iter->second.info)[i].uuid, (iter->second.count)[i], DEFAULT_CONTEXT_VALUE);
2979 if ((iter->second.info)[i].option & ISM_ISE_HIDE_IN_CONTROL_PANEL)
2980 m_current_helper_uuid = m_last_helper_uuid;
2985 m_imcontrol_repository.erase (iter);
2988 IntIntRepository::iterator iter2 = m_imcontrol_map.find (client_id);
2990 if (iter2 != m_imcontrol_map.end ())
2991 m_imcontrol_map.erase (iter2);
2992 } else if (client_info.type == REMOTEINPUT_ACT_CLIENT) {
2993 SCIM_DEBUG_MAIN (4) << "It's a REMOTEINPUT_ACT_CLIENT client.\n";
2995 for (unsigned int i = 0; i < m_current_send_remoteinput_id.size (); i++) {
2996 if (m_current_send_remoteinput_id.at (i) == client_id) {
2997 m_current_send_remoteinput_id.erase (m_current_send_remoteinput_id.begin () + i);
3001 } else if (client_info.type == REMOTEINPUT_CLIENT) {
3002 SCIM_DEBUG_MAIN (4) << "It's a REMOTEINPUT_CLIENT client.\n";
3004 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3005 if (m_current_recv_remoteinput_id.at (i) == client_id) {
3006 m_current_recv_remoteinput_id.erase (m_current_recv_remoteinput_id.begin () + i);
3010 } else if (client_info.type == CONFIG_CLIENT) {
3011 SCIM_DEBUG_MAIN(4) << "It's a CONFIG_CLIENT client.\n";
3013 LOGI ("clients: %d, panel clients: %d, imcontrols size: %d, helper infos: %d, \
3014 helper active infos: %d, helper client indexs: %d, ises pending: %d, \
3015 imcontrols: %d, start helper ic indexs: %d, client context uuids: %d, \
3016 client context helpers: %d, helpers uuid count: %d",
3017 m_client_repository.size(),
3018 m_panel_client_map.size(),
3019 m_imcontrol_map.size(),
3020 m_helper_info_repository.size(),
3021 m_helper_active_info_repository.size(),
3022 m_helper_client_index.size(),
3023 m_ise_pending_repository.size(),
3024 m_imcontrol_repository.size(),
3025 m_start_helper_ic_index.size(),
3026 m_client_context_uuids.size(),
3027 m_client_context_helper.size(),
3028 m_helper_uuid_count.size());
3031 const ClientInfo& socket_get_client_info (int client) {
3032 static ClientInfo null_client = { 0, UNKNOWN_CLIENT };
3033 ClientRepository::iterator it = m_client_repository.find (client);
3035 if (it != m_client_repository.end ())
3041 //SCIM_TRANS_CMD_PANEL_TURN_ON
3042 void socket_turn_on (void) {
3043 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_turn_on ()\n";
3044 m_signal_turn_on ();
3046 //SCIM_TRANS_CMD_PANEL_TURN_OFF
3047 void socket_turn_off (void) {
3048 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_turn_off ()\n";
3049 m_signal_turn_off ();
3051 //SCIM_TRANS_CMD_UPDATE_SCREEN
3052 void socket_update_screen (int client_id, uint32 num) {
3053 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_screen ()\n";
3055 if (((int) num) != m_current_screen) {
3056 SCIM_DEBUG_MAIN (4) << "New Screen number = " << num << "\n";
3057 m_signal_update_screen ((int) num);
3058 helper_all_update_screen ((int) num);
3059 m_current_screen = (num);
3062 //SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
3063 void socket_update_spot_location (uint32 x, uint32 y, uint32 top_y) {
3064 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_spot_location ()\n";
3065 SCIM_DEBUG_MAIN (4) << "New Spot location x=" << x << " y=" << y << "\n";
3066 m_signal_update_spot_location ((int)x, (int)y, (int)top_y);
3067 helper_all_update_spot_location ((int)x, (int)y);
3069 //ISM_TRANS_CMD_UPDATE_CURSOR_POSITION
3070 void socket_update_cursor_position (uint32 cursor_pos) {
3071 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_cursor_position ()\n";
3072 SCIM_DEBUG_MAIN (4) << "New cursor position pos=" << cursor_pos << "\n";
3073 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
3074 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
3075 iseContext->cursor_pos = static_cast<int>(cursor_pos);
3077 helper_all_update_cursor_position ((int)cursor_pos);
3079 //ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT
3080 void socket_update_surrounding_text (String text, uint32 cursor) {
3081 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3082 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3084 if (it != m_helper_client_index.end ()) {
3089 get_focused_context (client, context);
3090 ctx = get_helper_ic (client, context);
3091 m_panel_agent_manager.socket_update_surrounding_text (it->second.id, ctx, m_current_helper_uuid, text, cursor);
3096 void remoteinput_callback_focus_in () {
3097 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3099 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3101 m_panel_agent_manager.socket_remoteinput_focus_in (m_current_recv_remoteinput_id.at (i));
3106 void remoteinput_callback_focus_out () {
3107 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3109 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3111 m_panel_agent_manager.socket_remoteinput_focus_out (m_current_recv_remoteinput_id.at (i));
3116 void remoteinput_callback_entry_metadata (uint32 hint, uint32 layout, int variation, uint32 autocapital_type, int return_key_disabled) {
3117 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3118 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
3119 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
3120 iseContext->layout = static_cast<Ecore_IMF_Input_Panel_Layout>(layout);
3121 iseContext->return_key_disabled = static_cast<Eina_Bool>(return_key_disabled);
3122 iseContext->layout_variation = static_cast<int>(variation);
3123 iseContext->autocapital_type = static_cast<Ecore_IMF_Autocapital_Type>(autocapital_type);
3124 iseContext->input_hint = static_cast<Ecore_IMF_Input_Hints>(hint);
3126 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3128 m_panel_agent_manager.socket_remoteinput_entry_metadata (m_current_recv_remoteinput_id.at (i), hint, layout, variation, autocapital_type, return_key_disabled);
3133 void remoteinput_callback_surrounding_text (String text, uint32 cursor) {
3134 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3136 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3138 m_panel_agent_manager.socket_remoteinput_surrounding_text (m_current_recv_remoteinput_id.at (i), text, cursor);
3143 void remoteinput_callback_input_resource (uint32 input_resource) {
3144 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3146 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3148 m_panel_agent_manager.socket_remoteinput_input_resource (m_current_recv_remoteinput_id.at (i), input_resource);
3153 //ISM_TRANS_CMD_UPDATE_SELECTION
3154 void socket_update_selection (String text) {
3155 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3156 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3158 if (it != m_helper_client_index.end ()) {
3163 get_focused_context (client, context);
3164 ctx = get_helper_ic (client, context);
3165 m_panel_agent_manager.socket_update_selection (it->second.id, ctx, m_current_helper_uuid, text);
3169 //SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO
3170 void socket_update_factory_info (PanelFactoryInfo& info) {
3171 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_factory_info ()\n";
3172 SCIM_DEBUG_MAIN (4) << "New Factory info uuid=" << info.uuid << " name=" << info.name << "\n";
3173 info.lang = scim_get_normalized_language (info.lang);
3174 m_signal_update_factory_info (info);
3176 //SCIM_TRANS_CMD_PANEL_SHOW_HELP
3177 void socket_show_help (String help) {
3178 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_help ()\n";
3179 m_signal_show_help (help);
3181 //SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU
3182 void socket_show_factory_menu (std::vector <PanelFactoryInfo>& vec) {
3183 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_factory_menu ()\n";
3186 m_signal_show_factory_menu (vec);
3189 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
3190 void socket_show_preedit_string (void) {
3191 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_preedit_string ()\n";
3192 m_signal_show_preedit_string ();
3194 //SCIM_TRANS_CMD_SHOW_AUX_STRING
3195 void socket_show_aux_string (void) {
3196 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_aux_string ()\n";
3197 m_signal_show_aux_string ();
3199 //SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE
3200 void socket_show_lookup_table (void) {
3201 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_lookup_table ()\n";
3202 m_signal_show_lookup_table ();
3204 //ISM_TRANS_CMD_SHOW_ASSOCIATE_TABLE
3205 void socket_show_associate_table (void) {
3206 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_associate_table ()\n";
3207 m_signal_show_associate_table ();
3209 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
3210 void socket_hide_preedit_string (void) {
3211 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_preedit_string ()\n";
3212 m_signal_hide_preedit_string ();
3214 //SCIM_TRANS_CMD_HIDE_AUX_STRING
3215 void socket_hide_aux_string (void) {
3216 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_aux_string ()\n";
3217 m_signal_hide_aux_string ();
3219 //SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE
3220 void socket_hide_lookup_table (void) {
3221 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_lookup_table ()\n";
3222 m_signal_hide_lookup_table ();
3224 //ISM_TRANS_CMD_HIDE_ASSOCIATE_TABLE
3225 void socket_hide_associate_table (void) {
3226 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_associate_table ()\n";
3227 m_signal_hide_associate_table ();
3229 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
3230 void socket_update_preedit_string (String& str, const AttributeList& attrs, uint32 caret) {
3231 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_string ()\n";
3232 m_signal_update_preedit_string (str, attrs, (int) caret);
3234 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
3235 void socket_update_preedit_caret (uint32 caret) {
3236 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_caret ()\n";
3237 m_signal_update_preedit_caret ((int) caret);
3239 //ISM_TRANS_CMD_RECAPTURE_STRING
3240 void socket_recapture_string (int offset, int len, String& preedit, String& commit, const AttributeList& attrs) {
3241 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_caret ()\n";
3242 m_signal_recapture_string (offset, len, preedit, commit, attrs);
3244 //SCIM_TRANS_CMD_UPDATE_AUX_STRING
3245 void socket_update_aux_string (String& str, const AttributeList& attrs) {
3246 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_aux_string ()\n";
3247 m_signal_update_aux_string (str, attrs);
3248 m_is_imengine_aux = true;
3250 //SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE
3251 void socket_update_lookup_table (const LookupTable& table) {
3252 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_lookup_table ()\n";
3254 //g_isf_candidate_table = _isf_candidate_table;
3255 m_signal_update_lookup_table (table);
3256 m_is_imengine_candidate = true;
3258 //ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE
3259 void socket_update_associate_table (const LookupTable& table) {
3260 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_associate_table ()\n";
3261 m_signal_update_associate_table (table);
3264 void socket_update_control_panel (void) {
3265 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_control_panel ()\n";
3267 m_signal_get_keyboard_ise (name, uuid);
3268 PanelFactoryInfo info;
3270 if (name.length () > 0)
3271 info = PanelFactoryInfo (uuid, name, String (""), String (""));
3273 info = PanelFactoryInfo (String (""), String (_ ("English Keyboard")), String ("C"), String (SCIM_KEYBOARD_ICON_FILE));
3275 m_signal_update_factory_info (info);
3277 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
3278 void socket_register_properties (const PropertyList& properties) {
3279 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_register_properties ()\n";
3280 m_signal_register_properties (properties);
3282 //SCIM_TRANS_CMD_UPDATE_PROPERTY
3283 void socket_update_property (const Property& property) {
3284 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_property ()\n";
3285 m_signal_update_property (property);
3287 //ISM_TRANS_CMD_GET_KEYBOARD_ISE_LIST
3288 void socket_get_keyboard_ise_list (String& uuid) {
3289 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_keyboard_ise_list ()\n";
3290 std::vector<String> list;
3292 m_signal_get_keyboard_ise_list (list);
3293 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3295 if (it != m_helper_client_index.end ()) {
3298 get_focused_context (client, context);
3299 uint32 ctx = get_helper_ic (client, context);
3300 m_panel_agent_manager.socket_get_keyboard_ise_list (it->second.id, ctx, uuid, list);
3303 //ISM_TRANS_CMD_SET_CANDIDATE_UI
3304 void socket_set_candidate_ui (uint32 portrait_line, uint32 mode) {
3305 SCIM_DEBUG_MAIN (4) << __func__ << " \n";
3306 m_signal_set_candidate_ui (portrait_line, mode);
3308 //ISM_TRANS_CMD_GET_CANDIDATE_UI
3309 void socket_get_candidate_ui (String uuid) {
3310 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_candidate_ui ()\n";
3311 int style = 0, mode = 0;
3312 m_signal_get_candidate_ui (style, mode);
3313 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3315 if (it != m_helper_client_index.end ()) {
3318 get_focused_context (client, context);
3319 uint32 ctx = get_helper_ic (client, context);
3320 m_panel_agent_manager.socket_get_candidate_ui (it->second.id, ctx, uuid, style, mode);
3323 //ISM_TRANS_CMD_SET_CANDIDATE_POSITION
3324 void socket_set_candidate_position (uint32 left, uint32 top) {
3325 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_candidate_position ()\n";
3326 m_signal_set_candidate_position (left, top);
3328 //ISM_TRANS_CMD_HIDE_CANDIDATE
3329 void socket_hide_candidate (void) {
3330 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_candidate ()\n";
3331 m_signal_hide_preedit_string ();
3332 m_signal_hide_aux_string ();
3333 m_signal_hide_lookup_table ();
3334 m_signal_hide_associate_table ();
3336 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
3337 void socket_get_candidate_geometry (String& uuid) {
3338 SCIM_DEBUG_MAIN (4) << __func__ << " \n";
3339 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3341 if (it != m_helper_client_index.end ()) {
3342 struct rectinfo info = {0, 0, 0, 0};
3343 m_signal_get_candidate_geometry (info);
3346 get_focused_context (client, context);
3347 uint32 ctx = get_helper_ic (client, context);
3348 m_panel_agent_manager.socket_get_candidate_geometry (it->second.id, ctx, uuid, info);
3351 //ISM_TRANS_CMD_SET_KEYBOARD_ISE_BY_UUID
3352 void socket_set_keyboard_ise (String uuid) {
3353 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_keyboard_ise ()\n";
3355 m_signal_set_keyboard_ise (uuid);
3357 //ISM_TRANS_CMD_SELECT_CANDIDATE
3358 void socket_helper_select_candidate (uint32 index) {
3359 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_keyboard_ise ()\n";
3361 m_signal_select_candidate (index);
3363 //ISM_TRANS_CMD_UPDATE_ISE_GEOMETRY
3364 void socket_helper_update_ise_geometry (int client, uint32 x, uint32 y, uint32 width, uint32 height) {
3365 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3368 uint32 focused_context;
3369 HelperInfoRepository::iterator it = m_helper_active_info_repository.find (client);
3371 if (it != m_helper_active_info_repository.end ()) {
3372 if (it->second.uuid == m_current_helper_uuid) {
3373 m_signal_update_ise_geometry (x, y, width, height);
3375 get_focused_context (focused_client, focused_context);
3376 ClientInfo client_info = socket_get_client_info (focused_client);
3377 if (client_info.type == FRONTEND_CLIENT) {
3378 m_panel_agent_manager.update_ise_geometry (focused_client, focused_context, x, y, width, height);
3383 //ISM_TRANS_CMD_GET_KEYBOARD_ISE
3384 void socket_get_keyboard_ise (String uuid) {
3385 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_keyboard_ise ()\n";
3386 String ise_name, ise_uuid;
3390 get_focused_context (client, context);
3391 ctx = get_helper_ic (client, context);
3393 if (m_client_context_uuids.find (ctx) != m_client_context_uuids.end ())
3394 ise_uuid = m_client_context_uuids[ctx];
3396 m_signal_get_keyboard_ise (ise_name, ise_uuid);
3397 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3399 if (it != m_helper_client_index.end ()) {
3400 get_focused_context (client, context);
3401 ctx = get_helper_ic (client, context);
3402 m_panel_agent_manager.socket_get_keyboard_ise (it->second.id, ctx, uuid, ise_name, ise_uuid);
3406 //SCIM_TRANS_CMD_START_HELPER
3407 void socket_start_helper (int client_id, uint32 context, String uuid) {
3408 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_start_helper ()\n";
3409 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3411 uint32 ic = get_helper_ic (m_panel_client_map[client_id], context);
3413 /* Get the context uuid from the client context registration table. */
3415 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3417 if (it != m_client_context_uuids.end ())
3418 ic_uuid = it->second;
3421 if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3422 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3423 } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3424 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3427 if (it == m_helper_client_index.end ()) {
3428 SCIM_DEBUG_MAIN (5) << "Run this Helper.\n";
3429 m_start_helper_ic_index [uuid].push_back (std::make_pair (ic, ic_uuid));
3430 m_signal_run_helper (uuid, m_config_name, m_display_name);
3432 SCIM_DEBUG_MAIN (5) << "Increase the Reference count.\n";
3433 m_panel_agent_manager.socket_start_helper (it->second.id, ic, ic_uuid);
3439 //SCIM_TRANS_CMD_STOP_HELPER
3440 void socket_stop_helper (int client_id, uint32 context, String uuid) {
3441 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_stop_helper ()\n";
3442 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3444 uint32 ic = get_helper_ic (m_panel_client_map[client_id], context);
3446 if (it != m_helper_client_index.end ()) {
3447 SCIM_DEBUG_MAIN (5) << "Decrase the Reference count.\n";
3450 /* Get the context uuid from the client context registration table. */
3452 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3454 if (it != m_client_context_uuids.end ())
3455 ic_uuid = it->second;
3458 if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3459 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3460 } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3461 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3464 m_panel_agent_manager.helper_detach_input_context (it->second.id, ic, ic_uuid);
3466 if (it->second.ref <= 0)
3467 m_panel_agent_manager.exit (it->second.id, ic);
3472 //SCIM_TRANS_CMD_SEND_HELPER_EVENT
3473 void socket_send_helper_event (int client_id, uint32 context, String uuid, const Transaction& _nest_trans) {
3474 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_send_helper_event ()\n";
3475 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3477 if (it != m_helper_client_index.end ()) {
3479 /* Get the context uuid from the client context registration table. */
3481 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3483 if (it != m_client_context_uuids.end ())
3484 ic_uuid = it->second;
3487 if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3488 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3489 } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3490 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3493 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);
3497 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
3498 void socket_helper_register_properties (int client, PropertyList& properties) {
3499 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_properties (" << client << ")\n";
3500 m_signal_register_helper_properties (client, properties);
3502 #if 0 //why? remove if useless, infinite loop
3503 /* Check whether application is already focus_in */
3504 if (m_current_socket_client != -1) {
3505 SCIM_DEBUG_MAIN (2) << "Application is already focus_in!\n";
3506 focus_in_helper (m_current_helper_uuid, m_current_socket_client, m_current_client_context);
3507 reset_keyboard_ise ();
3510 /* Check whether ISE panel is already shown */
3511 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode && m_ise_context_length > 0) {
3512 SCIM_DEBUG_MAIN (2) << "Re-show ISE panel!\n";
3514 uint32 focused_context;
3515 get_focused_context (focused_client, focused_context);
3517 if (focused_client == -1 && m_active_client_id != -1) {
3518 focused_client = m_panel_client_map[m_active_client_id];
3519 focused_context = 0;
3522 uint32 ctx = get_helper_ic (focused_client, focused_context);
3523 bool ret = show_helper (m_current_helper_uuid, m_ise_context_buffer, m_ise_context_length, ctx);
3526 m_signal_show_ise ();
3530 //SCIM_TRANS_CMD_UPDATE_PROPERTY
3531 void socket_helper_update_property (int client, Property& property) {
3532 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_property (" << client << ")\n";
3533 m_signal_update_helper_property (client, property);
3535 //SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT
3536 void socket_helper_send_imengine_event (int client, uint32 target_ic, String target_uuid , Transaction& nest_trans) {
3537 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_send_imengine_event (" << client << ")\n";
3538 HelperInfoRepository::iterator hiit = m_helper_active_info_repository.find (client);
3540 if (hiit != m_helper_active_info_repository.end ()) {
3542 uint32 target_context;
3543 get_imengine_client_context (target_ic, target_client, target_context);
3545 uint32 focused_context;
3546 String focused_uuid;
3547 focused_uuid = get_focused_context (focused_client, focused_context);
3549 if (target_ic == (uint32) (-1)) {
3550 target_client = focused_client;
3551 target_context = focused_context;
3554 if (target_uuid.length () == 0)
3555 target_uuid = focused_uuid;
3557 ClientInfo client_info = socket_get_client_info (target_client);
3558 SCIM_DEBUG_MAIN (5) << "Target UUID = " << target_uuid << " Focused UUId = " << focused_uuid << "\nTarget Client = " << target_client << "\n";
3560 if (client_info.type == FRONTEND_CLIENT) {
3561 /* If the original context value is greater than 0x7FFF, the line below would not work properly
3562 since the target_context acquired by get_imengnie_client_context() is always smaller than 0x7FFF.
3563 But since the send_imengine_event() of scim_helper module will call IMEngine's
3564 process_helper_event() function directly, instead of sending SEND_IMENGINE_EVENT message.
3565 So we are not going to handle this kind of exceptional case for now. */
3566 m_panel_agent_manager.process_helper_event (target_client, target_context, target_uuid, hiit->second.uuid, nest_trans);
3571 void socket_helper_key_event_op (int client, int cmd, uint32 target_ic, String& target_uuid, KeyEvent& key) {
3572 if (!key.empty ()) {
3574 uint32 target_context;
3575 get_imengine_client_context (target_ic, target_client, target_context);
3577 uint32 focused_context;
3578 String focused_uuid;
3579 focused_uuid = get_focused_context (focused_client, focused_context);
3581 if (target_ic == (uint32) (-1)) {
3582 target_client = focused_client;
3583 target_context = focused_context;
3586 if (target_uuid.length () == 0)
3587 target_uuid = focused_uuid;
3589 if (target_client == -1) {
3590 /* FIXUP: monitor 'Invalid Window' error */
3591 LOGW ("focused target client is NULL");
3592 } else if (target_uuid == focused_uuid &&
3593 clients_equal (target_client, focused_client) &&
3594 contexts_equal (target_context, focused_context)) {
3595 ClientInfo client_info = socket_get_client_info (focused_client);
3597 if (client_info.type == FRONTEND_CLIENT) {
3598 m_panel_agent_manager.socket_helper_key_event (focused_client, focused_context, cmd, key);
3601 LOGD ("[target_client : %d, focused_client : %d] => %d, [target_context : %u, focused_context : %u] => %d",
3602 target_client, focused_client, clients_equal (target_client, focused_client),
3603 target_context, focused_context, contexts_equal (target_context, focused_context));
3607 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
3608 //SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT
3609 void socket_helper_send_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key) {
3610 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_send_key_event (" << client << ")\n";
3611 ISF_PROF_DEBUG ("first message")
3612 socket_helper_key_event_op (client, SCIM_TRANS_CMD_PROCESS_KEY_EVENT, target_ic, target_uuid, key);
3614 //SCIM_TRANS_CMD_FORWARD_KEY_EVENT
3615 void socket_helper_forward_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key) {
3616 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_forward_key_event (" << client << ")\n";
3617 socket_helper_key_event_op (client, SCIM_TRANS_CMD_FORWARD_KEY_EVENT, target_ic, target_uuid, key);
3620 //SCIM_TRANS_CMD_COMMIT_STRING
3621 void socket_helper_commit_string (int client, uint32 target_ic, String target_uuid, WideString wstr) {
3622 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_commit_string (" << client << ")\n";
3624 if (wstr.length ()) {
3626 uint32 target_context;
3627 get_imengine_client_context (target_ic, target_client, target_context);
3629 uint32 focused_context;
3630 String focused_uuid;
3631 focused_uuid = get_focused_context (focused_client, focused_context);
3633 if (target_ic == (uint32) (-1)) {
3634 target_client = focused_client;
3635 target_context = focused_context;
3638 if (target_uuid.length () == 0)
3639 target_uuid = focused_uuid;
3641 if (target_uuid == focused_uuid &&
3642 clients_equal (target_client, focused_client) &&
3643 contexts_equal (target_context, focused_context)) {
3644 ClientInfo client_info = socket_get_client_info (focused_client);
3646 if (client_info.type == FRONTEND_CLIENT) {
3647 m_panel_agent_manager.commit_string (focused_client, focused_context, wstr);
3649 std::cerr << "target client is not existed!!!" << "\n";
3654 //SCIM_TRANS_CMD_GET_SURROUNDING_TEXT
3655 void socket_helper_get_surrounding_text (int client, String uuid, uint32 maxlen_before, uint32 maxlen_after) {
3656 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3658 uint32 focused_context;
3659 get_focused_context (focused_client, focused_context);
3660 ClientInfo client_info = socket_get_client_info (focused_client);
3662 /* If the get_surrounding_text was received when there is no client available,
3663 * return empty surrounding text since the sender would be waiting for reply */
3664 if (focused_client == -1) {
3665 socket_update_surrounding_text("", 0);
3667 if (client_info.type == FRONTEND_CLIENT) {
3668 m_panel_agent_manager.socket_helper_get_surrounding_text (focused_client, focused_context, maxlen_before, maxlen_after);
3672 //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT
3673 void socket_helper_delete_surrounding_text (int client, uint32 offset, uint32 len) {
3674 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3676 uint32 focused_context;
3677 get_focused_context (focused_client, focused_context);
3678 ClientInfo client_info = socket_get_client_info (focused_client);
3680 if (client_info.type == FRONTEND_CLIENT) {
3681 m_panel_agent_manager.socket_helper_delete_surrounding_text (focused_client, focused_context, offset, len);
3684 //SCIM_TRANS_CMD_GET_SELECTION
3685 void socket_helper_get_selection (int client, String uuid) {
3686 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3688 uint32 focused_context;
3689 get_focused_context (focused_client, focused_context);
3690 ClientInfo client_info = socket_get_client_info (focused_client);
3692 if (client_info.type == FRONTEND_CLIENT) {
3693 m_panel_agent_manager.socket_helper_get_selection (focused_client, focused_context);
3696 //SCIM_TRANS_CMD_SET_SELECTION
3697 void socket_helper_set_selection (int client, uint32 start, uint32 end) {
3698 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3700 uint32 focused_context;
3701 get_focused_context (focused_client, focused_context);
3702 ClientInfo client_info = socket_get_client_info (focused_client);
3704 if (client_info.type == FRONTEND_CLIENT) {
3705 m_panel_agent_manager.socket_helper_set_selection (focused_client, focused_context, start, end);
3709 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
3710 void socket_helper_show_preedit_string (int client, uint32 target_ic, String target_uuid) {
3711 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_show_preedit_string (" << client << ")\n";
3713 uint32 target_context;
3714 get_imengine_client_context (target_ic, target_client, target_context);
3716 uint32 focused_context;
3717 String focused_uuid = get_focused_context (focused_client, focused_context);
3719 if (target_ic == (uint32) (-1)) {
3720 target_client = focused_client;
3721 target_context = focused_context;
3724 if (target_uuid.length () == 0)
3725 target_uuid = focused_uuid;
3727 if (target_uuid == focused_uuid &&
3728 clients_equal (target_client, focused_client) &&
3729 contexts_equal (target_context, focused_context)) {
3730 ClientInfo client_info = socket_get_client_info (focused_client);
3732 if (client_info.type == FRONTEND_CLIENT) {
3733 m_panel_agent_manager.show_preedit_string (focused_client, focused_context);
3737 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
3738 void socket_helper_hide_preedit_string (int client, uint32 target_ic, String target_uuid) {
3739 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_hide_preedit_string (" << client << ")\n";
3741 uint32 target_context;
3742 get_imengine_client_context (target_ic, target_client, target_context);
3744 uint32 focused_context;
3745 String focused_uuid = get_focused_context (focused_client, focused_context);
3747 if (target_ic == (uint32) (-1)) {
3748 target_client = focused_client;
3749 target_context = focused_context;
3752 if (target_uuid.length () == 0)
3753 target_uuid = focused_uuid;
3755 if (target_uuid == focused_uuid &&
3756 clients_equal (target_client, focused_client) &&
3757 contexts_equal (target_context, focused_context)) {
3758 ClientInfo client_info = socket_get_client_info (focused_client);
3760 if (client_info.type == FRONTEND_CLIENT) {
3761 m_panel_agent_manager.hide_preedit_string (focused_client, focused_context);
3765 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
3766 void socket_helper_update_preedit_string (int client, uint32 target_ic, String target_uuid, WideString preedit, WideString commit, AttributeList& attrs, uint32 caret) {
3767 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_preedit_string (" << client << ")\n";
3769 uint32 target_context;
3770 get_imengine_client_context (target_ic, target_client, target_context);
3772 uint32 focused_context;
3773 String focused_uuid;
3774 focused_uuid = get_focused_context (focused_client, focused_context);
3776 if (target_ic == (uint32) (-1)) {
3777 target_client = focused_client;
3778 target_context = focused_context;
3781 if (target_uuid.length () == 0)
3782 target_uuid = focused_uuid;
3784 if (target_uuid == focused_uuid &&
3785 clients_equal (target_client, focused_client) &&
3786 contexts_equal (target_context, focused_context)) {
3787 ClientInfo client_info = socket_get_client_info (focused_client);
3789 if (client_info.type == FRONTEND_CLIENT) {
3790 m_panel_agent_manager.update_preedit_string (focused_client, focused_context, preedit, commit, attrs, caret);
3794 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
3795 void socket_helper_update_preedit_caret (int client, uint32 caret) {
3796 SCIM_DEBUG_MAIN (4) << __func__ << " (" << client << ")\n";
3798 uint32 focused_context;
3799 String focused_uuid;
3800 focused_uuid = get_focused_context (focused_client, focused_context);
3801 ClientInfo client_info = socket_get_client_info (focused_client);
3803 if (client_info.type == FRONTEND_CLIENT) {
3804 m_panel_agent_manager.update_preedit_caret (focused_client, focused_context, caret);
3808 //ISM_TRANS_CMD_RECAPTURE_STRING
3809 void socket_helper_recapture_string (int client, uint32 target_ic, String target_uuid, int offset, int len, WideString preedit,
3810 WideString commit, AttributeList& attrs) {
3811 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_recapture_string (" << client << ")\n";
3813 uint32 target_context;
3814 get_imengine_client_context (target_ic, target_client, target_context);
3816 uint32 focused_context;
3817 String focused_uuid;
3818 focused_uuid = get_focused_context (focused_client, focused_context);
3820 if (target_ic == (uint32) (-1)) {
3821 target_client = focused_client;
3822 target_context = focused_context;
3825 if (target_uuid.length () == 0)
3826 target_uuid = focused_uuid;
3828 if (target_uuid == focused_uuid &&
3829 clients_equal (target_client, focused_client) &&
3830 contexts_equal (target_context, focused_context)) {
3831 ClientInfo client_info = socket_get_client_info (focused_client);
3833 if (client_info.type == FRONTEND_CLIENT) {
3834 m_panel_agent_manager.recapture_string (focused_client, focused_context, offset, len, preedit, commit, attrs);
3839 //SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
3840 void socket_helper_register_helper (int client, HelperInfo& info) {
3841 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_helper (" << client << ")\n";
3842 bool result = false;
3849 if (!m_signal_get_ise_information (info.uuid, info.name, language, type, option, module_name)) {
3850 LOGW ("This helper (%s) is not IME", info.uuid.c_str ());
3854 info.option = option;
3856 if (info.uuid.length ()) {
3857 SCIM_DEBUG_MAIN (4) << "New Helper uuid=" << info.uuid << " name=" << info.name << "\n";
3858 HelperClientIndex::iterator it = m_helper_client_index.find (info.uuid);
3860 if (it == m_helper_client_index.end ()) {
3861 m_helper_info_repository [client] = info;
3862 m_helper_client_index [info.uuid] = HelperClientStub (client, 1);
3863 StartHelperICIndex::iterator icit = m_start_helper_ic_index.find (info.uuid);
3865 if (icit != m_start_helper_ic_index.end ()) {
3866 m_panel_agent_manager.helper_attach_input_context_and_update_screen (client, icit->second, m_current_screen);
3867 m_start_helper_ic_index.erase (icit);
3870 LOGW ("Failed to register IME : %s", info.uuid.c_str ());
3871 m_panel_agent_manager.send_fail_reply(client);
3874 LOGW ("Failed to register IME : %s", info.uuid.c_str ());
3875 m_panel_agent_manager.send_fail_reply(client);
3882 LOGD ("Succeed to regster IME : %s", info.uuid.c_str ());
3883 m_signal_register_helper (client, info);
3887 //SCIM_TRANS_CMD_PANEL_REGISTER_ACTIVE_HELPER
3888 void socket_helper_register_helper_passive (int client, HelperInfo& info) {
3889 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_helper_passive (" << client << ")\n";
3896 if (!m_signal_get_ise_information (info.uuid, info.name, language, type, option, module_name)) {
3897 LOGW ("This helper (%s) is not IME", info.uuid.c_str ());
3901 info.option = option;
3903 if (info.uuid.length ()) {
3904 SCIM_DEBUG_MAIN (4) << "New Helper Passive uuid=" << info.uuid << " name=" << info.name << "\n";
3905 HelperInfoRepository::iterator it = m_helper_active_info_repository.find (client);
3907 if (it == m_helper_active_info_repository.end ()) {
3908 m_helper_active_info_repository[client] = info;
3911 StringIntRepository::iterator iter = m_ise_pending_repository.find (info.uuid);
3913 if (iter != m_ise_pending_repository.end ()) {
3914 m_ise_pending_repository.erase (iter);
3917 iter = m_ise_pending_repository.find (info.name);
3919 if (iter != m_ise_pending_repository.end ()) {
3920 m_ise_pending_repository.erase (iter);
3926 //ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
3927 void socket_helper_update_input_context (int client, uint32 type, uint32 value) {
3928 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_input_context (" << client << ")\n";
3929 m_signal_update_input_context ((int)type, (int)value);
3931 uint32 focused_context;
3932 get_focused_context (focused_client, focused_context);
3933 ClientInfo client_info = socket_get_client_info (focused_client);
3935 if (client_info.type == FRONTEND_CLIENT) {
3936 m_panel_agent_manager.update_ise_input_context (focused_client, focused_context, type, value);
3938 std::cerr << "focused client is not existed!!!" << "\n";
3941 //ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE
3942 void socket_helper_update_language_locale(int client, String locale) {
3943 SCIM_DEBUG_MAIN(4) << "InfoManager::socket_helper_update_language_locale (" << client << ")\n";
3944 m_signal_update_language_locale(locale);
3947 uint32 focused_context;
3948 get_focused_context(focused_client, focused_context);
3949 ClientInfo client_info = socket_get_client_info(focused_client);
3951 if (client_info.type == FRONTEND_CLIENT) {
3952 m_panel_agent_manager.update_ise_language_locale(focused_client, focused_context, locale);
3954 std::cerr << "focused client is not existed!!!" << "\n";
3957 //SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
3958 void socket_helper_send_private_command (int client, String command) {
3959 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3961 uint32 focused_context;
3962 get_focused_context (focused_client, focused_context);
3963 ClientInfo client_info = socket_get_client_info (focused_client);
3965 if (client_info.type == FRONTEND_CLIENT) {
3966 m_panel_agent_manager.send_private_command (focused_client, focused_context, command);
3969 //SCIM_TRANS_CMD_COMMIT_CONTENT
3970 void socket_helper_commit_content (int client, String content, String description, String mime_types) {
3971 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3973 uint32 focused_context;
3974 get_focused_context (focused_client, focused_context);
3975 ClientInfo client_info = socket_get_client_info (focused_client);
3977 if (client_info.type == FRONTEND_CLIENT) {
3978 m_panel_agent_manager.commit_content (focused_client, focused_context, content, description, mime_types);
3981 //ISM_TRANS_CMD_UPDATE_ISE_EXIT
3982 void UPDATE_ISE_EXIT (int client) {
3983 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3984 bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false);
3985 if (launch_ise_on_request && !m_refocus_needed && !m_reshow_needed)
3986 m_restart_needed = false;
3989 void process_key_event_done (KeyEvent &key, uint32 ret, uint32 serial) {
3991 uint32 focused_context;
3992 get_focused_context (focused_client, focused_context);
3993 ClientInfo client_info = socket_get_client_info (focused_client);
3995 if (client_info.type == FRONTEND_CLIENT) {
3996 m_panel_agent_manager.process_key_event_done (focused_client, focused_context, key, ret, serial);
4000 //ISM_TRANS_CMD_REQUEST_ISE_HIDE
4001 void request_ise_hide () {
4003 uint32 focused_context;
4004 get_focused_context (focused_client, focused_context);
4005 ClientInfo client_info = socket_get_client_info (focused_client);
4007 if (client_info.type == FRONTEND_CLIENT) {
4008 m_panel_agent_manager.request_ise_hide (focused_client, focused_context);
4012 void socket_reset_helper_input_context (const String& uuid, int client, uint32 context) {
4013 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4015 if (it != m_helper_client_index.end ()) {
4016 uint32 ctx = get_helper_ic (client, context);
4017 m_panel_agent_manager.reset_helper_context (it->second.id, ctx, uuid);
4021 bool helper_select_aux (uint32 item) {
4022 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_aux \n";
4024 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4025 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4027 if (it != m_helper_client_index.end ()) {
4031 get_focused_context (client, context);
4032 ctx = get_helper_ic (client, context);
4033 m_panel_agent_manager.select_aux (it->second.id, ctx, item);
4041 bool helper_select_candidate (uint32 item) {
4042 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_candidate \n";
4044 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4045 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4047 if (it != m_helper_client_index.end ()) {
4051 get_focused_context (client, context);
4052 ctx = get_helper_ic (client, context);
4053 m_panel_agent_manager.select_candidate (it->second.id, ctx, item);
4061 bool helper_lookup_table_page_up (void) {
4062 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_lookup_table_page_up \n";
4064 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4065 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4067 if (it != m_helper_client_index.end ()) {
4071 get_focused_context (client, context);
4072 ctx = get_helper_ic (client, context);
4073 m_panel_agent_manager.lookup_table_page_up (it->second.id, ctx);
4081 bool helper_lookup_table_page_down (void) {
4082 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_lookup_table_page_down \n";
4084 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4085 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4087 if (it != m_helper_client_index.end ()) {
4091 get_focused_context (client, context);
4092 ctx = get_helper_ic (client, context);
4093 m_panel_agent_manager.lookup_table_page_down (it->second.id, ctx);
4101 bool helper_update_lookup_table_page_size (uint32 size) {
4102 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_update_lookup_table_page_size \n";
4104 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4105 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4107 if (it != m_helper_client_index.end ()) {
4111 get_focused_context (client, context);
4112 ctx = get_helper_ic (client, context);
4113 m_panel_agent_manager.update_lookup_table_page_size (it->second.id, ctx, size);
4121 bool helper_update_candidate_item_layout (const std::vector<uint32>& row_items) {
4122 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4124 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4125 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4127 if (it != m_helper_client_index.end ()) {
4131 get_focused_context (client, context);
4132 ctx = get_helper_ic (client, context);
4133 m_panel_agent_manager.update_candidate_item_layout (it->second.id, ctx, row_items);
4141 bool helper_select_associate (uint32 item) {
4142 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_associate \n";
4144 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4145 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4147 if (it != m_helper_client_index.end ()) {
4151 get_focused_context (client, context);
4152 ctx = get_helper_ic (client, context);
4153 m_panel_agent_manager.select_associate (it->second.id, ctx, item);
4161 bool helper_associate_table_page_up (void) {
4162 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_associate_table_page_up \n";
4164 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4165 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4167 if (it != m_helper_client_index.end ()) {
4171 get_focused_context (client, context);
4172 ctx = get_helper_ic (client, context);
4173 m_panel_agent_manager.associate_table_page_up (it->second.id, ctx);
4181 bool helper_associate_table_page_down (void) {
4182 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_associate_table_page_down \n";
4184 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4185 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4187 if (it != m_helper_client_index.end ()) {
4191 get_focused_context (client, context);
4192 ctx = get_helper_ic (client, context);
4193 m_panel_agent_manager.associate_table_page_down (it->second.id, ctx);
4201 bool helper_update_associate_table_page_size (uint32 size) {
4202 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_update_associate_table_page_size \n";
4204 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4205 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4207 if (it != m_helper_client_index.end ()) {
4211 get_focused_context (client, context);
4212 ctx = get_helper_ic (client, context);
4213 m_panel_agent_manager.update_associate_table_page_size (it->second.id, ctx, size);
4221 bool helper_update_displayed_candidate_number (uint32 size) {
4222 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4224 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4225 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4227 if (it != m_helper_client_index.end ()) {
4231 get_focused_context (client, context);
4232 ctx = get_helper_ic (client, context);
4233 m_panel_agent_manager.update_displayed_candidate_number (it->second.id, ctx, size);
4241 bool helper_longpress_candidate (uint32 index) {
4242 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4244 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4245 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4247 if (it != m_helper_client_index.end ()) {
4251 get_focused_context (client, context);
4252 ctx = get_helper_ic (client, context);
4253 m_panel_agent_manager.send_longpress_event (it->second.id, ctx, index);
4258 std::cerr << __func__ << " is failed!!!\n";
4262 void helper_all_update_spot_location (int x, int y) {
4263 SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_spot_location (" << x << "," << y << ")\n";
4264 HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
4267 String uuid = get_focused_context (client, context);
4269 for (; hiit != m_helper_info_repository.end (); ++ hiit) {
4270 if (hiit->second.option & SCIM_HELPER_NEED_SPOT_LOCATION_INFO) {
4271 m_panel_agent_manager.helper_all_update_spot_location (hiit->first, get_helper_ic (client, context), uuid, x, y);
4276 void helper_all_update_cursor_position (int cursor_pos) {
4277 SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_cursor_position (" << cursor_pos << ")\n";
4278 HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
4281 String uuid = get_focused_context (client, context);
4283 for (; hiit != m_helper_info_repository.end (); ++ hiit) {
4284 m_panel_agent_manager.helper_all_update_cursor_position (hiit->first, get_helper_ic (client, context), uuid, cursor_pos);
4288 void helper_all_update_screen (int screen) {
4289 SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_screen (" << screen << ")\n";
4290 HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
4294 uuid = get_focused_context (client, context);
4296 for (; hiit != m_helper_info_repository.end (); ++ hiit) {
4297 if (hiit->second.option & SCIM_HELPER_NEED_SCREEN_INFO) {
4298 m_panel_agent_manager.helper_all_update_screen (hiit->first, get_helper_ic (client, context), uuid, screen);
4303 bool set_autocapital_type (int mode) {
4304 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4305 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
4306 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
4307 iseContext->autocapital_type = static_cast<Ecore_IMF_Autocapital_Type>(mode);
4309 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || (m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
4310 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4312 if (it != m_helper_client_index.end ()) {
4316 get_focused_context (client, context);
4317 ctx = get_helper_ic (client, context);
4318 m_panel_agent_manager.set_autocapital_type (it->second.id, ctx, m_current_helper_uuid, mode);
4323 std::cerr << __func__ << " is failed!!!\n";
4327 bool set_prediction_allow (int client, int mode) {
4328 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4329 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
4330 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
4331 iseContext->prediction_allow = static_cast<Eina_Bool>(mode);
4333 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || (m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
4334 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4336 if (it != m_helper_client_index.end ()) {
4338 uint32 focused_context;
4340 get_focused_context (focused_client, focused_context);
4341 ctx = get_helper_ic (focused_client, focused_context);
4342 m_panel_agent_manager.set_prediction_allow (it->second.id, ctx, m_current_helper_uuid, mode);
4347 std::cerr << __func__ << " is failed!!!\n";
4351 const String& get_focused_context (int& client, uint32& context, bool force_last_context = false) const {
4352 if (m_current_socket_client >= 0) {
4353 client = m_current_socket_client;
4354 context = m_current_client_context;
4355 return m_current_context_uuid;
4357 client = m_last_socket_client;
4358 context = m_last_client_context;
4359 return m_last_context_uuid;
4364 void socket_transaction_start (void) {
4365 m_signal_transaction_start ();
4368 void socket_transaction_end (void) {
4369 m_signal_transaction_end ();
4375 void unlock (void) {
4380 InfoManager::InfoManager ()
4381 : m_impl (new InfoManagerImpl ())
4385 InfoManager::~InfoManager ()
4391 InfoManager::initialize (InfoManager* info_manager, const ConfigPointer& config, const String& display, bool resident)
4393 return m_impl->initialize (info_manager, config, display, resident);
4397 InfoManager::valid (void) const
4399 return m_impl->valid ();
4403 InfoManager::stop (void)
4410 InfoManager::socket_get_client_info (int client) const
4412 return m_impl->socket_get_client_info (client);
4415 void InfoManager::hide_helper (const String& uuid)
4417 m_impl->hide_helper (uuid);
4420 InfoManager::get_current_toolbar_mode () const
4422 return m_impl->get_current_toolbar_mode ();
4426 InfoManager::get_current_ise_geometry (rectinfo& rect)
4428 m_impl->get_current_ise_geometry (rect);
4432 InfoManager::get_current_helper_uuid () const
4434 return m_impl->get_current_helper_uuid ();
4438 InfoManager::get_current_ise_name () const
4440 return m_impl->get_current_ise_name ();
4444 InfoManager::set_current_toolbar_mode (TOOLBAR_MODE_T mode)
4446 m_impl->set_current_toolbar_mode (mode);
4450 InfoManager::set_current_ise_name (String& name)
4452 m_impl->set_current_ise_name (name);
4456 InfoManager::set_current_helper_option (uint32 option)
4458 m_impl->set_current_helper_option (option);
4462 InfoManager::update_candidate_panel_event (uint32 nType, uint32 nValue)
4464 m_impl->update_panel_event (ISM_TRANS_CMD_UPDATE_ISF_CANDIDATE_PANEL, nType, nValue);
4468 InfoManager::update_input_panel_event (uint32 nType, uint32 nValue)
4470 m_impl->update_panel_event (ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT, nType, nValue);
4474 InfoManager::move_preedit_caret (uint32 position)
4476 return m_impl->move_preedit_caret (position);
4482 InfoManager::request_help (void)
4484 return m_impl->request_help ();
4488 InfoManager::request_factory_menu (void)
4490 return m_impl->request_factory_menu ();
4495 InfoManager::change_factory (const String& uuid)
4497 return m_impl->change_factory (uuid);
4501 InfoManager::helper_candidate_show (void)
4503 return m_impl->helper_candidate_show ();
4507 InfoManager::helper_candidate_hide (void)
4509 return m_impl->helper_candidate_hide ();
4513 InfoManager::candidate_more_window_show (void)
4515 return m_impl->candidate_more_window_show ();
4519 InfoManager::candidate_more_window_hide (void)
4521 return m_impl->candidate_more_window_hide ();
4525 InfoManager::update_helper_lookup_table (const LookupTable& table)
4527 return m_impl->update_helper_lookup_table (table);
4531 InfoManager::select_aux (uint32 item)
4533 return m_impl->select_aux (item);
4537 InfoManager::select_candidate (uint32 item)
4539 return m_impl->select_candidate (item);
4543 InfoManager::lookup_table_page_up (void)
4545 return m_impl->lookup_table_page_up ();
4549 InfoManager::lookup_table_page_down (void)
4551 return m_impl->lookup_table_page_down ();
4555 InfoManager::update_lookup_table_page_size (uint32 size)
4557 return m_impl->update_lookup_table_page_size (size);
4561 InfoManager::update_candidate_item_layout (const std::vector<uint32>& row_items)
4563 return m_impl->update_candidate_item_layout (row_items);
4567 InfoManager::select_associate (uint32 item)
4569 return m_impl->select_associate (item);
4573 InfoManager::associate_table_page_up (void)
4575 return m_impl->associate_table_page_up ();
4579 InfoManager::associate_table_page_down (void)
4581 return m_impl->associate_table_page_down ();
4585 InfoManager::update_associate_table_page_size (uint32 size)
4587 return m_impl->update_associate_table_page_size (size);
4591 InfoManager::update_displayed_candidate_number (uint32 size)
4593 return m_impl->update_displayed_candidate_number (size);
4597 InfoManager::send_longpress_event (int type, int index)
4599 m_impl->send_longpress_event (type, index);
4603 InfoManager::trigger_property (const String& property)
4605 return m_impl->trigger_property (property);
4609 InfoManager::start_helper (const String& uuid)
4611 return m_impl->start_helper (uuid, -2, 0);
4615 InfoManager::stop_helper (const String& uuid)
4617 return m_impl->stop_helper (uuid, -2, 0);
4621 InfoManager::set_default_ise (const DEFAULT_ISE_T& ise)
4623 m_impl->set_default_ise (ise);
4627 InfoManager::set_should_shared_ise (const bool should_shared_ise)
4629 m_impl->set_should_shared_ise (should_shared_ise);
4633 //InfoManager::reload_config (void)
4635 // m_impl->reload_config ();
4639 InfoManager::exit (void)
4641 return m_impl->exit ();
4644 InfoManager::update_ise_list (std::vector<String>& strList)
4646 m_impl->update_ise_list (strList);
4650 InfoManager::remoteinput_update_preedit_string (WideString str, AttributeList &attrs, uint32 caret)
4652 return m_impl->remoteinput_update_preedit_string (str, attrs, caret);
4656 InfoManager::remoteinput_commit_string (const WideString &str)
4658 return m_impl->remoteinput_commit_string (str);
4662 InfoManager::remoteinput_send_key_event (const KeyEvent &key)
4664 return m_impl->remoteinput_send_key_event (key);
4668 InfoManager::remoteinput_forward_key_event (const KeyEvent &key)
4670 return m_impl->remoteinput_forward_key_event (key);
4674 InfoManager::remoteinput_delete_surrounding_text (uint32 offset, uint32 len)
4676 return m_impl->remoteinput_delete_surrounding_text (offset, len);
4679 /////////////////////////////////Message function begin/////////////////////////////////////////
4681 //ISM_TRANS_CMD_PANEL_RESET_KEYBOARD_ISE
4682 bool InfoManager:: reset_keyboard_ise (void)
4684 return m_impl->reset_keyboard_ise ();
4687 //ISM_TRANS_CMD_SHOW_ISF_CONTROL
4688 void InfoManager::show_isf_panel (int client_id)
4690 m_impl->show_isf_panel (client_id);
4693 //ISM_TRANS_CMD_HIDE_ISF_CONTROL
4694 void InfoManager::hide_isf_panel (int client_id)
4696 m_impl->hide_isf_panel (client_id);
4699 //ISM_TRANS_CMD_SHOW_ISE_PANEL
4700 void InfoManager::show_ise_panel (int client_id, uint32 client, uint32 context, char* data, size_t len)
4702 m_impl->show_ise_panel (client_id, client, context, data, len);
4705 //ISM_TRANS_CMD_HIDE_ISE_PANEL
4706 void InfoManager::hide_ise_panel (int client_id, uint32 client, uint32 context)
4708 m_impl->hide_ise_panel (client_id, client, context);
4711 //ISM_TRANS_CMD_HIDE_ISE_PANEL from ISF control
4712 void InfoManager::hide_helper_ise (void)
4714 m_impl->hide_helper_ise ();
4717 //ISM_TRANS_CMD_LAUNCH_ISE from ISF control
4718 void InfoManager::prelaunch_helper_ise (void)
4720 m_impl->prelaunch_helper_ise ();
4723 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
4724 bool InfoManager::process_key_event (KeyEvent& key, uint32 serial)
4726 return m_impl->process_key_event (key, serial);
4729 //ISM_TRANS_CMD_GET_ACTIVE_ISE_GEOMETRY
4730 void InfoManager::get_input_panel_geometry (int client_id, _OUT_ struct rectinfo& info)
4732 m_impl->get_input_panel_geometry (client_id, info);
4735 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
4736 void InfoManager::get_candidate_window_geometry (int client_id, _OUT_ struct rectinfo& info)
4738 m_impl->get_candidate_window_geometry (client_id, info);
4741 //ISM_TRANS_CMD_GET_ISE_LANGUAGE_LOCALE
4742 void InfoManager::get_ise_language_locale (int client_id, _OUT_ char** data, _OUT_ size_t& len)
4744 m_impl->get_ise_language_locale (client_id, data, len);
4747 //ISM_TRANS_CMD_SET_LAYOUT
4748 void InfoManager::set_ise_layout (int client_id, uint32 layout)
4750 m_impl->set_ise_layout (client_id, layout);
4753 //ISM_TRANS_CMD_SET_INPUT_MODE
4754 void InfoManager::set_ise_input_mode (int client_id, uint32 input_mode)
4756 m_impl->set_ise_input_mode (client_id, input_mode);
4759 //ISM_TRANS_CMD_SET_INPUT_HINT
4760 void InfoManager::set_ise_input_hint (int client_id, uint32 input_hint)
4762 m_impl->set_ise_input_hint (client_id, input_hint);
4765 //ISM_TRANS_CMD_UPDATE_BIDI_DIRECTION
4766 void InfoManager::update_ise_bidi_direction (int client_id, uint32 bidi_direction)
4768 m_impl->update_ise_bidi_direction (client_id, bidi_direction);
4772 //ISM_TRANS_CMD_SET_ISE_LANGUAGE
4773 void InfoManager::set_ise_language (int client_id, uint32 language)
4775 m_impl->set_ise_language (client_id, language);
4778 //ISM_TRANS_CMD_SET_ISE_IMDATA
4779 void InfoManager::set_ise_imdata (int client_id, const char* imdata, size_t len)
4781 m_impl->set_ise_imdata (client_id, imdata, len);
4784 //ISM_TRANS_CMD_GET_ISE_IMDATA
4785 bool InfoManager:: get_ise_imdata (int client_id, _OUT_ char** imdata, _OUT_ size_t& len)
4787 return m_impl->get_ise_imdata (client_id, imdata, len);
4790 //ISM_TRANS_CMD_GET_LAYOUT
4791 bool InfoManager:: get_ise_layout (int client_id, _OUT_ uint32& layout)
4793 return m_impl->get_ise_layout (client_id, layout);
4796 //ISM_TRANS_CMD_GET_ISE_STATE
4797 void InfoManager::get_ise_state (int client_id, _OUT_ int& state)
4799 m_impl->get_ise_state (client_id, state);
4802 //ISM_TRANS_CMD_GET_ACTIVE_ISE
4803 void InfoManager::get_active_ise (int client_id, _OUT_ String& default_uuid)
4805 m_impl->get_active_ise (client_id, default_uuid);
4808 //ISM_TRANS_CMD_GET_ISE_LIST
4809 void InfoManager::get_ise_list (int client_id, _OUT_ std::vector<String>& strlist)
4811 m_impl->get_ise_list (client_id, strlist);
4815 //ISM_TRANS_CMD_GET_ALL_HELPER_ISE_INFO
4816 void InfoManager::get_all_helper_ise_info (int client_id, _OUT_ HELPER_ISE_INFO& info)
4818 m_impl->get_all_helper_ise_info (client_id, info);
4821 //ISM_TRANS_CMD_SET_ENABLE_HELPER_ISE_INFO
4822 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4823 void InfoManager::set_enable_helper_ise_info (int client_id, String appid, uint32 is_enabled)
4825 m_impl->set_enable_helper_ise_info (client_id, appid, is_enabled);
4828 //ISM_TRANS_CMD_SHOW_HELPER_ISE_LIST
4829 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4830 void InfoManager::show_helper_ise_list (int client_id)
4832 m_impl->show_helper_ise_list (client_id);
4836 //ISM_TRANS_CMD_SHOW_HELPER_ISE_SELECTOR
4837 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4838 void InfoManager::show_helper_ise_selector (int client_id)
4840 m_impl->show_helper_ise_selector (client_id);
4843 //ISM_TRANS_CMD_IS_HELPER_ISE_ENABLED
4845 void InfoManager::is_helper_ise_enabled (int client_id, String strAppid, _OUT_ uint32& nEnabled)
4847 m_impl->is_helper_ise_enabled (client_id, strAppid, nEnabled);
4850 //ISM_TRANS_CMD_GET_ISE_INFORMATION
4851 void InfoManager::get_ise_information (int client_id, String strUuid, _OUT_ String& strName, _OUT_ String& strLanguage,
4852 _OUT_ int& nType, _OUT_ int& nOption, _OUT_ String& strModuleName)
4854 m_impl->get_ise_information (client_id, strUuid, strName, strLanguage, nType, nOption, strModuleName);
4857 //ISM_TRANS_CMD_RESET_ISE_OPTION
4858 //reply SCIM_TRANS_CMD_OK
4859 bool InfoManager:: reset_ise_option (int client_id)
4861 return m_impl->reset_ise_option (client_id);
4864 //ISM_TRANS_CMD_SET_ACTIVE_ISE_BY_UUID
4866 bool InfoManager:: set_active_ise_by_uuid (int client_id, char* buf, size_t len)
4868 return m_impl->set_active_ise_by_uuid (client_id, buf, len);
4871 //ISM_TRANS_CMD_SET_INITIAL_ISE_BY_UUID
4872 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4873 void InfoManager::set_initial_ise_by_uuid (int client_id, char* buf, size_t len)
4875 m_impl->set_initial_ise_by_uuid (client_id, buf, len);
4878 //ISM_TRANS_CMD_SET_RETURN_KEY_TYPE
4879 void InfoManager::set_ise_return_key_type (int client_id, uint32 type)
4881 m_impl->set_ise_return_key_type (client_id, type);
4884 //ISM_TRANS_CMD_GET_RETURN_KEY_TYPE
4886 bool InfoManager:: get_ise_return_key_type (int client_id, _OUT_ uint32& type)
4888 return m_impl->get_ise_return_key_type (client_id, type);
4892 //ISM_TRANS_CMD_SET_RETURN_KEY_DISABLE
4893 void InfoManager::set_ise_return_key_disable (int client_id, uint32 disabled)
4895 m_impl->set_ise_return_key_disable (client_id, disabled);
4898 //ISM_TRANS_CMD_GET_RETURN_KEY_DISABLE
4899 bool InfoManager::get_ise_return_key_disable (int client_id, _OUT_ uint32& disabled)
4901 return m_impl->get_ise_return_key_disable (client_id, disabled);
4904 //ISM_TRANS_CMD_SET_CAPS_MODE
4905 void InfoManager::set_ise_caps_mode (int client_id, uint32 mode)
4907 m_impl->set_ise_caps_mode (client_id, mode);
4910 //SCIM_TRANS_CMD_RELOAD_CONFIG
4911 void InfoManager::reload_config (void)
4913 m_impl->reload_config ();
4916 //ISM_TRANS_CMD_SEND_WILL_SHOW_ACK
4917 void InfoManager::will_show_ack (int client_id)
4919 m_impl->will_show_ack (client_id);
4922 //ISM_TRANS_CMD_SEND_WILL_HIDE_ACK
4923 void InfoManager::will_hide_ack (int client_id)
4925 m_impl->will_hide_ack (client_id);
4928 //ISM_TRANS_CMD_RESET_DEFAULT_ISE
4929 void InfoManager::reset_default_ise (int client_id)
4931 m_impl->reset_default_ise (client_id);
4934 //ISM_TRANS_CMD_SET_HARDWARE_KEYBOARD_MODE
4935 void InfoManager::set_keyboard_mode (int client_id, uint32 mode)
4937 m_impl->set_keyboard_mode (client_id, mode);
4940 //ISM_TRANS_CMD_SEND_CANDIDATE_WILL_HIDE_ACK
4941 void InfoManager::candidate_will_hide_ack (int client_id)
4943 m_impl->candidate_will_hide_ack (client_id);
4946 //ISM_TRANS_CMD_GET_ACTIVE_HELPER_OPTION
4947 void InfoManager::get_active_helper_option (int client_id, _OUT_ uint32& option)
4949 m_impl->get_active_helper_option (client_id, option);
4952 //ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW
4953 void InfoManager::show_ise_option_window (int client_id)
4955 m_impl->show_ise_option_window (client_id);
4958 //ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW
4959 void InfoManager::resume_ise_option_window (int client_id)
4961 m_impl->resume_ise_option_window (client_id);
4964 //ISM_TRANS_CMD_SET_KEYBOARD_MODE
4965 void InfoManager::set_ise_keyboard_mode (int client_id, uint32 mode)
4967 m_impl->set_ise_keyboard_mode (client_id, mode);
4970 //ISM_TRANS_CMD_SET_PREDICTION_HINT
4971 void InfoManager::set_prediction_hint (int client_id, String prediction_hint)
4973 m_impl->set_prediction_hint (client_id, prediction_hint);
4976 //ISM_TRANS_CMD_SET_MIME_TYPE
4977 void InfoManager::set_ise_mime_type (int client_id, String mime_type)
4979 m_impl->set_ise_mime_type (client_id, mime_type);
4982 //ISM_TRANS_CMD_FINALIZE_CONTENT
4983 void InfoManager::finalize_content (int client_id, String text, uint32 cursor_pos)
4985 m_impl->finalize_content (client_id, text, cursor_pos);
4988 //ISM_TRANS_CMD_SET_PREDICTION_HINT_DATA
4989 void InfoManager::set_prediction_hint_data (int client_id, String key, String value)
4991 m_impl->set_prediction_hint_data (client_id, key, value);
4994 //ISM_TRANS_CMD_SET_OPTIMIZATION_HINT
4995 void InfoManager::set_optimization_hint(int client_id, uint32 hint)
4997 m_impl->set_optimization_hint(client_id, hint);
5000 //ISM_TRANS_CMD_EXPAND_CANDIDATE
5001 void InfoManager::expand_candidate ()
5003 m_impl->expand_candidate ();
5006 //ISM_TRANS_CMD_CONTRACT_CANDIDATE
5007 void InfoManager::contract_candidate ()
5009 m_impl->contract_candidate ();
5012 //ISM_TRANS_CMD_GET_RECENT_ISE_GEOMETRY
5013 void InfoManager::get_recent_ise_geometry (int client_id, uint32 angle, _OUT_ struct rectinfo& info)
5015 m_impl->get_recent_ise_geometry (client_id, angle, info);
5018 //ISM_TRANS_CMD_SEND_REMOTE_INPUT_MESSAGE
5019 bool InfoManager::remoteinput_send_input_message (int client_id, char* buf, size_t len)
5021 return m_impl->send_remote_input_message (client_id, buf, len);
5024 void InfoManager::remoteinput_send_surrounding_text (const char* text, uint32 cursor)
5026 return m_impl->send_remote_surrounding_text (text, cursor);
5029 //ISM_TRANS_CMD_REGISTER_PANEL_CLIENT
5030 void InfoManager::register_panel_client (uint32 client_id, uint32 id)
5032 m_impl->register_panel_client (client_id, id);
5035 //SCIM_TRANS_CMD_PANEL_REGISTER_INPUT_CONTEXT
5036 void InfoManager::register_input_context (uint32 client_id, uint32 context, String uuid)
5038 m_impl->register_input_context (client_id, context, uuid);
5041 //SCIM_TRANS_CMD_PANEL_REMOVE_INPUT_CONTEXT
5042 void InfoManager::remove_input_context (uint32 client_id, uint32 context)
5044 m_impl->remove_input_context (client_id, context);
5047 //SCIM_TRANS_CMD_PANEL_RESET_INPUT_CONTEXT
5048 void InfoManager::socket_reset_input_context (int client_id, uint32 context)
5050 m_impl->socket_reset_input_context (client_id, context);
5053 //SCIM_TRANS_CMD_FOCUS_IN
5054 void InfoManager::focus_in (int client_id, uint32 context, String uuid)
5056 m_impl->focus_in (client_id, context, uuid);
5059 //SCIM_TRANS_CMD_FOCUS_OUT
5060 void InfoManager::focus_out (int client_id, uint32 context)
5062 m_impl->focus_out (client_id, context);
5065 //ISM_TRANS_CMD_PROCESS_INPUT_DEVICE_EVENT
5066 bool InfoManager::process_input_device_event(int client, uint32 type, const char *data, size_t len, _OUT_ uint32& result)
5068 return m_impl->process_input_device_event(client, type, data, len, result);
5071 //ISM_TRANS_CMD_TURN_ON_LOG
5072 void InfoManager::socket_turn_on_log (uint32 isOn)
5074 m_impl->socket_turn_on_log (isOn);
5077 //SCIM_TRANS_CMD_PANEL_TURN_ON
5078 void InfoManager::socket_turn_on (void)
5080 m_impl->socket_turn_on ();
5083 //SCIM_TRANS_CMD_PANEL_TURN_OFF
5084 void InfoManager::socket_turn_off (void)
5086 m_impl->socket_turn_off ();
5089 //SCIM_TRANS_CMD_UPDATE_SCREEN
5090 void InfoManager::socket_update_screen (int client_id, uint32 num)
5092 m_impl->socket_update_screen (client_id, num);
5095 //SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
5096 void InfoManager::socket_update_spot_location (uint32 x, uint32 y, uint32 top_y)
5098 m_impl->socket_update_spot_location (x, y, top_y);
5101 //ISM_TRANS_CMD_UPDATE_CURSOR_POSITION
5102 void InfoManager::socket_update_cursor_position (uint32 cursor_pos)
5104 m_impl->socket_update_cursor_position (cursor_pos);
5107 //ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT
5108 void InfoManager::socket_update_surrounding_text (String text, uint32 cursor)
5110 m_impl->socket_update_surrounding_text (text, cursor);
5113 void InfoManager::remoteinput_callback_focus_in (void)
5115 m_impl->remoteinput_callback_focus_in ();
5118 void InfoManager::remoteinput_callback_focus_out (void)
5120 m_impl->remoteinput_callback_focus_out ();
5123 void InfoManager::remoteinput_callback_entry_metadata (uint32 hint, uint32 layout, int variation, uint32 autocapital_type, int return_key_disabled)
5125 m_impl->remoteinput_callback_entry_metadata (hint, layout, variation, autocapital_type, return_key_disabled);
5128 void InfoManager::remoteinput_callback_surrounding_text (String text, uint32 cursor)
5130 m_impl->remoteinput_callback_surrounding_text (text, cursor);
5133 void InfoManager::remoteinput_callback_input_resource (uint32 input_resource)
5135 m_impl->remoteinput_callback_input_resource (input_resource);
5138 //ISM_TRANS_CMD_UPDATE_SELECTION
5139 void InfoManager::socket_update_selection (String text)
5141 m_impl->socket_update_selection (text);
5144 //FIXME: useless anymore
5145 //SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO
5146 void InfoManager::socket_update_factory_info (PanelFactoryInfo& info)
5148 m_impl->socket_update_factory_info (info);
5151 //SCIM_TRANS_CMD_PANEL_SHOW_HELP
5152 void InfoManager::socket_show_help (String help)
5154 m_impl->socket_show_help (help);
5157 //SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU
5158 void InfoManager::socket_show_factory_menu (std::vector <PanelFactoryInfo>& vec)
5160 m_impl->socket_show_factory_menu (vec);
5163 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
5164 void InfoManager::socket_show_preedit_string (void)
5166 m_impl->socket_show_preedit_string ();
5169 //SCIM_TRANS_CMD_SHOW_AUX_STRING
5170 void InfoManager::socket_show_aux_string (void)
5172 m_impl->socket_show_aux_string ();
5175 //SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE
5176 void InfoManager::socket_show_lookup_table (void)
5178 m_impl->socket_show_lookup_table ();
5181 //ISM_TRANS_CMD_SHOW_ASSOCIATE_TABLE
5182 void InfoManager::socket_show_associate_table (void)
5184 m_impl->socket_show_associate_table ();
5187 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
5188 void InfoManager::socket_hide_preedit_string (void)
5190 m_impl->socket_hide_preedit_string ();
5193 //SCIM_TRANS_CMD_HIDE_AUX_STRING
5194 void InfoManager::socket_hide_aux_string (void)
5196 m_impl->socket_hide_aux_string ();
5199 //SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE
5200 void InfoManager::socket_hide_lookup_table (void)
5202 m_impl->socket_hide_lookup_table ();
5205 //ISM_TRANS_CMD_HIDE_ASSOCIATE_TABLE
5206 void InfoManager::socket_hide_associate_table (void)
5208 m_impl->socket_hide_associate_table ();
5211 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
5212 void InfoManager::socket_update_preedit_string (String& str, const AttributeList& attrs, uint32 caret)
5214 m_impl->socket_update_preedit_string (str, attrs, caret);
5217 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
5218 void InfoManager::socket_update_preedit_caret (uint32 caret)
5220 m_impl->socket_update_preedit_caret (caret);
5223 //ISM_TRANS_CMD_RECAPTURE_STRING
5224 void InfoManager::socket_recapture_string (int offset, int len, String& preedit, String& commit, const AttributeList& attrs)
5226 m_impl->socket_recapture_string (offset, len, preedit, commit, attrs);
5229 //SCIM_TRANS_CMD_UPDATE_AUX_STRING
5230 void InfoManager::socket_update_aux_string (String& str, const AttributeList& attrs)
5232 m_impl->socket_update_aux_string (str, attrs);
5235 //SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE
5236 void InfoManager::socket_update_lookup_table (const LookupTable& table)
5238 m_impl->socket_update_lookup_table (table);
5241 //ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE
5242 void InfoManager::socket_update_associate_table (const LookupTable& table)
5244 m_impl->socket_update_associate_table (table);
5247 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
5248 void InfoManager::socket_register_properties (const PropertyList& properties)
5250 m_impl->socket_register_properties (properties);
5253 //SCIM_TRANS_CMD_UPDATE_PROPERTY
5254 void InfoManager::socket_update_property (const Property& property)
5256 m_impl->socket_update_property (property);
5259 //ISM_TRANS_CMD_GET_KEYBOARD_ISE_LIST
5260 void InfoManager::socket_get_keyboard_ise_list (String& uuid)
5262 m_impl->socket_get_keyboard_ise_list (uuid);
5265 //ISM_TRANS_CMD_SET_CANDIDATE_UI
5266 void InfoManager::socket_set_candidate_ui (uint32 portrait_line, uint32 mode)
5268 m_impl->socket_set_candidate_ui (portrait_line, mode);
5271 //ISM_TRANS_CMD_GET_CANDIDATE_UI
5272 void InfoManager::socket_get_candidate_ui (String uuid)
5274 m_impl->socket_get_candidate_ui (uuid);
5277 //ISM_TRANS_CMD_SET_CANDIDATE_POSITION
5278 void InfoManager::socket_set_candidate_position (uint32 left, uint32 top)
5280 m_impl->socket_set_candidate_position (left, top);
5283 //ISM_TRANS_CMD_HIDE_CANDIDATE
5284 void InfoManager::socket_hide_candidate (void)
5286 m_impl->socket_hide_candidate ();
5289 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
5290 void InfoManager::socket_get_candidate_geometry (String& uuid)
5292 m_impl->socket_get_candidate_geometry (uuid);
5295 //ISM_TRANS_CMD_SET_KEYBOARD_ISE_BY_UUID
5296 void InfoManager::socket_set_keyboard_ise (String uuid)
5298 m_impl->socket_set_keyboard_ise (uuid);
5301 //ISM_TRANS_CMD_SELECT_CANDIDATE
5302 void InfoManager::socket_helper_select_candidate (uint32 index)
5304 m_impl->socket_helper_select_candidate (index);
5307 //ISM_TRANS_CMD_UPDATE_ISE_GEOMETRY
5308 void InfoManager::socket_helper_update_ise_geometry (int client, uint32 x, uint32 y, uint32 width, uint32 height)
5310 m_impl->socket_helper_update_ise_geometry (client, x, y, width, height);
5313 //ISM_TRANS_CMD_GET_KEYBOARD_ISE
5314 void InfoManager::socket_get_keyboard_ise (String uuid)
5316 m_impl->socket_get_keyboard_ise (uuid);
5319 //SCIM_TRANS_CMD_START_HELPER
5320 void InfoManager::socket_start_helper (int client_id, uint32 context, String uuid)
5322 m_impl->socket_start_helper (client_id, context, uuid);
5325 //SCIM_TRANS_CMD_STOP_HELPER
5326 void InfoManager::socket_stop_helper (int client_id, uint32 context, String uuid)
5328 m_impl->socket_stop_helper (client_id, context, uuid);
5331 //SCIM_TRANS_CMD_SEND_HELPER_EVENT
5332 void InfoManager::socket_send_helper_event (int client_id, uint32 context, String uuid, const Transaction& _nest_trans)
5334 m_impl->socket_send_helper_event (client_id, context, uuid, _nest_trans);
5337 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
5338 void InfoManager::socket_helper_register_properties (int client, PropertyList& properties)
5340 m_impl->socket_helper_register_properties (client, properties);
5343 //SCIM_TRANS_CMD_UPDATE_PROPERTY
5344 void InfoManager::socket_helper_update_property (int client, Property& property)
5346 m_impl->socket_helper_update_property (client, property);
5349 //SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT
5350 void InfoManager::socket_helper_send_imengine_event (int client, uint32 target_ic, String target_uuid , Transaction& nest_trans)
5352 m_impl->socket_helper_send_imengine_event (client, target_ic, target_uuid, nest_trans);
5355 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
5356 //SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT
5357 void InfoManager::socket_helper_send_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key)
5359 m_impl->socket_helper_send_key_event (client, target_ic, target_uuid, key);
5362 //SCIM_TRANS_CMD_FORWARD_KEY_EVENT
5363 void InfoManager::socket_helper_forward_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key)
5365 m_impl->socket_helper_forward_key_event (client, target_ic, target_uuid, key);
5368 //SCIM_TRANS_CMD_COMMIT_STRING
5369 void InfoManager::socket_helper_commit_string (int client, uint32 target_ic, String target_uuid, WideString wstr)
5371 m_impl->socket_helper_commit_string (client, target_ic, target_uuid, wstr);
5374 //SCIM_TRANS_CMD_GET_SURROUNDING_TEXT
5375 void InfoManager::socket_helper_get_surrounding_text (int client, String uuid, uint32 maxlen_before, uint32 maxlen_after)
5377 m_impl->socket_helper_get_surrounding_text (client, uuid, maxlen_before, maxlen_after);
5380 //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT
5381 void InfoManager::socket_helper_delete_surrounding_text (int client, uint32 offset, uint32 len)
5383 m_impl->socket_helper_delete_surrounding_text (client, offset, len);
5386 //SCIM_TRANS_CMD_GET_SELECTION
5387 void InfoManager::socket_helper_get_selection (int client, String uuid)
5389 m_impl->socket_helper_get_selection (client, uuid);
5392 //SCIM_TRANS_CMD_SET_SELECTION
5393 void InfoManager::socket_helper_set_selection (int client, uint32 start, uint32 end)
5395 m_impl->socket_helper_set_selection (client, start, end);
5398 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
5399 void InfoManager::socket_helper_show_preedit_string (int client, uint32 target_ic, String target_uuid)
5401 m_impl->socket_helper_show_preedit_string (client, target_ic, target_uuid);
5404 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
5405 void InfoManager::socket_helper_hide_preedit_string (int client, uint32 target_ic, String target_uuid)
5407 m_impl->socket_helper_hide_preedit_string (client, target_ic, target_uuid);
5410 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
5411 void InfoManager::socket_helper_update_preedit_string (int client, uint32 target_ic, String target_uuid, WideString preedit,
5412 WideString commit, AttributeList& attrs, uint32 caret)
5414 m_impl->socket_helper_update_preedit_string (client, target_ic, target_uuid, preedit, commit, attrs, caret);
5417 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
5418 void InfoManager::socket_helper_update_preedit_caret (int client, uint32 caret)
5420 m_impl->socket_helper_update_preedit_caret (client, caret);
5423 //ISM_TRANS_CMD_RECAPTURE_STRING
5424 void InfoManager::socket_helper_recapture_string (int client, uint32 target_ic, String target_uuid, int offset, int len, WideString preedit,
5425 WideString commit, AttributeList& attrs)
5427 m_impl->socket_helper_recapture_string (client, target_ic, target_uuid, offset, len, preedit, commit, attrs);
5430 //SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
5431 void InfoManager::socket_helper_register_helper (int client, HelperInfo& info)
5433 m_impl->socket_helper_register_helper (client, info);
5436 //SCIM_TRANS_CMD_PANEL_REGISTER_ACTIVE_HELPER
5437 void InfoManager::socket_helper_register_helper_passive (int client, HelperInfo& info)
5439 m_impl->socket_helper_register_helper_passive (client, info);
5442 //ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
5443 void InfoManager::socket_helper_update_input_context (int client, uint32 type, uint32 value)
5445 m_impl->socket_helper_update_input_context (client, type, value);
5448 //ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE
5449 void InfoManager::socket_helper_update_language_locale(int client, String locale)
5451 m_impl->socket_helper_update_language_locale(client, locale);
5454 //SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
5455 void InfoManager::socket_helper_send_private_command (int client, String command)
5457 m_impl->socket_helper_send_private_command (client, command);
5460 //SCIM_TRANS_CMD_COMMIT_CONTENT
5461 void InfoManager::socket_helper_commit_content (int client, String content, String description, String mime_types)
5463 m_impl->socket_helper_commit_content (client, content, description, mime_types);
5466 //ISM_TRANS_CMD_UPDATE_ISE_EXIT
5467 void InfoManager::UPDATE_ISE_EXIT (int client)
5469 m_impl->UPDATE_ISE_EXIT (client);
5472 //ISM_TRANS_CMD_PROCESS_KEY_EVENT_DONE
5473 void InfoManager::process_key_event_done (KeyEvent &key, uint32 ret, uint32 serial)
5475 m_impl->process_key_event_done (key, ret, serial);
5478 //ISM_TRANS_CMD_REQUEST_ISE_HIDE
5479 void InfoManager::request_ise_hide ()
5481 m_impl->request_ise_hide ();
5484 bool InfoManager::check_privilege_by_sockfd (int client_id, const String& privilege) {
5485 return m_impl->check_privilege_by_sockfd (client_id, privilege);
5488 void InfoManager::add_client (int client_id, uint32 key, ClientType type)
5490 m_impl->add_client (client_id, key, type);
5493 void InfoManager::del_client (int client_id)
5495 m_impl->del_client (client_id);
5498 bool InfoManager::set_autocapital_type (int mode)
5500 return m_impl->set_autocapital_type (mode);
5503 void InfoManager::set_prediction_allow (int client, bool mode)
5505 m_impl->set_prediction_allow (client, mode);
5508 void InfoManager::reshow_input_panel ()
5510 m_impl->reshow_input_panel ();
5513 //////////////////////////////////Message function end/////////////////////////////////////////
5516 InfoManager::signal_connect_turn_on (InfoManagerSlotVoid* slot)
5518 return m_impl->signal_connect_turn_on (slot);
5522 InfoManager::signal_connect_turn_off (InfoManagerSlotVoid* slot)
5524 return m_impl->signal_connect_turn_off (slot);
5528 InfoManager::signal_connect_show_panel (InfoManagerSlotVoid* slot)
5530 return m_impl->signal_connect_show_panel (slot);
5534 InfoManager::signal_connect_hide_panel (InfoManagerSlotVoid* slot)
5536 return m_impl->signal_connect_hide_panel (slot);
5540 InfoManager::signal_connect_update_screen (InfoManagerSlotInt* slot)
5542 return m_impl->signal_connect_update_screen (slot);
5546 InfoManager::signal_connect_update_spot_location (InfoManagerSlotIntIntInt* slot)
5548 return m_impl->signal_connect_update_spot_location (slot);
5552 InfoManager::signal_connect_update_factory_info (InfoManagerSlotFactoryInfo* slot)
5554 return m_impl->signal_connect_update_factory_info (slot);
5558 InfoManager::signal_connect_start_default_ise (InfoManagerSlotVoid* slot)
5560 return m_impl->signal_connect_start_default_ise (slot);
5564 InfoManager::signal_connect_stop_default_ise (InfoManagerSlotBool* slot)
5566 return m_impl->signal_connect_stop_default_ise (slot);
5570 InfoManager::signal_connect_set_candidate_ui (InfoManagerSlotIntInt* slot)
5572 return m_impl->signal_connect_set_candidate_ui (slot);
5576 InfoManager::signal_connect_get_candidate_ui (InfoManagerSlotIntInt2* slot)
5578 return m_impl->signal_connect_get_candidate_ui (slot);
5582 InfoManager::signal_connect_set_candidate_position (InfoManagerSlotIntInt* slot)
5584 return m_impl->signal_connect_set_candidate_position (slot);
5588 InfoManager::signal_connect_get_candidate_geometry (InfoManagerSlotRect* slot)
5590 return m_impl->signal_connect_get_candidate_geometry (slot);
5594 InfoManager::signal_connect_get_input_panel_geometry (InfoManagerSlotRect* slot)
5596 return m_impl->signal_connect_get_input_panel_geometry (slot);
5600 InfoManager::signal_connect_set_keyboard_ise (InfoManagerSlotString* slot)
5602 return m_impl->signal_connect_set_keyboard_ise (slot);
5606 InfoManager::signal_connect_get_keyboard_ise (InfoManagerSlotString2* slot)
5608 return m_impl->signal_connect_get_keyboard_ise (slot);
5612 InfoManager::signal_connect_show_help (InfoManagerSlotString* slot)
5614 return m_impl->signal_connect_show_help (slot);
5618 InfoManager::signal_connect_show_factory_menu (InfoManagerSlotFactoryInfoVector* slot)
5620 return m_impl->signal_connect_show_factory_menu (slot);
5624 InfoManager::signal_connect_show_preedit_string (InfoManagerSlotVoid* slot)
5626 return m_impl->signal_connect_show_preedit_string (slot);
5630 InfoManager::signal_connect_show_aux_string (InfoManagerSlotVoid* slot)
5632 return m_impl->signal_connect_show_aux_string (slot);
5636 InfoManager::signal_connect_show_lookup_table (InfoManagerSlotVoid* slot)
5638 return m_impl->signal_connect_show_lookup_table (slot);
5642 InfoManager::signal_connect_show_associate_table (InfoManagerSlotVoid* slot)
5644 return m_impl->signal_connect_show_associate_table (slot);
5648 InfoManager::signal_connect_hide_preedit_string (InfoManagerSlotVoid* slot)
5650 return m_impl->signal_connect_hide_preedit_string (slot);
5654 InfoManager::signal_connect_hide_aux_string (InfoManagerSlotVoid* slot)
5656 return m_impl->signal_connect_hide_aux_string (slot);
5660 InfoManager::signal_connect_hide_lookup_table (InfoManagerSlotVoid* slot)
5662 return m_impl->signal_connect_hide_lookup_table (slot);
5666 InfoManager::signal_connect_hide_associate_table (InfoManagerSlotVoid* slot)
5668 return m_impl->signal_connect_hide_associate_table (slot);
5672 InfoManager::signal_connect_update_preedit_string (InfoManagerSlotAttributeStringInt* slot)
5674 return m_impl->signal_connect_update_preedit_string (slot);
5678 InfoManager::signal_connect_update_preedit_caret (InfoManagerSlotInt* slot)
5680 return m_impl->signal_connect_update_preedit_caret (slot);
5684 InfoManager::signal_connect_update_aux_string (InfoManagerSlotAttributeString* slot)
5686 return m_impl->signal_connect_update_aux_string (slot);
5690 InfoManager::signal_connect_update_lookup_table (InfoManagerSlotLookupTable* slot)
5692 return m_impl->signal_connect_update_lookup_table (slot);
5696 InfoManager::signal_connect_update_associate_table (InfoManagerSlotLookupTable* slot)
5698 return m_impl->signal_connect_update_associate_table (slot);
5702 InfoManager::signal_connect_register_properties (InfoManagerSlotPropertyList* slot)
5704 return m_impl->signal_connect_register_properties (slot);
5708 InfoManager::signal_connect_update_property (InfoManagerSlotProperty* slot)
5710 return m_impl->signal_connect_update_property (slot);
5714 InfoManager::signal_connect_register_helper_properties (InfoManagerSlotIntPropertyList* slot)
5716 return m_impl->signal_connect_register_helper_properties (slot);
5720 InfoManager::signal_connect_update_helper_property (InfoManagerSlotIntProperty* slot)
5722 return m_impl->signal_connect_update_helper_property (slot);
5726 InfoManager::signal_connect_register_helper (InfoManagerSlotIntHelperInfo* slot)
5728 return m_impl->signal_connect_register_helper (slot);
5732 InfoManager::signal_connect_remove_helper (InfoManagerSlotInt* slot)
5734 return m_impl->signal_connect_remove_helper (slot);
5738 InfoManager::signal_connect_set_active_ise_by_uuid (InfoManagerSlotStringBool* slot)
5740 return m_impl->signal_connect_set_active_ise_by_uuid (slot);
5744 InfoManager::signal_connect_focus_in (InfoManagerSlotVoid* slot)
5746 return m_impl->signal_connect_focus_in (slot);
5750 InfoManager::signal_connect_focus_out (InfoManagerSlotVoid* slot)
5752 return m_impl->signal_connect_focus_out (slot);
5756 InfoManager::signal_connect_expand_candidate (InfoManagerSlotVoid* slot)
5758 return m_impl->signal_connect_expand_candidate (slot);
5762 InfoManager::signal_connect_contract_candidate (InfoManagerSlotVoid* slot)
5764 return m_impl->signal_connect_contract_candidate (slot);
5768 InfoManager::signal_connect_select_candidate (InfoManagerSlotInt* slot)
5770 return m_impl->signal_connect_select_candidate (slot);
5774 InfoManager::signal_connect_get_ise_list (InfoManagerSlotBoolStringVector* slot)
5776 return m_impl->signal_connect_get_ise_list (slot);
5780 InfoManager::signal_connect_get_all_helper_ise_info (InfoManagerSlotBoolHelperInfo* slot)
5782 return m_impl->signal_connect_get_all_helper_ise_info (slot);
5786 InfoManager::signal_connect_set_has_option_helper_ise_info (InfoManagerSlotStringBool* slot)
5788 return m_impl->signal_connect_set_has_option_helper_ise_info (slot);
5792 InfoManager::signal_connect_set_enable_helper_ise_info (InfoManagerSlotStringBool* slot)
5794 return m_impl->signal_connect_set_enable_helper_ise_info (slot);
5798 InfoManager::signal_connect_show_helper_ise_list (InfoManagerSlotVoid* slot)
5800 return m_impl->signal_connect_show_helper_ise_list (slot);
5804 InfoManager::signal_connect_show_helper_ise_selector (InfoManagerSlotVoid* slot)
5806 return m_impl->signal_connect_show_helper_ise_selector (slot);
5810 InfoManager::signal_connect_is_helper_ise_enabled (InfoManagerSlotStringInt* slot)
5812 return m_impl->signal_connect_is_helper_ise_enabled (slot);
5816 InfoManager::signal_connect_get_ise_information (InfoManagerSlotBoolString4int2* slot)
5818 return m_impl->signal_connect_get_ise_information (slot);
5822 InfoManager::signal_connect_get_keyboard_ise_list (InfoManagerSlotBoolStringVector* slot)
5824 return m_impl->signal_connect_get_keyboard_ise_list (slot);
5828 InfoManager::signal_connect_update_ise_geometry (InfoManagerSlotIntIntIntInt* slot)
5830 return m_impl->signal_connect_update_ise_geometry (slot);
5834 InfoManager::signal_connect_get_language_list (InfoManagerSlotStringVector* slot)
5836 return m_impl->signal_connect_get_language_list (slot);
5840 InfoManager::signal_connect_get_all_language (InfoManagerSlotStringVector* slot)
5842 return m_impl->signal_connect_get_all_language (slot);
5846 InfoManager::signal_connect_get_ise_language (InfoManagerSlotStrStringVector* slot)
5848 return m_impl->signal_connect_get_ise_language (slot);
5852 InfoManager::signal_connect_get_ise_info_by_uuid (InfoManagerSlotStringISEINFO* slot)
5854 return m_impl->signal_connect_get_ise_info_by_uuid (slot);
5858 InfoManager::signal_connect_send_key_event (InfoManagerSlotKeyEvent* slot)
5860 return m_impl->signal_connect_send_key_event (slot);
5864 InfoManager::signal_connect_accept_connection (InfoManagerSlotInt* slot)
5866 return m_impl->signal_connect_accept_connection (slot);
5870 InfoManager::signal_connect_close_connection (InfoManagerSlotInt* slot)
5872 return m_impl->signal_connect_close_connection (slot);
5876 InfoManager::signal_connect_exit (InfoManagerSlotVoid* slot)
5878 return m_impl->signal_connect_exit (slot);
5882 InfoManager::signal_connect_transaction_start (InfoManagerSlotVoid* slot)
5884 return m_impl->signal_connect_transaction_start (slot);
5888 InfoManager::signal_connect_transaction_end (InfoManagerSlotVoid* slot)
5890 return m_impl->signal_connect_transaction_end (slot);
5894 InfoManager::signal_connect_lock (InfoManagerSlotVoid* slot)
5896 return m_impl->signal_connect_lock (slot);
5900 InfoManager::signal_connect_unlock (InfoManagerSlotVoid* slot)
5902 return m_impl->signal_connect_unlock (slot);
5906 InfoManager::signal_connect_update_input_context (InfoManagerSlotIntInt* slot)
5908 return m_impl->signal_connect_update_input_context (slot);
5912 InfoManager::signal_connect_show_ise (InfoManagerSlotVoid* slot)
5914 return m_impl->signal_connect_show_ise (slot);
5918 InfoManager::signal_connect_hide_ise (InfoManagerSlotVoid* slot)
5920 return m_impl->signal_connect_hide_ise (slot);
5924 InfoManager::signal_connect_will_show_ack (InfoManagerSlotVoid* slot)
5926 return m_impl->signal_connect_will_show_ack (slot);
5930 InfoManager::signal_connect_will_hide_ack (InfoManagerSlotVoid* slot)
5932 return m_impl->signal_connect_will_hide_ack (slot);
5936 InfoManager::signal_connect_set_keyboard_mode (InfoManagerSlotInt* slot)
5938 return m_impl->signal_connect_set_keyboard_mode (slot);
5942 InfoManager::signal_connect_candidate_will_hide_ack (InfoManagerSlotVoid* slot)
5944 return m_impl->signal_connect_candidate_will_hide_ack (slot);
5948 InfoManager::signal_connect_get_ise_state (InfoManagerSlotInt2* slot)
5950 return m_impl->signal_connect_get_ise_state (slot);
5954 InfoManager::signal_connect_run_helper (InfoManagerSlotString3* slot)
5956 return m_impl->signal_connect_run_helper (slot);
5960 InfoManager::signal_connect_launch_option_application (InfoManagerSlotBoolString* slot)
5962 return m_impl->signal_connect_launch_option_application (slot);
5966 InfoManager::signal_connect_get_recent_ise_geometry (InfoManagerSlotIntRect* slot)
5968 return m_impl->signal_connect_get_recent_ise_geometry (slot);
5972 InfoManager::signal_connect_check_privilege_by_sockfd (InfoManagerSlotIntString2* slot)
5974 return m_impl->signal_connect_check_privilege_by_sockfd (slot);
5978 InfoManager::signal_connect_remoteinput_send_input_message (InfoManagerSlotStringBool* slot)
5980 return m_impl->signal_connect_remoteinput_send_input_message (slot);
5984 InfoManager::signal_connect_remoteinput_send_surrounding_text (InfoManagerSlotIntString* slot)
5986 return m_impl->signal_connect_remoteinput_send_surrounding_text (slot);
5989 } /* namespace scim */
5992 vi:ts=4:nowrap:ai:expandtab