static void test_get_ise_count (void *data, Evas_Object *obj, void *event_info);
static void test_reset_default_ise (void *data, Evas_Object *obj, void *event_info);
static void test_show_ise_selector (void *data, Evas_Object *obj, void *event_info);
+static void test_show_ise_option (void *data, Evas_Object *obj, void *event_info);
static struct _menu_item imcontrol_menu_its[] = {
{ "PANEL GEOMETRY GET", test_input_panel_geometry_get },
{ "GET ISE COUNT", test_get_ise_count },
{ "RESET DEFAULT ISE", test_reset_default_ise },
{ "SHOW ISE SELECTOR", test_show_ise_selector },
+ { "SHOW ISE OPTION", test_show_ise_option },
/* do not delete below */
{ NULL, NULL}
LOGD ("Show ISE selector is failed!!!\n");
}
+static void test_show_ise_option (void *data, Evas_Object *obj, void *event_info)
+{
+ int ret = isf_control_show_ise_option_window ();
+ if (ret == 0)
+ LOGD ("Show ISE option window is successful!\n");
+ else
+ LOGW ("Show ISE option window is failed!!!\n");
+}
+
static void test_get_initial_ise (void *data, Evas_Object *obj, void *event_info)
{
char *uuid = NULL;
return ise_count;
}
+EAPI int isf_control_show_ise_option_window (void)
+{
+ IMControlClient imcontrol_client;
+ imcontrol_client.open_connection ();
+ imcontrol_client.prepare ();
+ imcontrol_client.show_ise_option_window ();
+ imcontrol_client.send ();
+ imcontrol_client.close_connection ();
+ return 0;
+}
+
/*
vi:ts=4:nowrap:ai:expandtab
*/
*/
EAPI int isf_control_get_ise_count (ISE_TYPE_T type);
+/**
+ * @brief Show ISE's option window.
+ *
+ * @return 0 if successfully, otherwise return -1;
+ */
+EAPI int isf_control_show_ise_option_window ();
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
void show_ise_selector (void) {
m_trans.put_command (ISM_TRANS_CMD_SHOW_ISF_CONTROL);
}
+
+ void show_ise_option_window (void) {
+ m_trans.put_command (ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW);
+ }
};
IMControlClient::IMControlClient ()
{
m_impl->show_ise_selector ();
}
+
+void IMControlClient::show_ise_option_window (void)
+{
+ m_impl->show_ise_option_window ();
+}
+
};
/*
void set_active_ise_to_default (void);
void set_initial_ise_by_uuid (const char* uuid);
void show_ise_selector ();
+ void show_ise_option_window ();
};
}
HelperAgentSignalUintVoid signal_set_input_mode;
HelperAgentSignalUintVoid signal_set_input_hint;
HelperAgentSignalUintVoid signal_update_bidi_direction;
+ HelperAgentSignalVoid signal_show_option_window;
public:
HelperAgentImpl () : magic (0), magic_active (0), timeout (-1), focused_ic ((uint32) -1) { }
m_impl->signal_update_bidi_direction (this, bidi_direction);
break;
}
+ case ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW:
+ {
+ m_impl->signal_show_option_window (this, ic, ic_uuid);
+ break;
+ }
default:
break;
}
return m_impl->signal_longpress_candidate.connect (slot);
}
+/**
+ * @brief Connect a slot to Helper show option window.
+ *
+ * This signal is used to do request the ISE to show option window.
+ *
+ * The prototype of the slot is:
+ * void show_option_window (const HelperAgent *agent, int ic, const String &uuid);
+ */
+Connection
+HelperAgent::signal_connect_show_option_window (HelperAgentSlotVoid *slot)
+{
+ return m_impl->signal_show_option_window.connect (slot);
+}
+
} /* namespace scim */
/*
* void update_bidi_direction (const HelperAgent *agent, uint32 &bidi_direction);
*/
Connection signal_connect_update_bidi_direction (HelperAgentSlotUintVoid *slot);
+
+ /**
+ * @brief Connect a slot to Helper show option window.
+ *
+ * This signal is used to do request the ISE to show option window.
+ *
+ * The prototype of the slot is:
+ * void show_option_window (const HelperAgent *agent, int ic, const String &uuid);
+ */
+ Connection signal_connect_show_option_window (HelperAgentSlotVoid *slot);
};
/** @} */
return false;
}
+ bool show_helper_option_window (const String &uuid)
+ {
+ HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
+
+ if (it != m_helper_client_index.end ()) {
+ int client;
+ uint32 context;
+ Socket client_socket (it->second.id);
+ uint32 ctx;
+
+ get_focused_context (client, context);
+ ctx = get_helper_ic (client, context);
+
+ m_send_trans.clear ();
+ m_send_trans.put_command (SCIM_TRANS_CMD_REPLY);
+ m_send_trans.put_data (ctx);
+ m_send_trans.put_data (uuid);
+ m_send_trans.put_command (ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW);
+ m_send_trans.write_to_socket (client_socket);
+
+ ISF_SAVE_LOG ("Send ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW message\n");
+
+ return true;
+ }
+ return false;
+ }
+
void show_isf_panel (int client_id)
{
SCIM_DEBUG_MAIN(4) << "PanelAgent::show_isf_panel ()\n";
trans.write_to_socket (client_socket);
}
+ void show_ise_option_window (int client_id)
+ {
+ SCIM_DEBUG_MAIN(4) << "PanelAgent::show_ise_panel ()\n";
+
+ String initial_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
+ String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
+
+ ISF_SAVE_LOG ("prepare to show ISE option window %d [%s] [%s]\n", client_id, initial_uuid.c_str(), default_uuid.c_str());
+
+ if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode) {
+ show_helper_option_window (m_current_helper_uuid);
+ }
+ }
+
Connection signal_connect_reload_config (PanelAgentSlotVoid *slot)
{
return m_signal_reload_config.connect (slot);
} else if (cmd == ISM_TRANS_CMD_UPDATE_BIDI_DIRECTION) {
update_ise_bidi_direction (client_id);
continue;
+ } else if (cmd == ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW) {
+ show_ise_option_window (client_id);
+ continue;
}
current = last = false;
reset_default_ise (client_id);
else if (cmd == ISM_TRANS_CMD_SHOW_ISF_CONTROL)
show_isf_panel (client_id);
+ else if (cmd == ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW)
+ show_ise_option_window (client_id);
}
socket_transaction_end ();
const int ISM_TRANS_CMD_SET_INPUT_MODE = 1122;
const int ISM_TRANS_CMD_SET_INPUT_HINT = 1123;
const int ISM_TRANS_CMD_UPDATE_BIDI_DIRECTION = 1124;
+const int ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW = 1125;
/* ISE/Panel to IMControl */
const int ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT = 1151;