X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fwindow-system%2Fcommon%2Fwindow-base.h;h=782bc9e7d782511d2562eefa36cf1058f07baf87;hb=6349227b3481258c3f69f8d49541eb27e96248e4;hp=01d3650e9c09e1cd048c5b6eb09a1f5aaf9a246c;hpb=943cefaecdc067fcf1c0f90bc57c257bcfbc2561;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/window-system/common/window-base.h b/dali/internal/window-system/common/window-base.h index 01d3650..782bc9e 100644 --- a/dali/internal/window-system/common/window-base.h +++ b/dali/internal/window-system/common/window-base.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_BASE_H /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,19 +22,20 @@ #include #include #include +#include #include #include -#include // INTERNAL INCLUDES -#include -#include -#include -#include +#include #include +#include #include #include -#include +#include +#include +#include +#include namespace Dali { @@ -42,14 +43,12 @@ namespace Internal { namespace Adaptor { - /** * WindowBase interface */ class WindowBase { public: - /** * @brief Struct used to retrieve accessibility information */ @@ -65,27 +64,35 @@ public: }; // Window - typedef Signal< void ( bool ) > IconifySignalType; - typedef Signal< void ( bool ) > FocusSignalType; - typedef Signal< void ( ) > OutputSignalType; - typedef Signal< void ( ) > DeleteSignalType; - typedef Signal< void ( const DamageArea& ) > DamageSignalType; - typedef Signal< void ( const RotationEvent& ) > RotationSignalType; - typedef Signal< void ( WindowEffectState, WindowEffectType ) > TransitionEffectEventSignalType; - typedef Signal< void ( ) > KeyboardRepeatSettingsChangedSignalType; - typedef Signal< void ( ) > WindowRedrawRequestSignalType; + typedef Signal IconifySignalType; + typedef Signal MaximizeSignalType; + typedef Signal FocusSignalType; + typedef Signal OutputSignalType; + typedef Signal DeleteSignalType; + typedef Signal DamageSignalType; + typedef Signal RotationSignalType; + typedef Signal TransitionEffectEventSignalType; + typedef Signal KeyboardRepeatSettingsChangedSignalType; + typedef Signal WindowRedrawRequestSignalType; + typedef Signal UpdatePositionSizeType; + typedef Signal AuxiliaryMessageSignalType; + typedef Signal MouseInOutEventSignalType; + typedef Signal MouseRelativeEventSignalType; + typedef Signal MoveCompletedSignalType; + typedef Signal ResizeCompletedSignalType; + typedef Signal InsetsChangedSignalType; + typedef Signal PointerConstraintsSignalType; // Input events - typedef Signal< void ( Integration::Point&, uint32_t ) > TouchEventSignalType; - typedef Signal< void ( Integration::WheelEvent& ) > WheelEventSignalType; - typedef Signal< void( Integration::KeyEvent& ) > KeyEventSignalType; + typedef Signal TouchEventSignalType; + typedef Signal WheelEventSignalType; + typedef Signal KeyEventSignalType; // Clipboard - typedef Signal< void ( void* ) > SelectionSignalType; + typedef Signal SelectionSignalType; // Accessibility - typedef Signal< void ( StyleChange::Type ) > StyleSignalType; - typedef Signal< void ( const AccessibilityInfo& ) > AccessibilitySignalType; + typedef Signal StyleSignalType; /** * @brief Default constructor @@ -98,7 +105,6 @@ public: virtual ~WindowBase(); public: - /** * @brief Get the native window handle * @return The native window handle @@ -112,9 +118,15 @@ public: virtual int GetNativeWindowId() = 0; /** + * @brief Get the native window resource id assinged by window manager + * @return The native window resource id + */ + virtual std::string GetNativeWindowResourceId() = 0; + + /** * @brief Create the egl window */ - virtual EGLNativeWindowType CreateEglWindow( int width, int height ) = 0; + virtual EGLNativeWindowType CreateEglWindow(int width, int height) = 0; /** * @brief Destroy the egl window @@ -124,22 +136,22 @@ public: /** * @brief Set the egl window rotation */ - virtual void SetEglWindowRotation( int angle ) = 0; + virtual void SetEglWindowRotation(int angle) = 0; /** * @brief Set the egl window buffer transform */ - virtual void SetEglWindowBufferTransform( int angle ) = 0; + virtual void SetEglWindowBufferTransform(int angle) = 0; /** * @brief Set the egl window transform */ - virtual void SetEglWindowTransform( int angle ) = 0; + virtual void SetEglWindowTransform(int angle) = 0; /** * @brief Resize the egl window */ - virtual void ResizeEglWindow( Dali::PositionSize positionSize ) = 0; + virtual void ResizeEglWindow(Dali::PositionSize positionSize) = 0; /** * @brief Returns whether the egl window support rotation or not @@ -149,22 +161,27 @@ public: /** * @brief Move the window */ - virtual void Move( Dali::PositionSize positionSize ) = 0; + virtual void Move(Dali::PositionSize positionSize) = 0; /** * @brief Resize the window */ - virtual void Resize( Dali::PositionSize positionSize ) = 0; + virtual void Resize(Dali::PositionSize positionSize) = 0; /** * @brief Move and resize the window */ - virtual void MoveResize( Dali::PositionSize positionSize ) = 0; + virtual void MoveResize(Dali::PositionSize positionSize) = 0; + + /** + * @copydoc Dali::Window::SetLayout() + */ + virtual void SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan) = 0; /** * @copydoc Dali::Window::SetClass() */ - virtual void SetClass( const std::string& name, const std::string& className ) = 0; + virtual void SetClass(const std::string& name, const std::string& className) = 0; /** * @copydoc Dali::Window::Raise() @@ -182,19 +199,49 @@ public: virtual void Activate() = 0; /** + * @copydoc Dali::DevelWindow::Maximize() + */ + virtual void Maximize(bool maximize) = 0; + + /** + * @copydoc Dali::DevelWindow::IsMaximized() + */ + virtual bool IsMaximized() const = 0; + + /** + * @copydoc Dali::DevelWindow::SetMaximumSize() + */ + virtual void SetMaximumSize(Dali::Window::WindowSize size) = 0; + + /** + * @copydoc Dali::DevelWindow::Minimize() + */ + virtual void Minimize(bool minimize) = 0; + + /** + * @copydoc Dali::DevelWindow::IsMinimized() + */ + virtual bool IsMinimized() const = 0; + + /** + * @copydoc Dali::DevelWindow::SetMimimumSize() + */ + virtual void SetMimimumSize(Dali::Window::WindowSize size) = 0; + + /** * @copydoc Dali::Window::SetAvailableOrientations() */ - virtual void SetAvailableAnlges( const std::vector< int >& angles ) = 0; + virtual void SetAvailableAnlges(const std::vector& angles) = 0; /** * @copydoc Dali::Window::SetPreferredOrientation() */ - virtual void SetPreferredAngle( int angle ) = 0; + virtual void SetPreferredAngle(int angle) = 0; /** * @copydoc Dali::Window::SetAcceptFocus() */ - virtual void SetAcceptFocus( bool accept ) = 0; + virtual void SetAcceptFocus(bool accept) = 0; /** * @copydoc Dali::Window::Show() @@ -214,47 +261,52 @@ public: /** * @copydoc Dali::Window::GetSupportedAuxiliaryHint() */ - virtual std::string GetSupportedAuxiliaryHint( unsigned int index ) const = 0; + virtual std::string GetSupportedAuxiliaryHint(unsigned int index) const = 0; /** * @copydoc Dali::Window::AddAuxiliaryHint() */ - virtual unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value ) = 0; + virtual unsigned int AddAuxiliaryHint(const std::string& hint, const std::string& value) = 0; /** * @copydoc Dali::Window::RemoveAuxiliaryHint() */ - virtual bool RemoveAuxiliaryHint( unsigned int id ) = 0; + virtual bool RemoveAuxiliaryHint(unsigned int id) = 0; /** * @copydoc Dali::Window::SetAuxiliaryHintValue() */ - virtual bool SetAuxiliaryHintValue( unsigned int id, const std::string& value ) = 0; + virtual bool SetAuxiliaryHintValue(unsigned int id, const std::string& value) = 0; /** * @copydoc Dali::Window::GetAuxiliaryHintValue() */ - virtual std::string GetAuxiliaryHintValue( unsigned int id ) const = 0; + virtual std::string GetAuxiliaryHintValue(unsigned int id) const = 0; /** * @copydoc Dali::Window::GetAuxiliaryHintId() */ - virtual unsigned int GetAuxiliaryHintId( const std::string& hint ) const = 0; + virtual unsigned int GetAuxiliaryHintId(const std::string& hint) const = 0; /** * @copydoc Dali::Window::SetInputRegion() */ - virtual void SetInputRegion( const Rect< int >& inputRegion ) = 0; + virtual void SetInputRegion(const Rect& inputRegion) = 0; /** * @copydoc Dali::Window::SetType() */ - virtual void SetType( Dali::WindowType type ) = 0; + virtual void SetType(Dali::WindowType type) = 0; + + /** + * @copydoc Dali::Window::GetType() + */ + virtual Dali::WindowType GetType() const = 0; /** * @copydoc Dali::Window::SetNotificationLevel() */ - virtual bool SetNotificationLevel( Dali::WindowNotificationLevel level ) = 0; + virtual Dali::WindowOperationResult SetNotificationLevel(Dali::WindowNotificationLevel level) = 0; /** * @copydoc Dali::Window::GetNotificationLevel() @@ -264,12 +316,12 @@ public: /** * @copydoc Dali::Window::SetOpaqueState() */ - virtual void SetOpaqueState( bool opaque ) = 0; + virtual void SetOpaqueState(bool opaque) = 0; /** * @copydoc Dali::Window::SetScreenOffMode() */ - virtual bool SetScreenOffMode(WindowScreenOffMode screenOffMode) = 0; + virtual Dali::WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode) = 0; /** * @copydoc Dali::Window::GetScreenOffMode() @@ -279,7 +331,7 @@ public: /** * @copydoc Dali::Window::SetBrightness() */ - virtual bool SetBrightness( int brightness ) = 0; + virtual Dali::WindowOperationResult SetBrightness(int brightness) = 0; /** * @copydoc Dali::Window::GetBrightness() @@ -289,54 +341,91 @@ public: /** * @copydoc Dali::KeyGrab::GrabKey() */ - virtual bool GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode ) = 0; + virtual bool GrabKey(Dali::KEY key, KeyGrab::KeyGrabMode grabMode) = 0; /** * @copydoc Dali::KeyGrab::UngrabKey() */ - virtual bool UngrabKey( Dali::KEY key ) = 0; + virtual bool UngrabKey(Dali::KEY key) = 0; /** * @copydoc Dali::KeyGrab::GrabKeyList() */ - virtual bool GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result ) = 0; + virtual bool GrabKeyList(const Dali::Vector& key, const Dali::Vector& grabMode, Dali::Vector& result) = 0; /** * @copydoc Dali::KeyGrab::UngrabKeyList() */ - virtual bool UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result ) = 0; + virtual bool UngrabKeyList(const Dali::Vector& key, Dali::Vector& result) = 0; /** * @brief Get DPI * @param[out] dpiHorizontal set to the horizontal dpi * @param[out] dpiVertical set to the vertical dpi */ - virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) = 0; + virtual void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) = 0; + + /** + * @brief Return the angle of the window's rotation. + * @return The window orientation + */ + virtual int GetWindowRotationAngle() const = 0; /** - * @brief Get the screen rotation angle of the window + * @brief Get the angle of screen rotation for the window + * @return The screen orientation */ virtual int GetScreenRotationAngle() = 0; /** - * @brief Set the rotation angle of the window + * @brief Set the screen rotation angle of the window */ - virtual void SetWindowRotationAngle( int degree ) = 0; + virtual void SetWindowRotationAngle(int degree) = 0; /** * @brief Inform the window rotation is completed */ - virtual void WindowRotationCompleted( int degree, int width, int height ) = 0; + virtual void WindowRotationCompleted(int degree, int width, int height) = 0; + + /** + * @brief starts the window is moved by display server + */ + virtual void RequestMoveToServer() = 0; + + /** + * @brief starts the window is resized by display server + * + * @param[in] direction It is direction of the started edge/side. + */ + virtual void RequestResizeToServer(WindowResizeDirection direction) = 0; + + /** + * @brief Enables the floating mode of window. + * + * The floating mode is to support making partial size window easliy. + * It is useful to make popup style window + * and this window is always upper than the other normal window. + * + * A special display server(as a Tizen display server) supports this mode. + * + * @param[in] enable Enable floating mode or not. + */ + virtual void EnableFloatingMode(bool enable) = 0; + + /** + * @brief Gets whether floating mode is enabled or not. + */ + virtual bool IsFloatingModeEnabled() const = 0; /** * @copydoc Dali::Window::SetTransparency() */ - virtual void SetTransparency( bool transparent ) = 0; + virtual void SetTransparency(bool transparent) = 0; /** * @copydoc Dali::Window::SetParent() */ - virtual void SetParent( WindowBase* parentWinBase ) = 0; + virtual void SetParent(WindowBase* parentWinBase, bool belowParent) = 0; /** * @brief Create a sync fence that can tell the frame is rendered by the graphics driver. @@ -350,12 +439,108 @@ public: */ virtual int CreateFramePresentedSyncFence() = 0; + /** + * @copydoc Dali::Window::SetPositionSizeWithAngle() + */ + virtual void SetPositionSizeWithAngle(PositionSize positionSize, int angle) = 0; + + /** + * @brief Initialize for Ime window. + * It should be called when the window is only used for Ime keyboard window. + */ + virtual void InitializeIme() = 0; + + /** + * @brief Send the signal to display server for Ime Window is ready to render. + * It is used for compositing by display server. + */ + virtual void ImeWindowReadyToRender() = 0; + + /** + * @brief Includes input region. + * @param[in] inputRegion The added region to accept input events. + */ + virtual void IncludeInputRegion(const Rect& inputRegion) = 0; + + /** + * @brief Excludes input region. + * @param[in] inputRegion The subtracted region to except input events. + */ + virtual void ExcludeInputRegion(const Rect& inputRegion) = 0; + + /** + * @brief Sets the pointer constraints lock. + * @return Returns true if PointerConstraintsLock succeeds. + */ + virtual bool PointerConstraintsLock() = 0; + + /** + * @brief Sets the pointer constraints unlock. + * @return Returns true if PointerConstraintsUnlock succeeds. + */ + virtual bool PointerConstraintsUnlock() = 0; + + /** + * @brief Sets the locked pointer region + * + * @param[in] x The x position. + * @param[in] y The y position. + * @param[in] width The width. + * @param[in] height The height + */ + virtual void LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height) = 0; + + /** + * @brief Sets the locked pointer cursor position hintset + * + * @param[in] x The x position. + * @param[in] y The y position. + */ + virtual void LockedPointerCursorPositionHintSet(int32_t x, int32_t y) = 0; + + /** + * @brief Sets the pointer warp. The pointer moves to the set coordinates. + * + * @param[in] x The x position. + * @param[in] y The y position. + * @return Returns true if PointerWarp succeeds. + */ + virtual bool PointerWarp(int32_t x, int32_t y) = 0; + + /** + * @brief Sets visibility on/off of cursor + * + * @param[in] visible The visibility of cursor + */ + virtual void CursorVisibleSet(bool visible) = 0; + + /** + * @brief Requests grab key events according to the requested device subtype + * + * @param[in] deviceSubclass The deviceSubclass type. + * @return Returns true if KeyboardGrab succeeds. + */ + virtual bool KeyboardGrab(Device::Subclass::Type deviceSubclass) = 0; + + /** + * @brief Requests ungrab key events + * + * @param[in] window The window instance. + * @return Returns true if KeyboardUnGrab succeeds. + */ + virtual bool KeyboardUnGrab() = 0; + // Signals /** * @brief This signal is emitted when the window becomes iconified or deiconified. */ - IconifySignalType& IconifyChangedSignal(); + IconifySignalType& IconifyChangedSignal(); + + /** + * @brief This signal is emitted when the window becomes maximized or unmaximized. + */ + MaximizeSignalType& MaximizeChangedSignal(); /** * @brief This signal is emitted when the window focus is changed. @@ -413,11 +598,6 @@ public: StyleSignalType& StyleChangedSignal(); /** - * @brief This signal is emitted when an accessibility event is received. - */ - AccessibilitySignalType& AccessibilitySignal(); - - /** * @brief This signal is emitted when window's transition animation is started or ended. */ TransitionEffectEventSignalType& TransitionEffectEventSignal(); @@ -432,8 +612,52 @@ public: */ WindowRedrawRequestSignalType& WindowRedrawRequestSignal(); -protected: + /** + * @brief This signal is emitted when the window's geometry data is changed by display server or client. + * It is based on configure noification event. + */ + UpdatePositionSizeType& UpdatePositionSizeSignal(); + + /** + * @brief This signal is emitted when the window is received the auxiliary message from display server. + */ + AuxiliaryMessageSignalType& AuxiliaryMessageSignal(); + + /** + * @brief This signal is emitted when a mouse in or out event is recevied. + */ + MouseInOutEventSignalType& MouseInOutEventSignal(); + + /** + * @brief This signal is emitted when a mouse relative event is recevied. + */ + MouseRelativeEventSignalType& MouseRelativeEventSignal(); + + /** + * @brief This signal is emitted when window has been moved by then display server. + * To be moved the window by display server, RequestMoveToServer() should be called. + * After the moving job is finished, this function will be called. + */ + MoveCompletedSignalType& MoveCompletedSignal(); + + /** + * @brief This signal is emitted when window has been resized by then display server. + * To be resized the window by display server, RequestResizeToServer() should be called. + * After the resizing job is finished, this function will be called. + */ + ResizeCompletedSignalType& ResizeCompletedSignal(); + /** + * @brief This signal is emitted when window insets are changed by appearing or disappearing indicator, virtual keyboard, or clipboard. + */ + InsetsChangedSignalType& InsetsChangedSignal(); + + /** + * @brief This signal is emitted when window pointer is locked/unlocked + */ + PointerConstraintsSignalType& PointerConstraintsSignal(); + +protected: // Undefined WindowBase(const WindowBase&) = delete; @@ -441,8 +665,8 @@ protected: WindowBase& operator=(const WindowBase& rhs) = delete; protected: - IconifySignalType mIconifyChangedSignal; + MaximizeSignalType mMaximizeChangedSignal; FocusSignalType mFocusChangedSignal; OutputSignalType mOutputTransformedSignal; DeleteSignalType mDeleteRequestSignal; @@ -454,15 +678,22 @@ protected: SelectionSignalType mSelectionDataSendSignal; SelectionSignalType mSelectionDataReceivedSignal; StyleSignalType mStyleChangedSignal; - AccessibilitySignalType mAccessibilitySignal; TransitionEffectEventSignalType mTransitionEffectEventSignal; KeyboardRepeatSettingsChangedSignalType mKeyboardRepeatSettingsChangedSignal; WindowRedrawRequestSignalType mWindowRedrawRequestSignal; + UpdatePositionSizeType mUpdatePositionSizeSignal; + AuxiliaryMessageSignalType mAuxiliaryMessageSignal; + MouseInOutEventSignalType mMouseInOutEventSignal; + MouseRelativeEventSignalType mMouseRelativeEventSignal; + MoveCompletedSignalType mMoveCompletedSignal; + ResizeCompletedSignalType mResizeCompletedSignal; + InsetsChangedSignalType mInsetsChangedSignal; + PointerConstraintsSignalType mPointerConstraintsSignal; }; } // namespace Adaptor -} // namespace internal +} // namespace Internal } // namespace Dali