#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.
#include <dali/internal/window-system/common/window-base.h>
// EXTERNAL HEADERS
-#include <Ecore.h>
-#include <Ecore_X.h>
+#include <dali/internal/system/linux/dali-ecore.h>
+#include <dali/internal/system/linux/dali-ecore-x.h>
namespace Dali
{
namespace Adaptor
{
-class Window;
-class WindowRenderSurface;
-class WindowRenderSurfaceEcoreX;
-
/**
* WindowBaseEcoreX class provides an WindowBase EcoreX implementation.
*/
/**
* @brief Constructor
*/
- WindowBaseEcoreX( Window* window, WindowRenderSurface* windowRenderSurface );
+ WindowBaseEcoreX( PositionSize positionSize, Any surface, bool isTransparent );
/**
* @brief Destructor
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 Initialize() override;
+ virtual void SetEglWindowRotation( int angle ) override;
/**
- * @copydoc Dali::Internal::Adaptor::WindowBase::ShowIndicator()
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowBufferTransform()
*/
- virtual void ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode, Dali::Window::IndicatorBgOpacity opacityMode ) override;
+ virtual void SetEglWindowBufferTransform( int angle ) override;
/**
- * @copydoc Dali::Internal::Adaptor::WindowBase::SetIndicatorProperties()
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowTransform()
*/
- virtual void SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation ) override;
+ virtual void SetEglWindowTransform( int angle ) override;
/**
- * @copydoc Dali::Internal::Adaptor::WindowBase::IndicatorTypeChanged()
+ * @copydoc Dali::Internal::Adaptor::WindowBase::ResizeEglWindow()
*/
- virtual void IndicatorTypeChanged( IndicatorInterface::Type type ) override;
+ virtual void ResizeEglWindow( PositionSize positionSize ) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsEglWindowRotationSupported()
+ */
+ virtual bool IsEglWindowRotationSupported() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::Move()
+ */
+ virtual void Move( PositionSize positionSize ) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::Resize()
+ */
+ 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()
*/
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( WindowBase* parentWinBase ) 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
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;
};