2 * Copyright (c) 2014 - 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include "sclcoreui-efl.h"
19 #include "sclcoreimpl.h"
20 #include <Elementary.h>
22 #include <appcore-efl.h>
25 #include <vconf-keys.h>
29 #include <Ecore_Wayland.h>
30 #include <input-method-client-protocol.h>
34 #include <X11/Xatom.h>
38 /* This websocket agent is for supporting Tizen 2.X legacy web IMEs that uses websocket */
39 CWebHelperAgentWebSocket g_websocket;
42 static struct appcore_ops ops;
45 struct WaylandKeyboard
48 Ecore_Wl_Window *wl_win;
49 const char *ee_engine;
51 struct wl_surface *surface;
52 struct wl_input_panel *ip;
53 struct wl_output *output;
54 struct wl_input_panel_surface *ips;
57 struct WaylandKeyboard wlkb = {0};
59 #define RENDER_PRE_TIMEOUT 1.0f
60 static Ecore_Timer *_render_pre_timer = NULL;
61 static void delete_render_pre_timer()
63 if (_render_pre_timer) {
64 ecore_timer_del(_render_pre_timer);
65 _render_pre_timer = NULL;
72 CSCLCoreUIEFL::CSCLCoreUIEFL()
74 m_initialized = FALSE;
76 m_backend_identifier = "EFL";
78 m_rotation_degree = 0;
79 m_main_window = SCLWINDOW_INVALID;
84 CSCLCoreUIEFL::~CSCLCoreUIEFL()
88 sclboolean CSCLCoreUIEFL::init()
91 m_rotation_degree = -1;
93 for (int loop = 0;loop < OPTION_WINDOW_TYPE_MAX;loop++) {
94 m_option_window_info[loop].window = SCLWINDOW_INVALID;
104 void CSCLCoreUIEFL::fini()
106 m_initialized = FALSE;
113 sclwindow CSCLCoreUIEFL::get_main_window()
116 return m_main_window;
122 void CSCLCoreUIEFL::set_keyboard_size_hints(SclSize portrait, SclSize landscape)
124 Evas_Object *main_window = NATIVE_WINDOW_CAST(m_main_window);
127 ecore_wl_window_rotation_geometry_set(elm_win_wl_window_get(main_window), 0, 0, 0, portrait.width, portrait.height);
128 ecore_wl_window_rotation_geometry_set(elm_win_wl_window_get(main_window), 90, 0, 0, landscape.height, landscape.width);
129 ecore_wl_window_rotation_geometry_set(elm_win_wl_window_get(main_window), 180, 0, 0, portrait.width, portrait.height);
130 ecore_wl_window_rotation_geometry_set(elm_win_wl_window_get(main_window), 270, 0, 0, landscape.height, landscape.width);
133 ecore_x_e_window_rotation_geometry_set(elm_win_xwindow_get(main_window), 0, 0, 0, portrait.width, portrait.height);
134 ecore_x_e_window_rotation_geometry_set(elm_win_xwindow_get(main_window), 90, 0, 0, landscape.height, landscape.width);
135 ecore_x_e_window_rotation_geometry_set(elm_win_xwindow_get(main_window), 180, 0, 0, portrait.width, portrait.height);
136 ecore_x_e_window_rotation_geometry_set(elm_win_xwindow_get(main_window), 270, 0, 0, landscape.height, landscape.width);
141 void CSCLCoreUIEFL::set_floating_mode(sclboolean floating_mode)
144 wl_input_panel_surface_set_floating_panel(wlkb.ips, floating_mode);
147 static int language_changed_cb(void *event_info, void* data)
149 char clang[_POSIX_PATH_MAX] = {0};
150 char *vconf_str = vconf_get_str(VCONFKEY_LANGSET);
152 snprintf(clang, sizeof(clang), "%s", vconf_str);
155 LOGD("current language is %s\n", clang);
157 CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
159 ISCLCoreEventCallback *callback = impl->get_core_event_callback();
161 callback->on_set_display_language(clang);
168 static void accessibility_changed_cb(keynode_t *key, void* data)
171 if (vconf_get_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &vconf_value) == 0) {
172 LOGD("accessibility state : %d\n", vconf_value);
174 CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
176 ISCLCoreEventCallback *callback = impl->get_core_event_callback();
178 callback->on_set_accessibility_state(vconf_value);
185 static void win_rotation_changed_cb(void *data, Evas_Object *obj, void *event)
187 int degree = elm_win_rotation_get(obj);
188 LOGD("rotation angle : %d\n", degree);
190 ISCLCoreEventCallback *callback = NULL;
191 CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
193 callback = impl->get_core_event_callback();
196 CSCLCoreUIEFL *coreui = static_cast<CSCLCoreUIEFL*>(data);
198 coreui->set_screen_rotation_degree(degree);
201 callback->on_set_rotation_degree(degree);
205 static Eina_Bool _client_message_cb(void *data, int type, void *event)
207 Ecore_X_Event_Client_Message *ev = (Ecore_X_Event_Client_Message *)event;
209 ISCLCoreEventCallback *callback = NULL;
210 CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
211 Evas_Object *main_window = NULL;
213 callback = impl->get_core_event_callback();
214 main_window = NATIVE_WINDOW_CAST(impl->get_main_window());
217 #ifndef APPLY_WINDOW_MANAGER_CHANGE
219 if (ev->message_type == ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE) {
220 LOGD("ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE , %d %d\n", ev->data.l[0], gFHiddenState);
221 angle = ev->data.l[0];
222 ise_set_screen_direction(angle);
223 if (!gFHiddenState) {
226 } else if (ev->message_type == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE) {
227 LOGD("ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE , %d\n", ev->data.l[0]);
228 elm_win_keyboard_mode_set(main_window, (Elm_Win_Keyboard_Mode)(ev->data.l[0]));
229 gFHiddenState = !(ev->data.l[0]);
233 if (ev->message_type == ECORE_X_ATOM_E_WINDOW_ROTATION_CHANGE_REQUEST) {
234 if (ev->win == elm_win_xwindow_get(main_window)) {
235 int degree = ev->data.l[1];
236 CSCLCoreUIEFL *coreui = static_cast<CSCLCoreUIEFL*>(data);
238 coreui->set_screen_rotation_degree(degree);
240 LOGD("_ECORE_X_ATOM_E_WINDOW_ROTATION_REQUEST, %d\n", degree);
242 callback->on_set_rotation_degree(degree);
244 Ecore_X_Window control_window = 0;
245 Ecore_X_Atom atom = ecore_x_atom_get("_ISF_CONTROL_WINDOW");
246 Ecore_X_Window root = ecore_x_window_root_first_get();
247 if (ecore_x_window_prop_xid_get(root, atom, ECORE_X_ATOM_WINDOW, &control_window, 1) == 1) {
248 ecore_x_client_message32_send(control_window, ECORE_X_ATOM_E_WINDOW_ROTATION_CHANGE_REQUEST,
249 ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
250 ev->data.l[0], ev->data.l[1], ev->data.l[2], ev->data.l[3], ev->data.l[4]);
255 return ECORE_CALLBACK_RENEW;
259 int CSCLCoreUIEFL::get_screen_rotation_degree()
264 angle = elm_win_rotation_get(NATIVE_WINDOW_CAST(m_main_window));
266 if (m_rotation_degree == -1) {
270 unsigned long nitems_return;
271 unsigned long bytes_after_return;
272 unsigned char *data_window = NULL;
273 unsigned char *data_angle = NULL;
275 Ecore_X_Window app_window = 0;
277 Evas_Object *keypad_win = NATIVE_WINDOW_CAST(m_main_window);
279 LOGD("Trying to get app window degree for %p\n", keypad_win);
280 Ecore_X_Window win = elm_win_xwindow_get(NATIVE_WINDOW_CAST(keypad_win));
281 ret = XGetWindowProperty((Display *)ecore_x_display_get(),
282 ecore_x_window_root_get(win),
283 ecore_x_atom_get("_ISF_ACTIVE_WINDOW"),
284 0, G_MAXLONG, False, XA_WINDOW, &type_return,
285 &format_return, &nitems_return, &bytes_after_return,
288 if (ret == Success) {
289 if ((type_return == XA_WINDOW) && (format_return == 32) && (data_window)) {
290 app_window = *(Window *)data_window;
292 ret = XGetWindowProperty((Display *)ecore_x_display_get(), app_window,
293 ecore_x_atom_get("_E_ILLUME_ROTATE_WINDOW_ANGLE"),
294 0, G_MAXLONG, False, XA_CARDINAL, &type_return,
295 &format_return, &nitems_return, &bytes_after_return,
298 LOGD("app_window : %p, ret %d, %d, %p\n", app_window, ret, type_return, data_angle);
299 if (ret == Success) {
301 if (type_return == XA_CARDINAL) {
302 angle = *(unsigned int*)data_angle;
303 LOGD("current rotation angle is %p %d\n", app_window, angle);
313 angle = m_rotation_degree;
320 static void signal_handler(int sig) {
326 _wayland_setup(struct WaylandKeyboard *wlkb, Evas_Object *main_window)
328 Eina_Inlist *globals;
329 struct wl_registry *registry;
330 Ecore_Wl_Global *global;
332 if (!(registry = ecore_wl_registry_get()))
335 if (!(globals = ecore_wl_globals_get()))
338 EINA_INLIST_FOREACH(globals, global)
340 if (strcmp(global->interface, "wl_input_panel") == 0)
341 wlkb->ip = (wl_input_panel *)wl_registry_bind(registry, global->id, &wl_input_panel_interface, 1);
342 else if (strcmp(global->interface, "wl_output") == 0)
343 wlkb->output = (wl_output *)wl_registry_bind(registry, global->id, &wl_output_interface, 1);
347 LOGW("Can't get wayland input panel interface\n");
352 LOGW("Can't get wayland output interface\n");
356 wlkb->ee = ecore_evas_ecore_evas_get(evas_object_evas_get(main_window));
358 LOGW("ERROR: Unable to create Ecore_Evas object\n");
362 /* Set input panel surface */
363 LOGD("Setting up input panel\n");
364 wlkb->wl_win = ecore_evas_wayland_window_get(wlkb->ee);
366 LOGW("Couldn't get wayland window\n");
370 ecore_wl_window_type_set(wlkb->wl_win, ECORE_WL_WINDOW_TYPE_NONE);
371 wlkb->surface = ecore_wl_window_surface_create(wlkb->wl_win);
372 if (!wlkb->surface) {
373 LOGW("Couldn't create surface\n");
377 wlkb->ips = wl_input_panel_get_input_panel_surface(wlkb->ip, wlkb->surface);
379 LOGW("Couldn't get input panel surface\n");
383 wl_input_panel_surface_set_toplevel(wlkb->ips, wlkb->output, WL_INPUT_PANEL_SURFACE_POSITION_CENTER_BOTTOM);
389 check_evas_engine(struct WaylandKeyboard *wlkb)
391 Eina_Bool ret = EINA_FALSE;
392 const char *env = getenv("ECORE_EVAS_ENGINE");
395 if (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_WAYLAND_SHM)) {
397 } else if (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_WAYLAND_EGL)) {
400 LOGW("ERROR: Ecore_Evas does must be compiled with support for Wayland engines\n");
403 } else if (strcmp(env, "wayland_shm") != 0 && strcmp(env, "wayland_egl") != 0) {
404 LOGW("ERROR: ECORE_EVAS_ENGINE must be set to either 'wayland_shm' or 'wayland_egl'\n");
408 wlkb->ee_engine = env;
416 sclboolean CSCLCoreUIEFL::create_main_window()
419 if (!check_evas_engine(&wlkb)) {
420 LOGW("_wlkb_check_evas_engine error!\n");
423 LOGD("Selected engine: '%s'\n", wlkb.ee_engine);
426 elm_config_accel_preference_set("3d");
427 elm_policy_set(ELM_POLICY_THROTTLE, ELM_POLICY_THROTTLE_NEVER);
429 Evas_Object *main_window = elm_win_add(NULL, m_appid, ELM_WIN_UTILITY);
431 LOGE("Failed to create main window\n");
435 m_main_window = SCL_WINDOW_CAST(main_window);
438 if (!_wayland_setup(&wlkb, main_window)) {
439 LOGW("ERROR: Unable to setup input panel.\n");
444 elm_win_borderless_set(main_window, EINA_TRUE);
445 elm_win_keyboard_win_set(main_window, EINA_TRUE);
446 elm_win_autodel_set(main_window, EINA_TRUE);
447 elm_win_title_set(main_window, m_appid);
448 elm_win_prop_focus_skip_set(main_window, EINA_TRUE);
449 int rots[] = { 0, 90, 180, 270 };
450 elm_win_wm_rotation_available_rotations_set(main_window, rots, (sizeof(rots) / sizeof(int)));
453 unsigned int set = 1;
454 ecore_x_window_prop_card32_set(elm_win_xwindow_get(main_window),
455 ECORE_X_ATOM_E_WINDOW_ROTATION_SUPPORTED,
458 ecore_x_icccm_name_class_set(elm_win_xwindow_get(main_window), "Virtual Keyboard", "ISF");
464 int CSCLCoreUIEFL::create(void *data)
466 Evas_Object *main_window = NULL;
467 CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
469 if (!impl->prepare()) {
474 main_window = NATIVE_WINDOW_CAST(impl->get_main_window());
476 LOGW("Main window does not exist!");
482 appcore_set_event_callback(APPCORE_EVENT_LANG_CHANGE, language_changed_cb, NULL);
484 vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, accessibility_changed_cb, NULL);
486 /* Should we call these callback functions here? */
487 language_changed_cb(NULL, NULL);
488 accessibility_changed_cb(NULL, NULL);
491 evas_object_smart_callback_add(main_window, "wm,rotation,changed", win_rotation_changed_cb, NULL);
493 Ecore_Event_Handler *XClientMsgHandler =
494 ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, _client_message_cb, this);
497 signal(SIGQUIT, signal_handler);
498 signal(SIGTERM, signal_handler);
499 signal(SIGINT, signal_handler);
500 signal(SIGHUP, signal_handler);
503 evas_object_show(main_window);
509 int CSCLCoreUIEFL::terminate(void *data)
511 CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
515 appcore_set_event_callback(APPCORE_EVENT_LANG_CHANGE, NULL, NULL);
517 vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, accessibility_changed_cb);
520 if (XClientMsgHandler) {
521 ecore_event_handler_del(XClientMsgHandler);
522 XClientMsgHandler = NULL;
529 static int app_create_cb(void *data)
531 CSCLCoreUIEFL *sclui = static_cast<CSCLCoreUIEFL *>(data);
533 return sclui->create(data);
538 static int app_terminate_cb(void *data)
540 CSCLCoreUIEFL *sclui = static_cast<CSCLCoreUIEFL *>(data);
542 return sclui->terminate(data);
547 void CSCLCoreUIEFL::run(const sclchar *display)
549 char **argv = new char*[4];
551 const sclchar *appid = NULL;
553 ops.create = app_create_cb;
554 ops.terminate = app_terminate_cb;
560 CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
562 appid = impl->get_uuid();
571 argv[0] = const_cast<char *> (appid);
572 argv[1] = (char *)"--display";
573 argv[2] = const_cast<char *> (display);
576 LOGD("name : %s\n", appid);
578 appcore_efl_main(appid, &argc, (char ***)&argv, &ops);
583 static void focus_out_cb(void *data, Evas *e, void *event)
585 OptionWindowInfo *info = static_cast<OptionWindowInfo*>(data);
588 CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
590 ISCLCoreEventCallback *callback = impl->get_core_event_callback();
592 callback->on_destroy_option_window(info->window);
596 evas_object_hide(NATIVE_WINDOW_CAST(info->window));
597 evas_object_del(NATIVE_WINDOW_CAST(info->window));
604 set_transient_for_app_window(Evas_Object *window)
606 /* Set a transient window for window stack */
607 /* Gets the current XID of the active window into the root window property */
610 unsigned long nitems_return;
611 unsigned long bytes_after_return;
613 unsigned char *data = NULL;
614 Ecore_X_Window xAppWindow;
615 Ecore_X_Window xWindow = elm_win_xwindow_get(window);
618 ret = XGetWindowProperty((Display *)ecore_x_display_get(), ecore_x_window_root_get(xWindow),
619 ecore_x_atom_get("_ISF_ACTIVE_WINDOW"),
620 0, G_MAXLONG, False, XA_WINDOW, &type_return,
621 &format_return, &nitems_return, &bytes_after_return,
624 if (ret == Success) {
626 if (type_return == XA_WINDOW) {
627 xAppWindow = *(Window *)data;
628 LOGD("TRANSIENT_FOR SET : %x , %x\n", xAppWindow, xWindow);
629 ecore_x_icccm_transient_for_set(xWindow, xAppWindow);
638 set_transient_for_isf_setting_window(Evas_Object *window)
640 /* Set a transient window for window stack */
641 /* Gets the current XID of the active window into the root window property */
644 unsigned long nitems_return;
645 unsigned long bytes_after_return;
647 unsigned char *data = NULL;
648 Ecore_X_Window xControlWindow, xSettingWindow;
649 Ecore_X_Window xWindow = elm_win_xwindow_get(window);
652 ret = XGetWindowProperty((Display *)ecore_x_display_get(), ecore_x_window_root_get(xWindow),
653 ecore_x_atom_get("_ISF_CONTROL_WINDOW"),
654 0, G_MAXLONG, False, XA_WINDOW, &type_return,
655 &format_return, &nitems_return, &bytes_after_return,
658 if (ret == Success) {
660 if (type_return == XA_WINDOW) {
661 xControlWindow = *(Window *)data;
663 ecore_x_window_prop_xid_get(xControlWindow, ecore_x_atom_get("ISF Setting window"),
664 ECORE_X_ATOM_WINDOW, &xSettingWindow, 1);
666 LOGD("TRANSIENT_FOR SET : %x , %x\n", xSettingWindow, xWindow);
667 ecore_x_icccm_transient_for_set(xWindow, xSettingWindow);
675 sclwindow CSCLCoreUIEFL::create_option_window(SCLOptionWindowType type)
677 if (type < 0 || type >= OPTION_WINDOW_TYPE_MAX) {
678 return SCLWINDOW_INVALID;
681 ISCLCoreEventCallback *callback = NULL;
682 CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
684 callback = impl->get_core_event_callback();
686 sclboolean ret = false;
687 callback->on_check_option_window_availability(&ret);
689 LOGW("option_window not available\n");
690 return SCLWINDOW_INVALID;
693 return SCLWINDOW_INVALID;
697 /* Just in case the previous option window for setting application exists */
698 if (type == OPTION_WINDOW_TYPE_SETTING_APPLICATION) {
699 if (m_option_window_info[type].window != SCLWINDOW_INVALID) {
700 destroy_option_window(m_option_window_info[type].window);
704 Evas_Object *window, *bg;
706 window = elm_win_add(NATIVE_WINDOW_CAST(m_main_window), "Option window", ELM_WIN_BASIC);
707 if (!window) return NULL;
709 elm_win_title_set(window, "Option window");
710 bg = elm_bg_add(window);
712 evas_object_del(window);
716 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
717 elm_win_resize_object_add(window, bg);
718 evas_object_show(bg);
721 Evas_Coord win_w = 0, win_h = 0;
722 elm_win_screen_size_get(window, NULL, NULL, &win_w, &win_h);
723 int degree = get_screen_rotation_degree();
724 if (degree == 90 || degree == 270) {
725 evas_object_resize(window, win_h, win_w);
727 evas_object_resize(window, win_w, win_h);
731 int rots[] = { 0, 90, 180, 270 };
732 elm_win_wm_rotation_available_rotations_set(window, rots, (sizeof(rots) / sizeof(int)));
734 elm_win_indicator_mode_set(window, ELM_WIN_INDICATOR_SHOW);
737 callback->on_create_option_window(window, type);
740 if (type == OPTION_WINDOW_TYPE_NORMAL) {
741 Evas *evas = evas_object_evas_get(window);
742 evas_event_callback_add(evas, EVAS_CALLBACK_CANVAS_FOCUS_OUT, focus_out_cb, &m_option_window_info[type]);
743 set_transient_for_app_window(window);
744 } else if (type == OPTION_WINDOW_TYPE_SETTING_APPLICATION) {
745 set_transient_for_isf_setting_window(window);
748 m_option_window_info[type].window = window;
753 bool CSCLCoreUIEFL::show_option_window(SCLOptionWindowType type)
755 if (type < 0 || type >= OPTION_WINDOW_TYPE_MAX) {
756 return SCLWINDOW_INVALID;
759 ISCLCoreEventCallback *callback = NULL;
760 CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
762 callback = impl->get_core_event_callback();
764 sclboolean ret = false;
765 callback->on_check_option_window_availability(&ret);
767 LOGW("option_window not available\n");
775 if (m_option_window_info[type].window != SCLWINDOW_INVALID) {
776 evas_object_show(static_cast<Evas_Object*>(m_option_window_info[type].window));
777 elm_win_raise(static_cast<Evas_Object*>(m_option_window_info[type].window));
784 void CSCLCoreUIEFL::destroy_option_window(sclwindow window)
786 CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
788 ISCLCoreEventCallback *callback = impl->get_core_event_callback();
790 callback->on_destroy_option_window(window);
794 for (int loop = 0;loop < OPTION_WINDOW_TYPE_MAX;loop++) {
795 if (m_option_window_info[loop].window == window) {
796 evas_object_del(NATIVE_WINDOW_CAST(window));
797 m_option_window_info[loop].window = SCLWINDOW_INVALID;
802 void CSCLCoreUIEFL::set_screen_rotation_degree(int degree)
804 m_rotation_degree = degree;
808 static void _render_pre_cb(void *data, Evas *e, void *event_info)
810 LOGD("_render_pre_cb() called, now invoking wl_input_panel_surface_set_ready()");
812 wl_input_panel_surface_set_ready(wlkb.ips, 1);
814 Evas_Object *main_window = NATIVE_WINDOW_CAST(data);
815 evas_event_callback_del_full(evas_object_evas_get(main_window),
816 EVAS_CALLBACK_RENDER_PRE, _render_pre_cb, main_window);
818 delete_render_pre_timer();
821 static Eina_Bool _render_pre_timeout(void *data)
823 LOGD("_render_pre_timer expired, forcing to call _render_pre_cb() callback");
825 _render_pre_cb(data, NULL, NULL);
827 return ECORE_CALLBACK_CANCEL;
831 void CSCLCoreUIEFL::process_keyboard_ui_state_change(KEYBOARD_UI_STATE state)
834 if (state == KEYBOARD_UI_STATE_WILL_SHOW) {
835 evas_event_callback_add(evas_object_evas_get(NATIVE_WINDOW_CAST(m_main_window)),
836 EVAS_CALLBACK_RENDER_PRE, _render_pre_cb, (void*)m_main_window);
837 _render_pre_timer = ecore_timer_add(RENDER_PRE_TIMEOUT, _render_pre_timeout, (void*)m_main_window);
838 LOGD("Registered RENDER_PRE callback, _render_pre_cb() and a timer callback");
839 } else if (state == KEYBOARD_UI_STATE_DID_SHOW) {
840 LOGD("Forcing keyboard window to render");
841 evas_render(evas_object_evas_get(NATIVE_WINDOW_CAST(m_main_window)));