X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fintegration-api%2Fadaptor.h;h=04f9429b038f045ee857f6a71f22b06675044c1c;hb=e8e185f7d90010214890c2cb78bdd52c732f63ba;hp=e3a21153326cb4128d76dd53640ea7c5fb2cd238;hpb=92f60124b92e64ffb911a071e5493d3248ebf5ef;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/integration-api/adaptor.h b/dali/integration-api/adaptor.h index e3a2115..04f9429 100755 --- a/dali/integration-api/adaptor.h +++ b/dali/integration-api/adaptor.h @@ -1,5 +1,5 @@ -#ifndef __DALI_INTEGRATION_ADAPTOR_H__ -#define __DALI_INTEGRATION_ADAPTOR_H__ +#ifndef DALI_INTEGRATION_ADAPTOR_H +#define DALI_INTEGRATION_ADAPTOR_H /* * Copyright (c) 2018 Samsung Electronics Co., Ltd. @@ -24,6 +24,7 @@ #include #include #include +#include // INTERNAL INCLUDES #include @@ -40,12 +41,13 @@ namespace Dali { -class RenderSurface; +class RenderSurfaceInterface; namespace Internal { namespace Adaptor { +class GraphicsFactory; class Adaptor; } } @@ -139,7 +141,7 @@ public: * @param[in] surface The surface to draw onto * @return a reference to the adaptor handle */ - static Adaptor& New( Any nativeWindow, const Dali::RenderSurface& surface ); + static Adaptor& New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface ); /** * @brief Create a new adaptor using render surface. @@ -149,7 +151,7 @@ public: * @param[in] configuration The context loss configuration. * @return a reference to the adaptor handle */ - static Adaptor& New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration = Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS); + static Adaptor& New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration = Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS); /** * @brief Virtual Destructor. @@ -184,17 +186,24 @@ public: * @brief Ensures that the function passed in is called from the main loop when it is idle. * @note Function must be called from the main event thread only. * - * A callback of the following type may be used: + * Callbacks of the following types may be used: * @code * void MyFunction(); * @endcode + * This callback will be deleted once it is called. + * + * @code + * bool MyFunction(); + * @endcode + * This callback will be called repeatedly as long as it returns true. A return of 0 deletes this callback. * * @param[in] callback The function to call. + * @param[in] hasReturnValue Sould be set to true if the callback function has a return value. * @return true if added successfully, false otherwise * * @note Ownership of the callback is passed onto this class. */ - bool AddIdle( CallbackBase* callback ); + bool AddIdle( CallbackBase* callback, bool hasReturnValue ); /** * @brief Removes a previously added @p callback. @@ -212,14 +221,14 @@ public: * @param[in] nativeWindow native window handle * @param[in] surface to use */ - void ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface ); + void ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& surface ); /** * @brief Get the render surface the adaptor is using to render to. * * @return reference to current render surface */ - RenderSurface& GetSurface(); + Dali::RenderSurfaceInterface& GetSurface(); /** * @brief Gets native window handle @@ -229,6 +238,13 @@ public: Any GetNativeWindowHandle(); /** + * @brief Get the native display associated with the graphics backend + * + * @return A handle to the native display + */ + Any GetGraphicsDisplay(); + + /** * @brief Release any locks the surface may hold. * * For example, after compositing an offscreen surface, use this method to allow @@ -250,6 +266,23 @@ public: void SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender ); /** + * @brief The callback is called from the Update/Render thread prior to rendering. + * + * @param[in] callback The function to call + * + * @note The function is called from the Update thread, so should do as little processing as possible. + * It is not possible to call any DALi event side APIs from within the callback; doing so will cause + * instability. Only 1 callback is supported. Setting the callback to NULL will remove the current callback. + * + * A callback of the following type should be used: + * @code + * bool MyFunction(); + * @endcode + * This callback will be called repeatedly as long as it returns true. A return of 0 deletes this callback. + */ + void SetPreRenderCallback( CallbackBase* callback ); + + /** * @brief Set whether the frame count per render is managed using the hardware VSync or * manually timed. * @@ -327,16 +360,6 @@ public: void SceneCreated(); /** - * @copydoc Dali::Application::SetViewMode(); - */ - void SetViewMode( ViewMode viewMode ); - - /** - * @copydoc Dali::Application::SetStereoBase(); - */ - void SetStereoBase( float stereoBase ); - - /** * @brief Renders once more even if we're paused * @note Will not work if the window is hidden. */ @@ -348,6 +371,19 @@ public: */ const LogFactoryInterface& GetLogFactory(); + /** + * @brief Register a processor implementing the Integration::Processor interface with dali-core. + * @param[in] processor the Processor to register + * @note using this api does not maintain the processor's lifecycle, must be done elsewhere. + */ + void RegisterProcessor( Integration::Processor& processor ); + + /** + * @brief Unregister a previously registered processor from dali-core. + * @param[in] processor the Processor to unregister + */ + void UnregisterProcessor( Integration::Processor& processor ); + public: // Signals /** @@ -384,4 +420,4 @@ private: } // namespace Dali -#endif // __DALI_INTEGRATION_ADAPTOR_H__ +#endif // DALI_INTEGRATION_ADAPTOR_H