From: Wonkeun Oh Date: Thu, 20 Mar 2014 01:55:34 +0000 (+0900) Subject: change keyboard mode by touch & code refactoring about the keyboard mode X-Git-Tag: submit/tizen/20150128.083920~196 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F78%2F31578%2F1;p=platform%2Fcore%2Fuifw%2Fisf.git change keyboard mode by touch & code refactoring about the keyboard mode Change-Id: I90051b8744c8072bb9524b4378d470189ae32bbf --- diff --git a/ism/configs/global b/ism/configs/global index f5aeecd..e1aeac3 100755 --- a/ism/configs/global +++ b/ism/configs/global @@ -13,3 +13,4 @@ /InitialIseName = Tizen Keyboard /PreloadKeyboardIse = true /LaunchIseOnRequest = false +/ChangeKeyboardModeByTouch = false diff --git a/ism/extras/efl_immodule/isf_imf_context.cpp b/ism/extras/efl_immodule/isf_imf_context.cpp index ec31162..1be858b 100644 --- a/ism/extras/efl_immodule/isf_imf_context.cpp +++ b/ism/extras/efl_immodule/isf_imf_context.cpp @@ -291,6 +291,8 @@ static Ecore_Event_Handler *_key_up_handler static bool _on_the_spot = true; static bool _shared_input_method = false; +static bool _change_keyboard_mode_by_touch = false; + static double space_key_time = 0.0; static Eina_Bool autoperiod_allow = EINA_FALSE; @@ -539,7 +541,7 @@ _key_up_cb (void *data, int type, void *event) ecore_imf_context_input_panel_hide (active_ctx); } else { if (_click_timer == NULL) { - if (get_hardware_keyboard_mode ()) { + if (get_keyboard_mode () == TOOLBAR_KEYBOARD_MODE) { ecore_x_window_prop_card32_set (_input_win, ecore_x_atom_get (PROP_X_EXT_KEYBOARD_EXIST), &val, 1); ecore_timer_add (0.1, _panel_show, NULL); } else { @@ -819,7 +821,7 @@ caps_mode_check (Ecore_IMF_Context *ctx, Eina_Bool force, Eina_Bool noti) Eina_Bool uppercase; EcoreIMFContextISF *context_scim; - if (get_hardware_keyboard_mode ()) return EINA_FALSE; + if (get_keyboard_mode () == TOOLBAR_KEYBOARD_MODE) return EINA_FALSE; if (!ctx) return EINA_FALSE; context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get (ctx); @@ -1429,7 +1431,7 @@ isf_imf_context_focus_in (Ecore_IMF_Context *ctx) else LOGD ("ctx : %p input panel enable : FALSE\n", ctx); - if (get_hardware_keyboard_mode ()) + if (get_keyboard_mode () == TOOLBAR_KEYBOARD_MODE) clear_hide_request (); } @@ -1932,10 +1934,10 @@ isf_imf_context_filter_event (Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, /* Hardware input detect code */ if (type == ECORE_IMF_EVENT_KEY_DOWN) { Ecore_IMF_Event_Key_Down *ev = (Ecore_IMF_Event_Key_Down *)event; - if (ev->timestamp > 1 && get_hardware_keyboard_mode () == EINA_FALSE && + if (ev->timestamp > 1 && get_keyboard_mode () == TOOLBAR_HELPER_MODE && scim_string_to_key (key, ev->key) && key.code != 0xFF69 /* Cancel (Power + Volume down) key */) { - isf_imf_context_set_hardware_keyboard_mode (ctx); + isf_imf_context_set_keyboard_mode (ctx, TOOLBAR_KEYBOARD_MODE); _panel_client.prepare (ic->id); _panel_client.get_active_helper_option (&_active_helper_option); _panel_client.send (); @@ -1976,8 +1978,14 @@ isf_imf_context_filter_event (Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, } else if (type == ECORE_IMF_EVENT_MOUSE_UP) { if (ecore_imf_context_input_panel_enabled_get (ctx)) { LOGD ("[Mouse-up event] ctx : %p\n", ctx); - if (ic == _focused_ic) - ecore_imf_context_input_panel_show (ctx); + if (ic == _focused_ic) { + if (_change_keyboard_mode_by_touch && get_keyboard_mode () == TOOLBAR_KEYBOARD_MODE) { + isf_imf_context_set_keyboard_mode (ctx, TOOLBAR_HELPER_MODE); + LOGD("S/W keyboard mode by enabling ChangeKeyboardModeByTouch"); + } else { + ecore_imf_context_input_panel_show (ctx); + } + } else LOGE ("Can't show IME because there is no focus. ctx : %p\n", ctx); } @@ -2018,7 +2026,7 @@ isf_imf_context_filter_event (Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, } if (!_focused_ic || !_focused_ic->impl || !_focused_ic->impl->is_on) { ret = EINA_FALSE; - } else if (get_hardware_keyboard_mode () && (_active_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) { + } else if (get_keyboard_mode () == TOOLBAR_KEYBOARD_MODE && (_active_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) { _panel_client.process_key_event (key, (int*)&ret); } else { ret = _focused_ic->impl->si->process_key_event (key); @@ -3922,7 +3930,7 @@ slot_commit_string (IMEngineInstanceBase *si, if (ecore_imf_context_input_panel_layout_get (ic->ctx) == ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL && ic->impl->shift_mode_enabled && ic->impl->autocapital_type != ECORE_IMF_AUTOCAPITAL_TYPE_NONE && - get_hardware_keyboard_mode () == EINA_FALSE) { + get_keyboard_mode () == TOOLBAR_HELPER_MODE) { char converted[2] = {'\0'}; if (utf8_wcstombs (str).length () == 1) { Eina_Bool uppercase; @@ -4246,6 +4254,7 @@ reload_config_callback (const ConfigPointer &config) _on_the_spot = config->read (String (SCIM_CONFIG_FRONTEND_ON_THE_SPOT), _on_the_spot); _shared_input_method = config->read (String (SCIM_CONFIG_FRONTEND_SHARED_INPUT_METHOD), _shared_input_method); + _change_keyboard_mode_by_touch = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_CHANGE_KEYBOARD_MODE_BY_TOUCH), _change_keyboard_mode_by_touch); // Get keyboard layout setting // Flush the global config first, in order to load the new configs from disk. diff --git a/ism/extras/efl_immodule/isf_imf_control.cpp b/ism/extras/efl_immodule/isf_imf_control.cpp index f9078ad..2a128d1 100644 --- a/ism/extras/efl_immodule/isf_imf_control.cpp +++ b/ism/extras/efl_immodule/isf_imf_control.cpp @@ -207,10 +207,10 @@ int _isf_imf_context_input_panel_send_will_hide_ack (int context) return 0; } -int _isf_imf_context_set_hardware_keyboard_mode (int context) +int _isf_imf_context_set_keyboard_mode (int context, TOOLBAR_MODE_T mode) { _panel_client.prepare (context); - _panel_client.set_hardware_keyboard_mode (); + _panel_client.set_keyboard_mode (mode); _panel_client.send (); return 0; } diff --git a/ism/extras/efl_immodule/isf_imf_control.h b/ism/extras/efl_immodule/isf_imf_control.h index 81a5803..4c7a8b2 100644 --- a/ism/extras/efl_immodule/isf_imf_control.h +++ b/ism/extras/efl_immodule/isf_imf_control.h @@ -25,7 +25,10 @@ #ifndef __ISF_IMF_CONTROL_H #define __ISF_IMF_CONTROL_H +#define Uses_SCIM_PANEL_CLIENT + #include +#include "scim.h" #ifdef __cplusplus extern "C" @@ -57,7 +60,7 @@ extern "C" int _isf_imf_context_input_panel_send_will_show_ack (int context); int _isf_imf_context_input_panel_send_will_hide_ack (int context); - int _isf_imf_context_set_hardware_keyboard_mode (int context); + int _isf_imf_context_set_keyboard_mode (int context, scim::TOOLBAR_MODE_T mode); int _isf_imf_context_input_panel_send_candidate_will_hide_ack (int context); diff --git a/ism/extras/efl_immodule/isf_imf_control_ui.cpp b/ism/extras/efl_immodule/isf_imf_control_ui.cpp index 3fee08b..edabf1c 100644 --- a/ism/extras/efl_immodule/isf_imf_control_ui.cpp +++ b/ism/extras/efl_immodule/isf_imf_control_ui.cpp @@ -46,7 +46,7 @@ static Ecore_IMF_Context *hide_req_ic = NULL; static Ecore_Event_Handler *_prop_change_handler = NULL; static Ecore_X_Atom prop_x_keyboard_input_detected = 0; static Ecore_X_Window _control_win; -static Eina_Bool hw_kbd_mode = EINA_FALSE; +static TOOLBAR_MODE_T kbd_mode = TOOLBAR_HELPER_MODE; static Ecore_Timer *hide_timer = NULL; static Ecore_Timer *will_show_timer = NULL; Ecore_IMF_Input_Panel_State input_panel_state = ECORE_IMF_INPUT_PANEL_STATE_HIDE; @@ -179,8 +179,8 @@ static Eina_Bool _prop_change (void *data, int ev_type, void *ev) return ECORE_CALLBACK_PASS_ON; if (val == 0) { - hw_kbd_mode = EINA_FALSE; - LOGD ("H/W keyboard mode : %d\n", hw_kbd_mode); + kbd_mode = TOOLBAR_HELPER_MODE; + LOGD ("keyboard mode(0:H/W Keyboard, 1:S/W Keyboard): %d\n", kbd_mode); } } @@ -411,9 +411,9 @@ void input_panel_event_callback_call (Ecore_IMF_Input_Panel_Event type, int valu _event_callback_call (type, value); } -Eina_Bool get_hardware_keyboard_mode () +TOOLBAR_MODE_T get_keyboard_mode () { - return hw_kbd_mode; + return kbd_mode; } void isf_imf_context_control_panel_show (Ecore_IMF_Context *ctx) @@ -448,14 +448,14 @@ void isf_imf_input_panel_init (void) if (ecore_x_window_prop_card32_get (_control_win, prop_x_keyboard_input_detected, &val, 1) > 0){ if (val == 1){ - hw_kbd_mode = EINA_TRUE; + kbd_mode = TOOLBAR_KEYBOARD_MODE; } else { - hw_kbd_mode = EINA_FALSE; + kbd_mode = TOOLBAR_HELPER_MODE; } } else { - hw_kbd_mode = EINA_FALSE; + kbd_mode = TOOLBAR_HELPER_MODE; } - LOGD ("H/W keyboard mode : %d\n", hw_kbd_mode); + LOGD ("keyboard mode(0:H/W Keyboard, 1:S/W Keyboard): %d\n", kbd_mode); } void isf_imf_input_panel_shutdown (void) @@ -536,7 +536,7 @@ void isf_imf_context_input_panel_show (Ecore_IMF_Context* ctx) return; } - if (hw_kbd_mode) { + if (kbd_mode == TOOLBAR_KEYBOARD_MODE) { LOGD ("H/W keyboard is existed.\n"); return; } @@ -931,15 +931,15 @@ void isf_imf_context_input_panel_send_will_hide_ack (Ecore_IMF_Context *ctx) } } -void isf_imf_context_set_hardware_keyboard_mode (Ecore_IMF_Context *ctx) +void isf_imf_context_set_keyboard_mode (Ecore_IMF_Context *ctx, TOOLBAR_MODE_T mode) { if (IfInitContext == false) { _isf_imf_context_init (); } - hw_kbd_mode = EINA_TRUE; - SECURE_LOGD ("H/W keyboard mode : %d\n", hw_kbd_mode); - _isf_imf_context_set_hardware_keyboard_mode (_get_context_id (ctx)); + kbd_mode = mode; + SECURE_LOGD ("keyboard mode : %d\n", kbd_mode); + _isf_imf_context_set_keyboard_mode (_get_context_id (ctx), mode); } void isf_imf_context_input_panel_send_candidate_will_hide_ack (Ecore_IMF_Context *ctx) diff --git a/ism/extras/efl_immodule/isf_imf_control_ui.h b/ism/extras/efl_immodule/isf_imf_control_ui.h index bff46c5..9485798 100644 --- a/ism/extras/efl_immodule/isf_imf_control_ui.h +++ b/ism/extras/efl_immodule/isf_imf_control_ui.h @@ -25,14 +25,17 @@ #ifndef __ISF_IMF_CONTROL_UI_H #define __ISF_IMF_CONTROL_UI_H +#define Uses_SCIM_PANEL_CLIENT + #include +#include "scim.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ void input_panel_event_callback_call (Ecore_IMF_Input_Panel_Event type, int value); - Eina_Bool get_hardware_keyboard_mode (); + scim::TOOLBAR_MODE_T get_keyboard_mode (); bool process_update_input_context (int type, int value); Ecore_IMF_Context *get_using_ic (Ecore_IMF_Input_Panel_Event type, int value); void save_current_xid (Ecore_IMF_Context *ctx); @@ -66,7 +69,7 @@ extern "C" void isf_imf_context_input_panel_send_will_show_ack (Ecore_IMF_Context *ctx); void isf_imf_context_input_panel_send_will_hide_ack (Ecore_IMF_Context *ctx); - void isf_imf_context_set_hardware_keyboard_mode (Ecore_IMF_Context *ctx); + void isf_imf_context_set_keyboard_mode (Ecore_IMF_Context *ctx, scim::TOOLBAR_MODE_T mode); void isf_imf_context_input_panel_send_candidate_will_hide_ack (Ecore_IMF_Context *ctx); diff --git a/ism/extras/efl_panel/isf_panel_efl.cpp b/ism/extras/efl_panel/isf_panel_efl.cpp index 07d556b..3406f9f 100644 --- a/ism/extras/efl_panel/isf_panel_efl.cpp +++ b/ism/extras/efl_panel/isf_panel_efl.cpp @@ -143,11 +143,6 @@ typedef enum _WINDOW_STATE { WINDOW_STATE_ON, } WINDOW_STATE; -typedef enum _KEYBOARD_MODE { - SOFTWARE_KEYBOARD_MODE = 0, - HARDWARE_KEYBOARD_MODE, -} KEYBOARD_MODE; - typedef std::map OSPEmRepository; @@ -224,7 +219,7 @@ static void slot_hide_ise (void); static void slot_will_hide_ack (void); static void slot_candidate_will_hide_ack (void); -static void slot_set_hardware_keyboard_mode (void); +static void slot_set_keyboard_mode (int mode); static void slot_get_ise_state (int &state); static void slot_start_default_ise (void); static void slot_stop_default_ise (void); @@ -235,7 +230,7 @@ static Eina_Bool panel_agent_handler (void *data, Ecore_Fd_Han static Eina_Bool efl_create_control_window (void); static Ecore_X_Window efl_get_app_window (void); static Ecore_X_Window efl_get_quickpanel_window (void); -static void check_hardware_keyboard (KEYBOARD_MODE mode); +static void check_hardware_keyboard (TOOLBAR_MODE_T mode); static unsigned int get_ise_index (const String uuid); static bool set_active_ise (const String &uuid, bool launch_ise); @@ -3448,7 +3443,7 @@ static bool initialize_panel_agent (const String &config, const String &display, _panel_agent->signal_connect_will_hide_ack (slot (slot_will_hide_ack)); - _panel_agent->signal_connect_set_hardware_keyboard_mode (slot (slot_set_hardware_keyboard_mode)); + _panel_agent->signal_connect_set_keyboard_mode (slot (slot_set_keyboard_mode)); _panel_agent->signal_connect_candidate_will_hide_ack (slot (slot_candidate_will_hide_ack)); _panel_agent->signal_connect_get_ise_state (slot (slot_get_ise_state)); @@ -4917,10 +4912,11 @@ static void slot_candidate_will_hide_ack (void) } } -static void slot_set_hardware_keyboard_mode (void) +static void slot_set_keyboard_mode (int mode) { - LOGD ("slot_set_hardware_keyboard_mode called"); - check_hardware_keyboard (HARDWARE_KEYBOARD_MODE); + LOGD ("slot_set_keyboard_mode called (TOOLBAR_MODE : %d)\n",mode); + + check_hardware_keyboard ((TOOLBAR_MODE_T)mode); } static void slot_get_ise_state (int &state) @@ -5223,7 +5219,7 @@ static void display_language_changed_cb (keynode_t *key, void* data) * * @return void */ -static void check_hardware_keyboard (KEYBOARD_MODE mode) +static void check_hardware_keyboard (TOOLBAR_MODE_T mode) { SCIM_DEBUG_MAIN (3) << __FUNCTION__ << "...\n"; @@ -5234,7 +5230,7 @@ static void check_hardware_keyboard (KEYBOARD_MODE mode) String helper_uuid = _config->read (SCIM_CONFIG_DEFAULT_HELPER_ISE, String ("")); String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String ("")); - if (mode == HARDWARE_KEYBOARD_MODE) { + if (mode == TOOLBAR_KEYBOARD_MODE) { if (_panel_agent->get_current_toolbar_mode () == TOOLBAR_KEYBOARD_MODE) { LOGD ("HARDWARE_KEYBOARD_MODE return"); return; @@ -5295,10 +5291,10 @@ static void check_hardware_keyboard (KEYBOARD_MODE mode) notification_status_message_post (_("Input detected from hardware keyboard")); /* Set input detected property for isf setting */ - val = (unsigned int)HARDWARE_KEYBOARD_MODE; + val = 1; ecore_x_window_prop_card32_set (_control_window, ecore_x_atom_get (PROP_X_EXT_KEYBOARD_INPUT_DETECTED), &val, 1); ecore_x_window_prop_card32_set (ecore_x_window_root_first_get (), ecore_x_atom_get (PROP_X_EXT_KEYBOARD_INPUT_DETECTED), &val, 1); - } else if (mode == SOFTWARE_KEYBOARD_MODE) { + } else if (mode == TOOLBAR_HELPER_MODE) { LOGD ("SOFTWARE KEYBOARD MODE"); /* When switching back to S/W keyboard mode, let's hide candidate window first */ LOGD ("calling ui_candidate_hide (true, true, true)"); @@ -5318,7 +5314,7 @@ static void check_hardware_keyboard (KEYBOARD_MODE mode) #endif /* Set input detected property for isf setting */ - val = (unsigned int)SOFTWARE_KEYBOARD_MODE; + val = 0; ecore_x_test_fake_key_press ("XF86MenuKB"); ecore_x_window_prop_card32_set (_control_window, ecore_x_atom_get (PROP_X_EXT_KEYBOARD_INPUT_DETECTED), &val, 1); ecore_x_window_prop_card32_set (ecore_x_window_root_first_get (), ecore_x_atom_get (PROP_X_EXT_KEYBOARD_INPUT_DETECTED), &val, 1); @@ -5370,7 +5366,7 @@ static Eina_Bool x_event_window_property_cb (void *data, int ev_type, void *even if (ecore_x_window_prop_card32_get (_input_win, ecore_x_atom_get (PROP_X_EXT_KEYBOARD_EXIST), &val, 1) > 0) { if (val == 0) { _panel_agent->reset_keyboard_ise (); - check_hardware_keyboard (SOFTWARE_KEYBOARD_MODE); + check_hardware_keyboard (TOOLBAR_HELPER_MODE); set_keyboard_geometry_atom_info (_app_window, get_ise_geometry ()); _panel_agent->update_input_panel_event (ECORE_IMF_INPUT_PANEL_GEOMETRY_EVENT, 0); } @@ -5778,7 +5774,7 @@ static void launch_default_soft_keyboard (keynode_t *key, void* data) SCIM_DEBUG_MAIN (3) << __FUNCTION__ << "...\n"; /* Start default ISE */ - check_hardware_keyboard (SOFTWARE_KEYBOARD_MODE); + check_hardware_keyboard (TOOLBAR_HELPER_MODE); } static String sanitize_string (const char *str, int maxlen = 32) diff --git a/ism/extras/efl_wsc/isf_wsc_control.cpp b/ism/extras/efl_wsc/isf_wsc_control.cpp index 8500848..6191643 100644 --- a/ism/extras/efl_wsc/isf_wsc_control.cpp +++ b/ism/extras/efl_wsc/isf_wsc_control.cpp @@ -207,10 +207,10 @@ int _isf_wsc_context_input_panel_send_will_hide_ack (int context) return 0; } -int _isf_wsc_context_set_hardware_keyboard_mode (int context) +int _isf_wsc_context_set_keyboard_mode (int context, TOOLBAR_MODE_T mode) { _panel_client.prepare (context); - _panel_client.set_hardware_keyboard_mode (); + _panel_client.set_keyboard_mode (mode); _panel_client.send (); return 0; } diff --git a/ism/extras/efl_wsc/isf_wsc_control.h b/ism/extras/efl_wsc/isf_wsc_control.h index 70e7958..2ab4497 100644 --- a/ism/extras/efl_wsc/isf_wsc_control.h +++ b/ism/extras/efl_wsc/isf_wsc_control.h @@ -25,7 +25,10 @@ #ifndef __ISF_WSC_CONTROL_H #define __ISF_WSC_CONTROL_H +#define Uses_SCIM_PANEL_CLIENT + #include +#include "scim.h" #ifdef __cplusplus extern "C" @@ -57,7 +60,7 @@ extern "C" int _isf_wsc_context_input_panel_send_will_show_ack (int context); int _isf_wsc_context_input_panel_send_will_hide_ack (int context); - int _isf_wsc_context_set_hardware_keyboard_mode (int context); + int _isf_wsc_context_set_keyboard_mode (int context, scim::TOOLBAR_MODE_T mode); int _isf_wsc_context_input_panel_send_candidate_will_hide_ack (int context); diff --git a/ism/extras/efl_wsc/isf_wsc_control_ui.cpp b/ism/extras/efl_wsc/isf_wsc_control_ui.cpp index 106a922..da12887 100644 --- a/ism/extras/efl_wsc/isf_wsc_control_ui.cpp +++ b/ism/extras/efl_wsc/isf_wsc_control_ui.cpp @@ -174,7 +174,7 @@ void isf_wsc_context_input_panel_hide (WSCContextISF *ctx) _isf_wsc_context_input_panel_hide (get_panel_client_id (), context_id); } -void isf_wsc_context_set_hardware_keyboard_mode (WSCContextISF *ctx) +void isf_wsc_context_set_keyboard_mode (WSCContextISF *ctx, TOOLBAR_MODE_T mode) { if (IfInitContext == false) { _isf_wsc_context_init (); @@ -182,7 +182,7 @@ void isf_wsc_context_set_hardware_keyboard_mode (WSCContextISF *ctx) hw_kbd_num = 1; SECURE_LOGD ("The number of connected H/W keyboard : %d\n", hw_kbd_num); - _isf_wsc_context_set_hardware_keyboard_mode (_get_context_id (ctx)); + _isf_wsc_context_set_keyboard_mode (_get_context_id (ctx), mode); } void diff --git a/ism/extras/efl_wsc/isf_wsc_control_ui.h b/ism/extras/efl_wsc/isf_wsc_control_ui.h index d2dfb37..9408709 100644 --- a/ism/extras/efl_wsc/isf_wsc_control_ui.h +++ b/ism/extras/efl_wsc/isf_wsc_control_ui.h @@ -25,8 +25,11 @@ #ifndef __ISF_IMF_CONTROL_UI_H #define __ISF_IMF_CONTROL_UI_H +#define Uses_SCIM_PANEL_CLIENT + #include "isf_wsc_context.h" #include +#include "scim.h" #ifdef __cplusplus extern "C" @@ -46,7 +49,7 @@ extern "C" Ecore_IMF_Input_Panel_Layout isf_wsc_context_input_panel_layout_get (WSCContextISF *ctx); void isf_wsc_context_input_panel_caps_mode_set (WSCContextISF *ctx, unsigned int mode); void isf_wsc_context_input_panel_caps_lock_mode_set (WSCContextISF *ctx, Eina_Bool mode); - void isf_wsc_context_set_hardware_keyboard_mode (WSCContextISF *ctx); + void isf_wsc_context_set_keyboard_mode (WSCContextISF *ctx, scim::TOOLBAR_MODE_T mode); #ifdef __cplusplus } diff --git a/ism/src/scim_config_path.h b/ism/src/scim_config_path.h index ae5b2cc..3df9fd9 100644 --- a/ism/src/scim_config_path.h +++ b/ism/src/scim_config_path.h @@ -89,6 +89,7 @@ namespace scim { #define SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID "/DefaultIseUuid" #define SCIM_GLOBAL_CONFIG_PRELOAD_KEYBOARD_ISE "/PreloadKeyboardIse" #define SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST "/LaunchIseOnRequest" +#define SCIM_GLOBAL_CONFIG_CHANGE_KEYBOARD_MODE_BY_TOUCH "/ChangeKeyboardModeByTouch" #define ISF_CONFIG_HARDWARE_KEYBOARD_DETECT "/isf/hw_keyboard_detect" diff --git a/ism/src/scim_panel_agent.cpp b/ism/src/scim_panel_agent.cpp index a9825e8..ef0da33 100644 --- a/ism/src/scim_panel_agent.cpp +++ b/ism/src/scim_panel_agent.cpp @@ -367,7 +367,7 @@ class PanelAgent::PanelAgentImpl PanelAgentSignalVoid m_signal_will_show_ack; PanelAgentSignalVoid m_signal_will_hide_ack; - PanelAgentSignalVoid m_signal_set_hardware_keyboard_mode; + PanelAgentSignalInt m_signal_set_keyboard_mode; PanelAgentSignalVoid m_signal_candidate_will_hide_ack; PanelAgentSignalInt2 m_signal_get_ise_state; @@ -2748,11 +2748,15 @@ public: std::cerr << "Read SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID is failed!!!\n"; } - void set_hardware_keyboard_mode (int client_id) + void set_keyboard_mode (int client_id) { - SCIM_DEBUG_MAIN(4) << "PanelAgent::set_hardware_keyboard_mode ()\n"; + SCIM_DEBUG_MAIN(4) << "PanelAgent::set_keyboard_mode ()\n"; + uint32 mode; + if (m_recv_trans.get_data (mode)) { + m_signal_set_keyboard_mode (mode); + } + - m_signal_set_hardware_keyboard_mode (); } void candidate_will_hide_ack (int client_id) @@ -3129,9 +3133,9 @@ public: return m_signal_will_hide_ack.connect (slot); } - Connection signal_connect_set_hardware_keyboard_mode (PanelAgentSlotVoid *slot) + Connection signal_connect_set_keyboard_mode (PanelAgentSlotInt *slot) { - return m_signal_set_hardware_keyboard_mode.connect (slot); + return m_signal_set_keyboard_mode.connect (slot); } Connection signal_connect_candidate_will_hide_ack (PanelAgentSlotVoid *slot) @@ -3362,7 +3366,7 @@ private: will_hide_ack (client_id); continue; } else if (cmd == ISM_TRANS_CMD_SET_HARDWARE_KEYBOARD_MODE) { - set_hardware_keyboard_mode (client_id); + set_keyboard_mode (client_id); continue; } else if (cmd == ISM_TRANS_CMD_SEND_CANDIDATE_WILL_HIDE_ACK) { candidate_will_hide_ack (client_id); @@ -6462,9 +6466,9 @@ PanelAgent::signal_connect_will_hide_ack (PanelAgentSlotVoid } Connection -PanelAgent::signal_connect_set_hardware_keyboard_mode (PanelAgentSlotVoid *slot) +PanelAgent::signal_connect_set_keyboard_mode (PanelAgentSlotInt *slot) { - return m_impl->signal_connect_set_hardware_keyboard_mode (slot); + return m_impl->signal_connect_set_keyboard_mode (slot); } Connection diff --git a/ism/src/scim_panel_agent.h b/ism/src/scim_panel_agent.h index d9864d7..1468e69 100644 --- a/ism/src/scim_panel_agent.h +++ b/ism/src/scim_panel_agent.h @@ -67,12 +67,6 @@ namespace scim { * @{ */ -typedef enum -{ - TOOLBAR_KEYBOARD_MODE = 0, /* Hardware keyboard ISE */ - TOOLBAR_HELPER_MODE /* Software keyboard ISE */ -} TOOLBAR_MODE_T; - typedef struct _ISE_INFO { String uuid; @@ -1153,9 +1147,9 @@ public: /** * @brief Signal: Set hardware mode * - * slot prototype: void set_hardware_keyboard_mode (void); + * slot prototype: void set_keyboard_mode (void); */ - Connection signal_connect_set_hardware_keyboard_mode (PanelAgentSlotVoid *slot); + Connection signal_connect_set_keyboard_mode (PanelAgentSlotInt *slot); /** * @brief Signal: Notifies the client finished handling WILL_HIDE event for candidate diff --git a/ism/src/scim_panel_client.cpp b/ism/src/scim_panel_client.cpp index da4eb39..06603a4 100644 --- a/ism/src/scim_panel_client.cpp +++ b/ism/src/scim_panel_client.cpp @@ -1084,9 +1084,11 @@ public: m_send_trans.put_command (ISM_TRANS_CMD_SEND_WILL_HIDE_ACK); } - void set_hardware_keyboard_mode (void) { + void set_keyboard_mode (int mode) { if (m_send_refcount > 0) m_send_trans.put_command (ISM_TRANS_CMD_SET_HARDWARE_KEYBOARD_MODE); + m_send_trans.put_data (mode); + } void send_candidate_will_hide_ack (void) { @@ -1727,9 +1729,9 @@ PanelClient::send_will_hide_ack (void) } void -PanelClient::set_hardware_keyboard_mode (void) +PanelClient::set_keyboard_mode (int mode) { - m_impl->set_hardware_keyboard_mode (); + m_impl->set_keyboard_mode (mode); } void diff --git a/ism/src/scim_panel_client.h b/ism/src/scim_panel_client.h index 9c62a59..607bd2a 100644 --- a/ism/src/scim_panel_client.h +++ b/ism/src/scim_panel_client.h @@ -54,7 +54,6 @@ #include namespace scim { - /** * @addtogroup Panel * @ingroup InputServiceFramework @@ -239,7 +238,7 @@ public: void set_caps_mode (int mode); void send_will_show_ack (void); void send_will_hide_ack (void); - void set_hardware_keyboard_mode (void); + void set_keyboard_mode (int mode); void send_candidate_will_hide_ack (void); bool get_client_id (int &client_id); void register_client (int client_id); diff --git a/ism/src/scim_panel_common.h b/ism/src/scim_panel_common.h index f49ae50..f111878 100644 --- a/ism/src/scim_panel_common.h +++ b/ism/src/scim_panel_common.h @@ -41,6 +41,11 @@ namespace scim { * which need to communicate with Panel daemons. * @{ */ +typedef enum +{ + TOOLBAR_KEYBOARD_MODE = 0, /* Hardware keyboard ISE */ + TOOLBAR_HELPER_MODE /* Software keyboard ISE */ +} TOOLBAR_MODE_T; class EAPI PanelError: public Exception {