Added pre-render callback to Adaptor
[platform/core/uifw/dali-adaptor.git] / dali / integration-api / adaptor.h
index e3a2115..0925028 100755 (executable)
@@ -184,17 +184,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.
@@ -250,6 +257,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.
    *