2 * Copyright (c) 2023 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 EventWindowConfigureNotify(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
58 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
61 windowBase->OnConfigure(event);
67 static bool EventWindowPropertyChanged(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
69 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
72 return windowBase->OnWindowPropertyChanged(data, type, event);
79 * Called when the window receives a delete request
81 static bool EventWindowDeleteRequest(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
83 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
86 windowBase->OnDeleteRequest();
92 * Called when the window gains focus.
94 static bool EventWindowFocusIn(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
96 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
99 windowBase->OnFocusIn(data, type, event);
105 * Called when the window loses focus.
107 static bool EventWindowFocusOut(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
109 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
112 windowBase->OnFocusOut(data, type, event);
118 * Called when the window is damaged.
120 static bool EventWindowDamaged(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
122 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
125 windowBase->OnWindowDamaged(data, type, event);
131 /////////////////////////////////////////////////////////////////////////////////////////////////
132 // Selection Callbacks
133 /////////////////////////////////////////////////////////////////////////////////////////////////
136 * Called when the source window notifies us the content in clipboard is selected.
138 static bool EventSelectionClear(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
140 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
143 windowBase->OnSelectionClear(data, type, event);
149 * Called when the source window sends us about the selected content.
150 * For example, when dragged items are dragged INTO our window or when items are selected in the clipboard.
152 static bool EventSelectionNotify(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
154 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
157 windowBase->OnSelectionNotify(data, type, event);
162 /////////////////////////////////////////////////////////////////////////////////////////////////
164 /////////////////////////////////////////////////////////////////////////////////////////////////
167 * Called when a touch down is received.
169 static bool EventMouseButtonDown(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
171 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
174 windowBase->OnMouseButtonDown(data, type, event);
180 * Called when a touch up is received.
182 static bool EventMouseButtonUp(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
184 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
187 windowBase->OnMouseButtonUp(data, type, event);
193 * Called when a touch motion is received.
195 static bool EventMouseButtonMove(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
197 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
200 windowBase->OnMouseButtonMove(data, type, event);
205 /////////////////////////////////////////////////////////////////////////////////////////////////
207 /////////////////////////////////////////////////////////////////////////////////////////////////
210 * Called when a mouse wheel is received.
212 static bool EventMouseWheel(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
214 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
217 windowBase->OnMouseWheel(data, type, event);
222 /////////////////////////////////////////////////////////////////////////////////////////////////
224 /////////////////////////////////////////////////////////////////////////////////////////////////
227 * Called when a key down is received.
229 static bool EventKeyDown(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
231 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
234 windowBase->OnKeyDown(data, type, event);
240 * Called when a key up is received.
242 static bool EventKeyUp(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
244 WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
247 windowBase->OnKeyUp(data, type, event);
252 } // unnamed namespace
254 WindowBaseX::WindowBaseX(Dali::PositionSize positionSize, Any surface, bool isTransparent)
258 mIsTransparent(false), // Should only be set to true once we actually create a transparent window regardless of what isTransparent is.
259 mRotationAppSet(false),
260 mWindowRotationAngle(0)
262 Initialize(positionSize, surface, isTransparent);
265 WindowBaseX::~WindowBaseX()
268 mEventHandlers.Clear();
272 XDestroyWindow(WindowSystem::GetImplementation().GetXDisplay(), mWindow);
274 /**** @todo Should not be destroyed here! ****/
275 WindowSystem::Shutdown();
279 void WindowBaseX::Initialize(PositionSize positionSize, Any surface, bool isTransparent)
281 // see if there is a surface in Any surface
282 unsigned int surfaceId = GetSurfaceId(surface);
284 // if the surface is empty, create a new one.
287 /**** @todo Should be created from somewhere else! ****/
288 WindowSystem::Initialize();
290 // we own the surface about to created
292 CreateWindow(positionSize, isTransparent);
296 // XLib should already be initialized so no point in calling XInitThreads
297 mWindow = static_cast<::Window>(surfaceId);
300 auto& windowSystem = WindowSystem::GetImplementation();
303 if((id = getenv("DESKTOP_STARTUP_ID")))
305 windowSystem.SetStringProperty(mWindow, WindowSystemX::ATOM_NET_STARTUP_ID, std::string(id));
308 windowSystem.SetWindowHints(mWindow, true);
311 EnableMultipleSelection();
318 void WindowBaseX::SetWindowHints()
322 void WindowBaseX::EnableMultipleSelection()
324 WindowSystem::GetImplementation().InputMultiSelect(mWindow);
327 void WindowBaseX::EnableWindowClose()
329 WindowSystem::GetImplementation().SetProtocol(mWindow, WindowSystemX::ATOM_WM_DELETE_WINDOW, true);
332 void WindowBaseX::EnableDragAndDrop()
334 WindowSystem::GetImplementation().EnableDragAndDrop(mWindow, true);
337 void WindowBaseX::SetupEvents()
339 auto& windowSystem = WindowSystem::GetImplementation();
340 windowSystem.AddEventHandler(WindowSystemBase::Event::CONFIGURE_NOTIFY, EventWindowConfigureNotify, this);
341 windowSystem.AddEventHandler(WindowSystemBase::Event::PROPERTY_NOTIFY, EventWindowPropertyChanged, this);
342 windowSystem.AddEventHandler(WindowSystemBase::Event::DELETE_REQUEST, EventWindowDeleteRequest, this);
343 windowSystem.AddEventHandler(WindowSystemBase::Event::FOCUS_IN, EventWindowFocusIn, this);
344 windowSystem.AddEventHandler(WindowSystemBase::Event::FOCUS_OUT, EventWindowFocusOut, this);
345 windowSystem.AddEventHandler(WindowSystemBase::Event::DAMAGE, EventWindowDamaged, this);
346 windowSystem.AddEventHandler(WindowSystemBase::Event::MOUSE_BUTTON_DOWN, EventMouseButtonDown, this);
347 windowSystem.AddEventHandler(WindowSystemBase::Event::MOUSE_BUTTON_UP, EventMouseButtonUp, this);
348 windowSystem.AddEventHandler(WindowSystemBase::Event::MOUSE_OUT, EventMouseButtonUp, this);
349 windowSystem.AddEventHandler(WindowSystemBase::Event::MOUSE_MOVE, EventMouseButtonMove, this);
350 windowSystem.AddEventHandler(WindowSystemBase::Event::MOUSE_WHEEL, EventMouseWheel, this);
351 windowSystem.AddEventHandler(WindowSystemBase::Event::KEY_DOWN, EventKeyDown, this);
352 windowSystem.AddEventHandler(WindowSystemBase::Event::KEY_UP, EventKeyUp, this);
353 windowSystem.AddEventHandler(WindowSystemBase::Event::SELECTION_CLEAR, EventSelectionClear, this);
354 windowSystem.AddEventHandler(WindowSystemBase::Event::SELECTION_NOTIFY, EventSelectionNotify, this);
357 void WindowBaseX::DeleteEvents()
361 bool WindowBaseX::OnWindowPropertyChanged(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
365 auto propertyNotifyEvent = static_cast<WindowSystem::WindowSystemX::X11PropertyNotifyEvent*>(event);
366 if(propertyNotifyEvent->window == mWindow)
368 WindowSystemX::WindowState state = WindowSystem::GetImplementation().GetWindowState(mWindow);
372 case WindowSystemX::WindowState::WITHDRAWN:
374 // Window was hidden.
375 mIconifyChangedSignal.Emit(true);
379 case WindowSystemX::WindowState::ICONIC:
381 // Window was iconified (minimised).
382 mIconifyChangedSignal.Emit(true);
386 case WindowSystemX::WindowState::NORMAL:
389 mIconifyChangedSignal.Emit(false);
404 void WindowBaseX::OnConfigure(WindowSystemBase::EventBase* event)
406 auto configureEvent = static_cast<WindowSystemX::X11ConfigureNotifyEvent*>(event);
407 if(configureEvent->window == mWindow)
409 DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window::OnConfigureNotify\n");
410 Dali::PositionSize positionSize;
411 positionSize.x = configureEvent->x;
412 positionSize.y = configureEvent->y;
413 positionSize.width = configureEvent->width;
414 positionSize.height = configureEvent->height;
415 /// @note Can also get the window below this one if raise/lower was called.
416 mUpdatePositionSizeSignal.Emit(positionSize);
420 void WindowBaseX::OnDeleteRequest()
422 mDeleteRequestSignal.Emit();
425 void WindowBaseX::OnFocusIn(void* data, WindowSystemBase::Event, WindowSystemBase::EventBase* event)
427 auto x11Event = static_cast<WindowSystemX::X11Event*>(event);
429 if(x11Event->window == mWindow)
431 DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window::OnFocusIn\n");
433 mFocusChangedSignal.Emit(true);
437 void WindowBaseX::OnFocusOut(void* data, WindowSystemBase::Event, WindowSystemBase::EventBase* event)
439 auto x11Event = static_cast<WindowSystemX::X11Event*>(event);
440 // If the window loses focus then hide the keyboard.
441 if(x11Event->window == mWindow)
443 DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window::FocusOut\n");
445 mFocusChangedSignal.Emit(false);
449 void WindowBaseX::OnWindowDamaged(void* data, WindowSystemBase::Event, WindowSystemBase::EventBase* event)
451 auto windowExposeEvent = static_cast<WindowSystemX::X11ExposeEvent*>(event);
452 if(windowExposeEvent->window == mWindow)
455 area.x = windowExposeEvent->x;
456 area.y = windowExposeEvent->y;
457 area.width = windowExposeEvent->width;
458 area.height = windowExposeEvent->height;
460 mWindowDamagedSignal.Emit(area);
464 void WindowBaseX::OnMouseButtonDown(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
466 auto touchEvent = static_cast<WindowSystemX::X11MouseEvent*>(event);
468 if(touchEvent->window == mWindow)
470 DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window::ButtonDown\n");
471 PointState::Type state(PointState::DOWN);
473 Integration::Point point;
474 point.SetDeviceId(touchEvent->device);
475 point.SetState(state);
476 point.SetScreenPosition(Vector2(touchEvent->x, touchEvent->y));
477 point.SetRadius(touchEvent->multi.radius, Vector2(touchEvent->multi.radiusX, touchEvent->multi.radiusY));
478 point.SetPressure(touchEvent->multi.pressure);
479 point.SetAngle(Degree(touchEvent->multi.angle));
480 if(touchEvent->buttons)
482 point.SetMouseButton(static_cast<MouseButton::Type>(touchEvent->buttons));
485 mTouchEventSignal.Emit(point, touchEvent->timestamp);
489 void WindowBaseX::OnMouseButtonUp(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
491 auto touchEvent = static_cast<WindowSystemX::X11MouseEvent*>(event);
493 if(touchEvent->window == mWindow)
495 DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window::ButtonUp\n");
496 Integration::Point point;
497 point.SetDeviceId(touchEvent->device);
498 point.SetState(PointState::UP);
499 point.SetScreenPosition(Vector2(touchEvent->x, touchEvent->y));
500 point.SetRadius(touchEvent->multi.radius, Vector2(touchEvent->multi.radiusX, touchEvent->multi.radiusY));
501 point.SetPressure(touchEvent->multi.pressure);
502 point.SetAngle(Degree(static_cast<float>(touchEvent->multi.angle)));
503 if(touchEvent->buttons)
505 point.SetMouseButton(static_cast<MouseButton::Type>(touchEvent->buttons));
508 mTouchEventSignal.Emit(point, touchEvent->timestamp);
512 void WindowBaseX::OnMouseButtonMove(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
514 auto touchEvent = static_cast<WindowSystemX::X11MouseEvent*>(event);
516 if(touchEvent->window == mWindow)
518 Integration::Point point;
519 point.SetDeviceId(touchEvent->device);
520 point.SetState(PointState::MOTION);
521 point.SetScreenPosition(Vector2(static_cast<float>(touchEvent->x), static_cast<float>(touchEvent->y)));
522 point.SetRadius(static_cast<float>(touchEvent->multi.radius), Vector2(static_cast<float>(touchEvent->multi.radiusX), static_cast<float>(touchEvent->multi.radiusY)));
523 point.SetPressure(static_cast<float>(touchEvent->multi.pressure));
524 point.SetAngle(Degree(static_cast<float>(touchEvent->multi.angle)));
526 mTouchEventSignal.Emit(point, touchEvent->timestamp);
530 void WindowBaseX::OnMouseWheel(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
532 auto mouseWheelEvent = static_cast<WindowSystemX::X11MouseWheelEvent*>(event);
534 if(mouseWheelEvent->window == mWindow)
536 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);
538 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);
540 mWheelEventSignal.Emit(wheelEvent);
544 Integration::KeyEvent WindowBaseX::CreateKeyEvent(WindowSystemX::X11KeyEvent* keyEvent, Integration::KeyEvent::State state)
546 std::string keyName(keyEvent->keyname);
547 std::string logicalKey("");
548 std::string keyString("");
549 std::string compose("");
551 // Ensure key compose string is not NULL as keys like SHIFT or arrow have a null string.
552 if(!keyEvent->compose.empty())
554 compose = keyEvent->compose;
555 keyString = keyEvent->compose;
557 // Ensure key symbol is not NULL as keys like SHIFT have a null string.
558 if(!keyEvent->key.empty())
560 logicalKey = keyEvent->key;
563 int keyCode = keyEvent->keyCode;
564 int modifier(keyEvent->modifiers);
565 unsigned long time(keyEvent->timestamp);
567 Integration::KeyEvent daliKeyEvent{keyName, logicalKey, keyString, keyCode, modifier, time, state, compose, DEFAULT_DEVICE_NAME, DEFAULT_DEVICE_CLASS, DEFAULT_DEVICE_SUBCLASS};
571 void WindowBaseX::OnKeyDown(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
573 auto keyEvent = static_cast<WindowSystemX::X11KeyEvent*>(event);
575 if(keyEvent->window == mWindow)
577 DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseX::OnKeyDown\n");
579 auto daliKeyEvent = CreateKeyEvent(keyEvent, Integration::KeyEvent::DOWN);
581 mKeyEventSignal.Emit(daliKeyEvent);
585 void WindowBaseX::OnKeyUp(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
587 auto keyEvent = static_cast<WindowSystemX::X11KeyEvent*>(event);
589 if(keyEvent->window == mWindow)
591 DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, " WindowBaseX::OnKeyUp\n");
593 auto daliKeyEvent = CreateKeyEvent(keyEvent, Integration::KeyEvent::UP);
595 mKeyEventSignal.Emit(daliKeyEvent);
599 void WindowBaseX::OnSelectionClear(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
603 void WindowBaseX::OnSelectionNotify(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
607 Any WindowBaseX::GetNativeWindow()
612 int WindowBaseX::GetNativeWindowId()
617 std::string WindowBaseX::GetNativeWindowResourceId()
619 return std::string();
622 EGLNativeWindowType WindowBaseX::CreateEglWindow(int width, int height)
624 return reinterpret_cast<EGLNativeWindowType>(mWindow);
627 void WindowBaseX::DestroyEglWindow()
631 void WindowBaseX::SetEglWindowRotation(int angle)
635 void WindowBaseX::SetEglWindowBufferTransform(int angle)
639 void WindowBaseX::SetEglWindowTransform(int angle)
643 void WindowBaseX::ResizeEglWindow(PositionSize positionSize)
647 bool WindowBaseX::IsEglWindowRotationSupported()
652 void WindowBaseX::Move(PositionSize positionSize)
654 WindowSystem::GetImplementation().Move(mWindow, positionSize.x, positionSize.y);
657 void WindowBaseX::Resize(PositionSize positionSize)
659 WindowSystem::GetImplementation().Resize(mWindow, positionSize.width, positionSize.height);
662 void WindowBaseX::MoveResize(PositionSize positionSize)
664 WindowSystem::GetImplementation().MoveResize(mWindow, positionSize.x, positionSize.y, positionSize.width, positionSize.height);
667 void WindowBaseX::SetClass(const std::string& name, const std::string& className)
669 WindowSystem::GetImplementation().SetClass(mWindow, name, className);
672 void WindowBaseX::Raise()
674 WindowSystem::GetImplementation().Raise(mWindow);
677 void WindowBaseX::Lower()
679 WindowSystem::GetImplementation().Lower(mWindow);
682 void WindowBaseX::Activate()
684 WindowSystem::GetImplementation().Activate(mWindow);
687 void WindowBaseX::Maximize(bool maximize)
691 bool WindowBaseX::IsMaximized() const
696 void WindowBaseX::Minimize(bool minimize)
700 bool WindowBaseX::IsMinimized() const
705 void WindowBaseX::SetMimimumSize(Dali::Window::WindowSize size)
709 void WindowBaseX::SetMaximumSize(Dali::Window::WindowSize size)
713 void WindowBaseX::SetAvailableAnlges(const std::vector<int>& angles)
717 void WindowBaseX::SetPreferredAngle(int angle)
721 void WindowBaseX::SetAcceptFocus(bool accept)
725 void WindowBaseX::Show()
727 WindowSystem::GetImplementation().Show(mWindow);
730 void WindowBaseX::Hide()
732 WindowSystem::GetImplementation().Hide(mWindow);
735 unsigned int WindowBaseX::GetSupportedAuxiliaryHintCount() const
740 std::string WindowBaseX::GetSupportedAuxiliaryHint(unsigned int index) const
742 return std::string();
745 unsigned int WindowBaseX::AddAuxiliaryHint(const std::string& hint, const std::string& value)
750 bool WindowBaseX::RemoveAuxiliaryHint(unsigned int id)
755 bool WindowBaseX::SetAuxiliaryHintValue(unsigned int id, const std::string& value)
760 std::string WindowBaseX::GetAuxiliaryHintValue(unsigned int id) const
762 return std::string();
765 unsigned int WindowBaseX::GetAuxiliaryHintId(const std::string& hint) const
770 void WindowBaseX::SetInputRegion(const Rect<int>& inputRegion)
774 void WindowBaseX::SetType(Dali::WindowType type)
778 Dali::WindowType WindowBaseX::GetType() const
780 return Dali::WindowType::NORMAL;
783 Dali::WindowOperationResult WindowBaseX::SetNotificationLevel(Dali::WindowNotificationLevel level)
785 return Dali::WindowOperationResult::NOT_SUPPORTED;
788 Dali::WindowNotificationLevel WindowBaseX::GetNotificationLevel() const
790 return Dali::WindowNotificationLevel::NONE;
793 void WindowBaseX::SetOpaqueState(bool opaque)
797 Dali::WindowOperationResult WindowBaseX::SetScreenOffMode(WindowScreenOffMode screenOffMode)
799 return Dali::WindowOperationResult::NOT_SUPPORTED;
802 WindowScreenOffMode WindowBaseX::GetScreenOffMode() const
804 return WindowScreenOffMode::TIMEOUT;
807 Dali::WindowOperationResult WindowBaseX::SetBrightness(int brightness)
809 return Dali::WindowOperationResult::NOT_SUPPORTED;
812 int WindowBaseX::GetBrightness() const
817 bool WindowBaseX::GrabKey(Dali::KEY key, KeyGrab::KeyGrabMode grabMode)
822 bool WindowBaseX::UngrabKey(Dali::KEY key)
827 bool WindowBaseX::GrabKeyList(const Dali::Vector<Dali::KEY>& key, const Dali::Vector<KeyGrab::KeyGrabMode>& grabMode, Dali::Vector<bool>& result)
832 bool WindowBaseX::UngrabKeyList(const Dali::Vector<Dali::KEY>& key, Dali::Vector<bool>& result)
837 void WindowBaseX::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical)
839 // 1 inch = 25.4 millimeters
840 WindowSystem::GetImplementation().GetDPI(dpiHorizontal, dpiVertical);
843 int WindowBaseX::GetWindowRotationAngle() const
848 int WindowBaseX::GetScreenRotationAngle()
853 void WindowBaseX::SetWindowRotationAngle(int degree)
855 mWindowRotationAngle = degree;
858 void WindowBaseX::WindowRotationCompleted(int degree, int width, int height)
862 void WindowBaseX::SetTransparency(bool transparent)
866 unsigned int WindowBaseX::GetSurfaceId(Any surface) const
868 unsigned int surfaceId = 0;
870 if(surface.Empty() == false)
872 // check we have a valid type
873 DALI_ASSERT_ALWAYS(((surface.GetType() == typeid(::Window))) && "Surface type is invalid");
875 surfaceId = static_cast<unsigned int>(AnyCast<::Window>(surface));
880 void WindowBaseX::CreateWindow(PositionSize positionSize, bool isTransparent)
886 // create 32 bit window
889 mIsTransparent = true;
891 mWindow = WindowSystem::GetImplementation().CreateWindow(depth, positionSize.x, positionSize.y, positionSize.width, positionSize.height);
895 DALI_ASSERT_ALWAYS(0 && "Failed to create X window");
899 void WindowBaseX::SetParent(WindowBase* parentWinBase, bool belowParent)
903 WindowBaseX* windowBaseX = static_cast<WindowBaseX*>(parentWinBase);
904 ::Window parentWindow = windowBaseX->mWindow;
905 WindowSystem::GetImplementation().SetTransientForHint(mWindow, parentWindow);
909 WindowSystem::GetImplementation().UnsetTransientFor(mWindow);
913 int WindowBaseX::CreateFrameRenderedSyncFence()
918 int WindowBaseX::CreateFramePresentedSyncFence()
923 void WindowBaseX::SetPositionSizeWithAngle(PositionSize positionSize, int angle)
927 void WindowBaseX::InitializeIme()
931 void WindowBaseX::ImeWindowReadyToRender()
935 void WindowBaseX::RequestMoveToServer()
939 void WindowBaseX::RequestResizeToServer(WindowResizeDirection direction)
943 void WindowBaseX::EnableFloatingMode(bool enable)
947 bool WindowBaseX::IsFloatingModeEnabled() const
952 void WindowBaseX::IncludeInputRegion(const Rect<int>& inputRegion)
956 void WindowBaseX::ExcludeInputRegion(const Rect<int>& inputRegion)
960 } // namespace Adaptor
962 } // namespace Internal