X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fcommon%2Fnotification-manager.h;h=00b310ffa5ba50ed9057ca8654ecff18fef38691;hb=db9cfcd683be8e4b3a1f83f6378e493770eb9533;hp=1604af20341128b1d4ff98fd201ba0ed233d3a3b;hpb=8f2c5571c924479b6a07a2c2187dedd9c685baf0;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/common/notification-manager.h b/dali/internal/event/common/notification-manager.h index 1604af2..00b310f 100644 --- a/dali/internal/event/common/notification-manager.h +++ b/dali/internal/event/common/notification-manager.h @@ -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 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