The hardware keyboard should receive ise state variables because the ise_show is not requested
Change-Id: I8925469dd0d181623e971cabb704a6e3b69932de
m_send_trans.write_to_socket(client_socket);
}
+ void set_helper_keyboard_mode(int client, uint32 context, const String& uuid, uint32& mode) {
+ LOGD ("client id:%d\n", client);
+
+ Socket client_socket(client);
+ m_send_trans.clear();
+ m_send_trans.put_command(SCIM_TRANS_CMD_REPLY);
+ m_send_trans.put_data(context);
+ m_send_trans.put_data(uuid);
+ m_send_trans.put_command(ISM_TRANS_CMD_SET_KEYBOARD_MODE);
+ m_send_trans.put_data(mode);
+ m_send_trans.write_to_socket(client_socket);
+ }
+
bool process_key_event(int client, uint32 context, const String& uuid, KeyEvent& key, uint32 serial) {
LOGD ("client id:%d\n", client);
return false;
}
+ bool set_helper_keyboard_mode (const String& uuid, uint32& mode) {
+ HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
+
+ if (it != m_helper_client_index.end ()) {
+ int client;
+ uint32 context;
+ uint32 ctx;
+ get_focused_context (client, context);
+ ctx = get_helper_ic (client, context);
+ LOGD ("Send ISM_TRANS_CMD_SET_KEYBOARD_MODE message");
+ m_panel_agent_manager.set_helper_keyboard_mode (it->second.id, ctx, uuid, mode);
+ return true;
+ }
+
+ return false;
+ }
+
//ISM_TRANS_CMD_SHOW_ISF_CONTROL
void show_isf_panel (int client_id) {
LOGD ("");
LOGD ("");
SCIM_DEBUG_MAIN (4) << "InfoManager::set_keyboard_mode ()\n";
m_signal_set_keyboard_mode (mode);
+ set_ise_keyboard_mode (client_id, mode);
}
//ISM_TRANS_CMD_SEND_CANDIDATE_WILL_HIDE_ACK
void candidate_will_hide_ack (int client_id) {
}
}
+ //ISM_TRANS_CMD_SET_KEYBOARD_MODE
+ void set_ise_keyboard_mode (int client_id, uint32 mode) {
+ SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_keyboard_mode ()\n";
+ LOGD ("");
+ if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
+ set_helper_keyboard_mode (m_current_helper_uuid, mode);
+ }
+
//ISM_TRANS_CMD_EXPAND_CANDIDATE
void expand_candidate () {
LOGD ("");
m_impl->resume_ise_option_window (client_id);
}
+//ISM_TRANS_CMD_SET_KEYBOARD_MODE
+void InfoManager::set_ise_keyboard_mode (int client_id, uint32 mode)
+{
+ m_impl->set_ise_keyboard_mode (client_id, mode);
+}
+
//ISM_TRANS_CMD_EXPAND_CANDIDATE
void InfoManager::expand_candidate ()
{
//ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW
void resume_ise_option_window (int client_id);
+ //ISM_TRANS_CMD_SET_KEYBOARD_MODE
+ void set_ise_keyboard_mode (int client_id, uint32 mode);
+
//ISM_TRANS_CMD_EXPAND_CANDIDATE
void expand_candidate ();
uint32 m_prediction_allow;
};
+/* ISM_TRANS_CMD_SET_KEYBOARD_MODE */
+class MessageItemSetKeyboardMode : public MessageItemHelper
+{
+public:
+ MessageItemSetKeyboardMode() : m_keyboard_mode(1) {}
+ virtual ~MessageItemSetKeyboardMode() {}
+
+ uint32& get_mode_ref() { return m_keyboard_mode; }
+protected:
+ uint32 m_keyboard_mode;
+};
+
template <typename T>
inline T*
alloc_message() /* We could use memory pool in the future for performance enhancement */
}
break;
}
+ case ISM_TRANS_CMD_SET_KEYBOARD_MODE:
+ {
+ MessageItemSetKeyboardMode *message = alloc_message<MessageItemSetKeyboardMode>();
+ if (message) {
+ message->get_command_ref() = cmd;
+ if (transaction.get_data(message->get_mode_ref())) {
+ m_list_messages.push_back(message);
+ } else {
+ LOGW("wrong format of transaction\n");
+ dealloc_message<MessageItemSetKeyboardMode>(message);
+ }
+ }
+ break;
+ }
}
}
LOGW ("not implemented for %s", m_name.c_str ());
}
+void PanelAgentBase::set_helper_keyboard_mode (int client, uint32 context, const String& uuid, uint32& mode)
+{
+ LOGW ("not implemented for %s", m_name.c_str ());
+}
+
bool PanelAgentBase::process_key_event (int client, uint32 context, const String& uuid, KeyEvent& key, uint32 serial)
{
LOGW ("not implemented for %s", m_name.c_str ());
virtual void resume_helper_option_window (int client, uint32 context, const String& uuid);
/**
+ * @brief set_helper_keyboard_mode.
+ *
+ * @param
+ *
+ * @return none.
+ */
+ virtual void set_helper_keyboard_mode (int client, uint32 context, const String& uuid, uint32& mode);
+
+ /**
* @brief process_key_event.
*
* @param
_p->resume_helper_option_window (id, context_id, uuid);
}
+void PanelAgentManager::set_helper_keyboard_mode (int id, uint32 context_id, const String& uuid, uint32& mode)
+{
+ PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
+
+ if (!_p.null ())
+ _p->set_helper_keyboard_mode (id, context_id, uuid, mode);
+}
+
bool PanelAgentManager::process_key_event (int id, uint32 context_id, const String& uuid, KeyEvent& key, uint32 serial)
{
PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
void set_helper_caps_mode (int client, uint32 context, const String& uuid, uint32& mode);
void show_helper_option_window (int client, uint32 context, const String& uuid);
void resume_helper_option_window (int client, uint32 context, const String& uuid);
+ void set_helper_keyboard_mode (int client, uint32 context, const String& uuid, uint32& mode);
bool process_key_event (int client, uint32 context, const String& uuid, KeyEvent& key, uint32 serial);
bool get_helper_geometry (int client, uint32 context, String& uuid, _OUT_ struct rectinfo& info);
void get_helper_imdata (int client, uint32 context, String& uuid, _OUT_ char** imdata, _OUT_ size_t& len);
int need_update_selection_text;
uint32 layout;
bool ise_show_flag;
+ bool hw_keyboard_mode;
HelperAgentSignalVoid signal_exit;
HelperAgentSignalVoid signal_attach_input_context;
HelperAgentImpl (HelperAgent* thiz) : magic(0), magic_active(0), timeout(-1), focused_ic ((uint32) -1), thiz (thiz),
surrounding_text (NULL), selection_text (NULL), cursor_pos (0),
need_update_surrounding_text (0), need_update_selection_text (0),
- layout (0), ise_show_flag (false) {
+ layout (0), ise_show_flag (false), hw_keyboard_mode (false) {
}
~HelperAgentImpl () {
MessageItemUpdateCursorPosition *subclass = static_cast<MessageItemUpdateCursorPosition*>(message);
m_impl->cursor_pos = subclass->get_cursor_pos_ref();
LOGD ("update cursor position %d", subclass->get_cursor_pos_ref());
- if (m_impl->ise_show_flag) {
+ if (m_impl->ise_show_flag || m_impl->hw_keyboard_mode) {
m_impl->signal_update_cursor_position (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref(),
subclass->get_cursor_pos_ref());
if (!m_impl->si.null ()) m_impl->si->update_cursor_position(subclass->get_cursor_pos_ref());
m_impl->signal_focus_out (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
m_impl->focused_ic = (uint32) -1;
if (!m_impl->si.null ()) m_impl->si->focus_out();
+ m_impl->ise_show_flag = false;
break;
}
case SCIM_TRANS_CMD_FOCUS_IN:
m_impl->signal_focus_in (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
m_impl->focused_ic = subclass->get_ic_ref();
if (!m_impl->si.null ()) m_impl->si->focus_in();
- m_impl->ise_show_flag = false;
break;
}
case ISM_TRANS_CMD_SHOW_ISE_PANEL:
case ISM_TRANS_CMD_SET_RETURN_KEY_TYPE:
{
MessageItemSetReturnKeyType *subclass = static_cast<MessageItemSetReturnKeyType*>(message);
- if (m_impl->ise_show_flag) {
+ if (m_impl->ise_show_flag || m_impl->hw_keyboard_mode) {
m_impl->signal_set_return_key_type (this, subclass->get_type_ref());
}
break;
case ISM_TRANS_CMD_SET_RETURN_KEY_DISABLE:
{
MessageItemSetReturnKeyDisable *subclass = static_cast<MessageItemSetReturnKeyDisable*>(message);
- if (m_impl->ise_show_flag) {
+ if (m_impl->ise_show_flag || m_impl->hw_keyboard_mode) {
m_impl->signal_set_return_key_disable (this, subclass->get_disabled_ref());
}
break;
{
MessageItemSetLayout *subclass = static_cast<MessageItemSetLayout*>(message);
m_impl->layout = subclass->get_layout_ref();
- if (m_impl->ise_show_flag) {
+ if (m_impl->ise_show_flag || m_impl->hw_keyboard_mode) {
m_impl->signal_set_layout (this, subclass->get_layout_ref());
if (!m_impl->si.null ()) m_impl->si->set_layout(subclass->get_layout_ref());
}
case ISM_TRANS_CMD_SET_CAPS_MODE:
{
MessageItemSetCapsMode *subclass = static_cast<MessageItemSetCapsMode*>(message);
- if (m_impl->ise_show_flag) {
+ if (m_impl->ise_show_flag || m_impl->hw_keyboard_mode) {
m_impl->signal_set_caps_mode (this, subclass->get_mode_ref());
}
break;
if (!m_impl->si.null ()) m_impl->si->set_prediction_allow(subclass->get_prediction_allow_ref() == 0 ? false : true);
break;
}
+ case ISM_TRANS_CMD_SET_KEYBOARD_MODE:
+ {
+ MessageItemSetKeyboardMode *subclass = static_cast<MessageItemSetKeyboardMode*>(message);
+ if (subclass->get_mode_ref())
+ m_impl->hw_keyboard_mode = false;
+ else
+ m_impl->hw_keyboard_mode = true;
+ break;
+ }
default:
break;
}
const int ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW = 1125;
const int ISM_TRANS_CMD_PROCESS_INPUT_DEVICE_EVENT = 1126;
const int ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW = 1127;
+const int ISM_TRANS_CMD_SET_KEYBOARD_MODE = 1128;
/* ISE/Panel to IMControl */
const int ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT = 1151;