WindowPtr defaultWindow = mWindows.front();
- if( mDeferredRotationObserver != NULL )
- {
- defaultWindow->SetRotationObserver( mDeferredRotationObserver );
- mDeferredRotationObserver = NULL;
- }
-
unsigned int dpiHor, dpiVer;
dpiHor = dpiVer = 0;
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] )
mTtsPlayers(),
mObservers(),
mDragAndDropDetector(),
- mDeferredRotationObserver( nullptr ),
mEnvironmentOptions( environmentOptions ? environmentOptions : new EnvironmentOptions /* Create the options if not provided */),
mPerformanceInterface( nullptr ),
mKernelTracer(),
class CallbackManager;
class FeedbackPluginProxy;
class FeedbackController;
-class RotationObserver;
class VSyncMonitor;
class PerformanceInterface;
class LifeCycleObserver;
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
*/
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
// 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;
namespace Dali
{
-class Adaptor;
namespace Internal
{
namespace Adaptor
{
-class Adaptor;
class Window;
class Orientation;
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
// 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