- if( mStarted )
- {
- return;
- }
-
- mStarted = true;
-
- // Create scene for the window
- PositionSize positionSize = mSurface->GetPositionSize();
- mScene = Dali::Integration::Scene::New( Vector2( positionSize.width, positionSize.height ) );
- mScene.SetSurface( *mSurface.get() );
-
- unsigned int dpiHorizontal, dpiVertical;
- dpiHorizontal = dpiVertical = 0;
-
- mSurface->GetDpi( dpiHorizontal, dpiVertical );
- mScene.SetDpi( Vector2( static_cast<float>( dpiHorizontal ), static_cast<float>( dpiVertical ) ) );
-
- // Add the window to the adaptor observers
- mAdaptor = &adaptor;
- mAdaptor->AddObserver( *this );
-
- // 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 ) );
-}
-
-WindowRenderSurface* Window::GetSurface() const
-{
- return mSurface.get();
-}
-
-void Window::SetSurface(WindowRenderSurface* surface)
-{
- mSurface.reset( surface );
-
- mScene.SetSurface( *mSurface.get() );
-
- unsigned int dpiHorizontal, dpiVertical;
- dpiHorizontal = dpiVertical = 0;
-
- mSurface->GetDpi( dpiHorizontal, dpiVertical );
- mScene.SetDpi( Vector2( static_cast<float>( dpiHorizontal ), static_cast<float>( dpiVertical ) ) );
-
- mSurface->SetAdaptor( *mAdaptor );