} else {
LOGW ("wrong format of transaction");
}
+ } else if (cmd == ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE) {
+ String locale;
+
+ char* data = NULL;
+ size_t len;
+ if (m_recv_trans.get_data(&data, len)) {
+ if (data && len) {
+ locale = String(data, len);
+ m_info_manager->socket_helper_update_language_locale(client_id, locale);
+ } else {
+ LOGW("wrong format of transaction : %p %d", data, len);
+ }
+ } else {
+ LOGW("wrong format of transaction");
+ }
} else if (cmd == ISM_TRANS_CMD_GET_KEYBOARD_ISE_LIST) {
String uuid;
if (type == ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT) {
WSCContextISF* ic = find_ic (context);
- if (ic) {
- isf_wsc_context_input_panel_language_locale_get (_focused_ic, &(ic->language));
- if (ic->language)
- wl_input_method_context_language (_focused_ic->im_ctx, _focused_ic->serial, ic->language);
+ if (ic && ic->language) {
+ wl_input_method_context_language (_focused_ic->im_ctx, _focused_ic->serial, ic->language);
+ }
+ else {
+ LOGE("language locale query failed : %p %s", ic, (ic ? ic->language : "NULL"));
+ wl_input_method_context_language (_focused_ic->im_ctx, _focused_ic->serial, "");
}
}
wl_input_method_context_input_panel_event (_focused_ic->im_ctx, _focused_ic->serial, type, value);
}
+ void
+ update_ise_language_locale (int client, uint32 context, String locale) {
+ if (!_focused_ic || !_focused_ic->im_ctx)
+ return;
+
+ WSCContextISF* ic = find_ic (context);
+ if (ic && locale.length() > 0) {
+ if (ic->language) {
+ free(ic->language);
+ ic->language = NULL;
+ }
+ ic->language = strdup(locale.c_str());
+ }
+ }
+
#if 0
void
request_help (int id, uint32 context_id) {
InfoManagerSignalVoid m_signal_start_default_ise;
InfoManagerSignalVoid m_signal_stop_default_ise;
InfoManagerSignalIntInt m_signal_update_input_context;
+ InfoManagerSignalString m_signal_update_language_locale;
InfoManagerSignalIntInt m_signal_set_candidate_ui;
InfoManagerSignalIntInt2 m_signal_get_candidate_ui;
InfoManagerSignalIntInt m_signal_set_candidate_position;
return m_signal_update_input_context.connect (slot);
}
+ Connection signal_connect_update_language_locale(InfoManagerSlotString* slot) {
+ return m_signal_update_language_locale.connect(slot);
+ }
+
Connection signal_connect_show_ise (InfoManagerSlotVoid* slot) {
return m_signal_show_ise.connect (slot);
}
std::cerr << "focused client is not existed!!!" << "\n";
}
}
+ //ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE
+ void socket_helper_update_language_locale(int client, String locale) {
+ SCIM_DEBUG_MAIN(4) << "InfoManager::socket_helper_update_language_locale (" << client << ")\n";
+ m_signal_update_language_locale(locale);
+
+ int focused_client;
+ uint32 focused_context;
+ get_focused_context(focused_client, focused_context);
+ ClientInfo client_info = socket_get_client_info(focused_client);
+
+ if (client_info.type == FRONTEND_CLIENT) {
+ m_panel_agent_manager.update_ise_language_locale(focused_client, focused_context, locale);
+ } else {
+ std::cerr << "focused client is not existed!!!" << "\n";
+ }
+ }
//SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
void socket_helper_send_private_command (int client, String command) {
SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
m_impl->socket_helper_update_input_context (client, type, value);
}
+//ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE
+void InfoManager::socket_helper_update_language_locale(int client, String locale)
+{
+ m_impl->socket_helper_update_language_locale(client, locale);
+}
+
//SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
void InfoManager::socket_helper_send_private_command (int client, String command)
{
//ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
void socket_helper_update_input_context (int client, uint32 type, uint32 value);
+ //ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE
+ void socket_helper_update_language_locale(int client, String locale);
+
//SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
void socket_helper_send_private_command (int client, String command);
{
}
+//socket_helper_update_language_locale
+//ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE
+void PanelAgentBase::update_ise_language_locale(int client, uint32 context, String locale)
+{
+}
+
//socket_helper_send_private_command
//SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
void PanelAgentBase::send_private_command (int client, uint32 context, const String& command)
virtual void update_ise_input_context (int client, uint32 context, uint32 type, uint32 value);
/**
+ * @brief update_ise_language_locale.
+ *
+ * @param
+ *
+ * @return none.
+ */
+ virtual void update_ise_language_locale (int client, uint32 context, String locale);
+
+ /**
* @brief send_private_command.
*
* @param
_p->update_ise_input_context (id, context_id, type, value);
}
+void PanelAgentManager::update_ise_language_locale(int id, uint32 context_id, String locale)
+{
+ PanelAgentPointer _p = m_impl->get_panel_agent_by_id(id);
+
+ if (!_p.null())
+ _p->update_ise_language_locale(id, context_id, locale);
+}
+
void PanelAgentManager::send_private_command (int id, uint32 context_id, String command)
{
PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
void socket_helper_delete_surrounding_text (int client, uint32 context_id, uint32 offset, uint32 len);
void socket_helper_get_selection (int client, uint32 context_id);
void socket_helper_set_selection (int client, uint32 context_id, uint32 start, uint32 end);
- void update_ise_input_context (int focused_client, uint32 focused_context, uint32 type, uint32 value);
+ void update_ise_input_context (int focused_client, uint32 focused_context, uint32 type, uint32 value);
+ void update_ise_language_locale (int focused_client, uint32 focused_context, String locale);
void send_private_command (int focused_client, uint32 focused_context, String command);
void commit_content (int focused_client, uint32 focused_context, String content, String description, String mime_types);
void helper_all_update_spot_location (int client_id, uint32 context_id, String uuid, int x, int y);
void
HelperAgent::update_input_context (uint32 type, uint32 value) const
{
+ /* Update all state variables that could be queried by the client application */
+ char *buf = NULL;
+ m_impl->signal_get_language_locale(this, -1, &buf);
+
+ if (buf != NULL) {
+ if (m_impl->socket_active.is_connected()) {
+ m_impl->send.clear();
+ m_impl->send.put_command(SCIM_TRANS_CMD_REQUEST);
+ m_impl->send.put_data(m_impl->magic_active);
+ m_impl->send.put_command(ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE);
+ m_impl->send.put_data(buf, strlen(buf));
+ m_impl->send.write_to_socket(m_impl->socket_active, m_impl->magic_active);
+ }
+ delete[] buf;
+ buf = NULL;
+ }
+
if (m_impl->socket_active.is_connected ()) {
m_impl->send.clear ();
m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
* c. m_signal_get_surrounding_text and m_signal_delete_surrounding_text
* d. m_signal_show_preedit_string, m_signal_hide_preedit_string, m_signal_update_preedit_string and m_signal_update_preedit_caret
* e. m_signal_candidate_more_window_show, m_signal_candidate_more_window_hide, m_signal_longpress_candidate
- * f. m_signal_update_ise_input_context, m_signal_update_isf_candidate_panel
+ * f. m_signal_update_ise_input_context, m_signal_update_ise_language_locale, m_signal_update_isf_candidate_panel
* 2. Add new interface APIs in PanelClient class
* a. update_cursor_position () and update_surrounding_text ()
* b. expand_candidate (), contract_candidate () and set_candidate_style ()
/* ISE/Panel to IMControl */
const int ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT = 1151;
const int ISM_TRANS_CMD_UPDATE_ISF_CANDIDATE_PANEL = 1152;
+const int ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE = 1153;
/* ISE to Panel */