recapture string will be used for deleting the existed text and inserting preedit or commit string.
It's for avoiding the blinking due to the deleting and update preedit or commit string
Change-Id: I509755429e1e9c78cd1e2d27e4c821c669fc234f
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
text,
imcontext->preedit_text ? imcontext->preedit_text : "");
- old_preedit =
- imcontext->preedit_text && strlen(imcontext->preedit_text) > 0;
-
if (!imcontext->ctx)
return;
+ old_preedit =
+ imcontext->preedit_text && strlen(imcontext->preedit_text) > 0;
+
if (!check_serial(imcontext, serial))
return;
return EINA_TRUE;
}
+static void delete_surrounding_text(WaylandIMContext *imcontext, int index, int length)
+{
+ Ecore_IMF_Event_Delete_Surrounding ev;
+ LOGD("delete surrounding text (index: %d, length: %u)",
+ index, length);
+
+ ev.offset = index;
+ ev.n_chars = length;
+
+ ecore_imf_context_delete_surrounding_event_add(imcontext->ctx, ev.offset, ev.n_chars);
+ ecore_imf_context_event_callback_call(imcontext->ctx, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, &ev);
+}
+
static void
text_input_preedit_string(void *data,
struct wl_text_input *text_input EINA_UNUSED,
uint32_t length)
{
WaylandIMContext *imcontext = (WaylandIMContext *)data;
- Ecore_IMF_Event_Delete_Surrounding ev;
- LOGD("delete surrounding text (index: %d, length: %u)",
- index, length);
-
- ev.offset = index;
- ev.n_chars = length;
-
- ecore_imf_context_delete_surrounding_event_add(imcontext->ctx, ev.offset, ev.n_chars);
- ecore_imf_context_event_callback_call(imcontext->ctx, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, &ev);
+ delete_surrounding_text(imcontext, index, length);
}
static void
if (permission)
ecore_imf_context_input_panel_hide(imcontext->ctx);
}
+
+static void
+text_input_recapture_string(void *data,
+ struct wl_text_input *text_input EINA_UNUSED,
+ uint32_t serial,
+ int32_t index,
+ uint32_t length,
+ const char *preedit,
+ const char *preedit_commit,
+ const char *commit)
+{
+ WaylandIMContext *imcontext = (WaylandIMContext *)data;
+ Eina_Bool old_preedit = EINA_FALSE;
+ Eina_Bool preedit_changed = EINA_FALSE;
+
+ SECURE_LOGD("preedit event (preedit: '%s', current pre-edit: '%s')",
+ preedit,
+ imcontext->preedit_text ? imcontext->preedit_text : "");
+
+ if (!check_serial(imcontext, serial))
+ return;
+
+ old_preedit =
+ imcontext->preedit_text && strlen(imcontext->preedit_text) > 0;
+
+ if (imcontext->preedit_text)
+ preedit_changed = (strcmp(imcontext->preedit_text, preedit) != 0);
+ else
+ preedit_changed = (strlen(preedit) != 0);
+
+ clear_preedit(imcontext);
+
+ // send transaction start
+ ecore_imf_context_event_callback_call(imcontext->ctx, ECORE_IMF_CALLBACK_PRIVATE_COMMAND_SEND, (void *)"TRANSACTION_START");
+
+ // delete surrounding text
+ delete_surrounding_text(imcontext, index, length);
+
+ // update preedit string
+ imcontext->preedit_text = strdup(preedit);
+ imcontext->preedit_commit = (strlen(preedit) > 0 ? strdup(preedit_commit) : NULL);
+ imcontext->preedit_cursor =
+ utf8_offset_to_characters(preedit, imcontext->pending_preedit.cursor);
+ imcontext->preedit_attrs = imcontext->pending_preedit.attrs;
+
+ imcontext->pending_preedit.attrs = NULL;
+
+ if (preedit_changed) {
+ if (!old_preedit) {
+ ecore_imf_context_preedit_start_event_add(imcontext->ctx);
+ ecore_imf_context_event_callback_call(imcontext->ctx,
+ ECORE_IMF_CALLBACK_PREEDIT_START,
+ NULL);
+ }
+
+ ecore_imf_context_preedit_changed_event_add(imcontext->ctx);
+ ecore_imf_context_event_callback_call(imcontext->ctx,
+ ECORE_IMF_CALLBACK_PREEDIT_CHANGED,
+ NULL);
+
+ if (imcontext->preedit_text && strlen(imcontext->preedit_text) == 0) {
+ ecore_imf_context_preedit_end_event_add(imcontext->ctx);
+ ecore_imf_context_event_callback_call(imcontext->ctx,
+ ECORE_IMF_CALLBACK_PREEDIT_END,
+ NULL);
+ }
+ }
+
+ // commit string
+ if (commit && strlen(commit) != 0) {
+ ecore_imf_context_commit_event_add(imcontext->ctx, commit);
+ ecore_imf_context_event_callback_call(imcontext->ctx, ECORE_IMF_CALLBACK_COMMIT, (void *)commit);
+ }
+
+ // send transaction end
+ ecore_imf_context_event_callback_call(imcontext->ctx, ECORE_IMF_CALLBACK_PRIVATE_COMMAND_SEND, (void *)"TRANSACTION_END");
+}
//
static const struct wl_text_input_listener text_input_listener =
text_input_get_selection_text,
text_input_get_surrounding_text,
text_input_filter_key_event_done,
- text_input_hide_permission
+ text_input_hide_permission,
+ text_input_recapture_string
//
};
}
void
+SocketFrontEnd::recapture_string (int id, int offset, int len, const WideString & preedit, const WideString & commit, const AttributeList & attrs)
+{
+ if (m_current_instance == id) {
+ m_send_trans.put_command (ISM_TRANS_CMD_RECAPTURE_STRING);
+ m_send_trans.put_data ((uint32) offset);
+ m_send_trans.put_data ((uint32) len);
+ m_send_trans.put_data (preedit);
+ m_send_trans.put_data (attrs);
+ m_send_trans.put_data (commit);
+ }
+}
+
+void
SocketFrontEnd::forward_key_event (int id, const KeyEvent & key)
{
if (m_current_instance == id) {
virtual void update_aux_utf8_string (int id, const char * buf, int buflen, const AttributeList & attrs);
virtual void commit_string (int id, const WideString & str);
virtual void commit_utf8_string (int id, const char * buf, int buflen);
+ virtual void recapture_string (int id, int offset, int len, const WideString & preedit, const WideString & commit, const AttributeList & attrs);
virtual void forward_key_event (int id, const KeyEvent & key);
virtual void update_lookup_table (int id, const LookupTable & table);
$(LD_VERSION_SCRIPT_OPTION) \
@LIBTOOL_EXPORT_OPTIONS@ \
@LTLIBINTL@
-
+
socket_la_LIBADD = $(top_builddir)/ism/src/libscim@SCIM_EPOCH@.la
#include "scim_stl_map.h"
#include "isf_query_utility.h"
-
#define scim_module_init socket_LTX_scim_module_init
#define scim_module_exit socket_LTX_scim_module_exit
#define scim_imengine_module_init socket_LTX_scim_imengine_module_init
}
break;
}
+ case ISM_TRANS_CMD_RECAPTURE_STRING:
+ {
+ uint32 offset;
+ uint32 len;
+ WideString preedit, commit;
+ AttributeList attrs;
+ if (trans.get_data (offset) && trans.get_data (len) &&
+ trans.get_data (preedit) && trans.get_data (commit) && trans.get_data (attrs)) {
+ SCIM_DEBUG_IMENGINE(3) << " recapture_string ()\n";
+ recapture_string (offset, len, preedit, commit, attrs);
+ }
+ break;
+ }
case SCIM_TRANS_CMD_UPDATE_AUX_STRING:
{
WideString str;
m_info_manager->socket_update_aux_string(str, attrs);
else
LOGW ("wrong format of transaction\n");
+ } else if (cmd == ISM_TRANS_CMD_RECAPTURE_STRING) {
+ uint32 target_ic;
+ String target_uuid;
+ uint32 offset;
+ uint32 len;
+ WideString preedit;
+ WideString commit;
+ AttributeList attrs;
+
+ if (m_recv_trans.get_data(target_ic) &&
+ m_recv_trans.get_data(target_uuid) &&
+ m_recv_trans.get_data(offset) &&
+ m_recv_trans.get_data(len) &&
+ m_recv_trans.get_data(preedit) &&
+ m_recv_trans.get_data(commit) &&
+ m_recv_trans.get_data(attrs)) {
+ m_info_manager->socket_helper_recapture_string(client_id, target_ic, target_uuid, offset, len, preedit, commit, attrs);
+ } else {
+ LOGW ("wrong format of transaction\n");
+ }
} else if (cmd == SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE) {
CommonLookupTable _isf_candidate_table;
m_info_manager->socket_update_aux_string(str, attrs);
else
LOGW ("wrong format of transaction\n");
-
} else if (cmd == SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE) {
CommonLookupTable _isf_candidate_table;
}
} else if (cmd == ISM_TRANS_CMD_REQUEST_ISE_HIDE) {
m_info_manager->request_ise_hide();
+ } else if (cmd == ISM_TRANS_CMD_RECAPTURE_STRING) {
+ uint32 target_ic;
+ String target_uuid;
+ uint32 offset;
+ uint32 len;
+ WideString preedit;
+ WideString commit;
+ AttributeList attrs;
+
+ if (m_recv_trans.get_data(target_ic) &&
+ m_recv_trans.get_data(target_uuid) &&
+ m_recv_trans.get_data(offset) &&
+ m_recv_trans.get_data(len) &&
+ m_recv_trans.get_data(preedit) &&
+ m_recv_trans.get_data(commit) &&
+ m_recv_trans.get_data(attrs)) {
+ m_info_manager->socket_helper_recapture_string(client_id, target_ic, target_uuid, offset, len, preedit, commit, attrs);
+ } else {
+ LOGW ("wrong format of transaction\n");
+ }
} else {
LOGW ("unknown cmd: %d\n", cmd);
}
}
static void
-wsc_send_preedit (WSCContextISF* wsc_ctx, int32_t cursor)
+wsc_send_preedit_style (WSCContextISF* wsc_ctx)
{
LOGD ("");
if (!wsc_ctx) return;
-
- uint32_t index = strlen (wsc_ctx->preedit_str);
-
- if (wsc_ctx && wsc_ctx->impl && wsc_ctx->impl->is_on) {
+ if (wsc_ctx->impl && wsc_ctx->impl->is_on) {
String mbs = utf8_wcstombs (wsc_ctx->impl->preedit_string);
if (!wsc_ctx->impl->preedit_attrlist.empty ()) {
if (!wsc_ctx->impl->preedit_attrlist.empty ())
wsc_ctx->impl->preedit_attrlist.clear ();
}
+}
+
+static void
+wsc_send_preedit (WSCContextISF* wsc_ctx, int32_t cursor)
+{
+ LOGD ("");
+
+ if (!wsc_ctx) return;
+
+ uint32_t index = strlen (wsc_ctx->preedit_str);
+
+ wsc_send_preedit_style (wsc_ctx);
if (cursor > 0)
index = cursor;
}
}
+ void
+ recapture_string (int id, uint32 context_id, int offset, int len, WideString preedit, WideString commit, AttributeList& attrs) {
+ LOGD ("client id:%d", id);
+ SCIM_DEBUG_FRONTEND (1) << __FUNCTION__ << "...\n";
+ WSCContextISF* ic = find_ic (context_id);
+ String preedit_str = utf8_wcstombs (preedit);
+ String commit_str = utf8_wcstombs (commit);
+
+ if (ic && ic->impl && _focused_ic == ic) {
+ if (!ic->impl->is_on)
+ ic->impl->is_on = true;
+
+ check_input_resource (ic, INPUT_RESOURCE_LOCAL);
+
+ ic->impl->preedit_string = preedit;
+ ic->impl->preedit_attrlist = attrs;
+ ic->impl->commit_string = commit;
+
+ if (ic->impl->use_preedit) {
+ if (!ic->impl->preedit_started) {
+ if (!check_valid_ic (ic))
+ return;
+
+ ic->impl->preedit_started = true;
+ ic->impl->need_commit_preedit = true;
+ }
+ ic->impl->preedit_caret = preedit.length ();
+
+ // FIXME : cursor position
+ wl_input_method_context_preedit_cursor (ic->im_ctx, preedit.length());
+
+ wsc_send_preedit_style (ic);
+
+ wl_input_method_context_recapture_string (ic->im_ctx, ic->serial,
+ offset, len, preedit_str.c_str(), preedit_str.c_str(), commit_str.c_str());
+ } else {
+ g_info_manager->socket_recapture_string (offset, len, preedit_str, commit_str, attrs);
+ }
+ }
+ }
+
static Eina_Bool
surrounding_text_fd_read_func (void* data, Ecore_Fd_Handler* fd_handler) {
if (fd_handler == NULL || data == NULL)
typedef Signal3<void, const String&, const AttributeList&, int>
InfoManagerSignalAttributeStringInt;
+typedef Signal5<void, int, int, const String&, const String&, const AttributeList&>
+InfoManagerSignalAttributeInt2String2;
+
typedef Signal2<void, const String&, const AttributeList&>
InfoManagerSignalAttributeString;
InfoManagerSignalVoid m_signal_hide_lookup_table;
InfoManagerSignalVoid m_signal_hide_associate_table;
InfoManagerSignalAttributeStringInt m_signal_update_preedit_string;
+ InfoManagerSignalAttributeInt2String2 m_signal_recapture_string;
InfoManagerSignalInt m_signal_update_preedit_caret;
InfoManagerSignalAttributeString m_signal_update_aux_string;
InfoManagerSignalLookupTable m_signal_update_lookup_table;
return m_signal_update_preedit_caret.connect (slot);
}
+ Connection signal_connect_recapture_string (InfoManagerSlotAttributeInt2String2* slot) {
+ return m_signal_recapture_string.connect (slot);
+ }
+
Connection signal_connect_update_aux_string (InfoManagerSlotAttributeString* slot) {
return m_signal_update_aux_string.connect (slot);
}
m_signal_show_factory_menu (vec);
}
-
//SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
void socket_show_preedit_string (void) {
LOGD ("");
LOGD ("");
m_signal_update_preedit_caret ((int) caret);
}
+ //ISM_TRANS_CMD_RECAPTURE_STRING
+ void socket_recapture_string (int offset, int len, String& preedit, String& commit, const AttributeList& attrs) {
+ SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_caret ()\n";
+ LOGD ("");
+ m_signal_recapture_string (offset, len, preedit, commit, attrs);
+ }
//SCIM_TRANS_CMD_UPDATE_AUX_STRING
void socket_update_aux_string (String& str, const AttributeList& attrs) {
SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_aux_string ()\n";
}
}
+ //ISM_TRANS_CMD_RECAPTURE_STRING
+ void socket_helper_recapture_string (int client, uint32 target_ic, String target_uuid, int offset, int len, WideString preedit,
+ WideString commit, AttributeList& attrs) {
+ SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_recapture_string (" << client << ")\n";
+ int target_client;
+ uint32 target_context;
+ get_imengine_client_context (target_ic, target_client, target_context);
+ int focused_client;
+ uint32 focused_context;
+ String focused_uuid;
+ focused_uuid = get_focused_context (focused_client, focused_context);
+
+ if (target_ic == (uint32) (-1)) {
+ target_client = focused_client;
+ target_context = focused_context;
+ }
+
+ if (target_uuid.length () == 0)
+ target_uuid = focused_uuid;
+
+ if (target_uuid == focused_uuid &&
+ clients_equal (target_client, focused_client) &&
+ contexts_equal (target_context, focused_context)) {
+ ClientInfo client_info = socket_get_client_info (focused_client);
+
+ if (client_info.type == FRONTEND_CLIENT) {
+ m_panel_agent_manager.recapture_string (focused_client, focused_context, offset, len, preedit, commit, attrs);
+ }
+ }
+ }
+
//SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
void socket_helper_register_helper (int client, HelperInfo& info) {
SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_helper (" << client << ")\n";
m_impl->socket_update_preedit_caret (caret);
}
+//ISM_TRANS_CMD_RECAPTURE_STRING
+void InfoManager::socket_recapture_string (int offset, int len, String& preedit, String& commit, const AttributeList& attrs)
+{
+ m_impl->socket_recapture_string (offset, len, preedit, commit, attrs);
+}
+
//SCIM_TRANS_CMD_UPDATE_AUX_STRING
void InfoManager::socket_update_aux_string (String& str, const AttributeList& attrs)
{
m_impl->socket_helper_update_preedit_caret (client, caret);
}
+//ISM_TRANS_CMD_RECAPTURE_STRING
+void InfoManager::socket_helper_recapture_string (int client, uint32 target_ic, String target_uuid, int offset, int len, WideString preedit,
+ WideString commit, AttributeList& attrs)
+{
+ m_impl->socket_helper_recapture_string (client, target_ic, target_uuid, offset, len, preedit, commit, attrs);
+}
+
//SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
void InfoManager::socket_helper_register_helper (int client, HelperInfo& info)
{
typedef Slot3<void, const String&, const AttributeList&, int>
InfoManagerSlotAttributeStringInt;
+typedef Slot5<void, int, int, const String&, const String&, const AttributeList&>
+InfoManagerSlotAttributeInt2String2;
+
typedef Slot1<void, std::vector<String> &>
InfoManagerSlotStringVector;
//SCIM_TRANS_CMD_UPDATE_AUX_STRING
void socket_update_aux_string (String& str, const AttributeList& attrs);
+ //ISM_TRANS_CMD_RECAPTURE_STRING
+ void socket_recapture_string (int offset, int len, String& preedit, String& commit, const AttributeList& attrs);
+
//SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE
void socket_update_lookup_table (const LookupTable& table);
//SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
void socket_helper_update_preedit_caret (int client, uint32 caret);
+ //ISM_TRANS_CMD_RECAPTURE_STRING
+ void socket_helper_recapture_string (int client, uint32 target_ic, String target_uuid, int offset, int len, WideString preedit, WideString commit, AttributeList& attrs);
+
//SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
void socket_helper_register_helper (int client, HelperInfo& info);
Connection signal_connect_update_preedit_caret (InfoManagerSlotInt* slot);
/**
+ * @brief Signal: Recapture string.
+ *
+ * slot prototype: void recapture_string (int offset, int length, String preedit, String commit, Attribute &attrs);
+ */
+ Connection signal_connect_recapture_string (InfoManagerSlotAttributeInt2String2* slot);
+
+ /**
* @brief Signal: Update aux string.
*
* slot prototype: void update_aux_string (const String &str, const AttributeList &attrs);
{
LOGW ("not implemented for %s", m_name.c_str ());
}
+//socket_helper_recapture_string
+//ISM_TRANS_CMD_RECAPTURE_STRING
+void PanelAgentBase::recapture_string (int client, uint32 context, int offset, int len, WideString preedit, WideString commit, AttributeList& attrs)
+{
+ LOGW ("not implemented for %s", m_name.c_str ());
+}
//socket_helper_register_helper
//SCIM_TRANS_CMD_HELPER_ATTACH_INPUT_CONTEXT
//SCIM_TRANS_CMD_UPDATE_SCREEN
virtual void update_preedit_caret (int client, uint32 context, uint32 caret);
/**
+ * @brief recapture_string.
+ *
+ * @param
+ *
+ * @return none.
+ */
+ virtual void recapture_string (int client, uint32 context, int offset, int len, WideString preedit, WideString commit, AttributeList& attrs);
+
+ /**
* @brief attach_input_context and update_screen.
*
* @param
_p->update_preedit_caret (id, context_id, caret);
}
+void PanelAgentManager::recapture_string (int id, uint32 context_id, int offset, int len, WideString preedit, WideString commit, AttributeList& attrs)
+{
+ PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
+
+ if (!_p.null ())
+ _p->recapture_string (id, context_id, offset, len, preedit, commit, attrs);
+}
+
void PanelAgentManager::helper_attach_input_context_and_update_screen (int id, std::vector < std::pair <uint32, String> >& helper_ic_index,
uint32 current_screen)
{
void hide_preedit_string (int target_client, uint32 target_context);
void update_preedit_string (int target_client, uint32 target_context, WideString preedit, WideString commit, AttributeList& attrs, uint32 caret);
void update_preedit_caret (int focused_client, uint32 focused_context, uint32 caret);
+ void recapture_string (int target_client, uint32 target_context, int offset, int len, WideString preedit, WideString commit, AttributeList& attrs);
void helper_attach_input_context_and_update_screen (int client, std::vector < std::pair <uint32, String> >& helper_ic_index, uint32 current_screen);
void hide_helper_ise (int id, uint32 context);
bool process_input_device_event(int client, uint32 context, const String& uuid, uint32 type, const char *data, size_t len, _OUT_ uint32& result);
m_frontend->commit_utf8_string (si->get_id (), buf, buflen);
}
+ void slot_recapture_string (IMEngineInstanceBase * si, int offset, int len, const WideString & preedit, const WideString & commit, const AttributeList & attrs) {
+ m_frontend->recapture_string (si->get_id (), offset, len, preedit, commit, attrs);
+ }
+
void slot_forward_key_event (IMEngineInstanceBase * si, const KeyEvent & key) {
m_frontend->forward_key_event (si->get_id (), key);
}
si->signal_connect_commit_utf8_string (
slot (this, &FrontEndBase::FrontEndBaseImpl::slot_commit_utf8_string));
+ si->signal_connect_recapture_string (
+ slot (this, &FrontEndBase::FrontEndBaseImpl::slot_recapture_string));
+
si->signal_connect_forward_key_event (
slot (this, &FrontEndBase::FrontEndBaseImpl::slot_forward_key_event));
{
}
void
+FrontEndBase::recapture_string (int id, int offset, int len, const WideString & preedit, const WideString & commit, const AttributeList & attrs)
+{
+}
+void
FrontEndBase::forward_key_event (int id, const KeyEvent & key)
{
}
*/
virtual void commit_utf8_string (int id, const char * buf, int buflen);
+ virtual void recapture_string (int id, int offset, int len, const WideString & preedit, const WideString & commit, const AttributeList & attrs);
+
/**
* @brief forward a keyevent to the client of an IMEngine instance.
* @param id the id of the IMEngine instance.
}
void
+ slot_recapture_string (IMEngineInstanceBase *si,
+ int offset,
+ int len,
+ const WideString & preedit,
+ const WideString & commit,
+ const AttributeList & attrs)
+ {
+ LOGD ("");
+ thiz->recapture_string (-1, "", offset, len, preedit, commit, attrs);
+ }
+
+ void
slot_forward_key_event (IMEngineInstanceBase *si,
const KeyEvent & key)
{
slot (this, &HelperAgent::HelperAgentImpl::slot_update_preedit_string));
si->signal_connect_update_preedit_string_with_commit (
slot (this, &HelperAgent::HelperAgentImpl::slot_update_preedit_string_with_commit));
+ si->signal_connect_recapture_string (
+ slot (this, &HelperAgent::HelperAgentImpl::slot_recapture_string));
si->signal_connect_update_aux_string (
slot (this, &HelperAgent::HelperAgentImpl::slot_update_aux_string));
}
/**
+ * @brief Recapture
+ */
+void
+HelperAgent::recapture_string (int ic,
+ const String &ic_uuid,
+ int offset,
+ int len,
+ const WideString &preedit_str,
+ const WideString &commit_str,
+ const AttributeList &attrs) const
+{
+ LOGD ("offset = %d, len = %d", offset, len);
+
+ 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_RECAPTURE_STRING);
+
+ m_impl->send.put_data ((uint32)ic);
+ m_impl->send.put_data (ic_uuid);
+
+ // Deleting surrounding text
+ m_impl->send.put_data (offset);
+ m_impl->send.put_data (len);
+
+ // Update preedit text
+ m_impl->send.put_data (preedit_str);
+
+ // Commit
+ m_impl->send.put_data (commit_str);
+
+ // preedit attributes
+ m_impl->send.put_data (attrs);
+
+ m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
+ }
+}
+
+/**
* @brief Connect a slot to Helper exit signal.
*
* This signal is used to let the Helper exit.
*/
void request_ise_hide (void) const;
+ void recapture_string (int ic,
+ const String &ic_uuid,
+ int offset,
+ int len,
+ const WideString &preedit_str,
+ const WideString &commit_str,
+ const AttributeList &attrs) const;
+
public:
/**
* @brief Connect a slot to Helper exit signal.
typedef Signal5<void, IMEngineInstanceBase*,const WideString&,const WideString&,const AttributeList&,int>
IMEngineSignalWideStringWideStringAttributeListInt;
+typedef Signal6<void, IMEngineInstanceBase*,int,int, const WideString&,const WideString&,const AttributeList&>
+ IMEngineSignalInt2WideStringWideStringAttributeList;
+
typedef Signal5<bool, IMEngineInstanceBase*,WideString&,int&,int,int>
IMEngineSignalGetSurroundingText;
IMEngineSignalWideStringAttributeList m_signal_update_aux_string;
IMEngineSignalUTF8StringAttributeList m_signal_update_aux_utf8_string;
IMEngineSignalWideStringWideStringAttributeListInt m_signal_update_preedit_string_with_commit;
+ IMEngineSignalInt2WideStringWideStringAttributeList m_signal_recapture_string;
IMEngineSignalWideString m_signal_commit_string;
IMEngineSignalUTF8String m_signal_commit_utf8_string;
IMEngineSignalLookupTable m_signal_update_lookup_table;
}
Connection
+IMEngineInstanceBase::signal_connect_recapture_string (IMEngineSlotInt2WideStringWideStringAttributeList *slot)
+{
+ return m_impl->m_signal_recapture_string.connect (slot);
+}
+
+Connection
IMEngineInstanceBase::signal_connect_forward_key_event (IMEngineSlotKeyEvent *slot)
{
return m_impl->m_signal_forward_key_event.connect (slot);
}
void
+IMEngineInstanceBase::recapture_string (int offset,
+ int len,
+ const WideString &preedit,
+ const WideString &commit,
+ const AttributeList &attrs)
+{
+ m_impl->m_signal_recapture_string (this, offset, len, preedit, commit, attrs);
+}
+
+void
IMEngineInstanceBase::update_aux_string (const WideString &str,
const AttributeList &attrs)
{
typedef Slot5<void, IMEngineInstanceBase*,const WideString&, const WideString&, const AttributeList&,int>
IMEngineSlotWideStringWideStringAttributeListInt;
+typedef Slot6<void, IMEngineInstanceBase*,int,int,const WideString&, const WideString&, const AttributeList&>
+ IMEngineSlotInt2WideStringWideStringAttributeList;
+
typedef Slot5<bool, IMEngineInstanceBase*,WideString&,int&,int,int>
IMEngineSlotGetSurroundingText;
Connection signal_connect_update_preedit_string (IMEngineSlotWideStringAttributeListInt *slot);
Connection signal_connect_update_preedit_utf8_string (IMEngineSlotUTF8StringAttributeListInt *slot);
Connection signal_connect_update_preedit_string_with_commit (IMEngineSlotWideStringWideStringAttributeListInt *slot);
+ Connection signal_connect_recapture_string (IMEngineSlotInt2WideStringWideStringAttributeList *slot);
Connection signal_connect_update_aux_string (IMEngineSlotWideStringAttributeList *slot);
Connection signal_connect_update_aux_utf8_string (IMEngineSlotUTF8StringAttributeList *slot);
void commit_string (const char *buf,
int buflen);
+ void recapture_string (int offset,
+ int len,
+ const WideString &preedit,
+ const WideString &commit,
+ const AttributeList &attrs = AttributeList ());
+
/**
* @brief Forward a key event to the client application.
*
const int ISM_TRANS_CMD_SELECT_CANDIDATE = 1217;
const int ISM_TRANS_CMD_PROCESS_KEY_EVENT_DONE = 1218;
const int ISM_TRANS_CMD_REQUEST_ISE_HIDE = 1219;
+const int ISM_TRANS_CMD_RECAPTURE_STRING = 1220;
/* Panel to ISE */