// IME Callback
const char * const EWK_INPUTMETHOD_CHANGED = "inputmethod,changed";
+const char * const EWK_EDITORCLIENT_IME_OPENED = "editorclient,ime,opened";
const char * const EWK_EDITORCLIENT_IME_CLOSED = "editorclient,ime,closed";
// Custom handlers
this);
- // when ime start to be showed on the webview,
- // this callback will be called
+ // when ime start to be showed on the webview,
+ // this callback will be called
evas_object_smart_callback_add(
wkView,
EWK_INPUTMETHOD_CHANGED,
- imeOpenCallback,
+ imeChangedCallback,
this);
// this callback will be called
// if web content should know size of ime,
// use "inputmethod,changed" instead of this.
//
- //evas_object_smart_callback_add(
- // wkView,
- // "editorclient,ime,opened",
- // imeSomethingCallback,
- // this);
+ evas_object_smart_callback_add(
+ wkView,
+ EWK_EDITORCLIENT_IME_OPENED,
+ imeOpenedCallback,
+ this);
// when ime finished to be hidden,
// this callback will be called
evas_object_smart_callback_add(
wkView,
EWK_EDITORCLIENT_IME_CLOSED,
- imeCloseCallback,
+ imeClosedCallback,
this);
// custom content/scheme handlers
NULL,
NULL);
- // ime show/hide callback
+ // ime change/show/hide callback
evas_object_smart_callback_del(
wkView,
EWK_INPUTMETHOD_CHANGED,
- imeOpenCallback);
+ imeChangedCallback);
+ evas_object_smart_callback_del(
+ wkView,
+ EWK_EDITORCLIENT_IME_OPENED,
+ imeOpenedCallback);
evas_object_smart_callback_del(
wkView,
EWK_EDITORCLIENT_IME_CLOSED,
- imeCloseCallback);
+ imeClosedCallback);
// custom content/scheme handlers
evas_object_smart_callback_del(
}
}
-void ViewLogic::imeOpenCallback(
+void ViewLogic::imeChangedCallback(
void* data,
Evas_Object* /*obj*/,
void* eventInfo)
Assert(eventInfo);
ViewLogic* This = static_cast<ViewLogic*>(data);
Eina_Rectangle *rect = static_cast<Eina_Rectangle *>(eventInfo);
+ This->m_imeWidth = rect->w;
+ This->m_imeHeight = rect->h;
+}
+
+void ViewLogic::imeOpenedCallback(
+ void* data,
+ Evas_Object* /*obj*/,
+ void* /*eventInfo*/)
+{
+ LogDebug("enter");
+ Assert(data);
+ ViewLogic* This = static_cast<ViewLogic*>(data);
using namespace WrtPlugins::W3C;
SoftKeyboardChangeArgs args;
args.state = IME_STATE_ON;
- args.width = rect->w;
- args.height = rect->h;
+ args.width = This->m_imeWidth;
+ args.height = This->m_imeHeight;
This->fireJavascriptEvent(
static_cast<int>(SoftKeyboardChangeCustomEvent),
&args);
}
-void ViewLogic::imeCloseCallback(
+void ViewLogic::imeClosedCallback(
void* data,
Evas_Object* /*obj*/,
void* /*eventInfo*/)