Revert "[Tizen] Sync for libds"
[platform/core/uifw/dali-adaptor.git] / dali / internal / offscreen / common / offscreen-window-impl.h
index ba084a8..95a7c55 100644 (file)
 
 // EXTERNAL INCLUDES
 #include <memory>
-
-#include <dali/integration-api/adaptor-framework/scene-holder-impl.h>
 #include <dali/public-api/common/intrusive-ptr.h>
 #include <dali/public-api/signals/connection-tracker.h>
-#include <dali/integration-api/adaptor-framework/trigger-event-interface.h>
 
 // INTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/offscreen-window.h>
+#include <dali/integration-api/adaptor-framework/scene-holder-impl.h>
 
 namespace Dali
 {
@@ -43,13 +41,11 @@ namespace Internal
  * Implementation of the OffscreenWindow class.
  */
 class OffscreenWindow : public Dali::Internal::Adaptor::SceneHolder,
-                       public ConnectionTracker
+                        public ConnectionTracker
 {
 public:
-  typedef Dali::OffscreenWindow::WindowSize WindowSize;
-
-  typedef Dali::OffscreenWindow::PostRenderSignalType PostRenderSignalType;
-
+  using WindowSize = Dali::OffscreenWindow::WindowSize;
+  using PostRenderSignalType = Dali::OffscreenWindow::PostRenderSignalType;
 
   /**
    * @brief Create a new OffscreenWindow
@@ -68,66 +64,78 @@ public:
   /**
    * Destructor
    */
-  ~OffscreenWindow() = default;
+  ~OffscreenWindow();
 
   /**
    * @copydoc Dali::OffscreenWindow::GetLayerCount
    */
-  virtual uint32_t GetLayerCount() const = 0;
+  uint32_t GetLayerCount() const;
 
   /**
    * @copydoc Dali::OffscreenWindow::GetLayer
    */
-  virtual Dali::Layer GetLayer( uint32_t depth ) const= 0;
+  Dali::Layer GetLayer( uint32_t depth ) const;
 
   /**
    * @copydoc Dali::OffscreenWindow::GetSize
    */
-  virtual WindowSize GetSize() const= 0;
+  WindowSize GetSize() const;
 
   /**
-   * @brief Gets the native handle.
-   * @note When users call this function, it wraps the actual type used by the underlying system.
-   * @return The native handle or an empty handle
+   * @copydoc Dali::OffscreenWindow::GetNativeHandle
    */
-  virtual Dali::Any GetNativeHandle() const override = 0;
-
-  virtual PostRenderSignalType& PostRenderSignal() = 0;
+  Any GetNativeHandle() const override;
 
   /*
    * @brief Initialize the OffscreenWindow
-   * @param[in] offscreenApplication The OffscreenApplication instance to be used to intialize the new OffscreenWindow
    * @param[in] isDefaultWindow Whether the OffscreenWindow is a default one or not
    */
-  virtual void Initialize( OffscreenApplication* offscreenApplication, bool isDefaultWindow ) = 0;
+  void Initialize( bool isDefaultWindow );
+
+public:  // Signals
+
+  /**
+   * @copydoc Dali::OffscreenWindow::PostRenderSignal
+   */
+  PostRenderSignalType& PostRenderSignal();
 
 private:
   /**
    * This function is called after drawing by dali.
    */
-  virtual void OnPostRender() = 0;
+  void OnPostRender();
 
   /**
    * @brief Get the native render surface
    * @return The render surface
    */
-  virtual NativeRenderSurface* GetNativeRenderSurface() const = 0;
+  NativeRenderSurface* GetNativeRenderSurface() const;
 
 private:
 
+ /**
+   * Private constructor
+   *
+   * @param[in] width The initial width of the OffscreenWindow
+   * @param[in] height The initial height of the OffscreenWindow
+   * @param[in] surface The native surface handle
+   * @param[in] isTranslucent Whether the OffscreenWindow is translucent or not
+   */
+  OffscreenWindow( uint16_t width, uint16_t height, Dali::Any surface, bool isTranslucent );
+
   // Undefined
   OffscreenWindow( const OffscreenWindow& );
   OffscreenWindow& operator=( OffscreenWindow& );
 
-  /**
-   * This is for initialization of this OffscreenWindow in case it is created before adaptor is running.
-   */
-  void OnPreInitOffscreenApplication();
-
   /*
    * @brief Initialize the OffscreenWindow (for internal use)
    */
   void Initialize();
+
+private:
+
+  std::unique_ptr< TriggerEventInterface >  mRenderNotification;
+  PostRenderSignalType                      mPostRenderSignal;
 };
 
 inline OffscreenWindow& GetImplementation( Dali::OffscreenWindow& offscreenWindow )