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.update_entry_metadata (focused_client, focused_context);
2279 uint32 ctx = get_helper_ic (focused_client, focused_context);
2280 bool ret = show_helper (m_current_helper_uuid, m_ise_context_buffer, m_ise_context_length, ctx);
2282 m_signal_show_ise ();
2284 if (m_imdata_buffer && m_imdata_length > 0 && m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2285 set_helper_imdata (m_current_helper_uuid, m_imdata_buffer, m_imdata_length);
2290 Connection signal_connect_turn_on (InfoManagerSlotVoid* slot) {
2291 return m_signal_turn_on.connect (slot);
2294 Connection signal_connect_turn_off (InfoManagerSlotVoid* slot) {
2295 return m_signal_turn_off.connect (slot);
2298 Connection signal_connect_show_panel (InfoManagerSlotVoid* slot) {
2299 return m_signal_show_panel.connect (slot);
2302 Connection signal_connect_hide_panel (InfoManagerSlotVoid* slot) {
2303 return m_signal_hide_panel.connect (slot);
2306 Connection signal_connect_update_screen (InfoManagerSlotInt* slot) {
2307 return m_signal_update_screen.connect (slot);
2310 Connection signal_connect_update_spot_location (InfoManagerSlotIntIntInt* slot) {
2311 return m_signal_update_spot_location.connect (slot);
2314 Connection signal_connect_update_factory_info (InfoManagerSlotFactoryInfo* slot) {
2315 return m_signal_update_factory_info.connect (slot);
2318 Connection signal_connect_start_default_ise (InfoManagerSlotVoid* slot) {
2319 return m_signal_start_default_ise.connect (slot);
2322 Connection signal_connect_stop_default_ise (InfoManagerSlotVoid* slot) {
2323 return m_signal_stop_default_ise.connect (slot);
2326 Connection signal_connect_set_candidate_ui (InfoManagerSlotIntInt* slot) {
2327 return m_signal_set_candidate_ui.connect (slot);
2330 Connection signal_connect_get_candidate_ui (InfoManagerSlotIntInt2* slot) {
2331 return m_signal_get_candidate_ui.connect (slot);
2334 Connection signal_connect_set_candidate_position (InfoManagerSlotIntInt* slot) {
2335 return m_signal_set_candidate_position.connect (slot);
2338 Connection signal_connect_get_candidate_geometry (InfoManagerSlotRect* slot) {
2339 return m_signal_get_candidate_geometry.connect (slot);
2342 Connection signal_connect_get_input_panel_geometry (InfoManagerSlotRect* slot) {
2343 return m_signal_get_input_panel_geometry.connect (slot);
2346 Connection signal_connect_set_keyboard_ise (InfoManagerSlotString* slot) {
2347 return m_signal_set_keyboard_ise.connect (slot);
2350 Connection signal_connect_get_keyboard_ise (InfoManagerSlotString2* slot) {
2351 return m_signal_get_keyboard_ise.connect (slot);
2354 Connection signal_connect_show_help (InfoManagerSlotString* slot) {
2355 return m_signal_show_help.connect (slot);
2358 Connection signal_connect_show_factory_menu (InfoManagerSlotFactoryInfoVector* slot) {
2359 return m_signal_show_factory_menu.connect (slot);
2362 Connection signal_connect_show_preedit_string (InfoManagerSlotVoid* slot) {
2363 return m_signal_show_preedit_string.connect (slot);
2366 Connection signal_connect_show_aux_string (InfoManagerSlotVoid* slot) {
2367 return m_signal_show_aux_string.connect (slot);
2370 Connection signal_connect_show_lookup_table (InfoManagerSlotVoid* slot) {
2371 return m_signal_show_lookup_table.connect (slot);
2374 Connection signal_connect_show_associate_table (InfoManagerSlotVoid* slot) {
2375 return m_signal_show_associate_table.connect (slot);
2378 Connection signal_connect_hide_preedit_string (InfoManagerSlotVoid* slot) {
2379 return m_signal_hide_preedit_string.connect (slot);
2382 Connection signal_connect_hide_aux_string (InfoManagerSlotVoid* slot) {
2383 return m_signal_hide_aux_string.connect (slot);
2386 Connection signal_connect_hide_lookup_table (InfoManagerSlotVoid* slot) {
2387 return m_signal_hide_lookup_table.connect (slot);
2390 Connection signal_connect_hide_associate_table (InfoManagerSlotVoid* slot) {
2391 return m_signal_hide_associate_table.connect (slot);
2394 Connection signal_connect_update_preedit_string (InfoManagerSlotAttributeStringInt* slot) {
2395 return m_signal_update_preedit_string.connect (slot);
2398 Connection signal_connect_update_preedit_caret (InfoManagerSlotInt* slot) {
2399 return m_signal_update_preedit_caret.connect (slot);
2402 Connection signal_connect_recapture_string (InfoManagerSlotAttributeInt2String2* slot) {
2403 return m_signal_recapture_string.connect (slot);
2406 Connection signal_connect_update_aux_string (InfoManagerSlotAttributeString* slot) {
2407 return m_signal_update_aux_string.connect (slot);
2410 Connection signal_connect_update_lookup_table (InfoManagerSlotLookupTable* slot) {
2411 return m_signal_update_lookup_table.connect (slot);
2414 Connection signal_connect_update_associate_table (InfoManagerSlotLookupTable* slot) {
2415 return m_signal_update_associate_table.connect (slot);
2418 Connection signal_connect_register_properties (InfoManagerSlotPropertyList* slot) {
2419 return m_signal_register_properties.connect (slot);
2422 Connection signal_connect_update_property (InfoManagerSlotProperty* slot) {
2423 return m_signal_update_property.connect (slot);
2426 Connection signal_connect_register_helper_properties (InfoManagerSlotIntPropertyList* slot) {
2427 return m_signal_register_helper_properties.connect (slot);
2430 Connection signal_connect_update_helper_property (InfoManagerSlotIntProperty* slot) {
2431 return m_signal_update_helper_property.connect (slot);
2434 Connection signal_connect_register_helper (InfoManagerSlotIntHelperInfo* slot) {
2435 return m_signal_register_helper.connect (slot);
2438 Connection signal_connect_remove_helper (InfoManagerSlotInt* slot) {
2439 return m_signal_remove_helper.connect (slot);
2442 Connection signal_connect_set_active_ise_by_uuid (InfoManagerSlotStringBool* slot) {
2443 return m_signal_set_active_ise_by_uuid.connect (slot);
2446 Connection signal_connect_focus_in (InfoManagerSlotVoid* slot) {
2447 return m_signal_focus_in.connect (slot);
2450 Connection signal_connect_focus_out (InfoManagerSlotVoid* slot) {
2451 return m_signal_focus_out.connect (slot);
2454 Connection signal_connect_expand_candidate (InfoManagerSlotVoid* slot) {
2455 return m_signal_expand_candidate.connect (slot);
2458 Connection signal_connect_contract_candidate (InfoManagerSlotVoid* slot) {
2459 return m_signal_contract_candidate.connect (slot);
2462 Connection signal_connect_select_candidate (InfoManagerSlotInt* slot) {
2463 return m_signal_select_candidate.connect (slot);
2466 Connection signal_connect_get_ise_list (InfoManagerSlotBoolStringVector* slot) {
2467 return m_signal_get_ise_list.connect (slot);
2470 Connection signal_connect_get_all_helper_ise_info (InfoManagerSlotBoolHelperInfo* slot) {
2471 return m_signal_get_all_helper_ise_info.connect (slot);
2474 Connection signal_connect_set_has_option_helper_ise_info (InfoManagerSlotStringBool* slot) {
2475 return m_signal_set_has_option_helper_ise_info.connect (slot);
2478 Connection signal_connect_set_enable_helper_ise_info (InfoManagerSlotStringBool* slot) {
2479 return m_signal_set_enable_helper_ise_info.connect (slot);
2482 Connection signal_connect_show_helper_ise_list (InfoManagerSlotVoid* slot) {
2483 return m_signal_show_helper_ise_list.connect (slot);
2486 Connection signal_connect_show_helper_ise_selector (InfoManagerSlotVoid* slot) {
2487 return m_signal_show_helper_ise_selector.connect (slot);
2490 Connection signal_connect_is_helper_ise_enabled (InfoManagerSlotStringInt* slot) {
2491 return m_signal_is_helper_ise_enabled.connect (slot);
2494 Connection signal_connect_get_ise_information (InfoManagerSlotBoolString4int2* slot) {
2495 return m_signal_get_ise_information.connect (slot);
2498 Connection signal_connect_get_keyboard_ise_list (InfoManagerSlotBoolStringVector* slot) {
2499 return m_signal_get_keyboard_ise_list.connect (slot);
2502 Connection signal_connect_update_ise_geometry (InfoManagerSlotIntIntIntInt* slot) {
2503 return m_signal_update_ise_geometry.connect (slot);
2506 Connection signal_connect_get_language_list (InfoManagerSlotStringVector* slot) {
2507 return m_signal_get_language_list.connect (slot);
2510 Connection signal_connect_get_all_language (InfoManagerSlotStringVector* slot) {
2511 return m_signal_get_all_language.connect (slot);
2514 Connection signal_connect_get_ise_language (InfoManagerSlotStrStringVector* slot) {
2515 return m_signal_get_ise_language.connect (slot);
2518 Connection signal_connect_get_ise_info_by_uuid (InfoManagerSlotStringISEINFO* slot) {
2519 return m_signal_get_ise_info_by_uuid.connect (slot);
2522 Connection signal_connect_send_key_event (InfoManagerSlotKeyEvent* slot) {
2523 return m_signal_send_key_event.connect (slot);
2526 Connection signal_connect_accept_connection (InfoManagerSlotInt* slot) {
2527 return m_signal_accept_connection.connect (slot);
2530 Connection signal_connect_close_connection (InfoManagerSlotInt* slot) {
2531 return m_signal_close_connection.connect (slot);
2534 Connection signal_connect_exit (InfoManagerSlotVoid* slot) {
2535 return m_signal_exit.connect (slot);
2538 Connection signal_connect_transaction_start (InfoManagerSlotVoid* slot) {
2539 return m_signal_transaction_start.connect (slot);
2542 Connection signal_connect_transaction_end (InfoManagerSlotVoid* slot) {
2543 return m_signal_transaction_end.connect (slot);
2546 Connection signal_connect_lock (InfoManagerSlotVoid* slot) {
2547 return m_signal_lock.connect (slot);
2550 Connection signal_connect_unlock (InfoManagerSlotVoid* slot) {
2551 return m_signal_unlock.connect (slot);
2554 Connection signal_connect_update_input_context (InfoManagerSlotIntInt* slot) {
2555 return m_signal_update_input_context.connect (slot);
2558 Connection signal_connect_update_language_locale(InfoManagerSlotString* slot) {
2559 return m_signal_update_language_locale.connect(slot);
2562 Connection signal_connect_show_ise (InfoManagerSlotVoid* slot) {
2563 return m_signal_show_ise.connect (slot);
2566 Connection signal_connect_hide_ise (InfoManagerSlotVoid* slot) {
2567 return m_signal_hide_ise.connect (slot);
2570 Connection signal_connect_will_show_ack (InfoManagerSlotVoid* slot) {
2571 return m_signal_will_show_ack.connect (slot);
2574 Connection signal_connect_will_hide_ack (InfoManagerSlotVoid* slot) {
2575 return m_signal_will_hide_ack.connect (slot);
2578 Connection signal_connect_set_keyboard_mode (InfoManagerSlotInt* slot) {
2579 return m_signal_set_keyboard_mode.connect (slot);
2582 Connection signal_connect_candidate_will_hide_ack (InfoManagerSlotVoid* slot) {
2583 return m_signal_candidate_will_hide_ack.connect (slot);
2586 Connection signal_connect_get_ise_state (InfoManagerSlotInt2* slot) {
2587 return m_signal_get_ise_state.connect (slot);
2590 Connection signal_connect_run_helper (InfoManagerSlotString3* slot)
2592 return m_signal_run_helper.connect (slot);
2595 Connection signal_connect_launch_option_application (InfoManagerSlotBoolString* slot)
2597 return m_signal_launch_option_application.connect (slot);
2600 Connection signal_connect_get_recent_ise_geometry (InfoManagerSlotIntRect* slot) {
2601 return m_signal_get_recent_ise_geometry.connect (slot);
2604 Connection signal_connect_check_privilege_by_sockfd (InfoManagerSlotIntString2* slot)
2606 return m_signal_check_privilege_by_sockfd.connect (slot);
2609 Connection signal_connect_remoteinput_send_input_message (InfoManagerSlotStringBool* slot)
2611 return m_signal_remoteinput_send_input_message.connect (slot);
2614 Connection signal_connect_remoteinput_send_surrounding_text (InfoManagerSlotIntString* slot)
2616 return m_signal_remoteinput_send_surrounding_text.connect (slot);
2619 //ISM_TRANS_CMD_REGISTER_PANEL_CLIENT
2620 void register_panel_client (uint32 client_id, uint32 id) {
2621 m_panel_client_map [client_id] = (int)id;
2623 //SCIM_TRANS_CMD_PANEL_REGISTER_INPUT_CONTEXT
2624 void register_input_context (uint32 client_id, uint32 context, String uuid) {
2625 uint32 ctx = get_helper_ic (m_panel_client_map[client_id], context);
2626 m_client_context_uuids [ctx] = uuid;
2628 //SCIM_TRANS_CMD_PANEL_REMOVE_INPUT_CONTEXT
2629 void remove_input_context (uint32 client_id, uint32 context) {
2630 uint32 ctx = get_helper_ic (m_panel_client_map[client_id], context);
2631 m_client_context_uuids.erase (ctx);
2633 if (ctx == get_helper_ic (m_current_socket_client, m_current_client_context)) {
2635 m_current_socket_client = m_last_socket_client;
2636 m_current_client_context = m_last_client_context;
2637 m_current_context_uuid = m_last_context_uuid;
2638 m_last_socket_client = -1;
2639 m_last_client_context = 0;
2640 m_last_context_uuid = String ("");
2642 if (m_current_socket_client == -1) {
2644 socket_update_control_panel ();
2648 } else if (ctx == get_helper_ic (m_last_socket_client, m_last_client_context)) {
2650 m_last_socket_client = -1;
2651 m_last_client_context = 0;
2652 m_last_context_uuid = String ("");
2656 if (m_client_context_uuids.size () == 0)
2657 m_signal_stop_default_ise ();
2660 //SCIM_TRANS_CMD_PANEL_RESET_INPUT_CONTEXT
2661 void socket_reset_input_context (int client_id, uint32 context) {
2662 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_reset_input_context \n";
2664 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2665 socket_reset_helper_input_context (m_current_helper_uuid, m_panel_client_map[client_id], context);
2668 //SCIM_TRANS_CMD_FOCUS_IN
2669 void focus_in (int client_id, uint32 context, String uuid) {
2670 m_refocus_needed = true;
2671 bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false);
2672 if (launch_ise_on_request)
2673 m_signal_start_default_ise ();
2675 m_signal_focus_in ();
2676 focus_in_helper (m_current_helper_uuid, m_panel_client_map[client_id], context);
2677 SCIM_DEBUG_MAIN (2) << "PanelAgent::focus_in (" << client_id << "," << context << "," << uuid << ")\n";
2678 m_active_client_id = client_id;
2681 if (m_current_socket_client >= 0) {
2682 m_last_socket_client = m_current_socket_client;
2683 m_last_client_context = m_current_client_context;
2684 m_last_context_uuid = m_current_context_uuid;
2687 m_current_socket_client = m_panel_client_map[client_id];
2688 m_current_client_context = context;
2689 m_current_context_uuid = uuid;
2693 //SCIM_TRANS_CMD_FOCUS_OUT
2694 void focus_out (int client_id, uint32 context) {
2695 m_refocus_needed = false;
2696 m_signal_focus_out ();
2698 focus_out_helper (m_current_helper_uuid, m_panel_client_map[client_id], context);
2700 if (m_current_socket_client >= 0) {
2701 m_last_socket_client = m_current_socket_client;
2702 m_last_client_context = m_current_client_context;
2703 m_last_context_uuid = m_current_context_uuid;
2706 m_current_socket_client = -1;
2707 m_current_client_context = 0;
2708 m_current_context_uuid = String ("");
2712 //ISM_TRANS_CMD_TURN_ON_LOG
2713 void socket_turn_on_log (uint32 isOn) {
2715 DebugOutput::enable_debug (SCIM_DEBUG_AllMask);
2716 DebugOutput::set_verbose_level (7);
2717 SCIM_DEBUG_MAIN (4) << __func__ << " on\n";
2719 SCIM_DEBUG_MAIN (4) << __func__ << " off\n";
2720 DebugOutput::disable_debug (SCIM_DEBUG_AllMask);
2721 DebugOutput::set_verbose_level (0);
2725 uint32 focused_context;
2726 get_focused_context (focused_client, focused_context);
2728 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
2729 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
2731 if (it != m_helper_client_index.end ()) {
2732 //uint32 ctx = get_helper_ic (focused_client, focused_context);
2734 //m_panel_agent_manager.socket_turn_on_log (it->second.id, ctx, m_current_helper_uuid, isOn);
2738 if (focused_client == -1) {
2739 std::cerr << __func__ << " get_focused_context is failed!!!\n";
2743 ClientInfo client_info = socket_get_client_info (focused_client);
2745 if (client_info.type == FRONTEND_CLIENT) {
2747 //m_panel_agent_manager.socket_turn_on_log (focused_client, focused_context, isOn);
2752 void add_client (int client_id, uint32 key, ClientType type) {
2753 LOGD ("id:%d, key:%d, type:%d", client_id, key, type);
2757 SCIM_DEBUG_MAIN (4) << "Add client to repository. Type=" << type << " key=" << key << "\n";
2759 m_client_repository [client_id] = info;
2761 if (info.type == IMCONTROL_ACT_CLIENT) {
2762 m_pending_active_imcontrol_id = client_id;
2763 } else if (info.type == IMCONTROL_CLIENT) {
2764 m_imcontrol_map [m_pending_active_imcontrol_id] = client_id;
2765 m_pending_active_imcontrol_id = -1;
2766 } else if (info.type == REMOTEINPUT_ACT_CLIENT) {
2767 m_current_send_remoteinput_id.push_back (client_id);
2768 } else if (info.type == REMOTEINPUT_CLIENT) {
2769 m_current_recv_remoteinput_id.push_back (client_id);
2772 LOGD ("%d clients connecting", m_client_repository.size());
2777 void del_client (int client_id) {
2778 ClientRepository::iterator iter = m_client_repository.find(client_id);
2779 if (iter == m_client_repository.end()) {
2780 LOGW("The client with id %d does not exist in our client repository, returning", client_id);
2784 m_signal_close_connection (client_id);
2785 ClientInfo client_info = socket_get_client_info (client_id);
2786 m_client_repository.erase (client_id);
2787 LOGD ("id:%d, type:%d", client_id, client_info.type);
2788 #ifdef PANEL_SERVER_AUTO_EXIT
2789 /* Exit panel if there is no connected client anymore. */
2790 if (client_info.type != UNKNOWN_CLIENT && m_client_repository.size () == 0 && !m_should_resident) {
2791 SCIM_DEBUG_MAIN (4) << "Exit Socket Server Thread.\n";
2792 server->shutdown ();
2793 m_signal_exit.emit ();
2798 if (client_info.type == FRONTEND_CLIENT) {
2799 SCIM_DEBUG_MAIN (4) << "It's a FrontEnd client.\n";
2801 /* The focused client is closed. */
2802 if (m_current_socket_client == client_id) {
2803 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2804 hide_helper (m_current_helper_uuid);
2807 m_current_socket_client = -1;
2808 m_current_client_context = 0;
2809 m_current_context_uuid = String ("");
2811 socket_transaction_start ();
2813 socket_transaction_end ();
2816 if (m_last_socket_client == client_id) {
2818 m_last_socket_client = -1;
2819 m_last_client_context = 0;
2820 m_last_context_uuid = String ("");
2824 /* Erase all associated Client Context UUIDs. */
2825 std::vector <uint32> ctx_list;
2826 ClientContextUUIDRepository::iterator it = m_client_context_uuids.begin ();
2828 for (; it != m_client_context_uuids.end (); ++it) {
2829 if ((it->first & 0xFFFF) == (client_id & 0xFFFF))
2830 ctx_list.push_back (it->first);
2833 for (size_t i = 0; i < ctx_list.size (); ++i)
2834 m_client_context_uuids.erase (ctx_list [i]);
2836 /* Erase all helperise info associated with the client */
2838 it = m_client_context_helper.begin ();
2840 for (; it != m_client_context_helper.end (); ++it) {
2841 if ((it->first & 0xFFFF) == (client_id & 0xFFFF)) {
2842 ctx_list.push_back (it->first);
2843 /* similar to stop_helper except that it will not call get_focused_context() */
2844 String uuid = it->second;
2846 if (m_helper_uuid_count.find (uuid) != m_helper_uuid_count.end ()) {
2847 uint32 count = m_helper_uuid_count[uuid];
2850 m_helper_uuid_count.erase (uuid);
2851 HelperClientIndex::iterator pise = m_helper_client_index.find (uuid);
2853 if (pise != m_helper_client_index.end ()) {
2854 stop_helper (uuid, pise->second.id, it->first);
2857 SCIM_DEBUG_MAIN (1) << "Stop HelperISE " << uuid << " ...\n";
2859 m_helper_uuid_count[uuid] = count - 1;
2860 focus_out_helper (uuid, (it->first & 0xFFFF), ((it->first >> 16) & 0x7FFF));
2861 SCIM_DEBUG_MAIN (1) << "Decrement usage count of HelperISE " << uuid
2862 << " to " << m_helper_uuid_count[uuid] << "\n";
2868 for (size_t i = 0; i < ctx_list.size (); ++i)
2869 m_client_context_helper.erase (ctx_list [i]);
2871 HelperInfoRepository::iterator iter = m_helper_info_repository.begin ();
2873 for (; iter != m_helper_info_repository.end (); iter++) {
2874 if (!m_current_helper_uuid.compare (iter->second.uuid))
2875 if (! (iter->second.option & ISM_ISE_HIDE_IN_CONTROL_PANEL))
2876 socket_update_control_panel ();
2878 } else if (client_info.type == FRONTEND_ACT_CLIENT) {
2879 SCIM_DEBUG_MAIN (4) << "It's a FRONTEND_ACT_CLIENT client.\n";
2880 IntIntRepository::iterator iter2 = m_panel_client_map.find (client_id);
2882 if (iter2 != m_panel_client_map.end ())
2883 m_panel_client_map.erase (iter2);
2884 } else if (client_info.type == HELPER_CLIENT) {
2885 SCIM_DEBUG_MAIN (4) << "It's a Helper client.\n";
2887 HelperInfoRepository::iterator hiit = m_helper_info_repository.find (client_id);
2889 if (hiit != m_helper_info_repository.end ()) {
2890 bool restart = false;
2891 String uuid = hiit->second.uuid;
2892 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
2894 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
2895 if ((hiit->second.option & SCIM_HELPER_AUTO_RESTART) &&
2896 (default_uuid.compare (uuid) == 0 || default_uuid.compare ("") == 0) &&
2897 (it != m_helper_client_index.end () && it->second.ref > 0)) {
2901 m_helper_client_index.erase (uuid);
2902 m_helper_info_repository.erase (hiit);
2904 m_signal_stop_default_ise ();
2906 if (m_refocus_needed || m_reshow_needed)
2907 m_restart_needed = true;
2909 if (restart && !m_ise_exiting && m_restart_needed) {
2910 struct tms tiks_buf;
2911 static clock_t start_tiks = times (&tiks_buf);
2912 static double clock_tiks = (double)sysconf (_SC_CLK_TCK);
2913 clock_t curr_tiks = times (&tiks_buf);
2914 double secs = (double) (curr_tiks - start_tiks) / clock_tiks;
2915 //LOGE ("time second:%f", secs);
2916 static String restart_uuid;
2918 if (restart_uuid != uuid || secs > MIN_REPEAT_TIME) {
2919 scim_usleep (100000);
2923 get_focused_context(client, context);
2925 uint32 ic = get_helper_ic (client, context);
2927 /* Get the context uuid from the client context registration table. */
2929 ClientContextUUIDRepository::iterator it =
2930 m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client], context));
2932 if (it != m_client_context_uuids.end ())
2933 ic_uuid = it->second;
2936 m_start_helper_ic_index[uuid].push_back(std::make_pair(ic, ic_uuid));
2937 m_signal_run_helper (uuid, m_config_name, m_display_name);
2938 restart_uuid = uuid;
2939 LOGE ("Auto restart soft ISE:%s", uuid.c_str ());
2941 reset_default_ise (0);
2942 ISF_SAVE_LOG ("Auto restart is abnormal, reset default ISE");
2945 start_tiks = curr_tiks;
2949 m_ise_exiting = false;
2950 m_restart_needed = true;
2952 socket_transaction_start ();
2953 m_signal_remove_helper (client_id);
2954 socket_transaction_end ();
2955 } else if (client_info.type == HELPER_ACT_CLIENT) {
2956 SCIM_DEBUG_MAIN (4) << "It's a Helper passive client.\n";
2958 HelperInfoRepository::iterator hiit = m_helper_active_info_repository.find (client_id);
2960 if (hiit != m_helper_active_info_repository.end ())
2961 m_helper_active_info_repository.erase (hiit);
2964 } else if (client_info.type == IMCONTROL_ACT_CLIENT) {
2965 SCIM_DEBUG_MAIN (4) << "It's a IMCONTROL_ACT_CLIENT client.\n";
2966 IMControlRepository::iterator iter = m_imcontrol_repository.find (client_id);
2968 if (iter != m_imcontrol_repository.end ()) {
2969 int size = iter->second.info.size ();
2973 stop_helper ((iter->second.info)[i].uuid, (iter->second.count)[i], DEFAULT_CONTEXT_VALUE);
2975 if ((iter->second.info)[i].option & ISM_ISE_HIDE_IN_CONTROL_PANEL)
2976 m_current_helper_uuid = m_last_helper_uuid;
2981 m_imcontrol_repository.erase (iter);
2984 IntIntRepository::iterator iter2 = m_imcontrol_map.find (client_id);
2986 if (iter2 != m_imcontrol_map.end ())
2987 m_imcontrol_map.erase (iter2);
2988 } else if (client_info.type == REMOTEINPUT_ACT_CLIENT) {
2989 SCIM_DEBUG_MAIN (4) << "It's a REMOTEINPUT_ACT_CLIENT client.\n";
2991 for (unsigned int i = 0; i < m_current_send_remoteinput_id.size (); i++) {
2992 if (m_current_send_remoteinput_id.at (i) == client_id) {
2993 m_current_send_remoteinput_id.erase (m_current_send_remoteinput_id.begin () + i);
2997 } else if (client_info.type == REMOTEINPUT_CLIENT) {
2998 SCIM_DEBUG_MAIN (4) << "It's a REMOTEINPUT_CLIENT client.\n";
3000 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3001 if (m_current_recv_remoteinput_id.at (i) == client_id) {
3002 m_current_recv_remoteinput_id.erase (m_current_recv_remoteinput_id.begin () + i);
3006 } else if (client_info.type == CONFIG_CLIENT) {
3007 SCIM_DEBUG_MAIN(4) << "It's a CONFIG_CLIENT client.\n";
3009 LOGI ("clients: %d, panel clients: %d, imcontrols size: %d, helper infos: %d, \
3010 helper active infos: %d, helper client indexs: %d, ises pending: %d, \
3011 imcontrols: %d, start helper ic indexs: %d, client context uuids: %d, \
3012 client context helpers: %d, helpers uuid count: %d",
3013 m_client_repository.size(),
3014 m_panel_client_map.size(),
3015 m_imcontrol_map.size(),
3016 m_helper_info_repository.size(),
3017 m_helper_active_info_repository.size(),
3018 m_helper_client_index.size(),
3019 m_ise_pending_repository.size(),
3020 m_imcontrol_repository.size(),
3021 m_start_helper_ic_index.size(),
3022 m_client_context_uuids.size(),
3023 m_client_context_helper.size(),
3024 m_helper_uuid_count.size());
3027 const ClientInfo& socket_get_client_info (int client) {
3028 static ClientInfo null_client = { 0, UNKNOWN_CLIENT };
3029 ClientRepository::iterator it = m_client_repository.find (client);
3031 if (it != m_client_repository.end ())
3037 //SCIM_TRANS_CMD_PANEL_TURN_ON
3038 void socket_turn_on (void) {
3039 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_turn_on ()\n";
3040 m_signal_turn_on ();
3042 //SCIM_TRANS_CMD_PANEL_TURN_OFF
3043 void socket_turn_off (void) {
3044 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_turn_off ()\n";
3045 m_signal_turn_off ();
3047 //SCIM_TRANS_CMD_UPDATE_SCREEN
3048 void socket_update_screen (int client_id, uint32 num) {
3049 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_screen ()\n";
3051 if (((int) num) != m_current_screen) {
3052 SCIM_DEBUG_MAIN (4) << "New Screen number = " << num << "\n";
3053 m_signal_update_screen ((int) num);
3054 helper_all_update_screen ((int) num);
3055 m_current_screen = (num);
3058 //SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
3059 void socket_update_spot_location (uint32 x, uint32 y, uint32 top_y) {
3060 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_spot_location ()\n";
3061 SCIM_DEBUG_MAIN (4) << "New Spot location x=" << x << " y=" << y << "\n";
3062 m_signal_update_spot_location ((int)x, (int)y, (int)top_y);
3063 helper_all_update_spot_location ((int)x, (int)y);
3065 //ISM_TRANS_CMD_UPDATE_CURSOR_POSITION
3066 void socket_update_cursor_position (uint32 cursor_pos) {
3067 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_cursor_position ()\n";
3068 SCIM_DEBUG_MAIN (4) << "New cursor position pos=" << cursor_pos << "\n";
3069 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
3070 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
3071 iseContext->cursor_pos = static_cast<int>(cursor_pos);
3073 helper_all_update_cursor_position ((int)cursor_pos);
3075 //ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT
3076 void socket_update_surrounding_text (String text, uint32 cursor) {
3077 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3078 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3080 if (it != m_helper_client_index.end ()) {
3085 get_focused_context (client, context);
3086 ctx = get_helper_ic (client, context);
3087 m_panel_agent_manager.socket_update_surrounding_text (it->second.id, ctx, m_current_helper_uuid, text, cursor);
3092 void remoteinput_callback_focus_in () {
3093 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3095 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3097 m_panel_agent_manager.socket_remoteinput_focus_in (m_current_recv_remoteinput_id.at (i));
3102 void remoteinput_callback_focus_out () {
3103 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3105 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3107 m_panel_agent_manager.socket_remoteinput_focus_out (m_current_recv_remoteinput_id.at (i));
3112 void remoteinput_callback_entry_metadata (uint32 hint, uint32 layout, int variation, uint32 autocapital_type, int return_key_disabled) {
3113 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3114 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
3115 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
3116 iseContext->layout = static_cast<Ecore_IMF_Input_Panel_Layout>(layout);
3117 iseContext->return_key_disabled = static_cast<Eina_Bool>(return_key_disabled);
3118 iseContext->layout_variation = static_cast<int>(variation);
3119 iseContext->autocapital_type = static_cast<Ecore_IMF_Autocapital_Type>(autocapital_type);
3120 iseContext->input_hint = static_cast<Ecore_IMF_Input_Hints>(hint);
3122 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3124 m_panel_agent_manager.socket_remoteinput_entry_metadata (m_current_recv_remoteinput_id.at (i), hint, layout, variation, autocapital_type, return_key_disabled);
3129 void remoteinput_callback_surrounding_text (String text, uint32 cursor) {
3130 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3132 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3134 m_panel_agent_manager.socket_remoteinput_surrounding_text (m_current_recv_remoteinput_id.at (i), text, cursor);
3139 void remoteinput_callback_input_resource (uint32 input_resource) {
3140 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3142 for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3144 m_panel_agent_manager.socket_remoteinput_input_resource (m_current_recv_remoteinput_id.at (i), input_resource);
3149 //ISM_TRANS_CMD_UPDATE_SELECTION
3150 void socket_update_selection (String text) {
3151 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3152 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3154 if (it != m_helper_client_index.end ()) {
3159 get_focused_context (client, context);
3160 ctx = get_helper_ic (client, context);
3161 m_panel_agent_manager.socket_update_selection (it->second.id, ctx, m_current_helper_uuid, text);
3165 //SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO
3166 void socket_update_factory_info (PanelFactoryInfo& info) {
3167 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_factory_info ()\n";
3168 SCIM_DEBUG_MAIN (4) << "New Factory info uuid=" << info.uuid << " name=" << info.name << "\n";
3169 info.lang = scim_get_normalized_language (info.lang);
3170 m_signal_update_factory_info (info);
3172 //SCIM_TRANS_CMD_PANEL_SHOW_HELP
3173 void socket_show_help (String help) {
3174 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_help ()\n";
3175 m_signal_show_help (help);
3177 //SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU
3178 void socket_show_factory_menu (std::vector <PanelFactoryInfo>& vec) {
3179 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_factory_menu ()\n";
3182 m_signal_show_factory_menu (vec);
3185 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
3186 void socket_show_preedit_string (void) {
3187 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_preedit_string ()\n";
3188 m_signal_show_preedit_string ();
3190 //SCIM_TRANS_CMD_SHOW_AUX_STRING
3191 void socket_show_aux_string (void) {
3192 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_aux_string ()\n";
3193 m_signal_show_aux_string ();
3195 //SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE
3196 void socket_show_lookup_table (void) {
3197 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_lookup_table ()\n";
3198 m_signal_show_lookup_table ();
3200 //ISM_TRANS_CMD_SHOW_ASSOCIATE_TABLE
3201 void socket_show_associate_table (void) {
3202 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_associate_table ()\n";
3203 m_signal_show_associate_table ();
3205 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
3206 void socket_hide_preedit_string (void) {
3207 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_preedit_string ()\n";
3208 m_signal_hide_preedit_string ();
3210 //SCIM_TRANS_CMD_HIDE_AUX_STRING
3211 void socket_hide_aux_string (void) {
3212 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_aux_string ()\n";
3213 m_signal_hide_aux_string ();
3215 //SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE
3216 void socket_hide_lookup_table (void) {
3217 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_lookup_table ()\n";
3218 m_signal_hide_lookup_table ();
3220 //ISM_TRANS_CMD_HIDE_ASSOCIATE_TABLE
3221 void socket_hide_associate_table (void) {
3222 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_associate_table ()\n";
3223 m_signal_hide_associate_table ();
3225 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
3226 void socket_update_preedit_string (String& str, const AttributeList& attrs, uint32 caret) {
3227 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_string ()\n";
3228 m_signal_update_preedit_string (str, attrs, (int) caret);
3230 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
3231 void socket_update_preedit_caret (uint32 caret) {
3232 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_caret ()\n";
3233 m_signal_update_preedit_caret ((int) caret);
3235 //ISM_TRANS_CMD_RECAPTURE_STRING
3236 void socket_recapture_string (int offset, int len, String& preedit, String& commit, const AttributeList& attrs) {
3237 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_caret ()\n";
3238 m_signal_recapture_string (offset, len, preedit, commit, attrs);
3240 //SCIM_TRANS_CMD_UPDATE_AUX_STRING
3241 void socket_update_aux_string (String& str, const AttributeList& attrs) {
3242 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_aux_string ()\n";
3243 m_signal_update_aux_string (str, attrs);
3244 m_is_imengine_aux = true;
3246 //SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE
3247 void socket_update_lookup_table (const LookupTable& table) {
3248 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_lookup_table ()\n";
3250 //g_isf_candidate_table = _isf_candidate_table;
3251 m_signal_update_lookup_table (table);
3252 m_is_imengine_candidate = true;
3254 //ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE
3255 void socket_update_associate_table (const LookupTable& table) {
3256 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_associate_table ()\n";
3257 m_signal_update_associate_table (table);
3260 void socket_update_control_panel (void) {
3261 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_control_panel ()\n";
3263 m_signal_get_keyboard_ise (name, uuid);
3264 PanelFactoryInfo info;
3266 if (name.length () > 0)
3267 info = PanelFactoryInfo (uuid, name, String (""), String (""));
3269 info = PanelFactoryInfo (String (""), String (_ ("English Keyboard")), String ("C"), String (SCIM_KEYBOARD_ICON_FILE));
3271 m_signal_update_factory_info (info);
3273 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
3274 void socket_register_properties (const PropertyList& properties) {
3275 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_register_properties ()\n";
3276 m_signal_register_properties (properties);
3278 //SCIM_TRANS_CMD_UPDATE_PROPERTY
3279 void socket_update_property (const Property& property) {
3280 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_property ()\n";
3281 m_signal_update_property (property);
3283 //ISM_TRANS_CMD_GET_KEYBOARD_ISE_LIST
3284 void socket_get_keyboard_ise_list (String& uuid) {
3285 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_keyboard_ise_list ()\n";
3286 std::vector<String> list;
3288 m_signal_get_keyboard_ise_list (list);
3289 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3291 if (it != m_helper_client_index.end ()) {
3294 get_focused_context (client, context);
3295 uint32 ctx = get_helper_ic (client, context);
3296 m_panel_agent_manager.socket_get_keyboard_ise_list (it->second.id, ctx, uuid, list);
3299 //ISM_TRANS_CMD_SET_CANDIDATE_UI
3300 void socket_set_candidate_ui (uint32 portrait_line, uint32 mode) {
3301 SCIM_DEBUG_MAIN (4) << __func__ << " \n";
3302 m_signal_set_candidate_ui (portrait_line, mode);
3304 //ISM_TRANS_CMD_GET_CANDIDATE_UI
3305 void socket_get_candidate_ui (String uuid) {
3306 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_candidate_ui ()\n";
3307 int style = 0, mode = 0;
3308 m_signal_get_candidate_ui (style, mode);
3309 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3311 if (it != m_helper_client_index.end ()) {
3314 get_focused_context (client, context);
3315 uint32 ctx = get_helper_ic (client, context);
3316 m_panel_agent_manager.socket_get_candidate_ui (it->second.id, ctx, uuid, style, mode);
3319 //ISM_TRANS_CMD_SET_CANDIDATE_POSITION
3320 void socket_set_candidate_position (uint32 left, uint32 top) {
3321 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_candidate_position ()\n";
3322 m_signal_set_candidate_position (left, top);
3324 //ISM_TRANS_CMD_HIDE_CANDIDATE
3325 void socket_hide_candidate (void) {
3326 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_candidate ()\n";
3327 m_signal_hide_preedit_string ();
3328 m_signal_hide_aux_string ();
3329 m_signal_hide_lookup_table ();
3330 m_signal_hide_associate_table ();
3332 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
3333 void socket_get_candidate_geometry (String& uuid) {
3334 SCIM_DEBUG_MAIN (4) << __func__ << " \n";
3335 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3337 if (it != m_helper_client_index.end ()) {
3338 struct rectinfo info = {0, 0, 0, 0};
3339 m_signal_get_candidate_geometry (info);
3342 get_focused_context (client, context);
3343 uint32 ctx = get_helper_ic (client, context);
3344 m_panel_agent_manager.socket_get_candidate_geometry (it->second.id, ctx, uuid, info);
3347 //ISM_TRANS_CMD_SET_KEYBOARD_ISE_BY_UUID
3348 void socket_set_keyboard_ise (String uuid) {
3349 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_keyboard_ise ()\n";
3351 m_signal_set_keyboard_ise (uuid);
3353 //ISM_TRANS_CMD_SELECT_CANDIDATE
3354 void socket_helper_select_candidate (uint32 index) {
3355 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_keyboard_ise ()\n";
3357 m_signal_select_candidate (index);
3359 //ISM_TRANS_CMD_UPDATE_ISE_GEOMETRY
3360 void socket_helper_update_ise_geometry (int client, uint32 x, uint32 y, uint32 width, uint32 height) {
3361 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3364 uint32 focused_context;
3365 HelperInfoRepository::iterator it = m_helper_active_info_repository.find (client);
3367 if (it != m_helper_active_info_repository.end ()) {
3368 if (it->second.uuid == m_current_helper_uuid) {
3369 m_signal_update_ise_geometry (x, y, width, height);
3371 get_focused_context (focused_client, focused_context);
3372 ClientInfo client_info = socket_get_client_info (focused_client);
3373 if (client_info.type == FRONTEND_CLIENT) {
3374 m_panel_agent_manager.update_ise_geometry (focused_client, focused_context, x, y, width, height);
3379 //ISM_TRANS_CMD_GET_KEYBOARD_ISE
3380 void socket_get_keyboard_ise (String uuid) {
3381 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_keyboard_ise ()\n";
3382 String ise_name, ise_uuid;
3386 get_focused_context (client, context);
3387 ctx = get_helper_ic (client, context);
3389 if (m_client_context_uuids.find (ctx) != m_client_context_uuids.end ())
3390 ise_uuid = m_client_context_uuids[ctx];
3392 m_signal_get_keyboard_ise (ise_name, ise_uuid);
3393 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3395 if (it != m_helper_client_index.end ()) {
3396 get_focused_context (client, context);
3397 ctx = get_helper_ic (client, context);
3398 m_panel_agent_manager.socket_get_keyboard_ise (it->second.id, ctx, uuid, ise_name, ise_uuid);
3402 //SCIM_TRANS_CMD_START_HELPER
3403 void socket_start_helper (int client_id, uint32 context, String uuid) {
3404 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_start_helper ()\n";
3405 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3407 uint32 ic = get_helper_ic (m_panel_client_map[client_id], context);
3409 /* Get the context uuid from the client context registration table. */
3411 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3413 if (it != m_client_context_uuids.end ())
3414 ic_uuid = it->second;
3417 if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3418 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3419 } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3420 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3423 if (it == m_helper_client_index.end ()) {
3424 SCIM_DEBUG_MAIN (5) << "Run this Helper.\n";
3425 m_start_helper_ic_index [uuid].push_back (std::make_pair (ic, ic_uuid));
3426 m_signal_run_helper (uuid, m_config_name, m_display_name);
3428 SCIM_DEBUG_MAIN (5) << "Increase the Reference count.\n";
3429 m_panel_agent_manager.socket_start_helper (it->second.id, ic, ic_uuid);
3435 //SCIM_TRANS_CMD_STOP_HELPER
3436 void socket_stop_helper (int client_id, uint32 context, String uuid) {
3437 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_stop_helper ()\n";
3438 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3440 uint32 ic = get_helper_ic (m_panel_client_map[client_id], context);
3442 if (it != m_helper_client_index.end ()) {
3443 SCIM_DEBUG_MAIN (5) << "Decrase the Reference count.\n";
3446 /* Get the context uuid from the client context registration table. */
3448 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3450 if (it != m_client_context_uuids.end ())
3451 ic_uuid = it->second;
3454 if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3455 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3456 } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3457 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3460 m_panel_agent_manager.helper_detach_input_context (it->second.id, ic, ic_uuid);
3462 if (it->second.ref <= 0)
3463 m_panel_agent_manager.exit (it->second.id, ic);
3468 //SCIM_TRANS_CMD_SEND_HELPER_EVENT
3469 void socket_send_helper_event (int client_id, uint32 context, String uuid, const Transaction& _nest_trans) {
3470 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_send_helper_event ()\n";
3471 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3473 if (it != m_helper_client_index.end ()) {
3475 /* Get the context uuid from the client context registration table. */
3477 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3479 if (it != m_client_context_uuids.end ())
3480 ic_uuid = it->second;
3483 if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3484 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3485 } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3486 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3489 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);
3493 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
3494 void socket_helper_register_properties (int client, PropertyList& properties) {
3495 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_properties (" << client << ")\n";
3496 m_signal_register_helper_properties (client, properties);
3498 #if 0 //why? remove if useless, infinite loop
3499 /* Check whether application is already focus_in */
3500 if (m_current_socket_client != -1) {
3501 SCIM_DEBUG_MAIN (2) << "Application is already focus_in!\n";
3502 focus_in_helper (m_current_helper_uuid, m_current_socket_client, m_current_client_context);
3503 reset_keyboard_ise ();
3506 /* Check whether ISE panel is already shown */
3507 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode && m_ise_context_length > 0) {
3508 SCIM_DEBUG_MAIN (2) << "Re-show ISE panel!\n";
3510 uint32 focused_context;
3511 get_focused_context (focused_client, focused_context);
3513 if (focused_client == -1 && m_active_client_id != -1) {
3514 focused_client = m_panel_client_map[m_active_client_id];
3515 focused_context = 0;
3518 uint32 ctx = get_helper_ic (focused_client, focused_context);
3519 bool ret = show_helper (m_current_helper_uuid, m_ise_context_buffer, m_ise_context_length, ctx);
3522 m_signal_show_ise ();
3526 //SCIM_TRANS_CMD_UPDATE_PROPERTY
3527 void socket_helper_update_property (int client, Property& property) {
3528 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_property (" << client << ")\n";
3529 m_signal_update_helper_property (client, property);
3531 //SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT
3532 void socket_helper_send_imengine_event (int client, uint32 target_ic, String target_uuid , Transaction& nest_trans) {
3533 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_send_imengine_event (" << client << ")\n";
3534 HelperInfoRepository::iterator hiit = m_helper_active_info_repository.find (client);
3536 if (hiit != m_helper_active_info_repository.end ()) {
3538 uint32 target_context;
3539 get_imengine_client_context (target_ic, target_client, target_context);
3541 uint32 focused_context;
3542 String focused_uuid;
3543 focused_uuid = get_focused_context (focused_client, focused_context);
3545 if (target_ic == (uint32) (-1)) {
3546 target_client = focused_client;
3547 target_context = focused_context;
3550 if (target_uuid.length () == 0)
3551 target_uuid = focused_uuid;
3553 ClientInfo client_info = socket_get_client_info (target_client);
3554 SCIM_DEBUG_MAIN (5) << "Target UUID = " << target_uuid << " Focused UUId = " << focused_uuid << "\nTarget Client = " << target_client << "\n";
3556 if (client_info.type == FRONTEND_CLIENT) {
3557 /* If the original context value is greater than 0x7FFF, the line below would not work properly
3558 since the target_context acquired by get_imengnie_client_context() is always smaller than 0x7FFF.
3559 But since the send_imengine_event() of scim_helper module will call IMEngine's
3560 process_helper_event() function directly, instead of sending SEND_IMENGINE_EVENT message.
3561 So we are not going to handle this kind of exceptional case for now. */
3562 m_panel_agent_manager.process_helper_event (target_client, target_context, target_uuid, hiit->second.uuid, nest_trans);
3567 void socket_helper_key_event_op (int client, int cmd, uint32 target_ic, String& target_uuid, KeyEvent& key) {
3568 if (!key.empty ()) {
3570 uint32 target_context;
3571 get_imengine_client_context (target_ic, target_client, target_context);
3573 uint32 focused_context;
3574 String focused_uuid;
3575 focused_uuid = get_focused_context (focused_client, focused_context);
3577 if (target_ic == (uint32) (-1)) {
3578 target_client = focused_client;
3579 target_context = focused_context;
3582 if (target_uuid.length () == 0)
3583 target_uuid = focused_uuid;
3585 if (target_client == -1) {
3586 /* FIXUP: monitor 'Invalid Window' error */
3587 LOGW ("focused target client is NULL");
3588 } else if (target_uuid == focused_uuid &&
3589 clients_equal (target_client, focused_client) &&
3590 contexts_equal (target_context, focused_context)) {
3591 ClientInfo client_info = socket_get_client_info (focused_client);
3593 if (client_info.type == FRONTEND_CLIENT) {
3594 m_panel_agent_manager.socket_helper_key_event (focused_client, focused_context, cmd, key);
3597 LOGD ("[target_client : %d, focused_client : %d] => %d, [target_context : %u, focused_context : %u] => %d",
3598 target_client, focused_client, clients_equal (target_client, focused_client),
3599 target_context, focused_context, contexts_equal (target_context, focused_context));
3603 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
3604 //SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT
3605 void socket_helper_send_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key) {
3606 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_send_key_event (" << client << ")\n";
3607 ISF_PROF_DEBUG ("first message")
3608 socket_helper_key_event_op (client, SCIM_TRANS_CMD_PROCESS_KEY_EVENT, target_ic, target_uuid, key);
3610 //SCIM_TRANS_CMD_FORWARD_KEY_EVENT
3611 void socket_helper_forward_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key) {
3612 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_forward_key_event (" << client << ")\n";
3613 socket_helper_key_event_op (client, SCIM_TRANS_CMD_FORWARD_KEY_EVENT, target_ic, target_uuid, key);
3616 //SCIM_TRANS_CMD_COMMIT_STRING
3617 void socket_helper_commit_string (int client, uint32 target_ic, String target_uuid, WideString wstr) {
3618 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_commit_string (" << client << ")\n";
3620 if (wstr.length ()) {
3622 uint32 target_context;
3623 get_imengine_client_context (target_ic, target_client, target_context);
3625 uint32 focused_context;
3626 String focused_uuid;
3627 focused_uuid = get_focused_context (focused_client, focused_context);
3629 if (target_ic == (uint32) (-1)) {
3630 target_client = focused_client;
3631 target_context = focused_context;
3634 if (target_uuid.length () == 0)
3635 target_uuid = focused_uuid;
3637 if (target_uuid == focused_uuid &&
3638 clients_equal (target_client, focused_client) &&
3639 contexts_equal (target_context, focused_context)) {
3640 ClientInfo client_info = socket_get_client_info (focused_client);
3642 if (client_info.type == FRONTEND_CLIENT) {
3643 m_panel_agent_manager.commit_string (focused_client, focused_context, wstr);
3645 std::cerr << "target client is not existed!!!" << "\n";
3650 //SCIM_TRANS_CMD_GET_SURROUNDING_TEXT
3651 void socket_helper_get_surrounding_text (int client, String uuid, uint32 maxlen_before, uint32 maxlen_after) {
3652 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3654 uint32 focused_context;
3655 get_focused_context (focused_client, focused_context);
3656 ClientInfo client_info = socket_get_client_info (focused_client);
3658 /* If the get_surrounding_text was received when there is no client available,
3659 * return empty surrounding text since the sender would be waiting for reply */
3660 if (focused_client == -1) {
3661 socket_update_surrounding_text("", 0);
3663 if (client_info.type == FRONTEND_CLIENT) {
3664 m_panel_agent_manager.socket_helper_get_surrounding_text (focused_client, focused_context, maxlen_before, maxlen_after);
3668 //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT
3669 void socket_helper_delete_surrounding_text (int client, uint32 offset, uint32 len) {
3670 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3672 uint32 focused_context;
3673 get_focused_context (focused_client, focused_context);
3674 ClientInfo client_info = socket_get_client_info (focused_client);
3676 if (client_info.type == FRONTEND_CLIENT) {
3677 m_panel_agent_manager.socket_helper_delete_surrounding_text (focused_client, focused_context, offset, len);
3680 //SCIM_TRANS_CMD_GET_SELECTION
3681 void socket_helper_get_selection (int client, String uuid) {
3682 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3684 uint32 focused_context;
3685 get_focused_context (focused_client, focused_context);
3686 ClientInfo client_info = socket_get_client_info (focused_client);
3688 if (client_info.type == FRONTEND_CLIENT) {
3689 m_panel_agent_manager.socket_helper_get_selection (focused_client, focused_context);
3692 //SCIM_TRANS_CMD_SET_SELECTION
3693 void socket_helper_set_selection (int client, uint32 start, uint32 end) {
3694 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3696 uint32 focused_context;
3697 get_focused_context (focused_client, focused_context);
3698 ClientInfo client_info = socket_get_client_info (focused_client);
3700 if (client_info.type == FRONTEND_CLIENT) {
3701 m_panel_agent_manager.socket_helper_set_selection (focused_client, focused_context, start, end);
3705 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
3706 void socket_helper_show_preedit_string (int client, uint32 target_ic, String target_uuid) {
3707 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_show_preedit_string (" << client << ")\n";
3709 uint32 target_context;
3710 get_imengine_client_context (target_ic, target_client, target_context);
3712 uint32 focused_context;
3713 String focused_uuid = get_focused_context (focused_client, focused_context);
3715 if (target_ic == (uint32) (-1)) {
3716 target_client = focused_client;
3717 target_context = focused_context;
3720 if (target_uuid.length () == 0)
3721 target_uuid = focused_uuid;
3723 if (target_uuid == focused_uuid &&
3724 clients_equal (target_client, focused_client) &&
3725 contexts_equal (target_context, focused_context)) {
3726 ClientInfo client_info = socket_get_client_info (focused_client);
3728 if (client_info.type == FRONTEND_CLIENT) {
3729 m_panel_agent_manager.show_preedit_string (focused_client, focused_context);
3733 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
3734 void socket_helper_hide_preedit_string (int client, uint32 target_ic, String target_uuid) {
3735 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_hide_preedit_string (" << client << ")\n";
3737 uint32 target_context;
3738 get_imengine_client_context (target_ic, target_client, target_context);
3740 uint32 focused_context;
3741 String focused_uuid = get_focused_context (focused_client, focused_context);
3743 if (target_ic == (uint32) (-1)) {
3744 target_client = focused_client;
3745 target_context = focused_context;
3748 if (target_uuid.length () == 0)
3749 target_uuid = focused_uuid;
3751 if (target_uuid == focused_uuid &&
3752 clients_equal (target_client, focused_client) &&
3753 contexts_equal (target_context, focused_context)) {
3754 ClientInfo client_info = socket_get_client_info (focused_client);
3756 if (client_info.type == FRONTEND_CLIENT) {
3757 m_panel_agent_manager.hide_preedit_string (focused_client, focused_context);
3761 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
3762 void socket_helper_update_preedit_string (int client, uint32 target_ic, String target_uuid, WideString preedit, WideString commit, AttributeList& attrs, uint32 caret) {
3763 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_preedit_string (" << client << ")\n";
3765 uint32 target_context;
3766 get_imengine_client_context (target_ic, target_client, target_context);
3768 uint32 focused_context;
3769 String focused_uuid;
3770 focused_uuid = get_focused_context (focused_client, focused_context);
3772 if (target_ic == (uint32) (-1)) {
3773 target_client = focused_client;
3774 target_context = focused_context;
3777 if (target_uuid.length () == 0)
3778 target_uuid = focused_uuid;
3780 if (target_uuid == focused_uuid &&
3781 clients_equal (target_client, focused_client) &&
3782 contexts_equal (target_context, focused_context)) {
3783 ClientInfo client_info = socket_get_client_info (focused_client);
3785 if (client_info.type == FRONTEND_CLIENT) {
3786 m_panel_agent_manager.update_preedit_string (focused_client, focused_context, preedit, commit, attrs, caret);
3790 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
3791 void socket_helper_update_preedit_caret (int client, uint32 caret) {
3792 SCIM_DEBUG_MAIN (4) << __func__ << " (" << client << ")\n";
3794 uint32 focused_context;
3795 String focused_uuid;
3796 focused_uuid = get_focused_context (focused_client, focused_context);
3797 ClientInfo client_info = socket_get_client_info (focused_client);
3799 if (client_info.type == FRONTEND_CLIENT) {
3800 m_panel_agent_manager.update_preedit_caret (focused_client, focused_context, caret);
3804 //ISM_TRANS_CMD_RECAPTURE_STRING
3805 void socket_helper_recapture_string (int client, uint32 target_ic, String target_uuid, int offset, int len, WideString preedit,
3806 WideString commit, AttributeList& attrs) {
3807 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_recapture_string (" << client << ")\n";
3809 uint32 target_context;
3810 get_imengine_client_context (target_ic, target_client, target_context);
3812 uint32 focused_context;
3813 String focused_uuid;
3814 focused_uuid = get_focused_context (focused_client, focused_context);
3816 if (target_ic == (uint32) (-1)) {
3817 target_client = focused_client;
3818 target_context = focused_context;
3821 if (target_uuid.length () == 0)
3822 target_uuid = focused_uuid;
3824 if (target_uuid == focused_uuid &&
3825 clients_equal (target_client, focused_client) &&
3826 contexts_equal (target_context, focused_context)) {
3827 ClientInfo client_info = socket_get_client_info (focused_client);
3829 if (client_info.type == FRONTEND_CLIENT) {
3830 m_panel_agent_manager.recapture_string (focused_client, focused_context, offset, len, preedit, commit, attrs);
3835 //SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
3836 void socket_helper_register_helper (int client, HelperInfo& info) {
3837 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_helper (" << client << ")\n";
3838 bool result = false;
3845 if (!m_signal_get_ise_information (info.uuid, info.name, language, type, option, module_name)) {
3846 LOGW ("This helper (%s) is not IME", info.uuid.c_str ());
3850 info.option = option;
3852 if (info.uuid.length ()) {
3853 SCIM_DEBUG_MAIN (4) << "New Helper uuid=" << info.uuid << " name=" << info.name << "\n";
3854 HelperClientIndex::iterator it = m_helper_client_index.find (info.uuid);
3856 if (it == m_helper_client_index.end ()) {
3857 m_helper_info_repository [client] = info;
3858 m_helper_client_index [info.uuid] = HelperClientStub (client, 1);
3859 StartHelperICIndex::iterator icit = m_start_helper_ic_index.find (info.uuid);
3861 if (icit != m_start_helper_ic_index.end ()) {
3862 m_panel_agent_manager.helper_attach_input_context_and_update_screen (client, icit->second, m_current_screen);
3863 m_start_helper_ic_index.erase (icit);
3866 LOGW ("Failed to register IME : %s", info.uuid.c_str ());
3867 m_panel_agent_manager.send_fail_reply(client);
3870 LOGW ("Failed to register IME : %s", info.uuid.c_str ());
3871 m_panel_agent_manager.send_fail_reply(client);
3878 LOGD ("Succeed to regster IME : %s", info.uuid.c_str ());
3879 m_signal_register_helper (client, info);
3883 //SCIM_TRANS_CMD_PANEL_REGISTER_ACTIVE_HELPER
3884 void socket_helper_register_helper_passive (int client, HelperInfo& info) {
3885 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_helper_passive (" << client << ")\n";
3892 if (!m_signal_get_ise_information (info.uuid, info.name, language, type, option, module_name)) {
3893 LOGW ("This helper (%s) is not IME", info.uuid.c_str ());
3897 info.option = option;
3899 if (info.uuid.length ()) {
3900 SCIM_DEBUG_MAIN (4) << "New Helper Passive uuid=" << info.uuid << " name=" << info.name << "\n";
3901 HelperInfoRepository::iterator it = m_helper_active_info_repository.find (client);
3903 if (it == m_helper_active_info_repository.end ()) {
3904 m_helper_active_info_repository[client] = info;
3907 StringIntRepository::iterator iter = m_ise_pending_repository.find (info.uuid);
3909 if (iter != m_ise_pending_repository.end ()) {
3910 m_ise_pending_repository.erase (iter);
3913 iter = m_ise_pending_repository.find (info.name);
3915 if (iter != m_ise_pending_repository.end ()) {
3916 m_ise_pending_repository.erase (iter);
3922 //ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
3923 void socket_helper_update_input_context (int client, uint32 type, uint32 value) {
3924 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_input_context (" << client << ")\n";
3925 m_signal_update_input_context ((int)type, (int)value);
3927 uint32 focused_context;
3928 get_focused_context (focused_client, focused_context);
3929 ClientInfo client_info = socket_get_client_info (focused_client);
3931 if (client_info.type == FRONTEND_CLIENT) {
3932 m_panel_agent_manager.update_ise_input_context (focused_client, focused_context, type, value);
3934 std::cerr << "focused client is not existed!!!" << "\n";
3937 //ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE
3938 void socket_helper_update_language_locale(int client, String locale) {
3939 SCIM_DEBUG_MAIN(4) << "InfoManager::socket_helper_update_language_locale (" << client << ")\n";
3940 m_signal_update_language_locale(locale);
3943 uint32 focused_context;
3944 get_focused_context(focused_client, focused_context);
3945 ClientInfo client_info = socket_get_client_info(focused_client);
3947 if (client_info.type == FRONTEND_CLIENT) {
3948 m_panel_agent_manager.update_ise_language_locale(focused_client, focused_context, locale);
3950 std::cerr << "focused client is not existed!!!" << "\n";
3953 //SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
3954 void socket_helper_send_private_command (int client, String command) {
3955 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3957 uint32 focused_context;
3958 get_focused_context (focused_client, focused_context);
3959 ClientInfo client_info = socket_get_client_info (focused_client);
3961 if (client_info.type == FRONTEND_CLIENT) {
3962 m_panel_agent_manager.send_private_command (focused_client, focused_context, command);
3965 //SCIM_TRANS_CMD_COMMIT_CONTENT
3966 void socket_helper_commit_content (int client, String content, String description, String mime_types) {
3967 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3969 uint32 focused_context;
3970 get_focused_context (focused_client, focused_context);
3971 ClientInfo client_info = socket_get_client_info (focused_client);
3973 if (client_info.type == FRONTEND_CLIENT) {
3974 m_panel_agent_manager.commit_content (focused_client, focused_context, content, description, mime_types);
3977 //ISM_TRANS_CMD_UPDATE_ISE_EXIT
3978 void UPDATE_ISE_EXIT (int client) {
3979 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3980 bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false);
3981 if (launch_ise_on_request && !m_refocus_needed && !m_reshow_needed)
3982 m_restart_needed = false;
3985 void process_key_event_done (KeyEvent &key, uint32 ret, uint32 serial) {
3987 uint32 focused_context;
3988 get_focused_context (focused_client, focused_context);
3989 ClientInfo client_info = socket_get_client_info (focused_client);
3991 if (client_info.type == FRONTEND_CLIENT) {
3992 m_panel_agent_manager.process_key_event_done (focused_client, focused_context, key, ret, serial);
3996 //ISM_TRANS_CMD_REQUEST_ISE_HIDE
3997 void request_ise_hide () {
3999 uint32 focused_context;
4000 get_focused_context (focused_client, focused_context);
4001 ClientInfo client_info = socket_get_client_info (focused_client);
4003 if (client_info.type == FRONTEND_CLIENT) {
4004 m_panel_agent_manager.request_ise_hide (focused_client, focused_context);
4008 void socket_reset_helper_input_context (const String& uuid, int client, uint32 context) {
4009 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4011 if (it != m_helper_client_index.end ()) {
4012 uint32 ctx = get_helper_ic (client, context);
4013 m_panel_agent_manager.reset_helper_context (it->second.id, ctx, uuid);
4017 bool helper_select_aux (uint32 item) {
4018 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_aux \n";
4020 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4021 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4023 if (it != m_helper_client_index.end ()) {
4027 get_focused_context (client, context);
4028 ctx = get_helper_ic (client, context);
4029 m_panel_agent_manager.select_aux (it->second.id, ctx, item);
4037 bool helper_select_candidate (uint32 item) {
4038 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_candidate \n";
4040 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4041 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4043 if (it != m_helper_client_index.end ()) {
4047 get_focused_context (client, context);
4048 ctx = get_helper_ic (client, context);
4049 m_panel_agent_manager.select_candidate (it->second.id, ctx, item);
4057 bool helper_lookup_table_page_up (void) {
4058 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_lookup_table_page_up \n";
4060 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4061 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4063 if (it != m_helper_client_index.end ()) {
4067 get_focused_context (client, context);
4068 ctx = get_helper_ic (client, context);
4069 m_panel_agent_manager.lookup_table_page_up (it->second.id, ctx);
4077 bool helper_lookup_table_page_down (void) {
4078 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_lookup_table_page_down \n";
4080 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4081 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4083 if (it != m_helper_client_index.end ()) {
4087 get_focused_context (client, context);
4088 ctx = get_helper_ic (client, context);
4089 m_panel_agent_manager.lookup_table_page_down (it->second.id, ctx);
4097 bool helper_update_lookup_table_page_size (uint32 size) {
4098 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_update_lookup_table_page_size \n";
4100 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4101 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4103 if (it != m_helper_client_index.end ()) {
4107 get_focused_context (client, context);
4108 ctx = get_helper_ic (client, context);
4109 m_panel_agent_manager.update_lookup_table_page_size (it->second.id, ctx, size);
4117 bool helper_update_candidate_item_layout (const std::vector<uint32>& row_items) {
4118 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4120 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4121 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4123 if (it != m_helper_client_index.end ()) {
4127 get_focused_context (client, context);
4128 ctx = get_helper_ic (client, context);
4129 m_panel_agent_manager.update_candidate_item_layout (it->second.id, ctx, row_items);
4137 bool helper_select_associate (uint32 item) {
4138 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_associate \n";
4140 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4141 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4143 if (it != m_helper_client_index.end ()) {
4147 get_focused_context (client, context);
4148 ctx = get_helper_ic (client, context);
4149 m_panel_agent_manager.select_associate (it->second.id, ctx, item);
4157 bool helper_associate_table_page_up (void) {
4158 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_associate_table_page_up \n";
4160 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4161 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4163 if (it != m_helper_client_index.end ()) {
4167 get_focused_context (client, context);
4168 ctx = get_helper_ic (client, context);
4169 m_panel_agent_manager.associate_table_page_up (it->second.id, ctx);
4177 bool helper_associate_table_page_down (void) {
4178 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_associate_table_page_down \n";
4180 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4181 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4183 if (it != m_helper_client_index.end ()) {
4187 get_focused_context (client, context);
4188 ctx = get_helper_ic (client, context);
4189 m_panel_agent_manager.associate_table_page_down (it->second.id, ctx);
4197 bool helper_update_associate_table_page_size (uint32 size) {
4198 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_update_associate_table_page_size \n";
4200 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4201 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4203 if (it != m_helper_client_index.end ()) {
4207 get_focused_context (client, context);
4208 ctx = get_helper_ic (client, context);
4209 m_panel_agent_manager.update_associate_table_page_size (it->second.id, ctx, size);
4217 bool helper_update_displayed_candidate_number (uint32 size) {
4218 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4220 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4221 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4223 if (it != m_helper_client_index.end ()) {
4227 get_focused_context (client, context);
4228 ctx = get_helper_ic (client, context);
4229 m_panel_agent_manager.update_displayed_candidate_number (it->second.id, ctx, size);
4237 bool helper_longpress_candidate (uint32 index) {
4238 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4240 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4241 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4243 if (it != m_helper_client_index.end ()) {
4247 get_focused_context (client, context);
4248 ctx = get_helper_ic (client, context);
4249 m_panel_agent_manager.send_longpress_event (it->second.id, ctx, index);
4254 std::cerr << __func__ << " is failed!!!\n";
4258 void helper_all_update_spot_location (int x, int y) {
4259 SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_spot_location (" << x << "," << y << ")\n";
4260 HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
4263 String uuid = get_focused_context (client, context);
4265 for (; hiit != m_helper_info_repository.end (); ++ hiit) {
4266 if (hiit->second.option & SCIM_HELPER_NEED_SPOT_LOCATION_INFO) {
4267 m_panel_agent_manager.helper_all_update_spot_location (hiit->first, get_helper_ic (client, context), uuid, x, y);
4272 void helper_all_update_cursor_position (int cursor_pos) {
4273 SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_cursor_position (" << cursor_pos << ")\n";
4274 HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
4277 String uuid = get_focused_context (client, context);
4279 for (; hiit != m_helper_info_repository.end (); ++ hiit) {
4280 m_panel_agent_manager.helper_all_update_cursor_position (hiit->first, get_helper_ic (client, context), uuid, cursor_pos);
4284 void helper_all_update_screen (int screen) {
4285 SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_screen (" << screen << ")\n";
4286 HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
4290 uuid = get_focused_context (client, context);
4292 for (; hiit != m_helper_info_repository.end (); ++ hiit) {
4293 if (hiit->second.option & SCIM_HELPER_NEED_SCREEN_INFO) {
4294 m_panel_agent_manager.helper_all_update_screen (hiit->first, get_helper_ic (client, context), uuid, screen);
4299 bool set_autocapital_type (int mode) {
4300 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4301 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
4302 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
4303 iseContext->autocapital_type = static_cast<Ecore_IMF_Autocapital_Type>(mode);
4305 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || (m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
4306 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4308 if (it != m_helper_client_index.end ()) {
4312 get_focused_context (client, context);
4313 ctx = get_helper_ic (client, context);
4314 m_panel_agent_manager.set_autocapital_type (it->second.id, ctx, m_current_helper_uuid, mode);
4319 std::cerr << __func__ << " is failed!!!\n";
4323 bool set_prediction_allow (int client, int mode) {
4324 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4325 if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
4326 Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
4327 iseContext->prediction_allow = static_cast<Eina_Bool>(mode);
4329 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || (m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
4330 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4332 if (it != m_helper_client_index.end ()) {
4334 uint32 focused_context;
4336 get_focused_context (focused_client, focused_context);
4337 ctx = get_helper_ic (focused_client, focused_context);
4338 m_panel_agent_manager.set_prediction_allow (it->second.id, ctx, m_current_helper_uuid, mode);
4343 std::cerr << __func__ << " is failed!!!\n";
4347 const String& get_focused_context (int& client, uint32& context, bool force_last_context = false) const {
4348 if (m_current_socket_client >= 0) {
4349 client = m_current_socket_client;
4350 context = m_current_client_context;
4351 return m_current_context_uuid;
4353 client = m_last_socket_client;
4354 context = m_last_client_context;
4355 return m_last_context_uuid;
4360 void socket_transaction_start (void) {
4361 m_signal_transaction_start ();
4364 void socket_transaction_end (void) {
4365 m_signal_transaction_end ();
4371 void unlock (void) {
4376 InfoManager::InfoManager ()
4377 : m_impl (new InfoManagerImpl ())
4381 InfoManager::~InfoManager ()
4387 InfoManager::initialize (InfoManager* info_manager, const ConfigPointer& config, const String& display, bool resident)
4389 return m_impl->initialize (info_manager, config, display, resident);
4393 InfoManager::valid (void) const
4395 return m_impl->valid ();
4399 InfoManager::stop (void)
4406 InfoManager::socket_get_client_info (int client) const
4408 return m_impl->socket_get_client_info (client);
4411 void InfoManager::hide_helper (const String& uuid)
4413 m_impl->hide_helper (uuid);
4416 InfoManager::get_current_toolbar_mode () const
4418 return m_impl->get_current_toolbar_mode ();
4422 InfoManager::get_current_ise_geometry (rectinfo& rect)
4424 m_impl->get_current_ise_geometry (rect);
4428 InfoManager::get_current_helper_uuid () const
4430 return m_impl->get_current_helper_uuid ();
4434 InfoManager::get_current_ise_name () const
4436 return m_impl->get_current_ise_name ();
4440 InfoManager::set_current_toolbar_mode (TOOLBAR_MODE_T mode)
4442 m_impl->set_current_toolbar_mode (mode);
4446 InfoManager::set_current_ise_name (String& name)
4448 m_impl->set_current_ise_name (name);
4452 InfoManager::set_current_helper_option (uint32 option)
4454 m_impl->set_current_helper_option (option);
4458 InfoManager::update_candidate_panel_event (uint32 nType, uint32 nValue)
4460 m_impl->update_panel_event (ISM_TRANS_CMD_UPDATE_ISF_CANDIDATE_PANEL, nType, nValue);
4464 InfoManager::update_input_panel_event (uint32 nType, uint32 nValue)
4466 m_impl->update_panel_event (ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT, nType, nValue);
4470 InfoManager::move_preedit_caret (uint32 position)
4472 return m_impl->move_preedit_caret (position);
4478 InfoManager::request_help (void)
4480 return m_impl->request_help ();
4484 InfoManager::request_factory_menu (void)
4486 return m_impl->request_factory_menu ();
4491 InfoManager::change_factory (const String& uuid)
4493 return m_impl->change_factory (uuid);
4497 InfoManager::helper_candidate_show (void)
4499 return m_impl->helper_candidate_show ();
4503 InfoManager::helper_candidate_hide (void)
4505 return m_impl->helper_candidate_hide ();
4509 InfoManager::candidate_more_window_show (void)
4511 return m_impl->candidate_more_window_show ();
4515 InfoManager::candidate_more_window_hide (void)
4517 return m_impl->candidate_more_window_hide ();
4521 InfoManager::update_helper_lookup_table (const LookupTable& table)
4523 return m_impl->update_helper_lookup_table (table);
4527 InfoManager::select_aux (uint32 item)
4529 return m_impl->select_aux (item);
4533 InfoManager::select_candidate (uint32 item)
4535 return m_impl->select_candidate (item);
4539 InfoManager::lookup_table_page_up (void)
4541 return m_impl->lookup_table_page_up ();
4545 InfoManager::lookup_table_page_down (void)
4547 return m_impl->lookup_table_page_down ();
4551 InfoManager::update_lookup_table_page_size (uint32 size)
4553 return m_impl->update_lookup_table_page_size (size);
4557 InfoManager::update_candidate_item_layout (const std::vector<uint32>& row_items)
4559 return m_impl->update_candidate_item_layout (row_items);
4563 InfoManager::select_associate (uint32 item)
4565 return m_impl->select_associate (item);
4569 InfoManager::associate_table_page_up (void)
4571 return m_impl->associate_table_page_up ();
4575 InfoManager::associate_table_page_down (void)
4577 return m_impl->associate_table_page_down ();
4581 InfoManager::update_associate_table_page_size (uint32 size)
4583 return m_impl->update_associate_table_page_size (size);
4587 InfoManager::update_displayed_candidate_number (uint32 size)
4589 return m_impl->update_displayed_candidate_number (size);
4593 InfoManager::send_longpress_event (int type, int index)
4595 m_impl->send_longpress_event (type, index);
4599 InfoManager::trigger_property (const String& property)
4601 return m_impl->trigger_property (property);
4605 InfoManager::start_helper (const String& uuid)
4607 return m_impl->start_helper (uuid, -2, 0);
4611 InfoManager::stop_helper (const String& uuid)
4613 return m_impl->stop_helper (uuid, -2, 0);
4617 InfoManager::set_default_ise (const DEFAULT_ISE_T& ise)
4619 m_impl->set_default_ise (ise);
4623 InfoManager::set_should_shared_ise (const bool should_shared_ise)
4625 m_impl->set_should_shared_ise (should_shared_ise);
4629 //InfoManager::reload_config (void)
4631 // m_impl->reload_config ();
4635 InfoManager::exit (void)
4637 return m_impl->exit ();
4640 InfoManager::update_ise_list (std::vector<String>& strList)
4642 m_impl->update_ise_list (strList);
4646 InfoManager::remoteinput_update_preedit_string (WideString str, AttributeList &attrs, uint32 caret)
4648 return m_impl->remoteinput_update_preedit_string (str, attrs, caret);
4652 InfoManager::remoteinput_commit_string (const WideString &str)
4654 return m_impl->remoteinput_commit_string (str);
4658 InfoManager::remoteinput_send_key_event (const KeyEvent &key)
4660 return m_impl->remoteinput_send_key_event (key);
4664 InfoManager::remoteinput_forward_key_event (const KeyEvent &key)
4666 return m_impl->remoteinput_forward_key_event (key);
4670 InfoManager::remoteinput_delete_surrounding_text (uint32 offset, uint32 len)
4672 return m_impl->remoteinput_delete_surrounding_text (offset, len);
4675 /////////////////////////////////Message function begin/////////////////////////////////////////
4677 //ISM_TRANS_CMD_PANEL_RESET_KEYBOARD_ISE
4678 bool InfoManager:: reset_keyboard_ise (void)
4680 return m_impl->reset_keyboard_ise ();
4683 //ISM_TRANS_CMD_SHOW_ISF_CONTROL
4684 void InfoManager::show_isf_panel (int client_id)
4686 m_impl->show_isf_panel (client_id);
4689 //ISM_TRANS_CMD_HIDE_ISF_CONTROL
4690 void InfoManager::hide_isf_panel (int client_id)
4692 m_impl->hide_isf_panel (client_id);
4695 //ISM_TRANS_CMD_SHOW_ISE_PANEL
4696 void InfoManager::show_ise_panel (int client_id, uint32 client, uint32 context, char* data, size_t len)
4698 m_impl->show_ise_panel (client_id, client, context, data, len);
4701 //ISM_TRANS_CMD_HIDE_ISE_PANEL
4702 void InfoManager::hide_ise_panel (int client_id, uint32 client, uint32 context)
4704 m_impl->hide_ise_panel (client_id, client, context);
4707 //ISM_TRANS_CMD_HIDE_ISE_PANEL from ISF control
4708 void InfoManager::hide_helper_ise (void)
4710 m_impl->hide_helper_ise ();
4713 //ISM_TRANS_CMD_LAUNCH_ISE from ISF control
4714 void InfoManager::prelaunch_helper_ise (void)
4716 m_impl->prelaunch_helper_ise ();
4719 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
4720 bool InfoManager::process_key_event (KeyEvent& key, uint32 serial)
4722 return m_impl->process_key_event (key, serial);
4725 //ISM_TRANS_CMD_GET_ACTIVE_ISE_GEOMETRY
4726 void InfoManager::get_input_panel_geometry (int client_id, _OUT_ struct rectinfo& info)
4728 m_impl->get_input_panel_geometry (client_id, info);
4731 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
4732 void InfoManager::get_candidate_window_geometry (int client_id, _OUT_ struct rectinfo& info)
4734 m_impl->get_candidate_window_geometry (client_id, info);
4737 //ISM_TRANS_CMD_GET_ISE_LANGUAGE_LOCALE
4738 void InfoManager::get_ise_language_locale (int client_id, _OUT_ char** data, _OUT_ size_t& len)
4740 m_impl->get_ise_language_locale (client_id, data, len);
4743 //ISM_TRANS_CMD_SET_LAYOUT
4744 void InfoManager::set_ise_layout (int client_id, uint32 layout)
4746 m_impl->set_ise_layout (client_id, layout);
4749 //ISM_TRANS_CMD_SET_INPUT_MODE
4750 void InfoManager::set_ise_input_mode (int client_id, uint32 input_mode)
4752 m_impl->set_ise_input_mode (client_id, input_mode);
4755 //ISM_TRANS_CMD_SET_INPUT_HINT
4756 void InfoManager::set_ise_input_hint (int client_id, uint32 input_hint)
4758 m_impl->set_ise_input_hint (client_id, input_hint);
4761 //ISM_TRANS_CMD_UPDATE_BIDI_DIRECTION
4762 void InfoManager::update_ise_bidi_direction (int client_id, uint32 bidi_direction)
4764 m_impl->update_ise_bidi_direction (client_id, bidi_direction);
4768 //ISM_TRANS_CMD_SET_ISE_LANGUAGE
4769 void InfoManager::set_ise_language (int client_id, uint32 language)
4771 m_impl->set_ise_language (client_id, language);
4774 //ISM_TRANS_CMD_SET_ISE_IMDATA
4775 void InfoManager::set_ise_imdata (int client_id, const char* imdata, size_t len)
4777 m_impl->set_ise_imdata (client_id, imdata, len);
4780 //ISM_TRANS_CMD_GET_ISE_IMDATA
4781 bool InfoManager:: get_ise_imdata (int client_id, _OUT_ char** imdata, _OUT_ size_t& len)
4783 return m_impl->get_ise_imdata (client_id, imdata, len);
4786 //ISM_TRANS_CMD_GET_LAYOUT
4787 bool InfoManager:: get_ise_layout (int client_id, _OUT_ uint32& layout)
4789 return m_impl->get_ise_layout (client_id, layout);
4792 //ISM_TRANS_CMD_GET_ISE_STATE
4793 void InfoManager::get_ise_state (int client_id, _OUT_ int& state)
4795 m_impl->get_ise_state (client_id, state);
4798 //ISM_TRANS_CMD_GET_ACTIVE_ISE
4799 void InfoManager::get_active_ise (int client_id, _OUT_ String& default_uuid)
4801 m_impl->get_active_ise (client_id, default_uuid);
4804 //ISM_TRANS_CMD_GET_ISE_LIST
4805 void InfoManager::get_ise_list (int client_id, _OUT_ std::vector<String>& strlist)
4807 m_impl->get_ise_list (client_id, strlist);
4811 //ISM_TRANS_CMD_GET_ALL_HELPER_ISE_INFO
4812 void InfoManager::get_all_helper_ise_info (int client_id, _OUT_ HELPER_ISE_INFO& info)
4814 m_impl->get_all_helper_ise_info (client_id, info);
4817 //ISM_TRANS_CMD_SET_ENABLE_HELPER_ISE_INFO
4818 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4819 void InfoManager::set_enable_helper_ise_info (int client_id, String appid, uint32 is_enabled)
4821 m_impl->set_enable_helper_ise_info (client_id, appid, is_enabled);
4824 //ISM_TRANS_CMD_SHOW_HELPER_ISE_LIST
4825 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4826 void InfoManager::show_helper_ise_list (int client_id)
4828 m_impl->show_helper_ise_list (client_id);
4832 //ISM_TRANS_CMD_SHOW_HELPER_ISE_SELECTOR
4833 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4834 void InfoManager::show_helper_ise_selector (int client_id)
4836 m_impl->show_helper_ise_selector (client_id);
4839 //ISM_TRANS_CMD_IS_HELPER_ISE_ENABLED
4841 void InfoManager::is_helper_ise_enabled (int client_id, String strAppid, _OUT_ uint32& nEnabled)
4843 m_impl->is_helper_ise_enabled (client_id, strAppid, nEnabled);
4846 //ISM_TRANS_CMD_GET_ISE_INFORMATION
4847 void InfoManager::get_ise_information (int client_id, String strUuid, _OUT_ String& strName, _OUT_ String& strLanguage,
4848 _OUT_ int& nType, _OUT_ int& nOption, _OUT_ String& strModuleName)
4850 m_impl->get_ise_information (client_id, strUuid, strName, strLanguage, nType, nOption, strModuleName);
4853 //ISM_TRANS_CMD_RESET_ISE_OPTION
4854 //reply SCIM_TRANS_CMD_OK
4855 bool InfoManager:: reset_ise_option (int client_id)
4857 return m_impl->reset_ise_option (client_id);
4860 //ISM_TRANS_CMD_SET_ACTIVE_ISE_BY_UUID
4862 bool InfoManager:: set_active_ise_by_uuid (int client_id, char* buf, size_t len)
4864 return m_impl->set_active_ise_by_uuid (client_id, buf, len);
4867 //ISM_TRANS_CMD_SET_INITIAL_ISE_BY_UUID
4868 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4869 void InfoManager::set_initial_ise_by_uuid (int client_id, char* buf, size_t len)
4871 m_impl->set_initial_ise_by_uuid (client_id, buf, len);
4874 //ISM_TRANS_CMD_SET_RETURN_KEY_TYPE
4875 void InfoManager::set_ise_return_key_type (int client_id, uint32 type)
4877 m_impl->set_ise_return_key_type (client_id, type);
4880 //ISM_TRANS_CMD_GET_RETURN_KEY_TYPE
4882 bool InfoManager:: get_ise_return_key_type (int client_id, _OUT_ uint32& type)
4884 return m_impl->get_ise_return_key_type (client_id, type);
4888 //ISM_TRANS_CMD_SET_RETURN_KEY_DISABLE
4889 void InfoManager::set_ise_return_key_disable (int client_id, uint32 disabled)
4891 m_impl->set_ise_return_key_disable (client_id, disabled);
4894 //ISM_TRANS_CMD_GET_RETURN_KEY_DISABLE
4895 bool InfoManager::get_ise_return_key_disable (int client_id, _OUT_ uint32& disabled)
4897 return m_impl->get_ise_return_key_disable (client_id, disabled);
4900 //ISM_TRANS_CMD_SET_CAPS_MODE
4901 void InfoManager::set_ise_caps_mode (int client_id, uint32 mode)
4903 m_impl->set_ise_caps_mode (client_id, mode);
4906 //SCIM_TRANS_CMD_RELOAD_CONFIG
4907 void InfoManager::reload_config (void)
4909 m_impl->reload_config ();
4912 //ISM_TRANS_CMD_SEND_WILL_SHOW_ACK
4913 void InfoManager::will_show_ack (int client_id)
4915 m_impl->will_show_ack (client_id);
4918 //ISM_TRANS_CMD_SEND_WILL_HIDE_ACK
4919 void InfoManager::will_hide_ack (int client_id)
4921 m_impl->will_hide_ack (client_id);
4924 //ISM_TRANS_CMD_RESET_DEFAULT_ISE
4925 void InfoManager::reset_default_ise (int client_id)
4927 m_impl->reset_default_ise (client_id);
4930 //ISM_TRANS_CMD_SET_HARDWARE_KEYBOARD_MODE
4931 void InfoManager::set_keyboard_mode (int client_id, uint32 mode)
4933 m_impl->set_keyboard_mode (client_id, mode);
4936 //ISM_TRANS_CMD_SEND_CANDIDATE_WILL_HIDE_ACK
4937 void InfoManager::candidate_will_hide_ack (int client_id)
4939 m_impl->candidate_will_hide_ack (client_id);
4942 //ISM_TRANS_CMD_GET_ACTIVE_HELPER_OPTION
4943 void InfoManager::get_active_helper_option (int client_id, _OUT_ uint32& option)
4945 m_impl->get_active_helper_option (client_id, option);
4948 //ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW
4949 void InfoManager::show_ise_option_window (int client_id)
4951 m_impl->show_ise_option_window (client_id);
4954 //ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW
4955 void InfoManager::resume_ise_option_window (int client_id)
4957 m_impl->resume_ise_option_window (client_id);
4960 //ISM_TRANS_CMD_SET_KEYBOARD_MODE
4961 void InfoManager::set_ise_keyboard_mode (int client_id, uint32 mode)
4963 m_impl->set_ise_keyboard_mode (client_id, mode);
4966 //ISM_TRANS_CMD_SET_PREDICTION_HINT
4967 void InfoManager::set_prediction_hint (int client_id, String prediction_hint)
4969 m_impl->set_prediction_hint (client_id, prediction_hint);
4972 //ISM_TRANS_CMD_SET_MIME_TYPE
4973 void InfoManager::set_ise_mime_type (int client_id, String mime_type)
4975 m_impl->set_ise_mime_type (client_id, mime_type);
4978 //ISM_TRANS_CMD_FINALIZE_CONTENT
4979 void InfoManager::finalize_content (int client_id, String text, uint32 cursor_pos)
4981 m_impl->finalize_content (client_id, text, cursor_pos);
4984 //ISM_TRANS_CMD_SET_PREDICTION_HINT_DATA
4985 void InfoManager::set_prediction_hint_data (int client_id, String key, String value)
4987 m_impl->set_prediction_hint_data (client_id, key, value);
4990 //ISM_TRANS_CMD_SET_OPTIMIZATION_HINT
4991 void InfoManager::set_optimization_hint(int client_id, uint32 hint)
4993 m_impl->set_optimization_hint(client_id, hint);
4996 //ISM_TRANS_CMD_EXPAND_CANDIDATE
4997 void InfoManager::expand_candidate ()
4999 m_impl->expand_candidate ();
5002 //ISM_TRANS_CMD_CONTRACT_CANDIDATE
5003 void InfoManager::contract_candidate ()
5005 m_impl->contract_candidate ();
5008 //ISM_TRANS_CMD_GET_RECENT_ISE_GEOMETRY
5009 void InfoManager::get_recent_ise_geometry (int client_id, uint32 angle, _OUT_ struct rectinfo& info)
5011 m_impl->get_recent_ise_geometry (client_id, angle, info);
5014 //ISM_TRANS_CMD_SEND_REMOTE_INPUT_MESSAGE
5015 bool InfoManager::remoteinput_send_input_message (int client_id, char* buf, size_t len)
5017 return m_impl->send_remote_input_message (client_id, buf, len);
5020 void InfoManager::remoteinput_send_surrounding_text (const char* text, uint32 cursor)
5022 return m_impl->send_remote_surrounding_text (text, cursor);
5025 //ISM_TRANS_CMD_REGISTER_PANEL_CLIENT
5026 void InfoManager::register_panel_client (uint32 client_id, uint32 id)
5028 m_impl->register_panel_client (client_id, id);
5031 //SCIM_TRANS_CMD_PANEL_REGISTER_INPUT_CONTEXT
5032 void InfoManager::register_input_context (uint32 client_id, uint32 context, String uuid)
5034 m_impl->register_input_context (client_id, context, uuid);
5037 //SCIM_TRANS_CMD_PANEL_REMOVE_INPUT_CONTEXT
5038 void InfoManager::remove_input_context (uint32 client_id, uint32 context)
5040 m_impl->remove_input_context (client_id, context);
5043 //SCIM_TRANS_CMD_PANEL_RESET_INPUT_CONTEXT
5044 void InfoManager::socket_reset_input_context (int client_id, uint32 context)
5046 m_impl->socket_reset_input_context (client_id, context);
5049 //SCIM_TRANS_CMD_FOCUS_IN
5050 void InfoManager::focus_in (int client_id, uint32 context, String uuid)
5052 m_impl->focus_in (client_id, context, uuid);
5055 //SCIM_TRANS_CMD_FOCUS_OUT
5056 void InfoManager::focus_out (int client_id, uint32 context)
5058 m_impl->focus_out (client_id, context);
5061 //ISM_TRANS_CMD_PROCESS_INPUT_DEVICE_EVENT
5062 bool InfoManager::process_input_device_event(int client, uint32 type, const char *data, size_t len, _OUT_ uint32& result)
5064 return m_impl->process_input_device_event(client, type, data, len, result);
5067 //ISM_TRANS_CMD_TURN_ON_LOG
5068 void InfoManager::socket_turn_on_log (uint32 isOn)
5070 m_impl->socket_turn_on_log (isOn);
5073 //SCIM_TRANS_CMD_PANEL_TURN_ON
5074 void InfoManager::socket_turn_on (void)
5076 m_impl->socket_turn_on ();
5079 //SCIM_TRANS_CMD_PANEL_TURN_OFF
5080 void InfoManager::socket_turn_off (void)
5082 m_impl->socket_turn_off ();
5085 //SCIM_TRANS_CMD_UPDATE_SCREEN
5086 void InfoManager::socket_update_screen (int client_id, uint32 num)
5088 m_impl->socket_update_screen (client_id, num);
5091 //SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
5092 void InfoManager::socket_update_spot_location (uint32 x, uint32 y, uint32 top_y)
5094 m_impl->socket_update_spot_location (x, y, top_y);
5097 //ISM_TRANS_CMD_UPDATE_CURSOR_POSITION
5098 void InfoManager::socket_update_cursor_position (uint32 cursor_pos)
5100 m_impl->socket_update_cursor_position (cursor_pos);
5103 //ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT
5104 void InfoManager::socket_update_surrounding_text (String text, uint32 cursor)
5106 m_impl->socket_update_surrounding_text (text, cursor);
5109 void InfoManager::remoteinput_callback_focus_in (void)
5111 m_impl->remoteinput_callback_focus_in ();
5114 void InfoManager::remoteinput_callback_focus_out (void)
5116 m_impl->remoteinput_callback_focus_out ();
5119 void InfoManager::remoteinput_callback_entry_metadata (uint32 hint, uint32 layout, int variation, uint32 autocapital_type, int return_key_disabled)
5121 m_impl->remoteinput_callback_entry_metadata (hint, layout, variation, autocapital_type, return_key_disabled);
5124 void InfoManager::remoteinput_callback_surrounding_text (String text, uint32 cursor)
5126 m_impl->remoteinput_callback_surrounding_text (text, cursor);
5129 void InfoManager::remoteinput_callback_input_resource (uint32 input_resource)
5131 m_impl->remoteinput_callback_input_resource (input_resource);
5134 //ISM_TRANS_CMD_UPDATE_SELECTION
5135 void InfoManager::socket_update_selection (String text)
5137 m_impl->socket_update_selection (text);
5140 //FIXME: useless anymore
5141 //SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO
5142 void InfoManager::socket_update_factory_info (PanelFactoryInfo& info)
5144 m_impl->socket_update_factory_info (info);
5147 //SCIM_TRANS_CMD_PANEL_SHOW_HELP
5148 void InfoManager::socket_show_help (String help)
5150 m_impl->socket_show_help (help);
5153 //SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU
5154 void InfoManager::socket_show_factory_menu (std::vector <PanelFactoryInfo>& vec)
5156 m_impl->socket_show_factory_menu (vec);
5159 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
5160 void InfoManager::socket_show_preedit_string (void)
5162 m_impl->socket_show_preedit_string ();
5165 //SCIM_TRANS_CMD_SHOW_AUX_STRING
5166 void InfoManager::socket_show_aux_string (void)
5168 m_impl->socket_show_aux_string ();
5171 //SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE
5172 void InfoManager::socket_show_lookup_table (void)
5174 m_impl->socket_show_lookup_table ();
5177 //ISM_TRANS_CMD_SHOW_ASSOCIATE_TABLE
5178 void InfoManager::socket_show_associate_table (void)
5180 m_impl->socket_show_associate_table ();
5183 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
5184 void InfoManager::socket_hide_preedit_string (void)
5186 m_impl->socket_hide_preedit_string ();
5189 //SCIM_TRANS_CMD_HIDE_AUX_STRING
5190 void InfoManager::socket_hide_aux_string (void)
5192 m_impl->socket_hide_aux_string ();
5195 //SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE
5196 void InfoManager::socket_hide_lookup_table (void)
5198 m_impl->socket_hide_lookup_table ();
5201 //ISM_TRANS_CMD_HIDE_ASSOCIATE_TABLE
5202 void InfoManager::socket_hide_associate_table (void)
5204 m_impl->socket_hide_associate_table ();
5207 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
5208 void InfoManager::socket_update_preedit_string (String& str, const AttributeList& attrs, uint32 caret)
5210 m_impl->socket_update_preedit_string (str, attrs, caret);
5213 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
5214 void InfoManager::socket_update_preedit_caret (uint32 caret)
5216 m_impl->socket_update_preedit_caret (caret);
5219 //ISM_TRANS_CMD_RECAPTURE_STRING
5220 void InfoManager::socket_recapture_string (int offset, int len, String& preedit, String& commit, const AttributeList& attrs)
5222 m_impl->socket_recapture_string (offset, len, preedit, commit, attrs);
5225 //SCIM_TRANS_CMD_UPDATE_AUX_STRING
5226 void InfoManager::socket_update_aux_string (String& str, const AttributeList& attrs)
5228 m_impl->socket_update_aux_string (str, attrs);
5231 //SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE
5232 void InfoManager::socket_update_lookup_table (const LookupTable& table)
5234 m_impl->socket_update_lookup_table (table);
5237 //ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE
5238 void InfoManager::socket_update_associate_table (const LookupTable& table)
5240 m_impl->socket_update_associate_table (table);
5243 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
5244 void InfoManager::socket_register_properties (const PropertyList& properties)
5246 m_impl->socket_register_properties (properties);
5249 //SCIM_TRANS_CMD_UPDATE_PROPERTY
5250 void InfoManager::socket_update_property (const Property& property)
5252 m_impl->socket_update_property (property);
5255 //ISM_TRANS_CMD_GET_KEYBOARD_ISE_LIST
5256 void InfoManager::socket_get_keyboard_ise_list (String& uuid)
5258 m_impl->socket_get_keyboard_ise_list (uuid);
5261 //ISM_TRANS_CMD_SET_CANDIDATE_UI
5262 void InfoManager::socket_set_candidate_ui (uint32 portrait_line, uint32 mode)
5264 m_impl->socket_set_candidate_ui (portrait_line, mode);
5267 //ISM_TRANS_CMD_GET_CANDIDATE_UI
5268 void InfoManager::socket_get_candidate_ui (String uuid)
5270 m_impl->socket_get_candidate_ui (uuid);
5273 //ISM_TRANS_CMD_SET_CANDIDATE_POSITION
5274 void InfoManager::socket_set_candidate_position (uint32 left, uint32 top)
5276 m_impl->socket_set_candidate_position (left, top);
5279 //ISM_TRANS_CMD_HIDE_CANDIDATE
5280 void InfoManager::socket_hide_candidate (void)
5282 m_impl->socket_hide_candidate ();
5285 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
5286 void InfoManager::socket_get_candidate_geometry (String& uuid)
5288 m_impl->socket_get_candidate_geometry (uuid);
5291 //ISM_TRANS_CMD_SET_KEYBOARD_ISE_BY_UUID
5292 void InfoManager::socket_set_keyboard_ise (String uuid)
5294 m_impl->socket_set_keyboard_ise (uuid);
5297 //ISM_TRANS_CMD_SELECT_CANDIDATE
5298 void InfoManager::socket_helper_select_candidate (uint32 index)
5300 m_impl->socket_helper_select_candidate (index);
5303 //ISM_TRANS_CMD_UPDATE_ISE_GEOMETRY
5304 void InfoManager::socket_helper_update_ise_geometry (int client, uint32 x, uint32 y, uint32 width, uint32 height)
5306 m_impl->socket_helper_update_ise_geometry (client, x, y, width, height);
5309 //ISM_TRANS_CMD_GET_KEYBOARD_ISE
5310 void InfoManager::socket_get_keyboard_ise (String uuid)
5312 m_impl->socket_get_keyboard_ise (uuid);
5315 //SCIM_TRANS_CMD_START_HELPER
5316 void InfoManager::socket_start_helper (int client_id, uint32 context, String uuid)
5318 m_impl->socket_start_helper (client_id, context, uuid);
5321 //SCIM_TRANS_CMD_STOP_HELPER
5322 void InfoManager::socket_stop_helper (int client_id, uint32 context, String uuid)
5324 m_impl->socket_stop_helper (client_id, context, uuid);
5327 //SCIM_TRANS_CMD_SEND_HELPER_EVENT
5328 void InfoManager::socket_send_helper_event (int client_id, uint32 context, String uuid, const Transaction& _nest_trans)
5330 m_impl->socket_send_helper_event (client_id, context, uuid, _nest_trans);
5333 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
5334 void InfoManager::socket_helper_register_properties (int client, PropertyList& properties)
5336 m_impl->socket_helper_register_properties (client, properties);
5339 //SCIM_TRANS_CMD_UPDATE_PROPERTY
5340 void InfoManager::socket_helper_update_property (int client, Property& property)
5342 m_impl->socket_helper_update_property (client, property);
5345 //SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT
5346 void InfoManager::socket_helper_send_imengine_event (int client, uint32 target_ic, String target_uuid , Transaction& nest_trans)
5348 m_impl->socket_helper_send_imengine_event (client, target_ic, target_uuid, nest_trans);
5351 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
5352 //SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT
5353 void InfoManager::socket_helper_send_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key)
5355 m_impl->socket_helper_send_key_event (client, target_ic, target_uuid, key);
5358 //SCIM_TRANS_CMD_FORWARD_KEY_EVENT
5359 void InfoManager::socket_helper_forward_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key)
5361 m_impl->socket_helper_forward_key_event (client, target_ic, target_uuid, key);
5364 //SCIM_TRANS_CMD_COMMIT_STRING
5365 void InfoManager::socket_helper_commit_string (int client, uint32 target_ic, String target_uuid, WideString wstr)
5367 m_impl->socket_helper_commit_string (client, target_ic, target_uuid, wstr);
5370 //SCIM_TRANS_CMD_GET_SURROUNDING_TEXT
5371 void InfoManager::socket_helper_get_surrounding_text (int client, String uuid, uint32 maxlen_before, uint32 maxlen_after)
5373 m_impl->socket_helper_get_surrounding_text (client, uuid, maxlen_before, maxlen_after);
5376 //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT
5377 void InfoManager::socket_helper_delete_surrounding_text (int client, uint32 offset, uint32 len)
5379 m_impl->socket_helper_delete_surrounding_text (client, offset, len);
5382 //SCIM_TRANS_CMD_GET_SELECTION
5383 void InfoManager::socket_helper_get_selection (int client, String uuid)
5385 m_impl->socket_helper_get_selection (client, uuid);
5388 //SCIM_TRANS_CMD_SET_SELECTION
5389 void InfoManager::socket_helper_set_selection (int client, uint32 start, uint32 end)
5391 m_impl->socket_helper_set_selection (client, start, end);
5394 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
5395 void InfoManager::socket_helper_show_preedit_string (int client, uint32 target_ic, String target_uuid)
5397 m_impl->socket_helper_show_preedit_string (client, target_ic, target_uuid);
5400 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
5401 void InfoManager::socket_helper_hide_preedit_string (int client, uint32 target_ic, String target_uuid)
5403 m_impl->socket_helper_hide_preedit_string (client, target_ic, target_uuid);
5406 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
5407 void InfoManager::socket_helper_update_preedit_string (int client, uint32 target_ic, String target_uuid, WideString preedit,
5408 WideString commit, AttributeList& attrs, uint32 caret)
5410 m_impl->socket_helper_update_preedit_string (client, target_ic, target_uuid, preedit, commit, attrs, caret);
5413 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
5414 void InfoManager::socket_helper_update_preedit_caret (int client, uint32 caret)
5416 m_impl->socket_helper_update_preedit_caret (client, caret);
5419 //ISM_TRANS_CMD_RECAPTURE_STRING
5420 void InfoManager::socket_helper_recapture_string (int client, uint32 target_ic, String target_uuid, int offset, int len, WideString preedit,
5421 WideString commit, AttributeList& attrs)
5423 m_impl->socket_helper_recapture_string (client, target_ic, target_uuid, offset, len, preedit, commit, attrs);
5426 //SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
5427 void InfoManager::socket_helper_register_helper (int client, HelperInfo& info)
5429 m_impl->socket_helper_register_helper (client, info);
5432 //SCIM_TRANS_CMD_PANEL_REGISTER_ACTIVE_HELPER
5433 void InfoManager::socket_helper_register_helper_passive (int client, HelperInfo& info)
5435 m_impl->socket_helper_register_helper_passive (client, info);
5438 //ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
5439 void InfoManager::socket_helper_update_input_context (int client, uint32 type, uint32 value)
5441 m_impl->socket_helper_update_input_context (client, type, value);
5444 //ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE
5445 void InfoManager::socket_helper_update_language_locale(int client, String locale)
5447 m_impl->socket_helper_update_language_locale(client, locale);
5450 //SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
5451 void InfoManager::socket_helper_send_private_command (int client, String command)
5453 m_impl->socket_helper_send_private_command (client, command);
5456 //SCIM_TRANS_CMD_COMMIT_CONTENT
5457 void InfoManager::socket_helper_commit_content (int client, String content, String description, String mime_types)
5459 m_impl->socket_helper_commit_content (client, content, description, mime_types);
5462 //ISM_TRANS_CMD_UPDATE_ISE_EXIT
5463 void InfoManager::UPDATE_ISE_EXIT (int client)
5465 m_impl->UPDATE_ISE_EXIT (client);
5468 //ISM_TRANS_CMD_PROCESS_KEY_EVENT_DONE
5469 void InfoManager::process_key_event_done (KeyEvent &key, uint32 ret, uint32 serial)
5471 m_impl->process_key_event_done (key, ret, serial);
5474 //ISM_TRANS_CMD_REQUEST_ISE_HIDE
5475 void InfoManager::request_ise_hide ()
5477 m_impl->request_ise_hide ();
5480 bool InfoManager::check_privilege_by_sockfd (int client_id, const String& privilege) {
5481 return m_impl->check_privilege_by_sockfd (client_id, privilege);
5484 void InfoManager::add_client (int client_id, uint32 key, ClientType type)
5486 m_impl->add_client (client_id, key, type);
5489 void InfoManager::del_client (int client_id)
5491 m_impl->del_client (client_id);
5494 bool InfoManager::set_autocapital_type (int mode)
5496 return m_impl->set_autocapital_type (mode);
5499 void InfoManager::set_prediction_allow (int client, bool mode)
5501 m_impl->set_prediction_allow (client, mode);
5504 void InfoManager::reshow_input_panel ()
5506 m_impl->reshow_input_panel ();
5509 //////////////////////////////////Message function end/////////////////////////////////////////
5512 InfoManager::signal_connect_turn_on (InfoManagerSlotVoid* slot)
5514 return m_impl->signal_connect_turn_on (slot);
5518 InfoManager::signal_connect_turn_off (InfoManagerSlotVoid* slot)
5520 return m_impl->signal_connect_turn_off (slot);
5524 InfoManager::signal_connect_show_panel (InfoManagerSlotVoid* slot)
5526 return m_impl->signal_connect_show_panel (slot);
5530 InfoManager::signal_connect_hide_panel (InfoManagerSlotVoid* slot)
5532 return m_impl->signal_connect_hide_panel (slot);
5536 InfoManager::signal_connect_update_screen (InfoManagerSlotInt* slot)
5538 return m_impl->signal_connect_update_screen (slot);
5542 InfoManager::signal_connect_update_spot_location (InfoManagerSlotIntIntInt* slot)
5544 return m_impl->signal_connect_update_spot_location (slot);
5548 InfoManager::signal_connect_update_factory_info (InfoManagerSlotFactoryInfo* slot)
5550 return m_impl->signal_connect_update_factory_info (slot);
5554 InfoManager::signal_connect_start_default_ise (InfoManagerSlotVoid* slot)
5556 return m_impl->signal_connect_start_default_ise (slot);
5560 InfoManager::signal_connect_stop_default_ise (InfoManagerSlotVoid* slot)
5562 return m_impl->signal_connect_stop_default_ise (slot);
5566 InfoManager::signal_connect_set_candidate_ui (InfoManagerSlotIntInt* slot)
5568 return m_impl->signal_connect_set_candidate_ui (slot);
5572 InfoManager::signal_connect_get_candidate_ui (InfoManagerSlotIntInt2* slot)
5574 return m_impl->signal_connect_get_candidate_ui (slot);
5578 InfoManager::signal_connect_set_candidate_position (InfoManagerSlotIntInt* slot)
5580 return m_impl->signal_connect_set_candidate_position (slot);
5584 InfoManager::signal_connect_get_candidate_geometry (InfoManagerSlotRect* slot)
5586 return m_impl->signal_connect_get_candidate_geometry (slot);
5590 InfoManager::signal_connect_get_input_panel_geometry (InfoManagerSlotRect* slot)
5592 return m_impl->signal_connect_get_input_panel_geometry (slot);
5596 InfoManager::signal_connect_set_keyboard_ise (InfoManagerSlotString* slot)
5598 return m_impl->signal_connect_set_keyboard_ise (slot);
5602 InfoManager::signal_connect_get_keyboard_ise (InfoManagerSlotString2* slot)
5604 return m_impl->signal_connect_get_keyboard_ise (slot);
5608 InfoManager::signal_connect_show_help (InfoManagerSlotString* slot)
5610 return m_impl->signal_connect_show_help (slot);
5614 InfoManager::signal_connect_show_factory_menu (InfoManagerSlotFactoryInfoVector* slot)
5616 return m_impl->signal_connect_show_factory_menu (slot);
5620 InfoManager::signal_connect_show_preedit_string (InfoManagerSlotVoid* slot)
5622 return m_impl->signal_connect_show_preedit_string (slot);
5626 InfoManager::signal_connect_show_aux_string (InfoManagerSlotVoid* slot)
5628 return m_impl->signal_connect_show_aux_string (slot);
5632 InfoManager::signal_connect_show_lookup_table (InfoManagerSlotVoid* slot)
5634 return m_impl->signal_connect_show_lookup_table (slot);
5638 InfoManager::signal_connect_show_associate_table (InfoManagerSlotVoid* slot)
5640 return m_impl->signal_connect_show_associate_table (slot);
5644 InfoManager::signal_connect_hide_preedit_string (InfoManagerSlotVoid* slot)
5646 return m_impl->signal_connect_hide_preedit_string (slot);
5650 InfoManager::signal_connect_hide_aux_string (InfoManagerSlotVoid* slot)
5652 return m_impl->signal_connect_hide_aux_string (slot);
5656 InfoManager::signal_connect_hide_lookup_table (InfoManagerSlotVoid* slot)
5658 return m_impl->signal_connect_hide_lookup_table (slot);
5662 InfoManager::signal_connect_hide_associate_table (InfoManagerSlotVoid* slot)
5664 return m_impl->signal_connect_hide_associate_table (slot);
5668 InfoManager::signal_connect_update_preedit_string (InfoManagerSlotAttributeStringInt* slot)
5670 return m_impl->signal_connect_update_preedit_string (slot);
5674 InfoManager::signal_connect_update_preedit_caret (InfoManagerSlotInt* slot)
5676 return m_impl->signal_connect_update_preedit_caret (slot);
5680 InfoManager::signal_connect_update_aux_string (InfoManagerSlotAttributeString* slot)
5682 return m_impl->signal_connect_update_aux_string (slot);
5686 InfoManager::signal_connect_update_lookup_table (InfoManagerSlotLookupTable* slot)
5688 return m_impl->signal_connect_update_lookup_table (slot);
5692 InfoManager::signal_connect_update_associate_table (InfoManagerSlotLookupTable* slot)
5694 return m_impl->signal_connect_update_associate_table (slot);
5698 InfoManager::signal_connect_register_properties (InfoManagerSlotPropertyList* slot)
5700 return m_impl->signal_connect_register_properties (slot);
5704 InfoManager::signal_connect_update_property (InfoManagerSlotProperty* slot)
5706 return m_impl->signal_connect_update_property (slot);
5710 InfoManager::signal_connect_register_helper_properties (InfoManagerSlotIntPropertyList* slot)
5712 return m_impl->signal_connect_register_helper_properties (slot);
5716 InfoManager::signal_connect_update_helper_property (InfoManagerSlotIntProperty* slot)
5718 return m_impl->signal_connect_update_helper_property (slot);
5722 InfoManager::signal_connect_register_helper (InfoManagerSlotIntHelperInfo* slot)
5724 return m_impl->signal_connect_register_helper (slot);
5728 InfoManager::signal_connect_remove_helper (InfoManagerSlotInt* slot)
5730 return m_impl->signal_connect_remove_helper (slot);
5734 InfoManager::signal_connect_set_active_ise_by_uuid (InfoManagerSlotStringBool* slot)
5736 return m_impl->signal_connect_set_active_ise_by_uuid (slot);
5740 InfoManager::signal_connect_focus_in (InfoManagerSlotVoid* slot)
5742 return m_impl->signal_connect_focus_in (slot);
5746 InfoManager::signal_connect_focus_out (InfoManagerSlotVoid* slot)
5748 return m_impl->signal_connect_focus_out (slot);
5752 InfoManager::signal_connect_expand_candidate (InfoManagerSlotVoid* slot)
5754 return m_impl->signal_connect_expand_candidate (slot);
5758 InfoManager::signal_connect_contract_candidate (InfoManagerSlotVoid* slot)
5760 return m_impl->signal_connect_contract_candidate (slot);
5764 InfoManager::signal_connect_select_candidate (InfoManagerSlotInt* slot)
5766 return m_impl->signal_connect_select_candidate (slot);
5770 InfoManager::signal_connect_get_ise_list (InfoManagerSlotBoolStringVector* slot)
5772 return m_impl->signal_connect_get_ise_list (slot);
5776 InfoManager::signal_connect_get_all_helper_ise_info (InfoManagerSlotBoolHelperInfo* slot)
5778 return m_impl->signal_connect_get_all_helper_ise_info (slot);
5782 InfoManager::signal_connect_set_has_option_helper_ise_info (InfoManagerSlotStringBool* slot)
5784 return m_impl->signal_connect_set_has_option_helper_ise_info (slot);
5788 InfoManager::signal_connect_set_enable_helper_ise_info (InfoManagerSlotStringBool* slot)
5790 return m_impl->signal_connect_set_enable_helper_ise_info (slot);
5794 InfoManager::signal_connect_show_helper_ise_list (InfoManagerSlotVoid* slot)
5796 return m_impl->signal_connect_show_helper_ise_list (slot);
5800 InfoManager::signal_connect_show_helper_ise_selector (InfoManagerSlotVoid* slot)
5802 return m_impl->signal_connect_show_helper_ise_selector (slot);
5806 InfoManager::signal_connect_is_helper_ise_enabled (InfoManagerSlotStringInt* slot)
5808 return m_impl->signal_connect_is_helper_ise_enabled (slot);
5812 InfoManager::signal_connect_get_ise_information (InfoManagerSlotBoolString4int2* slot)
5814 return m_impl->signal_connect_get_ise_information (slot);
5818 InfoManager::signal_connect_get_keyboard_ise_list (InfoManagerSlotBoolStringVector* slot)
5820 return m_impl->signal_connect_get_keyboard_ise_list (slot);
5824 InfoManager::signal_connect_update_ise_geometry (InfoManagerSlotIntIntIntInt* slot)
5826 return m_impl->signal_connect_update_ise_geometry (slot);
5830 InfoManager::signal_connect_get_language_list (InfoManagerSlotStringVector* slot)
5832 return m_impl->signal_connect_get_language_list (slot);
5836 InfoManager::signal_connect_get_all_language (InfoManagerSlotStringVector* slot)
5838 return m_impl->signal_connect_get_all_language (slot);
5842 InfoManager::signal_connect_get_ise_language (InfoManagerSlotStrStringVector* slot)
5844 return m_impl->signal_connect_get_ise_language (slot);
5848 InfoManager::signal_connect_get_ise_info_by_uuid (InfoManagerSlotStringISEINFO* slot)
5850 return m_impl->signal_connect_get_ise_info_by_uuid (slot);
5854 InfoManager::signal_connect_send_key_event (InfoManagerSlotKeyEvent* slot)
5856 return m_impl->signal_connect_send_key_event (slot);
5860 InfoManager::signal_connect_accept_connection (InfoManagerSlotInt* slot)
5862 return m_impl->signal_connect_accept_connection (slot);
5866 InfoManager::signal_connect_close_connection (InfoManagerSlotInt* slot)
5868 return m_impl->signal_connect_close_connection (slot);
5872 InfoManager::signal_connect_exit (InfoManagerSlotVoid* slot)
5874 return m_impl->signal_connect_exit (slot);
5878 InfoManager::signal_connect_transaction_start (InfoManagerSlotVoid* slot)
5880 return m_impl->signal_connect_transaction_start (slot);
5884 InfoManager::signal_connect_transaction_end (InfoManagerSlotVoid* slot)
5886 return m_impl->signal_connect_transaction_end (slot);
5890 InfoManager::signal_connect_lock (InfoManagerSlotVoid* slot)
5892 return m_impl->signal_connect_lock (slot);
5896 InfoManager::signal_connect_unlock (InfoManagerSlotVoid* slot)
5898 return m_impl->signal_connect_unlock (slot);
5902 InfoManager::signal_connect_update_input_context (InfoManagerSlotIntInt* slot)
5904 return m_impl->signal_connect_update_input_context (slot);
5908 InfoManager::signal_connect_show_ise (InfoManagerSlotVoid* slot)
5910 return m_impl->signal_connect_show_ise (slot);
5914 InfoManager::signal_connect_hide_ise (InfoManagerSlotVoid* slot)
5916 return m_impl->signal_connect_hide_ise (slot);
5920 InfoManager::signal_connect_will_show_ack (InfoManagerSlotVoid* slot)
5922 return m_impl->signal_connect_will_show_ack (slot);
5926 InfoManager::signal_connect_will_hide_ack (InfoManagerSlotVoid* slot)
5928 return m_impl->signal_connect_will_hide_ack (slot);
5932 InfoManager::signal_connect_set_keyboard_mode (InfoManagerSlotInt* slot)
5934 return m_impl->signal_connect_set_keyboard_mode (slot);
5938 InfoManager::signal_connect_candidate_will_hide_ack (InfoManagerSlotVoid* slot)
5940 return m_impl->signal_connect_candidate_will_hide_ack (slot);
5944 InfoManager::signal_connect_get_ise_state (InfoManagerSlotInt2* slot)
5946 return m_impl->signal_connect_get_ise_state (slot);
5950 InfoManager::signal_connect_run_helper (InfoManagerSlotString3* slot)
5952 return m_impl->signal_connect_run_helper (slot);
5956 InfoManager::signal_connect_launch_option_application (InfoManagerSlotBoolString* slot)
5958 return m_impl->signal_connect_launch_option_application (slot);
5962 InfoManager::signal_connect_get_recent_ise_geometry (InfoManagerSlotIntRect* slot)
5964 return m_impl->signal_connect_get_recent_ise_geometry (slot);
5968 InfoManager::signal_connect_check_privilege_by_sockfd (InfoManagerSlotIntString2* slot)
5970 return m_impl->signal_connect_check_privilege_by_sockfd (slot);
5974 InfoManager::signal_connect_remoteinput_send_input_message (InfoManagerSlotStringBool* slot)
5976 return m_impl->signal_connect_remoteinput_send_input_message (slot);
5980 InfoManager::signal_connect_remoteinput_send_surrounding_text (InfoManagerSlotIntString* slot)
5982 return m_impl->signal_connect_remoteinput_send_surrounding_text (slot);
5985 } /* namespace scim */
5988 vi:ts=4:nowrap:ai:expandtab