LOGD ("cursor pos : %d\n", elm_entry_cursor_pos_get (obj));
}
+static void _commit_content_cb (void *data, Ecore_IMF_Context *ctx, void *event)
+{
+ Ecore_IMF_Event_Commit_Content *commit_content = (Ecore_IMF_Event_Commit_Content *)event;
+ if (!commit_content) return;
+
+ LOGD ("content : %s, description : %s, mime types : %s\n", commit_content->content_uri, commit_content->description, commit_content->mime_types);
+}
+
static Evas_Object *_create_ef_layout (Evas_Object *parent, const char *label, const char *guide_text, Elm_Input_Panel_Layout layout, int layout_variation = 0)
{
Evas_Object *en;
ic = (Ecore_IMF_Context *)elm_entry_imf_context_get (en);
if (ic != NULL) {
+ ecore_imf_context_event_callback_add (ic, ECORE_IMF_CALLBACK_COMMIT_CONTENT, _commit_content_cb, NULL);
+
ecore_imf_context_input_panel_event_callback_add (ic, ECORE_IMF_INPUT_PANEL_STATE_EVENT, _input_panel_state_cb, NULL);
ecore_imf_context_input_panel_event_callback_add (ic, ECORE_IMF_INPUT_PANEL_GEOMETRY_EVENT, _input_panel_resize_cb, NULL);
ecore_imf_context_input_panel_event_callback_add (ic, ECORE_IMF_INPUT_PANEL_SHIFT_MODE_EVENT, _shift_mode_cb, NULL);
}
static void
+text_input_commit_content(void *data,
+ struct wl_text_input *text_input EINA_UNUSED,
+ uint32_t serial EINA_UNUSED,
+ const char *content,
+ const char *description,
+ const char *mime_types)
+{
+ WaylandIMContext *imcontext = (WaylandIMContext *)data;
+ if (!imcontext || !imcontext->ctx) return;
+
+ Ecore_IMF_Event_Commit_Content ev;
+ ev.content_uri = content;
+ ev.mime_types = mime_types;
+ ev.description = description;
+
+ SECURE_LOGD("commit content : %s, description : %s, mime types : %s\n", content, description, mime_types);
+
+ ecore_imf_context_event_callback_call(imcontext->ctx, ECORE_IMF_CALLBACK_COMMIT_CONTENT, (void *)&ev);
+}
+
+static void
text_input_input_panel_data(void *data,
struct wl_text_input *text_input EINA_UNUSED,
uint32_t serial EINA_UNUSED,
text_input_get_surrounding_text,
text_input_filter_key_event_done,
text_input_hide_permission,
- text_input_recapture_string
+ text_input_recapture_string,
+ text_input_commit_content
//
};
}
void
+SocketFrontEnd::commit_content (int id, const String &content, const String &description, const String &mime_types)
+{
+ if (m_current_instance == id) {
+ m_send_trans.put_command (SCIM_TRANS_CMD_COMMIT_CONTENT);
+ m_temp_trans.put_data (content);
+ m_temp_trans.put_data (description);
+ m_temp_trans.put_data (mime_types);
+ }
+}
+
+void
SocketFrontEnd::expand_candidate (int id)
{
if (m_current_instance == id)
ISF_CANDIDATE_MODE_T mode);
virtual void send_private_command (int id, const String &command);
+ virtual void commit_content (int id, const String &content, const String &description, const String &mime_types);
public:
virtual void init (int argc, char **argv);
m_send_trans.write_to_socket(socket_client);
}
+ void commit_content(int client, uint32 focused_context, String content, String description, String mime_types) {
+ LOGD ("client id:%d\n", client);
+
+ Socket socket_client(client);
+ lock();
+ m_send_trans.clear();
+ m_send_trans.put_command(SCIM_TRANS_CMD_REPLY);
+ m_send_trans.put_data(focused_context);
+ m_send_trans.put_command(SCIM_TRANS_CMD_COMMIT_CONTENT);
+ m_send_trans.put_data(content);
+ m_send_trans.put_data(description);
+ m_send_trans.put_data(mime_types);
+ m_send_trans.write_to_socket(socket_client);
+ }
+
void helper_all_update_spot_location(int client, uint32 context_id, String uuid, int x, int y) {
LOGD ("client id:%d\n", client);
//FIXME: useless
//} else if (cmd == ISM_TRANS_CMD_UPDATE_ISE_EXIT) {
// m_info_manager->UPDATE_ISE_EXIT(client_id);
+ } else if (cmd == SCIM_TRANS_CMD_COMMIT_CONTENT) {
+ String content;
+ String description;
+ String mime_types;
+
+ if (m_recv_trans.get_data(content) &&
+ m_recv_trans.get_data(description) &&
+ m_recv_trans.get_data(mime_types)) {
+ m_info_manager->socket_helper_commit_content(client_id, content, description, mime_types);
+ } else {
+ LOGW ("wrong format of transaction\n");
+ }
} else if (cmd == ISM_TRANS_CMD_PROCESS_KEY_EVENT_DONE) {
KeyEvent key;
uint32 ret;
}
void
+ commit_content (int id, uint32 context_id, const String& content, const String& description, const String& mime_types) {
+ LOGD ("client id:%d", id);
+ if (_focused_ic && _focused_ic->im_ctx)
+ wl_input_method_context_commit_content (_focused_ic->im_ctx, _focused_ic->serial, content.c_str (), description.c_str (), mime_types.c_str ());
+ }
+
+ void
hide_helper_ise (int id, uint32 context_id)
{
LOGD ("client id:%d", id);
m_panel_agent_manager.send_private_command (focused_client, focused_context, command);
}
}
+ //SCIM_TRANS_CMD_COMMIT_CONTENT
+ void socket_helper_commit_content (int client, String content, String description, String mime_types) {
+ SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
+ LOGD ("");
+ int focused_client;
+ uint32 focused_context;
+ String focused_uuid = 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.commit_content (focused_client, focused_context, content, description, mime_types);
+ }
+ }
//ISM_TRANS_CMD_UPDATE_ISE_EXIT
//void UPDATE_ISE_EXIT (int client) {
// LOGD ("");
m_impl->socket_helper_send_private_command (client, command);
}
+//SCIM_TRANS_CMD_COMMIT_CONTENT
+void InfoManager::socket_helper_commit_content (int client, String content, String description, String mime_types)
+{
+ m_impl->socket_helper_commit_content (client, content, description, mime_types);
+}
+
//ISM_TRANS_CMD_UPDATE_ISE_EXIT
//void InfoManager::UPDATE_ISE_EXIT (int client)
//{
//SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
void socket_helper_send_private_command (int client, String command);
+ //SCIM_TRANS_CMD_SEND_COMMIT_CONTENT
+ void socket_helper_commit_content (int client, String content, String description, String mime_types);
+
//ISM_TRANS_CMD_UPDATE_ISE_EXIT
//void UPDATE_ISE_EXIT (int client);
LOGW ("not implemented for %s", m_name.c_str ());
}
+//socket_helper_commit_content
+//SCIM_TRANS_CMD_COMMIT_CONTENT
+void PanelAgentBase::commit_content (int client, uint32 context, const String& content, const String& description, const String& mime_types)
+{
+ LOGW ("not implemented for %s", m_name.c_str ());
+}
+
//SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
void PanelAgentBase::helper_all_update_spot_location (int client, uint32 context, String uuid, int x, int y)
{
*/
virtual void send_fail_reply (int client);
+ /**
+ * @brief commit_content.
+ *
+ * @param
+ *
+ * @return none.
+ */
+ virtual void commit_content (int client, uint32 context, const String& content, const String& description, const String& mime_types);
};
/** @} */
_p->send_private_command (id, context_id, command);
}
+void PanelAgentManager::commit_content (int id, uint32 context_id, String content, String description, String mime_types)
+{
+ PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
+
+ if (!_p.null ())
+ _p->commit_content (id, context_id, content, description, mime_types);
+}
+
void PanelAgentManager::helper_all_update_spot_location (int id, uint32 context_id, String uuid, int x, int y)
{
PanelAgentPointer _p = m_impl->get_panel_agent_by_id (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 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 helper_all_update_cursor_position (int client_id, uint32 context_id, String uuid, int cursor_pos);
void helper_all_update_screen (int client_id, uint32 context_id, String uuid, int screen);
}
void
+ slot_commit_content (IMEngineInstanceBase *si,
+ const String &content,
+ const String &description,
+ const String &mime_types)
+ {
+ LOGD ("");
+ thiz->commit_content (content, description, mime_types);
+ }
+
+ void
attach_instance ()
{
si->signal_connect_show_preedit_string (
}
/**
+ * @brief Commit content to an application.
+ *
+ * @param content The content sent from IME.
+ */
+void
+HelperAgent::commit_content (const String &content, const String &description, const String &mime_types) const
+{
+ LOGD ("");
+ 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 (SCIM_TRANS_CMD_COMMIT_CONTENT);
+ m_impl->send.put_data (content);
+ m_impl->send.put_data (description);
+ m_impl->send.put_data (mime_types);
+ m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
+ }
+}
+
+/**
* @brief Request to get uuid list of all keyboard ISEs.
*
* @param uuid The helper ISE UUID.
void send_private_command (const String &command) const;
/**
+ * @brief Commit content to an application
+ *
+ * @param content The content sent from IME.
+ */
+ void commit_content (const String &content,
+ const String &description,
+ const String &mime_types) const;
+
+ /**
* @brief Request panel to hide ISE, since in some cases ISE cannot hide itself (e.g. WAYLAND)
*/
void request_ise_hide (void) const;
const int SCIM_TRANS_CMD_GET_SELECTION = 174;
const int SCIM_TRANS_CMD_SET_SELECTION = 175;
const int SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND = 176;
+const int SCIM_TRANS_CMD_COMMIT_CONTENT = 177;
// Socket IMEngine to Socket FrontEnd
const int SCIM_TRANS_CMD_NEW_INSTANCE = 200;