+
+ DALI_LOG_RELEASE_INFO("InitializeIme: Ecore_Wl2_Display: %p, ecore wl window: %p\n", ecoreWl2Display, mEcoreWindow);
+
+ if(!(registry = ecore_wl2_display_registry_get(ecoreWl2Display)))
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get ecore_wl2 display registry\n");
+ return;
+ }
+
+ if(!(globals = ecore_wl2_display_globals_get(ecoreWl2Display)))
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get ecore_wl2 globals\n");
+ return;
+ }
+
+ EINA_ITERATOR_FOREACH(globals, global)
+ {
+ if(strcmp(global->interface, "wl_input_panel") == 0)
+ {
+ mWlInputPanel = (wl_input_panel*)wl_registry_bind(registry, global->id, &wl_input_panel_interface, 1);
+ }
+ else if(strcmp(global->interface, "wl_output") == 0)
+ {
+ mWlOutput = (wl_output*)wl_registry_bind(registry, global->id, &wl_output_interface, 1);
+ }
+ }
+
+ if(!mWlInputPanel)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get wayland input panel interface\n");
+ return;
+ }
+
+ if(!mWlOutput)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get wayland output panel interface\n");
+ return;
+ }
+
+ mWlInputPanelSurface = wl_input_panel_get_input_panel_surface(mWlInputPanel, mWlSurface);
+ if(!mWlInputPanelSurface)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get wayland input panel surface\n");
+ return;
+ }
+
+ wl_input_panel_surface_set_toplevel(mWlInputPanelSurface, mWlOutput, WL_INPUT_PANEL_SURFACE_POSITION_CENTER_BOTTOM);
+}
+
+void WindowBaseEcoreWl2::ImeWindowReadyToRender()
+{
+ if(!mWlInputPanelSurface)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::ImeWindowReadyToRender(), wayland input panel surface is null\n");
+ return;
+ }
+
+ wl_input_panel_surface_set_ready(mWlInputPanelSurface, 1);
+}
+
+void WindowBaseEcoreWl2::RequestMoveToServer()
+{
+ Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(NULL);
+ if(!display)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::RequestMoveToServer, Fail to get ecore_wl2_display\n");
+ return;
+ }
+
+ Ecore_Wl2_Input* input = ecore_wl2_input_default_input_get(display);
+ if(!input)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::RequestMoveToServer, Fail to get default Ecore_Wl2_Input\n");
+ return;
+ }
+
+ ecore_wl2_window_move(mEcoreWindow, input);
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::RequestMoveToServer, starts the window[%p] is moved by server\n", mEcoreWindow);
+}
+
+void WindowBaseEcoreWl2::RequestResizeToServer(WindowResizeDirection direction)
+{
+ Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(NULL);
+ if(!display)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::RequestResizeToServer, Fail to get ecore_wl2_display\n");
+ return;
+ }
+
+ Ecore_Wl2_Input* input = ecore_wl2_input_default_input_get(display);
+ if(!input)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::RequestResizeToServer, Fail to get default Ecore_Wl2_Input\n");
+ return;
+ }
+
+ int location = 0;
+ switch(direction)
+ {
+ case WindowResizeDirection::TOP_LEFT:
+ {
+ location = 5;
+ break;
+ }
+ case WindowResizeDirection::TOP:
+ {
+ location = 1;
+ break;
+ }
+ case WindowResizeDirection::TOP_RIGHT:
+ {
+ location = 9;
+ break;
+ }
+ case WindowResizeDirection::LEFT:
+ {
+ location = 4;
+ break;
+ }
+ case WindowResizeDirection::RIGHT:
+ {
+ location = 8;
+ break;
+ }
+ case WindowResizeDirection::BOTTOM_LEFT:
+ {
+ location = 6;
+ break;
+ }
+ case WindowResizeDirection::BOTTOM:
+ {
+ location = 2;
+ break;
+ }
+ case WindowResizeDirection::BOTTOM_RIGHT:
+ {
+ location = 10;
+ break;
+ }
+ default:
+ {
+ location = 0;
+ break;
+ }
+ }
+
+ ecore_wl2_window_resize(mEcoreWindow, input, location);
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::RequestResizeToServer, starts the window[%p] is resized by server, mode:%d\n", mEcoreWindow, location);
+}
+
+void WindowBaseEcoreWl2::EnableFloatingMode(bool enable)
+{
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::EnableFloatingMode, floating mode flag: [%p], enable [%d]\n", mEcoreWindow, enable);
+ if(enable == true)
+ {
+ ecore_wl2_window_floating_mode_set(mEcoreWindow, EINA_TRUE);
+ }
+ else
+ {
+ ecore_wl2_window_floating_mode_set(mEcoreWindow, EINA_FALSE);
+ }
+}
+
+bool WindowBaseEcoreWl2::IsFloatingModeEnabled() const
+{
+ return ecore_wl2_window_floating_mode_get(mEcoreWindow);
+}
+
+void WindowBaseEcoreWl2::IncludeInputRegion(const Rect<int>& inputRegion)
+{
+ Eina_Rectangle rect;
+ rect.x = inputRegion.x;
+ rect.y = inputRegion.y;
+ rect.w = inputRegion.width;
+ rect.h = inputRegion.height;
+
+ ecore_wl2_window_input_rect_add(mEcoreWindow, &rect);
+ ecore_wl2_window_commit(mEcoreWindow, EINA_TRUE);
+}
+
+void WindowBaseEcoreWl2::ExcludeInputRegion(const Rect<int>& inputRegion)
+{
+ Eina_Rectangle rect;
+ rect.x = inputRegion.x;
+ rect.y = inputRegion.y;
+ rect.w = inputRegion.width;
+ rect.h = inputRegion.height;
+
+ ecore_wl2_window_input_rect_subtract(mEcoreWindow, &rect);
+ ecore_wl2_window_commit(mEcoreWindow, EINA_TRUE);