Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-adaptor.git] / dali / integration-api / adaptor.h
index 25b5a6b..eb0f6f0 100755 (executable)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/signals/callback.h>
 #include <dali/public-api/signals/dali-signal.h>
+#include <dali/public-api/math/uint-16-pair.h>
 #include <dali/public-api/math/rect.h>
 #include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/common/view-mode.h>
@@ -44,11 +45,15 @@ namespace Dali
 
 class RenderSurfaceInterface;
 
+using WindowContainer = std::vector<Window>;
+
 namespace Integration
 {
 class SceneHolder;
 }
 
+using SceneHolderList = std::vector<Dali::Integration::SceneHolder>;
+
 
 namespace Internal
 {
@@ -122,6 +127,9 @@ class DALI_ADAPTOR_API Adaptor
 public:
 
   typedef Signal< void (Adaptor&) > AdaptorSignalType; ///< Generic Type for adaptor signals
+  typedef Signal< void (Dali::Integration::SceneHolder&) > WindowCreatedSignalType;  ///< SceneHolder created signal type
+
+  using SurfaceSize = Uint16Pair; ///< Surface size type
 
 public:
   /**
@@ -249,6 +257,19 @@ public:
   bool AddIdle( CallbackBase* callback, bool hasReturnValue );
 
   /**
+   * @brief Adds a new Window instance to the Adaptor
+   *
+   * @param[in]  childWindow The child window instance
+   * @param[in]  childWindowName The child window title/name
+   * @param[in]  childWindowClassName The class name that the child window belongs to
+   * @param[in]  childWindowMode The mode of the child window
+   */
+  bool AddWindow( Dali::Integration::SceneHolder childWindow,
+                  const std::string& childWindowName,
+                  const std::string& childWindowClassName,
+                  bool childWindowMode );
+
+  /**
    * @brief Removes a previously added @p callback.
    * @note Function must be called from the main event thread only.
    *
@@ -289,6 +310,14 @@ public:
   Any GetNativeWindowHandle();
 
   /**
+   * @brief Retrieve native window handle that the given actor is added to.
+   *
+   * @param[in] actor The actor
+   * @return native window handle
+   */
+  Any GetNativeWindowHandle( Actor actor );
+
+  /**
    * @brief Get the native display associated with the graphics backend
    *
    * @return A handle to the native display
@@ -334,14 +363,6 @@ public:
   void SetPreRenderCallback( CallbackBase* callback );
 
   /**
-   * @brief Set whether the frame count per render is managed using the hardware VSync or
-   * manually timed.
-   *
-   * @param[in] useHardware True if the hardware VSync should be used
-   */
-  void SetUseHardwareVSync(bool useHardware);
-
-  /**
    * @brief Returns a reference to the instance of the adaptor used by the current thread.
    *
    * @return A reference to the adaptor.
@@ -403,6 +424,22 @@ public:
   void SceneCreated();
 
   /**
+   * @brief Informs core the surface size has changed.
+   *
+   * @param[in] surface The current render surface
+   * @param[in] surfaceSize The new surface size
+   */
+  void SurfaceResizePrepare( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize );
+
+  /**
+   * @brief Informs ThreadController the surface size has changed.
+   *
+   * @param[in] surface The current render surface
+   * @param[in] surfaceSize The new surface size
+   */
+  void SurfaceResizeComplete( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize );
+
+  /**
    * @brief Renders once more even if we're paused
    * @note Will not work if the window is hidden.
    */
@@ -427,6 +464,28 @@ public:
    */
   void UnregisterProcessor( Integration::Processor& processor );
 
+  /**
+   * @brief Get the list of windows created.
+   * @return The list of windows
+   */
+  Dali::WindowContainer GetWindows() const;
+
+  /**
+   * @brief Get the list of scene holders.
+   * @return The list of scene holers
+   */
+  SceneHolderList GetSceneHolders() const;
+
+  /**
+   * @brief Called when the window becomes fully or partially visible.
+   */
+  void OnWindowShown();
+
+  /**
+   * @brief Called when the window is fully hidden.
+   */
+  void OnWindowHidden();
+
 public:  // Signals
 
   /**
@@ -444,6 +503,13 @@ public:  // Signals
    */
   AdaptorSignalType& LanguageChangedSignal();
 
+  /**
+   * @brief This signal is emitted when a new window (scene holder) is created
+   *
+   * @return The signal to connect to
+   */
+  WindowCreatedSignalType& WindowCreatedSignal();
+
 private:
 
   // Undefined