Revert "[Tizen] Revert "Support multiple window rendering""
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / common / window-impl.h
index fff44b7..eb7d873 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_IMPL_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.
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/object/base-object.h>
+#include <dali/public-api/actors/layer.h>
+#include <dali/public-api/render-tasks/render-task-list.h>
+#include <dali/integration-api/scene.h>
 
 // INTERNAL INCLUDES
 #include <dali/internal/adaptor/common/lifecycle-observer.h>
 #include <dali/internal/adaptor/common/adaptor-impl.h>
-#include <dali/internal/window-system/common/indicator-interface.h>
 #include <dali/public-api/adaptor-framework/window.h>
 #include <dali/public-api/adaptor-framework/key-grab.h>
 #include <dali/devel-api/adaptor-framework/drag-and-drop-detector.h>
 namespace Dali
 {
 class Adaptor;
-
-namespace Integration
-{
-class SystemOverlay;
-}
+class Actor;
 
 namespace Internal
 {
@@ -54,7 +52,7 @@ typedef IntrusivePtr<Orientation> OrientationPtr;
 /**
  * Window provides a surface to render onto with orientation & indicator properties.
  */
-class Window : public Dali::BaseObject, public IndicatorInterface::Observer, public LifeCycleObserver, public ConnectionTracker
+class Window : public Dali::BaseObject, public LifeCycleObserver, public ConnectionTracker
 {
 public:
   typedef Dali::Window::IndicatorSignalType IndicatorSignalType;
@@ -95,11 +93,6 @@ public:
   void SetIndicatorBgOpacity( Dali::Window::IndicatorBgOpacity opacity );
 
   /**
-   * Set the indicator visible mode
-   */
-  void SetIndicatorVisibleMode( Dali::Window::IndicatorVisibleMode mode );
-
-  /**
    * @copydoc Dali::Window::RotateIndicator()
    */
   void RotateIndicator( Dali::Window::WindowOrientation orientation );
@@ -125,6 +118,41 @@ public:
   void Activate();
 
   /**
+   * @copydoc Dali::Window::Add()
+   */
+  void Add( Dali::Actor actor );
+
+  /**
+   * @copydoc Dali::Window::Remove()
+   */
+  void Remove( Dali::Actor remove );
+
+  /**
+   * @copydoc Dali::Window::SetBackgroundColor()
+   */
+  void SetBackgroundColor(Vector4 color);
+
+  /**
+   * @copydoc Dali::Window::GetBackgroundColor()
+   */
+  Vector4 GetBackgroundColor() const;
+
+  /**
+   * @copydoc Dali::Window::GetRootLayer()
+   */
+  Dali::Layer GetRootLayer() const;
+
+  /**
+   * @copydoc Dali::Window::GetLayerCount()
+   */
+  uint32_t GetLayerCount() const;
+
+  /**
+   * @copydoc Dali::Window::GetLayer()
+   */
+  Dali::Layer GetLayer( uint32_t depth ) const;
+
+  /**
    * @copydoc Dali::Window::AddAvailableOrientation()
    */
   void AddAvailableOrientation(Dali::Window::WindowOrientation orientation);
@@ -334,6 +362,12 @@ public:
    */
   void RotationDone( int orientation, int width, int height );
 
+  /**
+   * @brief Retrieves the unique ID of the window.
+   * @return The ID
+   */
+  uint32_t GetId() const;
+
 private:
 
   /**
@@ -353,28 +387,6 @@ private:
   void Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className);
 
   /**
-   * Shows / hides the indicator bar.
-   * Handles close/open if rotation changes whilst hidden
-   */
-  void DoShowIndicator( Dali::Window::WindowOrientation lastOrientation );
-
-  /**
-   * Close current indicator and open a connection onto the new indicator service.
-   * Effect may not be synchronous if waiting for an indicator update on existing connection.
-   */
-  void DoRotateIndicator( Dali::Window::WindowOrientation orientation );
-
-  /**
-   * Change the indicator actor's rotation to match the current orientation
-   */
-  void SetIndicatorActorRotation();
-
-  /**
-   * Set the indicator properties on the window
-   */
-  void SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation );
-
-  /**
    * Called when the window becomes iconified or deiconified.
    */
   void OnIconifyChanged( bool iconified );
@@ -394,28 +406,6 @@ private:
    */
   void OnDeleteRequest();
 
-  /**
-   * Called when the Ecore indicator event is received.
-   */
-  void OnIndicatorFlicked();
-
-private: // IndicatorInterface::Observer interface
-
-  /**
-   * @copydoc Dali::Internal::Adaptor::IndicatorInterface::Observer::IndicatorTypeChanged()
-   */
-  virtual void IndicatorTypeChanged( IndicatorInterface::Type type );
-
-  /**
-   * @copydoc Dali::Internal::Adaptor::IndicatorInterface::Observer::IndicatorClosed()
-   */
-  virtual void IndicatorClosed( IndicatorInterface* indicator);
-
-  /**
-   * @copydoc Dali::Internal::Adaptor::IndicatorInterface::Observer::IndicatorVisibilityChanged()
-   */
-  virtual void IndicatorVisibilityChanged( bool isVisible );
-
 private: // Adaptor::Observer interface
 
   /**
@@ -467,11 +457,11 @@ public: // Signals
 
 private:
 
-  WindowRenderSurface*                  mSurface;
+  static uint32_t                       mWindowCounter;    ///< A counter to track the window creation
+  uint32_t                              mId;               ///< A unique ID to identify the window starting from 0
+  std::unique_ptr< WindowRenderSurface > mSurface;
+  Dali::Integration::Scene              mScene;
   WindowBase*                           mWindowBase;
-  Dali::Window::IndicatorVisibleMode    mIndicatorVisible; ///< public state
-  bool                                  mIndicatorIsShown:1; ///< private state
-  bool                                  mShowRotatedIndicatorOnClose:1;
   bool                                  mStarted:1;
   bool                                  mIsTransparent:1;
   bool                                  mIsFocusAcceptable:1;
@@ -479,11 +469,6 @@ private:
   bool                                  mIconified:1;
   bool                                  mOpaqueState:1;
   bool                                  mResizeEnabled:1;
-  std::unique_ptr< IndicatorInterface > mIndicator;
-  Dali::Window::WindowOrientation       mIndicatorOrientation;
-  Dali::Window::WindowOrientation       mNextIndicatorOrientation;
-  Dali::Window::IndicatorBgOpacity      mIndicatorOpacityMode;
-  Integration::SystemOverlay*           mOverlay;
   Adaptor*                              mAdaptor;
   Dali::DragAndDropDetector             mDragAndDropDetector;
   Dali::Window::Type                    mType;
@@ -492,6 +477,8 @@ private:
   std::vector<Dali::Window::WindowOrientation> mAvailableOrientations;
   Dali::Window::WindowOrientation              mPreferredOrientation;
 
+  Vector4                               mBackgroundColor;
+
   // Signals
   IndicatorSignalType mIndicatorVisibilityChangedSignal;
   FocusSignalType     mFocusChangedSignal;