Merge "RenderTasks would not finish if source actor was invisible." into tizen
[platform/core/uifw/dali-core.git] / dali / internal / event / common / notification-manager.h
index aa4912e..52775e2 100644 (file)
@@ -19,7 +19,6 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali/internal/common/message.h>
 
 namespace Dali
 {
@@ -27,7 +26,8 @@ namespace Dali
 namespace Internal
 {
 
-class PropertyNotification;
+class CompleteNotificationInterface;
+class MessageBase;
 
 /**
  * Provides notifications to the event-thread regarding the changes in previous update(s).
@@ -38,7 +38,7 @@ class NotificationManager
 public:
 
   /**
-   * Create an NotificationManager.
+   * Create an NotificationManager. Owned by Core in event thread side.
    */
   NotificationManager();
 
@@ -47,6 +47,14 @@ public:
    */
   virtual ~NotificationManager();
 
+/// Update side interface, can only be called from Update-thread
+
+  /**
+   * Queue a scene message to an interface. This method is thread-safe.
+   * @param[in] instance to be notified about completion of the Update side event.
+   */
+  void QueueCompleteNotification( CompleteNotificationInterface* instance );
+
   /**
    * Queue a scene message. This method is thread-safe.
    * @param[in] message A newly allocated message; NotificationManager takes ownership.
@@ -54,6 +62,13 @@ public:
   void QueueMessage( MessageBase* message );
 
   /**
+   * Signal Notification Manager that update frame is completed so it can let event thread process the notifications
+   */
+  void UpdateCompleted();
+
+/// Event side interface, can only be called from Update-thread
+
+  /**
    * Query whether the NotificationManager has messages to process.
    * @return True if there are messages to process.
    */
@@ -64,36 +79,11 @@ public:
    */
   void ProcessMessages();
 
-  /**
-   * Retrieve the notification count; this is incremented when Notify() is called.
-   */
-  unsigned int GetNotificationCount() const;
-
 private:
 
   struct Impl;
   Impl* mImpl;
-};
-
-/**
- * A functor for querying the notification count.
- * This is useful for skipping duplicate operations during NotificationManager::Notify()
- */
-struct NotificationCountQuery
-{
-  NotificationCountQuery(const NotificationManager& manager)
-  : mNotificationManager(manager)
-  {
-  }
-
-  unsigned int operator()() const
-  {
-    return mNotificationManager.GetNotificationCount();
-  }
-
-private:
 
-  const NotificationManager& mNotificationManager;
 };
 
 } // namespace Internal