static_cast<PageClientImpl*>(client)->imContextCommitted(static_cast<char*>(eventInfo));
}
-static void imfInputPanelStateEventCb(void *client, Ecore_IMF_Context *ctx, int value)
+static void imfInputPanelStateEventCb(void *client, Ecore_IMF_Context *ctx, int state)
{
LOG(ISF, "%s\n", __func__);
PageClientImpl* pageClient = static_cast<PageClientImpl*>(client);
- if (value == ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
- pageClient->setViewFocused(false);
+ if (state == ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
pageClient->page()->viewStateDidChange(WebPageProxy::ViewIsFocused | WebPageProxy::ViewWindowIsActive);
evas_object_smart_callback_call(pageClient->viewWidget(), "editorclient,ime,closed", 0);
LOG(ISF, "[SIGNAL] editorclient,ime,closed\n");
+
#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
pageClient->setIsTextSelectionMode(false);
#endif
- }
- else if (value == ECORE_IMF_INPUT_PANEL_STATE_SHOW) {
+ } else if (state == ECORE_IMF_INPUT_PANEL_STATE_SHOW) {
pageClient->page()->viewStateDidChange(WebPageProxy::ViewIsFocused | WebPageProxy::ViewWindowIsActive);
evas_object_smart_callback_call(pageClient->viewWidget(), "editorclient,ime,opened", 0);
LOG(ISF, "[SIGNAL] editorclient,ime,opened\n");
, m_preventNextCompositionCommit(false)
, m_layoutAndScaleState(BeforeCommitLoad)
, m_inputMethod(0)
- , m_inputMethodState(0)
, m_mousePressed(0)
#if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
, m_visibleContentRect(IntRect())
#if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
, m_isContextMenuVisible(false)
#endif
-#if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
- , m_inputValue()
- , m_inputType()
-#endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
#endif // #if OS(TIZEN)
{
m_page = context->createWebPage(this, pageGroup);
void PageClientImpl::didStartProgress()
{
m_layoutAndScaleState = BeforeCommitLoad;
+#if ENABLE(TIZEN_ISF_PORT)
+ if (getInputMethodState()) {
+ LOG(ISF, "%s\n", __func__);
+ setInputMethodState(false, String(), String());
+ }
+#endif
}
void PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame()
void PageClientImpl::setInputMethodState(bool active)
#endif
{
- LOG(ISF, "%s active %d\n", __func__, active);
-
- if (!m_inputMethod && !initializeInputMethod())
- return;
-
-#if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
- // FIXME: We need to find better way.
- m_inputValue = inputValue;
-
- m_inputType = inputType.string();
-#endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
-
#if ENABLE(TIZEN_ISF_PORT)
- Ewk_Setting* ewkSetting = ewk_view_setting_get(m_viewWidget);
- bool autofocused = ewk_setting_show_ime_on_autofocus_get(ewkSetting);
-
- if (!autofocused && active && !m_mousePressed) {
- LOG(ISF, "Autofocus is disabled\n");
- m_inputMethodState = false;
- return;
- }
-
- m_inputMethodState = active;
-
- LOG(ISF, "m_mousePressed %d, autofocused : %d, m_inputMethodState %d\n"
- , m_mousePressed, autofocused, m_inputMethodState);
-
- handleInputMethodState();
-#endif
-}
-
-#if ENABLE(TIZEN_ISF_PORT)
-void PageClientImpl::handleInputMethodState()
-{
LOG(ISF, "%s\n", __func__);
if (!m_inputMethod && !initializeInputMethod())
return;
Ewk_Setting* ewkSetting = ewk_view_setting_get(m_viewWidget);
+ bool autofocused = ewk_setting_show_ime_on_autofocus_get(ewkSetting);
bool defaultKeypadEnabled = ewk_setting_enable_default_keypad_get(ewkSetting);
- if (!evas_object_focus_get(m_viewWidget)) {
- LOG(ISF, "evas_object_focus_get() failed\n");
- m_inputMethodState = false;
+ LOG(ISF, "- active(%d), m_mousePressed(%d), autofocused(%d), defaultKeypadEnabled(%d)\n", active, m_mousePressed, autofocused, defaultKeypadEnabled);
+
+ if (!autofocused && active && !m_mousePressed) {
+ LOG(ISF, "[FAIL] Autofocus is disabled\n");
return;
}
Ecore_IMF_Input_Panel_State state = ecore_imf_context_input_panel_state_get(m_inputMethod);
- if (m_inputMethodState) {
+ if (active) {
if (state == ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
Eina_Rectangle rect;
ecore_imf_context_input_panel_geometry_get(m_inputMethod, &rect.x, &rect.y, &rect.w, &rect.h);
evas_object_smart_callback_call(m_viewWidget, "inputmethod,changed", &rect);
- LOG(ISF, "[SIGNAL] inputmethod,changed\n");
+ LOG(ISF, "[SIGNAL] inputmethod,changed (%d,%d,%d,%d)\n", rect.x, rect.y, rect.w, rect.h);
}
if (!defaultKeypadEnabled) {
- LOG(ISF, "Default keypad disabled\n");
- m_inputMethodState = false;
+ LOG(ISF, "[FAIL] Default keypad disabled\n");
return;
}
- const EditorState& editorState = page()->editorState();
-
#if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
+ String type = inputType.string();
+ LOG(ISF, "- Input type (%s)\n", type.utf8().data());
+
// Input picker
- if (m_inputType == "date") {
- ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_DATE, m_inputValue);
- m_inputMethodState = false;
+ if (type == "date") {
+ ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_DATE, inputValue);
return;
- } else if (m_inputType == "datetime") {
- ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_DATETIME, m_inputValue);
- m_inputMethodState = false;
+ } else if (type == "datetime") {
+ ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_DATETIME, inputValue);
return;
- } else if (m_inputType == "datetime-local") {
- ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_DATETIMELOCAL, m_inputValue);
- m_inputMethodState = false;
+ } else if (type == "datetime-local") {
+ ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_DATETIMELOCAL, inputValue);
return;
- } else if (m_inputType == "month") {
- ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_MONTH, m_inputValue);
- m_inputMethodState = false;
+ } else if (type == "month") {
+ ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_MONTH, inputValue);
return;
- } else if (m_inputType == "time") {
- ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_TIME, m_inputValue);
- m_inputMethodState = false;
+ } else if (type == "time") {
+ ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_TIME, inputValue);
return;
- } else if (m_inputType == "week") {
- ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_WEEK, m_inputValue);
- m_inputMethodState = false;
+ } else if (type == "week") {
+ ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_WEEK, inputValue);
return;
}
#if ENABLE(TIZEN_DATALIST_ELEMENT)
Vector<String> optionList = page()->getFocusedInputElementDataList();
if (optionList.size() > 0) {
- if (m_inputType == "tel")
+ if (type == "tel")
ewkViewDataListShowRequest(m_viewWidget, EWK_INPUT_TYPE_TELEPHONE, optionList);
- else if (m_inputType == "number")
+ else if (type == "number")
ewkViewDataListShowRequest(m_viewWidget, EWK_INPUT_TYPE_NUMBER, optionList);
- else if (m_inputType == "email")
+ else if (type == "email")
ewkViewDataListShowRequest(m_viewWidget, EWK_INPUT_TYPE_EMAIL, optionList);
- else if (m_inputType == "url")
+ else if (type == "url")
ewkViewDataListShowRequest(m_viewWidget, EWK_INPUT_TYPE_URL, optionList);
else
ewkViewDataListShowRequest(m_viewWidget, EWK_INPUT_TYPE_TEXT, optionList);
}
#endif
- LOG(ISF, "editorState.inputMethodHints %d, InputType %s\n", editorState.inputMethodHints, m_inputType.utf8().data());
-
// Allow Prediction text
- if (editorState.inputMethodHints == EWK_IMH_PASSWORD)
+ if (type == "password")
ecore_imf_context_prediction_allow_set(m_inputMethod, false);
else
ecore_imf_context_prediction_allow_set(m_inputMethod, true);
// Set Input Method's Layout
- if (m_inputType == "tel")
+ if (type == "tel")
ecore_imf_context_input_panel_layout_set(m_inputMethod, ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER);
- else if (m_inputType == "number")
+ else if (type == "number")
ecore_imf_context_input_panel_layout_set(m_inputMethod, ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER);
- else if (m_inputType == "email")
+ else if (type == "email")
ecore_imf_context_input_panel_layout_set(m_inputMethod, ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL);
- else if (m_inputType == "url")
+ else if (type == "url")
ecore_imf_context_input_panel_layout_set(m_inputMethod, ECORE_IMF_INPUT_PANEL_LAYOUT_URL);
- else if (m_inputType == "password")
+ else if (type == "password")
ecore_imf_context_input_panel_layout_set(m_inputMethod, ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD);
else
ecore_imf_context_input_panel_layout_set(m_inputMethod, ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL);
-#endif
+#endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
Evas* evas = evas_object_evas_get(m_viewWidget);
ecore_imf_context_client_window_set(m_inputMethod, (void*)ecore_evas_window_get(ecore_evas_ecore_evas_get(evas)));
ecore_imf_context_focus_in(m_inputMethod);
ecore_imf_context_input_panel_show(m_inputMethod);
- LOG(ISF, "[STATUS] SHOW\n");
+
+ setViewFocused(true);
+ evas_object_focus_set(m_viewWidget, true);
+ LOG(ISF, "- Keypad status : show\n");
setCursorPosition();
- } else if (!m_inputMethodState && state == ECORE_IMF_INPUT_PANEL_STATE_SHOW) {
+ } else if (!active && state != ECORE_IMF_INPUT_PANEL_STATE_HIDE && evas_object_focus_get(m_viewWidget)) {
if (!defaultKeypadEnabled) {
- LOG(ISF, "Default keypad disabled\n");
+ LOG(ISF, "[FAIL] Default keypad disabled\n");
return;
}
+
+ ecore_imf_context_reset(m_inputMethod);
ecore_imf_context_input_panel_hide(m_inputMethod);
ecore_imf_context_focus_out(m_inputMethod);
- LOG(ISF, "[STATUS] HIDE\n");
+
+ setViewFocused(false);
+ LOG(ISF, "- Keypad status : hide\n");
}
+#endif // #if ENABLE(TIZEN_ISF_PORT)
}
+#if ENABLE(TIZEN_ISF_PORT)
void PageClientImpl::setCursorPosition(int preeditPosition)
{
LOG(ISF, "%s\n", __func__);
if (!m_inputMethod)
return false;
- ecore_imf_context_input_panel_enabled_set(m_inputMethod, EINA_FALSE);
+ ecore_imf_context_input_panel_enabled_set(m_inputMethod, false);
ecore_imf_context_input_panel_event_callback_add(m_inputMethod, ECORE_IMF_INPUT_PANEL_STATE_EVENT, imfInputPanelStateEventCb, this);
ecore_imf_context_retrieve_surrounding_callback_set(m_inputMethod, imfRetrieveSurroundingCb, this); // Support for Auto Capitalization
ecore_imf_context_event_callback_add(m_inputMethod, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, imfContextDeleteSurroundingCb, this); //Support for Automatic Full Stop
if (!m_inputMethod && !initializeInputMethod())
return false;
- if (!page()->focusedFrame())
- return false;
-
Ecore_IMF_Input_Panel_State state;
state = ecore_imf_context_input_panel_state_get(m_inputMethod);
if (state != ECORE_IMF_INPUT_PANEL_STATE_HIDE)
}
page()->confirmComposition(String::fromUTF8(event));
- LOG(ISF, "confirmComposition : %s\n", event);
+ LOG(ISF, "confirmComposition : (%s)\n", event);
setCursorPosition();
}
{
LOG(ISF, "%s\n", __func__);
- m_mousePressed = true;
-
if (!m_inputMethod && !initializeInputMethod())
return;
- if (!page()->focusedFrame())
- return;
+ m_mousePressed = true;
m_preventNextCompositionCommit = true;
- ecore_imf_context_focus_out(m_inputMethod);
-}
-
-void PageClientImpl::handleInputMethodForFocusedNode()
-{
- LOG(ISF, "%s\n", __func__);
-
- if (!page()->focusedFrame())
- return;
-
- page()->handleInputMethodForFocusedNode();
+ ecore_imf_context_reset(m_inputMethod);
}
-#endif
+#endif // #if ENABLE(TIZEN_ISF_PORT)
void PageClientImpl::updateFormNavigation(int length, int offset)
{