[Tizen] Implement partial update
[platform/core/uifw/dali-core.git] / dali / internal / event / common / notification-manager.h
index aa4912e..00b310f 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_INTERNAL_NOTIFICATION_MANAGER_H__
-#define __DALI_INTERNAL_NOTIFICATION_MANAGER_H__
+#ifndef DALI_INTERNAL_NOTIFICATION_MANAGER_H
+#define DALI_INTERNAL_NOTIFICATION_MANAGER_H
 
 /*
- * Copyright (c) 2014 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.
@@ -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,41 +79,24 @@ 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)
-  {
-  }
+  // Undefined
+  NotificationManager( const NotificationManager& notificationManager );
 
-  unsigned int operator()() const
-  {
-    return mNotificationManager.GetNotificationCount();
-  }
+  // Undefined
+  NotificationManager& operator=( const NotificationManager& notificationManager );
 
 private:
 
-  const NotificationManager& mNotificationManager;
+  struct Impl;
+  Impl* mImpl;
+
 };
 
 } // namespace Internal
 
 } // namespace Dali
 
-#endif // __DALI_INTERNAL_NOTIFICATION_MANAGER_H__
+#endif // DALI_INTERNAL_NOTIFICATION_MANAGER_H