#define DALI_INTERNAL_WINDOWSYSTEM_ANDROID_WINDOW_BASE_ANDROID_H
/*
- * Copyright (c) 2018 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.
{
namespace Adaptor
{
-
/**
* WindowBaseAndroid class provides an WindowBase Android implementation.
*/
class WindowBaseAndroid : public WindowBase
{
public:
-
/**
* @brief Constructor
*/
- WindowBaseAndroid( PositionSize positionSize, Any surface, bool isTransparent );
+ WindowBaseAndroid(PositionSize positionSize, Any surface, bool isTransparent);
/**
* @brief Destructor
virtual ~WindowBaseAndroid();
public:
-
/**
* @brief Called when the window property is changed.
*/
- bool OnWindowPropertyChanged( void* data, int type, void* event );
+ bool OnWindowPropertyChanged(void* data, int type, void* event);
/**
* @brief Called when the window receives a delete request
/**
* @brief Called when the window gains focus.
*/
- void OnFocusIn( void* data, int type, void* event );
+ void OnFocusIn(void* data, int type, void* event);
/**
* @brief Called when the window loses focus.
*/
- void OnFocusOut( void* data, int type, void* event );
+ void OnFocusOut(void* data, int type, void* event);
/**
* @brief Called when the window is damaged.
*/
- void OnWindowDamaged( void* data, int type, void* event );
+ void OnWindowDamaged(void* data, int type, void* event);
/**
* @brief Called when a touch down is received.
*/
- void OnMouseButtonDown( void* data, int type, void* event );
+ void OnMouseButtonDown(void* data, int type, void* event);
/**
* @brief Called when a touch up is received.
*/
- void OnMouseButtonUp( void* data, int type, void* event );
+ void OnMouseButtonUp(void* data, int type, void* event);
/**
* @brief Called when a touch motion is received.
*/
- void OnMouseButtonMove( void* data, int type, void* event );
+ void OnMouseButtonMove(void* data, int type, void* event);
/**
* @brief Called when a mouse wheel is received.
*/
- void OnMouseWheel( void* data, int type, void* event );
+ void OnMouseWheel(void* data, int type, void* event);
/**
* @brief Called when a key down is received.
*/
- void OnKeyDown( void* data, int type, void* event );
+ void OnKeyDown(void* data, int type, void* event);
/**
* @brief Called when a key up is received.
*/
- void OnKeyUp( void* data, int type, void* event );
+ void OnKeyUp(void* data, int type, void* event);
/**
* @brief Called when the source window notifies us the content in clipboard is selected.
*/
- void OnSelectionClear( void* data, int type, void* event );
+ void OnSelectionClear(void* data, int type, void* event);
/**
* @brief Called when the source window sends us about the selected content.
*/
- void OnSelectionNotify( void* data, int type, void* event );
+ void OnSelectionNotify(void* data, int type, void* event);
public:
-
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindow()
*/
int GetNativeWindowId() override;
/**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindowResourceId()
+ */
+ std::string GetNativeWindowResourceId() override;
+
+ /**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateEglWindow()
*/
- EGLNativeWindowType CreateEglWindow( int width, int height ) override;
+ EGLNativeWindowType CreateEglWindow(int width, int height) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::DestroyEglWindow()
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowRotation()
*/
- void SetEglWindowRotation( int angle ) override;
+ void SetEglWindowRotation(int angle) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowBufferTransform()
*/
- void SetEglWindowBufferTransform( int angle ) override;
+ void SetEglWindowBufferTransform(int angle) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowTransform()
*/
- void SetEglWindowTransform( int angle ) override;
+ void SetEglWindowTransform(int angle) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::ResizeEglWindow()
*/
- void ResizeEglWindow( PositionSize positionSize ) override;
+ void ResizeEglWindow(PositionSize positionSize) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::IsEglWindowRotationSupported()
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Move()
*/
- void Move( PositionSize positionSize ) override;
+ void Move(PositionSize positionSize) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Resize()
*/
- void Resize( PositionSize positionSize ) override;
+ void Resize(PositionSize positionSize) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::MoveResize()
*/
- void MoveResize( PositionSize positionSize ) override;
+ void MoveResize(PositionSize positionSize) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetLayout()
+ */
+ void SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetClass()
*/
- void SetClass( const std::string& name, const std::string& className ) override;
+ void SetClass(const std::string& name, const std::string& className) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Raise()
void Activate() override;
/**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::Maximize()
+ */
+ void Maximize(bool maximize) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMaximized()
+ */
+ bool IsMaximized() const override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetMaximumSize()
+ */
+ void SetMaximumSize(Dali::Window::WindowSize size) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::Minimize()
+ */
+ void Minimize(bool minimize) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMinimized()
+ */
+ bool IsMinimized() const override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetMimimumSize()
+ */
+ void SetMimimumSize(Dali::Window::WindowSize size) override;
+
+ /**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAvailableAnlges()
*/
- void SetAvailableAnlges( const std::vector< int >& angles ) override;
+ void SetAvailableAnlges(const std::vector<int>& angles) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetPreferredAngle()
*/
- void SetPreferredAngle( int angle ) override;
+ void SetPreferredAngle(int angle) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAcceptFocus()
*/
- void SetAcceptFocus( bool accept ) override;
+ void SetAcceptFocus(bool accept) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::Show()
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHint()
*/
- std::string GetSupportedAuxiliaryHint( unsigned int index ) const override;
+ std::string GetSupportedAuxiliaryHint(unsigned int index) const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::AddAuxiliaryHint()
*/
- unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value ) override;
+ unsigned int AddAuxiliaryHint(const std::string& hint, const std::string& value) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::RemoveAuxiliaryHint()
*/
- bool RemoveAuxiliaryHint( unsigned int id ) override;
+ bool RemoveAuxiliaryHint(unsigned int id) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAuxiliaryHintValue()
*/
- bool SetAuxiliaryHintValue( unsigned int id, const std::string& value ) override;
+ bool SetAuxiliaryHintValue(unsigned int id, const std::string& value) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintValue()
*/
- std::string GetAuxiliaryHintValue( unsigned int id ) const override;
+ std::string GetAuxiliaryHintValue(unsigned int id) const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintId()
*/
- unsigned int GetAuxiliaryHintId( const std::string& hint ) const override;
+ unsigned int GetAuxiliaryHintId(const std::string& hint) const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetInputRegion()
*/
- void SetInputRegion( const Rect< int >& inputRegion ) override;
+ void SetInputRegion(const Rect<int>& inputRegion) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetType()
*/
- void SetType( Dali::WindowType type ) override;
+ void SetType(Dali::WindowType type) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::GetType()
+ */
+ Dali::WindowType GetType() const override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
*/
- bool SetNotificationLevel( Dali::WindowNotificationLevel level ) override;
+ Dali::WindowOperationResult SetNotificationLevel(Dali::WindowNotificationLevel level) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetOpaqueState()
*/
- void SetOpaqueState( bool opaque ) override;
+ void SetOpaqueState(bool opaque) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
*/
- bool SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
+ Dali::WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
*/
- bool SetBrightness( int brightness ) override;
+ Dali::WindowOperationResult SetBrightness(int brightness) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness()
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GrabKey()
*/
- bool GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode ) override;
+ bool GrabKey(Dali::KEY key, KeyGrab::KeyGrabMode grabMode) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKey()
*/
- bool UngrabKey( Dali::KEY key ) override;
+ bool UngrabKey(Dali::KEY key) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GrabKeyList()
*/
- bool GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result ) override;
+ bool GrabKeyList(const Dali::Vector<Dali::KEY>& key, const Dali::Vector<KeyGrab::KeyGrabMode>& grabMode, Dali::Vector<bool>& result) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKeyList()
*/
- bool UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result ) override;
+ bool UngrabKeyList(const Dali::Vector<Dali::KEY>& key, Dali::Vector<bool>& result) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetDpi()
*/
- void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
+ void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetWindowRotationAngle()
*/
- void SetWindowRotationAngle( int degree ) override;
+ void SetWindowRotationAngle(int degree) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted()
*/
- void WindowRotationCompleted( int degree, int width, int height ) override;
+ void WindowRotationCompleted(int degree, int width, int height) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetTransparency()
*/
- void SetTransparency( bool transparent ) override;
+ void SetTransparency(bool transparent) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
*/
- void SetParent( WindowBase* parentWinBase ) override;
+ void SetParent(WindowBase* parentWinBase, bool belowParent) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateFrameRenderedSyncFence()
int CreateFramePresentedSyncFence() override;
/**
- * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation()
+ * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle()
*/
- int GetOrientation() const override;
+ int GetWindowRotationAngle() const override;
-private:
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetPositionSizeWithAngle()
+ */
+ void SetPositionSizeWithAngle(PositionSize positionSize, int angle) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::InitializeIme()
+ */
+ void InitializeIme() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::ImeWindowReadyToRender()
+ */
+ void ImeWindowReadyToRender() override;
+
+ /**
+ *
+ * @copydoc Dali::Internal::Adaptor::WindowBase::RequestMoveToServer()
+ */
+ void RequestMoveToServer() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::RequestResizeToServer()
+ */
+ void RequestResizeToServer(WindowResizeDirection direction) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::EnableFloatingMode()
+ */
+ void EnableFloatingMode(bool enable) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsFloatingModeEnabled()
+ */
+ bool IsFloatingModeEnabled() const override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IncludeInputRegion()
+ */
+ void IncludeInputRegion(const Rect<int>& inputRegion) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::ExcludeInputRegion()
+ */
+ void ExcludeInputRegion(const Rect<int>& inputRegion) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerConstraintsLock()
+ */
+ bool PointerConstraintsLock() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerConstraintsUnlock()
+ */
+ bool PointerConstraintsUnlock() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::LockedPointerRegionSet()
+ */
+ void LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::LockedPointerCursorPositionHintSet()
+ */
+ void LockedPointerCursorPositionHintSet(int32_t x, int32_t y) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerWarp()
+ */
+ bool PointerWarp(int32_t x, int32_t y) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::CursorVisibleSet()
+ */
+ void CursorVisibleSet(bool visible) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::KeyboardGrab()
+ */
+ bool KeyboardGrab(Device::Subclass::Type deviceSubclass) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::KeyboardUnGrab()
+ */
+ bool KeyboardUnGrab() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetFullScreen()
+ */
+ void SetFullScreen(bool fullscreen) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::GetFullScreen()
+ */
+ bool GetFullScreen() override;
/**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetFrontBufferRendering()
+ */
+ void SetFrontBufferRendering(bool enable) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::GetFrontBufferRendering()
+ */
+ bool GetFrontBufferRendering() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowFrontBufferMode()
+ */
+ void SetEglWindowFrontBufferMode(bool enable) override;
+
+private:
+ /**
* Second stage initialization
*/
- void Initialize( PositionSize positionSize, Any surface, bool isTransparent );
+ void Initialize(PositionSize positionSize, Any surface, bool isTransparent);
/**
* @brief Get the surface id if the surface parameter is not empty
* @param surface Any containing a surface id, or can be empty
* @return surface id, or zero if surface is empty
*/
- unsigned int GetSurfaceId( Any surface ) const;
+ unsigned int GetSurfaceId(Any surface) const;
protected:
-
// Undefined
WindowBaseAndroid(const WindowBaseAndroid&) = delete;
WindowBaseAndroid& operator=(const WindowBaseAndroid& rhs) = delete;
private:
-
- ANativeWindow* mWindow; ///< Native window handle
- bool mOwnSurface:1; ///< Whether we own the surface (responsible for deleting it)
- bool mIsTransparent; ///< Whether the window is transparent (32 bit or 24 bit)
- bool mRotationAppSet:1;
+ ANativeWindow* mWindow; ///< Native window handle
+ bool mOwnSurface : 1; ///< Whether we own the surface (responsible for deleting it)
+ bool mIsTransparent; ///< Whether the window is transparent (32 bit or 24 bit)
+ bool mRotationAppSet : 1;
};
} // namespace Adaptor
-} // namespace internal
+} // namespace Internal
} // namespace Dali