1 /** @file isf_info_manager.cpp
2 * @brief Implementation of class InfoManager.
5 /* ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable. */
8 * Smart Common Input Method
10 * Copyright (c) 2005 James Su <suzhe@tsinghua.org.cn>
11 * Copyright (c) 2012-2016 Samsung Electronics Co., Ltd.
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License for more details.
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this program; if not, write to the
26 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
27 * Boston, MA 02111-1307 USA
29 * Modifications by Samsung Electronics Co., Ltd.
31 * a. m_signal_set_keyboard_ise and m_signal_get_keyboard_ise
32 * b. m_signal_focus_in and m_signal_focus_out
33 * c. m_signal_expand_candidate, m_signal_contract_candidate and m_signal_set_candidate_ui
34 * d. m_signal_get_ise_list, m_signal_get_keyboard_ise_list, m_signal_update_ise_geometry and m_signal_get_ise_information
35 * e. m_signal_set_active_ise_by_uuid and m_signal_get_ise_info_by_uuid
36 * f. m_signal_accept_connection, m_signal_close_connection and m_signal_exit
37 * 2. Add new interface APIs in PanelClient class
38 * a. get_helper_manager_id (), has_helper_manager_pending_event () and filter_helper_manager_event ()
39 * b. update_candidate_panel_event (), update_input_panel_event () and select_aux ()
40 * c. candidate_more_window_show () and candidate_more_window_hide ()
41 * d. update_displayed_candidate_number () and update_candidate_item_layout ()
42 * e. stop_helper (), send_longpress_event () and update_ise_list ()
43 * f. filter_event (), filter_exception_event () and get_server_id ()
44 * 3. Donot use thread to receive message
45 * 4. Monitor socket frontend for self-recovery function
47 * $Id: scim_panel_agent.cpp,v 1.8.2.1 2006/01/09 14:32:18 suzhe Exp $
52 #define Uses_SCIM_PANEL_AGENT
53 #define Uses_SCIM_HELPER
54 #define Uses_SCIM_EVENT
55 #define Uses_SCIM_CONFIG
56 #define Uses_SCIM_CONFIG_MODULE
57 #define Uses_SCIM_CONFIG_PATH
58 #define Uses_SCIM_UTILITY
61 #include <sys/types.h>
62 #include <sys/times.h>
65 #include "scim_private.h"
67 #include "scim_stl_map.h"
68 #include "isf_panel_agent_manager.h"
69 #include "isf_debug.h"
71 #include "ise_context.h"
76 #define LOG_TAG "ISF_PANEL_EFL"
78 #define MIN_REPEAT_TIME 2.0
84 InfoManagerSignalVoid;
86 typedef Signal1<void, int>
89 typedef Signal1<void, int&>
90 InfoManagerSignalInt2;
92 typedef Signal1<void, const String&>
93 InfoManagerSignalString;
95 typedef Signal2<void, const String&, bool>
96 InfoManagerSignalStringBool;
98 typedef Signal2<void, String&, String&>
99 InfoManagerSignalString2;
101 typedef Signal2<void, int, const String&>
102 InfoManagerSignalIntString;
104 typedef Signal1<void, const PanelFactoryInfo&>
105 InfoManagerSignalFactoryInfo;
107 typedef Signal1<void, const std::vector <PanelFactoryInfo> &>
108 InfoManagerSignalFactoryInfoVector;
110 typedef Signal1<void, const LookupTable&>
111 InfoManagerSignalLookupTable;
113 typedef Signal1<void, const Property&>
114 InfoManagerSignalProperty;
116 typedef Signal1<void, const PropertyList&>
117 InfoManagerSignalPropertyList;
119 typedef Signal2<void, int, int>
120 InfoManagerSignalIntInt;
122 typedef Signal2<void, int&, int&>
123 InfoManagerSignalIntInt2;
125 typedef Signal3<void, int, int, int>
126 InfoManagerSignalIntIntInt;
128 typedef Signal3<void, const String &, const String &, const String &>
129 InfoManagerSignalString3;
131 typedef Signal4<void, int, int, int, int>
132 InfoManagerSignalIntIntIntInt;
134 typedef Signal2<void, int, const Property&>
135 InfoManagerSignalIntProperty;
137 typedef Signal2<void, int, const PropertyList&>
138 InfoManagerSignalIntPropertyList;
140 typedef Signal2<void, int, const HelperInfo&>
141 InfoManagerSignalIntHelperInfo;
143 typedef Signal3<void, const String&, const AttributeList&, int>
144 InfoManagerSignalAttributeStringInt;
146 typedef Signal5<void, int, int, const String&, const String&, const AttributeList&>
147 InfoManagerSignalAttributeInt2String2;
149 typedef Signal2<void, const String&, const AttributeList&>
150 InfoManagerSignalAttributeString;
152 typedef Signal1<void, std::vector <String> &>
153 InfoManagerSignalStringVector;
155 typedef Signal1<bool, HELPER_ISE_INFO&>
156 InfoManagerSignalBoolHelperInfo;
158 typedef Signal1<bool, std::vector <String> &>
159 InfoManagerSignalBoolStringVector;
161 typedef Signal2<void, char*, std::vector <String> &>
162 InfoManagerSignalStrStringVector;
164 typedef Signal2<bool, const String&, ISE_INFO&>
165 InfoManagerSignalStringISEINFO;
167 typedef Signal2<bool, String, int&>
168 InfoManagerSignalStringInt;
170 typedef Signal1<void, const KeyEvent&>
171 InfoManagerSignalKeyEvent;
173 typedef Signal1<void, struct rectinfo&>
174 InfoManagerSignalRect;
176 typedef Signal6<bool, String, String&, String&, int&, int&, String&>
177 InfoManagerSignalBoolString4int2;
179 typedef Signal2<void, int, struct rectinfo&>
180 InfoManagerSignalIntRect;
182 typedef Signal2<bool, int, String>
183 InfoManagerSignalIntString2;
185 typedef Signal1<bool, String>
186 InfoManagerSignalBoolString;
188 struct HelperClientStub {
192 HelperClientStub (int i = 0, int r = 0) : id (i), ref (r) { }
195 struct IMControlStub {
196 std::vector<ISE_INFO> info;
197 std::vector<int> count;
200 #define DEFAULT_CONTEXT_VALUE 0xfff
202 #if SCIM_USE_STL_EXT_HASH_MAP
203 typedef __gnu_cxx::hash_map <int, ClientInfo, __gnu_cxx::hash <int> > ClientRepository;
204 typedef __gnu_cxx::hash_map <int, HelperInfo, __gnu_cxx::hash <int> > HelperInfoRepository;
205 typedef __gnu_cxx::hash_map <uint32, String, __gnu_cxx::hash <unsigned int> > ClientContextUUIDRepository;
206 typedef __gnu_cxx::hash_map <String, HelperClientStub, scim_hash_string> HelperClientIndex;
207 typedef __gnu_cxx::hash_map <String, std::vector < std::pair <uint32, String> >, scim_hash_string> StartHelperICIndex;
208 #elif SCIM_USE_STL_HASH_MAP
209 typedef std::hash_map <int, ClientInfo, std::hash <int> > ClientRepository;
210 typedef std::hash_map <int, HelperInfo, std::hash <int> > HelperInfoRepository;
211 typedef std::hash_map <uint32, String, std::hash <unsigned int> > ClientContextUUIDRepository;
212 typedef std::hash_map <String, HelperClientStub, scim_hash_string> HelperClientIndex;
213 typedef std::hash_map <String, std::vector < std::pair <uint32, String> >, scim_hash_string> StartHelperICIndex;
215 typedef std::map <int, ClientInfo> ClientRepository;
216 typedef std::map <int, HelperInfo> HelperInfoRepository;
217 typedef std::map <uint32, String> ClientContextUUIDRepository;
218 typedef std::map <String, HelperClientStub> HelperClientIndex;
219 typedef std::map <String, std::vector < std::pair <uint32, String> > > StartHelperICIndex;
222 typedef std::map <String, uint32> UUIDCountRepository;
223 typedef std::map <String, enum HelperState> UUIDStateRepository;
224 typedef std::map <String, int> StringIntRepository;
225 typedef std::map <int, struct IMControlStub> IMControlRepository;
226 typedef std::map <int, int> IntIntRepository;
229 get_helper_ic (int client, uint32 context)
231 return (uint32) (client & 0xFFFF) | ((context & 0x7FFF) << 16);
235 get_imengine_client_context (uint32 helper_ic, int& client, uint32& context)
237 client = (int) (helper_ic & 0xFFFF);
238 context = ((helper_ic >> 16) & 0x7FFF);
242 clients_equal (int first, int second)
244 return ((first & 0xFFFF) == (second & 0xFFFF));
248 contexts_equal (uint32 first, uint32 second)
250 return ((first & 0x7FFF) == (second & 0x7FFF));
253 //==================================== InfoManager ===========================
254 class InfoManager::InfoManagerImpl
256 int m_current_screen;
258 String m_config_name;
259 String m_display_name;
261 int m_current_socket_client;
262 uint32 m_current_client_context;
263 String m_current_context_uuid;
264 TOOLBAR_MODE_T m_current_toolbar_mode;
265 uint32 m_current_helper_option;
266 String m_current_helper_uuid;
267 String m_last_helper_uuid;
268 String m_current_ise_name;
269 int m_pending_active_imcontrol_id;
270 int m_show_request_client_id;
271 int m_active_client_id;
272 IntIntRepository m_panel_client_map;
273 IntIntRepository m_imcontrol_map;
274 bool m_should_shared_ise;
276 bool m_is_imengine_aux;
277 bool m_is_imengine_candidate;
278 bool m_refocus_needed;
279 bool m_reshow_needed;
280 bool m_restart_needed;
282 std::vector<int> m_current_send_remoteinput_id;
283 std::vector<int> m_current_recv_remoteinput_id;
285 int m_last_socket_client;
286 uint32 m_last_client_context;
287 String m_last_context_uuid;
289 char* m_ise_context_buffer;
290 size_t m_ise_context_length;
291 char* m_imdata_buffer;
292 size_t m_imdata_length;
294 ClientRepository m_client_repository;
296 * Each Helper ISE has two socket connect between InfoManager and HelperAgent.
297 * m_helper_info_repository records the active connection.
298 * m_helper_active_info_repository records the passive connection.
300 HelperInfoRepository m_helper_info_repository;
301 HelperInfoRepository m_helper_active_info_repository;
302 HelperClientIndex m_helper_client_index;
304 /* when helper register, notify imcontrol client */
305 StringIntRepository m_ise_pending_repository;
306 IMControlRepository m_imcontrol_repository;
308 StartHelperICIndex m_start_helper_ic_index;
311 ClientContextUUIDRepository m_client_context_uuids;
314 ClientContextUUIDRepository m_client_context_helper;
315 UUIDCountRepository m_helper_uuid_count;
317 InfoManagerSignalVoid m_signal_turn_on;
318 InfoManagerSignalVoid m_signal_turn_off;
319 InfoManagerSignalVoid m_signal_show_panel;
320 InfoManagerSignalVoid m_signal_hide_panel;
321 InfoManagerSignalInt m_signal_update_screen;
322 InfoManagerSignalIntIntInt m_signal_update_spot_location;
323 InfoManagerSignalFactoryInfo m_signal_update_factory_info;
324 InfoManagerSignalVoid m_signal_start_default_ise;
325 InfoManagerSignalVoid m_signal_stop_default_ise;
326 InfoManagerSignalIntInt m_signal_update_input_context;
327 InfoManagerSignalString m_signal_update_language_locale;
328 InfoManagerSignalIntInt m_signal_set_candidate_ui;
329 InfoManagerSignalIntInt2 m_signal_get_candidate_ui;
330 InfoManagerSignalIntInt m_signal_set_candidate_position;
331 InfoManagerSignalRect m_signal_get_candidate_geometry;
332 InfoManagerSignalRect m_signal_get_input_panel_geometry;
333 InfoManagerSignalString m_signal_set_keyboard_ise;
334 InfoManagerSignalString2 m_signal_get_keyboard_ise;
335 InfoManagerSignalString m_signal_show_help;
336 InfoManagerSignalFactoryInfoVector m_signal_show_factory_menu;
337 InfoManagerSignalVoid m_signal_show_preedit_string;
338 InfoManagerSignalVoid m_signal_show_aux_string;
339 InfoManagerSignalVoid m_signal_show_lookup_table;
340 InfoManagerSignalVoid m_signal_show_associate_table;
341 InfoManagerSignalVoid m_signal_hide_preedit_string;
342 InfoManagerSignalVoid m_signal_hide_aux_string;
343 InfoManagerSignalVoid m_signal_hide_lookup_table;
344 InfoManagerSignalVoid m_signal_hide_associate_table;
345 InfoManagerSignalAttributeStringInt m_signal_update_preedit_string;
346 InfoManagerSignalAttributeInt2String2 m_signal_recapture_string;
347 InfoManagerSignalInt m_signal_update_preedit_caret;
348 InfoManagerSignalAttributeString m_signal_update_aux_string;
349 InfoManagerSignalLookupTable m_signal_update_lookup_table;
350 InfoManagerSignalLookupTable m_signal_update_associate_table;
351 InfoManagerSignalPropertyList m_signal_register_properties;
352 InfoManagerSignalProperty m_signal_update_property;
353 InfoManagerSignalIntPropertyList m_signal_register_helper_properties;
354 InfoManagerSignalIntProperty m_signal_update_helper_property;
355 InfoManagerSignalIntHelperInfo m_signal_register_helper;
356 InfoManagerSignalInt m_signal_remove_helper;
357 InfoManagerSignalStringBool m_signal_set_active_ise_by_uuid;
358 InfoManagerSignalVoid m_signal_focus_in;
359 InfoManagerSignalVoid m_signal_focus_out;
360 InfoManagerSignalVoid m_signal_expand_candidate;
361 InfoManagerSignalVoid m_signal_contract_candidate;
362 InfoManagerSignalInt m_signal_select_candidate;
363 InfoManagerSignalBoolStringVector m_signal_get_ise_list;
364 InfoManagerSignalBoolHelperInfo m_signal_get_all_helper_ise_info;
365 InfoManagerSignalStringBool m_signal_set_has_option_helper_ise_info;
366 InfoManagerSignalStringBool m_signal_set_enable_helper_ise_info;
367 InfoManagerSignalVoid m_signal_show_helper_ise_list;
368 InfoManagerSignalVoid m_signal_show_helper_ise_selector;
369 InfoManagerSignalStringInt m_signal_is_helper_ise_enabled;
370 InfoManagerSignalBoolString4int2 m_signal_get_ise_information;
371 InfoManagerSignalBoolStringVector m_signal_get_keyboard_ise_list;
372 InfoManagerSignalIntIntIntInt m_signal_update_ise_geometry;
373 InfoManagerSignalStringVector m_signal_get_language_list;
374 InfoManagerSignalStringVector m_signal_get_all_language;
375 InfoManagerSignalStrStringVector m_signal_get_ise_language;
376 InfoManagerSignalStringISEINFO m_signal_get_ise_info_by_uuid;
377 InfoManagerSignalKeyEvent m_signal_send_key_event;
379 InfoManagerSignalInt m_signal_accept_connection;
380 InfoManagerSignalInt m_signal_close_connection;
381 InfoManagerSignalVoid m_signal_exit;
383 InfoManagerSignalVoid m_signal_transaction_start;
384 InfoManagerSignalVoid m_signal_transaction_end;
386 InfoManagerSignalVoid m_signal_lock;
387 InfoManagerSignalVoid m_signal_unlock;
389 InfoManagerSignalVoid m_signal_show_ise;
390 InfoManagerSignalVoid m_signal_hide_ise;
392 InfoManagerSignalVoid m_signal_will_show_ack;
393 InfoManagerSignalVoid m_signal_will_hide_ack;
395 InfoManagerSignalInt m_signal_set_keyboard_mode;
397 InfoManagerSignalVoid m_signal_candidate_will_hide_ack;
398 InfoManagerSignalInt2 m_signal_get_ise_state;
399 InfoManagerSignalString3 m_signal_run_helper;
401 InfoManagerSignalIntRect m_signal_get_recent_ise_geometry;
403 InfoManagerSignalStringBool m_signal_remoteinput_send_input_message;
404 InfoManagerSignalIntString m_signal_remoteinput_send_surrounding_text;
406 InfoManagerSignalIntString2 m_signal_check_privilege_by_sockfd;
408 InfoManagerSignalBoolString m_signal_launch_option_application;
410 PanelAgentManager m_panel_agent_manager;
412 void delete_ise_context_buffer (void) {
413 if (m_ise_context_buffer != NULL) {
414 delete[] m_ise_context_buffer;
415 m_ise_context_buffer = NULL;
416 m_ise_context_length = 0;
420 void delete_imdata_buffer (void) {
421 if (m_imdata_buffer != NULL) {
422 delete[] m_imdata_buffer;
423 m_imdata_buffer = NULL;
430 : m_current_screen (0),
431 m_current_socket_client (-1), m_current_client_context (0),
432 m_current_toolbar_mode (TOOLBAR_KEYBOARD_MODE),
433 m_current_helper_option (0),
434 m_pending_active_imcontrol_id (-1),
435 m_show_request_client_id (-1),
436 m_active_client_id (-1),
437 m_should_shared_ise (false),
438 m_ise_exiting (false), m_is_imengine_aux (false), m_is_imengine_candidate (false),
439 m_refocus_needed (false),
440 m_reshow_needed (false),
441 m_restart_needed (true),
442 m_last_socket_client (-1), m_last_client_context (0),
443 m_ise_context_buffer (NULL), m_ise_context_length (0),
444 m_imdata_buffer (NULL), m_imdata_length (0) {
445 m_current_ise_name = String (_ ("English Keyboard"));
446 m_imcontrol_repository.clear ();
447 m_imcontrol_map.clear ();
448 m_current_send_remoteinput_id.clear ();
449 m_current_recv_remoteinput_id.clear ();
450 m_panel_client_map.clear ();
453 ~InfoManagerImpl () {
454 delete_ise_context_buffer ();
455 delete_imdata_buffer ();
458 bool initialize (InfoManager* info_manager, const ConfigPointer& config, const String& display, bool resident) {
460 m_config_name = "socket";
461 m_display_name = display;
463 return m_panel_agent_manager.initialize (info_manager, config, display, resident);
466 bool valid (void) const {
467 return m_panel_agent_manager.valid ();
473 SCIM_DEBUG_MAIN (1) << "InfoManager::stop ()\n";
475 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
476 String helper_uuid = get_current_helper_uuid ();
477 hide_helper (helper_uuid);
478 stop_helper (helper_uuid, -2, 0);
481 m_panel_agent_manager.stop ();
484 TOOLBAR_MODE_T get_current_toolbar_mode () const {
485 return m_current_toolbar_mode;
488 String get_current_ise_name () const {
489 return m_current_ise_name;
492 String get_current_helper_uuid () const {
493 return m_current_helper_uuid;
496 uint32 get_current_helper_option () const {
497 return m_current_helper_option;
500 void set_current_ise_name (String& name) {
501 m_current_ise_name = name;
504 void set_current_toolbar_mode (TOOLBAR_MODE_T mode) {
505 m_current_toolbar_mode = mode;
508 void set_current_helper_option (uint32 option) {
509 m_current_helper_option = option;
512 void update_panel_event (int cmd, uint32 nType, uint32 nValue) {
514 uint32 focused_context;
515 get_focused_context (focused_client, focused_context);
517 if (focused_client == -1 && m_active_client_id != -1) {
518 focused_client = m_panel_client_map[m_active_client_id];
522 SCIM_DEBUG_MAIN (1) << __func__ << " (" << nType << ", " << nValue << "), client=" << focused_client << "\n";
523 ClientInfo client_info = socket_get_client_info (focused_client);
525 if (client_info.type == FRONTEND_CLIENT) {
526 m_panel_agent_manager.update_panel_event (focused_client, focused_context, cmd, nType, nValue);
528 std::cerr << __func__ << " focused client is not existed!!!" << "\n";
531 if (m_panel_client_map[m_show_request_client_id] != focused_client) {
532 client_info = socket_get_client_info (m_panel_client_map[m_show_request_client_id]);
534 if (client_info.type == FRONTEND_CLIENT) {
535 m_panel_agent_manager.update_panel_event (m_panel_client_map[m_show_request_client_id], 0, cmd, nType, nValue);
536 std::cerr << __func__ << " show request client=" << m_panel_client_map[m_show_request_client_id] << "\n";
538 std::cerr << __func__ << " show request client is not existed!!!" << "\n";
543 bool move_preedit_caret (uint32 position) {
544 SCIM_DEBUG_MAIN (1) << "InfoManager::move_preedit_caret (" << position << ")\n";
548 get_focused_context (client, context);
551 m_panel_agent_manager.update_preedit_caret (client, context, position);
559 bool request_help (void) {
560 SCIM_DEBUG_MAIN (1) << "InfoManager::request_help ()\n";
564 get_focused_context (client, context);
567 m_panel_agent_manager.request_help (client, context);
574 bool request_factory_menu (void) {
575 SCIM_DEBUG_MAIN (1) << "InfoManager::request_factory_menu ()\n";
579 get_focused_context (client, context);
582 m_panel_agent_manager.request_factory_menu (client, context);
590 //ISM_TRANS_CMD_PANEL_RESET_KEYBOARD_ISE
591 bool reset_keyboard_ise (void) {
592 SCIM_DEBUG_MAIN (1) << "InfoManager::reset_keyboard_ise ()\n";
596 get_focused_context (client, context);
599 m_panel_agent_manager.reset_keyboard_ise (client, context);
606 bool update_keyboard_ise_list (void) {
607 SCIM_DEBUG_MAIN (1) << "InfoManager::update_keyboard_ise_list ()\n";
611 get_focused_context (client, context);
614 m_panel_agent_manager.update_keyboard_ise_list (client, context);
621 bool change_factory (const String& uuid) {
622 SCIM_DEBUG_MAIN (1) << "InfoManager::change_factory (" << uuid << ")\n";
626 if (scim_global_config_read (SCIM_GLOBAL_CONFIG_PRELOAD_KEYBOARD_ISE, false))
627 m_helper_manager.preload_keyboard_ise (uuid);
630 get_focused_context (client, context);
633 m_panel_agent_manager.change_factory (client, context, uuid);
640 bool helper_candidate_show (void) {
641 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
646 get_focused_context (client, context);
648 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
649 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
651 if (it != m_helper_client_index.end ()) {
652 uint32 ctx = get_helper_ic (client, context);
653 m_panel_agent_manager.helper_candidate_show (it->second.id, ctx, m_current_helper_uuid);
658 /* Inform wayland module that we are showing candidate window */
660 uint32 focused_context;
661 String focused_uuid = get_focused_context(focused_client, focused_context);
662 m_panel_agent_manager.helper_candidate_show(focused_client, focused_context, focused_uuid);
667 bool helper_candidate_hide (void) {
668 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
673 get_focused_context (client, context);
675 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
676 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
678 if (it != m_helper_client_index.end ()) {
679 uint32 ctx = get_helper_ic (client, context);
680 m_panel_agent_manager.helper_candidate_hide (it->second.id, ctx, m_current_helper_uuid);
685 /* Inform wayland module that we are hiding candidate window */
687 uint32 focused_context;
688 String focused_uuid = get_focused_context(focused_client, focused_context);
689 m_panel_agent_manager.helper_candidate_hide(focused_client, focused_context, focused_uuid);
694 bool candidate_more_window_show (void) {
695 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
698 get_focused_context (client, context);
700 if (m_is_imengine_candidate) {
702 m_panel_agent_manager.candidate_more_window_show (client, context);
706 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
707 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
709 if (it != m_helper_client_index.end ()) {
710 uint32 ctx = get_helper_ic (client, context);
711 m_panel_agent_manager.candidate_more_window_show (it->second.id, ctx);
720 bool candidate_more_window_hide (void) {
721 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
724 get_focused_context (client, context);
726 if (m_is_imengine_candidate) {
728 m_panel_agent_manager.candidate_more_window_hide (client, context);
732 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
733 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
735 if (it != m_helper_client_index.end ()) {
736 uint32 ctx = get_helper_ic (client, context);
737 m_panel_agent_manager.candidate_more_window_hide (it->second.id, ctx);
746 bool update_helper_lookup_table (const LookupTable& table) {
747 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
751 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
752 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
754 if (it != m_helper_client_index.end ()) {
756 get_focused_context (client, context);
757 ctx = get_helper_ic (client, context);
758 m_panel_agent_manager.update_helper_lookup_table (it->second.id, ctx, m_current_helper_uuid, table);
766 bool select_aux (uint32 item) {
767 SCIM_DEBUG_MAIN (1) << "InfoManager::select_aux (" << item << ")\n";
771 get_focused_context (client, context);
773 if (m_is_imengine_aux) {
775 m_panel_agent_manager.select_aux (client, context, item);
778 helper_select_aux (item);
785 bool select_candidate (uint32 item) {
786 SCIM_DEBUG_MAIN (1) << "InfoManager::select_candidate (" << item << ")\n";
790 get_focused_context (client, context);
792 if (m_is_imengine_candidate) {
794 m_panel_agent_manager.select_candidate (client, context, item);
797 helper_select_candidate (item);
804 bool lookup_table_page_up (void) {
805 SCIM_DEBUG_MAIN (1) << "InfoManager::lookup_table_page_up ()\n";
809 get_focused_context (client, context);
811 if (m_is_imengine_candidate) {
813 m_panel_agent_manager.lookup_table_page_up (client, context);
816 helper_lookup_table_page_up ();
823 bool lookup_table_page_down (void) {
824 SCIM_DEBUG_MAIN (1) << "InfoManager::lookup_table_page_down ()\n";
828 get_focused_context (client, context);
830 if (m_is_imengine_candidate) {
832 m_panel_agent_manager.lookup_table_page_down (client, context);
835 helper_lookup_table_page_down ();
842 bool update_lookup_table_page_size (uint32 size) {
843 SCIM_DEBUG_MAIN (1) << "InfoManager::update_lookup_table_page_size (" << size << ")\n";
847 get_focused_context (client, context);
849 if (m_is_imengine_candidate) {
851 m_panel_agent_manager.update_lookup_table_page_size (client, context, size);
854 helper_update_lookup_table_page_size (size);
861 bool update_candidate_item_layout (const std::vector<uint32>& row_items) {
862 SCIM_DEBUG_MAIN (1) << __func__ << " (" << row_items.size () << ")\n";
866 get_focused_context (client, context);
868 if (m_is_imengine_candidate) {
870 m_panel_agent_manager.update_candidate_item_layout (client, context, row_items);
873 helper_update_candidate_item_layout (row_items);
880 bool select_associate (uint32 item) {
881 SCIM_DEBUG_MAIN (1) << "InfoManager::select_associate (" << item << ")\n";
885 get_focused_context (client, context);
888 m_panel_agent_manager.select_associate (client, context, item);
892 helper_select_associate (item);
896 bool associate_table_page_up (void) {
897 SCIM_DEBUG_MAIN (1) << "InfoManager::associate_table_page_up ()\n";
901 get_focused_context (client, context);
904 m_panel_agent_manager.associate_table_page_up (client, context);
908 helper_associate_table_page_up ();
912 bool associate_table_page_down (void) {
913 SCIM_DEBUG_MAIN (1) << "InfoManager::associate_table_page_down ()\n";
917 get_focused_context (client, context);
920 m_panel_agent_manager.associate_table_page_down (client, context);
924 helper_associate_table_page_down ();
928 bool update_associate_table_page_size (uint32 size) {
929 SCIM_DEBUG_MAIN (1) << "InfoManager::update_associate_table_page_size (" << size << ")\n";
933 get_focused_context (client, context);
936 m_panel_agent_manager.update_associate_table_page_size (client, context, size);
940 helper_update_associate_table_page_size (size);
944 bool update_displayed_candidate_number (uint32 size) {
945 SCIM_DEBUG_MAIN (1) << __func__ << " (" << size << ")\n";
949 get_focused_context (client, context);
951 if (m_is_imengine_candidate) {
953 m_panel_agent_manager.update_displayed_candidate_number (client, context, size);
956 helper_update_displayed_candidate_number (size);
963 void send_longpress_event (int type, int index) {
964 SCIM_DEBUG_MAIN (1) << __func__ << " (" << type << ", " << index << ")\n";
967 get_focused_context (client, context);
969 if (m_is_imengine_candidate) {
971 m_panel_agent_manager.send_longpress_event (client, context, index);
974 helper_longpress_candidate (index);
978 bool trigger_property (const String& property) {
979 SCIM_DEBUG_MAIN (1) << "InfoManager::trigger_property (" << property << ")\n";
983 get_focused_context (client, context);
986 m_panel_agent_manager.trigger_property (client, context, property);
993 bool start_helper (const String& uuid, int client, uint32 context) {
994 SCIM_DEBUG_MAIN (1) << "InfoManager::start_helper (" << uuid << ")\n";
995 LOGD ("start ISE(%s)", uuid.c_str ());
997 if (uuid.length () <= 0)
1001 /*if (m_current_toolbar_mode != TOOLBAR_HELPER_MODE || m_current_helper_uuid.compare (uuid) != 0)*/ {
1002 SCIM_DEBUG_MAIN (1) << "Run_helper\n";
1004 uint32 ic = get_helper_ic (m_panel_client_map[client], context);
1006 /* Get the context uuid from the client context registration table. */
1008 ClientContextUUIDRepository::iterator it =
1009 m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client], context));
1011 if (it != m_client_context_uuids.end ())
1012 ic_uuid = it->second;
1014 m_start_helper_ic_index [uuid].push_back (std::make_pair (ic, ic_uuid));
1015 m_signal_run_helper (uuid, m_config_name, m_display_name);
1017 m_current_helper_uuid = uuid;
1022 bool stop_helper (const String& uuid, int client, uint32 context) {
1023 char buf[256] = {0};
1024 snprintf (buf, sizeof (buf), "time:%ld pid:%d %s %s prepare to stop ISE(%s)\n",
1025 time (0), getpid (), __FILE__, __func__, uuid.c_str ());
1026 LOGD ("prepare to stop ISE(%s)", uuid.c_str ());
1027 SCIM_DEBUG_MAIN (1) << "InfoManager::stop_helper (" << uuid << ")\n";
1029 if (uuid.length () <= 0)
1033 uint32 ctx = get_helper_ic (client, context);
1034 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
1036 if (it != m_helper_client_index.end ()) {
1037 m_ise_exiting = true;
1038 m_current_helper_uuid = String ("");
1039 m_panel_agent_manager.exit (it->second.id, ctx);
1040 SCIM_DEBUG_MAIN (1) << "Stop helper\n";
1041 ISF_SAVE_LOG ("send SCIM_TRANS_CMD_EXIT message to %s", uuid.c_str ());
1044 /* Since we are stopping this helper, erase information from start_helper_ic_index too */
1045 m_start_helper_ic_index.erase (uuid);
1051 void focus_out_helper (const String& uuid, int client, uint32 context) {
1052 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1054 if (it != m_helper_client_index.end ()) {
1055 uint32 ctx = get_helper_ic (client, context);
1056 m_panel_agent_manager.focus_out_helper (it->second.id, ctx, uuid);
1060 void focus_in_helper (const String& uuid, int client, uint32 context) {
1061 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1063 if (it != m_helper_client_index.end ()) {
1064 uint32 ctx = get_helper_ic (client, context);
1065 m_panel_agent_manager.focus_in_helper (it->second.id, ctx, uuid);
1069 bool show_helper (const String& uuid, char* data, size_t& len, uint32 ctx) {
1070 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1072 if (it != m_helper_client_index.end ()) {
1073 Socket client_socket (it->second.id);
1074 m_panel_agent_manager.show_helper (it->second.id, ctx, uuid, data, len);
1078 LOGW ("Can't find %s", m_current_helper_uuid.c_str ());
1083 void hide_helper (const String& uuid, uint32 ctx = 0) {
1084 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1086 if (it != m_helper_client_index.end ()) {
1091 get_focused_context (client, context);
1092 ctx = get_helper_ic (client, context);
1095 m_panel_agent_manager.hide_helper (it->second.id, ctx, uuid);
1099 bool set_helper_mode (const String& uuid, uint32& mode) {
1100 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1102 if (it != m_helper_client_index.end ()) {
1106 get_focused_context (client, context);
1107 ctx = get_helper_ic (client, context);
1108 m_panel_agent_manager.set_helper_mode (it->second.id, ctx, uuid, mode);
1115 bool set_helper_language (const String& uuid, uint32& language) {
1116 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1118 if (it != m_helper_client_index.end ()) {
1122 get_focused_context (client, context);
1123 ctx = get_helper_ic (client, context);
1124 m_panel_agent_manager.set_helper_language (it->second.id, ctx, uuid, language);
1131 bool set_helper_imdata (const String& uuid, const char* imdata, size_t& len) {
1132 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1134 if (it != m_helper_client_index.end ()) {
1138 get_focused_context (client, context);
1139 ctx = get_helper_ic (client, context);
1140 m_panel_agent_manager.set_helper_imdata (it->second.id, ctx, uuid, imdata, len);
1147 bool set_helper_return_key_type (const String& uuid, int type) {
1148 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1150 if (it != m_helper_client_index.end ()) {
1154 get_focused_context (client, context);
1155 ctx = get_helper_ic (client, context);
1156 m_panel_agent_manager.set_helper_return_key_type (it->second.id, ctx, uuid, type);
1163 bool get_helper_return_key_type (const String& uuid, uint32& type) {
1164 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1166 if (it != m_helper_client_index.end ()) {
1170 get_focused_context (client, context);
1171 ctx = get_helper_ic (client, context);
1172 m_panel_agent_manager.get_helper_return_key_type (it->second.id, ctx, uuid, type);
1179 bool set_helper_return_key_disable (const String& uuid, bool disabled) {
1180 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1182 if (it != m_helper_client_index.end ()) {
1186 get_focused_context (client, context);
1187 ctx = get_helper_ic (client, context);
1188 m_panel_agent_manager.set_helper_return_key_disable (it->second.id, ctx, uuid, disabled);
1195 bool get_helper_return_key_disable (const String& uuid, uint32& disabled) {
1196 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1198 if (it != m_helper_client_index.end ()) {
1202 get_focused_context (client, context);
1203 ctx = get_helper_ic (client, context);
1204 m_panel_agent_manager.get_helper_return_key_disable (it->second.id, ctx, uuid, disabled);
1211 bool set_helper_layout (const String& uuid, uint32& layout) {
1212 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1214 if (it != m_helper_client_index.end ()) {
1218 get_focused_context (client, context);
1219 ctx = get_helper_ic (client, context);
1220 m_panel_agent_manager.set_helper_layout (it->second.id, ctx, uuid, layout);
1227 bool set_helper_input_mode (const String& uuid, uint32& mode) {
1228 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1230 if (it != m_helper_client_index.end ()) {
1234 get_focused_context (client, context);
1235 ctx = get_helper_ic (client, context);
1236 m_panel_agent_manager.set_helper_input_mode (it->second.id, ctx, uuid, mode);
1243 bool set_helper_input_hint (const String& uuid, uint32& hint) {
1244 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1246 if (it != m_helper_client_index.end ()) {
1250 get_focused_context (client, context);
1251 ctx = get_helper_ic (client, context);
1252 m_panel_agent_manager.set_helper_input_hint (it->second.id, ctx, uuid, hint);
1259 bool set_helper_bidi_direction (const String& uuid, uint32& direction) {
1260 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1262 if (it != m_helper_client_index.end ()) {
1266 get_focused_context (client, context);
1267 ctx = get_helper_ic (client, context);
1268 m_panel_agent_manager.set_helper_bidi_direction (it->second.id, ctx, uuid, direction);
1275 bool set_helper_caps_mode (const String& uuid, uint32& mode) {
1276 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1278 if (it != m_helper_client_index.end ()) {
1282 get_focused_context (client, context);
1283 ctx = get_helper_ic (client, context);
1284 m_panel_agent_manager.set_helper_caps_mode (it->second.id, ctx, uuid, mode);
1291 bool show_helper_option_window (const String& uuid) {
1292 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1294 if (it != m_helper_client_index.end ()) {
1298 get_focused_context (client, context);
1299 ctx = get_helper_ic (client, context);
1301 if (!m_signal_launch_option_application (uuid)) {
1302 LOGD ("call show helper option");
1303 m_panel_agent_manager.show_helper_option_window (it->second.id, ctx, uuid);
1312 bool resume_helper_option_window (const String& uuid) {
1313 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1315 if (it != m_helper_client_index.end ()) {
1319 get_focused_context (client, context);
1320 ctx = get_helper_ic (client, context);
1321 m_panel_agent_manager.resume_helper_option_window (it->second.id, ctx, uuid);
1328 bool set_helper_keyboard_mode (const String& uuid, uint32& mode) {
1329 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1331 if (it != m_helper_client_index.end ()) {
1335 get_focused_context (client, context);
1336 ctx = get_helper_ic (client, context);
1337 m_panel_agent_manager.set_helper_keyboard_mode (it->second.id, ctx, uuid, mode);
1344 bool set_helper_prediction_hint (const String& uuid, String prediction_hint) {
1345 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1347 if (it != m_helper_client_index.end ()) {
1351 get_focused_context (client, context);
1352 ctx = get_helper_ic (client, context);
1353 m_panel_agent_manager.set_helper_prediction_hint (it->second.id, ctx, uuid, prediction_hint);
1360 bool set_helper_mime_type (const String& uuid, String mime_type) {
1361 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1363 if (it != m_helper_client_index.end ()) {
1367 get_focused_context (client, context);
1368 ctx = get_helper_ic (client, context);
1369 m_panel_agent_manager.set_helper_mime_type (it->second.id, ctx, uuid, mime_type);
1376 bool finalize_content_helper (const String& uuid, String text, uint32 cursor_pos) {
1377 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1379 if (it != m_helper_client_index.end ()) {
1383 get_focused_context (client, context);
1384 ctx = get_helper_ic (client, context);
1385 m_panel_agent_manager.finalize_content_helper (it->second.id, ctx, uuid, text, cursor_pos);
1392 bool set_helper_prediction_hint_data (const String& uuid, String key, String value) {
1393 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1395 if (it != m_helper_client_index.end ()) {
1399 get_focused_context (client, context);
1400 ctx = get_helper_ic (client, context);
1401 m_panel_agent_manager.set_helper_prediction_hint_data (it->second.id, ctx, uuid, key, value);
1408 bool set_helper_optimization_hint(const String& uuid, uint32& hint) {
1409 HelperClientIndex::iterator it = m_helper_client_index.find(m_current_helper_uuid);
1411 if (it != m_helper_client_index.end()) {
1415 get_focused_context(client, context);
1416 ctx = get_helper_ic(client, context);
1417 m_panel_agent_manager.set_helper_optimization_hint(it->second.id, ctx, uuid, hint);
1424 //ISM_TRANS_CMD_SHOW_ISF_CONTROL
1425 void show_isf_panel (int client_id) {
1426 SCIM_DEBUG_MAIN (4) << "InfoManager::show_isf_panel ()\n";
1427 m_signal_show_panel ();
1430 //ISM_TRANS_CMD_SEND_REMOTE_INPUT_MESSAGE
1431 bool send_remote_input_message (int client_id, char* buf, size_t len) {
1432 SCIM_DEBUG_MAIN(4) << "InfoManager::send_remote_input_message ()\n";
1434 if (buf && len > 0) {
1436 m_signal_remoteinput_send_input_message (msg, true);
1443 void send_remote_surrounding_text (const char* text, uint32 cursor) {
1444 SCIM_DEBUG_MAIN(4) << "InfoManager::send_remote_surrounding_text ()\n";
1446 m_signal_remoteinput_send_surrounding_text (cursor, text);
1449 //ISM_TRANS_CMD_HIDE_ISF_CONTROL
1450 void hide_isf_panel (int client_id) {
1451 SCIM_DEBUG_MAIN (4) << "InfoManager::hide_isf_panel ()\n";
1452 m_signal_hide_panel ();
1455 //ISM_TRANS_CMD_SHOW_ISE_PANEL
1456 void show_ise_panel (int client_id, uint32 client, uint32 context, char* data, size_t len) {
1457 SCIM_DEBUG_MAIN (4) << "InfoManager::show_ise_panel ()\n";
1458 m_reshow_needed = true;
1459 String initial_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
1460 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
1461 LOGD ("prepare to show ISE %d [%s] [%s]", client_id, initial_uuid.c_str (), default_uuid.c_str ());
1463 m_show_request_client_id = client_id;
1464 m_active_client_id = client_id;
1465 SCIM_DEBUG_MAIN (4) << __func__ << " (client:" << client << " context:" << context << ")\n";
1467 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode) {
1468 uint32 ctx = get_helper_ic (client, context);
1469 ret = show_helper (m_current_helper_uuid, data, len, ctx);
1472 /* Save ISE context for ISE panel re-showing */
1473 /* The size of data can be bigger than Ise_Context size if there is IMDATA. */
1474 if (data && len > 0) {
1475 delete_imdata_buffer ();
1476 delete_ise_context_buffer ();
1477 m_ise_context_buffer = new char [len];
1478 if (m_ise_context_buffer) {
1479 m_ise_context_length = len;
1480 memcpy (m_ise_context_buffer, data, m_ise_context_length);
1485 m_signal_show_ise ();
1487 bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false);
1488 if (launch_ise_on_request)
1489 m_signal_start_default_ise ();
1493 //ISM_TRANS_CMD_HIDE_ISE_PANEL
1494 void hide_ise_panel (int client_id, uint32 client, uint32 context) {
1495 SCIM_DEBUG_MAIN (4) << "InfoManager::hide_ise_panel ()\n";
1496 LOGD ("prepare to hide ISE, %d %d", client_id, m_show_request_client_id);
1497 SCIM_DEBUG_MAIN (4) << __func__ << " (client:" << client << " context:" << context << ")\n";
1499 m_reshow_needed = false;
1500 if (m_panel_client_map[client_id] == m_current_socket_client || client_id == m_show_request_client_id) {
1501 // && (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
1503 uint32 focused_context;
1504 get_focused_context (focused_client, focused_context);
1506 if (focused_client == -1 && m_active_client_id != -1) {
1507 focused_client = m_panel_client_map[m_active_client_id];
1508 focused_context = 0;
1511 m_signal_hide_ise ();
1514 /* Release ISE context & IMDATA buffer */
1515 delete_imdata_buffer ();
1516 delete_ise_context_buffer ();
1519 void hide_helper_ise (void) {
1522 uint32 focused_context;
1523 get_focused_context (focused_client, focused_context);
1524 m_panel_agent_manager.hide_helper_ise (focused_client, focused_context);
1526 m_signal_hide_ise ();
1530 void prelaunch_helper_ise (void) {
1531 SCIM_DEBUG_MAIN (4) << "InfoManager::prelaunch_helper_ise ()\n";
1534 * Currenlty the SHOW_PREPARE hint is delivered only to the already-running ISEs.
1535 * If the newly launched ise also has to be notified of given optimization hint,
1536 * we'll need to mark the hint somewhere and send the message when a newly launched
1537 * ise connects to the panel.
1539 HelperClientIndex::iterator it = m_helper_client_index.find(m_current_helper_uuid);
1540 if (it != m_helper_client_index.end()) {
1544 get_focused_context(client, context);
1545 ctx = get_helper_ic(client, context);
1546 m_panel_agent_manager.set_helper_optimization_hint(it->second.id, ctx, m_current_helper_uuid, ISE_OPTIMIZATION_HINT_SHOW_PREPARE);
1549 m_signal_start_default_ise();
1552 void set_default_ise (const DEFAULT_ISE_T& ise) {
1553 LOGD ("set default ise : %s", ise.uuid.c_str());
1554 scim_global_config_write (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), ise.uuid);
1555 scim_global_config_flush ();
1558 void set_should_shared_ise (const bool should_shared_ise) {
1559 m_should_shared_ise = should_shared_ise;
1561 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
1562 bool process_key_event (KeyEvent& key, uint32 serial) {
1563 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1565 if (it != m_helper_client_index.end ()) {
1569 get_focused_context (client, context);
1570 ctx = get_helper_ic (client, context);
1571 return m_panel_agent_manager.process_key_event (it->second.id, ctx, m_current_helper_uuid, key, serial);
1577 //ISM_TRANS_CMD_PROCESS_INPUT_DEVICE_EVENT
1578 bool process_input_device_event(int client_id, uint32 type, const char *data, size_t len, _OUT_ uint32& result) {
1579 SCIM_DEBUG_MAIN(4) << "InfoManager::process_input_device_event ()\n";
1580 HelperClientIndex::iterator it = m_helper_client_index.find(m_current_helper_uuid);
1582 if (it != m_helper_client_index.end()) {
1586 get_focused_context(client, context);
1587 ctx = get_helper_ic(client, context);
1588 return m_panel_agent_manager.process_input_device_event(it->second.id, ctx, m_current_helper_uuid, type, data, len, result);
1594 bool get_helper_geometry (String& uuid, struct rectinfo& info) {
1595 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1597 if (it != m_helper_client_index.end ()) {
1601 get_focused_context (client, context);
1602 ctx = get_helper_ic (client, context);
1603 return m_panel_agent_manager.get_helper_geometry (it->second.id, ctx, uuid, info);
1609 bool get_helper_imdata (String& uuid, char** imdata, size_t& len) {
1610 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1612 if (it != m_helper_client_index.end ()) {
1616 get_focused_context (client, context);
1617 ctx = get_helper_ic (client, context);
1618 m_panel_agent_manager.get_helper_imdata (it->second.id, ctx, uuid, imdata, len);
1625 bool get_helper_layout (String& uuid, uint32& layout) {
1626 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1628 if (it != m_helper_client_index.end ()) {
1632 get_focused_context (client, context);
1633 ctx = get_helper_ic (client, context);
1634 m_panel_agent_manager.get_helper_layout (it->second.id, ctx, uuid, layout);
1640 //ISM_TRANS_CMD_GET_ACTIVE_ISE_GEOMETRY
1641 void get_input_panel_geometry (int client_id, _OUT_ struct rectinfo& info) {
1642 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1643 m_signal_get_input_panel_geometry (info);
1645 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
1646 void get_candidate_window_geometry (int client_id, _OUT_ struct rectinfo& info) {
1647 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1648 m_signal_get_candidate_geometry (info);
1650 //ISM_TRANS_CMD_GET_ISE_LANGUAGE_LOCALE
1651 void get_ise_language_locale (int client_id, _OUT_ char** data, _OUT_ size_t& len) {
1652 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1653 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
1654 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1656 if (it != m_helper_client_index.end ()) {
1659 get_focused_context (client, context);
1660 uint32 ctx = get_helper_ic (client, context);
1661 m_panel_agent_manager.get_ise_language_locale (it->second.id, ctx, m_current_helper_uuid, data, len);
1666 void get_current_ise_geometry (rectinfo& rect) {
1667 SCIM_DEBUG_MAIN (4) << __func__ << " \n";
1670 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1671 ret = get_helper_geometry (m_current_helper_uuid, rect);
1681 void set_ise_mode (int client_id, uint32 mode) {
1682 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_mode ()\n";
1684 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1685 set_helper_mode (m_current_helper_uuid, mode);
1687 //ISM_TRANS_CMD_SET_LAYOUT
1688 void set_ise_layout (int client_id, uint32 layout) {
1689 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_layout ()\n";
1690 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1691 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1692 iseContext->layout = static_cast<Ecore_IMF_Input_Panel_Layout>(layout);
1694 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1695 set_helper_layout (m_current_helper_uuid, layout);
1697 //ISM_TRANS_CMD_SET_INPUT_MODE
1698 void set_ise_input_mode (int client_id, uint32 input_mode) {
1699 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_input_mode ()\n";
1701 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1702 set_helper_input_mode (m_current_helper_uuid, input_mode);
1704 //ISM_TRANS_CMD_SET_INPUT_HINT
1705 void set_ise_input_hint (int client_id, uint32 input_hint) {
1706 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_input_hint ()\n";
1707 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1708 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1709 iseContext->input_hint = static_cast<Ecore_IMF_Input_Hints>(input_hint);
1711 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1712 set_helper_input_hint (m_current_helper_uuid, input_hint);
1714 //ISM_TRANS_CMD_UPDATE_BIDI_DIRECTION
1715 void update_ise_bidi_direction (int client_id, uint32 bidi_direction) {
1716 SCIM_DEBUG_MAIN (4) << "InfoManager::update_ise_bidi_direction ()\n";
1717 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1718 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1719 iseContext->bidi_direction = static_cast<Ecore_IMF_BiDi_Direction>(bidi_direction);
1721 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1722 set_helper_bidi_direction (m_current_helper_uuid, bidi_direction);
1724 //ISM_TRANS_CMD_SET_ISE_LANGUAGE
1725 void set_ise_language (int client_id, uint32 language) {
1726 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_language ()\n";
1727 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1728 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1729 iseContext->language = static_cast<Ecore_IMF_Input_Panel_Lang>(language);
1731 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1732 set_helper_language (m_current_helper_uuid, language);
1734 //ISM_TRANS_CMD_SET_ISE_IMDATA
1735 void set_ise_imdata (int client_id, const char* imdata, size_t len) {
1736 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_imdata ()\n";
1738 delete_imdata_buffer ();
1739 m_imdata_buffer = new char [len];
1740 if (m_imdata_buffer) {
1741 m_imdata_length = len;
1742 memcpy (m_imdata_buffer, imdata, m_imdata_length);
1744 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1745 set_helper_imdata (m_current_helper_uuid, imdata, len);
1747 //ISM_TRANS_CMD_GET_ISE_IMDATA
1748 bool get_ise_imdata (int client_id, _OUT_ char** imdata, _OUT_ size_t& len) {
1749 SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_imdata ()\n";
1752 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1753 ret = get_helper_imdata (m_current_helper_uuid, imdata, len);
1757 //ISM_TRANS_CMD_GET_LAYOUT
1758 bool get_ise_layout (int client_id, _OUT_ uint32& layout) {
1759 SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_layout ()\n";
1762 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1763 ret = get_helper_layout (m_current_helper_uuid, layout);
1767 //ISM_TRANS_CMD_GET_ISE_STATE
1768 void get_ise_state (int client_id, _OUT_ int& state) {
1769 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1770 m_signal_get_ise_state (state);
1772 //ISM_TRANS_CMD_GET_ACTIVE_ISE
1773 void get_active_ise (int client_id, _OUT_ String& default_uuid) {
1774 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1775 default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
1777 //ISM_TRANS_CMD_GET_ISE_LIST
1778 void get_ise_list (int client_id, _OUT_ std::vector<String>& strlist) {
1779 SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_list ()\n";
1780 m_signal_get_ise_list (strlist);
1782 //ISM_TRANS_CMD_GET_ALL_HELPER_ISE_INFO
1783 void get_all_helper_ise_info (int client_id, _OUT_ HELPER_ISE_INFO& info) {
1784 SCIM_DEBUG_MAIN (4) << "InfoManager::get_all_helper_ise_info ()\n";
1785 m_signal_get_all_helper_ise_info (info);
1787 //1 Check if the current IME's option (setting) is available or not.
1788 for (uint32 i = 0; i < info.appid.size (); i++) {
1789 if (m_current_helper_uuid.compare (info.appid [i]) == 0) { // Find the current IME
1790 // If the current IME's "has_option" is unknown (-1), get it through ISM_TRANS_CMD_CHECK_OPTION_WINDOW command.
1791 // And it's saved to ime_info DB. Then next time this will be skipped.
1792 if (info.has_option [i] >= 2) {
1793 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1795 if (it != m_helper_client_index.end ()) {
1798 get_focused_context (client, context);
1799 uint32 ctx = get_helper_ic (client, context);
1800 uint32 avail = static_cast<uint32> (-1);
1801 m_panel_agent_manager.check_option_window (it->second.id, ctx, m_current_helper_uuid, avail);
1804 String setting_app = isf_pkg_get_setting_app (m_current_helper_uuid);
1805 if (setting_app.length () > 0)
1810 info.has_option [i] = avail;
1811 // Update "has_option" column of ime_info DB and global variable.
1812 m_signal_set_has_option_helper_ise_info (info.appid [i], static_cast<bool> (avail));
1819 //ISM_TRANS_CMD_SET_ENABLE_HELPER_ISE_INFO
1820 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1821 void set_enable_helper_ise_info (int client_id, String appid, uint32 is_enabled) {
1822 SCIM_DEBUG_MAIN (4) << "InfoManager::set_enable_helper_ise_info ()\n";
1823 m_signal_set_enable_helper_ise_info (appid, static_cast<bool> (is_enabled));
1825 //ISM_TRANS_CMD_SHOW_HELPER_ISE_LIST
1826 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1827 void show_helper_ise_list (int client_id) {
1828 SCIM_DEBUG_MAIN (4) << "InfoManager::show_helper_ise_list ()\n";
1829 m_signal_show_helper_ise_list ();
1831 //ISM_TRANS_CMD_SHOW_HELPER_ISE_SELECTOR
1832 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1833 void show_helper_ise_selector (int client_id) {
1834 SCIM_DEBUG_MAIN (4) << "InfoManager::show_helper_ise_selector ()\n";
1835 m_signal_show_helper_ise_selector ();
1837 //ISM_TRANS_CMD_IS_HELPER_ISE_ENABLED
1839 void is_helper_ise_enabled (int client_id, String strAppid, _OUT_ uint32& nEnabled) {
1840 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1842 m_signal_is_helper_ise_enabled (strAppid, _nEnabled);
1843 nEnabled = (uint32)_nEnabled;
1845 //ISM_TRANS_CMD_GET_ISE_INFORMATION
1846 void get_ise_information (int client_id, String strUuid, _OUT_ String& strName, _OUT_ String& strLanguage,
1847 _OUT_ int& nType, _OUT_ int& nOption, _OUT_ String& strModuleName) {
1848 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1849 m_signal_get_ise_information (strUuid, strName, strLanguage, nType, nOption, strModuleName);
1854 void get_language_list (int client_id, _OUT_ std::vector<String>& strlist) {
1855 SCIM_DEBUG_MAIN (4) << "InfoManager::get_language_list ()\n";
1856 m_signal_get_language_list (strlist);
1859 void get_all_language (int client_id, _OUT_ std::vector<String>& strlist) {
1860 SCIM_DEBUG_MAIN (4) << "InfoManager::get_all_language ()\n";
1861 m_signal_get_all_language (strlist);
1866 void get_ise_language (int client_id, char* buf, size_t len, _OUT_ std::vector<String>& strlist) {
1867 SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_language ()\n";
1868 m_signal_get_ise_language (buf, strlist);
1870 //ISM_TRANS_CMD_RESET_ISE_OPTION
1871 //reply SCIM_TRANS_CMD_OK
1872 bool reset_ise_option (int client_id) {
1873 SCIM_DEBUG_MAIN (1) << "InfoManager::resect_ise_option ()\n";
1877 ClientContextUUIDRepository::iterator it = m_client_context_uuids.begin ();
1879 if (it != m_client_context_uuids.end ()) {
1880 get_imengine_client_context (it->first, client, context);
1884 m_panel_agent_manager.reset_ise_option (client, context);
1891 bool find_active_ise_by_uuid (String uuid) {
1892 HelperInfoRepository::iterator iter = m_helper_info_repository.begin ();
1894 for (; iter != m_helper_info_repository.end (); iter++) {
1895 if (!uuid.compare (iter->second.uuid))
1901 //ISM_TRANS_CMD_SET_ACTIVE_ISE_BY_UUID
1903 bool set_active_ise_by_uuid (int client_id, char* buf, size_t len) {
1904 SCIM_DEBUG_MAIN (4) << "InfoManager::set_active_ise_by_uuid ()\n";
1913 if (!m_signal_get_ise_info_by_uuid (uuid, info)) {
1917 if (info.type == TOOLBAR_KEYBOARD_MODE) {
1918 m_signal_set_active_ise_by_uuid (uuid, 1);
1921 m_signal_set_active_ise_by_uuid (uuid, 1);
1926 if (find_active_ise_by_uuid (uuid)) {
1929 m_ise_pending_repository[uuid] = client_id;
1933 //ISM_TRANS_CMD_SET_INITIAL_ISE_BY_UUID
1934 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1935 void set_initial_ise_by_uuid (int client_id, char* buf, size_t len) {
1936 SCIM_DEBUG_MAIN (4) << "InfoManager::set_initial_ise_by_uuid ()\n";
1943 scim_global_config_write (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (uuid));
1944 scim_global_config_flush ();
1946 //ISM_TRANS_CMD_SET_RETURN_KEY_TYPE
1947 void set_ise_return_key_type (int client_id, uint32 type) {
1948 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1949 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1950 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1951 iseContext->return_key_type = static_cast<Ecore_IMF_Input_Panel_Return_Key_Type>(type);
1953 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1954 set_helper_return_key_type (m_current_helper_uuid, type);
1956 //ISM_TRANS_CMD_GET_RETURN_KEY_TYPE
1958 bool get_ise_return_key_type (int client_id, _OUT_ uint32& type) {
1959 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1962 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1963 ret = get_helper_return_key_type (m_current_helper_uuid, type);
1967 //ISM_TRANS_CMD_SET_RETURN_KEY_DISABLE
1968 void set_ise_return_key_disable (int client_id, uint32 disabled) {
1969 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1970 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1971 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1972 iseContext->return_key_disabled = static_cast<Eina_Bool>(disabled);
1974 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1975 set_helper_return_key_disable (m_current_helper_uuid, disabled);
1977 //ISM_TRANS_CMD_GET_RETURN_KEY_DISABLE
1978 bool get_ise_return_key_disable (int client_id, _OUT_ uint32& disabled) {
1979 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1982 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1983 ret = get_helper_return_key_disable (m_current_helper_uuid, disabled);
1988 void reset_helper_context (const String& uuid) {
1989 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1991 if (it != m_helper_client_index.end ()) {
1995 get_focused_context (client, context);
1996 ctx = get_helper_ic (client, context);
1997 m_panel_agent_manager.reset_helper_context (it->second.id, ctx, uuid);
2003 void reset_ise_context (int client_id) {
2004 SCIM_DEBUG_MAIN (4) << "InfoManager::reset_ise_context ()\n";
2006 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2007 reset_helper_context (m_current_helper_uuid);
2009 //ISM_TRANS_CMD_SET_CAPS_MODE
2010 void set_ise_caps_mode (int client_id, uint32 mode) {
2011 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_caps_mode ()\n";
2012 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
2013 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
2014 iseContext->caps_mode = static_cast<Eina_Bool>(mode);
2016 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2017 set_helper_caps_mode (m_current_helper_uuid, mode);
2020 //SCIM_TRANS_CMD_RELOAD_CONFIG
2021 void reload_config (void) {
2022 SCIM_DEBUG_MAIN (1) << "InfoManager::reload_config ()\n";
2025 for (ClientRepository::iterator it = m_client_repository.begin (); it != m_client_repository.end (); ++it) {
2026 if (it->second.type == FRONTEND_CLIENT || it->second.type == HELPER_CLIENT) {
2027 m_panel_agent_manager.reload_config (it->first);
2035 SCIM_DEBUG_MAIN (1) << "InfoManager::exit ()\n";
2038 for (ClientRepository::iterator it = m_client_repository.begin (); it != m_client_repository.end (); ++it) {
2039 m_panel_agent_manager.exit (it->first, 0);
2047 void update_ise_list (std::vector<String>& strList) {
2048 /* request PanelClient to update keyboard ise list */
2049 update_keyboard_ise_list ();
2051 //ISM_TRANS_CMD_SEND_WILL_SHOW_ACK
2052 void will_show_ack (int client_id) {
2053 SCIM_DEBUG_MAIN (4) << "InfoManager::will_show_ack ()\n";
2054 m_signal_will_show_ack ();
2056 //ISM_TRANS_CMD_SEND_WILL_HIDE_ACK
2057 void will_hide_ack (int client_id) {
2058 SCIM_DEBUG_MAIN (4) << "InfoManager::will_hide_ack ()\n";
2059 m_signal_will_hide_ack ();
2061 //ISM_TRANS_CMD_RESET_DEFAULT_ISE
2062 void reset_default_ise (int client_id) {
2063 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
2064 String initial_ise = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
2066 if (initial_ise.length () > 0)
2067 m_signal_set_active_ise_by_uuid (initial_ise, 1);
2069 std::cerr << "Read SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID is failed!!!\n";
2071 //ISM_TRANS_CMD_SET_HARDWARE_KEYBOARD_MODE
2072 void set_keyboard_mode (int client_id, uint32 mode) {
2073 SCIM_DEBUG_MAIN (4) << "InfoManager::set_keyboard_mode ()\n";
2074 m_signal_set_keyboard_mode (mode);
2075 set_ise_keyboard_mode (client_id, mode);
2077 //ISM_TRANS_CMD_SEND_CANDIDATE_WILL_HIDE_ACK
2078 void candidate_will_hide_ack (int client_id) {
2079 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "\n";
2080 m_signal_candidate_will_hide_ack ();
2083 //ISM_TRANS_CMD_GET_ACTIVE_HELPER_OPTION
2084 void get_active_helper_option (int client_id, _OUT_ uint32& option) {
2085 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
2086 option = get_current_helper_option ();
2088 //ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW
2089 void show_ise_option_window (int client_id) {
2090 SCIM_DEBUG_MAIN (4) << "InfoManager::show_ise_option_window ()\n";
2091 String initial_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
2092 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
2093 LOGD ("prepare to show ISE option window %d [%s] [%s]", client_id, initial_uuid.c_str (), default_uuid.c_str ());
2095 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode) {
2096 show_helper_option_window (m_current_helper_uuid);
2100 //ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW
2101 void resume_ise_option_window (int client_id) {
2102 SCIM_DEBUG_MAIN (4) << "InfoManager::resume_ise_option_window ()\n";
2103 String initial_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
2104 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
2105 LOGD ("prepare to resume ISE option window %d [%s] [%s]", client_id, initial_uuid.c_str (), default_uuid.c_str ());
2107 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode) {
2108 resume_helper_option_window (m_current_helper_uuid);
2112 //ISM_TRANS_CMD_SET_KEYBOARD_MODE
2113 void set_ise_keyboard_mode (int client_id, uint32 mode) {
2114 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_keyboard_mode ()\n";
2115 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2116 set_helper_keyboard_mode (m_current_helper_uuid, mode);
2119 //ISM_TRANS_CMD_SET_PREDICTION_HINT
2120 void set_prediction_hint (int client_id, String prediction_hint) {
2121 SCIM_DEBUG_MAIN (4) << "InfoManager::set_prediction_hint ()\n";
2122 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2123 set_helper_prediction_hint (m_current_helper_uuid, prediction_hint);
2126 //ISM_TRANS_CMD_SET_MIME_TYPE
2127 void set_ise_mime_type (int client_id, String mime_type) {
2128 SCIM_DEBUG_MAIN (4) << "InfoManager::set_mime_type ()\n";
2129 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2130 set_helper_mime_type (m_current_helper_uuid, mime_type);
2133 //ISM_TRANS_CMD_FINALIZE_CONTENT
2134 void finalize_content (int client_id, String text, uint32 cursor_pos) {
2135 SCIM_DEBUG_MAIN (4) << "InfoManager::finalize_content ()\n";
2136 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2137 finalize_content_helper (m_current_helper_uuid, text, cursor_pos);
2140 //ISM_TRANS_CMD_SET_PREDICTION_HINT_DATA
2141 void set_prediction_hint_data (int client_id, String key, String value) {
2142 SCIM_DEBUG_MAIN (4) << "InfoManager::set_prediction_hint_data ()\n";
2143 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2144 set_helper_prediction_hint_data (m_current_helper_uuid, key, value);
2147 //ISM_TRANS_CMD_SET_OPTIMIZATION_HINT
2148 void set_optimization_hint(int client_id, uint32 hint) {
2149 SCIM_DEBUG_MAIN(4) << "InfoManager::set_optimization_hint ()\n";
2150 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2151 set_helper_optimization_hint(m_current_helper_uuid, hint);
2154 //ISM_TRANS_CMD_EXPAND_CANDIDATE
2155 void expand_candidate () {
2157 m_signal_expand_candidate ();
2160 //ISM_TRANS_CMD_CONTRACT_CANDIDATE
2161 void contract_candidate () {
2163 m_signal_contract_candidate ();
2165 //ISM_TRANS_CMD_GET_RECENT_ISE_GEOMETRY
2166 void get_recent_ise_geometry (int client_id, uint32 angle, _OUT_ struct rectinfo& info) {
2167 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
2169 m_signal_get_recent_ise_geometry (angle, info);
2172 bool check_privilege_by_sockfd (int client_id, const String& privilege) {
2173 return m_signal_check_privilege_by_sockfd (client_id, privilege);
2176 bool remoteinput_update_preedit_string (WideString str, AttributeList &attrs, uint32 caret)
2178 SCIM_DEBUG_MAIN(1) << "PanelAgent::update_preedit_string ()\n";
2184 get_focused_context (client, context);
2186 m_panel_agent_manager.remote_update_preedit_string (client, context, str, str, attrs, caret);
2194 bool remoteinput_commit_string (const WideString &str)
2196 SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_commit_string ()\n";
2202 get_focused_context (client, context);
2204 m_panel_agent_manager.remote_commit_string (client, context, str);
2212 bool remoteinput_send_key_event (const KeyEvent &key)
2214 SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_send_key_event ()\n";
2218 get_focused_context (client, context);
2220 m_panel_agent_manager.remote_send_key_event (client, context, key);
2226 bool remoteinput_forward_key_event (const KeyEvent &key)
2228 SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_forward_key_event ()\n";
2232 get_focused_context (client, context);
2234 m_panel_agent_manager.remote_forward_key_event (client, context, key);
2240 bool remoteinput_delete_surrounding_text (uint32 offset, uint32 len)
2242 SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_delete_surrounding_text ()\n";
2246 get_focused_context (client, context);
2248 m_panel_agent_manager.remote_delete_surrounding_text (client, context, offset, len);
2254 void reshow_input_panel () {
2255 /* Check whether application is already focus_in */
2256 if (m_refocus_needed) {
2257 LOGD ("Re-focus in");
2258 SCIM_DEBUG_MAIN (2) << "Application is already focus_in!\n";
2260 focus_in_helper (m_current_helper_uuid, m_current_socket_client, m_current_client_context);
2261 reset_keyboard_ise ();
2264 /* Check whether ISE panel is already shown */
2265 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode && m_ise_context_length > 0 && m_reshow_needed) {
2266 LOGD ("Re-show input_panel");
2267 SCIM_DEBUG_MAIN (2) << "Re-show ISE panel!\n";
2270 uint32 focused_context;
2272 get_focused_context (focused_client, focused_context);
2273 if (focused_client == -1 && m_active_client_id != -1) {
2274 focused_client = m_panel_client_map[m_active_client_id];
2275 focused_context = 0;
2278 m_panel_agent_manager.request_ise_reshow (focused_client, focused_context);
2279 m_panel_agent_manager.update_entry_metadata (focused_client, focused_context);
2280 uint32 ctx = get_helper_ic (focused_client, focused_context);
2281 bool ret = show_helper (m_current_helper_uuid, m_ise_context_buffer, m_ise_context_length, ctx);
2283 m_signal_show_ise ();
2285 if (m_imdata_buffer && m_imdata_length > 0 && m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2286 set_helper_imdata (m_current_helper_uuid, m_imdata_buffer, m_imdata_length);
2291 Connection signal_connect_turn_on (InfoManagerSlotVoid* slot) {
2292 return m_signal_turn_on.connect (slot);
2295 Connection signal_connect_turn_off (InfoManagerSlotVoid* slot) {
2296 return m_signal_turn_off.connect (slot);
2299 Connection signal_connect_show_panel (InfoManagerSlotVoid* slot) {
2300 return m_signal_show_panel.connect (slot);
2303 Connection signal_connect_hide_panel (InfoManagerSlotVoid* slot) {
2304 return m_signal_hide_panel.connect (slot);
2307 Connection signal_connect_update_screen (InfoManagerSlotInt* slot) {
2308 return m_signal_update_screen.connect (slot);
2311 Connection signal_connect_update_spot_location (InfoManagerSlotIntIntInt* slot) {
2312 return m_signal_update_spot_location.connect (slot);
2315 Connection signal_connect_update_factory_info (InfoManagerSlotFactoryInfo* slot) {
2316 return m_signal_update_factory_info.connect (slot);
2319 Connection signal_connect_start_default_ise (InfoManagerSlotVoid* slot) {
2320 return m_signal_start_default_ise.connect (slot);
2323 Connection signal_connect_stop_default_ise (InfoManagerSlotVoid* slot) {
2324 return m_signal_stop_default_ise.connect (slot);
2327 Connection signal_connect_set_candidate_ui (InfoManagerSlotIntInt* slot) {
2328 return m_signal_set_candidate_ui.connect (slot);
2331 Connection signal_connect_get_candidate_ui (InfoManagerSlotIntInt2* slot) {
2332 return m_signal_get_candidate_ui.connect (slot);
2335 Connection signal_connect_set_candidate_position (InfoManagerSlotIntInt* slot) {
2336 return m_signal_set_candidate_position.connect (slot);
2339 Connection signal_connect_get_candidate_geometry (InfoManagerSlotRect* slot) {
2340 return m_signal_get_candidate_geometry.connect (slot);
2343 Connection signal_connect_get_input_panel_geometry (InfoManagerSlotRect* slot) {
2344 return m_signal_get_input_panel_geometry.connect (slot);
2347 Connection signal_connect_set_keyboard_ise (InfoManagerSlotString* slot) {
2348 return m_signal_set_keyboard_ise.connect (slot);
2351 Connection signal_connect_get_keyboard_ise (InfoManagerSlotString2* slot) {
2352 return m_signal_get_keyboard_ise.connect (slot);
2355 Connection signal_connect_show_help (InfoManagerSlotString* slot) {
2356 return m_signal_show_help.connect (slot);
2359 Connection signal_connect_show_factory_menu (InfoManagerSlotFactoryInfoVector* slot) {
2360 return m_signal_show_factory_menu.connect (slot);
2363 Connection signal_connect_show_preedit_string (InfoManagerSlotVoid* slot) {
2364 return m_signal_show_preedit_string.connect (slot);
2367 Connection signal_connect_show_aux_string (InfoManagerSlotVoid* slot) {
2368 return m_signal_show_aux_string.connect (slot);
2371 Connection signal_connect_show_lookup_table (InfoManagerSlotVoid* slot) {
2372 return m_signal_show_lookup_table.connect (slot);
2375 Connection signal_connect_show_associate_table (InfoManagerSlotVoid* slot) {
2376 return m_signal_show_associate_table.connect (slot);
2379 Connection signal_connect_hide_preedit_string (InfoManagerSlotVoid* slot) {
2380 return m_signal_hide_preedit_string.connect (slot);
2383 Connection signal_connect_hide_aux_string (InfoManagerSlotVoid* slot) {
2384 return m_signal_hide_aux_string.connect (slot);
2387 Connection signal_connect_hide_lookup_table (InfoManagerSlotVoid* slot) {
2388 return m_signal_hide_lookup_table.connect (slot);
2391 Connection signal_connect_hide_associate_table (InfoManagerSlotVoid* slot) {
2392 return m_signal_hide_associate_table.connect (slot);
2395 Connection signal_connect_update_preedit_string (InfoManagerSlotAttributeStringInt* slot) {
2396 return m_signal_update_preedit_string.connect (slot);
2399 Connection signal_connect_update_preedit_caret (InfoManagerSlotInt* slot) {
2400 return m_signal_update_preedit_caret.connect (slot);
2403 Connection signal_connect_recapture_string (InfoManagerSlotAttributeInt2String2* slot) {
2404 return m_signal_recapture_string.connect (slot);
2407 Connection signal_connect_update_aux_string (InfoManagerSlotAttributeString* slot) {
2408 return m_signal_update_aux_string.connect (slot);
2411 Connection signal_connect_update_lookup_table (InfoManagerSlotLookupTable* slot) {
2412 return m_signal_update_lookup_table.connect (slot);
2415 Connection signal_connect_update_associate_table (InfoManagerSlotLookupTable* slot) {
2416 return m_signal_update_associate_table.connect (slot);
2419 Connection signal_connect_register_properties (InfoManagerSlotPropertyList* slot) {
2420 return m_signal_register_properties.connect (slot);
2423 Connection signal_connect_update_property (InfoManagerSlotProperty* slot) {
2424 return m_signal_update_property.connect (slot);
2427 Connection signal_connect_register_helper_properties (InfoManagerSlotIntPropertyList* slot) {
2428 return m_signal_register_helper_properties.connect (slot);
2431 Connection signal_connect_update_helper_property (InfoManagerSlotIntProperty* slot) {
2432 return m_signal_update_helper_property.connect (slot);
2435 Connection signal_connect_register_helper (InfoManagerSlotIntHelperInfo* slot) {
2436 return m_signal_register_helper.connect (slot);
2439 Connection signal_connect_remove_helper (InfoManagerSlotInt* slot) {
2440 return m_signal_remove_helper.connect (slot);
2443 Connection signal_connect_set_active_ise_by_uuid (InfoManagerSlotStringBool* slot) {
2444 return m_signal_set_active_ise_by_uuid.connect (slot);
2447 Connection signal_connect_focus_in (InfoManagerSlotVoid* slot) {
2448 return m_signal_focus_in.connect (slot);
2451 Connection signal_connect_focus_out (InfoManagerSlotVoid* slot) {
2452 return m_signal_focus_out.connect (slot);
2455 Connection signal_connect_expand_candidate (InfoManagerSlotVoid* slot) {
2456 return m_signal_expand_candidate.connect (slot);
2459 Connection signal_connect_contract_candidate (InfoManagerSlotVoid* slot) {
2460 return m_signal_contract_candidate.connect (slot);
2463 Connection signal_connect_select_candidate (InfoManagerSlotInt* slot) {
2464 return m_signal_select_candidate.connect (slot);
2467 Connection signal_connect_get_ise_list (InfoManagerSlotBoolStringVector* slot) {
2468 return m_signal_get_ise_list.connect (slot);
2471 Connection signal_connect_get_all_helper_ise_info (InfoManagerSlotBoolHelperInfo* slot) {
2472 return m_signal_get_all_helper_ise_info.connect (slot);
2475 Connection signal_connect_set_has_option_helper_ise_info (InfoManagerSlotStringBool* slot) {
2476 return m_signal_set_has_option_helper_ise_info.connect (slot);
2479 Connection signal_connect_set_enable_helper_ise_info (InfoManagerSlotStringBool* slot) {
2480 return m_signal_set_enable_helper_ise_info.connect (slot);
2483 Connection signal_connect_show_helper_ise_list (InfoManagerSlotVoid* slot) {
2484 return m_signal_show_helper_ise_list.connect (slot);
2487 Connection signal_connect_show_helper_ise_selector (InfoManagerSlotVoid* slot) {
2488 return m_signal_show_helper_ise_selector.connect (slot);
2491 Connection signal_connect_is_helper_ise_enabled (InfoManagerSlotStringInt* slot) {
2492 return m_signal_is_helper_ise_enabled.connect (slot);
2495 Connection signal_connect_get_ise_information (InfoManagerSlotBoolString4int2* slot) {
2496 return m_signal_get_ise_information.connect (slot);
2499 Connection signal_connect_get_keyboard_ise_list (InfoManagerSlotBoolStringVector* slot) {
2500 return m_signal_get_keyboard_ise_list.connect (slot);
2503 Connection signal_connect_update_ise_geometry (InfoManagerSlotIntIntIntInt* slot) {
2504 return m_signal_update_ise_geometry.connect (slot);
2507 Connection signal_connect_get_language_list (InfoManagerSlotStringVector* slot) {
2508 return m_signal_get_language_list.connect (slot);
2511 Connection signal_connect_get_all_language (InfoManagerSlotStringVector* slot) {
2512 return m_signal_get_all_language.connect (slot);
2515 Connection signal_connect_get_ise_language (InfoManagerSlotStrStringVector* slot) {
2516 return m_signal_get_ise_language.connect (slot);
2519 Connection signal_connect_get_ise_info_by_uuid (InfoManagerSlotStringISEINFO* slot) {
2520 return m_signal_get_ise_info_by_uuid.connect (slot);
2523 Connection signal_connect_send_key_event (InfoManagerSlotKeyEvent* slot) {
2524 return m_signal_send_key_event.connect (slot);
2527 Connection signal_connect_accept_connection (InfoManagerSlotInt* slot) {
2528 return m_signal_accept_connection.connect (slot);
2531 Connection signal_connect_close_connection (InfoManagerSlotInt* slot) {
2532 return m_signal_close_connection.connect (slot);
2535 Connection signal_connect_exit (InfoManagerSlotVoid* slot) {
2536 return m_signal_exit.connect (slot);
2539 Connection signal_connect_transaction_start (InfoManagerSlotVoid* slot) {
2540 return m_signal_transaction_start.connect (slot);
2543 Connection signal_connect_transaction_end (InfoManagerSlotVoid* slot) {
2544 return m_signal_transaction_end.connect (slot);
2547 Connection signal_connect_lock (InfoManagerSlotVoid* slot) {
2548 return m_signal_lock.connect (slot);
2551 Connection signal_connect_unlock (InfoManagerSlotVoid* slot) {
2552 return m_signal_unlock.connect (slot);
2555 Connection signal_connect_update_input_context (InfoManagerSlotIntInt* slot) {
2556 return m_signal_update_input_context.connect (slot);
2559 Connection signal_connect_update_language_locale(InfoManagerSlotString* slot) {
2560 return m_signal_update_language_locale.connect(slot);
2563 Connection signal_connect_show_ise (InfoManagerSlotVoid* slot) {
2564 return m_signal_show_ise.connect (slot);
2567 Connection signal_connect_hide_ise (InfoManagerSlotVoid* slot) {
2568 return m_signal_hide_ise.connect (slot);
2571 Connection signal_connect_will_show_ack (InfoManagerSlotVoid* slot) {
2572 return m_signal_will_show_ack.connect (slot);
2575 Connection signal_connect_will_hide_ack (InfoManagerSlotVoid* slot) {
2576 return m_signal_will_hide_ack.connect (slot);
2579 Connection signal_connect_set_keyboard_mode (InfoManagerSlotInt* slot) {
2580 return m_signal_set_keyboard_mode.connect (slot);
2583 Connection signal_connect_candidate_will_hide_ack (InfoManagerSlotVoid* slot) {
2584 return m_signal_candidate_will_hide_ack.connect (slot);
2587 Connection signal_connect_get_ise_state (InfoManagerSlotInt2* slot) {
2588 return m_signal_get_ise_state.connect (slot);
2591 Connection signal_connect_run_helper (InfoManagerSlotString3* slot)
2593 return m_signal_run_helper.connect (slot);
2596 Connection signal_connect_launch_option_application (InfoManagerSlotBoolString* slot)
2598 return m_signal_launch_option_application.connect (slot);
2601 Connection signal_connect_get_recent_ise_geometry (InfoManagerSlotIntRect* slot) {
2602 return m_signal_get_recent_ise_geometry.connect (slot);
2605 Connection signal_connect_check_privilege_by_sockfd (InfoManagerSlotIntString2* slot)
2607 return m_signal_check_privilege_by_sockfd.connect (slot);
2610 Connection signal_connect_remoteinput_send_input_message (InfoManagerSlotStringBool* slot)
2612 return m_signal_remoteinput_send_input_message.connect (slot);
2615 Connection signal_connect_remoteinput_send_surrounding_text (InfoManagerSlotIntString* slot)
2617 return m_signal_remoteinput_send_surrounding_text.connect (slot);
2620 //ISM_TRANS_CMD_REGISTER_PANEL_CLIENT
2621 void register_panel_client (uint32 client_id, uint32 id) {
2622 m_panel_client_map [client_id] = (int)id;
2624 //SCIM_TRANS_CMD_PANEL_REGISTER_INPUT_CONTEXT
2625 void register_input_context (uint32 client_id, uint32 context, String uuid) {
2626 uint32 ctx = get_helper_ic (m_panel_client_map[client_id], context);
2627 m_client_context_uuids [ctx] = uuid;
2629 //SCIM_TRANS_CMD_PANEL_REMOVE_INPUT_CONTEXT
2630 void remove_input_context (uint32 client_id, uint32 context) {
2631 uint32 ctx = get_helper_ic (m_panel_client_map[client_id], context);
2632 m_client_context_uuids.erase (ctx);
2634 if (ctx == get_helper_ic (m_current_socket_client, m_current_client_context)) {
2636 m_current_socket_client = m_last_socket_client;
2637 m_current_client_context = m_last_client_context;
2638 m_current_context_uuid = m_last_context_uuid;
2639 m_last_socket_client = -1;
2640 m_last_client_context = 0;
2641 m_last_context_uuid = String ("");
2643 if (m_current_socket_client == -1) {
2645 socket_update_control_panel ();
2649 } else if (ctx == get_helper_ic (m_last_socket_client, m_last_client_context)) {
2651 m_last_socket_client = -1;
2652 m_last_client_context = 0;
2653 m_last_context_uuid = String ("");
2657 if (m_client_context_uuids.size () == 0)
2658 m_signal_stop_default_ise ();
2661 //SCIM_TRANS_CMD_PANEL_RESET_INPUT_CONTEXT
2662 void socket_reset_input_context (int client_id, uint32 context) {
2663 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_reset_input_context \n";
2665 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2666 socket_reset_helper_input_context (m_current_helper_uuid, m_panel_client_map[client_id], context);
2669 //SCIM_TRANS_CMD_FOCUS_IN
2670 void focus_in (int client_id, uint32 context, String uuid) {
2671 m_refocus_needed = true;
2672 bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false);
2673 if (launch_ise_on_request)
2674 m_signal_start_default_ise ();
2676 m_signal_focus_in ();
2677 focus_in_helper (m_current_helper_uuid, m_panel_client_map[client_id], context);
2678 SCIM_DEBUG_MAIN (2) << "PanelAgent::focus_in (" << client_id << "," << context << "," << uuid << ")\n";
2679 m_active_client_id = client_id;
2682 if (m_current_socket_client >= 0) {
2683 m_last_socket_client = m_current_socket_client;
2684 m_last_client_context = m_current_client_context;
2685 m_last_context_uuid = m_current_context_uuid;
2688 m_current_socket_client = m_panel_client_map[client_id];
2689 m_current_client_context = context;
2690 m_current_context_uuid = uuid;
2694 //SCIM_TRANS_CMD_FOCUS_OUT
2695 void focus_out (int client_id, uint32 context) {
2696 m_refocus_needed = false;
2697 m_signal_focus_out ();
2699 focus_out_helper (m_current_helper_uuid, m_panel_client_map[client_id], context);
2701 if (m_current_socket_client >= 0) {
2702 m_last_socket_client = m_current_socket_client;
2703 m_last_client_context = m_current_client_context;
2704 m_last_context_uuid = m_current_context_uuid;
2707 m_current_socket_client = -1;
2708 m_current_client_context = 0;
2709 m_current_context_uuid = String ("");
2713 //ISM_TRANS_CMD_TURN_ON_LOG
2714 void socket_turn_on_log (uint32 isOn) {
2716 DebugOutput::enable_debug (SCIM_DEBUG_AllMask);
2717 DebugOutput::set_verbose_level (7);
2718 SCIM_DEBUG_MAIN (4) << __func__ << " on\n";
2720 SCIM_DEBUG_MAIN (4) << __func__ << " off\n";
2721 DebugOutput::disable_debug (SCIM_DEBUG_AllMask);
2722 DebugOutput::set_verbose_level (0);
2726 uint32 focused_context;
2727 get_focused_context (focused_client, focused_context);
2729 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
2730 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
2732 if (it != m_helper_client_index.end ()) {
2733 //uint32 ctx = get_helper_ic (focused_client, focused_context);
2735 //m_panel_agent_manager.socket_turn_on_log (it->second.id, ctx, m_current_helper_uuid, isOn);
2739 if (focused_client == -1) {
2740 std::cerr << __func__ << " get_focused_context is failed!!!\n";
2744 ClientInfo client_info = socket_get_client_info (focused_client);
2746 if (client_info.type == FRONTEND_CLIENT) {
2748 //m_panel_agent_manager.socket_turn_on_log (focused_client, focused_context, isOn);
2753 void add_client (int client_id, uint32 key, ClientType type) {
2754 LOGD ("id:%d, key:%d, type:%d", client_id, key, type);
2758 SCIM_DEBUG_MAIN (4) << "Add client to repository. Type=" << type << " key=" << key << "\n";
2760 m_client_repository [client_id] = info;
2762 if (info.type == IMCONTROL_ACT_CLIENT) {
2763 m_pending_active_imcontrol_id = client_id;
2764 } else if (info.type == IMCONTROL_CLIENT) {
2765 m_imcontrol_map [m_pending_active_imcontrol_id] = client_id;
2766 m_pending_active_imcontrol_id = -1;
2767 } else if (info.type == REMOTEINPUT_ACT_CLIENT) {
2768 m_current_send_remoteinput_id.push_back (client_id);
2769 } else if (info.type == REMOTEINPUT_CLIENT) {
2770 m_current_recv_remoteinput_id.push_back (client_id);
2773 LOGD ("%d clients connecting", m_client_repository.size());
2778 void del_client (int client_id) {
2779 ClientRepository::iterator iter = m_client_repository.find(client_id);
2780 if (iter == m_client_repository.end()) {
2781 LOGW("The client with id %d does not exist in our client repository, returning", client_id);
2785 m_signal_close_connection (client_id);
2786 ClientInfo client_info = socket_get_client_info (client_id);
2787 m_client_repository.erase (client_id);
2788 LOGD ("id:%d, type:%d", client_id, client_info.type);
2789 #ifdef PANEL_SERVER_AUTO_EXIT
2790 /* Exit panel if there is no connected client anymore. */
2791 if (client_info.type != UNKNOWN_CLIENT && m_client_repository.size () == 0 && !m_should_resident) {
2792 SCIM_DEBUG_MAIN (4) << "Exit Socket Server Thread.\n";
2793 server->shutdown ();
2794 m_signal_exit.emit ();
2799 if (client_info.type == FRONTEND_CLIENT) {
2800 SCIM_DEBUG_MAIN (4) << "It's a FrontEnd client.\n";
2802 /* The focused client is closed. */
2803 if (m_current_socket_client == client_id) {
2804 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2805 hide_helper (m_current_helper_uuid);
2808 m_current_socket_client = -1;
2809 m_current_client_context = 0;
2810 m_current_context_uuid = String ("");
2812 socket_transaction_start ();
2814 socket_transaction_end ();
2817 if (m_last_socket_client == client_id) {
2819 m_last_socket_client = -1;
2820 m_last_client_context = 0;
2821 m_last_context_uuid = String ("");
2825 /* Erase all associated Client Context UUIDs. */
2826 std::vector <uint32> ctx_list;
2827 ClientContextUUIDRepository::iterator it = m_client_context_uuids.begin ();
2829 for (; it != m_client_context_uuids.end (); ++it) {
2830 if ((it->first & 0xFFFF) == (client_id & 0xFFFF))
2831 ctx_list.push_back (it->first);
2834 for (size_t i = 0; i < ctx_list.size (); ++i)
2835 m_client_context_uuids.erase (ctx_list [i]);
2837 /* Erase all helperise info associated with the client */
2839 it = m_client_context_helper.begin ();
2841 for (; it != m_client_context_helper.end (); ++it) {
2842 if ((it->first & 0xFFFF) == (client_id & 0xFFFF)) {
2843 ctx_list.push_back (it->first);
2844 /* similar to stop_helper except that it will not call get_focused_context() */
2845 String uuid = it->second;
2847 if (m_helper_uuid_count.find (uuid) != m_helper_uuid_count.end ()) {
2848 uint32 count = m_helper_uuid_count[uuid];
2851 m_helper_uuid_count.erase (uuid);
2852 HelperClientIndex::iterator pise = m_helper_client_index.find (uuid);
2854 if (pise != m_helper_client_index.end ()) {
2855 stop_helper (uuid, pise->second.id, it->first);
2858 SCIM_DEBUG_MAIN (1) << "Stop HelperISE " << uuid << " ...\n";
2860 m_helper_uuid_count[uuid] = count - 1;
2861 focus_out_helper (uuid, (it->first & 0xFFFF), ((it->first >> 16) & 0x7FFF));
2862 SCIM_DEBUG_MAIN (1) << "Decrement usage count of HelperISE " << uuid
2863 << " to " << m_helper_uuid_count[uuid] << "\n";
2869 for (size_t i = 0; i < ctx_list.size (); ++i)
2870 m_client_context_helper.erase (ctx_list [i]);
2872 HelperInfoRepository::iterator iter = m_helper_info_repository.begin ();
2874 for (; iter != m_helper_info_repository.end (); iter++) {
2875 if (!m_current_helper_uuid.compare (iter->second.uuid))
2876 if (! (iter->second.option & ISM_ISE_HIDE_IN_CONTROL_PANEL))
2877 socket_update_control_panel ();
2879 } else if (client_info.type == FRONTEND_ACT_CLIENT) {
2880 SCIM_DEBUG_MAIN (4) << "It's a FRONTEND_ACT_CLIENT client.\n";
2881 IntIntRepository::iterator iter2 = m_panel_client_map.find (client_id);
2883 if (iter2 != m_panel_client_map.end ())
2884 m_panel_client_map.erase (iter2);
2885 } else if (client_info.type == HELPER_CLIENT) {
2886 SCIM_DEBUG_MAIN (4) << "It's a Helper client.\n";
2888 HelperInfoRepository::iterator hiit = m_helper_info_repository.find (client_id);
2890 if (hiit != m_helper_info_repository.end ()) {
2891 bool restart = false;
2892 String uuid = hiit->second.uuid;
2893 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
2895 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
2896 if ((hiit->second.option & SCIM_HELPER_AUTO_RESTART) &&
2897 (default_uuid.compare (uuid) == 0 || default_uuid.compare ("") == 0) &&
2898 (it != m_helper_client_index.end () && it->second.ref > 0)) {
2902 m_helper_client_index.erase (uuid);
2903 m_helper_info_repository.erase (hiit);
2905 m_signal_stop_default_ise ();
2907 if (m_refocus_needed || m_reshow_needed)
2908 m_restart_needed = true;
2910 if (restart && !m_ise_exiting && m_restart_needed) {
2911 struct tms tiks_buf;
2912 static clock_t start_tiks = times (&tiks_buf);
2913 static double clock_tiks = (double)sysconf (_SC_CLK_TCK);
2914 clock_t curr_tiks = times (&tiks_buf);
2915 double secs = (double) (curr_tiks - start_tiks) / clock_tiks;
2916 //LOGE ("time second:%f", secs);
2917 static String restart_uuid;
2919 if (restart_uuid != uuid || secs > MIN_REPEAT_TIME) {
2920 scim_usleep (100000);
2924 get_focused_context(client, context);
2926 uint32 ic = get_helper_ic (client, context);
2928 /* Get the context uuid from the client context registration table. */
2930 ClientContextUUIDRepository::iterator it =
2931 m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client], context));
2933 if (it != m_client_context_uuids.end ())
2934 ic_uuid = it->second;
2937 m_start_helper_ic_index[uuid].push_back(std::make_pair(ic, ic_uuid));
2938 m_signal_run_helper (uuid, m_config_name, m_display_name);
2939 restart_uuid = uuid;
2940 LOGE ("Auto restart soft ISE:%s", uuid.c_str ());
2942 reset_default_ise (0);
2943 ISF_SAVE_LOG ("Auto restart is abnormal, reset default ISE");
2946 start_tiks = curr_tiks;
2950 m_ise_exiting = false;
2951 m_restart_needed = true;
2953 socket_transaction_start ();
2954 m_signal_remove_helper (client_id);
2955 socket_transaction_end ();
2956 } else if (client_info.type == HELPER_ACT_CLIENT) {
2957 SCIM_DEBUG_MAIN (4) << "It's a Helper passive client.\n";
2959 HelperInfoRepository::iterator hiit = m_helper_active_info_repository.find (client_id);
2961 if (hiit != m_helper_active_info_repository.end ())
2962 m_helper_active_info_repository.erase (hiit);
2965 } else if (client_info.type == IMCONTROL_ACT_CLIENT) {
2966 SCIM_DEBUG_MAIN (4) << "It's a IMCONTROL_ACT_CLIENT client.\n";
2967 IMControlRepository::iterator iter = m_imcontrol_repository.find (client_id);
2969 if (iter != m_imcontrol_repository.end ()) {
2970 int size = iter->second.info.size ();
2974 stop_helper ((iter->second.info)[i].uuid, (iter->second.count)[i], DEFAULT_CONTEXT_VALUE);
2976 if ((iter->second.info)[i].option & ISM_ISE_HIDE_IN_CONTROL_PANEL)
2977 m_current_helper_uuid = m_last_helper_uuid;
2982 m_imcontrol_repository.erase (iter);
2985 IntIntRepository::iterator iter2 = m_imcontrol_map.find (client_id);
2987 if (iter2 != m_imcontrol_map.end ())
2988 m_imcontrol_map.erase (iter2);
2989 } else if (client_info.type == REMOTEINPUT_ACT_CLIENT) {
2990 SCIM_DEBUG_MAIN (4) << "It's a REMOTEINPUT_ACT_CLIENT client.\n";
2992 for (unsigned int i = 0; i < m_current_send_remoteinput_id.size (); i++) {
2993 if (m_current_send_remoteinput_id.at (i) == client_id) {
2994 m_current_send_remoteinput_id.erase (m_current_send_remoteinput_id.begin () + i);
2998 } else if (client_info.type == REMOTEINPUT_CLIENT) {
2999 SCIM_DEBUG_MAIN (4) << "It's a REMOTEINPUT_CLIENT client.\n";
3001 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3002 if (m_current_recv_remoteinput_id.at (i) == client_id) {
3003 m_current_recv_remoteinput_id.erase (m_current_recv_remoteinput_id.begin () + i);
3007 } else if (client_info.type == CONFIG_CLIENT) {
3008 SCIM_DEBUG_MAIN(4) << "It's a CONFIG_CLIENT client.\n";
3010 LOGI ("clients: %d, panel clients: %d, imcontrols size: %d, helper infos: %d, \
3011 helper active infos: %d, helper client indexs: %d, ises pending: %d, \
3012 imcontrols: %d, start helper ic indexs: %d, client context uuids: %d, \
3013 client context helpers: %d, helpers uuid count: %d",
3014 m_client_repository.size(),
3015 m_panel_client_map.size(),
3016 m_imcontrol_map.size(),
3017 m_helper_info_repository.size(),
3018 m_helper_active_info_repository.size(),
3019 m_helper_client_index.size(),
3020 m_ise_pending_repository.size(),
3021 m_imcontrol_repository.size(),
3022 m_start_helper_ic_index.size(),
3023 m_client_context_uuids.size(),
3024 m_client_context_helper.size(),
3025 m_helper_uuid_count.size());
3028 const ClientInfo& socket_get_client_info (int client) {
3029 static ClientInfo null_client = { 0, UNKNOWN_CLIENT };
3030 ClientRepository::iterator it = m_client_repository.find (client);
3032 if (it != m_client_repository.end ())
3038 //SCIM_TRANS_CMD_PANEL_TURN_ON
3039 void socket_turn_on (void) {
3040 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_turn_on ()\n";
3041 m_signal_turn_on ();
3043 //SCIM_TRANS_CMD_PANEL_TURN_OFF
3044 void socket_turn_off (void) {
3045 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_turn_off ()\n";
3046 m_signal_turn_off ();
3048 //SCIM_TRANS_CMD_UPDATE_SCREEN
3049 void socket_update_screen (int client_id, uint32 num) {
3050 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_screen ()\n";
3052 if (((int) num) != m_current_screen) {
3053 SCIM_DEBUG_MAIN (4) << "New Screen number = " << num << "\n";
3054 m_signal_update_screen ((int) num);
3055 helper_all_update_screen ((int) num);
3056 m_current_screen = (num);
3059 //SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
3060 void socket_update_spot_location (uint32 x, uint32 y, uint32 top_y) {
3061 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_spot_location ()\n";
3062 SCIM_DEBUG_MAIN (4) << "New Spot location x=" << x << " y=" << y << "\n";
3063 m_signal_update_spot_location ((int)x, (int)y, (int)top_y);
3064 helper_all_update_spot_location ((int)x, (int)y);
3066 //ISM_TRANS_CMD_UPDATE_CURSOR_POSITION
3067 void socket_update_cursor_position (uint32 cursor_pos) {
3068 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_cursor_position ()\n";
3069 SCIM_DEBUG_MAIN (4) << "New cursor position pos=" << cursor_pos << "\n";
3070 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
3071 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
3072 iseContext->cursor_pos = static_cast<int>(cursor_pos);
3074 helper_all_update_cursor_position ((int)cursor_pos);
3076 //ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT
3077 void socket_update_surrounding_text (String text, uint32 cursor) {
3078 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3079 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3081 if (it != m_helper_client_index.end ()) {
3086 get_focused_context (client, context);
3087 ctx = get_helper_ic (client, context);
3088 m_panel_agent_manager.socket_update_surrounding_text (it->second.id, ctx, m_current_helper_uuid, text, cursor);
3093 void remoteinput_callback_focus_in () {
3094 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3096 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3098 m_panel_agent_manager.socket_remoteinput_focus_in (m_current_recv_remoteinput_id.at (i));
3103 void remoteinput_callback_focus_out () {
3104 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3106 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3108 m_panel_agent_manager.socket_remoteinput_focus_out (m_current_recv_remoteinput_id.at (i));
3113 void remoteinput_callback_entry_metadata (uint32 hint, uint32 layout, int variation, uint32 autocapital_type, int return_key_disabled) {
3114 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3115 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
3116 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
3117 iseContext->layout = static_cast<Ecore_IMF_Input_Panel_Layout>(layout);
3118 iseContext->return_key_disabled = static_cast<Eina_Bool>(return_key_disabled);
3119 iseContext->layout_variation = static_cast<int>(variation);
3120 iseContext->autocapital_type = static_cast<Ecore_IMF_Autocapital_Type>(autocapital_type);
3121 iseContext->input_hint = static_cast<Ecore_IMF_Input_Hints>(hint);
3123 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3125 m_panel_agent_manager.socket_remoteinput_entry_metadata (m_current_recv_remoteinput_id.at (i), hint, layout, variation, autocapital_type, return_key_disabled);
3130 void remoteinput_callback_surrounding_text (String text, uint32 cursor) {
3131 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3133 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3135 m_panel_agent_manager.socket_remoteinput_surrounding_text (m_current_recv_remoteinput_id.at (i), text, cursor);
3140 void remoteinput_callback_input_resource (uint32 input_resource) {
3141 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3143 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3145 m_panel_agent_manager.socket_remoteinput_input_resource (m_current_recv_remoteinput_id.at (i), input_resource);
3150 //ISM_TRANS_CMD_UPDATE_SELECTION
3151 void socket_update_selection (String text) {
3152 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3153 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3155 if (it != m_helper_client_index.end ()) {
3160 get_focused_context (client, context);
3161 ctx = get_helper_ic (client, context);
3162 m_panel_agent_manager.socket_update_selection (it->second.id, ctx, m_current_helper_uuid, text);
3166 //SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO
3167 void socket_update_factory_info (PanelFactoryInfo& info) {
3168 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_factory_info ()\n";
3169 SCIM_DEBUG_MAIN (4) << "New Factory info uuid=" << info.uuid << " name=" << info.name << "\n";
3170 info.lang = scim_get_normalized_language (info.lang);
3171 m_signal_update_factory_info (info);
3173 //SCIM_TRANS_CMD_PANEL_SHOW_HELP
3174 void socket_show_help (String help) {
3175 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_help ()\n";
3176 m_signal_show_help (help);
3178 //SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU
3179 void socket_show_factory_menu (std::vector <PanelFactoryInfo>& vec) {
3180 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_factory_menu ()\n";
3183 m_signal_show_factory_menu (vec);
3186 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
3187 void socket_show_preedit_string (void) {
3188 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_preedit_string ()\n";
3189 m_signal_show_preedit_string ();
3191 //SCIM_TRANS_CMD_SHOW_AUX_STRING
3192 void socket_show_aux_string (void) {
3193 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_aux_string ()\n";
3194 m_signal_show_aux_string ();
3196 //SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE
3197 void socket_show_lookup_table (void) {
3198 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_lookup_table ()\n";
3199 m_signal_show_lookup_table ();
3201 //ISM_TRANS_CMD_SHOW_ASSOCIATE_TABLE
3202 void socket_show_associate_table (void) {
3203 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_associate_table ()\n";
3204 m_signal_show_associate_table ();
3206 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
3207 void socket_hide_preedit_string (void) {
3208 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_preedit_string ()\n";
3209 m_signal_hide_preedit_string ();
3211 //SCIM_TRANS_CMD_HIDE_AUX_STRING
3212 void socket_hide_aux_string (void) {
3213 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_aux_string ()\n";
3214 m_signal_hide_aux_string ();
3216 //SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE
3217 void socket_hide_lookup_table (void) {
3218 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_lookup_table ()\n";
3219 m_signal_hide_lookup_table ();
3221 //ISM_TRANS_CMD_HIDE_ASSOCIATE_TABLE
3222 void socket_hide_associate_table (void) {
3223 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_associate_table ()\n";
3224 m_signal_hide_associate_table ();
3226 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
3227 void socket_update_preedit_string (String& str, const AttributeList& attrs, uint32 caret) {
3228 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_string ()\n";
3229 m_signal_update_preedit_string (str, attrs, (int) caret);
3231 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
3232 void socket_update_preedit_caret (uint32 caret) {
3233 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_caret ()\n";
3234 m_signal_update_preedit_caret ((int) caret);
3236 //ISM_TRANS_CMD_RECAPTURE_STRING
3237 void socket_recapture_string (int offset, int len, String& preedit, String& commit, const AttributeList& attrs) {
3238 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_caret ()\n";
3239 m_signal_recapture_string (offset, len, preedit, commit, attrs);
3241 //SCIM_TRANS_CMD_UPDATE_AUX_STRING
3242 void socket_update_aux_string (String& str, const AttributeList& attrs) {
3243 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_aux_string ()\n";
3244 m_signal_update_aux_string (str, attrs);
3245 m_is_imengine_aux = true;
3247 //SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE
3248 void socket_update_lookup_table (const LookupTable& table) {
3249 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_lookup_table ()\n";
3251 //g_isf_candidate_table = _isf_candidate_table;
3252 m_signal_update_lookup_table (table);
3253 m_is_imengine_candidate = true;
3255 //ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE
3256 void socket_update_associate_table (const LookupTable& table) {
3257 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_associate_table ()\n";
3258 m_signal_update_associate_table (table);
3261 void socket_update_control_panel (void) {
3262 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_control_panel ()\n";
3264 m_signal_get_keyboard_ise (name, uuid);
3265 PanelFactoryInfo info;
3267 if (name.length () > 0)
3268 info = PanelFactoryInfo (uuid, name, String (""), String (""));
3270 info = PanelFactoryInfo (String (""), String (_ ("English Keyboard")), String ("C"), String (SCIM_KEYBOARD_ICON_FILE));
3272 m_signal_update_factory_info (info);
3274 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
3275 void socket_register_properties (const PropertyList& properties) {
3276 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_register_properties ()\n";
3277 m_signal_register_properties (properties);
3279 //SCIM_TRANS_CMD_UPDATE_PROPERTY
3280 void socket_update_property (const Property& property) {
3281 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_property ()\n";
3282 m_signal_update_property (property);
3284 //ISM_TRANS_CMD_GET_KEYBOARD_ISE_LIST
3285 void socket_get_keyboard_ise_list (String& uuid) {
3286 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_keyboard_ise_list ()\n";
3287 std::vector<String> list;
3289 m_signal_get_keyboard_ise_list (list);
3290 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3292 if (it != m_helper_client_index.end ()) {
3295 get_focused_context (client, context);
3296 uint32 ctx = get_helper_ic (client, context);
3297 m_panel_agent_manager.socket_get_keyboard_ise_list (it->second.id, ctx, uuid, list);
3300 //ISM_TRANS_CMD_SET_CANDIDATE_UI
3301 void socket_set_candidate_ui (uint32 portrait_line, uint32 mode) {
3302 SCIM_DEBUG_MAIN (4) << __func__ << " \n";
3303 m_signal_set_candidate_ui (portrait_line, mode);
3305 //ISM_TRANS_CMD_GET_CANDIDATE_UI
3306 void socket_get_candidate_ui (String uuid) {
3307 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_candidate_ui ()\n";
3308 int style = 0, mode = 0;
3309 m_signal_get_candidate_ui (style, mode);
3310 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3312 if (it != m_helper_client_index.end ()) {
3315 get_focused_context (client, context);
3316 uint32 ctx = get_helper_ic (client, context);
3317 m_panel_agent_manager.socket_get_candidate_ui (it->second.id, ctx, uuid, style, mode);
3320 //ISM_TRANS_CMD_SET_CANDIDATE_POSITION
3321 void socket_set_candidate_position (uint32 left, uint32 top) {
3322 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_candidate_position ()\n";
3323 m_signal_set_candidate_position (left, top);
3325 //ISM_TRANS_CMD_HIDE_CANDIDATE
3326 void socket_hide_candidate (void) {
3327 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_candidate ()\n";
3328 m_signal_hide_preedit_string ();
3329 m_signal_hide_aux_string ();
3330 m_signal_hide_lookup_table ();
3331 m_signal_hide_associate_table ();
3333 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
3334 void socket_get_candidate_geometry (String& uuid) {
3335 SCIM_DEBUG_MAIN (4) << __func__ << " \n";
3336 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3338 if (it != m_helper_client_index.end ()) {
3339 struct rectinfo info = {0, 0, 0, 0};
3340 m_signal_get_candidate_geometry (info);
3343 get_focused_context (client, context);
3344 uint32 ctx = get_helper_ic (client, context);
3345 m_panel_agent_manager.socket_get_candidate_geometry (it->second.id, ctx, uuid, info);
3348 //ISM_TRANS_CMD_SET_KEYBOARD_ISE_BY_UUID
3349 void socket_set_keyboard_ise (String uuid) {
3350 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_keyboard_ise ()\n";
3352 m_signal_set_keyboard_ise (uuid);
3354 //ISM_TRANS_CMD_SELECT_CANDIDATE
3355 void socket_helper_select_candidate (uint32 index) {
3356 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_keyboard_ise ()\n";
3358 m_signal_select_candidate (index);
3360 //ISM_TRANS_CMD_UPDATE_ISE_GEOMETRY
3361 void socket_helper_update_ise_geometry (int client, uint32 x, uint32 y, uint32 width, uint32 height) {
3362 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3365 uint32 focused_context;
3366 HelperInfoRepository::iterator it = m_helper_active_info_repository.find (client);
3368 if (it != m_helper_active_info_repository.end ()) {
3369 if (it->second.uuid == m_current_helper_uuid) {
3370 m_signal_update_ise_geometry (x, y, width, height);
3372 get_focused_context (focused_client, focused_context);
3373 ClientInfo client_info = socket_get_client_info (focused_client);
3374 if (client_info.type == FRONTEND_CLIENT) {
3375 m_panel_agent_manager.update_ise_geometry (focused_client, focused_context, x, y, width, height);
3380 //ISM_TRANS_CMD_GET_KEYBOARD_ISE
3381 void socket_get_keyboard_ise (String uuid) {
3382 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_keyboard_ise ()\n";
3383 String ise_name, ise_uuid;
3387 get_focused_context (client, context);
3388 ctx = get_helper_ic (client, context);
3390 if (m_client_context_uuids.find (ctx) != m_client_context_uuids.end ())
3391 ise_uuid = m_client_context_uuids[ctx];
3393 m_signal_get_keyboard_ise (ise_name, ise_uuid);
3394 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3396 if (it != m_helper_client_index.end ()) {
3397 get_focused_context (client, context);
3398 ctx = get_helper_ic (client, context);
3399 m_panel_agent_manager.socket_get_keyboard_ise (it->second.id, ctx, uuid, ise_name, ise_uuid);
3403 //SCIM_TRANS_CMD_START_HELPER
3404 void socket_start_helper (int client_id, uint32 context, String uuid) {
3405 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_start_helper ()\n";
3406 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3408 uint32 ic = get_helper_ic (m_panel_client_map[client_id], context);
3410 /* Get the context uuid from the client context registration table. */
3412 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3414 if (it != m_client_context_uuids.end ())
3415 ic_uuid = it->second;
3418 if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3419 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3420 } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3421 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3424 if (it == m_helper_client_index.end ()) {
3425 SCIM_DEBUG_MAIN (5) << "Run this Helper.\n";
3426 m_start_helper_ic_index [uuid].push_back (std::make_pair (ic, ic_uuid));
3427 m_signal_run_helper (uuid, m_config_name, m_display_name);
3429 SCIM_DEBUG_MAIN (5) << "Increase the Reference count.\n";
3430 m_panel_agent_manager.socket_start_helper (it->second.id, ic, ic_uuid);
3436 //SCIM_TRANS_CMD_STOP_HELPER
3437 void socket_stop_helper (int client_id, uint32 context, String uuid) {
3438 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_stop_helper ()\n";
3439 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3441 uint32 ic = get_helper_ic (m_panel_client_map[client_id], context);
3443 if (it != m_helper_client_index.end ()) {
3444 SCIM_DEBUG_MAIN (5) << "Decrase the Reference count.\n";
3447 /* Get the context uuid from the client context registration table. */
3449 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3451 if (it != m_client_context_uuids.end ())
3452 ic_uuid = it->second;
3455 if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3456 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3457 } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3458 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3461 m_panel_agent_manager.helper_detach_input_context (it->second.id, ic, ic_uuid);
3463 if (it->second.ref <= 0)
3464 m_panel_agent_manager.exit (it->second.id, ic);
3469 //SCIM_TRANS_CMD_SEND_HELPER_EVENT
3470 void socket_send_helper_event (int client_id, uint32 context, String uuid, const Transaction& _nest_trans) {
3471 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_send_helper_event ()\n";
3472 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3474 if (it != m_helper_client_index.end ()) {
3476 /* Get the context uuid from the client context registration table. */
3478 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3480 if (it != m_client_context_uuids.end ())
3481 ic_uuid = it->second;
3484 if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3485 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3486 } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3487 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3490 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);
3494 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
3495 void socket_helper_register_properties (int client, PropertyList& properties) {
3496 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_properties (" << client << ")\n";
3497 m_signal_register_helper_properties (client, properties);
3499 #if 0 //why? remove if useless, infinite loop
3500 /* Check whether application is already focus_in */
3501 if (m_current_socket_client != -1) {
3502 SCIM_DEBUG_MAIN (2) << "Application is already focus_in!\n";
3503 focus_in_helper (m_current_helper_uuid, m_current_socket_client, m_current_client_context);
3504 reset_keyboard_ise ();
3507 /* Check whether ISE panel is already shown */
3508 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode && m_ise_context_length > 0) {
3509 SCIM_DEBUG_MAIN (2) << "Re-show ISE panel!\n";
3511 uint32 focused_context;
3512 get_focused_context (focused_client, focused_context);
3514 if (focused_client == -1 && m_active_client_id != -1) {
3515 focused_client = m_panel_client_map[m_active_client_id];
3516 focused_context = 0;
3519 uint32 ctx = get_helper_ic (focused_client, focused_context);
3520 bool ret = show_helper (m_current_helper_uuid, m_ise_context_buffer, m_ise_context_length, ctx);
3523 m_signal_show_ise ();
3527 //SCIM_TRANS_CMD_UPDATE_PROPERTY
3528 void socket_helper_update_property (int client, Property& property) {
3529 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_property (" << client << ")\n";
3530 m_signal_update_helper_property (client, property);
3532 //SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT
3533 void socket_helper_send_imengine_event (int client, uint32 target_ic, String target_uuid , Transaction& nest_trans) {
3534 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_send_imengine_event (" << client << ")\n";
3535 HelperInfoRepository::iterator hiit = m_helper_active_info_repository.find (client);
3537 if (hiit != m_helper_active_info_repository.end ()) {
3539 uint32 target_context;
3540 get_imengine_client_context (target_ic, target_client, target_context);
3542 uint32 focused_context;
3543 String focused_uuid;
3544 focused_uuid = get_focused_context (focused_client, focused_context);
3546 if (target_ic == (uint32) (-1)) {
3547 target_client = focused_client;
3548 target_context = focused_context;
3551 if (target_uuid.length () == 0)
3552 target_uuid = focused_uuid;
3554 ClientInfo client_info = socket_get_client_info (target_client);
3555 SCIM_DEBUG_MAIN (5) << "Target UUID = " << target_uuid << " Focused UUId = " << focused_uuid << "\nTarget Client = " << target_client << "\n";
3557 if (client_info.type == FRONTEND_CLIENT) {
3558 /* If the original context value is greater than 0x7FFF, the line below would not work properly
3559 since the target_context acquired by get_imengnie_client_context() is always smaller than 0x7FFF.
3560 But since the send_imengine_event() of scim_helper module will call IMEngine's
3561 process_helper_event() function directly, instead of sending SEND_IMENGINE_EVENT message.
3562 So we are not going to handle this kind of exceptional case for now. */
3563 m_panel_agent_manager.process_helper_event (target_client, target_context, target_uuid, hiit->second.uuid, nest_trans);
3568 void socket_helper_key_event_op (int client, int cmd, uint32 target_ic, String& target_uuid, KeyEvent& key) {
3569 if (!key.empty ()) {
3571 uint32 target_context;
3572 get_imengine_client_context (target_ic, target_client, target_context);
3574 uint32 focused_context;
3575 String focused_uuid;
3576 focused_uuid = get_focused_context (focused_client, focused_context);
3578 if (target_ic == (uint32) (-1)) {
3579 target_client = focused_client;
3580 target_context = focused_context;
3583 if (target_uuid.length () == 0)
3584 target_uuid = focused_uuid;
3586 if (target_client == -1) {
3587 /* FIXUP: monitor 'Invalid Window' error */
3588 LOGW ("focused target client is NULL");
3589 } else if (target_uuid == focused_uuid &&
3590 clients_equal (target_client, focused_client) &&
3591 contexts_equal (target_context, focused_context)) {
3592 ClientInfo client_info = socket_get_client_info (focused_client);
3594 if (client_info.type == FRONTEND_CLIENT) {
3595 m_panel_agent_manager.socket_helper_key_event (focused_client, focused_context, cmd, key);
3598 LOGD ("[target_client : %d, focused_client : %d] => %d, [target_context : %u, focused_context : %u] => %d",
3599 target_client, focused_client, clients_equal (target_client, focused_client),
3600 target_context, focused_context, contexts_equal (target_context, focused_context));
3604 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
3605 //SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT
3606 void socket_helper_send_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key) {
3607 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_send_key_event (" << client << ")\n";
3608 ISF_PROF_DEBUG ("first message")
3609 socket_helper_key_event_op (client, SCIM_TRANS_CMD_PROCESS_KEY_EVENT, target_ic, target_uuid, key);
3611 //SCIM_TRANS_CMD_FORWARD_KEY_EVENT
3612 void socket_helper_forward_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key) {
3613 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_forward_key_event (" << client << ")\n";
3614 socket_helper_key_event_op (client, SCIM_TRANS_CMD_FORWARD_KEY_EVENT, target_ic, target_uuid, key);
3617 //SCIM_TRANS_CMD_COMMIT_STRING
3618 void socket_helper_commit_string (int client, uint32 target_ic, String target_uuid, WideString wstr) {
3619 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_commit_string (" << client << ")\n";
3621 if (wstr.length ()) {
3623 uint32 target_context;
3624 get_imengine_client_context (target_ic, target_client, target_context);
3626 uint32 focused_context;
3627 String focused_uuid;
3628 focused_uuid = get_focused_context (focused_client, focused_context);
3630 if (target_ic == (uint32) (-1)) {
3631 target_client = focused_client;
3632 target_context = focused_context;
3635 if (target_uuid.length () == 0)
3636 target_uuid = focused_uuid;
3638 if (target_uuid == focused_uuid &&
3639 clients_equal (target_client, focused_client) &&
3640 contexts_equal (target_context, focused_context)) {
3641 ClientInfo client_info = socket_get_client_info (focused_client);
3643 if (client_info.type == FRONTEND_CLIENT) {
3644 m_panel_agent_manager.commit_string (focused_client, focused_context, wstr);
3646 std::cerr << "target client is not existed!!!" << "\n";
3651 //SCIM_TRANS_CMD_GET_SURROUNDING_TEXT
3652 void socket_helper_get_surrounding_text (int client, String uuid, uint32 maxlen_before, uint32 maxlen_after) {
3653 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3655 uint32 focused_context;
3656 get_focused_context (focused_client, focused_context);
3657 ClientInfo client_info = socket_get_client_info (focused_client);
3659 /* If the get_surrounding_text was received when there is no client available,
3660 * return empty surrounding text since the sender would be waiting for reply */
3661 if (focused_client == -1) {
3662 socket_update_surrounding_text("", 0);
3664 if (client_info.type == FRONTEND_CLIENT) {
3665 m_panel_agent_manager.socket_helper_get_surrounding_text (focused_client, focused_context, maxlen_before, maxlen_after);
3669 //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT
3670 void socket_helper_delete_surrounding_text (int client, uint32 offset, uint32 len) {
3671 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3673 uint32 focused_context;
3674 get_focused_context (focused_client, focused_context);
3675 ClientInfo client_info = socket_get_client_info (focused_client);
3677 if (client_info.type == FRONTEND_CLIENT) {
3678 m_panel_agent_manager.socket_helper_delete_surrounding_text (focused_client, focused_context, offset, len);
3681 //SCIM_TRANS_CMD_GET_SELECTION
3682 void socket_helper_get_selection (int client, String uuid) {
3683 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3685 uint32 focused_context;
3686 get_focused_context (focused_client, focused_context);
3687 ClientInfo client_info = socket_get_client_info (focused_client);
3689 if (client_info.type == FRONTEND_CLIENT) {
3690 m_panel_agent_manager.socket_helper_get_selection (focused_client, focused_context);
3693 //SCIM_TRANS_CMD_SET_SELECTION
3694 void socket_helper_set_selection (int client, uint32 start, uint32 end) {
3695 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3697 uint32 focused_context;
3698 get_focused_context (focused_client, focused_context);
3699 ClientInfo client_info = socket_get_client_info (focused_client);
3701 if (client_info.type == FRONTEND_CLIENT) {
3702 m_panel_agent_manager.socket_helper_set_selection (focused_client, focused_context, start, end);
3706 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
3707 void socket_helper_show_preedit_string (int client, uint32 target_ic, String target_uuid) {
3708 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_show_preedit_string (" << client << ")\n";
3710 uint32 target_context;
3711 get_imengine_client_context (target_ic, target_client, target_context);
3713 uint32 focused_context;
3714 String focused_uuid = get_focused_context (focused_client, focused_context);
3716 if (target_ic == (uint32) (-1)) {
3717 target_client = focused_client;
3718 target_context = focused_context;
3721 if (target_uuid.length () == 0)
3722 target_uuid = focused_uuid;
3724 if (target_uuid == focused_uuid &&
3725 clients_equal (target_client, focused_client) &&
3726 contexts_equal (target_context, focused_context)) {
3727 ClientInfo client_info = socket_get_client_info (focused_client);
3729 if (client_info.type == FRONTEND_CLIENT) {
3730 m_panel_agent_manager.show_preedit_string (focused_client, focused_context);
3734 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
3735 void socket_helper_hide_preedit_string (int client, uint32 target_ic, String target_uuid) {
3736 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_hide_preedit_string (" << client << ")\n";
3738 uint32 target_context;
3739 get_imengine_client_context (target_ic, target_client, target_context);
3741 uint32 focused_context;
3742 String focused_uuid = get_focused_context (focused_client, focused_context);
3744 if (target_ic == (uint32) (-1)) {
3745 target_client = focused_client;
3746 target_context = focused_context;
3749 if (target_uuid.length () == 0)
3750 target_uuid = focused_uuid;
3752 if (target_uuid == focused_uuid &&
3753 clients_equal (target_client, focused_client) &&
3754 contexts_equal (target_context, focused_context)) {
3755 ClientInfo client_info = socket_get_client_info (focused_client);
3757 if (client_info.type == FRONTEND_CLIENT) {
3758 m_panel_agent_manager.hide_preedit_string (focused_client, focused_context);
3762 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
3763 void socket_helper_update_preedit_string (int client, uint32 target_ic, String target_uuid, WideString preedit, WideString commit, AttributeList& attrs, uint32 caret) {
3764 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_preedit_string (" << client << ")\n";
3766 uint32 target_context;
3767 get_imengine_client_context (target_ic, target_client, target_context);
3769 uint32 focused_context;
3770 String focused_uuid;
3771 focused_uuid = get_focused_context (focused_client, focused_context);
3773 if (target_ic == (uint32) (-1)) {
3774 target_client = focused_client;
3775 target_context = focused_context;
3778 if (target_uuid.length () == 0)
3779 target_uuid = focused_uuid;
3781 if (target_uuid == focused_uuid &&
3782 clients_equal (target_client, focused_client) &&
3783 contexts_equal (target_context, focused_context)) {
3784 ClientInfo client_info = socket_get_client_info (focused_client);
3786 if (client_info.type == FRONTEND_CLIENT) {
3787 m_panel_agent_manager.update_preedit_string (focused_client, focused_context, preedit, commit, attrs, caret);
3791 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
3792 void socket_helper_update_preedit_caret (int client, uint32 caret) {
3793 SCIM_DEBUG_MAIN (4) << __func__ << " (" << client << ")\n";
3795 uint32 focused_context;
3796 String focused_uuid;
3797 focused_uuid = get_focused_context (focused_client, focused_context);
3798 ClientInfo client_info = socket_get_client_info (focused_client);
3800 if (client_info.type == FRONTEND_CLIENT) {
3801 m_panel_agent_manager.update_preedit_caret (focused_client, focused_context, caret);
3805 //ISM_TRANS_CMD_RECAPTURE_STRING
3806 void socket_helper_recapture_string (int client, uint32 target_ic, String target_uuid, int offset, int len, WideString preedit,
3807 WideString commit, AttributeList& attrs) {
3808 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_recapture_string (" << client << ")\n";
3810 uint32 target_context;
3811 get_imengine_client_context (target_ic, target_client, target_context);
3813 uint32 focused_context;
3814 String focused_uuid;
3815 focused_uuid = get_focused_context (focused_client, focused_context);
3817 if (target_ic == (uint32) (-1)) {
3818 target_client = focused_client;
3819 target_context = focused_context;
3822 if (target_uuid.length () == 0)
3823 target_uuid = focused_uuid;
3825 if (target_uuid == focused_uuid &&
3826 clients_equal (target_client, focused_client) &&
3827 contexts_equal (target_context, focused_context)) {
3828 ClientInfo client_info = socket_get_client_info (focused_client);
3830 if (client_info.type == FRONTEND_CLIENT) {
3831 m_panel_agent_manager.recapture_string (focused_client, focused_context, offset, len, preedit, commit, attrs);
3836 //SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
3837 void socket_helper_register_helper (int client, HelperInfo& info) {
3838 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_helper (" << client << ")\n";
3839 bool result = false;
3846 if (!m_signal_get_ise_information (info.uuid, info.name, language, type, option, module_name)) {
3847 LOGW ("This helper (%s) is not IME", info.uuid.c_str ());
3851 info.option = option;
3853 if (info.uuid.length ()) {
3854 SCIM_DEBUG_MAIN (4) << "New Helper uuid=" << info.uuid << " name=" << info.name << "\n";
3855 HelperClientIndex::iterator it = m_helper_client_index.find (info.uuid);
3857 if (it == m_helper_client_index.end ()) {
3858 m_helper_info_repository [client] = info;
3859 m_helper_client_index [info.uuid] = HelperClientStub (client, 1);
3860 StartHelperICIndex::iterator icit = m_start_helper_ic_index.find (info.uuid);
3862 if (icit != m_start_helper_ic_index.end ()) {
3863 m_panel_agent_manager.helper_attach_input_context_and_update_screen (client, icit->second, m_current_screen);
3864 m_start_helper_ic_index.erase (icit);
3867 LOGW ("Failed to register IME : %s", info.uuid.c_str ());
3868 m_panel_agent_manager.send_fail_reply(client);
3871 LOGW ("Failed to register IME : %s", info.uuid.c_str ());
3872 m_panel_agent_manager.send_fail_reply(client);
3879 LOGD ("Succeed to regster IME : %s", info.uuid.c_str ());
3880 m_signal_register_helper (client, info);
3884 //SCIM_TRANS_CMD_PANEL_REGISTER_ACTIVE_HELPER
3885 void socket_helper_register_helper_passive (int client, HelperInfo& info) {
3886 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_helper_passive (" << client << ")\n";
3893 if (!m_signal_get_ise_information (info.uuid, info.name, language, type, option, module_name)) {
3894 LOGW ("This helper (%s) is not IME", info.uuid.c_str ());
3898 info.option = option;
3900 if (info.uuid.length ()) {
3901 SCIM_DEBUG_MAIN (4) << "New Helper Passive uuid=" << info.uuid << " name=" << info.name << "\n";
3902 HelperInfoRepository::iterator it = m_helper_active_info_repository.find (client);
3904 if (it == m_helper_active_info_repository.end ()) {
3905 m_helper_active_info_repository[client] = info;
3908 StringIntRepository::iterator iter = m_ise_pending_repository.find (info.uuid);
3910 if (iter != m_ise_pending_repository.end ()) {
3911 m_ise_pending_repository.erase (iter);
3914 iter = m_ise_pending_repository.find (info.name);
3916 if (iter != m_ise_pending_repository.end ()) {
3917 m_ise_pending_repository.erase (iter);
3923 //ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
3924 void socket_helper_update_input_context (int client, uint32 type, uint32 value) {
3925 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_input_context (" << client << ")\n";
3926 m_signal_update_input_context ((int)type, (int)value);
3928 uint32 focused_context;
3929 get_focused_context (focused_client, focused_context);
3930 ClientInfo client_info = socket_get_client_info (focused_client);
3932 if (client_info.type == FRONTEND_CLIENT) {
3933 m_panel_agent_manager.update_ise_input_context (focused_client, focused_context, type, value);
3935 std::cerr << "focused client is not existed!!!" << "\n";
3938 //ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE
3939 void socket_helper_update_language_locale(int client, String locale) {
3940 SCIM_DEBUG_MAIN(4) << "InfoManager::socket_helper_update_language_locale (" << client << ")\n";
3941 m_signal_update_language_locale(locale);
3944 uint32 focused_context;
3945 get_focused_context(focused_client, focused_context);
3946 ClientInfo client_info = socket_get_client_info(focused_client);
3948 if (client_info.type == FRONTEND_CLIENT) {
3949 m_panel_agent_manager.update_ise_language_locale(focused_client, focused_context, locale);
3951 std::cerr << "focused client is not existed!!!" << "\n";
3954 //SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
3955 void socket_helper_send_private_command (int client, String command) {
3956 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3958 uint32 focused_context;
3959 get_focused_context (focused_client, focused_context);
3960 ClientInfo client_info = socket_get_client_info (focused_client);
3962 if (client_info.type == FRONTEND_CLIENT) {
3963 m_panel_agent_manager.send_private_command (focused_client, focused_context, command);
3966 //SCIM_TRANS_CMD_COMMIT_CONTENT
3967 void socket_helper_commit_content (int client, String content, String description, String mime_types) {
3968 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3970 uint32 focused_context;
3971 get_focused_context (focused_client, focused_context);
3972 ClientInfo client_info = socket_get_client_info (focused_client);
3974 if (client_info.type == FRONTEND_CLIENT) {
3975 m_panel_agent_manager.commit_content (focused_client, focused_context, content, description, mime_types);
3978 //ISM_TRANS_CMD_UPDATE_ISE_EXIT
3979 void UPDATE_ISE_EXIT (int client) {
3980 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3981 bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false);
3982 if (launch_ise_on_request && !m_refocus_needed && !m_reshow_needed)
3983 m_restart_needed = false;
3986 void process_key_event_done (KeyEvent &key, uint32 ret, uint32 serial) {
3988 uint32 focused_context;
3989 get_focused_context (focused_client, focused_context);
3990 ClientInfo client_info = socket_get_client_info (focused_client);
3992 if (client_info.type == FRONTEND_CLIENT) {
3993 m_panel_agent_manager.process_key_event_done (focused_client, focused_context, key, ret, serial);
3997 //ISM_TRANS_CMD_REQUEST_ISE_HIDE
3998 void request_ise_hide () {
4000 uint32 focused_context;
4001 get_focused_context (focused_client, focused_context);
4002 ClientInfo client_info = socket_get_client_info (focused_client);
4004 if (client_info.type == FRONTEND_CLIENT) {
4005 m_panel_agent_manager.request_ise_hide (focused_client, focused_context);
4009 void socket_reset_helper_input_context (const String& uuid, int client, uint32 context) {
4010 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4012 if (it != m_helper_client_index.end ()) {
4013 uint32 ctx = get_helper_ic (client, context);
4014 m_panel_agent_manager.reset_helper_context (it->second.id, ctx, uuid);
4018 bool helper_select_aux (uint32 item) {
4019 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_aux \n";
4021 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4022 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4024 if (it != m_helper_client_index.end ()) {
4028 get_focused_context (client, context);
4029 ctx = get_helper_ic (client, context);
4030 m_panel_agent_manager.select_aux (it->second.id, ctx, item);
4038 bool helper_select_candidate (uint32 item) {
4039 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_candidate \n";
4041 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4042 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4044 if (it != m_helper_client_index.end ()) {
4048 get_focused_context (client, context);
4049 ctx = get_helper_ic (client, context);
4050 m_panel_agent_manager.select_candidate (it->second.id, ctx, item);
4058 bool helper_lookup_table_page_up (void) {
4059 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_lookup_table_page_up \n";
4061 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4062 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4064 if (it != m_helper_client_index.end ()) {
4068 get_focused_context (client, context);
4069 ctx = get_helper_ic (client, context);
4070 m_panel_agent_manager.lookup_table_page_up (it->second.id, ctx);
4078 bool helper_lookup_table_page_down (void) {
4079 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_lookup_table_page_down \n";
4081 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4082 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4084 if (it != m_helper_client_index.end ()) {
4088 get_focused_context (client, context);
4089 ctx = get_helper_ic (client, context);
4090 m_panel_agent_manager.lookup_table_page_down (it->second.id, ctx);
4098 bool helper_update_lookup_table_page_size (uint32 size) {
4099 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_update_lookup_table_page_size \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.update_lookup_table_page_size (it->second.id, ctx, size);
4118 bool helper_update_candidate_item_layout (const std::vector<uint32>& row_items) {
4119 SCIM_DEBUG_MAIN (4) << __func__ << "\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.update_candidate_item_layout (it->second.id, ctx, row_items);
4138 bool helper_select_associate (uint32 item) {
4139 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_associate \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.select_associate (it->second.id, ctx, item);
4158 bool helper_associate_table_page_up (void) {
4159 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_associate_table_page_up \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.associate_table_page_up (it->second.id, ctx);
4178 bool helper_associate_table_page_down (void) {
4179 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_associate_table_page_down \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.associate_table_page_down (it->second.id, ctx);
4198 bool helper_update_associate_table_page_size (uint32 size) {
4199 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_update_associate_table_page_size \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_associate_table_page_size (it->second.id, ctx, size);
4218 bool helper_update_displayed_candidate_number (uint32 size) {
4219 SCIM_DEBUG_MAIN (4) << __func__ << "\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.update_displayed_candidate_number (it->second.id, ctx, size);
4238 bool helper_longpress_candidate (uint32 index) {
4239 SCIM_DEBUG_MAIN (4) << __func__ << "\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.send_longpress_event (it->second.id, ctx, index);
4255 std::cerr << __func__ << " is failed!!!\n";
4259 void helper_all_update_spot_location (int x, int y) {
4260 SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_spot_location (" << x << "," << y << ")\n";
4261 HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
4264 String uuid = get_focused_context (client, context);
4266 for (; hiit != m_helper_info_repository.end (); ++ hiit) {
4267 if (hiit->second.option & SCIM_HELPER_NEED_SPOT_LOCATION_INFO) {
4268 m_panel_agent_manager.helper_all_update_spot_location (hiit->first, get_helper_ic (client, context), uuid, x, y);
4273 void helper_all_update_cursor_position (int cursor_pos) {
4274 SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_cursor_position (" << cursor_pos << ")\n";
4275 HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
4278 String uuid = get_focused_context (client, context);
4280 for (; hiit != m_helper_info_repository.end (); ++ hiit) {
4281 m_panel_agent_manager.helper_all_update_cursor_position (hiit->first, get_helper_ic (client, context), uuid, cursor_pos);
4285 void helper_all_update_screen (int screen) {
4286 SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_screen (" << screen << ")\n";
4287 HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
4291 uuid = get_focused_context (client, context);
4293 for (; hiit != m_helper_info_repository.end (); ++ hiit) {
4294 if (hiit->second.option & SCIM_HELPER_NEED_SCREEN_INFO) {
4295 m_panel_agent_manager.helper_all_update_screen (hiit->first, get_helper_ic (client, context), uuid, screen);
4300 bool set_autocapital_type (int mode) {
4301 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4302 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
4303 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
4304 iseContext->autocapital_type = static_cast<Ecore_IMF_Autocapital_Type>(mode);
4306 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || (m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
4307 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4309 if (it != m_helper_client_index.end ()) {
4313 get_focused_context (client, context);
4314 ctx = get_helper_ic (client, context);
4315 m_panel_agent_manager.set_autocapital_type (it->second.id, ctx, m_current_helper_uuid, mode);
4320 std::cerr << __func__ << " is failed!!!\n";
4324 bool set_prediction_allow (int client, int mode) {
4325 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4326 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
4327 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
4328 iseContext->prediction_allow = static_cast<Eina_Bool>(mode);
4330 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || (m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
4331 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4333 if (it != m_helper_client_index.end ()) {
4335 uint32 focused_context;
4337 get_focused_context (focused_client, focused_context);
4338 ctx = get_helper_ic (focused_client, focused_context);
4339 m_panel_agent_manager.set_prediction_allow (it->second.id, ctx, m_current_helper_uuid, mode);
4344 std::cerr << __func__ << " is failed!!!\n";
4348 const String& get_focused_context (int& client, uint32& context, bool force_last_context = false) const {
4349 if (m_current_socket_client >= 0) {
4350 client = m_current_socket_client;
4351 context = m_current_client_context;
4352 return m_current_context_uuid;
4354 client = m_last_socket_client;
4355 context = m_last_client_context;
4356 return m_last_context_uuid;
4361 void socket_transaction_start (void) {
4362 m_signal_transaction_start ();
4365 void socket_transaction_end (void) {
4366 m_signal_transaction_end ();
4372 void unlock (void) {
4377 InfoManager::InfoManager ()
4378 : m_impl (new InfoManagerImpl ())
4382 InfoManager::~InfoManager ()
4388 InfoManager::initialize (InfoManager* info_manager, const ConfigPointer& config, const String& display, bool resident)
4390 return m_impl->initialize (info_manager, config, display, resident);
4394 InfoManager::valid (void) const
4396 return m_impl->valid ();
4400 InfoManager::stop (void)
4407 InfoManager::socket_get_client_info (int client) const
4409 return m_impl->socket_get_client_info (client);
4412 void InfoManager::hide_helper (const String& uuid)
4414 m_impl->hide_helper (uuid);
4417 InfoManager::get_current_toolbar_mode () const
4419 return m_impl->get_current_toolbar_mode ();
4423 InfoManager::get_current_ise_geometry (rectinfo& rect)
4425 m_impl->get_current_ise_geometry (rect);
4429 InfoManager::get_current_helper_uuid () const
4431 return m_impl->get_current_helper_uuid ();
4435 InfoManager::get_current_ise_name () const
4437 return m_impl->get_current_ise_name ();
4441 InfoManager::set_current_toolbar_mode (TOOLBAR_MODE_T mode)
4443 m_impl->set_current_toolbar_mode (mode);
4447 InfoManager::set_current_ise_name (String& name)
4449 m_impl->set_current_ise_name (name);
4453 InfoManager::set_current_helper_option (uint32 option)
4455 m_impl->set_current_helper_option (option);
4459 InfoManager::update_candidate_panel_event (uint32 nType, uint32 nValue)
4461 m_impl->update_panel_event (ISM_TRANS_CMD_UPDATE_ISF_CANDIDATE_PANEL, nType, nValue);
4465 InfoManager::update_input_panel_event (uint32 nType, uint32 nValue)
4467 m_impl->update_panel_event (ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT, nType, nValue);
4471 InfoManager::move_preedit_caret (uint32 position)
4473 return m_impl->move_preedit_caret (position);
4479 InfoManager::request_help (void)
4481 return m_impl->request_help ();
4485 InfoManager::request_factory_menu (void)
4487 return m_impl->request_factory_menu ();
4492 InfoManager::change_factory (const String& uuid)
4494 return m_impl->change_factory (uuid);
4498 InfoManager::helper_candidate_show (void)
4500 return m_impl->helper_candidate_show ();
4504 InfoManager::helper_candidate_hide (void)
4506 return m_impl->helper_candidate_hide ();
4510 InfoManager::candidate_more_window_show (void)
4512 return m_impl->candidate_more_window_show ();
4516 InfoManager::candidate_more_window_hide (void)
4518 return m_impl->candidate_more_window_hide ();
4522 InfoManager::update_helper_lookup_table (const LookupTable& table)
4524 return m_impl->update_helper_lookup_table (table);
4528 InfoManager::select_aux (uint32 item)
4530 return m_impl->select_aux (item);
4534 InfoManager::select_candidate (uint32 item)
4536 return m_impl->select_candidate (item);
4540 InfoManager::lookup_table_page_up (void)
4542 return m_impl->lookup_table_page_up ();
4546 InfoManager::lookup_table_page_down (void)
4548 return m_impl->lookup_table_page_down ();
4552 InfoManager::update_lookup_table_page_size (uint32 size)
4554 return m_impl->update_lookup_table_page_size (size);
4558 InfoManager::update_candidate_item_layout (const std::vector<uint32>& row_items)
4560 return m_impl->update_candidate_item_layout (row_items);
4564 InfoManager::select_associate (uint32 item)
4566 return m_impl->select_associate (item);
4570 InfoManager::associate_table_page_up (void)
4572 return m_impl->associate_table_page_up ();
4576 InfoManager::associate_table_page_down (void)
4578 return m_impl->associate_table_page_down ();
4582 InfoManager::update_associate_table_page_size (uint32 size)
4584 return m_impl->update_associate_table_page_size (size);
4588 InfoManager::update_displayed_candidate_number (uint32 size)
4590 return m_impl->update_displayed_candidate_number (size);
4594 InfoManager::send_longpress_event (int type, int index)
4596 m_impl->send_longpress_event (type, index);
4600 InfoManager::trigger_property (const String& property)
4602 return m_impl->trigger_property (property);
4606 InfoManager::start_helper (const String& uuid)
4608 return m_impl->start_helper (uuid, -2, 0);
4612 InfoManager::stop_helper (const String& uuid)
4614 return m_impl->stop_helper (uuid, -2, 0);
4618 InfoManager::set_default_ise (const DEFAULT_ISE_T& ise)
4620 m_impl->set_default_ise (ise);
4624 InfoManager::set_should_shared_ise (const bool should_shared_ise)
4626 m_impl->set_should_shared_ise (should_shared_ise);
4630 //InfoManager::reload_config (void)
4632 // m_impl->reload_config ();
4636 InfoManager::exit (void)
4638 return m_impl->exit ();
4641 InfoManager::update_ise_list (std::vector<String>& strList)
4643 m_impl->update_ise_list (strList);
4647 InfoManager::remoteinput_update_preedit_string (WideString str, AttributeList &attrs, uint32 caret)
4649 return m_impl->remoteinput_update_preedit_string (str, attrs, caret);
4653 InfoManager::remoteinput_commit_string (const WideString &str)
4655 return m_impl->remoteinput_commit_string (str);
4659 InfoManager::remoteinput_send_key_event (const KeyEvent &key)
4661 return m_impl->remoteinput_send_key_event (key);
4665 InfoManager::remoteinput_forward_key_event (const KeyEvent &key)
4667 return m_impl->remoteinput_forward_key_event (key);
4671 InfoManager::remoteinput_delete_surrounding_text (uint32 offset, uint32 len)
4673 return m_impl->remoteinput_delete_surrounding_text (offset, len);
4676 /////////////////////////////////Message function begin/////////////////////////////////////////
4678 //ISM_TRANS_CMD_PANEL_RESET_KEYBOARD_ISE
4679 bool InfoManager:: reset_keyboard_ise (void)
4681 return m_impl->reset_keyboard_ise ();
4684 //ISM_TRANS_CMD_SHOW_ISF_CONTROL
4685 void InfoManager::show_isf_panel (int client_id)
4687 m_impl->show_isf_panel (client_id);
4690 //ISM_TRANS_CMD_HIDE_ISF_CONTROL
4691 void InfoManager::hide_isf_panel (int client_id)
4693 m_impl->hide_isf_panel (client_id);
4696 //ISM_TRANS_CMD_SHOW_ISE_PANEL
4697 void InfoManager::show_ise_panel (int client_id, uint32 client, uint32 context, char* data, size_t len)
4699 m_impl->show_ise_panel (client_id, client, context, data, len);
4702 //ISM_TRANS_CMD_HIDE_ISE_PANEL
4703 void InfoManager::hide_ise_panel (int client_id, uint32 client, uint32 context)
4705 m_impl->hide_ise_panel (client_id, client, context);
4708 //ISM_TRANS_CMD_HIDE_ISE_PANEL from ISF control
4709 void InfoManager::hide_helper_ise (void)
4711 m_impl->hide_helper_ise ();
4714 //ISM_TRANS_CMD_LAUNCH_ISE from ISF control
4715 void InfoManager::prelaunch_helper_ise (void)
4717 m_impl->prelaunch_helper_ise ();
4720 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
4721 bool InfoManager::process_key_event (KeyEvent& key, uint32 serial)
4723 return m_impl->process_key_event (key, serial);
4726 //ISM_TRANS_CMD_GET_ACTIVE_ISE_GEOMETRY
4727 void InfoManager::get_input_panel_geometry (int client_id, _OUT_ struct rectinfo& info)
4729 m_impl->get_input_panel_geometry (client_id, info);
4732 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
4733 void InfoManager::get_candidate_window_geometry (int client_id, _OUT_ struct rectinfo& info)
4735 m_impl->get_candidate_window_geometry (client_id, info);
4738 //ISM_TRANS_CMD_GET_ISE_LANGUAGE_LOCALE
4739 void InfoManager::get_ise_language_locale (int client_id, _OUT_ char** data, _OUT_ size_t& len)
4741 m_impl->get_ise_language_locale (client_id, data, len);
4744 //ISM_TRANS_CMD_SET_LAYOUT
4745 void InfoManager::set_ise_layout (int client_id, uint32 layout)
4747 m_impl->set_ise_layout (client_id, layout);
4750 //ISM_TRANS_CMD_SET_INPUT_MODE
4751 void InfoManager::set_ise_input_mode (int client_id, uint32 input_mode)
4753 m_impl->set_ise_input_mode (client_id, input_mode);
4756 //ISM_TRANS_CMD_SET_INPUT_HINT
4757 void InfoManager::set_ise_input_hint (int client_id, uint32 input_hint)
4759 m_impl->set_ise_input_hint (client_id, input_hint);
4762 //ISM_TRANS_CMD_UPDATE_BIDI_DIRECTION
4763 void InfoManager::update_ise_bidi_direction (int client_id, uint32 bidi_direction)
4765 m_impl->update_ise_bidi_direction (client_id, bidi_direction);
4769 //ISM_TRANS_CMD_SET_ISE_LANGUAGE
4770 void InfoManager::set_ise_language (int client_id, uint32 language)
4772 m_impl->set_ise_language (client_id, language);
4775 //ISM_TRANS_CMD_SET_ISE_IMDATA
4776 void InfoManager::set_ise_imdata (int client_id, const char* imdata, size_t len)
4778 m_impl->set_ise_imdata (client_id, imdata, len);
4781 //ISM_TRANS_CMD_GET_ISE_IMDATA
4782 bool InfoManager:: get_ise_imdata (int client_id, _OUT_ char** imdata, _OUT_ size_t& len)
4784 return m_impl->get_ise_imdata (client_id, imdata, len);
4787 //ISM_TRANS_CMD_GET_LAYOUT
4788 bool InfoManager:: get_ise_layout (int client_id, _OUT_ uint32& layout)
4790 return m_impl->get_ise_layout (client_id, layout);
4793 //ISM_TRANS_CMD_GET_ISE_STATE
4794 void InfoManager::get_ise_state (int client_id, _OUT_ int& state)
4796 m_impl->get_ise_state (client_id, state);
4799 //ISM_TRANS_CMD_GET_ACTIVE_ISE
4800 void InfoManager::get_active_ise (int client_id, _OUT_ String& default_uuid)
4802 m_impl->get_active_ise (client_id, default_uuid);
4805 //ISM_TRANS_CMD_GET_ISE_LIST
4806 void InfoManager::get_ise_list (int client_id, _OUT_ std::vector<String>& strlist)
4808 m_impl->get_ise_list (client_id, strlist);
4812 //ISM_TRANS_CMD_GET_ALL_HELPER_ISE_INFO
4813 void InfoManager::get_all_helper_ise_info (int client_id, _OUT_ HELPER_ISE_INFO& info)
4815 m_impl->get_all_helper_ise_info (client_id, info);
4818 //ISM_TRANS_CMD_SET_ENABLE_HELPER_ISE_INFO
4819 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4820 void InfoManager::set_enable_helper_ise_info (int client_id, String appid, uint32 is_enabled)
4822 m_impl->set_enable_helper_ise_info (client_id, appid, is_enabled);
4825 //ISM_TRANS_CMD_SHOW_HELPER_ISE_LIST
4826 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4827 void InfoManager::show_helper_ise_list (int client_id)
4829 m_impl->show_helper_ise_list (client_id);
4833 //ISM_TRANS_CMD_SHOW_HELPER_ISE_SELECTOR
4834 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4835 void InfoManager::show_helper_ise_selector (int client_id)
4837 m_impl->show_helper_ise_selector (client_id);
4840 //ISM_TRANS_CMD_IS_HELPER_ISE_ENABLED
4842 void InfoManager::is_helper_ise_enabled (int client_id, String strAppid, _OUT_ uint32& nEnabled)
4844 m_impl->is_helper_ise_enabled (client_id, strAppid, nEnabled);
4847 //ISM_TRANS_CMD_GET_ISE_INFORMATION
4848 void InfoManager::get_ise_information (int client_id, String strUuid, _OUT_ String& strName, _OUT_ String& strLanguage,
4849 _OUT_ int& nType, _OUT_ int& nOption, _OUT_ String& strModuleName)
4851 m_impl->get_ise_information (client_id, strUuid, strName, strLanguage, nType, nOption, strModuleName);
4854 //ISM_TRANS_CMD_RESET_ISE_OPTION
4855 //reply SCIM_TRANS_CMD_OK
4856 bool InfoManager:: reset_ise_option (int client_id)
4858 return m_impl->reset_ise_option (client_id);
4861 //ISM_TRANS_CMD_SET_ACTIVE_ISE_BY_UUID
4863 bool InfoManager:: set_active_ise_by_uuid (int client_id, char* buf, size_t len)
4865 return m_impl->set_active_ise_by_uuid (client_id, buf, len);
4868 //ISM_TRANS_CMD_SET_INITIAL_ISE_BY_UUID
4869 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4870 void InfoManager::set_initial_ise_by_uuid (int client_id, char* buf, size_t len)
4872 m_impl->set_initial_ise_by_uuid (client_id, buf, len);
4875 //ISM_TRANS_CMD_SET_RETURN_KEY_TYPE
4876 void InfoManager::set_ise_return_key_type (int client_id, uint32 type)
4878 m_impl->set_ise_return_key_type (client_id, type);
4881 //ISM_TRANS_CMD_GET_RETURN_KEY_TYPE
4883 bool InfoManager:: get_ise_return_key_type (int client_id, _OUT_ uint32& type)
4885 return m_impl->get_ise_return_key_type (client_id, type);
4889 //ISM_TRANS_CMD_SET_RETURN_KEY_DISABLE
4890 void InfoManager::set_ise_return_key_disable (int client_id, uint32 disabled)
4892 m_impl->set_ise_return_key_disable (client_id, disabled);
4895 //ISM_TRANS_CMD_GET_RETURN_KEY_DISABLE
4896 bool InfoManager::get_ise_return_key_disable (int client_id, _OUT_ uint32& disabled)
4898 return m_impl->get_ise_return_key_disable (client_id, disabled);
4901 //ISM_TRANS_CMD_SET_CAPS_MODE
4902 void InfoManager::set_ise_caps_mode (int client_id, uint32 mode)
4904 m_impl->set_ise_caps_mode (client_id, mode);
4907 //SCIM_TRANS_CMD_RELOAD_CONFIG
4908 void InfoManager::reload_config (void)
4910 m_impl->reload_config ();
4913 //ISM_TRANS_CMD_SEND_WILL_SHOW_ACK
4914 void InfoManager::will_show_ack (int client_id)
4916 m_impl->will_show_ack (client_id);
4919 //ISM_TRANS_CMD_SEND_WILL_HIDE_ACK
4920 void InfoManager::will_hide_ack (int client_id)
4922 m_impl->will_hide_ack (client_id);
4925 //ISM_TRANS_CMD_RESET_DEFAULT_ISE
4926 void InfoManager::reset_default_ise (int client_id)
4928 m_impl->reset_default_ise (client_id);
4931 //ISM_TRANS_CMD_SET_HARDWARE_KEYBOARD_MODE
4932 void InfoManager::set_keyboard_mode (int client_id, uint32 mode)
4934 m_impl->set_keyboard_mode (client_id, mode);
4937 //ISM_TRANS_CMD_SEND_CANDIDATE_WILL_HIDE_ACK
4938 void InfoManager::candidate_will_hide_ack (int client_id)
4940 m_impl->candidate_will_hide_ack (client_id);
4943 //ISM_TRANS_CMD_GET_ACTIVE_HELPER_OPTION
4944 void InfoManager::get_active_helper_option (int client_id, _OUT_ uint32& option)
4946 m_impl->get_active_helper_option (client_id, option);
4949 //ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW
4950 void InfoManager::show_ise_option_window (int client_id)
4952 m_impl->show_ise_option_window (client_id);
4955 //ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW
4956 void InfoManager::resume_ise_option_window (int client_id)
4958 m_impl->resume_ise_option_window (client_id);
4961 //ISM_TRANS_CMD_SET_KEYBOARD_MODE
4962 void InfoManager::set_ise_keyboard_mode (int client_id, uint32 mode)
4964 m_impl->set_ise_keyboard_mode (client_id, mode);
4967 //ISM_TRANS_CMD_SET_PREDICTION_HINT
4968 void InfoManager::set_prediction_hint (int client_id, String prediction_hint)
4970 m_impl->set_prediction_hint (client_id, prediction_hint);
4973 //ISM_TRANS_CMD_SET_MIME_TYPE
4974 void InfoManager::set_ise_mime_type (int client_id, String mime_type)
4976 m_impl->set_ise_mime_type (client_id, mime_type);
4979 //ISM_TRANS_CMD_FINALIZE_CONTENT
4980 void InfoManager::finalize_content (int client_id, String text, uint32 cursor_pos)
4982 m_impl->finalize_content (client_id, text, cursor_pos);
4985 //ISM_TRANS_CMD_SET_PREDICTION_HINT_DATA
4986 void InfoManager::set_prediction_hint_data (int client_id, String key, String value)
4988 m_impl->set_prediction_hint_data (client_id, key, value);
4991 //ISM_TRANS_CMD_SET_OPTIMIZATION_HINT
4992 void InfoManager::set_optimization_hint(int client_id, uint32 hint)
4994 m_impl->set_optimization_hint(client_id, hint);
4997 //ISM_TRANS_CMD_EXPAND_CANDIDATE
4998 void InfoManager::expand_candidate ()
5000 m_impl->expand_candidate ();
5003 //ISM_TRANS_CMD_CONTRACT_CANDIDATE
5004 void InfoManager::contract_candidate ()
5006 m_impl->contract_candidate ();
5009 //ISM_TRANS_CMD_GET_RECENT_ISE_GEOMETRY
5010 void InfoManager::get_recent_ise_geometry (int client_id, uint32 angle, _OUT_ struct rectinfo& info)
5012 m_impl->get_recent_ise_geometry (client_id, angle, info);
5015 //ISM_TRANS_CMD_SEND_REMOTE_INPUT_MESSAGE
5016 bool InfoManager::remoteinput_send_input_message (int client_id, char* buf, size_t len)
5018 return m_impl->send_remote_input_message (client_id, buf, len);
5021 void InfoManager::remoteinput_send_surrounding_text (const char* text, uint32 cursor)
5023 return m_impl->send_remote_surrounding_text (text, cursor);
5026 //ISM_TRANS_CMD_REGISTER_PANEL_CLIENT
5027 void InfoManager::register_panel_client (uint32 client_id, uint32 id)
5029 m_impl->register_panel_client (client_id, id);
5032 //SCIM_TRANS_CMD_PANEL_REGISTER_INPUT_CONTEXT
5033 void InfoManager::register_input_context (uint32 client_id, uint32 context, String uuid)
5035 m_impl->register_input_context (client_id, context, uuid);
5038 //SCIM_TRANS_CMD_PANEL_REMOVE_INPUT_CONTEXT
5039 void InfoManager::remove_input_context (uint32 client_id, uint32 context)
5041 m_impl->remove_input_context (client_id, context);
5044 //SCIM_TRANS_CMD_PANEL_RESET_INPUT_CONTEXT
5045 void InfoManager::socket_reset_input_context (int client_id, uint32 context)
5047 m_impl->socket_reset_input_context (client_id, context);
5050 //SCIM_TRANS_CMD_FOCUS_IN
5051 void InfoManager::focus_in (int client_id, uint32 context, String uuid)
5053 m_impl->focus_in (client_id, context, uuid);
5056 //SCIM_TRANS_CMD_FOCUS_OUT
5057 void InfoManager::focus_out (int client_id, uint32 context)
5059 m_impl->focus_out (client_id, context);
5062 //ISM_TRANS_CMD_PROCESS_INPUT_DEVICE_EVENT
5063 bool InfoManager::process_input_device_event(int client, uint32 type, const char *data, size_t len, _OUT_ uint32& result)
5065 return m_impl->process_input_device_event(client, type, data, len, result);
5068 //ISM_TRANS_CMD_TURN_ON_LOG
5069 void InfoManager::socket_turn_on_log (uint32 isOn)
5071 m_impl->socket_turn_on_log (isOn);
5074 //SCIM_TRANS_CMD_PANEL_TURN_ON
5075 void InfoManager::socket_turn_on (void)
5077 m_impl->socket_turn_on ();
5080 //SCIM_TRANS_CMD_PANEL_TURN_OFF
5081 void InfoManager::socket_turn_off (void)
5083 m_impl->socket_turn_off ();
5086 //SCIM_TRANS_CMD_UPDATE_SCREEN
5087 void InfoManager::socket_update_screen (int client_id, uint32 num)
5089 m_impl->socket_update_screen (client_id, num);
5092 //SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
5093 void InfoManager::socket_update_spot_location (uint32 x, uint32 y, uint32 top_y)
5095 m_impl->socket_update_spot_location (x, y, top_y);
5098 //ISM_TRANS_CMD_UPDATE_CURSOR_POSITION
5099 void InfoManager::socket_update_cursor_position (uint32 cursor_pos)
5101 m_impl->socket_update_cursor_position (cursor_pos);
5104 //ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT
5105 void InfoManager::socket_update_surrounding_text (String text, uint32 cursor)
5107 m_impl->socket_update_surrounding_text (text, cursor);
5110 void InfoManager::remoteinput_callback_focus_in (void)
5112 m_impl->remoteinput_callback_focus_in ();
5115 void InfoManager::remoteinput_callback_focus_out (void)
5117 m_impl->remoteinput_callback_focus_out ();
5120 void InfoManager::remoteinput_callback_entry_metadata (uint32 hint, uint32 layout, int variation, uint32 autocapital_type, int return_key_disabled)
5122 m_impl->remoteinput_callback_entry_metadata (hint, layout, variation, autocapital_type, return_key_disabled);
5125 void InfoManager::remoteinput_callback_surrounding_text (String text, uint32 cursor)
5127 m_impl->remoteinput_callback_surrounding_text (text, cursor);
5130 void InfoManager::remoteinput_callback_input_resource (uint32 input_resource)
5132 m_impl->remoteinput_callback_input_resource (input_resource);
5135 //ISM_TRANS_CMD_UPDATE_SELECTION
5136 void InfoManager::socket_update_selection (String text)
5138 m_impl->socket_update_selection (text);
5141 //FIXME: useless anymore
5142 //SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO
5143 void InfoManager::socket_update_factory_info (PanelFactoryInfo& info)
5145 m_impl->socket_update_factory_info (info);
5148 //SCIM_TRANS_CMD_PANEL_SHOW_HELP
5149 void InfoManager::socket_show_help (String help)
5151 m_impl->socket_show_help (help);
5154 //SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU
5155 void InfoManager::socket_show_factory_menu (std::vector <PanelFactoryInfo>& vec)
5157 m_impl->socket_show_factory_menu (vec);
5160 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
5161 void InfoManager::socket_show_preedit_string (void)
5163 m_impl->socket_show_preedit_string ();
5166 //SCIM_TRANS_CMD_SHOW_AUX_STRING
5167 void InfoManager::socket_show_aux_string (void)
5169 m_impl->socket_show_aux_string ();
5172 //SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE
5173 void InfoManager::socket_show_lookup_table (void)
5175 m_impl->socket_show_lookup_table ();
5178 //ISM_TRANS_CMD_SHOW_ASSOCIATE_TABLE
5179 void InfoManager::socket_show_associate_table (void)
5181 m_impl->socket_show_associate_table ();
5184 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
5185 void InfoManager::socket_hide_preedit_string (void)
5187 m_impl->socket_hide_preedit_string ();
5190 //SCIM_TRANS_CMD_HIDE_AUX_STRING
5191 void InfoManager::socket_hide_aux_string (void)
5193 m_impl->socket_hide_aux_string ();
5196 //SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE
5197 void InfoManager::socket_hide_lookup_table (void)
5199 m_impl->socket_hide_lookup_table ();
5202 //ISM_TRANS_CMD_HIDE_ASSOCIATE_TABLE
5203 void InfoManager::socket_hide_associate_table (void)
5205 m_impl->socket_hide_associate_table ();
5208 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
5209 void InfoManager::socket_update_preedit_string (String& str, const AttributeList& attrs, uint32 caret)
5211 m_impl->socket_update_preedit_string (str, attrs, caret);
5214 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
5215 void InfoManager::socket_update_preedit_caret (uint32 caret)
5217 m_impl->socket_update_preedit_caret (caret);
5220 //ISM_TRANS_CMD_RECAPTURE_STRING
5221 void InfoManager::socket_recapture_string (int offset, int len, String& preedit, String& commit, const AttributeList& attrs)
5223 m_impl->socket_recapture_string (offset, len, preedit, commit, attrs);
5226 //SCIM_TRANS_CMD_UPDATE_AUX_STRING
5227 void InfoManager::socket_update_aux_string (String& str, const AttributeList& attrs)
5229 m_impl->socket_update_aux_string (str, attrs);
5232 //SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE
5233 void InfoManager::socket_update_lookup_table (const LookupTable& table)
5235 m_impl->socket_update_lookup_table (table);
5238 //ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE
5239 void InfoManager::socket_update_associate_table (const LookupTable& table)
5241 m_impl->socket_update_associate_table (table);
5244 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
5245 void InfoManager::socket_register_properties (const PropertyList& properties)
5247 m_impl->socket_register_properties (properties);
5250 //SCIM_TRANS_CMD_UPDATE_PROPERTY
5251 void InfoManager::socket_update_property (const Property& property)
5253 m_impl->socket_update_property (property);
5256 //ISM_TRANS_CMD_GET_KEYBOARD_ISE_LIST
5257 void InfoManager::socket_get_keyboard_ise_list (String& uuid)
5259 m_impl->socket_get_keyboard_ise_list (uuid);
5262 //ISM_TRANS_CMD_SET_CANDIDATE_UI
5263 void InfoManager::socket_set_candidate_ui (uint32 portrait_line, uint32 mode)
5265 m_impl->socket_set_candidate_ui (portrait_line, mode);
5268 //ISM_TRANS_CMD_GET_CANDIDATE_UI
5269 void InfoManager::socket_get_candidate_ui (String uuid)
5271 m_impl->socket_get_candidate_ui (uuid);
5274 //ISM_TRANS_CMD_SET_CANDIDATE_POSITION
5275 void InfoManager::socket_set_candidate_position (uint32 left, uint32 top)
5277 m_impl->socket_set_candidate_position (left, top);
5280 //ISM_TRANS_CMD_HIDE_CANDIDATE
5281 void InfoManager::socket_hide_candidate (void)
5283 m_impl->socket_hide_candidate ();
5286 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
5287 void InfoManager::socket_get_candidate_geometry (String& uuid)
5289 m_impl->socket_get_candidate_geometry (uuid);
5292 //ISM_TRANS_CMD_SET_KEYBOARD_ISE_BY_UUID
5293 void InfoManager::socket_set_keyboard_ise (String uuid)
5295 m_impl->socket_set_keyboard_ise (uuid);
5298 //ISM_TRANS_CMD_SELECT_CANDIDATE
5299 void InfoManager::socket_helper_select_candidate (uint32 index)
5301 m_impl->socket_helper_select_candidate (index);
5304 //ISM_TRANS_CMD_UPDATE_ISE_GEOMETRY
5305 void InfoManager::socket_helper_update_ise_geometry (int client, uint32 x, uint32 y, uint32 width, uint32 height)
5307 m_impl->socket_helper_update_ise_geometry (client, x, y, width, height);
5310 //ISM_TRANS_CMD_GET_KEYBOARD_ISE
5311 void InfoManager::socket_get_keyboard_ise (String uuid)
5313 m_impl->socket_get_keyboard_ise (uuid);
5316 //SCIM_TRANS_CMD_START_HELPER
5317 void InfoManager::socket_start_helper (int client_id, uint32 context, String uuid)
5319 m_impl->socket_start_helper (client_id, context, uuid);
5322 //SCIM_TRANS_CMD_STOP_HELPER
5323 void InfoManager::socket_stop_helper (int client_id, uint32 context, String uuid)
5325 m_impl->socket_stop_helper (client_id, context, uuid);
5328 //SCIM_TRANS_CMD_SEND_HELPER_EVENT
5329 void InfoManager::socket_send_helper_event (int client_id, uint32 context, String uuid, const Transaction& _nest_trans)
5331 m_impl->socket_send_helper_event (client_id, context, uuid, _nest_trans);
5334 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
5335 void InfoManager::socket_helper_register_properties (int client, PropertyList& properties)
5337 m_impl->socket_helper_register_properties (client, properties);
5340 //SCIM_TRANS_CMD_UPDATE_PROPERTY
5341 void InfoManager::socket_helper_update_property (int client, Property& property)
5343 m_impl->socket_helper_update_property (client, property);
5346 //SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT
5347 void InfoManager::socket_helper_send_imengine_event (int client, uint32 target_ic, String target_uuid , Transaction& nest_trans)
5349 m_impl->socket_helper_send_imengine_event (client, target_ic, target_uuid, nest_trans);
5352 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
5353 //SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT
5354 void InfoManager::socket_helper_send_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key)
5356 m_impl->socket_helper_send_key_event (client, target_ic, target_uuid, key);
5359 //SCIM_TRANS_CMD_FORWARD_KEY_EVENT
5360 void InfoManager::socket_helper_forward_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key)
5362 m_impl->socket_helper_forward_key_event (client, target_ic, target_uuid, key);
5365 //SCIM_TRANS_CMD_COMMIT_STRING
5366 void InfoManager::socket_helper_commit_string (int client, uint32 target_ic, String target_uuid, WideString wstr)
5368 m_impl->socket_helper_commit_string (client, target_ic, target_uuid, wstr);
5371 //SCIM_TRANS_CMD_GET_SURROUNDING_TEXT
5372 void InfoManager::socket_helper_get_surrounding_text (int client, String uuid, uint32 maxlen_before, uint32 maxlen_after)
5374 m_impl->socket_helper_get_surrounding_text (client, uuid, maxlen_before, maxlen_after);
5377 //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT
5378 void InfoManager::socket_helper_delete_surrounding_text (int client, uint32 offset, uint32 len)
5380 m_impl->socket_helper_delete_surrounding_text (client, offset, len);
5383 //SCIM_TRANS_CMD_GET_SELECTION
5384 void InfoManager::socket_helper_get_selection (int client, String uuid)
5386 m_impl->socket_helper_get_selection (client, uuid);
5389 //SCIM_TRANS_CMD_SET_SELECTION
5390 void InfoManager::socket_helper_set_selection (int client, uint32 start, uint32 end)
5392 m_impl->socket_helper_set_selection (client, start, end);
5395 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
5396 void InfoManager::socket_helper_show_preedit_string (int client, uint32 target_ic, String target_uuid)
5398 m_impl->socket_helper_show_preedit_string (client, target_ic, target_uuid);
5401 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
5402 void InfoManager::socket_helper_hide_preedit_string (int client, uint32 target_ic, String target_uuid)
5404 m_impl->socket_helper_hide_preedit_string (client, target_ic, target_uuid);
5407 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
5408 void InfoManager::socket_helper_update_preedit_string (int client, uint32 target_ic, String target_uuid, WideString preedit,
5409 WideString commit, AttributeList& attrs, uint32 caret)
5411 m_impl->socket_helper_update_preedit_string (client, target_ic, target_uuid, preedit, commit, attrs, caret);
5414 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
5415 void InfoManager::socket_helper_update_preedit_caret (int client, uint32 caret)
5417 m_impl->socket_helper_update_preedit_caret (client, caret);
5420 //ISM_TRANS_CMD_RECAPTURE_STRING
5421 void InfoManager::socket_helper_recapture_string (int client, uint32 target_ic, String target_uuid, int offset, int len, WideString preedit,
5422 WideString commit, AttributeList& attrs)
5424 m_impl->socket_helper_recapture_string (client, target_ic, target_uuid, offset, len, preedit, commit, attrs);
5427 //SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
5428 void InfoManager::socket_helper_register_helper (int client, HelperInfo& info)
5430 m_impl->socket_helper_register_helper (client, info);
5433 //SCIM_TRANS_CMD_PANEL_REGISTER_ACTIVE_HELPER
5434 void InfoManager::socket_helper_register_helper_passive (int client, HelperInfo& info)
5436 m_impl->socket_helper_register_helper_passive (client, info);
5439 //ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
5440 void InfoManager::socket_helper_update_input_context (int client, uint32 type, uint32 value)
5442 m_impl->socket_helper_update_input_context (client, type, value);
5445 //ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE
5446 void InfoManager::socket_helper_update_language_locale(int client, String locale)
5448 m_impl->socket_helper_update_language_locale(client, locale);
5451 //SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
5452 void InfoManager::socket_helper_send_private_command (int client, String command)
5454 m_impl->socket_helper_send_private_command (client, command);
5457 //SCIM_TRANS_CMD_COMMIT_CONTENT
5458 void InfoManager::socket_helper_commit_content (int client, String content, String description, String mime_types)
5460 m_impl->socket_helper_commit_content (client, content, description, mime_types);
5463 //ISM_TRANS_CMD_UPDATE_ISE_EXIT
5464 void InfoManager::UPDATE_ISE_EXIT (int client)
5466 m_impl->UPDATE_ISE_EXIT (client);
5469 //ISM_TRANS_CMD_PROCESS_KEY_EVENT_DONE
5470 void InfoManager::process_key_event_done (KeyEvent &key, uint32 ret, uint32 serial)
5472 m_impl->process_key_event_done (key, ret, serial);
5475 //ISM_TRANS_CMD_REQUEST_ISE_HIDE
5476 void InfoManager::request_ise_hide ()
5478 m_impl->request_ise_hide ();
5481 bool InfoManager::check_privilege_by_sockfd (int client_id, const String& privilege) {
5482 return m_impl->check_privilege_by_sockfd (client_id, privilege);
5485 void InfoManager::add_client (int client_id, uint32 key, ClientType type)
5487 m_impl->add_client (client_id, key, type);
5490 void InfoManager::del_client (int client_id)
5492 m_impl->del_client (client_id);
5495 bool InfoManager::set_autocapital_type (int mode)
5497 return m_impl->set_autocapital_type (mode);
5500 void InfoManager::set_prediction_allow (int client, bool mode)
5502 m_impl->set_prediction_allow (client, mode);
5505 void InfoManager::reshow_input_panel ()
5507 m_impl->reshow_input_panel ();
5510 //////////////////////////////////Message function end/////////////////////////////////////////
5513 InfoManager::signal_connect_turn_on (InfoManagerSlotVoid* slot)
5515 return m_impl->signal_connect_turn_on (slot);
5519 InfoManager::signal_connect_turn_off (InfoManagerSlotVoid* slot)
5521 return m_impl->signal_connect_turn_off (slot);
5525 InfoManager::signal_connect_show_panel (InfoManagerSlotVoid* slot)
5527 return m_impl->signal_connect_show_panel (slot);
5531 InfoManager::signal_connect_hide_panel (InfoManagerSlotVoid* slot)
5533 return m_impl->signal_connect_hide_panel (slot);
5537 InfoManager::signal_connect_update_screen (InfoManagerSlotInt* slot)
5539 return m_impl->signal_connect_update_screen (slot);
5543 InfoManager::signal_connect_update_spot_location (InfoManagerSlotIntIntInt* slot)
5545 return m_impl->signal_connect_update_spot_location (slot);
5549 InfoManager::signal_connect_update_factory_info (InfoManagerSlotFactoryInfo* slot)
5551 return m_impl->signal_connect_update_factory_info (slot);
5555 InfoManager::signal_connect_start_default_ise (InfoManagerSlotVoid* slot)
5557 return m_impl->signal_connect_start_default_ise (slot);
5561 InfoManager::signal_connect_stop_default_ise (InfoManagerSlotVoid* slot)
5563 return m_impl->signal_connect_stop_default_ise (slot);
5567 InfoManager::signal_connect_set_candidate_ui (InfoManagerSlotIntInt* slot)
5569 return m_impl->signal_connect_set_candidate_ui (slot);
5573 InfoManager::signal_connect_get_candidate_ui (InfoManagerSlotIntInt2* slot)
5575 return m_impl->signal_connect_get_candidate_ui (slot);
5579 InfoManager::signal_connect_set_candidate_position (InfoManagerSlotIntInt* slot)
5581 return m_impl->signal_connect_set_candidate_position (slot);
5585 InfoManager::signal_connect_get_candidate_geometry (InfoManagerSlotRect* slot)
5587 return m_impl->signal_connect_get_candidate_geometry (slot);
5591 InfoManager::signal_connect_get_input_panel_geometry (InfoManagerSlotRect* slot)
5593 return m_impl->signal_connect_get_input_panel_geometry (slot);
5597 InfoManager::signal_connect_set_keyboard_ise (InfoManagerSlotString* slot)
5599 return m_impl->signal_connect_set_keyboard_ise (slot);
5603 InfoManager::signal_connect_get_keyboard_ise (InfoManagerSlotString2* slot)
5605 return m_impl->signal_connect_get_keyboard_ise (slot);
5609 InfoManager::signal_connect_show_help (InfoManagerSlotString* slot)
5611 return m_impl->signal_connect_show_help (slot);
5615 InfoManager::signal_connect_show_factory_menu (InfoManagerSlotFactoryInfoVector* slot)
5617 return m_impl->signal_connect_show_factory_menu (slot);
5621 InfoManager::signal_connect_show_preedit_string (InfoManagerSlotVoid* slot)
5623 return m_impl->signal_connect_show_preedit_string (slot);
5627 InfoManager::signal_connect_show_aux_string (InfoManagerSlotVoid* slot)
5629 return m_impl->signal_connect_show_aux_string (slot);
5633 InfoManager::signal_connect_show_lookup_table (InfoManagerSlotVoid* slot)
5635 return m_impl->signal_connect_show_lookup_table (slot);
5639 InfoManager::signal_connect_show_associate_table (InfoManagerSlotVoid* slot)
5641 return m_impl->signal_connect_show_associate_table (slot);
5645 InfoManager::signal_connect_hide_preedit_string (InfoManagerSlotVoid* slot)
5647 return m_impl->signal_connect_hide_preedit_string (slot);
5651 InfoManager::signal_connect_hide_aux_string (InfoManagerSlotVoid* slot)
5653 return m_impl->signal_connect_hide_aux_string (slot);
5657 InfoManager::signal_connect_hide_lookup_table (InfoManagerSlotVoid* slot)
5659 return m_impl->signal_connect_hide_lookup_table (slot);
5663 InfoManager::signal_connect_hide_associate_table (InfoManagerSlotVoid* slot)
5665 return m_impl->signal_connect_hide_associate_table (slot);
5669 InfoManager::signal_connect_update_preedit_string (InfoManagerSlotAttributeStringInt* slot)
5671 return m_impl->signal_connect_update_preedit_string (slot);
5675 InfoManager::signal_connect_update_preedit_caret (InfoManagerSlotInt* slot)
5677 return m_impl->signal_connect_update_preedit_caret (slot);
5681 InfoManager::signal_connect_update_aux_string (InfoManagerSlotAttributeString* slot)
5683 return m_impl->signal_connect_update_aux_string (slot);
5687 InfoManager::signal_connect_update_lookup_table (InfoManagerSlotLookupTable* slot)
5689 return m_impl->signal_connect_update_lookup_table (slot);
5693 InfoManager::signal_connect_update_associate_table (InfoManagerSlotLookupTable* slot)
5695 return m_impl->signal_connect_update_associate_table (slot);
5699 InfoManager::signal_connect_register_properties (InfoManagerSlotPropertyList* slot)
5701 return m_impl->signal_connect_register_properties (slot);
5705 InfoManager::signal_connect_update_property (InfoManagerSlotProperty* slot)
5707 return m_impl->signal_connect_update_property (slot);
5711 InfoManager::signal_connect_register_helper_properties (InfoManagerSlotIntPropertyList* slot)
5713 return m_impl->signal_connect_register_helper_properties (slot);
5717 InfoManager::signal_connect_update_helper_property (InfoManagerSlotIntProperty* slot)
5719 return m_impl->signal_connect_update_helper_property (slot);
5723 InfoManager::signal_connect_register_helper (InfoManagerSlotIntHelperInfo* slot)
5725 return m_impl->signal_connect_register_helper (slot);
5729 InfoManager::signal_connect_remove_helper (InfoManagerSlotInt* slot)
5731 return m_impl->signal_connect_remove_helper (slot);
5735 InfoManager::signal_connect_set_active_ise_by_uuid (InfoManagerSlotStringBool* slot)
5737 return m_impl->signal_connect_set_active_ise_by_uuid (slot);
5741 InfoManager::signal_connect_focus_in (InfoManagerSlotVoid* slot)
5743 return m_impl->signal_connect_focus_in (slot);
5747 InfoManager::signal_connect_focus_out (InfoManagerSlotVoid* slot)
5749 return m_impl->signal_connect_focus_out (slot);
5753 InfoManager::signal_connect_expand_candidate (InfoManagerSlotVoid* slot)
5755 return m_impl->signal_connect_expand_candidate (slot);
5759 InfoManager::signal_connect_contract_candidate (InfoManagerSlotVoid* slot)
5761 return m_impl->signal_connect_contract_candidate (slot);
5765 InfoManager::signal_connect_select_candidate (InfoManagerSlotInt* slot)
5767 return m_impl->signal_connect_select_candidate (slot);
5771 InfoManager::signal_connect_get_ise_list (InfoManagerSlotBoolStringVector* slot)
5773 return m_impl->signal_connect_get_ise_list (slot);
5777 InfoManager::signal_connect_get_all_helper_ise_info (InfoManagerSlotBoolHelperInfo* slot)
5779 return m_impl->signal_connect_get_all_helper_ise_info (slot);
5783 InfoManager::signal_connect_set_has_option_helper_ise_info (InfoManagerSlotStringBool* slot)
5785 return m_impl->signal_connect_set_has_option_helper_ise_info (slot);
5789 InfoManager::signal_connect_set_enable_helper_ise_info (InfoManagerSlotStringBool* slot)
5791 return m_impl->signal_connect_set_enable_helper_ise_info (slot);
5795 InfoManager::signal_connect_show_helper_ise_list (InfoManagerSlotVoid* slot)
5797 return m_impl->signal_connect_show_helper_ise_list (slot);
5801 InfoManager::signal_connect_show_helper_ise_selector (InfoManagerSlotVoid* slot)
5803 return m_impl->signal_connect_show_helper_ise_selector (slot);
5807 InfoManager::signal_connect_is_helper_ise_enabled (InfoManagerSlotStringInt* slot)
5809 return m_impl->signal_connect_is_helper_ise_enabled (slot);
5813 InfoManager::signal_connect_get_ise_information (InfoManagerSlotBoolString4int2* slot)
5815 return m_impl->signal_connect_get_ise_information (slot);
5819 InfoManager::signal_connect_get_keyboard_ise_list (InfoManagerSlotBoolStringVector* slot)
5821 return m_impl->signal_connect_get_keyboard_ise_list (slot);
5825 InfoManager::signal_connect_update_ise_geometry (InfoManagerSlotIntIntIntInt* slot)
5827 return m_impl->signal_connect_update_ise_geometry (slot);
5831 InfoManager::signal_connect_get_language_list (InfoManagerSlotStringVector* slot)
5833 return m_impl->signal_connect_get_language_list (slot);
5837 InfoManager::signal_connect_get_all_language (InfoManagerSlotStringVector* slot)
5839 return m_impl->signal_connect_get_all_language (slot);
5843 InfoManager::signal_connect_get_ise_language (InfoManagerSlotStrStringVector* slot)
5845 return m_impl->signal_connect_get_ise_language (slot);
5849 InfoManager::signal_connect_get_ise_info_by_uuid (InfoManagerSlotStringISEINFO* slot)
5851 return m_impl->signal_connect_get_ise_info_by_uuid (slot);
5855 InfoManager::signal_connect_send_key_event (InfoManagerSlotKeyEvent* slot)
5857 return m_impl->signal_connect_send_key_event (slot);
5861 InfoManager::signal_connect_accept_connection (InfoManagerSlotInt* slot)
5863 return m_impl->signal_connect_accept_connection (slot);
5867 InfoManager::signal_connect_close_connection (InfoManagerSlotInt* slot)
5869 return m_impl->signal_connect_close_connection (slot);
5873 InfoManager::signal_connect_exit (InfoManagerSlotVoid* slot)
5875 return m_impl->signal_connect_exit (slot);
5879 InfoManager::signal_connect_transaction_start (InfoManagerSlotVoid* slot)
5881 return m_impl->signal_connect_transaction_start (slot);
5885 InfoManager::signal_connect_transaction_end (InfoManagerSlotVoid* slot)
5887 return m_impl->signal_connect_transaction_end (slot);
5891 InfoManager::signal_connect_lock (InfoManagerSlotVoid* slot)
5893 return m_impl->signal_connect_lock (slot);
5897 InfoManager::signal_connect_unlock (InfoManagerSlotVoid* slot)
5899 return m_impl->signal_connect_unlock (slot);
5903 InfoManager::signal_connect_update_input_context (InfoManagerSlotIntInt* slot)
5905 return m_impl->signal_connect_update_input_context (slot);
5909 InfoManager::signal_connect_show_ise (InfoManagerSlotVoid* slot)
5911 return m_impl->signal_connect_show_ise (slot);
5915 InfoManager::signal_connect_hide_ise (InfoManagerSlotVoid* slot)
5917 return m_impl->signal_connect_hide_ise (slot);
5921 InfoManager::signal_connect_will_show_ack (InfoManagerSlotVoid* slot)
5923 return m_impl->signal_connect_will_show_ack (slot);
5927 InfoManager::signal_connect_will_hide_ack (InfoManagerSlotVoid* slot)
5929 return m_impl->signal_connect_will_hide_ack (slot);
5933 InfoManager::signal_connect_set_keyboard_mode (InfoManagerSlotInt* slot)
5935 return m_impl->signal_connect_set_keyboard_mode (slot);
5939 InfoManager::signal_connect_candidate_will_hide_ack (InfoManagerSlotVoid* slot)
5941 return m_impl->signal_connect_candidate_will_hide_ack (slot);
5945 InfoManager::signal_connect_get_ise_state (InfoManagerSlotInt2* slot)
5947 return m_impl->signal_connect_get_ise_state (slot);
5951 InfoManager::signal_connect_run_helper (InfoManagerSlotString3* slot)
5953 return m_impl->signal_connect_run_helper (slot);
5957 InfoManager::signal_connect_launch_option_application (InfoManagerSlotBoolString* slot)
5959 return m_impl->signal_connect_launch_option_application (slot);
5963 InfoManager::signal_connect_get_recent_ise_geometry (InfoManagerSlotIntRect* slot)
5965 return m_impl->signal_connect_get_recent_ise_geometry (slot);
5969 InfoManager::signal_connect_check_privilege_by_sockfd (InfoManagerSlotIntString2* slot)
5971 return m_impl->signal_connect_check_privilege_by_sockfd (slot);
5975 InfoManager::signal_connect_remoteinput_send_input_message (InfoManagerSlotStringBool* slot)
5977 return m_impl->signal_connect_remoteinput_send_input_message (slot);
5981 InfoManager::signal_connect_remoteinput_send_surrounding_text (InfoManagerSlotIntString* slot)
5983 return m_impl->signal_connect_remoteinput_send_surrounding_text (slot);
5986 } /* namespace scim */
5989 vi:ts=4:nowrap:ai:expandtab