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 <sys/socket.h>
66 #include "scim_private.h"
68 #include "scim_stl_map.h"
69 #include "isf_panel_agent_manager.h"
70 #include "isf_debug.h"
72 #include "ise_context.h"
77 #define LOG_TAG "ISF_PANEL_EFL"
79 #define MIN_REPEAT_TIME 2.0
85 InfoManagerSignalVoid;
87 typedef Signal1<void, int>
90 typedef Signal1<void, int&>
91 InfoManagerSignalInt2;
93 typedef Signal1<void, const String&>
94 InfoManagerSignalString;
96 typedef Signal2<void, const String&, bool>
97 InfoManagerSignalStringBool;
99 typedef Signal2<void, String&, String&>
100 InfoManagerSignalString2;
102 typedef Signal2<void, int, const String&>
103 InfoManagerSignalIntString;
105 typedef Signal1<void, const PanelFactoryInfo&>
106 InfoManagerSignalFactoryInfo;
108 typedef Signal1<void, const std::vector <PanelFactoryInfo> &>
109 InfoManagerSignalFactoryInfoVector;
111 typedef Signal1<void, const LookupTable&>
112 InfoManagerSignalLookupTable;
114 typedef Signal1<void, const Property&>
115 InfoManagerSignalProperty;
117 typedef Signal1<void, const PropertyList&>
118 InfoManagerSignalPropertyList;
120 typedef Signal2<void, int, int>
121 InfoManagerSignalIntInt;
123 typedef Signal2<void, int&, int&>
124 InfoManagerSignalIntInt2;
126 typedef Signal3<void, int, int, int>
127 InfoManagerSignalIntIntInt;
129 typedef Signal3<void, const String &, const String &, const String &>
130 InfoManagerSignalString3;
132 typedef Signal4<void, int, int, int, int>
133 InfoManagerSignalIntIntIntInt;
135 typedef Signal2<void, int, const Property&>
136 InfoManagerSignalIntProperty;
138 typedef Signal2<void, int, const PropertyList&>
139 InfoManagerSignalIntPropertyList;
141 typedef Signal2<void, int, const HelperInfo&>
142 InfoManagerSignalIntHelperInfo;
144 typedef Signal3<void, const String&, const AttributeList&, int>
145 InfoManagerSignalAttributeStringInt;
147 typedef Signal5<void, int, int, const String&, const String&, const AttributeList&>
148 InfoManagerSignalAttributeInt2String2;
150 typedef Signal2<void, const String&, const AttributeList&>
151 InfoManagerSignalAttributeString;
153 typedef Signal1<void, std::vector <String> &>
154 InfoManagerSignalStringVector;
156 typedef Signal1<bool, HELPER_ISE_INFO&>
157 InfoManagerSignalBoolHelperInfo;
159 typedef Signal1<bool, std::vector <String> &>
160 InfoManagerSignalBoolStringVector;
162 typedef Signal2<void, char*, std::vector <String> &>
163 InfoManagerSignalStrStringVector;
165 typedef Signal2<bool, const String&, ISE_INFO&>
166 InfoManagerSignalStringISEINFO;
168 typedef Signal2<bool, String, int&>
169 InfoManagerSignalStringInt;
171 typedef Signal1<void, const KeyEvent&>
172 InfoManagerSignalKeyEvent;
174 typedef Signal1<void, struct rectinfo&>
175 InfoManagerSignalRect;
177 typedef Signal6<bool, String, String&, String&, int&, int&, String&>
178 InfoManagerSignalBoolString4int2;
180 typedef Signal2<void, int, struct rectinfo&>
181 InfoManagerSignalIntRect;
183 typedef Signal2<bool, int, String>
184 InfoManagerSignalIntString2;
186 typedef Signal1<bool, String>
187 InfoManagerSignalBoolString;
189 typedef Signal2<bool, String, String&>
190 InfoManagerSignalBoolString2;
192 typedef Signal1<void, bool>
193 InfoManagerSignalBool;
195 struct HelperClientStub {
199 HelperClientStub (int i = 0, int r = 0) : id (i), ref (r) { }
202 struct IMControlStub {
203 std::vector<ISE_INFO> info;
204 std::vector<int> count;
207 #define DEFAULT_CONTEXT_VALUE 0xfff
209 #if SCIM_USE_STL_EXT_HASH_MAP
210 typedef __gnu_cxx::hash_map <int, ClientInfo, __gnu_cxx::hash <int> > ClientRepository;
211 typedef __gnu_cxx::hash_map <int, HelperInfo, __gnu_cxx::hash <int> > HelperInfoRepository;
212 typedef __gnu_cxx::hash_map <uint32, String, __gnu_cxx::hash <unsigned int> > ClientContextUUIDRepository;
213 typedef __gnu_cxx::hash_map <String, HelperClientStub, scim_hash_string> HelperClientIndex;
214 typedef __gnu_cxx::hash_map <String, std::vector < std::pair <uint32, String> >, scim_hash_string> StartHelperICIndex;
215 #elif SCIM_USE_STL_HASH_MAP
216 typedef std::hash_map <int, ClientInfo, std::hash <int> > ClientRepository;
217 typedef std::hash_map <int, HelperInfo, std::hash <int> > HelperInfoRepository;
218 typedef std::hash_map <uint32, String, std::hash <unsigned int> > ClientContextUUIDRepository;
219 typedef std::hash_map <String, HelperClientStub, scim_hash_string> HelperClientIndex;
220 typedef std::hash_map <String, std::vector < std::pair <uint32, String> >, scim_hash_string> StartHelperICIndex;
222 typedef std::map <int, ClientInfo> ClientRepository;
223 typedef std::map <int, HelperInfo> HelperInfoRepository;
224 typedef std::map <uint32, String> ClientContextUUIDRepository;
225 typedef std::map <String, HelperClientStub> HelperClientIndex;
226 typedef std::map <String, std::vector < std::pair <uint32, String> > > StartHelperICIndex;
229 typedef std::map <String, uint32> UUIDCountRepository;
230 typedef std::map <String, enum HelperState> UUIDStateRepository;
231 typedef std::map <String, int> StringIntRepository;
232 typedef std::map <int, struct IMControlStub> IMControlRepository;
233 typedef std::map <int, int> IntIntRepository;
236 get_helper_ic (int client, uint32 context)
238 return (uint32) (client & 0xFFFF) | ((context & 0x7FFF) << 16);
242 get_imengine_client_context (uint32 helper_ic, int& client, uint32& context)
244 client = (int) (helper_ic & 0xFFFF);
245 context = ((helper_ic >> 16) & 0x7FFF);
249 clients_equal (int first, int second)
251 return ((first & 0xFFFF) == (second & 0xFFFF));
255 contexts_equal (uint32 first, uint32 second)
257 return ((first & 0x7FFF) == (second & 0x7FFF));
260 //==================================== InfoManager ===========================
261 class InfoManager::InfoManagerImpl
263 int m_current_screen;
265 String m_config_name;
266 String m_display_name;
268 int m_current_socket_client;
269 uint32 m_current_client_context;
270 String m_current_context_uuid;
271 TOOLBAR_MODE_T m_current_toolbar_mode;
272 uint32 m_current_helper_option;
273 String m_current_helper_uuid;
274 String m_last_helper_uuid;
275 String m_current_ise_name;
276 int m_pending_active_imcontrol_id;
277 int m_show_request_client_id;
278 int m_active_client_id;
279 IntIntRepository m_panel_client_map;
280 IntIntRepository m_imcontrol_map;
281 bool m_should_shared_ise;
283 bool m_is_imengine_aux;
284 bool m_is_imengine_candidate;
285 bool m_refocus_needed;
286 bool m_reshow_needed;
287 bool m_restart_needed;
290 std::vector<int> m_current_send_remoteinput_id;
291 std::vector<int> m_current_recv_remoteinput_id;
293 int m_last_socket_client;
294 uint32 m_last_client_context;
295 String m_last_context_uuid;
297 char* m_ise_context_buffer;
298 size_t m_ise_context_length;
299 char* m_imdata_buffer;
300 size_t m_imdata_length;
302 ClientRepository m_client_repository;
304 * Each Helper ISE has two socket connect between InfoManager and HelperAgent.
305 * m_helper_info_repository records the active connection.
306 * m_helper_active_info_repository records the passive connection.
308 HelperInfoRepository m_helper_info_repository;
309 HelperInfoRepository m_helper_active_info_repository;
310 HelperClientIndex m_helper_client_index;
312 /* when helper register, notify imcontrol client */
313 StringIntRepository m_ise_pending_repository;
314 IMControlRepository m_imcontrol_repository;
316 StartHelperICIndex m_start_helper_ic_index;
319 ClientContextUUIDRepository m_client_context_uuids;
322 ClientContextUUIDRepository m_client_context_helper;
323 UUIDCountRepository m_helper_uuid_count;
325 InfoManagerSignalVoid m_signal_turn_on;
326 InfoManagerSignalVoid m_signal_turn_off;
327 InfoManagerSignalVoid m_signal_show_panel;
328 InfoManagerSignalVoid m_signal_hide_panel;
329 InfoManagerSignalInt m_signal_update_screen;
330 InfoManagerSignalIntIntInt m_signal_update_spot_location;
331 InfoManagerSignalFactoryInfo m_signal_update_factory_info;
332 InfoManagerSignalVoid m_signal_start_default_ise;
333 InfoManagerSignalBool m_signal_stop_default_ise;
334 InfoManagerSignalIntInt m_signal_update_input_context;
335 InfoManagerSignalString m_signal_update_language_locale;
336 InfoManagerSignalIntInt m_signal_set_candidate_ui;
337 InfoManagerSignalIntInt2 m_signal_get_candidate_ui;
338 InfoManagerSignalIntInt m_signal_set_candidate_position;
339 InfoManagerSignalRect m_signal_get_candidate_geometry;
340 InfoManagerSignalRect m_signal_get_input_panel_geometry;
341 InfoManagerSignalString m_signal_set_keyboard_ise;
342 InfoManagerSignalString2 m_signal_get_keyboard_ise;
343 InfoManagerSignalString m_signal_show_help;
344 InfoManagerSignalFactoryInfoVector m_signal_show_factory_menu;
345 InfoManagerSignalVoid m_signal_show_preedit_string;
346 InfoManagerSignalVoid m_signal_show_aux_string;
347 InfoManagerSignalVoid m_signal_show_lookup_table;
348 InfoManagerSignalVoid m_signal_show_associate_table;
349 InfoManagerSignalVoid m_signal_hide_preedit_string;
350 InfoManagerSignalVoid m_signal_hide_aux_string;
351 InfoManagerSignalVoid m_signal_hide_lookup_table;
352 InfoManagerSignalVoid m_signal_hide_associate_table;
353 InfoManagerSignalAttributeStringInt m_signal_update_preedit_string;
354 InfoManagerSignalAttributeInt2String2 m_signal_recapture_string;
355 InfoManagerSignalInt m_signal_update_preedit_caret;
356 InfoManagerSignalAttributeString m_signal_update_aux_string;
357 InfoManagerSignalLookupTable m_signal_update_lookup_table;
358 InfoManagerSignalLookupTable m_signal_update_associate_table;
359 InfoManagerSignalPropertyList m_signal_register_properties;
360 InfoManagerSignalProperty m_signal_update_property;
361 InfoManagerSignalIntPropertyList m_signal_register_helper_properties;
362 InfoManagerSignalIntProperty m_signal_update_helper_property;
363 InfoManagerSignalIntHelperInfo m_signal_register_helper;
364 InfoManagerSignalInt m_signal_remove_helper;
365 InfoManagerSignalStringBool m_signal_set_active_ise_by_uuid;
366 InfoManagerSignalVoid m_signal_focus_in;
367 InfoManagerSignalVoid m_signal_focus_out;
368 InfoManagerSignalVoid m_signal_expand_candidate;
369 InfoManagerSignalVoid m_signal_contract_candidate;
370 InfoManagerSignalInt m_signal_select_candidate;
371 InfoManagerSignalBoolStringVector m_signal_get_ise_list;
372 InfoManagerSignalBoolHelperInfo m_signal_get_all_helper_ise_info;
373 InfoManagerSignalStringBool m_signal_set_has_option_helper_ise_info;
374 InfoManagerSignalStringBool m_signal_set_enable_helper_ise_info;
375 InfoManagerSignalVoid m_signal_show_helper_ise_list;
376 InfoManagerSignalVoid m_signal_show_helper_ise_selector;
377 InfoManagerSignalStringInt m_signal_is_helper_ise_enabled;
378 InfoManagerSignalBoolString4int2 m_signal_get_ise_information;
379 InfoManagerSignalBoolStringVector m_signal_get_keyboard_ise_list;
380 InfoManagerSignalIntIntIntInt m_signal_update_ise_geometry;
381 InfoManagerSignalStringVector m_signal_get_language_list;
382 InfoManagerSignalStringVector m_signal_get_all_language;
383 InfoManagerSignalStrStringVector m_signal_get_ise_language;
384 InfoManagerSignalStringISEINFO m_signal_get_ise_info_by_uuid;
385 InfoManagerSignalKeyEvent m_signal_send_key_event;
387 InfoManagerSignalInt m_signal_accept_connection;
388 InfoManagerSignalInt m_signal_close_connection;
389 InfoManagerSignalVoid m_signal_exit;
391 InfoManagerSignalVoid m_signal_transaction_start;
392 InfoManagerSignalVoid m_signal_transaction_end;
394 InfoManagerSignalVoid m_signal_lock;
395 InfoManagerSignalVoid m_signal_unlock;
397 InfoManagerSignalVoid m_signal_show_ise;
398 InfoManagerSignalVoid m_signal_hide_ise;
400 InfoManagerSignalVoid m_signal_will_show_ack;
401 InfoManagerSignalVoid m_signal_will_hide_ack;
403 InfoManagerSignalInt m_signal_set_keyboard_mode;
405 InfoManagerSignalVoid m_signal_candidate_will_hide_ack;
406 InfoManagerSignalInt2 m_signal_get_ise_state;
407 InfoManagerSignalString3 m_signal_run_helper;
409 InfoManagerSignalIntRect m_signal_get_recent_ise_geometry;
411 InfoManagerSignalStringBool m_signal_remoteinput_send_input_message;
412 InfoManagerSignalIntString m_signal_remoteinput_send_surrounding_text;
414 InfoManagerSignalIntString2 m_signal_check_privilege_by_sockfd;
416 InfoManagerSignalBoolString m_signal_launch_option_application;
417 InfoManagerSignalBoolString2 m_signal_get_ise_setting_appid;
419 PanelAgentManager m_panel_agent_manager;
421 void delete_ise_context_buffer (void) {
422 if (m_ise_context_buffer != NULL) {
423 delete[] m_ise_context_buffer;
424 m_ise_context_buffer = NULL;
425 m_ise_context_length = 0;
429 void delete_imdata_buffer (void) {
430 if (m_imdata_buffer != NULL) {
431 delete[] m_imdata_buffer;
432 m_imdata_buffer = NULL;
439 : m_current_screen (0),
440 m_current_socket_client (-1), m_current_client_context (0),
441 m_current_toolbar_mode (TOOLBAR_KEYBOARD_MODE),
442 m_current_helper_option (0),
443 m_pending_active_imcontrol_id (-1),
444 m_show_request_client_id (-1),
445 m_active_client_id (-1),
446 m_should_shared_ise (false),
447 m_ise_exiting (false), m_is_imengine_aux (false), m_is_imengine_candidate (false),
448 m_refocus_needed (false),
449 m_reshow_needed (false),
450 m_restart_needed (false),
451 m_is_ise_alive (false),
452 m_last_socket_client (-1), m_last_client_context (0),
453 m_ise_context_buffer (NULL), m_ise_context_length (0),
454 m_imdata_buffer (NULL), m_imdata_length (0) {
455 m_current_ise_name = String (_ ("English Keyboard"));
456 m_imcontrol_repository.clear ();
457 m_imcontrol_map.clear ();
458 m_current_send_remoteinput_id.clear ();
459 m_current_recv_remoteinput_id.clear ();
460 m_panel_client_map.clear ();
463 ~InfoManagerImpl () {
464 delete_ise_context_buffer ();
465 delete_imdata_buffer ();
468 bool initialize (InfoManager* info_manager, const ConfigPointer& config, const String& display, bool resident) {
470 m_config_name = "socket";
471 m_display_name = display;
473 return m_panel_agent_manager.initialize (info_manager, config, display, resident);
476 bool valid (void) const {
477 return m_panel_agent_manager.valid ();
483 SCIM_DEBUG_MAIN (1) << "InfoManager::stop ()\n";
485 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
486 String helper_uuid = get_current_helper_uuid ();
487 hide_helper (helper_uuid);
488 stop_helper (helper_uuid, -2, 0);
491 m_panel_agent_manager.stop ();
494 TOOLBAR_MODE_T get_current_toolbar_mode () const {
495 return m_current_toolbar_mode;
498 String get_current_ise_name () const {
499 return m_current_ise_name;
502 String get_current_helper_uuid () const {
503 return m_current_helper_uuid;
506 uint32 get_current_helper_option () const {
507 return m_current_helper_option;
510 void set_current_ise_name (String& name) {
511 m_current_ise_name = name;
514 void set_current_toolbar_mode (TOOLBAR_MODE_T mode) {
515 m_current_toolbar_mode = mode;
518 void set_current_helper_option (uint32 option) {
519 m_current_helper_option = option;
522 void update_panel_event (int cmd, uint32 nType, uint32 nValue) {
524 uint32 focused_context;
525 get_focused_context (focused_client, focused_context);
527 if (focused_client == -1 && m_active_client_id != -1) {
528 focused_client = m_panel_client_map[m_active_client_id];
532 SCIM_DEBUG_MAIN (1) << __func__ << " (" << nType << ", " << nValue << "), client=" << focused_client << "\n";
533 ClientInfo client_info = socket_get_client_info (focused_client);
535 if (client_info.type == FRONTEND_CLIENT) {
536 m_panel_agent_manager.update_panel_event (focused_client, focused_context, cmd, nType, nValue);
538 std::cerr << __func__ << " focused client is not existed!!!" << "\n";
541 if (m_panel_client_map[m_show_request_client_id] != focused_client) {
542 client_info = socket_get_client_info (m_panel_client_map[m_show_request_client_id]);
544 if (client_info.type == FRONTEND_CLIENT) {
545 m_panel_agent_manager.update_panel_event (m_panel_client_map[m_show_request_client_id], 0, cmd, nType, nValue);
546 std::cerr << __func__ << " show request client=" << m_panel_client_map[m_show_request_client_id] << "\n";
548 std::cerr << __func__ << " show request client is not existed!!!" << "\n";
553 bool move_preedit_caret (uint32 position) {
554 SCIM_DEBUG_MAIN (1) << "InfoManager::move_preedit_caret (" << position << ")\n";
558 get_focused_context (client, context);
561 m_panel_agent_manager.update_preedit_caret (client, context, position);
569 bool request_help (void) {
570 SCIM_DEBUG_MAIN (1) << "InfoManager::request_help ()\n";
574 get_focused_context (client, context);
577 m_panel_agent_manager.request_help (client, context);
584 bool request_factory_menu (void) {
585 SCIM_DEBUG_MAIN (1) << "InfoManager::request_factory_menu ()\n";
589 get_focused_context (client, context);
592 m_panel_agent_manager.request_factory_menu (client, context);
600 //ISM_TRANS_CMD_PANEL_RESET_KEYBOARD_ISE
601 bool reset_keyboard_ise (void) {
602 SCIM_DEBUG_MAIN (1) << "InfoManager::reset_keyboard_ise ()\n";
606 get_focused_context (client, context);
609 m_panel_agent_manager.reset_keyboard_ise (client, context);
616 bool update_keyboard_ise_list (void) {
617 SCIM_DEBUG_MAIN (1) << "InfoManager::update_keyboard_ise_list ()\n";
621 get_focused_context (client, context);
624 m_panel_agent_manager.update_keyboard_ise_list (client, context);
631 bool change_factory (const String& uuid) {
632 SCIM_DEBUG_MAIN (1) << "InfoManager::change_factory (" << uuid << ")\n";
636 if (scim_global_config_read (SCIM_GLOBAL_CONFIG_PRELOAD_KEYBOARD_ISE, false))
637 m_helper_manager.preload_keyboard_ise (uuid);
640 get_focused_context (client, context);
643 m_panel_agent_manager.change_factory (client, context, uuid);
650 bool helper_candidate_show (void) {
651 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
656 get_focused_context (client, context);
658 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
659 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
661 if (it != m_helper_client_index.end ()) {
662 uint32 ctx = get_helper_ic (client, context);
663 m_panel_agent_manager.helper_candidate_show (it->second.id, ctx, m_current_helper_uuid);
668 /* Inform wayland module that we are showing candidate window */
670 uint32 focused_context;
671 String focused_uuid = get_focused_context(focused_client, focused_context);
672 m_panel_agent_manager.helper_candidate_show(focused_client, focused_context, focused_uuid);
677 bool helper_candidate_hide (void) {
678 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
683 get_focused_context (client, context);
685 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
686 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
688 if (it != m_helper_client_index.end ()) {
689 uint32 ctx = get_helper_ic (client, context);
690 m_panel_agent_manager.helper_candidate_hide (it->second.id, ctx, m_current_helper_uuid);
695 /* Inform wayland module that we are hiding candidate window */
697 uint32 focused_context;
698 String focused_uuid = get_focused_context(focused_client, focused_context);
699 m_panel_agent_manager.helper_candidate_hide(focused_client, focused_context, focused_uuid);
704 bool candidate_more_window_show (void) {
705 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
708 get_focused_context (client, context);
710 if (m_is_imengine_candidate) {
712 m_panel_agent_manager.candidate_more_window_show (client, context);
716 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
717 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
719 if (it != m_helper_client_index.end ()) {
720 uint32 ctx = get_helper_ic (client, context);
721 m_panel_agent_manager.candidate_more_window_show (it->second.id, ctx);
730 bool candidate_more_window_hide (void) {
731 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
734 get_focused_context (client, context);
736 if (m_is_imengine_candidate) {
738 m_panel_agent_manager.candidate_more_window_hide (client, context);
742 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
743 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
745 if (it != m_helper_client_index.end ()) {
746 uint32 ctx = get_helper_ic (client, context);
747 m_panel_agent_manager.candidate_more_window_hide (it->second.id, ctx);
756 bool update_helper_lookup_table (const LookupTable& table) {
757 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
761 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
762 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
764 if (it != m_helper_client_index.end ()) {
766 get_focused_context (client, context);
767 ctx = get_helper_ic (client, context);
768 m_panel_agent_manager.update_helper_lookup_table (it->second.id, ctx, m_current_helper_uuid, table);
776 bool select_aux (uint32 item) {
777 SCIM_DEBUG_MAIN (1) << "InfoManager::select_aux (" << item << ")\n";
781 get_focused_context (client, context);
783 if (m_is_imengine_aux) {
785 m_panel_agent_manager.select_aux (client, context, item);
788 helper_select_aux (item);
795 bool select_candidate (uint32 item) {
796 SCIM_DEBUG_MAIN (1) << "InfoManager::select_candidate (" << item << ")\n";
800 get_focused_context (client, context);
802 if (m_is_imengine_candidate) {
804 m_panel_agent_manager.select_candidate (client, context, item);
807 helper_select_candidate (item);
814 bool lookup_table_page_up (void) {
815 SCIM_DEBUG_MAIN (1) << "InfoManager::lookup_table_page_up ()\n";
819 get_focused_context (client, context);
821 if (m_is_imengine_candidate) {
823 m_panel_agent_manager.lookup_table_page_up (client, context);
826 helper_lookup_table_page_up ();
833 bool lookup_table_page_down (void) {
834 SCIM_DEBUG_MAIN (1) << "InfoManager::lookup_table_page_down ()\n";
838 get_focused_context (client, context);
840 if (m_is_imengine_candidate) {
842 m_panel_agent_manager.lookup_table_page_down (client, context);
845 helper_lookup_table_page_down ();
852 bool update_lookup_table_page_size (uint32 size) {
853 SCIM_DEBUG_MAIN (1) << "InfoManager::update_lookup_table_page_size (" << size << ")\n";
857 get_focused_context (client, context);
859 if (m_is_imengine_candidate) {
861 m_panel_agent_manager.update_lookup_table_page_size (client, context, size);
864 helper_update_lookup_table_page_size (size);
871 bool update_candidate_item_layout (const std::vector<uint32>& row_items) {
872 SCIM_DEBUG_MAIN (1) << __func__ << " (" << row_items.size () << ")\n";
876 get_focused_context (client, context);
878 if (m_is_imengine_candidate) {
880 m_panel_agent_manager.update_candidate_item_layout (client, context, row_items);
883 helper_update_candidate_item_layout (row_items);
890 bool select_associate (uint32 item) {
891 SCIM_DEBUG_MAIN (1) << "InfoManager::select_associate (" << item << ")\n";
895 get_focused_context (client, context);
898 m_panel_agent_manager.select_associate (client, context, item);
902 helper_select_associate (item);
906 bool associate_table_page_up (void) {
907 SCIM_DEBUG_MAIN (1) << "InfoManager::associate_table_page_up ()\n";
911 get_focused_context (client, context);
914 m_panel_agent_manager.associate_table_page_up (client, context);
918 helper_associate_table_page_up ();
922 bool associate_table_page_down (void) {
923 SCIM_DEBUG_MAIN (1) << "InfoManager::associate_table_page_down ()\n";
927 get_focused_context (client, context);
930 m_panel_agent_manager.associate_table_page_down (client, context);
934 helper_associate_table_page_down ();
938 bool update_associate_table_page_size (uint32 size) {
939 SCIM_DEBUG_MAIN (1) << "InfoManager::update_associate_table_page_size (" << size << ")\n";
943 get_focused_context (client, context);
946 m_panel_agent_manager.update_associate_table_page_size (client, context, size);
950 helper_update_associate_table_page_size (size);
954 bool update_displayed_candidate_number (uint32 size) {
955 SCIM_DEBUG_MAIN (1) << __func__ << " (" << size << ")\n";
959 get_focused_context (client, context);
961 if (m_is_imengine_candidate) {
963 m_panel_agent_manager.update_displayed_candidate_number (client, context, size);
966 helper_update_displayed_candidate_number (size);
973 void send_longpress_event (int type, int index) {
974 SCIM_DEBUG_MAIN (1) << __func__ << " (" << type << ", " << index << ")\n";
977 get_focused_context (client, context);
979 if (m_is_imengine_candidate) {
981 m_panel_agent_manager.send_longpress_event (client, context, index);
984 helper_longpress_candidate (index);
988 bool trigger_property (const String& property) {
989 SCIM_DEBUG_MAIN (1) << "InfoManager::trigger_property (" << property << ")\n";
993 get_focused_context (client, context);
996 m_panel_agent_manager.trigger_property (client, context, property);
1003 bool start_helper (const String& uuid, int client, uint32 context) {
1004 SCIM_DEBUG_MAIN (1) << "InfoManager::start_helper (" << uuid << ")\n";
1005 LOGD ("start ISE(%s)", uuid.c_str ());
1007 if (uuid.length () <= 0)
1011 /*if (m_current_toolbar_mode != TOOLBAR_HELPER_MODE || m_current_helper_uuid.compare (uuid) != 0)*/ {
1012 SCIM_DEBUG_MAIN (1) << "Run_helper\n";
1014 uint32 ic = get_helper_ic (m_panel_client_map[client], context);
1016 /* Get the context uuid from the client context registration table. */
1018 ClientContextUUIDRepository::iterator it =
1019 m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client], context));
1021 if (it != m_client_context_uuids.end ())
1022 ic_uuid = it->second;
1024 m_start_helper_ic_index [uuid].push_back (std::make_pair (ic, ic_uuid));
1025 m_signal_run_helper (uuid, m_config_name, m_display_name);
1027 m_current_helper_uuid = uuid;
1032 bool stop_helper (const String& uuid, int client, uint32 context) {
1033 char buf[256] = {0};
1034 snprintf (buf, sizeof (buf), "time:%ld pid:%d %s %s prepare to stop ISE(%s)\n",
1035 time (0), getpid (), __FILE__, __func__, uuid.c_str ());
1036 LOGD ("prepare to stop ISE(%s)", uuid.c_str ());
1037 SCIM_DEBUG_MAIN (1) << "InfoManager::stop_helper (" << uuid << ")\n";
1039 if (uuid.length () <= 0)
1043 uint32 ctx = get_helper_ic (client, context);
1044 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
1046 if (it != m_helper_client_index.end ()) {
1047 m_ise_exiting = true;
1048 m_current_helper_uuid = String ("");
1049 m_panel_agent_manager.exit (it->second.id, ctx);
1050 SCIM_DEBUG_MAIN (1) << "Stop helper\n";
1051 ISF_SAVE_LOG ("send SCIM_TRANS_CMD_EXIT message to %s", uuid.c_str ());
1054 /* Since we are stopping this helper, erase information from start_helper_ic_index too */
1055 m_start_helper_ic_index.erase (uuid);
1061 void focus_out_helper (const String& uuid, int client, uint32 context) {
1062 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1064 if (it != m_helper_client_index.end ()) {
1065 uint32 ctx = get_helper_ic (client, context);
1066 m_panel_agent_manager.focus_out_helper (it->second.id, ctx, uuid);
1070 void focus_in_helper (const String& uuid, int client, uint32 context) {
1071 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1073 if (it != m_helper_client_index.end ()) {
1074 uint32 ctx = get_helper_ic (client, context);
1075 m_panel_agent_manager.focus_in_helper (it->second.id, ctx, uuid);
1079 bool show_helper (const String& uuid, char* data, size_t& len, uint32 ctx) {
1080 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1082 if (it != m_helper_client_index.end ()) {
1083 Socket client_socket (it->second.id);
1084 m_panel_agent_manager.show_helper (it->second.id, ctx, uuid, data, len);
1088 LOGW ("Can't find %s", m_current_helper_uuid.c_str ());
1093 void hide_helper (const String& uuid, uint32 ctx = 0) {
1094 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1096 if (it != m_helper_client_index.end ()) {
1101 get_focused_context (client, context);
1102 ctx = get_helper_ic (client, context);
1105 m_panel_agent_manager.hide_helper (it->second.id, ctx, uuid);
1109 bool set_helper_mode (const String& uuid, uint32& mode) {
1110 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1112 if (it != m_helper_client_index.end ()) {
1116 get_focused_context (client, context);
1117 ctx = get_helper_ic (client, context);
1118 m_panel_agent_manager.set_helper_mode (it->second.id, ctx, uuid, mode);
1125 bool set_helper_language (const String& uuid, uint32& language) {
1126 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1128 if (it != m_helper_client_index.end ()) {
1132 get_focused_context (client, context);
1133 ctx = get_helper_ic (client, context);
1134 m_panel_agent_manager.set_helper_language (it->second.id, ctx, uuid, language);
1141 bool set_helper_imdata (const String& uuid, const char* imdata, size_t& len) {
1142 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1144 if (it != m_helper_client_index.end ()) {
1148 get_focused_context (client, context);
1149 ctx = get_helper_ic (client, context);
1150 m_panel_agent_manager.set_helper_imdata (it->second.id, ctx, uuid, imdata, len);
1157 bool set_helper_return_key_type (const String& uuid, int type) {
1158 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1160 if (it != m_helper_client_index.end ()) {
1164 get_focused_context (client, context);
1165 ctx = get_helper_ic (client, context);
1166 m_panel_agent_manager.set_helper_return_key_type (it->second.id, ctx, uuid, type);
1173 bool get_helper_return_key_type (const String& uuid, uint32& type) {
1174 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1176 if (it != m_helper_client_index.end ()) {
1180 get_focused_context (client, context);
1181 ctx = get_helper_ic (client, context);
1182 m_panel_agent_manager.get_helper_return_key_type (it->second.id, ctx, uuid, type);
1189 bool set_helper_return_key_disable (const String& uuid, bool disabled) {
1190 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1192 if (it != m_helper_client_index.end ()) {
1196 get_focused_context (client, context);
1197 ctx = get_helper_ic (client, context);
1198 m_panel_agent_manager.set_helper_return_key_disable (it->second.id, ctx, uuid, disabled);
1205 bool get_helper_return_key_disable (const String& uuid, uint32& disabled) {
1206 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1208 if (it != m_helper_client_index.end ()) {
1212 get_focused_context (client, context);
1213 ctx = get_helper_ic (client, context);
1214 m_panel_agent_manager.get_helper_return_key_disable (it->second.id, ctx, uuid, disabled);
1221 bool set_helper_layout (const String& uuid, uint32& layout) {
1222 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1224 if (it != m_helper_client_index.end ()) {
1228 get_focused_context (client, context);
1229 ctx = get_helper_ic (client, context);
1230 m_panel_agent_manager.set_helper_layout (it->second.id, ctx, uuid, layout);
1237 bool set_helper_input_mode (const String& uuid, uint32& mode) {
1238 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1240 if (it != m_helper_client_index.end ()) {
1244 get_focused_context (client, context);
1245 ctx = get_helper_ic (client, context);
1246 m_panel_agent_manager.set_helper_input_mode (it->second.id, ctx, uuid, mode);
1253 bool set_helper_input_hint (const String& uuid, uint32& hint) {
1254 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1256 if (it != m_helper_client_index.end ()) {
1260 get_focused_context (client, context);
1261 ctx = get_helper_ic (client, context);
1262 m_panel_agent_manager.set_helper_input_hint (it->second.id, ctx, uuid, hint);
1269 bool set_helper_bidi_direction (const String& uuid, uint32& direction) {
1270 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1272 if (it != m_helper_client_index.end ()) {
1276 get_focused_context (client, context);
1277 ctx = get_helper_ic (client, context);
1278 m_panel_agent_manager.set_helper_bidi_direction (it->second.id, ctx, uuid, direction);
1285 bool set_helper_caps_mode (const String& uuid, uint32& mode) {
1286 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1288 if (it != m_helper_client_index.end ()) {
1292 get_focused_context (client, context);
1293 ctx = get_helper_ic (client, context);
1294 m_panel_agent_manager.set_helper_caps_mode (it->second.id, ctx, uuid, mode);
1301 int get_client_pid(int client_id)
1303 Socket client_socket(client_id);
1305 int sockfd = client_socket.get_id();
1307 socklen_t len = sizeof(struct ucred);
1308 if (getsockopt(sockfd, SOL_SOCKET, SO_PEERCRED, &ucred, &len) == 0) {
1309 LOGI("client pid : %u", ucred.pid);
1312 LOGW("Failed to get socket infomation");
1319 bool show_helper_option_window (const String& uuid, int caller_pid) {
1320 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1322 if (it != m_helper_client_index.end ()) {
1326 get_focused_context (client, context);
1327 ctx = get_helper_ic (client, context);
1329 if (!m_signal_launch_option_application (uuid)) {
1330 LOGD ("call show helper option");
1331 int ime_pid = get_client_pid(it->second.id);
1332 LOGD ("parent : %d, client : %d", caller_pid, ime_pid);
1333 m_panel_agent_manager.show_helper_option_window (it->second.id, ctx, uuid, caller_pid, ime_pid);
1334 m_panel_agent_manager.set_transient_for (caller_pid, ime_pid);
1343 bool resume_helper_option_window (const String& uuid) {
1344 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1346 if (it != m_helper_client_index.end ()) {
1350 get_focused_context (client, context);
1351 ctx = get_helper_ic (client, context);
1352 m_panel_agent_manager.resume_helper_option_window (it->second.id, ctx, uuid);
1359 bool set_helper_keyboard_mode (const String& uuid, uint32& mode) {
1360 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1362 if (it != m_helper_client_index.end ()) {
1366 get_focused_context (client, context);
1367 ctx = get_helper_ic (client, context);
1368 m_panel_agent_manager.set_helper_keyboard_mode (it->second.id, ctx, uuid, mode);
1375 bool set_helper_prediction_hint (const String& uuid, String prediction_hint) {
1376 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1378 if (it != m_helper_client_index.end ()) {
1382 get_focused_context (client, context);
1383 ctx = get_helper_ic (client, context);
1384 m_panel_agent_manager.set_helper_prediction_hint (it->second.id, ctx, uuid, prediction_hint);
1391 bool set_helper_mime_type (const String& uuid, String mime_type) {
1392 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1394 if (it != m_helper_client_index.end ()) {
1398 get_focused_context (client, context);
1399 ctx = get_helper_ic (client, context);
1400 m_panel_agent_manager.set_helper_mime_type (it->second.id, ctx, uuid, mime_type);
1407 bool finalize_content_helper (const String& uuid, String text, uint32 cursor_pos) {
1408 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1410 if (it != m_helper_client_index.end ()) {
1414 get_focused_context (client, context);
1415 ctx = get_helper_ic (client, context);
1416 m_panel_agent_manager.finalize_content_helper (it->second.id, ctx, uuid, text, cursor_pos);
1423 bool set_helper_prediction_hint_data (const String& uuid, String key, String value) {
1424 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1426 if (it != m_helper_client_index.end ()) {
1430 get_focused_context (client, context);
1431 ctx = get_helper_ic (client, context);
1432 m_panel_agent_manager.set_helper_prediction_hint_data (it->second.id, ctx, uuid, key, value);
1439 bool set_helper_optimization_hint(const String& uuid, uint32& hint) {
1440 HelperClientIndex::iterator it = m_helper_client_index.find(m_current_helper_uuid);
1442 if (it != m_helper_client_index.end()) {
1446 get_focused_context(client, context);
1447 ctx = get_helper_ic(client, context);
1448 m_panel_agent_manager.set_helper_optimization_hint(it->second.id, ctx, uuid, hint);
1455 //ISM_TRANS_CMD_SHOW_ISF_CONTROL
1456 void show_isf_panel (int client_id) {
1457 SCIM_DEBUG_MAIN (4) << "InfoManager::show_isf_panel ()\n";
1458 m_signal_show_panel ();
1461 //ISM_TRANS_CMD_SEND_REMOTE_INPUT_MESSAGE
1462 bool send_remote_input_message (int client_id, char* buf, size_t len) {
1463 SCIM_DEBUG_MAIN(4) << "InfoManager::send_remote_input_message ()\n";
1465 if (buf && len > 0) {
1467 m_signal_remoteinput_send_input_message (msg, true);
1474 void send_remote_surrounding_text (const char* text, uint32 cursor) {
1475 SCIM_DEBUG_MAIN(4) << "InfoManager::send_remote_surrounding_text ()\n";
1477 m_signal_remoteinput_send_surrounding_text (cursor, text);
1480 //ISM_TRANS_CMD_HIDE_ISF_CONTROL
1481 void hide_isf_panel (int client_id) {
1482 SCIM_DEBUG_MAIN (4) << "InfoManager::hide_isf_panel ()\n";
1483 m_signal_hide_panel ();
1486 //ISM_TRANS_CMD_SHOW_ISE_PANEL
1487 void show_ise_panel (int client_id, uint32 client, uint32 context, char* data, size_t len) {
1488 SCIM_DEBUG_MAIN (4) << "InfoManager::show_ise_panel ()\n";
1489 m_reshow_needed = true;
1490 String initial_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
1491 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
1492 LOGD ("prepare to show ISE %d [%s] [%s]", client_id, initial_uuid.c_str (), default_uuid.c_str ());
1494 m_show_request_client_id = client_id;
1495 m_active_client_id = client_id;
1496 SCIM_DEBUG_MAIN (4) << __func__ << " (client:" << client << " context:" << context << ")\n";
1498 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode) {
1499 uint32 ctx = get_helper_ic (client, context);
1500 ret = show_helper (m_current_helper_uuid, data, len, ctx);
1503 /* Save ISE context for ISE panel re-showing */
1504 /* The size of data can be bigger than Ise_Context size if there is IMDATA. */
1505 if (data && len > 0) {
1506 delete_imdata_buffer ();
1507 delete_ise_context_buffer ();
1508 m_ise_context_buffer = new char [len];
1509 if (m_ise_context_buffer) {
1510 m_ise_context_length = len;
1511 memcpy (m_ise_context_buffer, data, m_ise_context_length);
1516 m_signal_show_ise ();
1518 bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false);
1519 if (launch_ise_on_request)
1520 m_signal_start_default_ise ();
1524 //ISM_TRANS_CMD_HIDE_ISE_PANEL
1525 void hide_ise_panel (int client_id, uint32 client, uint32 context) {
1526 SCIM_DEBUG_MAIN (4) << "InfoManager::hide_ise_panel ()\n";
1527 LOGD ("prepare to hide ISE, %d %d", client_id, m_show_request_client_id);
1528 SCIM_DEBUG_MAIN (4) << __func__ << " (client:" << client << " context:" << context << ")\n";
1530 m_reshow_needed = false;
1531 if (m_panel_client_map[client_id] == m_current_socket_client || client_id == m_show_request_client_id) {
1532 // && (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
1534 uint32 focused_context;
1535 get_focused_context (focused_client, focused_context);
1537 if (focused_client == -1 && m_active_client_id != -1) {
1538 focused_client = m_panel_client_map[m_active_client_id];
1539 focused_context = 0;
1542 m_signal_hide_ise ();
1545 /* Release ISE context & IMDATA buffer */
1546 delete_imdata_buffer ();
1547 delete_ise_context_buffer ();
1550 void hide_helper_ise (void) {
1553 uint32 focused_context;
1554 get_focused_context (focused_client, focused_context);
1555 m_panel_agent_manager.hide_helper_ise (focused_client, focused_context);
1557 m_signal_hide_ise ();
1561 void prelaunch_helper_ise (void) {
1562 SCIM_DEBUG_MAIN (4) << "InfoManager::prelaunch_helper_ise ()\n";
1565 * Currently the SHOW_PREPARE hint is delivered only to the already-running ISEs.
1566 * If the newly launched ise also has to be notified of given optimization hint,
1567 * we'll need to mark the hint somewhere and send the message when a newly launched
1568 * ise connects to the panel.
1570 HelperClientIndex::iterator it = m_helper_client_index.find(m_current_helper_uuid);
1571 if (it != m_helper_client_index.end()) {
1575 get_focused_context(client, context);
1576 ctx = get_helper_ic(client, context);
1577 m_panel_agent_manager.set_helper_optimization_hint(it->second.id, ctx, m_current_helper_uuid, ISE_OPTIMIZATION_HINT_SHOW_PREPARE);
1580 m_signal_start_default_ise();
1583 void set_default_ise (const DEFAULT_ISE_T& ise) {
1584 LOGD ("set default ise : %s", ise.uuid.c_str());
1585 scim_global_config_write (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), ise.uuid);
1586 scim_global_config_flush ();
1589 void set_should_shared_ise (const bool should_shared_ise) {
1590 m_should_shared_ise = should_shared_ise;
1592 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
1593 bool process_key_event (KeyEvent& key, uint32 serial, uint32 keycode) {
1594 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1596 if (m_is_ise_alive == false)
1599 if (it != m_helper_client_index.end ()) {
1603 get_focused_context (client, context);
1604 ctx = get_helper_ic (client, context);
1605 return m_panel_agent_manager.process_key_event (it->second.id, ctx, m_current_helper_uuid, key, serial, keycode);
1611 //ISM_TRANS_CMD_PROCESS_INPUT_DEVICE_EVENT
1612 bool process_input_device_event(int client_id, uint32 type, const char *data, size_t len, _OUT_ uint32& result) {
1613 SCIM_DEBUG_MAIN(4) << "InfoManager::process_input_device_event ()\n";
1614 HelperClientIndex::iterator it = m_helper_client_index.find(m_current_helper_uuid);
1616 if (it != m_helper_client_index.end()) {
1620 get_focused_context(client, context);
1621 ctx = get_helper_ic(client, context);
1622 return m_panel_agent_manager.process_input_device_event(it->second.id, ctx, m_current_helper_uuid, type, data, len, result);
1628 bool get_helper_geometry (String& uuid, struct rectinfo& info) {
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 return m_panel_agent_manager.get_helper_geometry (it->second.id, ctx, uuid, info);
1643 bool get_helper_imdata (String& uuid, char** imdata, size_t& len) {
1644 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1646 if (it != m_helper_client_index.end ()) {
1650 get_focused_context (client, context);
1651 ctx = get_helper_ic (client, context);
1652 m_panel_agent_manager.get_helper_imdata (it->second.id, ctx, uuid, imdata, len);
1659 bool get_helper_layout (String& uuid, uint32& layout) {
1660 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1662 if (it != m_helper_client_index.end ()) {
1666 get_focused_context (client, context);
1667 ctx = get_helper_ic (client, context);
1668 m_panel_agent_manager.get_helper_layout (it->second.id, ctx, uuid, layout);
1674 //ISM_TRANS_CMD_GET_ACTIVE_ISE_GEOMETRY
1675 void get_input_panel_geometry (int client_id, _OUT_ struct rectinfo& info) {
1676 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1677 m_signal_get_input_panel_geometry (info);
1679 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
1680 void get_candidate_window_geometry (int client_id, _OUT_ struct rectinfo& info) {
1681 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1682 m_signal_get_candidate_geometry (info);
1684 //ISM_TRANS_CMD_GET_ISE_LANGUAGE_LOCALE
1685 void get_ise_language_locale (int client_id, _OUT_ char** data, _OUT_ size_t& len) {
1686 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1687 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
1688 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1690 if (it != m_helper_client_index.end ()) {
1693 get_focused_context (client, context);
1694 uint32 ctx = get_helper_ic (client, context);
1695 m_panel_agent_manager.get_ise_language_locale (it->second.id, ctx, m_current_helper_uuid, data, len);
1700 void get_current_ise_geometry (rectinfo& rect) {
1701 SCIM_DEBUG_MAIN (4) << __func__ << " \n";
1704 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1705 ret = get_helper_geometry (m_current_helper_uuid, rect);
1715 void set_ise_mode (int client_id, uint32 mode) {
1716 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_mode ()\n";
1718 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1719 set_helper_mode (m_current_helper_uuid, mode);
1721 //ISM_TRANS_CMD_SET_LAYOUT
1722 void set_ise_layout (int client_id, uint32 layout) {
1723 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_layout ()\n";
1724 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1725 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1726 iseContext->layout = static_cast<Ecore_IMF_Input_Panel_Layout>(layout);
1728 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1729 set_helper_layout (m_current_helper_uuid, layout);
1731 //ISM_TRANS_CMD_SET_INPUT_MODE
1732 void set_ise_input_mode (int client_id, uint32 input_mode) {
1733 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_input_mode ()\n";
1735 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1736 set_helper_input_mode (m_current_helper_uuid, input_mode);
1738 //ISM_TRANS_CMD_SET_INPUT_HINT
1739 void set_ise_input_hint (int client_id, uint32 input_hint) {
1740 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_input_hint ()\n";
1741 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1742 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1743 iseContext->input_hint = static_cast<Ecore_IMF_Input_Hints>(input_hint);
1745 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1746 set_helper_input_hint (m_current_helper_uuid, input_hint);
1748 //ISM_TRANS_CMD_UPDATE_BIDI_DIRECTION
1749 void update_ise_bidi_direction (int client_id, uint32 bidi_direction) {
1750 SCIM_DEBUG_MAIN (4) << "InfoManager::update_ise_bidi_direction ()\n";
1751 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1752 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1753 iseContext->bidi_direction = static_cast<Ecore_IMF_BiDi_Direction>(bidi_direction);
1755 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1756 set_helper_bidi_direction (m_current_helper_uuid, bidi_direction);
1758 //ISM_TRANS_CMD_SET_ISE_LANGUAGE
1759 void set_ise_language (int client_id, uint32 language) {
1760 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_language ()\n";
1761 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1762 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1763 iseContext->language = static_cast<Ecore_IMF_Input_Panel_Lang>(language);
1765 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1766 set_helper_language (m_current_helper_uuid, language);
1768 //ISM_TRANS_CMD_SET_ISE_IMDATA
1769 void set_ise_imdata (int client_id, const char* imdata, size_t len) {
1770 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_imdata ()\n";
1772 delete_imdata_buffer ();
1773 m_imdata_buffer = new char [len];
1774 if (m_imdata_buffer) {
1775 m_imdata_length = len;
1776 memcpy (m_imdata_buffer, imdata, m_imdata_length);
1778 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1779 set_helper_imdata (m_current_helper_uuid, imdata, len);
1781 //ISM_TRANS_CMD_GET_ISE_IMDATA
1782 bool get_ise_imdata (int client_id, _OUT_ char** imdata, _OUT_ size_t& len) {
1783 SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_imdata ()\n";
1786 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1787 ret = get_helper_imdata (m_current_helper_uuid, imdata, len);
1791 //ISM_TRANS_CMD_GET_LAYOUT
1792 bool get_ise_layout (int client_id, _OUT_ uint32& layout) {
1793 SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_layout ()\n";
1796 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1797 ret = get_helper_layout (m_current_helper_uuid, layout);
1801 //ISM_TRANS_CMD_GET_ISE_STATE
1802 void get_ise_state (int client_id, _OUT_ int& state) {
1803 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1804 m_signal_get_ise_state (state);
1806 //ISM_TRANS_CMD_GET_ACTIVE_ISE
1807 void get_active_ise (int client_id, _OUT_ String& default_uuid) {
1808 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1809 default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
1811 //ISM_TRANS_CMD_GET_ISE_LIST
1812 void get_ise_list (int client_id, _OUT_ std::vector<String>& strlist) {
1813 SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_list ()\n";
1814 m_signal_get_ise_list (strlist);
1816 //ISM_TRANS_CMD_GET_ALL_HELPER_ISE_INFO
1817 void get_all_helper_ise_info (int client_id, _OUT_ HELPER_ISE_INFO& info) {
1818 SCIM_DEBUG_MAIN (4) << "InfoManager::get_all_helper_ise_info ()\n";
1819 m_signal_get_all_helper_ise_info (info);
1821 //1 Check if the current IME's option (setting) is available or not.
1822 for (uint32 i = 0; i < info.appid.size (); i++) {
1823 if (m_current_helper_uuid.compare (info.appid [i]) == 0) { // Find the current IME
1824 // If the current IME's "has_option" is unknown (-1), get it through ISM_TRANS_CMD_CHECK_OPTION_WINDOW command.
1825 // And it's saved to ime_info DB. Then next time this will be skipped.
1826 if (info.has_option [i] >= 2) {
1827 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1829 if (it != m_helper_client_index.end ()) {
1832 get_focused_context (client, context);
1833 uint32 ctx = get_helper_ic (client, context);
1834 uint32 avail = static_cast<uint32> (-1);
1835 m_panel_agent_manager.check_option_window (it->second.id, ctx, m_current_helper_uuid, avail);
1838 String setting_app = isf_pkg_get_setting_app (m_current_helper_uuid);
1839 if (setting_app.length () > 0)
1844 info.has_option [i] = avail;
1845 // Update "has_option" column of ime_info DB and global variable.
1846 m_signal_set_has_option_helper_ise_info (info.appid [i], static_cast<bool> (avail));
1853 //ISM_TRANS_CMD_SET_ENABLE_HELPER_ISE_INFO
1854 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1855 void set_enable_helper_ise_info (int client_id, String appid, uint32 is_enabled) {
1856 SCIM_DEBUG_MAIN (4) << "InfoManager::set_enable_helper_ise_info ()\n";
1857 m_signal_set_enable_helper_ise_info (appid, static_cast<bool> (is_enabled));
1859 //ISM_TRANS_CMD_SHOW_HELPER_ISE_LIST
1860 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1861 void show_helper_ise_list (int client_id) {
1862 SCIM_DEBUG_MAIN (4) << "InfoManager::show_helper_ise_list ()\n";
1863 m_signal_show_helper_ise_list ();
1865 //ISM_TRANS_CMD_SHOW_HELPER_ISE_SELECTOR
1866 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1867 void show_helper_ise_selector (int client_id) {
1868 SCIM_DEBUG_MAIN (4) << "InfoManager::show_helper_ise_selector ()\n";
1869 m_signal_show_helper_ise_selector ();
1871 //ISM_TRANS_CMD_IS_HELPER_ISE_ENABLED
1873 void is_helper_ise_enabled (int client_id, String strAppid, _OUT_ uint32& nEnabled) {
1874 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1876 m_signal_is_helper_ise_enabled (strAppid, _nEnabled);
1877 nEnabled = (uint32)_nEnabled;
1879 //ISM_TRANS_CMD_GET_ISE_INFORMATION
1880 void get_ise_information (int client_id, String strUuid, _OUT_ String& strName, _OUT_ String& strLanguage,
1881 _OUT_ int& nType, _OUT_ int& nOption, _OUT_ String& strModuleName) {
1882 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1883 m_signal_get_ise_information (strUuid, strName, strLanguage, nType, nOption, strModuleName);
1888 void get_language_list (int client_id, _OUT_ std::vector<String>& strlist) {
1889 SCIM_DEBUG_MAIN (4) << "InfoManager::get_language_list ()\n";
1890 m_signal_get_language_list (strlist);
1893 void get_all_language (int client_id, _OUT_ std::vector<String>& strlist) {
1894 SCIM_DEBUG_MAIN (4) << "InfoManager::get_all_language ()\n";
1895 m_signal_get_all_language (strlist);
1900 void get_ise_language (int client_id, char* buf, size_t len, _OUT_ std::vector<String>& strlist) {
1901 SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_language ()\n";
1902 m_signal_get_ise_language (buf, strlist);
1904 //ISM_TRANS_CMD_RESET_ISE_OPTION
1905 //reply SCIM_TRANS_CMD_OK
1906 bool reset_ise_option (int client_id) {
1907 SCIM_DEBUG_MAIN (1) << "InfoManager::reset_ise_option ()\n";
1911 ClientContextUUIDRepository::iterator it = m_client_context_uuids.begin ();
1913 if (it != m_client_context_uuids.end ()) {
1914 get_imengine_client_context (it->first, client, context);
1918 m_panel_agent_manager.reset_ise_option (client, context);
1925 bool find_active_ise_by_uuid (String uuid) {
1926 HelperInfoRepository::iterator iter = m_helper_info_repository.begin ();
1928 for (; iter != m_helper_info_repository.end (); iter++) {
1929 if (!uuid.compare (iter->second.uuid))
1935 //ISM_TRANS_CMD_SET_ACTIVE_ISE_BY_UUID
1937 bool set_active_ise_by_uuid (int client_id, char* buf, size_t len) {
1938 SCIM_DEBUG_MAIN (4) << "InfoManager::set_active_ise_by_uuid ()\n";
1947 if (!m_signal_get_ise_info_by_uuid (uuid, info)) {
1951 if (info.type == TOOLBAR_KEYBOARD_MODE) {
1952 m_signal_set_active_ise_by_uuid (uuid, 1);
1955 m_signal_set_active_ise_by_uuid (uuid, 1);
1960 if (find_active_ise_by_uuid (uuid)) {
1963 m_ise_pending_repository[uuid] = client_id;
1967 //ISM_TRANS_CMD_SET_INITIAL_ISE_BY_UUID
1968 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1969 void set_initial_ise_by_uuid (int client_id, char* buf, size_t len) {
1970 SCIM_DEBUG_MAIN (4) << "InfoManager::set_initial_ise_by_uuid ()\n";
1977 scim_global_config_write (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (uuid));
1978 scim_global_config_flush ();
1980 //ISM_TRANS_CMD_SET_RETURN_KEY_TYPE
1981 void set_ise_return_key_type (int client_id, uint32 type) {
1982 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1983 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1984 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1985 iseContext->return_key_type = static_cast<Ecore_IMF_Input_Panel_Return_Key_Type>(type);
1987 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1988 set_helper_return_key_type (m_current_helper_uuid, type);
1990 //ISM_TRANS_CMD_GET_RETURN_KEY_TYPE
1992 bool get_ise_return_key_type (int client_id, _OUT_ uint32& type) {
1993 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1996 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1997 ret = get_helper_return_key_type (m_current_helper_uuid, type);
2001 //ISM_TRANS_CMD_SET_RETURN_KEY_DISABLE
2002 void set_ise_return_key_disable (int client_id, uint32 disabled) {
2003 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
2004 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
2005 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
2006 iseContext->return_key_disabled = static_cast<Eina_Bool>(disabled);
2008 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2009 set_helper_return_key_disable (m_current_helper_uuid, disabled);
2011 //ISM_TRANS_CMD_GET_RETURN_KEY_DISABLE
2012 bool get_ise_return_key_disable (int client_id, _OUT_ uint32& disabled) {
2013 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
2016 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2017 ret = get_helper_return_key_disable (m_current_helper_uuid, disabled);
2022 void reset_helper_context (const String& uuid) {
2023 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
2025 if (it != m_helper_client_index.end ()) {
2029 get_focused_context (client, context);
2030 ctx = get_helper_ic (client, context);
2031 m_panel_agent_manager.reset_helper_context (it->second.id, ctx, uuid);
2037 void reset_ise_context (int client_id) {
2038 SCIM_DEBUG_MAIN (4) << "InfoManager::reset_ise_context ()\n";
2040 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2041 reset_helper_context (m_current_helper_uuid);
2043 //ISM_TRANS_CMD_SET_CAPS_MODE
2044 void set_ise_caps_mode (int client_id, uint32 mode) {
2045 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_caps_mode ()\n";
2046 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
2047 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
2048 iseContext->caps_mode = static_cast<Eina_Bool>(mode);
2050 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2051 set_helper_caps_mode (m_current_helper_uuid, mode);
2054 //SCIM_TRANS_CMD_RELOAD_CONFIG
2055 void reload_config (void) {
2056 SCIM_DEBUG_MAIN (1) << "InfoManager::reload_config ()\n";
2059 for (ClientRepository::iterator it = m_client_repository.begin (); it != m_client_repository.end (); ++it) {
2060 if (it->second.type == FRONTEND_CLIENT || it->second.type == HELPER_CLIENT) {
2061 m_panel_agent_manager.reload_config (it->first);
2069 SCIM_DEBUG_MAIN (1) << "InfoManager::exit ()\n";
2072 for (ClientRepository::iterator it = m_client_repository.begin (); it != m_client_repository.end (); ++it) {
2073 m_panel_agent_manager.exit (it->first, 0);
2081 void update_ise_list (std::vector<String>& strList) {
2082 /* request PanelClient to update keyboard ise list */
2083 update_keyboard_ise_list ();
2085 //ISM_TRANS_CMD_SEND_WILL_SHOW_ACK
2086 void will_show_ack (int client_id) {
2087 SCIM_DEBUG_MAIN (4) << "InfoManager::will_show_ack ()\n";
2088 m_signal_will_show_ack ();
2090 //ISM_TRANS_CMD_SEND_WILL_HIDE_ACK
2091 void will_hide_ack (int client_id) {
2092 SCIM_DEBUG_MAIN (4) << "InfoManager::will_hide_ack ()\n";
2093 m_signal_will_hide_ack ();
2095 //ISM_TRANS_CMD_RESET_DEFAULT_ISE
2096 void reset_default_ise (int client_id) {
2097 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
2098 String initial_ise = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
2100 if (initial_ise.length () > 0)
2101 m_signal_set_active_ise_by_uuid (initial_ise, 1);
2103 std::cerr << "Read SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID is failed!!!\n";
2105 //ISM_TRANS_CMD_SET_HARDWARE_KEYBOARD_MODE
2106 void set_keyboard_mode (int client_id, uint32 mode) {
2107 SCIM_DEBUG_MAIN (4) << "InfoManager::set_keyboard_mode ()\n";
2108 m_signal_set_keyboard_mode (mode);
2109 set_ise_keyboard_mode (client_id, mode);
2111 //ISM_TRANS_CMD_SEND_CANDIDATE_WILL_HIDE_ACK
2112 void candidate_will_hide_ack (int client_id) {
2113 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "\n";
2114 m_signal_candidate_will_hide_ack ();
2117 //ISM_TRANS_CMD_GET_ACTIVE_HELPER_OPTION
2118 void get_active_helper_option (int client_id, _OUT_ uint32& option) {
2119 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
2120 option = get_current_helper_option ();
2122 //ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW
2123 void show_ise_option_window (int client_id, int caller_pid) {
2124 SCIM_DEBUG_MAIN (4) << "InfoManager::show_ise_option_window ()\n";
2125 String initial_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
2126 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
2127 LOGD ("prepare to show ISE option window %d [%s] [%s]", client_id, initial_uuid.c_str (), default_uuid.c_str ());
2129 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode) {
2130 show_helper_option_window (m_current_helper_uuid, caller_pid);
2134 //ISM_TRANS_CMD_GET_ISE_SETTING_APPID
2135 void get_ise_setting_appid (int client_id, _OUT_ String &ime_setting_appid) {
2136 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
2137 m_signal_get_ise_setting_appid (m_current_helper_uuid, ime_setting_appid);
2140 //ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW
2141 void resume_ise_option_window (int client_id) {
2142 SCIM_DEBUG_MAIN (4) << "InfoManager::resume_ise_option_window ()\n";
2143 String initial_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
2144 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
2145 LOGD ("prepare to resume ISE option window %d [%s] [%s]", client_id, initial_uuid.c_str (), default_uuid.c_str ());
2147 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode) {
2148 resume_helper_option_window (m_current_helper_uuid);
2152 //ISM_TRANS_CMD_SET_KEYBOARD_MODE
2153 void set_ise_keyboard_mode (int client_id, uint32 mode) {
2154 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_keyboard_mode ()\n";
2155 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2156 set_helper_keyboard_mode (m_current_helper_uuid, mode);
2159 //ISM_TRANS_CMD_SET_PREDICTION_HINT
2160 void set_prediction_hint (int client_id, String prediction_hint) {
2161 SCIM_DEBUG_MAIN (4) << "InfoManager::set_prediction_hint ()\n";
2162 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2163 set_helper_prediction_hint (m_current_helper_uuid, prediction_hint);
2166 //ISM_TRANS_CMD_SET_MIME_TYPE
2167 void set_ise_mime_type (int client_id, String mime_type) {
2168 SCIM_DEBUG_MAIN (4) << "InfoManager::set_mime_type ()\n";
2169 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2170 set_helper_mime_type (m_current_helper_uuid, mime_type);
2173 //ISM_TRANS_CMD_FINALIZE_CONTENT
2174 void finalize_content (int client_id, String text, uint32 cursor_pos) {
2175 SCIM_DEBUG_MAIN (4) << "InfoManager::finalize_content ()\n";
2176 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2177 finalize_content_helper (m_current_helper_uuid, text, cursor_pos);
2180 //ISM_TRANS_CMD_SET_PREDICTION_HINT_DATA
2181 void set_prediction_hint_data (int client_id, String key, String value) {
2182 SCIM_DEBUG_MAIN (4) << "InfoManager::set_prediction_hint_data ()\n";
2183 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2184 set_helper_prediction_hint_data (m_current_helper_uuid, key, value);
2187 //ISM_TRANS_CMD_SET_OPTIMIZATION_HINT
2188 void set_optimization_hint(int client_id, uint32 hint) {
2189 SCIM_DEBUG_MAIN(4) << "InfoManager::set_optimization_hint ()\n";
2190 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2191 set_helper_optimization_hint(m_current_helper_uuid, hint);
2194 //ISM_TRANS_CMD_EXPAND_CANDIDATE
2195 void expand_candidate () {
2197 m_signal_expand_candidate ();
2200 //ISM_TRANS_CMD_CONTRACT_CANDIDATE
2201 void contract_candidate () {
2203 m_signal_contract_candidate ();
2205 //ISM_TRANS_CMD_GET_RECENT_ISE_GEOMETRY
2206 void get_recent_ise_geometry (int client_id, uint32 angle, _OUT_ struct rectinfo& info) {
2207 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
2209 m_signal_get_recent_ise_geometry (angle, info);
2212 bool check_privilege_by_sockfd (int client_id, const String& privilege) {
2213 return m_signal_check_privilege_by_sockfd (client_id, privilege);
2216 bool remoteinput_update_preedit_string (WideString str, AttributeList &attrs, uint32 caret)
2218 SCIM_DEBUG_MAIN(1) << "PanelAgent::update_preedit_string ()\n";
2224 get_focused_context (client, context);
2226 m_panel_agent_manager.remote_update_preedit_string (client, context, str, str, attrs, caret);
2234 bool remoteinput_commit_string (const WideString &str)
2236 SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_commit_string ()\n";
2242 get_focused_context (client, context);
2244 m_panel_agent_manager.remote_commit_string (client, context, str);
2252 bool remoteinput_send_key_event (const KeyEvent &key)
2254 SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_send_key_event ()\n";
2258 get_focused_context (client, context);
2260 m_panel_agent_manager.remote_send_key_event (client, context, key);
2266 bool remoteinput_forward_key_event (const KeyEvent &key)
2268 SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_forward_key_event ()\n";
2272 get_focused_context (client, context);
2274 m_panel_agent_manager.remote_forward_key_event (client, context, key);
2280 bool remoteinput_delete_surrounding_text (uint32 offset, uint32 len)
2282 SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_delete_surrounding_text ()\n";
2286 get_focused_context (client, context);
2288 m_panel_agent_manager.remote_delete_surrounding_text (client, context, offset, len);
2294 void reshow_input_panel () {
2295 /* Check whether application is already focus_in */
2296 if (m_refocus_needed) {
2297 LOGD ("Re-focus in");
2298 SCIM_DEBUG_MAIN (2) << "Application is already focus_in!\n";
2300 focus_in_helper (m_current_helper_uuid, m_current_socket_client, m_current_client_context);
2301 reset_keyboard_ise ();
2304 /* Check whether ISE panel is already shown */
2305 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode && m_ise_context_length > 0 && m_reshow_needed) {
2306 LOGD ("Re-show input_panel");
2307 SCIM_DEBUG_MAIN (2) << "Re-show ISE panel!\n";
2310 uint32 focused_context;
2312 get_focused_context (focused_client, focused_context);
2313 if (focused_client == -1 && m_active_client_id != -1) {
2314 focused_client = m_panel_client_map[m_active_client_id];
2315 focused_context = 0;
2318 m_panel_agent_manager.request_ise_reshow (focused_client, focused_context);
2319 m_panel_agent_manager.update_entry_metadata (focused_client, focused_context);
2320 uint32 ctx = get_helper_ic (focused_client, focused_context);
2321 bool ret = show_helper (m_current_helper_uuid, m_ise_context_buffer, m_ise_context_length, ctx);
2323 m_signal_show_ise ();
2325 if (m_imdata_buffer && m_imdata_length > 0 && m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2326 set_helper_imdata (m_current_helper_uuid, m_imdata_buffer, m_imdata_length);
2331 void request_ise_terminate () {
2332 if (m_client_context_uuids.size () == 0) {
2333 LOGD("Request to terminate IME");
2334 m_signal_stop_default_ise (true);
2338 Connection signal_connect_turn_on (InfoManagerSlotVoid* slot) {
2339 return m_signal_turn_on.connect (slot);
2342 Connection signal_connect_turn_off (InfoManagerSlotVoid* slot) {
2343 return m_signal_turn_off.connect (slot);
2346 Connection signal_connect_show_panel (InfoManagerSlotVoid* slot) {
2347 return m_signal_show_panel.connect (slot);
2350 Connection signal_connect_hide_panel (InfoManagerSlotVoid* slot) {
2351 return m_signal_hide_panel.connect (slot);
2354 Connection signal_connect_update_screen (InfoManagerSlotInt* slot) {
2355 return m_signal_update_screen.connect (slot);
2358 Connection signal_connect_update_spot_location (InfoManagerSlotIntIntInt* slot) {
2359 return m_signal_update_spot_location.connect (slot);
2362 Connection signal_connect_update_factory_info (InfoManagerSlotFactoryInfo* slot) {
2363 return m_signal_update_factory_info.connect (slot);
2366 Connection signal_connect_start_default_ise (InfoManagerSlotVoid* slot) {
2367 return m_signal_start_default_ise.connect (slot);
2370 Connection signal_connect_stop_default_ise (InfoManagerSlotBool* slot) {
2371 return m_signal_stop_default_ise.connect (slot);
2374 Connection signal_connect_set_candidate_ui (InfoManagerSlotIntInt* slot) {
2375 return m_signal_set_candidate_ui.connect (slot);
2378 Connection signal_connect_get_candidate_ui (InfoManagerSlotIntInt2* slot) {
2379 return m_signal_get_candidate_ui.connect (slot);
2382 Connection signal_connect_set_candidate_position (InfoManagerSlotIntInt* slot) {
2383 return m_signal_set_candidate_position.connect (slot);
2386 Connection signal_connect_get_candidate_geometry (InfoManagerSlotRect* slot) {
2387 return m_signal_get_candidate_geometry.connect (slot);
2390 Connection signal_connect_get_input_panel_geometry (InfoManagerSlotRect* slot) {
2391 return m_signal_get_input_panel_geometry.connect (slot);
2394 Connection signal_connect_set_keyboard_ise (InfoManagerSlotString* slot) {
2395 return m_signal_set_keyboard_ise.connect (slot);
2398 Connection signal_connect_get_keyboard_ise (InfoManagerSlotString2* slot) {
2399 return m_signal_get_keyboard_ise.connect (slot);
2402 Connection signal_connect_show_help (InfoManagerSlotString* slot) {
2403 return m_signal_show_help.connect (slot);
2406 Connection signal_connect_show_factory_menu (InfoManagerSlotFactoryInfoVector* slot) {
2407 return m_signal_show_factory_menu.connect (slot);
2410 Connection signal_connect_show_preedit_string (InfoManagerSlotVoid* slot) {
2411 return m_signal_show_preedit_string.connect (slot);
2414 Connection signal_connect_show_aux_string (InfoManagerSlotVoid* slot) {
2415 return m_signal_show_aux_string.connect (slot);
2418 Connection signal_connect_show_lookup_table (InfoManagerSlotVoid* slot) {
2419 return m_signal_show_lookup_table.connect (slot);
2422 Connection signal_connect_show_associate_table (InfoManagerSlotVoid* slot) {
2423 return m_signal_show_associate_table.connect (slot);
2426 Connection signal_connect_hide_preedit_string (InfoManagerSlotVoid* slot) {
2427 return m_signal_hide_preedit_string.connect (slot);
2430 Connection signal_connect_hide_aux_string (InfoManagerSlotVoid* slot) {
2431 return m_signal_hide_aux_string.connect (slot);
2434 Connection signal_connect_hide_lookup_table (InfoManagerSlotVoid* slot) {
2435 return m_signal_hide_lookup_table.connect (slot);
2438 Connection signal_connect_hide_associate_table (InfoManagerSlotVoid* slot) {
2439 return m_signal_hide_associate_table.connect (slot);
2442 Connection signal_connect_update_preedit_string (InfoManagerSlotAttributeStringInt* slot) {
2443 return m_signal_update_preedit_string.connect (slot);
2446 Connection signal_connect_update_preedit_caret (InfoManagerSlotInt* slot) {
2447 return m_signal_update_preedit_caret.connect (slot);
2450 Connection signal_connect_recapture_string (InfoManagerSlotAttributeInt2String2* slot) {
2451 return m_signal_recapture_string.connect (slot);
2454 Connection signal_connect_update_aux_string (InfoManagerSlotAttributeString* slot) {
2455 return m_signal_update_aux_string.connect (slot);
2458 Connection signal_connect_update_lookup_table (InfoManagerSlotLookupTable* slot) {
2459 return m_signal_update_lookup_table.connect (slot);
2462 Connection signal_connect_update_associate_table (InfoManagerSlotLookupTable* slot) {
2463 return m_signal_update_associate_table.connect (slot);
2466 Connection signal_connect_register_properties (InfoManagerSlotPropertyList* slot) {
2467 return m_signal_register_properties.connect (slot);
2470 Connection signal_connect_update_property (InfoManagerSlotProperty* slot) {
2471 return m_signal_update_property.connect (slot);
2474 Connection signal_connect_register_helper_properties (InfoManagerSlotIntPropertyList* slot) {
2475 return m_signal_register_helper_properties.connect (slot);
2478 Connection signal_connect_update_helper_property (InfoManagerSlotIntProperty* slot) {
2479 return m_signal_update_helper_property.connect (slot);
2482 Connection signal_connect_register_helper (InfoManagerSlotIntHelperInfo* slot) {
2483 return m_signal_register_helper.connect (slot);
2486 Connection signal_connect_remove_helper (InfoManagerSlotInt* slot) {
2487 return m_signal_remove_helper.connect (slot);
2490 Connection signal_connect_set_active_ise_by_uuid (InfoManagerSlotStringBool* slot) {
2491 return m_signal_set_active_ise_by_uuid.connect (slot);
2494 Connection signal_connect_focus_in (InfoManagerSlotVoid* slot) {
2495 return m_signal_focus_in.connect (slot);
2498 Connection signal_connect_focus_out (InfoManagerSlotVoid* slot) {
2499 return m_signal_focus_out.connect (slot);
2502 Connection signal_connect_expand_candidate (InfoManagerSlotVoid* slot) {
2503 return m_signal_expand_candidate.connect (slot);
2506 Connection signal_connect_contract_candidate (InfoManagerSlotVoid* slot) {
2507 return m_signal_contract_candidate.connect (slot);
2510 Connection signal_connect_select_candidate (InfoManagerSlotInt* slot) {
2511 return m_signal_select_candidate.connect (slot);
2514 Connection signal_connect_get_ise_list (InfoManagerSlotBoolStringVector* slot) {
2515 return m_signal_get_ise_list.connect (slot);
2518 Connection signal_connect_get_all_helper_ise_info (InfoManagerSlotBoolHelperInfo* slot) {
2519 return m_signal_get_all_helper_ise_info.connect (slot);
2522 Connection signal_connect_set_has_option_helper_ise_info (InfoManagerSlotStringBool* slot) {
2523 return m_signal_set_has_option_helper_ise_info.connect (slot);
2526 Connection signal_connect_set_enable_helper_ise_info (InfoManagerSlotStringBool* slot) {
2527 return m_signal_set_enable_helper_ise_info.connect (slot);
2530 Connection signal_connect_show_helper_ise_list (InfoManagerSlotVoid* slot) {
2531 return m_signal_show_helper_ise_list.connect (slot);
2534 Connection signal_connect_show_helper_ise_selector (InfoManagerSlotVoid* slot) {
2535 return m_signal_show_helper_ise_selector.connect (slot);
2538 Connection signal_connect_is_helper_ise_enabled (InfoManagerSlotStringInt* slot) {
2539 return m_signal_is_helper_ise_enabled.connect (slot);
2542 Connection signal_connect_get_ise_information (InfoManagerSlotBoolString4int2* slot) {
2543 return m_signal_get_ise_information.connect (slot);
2546 Connection signal_connect_get_keyboard_ise_list (InfoManagerSlotBoolStringVector* slot) {
2547 return m_signal_get_keyboard_ise_list.connect (slot);
2550 Connection signal_connect_update_ise_geometry (InfoManagerSlotIntIntIntInt* slot) {
2551 return m_signal_update_ise_geometry.connect (slot);
2554 Connection signal_connect_get_language_list (InfoManagerSlotStringVector* slot) {
2555 return m_signal_get_language_list.connect (slot);
2558 Connection signal_connect_get_all_language (InfoManagerSlotStringVector* slot) {
2559 return m_signal_get_all_language.connect (slot);
2562 Connection signal_connect_get_ise_language (InfoManagerSlotStrStringVector* slot) {
2563 return m_signal_get_ise_language.connect (slot);
2566 Connection signal_connect_get_ise_info_by_uuid (InfoManagerSlotStringISEINFO* slot) {
2567 return m_signal_get_ise_info_by_uuid.connect (slot);
2570 Connection signal_connect_send_key_event (InfoManagerSlotKeyEvent* slot) {
2571 return m_signal_send_key_event.connect (slot);
2574 Connection signal_connect_accept_connection (InfoManagerSlotInt* slot) {
2575 return m_signal_accept_connection.connect (slot);
2578 Connection signal_connect_close_connection (InfoManagerSlotInt* slot) {
2579 return m_signal_close_connection.connect (slot);
2582 Connection signal_connect_exit (InfoManagerSlotVoid* slot) {
2583 return m_signal_exit.connect (slot);
2586 Connection signal_connect_transaction_start (InfoManagerSlotVoid* slot) {
2587 return m_signal_transaction_start.connect (slot);
2590 Connection signal_connect_transaction_end (InfoManagerSlotVoid* slot) {
2591 return m_signal_transaction_end.connect (slot);
2594 Connection signal_connect_lock (InfoManagerSlotVoid* slot) {
2595 return m_signal_lock.connect (slot);
2598 Connection signal_connect_unlock (InfoManagerSlotVoid* slot) {
2599 return m_signal_unlock.connect (slot);
2602 Connection signal_connect_update_input_context (InfoManagerSlotIntInt* slot) {
2603 return m_signal_update_input_context.connect (slot);
2606 Connection signal_connect_update_language_locale(InfoManagerSlotString* slot) {
2607 return m_signal_update_language_locale.connect(slot);
2610 Connection signal_connect_show_ise (InfoManagerSlotVoid* slot) {
2611 return m_signal_show_ise.connect (slot);
2614 Connection signal_connect_hide_ise (InfoManagerSlotVoid* slot) {
2615 return m_signal_hide_ise.connect (slot);
2618 Connection signal_connect_will_show_ack (InfoManagerSlotVoid* slot) {
2619 return m_signal_will_show_ack.connect (slot);
2622 Connection signal_connect_will_hide_ack (InfoManagerSlotVoid* slot) {
2623 return m_signal_will_hide_ack.connect (slot);
2626 Connection signal_connect_set_keyboard_mode (InfoManagerSlotInt* slot) {
2627 return m_signal_set_keyboard_mode.connect (slot);
2630 Connection signal_connect_candidate_will_hide_ack (InfoManagerSlotVoid* slot) {
2631 return m_signal_candidate_will_hide_ack.connect (slot);
2634 Connection signal_connect_get_ise_state (InfoManagerSlotInt2* slot) {
2635 return m_signal_get_ise_state.connect (slot);
2638 Connection signal_connect_run_helper (InfoManagerSlotString3* slot)
2640 return m_signal_run_helper.connect (slot);
2643 Connection signal_connect_launch_option_application (InfoManagerSlotBoolString* slot)
2645 return m_signal_launch_option_application.connect (slot);
2648 Connection signal_connect_get_ise_setting_appid (InfoManagerSlotBoolString2* slot)
2650 return m_signal_get_ise_setting_appid.connect (slot);
2653 Connection signal_connect_get_recent_ise_geometry (InfoManagerSlotIntRect* slot) {
2654 return m_signal_get_recent_ise_geometry.connect (slot);
2657 Connection signal_connect_check_privilege_by_sockfd (InfoManagerSlotIntString2* slot)
2659 return m_signal_check_privilege_by_sockfd.connect (slot);
2662 Connection signal_connect_remoteinput_send_input_message (InfoManagerSlotStringBool* slot)
2664 return m_signal_remoteinput_send_input_message.connect (slot);
2667 Connection signal_connect_remoteinput_send_surrounding_text (InfoManagerSlotIntString* slot)
2669 return m_signal_remoteinput_send_surrounding_text.connect (slot);
2672 //ISM_TRANS_CMD_REGISTER_PANEL_CLIENT
2673 void register_panel_client (uint32 client_id, uint32 id) {
2674 m_panel_client_map [client_id] = (int)id;
2676 //SCIM_TRANS_CMD_PANEL_REGISTER_INPUT_CONTEXT
2677 void register_input_context (uint32 client_id, uint32 context, String uuid) {
2678 uint32 ctx = get_helper_ic (m_panel_client_map[client_id], context);
2679 m_client_context_uuids [ctx] = uuid;
2681 //SCIM_TRANS_CMD_PANEL_REMOVE_INPUT_CONTEXT
2682 void remove_input_context (uint32 client_id, uint32 context) {
2683 uint32 ctx = get_helper_ic (m_panel_client_map[client_id], context);
2684 m_client_context_uuids.erase (ctx);
2686 if (ctx == get_helper_ic (m_current_socket_client, m_current_client_context)) {
2688 m_current_socket_client = m_last_socket_client;
2689 m_current_client_context = m_last_client_context;
2690 m_current_context_uuid = m_last_context_uuid;
2691 m_last_socket_client = -1;
2692 m_last_client_context = 0;
2693 m_last_context_uuid = String ("");
2695 if (m_current_socket_client == -1) {
2697 socket_update_control_panel ();
2701 } else if (ctx == get_helper_ic (m_last_socket_client, m_last_client_context)) {
2703 m_last_socket_client = -1;
2704 m_last_client_context = 0;
2705 m_last_context_uuid = String ("");
2710 //SCIM_TRANS_CMD_PANEL_RESET_INPUT_CONTEXT
2711 void socket_reset_input_context (int client_id, uint32 context) {
2712 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_reset_input_context \n";
2714 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2715 socket_reset_helper_input_context (m_current_helper_uuid, m_panel_client_map[client_id], context);
2718 //SCIM_TRANS_CMD_FOCUS_IN
2719 void focus_in (int client_id, uint32 context, String uuid) {
2720 m_refocus_needed = true;
2721 bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false);
2722 if (launch_ise_on_request)
2723 m_signal_start_default_ise ();
2725 m_signal_focus_in ();
2726 focus_in_helper (m_current_helper_uuid, m_panel_client_map[client_id], context);
2727 SCIM_DEBUG_MAIN (2) << "PanelAgent::focus_in (" << client_id << "," << context << "," << uuid << ")\n";
2728 m_active_client_id = client_id;
2731 if (m_current_socket_client >= 0) {
2732 m_last_socket_client = m_current_socket_client;
2733 m_last_client_context = m_current_client_context;
2734 m_last_context_uuid = m_current_context_uuid;
2737 m_current_socket_client = m_panel_client_map[client_id];
2738 m_current_client_context = context;
2739 m_current_context_uuid = uuid;
2743 //SCIM_TRANS_CMD_FOCUS_OUT
2744 void focus_out (int client_id, uint32 context) {
2745 m_refocus_needed = false;
2746 m_signal_focus_out ();
2748 focus_out_helper (m_current_helper_uuid, m_panel_client_map[client_id], context);
2750 if (m_current_socket_client >= 0) {
2751 m_last_socket_client = m_current_socket_client;
2752 m_last_client_context = m_current_client_context;
2753 m_last_context_uuid = m_current_context_uuid;
2756 m_current_socket_client = -1;
2757 m_current_client_context = 0;
2758 m_current_context_uuid = String ("");
2762 //ISM_TRANS_CMD_TURN_ON_LOG
2763 void socket_turn_on_log (uint32 isOn) {
2765 DebugOutput::enable_debug (SCIM_DEBUG_AllMask);
2766 DebugOutput::set_verbose_level (7);
2767 SCIM_DEBUG_MAIN (4) << __func__ << " on\n";
2769 SCIM_DEBUG_MAIN (4) << __func__ << " off\n";
2770 DebugOutput::disable_debug (SCIM_DEBUG_AllMask);
2771 DebugOutput::set_verbose_level (0);
2775 uint32 focused_context;
2776 get_focused_context (focused_client, focused_context);
2778 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
2779 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
2781 if (it != m_helper_client_index.end ()) {
2782 //uint32 ctx = get_helper_ic (focused_client, focused_context);
2784 //m_panel_agent_manager.socket_turn_on_log (it->second.id, ctx, m_current_helper_uuid, isOn);
2788 if (focused_client == -1) {
2789 std::cerr << __func__ << " get_focused_context is failed!!!\n";
2793 ClientInfo client_info = socket_get_client_info (focused_client);
2795 if (client_info.type == FRONTEND_CLIENT) {
2797 //m_panel_agent_manager.socket_turn_on_log (focused_client, focused_context, isOn);
2802 void add_client (int client_id, uint32 key, ClientType type) {
2803 LOGD ("id:%d, key:%d, type:%d", client_id, key, type);
2807 SCIM_DEBUG_MAIN (4) << "Add client to repository. Type=" << type << " key=" << key << "\n";
2809 m_client_repository [client_id] = info;
2811 if (info.type == HELPER_CLIENT || info.type == HELPER_ACT_CLIENT)
2812 m_is_ise_alive = true;
2814 if (info.type == IMCONTROL_ACT_CLIENT) {
2815 m_pending_active_imcontrol_id = client_id;
2816 } else if (info.type == IMCONTROL_CLIENT) {
2817 m_imcontrol_map [m_pending_active_imcontrol_id] = client_id;
2818 m_pending_active_imcontrol_id = -1;
2819 } else if (info.type == REMOTEINPUT_ACT_CLIENT) {
2820 m_current_send_remoteinput_id.push_back (client_id);
2821 } else if (info.type == REMOTEINPUT_CLIENT) {
2822 m_current_recv_remoteinput_id.push_back (client_id);
2825 LOGD ("%zu clients connecting", m_client_repository.size());
2830 void del_client (int client_id) {
2831 ClientRepository::iterator iter = m_client_repository.find(client_id);
2832 if (iter == m_client_repository.end()) {
2833 LOGW("The client with id %d does not exist in our client repository, returning", client_id);
2837 m_signal_close_connection (client_id);
2838 ClientInfo client_info = socket_get_client_info (client_id);
2839 m_client_repository.erase (client_id);
2840 LOGD ("id:%d, type:%d", client_id, client_info.type);
2841 #ifdef PANEL_SERVER_AUTO_EXIT
2842 /* Exit panel if there is no connected client anymore. */
2843 if (client_info.type != UNKNOWN_CLIENT && m_client_repository.size () == 0 && !m_should_resident) {
2844 SCIM_DEBUG_MAIN (4) << "Exit Socket Server Thread.\n";
2845 server->shutdown ();
2846 m_signal_exit.emit ();
2851 if (client_info.type == FRONTEND_CLIENT) {
2852 SCIM_DEBUG_MAIN (4) << "It's a FrontEnd client.\n";
2854 /* The focused client is closed. */
2855 if (m_current_socket_client == client_id) {
2856 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2857 hide_helper (m_current_helper_uuid);
2860 m_current_socket_client = -1;
2861 m_current_client_context = 0;
2862 m_current_context_uuid = String ("");
2864 socket_transaction_start ();
2866 socket_transaction_end ();
2869 if (m_last_socket_client == client_id) {
2871 m_last_socket_client = -1;
2872 m_last_client_context = 0;
2873 m_last_context_uuid = String ("");
2877 /* Erase all associated Client Context UUIDs. */
2878 std::vector <uint32> ctx_list;
2879 ClientContextUUIDRepository::iterator it = m_client_context_uuids.begin ();
2881 for (; it != m_client_context_uuids.end (); ++it) {
2882 if ((it->first & 0xFFFF) == (client_id & 0xFFFF))
2883 ctx_list.push_back (it->first);
2886 for (size_t i = 0; i < ctx_list.size (); ++i)
2887 m_client_context_uuids.erase (ctx_list [i]);
2889 /* Erase all helperise info associated with the client */
2891 it = m_client_context_helper.begin ();
2893 for (; it != m_client_context_helper.end (); ++it) {
2894 if ((it->first & 0xFFFF) == (client_id & 0xFFFF)) {
2895 ctx_list.push_back (it->first);
2896 /* similar to stop_helper except that it will not call get_focused_context() */
2897 String uuid = it->second;
2899 if (m_helper_uuid_count.find (uuid) != m_helper_uuid_count.end ()) {
2900 uint32 count = m_helper_uuid_count[uuid];
2903 m_helper_uuid_count.erase (uuid);
2904 HelperClientIndex::iterator pise = m_helper_client_index.find (uuid);
2906 if (pise != m_helper_client_index.end ()) {
2907 stop_helper (uuid, pise->second.id, it->first);
2910 SCIM_DEBUG_MAIN (1) << "Stop HelperISE " << uuid << " ...\n";
2912 m_helper_uuid_count[uuid] = count - 1;
2913 focus_out_helper (uuid, (it->first & 0xFFFF), ((it->first >> 16) & 0x7FFF));
2914 SCIM_DEBUG_MAIN (1) << "Decrement usage count of HelperISE " << uuid
2915 << " to " << m_helper_uuid_count[uuid] << "\n";
2921 for (size_t i = 0; i < ctx_list.size (); ++i)
2922 m_client_context_helper.erase (ctx_list [i]);
2924 HelperInfoRepository::iterator iter = m_helper_info_repository.begin ();
2926 for (; iter != m_helper_info_repository.end (); iter++) {
2927 if (!m_current_helper_uuid.compare (iter->second.uuid))
2928 if (! (iter->second.option & ISM_ISE_HIDE_IN_CONTROL_PANEL))
2929 socket_update_control_panel ();
2931 } else if (client_info.type == FRONTEND_ACT_CLIENT) {
2932 SCIM_DEBUG_MAIN (4) << "It's a FRONTEND_ACT_CLIENT client.\n";
2933 IntIntRepository::iterator iter2 = m_panel_client_map.find (client_id);
2935 if (iter2 != m_panel_client_map.end ())
2936 m_panel_client_map.erase (iter2);
2937 } else if (client_info.type == HELPER_CLIENT) {
2938 SCIM_DEBUG_MAIN (4) << "It's a Helper client.\n";
2940 HelperInfoRepository::iterator hiit = m_helper_info_repository.find (client_id);
2942 bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false);
2943 if (hiit != m_helper_info_repository.end ()) {
2944 bool restart = false;
2945 String uuid = hiit->second.uuid;
2946 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
2948 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
2949 if ((hiit->second.option & SCIM_HELPER_AUTO_RESTART) &&
2950 (default_uuid.compare (uuid) == 0 || default_uuid.compare ("") == 0) &&
2951 (it != m_helper_client_index.end () && it->second.ref > 0)) {
2955 m_helper_client_index.erase (uuid);
2956 m_helper_info_repository.erase (hiit);
2958 m_signal_stop_default_ise (false);
2960 if (m_refocus_needed || m_reshow_needed || !launch_ise_on_request)
2961 m_restart_needed = true;
2963 if (restart && !m_ise_exiting && m_restart_needed) {
2964 struct tms tiks_buf;
2965 static clock_t start_tiks = times (&tiks_buf);
2966 static double clock_tiks = (double)sysconf (_SC_CLK_TCK);
2967 clock_t curr_tiks = times (&tiks_buf);
2968 double secs = (double) (curr_tiks - start_tiks) / clock_tiks;
2969 //LOGE ("time second:%f", secs);
2970 static String restart_uuid;
2972 if (restart_uuid != uuid || secs > MIN_REPEAT_TIME) {
2973 scim_usleep (100000);
2977 get_focused_context(client, context);
2979 uint32 ic = get_helper_ic (client, context);
2981 /* Get the context uuid from the client context registration table. */
2983 ClientContextUUIDRepository::iterator it =
2984 m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client], context));
2986 if (it != m_client_context_uuids.end ())
2987 ic_uuid = it->second;
2990 m_start_helper_ic_index[uuid].push_back(std::make_pair(ic, ic_uuid));
2991 m_signal_run_helper (uuid, m_config_name, m_display_name);
2992 restart_uuid = uuid;
2993 LOGE ("Auto restart soft ISE:%s", uuid.c_str ());
2995 reset_default_ise (0);
2996 ISF_SAVE_LOG ("Auto restart is abnormal, reset default ISE");
2999 start_tiks = curr_tiks;
3003 m_ise_exiting = false;
3004 m_restart_needed = launch_ise_on_request ? false : true;
3006 socket_transaction_start ();
3007 m_signal_remove_helper (client_id);
3008 socket_transaction_end ();
3009 } else if (client_info.type == HELPER_ACT_CLIENT) {
3010 SCIM_DEBUG_MAIN (4) << "It's a Helper passive client.\n";
3012 HelperInfoRepository::iterator hiit = m_helper_active_info_repository.find (client_id);
3014 if (hiit != m_helper_active_info_repository.end ()) {
3015 if (hiit->second.uuid == m_current_helper_uuid)
3016 m_is_ise_alive = false;
3018 m_helper_active_info_repository.erase (hiit);
3022 } else if (client_info.type == IMCONTROL_ACT_CLIENT) {
3023 SCIM_DEBUG_MAIN (4) << "It's a IMCONTROL_ACT_CLIENT client.\n";
3024 IMControlRepository::iterator iter = m_imcontrol_repository.find (client_id);
3026 if (iter != m_imcontrol_repository.end ()) {
3027 int size = iter->second.info.size ();
3031 stop_helper ((iter->second.info)[i].uuid, (iter->second.count)[i], DEFAULT_CONTEXT_VALUE);
3033 if ((iter->second.info)[i].option & ISM_ISE_HIDE_IN_CONTROL_PANEL)
3034 m_current_helper_uuid = m_last_helper_uuid;
3039 m_imcontrol_repository.erase (iter);
3042 IntIntRepository::iterator iter2 = m_imcontrol_map.find (client_id);
3044 if (iter2 != m_imcontrol_map.end ())
3045 m_imcontrol_map.erase (iter2);
3046 } else if (client_info.type == REMOTEINPUT_ACT_CLIENT) {
3047 SCIM_DEBUG_MAIN (4) << "It's a REMOTEINPUT_ACT_CLIENT client.\n";
3049 for (unsigned int i = 0; i < m_current_send_remoteinput_id.size (); i++) {
3050 if (m_current_send_remoteinput_id.at (i) == client_id) {
3051 m_current_send_remoteinput_id.erase (m_current_send_remoteinput_id.begin () + i);
3055 } else if (client_info.type == REMOTEINPUT_CLIENT) {
3056 SCIM_DEBUG_MAIN (4) << "It's a REMOTEINPUT_CLIENT client.\n";
3058 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3059 if (m_current_recv_remoteinput_id.at (i) == client_id) {
3060 m_current_recv_remoteinput_id.erase (m_current_recv_remoteinput_id.begin () + i);
3064 } else if (client_info.type == CONFIG_CLIENT) {
3065 SCIM_DEBUG_MAIN(4) << "It's a CONFIG_CLIENT client.\n";
3067 LOGI ("clients: %zu, panel clients: %zu, imcontrols size: %zu, helper infos: %zu, \
3068 helper active infos: %zu, helper client indexes: %zu, ises pending: %zu, \
3069 imcontrols: %zu, start helper ic indexes: %zu, client context uuids: %zu, \
3070 client context helpers: %zu, helpers uuid count: %zu",
3071 m_client_repository.size(),
3072 m_panel_client_map.size(),
3073 m_imcontrol_map.size(),
3074 m_helper_info_repository.size(),
3075 m_helper_active_info_repository.size(),
3076 m_helper_client_index.size(),
3077 m_ise_pending_repository.size(),
3078 m_imcontrol_repository.size(),
3079 m_start_helper_ic_index.size(),
3080 m_client_context_uuids.size(),
3081 m_client_context_helper.size(),
3082 m_helper_uuid_count.size());
3085 const ClientInfo& socket_get_client_info (int client) {
3086 static ClientInfo null_client = { 0, UNKNOWN_CLIENT };
3087 ClientRepository::iterator it = m_client_repository.find (client);
3089 if (it != m_client_repository.end ())
3095 //SCIM_TRANS_CMD_PANEL_TURN_ON
3096 void socket_turn_on (void) {
3097 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_turn_on ()\n";
3098 m_signal_turn_on ();
3100 //SCIM_TRANS_CMD_PANEL_TURN_OFF
3101 void socket_turn_off (void) {
3102 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_turn_off ()\n";
3103 m_signal_turn_off ();
3105 //SCIM_TRANS_CMD_UPDATE_SCREEN
3106 void socket_update_screen (int client_id, uint32 num) {
3107 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_screen ()\n";
3109 if (((int) num) != m_current_screen) {
3110 SCIM_DEBUG_MAIN (4) << "New Screen number = " << num << "\n";
3111 m_signal_update_screen ((int) num);
3112 helper_all_update_screen ((int) num);
3113 m_current_screen = (num);
3116 //SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
3117 void socket_update_spot_location (uint32 x, uint32 y, uint32 top_y) {
3118 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_spot_location ()\n";
3119 SCIM_DEBUG_MAIN (4) << "New Spot location x=" << x << " y=" << y << "\n";
3120 m_signal_update_spot_location ((int)x, (int)y, (int)top_y);
3121 helper_all_update_spot_location ((int)x, (int)y);
3123 //ISM_TRANS_CMD_UPDATE_CURSOR_POSITION
3124 void socket_update_cursor_position (uint32 cursor_pos) {
3125 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_cursor_position ()\n";
3126 SCIM_DEBUG_MAIN (4) << "New cursor position pos=" << cursor_pos << "\n";
3127 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
3128 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
3129 iseContext->cursor_pos = static_cast<int>(cursor_pos);
3131 helper_all_update_cursor_position ((int)cursor_pos);
3133 //ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT
3134 void socket_update_surrounding_text (String text, uint32 cursor) {
3135 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3136 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3138 if (it != m_helper_client_index.end ()) {
3143 get_focused_context (client, context);
3144 ctx = get_helper_ic (client, context);
3145 m_panel_agent_manager.socket_update_surrounding_text (it->second.id, ctx, m_current_helper_uuid, text, cursor);
3150 void remoteinput_callback_focus_in () {
3151 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3153 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3155 m_panel_agent_manager.socket_remoteinput_focus_in (m_current_recv_remoteinput_id.at (i));
3160 void remoteinput_callback_focus_out () {
3161 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3163 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3165 m_panel_agent_manager.socket_remoteinput_focus_out (m_current_recv_remoteinput_id.at (i));
3170 void remoteinput_callback_entry_metadata (uint32 hint, uint32 layout, int variation, uint32 autocapital_type, int return_key_disabled, uint32 return_key_type) {
3171 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3172 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
3173 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
3174 iseContext->layout = static_cast<Ecore_IMF_Input_Panel_Layout>(layout);
3175 iseContext->return_key_type = static_cast<Ecore_IMF_Input_Panel_Return_Key_Type>(return_key_type);
3176 iseContext->return_key_disabled = static_cast<Eina_Bool>(return_key_disabled);
3177 iseContext->layout_variation = static_cast<int>(variation);
3178 iseContext->autocapital_type = static_cast<Ecore_IMF_Autocapital_Type>(autocapital_type);
3179 iseContext->input_hint = static_cast<Ecore_IMF_Input_Hints>(hint);
3181 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3183 m_panel_agent_manager.socket_remoteinput_entry_metadata (m_current_recv_remoteinput_id.at (i), hint, layout, variation, autocapital_type, return_key_disabled, return_key_type);
3188 void remoteinput_callback_surrounding_text (String text, uint32 cursor) {
3189 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3191 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3193 m_panel_agent_manager.socket_remoteinput_surrounding_text (m_current_recv_remoteinput_id.at (i), text, cursor);
3198 void remoteinput_callback_input_resource (uint32 input_resource) {
3199 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3201 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3203 m_panel_agent_manager.socket_remoteinput_input_resource (m_current_recv_remoteinput_id.at (i), input_resource);
3208 //ISM_TRANS_CMD_UPDATE_SELECTION
3209 void socket_update_selection (String text) {
3210 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3211 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3213 if (it != m_helper_client_index.end ()) {
3218 get_focused_context (client, context);
3219 ctx = get_helper_ic (client, context);
3220 m_panel_agent_manager.socket_update_selection (it->second.id, ctx, m_current_helper_uuid, text);
3224 //SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO
3225 void socket_update_factory_info (PanelFactoryInfo& info) {
3226 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_factory_info ()\n";
3227 SCIM_DEBUG_MAIN (4) << "New Factory info uuid=" << info.uuid << " name=" << info.name << "\n";
3228 info.lang = scim_get_normalized_language (info.lang);
3229 m_signal_update_factory_info (info);
3231 //SCIM_TRANS_CMD_PANEL_SHOW_HELP
3232 void socket_show_help (String help) {
3233 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_help ()\n";
3234 m_signal_show_help (help);
3236 //SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU
3237 void socket_show_factory_menu (std::vector <PanelFactoryInfo>& vec) {
3238 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_factory_menu ()\n";
3241 m_signal_show_factory_menu (vec);
3244 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
3245 void socket_show_preedit_string (void) {
3246 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_preedit_string ()\n";
3247 m_signal_show_preedit_string ();
3249 //SCIM_TRANS_CMD_SHOW_AUX_STRING
3250 void socket_show_aux_string (void) {
3251 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_aux_string ()\n";
3252 m_signal_show_aux_string ();
3254 //SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE
3255 void socket_show_lookup_table (void) {
3256 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_lookup_table ()\n";
3257 m_signal_show_lookup_table ();
3259 //ISM_TRANS_CMD_SHOW_ASSOCIATE_TABLE
3260 void socket_show_associate_table (void) {
3261 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_associate_table ()\n";
3262 m_signal_show_associate_table ();
3264 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
3265 void socket_hide_preedit_string (void) {
3266 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_preedit_string ()\n";
3267 m_signal_hide_preedit_string ();
3269 //SCIM_TRANS_CMD_HIDE_AUX_STRING
3270 void socket_hide_aux_string (void) {
3271 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_aux_string ()\n";
3272 m_signal_hide_aux_string ();
3274 //SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE
3275 void socket_hide_lookup_table (void) {
3276 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_lookup_table ()\n";
3277 m_signal_hide_lookup_table ();
3279 //ISM_TRANS_CMD_HIDE_ASSOCIATE_TABLE
3280 void socket_hide_associate_table (void) {
3281 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_associate_table ()\n";
3282 m_signal_hide_associate_table ();
3284 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
3285 void socket_update_preedit_string (String& str, const AttributeList& attrs, uint32 caret) {
3286 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_string ()\n";
3287 m_signal_update_preedit_string (str, attrs, (int) caret);
3289 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
3290 void socket_update_preedit_caret (uint32 caret) {
3291 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_caret ()\n";
3292 m_signal_update_preedit_caret ((int) caret);
3294 //ISM_TRANS_CMD_RECAPTURE_STRING
3295 void socket_recapture_string (int offset, int len, String& preedit, String& commit, const AttributeList& attrs) {
3296 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_caret ()\n";
3297 m_signal_recapture_string (offset, len, preedit, commit, attrs);
3299 //SCIM_TRANS_CMD_UPDATE_AUX_STRING
3300 void socket_update_aux_string (String& str, const AttributeList& attrs) {
3301 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_aux_string ()\n";
3302 m_signal_update_aux_string (str, attrs);
3303 m_is_imengine_aux = true;
3305 //SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE
3306 void socket_update_lookup_table (const LookupTable& table) {
3307 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_lookup_table ()\n";
3309 //g_isf_candidate_table = _isf_candidate_table;
3310 m_signal_update_lookup_table (table);
3311 m_is_imengine_candidate = true;
3313 //ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE
3314 void socket_update_associate_table (const LookupTable& table) {
3315 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_associate_table ()\n";
3316 m_signal_update_associate_table (table);
3319 void socket_update_control_panel (void) {
3320 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_control_panel ()\n";
3322 m_signal_get_keyboard_ise (name, uuid);
3323 PanelFactoryInfo info;
3325 if (name.length () > 0)
3326 info = PanelFactoryInfo (uuid, name, String (""), String (""));
3328 info = PanelFactoryInfo (String (""), String (_ ("English Keyboard")), String ("C"), String (SCIM_KEYBOARD_ICON_FILE));
3330 m_signal_update_factory_info (info);
3332 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
3333 void socket_register_properties (const PropertyList& properties) {
3334 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_register_properties ()\n";
3335 m_signal_register_properties (properties);
3337 //SCIM_TRANS_CMD_UPDATE_PROPERTY
3338 void socket_update_property (const Property& property) {
3339 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_property ()\n";
3340 m_signal_update_property (property);
3342 //ISM_TRANS_CMD_GET_KEYBOARD_ISE_LIST
3343 void socket_get_keyboard_ise_list (String& uuid) {
3344 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_keyboard_ise_list ()\n";
3345 std::vector<String> list;
3347 m_signal_get_keyboard_ise_list (list);
3348 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3350 if (it != m_helper_client_index.end ()) {
3353 get_focused_context (client, context);
3354 uint32 ctx = get_helper_ic (client, context);
3355 m_panel_agent_manager.socket_get_keyboard_ise_list (it->second.id, ctx, uuid, list);
3358 //ISM_TRANS_CMD_SET_CANDIDATE_UI
3359 void socket_set_candidate_ui (uint32 portrait_line, uint32 mode) {
3360 SCIM_DEBUG_MAIN (4) << __func__ << " \n";
3361 m_signal_set_candidate_ui (portrait_line, mode);
3363 //ISM_TRANS_CMD_GET_CANDIDATE_UI
3364 void socket_get_candidate_ui (String uuid) {
3365 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_candidate_ui ()\n";
3366 int style = 0, mode = 0;
3367 m_signal_get_candidate_ui (style, mode);
3368 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3370 if (it != m_helper_client_index.end ()) {
3373 get_focused_context (client, context);
3374 uint32 ctx = get_helper_ic (client, context);
3375 m_panel_agent_manager.socket_get_candidate_ui (it->second.id, ctx, uuid, style, mode);
3378 //ISM_TRANS_CMD_SET_CANDIDATE_POSITION
3379 void socket_set_candidate_position (uint32 left, uint32 top) {
3380 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_candidate_position ()\n";
3381 m_signal_set_candidate_position (left, top);
3383 //ISM_TRANS_CMD_HIDE_CANDIDATE
3384 void socket_hide_candidate (void) {
3385 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_candidate ()\n";
3386 m_signal_hide_preedit_string ();
3387 m_signal_hide_aux_string ();
3388 m_signal_hide_lookup_table ();
3389 m_signal_hide_associate_table ();
3391 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
3392 void socket_get_candidate_geometry (String& uuid) {
3393 SCIM_DEBUG_MAIN (4) << __func__ << " \n";
3394 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3396 if (it != m_helper_client_index.end ()) {
3397 struct rectinfo info = {0, 0, 0, 0};
3398 m_signal_get_candidate_geometry (info);
3401 get_focused_context (client, context);
3402 uint32 ctx = get_helper_ic (client, context);
3403 m_panel_agent_manager.socket_get_candidate_geometry (it->second.id, ctx, uuid, info);
3406 //ISM_TRANS_CMD_SET_KEYBOARD_ISE_BY_UUID
3407 void socket_set_keyboard_ise (String uuid) {
3408 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_keyboard_ise ()\n";
3410 m_signal_set_keyboard_ise (uuid);
3412 //ISM_TRANS_CMD_SELECT_CANDIDATE
3413 void socket_helper_select_candidate (uint32 index) {
3414 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_keyboard_ise ()\n";
3416 m_signal_select_candidate (index);
3418 //ISM_TRANS_CMD_UPDATE_ISE_GEOMETRY
3419 void socket_helper_update_ise_geometry (int client, uint32 x, uint32 y, uint32 width, uint32 height) {
3420 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3423 uint32 focused_context;
3424 HelperInfoRepository::iterator it = m_helper_active_info_repository.find (client);
3426 if (it != m_helper_active_info_repository.end ()) {
3427 if (it->second.uuid == m_current_helper_uuid) {
3428 m_signal_update_ise_geometry (x, y, width, height);
3430 get_focused_context (focused_client, focused_context);
3431 ClientInfo client_info = socket_get_client_info (focused_client);
3432 if (client_info.type == FRONTEND_CLIENT) {
3433 m_panel_agent_manager.update_ise_geometry (focused_client, focused_context, x, y, width, height);
3438 //ISM_TRANS_CMD_GET_KEYBOARD_ISE
3439 void socket_get_keyboard_ise (String uuid) {
3440 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_keyboard_ise ()\n";
3441 String ise_name, ise_uuid;
3445 get_focused_context (client, context);
3446 ctx = get_helper_ic (client, context);
3448 if (m_client_context_uuids.find (ctx) != m_client_context_uuids.end ())
3449 ise_uuid = m_client_context_uuids[ctx];
3451 m_signal_get_keyboard_ise (ise_name, ise_uuid);
3452 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3454 if (it != m_helper_client_index.end ()) {
3455 get_focused_context (client, context);
3456 ctx = get_helper_ic (client, context);
3457 m_panel_agent_manager.socket_get_keyboard_ise (it->second.id, ctx, uuid, ise_name, ise_uuid);
3461 //SCIM_TRANS_CMD_START_HELPER
3462 void socket_start_helper (int client_id, uint32 context, String uuid) {
3463 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_start_helper ()\n";
3464 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3466 uint32 ic = get_helper_ic (m_panel_client_map[client_id], context);
3468 /* Get the context uuid from the client context registration table. */
3470 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3472 if (it != m_client_context_uuids.end ())
3473 ic_uuid = it->second;
3476 if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3477 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3478 } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3479 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3482 if (it == m_helper_client_index.end ()) {
3483 SCIM_DEBUG_MAIN (5) << "Run this Helper.\n";
3484 m_start_helper_ic_index [uuid].push_back (std::make_pair (ic, ic_uuid));
3485 m_signal_run_helper (uuid, m_config_name, m_display_name);
3487 SCIM_DEBUG_MAIN (5) << "Increase the Reference count.\n";
3488 m_panel_agent_manager.socket_start_helper (it->second.id, ic, ic_uuid);
3494 //SCIM_TRANS_CMD_STOP_HELPER
3495 void socket_stop_helper (int client_id, uint32 context, String uuid) {
3496 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_stop_helper ()\n";
3497 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3499 uint32 ic = get_helper_ic (m_panel_client_map[client_id], context);
3501 if (it != m_helper_client_index.end ()) {
3502 SCIM_DEBUG_MAIN (5) << "Decrease the Reference count.\n";
3505 /* Get the context uuid from the client context registration table. */
3507 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3509 if (it != m_client_context_uuids.end ())
3510 ic_uuid = it->second;
3513 if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3514 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3515 } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3516 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3519 m_panel_agent_manager.helper_detach_input_context (it->second.id, ic, ic_uuid);
3521 if (it->second.ref <= 0)
3522 m_panel_agent_manager.exit (it->second.id, ic);
3527 //SCIM_TRANS_CMD_SEND_HELPER_EVENT
3528 void socket_send_helper_event (int client_id, uint32 context, String uuid, const Transaction& _nest_trans) {
3529 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_send_helper_event ()\n";
3530 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3532 if (it != m_helper_client_index.end ()) {
3534 /* Get the context uuid from the client context registration table. */
3536 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3538 if (it != m_client_context_uuids.end ())
3539 ic_uuid = it->second;
3542 if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3543 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3544 } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3545 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3548 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);
3552 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
3553 void socket_helper_register_properties (int client, PropertyList& properties) {
3554 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_properties (" << client << ")\n";
3555 m_signal_register_helper_properties (client, properties);
3557 #if 0 //why? remove if useless, infinite loop
3558 /* Check whether application is already focus_in */
3559 if (m_current_socket_client != -1) {
3560 SCIM_DEBUG_MAIN (2) << "Application is already focus_in!\n";
3561 focus_in_helper (m_current_helper_uuid, m_current_socket_client, m_current_client_context);
3562 reset_keyboard_ise ();
3565 /* Check whether ISE panel is already shown */
3566 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode && m_ise_context_length > 0) {
3567 SCIM_DEBUG_MAIN (2) << "Re-show ISE panel!\n";
3569 uint32 focused_context;
3570 get_focused_context (focused_client, focused_context);
3572 if (focused_client == -1 && m_active_client_id != -1) {
3573 focused_client = m_panel_client_map[m_active_client_id];
3574 focused_context = 0;
3577 uint32 ctx = get_helper_ic (focused_client, focused_context);
3578 bool ret = show_helper (m_current_helper_uuid, m_ise_context_buffer, m_ise_context_length, ctx);
3581 m_signal_show_ise ();
3585 //SCIM_TRANS_CMD_UPDATE_PROPERTY
3586 void socket_helper_update_property (int client, Property& property) {
3587 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_property (" << client << ")\n";
3588 m_signal_update_helper_property (client, property);
3590 //SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT
3591 void socket_helper_send_imengine_event (int client, uint32 target_ic, String target_uuid , Transaction& nest_trans) {
3592 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_send_imengine_event (" << client << ")\n";
3593 HelperInfoRepository::iterator hiit = m_helper_active_info_repository.find (client);
3595 if (hiit != m_helper_active_info_repository.end ()) {
3597 uint32 target_context;
3598 get_imengine_client_context (target_ic, target_client, target_context);
3600 uint32 focused_context;
3601 String focused_uuid;
3602 focused_uuid = get_focused_context (focused_client, focused_context);
3604 if (target_ic == (uint32) (-1)) {
3605 target_client = focused_client;
3606 target_context = focused_context;
3609 if (target_uuid.length () == 0)
3610 target_uuid = focused_uuid;
3612 ClientInfo client_info = socket_get_client_info (target_client);
3613 SCIM_DEBUG_MAIN (5) << "Target UUID = " << target_uuid << " Focused UUId = " << focused_uuid << "\nTarget Client = " << target_client << "\n";
3615 if (client_info.type == FRONTEND_CLIENT) {
3616 /* If the original context value is greater than 0x7FFF, the line below would not work properly
3617 since the target_context acquired by get_imengine_client_context() is always smaller than 0x7FFF.
3618 But since the send_imengine_event() of scim_helper module will call IMEngine's
3619 process_helper_event() function directly, instead of sending SEND_IMENGINE_EVENT message.
3620 So we are not going to handle this kind of exceptional case for now. */
3621 m_panel_agent_manager.process_helper_event (target_client, target_context, target_uuid, hiit->second.uuid, nest_trans);
3626 void socket_helper_key_event_op (int client, int cmd, uint32 target_ic, String& target_uuid, KeyEvent& key) {
3627 if (!key.empty ()) {
3629 uint32 target_context;
3630 get_imengine_client_context (target_ic, target_client, target_context);
3632 uint32 focused_context;
3633 String focused_uuid;
3634 focused_uuid = get_focused_context (focused_client, focused_context);
3636 if (target_ic == (uint32) (-1)) {
3637 target_client = focused_client;
3638 target_context = focused_context;
3641 if (target_uuid.length () == 0)
3642 target_uuid = focused_uuid;
3644 if (target_client == -1) {
3645 /* FIXUP: monitor 'Invalid Window' error */
3646 LOGW ("focused target client is NULL");
3647 } else if (target_uuid == focused_uuid &&
3648 clients_equal (target_client, focused_client) &&
3649 contexts_equal (target_context, focused_context)) {
3650 ClientInfo client_info = socket_get_client_info (focused_client);
3652 if (client_info.type == FRONTEND_CLIENT) {
3653 m_panel_agent_manager.socket_helper_key_event (focused_client, focused_context, cmd, key);
3656 LOGD ("[target_client : %d, focused_client : %d] => %d, [target_context : %u, focused_context : %u] => %d",
3657 target_client, focused_client, clients_equal (target_client, focused_client),
3658 target_context, focused_context, contexts_equal (target_context, focused_context));
3662 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
3663 //SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT
3664 void socket_helper_send_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key) {
3665 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_send_key_event (" << client << ")\n";
3666 ISF_PROF_DEBUG ("first message")
3667 socket_helper_key_event_op (client, SCIM_TRANS_CMD_PROCESS_KEY_EVENT, target_ic, target_uuid, key);
3669 //SCIM_TRANS_CMD_FORWARD_KEY_EVENT
3670 void socket_helper_forward_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key) {
3671 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_forward_key_event (" << client << ")\n";
3672 socket_helper_key_event_op (client, SCIM_TRANS_CMD_FORWARD_KEY_EVENT, target_ic, target_uuid, key);
3675 //SCIM_TRANS_CMD_COMMIT_STRING
3676 void socket_helper_commit_string (int client, uint32 target_ic, String target_uuid, WideString wstr) {
3677 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_commit_string (" << client << ")\n";
3679 if (wstr.length ()) {
3681 uint32 target_context;
3682 get_imengine_client_context (target_ic, target_client, target_context);
3684 uint32 focused_context;
3685 String focused_uuid;
3686 focused_uuid = get_focused_context (focused_client, focused_context);
3688 if (target_ic == (uint32) (-1)) {
3689 target_client = focused_client;
3690 target_context = focused_context;
3693 if (target_uuid.length () == 0)
3694 target_uuid = focused_uuid;
3696 if (target_uuid == focused_uuid &&
3697 clients_equal (target_client, focused_client) &&
3698 contexts_equal (target_context, focused_context)) {
3699 ClientInfo client_info = socket_get_client_info (focused_client);
3701 if (client_info.type == FRONTEND_CLIENT) {
3702 m_panel_agent_manager.commit_string (focused_client, focused_context, wstr);
3704 std::cerr << "target client is not existed!!!" << "\n";
3709 //SCIM_TRANS_CMD_GET_SURROUNDING_TEXT
3710 void socket_helper_get_surrounding_text (int client, String uuid, uint32 maxlen_before, uint32 maxlen_after) {
3711 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3713 uint32 focused_context;
3714 get_focused_context (focused_client, focused_context);
3715 ClientInfo client_info = socket_get_client_info (focused_client);
3717 /* If the get_surrounding_text was received when there is no client available,
3718 * return empty surrounding text since the sender would be waiting for reply */
3719 if (focused_client == -1) {
3720 socket_update_surrounding_text("", 0);
3722 if (client_info.type == FRONTEND_CLIENT) {
3723 m_panel_agent_manager.socket_helper_get_surrounding_text (focused_client, focused_context, maxlen_before, maxlen_after);
3727 //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT
3728 void socket_helper_delete_surrounding_text (int client, uint32 offset, uint32 len) {
3729 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3731 uint32 focused_context;
3732 get_focused_context (focused_client, focused_context);
3733 ClientInfo client_info = socket_get_client_info (focused_client);
3735 if (client_info.type == FRONTEND_CLIENT) {
3736 m_panel_agent_manager.socket_helper_delete_surrounding_text (focused_client, focused_context, offset, len);
3739 //SCIM_TRANS_CMD_GET_SELECTION
3740 void socket_helper_get_selection (int client, String uuid) {
3741 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3743 uint32 focused_context;
3744 get_focused_context (focused_client, focused_context);
3745 ClientInfo client_info = socket_get_client_info (focused_client);
3747 if (client_info.type == FRONTEND_CLIENT) {
3748 m_panel_agent_manager.socket_helper_get_selection (focused_client, focused_context);
3751 //SCIM_TRANS_CMD_SET_SELECTION
3752 void socket_helper_set_selection (int client, uint32 start, uint32 end) {
3753 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3755 uint32 focused_context;
3756 get_focused_context (focused_client, focused_context);
3757 ClientInfo client_info = socket_get_client_info (focused_client);
3759 if (client_info.type == FRONTEND_CLIENT) {
3760 m_panel_agent_manager.socket_helper_set_selection (focused_client, focused_context, start, end);
3764 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
3765 void socket_helper_show_preedit_string (int client, uint32 target_ic, String target_uuid) {
3766 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_show_preedit_string (" << client << ")\n";
3768 uint32 target_context;
3769 get_imengine_client_context (target_ic, target_client, target_context);
3771 uint32 focused_context;
3772 String focused_uuid = get_focused_context (focused_client, focused_context);
3774 if (target_ic == (uint32) (-1)) {
3775 target_client = focused_client;
3776 target_context = focused_context;
3779 if (target_uuid.length () == 0)
3780 target_uuid = focused_uuid;
3782 if (target_uuid == focused_uuid &&
3783 clients_equal (target_client, focused_client) &&
3784 contexts_equal (target_context, focused_context)) {
3785 ClientInfo client_info = socket_get_client_info (focused_client);
3787 if (client_info.type == FRONTEND_CLIENT) {
3788 m_panel_agent_manager.show_preedit_string (focused_client, focused_context);
3792 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
3793 void socket_helper_hide_preedit_string (int client, uint32 target_ic, String target_uuid) {
3794 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_hide_preedit_string (" << client << ")\n";
3796 uint32 target_context;
3797 get_imengine_client_context (target_ic, target_client, target_context);
3799 uint32 focused_context;
3800 String focused_uuid = get_focused_context (focused_client, focused_context);
3802 if (target_ic == (uint32) (-1)) {
3803 target_client = focused_client;
3804 target_context = focused_context;
3807 if (target_uuid.length () == 0)
3808 target_uuid = focused_uuid;
3810 if (target_uuid == focused_uuid &&
3811 clients_equal (target_client, focused_client) &&
3812 contexts_equal (target_context, focused_context)) {
3813 ClientInfo client_info = socket_get_client_info (focused_client);
3815 if (client_info.type == FRONTEND_CLIENT) {
3816 m_panel_agent_manager.hide_preedit_string (focused_client, focused_context);
3820 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
3821 void socket_helper_update_preedit_string (int client, uint32 target_ic, String target_uuid, WideString preedit, WideString commit, AttributeList& attrs, uint32 caret) {
3822 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_preedit_string (" << client << ")\n";
3824 uint32 target_context;
3825 get_imengine_client_context (target_ic, target_client, target_context);
3827 uint32 focused_context;
3828 String focused_uuid;
3829 focused_uuid = get_focused_context (focused_client, focused_context);
3831 if (target_ic == (uint32) (-1)) {
3832 target_client = focused_client;
3833 target_context = focused_context;
3836 if (target_uuid.length () == 0)
3837 target_uuid = focused_uuid;
3839 if (target_uuid == focused_uuid &&
3840 clients_equal (target_client, focused_client) &&
3841 contexts_equal (target_context, focused_context)) {
3842 ClientInfo client_info = socket_get_client_info (focused_client);
3844 if (client_info.type == FRONTEND_CLIENT) {
3845 m_panel_agent_manager.update_preedit_string (focused_client, focused_context, preedit, commit, attrs, caret);
3849 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
3850 void socket_helper_update_preedit_caret (int client, uint32 caret) {
3851 SCIM_DEBUG_MAIN (4) << __func__ << " (" << client << ")\n";
3853 uint32 focused_context;
3854 String focused_uuid;
3855 focused_uuid = get_focused_context (focused_client, focused_context);
3856 ClientInfo client_info = socket_get_client_info (focused_client);
3858 if (client_info.type == FRONTEND_CLIENT) {
3859 m_panel_agent_manager.update_preedit_caret (focused_client, focused_context, caret);
3863 //ISM_TRANS_CMD_RECAPTURE_STRING
3864 void socket_helper_recapture_string (int client, uint32 target_ic, String target_uuid, int offset, int len, WideString preedit,
3865 WideString commit, AttributeList& attrs) {
3866 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_recapture_string (" << client << ")\n";
3868 uint32 target_context;
3869 get_imengine_client_context (target_ic, target_client, target_context);
3871 uint32 focused_context;
3872 String focused_uuid;
3873 focused_uuid = get_focused_context (focused_client, focused_context);
3875 if (target_ic == (uint32) (-1)) {
3876 target_client = focused_client;
3877 target_context = focused_context;
3880 if (target_uuid.length () == 0)
3881 target_uuid = focused_uuid;
3883 if (target_uuid == focused_uuid &&
3884 clients_equal (target_client, focused_client) &&
3885 contexts_equal (target_context, focused_context)) {
3886 ClientInfo client_info = socket_get_client_info (focused_client);
3888 if (client_info.type == FRONTEND_CLIENT) {
3889 m_panel_agent_manager.recapture_string (focused_client, focused_context, offset, len, preedit, commit, attrs);
3894 //SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
3895 void socket_helper_register_helper (int client, HelperInfo& info) {
3896 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_helper (" << client << ")\n";
3897 bool result = false;
3904 if (!m_signal_get_ise_information (info.uuid, info.name, language, type, option, module_name)) {
3905 LOGW ("This helper (%s) is not IME", info.uuid.c_str ());
3909 info.option = option;
3911 if (info.uuid.length ()) {
3912 SCIM_DEBUG_MAIN (4) << "New Helper uuid=" << info.uuid << " name=" << info.name << "\n";
3913 HelperClientIndex::iterator it = m_helper_client_index.find (info.uuid);
3915 if (it == m_helper_client_index.end ()) {
3916 m_helper_info_repository [client] = info;
3917 m_helper_client_index [info.uuid] = HelperClientStub (client, 1);
3918 StartHelperICIndex::iterator icit = m_start_helper_ic_index.find (info.uuid);
3920 if (icit != m_start_helper_ic_index.end ()) {
3921 m_panel_agent_manager.helper_attach_input_context_and_update_screen (client, icit->second, m_current_screen);
3922 m_start_helper_ic_index.erase (icit);
3925 LOGW ("Failed to register IME : %s", info.uuid.c_str ());
3926 m_panel_agent_manager.send_fail_reply(client);
3929 LOGW ("Failed to register IME : %s", info.uuid.c_str ());
3930 m_panel_agent_manager.send_fail_reply(client);
3937 LOGD ("Succeed to register IME : %s", info.uuid.c_str ());
3938 m_signal_register_helper (client, info);
3942 //SCIM_TRANS_CMD_PANEL_REGISTER_ACTIVE_HELPER
3943 void socket_helper_register_helper_passive (int client, HelperInfo& info) {
3944 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_helper_passive (" << client << ")\n";
3951 if (!m_signal_get_ise_information (info.uuid, info.name, language, type, option, module_name)) {
3952 LOGW ("This helper (%s) is not IME", info.uuid.c_str ());
3956 info.option = option;
3958 if (info.uuid.length ()) {
3959 SCIM_DEBUG_MAIN (4) << "New Helper Passive uuid=" << info.uuid << " name=" << info.name << "\n";
3960 HelperInfoRepository::iterator it = m_helper_active_info_repository.find (client);
3962 if (it == m_helper_active_info_repository.end ()) {
3963 m_helper_active_info_repository[client] = info;
3966 StringIntRepository::iterator iter = m_ise_pending_repository.find (info.uuid);
3968 if (iter != m_ise_pending_repository.end ()) {
3969 m_ise_pending_repository.erase (iter);
3972 iter = m_ise_pending_repository.find (info.name);
3974 if (iter != m_ise_pending_repository.end ()) {
3975 m_ise_pending_repository.erase (iter);
3981 //ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
3982 void socket_helper_update_input_context (int client, uint32 type, uint32 value) {
3983 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_input_context (" << client << ")\n";
3984 m_signal_update_input_context ((int)type, (int)value);
3986 uint32 focused_context;
3987 get_focused_context (focused_client, focused_context);
3988 ClientInfo client_info = socket_get_client_info (focused_client);
3990 if (client_info.type == FRONTEND_CLIENT) {
3991 m_panel_agent_manager.update_ise_input_context (focused_client, focused_context, type, value);
3993 std::cerr << "focused client is not existed!!!" << "\n";
3996 //ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE
3997 void socket_helper_update_language_locale(int client, String locale) {
3998 SCIM_DEBUG_MAIN(4) << "InfoManager::socket_helper_update_language_locale (" << client << ")\n";
3999 m_signal_update_language_locale(locale);
4002 uint32 focused_context;
4003 get_focused_context(focused_client, focused_context);
4004 ClientInfo client_info = socket_get_client_info(focused_client);
4006 if (client_info.type == FRONTEND_CLIENT) {
4007 m_panel_agent_manager.update_ise_language_locale(focused_client, focused_context, locale);
4009 std::cerr << "focused client is not existed!!!" << "\n";
4012 //SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
4013 void socket_helper_send_private_command (int client, String command) {
4014 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
4016 uint32 focused_context;
4017 get_focused_context (focused_client, focused_context);
4018 ClientInfo client_info = socket_get_client_info (focused_client);
4020 if (client_info.type == FRONTEND_CLIENT) {
4021 m_panel_agent_manager.send_private_command (focused_client, focused_context, command);
4024 //SCIM_TRANS_CMD_COMMIT_CONTENT
4025 void socket_helper_commit_content (int client, String content, String description, String mime_types) {
4026 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
4028 uint32 focused_context;
4029 get_focused_context (focused_client, focused_context);
4030 ClientInfo client_info = socket_get_client_info (focused_client);
4032 if (client_info.type == FRONTEND_CLIENT) {
4033 m_panel_agent_manager.commit_content (focused_client, focused_context, content, description, mime_types);
4036 //ISM_TRANS_CMD_UPDATE_ISE_EXIT
4037 void UPDATE_ISE_EXIT (int client) {
4038 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4039 bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false);
4040 if (launch_ise_on_request && !m_refocus_needed && !m_reshow_needed)
4041 m_restart_needed = false;
4044 void process_key_event_done (KeyEvent &key, uint32 ret, uint32 serial) {
4046 uint32 focused_context;
4047 get_focused_context (focused_client, focused_context);
4048 ClientInfo client_info = socket_get_client_info (focused_client);
4050 if (client_info.type == FRONTEND_CLIENT) {
4051 m_panel_agent_manager.process_key_event_done (focused_client, focused_context, key, ret, serial);
4055 //ISM_TRANS_CMD_REQUEST_ISE_HIDE
4056 void request_ise_hide () {
4058 uint32 focused_context;
4059 get_focused_context (focused_client, focused_context);
4060 ClientInfo client_info = socket_get_client_info (focused_client);
4062 if (client_info.type == FRONTEND_CLIENT) {
4063 m_panel_agent_manager.request_ise_hide (focused_client, focused_context);
4067 void socket_reset_helper_input_context (const String& uuid, int client, uint32 context) {
4068 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4070 if (it != m_helper_client_index.end ()) {
4071 uint32 ctx = get_helper_ic (client, context);
4072 m_panel_agent_manager.reset_helper_context (it->second.id, ctx, uuid);
4076 bool helper_select_aux (uint32 item) {
4077 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_aux \n";
4079 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4080 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4082 if (it != m_helper_client_index.end ()) {
4086 get_focused_context (client, context);
4087 ctx = get_helper_ic (client, context);
4088 m_panel_agent_manager.select_aux (it->second.id, ctx, item);
4096 bool helper_select_candidate (uint32 item) {
4097 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_candidate \n";
4099 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4100 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4102 if (it != m_helper_client_index.end ()) {
4106 get_focused_context (client, context);
4107 ctx = get_helper_ic (client, context);
4108 m_panel_agent_manager.select_candidate (it->second.id, ctx, item);
4116 bool helper_lookup_table_page_up (void) {
4117 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_lookup_table_page_up \n";
4119 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4120 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4122 if (it != m_helper_client_index.end ()) {
4126 get_focused_context (client, context);
4127 ctx = get_helper_ic (client, context);
4128 m_panel_agent_manager.lookup_table_page_up (it->second.id, ctx);
4136 bool helper_lookup_table_page_down (void) {
4137 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_lookup_table_page_down \n";
4139 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4140 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4142 if (it != m_helper_client_index.end ()) {
4146 get_focused_context (client, context);
4147 ctx = get_helper_ic (client, context);
4148 m_panel_agent_manager.lookup_table_page_down (it->second.id, ctx);
4156 bool helper_update_lookup_table_page_size (uint32 size) {
4157 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_update_lookup_table_page_size \n";
4159 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4160 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4162 if (it != m_helper_client_index.end ()) {
4166 get_focused_context (client, context);
4167 ctx = get_helper_ic (client, context);
4168 m_panel_agent_manager.update_lookup_table_page_size (it->second.id, ctx, size);
4176 bool helper_update_candidate_item_layout (const std::vector<uint32>& row_items) {
4177 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4179 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4180 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4182 if (it != m_helper_client_index.end ()) {
4186 get_focused_context (client, context);
4187 ctx = get_helper_ic (client, context);
4188 m_panel_agent_manager.update_candidate_item_layout (it->second.id, ctx, row_items);
4196 bool helper_select_associate (uint32 item) {
4197 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_associate \n";
4199 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4200 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4202 if (it != m_helper_client_index.end ()) {
4206 get_focused_context (client, context);
4207 ctx = get_helper_ic (client, context);
4208 m_panel_agent_manager.select_associate (it->second.id, ctx, item);
4216 bool helper_associate_table_page_up (void) {
4217 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_associate_table_page_up \n";
4219 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4220 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4222 if (it != m_helper_client_index.end ()) {
4226 get_focused_context (client, context);
4227 ctx = get_helper_ic (client, context);
4228 m_panel_agent_manager.associate_table_page_up (it->second.id, ctx);
4236 bool helper_associate_table_page_down (void) {
4237 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_associate_table_page_down \n";
4239 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4240 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4242 if (it != m_helper_client_index.end ()) {
4246 get_focused_context (client, context);
4247 ctx = get_helper_ic (client, context);
4248 m_panel_agent_manager.associate_table_page_down (it->second.id, ctx);
4256 bool helper_update_associate_table_page_size (uint32 size) {
4257 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_update_associate_table_page_size \n";
4259 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4260 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4262 if (it != m_helper_client_index.end ()) {
4266 get_focused_context (client, context);
4267 ctx = get_helper_ic (client, context);
4268 m_panel_agent_manager.update_associate_table_page_size (it->second.id, ctx, size);
4276 bool helper_update_displayed_candidate_number (uint32 size) {
4277 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4279 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4280 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4282 if (it != m_helper_client_index.end ()) {
4286 get_focused_context (client, context);
4287 ctx = get_helper_ic (client, context);
4288 m_panel_agent_manager.update_displayed_candidate_number (it->second.id, ctx, size);
4296 bool helper_longpress_candidate (uint32 index) {
4297 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4299 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4300 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4302 if (it != m_helper_client_index.end ()) {
4306 get_focused_context (client, context);
4307 ctx = get_helper_ic (client, context);
4308 m_panel_agent_manager.send_longpress_event (it->second.id, ctx, index);
4313 std::cerr << __func__ << " is failed!!!\n";
4317 void helper_all_update_spot_location (int x, int y) {
4318 SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_spot_location (" << x << "," << y << ")\n";
4319 HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
4322 String uuid = get_focused_context (client, context);
4324 for (; hiit != m_helper_info_repository.end (); ++ hiit) {
4325 if (hiit->second.option & SCIM_HELPER_NEED_SPOT_LOCATION_INFO) {
4326 m_panel_agent_manager.helper_all_update_spot_location (hiit->first, get_helper_ic (client, context), uuid, x, y);
4331 void helper_all_update_cursor_position (int cursor_pos) {
4332 SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_cursor_position (" << cursor_pos << ")\n";
4333 HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
4336 String uuid = get_focused_context (client, context);
4338 for (; hiit != m_helper_info_repository.end (); ++ hiit) {
4339 m_panel_agent_manager.helper_all_update_cursor_position (hiit->first, get_helper_ic (client, context), uuid, cursor_pos);
4343 void helper_all_update_screen (int screen) {
4344 SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_screen (" << screen << ")\n";
4345 HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
4349 uuid = get_focused_context (client, context);
4351 for (; hiit != m_helper_info_repository.end (); ++ hiit) {
4352 if (hiit->second.option & SCIM_HELPER_NEED_SCREEN_INFO) {
4353 m_panel_agent_manager.helper_all_update_screen (hiit->first, get_helper_ic (client, context), uuid, screen);
4358 bool set_autocapital_type (int mode) {
4359 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4360 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
4361 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
4362 iseContext->autocapital_type = static_cast<Ecore_IMF_Autocapital_Type>(mode);
4364 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || (m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
4365 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4367 if (it != m_helper_client_index.end ()) {
4371 get_focused_context (client, context);
4372 ctx = get_helper_ic (client, context);
4373 m_panel_agent_manager.set_autocapital_type (it->second.id, ctx, m_current_helper_uuid, mode);
4378 std::cerr << __func__ << " is failed!!!\n";
4382 bool set_prediction_allow (int client, int mode) {
4383 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4384 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
4385 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
4386 iseContext->prediction_allow = static_cast<Eina_Bool>(mode);
4388 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || (m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
4389 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4391 if (it != m_helper_client_index.end ()) {
4393 uint32 focused_context;
4395 get_focused_context (focused_client, focused_context);
4396 ctx = get_helper_ic (focused_client, focused_context);
4397 m_panel_agent_manager.set_prediction_allow (it->second.id, ctx, m_current_helper_uuid, mode);
4402 std::cerr << __func__ << " is failed!!!\n";
4406 const String& get_focused_context (int& client, uint32& context, bool force_last_context = false) const {
4407 if (m_current_socket_client >= 0) {
4408 client = m_current_socket_client;
4409 context = m_current_client_context;
4410 return m_current_context_uuid;
4412 client = m_last_socket_client;
4413 context = m_last_client_context;
4414 return m_last_context_uuid;
4419 void socket_transaction_start (void) {
4420 m_signal_transaction_start ();
4423 void socket_transaction_end (void) {
4424 m_signal_transaction_end ();
4430 void unlock (void) {
4435 InfoManager::InfoManager ()
4436 : m_impl (new InfoManagerImpl ())
4440 InfoManager::~InfoManager ()
4446 InfoManager::initialize (InfoManager* info_manager, const ConfigPointer& config, const String& display, bool resident)
4448 return m_impl->initialize (info_manager, config, display, resident);
4452 InfoManager::valid (void) const
4454 return m_impl->valid ();
4458 InfoManager::stop (void)
4465 InfoManager::socket_get_client_info (int client) const
4467 return m_impl->socket_get_client_info (client);
4470 void InfoManager::hide_helper (const String& uuid)
4472 m_impl->hide_helper (uuid);
4475 InfoManager::get_current_toolbar_mode () const
4477 return m_impl->get_current_toolbar_mode ();
4481 InfoManager::get_current_ise_geometry (rectinfo& rect)
4483 m_impl->get_current_ise_geometry (rect);
4487 InfoManager::get_current_helper_uuid () const
4489 return m_impl->get_current_helper_uuid ();
4493 InfoManager::get_current_ise_name () const
4495 return m_impl->get_current_ise_name ();
4499 InfoManager::set_current_toolbar_mode (TOOLBAR_MODE_T mode)
4501 m_impl->set_current_toolbar_mode (mode);
4505 InfoManager::set_current_ise_name (String& name)
4507 m_impl->set_current_ise_name (name);
4511 InfoManager::set_current_helper_option (uint32 option)
4513 m_impl->set_current_helper_option (option);
4517 InfoManager::update_candidate_panel_event (uint32 nType, uint32 nValue)
4519 m_impl->update_panel_event (ISM_TRANS_CMD_UPDATE_ISF_CANDIDATE_PANEL, nType, nValue);
4523 InfoManager::update_input_panel_event (uint32 nType, uint32 nValue)
4525 m_impl->update_panel_event (ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT, nType, nValue);
4529 InfoManager::move_preedit_caret (uint32 position)
4531 return m_impl->move_preedit_caret (position);
4537 InfoManager::request_help (void)
4539 return m_impl->request_help ();
4543 InfoManager::request_factory_menu (void)
4545 return m_impl->request_factory_menu ();
4550 InfoManager::change_factory (const String& uuid)
4552 return m_impl->change_factory (uuid);
4556 InfoManager::helper_candidate_show (void)
4558 return m_impl->helper_candidate_show ();
4562 InfoManager::helper_candidate_hide (void)
4564 return m_impl->helper_candidate_hide ();
4568 InfoManager::candidate_more_window_show (void)
4570 return m_impl->candidate_more_window_show ();
4574 InfoManager::candidate_more_window_hide (void)
4576 return m_impl->candidate_more_window_hide ();
4580 InfoManager::update_helper_lookup_table (const LookupTable& table)
4582 return m_impl->update_helper_lookup_table (table);
4586 InfoManager::select_aux (uint32 item)
4588 return m_impl->select_aux (item);
4592 InfoManager::select_candidate (uint32 item)
4594 return m_impl->select_candidate (item);
4598 InfoManager::lookup_table_page_up (void)
4600 return m_impl->lookup_table_page_up ();
4604 InfoManager::lookup_table_page_down (void)
4606 return m_impl->lookup_table_page_down ();
4610 InfoManager::update_lookup_table_page_size (uint32 size)
4612 return m_impl->update_lookup_table_page_size (size);
4616 InfoManager::update_candidate_item_layout (const std::vector<uint32>& row_items)
4618 return m_impl->update_candidate_item_layout (row_items);
4622 InfoManager::select_associate (uint32 item)
4624 return m_impl->select_associate (item);
4628 InfoManager::associate_table_page_up (void)
4630 return m_impl->associate_table_page_up ();
4634 InfoManager::associate_table_page_down (void)
4636 return m_impl->associate_table_page_down ();
4640 InfoManager::update_associate_table_page_size (uint32 size)
4642 return m_impl->update_associate_table_page_size (size);
4646 InfoManager::update_displayed_candidate_number (uint32 size)
4648 return m_impl->update_displayed_candidate_number (size);
4652 InfoManager::send_longpress_event (int type, int index)
4654 m_impl->send_longpress_event (type, index);
4658 InfoManager::trigger_property (const String& property)
4660 return m_impl->trigger_property (property);
4664 InfoManager::start_helper (const String& uuid)
4666 return m_impl->start_helper (uuid, -2, 0);
4670 InfoManager::stop_helper (const String& uuid)
4672 return m_impl->stop_helper (uuid, -2, 0);
4676 InfoManager::set_default_ise (const DEFAULT_ISE_T& ise)
4678 m_impl->set_default_ise (ise);
4682 InfoManager::set_should_shared_ise (const bool should_shared_ise)
4684 m_impl->set_should_shared_ise (should_shared_ise);
4688 //InfoManager::reload_config (void)
4690 // m_impl->reload_config ();
4694 InfoManager::exit (void)
4696 return m_impl->exit ();
4699 InfoManager::update_ise_list (std::vector<String>& strList)
4701 m_impl->update_ise_list (strList);
4705 InfoManager::remoteinput_update_preedit_string (WideString str, AttributeList &attrs, uint32 caret)
4707 return m_impl->remoteinput_update_preedit_string (str, attrs, caret);
4711 InfoManager::remoteinput_commit_string (const WideString &str)
4713 return m_impl->remoteinput_commit_string (str);
4717 InfoManager::remoteinput_send_key_event (const KeyEvent &key)
4719 return m_impl->remoteinput_send_key_event (key);
4723 InfoManager::remoteinput_forward_key_event (const KeyEvent &key)
4725 return m_impl->remoteinput_forward_key_event (key);
4729 InfoManager::remoteinput_delete_surrounding_text (uint32 offset, uint32 len)
4731 return m_impl->remoteinput_delete_surrounding_text (offset, len);
4734 /////////////////////////////////Message function begin/////////////////////////////////////////
4736 //ISM_TRANS_CMD_PANEL_RESET_KEYBOARD_ISE
4737 bool InfoManager:: reset_keyboard_ise (void)
4739 return m_impl->reset_keyboard_ise ();
4742 //ISM_TRANS_CMD_SHOW_ISF_CONTROL
4743 void InfoManager::show_isf_panel (int client_id)
4745 m_impl->show_isf_panel (client_id);
4748 //ISM_TRANS_CMD_HIDE_ISF_CONTROL
4749 void InfoManager::hide_isf_panel (int client_id)
4751 m_impl->hide_isf_panel (client_id);
4754 //ISM_TRANS_CMD_SHOW_ISE_PANEL
4755 void InfoManager::show_ise_panel (int client_id, uint32 client, uint32 context, char* data, size_t len)
4757 m_impl->show_ise_panel (client_id, client, context, data, len);
4760 //ISM_TRANS_CMD_HIDE_ISE_PANEL
4761 void InfoManager::hide_ise_panel (int client_id, uint32 client, uint32 context)
4763 m_impl->hide_ise_panel (client_id, client, context);
4766 //ISM_TRANS_CMD_HIDE_ISE_PANEL from ISF control
4767 void InfoManager::hide_helper_ise (void)
4769 m_impl->hide_helper_ise ();
4772 //ISM_TRANS_CMD_LAUNCH_ISE from ISF control
4773 void InfoManager::prelaunch_helper_ise (void)
4775 m_impl->prelaunch_helper_ise ();
4778 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
4779 bool InfoManager::process_key_event (KeyEvent& key, uint32 serial, uint32 keycode)
4781 return m_impl->process_key_event (key, serial, keycode);
4784 //ISM_TRANS_CMD_GET_ACTIVE_ISE_GEOMETRY
4785 void InfoManager::get_input_panel_geometry (int client_id, _OUT_ struct rectinfo& info)
4787 m_impl->get_input_panel_geometry (client_id, info);
4790 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
4791 void InfoManager::get_candidate_window_geometry (int client_id, _OUT_ struct rectinfo& info)
4793 m_impl->get_candidate_window_geometry (client_id, info);
4796 //ISM_TRANS_CMD_GET_ISE_LANGUAGE_LOCALE
4797 void InfoManager::get_ise_language_locale (int client_id, _OUT_ char** data, _OUT_ size_t& len)
4799 m_impl->get_ise_language_locale (client_id, data, len);
4802 //ISM_TRANS_CMD_SET_LAYOUT
4803 void InfoManager::set_ise_layout (int client_id, uint32 layout)
4805 m_impl->set_ise_layout (client_id, layout);
4808 //ISM_TRANS_CMD_SET_INPUT_MODE
4809 void InfoManager::set_ise_input_mode (int client_id, uint32 input_mode)
4811 m_impl->set_ise_input_mode (client_id, input_mode);
4814 //ISM_TRANS_CMD_SET_INPUT_HINT
4815 void InfoManager::set_ise_input_hint (int client_id, uint32 input_hint)
4817 m_impl->set_ise_input_hint (client_id, input_hint);
4820 //ISM_TRANS_CMD_UPDATE_BIDI_DIRECTION
4821 void InfoManager::update_ise_bidi_direction (int client_id, uint32 bidi_direction)
4823 m_impl->update_ise_bidi_direction (client_id, bidi_direction);
4827 //ISM_TRANS_CMD_SET_ISE_LANGUAGE
4828 void InfoManager::set_ise_language (int client_id, uint32 language)
4830 m_impl->set_ise_language (client_id, language);
4833 //ISM_TRANS_CMD_SET_ISE_IMDATA
4834 void InfoManager::set_ise_imdata (int client_id, const char* imdata, size_t len)
4836 m_impl->set_ise_imdata (client_id, imdata, len);
4839 //ISM_TRANS_CMD_GET_ISE_IMDATA
4840 bool InfoManager:: get_ise_imdata (int client_id, _OUT_ char** imdata, _OUT_ size_t& len)
4842 return m_impl->get_ise_imdata (client_id, imdata, len);
4845 //ISM_TRANS_CMD_GET_LAYOUT
4846 bool InfoManager:: get_ise_layout (int client_id, _OUT_ uint32& layout)
4848 return m_impl->get_ise_layout (client_id, layout);
4851 //ISM_TRANS_CMD_GET_ISE_STATE
4852 void InfoManager::get_ise_state (int client_id, _OUT_ int& state)
4854 m_impl->get_ise_state (client_id, state);
4857 //ISM_TRANS_CMD_GET_ACTIVE_ISE
4858 void InfoManager::get_active_ise (int client_id, _OUT_ String& default_uuid)
4860 m_impl->get_active_ise (client_id, default_uuid);
4863 //ISM_TRANS_CMD_GET_ISE_LIST
4864 void InfoManager::get_ise_list (int client_id, _OUT_ std::vector<String>& strlist)
4866 m_impl->get_ise_list (client_id, strlist);
4869 //ISM_TRANS_CMD_GET_ALL_HELPER_ISE_INFO
4870 void InfoManager::get_all_helper_ise_info (int client_id, _OUT_ HELPER_ISE_INFO& info)
4872 m_impl->get_all_helper_ise_info (client_id, info);
4875 //ISM_TRANS_CMD_SET_ENABLE_HELPER_ISE_INFO
4876 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4877 void InfoManager::set_enable_helper_ise_info (int client_id, String appid, uint32 is_enabled)
4879 m_impl->set_enable_helper_ise_info (client_id, appid, is_enabled);
4882 //ISM_TRANS_CMD_SHOW_HELPER_ISE_LIST
4883 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4884 void InfoManager::show_helper_ise_list (int client_id)
4886 m_impl->show_helper_ise_list (client_id);
4889 //ISM_TRANS_CMD_SHOW_HELPER_ISE_SELECTOR
4890 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4891 void InfoManager::show_helper_ise_selector (int client_id)
4893 m_impl->show_helper_ise_selector (client_id);
4896 //ISM_TRANS_CMD_IS_HELPER_ISE_ENABLED
4898 void InfoManager::is_helper_ise_enabled (int client_id, String strAppid, _OUT_ uint32& nEnabled)
4900 m_impl->is_helper_ise_enabled (client_id, strAppid, nEnabled);
4903 //ISM_TRANS_CMD_GET_ISE_INFORMATION
4904 void InfoManager::get_ise_information (int client_id, String strUuid, _OUT_ String& strName, _OUT_ String& strLanguage,
4905 _OUT_ int& nType, _OUT_ int& nOption, _OUT_ String& strModuleName)
4907 m_impl->get_ise_information (client_id, strUuid, strName, strLanguage, nType, nOption, strModuleName);
4910 //ISM_TRANS_CMD_RESET_ISE_OPTION
4911 //reply SCIM_TRANS_CMD_OK
4912 bool InfoManager:: reset_ise_option (int client_id)
4914 return m_impl->reset_ise_option (client_id);
4917 //ISM_TRANS_CMD_SET_ACTIVE_ISE_BY_UUID
4919 bool InfoManager:: set_active_ise_by_uuid (int client_id, char* buf, size_t len)
4921 return m_impl->set_active_ise_by_uuid (client_id, buf, len);
4924 //ISM_TRANS_CMD_SET_INITIAL_ISE_BY_UUID
4925 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4926 void InfoManager::set_initial_ise_by_uuid (int client_id, char* buf, size_t len)
4928 m_impl->set_initial_ise_by_uuid (client_id, buf, len);
4931 //ISM_TRANS_CMD_SET_RETURN_KEY_TYPE
4932 void InfoManager::set_ise_return_key_type (int client_id, uint32 type)
4934 m_impl->set_ise_return_key_type (client_id, type);
4937 //ISM_TRANS_CMD_GET_RETURN_KEY_TYPE
4939 bool InfoManager:: get_ise_return_key_type (int client_id, _OUT_ uint32& type)
4941 return m_impl->get_ise_return_key_type (client_id, type);
4945 //ISM_TRANS_CMD_SET_RETURN_KEY_DISABLE
4946 void InfoManager::set_ise_return_key_disable (int client_id, uint32 disabled)
4948 m_impl->set_ise_return_key_disable (client_id, disabled);
4951 //ISM_TRANS_CMD_GET_RETURN_KEY_DISABLE
4952 bool InfoManager::get_ise_return_key_disable (int client_id, _OUT_ uint32& disabled)
4954 return m_impl->get_ise_return_key_disable (client_id, disabled);
4957 //ISM_TRANS_CMD_SET_CAPS_MODE
4958 void InfoManager::set_ise_caps_mode (int client_id, uint32 mode)
4960 m_impl->set_ise_caps_mode (client_id, mode);
4963 //SCIM_TRANS_CMD_RELOAD_CONFIG
4964 void InfoManager::reload_config (void)
4966 m_impl->reload_config ();
4969 //ISM_TRANS_CMD_SEND_WILL_SHOW_ACK
4970 void InfoManager::will_show_ack (int client_id)
4972 m_impl->will_show_ack (client_id);
4975 //ISM_TRANS_CMD_SEND_WILL_HIDE_ACK
4976 void InfoManager::will_hide_ack (int client_id)
4978 m_impl->will_hide_ack (client_id);
4981 //ISM_TRANS_CMD_RESET_DEFAULT_ISE
4982 void InfoManager::reset_default_ise (int client_id)
4984 m_impl->reset_default_ise (client_id);
4987 //ISM_TRANS_CMD_SET_HARDWARE_KEYBOARD_MODE
4988 void InfoManager::set_keyboard_mode (int client_id, uint32 mode)
4990 m_impl->set_keyboard_mode (client_id, mode);
4993 //ISM_TRANS_CMD_SEND_CANDIDATE_WILL_HIDE_ACK
4994 void InfoManager::candidate_will_hide_ack (int client_id)
4996 m_impl->candidate_will_hide_ack (client_id);
4999 //ISM_TRANS_CMD_GET_ACTIVE_HELPER_OPTION
5000 void InfoManager::get_active_helper_option (int client_id, _OUT_ uint32& option)
5002 m_impl->get_active_helper_option (client_id, option);
5005 //ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW
5006 void InfoManager::show_ise_option_window (int client_id, int caller_pid)
5008 m_impl->show_ise_option_window (client_id, caller_pid);
5011 //ISM_TRANS_CMD_GET_ISE_SETTING_APPID
5012 void InfoManager::get_ise_setting_appid (int client_id, String &ime_setting_appid)
5014 m_impl->get_ise_setting_appid (client_id, ime_setting_appid);
5017 //ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW
5018 void InfoManager::resume_ise_option_window (int client_id)
5020 m_impl->resume_ise_option_window (client_id);
5023 //ISM_TRANS_CMD_SET_KEYBOARD_MODE
5024 void InfoManager::set_ise_keyboard_mode (int client_id, uint32 mode)
5026 m_impl->set_ise_keyboard_mode (client_id, mode);
5029 //ISM_TRANS_CMD_SET_PREDICTION_HINT
5030 void InfoManager::set_prediction_hint (int client_id, String prediction_hint)
5032 m_impl->set_prediction_hint (client_id, prediction_hint);
5035 //ISM_TRANS_CMD_SET_MIME_TYPE
5036 void InfoManager::set_ise_mime_type (int client_id, String mime_type)
5038 m_impl->set_ise_mime_type (client_id, mime_type);
5041 //ISM_TRANS_CMD_FINALIZE_CONTENT
5042 void InfoManager::finalize_content (int client_id, String text, uint32 cursor_pos)
5044 m_impl->finalize_content (client_id, text, cursor_pos);
5047 //ISM_TRANS_CMD_SET_PREDICTION_HINT_DATA
5048 void InfoManager::set_prediction_hint_data (int client_id, String key, String value)
5050 m_impl->set_prediction_hint_data (client_id, key, value);
5053 //ISM_TRANS_CMD_SET_OPTIMIZATION_HINT
5054 void InfoManager::set_optimization_hint(int client_id, uint32 hint)
5056 m_impl->set_optimization_hint(client_id, hint);
5059 //ISM_TRANS_CMD_EXPAND_CANDIDATE
5060 void InfoManager::expand_candidate ()
5062 m_impl->expand_candidate ();
5065 //ISM_TRANS_CMD_CONTRACT_CANDIDATE
5066 void InfoManager::contract_candidate ()
5068 m_impl->contract_candidate ();
5071 //ISM_TRANS_CMD_GET_RECENT_ISE_GEOMETRY
5072 void InfoManager::get_recent_ise_geometry (int client_id, uint32 angle, _OUT_ struct rectinfo& info)
5074 m_impl->get_recent_ise_geometry (client_id, angle, info);
5077 //ISM_TRANS_CMD_SEND_REMOTE_INPUT_MESSAGE
5078 bool InfoManager::remoteinput_send_input_message (int client_id, char* buf, size_t len)
5080 return m_impl->send_remote_input_message (client_id, buf, len);
5083 void InfoManager::remoteinput_send_surrounding_text (const char* text, uint32 cursor)
5085 return m_impl->send_remote_surrounding_text (text, cursor);
5088 //ISM_TRANS_CMD_REGISTER_PANEL_CLIENT
5089 void InfoManager::register_panel_client (uint32 client_id, uint32 id)
5091 m_impl->register_panel_client (client_id, id);
5094 //SCIM_TRANS_CMD_PANEL_REGISTER_INPUT_CONTEXT
5095 void InfoManager::register_input_context (uint32 client_id, uint32 context, String uuid)
5097 m_impl->register_input_context (client_id, context, uuid);
5100 //SCIM_TRANS_CMD_PANEL_REMOVE_INPUT_CONTEXT
5101 void InfoManager::remove_input_context (uint32 client_id, uint32 context)
5103 m_impl->remove_input_context (client_id, context);
5106 //SCIM_TRANS_CMD_PANEL_RESET_INPUT_CONTEXT
5107 void InfoManager::socket_reset_input_context (int client_id, uint32 context)
5109 m_impl->socket_reset_input_context (client_id, context);
5112 //SCIM_TRANS_CMD_FOCUS_IN
5113 void InfoManager::focus_in (int client_id, uint32 context, String uuid)
5115 m_impl->focus_in (client_id, context, uuid);
5118 //SCIM_TRANS_CMD_FOCUS_OUT
5119 void InfoManager::focus_out (int client_id, uint32 context)
5121 m_impl->focus_out (client_id, context);
5124 //ISM_TRANS_CMD_PROCESS_INPUT_DEVICE_EVENT
5125 bool InfoManager::process_input_device_event(int client, uint32 type, const char *data, size_t len, _OUT_ uint32& result)
5127 return m_impl->process_input_device_event(client, type, data, len, result);
5130 //ISM_TRANS_CMD_TURN_ON_LOG
5131 void InfoManager::socket_turn_on_log (uint32 isOn)
5133 m_impl->socket_turn_on_log (isOn);
5136 //SCIM_TRANS_CMD_PANEL_TURN_ON
5137 void InfoManager::socket_turn_on (void)
5139 m_impl->socket_turn_on ();
5142 //SCIM_TRANS_CMD_PANEL_TURN_OFF
5143 void InfoManager::socket_turn_off (void)
5145 m_impl->socket_turn_off ();
5148 //SCIM_TRANS_CMD_UPDATE_SCREEN
5149 void InfoManager::socket_update_screen (int client_id, uint32 num)
5151 m_impl->socket_update_screen (client_id, num);
5154 //SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
5155 void InfoManager::socket_update_spot_location (uint32 x, uint32 y, uint32 top_y)
5157 m_impl->socket_update_spot_location (x, y, top_y);
5160 //ISM_TRANS_CMD_UPDATE_CURSOR_POSITION
5161 void InfoManager::socket_update_cursor_position (uint32 cursor_pos)
5163 m_impl->socket_update_cursor_position (cursor_pos);
5166 //ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT
5167 void InfoManager::socket_update_surrounding_text (String text, uint32 cursor)
5169 m_impl->socket_update_surrounding_text (text, cursor);
5172 void InfoManager::remoteinput_callback_focus_in (void)
5174 m_impl->remoteinput_callback_focus_in ();
5177 void InfoManager::remoteinput_callback_focus_out (void)
5179 m_impl->remoteinput_callback_focus_out ();
5182 void InfoManager::remoteinput_callback_entry_metadata (uint32 hint, uint32 layout, int variation, uint32 autocapital_type, int return_key_disabled, uint32 return_key_type)
5184 m_impl->remoteinput_callback_entry_metadata (hint, layout, variation, autocapital_type, return_key_disabled, return_key_type);
5187 void InfoManager::remoteinput_callback_surrounding_text (String text, uint32 cursor)
5189 m_impl->remoteinput_callback_surrounding_text (text, cursor);
5192 void InfoManager::remoteinput_callback_input_resource (uint32 input_resource)
5194 m_impl->remoteinput_callback_input_resource (input_resource);
5197 //ISM_TRANS_CMD_UPDATE_SELECTION
5198 void InfoManager::socket_update_selection (String text)
5200 m_impl->socket_update_selection (text);
5203 //FIXME: useless anymore
5204 //SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO
5205 void InfoManager::socket_update_factory_info (PanelFactoryInfo& info)
5207 m_impl->socket_update_factory_info (info);
5210 //SCIM_TRANS_CMD_PANEL_SHOW_HELP
5211 void InfoManager::socket_show_help (String help)
5213 m_impl->socket_show_help (help);
5216 //SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU
5217 void InfoManager::socket_show_factory_menu (std::vector <PanelFactoryInfo>& vec)
5219 m_impl->socket_show_factory_menu (vec);
5222 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
5223 void InfoManager::socket_show_preedit_string (void)
5225 m_impl->socket_show_preedit_string ();
5228 //SCIM_TRANS_CMD_SHOW_AUX_STRING
5229 void InfoManager::socket_show_aux_string (void)
5231 m_impl->socket_show_aux_string ();
5234 //SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE
5235 void InfoManager::socket_show_lookup_table (void)
5237 m_impl->socket_show_lookup_table ();
5240 //ISM_TRANS_CMD_SHOW_ASSOCIATE_TABLE
5241 void InfoManager::socket_show_associate_table (void)
5243 m_impl->socket_show_associate_table ();
5246 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
5247 void InfoManager::socket_hide_preedit_string (void)
5249 m_impl->socket_hide_preedit_string ();
5252 //SCIM_TRANS_CMD_HIDE_AUX_STRING
5253 void InfoManager::socket_hide_aux_string (void)
5255 m_impl->socket_hide_aux_string ();
5258 //SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE
5259 void InfoManager::socket_hide_lookup_table (void)
5261 m_impl->socket_hide_lookup_table ();
5264 //ISM_TRANS_CMD_HIDE_ASSOCIATE_TABLE
5265 void InfoManager::socket_hide_associate_table (void)
5267 m_impl->socket_hide_associate_table ();
5270 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
5271 void InfoManager::socket_update_preedit_string (String& str, const AttributeList& attrs, uint32 caret)
5273 m_impl->socket_update_preedit_string (str, attrs, caret);
5276 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
5277 void InfoManager::socket_update_preedit_caret (uint32 caret)
5279 m_impl->socket_update_preedit_caret (caret);
5282 //ISM_TRANS_CMD_RECAPTURE_STRING
5283 void InfoManager::socket_recapture_string (int offset, int len, String& preedit, String& commit, const AttributeList& attrs)
5285 m_impl->socket_recapture_string (offset, len, preedit, commit, attrs);
5288 //SCIM_TRANS_CMD_UPDATE_AUX_STRING
5289 void InfoManager::socket_update_aux_string (String& str, const AttributeList& attrs)
5291 m_impl->socket_update_aux_string (str, attrs);
5294 //SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE
5295 void InfoManager::socket_update_lookup_table (const LookupTable& table)
5297 m_impl->socket_update_lookup_table (table);
5300 //ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE
5301 void InfoManager::socket_update_associate_table (const LookupTable& table)
5303 m_impl->socket_update_associate_table (table);
5306 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
5307 void InfoManager::socket_register_properties (const PropertyList& properties)
5309 m_impl->socket_register_properties (properties);
5312 //SCIM_TRANS_CMD_UPDATE_PROPERTY
5313 void InfoManager::socket_update_property (const Property& property)
5315 m_impl->socket_update_property (property);
5318 //ISM_TRANS_CMD_GET_KEYBOARD_ISE_LIST
5319 void InfoManager::socket_get_keyboard_ise_list (String& uuid)
5321 m_impl->socket_get_keyboard_ise_list (uuid);
5324 //ISM_TRANS_CMD_SET_CANDIDATE_UI
5325 void InfoManager::socket_set_candidate_ui (uint32 portrait_line, uint32 mode)
5327 m_impl->socket_set_candidate_ui (portrait_line, mode);
5330 //ISM_TRANS_CMD_GET_CANDIDATE_UI
5331 void InfoManager::socket_get_candidate_ui (String uuid)
5333 m_impl->socket_get_candidate_ui (uuid);
5336 //ISM_TRANS_CMD_SET_CANDIDATE_POSITION
5337 void InfoManager::socket_set_candidate_position (uint32 left, uint32 top)
5339 m_impl->socket_set_candidate_position (left, top);
5342 //ISM_TRANS_CMD_HIDE_CANDIDATE
5343 void InfoManager::socket_hide_candidate (void)
5345 m_impl->socket_hide_candidate ();
5348 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
5349 void InfoManager::socket_get_candidate_geometry (String& uuid)
5351 m_impl->socket_get_candidate_geometry (uuid);
5354 //ISM_TRANS_CMD_SET_KEYBOARD_ISE_BY_UUID
5355 void InfoManager::socket_set_keyboard_ise (String uuid)
5357 m_impl->socket_set_keyboard_ise (uuid);
5360 //ISM_TRANS_CMD_SELECT_CANDIDATE
5361 void InfoManager::socket_helper_select_candidate (uint32 index)
5363 m_impl->socket_helper_select_candidate (index);
5366 //ISM_TRANS_CMD_UPDATE_ISE_GEOMETRY
5367 void InfoManager::socket_helper_update_ise_geometry (int client, uint32 x, uint32 y, uint32 width, uint32 height)
5369 m_impl->socket_helper_update_ise_geometry (client, x, y, width, height);
5372 //ISM_TRANS_CMD_GET_KEYBOARD_ISE
5373 void InfoManager::socket_get_keyboard_ise (String uuid)
5375 m_impl->socket_get_keyboard_ise (uuid);
5378 //SCIM_TRANS_CMD_START_HELPER
5379 void InfoManager::socket_start_helper (int client_id, uint32 context, String uuid)
5381 m_impl->socket_start_helper (client_id, context, uuid);
5384 //SCIM_TRANS_CMD_STOP_HELPER
5385 void InfoManager::socket_stop_helper (int client_id, uint32 context, String uuid)
5387 m_impl->socket_stop_helper (client_id, context, uuid);
5390 //SCIM_TRANS_CMD_SEND_HELPER_EVENT
5391 void InfoManager::socket_send_helper_event (int client_id, uint32 context, String uuid, const Transaction& _nest_trans)
5393 m_impl->socket_send_helper_event (client_id, context, uuid, _nest_trans);
5396 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
5397 void InfoManager::socket_helper_register_properties (int client, PropertyList& properties)
5399 m_impl->socket_helper_register_properties (client, properties);
5402 //SCIM_TRANS_CMD_UPDATE_PROPERTY
5403 void InfoManager::socket_helper_update_property (int client, Property& property)
5405 m_impl->socket_helper_update_property (client, property);
5408 //SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT
5409 void InfoManager::socket_helper_send_imengine_event (int client, uint32 target_ic, String target_uuid , Transaction& nest_trans)
5411 m_impl->socket_helper_send_imengine_event (client, target_ic, target_uuid, nest_trans);
5414 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
5415 //SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT
5416 void InfoManager::socket_helper_send_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key)
5418 m_impl->socket_helper_send_key_event (client, target_ic, target_uuid, key);
5421 //SCIM_TRANS_CMD_FORWARD_KEY_EVENT
5422 void InfoManager::socket_helper_forward_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key)
5424 m_impl->socket_helper_forward_key_event (client, target_ic, target_uuid, key);
5427 //SCIM_TRANS_CMD_COMMIT_STRING
5428 void InfoManager::socket_helper_commit_string (int client, uint32 target_ic, String target_uuid, WideString wstr)
5430 m_impl->socket_helper_commit_string (client, target_ic, target_uuid, wstr);
5433 //SCIM_TRANS_CMD_GET_SURROUNDING_TEXT
5434 void InfoManager::socket_helper_get_surrounding_text (int client, String uuid, uint32 maxlen_before, uint32 maxlen_after)
5436 m_impl->socket_helper_get_surrounding_text (client, uuid, maxlen_before, maxlen_after);
5439 //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT
5440 void InfoManager::socket_helper_delete_surrounding_text (int client, uint32 offset, uint32 len)
5442 m_impl->socket_helper_delete_surrounding_text (client, offset, len);
5445 //SCIM_TRANS_CMD_GET_SELECTION
5446 void InfoManager::socket_helper_get_selection (int client, String uuid)
5448 m_impl->socket_helper_get_selection (client, uuid);
5451 //SCIM_TRANS_CMD_SET_SELECTION
5452 void InfoManager::socket_helper_set_selection (int client, uint32 start, uint32 end)
5454 m_impl->socket_helper_set_selection (client, start, end);
5457 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
5458 void InfoManager::socket_helper_show_preedit_string (int client, uint32 target_ic, String target_uuid)
5460 m_impl->socket_helper_show_preedit_string (client, target_ic, target_uuid);
5463 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
5464 void InfoManager::socket_helper_hide_preedit_string (int client, uint32 target_ic, String target_uuid)
5466 m_impl->socket_helper_hide_preedit_string (client, target_ic, target_uuid);
5469 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
5470 void InfoManager::socket_helper_update_preedit_string (int client, uint32 target_ic, String target_uuid, WideString preedit,
5471 WideString commit, AttributeList& attrs, uint32 caret)
5473 m_impl->socket_helper_update_preedit_string (client, target_ic, target_uuid, preedit, commit, attrs, caret);
5476 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
5477 void InfoManager::socket_helper_update_preedit_caret (int client, uint32 caret)
5479 m_impl->socket_helper_update_preedit_caret (client, caret);
5482 //ISM_TRANS_CMD_RECAPTURE_STRING
5483 void InfoManager::socket_helper_recapture_string (int client, uint32 target_ic, String target_uuid, int offset, int len, WideString preedit,
5484 WideString commit, AttributeList& attrs)
5486 m_impl->socket_helper_recapture_string (client, target_ic, target_uuid, offset, len, preedit, commit, attrs);
5489 //SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
5490 void InfoManager::socket_helper_register_helper (int client, HelperInfo& info)
5492 m_impl->socket_helper_register_helper (client, info);
5495 //SCIM_TRANS_CMD_PANEL_REGISTER_ACTIVE_HELPER
5496 void InfoManager::socket_helper_register_helper_passive (int client, HelperInfo& info)
5498 m_impl->socket_helper_register_helper_passive (client, info);
5501 //ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
5502 void InfoManager::socket_helper_update_input_context (int client, uint32 type, uint32 value)
5504 m_impl->socket_helper_update_input_context (client, type, value);
5507 //ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE
5508 void InfoManager::socket_helper_update_language_locale(int client, String locale)
5510 m_impl->socket_helper_update_language_locale(client, locale);
5513 //SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
5514 void InfoManager::socket_helper_send_private_command (int client, String command)
5516 m_impl->socket_helper_send_private_command (client, command);
5519 //SCIM_TRANS_CMD_COMMIT_CONTENT
5520 void InfoManager::socket_helper_commit_content (int client, String content, String description, String mime_types)
5522 m_impl->socket_helper_commit_content (client, content, description, mime_types);
5525 //ISM_TRANS_CMD_UPDATE_ISE_EXIT
5526 void InfoManager::UPDATE_ISE_EXIT (int client)
5528 m_impl->UPDATE_ISE_EXIT (client);
5531 //ISM_TRANS_CMD_PROCESS_KEY_EVENT_DONE
5532 void InfoManager::process_key_event_done (KeyEvent &key, uint32 ret, uint32 serial)
5534 m_impl->process_key_event_done (key, ret, serial);
5537 //ISM_TRANS_CMD_REQUEST_ISE_HIDE
5538 void InfoManager::request_ise_hide ()
5540 m_impl->request_ise_hide ();
5543 bool InfoManager::check_privilege_by_sockfd (int client_id, const String& privilege) {
5544 return m_impl->check_privilege_by_sockfd (client_id, privilege);
5547 void InfoManager::add_client (int client_id, uint32 key, ClientType type)
5549 m_impl->add_client (client_id, key, type);
5552 void InfoManager::del_client (int client_id)
5554 m_impl->del_client (client_id);
5557 bool InfoManager::set_autocapital_type (int mode)
5559 return m_impl->set_autocapital_type (mode);
5562 void InfoManager::set_prediction_allow (int client, bool mode)
5564 m_impl->set_prediction_allow (client, mode);
5567 void InfoManager::reshow_input_panel ()
5569 m_impl->reshow_input_panel ();
5572 void InfoManager::request_ise_terminate ()
5574 m_impl->request_ise_terminate ();
5577 //////////////////////////////////Message function end/////////////////////////////////////////
5580 InfoManager::signal_connect_turn_on (InfoManagerSlotVoid* slot)
5582 return m_impl->signal_connect_turn_on (slot);
5586 InfoManager::signal_connect_turn_off (InfoManagerSlotVoid* slot)
5588 return m_impl->signal_connect_turn_off (slot);
5592 InfoManager::signal_connect_show_panel (InfoManagerSlotVoid* slot)
5594 return m_impl->signal_connect_show_panel (slot);
5598 InfoManager::signal_connect_hide_panel (InfoManagerSlotVoid* slot)
5600 return m_impl->signal_connect_hide_panel (slot);
5604 InfoManager::signal_connect_update_screen (InfoManagerSlotInt* slot)
5606 return m_impl->signal_connect_update_screen (slot);
5610 InfoManager::signal_connect_update_spot_location (InfoManagerSlotIntIntInt* slot)
5612 return m_impl->signal_connect_update_spot_location (slot);
5616 InfoManager::signal_connect_update_factory_info (InfoManagerSlotFactoryInfo* slot)
5618 return m_impl->signal_connect_update_factory_info (slot);
5622 InfoManager::signal_connect_start_default_ise (InfoManagerSlotVoid* slot)
5624 return m_impl->signal_connect_start_default_ise (slot);
5628 InfoManager::signal_connect_stop_default_ise (InfoManagerSlotBool* slot)
5630 return m_impl->signal_connect_stop_default_ise (slot);
5634 InfoManager::signal_connect_set_candidate_ui (InfoManagerSlotIntInt* slot)
5636 return m_impl->signal_connect_set_candidate_ui (slot);
5640 InfoManager::signal_connect_get_candidate_ui (InfoManagerSlotIntInt2* slot)
5642 return m_impl->signal_connect_get_candidate_ui (slot);
5646 InfoManager::signal_connect_set_candidate_position (InfoManagerSlotIntInt* slot)
5648 return m_impl->signal_connect_set_candidate_position (slot);
5652 InfoManager::signal_connect_get_candidate_geometry (InfoManagerSlotRect* slot)
5654 return m_impl->signal_connect_get_candidate_geometry (slot);
5658 InfoManager::signal_connect_get_input_panel_geometry (InfoManagerSlotRect* slot)
5660 return m_impl->signal_connect_get_input_panel_geometry (slot);
5664 InfoManager::signal_connect_set_keyboard_ise (InfoManagerSlotString* slot)
5666 return m_impl->signal_connect_set_keyboard_ise (slot);
5670 InfoManager::signal_connect_get_keyboard_ise (InfoManagerSlotString2* slot)
5672 return m_impl->signal_connect_get_keyboard_ise (slot);
5676 InfoManager::signal_connect_show_help (InfoManagerSlotString* slot)
5678 return m_impl->signal_connect_show_help (slot);
5682 InfoManager::signal_connect_show_factory_menu (InfoManagerSlotFactoryInfoVector* slot)
5684 return m_impl->signal_connect_show_factory_menu (slot);
5688 InfoManager::signal_connect_show_preedit_string (InfoManagerSlotVoid* slot)
5690 return m_impl->signal_connect_show_preedit_string (slot);
5694 InfoManager::signal_connect_show_aux_string (InfoManagerSlotVoid* slot)
5696 return m_impl->signal_connect_show_aux_string (slot);
5700 InfoManager::signal_connect_show_lookup_table (InfoManagerSlotVoid* slot)
5702 return m_impl->signal_connect_show_lookup_table (slot);
5706 InfoManager::signal_connect_show_associate_table (InfoManagerSlotVoid* slot)
5708 return m_impl->signal_connect_show_associate_table (slot);
5712 InfoManager::signal_connect_hide_preedit_string (InfoManagerSlotVoid* slot)
5714 return m_impl->signal_connect_hide_preedit_string (slot);
5718 InfoManager::signal_connect_hide_aux_string (InfoManagerSlotVoid* slot)
5720 return m_impl->signal_connect_hide_aux_string (slot);
5724 InfoManager::signal_connect_hide_lookup_table (InfoManagerSlotVoid* slot)
5726 return m_impl->signal_connect_hide_lookup_table (slot);
5730 InfoManager::signal_connect_hide_associate_table (InfoManagerSlotVoid* slot)
5732 return m_impl->signal_connect_hide_associate_table (slot);
5736 InfoManager::signal_connect_update_preedit_string (InfoManagerSlotAttributeStringInt* slot)
5738 return m_impl->signal_connect_update_preedit_string (slot);
5742 InfoManager::signal_connect_update_preedit_caret (InfoManagerSlotInt* slot)
5744 return m_impl->signal_connect_update_preedit_caret (slot);
5748 InfoManager::signal_connect_update_aux_string (InfoManagerSlotAttributeString* slot)
5750 return m_impl->signal_connect_update_aux_string (slot);
5754 InfoManager::signal_connect_update_lookup_table (InfoManagerSlotLookupTable* slot)
5756 return m_impl->signal_connect_update_lookup_table (slot);
5760 InfoManager::signal_connect_update_associate_table (InfoManagerSlotLookupTable* slot)
5762 return m_impl->signal_connect_update_associate_table (slot);
5766 InfoManager::signal_connect_register_properties (InfoManagerSlotPropertyList* slot)
5768 return m_impl->signal_connect_register_properties (slot);
5772 InfoManager::signal_connect_update_property (InfoManagerSlotProperty* slot)
5774 return m_impl->signal_connect_update_property (slot);
5778 InfoManager::signal_connect_register_helper_properties (InfoManagerSlotIntPropertyList* slot)
5780 return m_impl->signal_connect_register_helper_properties (slot);
5784 InfoManager::signal_connect_update_helper_property (InfoManagerSlotIntProperty* slot)
5786 return m_impl->signal_connect_update_helper_property (slot);
5790 InfoManager::signal_connect_register_helper (InfoManagerSlotIntHelperInfo* slot)
5792 return m_impl->signal_connect_register_helper (slot);
5796 InfoManager::signal_connect_remove_helper (InfoManagerSlotInt* slot)
5798 return m_impl->signal_connect_remove_helper (slot);
5802 InfoManager::signal_connect_set_active_ise_by_uuid (InfoManagerSlotStringBool* slot)
5804 return m_impl->signal_connect_set_active_ise_by_uuid (slot);
5808 InfoManager::signal_connect_focus_in (InfoManagerSlotVoid* slot)
5810 return m_impl->signal_connect_focus_in (slot);
5814 InfoManager::signal_connect_focus_out (InfoManagerSlotVoid* slot)
5816 return m_impl->signal_connect_focus_out (slot);
5820 InfoManager::signal_connect_expand_candidate (InfoManagerSlotVoid* slot)
5822 return m_impl->signal_connect_expand_candidate (slot);
5826 InfoManager::signal_connect_contract_candidate (InfoManagerSlotVoid* slot)
5828 return m_impl->signal_connect_contract_candidate (slot);
5832 InfoManager::signal_connect_select_candidate (InfoManagerSlotInt* slot)
5834 return m_impl->signal_connect_select_candidate (slot);
5838 InfoManager::signal_connect_get_ise_list (InfoManagerSlotBoolStringVector* slot)
5840 return m_impl->signal_connect_get_ise_list (slot);
5844 InfoManager::signal_connect_get_all_helper_ise_info (InfoManagerSlotBoolHelperInfo* slot)
5846 return m_impl->signal_connect_get_all_helper_ise_info (slot);
5850 InfoManager::signal_connect_set_has_option_helper_ise_info (InfoManagerSlotStringBool* slot)
5852 return m_impl->signal_connect_set_has_option_helper_ise_info (slot);
5856 InfoManager::signal_connect_set_enable_helper_ise_info (InfoManagerSlotStringBool* slot)
5858 return m_impl->signal_connect_set_enable_helper_ise_info (slot);
5862 InfoManager::signal_connect_show_helper_ise_list (InfoManagerSlotVoid* slot)
5864 return m_impl->signal_connect_show_helper_ise_list (slot);
5868 InfoManager::signal_connect_show_helper_ise_selector (InfoManagerSlotVoid* slot)
5870 return m_impl->signal_connect_show_helper_ise_selector (slot);
5874 InfoManager::signal_connect_is_helper_ise_enabled (InfoManagerSlotStringInt* slot)
5876 return m_impl->signal_connect_is_helper_ise_enabled (slot);
5880 InfoManager::signal_connect_get_ise_information (InfoManagerSlotBoolString4int2* slot)
5882 return m_impl->signal_connect_get_ise_information (slot);
5886 InfoManager::signal_connect_get_keyboard_ise_list (InfoManagerSlotBoolStringVector* slot)
5888 return m_impl->signal_connect_get_keyboard_ise_list (slot);
5892 InfoManager::signal_connect_update_ise_geometry (InfoManagerSlotIntIntIntInt* slot)
5894 return m_impl->signal_connect_update_ise_geometry (slot);
5898 InfoManager::signal_connect_get_language_list (InfoManagerSlotStringVector* slot)
5900 return m_impl->signal_connect_get_language_list (slot);
5904 InfoManager::signal_connect_get_all_language (InfoManagerSlotStringVector* slot)
5906 return m_impl->signal_connect_get_all_language (slot);
5910 InfoManager::signal_connect_get_ise_language (InfoManagerSlotStrStringVector* slot)
5912 return m_impl->signal_connect_get_ise_language (slot);
5916 InfoManager::signal_connect_get_ise_info_by_uuid (InfoManagerSlotStringISEINFO* slot)
5918 return m_impl->signal_connect_get_ise_info_by_uuid (slot);
5922 InfoManager::signal_connect_send_key_event (InfoManagerSlotKeyEvent* slot)
5924 return m_impl->signal_connect_send_key_event (slot);
5928 InfoManager::signal_connect_accept_connection (InfoManagerSlotInt* slot)
5930 return m_impl->signal_connect_accept_connection (slot);
5934 InfoManager::signal_connect_close_connection (InfoManagerSlotInt* slot)
5936 return m_impl->signal_connect_close_connection (slot);
5940 InfoManager::signal_connect_exit (InfoManagerSlotVoid* slot)
5942 return m_impl->signal_connect_exit (slot);
5946 InfoManager::signal_connect_transaction_start (InfoManagerSlotVoid* slot)
5948 return m_impl->signal_connect_transaction_start (slot);
5952 InfoManager::signal_connect_transaction_end (InfoManagerSlotVoid* slot)
5954 return m_impl->signal_connect_transaction_end (slot);
5958 InfoManager::signal_connect_lock (InfoManagerSlotVoid* slot)
5960 return m_impl->signal_connect_lock (slot);
5964 InfoManager::signal_connect_unlock (InfoManagerSlotVoid* slot)
5966 return m_impl->signal_connect_unlock (slot);
5970 InfoManager::signal_connect_update_input_context (InfoManagerSlotIntInt* slot)
5972 return m_impl->signal_connect_update_input_context (slot);
5976 InfoManager::signal_connect_show_ise (InfoManagerSlotVoid* slot)
5978 return m_impl->signal_connect_show_ise (slot);
5982 InfoManager::signal_connect_hide_ise (InfoManagerSlotVoid* slot)
5984 return m_impl->signal_connect_hide_ise (slot);
5988 InfoManager::signal_connect_will_show_ack (InfoManagerSlotVoid* slot)
5990 return m_impl->signal_connect_will_show_ack (slot);
5994 InfoManager::signal_connect_will_hide_ack (InfoManagerSlotVoid* slot)
5996 return m_impl->signal_connect_will_hide_ack (slot);
6000 InfoManager::signal_connect_set_keyboard_mode (InfoManagerSlotInt* slot)
6002 return m_impl->signal_connect_set_keyboard_mode (slot);
6006 InfoManager::signal_connect_candidate_will_hide_ack (InfoManagerSlotVoid* slot)
6008 return m_impl->signal_connect_candidate_will_hide_ack (slot);
6012 InfoManager::signal_connect_get_ise_state (InfoManagerSlotInt2* slot)
6014 return m_impl->signal_connect_get_ise_state (slot);
6018 InfoManager::signal_connect_run_helper (InfoManagerSlotString3* slot)
6020 return m_impl->signal_connect_run_helper (slot);
6024 InfoManager::signal_connect_launch_option_application (InfoManagerSlotBoolString* slot)
6026 return m_impl->signal_connect_launch_option_application (slot);
6030 InfoManager::signal_connect_get_ise_setting_appid (InfoManagerSlotBoolString2* slot)
6032 return m_impl->signal_connect_get_ise_setting_appid (slot);
6036 InfoManager::signal_connect_get_recent_ise_geometry (InfoManagerSlotIntRect* slot)
6038 return m_impl->signal_connect_get_recent_ise_geometry (slot);
6042 InfoManager::signal_connect_check_privilege_by_sockfd (InfoManagerSlotIntString2* slot)
6044 return m_impl->signal_connect_check_privilege_by_sockfd (slot);
6048 InfoManager::signal_connect_remoteinput_send_input_message (InfoManagerSlotStringBool* slot)
6050 return m_impl->signal_connect_remoteinput_send_input_message (slot);
6054 InfoManager::signal_connect_remoteinput_send_surrounding_text (InfoManagerSlotIntString* slot)
6056 return m_impl->signal_connect_remoteinput_send_surrounding_text (slot);
6059 } /* namespace scim */
6062 vi:ts=4:nowrap:ai:expandtab