Revert "[Tizen] Add screen and client rotation itself function"
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / tizen-wayland / ecore-wl2 / window-base-ecore-wl2.h
index a5bf2b2..2b45ae0 100644 (file)
 #include <Ecore.h>
 #include <Ecore_Wl2.h>
 #include <tizen-extension-client-protocol.h>
+#include <wayland-egl.h>
+
+#ifdef DALI_ELDBUS_AVAILABLE
+#include <Eldbus.h>
+#endif
 
 namespace Dali
 {
@@ -46,7 +51,7 @@ public:
   /**
    * @brief Constructor
    */
-  WindowBaseEcoreWl2( Window* window, WindowRenderSurface* windowRenderSurface );
+  WindowBaseEcoreWl2( PositionSize positionSize, Any surface, bool isTransparent );
 
   /**
    * @brief Destructor
@@ -81,6 +86,83 @@ public:
   Eina_Bool OnIgnoreOutputTransform( void* data, int type, void* event );
 
   /**
+   * @brief Called when a rotation event is recevied.
+   */
+  void OnRotation( void* data, int type, void* event );
+
+  /**
+   * @brief Called when a configure event is recevied.
+   */
+  void OnConfiguration( 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 touch is canceled.
+   */
+  void OnMouseButtonCancel( 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 detent rotation event is recevied.
+   */
+  void OnDetentRotation( 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 OnDataSend( void* data, int type, void* event );
+
+  /**
+   * @brief Called when the source window sends us about the selected content.
+   */
+  void OnDataReceive( void* data, int type, void* event );
+
+  /**
+   * @brief Called when a font name is changed.
+   */
+  void OnFontNameChanged();
+
+  /**
+   * @brief Called when a font size is changed.
+   */
+  void OnFontSizeChanged();
+
+#ifdef DALI_ELDBUS_AVAILABLE
+  /**
+   * @brief Called when Ecore ElDBus accessibility event is received.
+   */
+  void OnEcoreElDBusAccessibilityNotification( void* context, const Eldbus_Message* message );
+#endif
+
+  /**
    * @brief RegistryGlobalCallback
    */
   void RegistryGlobalCallback( void* data, struct wl_registry *registry, uint32_t name, const char* interface, uint32_t version );
@@ -108,29 +190,69 @@ public:
 public:
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::Initialize()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindow()
    */
-  virtual void Initialize() override;
+  virtual Any GetNativeWindow() override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::ShowIndicator()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindowId()
    */
-  virtual void ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode, Dali::Window::IndicatorBgOpacity opacityMode ) override;
+  virtual int GetNativeWindowId() override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::SetIndicatorProperties()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::CreateEglWindow()
    */
-  virtual void SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation ) override;
+  virtual EGLNativeWindowType CreateEglWindow( int width, int height ) override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::IndicatorTypeChanged()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::DestroyEglWindow()
    */
-  virtual void IndicatorTypeChanged( IndicatorInterface::Type type ) override;
+  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 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()
@@ -272,6 +394,58 @@ public:
    */
   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;
+
+  /**
+   * @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::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 );
+
+  /**
+   * Initialize Ecore ElDBus
+   */
+  void InitializeEcoreElDBus();
+
+  /**
+   * @brief Create window
+   */
+  void CreateWindow( PositionSize positionSize );
+
 protected:
 
   // Undefined
@@ -286,9 +460,9 @@ private:
 
   Dali::Vector< Ecore_Event_Handler* > mEcoreEventHandler;
 
-  Window*                              mWindow;
-  WindowRenderSurfaceEcoreWl2*         mWindowSurface;
   Ecore_Wl2_Window*                    mEcoreWindow;
+  wl_surface*                          mWlSurface;
+  wl_egl_window*                       mEglWindow;
   wl_display*                          mDisplay;
   wl_event_queue*                      mEventQueue;
   tizen_policy*                        mTizenPolicy;
@@ -308,6 +482,15 @@ private:
   int                                  mBrightness;
   uint32_t                             mBrightnessChangeState;
   bool                                 mBrightnessChangeDone;
+
+  bool                                 mOwnSurface;
+
+  volatile uint32_t                    mMoveResizeSerial;
+  uint32_t                             mLastSubmittedMoveResizeSerial;
+
+#ifdef DALI_ELDBUS_AVAILABLE
+  Eldbus_Connection*                   mSystemConnection;
+#endif // DALI_ELDBUS_AVAILABLE
 };
 
 } // namespace Adaptor