[Tizen] Implement partial update
[platform/core/uifw/dali-core.git] / dali / internal / event / common / notification-manager.h
index 1604af2..00b310f 100644 (file)
@@ -1,24 +1,24 @@
-#ifndef __DALI_INTERNAL_NOTIFICATION_MANAGER_H__
-#define __DALI_INTERNAL_NOTIFICATION_MANAGER_H__
-
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+#ifndef DALI_INTERNAL_NOTIFICATION_MANAGER_H
+#define DALI_INTERNAL_NOTIFICATION_MANAGER_H
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 // INTERNAL INCLUDES
-#include <dali/internal/common/message.h>
 
 namespace Dali
 {
@@ -26,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).
@@ -37,7 +38,7 @@ class NotificationManager
 public:
 
   /**
-   * Create an NotificationManager.
+   * Create an NotificationManager. Owned by Core in event thread side.
    */
   NotificationManager();
 
@@ -46,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.
@@ -53,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.
    */
@@ -63,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;
-};
+  // Undefined
+  NotificationManager( const NotificationManager& notificationManager );
 
-/**
- * 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();
-  }
+  // 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