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 void set_floating_mode (uint32 floating_mode) {
2340 uint32 focused_context;
2341 get_focused_context (focused_client, focused_context);
2342 ClientInfo client_info = socket_get_client_info (focused_client);
2344 if (client_info.type == FRONTEND_CLIENT) {
2345 m_panel_agent_manager.set_floating_mode (focused_client, focused_context, floating_mode);
2349 void set_floating_drag_enabled (uint32 enabled) {
2351 uint32 focused_context;
2352 get_focused_context (focused_client, focused_context);
2353 ClientInfo client_info = socket_get_client_info (focused_client);
2355 if (client_info.type == FRONTEND_CLIENT) {
2356 m_panel_agent_manager.set_floating_drag_enabled (focused_client, focused_context, enabled);
2360 Connection signal_connect_turn_on (InfoManagerSlotVoid* slot) {
2361 return m_signal_turn_on.connect (slot);
2364 Connection signal_connect_turn_off (InfoManagerSlotVoid* slot) {
2365 return m_signal_turn_off.connect (slot);
2368 Connection signal_connect_show_panel (InfoManagerSlotVoid* slot) {
2369 return m_signal_show_panel.connect (slot);
2372 Connection signal_connect_hide_panel (InfoManagerSlotVoid* slot) {
2373 return m_signal_hide_panel.connect (slot);
2376 Connection signal_connect_update_screen (InfoManagerSlotInt* slot) {
2377 return m_signal_update_screen.connect (slot);
2380 Connection signal_connect_update_spot_location (InfoManagerSlotIntIntInt* slot) {
2381 return m_signal_update_spot_location.connect (slot);
2384 Connection signal_connect_update_factory_info (InfoManagerSlotFactoryInfo* slot) {
2385 return m_signal_update_factory_info.connect (slot);
2388 Connection signal_connect_start_default_ise (InfoManagerSlotVoid* slot) {
2389 return m_signal_start_default_ise.connect (slot);
2392 Connection signal_connect_stop_default_ise (InfoManagerSlotBool* slot) {
2393 return m_signal_stop_default_ise.connect (slot);
2396 Connection signal_connect_set_candidate_ui (InfoManagerSlotIntInt* slot) {
2397 return m_signal_set_candidate_ui.connect (slot);
2400 Connection signal_connect_get_candidate_ui (InfoManagerSlotIntInt2* slot) {
2401 return m_signal_get_candidate_ui.connect (slot);
2404 Connection signal_connect_set_candidate_position (InfoManagerSlotIntInt* slot) {
2405 return m_signal_set_candidate_position.connect (slot);
2408 Connection signal_connect_get_candidate_geometry (InfoManagerSlotRect* slot) {
2409 return m_signal_get_candidate_geometry.connect (slot);
2412 Connection signal_connect_get_input_panel_geometry (InfoManagerSlotRect* slot) {
2413 return m_signal_get_input_panel_geometry.connect (slot);
2416 Connection signal_connect_set_keyboard_ise (InfoManagerSlotString* slot) {
2417 return m_signal_set_keyboard_ise.connect (slot);
2420 Connection signal_connect_get_keyboard_ise (InfoManagerSlotString2* slot) {
2421 return m_signal_get_keyboard_ise.connect (slot);
2424 Connection signal_connect_show_help (InfoManagerSlotString* slot) {
2425 return m_signal_show_help.connect (slot);
2428 Connection signal_connect_show_factory_menu (InfoManagerSlotFactoryInfoVector* slot) {
2429 return m_signal_show_factory_menu.connect (slot);
2432 Connection signal_connect_show_preedit_string (InfoManagerSlotVoid* slot) {
2433 return m_signal_show_preedit_string.connect (slot);
2436 Connection signal_connect_show_aux_string (InfoManagerSlotVoid* slot) {
2437 return m_signal_show_aux_string.connect (slot);
2440 Connection signal_connect_show_lookup_table (InfoManagerSlotVoid* slot) {
2441 return m_signal_show_lookup_table.connect (slot);
2444 Connection signal_connect_show_associate_table (InfoManagerSlotVoid* slot) {
2445 return m_signal_show_associate_table.connect (slot);
2448 Connection signal_connect_hide_preedit_string (InfoManagerSlotVoid* slot) {
2449 return m_signal_hide_preedit_string.connect (slot);
2452 Connection signal_connect_hide_aux_string (InfoManagerSlotVoid* slot) {
2453 return m_signal_hide_aux_string.connect (slot);
2456 Connection signal_connect_hide_lookup_table (InfoManagerSlotVoid* slot) {
2457 return m_signal_hide_lookup_table.connect (slot);
2460 Connection signal_connect_hide_associate_table (InfoManagerSlotVoid* slot) {
2461 return m_signal_hide_associate_table.connect (slot);
2464 Connection signal_connect_update_preedit_string (InfoManagerSlotAttributeStringInt* slot) {
2465 return m_signal_update_preedit_string.connect (slot);
2468 Connection signal_connect_update_preedit_caret (InfoManagerSlotInt* slot) {
2469 return m_signal_update_preedit_caret.connect (slot);
2472 Connection signal_connect_recapture_string (InfoManagerSlotAttributeInt2String2* slot) {
2473 return m_signal_recapture_string.connect (slot);
2476 Connection signal_connect_update_aux_string (InfoManagerSlotAttributeString* slot) {
2477 return m_signal_update_aux_string.connect (slot);
2480 Connection signal_connect_update_lookup_table (InfoManagerSlotLookupTable* slot) {
2481 return m_signal_update_lookup_table.connect (slot);
2484 Connection signal_connect_update_associate_table (InfoManagerSlotLookupTable* slot) {
2485 return m_signal_update_associate_table.connect (slot);
2488 Connection signal_connect_register_properties (InfoManagerSlotPropertyList* slot) {
2489 return m_signal_register_properties.connect (slot);
2492 Connection signal_connect_update_property (InfoManagerSlotProperty* slot) {
2493 return m_signal_update_property.connect (slot);
2496 Connection signal_connect_register_helper_properties (InfoManagerSlotIntPropertyList* slot) {
2497 return m_signal_register_helper_properties.connect (slot);
2500 Connection signal_connect_update_helper_property (InfoManagerSlotIntProperty* slot) {
2501 return m_signal_update_helper_property.connect (slot);
2504 Connection signal_connect_register_helper (InfoManagerSlotIntHelperInfo* slot) {
2505 return m_signal_register_helper.connect (slot);
2508 Connection signal_connect_remove_helper (InfoManagerSlotInt* slot) {
2509 return m_signal_remove_helper.connect (slot);
2512 Connection signal_connect_set_active_ise_by_uuid (InfoManagerSlotStringBool* slot) {
2513 return m_signal_set_active_ise_by_uuid.connect (slot);
2516 Connection signal_connect_focus_in (InfoManagerSlotVoid* slot) {
2517 return m_signal_focus_in.connect (slot);
2520 Connection signal_connect_focus_out (InfoManagerSlotVoid* slot) {
2521 return m_signal_focus_out.connect (slot);
2524 Connection signal_connect_expand_candidate (InfoManagerSlotVoid* slot) {
2525 return m_signal_expand_candidate.connect (slot);
2528 Connection signal_connect_contract_candidate (InfoManagerSlotVoid* slot) {
2529 return m_signal_contract_candidate.connect (slot);
2532 Connection signal_connect_select_candidate (InfoManagerSlotInt* slot) {
2533 return m_signal_select_candidate.connect (slot);
2536 Connection signal_connect_get_ise_list (InfoManagerSlotBoolStringVector* slot) {
2537 return m_signal_get_ise_list.connect (slot);
2540 Connection signal_connect_get_all_helper_ise_info (InfoManagerSlotBoolHelperInfo* slot) {
2541 return m_signal_get_all_helper_ise_info.connect (slot);
2544 Connection signal_connect_set_has_option_helper_ise_info (InfoManagerSlotStringBool* slot) {
2545 return m_signal_set_has_option_helper_ise_info.connect (slot);
2548 Connection signal_connect_set_enable_helper_ise_info (InfoManagerSlotStringBool* slot) {
2549 return m_signal_set_enable_helper_ise_info.connect (slot);
2552 Connection signal_connect_show_helper_ise_list (InfoManagerSlotVoid* slot) {
2553 return m_signal_show_helper_ise_list.connect (slot);
2556 Connection signal_connect_show_helper_ise_selector (InfoManagerSlotVoid* slot) {
2557 return m_signal_show_helper_ise_selector.connect (slot);
2560 Connection signal_connect_is_helper_ise_enabled (InfoManagerSlotStringInt* slot) {
2561 return m_signal_is_helper_ise_enabled.connect (slot);
2564 Connection signal_connect_get_ise_information (InfoManagerSlotBoolString4int2* slot) {
2565 return m_signal_get_ise_information.connect (slot);
2568 Connection signal_connect_get_keyboard_ise_list (InfoManagerSlotBoolStringVector* slot) {
2569 return m_signal_get_keyboard_ise_list.connect (slot);
2572 Connection signal_connect_update_ise_geometry (InfoManagerSlotIntIntIntInt* slot) {
2573 return m_signal_update_ise_geometry.connect (slot);
2576 Connection signal_connect_get_language_list (InfoManagerSlotStringVector* slot) {
2577 return m_signal_get_language_list.connect (slot);
2580 Connection signal_connect_get_all_language (InfoManagerSlotStringVector* slot) {
2581 return m_signal_get_all_language.connect (slot);
2584 Connection signal_connect_get_ise_language (InfoManagerSlotStrStringVector* slot) {
2585 return m_signal_get_ise_language.connect (slot);
2588 Connection signal_connect_get_ise_info_by_uuid (InfoManagerSlotStringISEINFO* slot) {
2589 return m_signal_get_ise_info_by_uuid.connect (slot);
2592 Connection signal_connect_send_key_event (InfoManagerSlotKeyEvent* slot) {
2593 return m_signal_send_key_event.connect (slot);
2596 Connection signal_connect_accept_connection (InfoManagerSlotInt* slot) {
2597 return m_signal_accept_connection.connect (slot);
2600 Connection signal_connect_close_connection (InfoManagerSlotInt* slot) {
2601 return m_signal_close_connection.connect (slot);
2604 Connection signal_connect_exit (InfoManagerSlotVoid* slot) {
2605 return m_signal_exit.connect (slot);
2608 Connection signal_connect_transaction_start (InfoManagerSlotVoid* slot) {
2609 return m_signal_transaction_start.connect (slot);
2612 Connection signal_connect_transaction_end (InfoManagerSlotVoid* slot) {
2613 return m_signal_transaction_end.connect (slot);
2616 Connection signal_connect_lock (InfoManagerSlotVoid* slot) {
2617 return m_signal_lock.connect (slot);
2620 Connection signal_connect_unlock (InfoManagerSlotVoid* slot) {
2621 return m_signal_unlock.connect (slot);
2624 Connection signal_connect_update_input_context (InfoManagerSlotIntInt* slot) {
2625 return m_signal_update_input_context.connect (slot);
2628 Connection signal_connect_update_language_locale(InfoManagerSlotString* slot) {
2629 return m_signal_update_language_locale.connect(slot);
2632 Connection signal_connect_show_ise (InfoManagerSlotVoid* slot) {
2633 return m_signal_show_ise.connect (slot);
2636 Connection signal_connect_hide_ise (InfoManagerSlotVoid* slot) {
2637 return m_signal_hide_ise.connect (slot);
2640 Connection signal_connect_will_show_ack (InfoManagerSlotVoid* slot) {
2641 return m_signal_will_show_ack.connect (slot);
2644 Connection signal_connect_will_hide_ack (InfoManagerSlotVoid* slot) {
2645 return m_signal_will_hide_ack.connect (slot);
2648 Connection signal_connect_set_keyboard_mode (InfoManagerSlotInt* slot) {
2649 return m_signal_set_keyboard_mode.connect (slot);
2652 Connection signal_connect_candidate_will_hide_ack (InfoManagerSlotVoid* slot) {
2653 return m_signal_candidate_will_hide_ack.connect (slot);
2656 Connection signal_connect_get_ise_state (InfoManagerSlotInt2* slot) {
2657 return m_signal_get_ise_state.connect (slot);
2660 Connection signal_connect_run_helper (InfoManagerSlotString3* slot)
2662 return m_signal_run_helper.connect (slot);
2665 Connection signal_connect_launch_option_application (InfoManagerSlotBoolString* slot)
2667 return m_signal_launch_option_application.connect (slot);
2670 Connection signal_connect_get_ise_setting_appid (InfoManagerSlotBoolString2* slot)
2672 return m_signal_get_ise_setting_appid.connect (slot);
2675 Connection signal_connect_get_recent_ise_geometry (InfoManagerSlotIntRect* slot) {
2676 return m_signal_get_recent_ise_geometry.connect (slot);
2679 Connection signal_connect_check_privilege_by_sockfd (InfoManagerSlotIntString2* slot)
2681 return m_signal_check_privilege_by_sockfd.connect (slot);
2684 Connection signal_connect_remoteinput_send_input_message (InfoManagerSlotStringBool* slot)
2686 return m_signal_remoteinput_send_input_message.connect (slot);
2689 Connection signal_connect_remoteinput_send_surrounding_text (InfoManagerSlotIntString* slot)
2691 return m_signal_remoteinput_send_surrounding_text.connect (slot);
2694 //ISM_TRANS_CMD_REGISTER_PANEL_CLIENT
2695 void register_panel_client (uint32 client_id, uint32 id) {
2696 m_panel_client_map [client_id] = (int)id;
2698 //SCIM_TRANS_CMD_PANEL_REGISTER_INPUT_CONTEXT
2699 void register_input_context (uint32 client_id, uint32 context, String uuid) {
2700 uint32 ctx = get_helper_ic (m_panel_client_map[client_id], context);
2701 m_client_context_uuids [ctx] = uuid;
2703 //SCIM_TRANS_CMD_PANEL_REMOVE_INPUT_CONTEXT
2704 void remove_input_context (uint32 client_id, uint32 context) {
2705 uint32 ctx = get_helper_ic (m_panel_client_map[client_id], context);
2706 m_client_context_uuids.erase (ctx);
2708 if (ctx == get_helper_ic (m_current_socket_client, m_current_client_context)) {
2710 m_current_socket_client = m_last_socket_client;
2711 m_current_client_context = m_last_client_context;
2712 m_current_context_uuid = m_last_context_uuid;
2713 m_last_socket_client = -1;
2714 m_last_client_context = 0;
2715 m_last_context_uuid = String ("");
2717 if (m_current_socket_client == -1) {
2719 socket_update_control_panel ();
2723 } else if (ctx == get_helper_ic (m_last_socket_client, m_last_client_context)) {
2725 m_last_socket_client = -1;
2726 m_last_client_context = 0;
2727 m_last_context_uuid = String ("");
2732 //SCIM_TRANS_CMD_PANEL_RESET_INPUT_CONTEXT
2733 void socket_reset_input_context (int client_id, uint32 context) {
2734 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_reset_input_context \n";
2736 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2737 socket_reset_helper_input_context (m_current_helper_uuid, m_panel_client_map[client_id], context);
2740 //SCIM_TRANS_CMD_FOCUS_IN
2741 void focus_in (int client_id, uint32 context, String uuid) {
2742 m_refocus_needed = true;
2743 bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false);
2744 if (launch_ise_on_request)
2745 m_signal_start_default_ise ();
2747 m_signal_focus_in ();
2748 focus_in_helper (m_current_helper_uuid, m_panel_client_map[client_id], context);
2749 SCIM_DEBUG_MAIN (2) << "PanelAgent::focus_in (" << client_id << "," << context << "," << uuid << ")\n";
2750 m_active_client_id = client_id;
2753 if (m_current_socket_client >= 0) {
2754 m_last_socket_client = m_current_socket_client;
2755 m_last_client_context = m_current_client_context;
2756 m_last_context_uuid = m_current_context_uuid;
2759 m_current_socket_client = m_panel_client_map[client_id];
2760 m_current_client_context = context;
2761 m_current_context_uuid = uuid;
2765 //SCIM_TRANS_CMD_FOCUS_OUT
2766 void focus_out (int client_id, uint32 context) {
2767 m_refocus_needed = false;
2768 m_signal_focus_out ();
2770 focus_out_helper (m_current_helper_uuid, m_panel_client_map[client_id], context);
2772 if (m_current_socket_client >= 0) {
2773 m_last_socket_client = m_current_socket_client;
2774 m_last_client_context = m_current_client_context;
2775 m_last_context_uuid = m_current_context_uuid;
2778 m_current_socket_client = -1;
2779 m_current_client_context = 0;
2780 m_current_context_uuid = String ("");
2784 //ISM_TRANS_CMD_TURN_ON_LOG
2785 void socket_turn_on_log (uint32 isOn) {
2787 DebugOutput::enable_debug (SCIM_DEBUG_AllMask);
2788 DebugOutput::set_verbose_level (7);
2789 SCIM_DEBUG_MAIN (4) << __func__ << " on\n";
2791 SCIM_DEBUG_MAIN (4) << __func__ << " off\n";
2792 DebugOutput::disable_debug (SCIM_DEBUG_AllMask);
2793 DebugOutput::set_verbose_level (0);
2797 uint32 focused_context;
2798 get_focused_context (focused_client, focused_context);
2800 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
2801 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
2803 if (it != m_helper_client_index.end ()) {
2804 //uint32 ctx = get_helper_ic (focused_client, focused_context);
2806 //m_panel_agent_manager.socket_turn_on_log (it->second.id, ctx, m_current_helper_uuid, isOn);
2810 if (focused_client == -1) {
2811 std::cerr << __func__ << " get_focused_context is failed!!!\n";
2815 ClientInfo client_info = socket_get_client_info (focused_client);
2817 if (client_info.type == FRONTEND_CLIENT) {
2819 //m_panel_agent_manager.socket_turn_on_log (focused_client, focused_context, isOn);
2824 void add_client (int client_id, uint32 key, ClientType type) {
2825 LOGD ("id:%d, key:%d, type:%d", client_id, key, type);
2829 SCIM_DEBUG_MAIN (4) << "Add client to repository. Type=" << type << " key=" << key << "\n";
2831 m_client_repository [client_id] = info;
2833 if (info.type == HELPER_CLIENT || info.type == HELPER_ACT_CLIENT)
2834 m_is_ise_alive = true;
2836 if (info.type == IMCONTROL_ACT_CLIENT) {
2837 m_pending_active_imcontrol_id = client_id;
2838 } else if (info.type == IMCONTROL_CLIENT) {
2839 m_imcontrol_map [m_pending_active_imcontrol_id] = client_id;
2840 m_pending_active_imcontrol_id = -1;
2841 } else if (info.type == REMOTEINPUT_ACT_CLIENT) {
2842 m_current_send_remoteinput_id.push_back (client_id);
2843 } else if (info.type == REMOTEINPUT_CLIENT) {
2844 m_current_recv_remoteinput_id.push_back (client_id);
2847 LOGD ("%zu clients connecting", m_client_repository.size());
2852 void del_client (int client_id) {
2853 ClientRepository::iterator iter = m_client_repository.find(client_id);
2854 if (iter == m_client_repository.end()) {
2855 LOGW("The client with id %d does not exist in our client repository, returning", client_id);
2859 m_signal_close_connection (client_id);
2860 ClientInfo client_info = socket_get_client_info (client_id);
2861 m_client_repository.erase (client_id);
2862 LOGD ("id:%d, type:%d", client_id, client_info.type);
2863 #ifdef PANEL_SERVER_AUTO_EXIT
2864 /* Exit panel if there is no connected client anymore. */
2865 if (client_info.type != UNKNOWN_CLIENT && m_client_repository.size () == 0 && !m_should_resident) {
2866 SCIM_DEBUG_MAIN (4) << "Exit Socket Server Thread.\n";
2867 server->shutdown ();
2868 m_signal_exit.emit ();
2873 if (client_info.type == FRONTEND_CLIENT) {
2874 SCIM_DEBUG_MAIN (4) << "It's a FrontEnd client.\n";
2876 /* The focused client is closed. */
2877 if (m_current_socket_client == client_id) {
2878 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2879 hide_helper (m_current_helper_uuid);
2882 m_current_socket_client = -1;
2883 m_current_client_context = 0;
2884 m_current_context_uuid = String ("");
2886 socket_transaction_start ();
2888 socket_transaction_end ();
2891 if (m_last_socket_client == client_id) {
2893 m_last_socket_client = -1;
2894 m_last_client_context = 0;
2895 m_last_context_uuid = String ("");
2899 /* Erase all associated Client Context UUIDs. */
2900 std::vector <uint32> ctx_list;
2901 ClientContextUUIDRepository::iterator it = m_client_context_uuids.begin ();
2903 for (; it != m_client_context_uuids.end (); ++it) {
2904 if ((it->first & 0xFFFF) == (client_id & 0xFFFF))
2905 ctx_list.push_back (it->first);
2908 for (size_t i = 0; i < ctx_list.size (); ++i)
2909 m_client_context_uuids.erase (ctx_list [i]);
2911 /* Erase all helperise info associated with the client */
2913 it = m_client_context_helper.begin ();
2915 for (; it != m_client_context_helper.end (); ++it) {
2916 if ((it->first & 0xFFFF) == (client_id & 0xFFFF)) {
2917 ctx_list.push_back (it->first);
2918 /* similar to stop_helper except that it will not call get_focused_context() */
2919 String uuid = it->second;
2921 if (m_helper_uuid_count.find (uuid) != m_helper_uuid_count.end ()) {
2922 uint32 count = m_helper_uuid_count[uuid];
2925 m_helper_uuid_count.erase (uuid);
2926 HelperClientIndex::iterator pise = m_helper_client_index.find (uuid);
2928 if (pise != m_helper_client_index.end ()) {
2929 stop_helper (uuid, pise->second.id, it->first);
2932 SCIM_DEBUG_MAIN (1) << "Stop HelperISE " << uuid << " ...\n";
2934 m_helper_uuid_count[uuid] = count - 1;
2935 focus_out_helper (uuid, (it->first & 0xFFFF), ((it->first >> 16) & 0x7FFF));
2936 SCIM_DEBUG_MAIN (1) << "Decrement usage count of HelperISE " << uuid
2937 << " to " << m_helper_uuid_count[uuid] << "\n";
2943 for (size_t i = 0; i < ctx_list.size (); ++i)
2944 m_client_context_helper.erase (ctx_list [i]);
2946 HelperInfoRepository::iterator iter = m_helper_info_repository.begin ();
2948 for (; iter != m_helper_info_repository.end (); iter++) {
2949 if (!m_current_helper_uuid.compare (iter->second.uuid))
2950 if (! (iter->second.option & ISM_ISE_HIDE_IN_CONTROL_PANEL))
2951 socket_update_control_panel ();
2953 } else if (client_info.type == FRONTEND_ACT_CLIENT) {
2954 SCIM_DEBUG_MAIN (4) << "It's a FRONTEND_ACT_CLIENT client.\n";
2955 IntIntRepository::iterator iter2 = m_panel_client_map.find (client_id);
2957 if (iter2 != m_panel_client_map.end ())
2958 m_panel_client_map.erase (iter2);
2959 } else if (client_info.type == HELPER_CLIENT) {
2960 SCIM_DEBUG_MAIN (4) << "It's a Helper client.\n";
2962 HelperInfoRepository::iterator hiit = m_helper_info_repository.find (client_id);
2964 bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false);
2965 if (hiit != m_helper_info_repository.end ()) {
2966 bool restart = false;
2967 String uuid = hiit->second.uuid;
2968 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
2970 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
2971 if ((hiit->second.option & SCIM_HELPER_AUTO_RESTART) &&
2972 (default_uuid.compare (uuid) == 0 || default_uuid.compare ("") == 0) &&
2973 (it != m_helper_client_index.end () && it->second.ref > 0)) {
2977 m_helper_client_index.erase (uuid);
2978 m_helper_info_repository.erase (hiit);
2980 m_signal_stop_default_ise (false);
2982 if (m_refocus_needed || m_reshow_needed || !launch_ise_on_request)
2983 m_restart_needed = true;
2985 if (restart && !m_ise_exiting && m_restart_needed) {
2986 struct tms tiks_buf;
2987 static clock_t start_tiks = times (&tiks_buf);
2988 static double clock_tiks = (double)sysconf (_SC_CLK_TCK);
2989 clock_t curr_tiks = times (&tiks_buf);
2990 double secs = (double) (curr_tiks - start_tiks) / clock_tiks;
2991 //LOGE ("time second:%f", secs);
2992 static String restart_uuid;
2994 if (restart_uuid != uuid || secs > MIN_REPEAT_TIME) {
2995 scim_usleep (100000);
2999 get_focused_context(client, context);
3001 uint32 ic = get_helper_ic (client, context);
3003 /* Get the context uuid from the client context registration table. */
3005 ClientContextUUIDRepository::iterator it =
3006 m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client], context));
3008 if (it != m_client_context_uuids.end ())
3009 ic_uuid = it->second;
3012 m_start_helper_ic_index[uuid].push_back(std::make_pair(ic, ic_uuid));
3013 m_signal_run_helper (uuid, m_config_name, m_display_name);
3014 restart_uuid = uuid;
3015 LOGE ("Auto restart soft ISE:%s", uuid.c_str ());
3017 reset_default_ise (0);
3018 ISF_SAVE_LOG ("Auto restart is abnormal, reset default ISE");
3021 start_tiks = curr_tiks;
3025 m_ise_exiting = false;
3026 m_restart_needed = launch_ise_on_request ? false : true;
3028 socket_transaction_start ();
3029 m_signal_remove_helper (client_id);
3030 socket_transaction_end ();
3031 } else if (client_info.type == HELPER_ACT_CLIENT) {
3032 SCIM_DEBUG_MAIN (4) << "It's a Helper passive client.\n";
3034 HelperInfoRepository::iterator hiit = m_helper_active_info_repository.find (client_id);
3036 if (hiit != m_helper_active_info_repository.end ()) {
3037 if (hiit->second.uuid == m_current_helper_uuid)
3038 m_is_ise_alive = false;
3040 m_helper_active_info_repository.erase (hiit);
3044 } else if (client_info.type == IMCONTROL_ACT_CLIENT) {
3045 SCIM_DEBUG_MAIN (4) << "It's a IMCONTROL_ACT_CLIENT client.\n";
3046 IMControlRepository::iterator iter = m_imcontrol_repository.find (client_id);
3048 if (iter != m_imcontrol_repository.end ()) {
3049 int size = iter->second.info.size ();
3053 stop_helper ((iter->second.info)[i].uuid, (iter->second.count)[i], DEFAULT_CONTEXT_VALUE);
3055 if ((iter->second.info)[i].option & ISM_ISE_HIDE_IN_CONTROL_PANEL)
3056 m_current_helper_uuid = m_last_helper_uuid;
3061 m_imcontrol_repository.erase (iter);
3064 IntIntRepository::iterator iter2 = m_imcontrol_map.find (client_id);
3066 if (iter2 != m_imcontrol_map.end ())
3067 m_imcontrol_map.erase (iter2);
3068 } else if (client_info.type == REMOTEINPUT_ACT_CLIENT) {
3069 SCIM_DEBUG_MAIN (4) << "It's a REMOTEINPUT_ACT_CLIENT client.\n";
3071 for (unsigned int i = 0; i < m_current_send_remoteinput_id.size (); i++) {
3072 if (m_current_send_remoteinput_id.at (i) == client_id) {
3073 m_current_send_remoteinput_id.erase (m_current_send_remoteinput_id.begin () + i);
3077 } else if (client_info.type == REMOTEINPUT_CLIENT) {
3078 SCIM_DEBUG_MAIN (4) << "It's a REMOTEINPUT_CLIENT client.\n";
3080 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3081 if (m_current_recv_remoteinput_id.at (i) == client_id) {
3082 m_current_recv_remoteinput_id.erase (m_current_recv_remoteinput_id.begin () + i);
3086 } else if (client_info.type == CONFIG_CLIENT) {
3087 SCIM_DEBUG_MAIN(4) << "It's a CONFIG_CLIENT client.\n";
3089 LOGI ("clients: %zu, panel clients: %zu, imcontrols size: %zu, helper infos: %zu, \
3090 helper active infos: %zu, helper client indexes: %zu, ises pending: %zu, \
3091 imcontrols: %zu, start helper ic indexes: %zu, client context uuids: %zu, \
3092 client context helpers: %zu, helpers uuid count: %zu",
3093 m_client_repository.size(),
3094 m_panel_client_map.size(),
3095 m_imcontrol_map.size(),
3096 m_helper_info_repository.size(),
3097 m_helper_active_info_repository.size(),
3098 m_helper_client_index.size(),
3099 m_ise_pending_repository.size(),
3100 m_imcontrol_repository.size(),
3101 m_start_helper_ic_index.size(),
3102 m_client_context_uuids.size(),
3103 m_client_context_helper.size(),
3104 m_helper_uuid_count.size());
3107 const ClientInfo& socket_get_client_info (int client) {
3108 static ClientInfo null_client = { 0, UNKNOWN_CLIENT };
3109 ClientRepository::iterator it = m_client_repository.find (client);
3111 if (it != m_client_repository.end ())
3117 //SCIM_TRANS_CMD_PANEL_TURN_ON
3118 void socket_turn_on (void) {
3119 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_turn_on ()\n";
3120 m_signal_turn_on ();
3122 //SCIM_TRANS_CMD_PANEL_TURN_OFF
3123 void socket_turn_off (void) {
3124 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_turn_off ()\n";
3125 m_signal_turn_off ();
3127 //SCIM_TRANS_CMD_UPDATE_SCREEN
3128 void socket_update_screen (int client_id, uint32 num) {
3129 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_screen ()\n";
3131 if (((int) num) != m_current_screen) {
3132 SCIM_DEBUG_MAIN (4) << "New Screen number = " << num << "\n";
3133 m_signal_update_screen ((int) num);
3134 helper_all_update_screen ((int) num);
3135 m_current_screen = (num);
3138 //SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
3139 void socket_update_spot_location (uint32 x, uint32 y, uint32 top_y) {
3140 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_spot_location ()\n";
3141 SCIM_DEBUG_MAIN (4) << "New Spot location x=" << x << " y=" << y << "\n";
3142 m_signal_update_spot_location ((int)x, (int)y, (int)top_y);
3143 helper_all_update_spot_location ((int)x, (int)y);
3145 //ISM_TRANS_CMD_UPDATE_CURSOR_POSITION
3146 void socket_update_cursor_position (uint32 cursor_pos) {
3147 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_cursor_position ()\n";
3148 SCIM_DEBUG_MAIN (4) << "New cursor position pos=" << cursor_pos << "\n";
3149 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
3150 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
3151 iseContext->cursor_pos = static_cast<int>(cursor_pos);
3153 helper_all_update_cursor_position ((int)cursor_pos);
3155 //ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT
3156 void socket_update_surrounding_text (String text, uint32 cursor) {
3157 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3158 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3160 if (it != m_helper_client_index.end ()) {
3165 get_focused_context (client, context);
3166 ctx = get_helper_ic (client, context);
3167 m_panel_agent_manager.socket_update_surrounding_text (it->second.id, ctx, m_current_helper_uuid, text, cursor);
3172 void remoteinput_callback_focus_in () {
3173 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3175 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3177 m_panel_agent_manager.socket_remoteinput_focus_in (m_current_recv_remoteinput_id.at (i));
3182 void remoteinput_callback_focus_out () {
3183 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3185 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3187 m_panel_agent_manager.socket_remoteinput_focus_out (m_current_recv_remoteinput_id.at (i));
3192 void remoteinput_callback_entry_metadata (uint32 hint, uint32 layout, int variation, uint32 autocapital_type, int return_key_disabled, uint32 return_key_type) {
3193 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3194 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
3195 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
3196 iseContext->layout = static_cast<Ecore_IMF_Input_Panel_Layout>(layout);
3197 iseContext->return_key_type = static_cast<Ecore_IMF_Input_Panel_Return_Key_Type>(return_key_type);
3198 iseContext->return_key_disabled = static_cast<Eina_Bool>(return_key_disabled);
3199 iseContext->layout_variation = static_cast<int>(variation);
3200 iseContext->autocapital_type = static_cast<Ecore_IMF_Autocapital_Type>(autocapital_type);
3201 iseContext->input_hint = static_cast<Ecore_IMF_Input_Hints>(hint);
3203 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3205 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);
3210 void remoteinput_callback_surrounding_text (String text, uint32 cursor) {
3211 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3213 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3215 m_panel_agent_manager.socket_remoteinput_surrounding_text (m_current_recv_remoteinput_id.at (i), text, cursor);
3220 void remoteinput_callback_input_resource (uint32 input_resource) {
3221 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3223 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3225 m_panel_agent_manager.socket_remoteinput_input_resource (m_current_recv_remoteinput_id.at (i), input_resource);
3230 //ISM_TRANS_CMD_UPDATE_SELECTION
3231 void socket_update_selection (String text) {
3232 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3233 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3235 if (it != m_helper_client_index.end ()) {
3240 get_focused_context (client, context);
3241 ctx = get_helper_ic (client, context);
3242 m_panel_agent_manager.socket_update_selection (it->second.id, ctx, m_current_helper_uuid, text);
3246 //SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO
3247 void socket_update_factory_info (PanelFactoryInfo& info) {
3248 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_factory_info ()\n";
3249 SCIM_DEBUG_MAIN (4) << "New Factory info uuid=" << info.uuid << " name=" << info.name << "\n";
3250 info.lang = scim_get_normalized_language (info.lang);
3251 m_signal_update_factory_info (info);
3253 //SCIM_TRANS_CMD_PANEL_SHOW_HELP
3254 void socket_show_help (String help) {
3255 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_help ()\n";
3256 m_signal_show_help (help);
3258 //SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU
3259 void socket_show_factory_menu (std::vector <PanelFactoryInfo>& vec) {
3260 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_factory_menu ()\n";
3263 m_signal_show_factory_menu (vec);
3266 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
3267 void socket_show_preedit_string (void) {
3268 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_preedit_string ()\n";
3269 m_signal_show_preedit_string ();
3271 //SCIM_TRANS_CMD_SHOW_AUX_STRING
3272 void socket_show_aux_string (void) {
3273 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_aux_string ()\n";
3274 m_signal_show_aux_string ();
3276 //SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE
3277 void socket_show_lookup_table (void) {
3278 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_lookup_table ()\n";
3279 m_signal_show_lookup_table ();
3281 //ISM_TRANS_CMD_SHOW_ASSOCIATE_TABLE
3282 void socket_show_associate_table (void) {
3283 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_associate_table ()\n";
3284 m_signal_show_associate_table ();
3286 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
3287 void socket_hide_preedit_string (void) {
3288 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_preedit_string ()\n";
3289 m_signal_hide_preedit_string ();
3291 //SCIM_TRANS_CMD_HIDE_AUX_STRING
3292 void socket_hide_aux_string (void) {
3293 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_aux_string ()\n";
3294 m_signal_hide_aux_string ();
3296 //SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE
3297 void socket_hide_lookup_table (void) {
3298 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_lookup_table ()\n";
3299 m_signal_hide_lookup_table ();
3301 //ISM_TRANS_CMD_HIDE_ASSOCIATE_TABLE
3302 void socket_hide_associate_table (void) {
3303 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_associate_table ()\n";
3304 m_signal_hide_associate_table ();
3306 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
3307 void socket_update_preedit_string (String& str, const AttributeList& attrs, uint32 caret) {
3308 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_string ()\n";
3309 m_signal_update_preedit_string (str, attrs, (int) caret);
3311 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
3312 void socket_update_preedit_caret (uint32 caret) {
3313 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_caret ()\n";
3314 m_signal_update_preedit_caret ((int) caret);
3316 //ISM_TRANS_CMD_RECAPTURE_STRING
3317 void socket_recapture_string (int offset, int len, String& preedit, String& commit, const AttributeList& attrs) {
3318 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_caret ()\n";
3319 m_signal_recapture_string (offset, len, preedit, commit, attrs);
3321 //SCIM_TRANS_CMD_UPDATE_AUX_STRING
3322 void socket_update_aux_string (String& str, const AttributeList& attrs) {
3323 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_aux_string ()\n";
3324 m_signal_update_aux_string (str, attrs);
3325 m_is_imengine_aux = true;
3327 //SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE
3328 void socket_update_lookup_table (const LookupTable& table) {
3329 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_lookup_table ()\n";
3331 //g_isf_candidate_table = _isf_candidate_table;
3332 m_signal_update_lookup_table (table);
3333 m_is_imengine_candidate = true;
3335 //ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE
3336 void socket_update_associate_table (const LookupTable& table) {
3337 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_associate_table ()\n";
3338 m_signal_update_associate_table (table);
3341 void socket_update_control_panel (void) {
3342 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_control_panel ()\n";
3344 m_signal_get_keyboard_ise (name, uuid);
3345 PanelFactoryInfo info;
3347 if (name.length () > 0)
3348 info = PanelFactoryInfo (uuid, name, String (""), String (""));
3350 info = PanelFactoryInfo (String (""), String (_ ("English Keyboard")), String ("C"), String (SCIM_KEYBOARD_ICON_FILE));
3352 m_signal_update_factory_info (info);
3354 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
3355 void socket_register_properties (const PropertyList& properties) {
3356 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_register_properties ()\n";
3357 m_signal_register_properties (properties);
3359 //SCIM_TRANS_CMD_UPDATE_PROPERTY
3360 void socket_update_property (const Property& property) {
3361 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_property ()\n";
3362 m_signal_update_property (property);
3364 //ISM_TRANS_CMD_GET_KEYBOARD_ISE_LIST
3365 void socket_get_keyboard_ise_list (String& uuid) {
3366 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_keyboard_ise_list ()\n";
3367 std::vector<String> list;
3369 m_signal_get_keyboard_ise_list (list);
3370 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3372 if (it != m_helper_client_index.end ()) {
3375 get_focused_context (client, context);
3376 uint32 ctx = get_helper_ic (client, context);
3377 m_panel_agent_manager.socket_get_keyboard_ise_list (it->second.id, ctx, uuid, list);
3380 //ISM_TRANS_CMD_SET_CANDIDATE_UI
3381 void socket_set_candidate_ui (uint32 portrait_line, uint32 mode) {
3382 SCIM_DEBUG_MAIN (4) << __func__ << " \n";
3383 m_signal_set_candidate_ui (portrait_line, mode);
3385 //ISM_TRANS_CMD_GET_CANDIDATE_UI
3386 void socket_get_candidate_ui (String uuid) {
3387 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_candidate_ui ()\n";
3388 int style = 0, mode = 0;
3389 m_signal_get_candidate_ui (style, mode);
3390 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3392 if (it != m_helper_client_index.end ()) {
3395 get_focused_context (client, context);
3396 uint32 ctx = get_helper_ic (client, context);
3397 m_panel_agent_manager.socket_get_candidate_ui (it->second.id, ctx, uuid, style, mode);
3400 //ISM_TRANS_CMD_SET_CANDIDATE_POSITION
3401 void socket_set_candidate_position (uint32 left, uint32 top) {
3402 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_candidate_position ()\n";
3403 m_signal_set_candidate_position (left, top);
3405 //ISM_TRANS_CMD_HIDE_CANDIDATE
3406 void socket_hide_candidate (void) {
3407 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_candidate ()\n";
3408 m_signal_hide_preedit_string ();
3409 m_signal_hide_aux_string ();
3410 m_signal_hide_lookup_table ();
3411 m_signal_hide_associate_table ();
3413 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
3414 void socket_get_candidate_geometry (String& uuid) {
3415 SCIM_DEBUG_MAIN (4) << __func__ << " \n";
3416 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3418 if (it != m_helper_client_index.end ()) {
3419 struct rectinfo info = {0, 0, 0, 0};
3420 m_signal_get_candidate_geometry (info);
3423 get_focused_context (client, context);
3424 uint32 ctx = get_helper_ic (client, context);
3425 m_panel_agent_manager.socket_get_candidate_geometry (it->second.id, ctx, uuid, info);
3428 //ISM_TRANS_CMD_SET_KEYBOARD_ISE_BY_UUID
3429 void socket_set_keyboard_ise (String uuid) {
3430 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_keyboard_ise ()\n";
3432 m_signal_set_keyboard_ise (uuid);
3434 //ISM_TRANS_CMD_SELECT_CANDIDATE
3435 void socket_helper_select_candidate (uint32 index) {
3436 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_keyboard_ise ()\n";
3438 m_signal_select_candidate (index);
3440 //ISM_TRANS_CMD_UPDATE_ISE_GEOMETRY
3441 void socket_helper_update_ise_geometry (int client, uint32 x, uint32 y, uint32 width, uint32 height) {
3442 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3445 uint32 focused_context;
3446 HelperInfoRepository::iterator it = m_helper_active_info_repository.find (client);
3448 if (it != m_helper_active_info_repository.end ()) {
3449 if (it->second.uuid == m_current_helper_uuid) {
3450 m_signal_update_ise_geometry (x, y, width, height);
3452 get_focused_context (focused_client, focused_context);
3453 ClientInfo client_info = socket_get_client_info (focused_client);
3454 if (client_info.type == FRONTEND_CLIENT) {
3455 m_panel_agent_manager.update_ise_geometry (focused_client, focused_context, x, y, width, height);
3460 //ISM_TRANS_CMD_GET_KEYBOARD_ISE
3461 void socket_get_keyboard_ise (String uuid) {
3462 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_keyboard_ise ()\n";
3463 String ise_name, ise_uuid;
3467 get_focused_context (client, context);
3468 ctx = get_helper_ic (client, context);
3470 if (m_client_context_uuids.find (ctx) != m_client_context_uuids.end ())
3471 ise_uuid = m_client_context_uuids[ctx];
3473 m_signal_get_keyboard_ise (ise_name, ise_uuid);
3474 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3476 if (it != m_helper_client_index.end ()) {
3477 get_focused_context (client, context);
3478 ctx = get_helper_ic (client, context);
3479 m_panel_agent_manager.socket_get_keyboard_ise (it->second.id, ctx, uuid, ise_name, ise_uuid);
3483 //SCIM_TRANS_CMD_START_HELPER
3484 void socket_start_helper (int client_id, uint32 context, String uuid) {
3485 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_start_helper ()\n";
3486 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3488 uint32 ic = get_helper_ic (m_panel_client_map[client_id], context);
3490 /* Get the context uuid from the client context registration table. */
3492 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3494 if (it != m_client_context_uuids.end ())
3495 ic_uuid = it->second;
3498 if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3499 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3500 } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3501 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3504 if (it == m_helper_client_index.end ()) {
3505 SCIM_DEBUG_MAIN (5) << "Run this Helper.\n";
3506 m_start_helper_ic_index [uuid].push_back (std::make_pair (ic, ic_uuid));
3507 m_signal_run_helper (uuid, m_config_name, m_display_name);
3509 SCIM_DEBUG_MAIN (5) << "Increase the Reference count.\n";
3510 m_panel_agent_manager.socket_start_helper (it->second.id, ic, ic_uuid);
3516 //SCIM_TRANS_CMD_STOP_HELPER
3517 void socket_stop_helper (int client_id, uint32 context, String uuid) {
3518 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_stop_helper ()\n";
3519 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3521 uint32 ic = get_helper_ic (m_panel_client_map[client_id], context);
3523 if (it != m_helper_client_index.end ()) {
3524 SCIM_DEBUG_MAIN (5) << "Decrease the Reference count.\n";
3527 /* Get the context uuid from the client context registration table. */
3529 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3531 if (it != m_client_context_uuids.end ())
3532 ic_uuid = it->second;
3535 if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3536 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3537 } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3538 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3541 m_panel_agent_manager.helper_detach_input_context (it->second.id, ic, ic_uuid);
3543 if (it->second.ref <= 0)
3544 m_panel_agent_manager.exit (it->second.id, ic);
3549 //SCIM_TRANS_CMD_SEND_HELPER_EVENT
3550 void socket_send_helper_event (int client_id, uint32 context, String uuid, const Transaction& _nest_trans) {
3551 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_send_helper_event ()\n";
3552 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3554 if (it != m_helper_client_index.end ()) {
3556 /* Get the context uuid from the client context registration table. */
3558 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3560 if (it != m_client_context_uuids.end ())
3561 ic_uuid = it->second;
3564 if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3565 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3566 } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3567 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3570 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);
3574 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
3575 void socket_helper_register_properties (int client, PropertyList& properties) {
3576 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_properties (" << client << ")\n";
3577 m_signal_register_helper_properties (client, properties);
3579 #if 0 //why? remove if useless, infinite loop
3580 /* Check whether application is already focus_in */
3581 if (m_current_socket_client != -1) {
3582 SCIM_DEBUG_MAIN (2) << "Application is already focus_in!\n";
3583 focus_in_helper (m_current_helper_uuid, m_current_socket_client, m_current_client_context);
3584 reset_keyboard_ise ();
3587 /* Check whether ISE panel is already shown */
3588 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode && m_ise_context_length > 0) {
3589 SCIM_DEBUG_MAIN (2) << "Re-show ISE panel!\n";
3591 uint32 focused_context;
3592 get_focused_context (focused_client, focused_context);
3594 if (focused_client == -1 && m_active_client_id != -1) {
3595 focused_client = m_panel_client_map[m_active_client_id];
3596 focused_context = 0;
3599 uint32 ctx = get_helper_ic (focused_client, focused_context);
3600 bool ret = show_helper (m_current_helper_uuid, m_ise_context_buffer, m_ise_context_length, ctx);
3603 m_signal_show_ise ();
3607 //SCIM_TRANS_CMD_UPDATE_PROPERTY
3608 void socket_helper_update_property (int client, Property& property) {
3609 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_property (" << client << ")\n";
3610 m_signal_update_helper_property (client, property);
3612 //SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT
3613 void socket_helper_send_imengine_event (int client, uint32 target_ic, String target_uuid , Transaction& nest_trans) {
3614 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_send_imengine_event (" << client << ")\n";
3615 HelperInfoRepository::iterator hiit = m_helper_active_info_repository.find (client);
3617 if (hiit != m_helper_active_info_repository.end ()) {
3619 uint32 target_context;
3620 get_imengine_client_context (target_ic, target_client, target_context);
3622 uint32 focused_context;
3623 String focused_uuid;
3624 focused_uuid = get_focused_context (focused_client, focused_context);
3626 if (target_ic == (uint32) (-1)) {
3627 target_client = focused_client;
3628 target_context = focused_context;
3631 if (target_uuid.length () == 0)
3632 target_uuid = focused_uuid;
3634 ClientInfo client_info = socket_get_client_info (target_client);
3635 SCIM_DEBUG_MAIN (5) << "Target UUID = " << target_uuid << " Focused UUId = " << focused_uuid << "\nTarget Client = " << target_client << "\n";
3637 if (client_info.type == FRONTEND_CLIENT) {
3638 /* If the original context value is greater than 0x7FFF, the line below would not work properly
3639 since the target_context acquired by get_imengine_client_context() is always smaller than 0x7FFF.
3640 But since the send_imengine_event() of scim_helper module will call IMEngine's
3641 process_helper_event() function directly, instead of sending SEND_IMENGINE_EVENT message.
3642 So we are not going to handle this kind of exceptional case for now. */
3643 m_panel_agent_manager.process_helper_event (target_client, target_context, target_uuid, hiit->second.uuid, nest_trans);
3648 void socket_helper_key_event_op (int client, int cmd, uint32 target_ic, String& target_uuid, KeyEvent& key) {
3649 if (!key.empty ()) {
3651 uint32 target_context;
3652 get_imengine_client_context (target_ic, target_client, target_context);
3654 uint32 focused_context;
3655 String focused_uuid;
3656 focused_uuid = get_focused_context (focused_client, focused_context);
3658 if (target_ic == (uint32) (-1)) {
3659 target_client = focused_client;
3660 target_context = focused_context;
3663 if (target_uuid.length () == 0)
3664 target_uuid = focused_uuid;
3666 if (target_client == -1) {
3667 /* FIXUP: monitor 'Invalid Window' error */
3668 LOGW ("focused target client is NULL");
3669 } else if (target_uuid == focused_uuid &&
3670 clients_equal (target_client, focused_client) &&
3671 contexts_equal (target_context, focused_context)) {
3672 ClientInfo client_info = socket_get_client_info (focused_client);
3674 if (client_info.type == FRONTEND_CLIENT) {
3675 m_panel_agent_manager.socket_helper_key_event (focused_client, focused_context, cmd, key);
3678 LOGD ("[target_client : %d, focused_client : %d] => %d, [target_context : %u, focused_context : %u] => %d",
3679 target_client, focused_client, clients_equal (target_client, focused_client),
3680 target_context, focused_context, contexts_equal (target_context, focused_context));
3684 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
3685 //SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT
3686 void socket_helper_send_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key) {
3687 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_send_key_event (" << client << ")\n";
3688 ISF_PROF_DEBUG ("first message")
3689 socket_helper_key_event_op (client, SCIM_TRANS_CMD_PROCESS_KEY_EVENT, target_ic, target_uuid, key);
3691 //SCIM_TRANS_CMD_FORWARD_KEY_EVENT
3692 void socket_helper_forward_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key) {
3693 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_forward_key_event (" << client << ")\n";
3694 socket_helper_key_event_op (client, SCIM_TRANS_CMD_FORWARD_KEY_EVENT, target_ic, target_uuid, key);
3697 //SCIM_TRANS_CMD_COMMIT_STRING
3698 void socket_helper_commit_string (int client, uint32 target_ic, String target_uuid, WideString wstr) {
3699 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_commit_string (" << client << ")\n";
3701 if (wstr.length ()) {
3703 uint32 target_context;
3704 get_imengine_client_context (target_ic, target_client, target_context);
3706 uint32 focused_context;
3707 String focused_uuid;
3708 focused_uuid = get_focused_context (focused_client, focused_context);
3710 if (target_ic == (uint32) (-1)) {
3711 target_client = focused_client;
3712 target_context = focused_context;
3715 if (target_uuid.length () == 0)
3716 target_uuid = focused_uuid;
3718 if (target_uuid == focused_uuid &&
3719 clients_equal (target_client, focused_client) &&
3720 contexts_equal (target_context, focused_context)) {
3721 ClientInfo client_info = socket_get_client_info (focused_client);
3723 if (client_info.type == FRONTEND_CLIENT) {
3724 m_panel_agent_manager.commit_string (focused_client, focused_context, wstr);
3726 std::cerr << "target client is not existed!!!" << "\n";
3731 //SCIM_TRANS_CMD_GET_SURROUNDING_TEXT
3732 void socket_helper_get_surrounding_text (int client, String uuid, uint32 maxlen_before, uint32 maxlen_after) {
3733 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3735 uint32 focused_context;
3736 get_focused_context (focused_client, focused_context);
3737 ClientInfo client_info = socket_get_client_info (focused_client);
3739 /* If the get_surrounding_text was received when there is no client available,
3740 * return empty surrounding text since the sender would be waiting for reply */
3741 if (focused_client == -1) {
3742 socket_update_surrounding_text("", 0);
3744 if (client_info.type == FRONTEND_CLIENT) {
3745 m_panel_agent_manager.socket_helper_get_surrounding_text (focused_client, focused_context, maxlen_before, maxlen_after);
3749 //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT
3750 void socket_helper_delete_surrounding_text (int client, uint32 offset, uint32 len) {
3751 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3753 uint32 focused_context;
3754 get_focused_context (focused_client, focused_context);
3755 ClientInfo client_info = socket_get_client_info (focused_client);
3757 if (client_info.type == FRONTEND_CLIENT) {
3758 m_panel_agent_manager.socket_helper_delete_surrounding_text (focused_client, focused_context, offset, len);
3761 //SCIM_TRANS_CMD_GET_SELECTION
3762 void socket_helper_get_selection (int client, String uuid) {
3763 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3765 uint32 focused_context;
3766 get_focused_context (focused_client, focused_context);
3767 ClientInfo client_info = socket_get_client_info (focused_client);
3769 if (client_info.type == FRONTEND_CLIENT) {
3770 m_panel_agent_manager.socket_helper_get_selection (focused_client, focused_context);
3773 //SCIM_TRANS_CMD_SET_SELECTION
3774 void socket_helper_set_selection (int client, uint32 start, uint32 end) {
3775 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3777 uint32 focused_context;
3778 get_focused_context (focused_client, focused_context);
3779 ClientInfo client_info = socket_get_client_info (focused_client);
3781 if (client_info.type == FRONTEND_CLIENT) {
3782 m_panel_agent_manager.socket_helper_set_selection (focused_client, focused_context, start, end);
3786 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
3787 void socket_helper_show_preedit_string (int client, uint32 target_ic, String target_uuid) {
3788 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_show_preedit_string (" << client << ")\n";
3790 uint32 target_context;
3791 get_imengine_client_context (target_ic, target_client, target_context);
3793 uint32 focused_context;
3794 String focused_uuid = get_focused_context (focused_client, focused_context);
3796 if (target_ic == (uint32) (-1)) {
3797 target_client = focused_client;
3798 target_context = focused_context;
3801 if (target_uuid.length () == 0)
3802 target_uuid = focused_uuid;
3804 if (target_uuid == focused_uuid &&
3805 clients_equal (target_client, focused_client) &&
3806 contexts_equal (target_context, focused_context)) {
3807 ClientInfo client_info = socket_get_client_info (focused_client);
3809 if (client_info.type == FRONTEND_CLIENT) {
3810 m_panel_agent_manager.show_preedit_string (focused_client, focused_context);
3814 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
3815 void socket_helper_hide_preedit_string (int client, uint32 target_ic, String target_uuid) {
3816 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_hide_preedit_string (" << client << ")\n";
3818 uint32 target_context;
3819 get_imengine_client_context (target_ic, target_client, target_context);
3821 uint32 focused_context;
3822 String focused_uuid = get_focused_context (focused_client, focused_context);
3824 if (target_ic == (uint32) (-1)) {
3825 target_client = focused_client;
3826 target_context = focused_context;
3829 if (target_uuid.length () == 0)
3830 target_uuid = focused_uuid;
3832 if (target_uuid == focused_uuid &&
3833 clients_equal (target_client, focused_client) &&
3834 contexts_equal (target_context, focused_context)) {
3835 ClientInfo client_info = socket_get_client_info (focused_client);
3837 if (client_info.type == FRONTEND_CLIENT) {
3838 m_panel_agent_manager.hide_preedit_string (focused_client, focused_context);
3842 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
3843 void socket_helper_update_preedit_string (int client, uint32 target_ic, String target_uuid, WideString preedit, WideString commit, AttributeList& attrs, uint32 caret) {
3844 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_preedit_string (" << client << ")\n";
3846 uint32 target_context;
3847 get_imengine_client_context (target_ic, target_client, target_context);
3849 uint32 focused_context;
3850 String focused_uuid;
3851 focused_uuid = get_focused_context (focused_client, focused_context);
3853 if (target_ic == (uint32) (-1)) {
3854 target_client = focused_client;
3855 target_context = focused_context;
3858 if (target_uuid.length () == 0)
3859 target_uuid = focused_uuid;
3861 if (target_uuid == focused_uuid &&
3862 clients_equal (target_client, focused_client) &&
3863 contexts_equal (target_context, focused_context)) {
3864 ClientInfo client_info = socket_get_client_info (focused_client);
3866 if (client_info.type == FRONTEND_CLIENT) {
3867 m_panel_agent_manager.update_preedit_string (focused_client, focused_context, preedit, commit, attrs, caret);
3871 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
3872 void socket_helper_update_preedit_caret (int client, uint32 caret) {
3873 SCIM_DEBUG_MAIN (4) << __func__ << " (" << client << ")\n";
3875 uint32 focused_context;
3876 String focused_uuid;
3877 focused_uuid = get_focused_context (focused_client, focused_context);
3878 ClientInfo client_info = socket_get_client_info (focused_client);
3880 if (client_info.type == FRONTEND_CLIENT) {
3881 m_panel_agent_manager.update_preedit_caret (focused_client, focused_context, caret);
3885 //ISM_TRANS_CMD_RECAPTURE_STRING
3886 void socket_helper_recapture_string (int client, uint32 target_ic, String target_uuid, int offset, int len, WideString preedit,
3887 WideString commit, AttributeList& attrs) {
3888 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_recapture_string (" << client << ")\n";
3890 uint32 target_context;
3891 get_imengine_client_context (target_ic, target_client, target_context);
3893 uint32 focused_context;
3894 String focused_uuid;
3895 focused_uuid = get_focused_context (focused_client, focused_context);
3897 if (target_ic == (uint32) (-1)) {
3898 target_client = focused_client;
3899 target_context = focused_context;
3902 if (target_uuid.length () == 0)
3903 target_uuid = focused_uuid;
3905 if (target_uuid == focused_uuid &&
3906 clients_equal (target_client, focused_client) &&
3907 contexts_equal (target_context, focused_context)) {
3908 ClientInfo client_info = socket_get_client_info (focused_client);
3910 if (client_info.type == FRONTEND_CLIENT) {
3911 m_panel_agent_manager.recapture_string (focused_client, focused_context, offset, len, preedit, commit, attrs);
3916 //SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
3917 void socket_helper_register_helper (int client, HelperInfo& info) {
3918 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_helper (" << client << ")\n";
3919 bool result = false;
3926 if (!m_signal_get_ise_information (info.uuid, info.name, language, type, option, module_name)) {
3927 LOGW ("This helper (%s) is not IME", info.uuid.c_str ());
3931 info.option = option;
3933 if (info.uuid.length ()) {
3934 SCIM_DEBUG_MAIN (4) << "New Helper uuid=" << info.uuid << " name=" << info.name << "\n";
3935 HelperClientIndex::iterator it = m_helper_client_index.find (info.uuid);
3937 if (it == m_helper_client_index.end ()) {
3938 m_helper_info_repository [client] = info;
3939 m_helper_client_index [info.uuid] = HelperClientStub (client, 1);
3940 StartHelperICIndex::iterator icit = m_start_helper_ic_index.find (info.uuid);
3942 if (icit != m_start_helper_ic_index.end ()) {
3943 m_panel_agent_manager.helper_attach_input_context_and_update_screen (client, icit->second, m_current_screen);
3944 m_start_helper_ic_index.erase (icit);
3947 LOGW ("Failed to register IME : %s", info.uuid.c_str ());
3948 m_panel_agent_manager.send_fail_reply(client);
3951 LOGW ("Failed to register IME : %s", info.uuid.c_str ());
3952 m_panel_agent_manager.send_fail_reply(client);
3959 LOGD ("Succeed to register IME : %s", info.uuid.c_str ());
3960 m_signal_register_helper (client, info);
3964 //SCIM_TRANS_CMD_PANEL_REGISTER_ACTIVE_HELPER
3965 void socket_helper_register_helper_passive (int client, HelperInfo& info) {
3966 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_helper_passive (" << client << ")\n";
3973 if (!m_signal_get_ise_information (info.uuid, info.name, language, type, option, module_name)) {
3974 LOGW ("This helper (%s) is not IME", info.uuid.c_str ());
3978 info.option = option;
3980 if (info.uuid.length ()) {
3981 SCIM_DEBUG_MAIN (4) << "New Helper Passive uuid=" << info.uuid << " name=" << info.name << "\n";
3982 HelperInfoRepository::iterator it = m_helper_active_info_repository.find (client);
3984 if (it == m_helper_active_info_repository.end ()) {
3985 m_helper_active_info_repository[client] = info;
3988 StringIntRepository::iterator iter = m_ise_pending_repository.find (info.uuid);
3990 if (iter != m_ise_pending_repository.end ()) {
3991 m_ise_pending_repository.erase (iter);
3994 iter = m_ise_pending_repository.find (info.name);
3996 if (iter != m_ise_pending_repository.end ()) {
3997 m_ise_pending_repository.erase (iter);
4003 //ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
4004 void socket_helper_update_input_context (int client, uint32 type, uint32 value) {
4005 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_input_context (" << client << ")\n";
4006 m_signal_update_input_context ((int)type, (int)value);
4008 uint32 focused_context;
4009 get_focused_context (focused_client, focused_context);
4010 ClientInfo client_info = socket_get_client_info (focused_client);
4012 if (client_info.type == FRONTEND_CLIENT) {
4013 m_panel_agent_manager.update_ise_input_context (focused_client, focused_context, type, value);
4015 std::cerr << "focused client is not existed!!!" << "\n";
4018 //ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE
4019 void socket_helper_update_language_locale(int client, String locale) {
4020 SCIM_DEBUG_MAIN(4) << "InfoManager::socket_helper_update_language_locale (" << client << ")\n";
4021 m_signal_update_language_locale(locale);
4024 uint32 focused_context;
4025 get_focused_context(focused_client, focused_context);
4026 ClientInfo client_info = socket_get_client_info(focused_client);
4028 if (client_info.type == FRONTEND_CLIENT) {
4029 m_panel_agent_manager.update_ise_language_locale(focused_client, focused_context, locale);
4031 std::cerr << "focused client is not existed!!!" << "\n";
4034 //SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
4035 void socket_helper_send_private_command (int client, String command) {
4036 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
4038 uint32 focused_context;
4039 get_focused_context (focused_client, focused_context);
4040 ClientInfo client_info = socket_get_client_info (focused_client);
4042 if (client_info.type == FRONTEND_CLIENT) {
4043 m_panel_agent_manager.send_private_command (focused_client, focused_context, command);
4046 //SCIM_TRANS_CMD_COMMIT_CONTENT
4047 void socket_helper_commit_content (int client, String content, String description, String mime_types) {
4048 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
4050 uint32 focused_context;
4051 get_focused_context (focused_client, focused_context);
4052 ClientInfo client_info = socket_get_client_info (focused_client);
4054 if (client_info.type == FRONTEND_CLIENT) {
4055 m_panel_agent_manager.commit_content (focused_client, focused_context, content, description, mime_types);
4058 //ISM_TRANS_CMD_UPDATE_ISE_EXIT
4059 void UPDATE_ISE_EXIT (int client) {
4060 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4061 bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false);
4062 if (launch_ise_on_request && !m_refocus_needed && !m_reshow_needed)
4063 m_restart_needed = false;
4066 void process_key_event_done (KeyEvent &key, uint32 ret, uint32 serial) {
4068 uint32 focused_context;
4069 get_focused_context (focused_client, focused_context);
4070 ClientInfo client_info = socket_get_client_info (focused_client);
4072 if (client_info.type == FRONTEND_CLIENT) {
4073 m_panel_agent_manager.process_key_event_done (focused_client, focused_context, key, ret, serial);
4077 //ISM_TRANS_CMD_REQUEST_ISE_HIDE
4078 void request_ise_hide () {
4080 uint32 focused_context;
4081 get_focused_context (focused_client, focused_context);
4082 ClientInfo client_info = socket_get_client_info (focused_client);
4084 if (client_info.type == FRONTEND_CLIENT) {
4085 m_panel_agent_manager.request_ise_hide (focused_client, focused_context);
4089 void socket_reset_helper_input_context (const String& uuid, int client, uint32 context) {
4090 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4092 if (it != m_helper_client_index.end ()) {
4093 uint32 ctx = get_helper_ic (client, context);
4094 m_panel_agent_manager.reset_helper_context (it->second.id, ctx, uuid);
4098 bool helper_select_aux (uint32 item) {
4099 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_aux \n";
4101 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4102 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4104 if (it != m_helper_client_index.end ()) {
4108 get_focused_context (client, context);
4109 ctx = get_helper_ic (client, context);
4110 m_panel_agent_manager.select_aux (it->second.id, ctx, item);
4118 bool helper_select_candidate (uint32 item) {
4119 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_candidate \n";
4121 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4122 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4124 if (it != m_helper_client_index.end ()) {
4128 get_focused_context (client, context);
4129 ctx = get_helper_ic (client, context);
4130 m_panel_agent_manager.select_candidate (it->second.id, ctx, item);
4138 bool helper_lookup_table_page_up (void) {
4139 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_lookup_table_page_up \n";
4141 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4142 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4144 if (it != m_helper_client_index.end ()) {
4148 get_focused_context (client, context);
4149 ctx = get_helper_ic (client, context);
4150 m_panel_agent_manager.lookup_table_page_up (it->second.id, ctx);
4158 bool helper_lookup_table_page_down (void) {
4159 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_lookup_table_page_down \n";
4161 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4162 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4164 if (it != m_helper_client_index.end ()) {
4168 get_focused_context (client, context);
4169 ctx = get_helper_ic (client, context);
4170 m_panel_agent_manager.lookup_table_page_down (it->second.id, ctx);
4178 bool helper_update_lookup_table_page_size (uint32 size) {
4179 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_update_lookup_table_page_size \n";
4181 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4182 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4184 if (it != m_helper_client_index.end ()) {
4188 get_focused_context (client, context);
4189 ctx = get_helper_ic (client, context);
4190 m_panel_agent_manager.update_lookup_table_page_size (it->second.id, ctx, size);
4198 bool helper_update_candidate_item_layout (const std::vector<uint32>& row_items) {
4199 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4201 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4202 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4204 if (it != m_helper_client_index.end ()) {
4208 get_focused_context (client, context);
4209 ctx = get_helper_ic (client, context);
4210 m_panel_agent_manager.update_candidate_item_layout (it->second.id, ctx, row_items);
4218 bool helper_select_associate (uint32 item) {
4219 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_associate \n";
4221 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4222 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4224 if (it != m_helper_client_index.end ()) {
4228 get_focused_context (client, context);
4229 ctx = get_helper_ic (client, context);
4230 m_panel_agent_manager.select_associate (it->second.id, ctx, item);
4238 bool helper_associate_table_page_up (void) {
4239 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_associate_table_page_up \n";
4241 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4242 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4244 if (it != m_helper_client_index.end ()) {
4248 get_focused_context (client, context);
4249 ctx = get_helper_ic (client, context);
4250 m_panel_agent_manager.associate_table_page_up (it->second.id, ctx);
4258 bool helper_associate_table_page_down (void) {
4259 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_associate_table_page_down \n";
4261 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4262 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4264 if (it != m_helper_client_index.end ()) {
4268 get_focused_context (client, context);
4269 ctx = get_helper_ic (client, context);
4270 m_panel_agent_manager.associate_table_page_down (it->second.id, ctx);
4278 bool helper_update_associate_table_page_size (uint32 size) {
4279 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_update_associate_table_page_size \n";
4281 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4282 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4284 if (it != m_helper_client_index.end ()) {
4288 get_focused_context (client, context);
4289 ctx = get_helper_ic (client, context);
4290 m_panel_agent_manager.update_associate_table_page_size (it->second.id, ctx, size);
4298 bool helper_update_displayed_candidate_number (uint32 size) {
4299 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4301 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4302 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4304 if (it != m_helper_client_index.end ()) {
4308 get_focused_context (client, context);
4309 ctx = get_helper_ic (client, context);
4310 m_panel_agent_manager.update_displayed_candidate_number (it->second.id, ctx, size);
4318 bool helper_longpress_candidate (uint32 index) {
4319 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4321 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4322 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4324 if (it != m_helper_client_index.end ()) {
4328 get_focused_context (client, context);
4329 ctx = get_helper_ic (client, context);
4330 m_panel_agent_manager.send_longpress_event (it->second.id, ctx, index);
4335 std::cerr << __func__ << " is failed!!!\n";
4339 void helper_all_update_spot_location (int x, int y) {
4340 SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_spot_location (" << x << "," << y << ")\n";
4341 HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
4344 String uuid = get_focused_context (client, context);
4346 for (; hiit != m_helper_info_repository.end (); ++ hiit) {
4347 if (hiit->second.option & SCIM_HELPER_NEED_SPOT_LOCATION_INFO) {
4348 m_panel_agent_manager.helper_all_update_spot_location (hiit->first, get_helper_ic (client, context), uuid, x, y);
4353 void helper_all_update_cursor_position (int cursor_pos) {
4354 SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_cursor_position (" << cursor_pos << ")\n";
4355 HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
4358 String uuid = get_focused_context (client, context);
4360 for (; hiit != m_helper_info_repository.end (); ++ hiit) {
4361 m_panel_agent_manager.helper_all_update_cursor_position (hiit->first, get_helper_ic (client, context), uuid, cursor_pos);
4365 void helper_all_update_screen (int screen) {
4366 SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_screen (" << screen << ")\n";
4367 HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
4371 uuid = get_focused_context (client, context);
4373 for (; hiit != m_helper_info_repository.end (); ++ hiit) {
4374 if (hiit->second.option & SCIM_HELPER_NEED_SCREEN_INFO) {
4375 m_panel_agent_manager.helper_all_update_screen (hiit->first, get_helper_ic (client, context), uuid, screen);
4380 bool set_autocapital_type (int mode) {
4381 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4382 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
4383 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
4384 iseContext->autocapital_type = static_cast<Ecore_IMF_Autocapital_Type>(mode);
4386 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || (m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
4387 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4389 if (it != m_helper_client_index.end ()) {
4393 get_focused_context (client, context);
4394 ctx = get_helper_ic (client, context);
4395 m_panel_agent_manager.set_autocapital_type (it->second.id, ctx, m_current_helper_uuid, mode);
4400 std::cerr << __func__ << " is failed!!!\n";
4404 bool set_prediction_allow (int client, int mode) {
4405 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4406 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
4407 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
4408 iseContext->prediction_allow = static_cast<Eina_Bool>(mode);
4410 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || (m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
4411 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4413 if (it != m_helper_client_index.end ()) {
4415 uint32 focused_context;
4417 get_focused_context (focused_client, focused_context);
4418 ctx = get_helper_ic (focused_client, focused_context);
4419 m_panel_agent_manager.set_prediction_allow (it->second.id, ctx, m_current_helper_uuid, mode);
4424 std::cerr << __func__ << " is failed!!!\n";
4428 const String& get_focused_context (int& client, uint32& context, bool force_last_context = false) const {
4429 if (m_current_socket_client >= 0) {
4430 client = m_current_socket_client;
4431 context = m_current_client_context;
4432 return m_current_context_uuid;
4434 client = m_last_socket_client;
4435 context = m_last_client_context;
4436 return m_last_context_uuid;
4441 void socket_transaction_start (void) {
4442 m_signal_transaction_start ();
4445 void socket_transaction_end (void) {
4446 m_signal_transaction_end ();
4452 void unlock (void) {
4457 InfoManager::InfoManager ()
4458 : m_impl (new InfoManagerImpl ())
4462 InfoManager::~InfoManager ()
4468 InfoManager::initialize (InfoManager* info_manager, const ConfigPointer& config, const String& display, bool resident)
4470 return m_impl->initialize (info_manager, config, display, resident);
4474 InfoManager::valid (void) const
4476 return m_impl->valid ();
4480 InfoManager::stop (void)
4487 InfoManager::socket_get_client_info (int client) const
4489 return m_impl->socket_get_client_info (client);
4492 void InfoManager::hide_helper (const String& uuid)
4494 m_impl->hide_helper (uuid);
4497 InfoManager::get_current_toolbar_mode () const
4499 return m_impl->get_current_toolbar_mode ();
4503 InfoManager::get_current_ise_geometry (rectinfo& rect)
4505 m_impl->get_current_ise_geometry (rect);
4509 InfoManager::get_current_helper_uuid () const
4511 return m_impl->get_current_helper_uuid ();
4515 InfoManager::get_current_ise_name () const
4517 return m_impl->get_current_ise_name ();
4521 InfoManager::set_current_toolbar_mode (TOOLBAR_MODE_T mode)
4523 m_impl->set_current_toolbar_mode (mode);
4527 InfoManager::set_current_ise_name (String& name)
4529 m_impl->set_current_ise_name (name);
4533 InfoManager::set_current_helper_option (uint32 option)
4535 m_impl->set_current_helper_option (option);
4539 InfoManager::update_candidate_panel_event (uint32 nType, uint32 nValue)
4541 m_impl->update_panel_event (ISM_TRANS_CMD_UPDATE_ISF_CANDIDATE_PANEL, nType, nValue);
4545 InfoManager::update_input_panel_event (uint32 nType, uint32 nValue)
4547 m_impl->update_panel_event (ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT, nType, nValue);
4551 InfoManager::move_preedit_caret (uint32 position)
4553 return m_impl->move_preedit_caret (position);
4559 InfoManager::request_help (void)
4561 return m_impl->request_help ();
4565 InfoManager::request_factory_menu (void)
4567 return m_impl->request_factory_menu ();
4572 InfoManager::change_factory (const String& uuid)
4574 return m_impl->change_factory (uuid);
4578 InfoManager::helper_candidate_show (void)
4580 return m_impl->helper_candidate_show ();
4584 InfoManager::helper_candidate_hide (void)
4586 return m_impl->helper_candidate_hide ();
4590 InfoManager::candidate_more_window_show (void)
4592 return m_impl->candidate_more_window_show ();
4596 InfoManager::candidate_more_window_hide (void)
4598 return m_impl->candidate_more_window_hide ();
4602 InfoManager::update_helper_lookup_table (const LookupTable& table)
4604 return m_impl->update_helper_lookup_table (table);
4608 InfoManager::select_aux (uint32 item)
4610 return m_impl->select_aux (item);
4614 InfoManager::select_candidate (uint32 item)
4616 return m_impl->select_candidate (item);
4620 InfoManager::lookup_table_page_up (void)
4622 return m_impl->lookup_table_page_up ();
4626 InfoManager::lookup_table_page_down (void)
4628 return m_impl->lookup_table_page_down ();
4632 InfoManager::update_lookup_table_page_size (uint32 size)
4634 return m_impl->update_lookup_table_page_size (size);
4638 InfoManager::update_candidate_item_layout (const std::vector<uint32>& row_items)
4640 return m_impl->update_candidate_item_layout (row_items);
4644 InfoManager::select_associate (uint32 item)
4646 return m_impl->select_associate (item);
4650 InfoManager::associate_table_page_up (void)
4652 return m_impl->associate_table_page_up ();
4656 InfoManager::associate_table_page_down (void)
4658 return m_impl->associate_table_page_down ();
4662 InfoManager::update_associate_table_page_size (uint32 size)
4664 return m_impl->update_associate_table_page_size (size);
4668 InfoManager::update_displayed_candidate_number (uint32 size)
4670 return m_impl->update_displayed_candidate_number (size);
4674 InfoManager::send_longpress_event (int type, int index)
4676 m_impl->send_longpress_event (type, index);
4680 InfoManager::trigger_property (const String& property)
4682 return m_impl->trigger_property (property);
4686 InfoManager::start_helper (const String& uuid)
4688 return m_impl->start_helper (uuid, -2, 0);
4692 InfoManager::stop_helper (const String& uuid)
4694 return m_impl->stop_helper (uuid, -2, 0);
4698 InfoManager::set_default_ise (const DEFAULT_ISE_T& ise)
4700 m_impl->set_default_ise (ise);
4704 InfoManager::set_should_shared_ise (const bool should_shared_ise)
4706 m_impl->set_should_shared_ise (should_shared_ise);
4710 //InfoManager::reload_config (void)
4712 // m_impl->reload_config ();
4716 InfoManager::exit (void)
4718 return m_impl->exit ();
4721 InfoManager::update_ise_list (std::vector<String>& strList)
4723 m_impl->update_ise_list (strList);
4727 InfoManager::remoteinput_update_preedit_string (WideString str, AttributeList &attrs, uint32 caret)
4729 return m_impl->remoteinput_update_preedit_string (str, attrs, caret);
4733 InfoManager::remoteinput_commit_string (const WideString &str)
4735 return m_impl->remoteinput_commit_string (str);
4739 InfoManager::remoteinput_send_key_event (const KeyEvent &key)
4741 return m_impl->remoteinput_send_key_event (key);
4745 InfoManager::remoteinput_forward_key_event (const KeyEvent &key)
4747 return m_impl->remoteinput_forward_key_event (key);
4751 InfoManager::remoteinput_delete_surrounding_text (uint32 offset, uint32 len)
4753 return m_impl->remoteinput_delete_surrounding_text (offset, len);
4756 /////////////////////////////////Message function begin/////////////////////////////////////////
4758 //ISM_TRANS_CMD_PANEL_RESET_KEYBOARD_ISE
4759 bool InfoManager:: reset_keyboard_ise (void)
4761 return m_impl->reset_keyboard_ise ();
4764 //ISM_TRANS_CMD_SHOW_ISF_CONTROL
4765 void InfoManager::show_isf_panel (int client_id)
4767 m_impl->show_isf_panel (client_id);
4770 //ISM_TRANS_CMD_HIDE_ISF_CONTROL
4771 void InfoManager::hide_isf_panel (int client_id)
4773 m_impl->hide_isf_panel (client_id);
4776 //ISM_TRANS_CMD_SHOW_ISE_PANEL
4777 void InfoManager::show_ise_panel (int client_id, uint32 client, uint32 context, char* data, size_t len)
4779 m_impl->show_ise_panel (client_id, client, context, data, len);
4782 //ISM_TRANS_CMD_HIDE_ISE_PANEL
4783 void InfoManager::hide_ise_panel (int client_id, uint32 client, uint32 context)
4785 m_impl->hide_ise_panel (client_id, client, context);
4788 //ISM_TRANS_CMD_HIDE_ISE_PANEL from ISF control
4789 void InfoManager::hide_helper_ise (void)
4791 m_impl->hide_helper_ise ();
4794 //ISM_TRANS_CMD_LAUNCH_ISE from ISF control
4795 void InfoManager::prelaunch_helper_ise (void)
4797 m_impl->prelaunch_helper_ise ();
4800 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
4801 bool InfoManager::process_key_event (KeyEvent& key, uint32 serial, uint32 keycode)
4803 return m_impl->process_key_event (key, serial, keycode);
4806 //ISM_TRANS_CMD_GET_ACTIVE_ISE_GEOMETRY
4807 void InfoManager::get_input_panel_geometry (int client_id, _OUT_ struct rectinfo& info)
4809 m_impl->get_input_panel_geometry (client_id, info);
4812 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
4813 void InfoManager::get_candidate_window_geometry (int client_id, _OUT_ struct rectinfo& info)
4815 m_impl->get_candidate_window_geometry (client_id, info);
4818 //ISM_TRANS_CMD_GET_ISE_LANGUAGE_LOCALE
4819 void InfoManager::get_ise_language_locale (int client_id, _OUT_ char** data, _OUT_ size_t& len)
4821 m_impl->get_ise_language_locale (client_id, data, len);
4824 //ISM_TRANS_CMD_SET_LAYOUT
4825 void InfoManager::set_ise_layout (int client_id, uint32 layout)
4827 m_impl->set_ise_layout (client_id, layout);
4830 //ISM_TRANS_CMD_SET_INPUT_MODE
4831 void InfoManager::set_ise_input_mode (int client_id, uint32 input_mode)
4833 m_impl->set_ise_input_mode (client_id, input_mode);
4836 //ISM_TRANS_CMD_SET_INPUT_HINT
4837 void InfoManager::set_ise_input_hint (int client_id, uint32 input_hint)
4839 m_impl->set_ise_input_hint (client_id, input_hint);
4842 //ISM_TRANS_CMD_UPDATE_BIDI_DIRECTION
4843 void InfoManager::update_ise_bidi_direction (int client_id, uint32 bidi_direction)
4845 m_impl->update_ise_bidi_direction (client_id, bidi_direction);
4849 //ISM_TRANS_CMD_SET_ISE_LANGUAGE
4850 void InfoManager::set_ise_language (int client_id, uint32 language)
4852 m_impl->set_ise_language (client_id, language);
4855 //ISM_TRANS_CMD_SET_ISE_IMDATA
4856 void InfoManager::set_ise_imdata (int client_id, const char* imdata, size_t len)
4858 m_impl->set_ise_imdata (client_id, imdata, len);
4861 //ISM_TRANS_CMD_GET_ISE_IMDATA
4862 bool InfoManager:: get_ise_imdata (int client_id, _OUT_ char** imdata, _OUT_ size_t& len)
4864 return m_impl->get_ise_imdata (client_id, imdata, len);
4867 //ISM_TRANS_CMD_GET_LAYOUT
4868 bool InfoManager:: get_ise_layout (int client_id, _OUT_ uint32& layout)
4870 return m_impl->get_ise_layout (client_id, layout);
4873 //ISM_TRANS_CMD_GET_ISE_STATE
4874 void InfoManager::get_ise_state (int client_id, _OUT_ int& state)
4876 m_impl->get_ise_state (client_id, state);
4879 //ISM_TRANS_CMD_GET_ACTIVE_ISE
4880 void InfoManager::get_active_ise (int client_id, _OUT_ String& default_uuid)
4882 m_impl->get_active_ise (client_id, default_uuid);
4885 //ISM_TRANS_CMD_GET_ISE_LIST
4886 void InfoManager::get_ise_list (int client_id, _OUT_ std::vector<String>& strlist)
4888 m_impl->get_ise_list (client_id, strlist);
4891 //ISM_TRANS_CMD_GET_ALL_HELPER_ISE_INFO
4892 void InfoManager::get_all_helper_ise_info (int client_id, _OUT_ HELPER_ISE_INFO& info)
4894 m_impl->get_all_helper_ise_info (client_id, info);
4897 //ISM_TRANS_CMD_SET_ENABLE_HELPER_ISE_INFO
4898 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4899 void InfoManager::set_enable_helper_ise_info (int client_id, String appid, uint32 is_enabled)
4901 m_impl->set_enable_helper_ise_info (client_id, appid, is_enabled);
4904 //ISM_TRANS_CMD_SHOW_HELPER_ISE_LIST
4905 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4906 void InfoManager::show_helper_ise_list (int client_id)
4908 m_impl->show_helper_ise_list (client_id);
4911 //ISM_TRANS_CMD_SHOW_HELPER_ISE_SELECTOR
4912 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4913 void InfoManager::show_helper_ise_selector (int client_id)
4915 m_impl->show_helper_ise_selector (client_id);
4918 //ISM_TRANS_CMD_IS_HELPER_ISE_ENABLED
4920 void InfoManager::is_helper_ise_enabled (int client_id, String strAppid, _OUT_ uint32& nEnabled)
4922 m_impl->is_helper_ise_enabled (client_id, strAppid, nEnabled);
4925 //ISM_TRANS_CMD_GET_ISE_INFORMATION
4926 void InfoManager::get_ise_information (int client_id, String strUuid, _OUT_ String& strName, _OUT_ String& strLanguage,
4927 _OUT_ int& nType, _OUT_ int& nOption, _OUT_ String& strModuleName)
4929 m_impl->get_ise_information (client_id, strUuid, strName, strLanguage, nType, nOption, strModuleName);
4932 //ISM_TRANS_CMD_RESET_ISE_OPTION
4933 //reply SCIM_TRANS_CMD_OK
4934 bool InfoManager:: reset_ise_option (int client_id)
4936 return m_impl->reset_ise_option (client_id);
4939 //ISM_TRANS_CMD_SET_ACTIVE_ISE_BY_UUID
4941 bool InfoManager:: set_active_ise_by_uuid (int client_id, char* buf, size_t len)
4943 return m_impl->set_active_ise_by_uuid (client_id, buf, len);
4946 //ISM_TRANS_CMD_SET_INITIAL_ISE_BY_UUID
4947 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4948 void InfoManager::set_initial_ise_by_uuid (int client_id, char* buf, size_t len)
4950 m_impl->set_initial_ise_by_uuid (client_id, buf, len);
4953 //ISM_TRANS_CMD_SET_RETURN_KEY_TYPE
4954 void InfoManager::set_ise_return_key_type (int client_id, uint32 type)
4956 m_impl->set_ise_return_key_type (client_id, type);
4959 //ISM_TRANS_CMD_GET_RETURN_KEY_TYPE
4961 bool InfoManager:: get_ise_return_key_type (int client_id, _OUT_ uint32& type)
4963 return m_impl->get_ise_return_key_type (client_id, type);
4967 //ISM_TRANS_CMD_SET_RETURN_KEY_DISABLE
4968 void InfoManager::set_ise_return_key_disable (int client_id, uint32 disabled)
4970 m_impl->set_ise_return_key_disable (client_id, disabled);
4973 //ISM_TRANS_CMD_GET_RETURN_KEY_DISABLE
4974 bool InfoManager::get_ise_return_key_disable (int client_id, _OUT_ uint32& disabled)
4976 return m_impl->get_ise_return_key_disable (client_id, disabled);
4979 //ISM_TRANS_CMD_SET_CAPS_MODE
4980 void InfoManager::set_ise_caps_mode (int client_id, uint32 mode)
4982 m_impl->set_ise_caps_mode (client_id, mode);
4985 //SCIM_TRANS_CMD_RELOAD_CONFIG
4986 void InfoManager::reload_config (void)
4988 m_impl->reload_config ();
4991 //ISM_TRANS_CMD_SEND_WILL_SHOW_ACK
4992 void InfoManager::will_show_ack (int client_id)
4994 m_impl->will_show_ack (client_id);
4997 //ISM_TRANS_CMD_SEND_WILL_HIDE_ACK
4998 void InfoManager::will_hide_ack (int client_id)
5000 m_impl->will_hide_ack (client_id);
5003 //ISM_TRANS_CMD_RESET_DEFAULT_ISE
5004 void InfoManager::reset_default_ise (int client_id)
5006 m_impl->reset_default_ise (client_id);
5009 //ISM_TRANS_CMD_SET_HARDWARE_KEYBOARD_MODE
5010 void InfoManager::set_keyboard_mode (int client_id, uint32 mode)
5012 m_impl->set_keyboard_mode (client_id, mode);
5015 //ISM_TRANS_CMD_SEND_CANDIDATE_WILL_HIDE_ACK
5016 void InfoManager::candidate_will_hide_ack (int client_id)
5018 m_impl->candidate_will_hide_ack (client_id);
5021 //ISM_TRANS_CMD_GET_ACTIVE_HELPER_OPTION
5022 void InfoManager::get_active_helper_option (int client_id, _OUT_ uint32& option)
5024 m_impl->get_active_helper_option (client_id, option);
5027 //ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW
5028 void InfoManager::show_ise_option_window (int client_id, int caller_pid)
5030 m_impl->show_ise_option_window (client_id, caller_pid);
5033 //ISM_TRANS_CMD_GET_ISE_SETTING_APPID
5034 void InfoManager::get_ise_setting_appid (int client_id, String &ime_setting_appid)
5036 m_impl->get_ise_setting_appid (client_id, ime_setting_appid);
5039 //ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW
5040 void InfoManager::resume_ise_option_window (int client_id)
5042 m_impl->resume_ise_option_window (client_id);
5045 //ISM_TRANS_CMD_SET_KEYBOARD_MODE
5046 void InfoManager::set_ise_keyboard_mode (int client_id, uint32 mode)
5048 m_impl->set_ise_keyboard_mode (client_id, mode);
5051 //ISM_TRANS_CMD_SET_PREDICTION_HINT
5052 void InfoManager::set_prediction_hint (int client_id, String prediction_hint)
5054 m_impl->set_prediction_hint (client_id, prediction_hint);
5057 //ISM_TRANS_CMD_SET_MIME_TYPE
5058 void InfoManager::set_ise_mime_type (int client_id, String mime_type)
5060 m_impl->set_ise_mime_type (client_id, mime_type);
5063 //ISM_TRANS_CMD_FINALIZE_CONTENT
5064 void InfoManager::finalize_content (int client_id, String text, uint32 cursor_pos)
5066 m_impl->finalize_content (client_id, text, cursor_pos);
5069 //ISM_TRANS_CMD_SET_PREDICTION_HINT_DATA
5070 void InfoManager::set_prediction_hint_data (int client_id, String key, String value)
5072 m_impl->set_prediction_hint_data (client_id, key, value);
5075 //ISM_TRANS_CMD_SET_OPTIMIZATION_HINT
5076 void InfoManager::set_optimization_hint(int client_id, uint32 hint)
5078 m_impl->set_optimization_hint(client_id, hint);
5081 //ISM_TRANS_CMD_EXPAND_CANDIDATE
5082 void InfoManager::expand_candidate ()
5084 m_impl->expand_candidate ();
5087 //ISM_TRANS_CMD_CONTRACT_CANDIDATE
5088 void InfoManager::contract_candidate ()
5090 m_impl->contract_candidate ();
5093 //ISM_TRANS_CMD_GET_RECENT_ISE_GEOMETRY
5094 void InfoManager::get_recent_ise_geometry (int client_id, uint32 angle, _OUT_ struct rectinfo& info)
5096 m_impl->get_recent_ise_geometry (client_id, angle, info);
5099 //ISM_TRANS_CMD_SEND_REMOTE_INPUT_MESSAGE
5100 bool InfoManager::remoteinput_send_input_message (int client_id, char* buf, size_t len)
5102 return m_impl->send_remote_input_message (client_id, buf, len);
5105 void InfoManager::remoteinput_send_surrounding_text (const char* text, uint32 cursor)
5107 return m_impl->send_remote_surrounding_text (text, cursor);
5110 //ISM_TRANS_CMD_REGISTER_PANEL_CLIENT
5111 void InfoManager::register_panel_client (uint32 client_id, uint32 id)
5113 m_impl->register_panel_client (client_id, id);
5116 //SCIM_TRANS_CMD_PANEL_REGISTER_INPUT_CONTEXT
5117 void InfoManager::register_input_context (uint32 client_id, uint32 context, String uuid)
5119 m_impl->register_input_context (client_id, context, uuid);
5122 //SCIM_TRANS_CMD_PANEL_REMOVE_INPUT_CONTEXT
5123 void InfoManager::remove_input_context (uint32 client_id, uint32 context)
5125 m_impl->remove_input_context (client_id, context);
5128 //SCIM_TRANS_CMD_PANEL_RESET_INPUT_CONTEXT
5129 void InfoManager::socket_reset_input_context (int client_id, uint32 context)
5131 m_impl->socket_reset_input_context (client_id, context);
5134 //SCIM_TRANS_CMD_FOCUS_IN
5135 void InfoManager::focus_in (int client_id, uint32 context, String uuid)
5137 m_impl->focus_in (client_id, context, uuid);
5140 //SCIM_TRANS_CMD_FOCUS_OUT
5141 void InfoManager::focus_out (int client_id, uint32 context)
5143 m_impl->focus_out (client_id, context);
5146 //ISM_TRANS_CMD_PROCESS_INPUT_DEVICE_EVENT
5147 bool InfoManager::process_input_device_event(int client, uint32 type, const char *data, size_t len, _OUT_ uint32& result)
5149 return m_impl->process_input_device_event(client, type, data, len, result);
5152 //ISM_TRANS_CMD_TURN_ON_LOG
5153 void InfoManager::socket_turn_on_log (uint32 isOn)
5155 m_impl->socket_turn_on_log (isOn);
5158 //SCIM_TRANS_CMD_PANEL_TURN_ON
5159 void InfoManager::socket_turn_on (void)
5161 m_impl->socket_turn_on ();
5164 //SCIM_TRANS_CMD_PANEL_TURN_OFF
5165 void InfoManager::socket_turn_off (void)
5167 m_impl->socket_turn_off ();
5170 //SCIM_TRANS_CMD_UPDATE_SCREEN
5171 void InfoManager::socket_update_screen (int client_id, uint32 num)
5173 m_impl->socket_update_screen (client_id, num);
5176 //SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
5177 void InfoManager::socket_update_spot_location (uint32 x, uint32 y, uint32 top_y)
5179 m_impl->socket_update_spot_location (x, y, top_y);
5182 //ISM_TRANS_CMD_UPDATE_CURSOR_POSITION
5183 void InfoManager::socket_update_cursor_position (uint32 cursor_pos)
5185 m_impl->socket_update_cursor_position (cursor_pos);
5188 //ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT
5189 void InfoManager::socket_update_surrounding_text (String text, uint32 cursor)
5191 m_impl->socket_update_surrounding_text (text, cursor);
5194 void InfoManager::remoteinput_callback_focus_in (void)
5196 m_impl->remoteinput_callback_focus_in ();
5199 void InfoManager::remoteinput_callback_focus_out (void)
5201 m_impl->remoteinput_callback_focus_out ();
5204 void InfoManager::remoteinput_callback_entry_metadata (uint32 hint, uint32 layout, int variation, uint32 autocapital_type, int return_key_disabled, uint32 return_key_type)
5206 m_impl->remoteinput_callback_entry_metadata (hint, layout, variation, autocapital_type, return_key_disabled, return_key_type);
5209 void InfoManager::remoteinput_callback_surrounding_text (String text, uint32 cursor)
5211 m_impl->remoteinput_callback_surrounding_text (text, cursor);
5214 void InfoManager::remoteinput_callback_input_resource (uint32 input_resource)
5216 m_impl->remoteinput_callback_input_resource (input_resource);
5219 //ISM_TRANS_CMD_UPDATE_SELECTION
5220 void InfoManager::socket_update_selection (String text)
5222 m_impl->socket_update_selection (text);
5225 //FIXME: useless anymore
5226 //SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO
5227 void InfoManager::socket_update_factory_info (PanelFactoryInfo& info)
5229 m_impl->socket_update_factory_info (info);
5232 //SCIM_TRANS_CMD_PANEL_SHOW_HELP
5233 void InfoManager::socket_show_help (String help)
5235 m_impl->socket_show_help (help);
5238 //SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU
5239 void InfoManager::socket_show_factory_menu (std::vector <PanelFactoryInfo>& vec)
5241 m_impl->socket_show_factory_menu (vec);
5244 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
5245 void InfoManager::socket_show_preedit_string (void)
5247 m_impl->socket_show_preedit_string ();
5250 //SCIM_TRANS_CMD_SHOW_AUX_STRING
5251 void InfoManager::socket_show_aux_string (void)
5253 m_impl->socket_show_aux_string ();
5256 //SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE
5257 void InfoManager::socket_show_lookup_table (void)
5259 m_impl->socket_show_lookup_table ();
5262 //ISM_TRANS_CMD_SHOW_ASSOCIATE_TABLE
5263 void InfoManager::socket_show_associate_table (void)
5265 m_impl->socket_show_associate_table ();
5268 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
5269 void InfoManager::socket_hide_preedit_string (void)
5271 m_impl->socket_hide_preedit_string ();
5274 //SCIM_TRANS_CMD_HIDE_AUX_STRING
5275 void InfoManager::socket_hide_aux_string (void)
5277 m_impl->socket_hide_aux_string ();
5280 //SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE
5281 void InfoManager::socket_hide_lookup_table (void)
5283 m_impl->socket_hide_lookup_table ();
5286 //ISM_TRANS_CMD_HIDE_ASSOCIATE_TABLE
5287 void InfoManager::socket_hide_associate_table (void)
5289 m_impl->socket_hide_associate_table ();
5292 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
5293 void InfoManager::socket_update_preedit_string (String& str, const AttributeList& attrs, uint32 caret)
5295 m_impl->socket_update_preedit_string (str, attrs, caret);
5298 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
5299 void InfoManager::socket_update_preedit_caret (uint32 caret)
5301 m_impl->socket_update_preedit_caret (caret);
5304 //ISM_TRANS_CMD_RECAPTURE_STRING
5305 void InfoManager::socket_recapture_string (int offset, int len, String& preedit, String& commit, const AttributeList& attrs)
5307 m_impl->socket_recapture_string (offset, len, preedit, commit, attrs);
5310 //SCIM_TRANS_CMD_UPDATE_AUX_STRING
5311 void InfoManager::socket_update_aux_string (String& str, const AttributeList& attrs)
5313 m_impl->socket_update_aux_string (str, attrs);
5316 //SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE
5317 void InfoManager::socket_update_lookup_table (const LookupTable& table)
5319 m_impl->socket_update_lookup_table (table);
5322 //ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE
5323 void InfoManager::socket_update_associate_table (const LookupTable& table)
5325 m_impl->socket_update_associate_table (table);
5328 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
5329 void InfoManager::socket_register_properties (const PropertyList& properties)
5331 m_impl->socket_register_properties (properties);
5334 //SCIM_TRANS_CMD_UPDATE_PROPERTY
5335 void InfoManager::socket_update_property (const Property& property)
5337 m_impl->socket_update_property (property);
5340 //ISM_TRANS_CMD_GET_KEYBOARD_ISE_LIST
5341 void InfoManager::socket_get_keyboard_ise_list (String& uuid)
5343 m_impl->socket_get_keyboard_ise_list (uuid);
5346 //ISM_TRANS_CMD_SET_CANDIDATE_UI
5347 void InfoManager::socket_set_candidate_ui (uint32 portrait_line, uint32 mode)
5349 m_impl->socket_set_candidate_ui (portrait_line, mode);
5352 //ISM_TRANS_CMD_GET_CANDIDATE_UI
5353 void InfoManager::socket_get_candidate_ui (String uuid)
5355 m_impl->socket_get_candidate_ui (uuid);
5358 //ISM_TRANS_CMD_SET_CANDIDATE_POSITION
5359 void InfoManager::socket_set_candidate_position (uint32 left, uint32 top)
5361 m_impl->socket_set_candidate_position (left, top);
5364 //ISM_TRANS_CMD_HIDE_CANDIDATE
5365 void InfoManager::socket_hide_candidate (void)
5367 m_impl->socket_hide_candidate ();
5370 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
5371 void InfoManager::socket_get_candidate_geometry (String& uuid)
5373 m_impl->socket_get_candidate_geometry (uuid);
5376 //ISM_TRANS_CMD_SET_KEYBOARD_ISE_BY_UUID
5377 void InfoManager::socket_set_keyboard_ise (String uuid)
5379 m_impl->socket_set_keyboard_ise (uuid);
5382 //ISM_TRANS_CMD_SELECT_CANDIDATE
5383 void InfoManager::socket_helper_select_candidate (uint32 index)
5385 m_impl->socket_helper_select_candidate (index);
5388 //ISM_TRANS_CMD_UPDATE_ISE_GEOMETRY
5389 void InfoManager::socket_helper_update_ise_geometry (int client, uint32 x, uint32 y, uint32 width, uint32 height)
5391 m_impl->socket_helper_update_ise_geometry (client, x, y, width, height);
5394 //ISM_TRANS_CMD_GET_KEYBOARD_ISE
5395 void InfoManager::socket_get_keyboard_ise (String uuid)
5397 m_impl->socket_get_keyboard_ise (uuid);
5400 //SCIM_TRANS_CMD_START_HELPER
5401 void InfoManager::socket_start_helper (int client_id, uint32 context, String uuid)
5403 m_impl->socket_start_helper (client_id, context, uuid);
5406 //SCIM_TRANS_CMD_STOP_HELPER
5407 void InfoManager::socket_stop_helper (int client_id, uint32 context, String uuid)
5409 m_impl->socket_stop_helper (client_id, context, uuid);
5412 //SCIM_TRANS_CMD_SEND_HELPER_EVENT
5413 void InfoManager::socket_send_helper_event (int client_id, uint32 context, String uuid, const Transaction& _nest_trans)
5415 m_impl->socket_send_helper_event (client_id, context, uuid, _nest_trans);
5418 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
5419 void InfoManager::socket_helper_register_properties (int client, PropertyList& properties)
5421 m_impl->socket_helper_register_properties (client, properties);
5424 //SCIM_TRANS_CMD_UPDATE_PROPERTY
5425 void InfoManager::socket_helper_update_property (int client, Property& property)
5427 m_impl->socket_helper_update_property (client, property);
5430 //SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT
5431 void InfoManager::socket_helper_send_imengine_event (int client, uint32 target_ic, String target_uuid , Transaction& nest_trans)
5433 m_impl->socket_helper_send_imengine_event (client, target_ic, target_uuid, nest_trans);
5436 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
5437 //SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT
5438 void InfoManager::socket_helper_send_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key)
5440 m_impl->socket_helper_send_key_event (client, target_ic, target_uuid, key);
5443 //SCIM_TRANS_CMD_FORWARD_KEY_EVENT
5444 void InfoManager::socket_helper_forward_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key)
5446 m_impl->socket_helper_forward_key_event (client, target_ic, target_uuid, key);
5449 //SCIM_TRANS_CMD_COMMIT_STRING
5450 void InfoManager::socket_helper_commit_string (int client, uint32 target_ic, String target_uuid, WideString wstr)
5452 m_impl->socket_helper_commit_string (client, target_ic, target_uuid, wstr);
5455 //SCIM_TRANS_CMD_GET_SURROUNDING_TEXT
5456 void InfoManager::socket_helper_get_surrounding_text (int client, String uuid, uint32 maxlen_before, uint32 maxlen_after)
5458 m_impl->socket_helper_get_surrounding_text (client, uuid, maxlen_before, maxlen_after);
5461 //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT
5462 void InfoManager::socket_helper_delete_surrounding_text (int client, uint32 offset, uint32 len)
5464 m_impl->socket_helper_delete_surrounding_text (client, offset, len);
5467 //SCIM_TRANS_CMD_GET_SELECTION
5468 void InfoManager::socket_helper_get_selection (int client, String uuid)
5470 m_impl->socket_helper_get_selection (client, uuid);
5473 //SCIM_TRANS_CMD_SET_SELECTION
5474 void InfoManager::socket_helper_set_selection (int client, uint32 start, uint32 end)
5476 m_impl->socket_helper_set_selection (client, start, end);
5479 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
5480 void InfoManager::socket_helper_show_preedit_string (int client, uint32 target_ic, String target_uuid)
5482 m_impl->socket_helper_show_preedit_string (client, target_ic, target_uuid);
5485 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
5486 void InfoManager::socket_helper_hide_preedit_string (int client, uint32 target_ic, String target_uuid)
5488 m_impl->socket_helper_hide_preedit_string (client, target_ic, target_uuid);
5491 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
5492 void InfoManager::socket_helper_update_preedit_string (int client, uint32 target_ic, String target_uuid, WideString preedit,
5493 WideString commit, AttributeList& attrs, uint32 caret)
5495 m_impl->socket_helper_update_preedit_string (client, target_ic, target_uuid, preedit, commit, attrs, caret);
5498 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
5499 void InfoManager::socket_helper_update_preedit_caret (int client, uint32 caret)
5501 m_impl->socket_helper_update_preedit_caret (client, caret);
5504 //ISM_TRANS_CMD_RECAPTURE_STRING
5505 void InfoManager::socket_helper_recapture_string (int client, uint32 target_ic, String target_uuid, int offset, int len, WideString preedit,
5506 WideString commit, AttributeList& attrs)
5508 m_impl->socket_helper_recapture_string (client, target_ic, target_uuid, offset, len, preedit, commit, attrs);
5511 //SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
5512 void InfoManager::socket_helper_register_helper (int client, HelperInfo& info)
5514 m_impl->socket_helper_register_helper (client, info);
5517 //SCIM_TRANS_CMD_PANEL_REGISTER_ACTIVE_HELPER
5518 void InfoManager::socket_helper_register_helper_passive (int client, HelperInfo& info)
5520 m_impl->socket_helper_register_helper_passive (client, info);
5523 //ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
5524 void InfoManager::socket_helper_update_input_context (int client, uint32 type, uint32 value)
5526 m_impl->socket_helper_update_input_context (client, type, value);
5529 //ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE
5530 void InfoManager::socket_helper_update_language_locale(int client, String locale)
5532 m_impl->socket_helper_update_language_locale(client, locale);
5535 //SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
5536 void InfoManager::socket_helper_send_private_command (int client, String command)
5538 m_impl->socket_helper_send_private_command (client, command);
5541 //SCIM_TRANS_CMD_COMMIT_CONTENT
5542 void InfoManager::socket_helper_commit_content (int client, String content, String description, String mime_types)
5544 m_impl->socket_helper_commit_content (client, content, description, mime_types);
5547 //ISM_TRANS_CMD_UPDATE_ISE_EXIT
5548 void InfoManager::UPDATE_ISE_EXIT (int client)
5550 m_impl->UPDATE_ISE_EXIT (client);
5553 //ISM_TRANS_CMD_PROCESS_KEY_EVENT_DONE
5554 void InfoManager::process_key_event_done (KeyEvent &key, uint32 ret, uint32 serial)
5556 m_impl->process_key_event_done (key, ret, serial);
5559 //ISM_TRANS_CMD_REQUEST_ISE_HIDE
5560 void InfoManager::request_ise_hide ()
5562 m_impl->request_ise_hide ();
5565 bool InfoManager::check_privilege_by_sockfd (int client_id, const String& privilege) {
5566 return m_impl->check_privilege_by_sockfd (client_id, privilege);
5569 void InfoManager::add_client (int client_id, uint32 key, ClientType type)
5571 m_impl->add_client (client_id, key, type);
5574 void InfoManager::del_client (int client_id)
5576 m_impl->del_client (client_id);
5579 bool InfoManager::set_autocapital_type (int mode)
5581 return m_impl->set_autocapital_type (mode);
5584 void InfoManager::set_prediction_allow (int client, bool mode)
5586 m_impl->set_prediction_allow (client, mode);
5589 void InfoManager::reshow_input_panel ()
5591 m_impl->reshow_input_panel ();
5594 void InfoManager::request_ise_terminate ()
5596 m_impl->request_ise_terminate ();
5599 void InfoManager::set_floating_mode (uint32 floating_mode)
5601 m_impl->set_floating_mode (floating_mode);
5604 void InfoManager::set_floating_drag_enabled (uint32 enabled)
5606 m_impl->set_floating_drag_enabled (enabled);
5609 //////////////////////////////////Message function end/////////////////////////////////////////
5612 InfoManager::signal_connect_turn_on (InfoManagerSlotVoid* slot)
5614 return m_impl->signal_connect_turn_on (slot);
5618 InfoManager::signal_connect_turn_off (InfoManagerSlotVoid* slot)
5620 return m_impl->signal_connect_turn_off (slot);
5624 InfoManager::signal_connect_show_panel (InfoManagerSlotVoid* slot)
5626 return m_impl->signal_connect_show_panel (slot);
5630 InfoManager::signal_connect_hide_panel (InfoManagerSlotVoid* slot)
5632 return m_impl->signal_connect_hide_panel (slot);
5636 InfoManager::signal_connect_update_screen (InfoManagerSlotInt* slot)
5638 return m_impl->signal_connect_update_screen (slot);
5642 InfoManager::signal_connect_update_spot_location (InfoManagerSlotIntIntInt* slot)
5644 return m_impl->signal_connect_update_spot_location (slot);
5648 InfoManager::signal_connect_update_factory_info (InfoManagerSlotFactoryInfo* slot)
5650 return m_impl->signal_connect_update_factory_info (slot);
5654 InfoManager::signal_connect_start_default_ise (InfoManagerSlotVoid* slot)
5656 return m_impl->signal_connect_start_default_ise (slot);
5660 InfoManager::signal_connect_stop_default_ise (InfoManagerSlotBool* slot)
5662 return m_impl->signal_connect_stop_default_ise (slot);
5666 InfoManager::signal_connect_set_candidate_ui (InfoManagerSlotIntInt* slot)
5668 return m_impl->signal_connect_set_candidate_ui (slot);
5672 InfoManager::signal_connect_get_candidate_ui (InfoManagerSlotIntInt2* slot)
5674 return m_impl->signal_connect_get_candidate_ui (slot);
5678 InfoManager::signal_connect_set_candidate_position (InfoManagerSlotIntInt* slot)
5680 return m_impl->signal_connect_set_candidate_position (slot);
5684 InfoManager::signal_connect_get_candidate_geometry (InfoManagerSlotRect* slot)
5686 return m_impl->signal_connect_get_candidate_geometry (slot);
5690 InfoManager::signal_connect_get_input_panel_geometry (InfoManagerSlotRect* slot)
5692 return m_impl->signal_connect_get_input_panel_geometry (slot);
5696 InfoManager::signal_connect_set_keyboard_ise (InfoManagerSlotString* slot)
5698 return m_impl->signal_connect_set_keyboard_ise (slot);
5702 InfoManager::signal_connect_get_keyboard_ise (InfoManagerSlotString2* slot)
5704 return m_impl->signal_connect_get_keyboard_ise (slot);
5708 InfoManager::signal_connect_show_help (InfoManagerSlotString* slot)
5710 return m_impl->signal_connect_show_help (slot);
5714 InfoManager::signal_connect_show_factory_menu (InfoManagerSlotFactoryInfoVector* slot)
5716 return m_impl->signal_connect_show_factory_menu (slot);
5720 InfoManager::signal_connect_show_preedit_string (InfoManagerSlotVoid* slot)
5722 return m_impl->signal_connect_show_preedit_string (slot);
5726 InfoManager::signal_connect_show_aux_string (InfoManagerSlotVoid* slot)
5728 return m_impl->signal_connect_show_aux_string (slot);
5732 InfoManager::signal_connect_show_lookup_table (InfoManagerSlotVoid* slot)
5734 return m_impl->signal_connect_show_lookup_table (slot);
5738 InfoManager::signal_connect_show_associate_table (InfoManagerSlotVoid* slot)
5740 return m_impl->signal_connect_show_associate_table (slot);
5744 InfoManager::signal_connect_hide_preedit_string (InfoManagerSlotVoid* slot)
5746 return m_impl->signal_connect_hide_preedit_string (slot);
5750 InfoManager::signal_connect_hide_aux_string (InfoManagerSlotVoid* slot)
5752 return m_impl->signal_connect_hide_aux_string (slot);
5756 InfoManager::signal_connect_hide_lookup_table (InfoManagerSlotVoid* slot)
5758 return m_impl->signal_connect_hide_lookup_table (slot);
5762 InfoManager::signal_connect_hide_associate_table (InfoManagerSlotVoid* slot)
5764 return m_impl->signal_connect_hide_associate_table (slot);
5768 InfoManager::signal_connect_update_preedit_string (InfoManagerSlotAttributeStringInt* slot)
5770 return m_impl->signal_connect_update_preedit_string (slot);
5774 InfoManager::signal_connect_update_preedit_caret (InfoManagerSlotInt* slot)
5776 return m_impl->signal_connect_update_preedit_caret (slot);
5780 InfoManager::signal_connect_update_aux_string (InfoManagerSlotAttributeString* slot)
5782 return m_impl->signal_connect_update_aux_string (slot);
5786 InfoManager::signal_connect_update_lookup_table (InfoManagerSlotLookupTable* slot)
5788 return m_impl->signal_connect_update_lookup_table (slot);
5792 InfoManager::signal_connect_update_associate_table (InfoManagerSlotLookupTable* slot)
5794 return m_impl->signal_connect_update_associate_table (slot);
5798 InfoManager::signal_connect_register_properties (InfoManagerSlotPropertyList* slot)
5800 return m_impl->signal_connect_register_properties (slot);
5804 InfoManager::signal_connect_update_property (InfoManagerSlotProperty* slot)
5806 return m_impl->signal_connect_update_property (slot);
5810 InfoManager::signal_connect_register_helper_properties (InfoManagerSlotIntPropertyList* slot)
5812 return m_impl->signal_connect_register_helper_properties (slot);
5816 InfoManager::signal_connect_update_helper_property (InfoManagerSlotIntProperty* slot)
5818 return m_impl->signal_connect_update_helper_property (slot);
5822 InfoManager::signal_connect_register_helper (InfoManagerSlotIntHelperInfo* slot)
5824 return m_impl->signal_connect_register_helper (slot);
5828 InfoManager::signal_connect_remove_helper (InfoManagerSlotInt* slot)
5830 return m_impl->signal_connect_remove_helper (slot);
5834 InfoManager::signal_connect_set_active_ise_by_uuid (InfoManagerSlotStringBool* slot)
5836 return m_impl->signal_connect_set_active_ise_by_uuid (slot);
5840 InfoManager::signal_connect_focus_in (InfoManagerSlotVoid* slot)
5842 return m_impl->signal_connect_focus_in (slot);
5846 InfoManager::signal_connect_focus_out (InfoManagerSlotVoid* slot)
5848 return m_impl->signal_connect_focus_out (slot);
5852 InfoManager::signal_connect_expand_candidate (InfoManagerSlotVoid* slot)
5854 return m_impl->signal_connect_expand_candidate (slot);
5858 InfoManager::signal_connect_contract_candidate (InfoManagerSlotVoid* slot)
5860 return m_impl->signal_connect_contract_candidate (slot);
5864 InfoManager::signal_connect_select_candidate (InfoManagerSlotInt* slot)
5866 return m_impl->signal_connect_select_candidate (slot);
5870 InfoManager::signal_connect_get_ise_list (InfoManagerSlotBoolStringVector* slot)
5872 return m_impl->signal_connect_get_ise_list (slot);
5876 InfoManager::signal_connect_get_all_helper_ise_info (InfoManagerSlotBoolHelperInfo* slot)
5878 return m_impl->signal_connect_get_all_helper_ise_info (slot);
5882 InfoManager::signal_connect_set_has_option_helper_ise_info (InfoManagerSlotStringBool* slot)
5884 return m_impl->signal_connect_set_has_option_helper_ise_info (slot);
5888 InfoManager::signal_connect_set_enable_helper_ise_info (InfoManagerSlotStringBool* slot)
5890 return m_impl->signal_connect_set_enable_helper_ise_info (slot);
5894 InfoManager::signal_connect_show_helper_ise_list (InfoManagerSlotVoid* slot)
5896 return m_impl->signal_connect_show_helper_ise_list (slot);
5900 InfoManager::signal_connect_show_helper_ise_selector (InfoManagerSlotVoid* slot)
5902 return m_impl->signal_connect_show_helper_ise_selector (slot);
5906 InfoManager::signal_connect_is_helper_ise_enabled (InfoManagerSlotStringInt* slot)
5908 return m_impl->signal_connect_is_helper_ise_enabled (slot);
5912 InfoManager::signal_connect_get_ise_information (InfoManagerSlotBoolString4int2* slot)
5914 return m_impl->signal_connect_get_ise_information (slot);
5918 InfoManager::signal_connect_get_keyboard_ise_list (InfoManagerSlotBoolStringVector* slot)
5920 return m_impl->signal_connect_get_keyboard_ise_list (slot);
5924 InfoManager::signal_connect_update_ise_geometry (InfoManagerSlotIntIntIntInt* slot)
5926 return m_impl->signal_connect_update_ise_geometry (slot);
5930 InfoManager::signal_connect_get_language_list (InfoManagerSlotStringVector* slot)
5932 return m_impl->signal_connect_get_language_list (slot);
5936 InfoManager::signal_connect_get_all_language (InfoManagerSlotStringVector* slot)
5938 return m_impl->signal_connect_get_all_language (slot);
5942 InfoManager::signal_connect_get_ise_language (InfoManagerSlotStrStringVector* slot)
5944 return m_impl->signal_connect_get_ise_language (slot);
5948 InfoManager::signal_connect_get_ise_info_by_uuid (InfoManagerSlotStringISEINFO* slot)
5950 return m_impl->signal_connect_get_ise_info_by_uuid (slot);
5954 InfoManager::signal_connect_send_key_event (InfoManagerSlotKeyEvent* slot)
5956 return m_impl->signal_connect_send_key_event (slot);
5960 InfoManager::signal_connect_accept_connection (InfoManagerSlotInt* slot)
5962 return m_impl->signal_connect_accept_connection (slot);
5966 InfoManager::signal_connect_close_connection (InfoManagerSlotInt* slot)
5968 return m_impl->signal_connect_close_connection (slot);
5972 InfoManager::signal_connect_exit (InfoManagerSlotVoid* slot)
5974 return m_impl->signal_connect_exit (slot);
5978 InfoManager::signal_connect_transaction_start (InfoManagerSlotVoid* slot)
5980 return m_impl->signal_connect_transaction_start (slot);
5984 InfoManager::signal_connect_transaction_end (InfoManagerSlotVoid* slot)
5986 return m_impl->signal_connect_transaction_end (slot);
5990 InfoManager::signal_connect_lock (InfoManagerSlotVoid* slot)
5992 return m_impl->signal_connect_lock (slot);
5996 InfoManager::signal_connect_unlock (InfoManagerSlotVoid* slot)
5998 return m_impl->signal_connect_unlock (slot);
6002 InfoManager::signal_connect_update_input_context (InfoManagerSlotIntInt* slot)
6004 return m_impl->signal_connect_update_input_context (slot);
6008 InfoManager::signal_connect_show_ise (InfoManagerSlotVoid* slot)
6010 return m_impl->signal_connect_show_ise (slot);
6014 InfoManager::signal_connect_hide_ise (InfoManagerSlotVoid* slot)
6016 return m_impl->signal_connect_hide_ise (slot);
6020 InfoManager::signal_connect_will_show_ack (InfoManagerSlotVoid* slot)
6022 return m_impl->signal_connect_will_show_ack (slot);
6026 InfoManager::signal_connect_will_hide_ack (InfoManagerSlotVoid* slot)
6028 return m_impl->signal_connect_will_hide_ack (slot);
6032 InfoManager::signal_connect_set_keyboard_mode (InfoManagerSlotInt* slot)
6034 return m_impl->signal_connect_set_keyboard_mode (slot);
6038 InfoManager::signal_connect_candidate_will_hide_ack (InfoManagerSlotVoid* slot)
6040 return m_impl->signal_connect_candidate_will_hide_ack (slot);
6044 InfoManager::signal_connect_get_ise_state (InfoManagerSlotInt2* slot)
6046 return m_impl->signal_connect_get_ise_state (slot);
6050 InfoManager::signal_connect_run_helper (InfoManagerSlotString3* slot)
6052 return m_impl->signal_connect_run_helper (slot);
6056 InfoManager::signal_connect_launch_option_application (InfoManagerSlotBoolString* slot)
6058 return m_impl->signal_connect_launch_option_application (slot);
6062 InfoManager::signal_connect_get_ise_setting_appid (InfoManagerSlotBoolString2* slot)
6064 return m_impl->signal_connect_get_ise_setting_appid (slot);
6068 InfoManager::signal_connect_get_recent_ise_geometry (InfoManagerSlotIntRect* slot)
6070 return m_impl->signal_connect_get_recent_ise_geometry (slot);
6074 InfoManager::signal_connect_check_privilege_by_sockfd (InfoManagerSlotIntString2* slot)
6076 return m_impl->signal_connect_check_privilege_by_sockfd (slot);
6080 InfoManager::signal_connect_remoteinput_send_input_message (InfoManagerSlotStringBool* slot)
6082 return m_impl->signal_connect_remoteinput_send_input_message (slot);
6086 InfoManager::signal_connect_remoteinput_send_surrounding_text (InfoManagerSlotIntString* slot)
6088 return m_impl->signal_connect_remoteinput_send_surrounding_text (slot);
6091 } /* namespace scim */
6094 vi:ts=4:nowrap:ai:expandtab