2 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
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.
19 #include <dali/internal/window-system/x11/window-base-x.h>
22 #include <dali/internal/window-system/common/window-impl.h>
23 #include <dali/internal/window-system/common/window-render-surface.h>
24 #include <dali/internal/window-system/common/window-system.h>
25 #include <dali/internal/window-system/x11/window-system-x.h>
28 #include <dali/integration-api/debug.h>
29 #include <dali/public-api/events/mouse-button.h>
30 #include <dali/public-api/object/any.h>
32 using Dali::Internal::Adaptor::WindowSystem::WindowSystemX;
42 const std::string DEFAULT_DEVICE_NAME = "";
43 const Device::Class::Type DEFAULT_DEVICE_CLASS = Device::Class::NONE;
44 const Device::Subclass::Type DEFAULT_DEVICE_SUBCLASS = Device::Subclass::NONE;
46 const unsigned int PRIMARY_TOUCH_BUTTON_ID(1);
48 #if defined(DEBUG_ENABLED)
49 Debug::Filter* gWindowBaseLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_WINDOW_BASE");
52 /////////////////////////////////////////////////////////////////////////////////////////////////
54 /////////////////////////////////////////////////////////////////////////////////////////////////
56 static bool EventWindowPropertyChanged(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
58 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
61 return windowBase->OnWindowPropertyChanged(data, type, event);
68 * Called when the window receives a delete request
70 static bool EventWindowDeleteRequest(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
72 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
75 windowBase->OnDeleteRequest();
81 * Called when the window gains focus.
83 static bool EventWindowFocusIn(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
85 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
88 windowBase->OnFocusIn(data, type, event);
94 * Called when the window loses focus.
96 static bool EventWindowFocusOut(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
98 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
101 windowBase->OnFocusOut(data, type, event);
107 * Called when the window is damaged.
109 static bool EventWindowDamaged(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
111 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
114 windowBase->OnWindowDamaged(data, type, event);
120 /////////////////////////////////////////////////////////////////////////////////////////////////
121 // Selection Callbacks
122 /////////////////////////////////////////////////////////////////////////////////////////////////
125 * Called when the source window notifies us the content in clipboard is selected.
127 static bool EventSelectionClear(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
129 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
132 windowBase->OnSelectionClear(data, type, event);
138 * Called when the source window sends us about the selected content.
139 * For example, when dragged items are dragged INTO our window or when items are selected in the clipboard.
141 static bool EventSelectionNotify(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
143 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
146 windowBase->OnSelectionNotify(data, type, event);
151 /////////////////////////////////////////////////////////////////////////////////////////////////
153 /////////////////////////////////////////////////////////////////////////////////////////////////
156 * Called when a touch down is received.
158 static bool EventMouseButtonDown(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
160 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
163 windowBase->OnMouseButtonDown(data, type, event);
169 * Called when a touch up is received.
171 static bool EventMouseButtonUp(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
173 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
176 windowBase->OnMouseButtonUp(data, type, event);
182 * Called when a touch motion is received.
184 static bool EventMouseButtonMove(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
186 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
189 windowBase->OnMouseButtonMove(data, type, event);
194 /////////////////////////////////////////////////////////////////////////////////////////////////
196 /////////////////////////////////////////////////////////////////////////////////////////////////
199 * Called when a mouse wheel is received.
201 static bool EventMouseWheel(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
203 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
206 windowBase->OnMouseWheel(data, type, event);
211 /////////////////////////////////////////////////////////////////////////////////////////////////
213 /////////////////////////////////////////////////////////////////////////////////////////////////
216 * Called when a key down is received.
218 static bool EventKeyDown(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
220 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
223 windowBase->OnKeyDown(data, type, event);
229 * Called when a key up is received.
231 static bool EventKeyUp(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
233 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
236 windowBase->OnKeyUp(data, type, event);
241 } // unnamed namespace
243 WindowBaseX::WindowBaseX(Dali::PositionSize positionSize, Any surface, bool isTransparent)
247 mIsTransparent(false), // Should only be set to true once we actually create a transparent window regardless of what isTransparent is.
248 mRotationAppSet(false),
249 mWindowRotationAngle(0)
251 Initialize(positionSize, surface, isTransparent);
254 WindowBaseX::~WindowBaseX()
257 mEventHandlers.Clear();
261 XDestroyWindow(WindowSystem::GetImplementation().GetXDisplay(), mWindow);
263 /**** @todo Should not be destroyed here! ****/
264 WindowSystem::Shutdown();
268 void WindowBaseX::Initialize(PositionSize positionSize, Any surface, bool isTransparent)
270 // see if there is a surface in Any surface
271 unsigned int surfaceId = GetSurfaceId(surface);
273 // if the surface is empty, create a new one.
276 /**** @todo Should be created from somewhere else! ****/
277 WindowSystem::Initialize();
279 // we own the surface about to created
281 CreateWindow(positionSize, isTransparent);
285 // XLib should already be initialized so no point in calling XInitThreads
286 mWindow = static_cast<::Window>(surfaceId);
289 auto& windowSystem = WindowSystem::GetImplementation();
292 if((id = getenv("DESKTOP_STARTUP_ID")))
294 windowSystem.SetStringProperty(mWindow, WindowSystemX::ATOM_NET_STARTUP_ID, std::string(id));
297 windowSystem.SetWindowHints(mWindow, true);
300 EnableMultipleSelection();
307 void WindowBaseX::SetWindowHints()
311 void WindowBaseX::EnableMultipleSelection()
313 WindowSystem::GetImplementation().InputMultiSelect(mWindow);
316 void WindowBaseX::EnableWindowClose()
318 WindowSystem::GetImplementation().SetProtocol(mWindow, WindowSystemX::ATOM_WM_DELETE_WINDOW, true);
321 void WindowBaseX::EnableDragAndDrop()
323 WindowSystem::GetImplementation().EnableDragAndDrop(mWindow, true);
326 void WindowBaseX::SetupEvents()
328 auto& windowSystem = WindowSystem::GetImplementation();
329 windowSystem.AddEventHandler(WindowSystemBase::Event::PROPERTY_NOTIFY, EventWindowPropertyChanged, this);
330 windowSystem.AddEventHandler(WindowSystemBase::Event::DELETE_REQUEST, EventWindowDeleteRequest, this);
331 windowSystem.AddEventHandler(WindowSystemBase::Event::FOCUS_IN, EventWindowFocusIn, this);
332 windowSystem.AddEventHandler(WindowSystemBase::Event::FOCUS_OUT, EventWindowFocusOut, this);
333 windowSystem.AddEventHandler(WindowSystemBase::Event::DAMAGE, EventWindowDamaged, this);
334 windowSystem.AddEventHandler(WindowSystemBase::Event::MOUSE_BUTTON_DOWN, EventMouseButtonDown, this);
335 windowSystem.AddEventHandler(WindowSystemBase::Event::MOUSE_BUTTON_UP, EventMouseButtonUp, this);
336 windowSystem.AddEventHandler(WindowSystemBase::Event::MOUSE_OUT, EventMouseButtonUp, this);
337 windowSystem.AddEventHandler(WindowSystemBase::Event::MOUSE_MOVE, EventMouseButtonMove, this);
338 windowSystem.AddEventHandler(WindowSystemBase::Event::MOUSE_WHEEL, EventMouseWheel, this);
339 windowSystem.AddEventHandler(WindowSystemBase::Event::KEY_DOWN, EventKeyDown, this);
340 windowSystem.AddEventHandler(WindowSystemBase::Event::KEY_UP, EventKeyUp, this);
341 windowSystem.AddEventHandler(WindowSystemBase::Event::SELECTION_CLEAR, EventSelectionClear, this);
342 windowSystem.AddEventHandler(WindowSystemBase::Event::SELECTION_NOTIFY, EventSelectionNotify, this);
345 void WindowBaseX::DeleteEvents()
349 bool WindowBaseX::OnWindowPropertyChanged(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
353 auto propertyNotifyEvent = static_cast<WindowSystem::WindowSystemX::X11PropertyNotifyEvent*>(event);
354 if(propertyNotifyEvent->window == mWindow)
356 WindowSystemX::WindowState state = WindowSystem::GetImplementation().GetWindowState(mWindow);
360 case WindowSystemX::WindowState::WITHDRAWN:
362 // Window was hidden.
363 mIconifyChangedSignal.Emit(true);
367 case WindowSystemX::WindowState::ICONIC:
369 // Window was iconified (minimised).
370 mIconifyChangedSignal.Emit(true);
374 case WindowSystemX::WindowState::NORMAL:
377 mIconifyChangedSignal.Emit(false);
392 void WindowBaseX::OnDeleteRequest()
394 mDeleteRequestSignal.Emit();
397 void WindowBaseX::OnFocusIn(void* data, WindowSystemBase::Event, WindowSystemBase::EventBase* event)
399 auto x11Event = static_cast<WindowSystemX::X11Event*>(event);
401 if(x11Event->window == mWindow)
403 DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window::OnFocusIn\n");
405 mFocusChangedSignal.Emit(true);
409 void WindowBaseX::OnFocusOut(void* data, WindowSystemBase::Event, WindowSystemBase::EventBase* event)
411 auto x11Event = static_cast<WindowSystemX::X11Event*>(event);
412 // If the window loses focus then hide the keyboard.
413 if(x11Event->window == mWindow)
415 DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window::FocusOut\n");
417 mFocusChangedSignal.Emit(false);
421 void WindowBaseX::OnWindowDamaged(void* data, WindowSystemBase::Event, WindowSystemBase::EventBase* event)
423 auto windowExposeEvent = static_cast<WindowSystemX::X11ExposeEvent*>(event);
424 if(windowExposeEvent->window == mWindow)
427 area.x = windowExposeEvent->x;
428 area.y = windowExposeEvent->y;
429 area.width = windowExposeEvent->width;
430 area.height = windowExposeEvent->height;
432 mWindowDamagedSignal.Emit(area);
436 void WindowBaseX::OnMouseButtonDown(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
438 auto touchEvent = static_cast<WindowSystemX::X11MouseEvent*>(event);
440 if(touchEvent->window == mWindow)
442 DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window::ButtonDown\n");
443 PointState::Type state(PointState::DOWN);
445 Integration::Point point;
446 point.SetDeviceId(touchEvent->device);
447 point.SetState(state);
448 point.SetScreenPosition(Vector2(touchEvent->x, touchEvent->y));
449 point.SetRadius(touchEvent->multi.radius, Vector2(touchEvent->multi.radiusX, touchEvent->multi.radiusY));
450 point.SetPressure(touchEvent->multi.pressure);
451 point.SetAngle(Degree(touchEvent->multi.angle));
452 if(touchEvent->buttons)
454 point.SetMouseButton(static_cast<MouseButton::Type>(touchEvent->buttons));
457 mTouchEventSignal.Emit(point, touchEvent->timestamp);
461 void WindowBaseX::OnMouseButtonUp(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
463 auto touchEvent = static_cast<WindowSystemX::X11MouseEvent*>(event);
465 if(touchEvent->window == mWindow)
467 DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window::ButtonUp\n");
468 Integration::Point point;
469 point.SetDeviceId(touchEvent->device);
470 point.SetState(PointState::UP);
471 point.SetScreenPosition(Vector2(touchEvent->x, touchEvent->y));
472 point.SetRadius(touchEvent->multi.radius, Vector2(touchEvent->multi.radiusX, touchEvent->multi.radiusY));
473 point.SetPressure(touchEvent->multi.pressure);
474 point.SetAngle(Degree(static_cast<float>(touchEvent->multi.angle)));
475 if(touchEvent->buttons)
477 point.SetMouseButton(static_cast<MouseButton::Type>(touchEvent->buttons));
480 mTouchEventSignal.Emit(point, touchEvent->timestamp);
484 void WindowBaseX::OnMouseButtonMove(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
486 auto touchEvent = static_cast<WindowSystemX::X11MouseEvent*>(event);
488 if(touchEvent->window == mWindow)
490 Integration::Point point;
491 point.SetDeviceId(touchEvent->device);
492 point.SetState(PointState::MOTION);
493 point.SetScreenPosition(Vector2(static_cast<float>(touchEvent->x), static_cast<float>(touchEvent->y)));
494 point.SetRadius(static_cast<float>(touchEvent->multi.radius), Vector2(static_cast<float>(touchEvent->multi.radiusX), static_cast<float>(touchEvent->multi.radiusY)));
495 point.SetPressure(static_cast<float>(touchEvent->multi.pressure));
496 point.SetAngle(Degree(static_cast<float>(touchEvent->multi.angle)));
498 mTouchEventSignal.Emit(point, touchEvent->timestamp);
502 void WindowBaseX::OnMouseWheel(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
504 auto mouseWheelEvent = static_cast<WindowSystemX::X11MouseWheelEvent*>(event);
506 if(mouseWheelEvent->window == mWindow)
508 DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseX::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent->direction, mouseWheelEvent->modifiers, mouseWheelEvent->x, mouseWheelEvent->y, mouseWheelEvent->z);
510 Integration::WheelEvent wheelEvent(Integration::WheelEvent::MOUSE_WHEEL, mouseWheelEvent->direction, mouseWheelEvent->modifiers, Vector2(static_cast<float>(mouseWheelEvent->x), static_cast<float>(mouseWheelEvent->y)), mouseWheelEvent->z, mouseWheelEvent->timestamp);
512 mWheelEventSignal.Emit(wheelEvent);
516 Integration::KeyEvent WindowBaseX::CreateKeyEvent(WindowSystemX::X11KeyEvent* keyEvent, Integration::KeyEvent::State state)
518 std::string keyName(keyEvent->keyname);
519 std::string logicalKey("");
520 std::string keyString("");
521 std::string compose("");
523 // Ensure key compose string is not NULL as keys like SHIFT or arrow have a null string.
524 if(!keyEvent->compose.empty())
526 compose = keyEvent->compose;
527 keyString = keyEvent->compose;
529 // Ensure key symbol is not NULL as keys like SHIFT have a null string.
530 if(!keyEvent->key.empty())
532 logicalKey = keyEvent->key;
535 int keyCode = keyEvent->keyCode;
536 int modifier(keyEvent->modifiers);
537 unsigned long time(keyEvent->timestamp);
539 Integration::KeyEvent daliKeyEvent{keyName, logicalKey, keyString, keyCode, modifier, time, state, compose, DEFAULT_DEVICE_NAME, DEFAULT_DEVICE_CLASS, DEFAULT_DEVICE_SUBCLASS};
543 void WindowBaseX::OnKeyDown(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
545 auto keyEvent = static_cast<WindowSystemX::X11KeyEvent*>(event);
547 if(keyEvent->window == mWindow)
549 DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseX::OnKeyDown\n");
551 auto daliKeyEvent = CreateKeyEvent(keyEvent, Integration::KeyEvent::DOWN);
553 mKeyEventSignal.Emit(daliKeyEvent);
557 void WindowBaseX::OnKeyUp(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
559 auto keyEvent = static_cast<WindowSystemX::X11KeyEvent*>(event);
561 if(keyEvent->window == mWindow)
563 DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, " WindowBaseX::OnKeyUp\n");
565 auto daliKeyEvent = CreateKeyEvent(keyEvent, Integration::KeyEvent::UP);
567 mKeyEventSignal.Emit(daliKeyEvent);
571 void WindowBaseX::OnSelectionClear(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
575 void WindowBaseX::OnSelectionNotify(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
579 Any WindowBaseX::GetNativeWindow()
584 int WindowBaseX::GetNativeWindowId()
589 std::string WindowBaseX::GetNativeWindowResourceId()
591 return std::string();
594 EGLNativeWindowType WindowBaseX::CreateEglWindow(int width, int height)
596 return reinterpret_cast<EGLNativeWindowType>(mWindow);
599 void WindowBaseX::DestroyEglWindow()
603 void WindowBaseX::SetEglWindowRotation(int angle)
607 void WindowBaseX::SetEglWindowBufferTransform(int angle)
611 void WindowBaseX::SetEglWindowTransform(int angle)
615 void WindowBaseX::ResizeEglWindow(PositionSize positionSize)
619 bool WindowBaseX::IsEglWindowRotationSupported()
624 void WindowBaseX::Move(PositionSize positionSize)
626 WindowSystem::GetImplementation().Move(mWindow, positionSize.x, positionSize.y);
629 void WindowBaseX::Resize(PositionSize positionSize)
631 WindowSystem::GetImplementation().Resize(mWindow, positionSize.width, positionSize.height);
634 void WindowBaseX::MoveResize(PositionSize positionSize)
636 WindowSystem::GetImplementation().MoveResize(mWindow, positionSize.x, positionSize.y, positionSize.width, positionSize.height);
639 void WindowBaseX::SetClass(const std::string& name, const std::string& className)
641 WindowSystem::GetImplementation().SetClass(mWindow, name, className);
644 void WindowBaseX::Raise()
646 WindowSystem::GetImplementation().Raise(mWindow);
649 void WindowBaseX::Lower()
651 WindowSystem::GetImplementation().Lower(mWindow);
654 void WindowBaseX::Activate()
656 WindowSystem::GetImplementation().Activate(mWindow);
659 void WindowBaseX::Maximize(bool maximize)
663 bool WindowBaseX::IsMaximized() const
668 void WindowBaseX::Minimize(bool minimize)
672 bool WindowBaseX::IsMinimized() const
677 void WindowBaseX::SetMimimumSize(Dali::Window::WindowSize size)
681 void WindowBaseX::SetMaximumSize(Dali::Window::WindowSize size)
685 void WindowBaseX::SetAvailableAnlges(const std::vector<int>& angles)
689 void WindowBaseX::SetPreferredAngle(int angle)
693 void WindowBaseX::SetAcceptFocus(bool accept)
697 void WindowBaseX::Show()
699 WindowSystem::GetImplementation().Show(mWindow);
702 void WindowBaseX::Hide()
704 WindowSystem::GetImplementation().Hide(mWindow);
707 unsigned int WindowBaseX::GetSupportedAuxiliaryHintCount() const
712 std::string WindowBaseX::GetSupportedAuxiliaryHint(unsigned int index) const
714 return std::string();
717 unsigned int WindowBaseX::AddAuxiliaryHint(const std::string& hint, const std::string& value)
722 bool WindowBaseX::RemoveAuxiliaryHint(unsigned int id)
727 bool WindowBaseX::SetAuxiliaryHintValue(unsigned int id, const std::string& value)
732 std::string WindowBaseX::GetAuxiliaryHintValue(unsigned int id) const
734 return std::string();
737 unsigned int WindowBaseX::GetAuxiliaryHintId(const std::string& hint) const
742 void WindowBaseX::SetInputRegion(const Rect<int>& inputRegion)
746 void WindowBaseX::SetType(Dali::WindowType type)
750 Dali::WindowType WindowBaseX::GetType() const
752 return Dali::WindowType::NORMAL;
755 Dali::WindowOperationResult WindowBaseX::SetNotificationLevel(Dali::WindowNotificationLevel level)
757 return Dali::WindowOperationResult::NOT_SUPPORTED;
760 Dali::WindowNotificationLevel WindowBaseX::GetNotificationLevel() const
762 return Dali::WindowNotificationLevel::NONE;
765 void WindowBaseX::SetOpaqueState(bool opaque)
769 Dali::WindowOperationResult WindowBaseX::SetScreenOffMode(WindowScreenOffMode screenOffMode)
771 return Dali::WindowOperationResult::NOT_SUPPORTED;
774 WindowScreenOffMode WindowBaseX::GetScreenOffMode() const
776 return WindowScreenOffMode::TIMEOUT;
779 Dali::WindowOperationResult WindowBaseX::SetBrightness(int brightness)
781 return Dali::WindowOperationResult::NOT_SUPPORTED;
784 int WindowBaseX::GetBrightness() const
789 bool WindowBaseX::GrabKey(Dali::KEY key, KeyGrab::KeyGrabMode grabMode)
794 bool WindowBaseX::UngrabKey(Dali::KEY key)
799 bool WindowBaseX::GrabKeyList(const Dali::Vector<Dali::KEY>& key, const Dali::Vector<KeyGrab::KeyGrabMode>& grabMode, Dali::Vector<bool>& result)
804 bool WindowBaseX::UngrabKeyList(const Dali::Vector<Dali::KEY>& key, Dali::Vector<bool>& result)
809 void WindowBaseX::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical)
811 // 1 inch = 25.4 millimeters
812 WindowSystem::GetImplementation().GetDPI(dpiHorizontal, dpiVertical);
815 int WindowBaseX::GetWindowRotationAngle() const
820 int WindowBaseX::GetScreenRotationAngle()
825 void WindowBaseX::SetWindowRotationAngle(int degree)
827 mWindowRotationAngle = degree;
830 void WindowBaseX::WindowRotationCompleted(int degree, int width, int height)
834 void WindowBaseX::SetTransparency(bool transparent)
838 unsigned int WindowBaseX::GetSurfaceId(Any surface) const
840 unsigned int surfaceId = 0;
842 if(surface.Empty() == false)
844 // check we have a valid type
845 DALI_ASSERT_ALWAYS(((surface.GetType() == typeid(::Window))) && "Surface type is invalid");
847 surfaceId = static_cast<unsigned int>(AnyCast<::Window>(surface));
852 void WindowBaseX::CreateWindow(PositionSize positionSize, bool isTransparent)
858 // create 32 bit window
861 mIsTransparent = true;
863 mWindow = WindowSystem::GetImplementation().CreateWindow(depth, positionSize.x, positionSize.y, positionSize.width, positionSize.height);
867 DALI_ASSERT_ALWAYS(0 && "Failed to create X window");
871 void WindowBaseX::SetParent(WindowBase* parentWinBase, bool belowParent)
875 WindowBaseX* windowBaseX = static_cast<WindowBaseX*>(parentWinBase);
876 ::Window parentWindow = windowBaseX->mWindow;
877 WindowSystem::GetImplementation().SetTransientForHint(mWindow, parentWindow);
881 WindowSystem::GetImplementation().UnsetTransientFor(mWindow);
885 int WindowBaseX::CreateFrameRenderedSyncFence()
890 int WindowBaseX::CreateFramePresentedSyncFence()
895 void WindowBaseX::SetPositionSizeWithAngle(PositionSize positionSize, int angle)
899 void WindowBaseX::InitializeIme()
903 void WindowBaseX::ImeWindowReadyToRender()
907 void WindowBaseX::RequestMoveToServer()
911 void WindowBaseX::RequestResizeToServer(WindowResizeDirection direction)
915 void WindowBaseX::EnableFloatingMode(bool enable)
919 bool WindowBaseX::IsFloatingModeEnabled() const
924 void WindowBaseX::IncludeInputRegion(const Rect<int>& inputRegion)
928 void WindowBaseX::ExcludeInputRegion(const Rect<int>& inputRegion)
932 } // namespace Adaptor
934 } // namespace Internal