From 8b9341a5246f57d706d6ef34d4a2c1da3649d6a4 Mon Sep 17 00:00:00 2001 From: Richard Huang Date: Mon, 15 Apr 2019 17:05:33 +0100 Subject: [PATCH] Remove the deferred RotationObserver from the Adaptor Change-Id: I9b9cc0af572e0c8bc5f90b45298e27dc82e9b325 --- dali/internal/adaptor/common/adaptor-impl.cpp | 17 ----------------- dali/internal/adaptor/common/adaptor-impl.h | 9 --------- dali/internal/window-system/common/orientation-impl.cpp | 10 ---------- dali/internal/window-system/common/orientation-impl.h | 13 ------------- dali/internal/window-system/common/window-impl.cpp | 11 ++++++----- 5 files changed, 6 insertions(+), 54 deletions(-) diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index 0bdf2c7..d36c352 100755 --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -330,12 +330,6 @@ void Adaptor::Start() WindowPtr defaultWindow = mWindows.front(); - if( mDeferredRotationObserver != NULL ) - { - defaultWindow->SetRotationObserver( mDeferredRotationObserver ); - mDeferredRotationObserver = NULL; - } - unsigned int dpiHor, dpiVer; dpiHor = dpiVer = 0; @@ -718,16 +712,6 @@ void Adaptor::SetDragAndDropDetector( DragAndDropDetectorPtr detector ) mDragAndDropDetector = detector; } -void Adaptor::SetRotationObserver( RotationObserver* observer ) -{ - WindowPtr defaultWindow = mWindows.front(); - if( !defaultWindow->SetRotationObserver( observer ) && mState == READY ) - { - // Set once event handler exists - mDeferredRotationObserver = observer; - } -} - void Adaptor::DestroyTtsPlayer(Dali::TtsPlayer::Mode mode) { if( mTtsPlayers[mode] ) @@ -993,7 +977,6 @@ Adaptor::Adaptor(Dali::Window window, Dali::Adaptor& adaptor, Dali::RenderSurfac mTtsPlayers(), mObservers(), mDragAndDropDetector(), - mDeferredRotationObserver( nullptr ), mEnvironmentOptions( environmentOptions ? environmentOptions : new EnvironmentOptions /* Create the options if not provided */), mPerformanceInterface( nullptr ), mKernelTracer(), diff --git a/dali/internal/adaptor/common/adaptor-impl.h b/dali/internal/adaptor/common/adaptor-impl.h index b3d6181..9b61083 100755 --- a/dali/internal/adaptor/common/adaptor-impl.h +++ b/dali/internal/adaptor/common/adaptor-impl.h @@ -76,7 +76,6 @@ class TriggerEvent; class CallbackManager; class FeedbackPluginProxy; class FeedbackController; -class RotationObserver; class VSyncMonitor; class PerformanceInterface; class LifeCycleObserver; @@ -320,13 +319,6 @@ public: void SetDragAndDropDetector( DragAndDropDetectorPtr detector ); /** - * Sets a rotation observer, or set to NULL to remove. - * @pre Adaptor::Start() has been called ( to create EventHandler ) - * @param[in] observer The observer to listen for window rotation events - */ - void SetRotationObserver( RotationObserver* observer ); - - /** * Destroy the TtsPlayer of specific mode. * @param[in] mode The mode of TtsPlayer to destroy */ @@ -669,7 +661,6 @@ private: // Data Dali::TtsPlayer mTtsPlayers[Dali::TtsPlayer::MODE_NUM]; ///< Provides TTS support ObserverContainer mObservers; ///< A list of adaptor observer pointers DragAndDropDetectorPtr mDragAndDropDetector; ///< The Drag & Drop detector - RotationObserver* mDeferredRotationObserver; ///< deferred Rotation observer needs event handler EnvironmentOptions* mEnvironmentOptions; ///< environment options PerformanceInterface* mPerformanceInterface; ///< Performance interface KernelTrace mKernelTracer; ///< Kernel tracer diff --git a/dali/internal/window-system/common/orientation-impl.cpp b/dali/internal/window-system/common/orientation-impl.cpp index 0adbe85..c2341eb 100644 --- a/dali/internal/window-system/common/orientation-impl.cpp +++ b/dali/internal/window-system/common/orientation-impl.cpp @@ -53,16 +53,6 @@ Orientation::~Orientation() // so it will live longer than adaptor. (hence, no need to remove rotation observer) } -void Orientation::SetAdaptor(Dali::Adaptor& adaptor) -{ - SetAdaptor( Adaptor::GetImplementation( adaptor ) ); -} - -void Orientation::SetAdaptor(Adaptor& adaptor) -{ - adaptor.SetRotationObserver(this); -} - int Orientation::GetDegrees() const { return mOrientation; diff --git a/dali/internal/window-system/common/orientation-impl.h b/dali/internal/window-system/common/orientation-impl.h index 47c058d..65d02ea 100644 --- a/dali/internal/window-system/common/orientation-impl.h +++ b/dali/internal/window-system/common/orientation-impl.h @@ -29,14 +29,12 @@ namespace Dali { -class Adaptor; namespace Internal { namespace Adaptor { -class Adaptor; class Window; class Orientation; @@ -62,17 +60,6 @@ protected: virtual ~Orientation(); public: - /** - * Set the adaptor for basic setup - * @param[in] adaptor The adaptor - */ - void SetAdaptor(Dali::Adaptor& adaptor); - - /** - * Set the adaptor for basic setup - * @param[in] adaptor The adaptor - */ - void SetAdaptor(Adaptor& adaptor); /** * Returns the actual orientation in degrees diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp index 7ff03e4..564ff14 100644 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -162,15 +162,16 @@ void Window::SetAdaptor(Adaptor& adaptor) // Can only create the detector when we know the Core has been instantiated. mDragAndDropDetector = DragAndDropDetector::New(); - if( mOrientation ) - { - mOrientation->SetAdaptor( adaptor ); - } - mSurface->SetAdaptor( *mAdaptor ); mEventHandler = EventHandlerPtr( new EventHandler( mScene, *mAdaptor, *mAdaptor->GetGestureManager(), *mAdaptor ) ); + + // TODO: Orientation should be passed into the constructor of EventHandler + if( mOrientation ) + { + SetRotationObserver( &(*mOrientation) ); + } } WindowRenderSurface* Window::GetSurface() const -- 2.7.4