X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fwindow-system%2Fubuntu-x11%2Fwindow-base-ecore-x.h;h=f6618e787d80bccd79b4ea56652aa4d252cdd44a;hb=70189749d12fc175c530b8d852386e1c13088fbd;hp=9e7ecc62dc47b3562f6ffe1a314634fe30d964ec;hpb=4d3f072f2b4191440ef5b6396a0e033098a87067;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h index 9e7ecc6..f6618e7 100644 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_WINDOWSYSTEM_ECOREX_WINDOW_BASE_ECORE_X_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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,8 +22,8 @@ #include // EXTERNAL HEADERS -#include -#include +#include +#include namespace Dali { @@ -32,10 +32,6 @@ namespace Internal namespace Adaptor { -class Window; -class WindowRenderSurface; -class WindowRenderSurfaceEcoreX; - /** * WindowBaseEcoreX class provides an WindowBase EcoreX implementation. */ @@ -46,7 +42,7 @@ public: /** * @brief Constructor */ - WindowBaseEcoreX( Window* window, WindowRenderSurface* windowRenderSurface ); + WindowBaseEcoreX( PositionSize positionSize, Any surface, bool isTransparent ); /** * @brief Destructor @@ -61,36 +57,131 @@ public: Eina_Bool OnWindowPropertyChanged( void* data, int type, void* event ); /** - * Called when the window receives a delete request + * @brief Called when the window receives a delete request */ void OnDeleteRequest(); + /** + * @brief Called when the window gains focus. + */ + void OnFocusIn( void* data, int type, void* event ); + + /** + * @brief Called when the window loses focus. + */ + void OnFocusOut( void* data, int type, void* event ); + + /** + * @brief Called when the window is damaged. + */ + void OnWindowDamaged( void* data, int type, void* event ); + + /** + * @brief Called when a touch down is received. + */ + void OnMouseButtonDown( void* data, int type, void* event ); + + /** + * @brief Called when a touch up is received. + */ + void OnMouseButtonUp( void* data, int type, void* event ); + + /** + * @brief Called when a touch motion is received. + */ + void OnMouseButtonMove( void* data, int type, void* event ); + + /** + * @brief Called when a mouse wheel is received. + */ + void OnMouseWheel( void* data, int type, void* event ); + + /** + * @brief Called when a key down is received. + */ + void OnKeyDown( void* data, int type, void* event ); + + /** + * @brief Called when a key up is received. + */ + 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 ); + + /** + * @brief Called when the source window sends us about the selected content. + */ + void OnSelectionNotify( void* data, int type, void* event ); + public: /** - * @copydoc Dali::Internal::Adaptor::WindowBase::Initialize() + * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindow() + */ + virtual Any GetNativeWindow() override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindowId() + */ + virtual int GetNativeWindowId() override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::CreateEglWindow() + */ + virtual EGLNativeWindowType CreateEglWindow( int width, int height ) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::DestroyEglWindow() + */ + virtual void DestroyEglWindow() override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowRotation() + */ + virtual void SetEglWindowRotation( int angle ) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowBufferTransform() + */ + virtual void SetEglWindowBufferTransform( int angle ) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowTransform() + */ + virtual void SetEglWindowTransform( int angle ) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::ResizeEglWindow() */ - virtual void Initialize() override; + virtual void ResizeEglWindow( PositionSize positionSize ) override; /** - * @copydoc Dali::Internal::Adaptor::WindowBase::ShowIndicator() + * @copydoc Dali::Internal::Adaptor::WindowBase::IsEglWindowRotationSupported() */ - virtual void ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode, Dali::Window::IndicatorBgOpacity opacityMode ) override; + virtual bool IsEglWindowRotationSupported() override; /** - * @copydoc Dali::Internal::Adaptor::WindowBase::SetIndicatorProperties() + * @copydoc Dali::Internal::Adaptor::WindowBase::Move() */ - virtual void SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation ) override; + virtual void Move( PositionSize positionSize ) override; /** - * @copydoc Dali::Internal::Adaptor::WindowBase::IndicatorTypeChanged() + * @copydoc Dali::Internal::Adaptor::WindowBase::Resize() */ - virtual void IndicatorTypeChanged( IndicatorInterface::Type type ) override; + virtual void Resize( PositionSize positionSize ) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::MoveResize() + */ + virtual void MoveResize( PositionSize positionSize ) override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetClass() */ - virtual void SetClass( std::string name, std::string className ) override; + virtual void SetClass( const std::string& name, const std::string& className ) override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::Raise() @@ -212,6 +303,91 @@ public: */ virtual int GetBrightness() const override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::GrabKey() + */ + virtual bool GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode ) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKey() + */ + virtual bool UngrabKey( Dali::KEY key ) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::GrabKeyList() + */ + virtual 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() + */ + virtual bool UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result ) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::GetDpi() + */ + virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override; + + /** + * @brief Return the orientation of the surface. + * @return The orientation + */ + virtual int GetOrientation() const override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle() + */ + virtual int GetScreenRotationAngle() override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::SetWindowRotationAngle() + */ + virtual void SetWindowRotationAngle( int degree ) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle() + */ + virtual int GetWindowRotationAngle() override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted() + */ + virtual void WindowRotationCompleted( int degree, int width, int height ) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::SetTransparency() + */ + virtual void SetTransparency( bool transparent ) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::SetParent() + */ + virtual void SetParent( Any parent ) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::IsMatchedWindow() + */ + virtual bool IsMatchedWindow( Any window ) override; + +private: + + /** + * Second stage initialization + */ + 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; + + /** + * @brief Create window + */ + void CreateWindow( PositionSize positionSize, bool isTransparent ); + protected: // Undefined @@ -223,11 +399,9 @@ protected: private: Dali::Vector< Ecore_Event_Handler* > mEcoreEventHandler; - - Window* mWindow; - WindowRenderSurfaceEcoreX* mWindowSurface; - Ecore_X_Window mEcoreWindow; - + Ecore_X_Window mEcoreWindow; ///< 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; };