From: dongsug.song Date: Tue, 15 Nov 2016 00:18:28 +0000 (+0900) Subject: Revert "[3.0] Add the RemoveIdle() to adaptor." X-Git-Tag: accepted/tizen/common/20161115.200910~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F63%2F97663%2F1;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Revert "[3.0] Add the RemoveIdle() to adaptor." This reverts commit 3d8c0ed7c81e51d5fc509fe189d02b0ae7309726. Change-Id: I1bbb0beccd06cc9509006e6eb4a26dbe44ead18a --- diff --git a/adaptors/common/adaptor-impl.cpp b/adaptors/common/adaptor-impl.cpp index da9476b..cdc1405 100644 --- a/adaptors/common/adaptor-impl.cpp +++ b/adaptors/common/adaptor-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2015 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. @@ -467,10 +467,6 @@ bool Adaptor::AddIdle( CallbackBase* callback ) return idleAdded; } -void Adaptor::RemoveIdle( CallbackBase* callback ) -{ - mCallbackManager->RemoveIdleCallback( callback ); -} Dali::Adaptor& Adaptor::Get() { diff --git a/adaptors/common/adaptor-impl.h b/adaptors/common/adaptor-impl.h index 704d414..40b9bb2 100644 --- a/adaptors/common/adaptor-impl.h +++ b/adaptors/common/adaptor-impl.h @@ -2,7 +2,7 @@ #define __DALI_INTERNAL_ADAPTOR_IMPL_H__ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2015 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. @@ -220,11 +220,6 @@ public: // AdaptorInternalServices implementation */ virtual bool AddIdle( CallbackBase* callback ); - /** - * @copydoc Dali::Adaptor::RemoveIdle() - */ - virtual void RemoveIdle( CallbackBase* callback ); - public: /** diff --git a/adaptors/common/adaptor.cpp b/adaptors/common/adaptor.cpp index a2e80ad..9c6701c 100644 --- a/adaptors/common/adaptor.cpp +++ b/adaptors/common/adaptor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2014 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. @@ -84,11 +84,6 @@ bool Adaptor::AddIdle( CallbackBase* callback ) return mImpl->AddIdle( callback ); } -void Adaptor::RemoveIdle( CallbackBase* callback ) -{ - mImpl->RemoveIdle( callback ); -} - void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface ) { mImpl->ReplaceSurface(nativeWindow, surface); diff --git a/adaptors/common/callback-manager.h b/adaptors/common/callback-manager.h index fc16aca..20f8798 100644 --- a/adaptors/common/callback-manager.h +++ b/adaptors/common/callback-manager.h @@ -2,7 +2,7 @@ #define __DALI_INTERNAL_CALLBACK_MANAGER_H__ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2014 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. @@ -50,26 +50,15 @@ public: virtual ~CallbackManager() {} /** - * @brief Adds a @p callback to be run on idle. - * @note Must be called from the main thread only. - * - * @param[in] callback custom callback function. - * + * Adds a call back to be run on idle. + * Must be call from main thread only. + * @param callback custom call back function + * @param priority call back priority * @return true on success */ virtual bool AddIdleCallback( CallbackBase* callback ) = 0; /** - * @brief Removes a previously added @p callback. - * @note Must be called from main thread only. - * - * Does nothing if the @p callback doesn't exist. - * - * @param[in] callback The callback to be removed. - */ - virtual void RemoveIdleCallback( CallbackBase* callback ) = 0; - - /** * Starts the callback manager. */ virtual void Start() = 0; diff --git a/adaptors/common/event-loop/ecore/ecore-callback-manager.cpp b/adaptors/common/event-loop/ecore/ecore-callback-manager.cpp index 77b525e..b6e5f3c 100644 --- a/adaptors/common/event-loop/ecore/ecore-callback-manager.cpp +++ b/adaptors/common/event-loop/ecore/ecore-callback-manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2014 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. @@ -120,7 +120,7 @@ bool EcoreCallbackManager::AddIdleCallback( CallbackBase* callback ) return false; } - CallbackData* callbackData = new CallbackData( callback ); + CallbackData *callbackData = new CallbackData( callback ); callbackData->mRemoveFromContainerFunction = MakeCallback( this, &EcoreCallbackManager::RemoveCallbackFromContainer ); @@ -135,25 +135,6 @@ bool EcoreCallbackManager::AddIdleCallback( CallbackBase* callback ) return true; } -void EcoreCallbackManager::RemoveIdleCallback( CallbackBase* callback ) -{ - for( CallbackList::iterator it = mCallbackContainer.begin(), - endIt = mCallbackContainer.end(); - it != endIt; - ++it ) - { - CallbackData* data = *it; - - if( data->mCallback == callback ) - { - // remove callback data from the container. - CallbackBase::Execute( *data->mRemoveFromContainerFunction, data ); - - ecore_idler_del( data->mIdler ); - } - } -} - void EcoreCallbackManager::RemoveCallbackFromContainer(CallbackData *callbackData) { mCallbackContainer.remove(callbackData); diff --git a/adaptors/common/event-loop/ecore/ecore-callback-manager.h b/adaptors/common/event-loop/ecore/ecore-callback-manager.h index a158a4e..f93cc72 100644 --- a/adaptors/common/event-loop/ecore/ecore-callback-manager.h +++ b/adaptors/common/event-loop/ecore/ecore-callback-manager.h @@ -2,7 +2,7 @@ #define __DALI_ECORE_CALLBACK_MANAGER_H__ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2014 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. @@ -57,16 +57,11 @@ public: } /** - * @copydoc CallbackManager::AddIdleCallback() + * @copydoc CallbackManager::AddCallback() */ virtual bool AddIdleCallback( CallbackBase* callback ); /** - * @copydoc CallbackManager::RemoveIdleCallback() - */ - virtual void RemoveIdleCallback( CallbackBase* callback ); - - /** * @copydoc CallbackManager::Start() */ virtual void Start(); diff --git a/adaptors/common/event-loop/lib-uv/uv-callback-manager.cpp b/adaptors/common/event-loop/lib-uv/uv-callback-manager.cpp index 9aca9c8..ab8552d 100644 --- a/adaptors/common/event-loop/lib-uv/uv-callback-manager.cpp +++ b/adaptors/common/event-loop/lib-uv/uv-callback-manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2014 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. @@ -154,7 +154,7 @@ bool UvCallbackManager::AddIdleCallback( CallbackBase* callback ) return false; } - CallbackData *callbackData = new CallbackData( callback ); + CallbackData *callbackData = new CallbackData(callback ); // To inform the manager a callback has finished, we get it to call RemoveCallbackFromContainer callbackData->mRemoveFromContainerFunction = MakeCallback( this, &UvCallbackManager::RemoveCallbackFromContainer ); @@ -168,25 +168,6 @@ bool UvCallbackManager::AddIdleCallback( CallbackBase* callback ) return true; } -void UvCallbackManager::RemoveIdleCallback( CallbackBase* callback ) -{ - for( CallbackList::iterator it = mCallbackContainer.begin(), - endIt = mCallbackContainer.end(); - it != endIt; - ++it ) - { - CallbackData* data = *it; - - if( data->mCallback == callback ) - { - // remove callback data from the container. - CallbackBase::Execute( *data->mRemoveFromContainerFunction, data ); - - delete data; - } - } -} - void UvCallbackManager::RemoveCallbackFromContainer(CallbackData *callbackData) { mCallbackContainer.remove(callbackData); diff --git a/adaptors/common/event-loop/lib-uv/uv-callback-manager.h b/adaptors/common/event-loop/lib-uv/uv-callback-manager.h index 0fcc2c1..78abab6 100644 --- a/adaptors/common/event-loop/lib-uv/uv-callback-manager.h +++ b/adaptors/common/event-loop/lib-uv/uv-callback-manager.h @@ -2,7 +2,7 @@ #define __DALI_UV_CALLBACK_MANAGER_H__ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2014 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. @@ -56,16 +56,11 @@ public: ~UvCallbackManager(){} /** - * @copydoc CallbackManager::AddIdleCallback() + * @copydoc CallbackManager::AddCallback() */ virtual bool AddIdleCallback( CallbackBase* callback ); /** - * @copydoc CallbackManager::RemoveIdleCallback() - */ - virtual void RemoveIdleCallback( CallbackBase* callback ); - - /** * @copydoc CallbackManager::Start() */ virtual void Start(); diff --git a/adaptors/integration-api/adaptor.h b/adaptors/integration-api/adaptor.h index 7de4d65..8eabd4a 100644 --- a/adaptors/integration-api/adaptor.h +++ b/adaptors/integration-api/adaptor.h @@ -2,7 +2,7 @@ #define __DALI_INTEGRATION_ADAPTOR_H__ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2014 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. @@ -198,16 +198,6 @@ public: bool AddIdle( CallbackBase* callback ); /** - * @brief Removes a previously added @p callback. - * @note Function must be called from the main event thread only. - * - * Does nothing if the @p callback doesn't exist. - * - * @param[in] callback The callback to be removed. - */ - void RemoveIdle( CallbackBase* callback ); - - /** * @brief Replaces the rendering surface * * @param[in] nativeWindow native window handle