X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fintegration-api%2Fadaptor.h;h=cb19fa09b619ca7c9ae2c9ba02cea55aa4cf7652;hb=5cdb62a3357f02eef562bb9c8d1cdf9a15e4a390;hp=04f9429b038f045ee857f6a71f22b06675044c1c;hpb=8999300d7e1382d64455e0089d012521758cf143;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/integration-api/adaptor.h b/dali/integration-api/adaptor.h index 04f9429..cb19fa0 100755 --- a/dali/integration-api/adaptor.h +++ b/dali/integration-api/adaptor.h @@ -2,7 +2,7 @@ #define DALI_INTEGRATION_ADAPTOR_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. @@ -21,9 +21,11 @@ // EXTERNAL INCLUDES #include #include +#include #include #include #include +#include #include // INTERNAL INCLUDES @@ -43,6 +45,14 @@ namespace Dali class RenderSurfaceInterface; +using WindowContainer = std::vector; + +namespace Integration +{ +class SceneHolder; +} + + namespace Internal { namespace Adaptor @@ -115,6 +125,9 @@ class DALI_ADAPTOR_API Adaptor public: typedef Signal< void (Adaptor&) > AdaptorSignalType; ///< Generic Type for adaptor signals + typedef Signal< void (Window&) > WindowCreatedSignalType; ///< Window created signal type + + using SurfaceSize = Uint16Pair; ///< Surface size type public: /** @@ -137,21 +150,57 @@ public: /** * @brief Create a new adaptor using render surface. * - * @param[in] nativeWindow native window handle + * @param[in] window The window to draw onto * @param[in] surface The surface to draw onto * @return a reference to the adaptor handle */ - static Adaptor& New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface ); + static Adaptor& New( Window window, const Dali::RenderSurfaceInterface& surface ); /** * @brief Create a new adaptor using render surface. * - * @param[in] nativeWindow native window handle + * @param[in] window The window to draw onto * @param[in] surface The surface to draw onto * @param[in] configuration The context loss configuration. * @return a reference to the adaptor handle */ - static Adaptor& New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration = Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS); + static Adaptor& New( Window window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration = Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS); + + /** + * @brief Create a new adaptor using the SceneHolder. + * + * @param[in] sceneHolder The SceneHolder to draw onto + * @return a reference to the adaptor handle + */ + static Adaptor& New( Dali::Integration::SceneHolder sceneHolder ); + + /** + * @brief Create a new adaptor using the SceneHolder. + * + * @param[in] sceneHolder The SceneHolder to draw onto + * @param[in] configuration The context loss configuration. + * @return a reference to the adaptor handle + */ + static Adaptor& New( Dali::Integration::SceneHolder sceneHolder, Configuration::ContextLoss configuration ); + + /** + * @brief Create a new adaptor using render surface. + * + * @param[in] sceneHolder The SceneHolder to draw onto + * @param[in] surface The surface to draw onto + * @return a reference to the adaptor handle + */ + static Adaptor& New( Dali::Integration::SceneHolder sceneHolder, const Dali::RenderSurfaceInterface& surface ); + + /** + * @brief Create a new adaptor using render surface. + * + * @param[in] sceneHolder The SceneHolder to draw onto + * @param[in] surface The surface to draw onto + * @param[in] configuration The context loss configuration. + * @return a reference to the adaptor handle + */ + static Adaptor& New( Dali::Integration::SceneHolder sceneHolder, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration = Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS); /** * @brief Virtual Destructor. @@ -206,6 +255,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. * @@ -218,10 +280,18 @@ public: /** * @brief Replaces the rendering surface * - * @param[in] nativeWindow native window handle + * @param[in] window The window to replace the surface for + * @param[in] surface to use + */ + void ReplaceSurface( Window window, Dali::RenderSurfaceInterface& surface ); + + /** + * @brief Replaces the rendering surface + * + * @param[in] sceneHolder The SceneHolder to replace the surface for * @param[in] surface to use */ - void ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& surface ); + void ReplaceSurface( Dali::Integration::SceneHolder sceneHolder, Dali::RenderSurfaceInterface& surface ); /** * @brief Get the render surface the adaptor is using to render to. @@ -238,6 +308,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 @@ -283,14 +361,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. @@ -325,14 +395,6 @@ public: void NotifyLanguageChanged(); /** - * @brief Sets minimum distance in pixels that the fingers must move towards/away from each other in order to - * trigger a pinch gesture - * - * @param[in] distance The minimum pinch distance in pixels - */ - void SetMinimumPinchDistance(float distance); - - /** * @brief Feed a touch point to the adaptor. * * @param[in] point touch point @@ -360,6 +422,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. */ @@ -384,6 +462,22 @@ public: */ void UnregisterProcessor( Integration::Processor& processor ); + /** + * @brief Get the list of windows created. + * @return The list of windows + */ + Dali::WindowContainer GetWindows() 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 /** @@ -401,6 +495,13 @@ public: // Signals */ AdaptorSignalType& LanguageChangedSignal(); + /** + * @brief This signal is emitted when a new window is created + * + * @return The signal to connect to + */ + WindowCreatedSignalType& WindowCreatedSignal(); + private: // Undefined