#include "isf_focus_movement_efl.h"
#include "isf_language_efl.h"
#include "isf_ondemand_efl.h"
+#include "isf_input_hint_efl.h"
#if HAVE_UIGADGET
#include <ui-gadget.h>
{ "ISF Language", ise_language_bt },
{ "ISF Return Key Type", ise_return_key_type_bt },
{ "ISF Return Key Disable", ise_return_key_disable_bt },
+ { "ISF Input hint", ise_input_hint_bt },
{ "ISF IM Data", ise_imdata_set_bt },
#ifdef _WEARABLE
{ "ISF ondemand", ise_ondemand_bt },
WideString preedit_string;
AttributeList preedit_attrlist;
Ecore_IMF_Autocapital_Type autocapital_type;
+ Ecore_IMF_Input_Hints input_hint;
void *imdata;
int imdata_size;
int preedit_caret;
static void panel_req_update_cursor_position (EcoreIMFContextISF *ic, int cursor_pos);
static void panel_req_show_help (EcoreIMFContextISF *ic);
static void panel_req_show_factory_menu (EcoreIMFContextISF *ic);
+static void panel_req_set_input_hint (EcoreIMFContextISF *ic, int hint);
/* Panel iochannel handler*/
static bool panel_initialize (void);
}
impl->autocapital_type = ECORE_IMF_AUTOCAPITAL_TYPE_NONE;
+ impl->input_hint = ECORE_IMF_INPUT_HINT_NONE;
impl->next_shift_status = 0;
impl->shift_mode_enabled = 0;
impl->next = _used_ic_impl_list;
context_scim->impl->si->set_prediction_allow (context_scim->impl->prediction_allow);
LOGD ("ctx : %p. set autocapital type : %d\n", ctx, context_scim->impl->autocapital_type);
context_scim->impl->si->set_autocapital_type (context_scim->impl->autocapital_type);
+ context_scim->impl->si->set_input_hint (context_scim->impl->input_hint);
if (context_scim->impl->imdata)
context_scim->impl->si->set_imdata ((const char *)context_scim->impl->imdata, context_scim->impl->imdata_size);
} else {
isf_imf_context_input_panel_imdata_get (ctx, data, length);
}
+EAPI void
+isf_imf_context_input_hint_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Hints hint)
+{
+ SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
+
+ EcoreIMFContextISF *context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get (ctx);
+
+ if (context_scim && context_scim->impl) {
+ if (context_scim->impl->input_hint != hint) {
+ LOGD ("ctx : %p, input hint : %#x\n", ctx, hint);
+ context_scim->impl->input_hint = hint;
+
+ if (context_scim->impl->si && context_scim == _focused_ic) {
+ _panel_client.prepare (context_scim->id);
+ context_scim->impl->si->set_input_hint (hint);
+ panel_req_set_input_hint (context_scim, hint);
+ _panel_client.send ();
+ }
+ }
+ }
+}
+
/* Panel Slot functions */
static void
panel_slot_reload_config (int context)
_panel_client.update_cursor_position (ic->id, cursor_pos);
}
+static void
+panel_req_set_input_hint (EcoreIMFContextISF *ic, int hint)
+{
+ SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
+
+ if (ic)
+ _panel_client.set_input_hint (ic->id, hint);
+}
+
static bool
filter_hotkeys (EcoreIMFContextISF *ic, const KeyEvent &key)
{
ic->impl->si->set_prediction_allow (ic->impl->prediction_allow);
LOGD ("ctx : %p. set autocapital type : %d\n", ic->ctx, ic->impl->autocapital_type);
ic->impl->si->set_autocapital_type (ic->impl->autocapital_type);
+ ic->impl->si->set_input_hint (ic->impl->input_hint);
}
//Record the IC on/off status
EAPI void isf_imf_context_autocapital_type_set (Ecore_IMF_Context* ctx, Ecore_IMF_Autocapital_Type autocapital_type);
EAPI void isf_imf_context_imdata_set (Ecore_IMF_Context* ctx, const void *data, int len);
EAPI void isf_imf_context_imdata_get (Ecore_IMF_Context* ctx, void *data, int *len);
+EAPI void isf_imf_context_input_hint_set (Ecore_IMF_Context* ctx, Ecore_IMF_Input_Hints hint);
EAPI EcoreIMFContextISF* isf_imf_context_new (void);
EAPI void isf_imf_context_shutdown (void);
Ecore_X_Window focus_out_win = e->win;
Ecore_X_Window focus_in_win = ecore_x_window_focus_get ();
- LOGD ("ctx : %p, client_window : %x, focus-out win : %x, focus-in win : %x\n", ctx, client_win, focus_out_win, focus_in_win);
+ LOGD ("ctx : %p, client_window : %#x, focus-out win : %#x, focus-in win : %#x\n", ctx, client_win, focus_out_win, focus_in_win);
if (check_focus_out_by_popup_win (ctx))
return ECORE_CALLBACK_PASS_ON;
LOGD ("win type : %d\n", win_type);
if (win_type == ECORE_X_WINDOW_TYPE_POPUP_MENU) {
- LOGD ("client window : %x, focus window : %x\n", client_win, focus_win);
+ LOGD ("client window : %#x, focus window : %#x\n", client_win, focus_win);
if (client_win != focus_win) {
ret = EINA_TRUE;
iseContext.autocapital_type = ecore_imf_context_autocapital_type_get (ctx);
+ iseContext.input_hint = ecore_imf_context_input_hint_get (ctx);
+
SECURE_LOGD ("ctx : %p, layout : %d, layout variation : %d\n", ctx, iseContext.layout, iseContext.layout_variation);
SECURE_LOGD ("language : %d, cursor position : %d, caps mode : %d\n", iseContext.language, iseContext.cursor_pos, iseContext.caps_mode);
SECURE_LOGD ("return_key_type : %d, return_key_disabled : %d, autocapital type : %d\n", iseContext.return_key_type, iseContext.return_key_disabled, iseContext.autocapital_type);
SECURE_LOGD ("client_window : %#x, password mode : %d, prediction_allow : %d\n", iseContext.client_window, iseContext.password_mode, iseContext.prediction_allow);
+ SECURE_LOGD ("input hint : %#x\n", iseContext.input_hint);
if (iseContext.client_window != ecore_x_window_focus_get ()) {
LOGW ("Client window is different from focus window. client win : %#x, focus win : %#x\n", iseContext.client_window, ecore_x_window_focus_get ());
NULL, /* input_panel_event_callback_add */
NULL, /* input_panel_event_callback_del */
isf_imf_context_input_panel_language_locale_get,
- isf_imf_context_candidate_window_geometry_get
+ isf_imf_context_candidate_window_geometry_get,
+ isf_imf_context_input_hint_set
};
static Ecore_IMF_Context *imf_module_create (void);
socket_set_autocapital_type (id);
else if (cmd == ISM_TRANS_CMD_SET_LAYOUT)
socket_set_layout (id);
+ else if (cmd == ISM_TRANS_CMD_SET_INPUT_HINT)
+ socket_set_input_hint (id);
else if (cmd == ISM_TRANS_CMD_RESET_ISE_OPTION)
socket_reset_option (id);
else if (cmd == SCIM_TRANS_CMD_RESET)
}
void
+SocketFrontEnd::socket_set_input_hint (int /*client_id*/)
+{
+ uint32 siid;
+ uint32 input_hint;
+
+ SCIM_DEBUG_FRONTEND (2) << __func__ << "\n";
+
+ if (m_receive_trans.get_data (siid) &&
+ m_receive_trans.get_data (input_hint)) {
+
+ SCIM_DEBUG_FRONTEND (3) << " SI (" << siid << ").\n";
+
+ m_current_instance = (int) siid;
+
+ set_input_hint ((int) siid, input_hint);
+ m_send_trans.put_command (SCIM_TRANS_CMD_OK);
+
+ m_current_instance = -1;
+ }
+}
+
+
+void
SocketFrontEnd::socket_update_candidate_item_layout (int /*client_id*/)
{
uint32 siid;
void socket_longpress_candidate (int client_id);
void socket_set_imdata (int client_id);
void socket_set_autocapital_type (int client_id);
+ void socket_set_input_hint (int client_id);
};
#endif
}
void
+SocketInstance::set_input_hint (unsigned int input_hint)
+{
+ Transaction trans;
+
+ global->init_transaction (trans);
+
+ SCIM_DEBUG_IMENGINE(1) << __func__<< " (" << m_peer_id << ")\n";
+
+ trans.put_command (ISM_TRANS_CMD_SET_INPUT_HINT);
+ trans.put_data (m_peer_id);
+ trans.put_data (input_hint);
+
+ commit_transaction (trans);
+}
+
+void
SocketInstance::update_candidate_item_layout (const std::vector<unsigned int> &row_items)
{
Transaction trans;
virtual void longpress_candidate (unsigned int index);
virtual void set_imdata (const char *data, unsigned int len);
virtual void set_autocapital_type (int mode);
+ virtual void set_input_hint (unsigned int input_hint);
private:
bool commit_transaction (Transaction &trans);
Eina_Bool caps_mode;
int layout_variation;
Ecore_IMF_Autocapital_Type autocapital_type;
- int reserved[247];
+ Ecore_IMF_Input_Hints input_hint;
+ int reserved[246];
} Ise_Context;
#endif /* __ISE_CONTEXT_H */
}
void
+FrontEndBase::set_input_hint (int id, unsigned int input_hint) const
+{
+ IMEngineInstancePointer si = m_impl->find_instance (id);
+
+ if (!si.null ()) si->set_input_hint (input_hint);
+}
+
+void
FrontEndBase::update_candidate_item_layout (int id, const std::vector<unsigned int> &row_items) const
{
IMEngineInstancePointer si = m_impl->find_instance (id);
void set_autocapital_type (int id, int mode) const;
/**
+ * @brief Set input hint.
+ * @param id the IMEngine instance id.
+ * @param input_hint - the input hint.
+ */
+ void set_input_hint (int id, unsigned int input_hint) const;
+
+ /**
* @}
*/
HelperAgentSignalInt signal_longpress_candidate;
HelperAgentSignalKeyEventUint signal_process_key_event;
HelperAgentSignalUintVoid signal_set_input_mode;
+ HelperAgentSignalUintVoid signal_set_input_hint;
public:
HelperAgentImpl () : magic (0), magic_active (0), timeout (-1), focused_ic ((uint32) -1) { }
m_impl->signal_longpress_candidate (this, ic, ic_uuid, index);
break;
}
+ case ISM_TRANS_CMD_SET_INPUT_HINT:
+ {
+ uint32 input_hint;
+
+ if (m_impl->recv.get_data (input_hint))
+ m_impl->signal_set_input_hint (this, input_hint);
+ break;
+ }
default:
break;
}
}
/**
+ * @brief Connect a slot to Helper set input hint signal.
+ *
+ * This signal is used to set Helper ISE input hint.
+ *
+ * The prototype of the slot is:
+ * void set_input_hint (const HelperAgent *agent, uint32 &input_hint);
+ */
+Connection
+HelperAgent::signal_connect_set_input_hint (HelperAgentSlotUintVoid *slot)
+{
+ return m_impl->signal_set_input_hint.connect (slot);
+}
+
+/**
* @brief Connect a slot to Helper set shift mode signal.
*
* This signal is used to set Helper shift mode.
* void set_input_mode (const HelperAgent *agent, uint32 &input_mode);
*/
Connection signal_connect_set_input_mode (HelperAgentSlotUintVoid *slot);
+
+ /**
+ * @brief Connect a slot to Helper set input hint signal.
+ *
+ * This signal is used to set Helper ISE input hint.
+ *
+ * The prototype of the slot is:
+ * void set_input_hint (const HelperAgent *agent, uint32 &input_hint);
+ */
+ Connection signal_connect_set_input_hint (HelperAgentSlotUintVoid *slot);
};
/** @} */
}
void
+IMEngineInstanceBase::set_input_hint (unsigned int input_hint)
+{
+}
+
+void
IMEngineInstanceBase::update_candidate_item_layout (const std::vector<unsigned int> &row_items)
{
}
*/
virtual void set_autocapital_type (int mode);
+ /**
+ * @brief Set input hint
+ *
+ * @param input_hint - the input hint.
+ */
+ virtual void set_input_hint (unsigned int input_hint);
+
protected:
/**
* @name Signal activation functions
return false;
}
+ bool set_helper_input_hint (const String &uuid, uint32 &hint)
+ {
+ 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_SET_INPUT_HINT);
+ m_send_trans.put_data (hint);
+ m_send_trans.write_to_socket (client_socket);
+ return true;
+ }
+
+ return false;
+ }
+
bool set_helper_caps_mode (const String &uuid, uint32 &mode)
{
HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
}
}
+ void set_ise_input_hint (int client_id)
+ {
+ SCIM_DEBUG_MAIN(4) << "PanelAgent::set_ise_input_hint ()\n";
+ uint32 input_hint;
+
+ if (m_recv_trans.get_data (input_hint)) {
+ if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
+ set_helper_input_hint (m_current_helper_uuid, input_hint);
+ }
+ }
+
void set_ise_language (int client_id)
{
SCIM_DEBUG_MAIN(4) << "PanelAgent::set_ise_language ()\n";
} else if (cmd == ISM_TRANS_CMD_SET_INPUT_MODE) {
set_ise_input_mode (client_id);
continue;
+ } else if (cmd == ISM_TRANS_CMD_SET_INPUT_HINT) {
+ set_ise_input_hint (client_id);
+ continue;
}
current = last = false;
}
}
+ void set_input_hint (int icid, int input_hint) {
+ if (m_send_refcount > 0 && m_current_icid == icid) {
+ m_send_trans.put_command (ISM_TRANS_CMD_SET_INPUT_HINT);
+ m_send_trans.put_data (input_hint);
+ }
+ }
+
void get_layout (int* layout) {
if (m_send_refcount > 0) {
int cmd;
}
void
+PanelClient::set_input_hint (int icid, int input_hint)
+{
+ m_impl->set_input_hint (icid, input_hint);
+}
+
+void
PanelClient::set_ise_language (int language)
{
m_impl->set_ise_language (language);
void process_key_event (KeyEvent& key, int* ret);
void get_active_helper_option (int* option);
void set_input_mode (int input_mode);
+ void set_input_hint (int icid, int input_hint);
/** @} */
const int ISM_TRANS_CMD_SET_RETURN_KEY_DISABLE = 1120;
const int ISM_TRANS_CMD_GET_RETURN_KEY_DISABLE = 1121;
const int ISM_TRANS_CMD_SET_INPUT_MODE = 1122;
+const int ISM_TRANS_CMD_SET_INPUT_HINT = 1123;
/* ISE/Panel to IMControl */
const int ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT = 1151;