// EXTERNAL HEADERS
#include <dali/integration-api/core.h>
#include <dali/integration-api/system-overlay.h>
+#include <dali/integration-api/render-task-list-integ.h>
+#include <dali/public-api/actors/camera-actor.h>
#include <dali/public-api/render-tasks/render-task.h>
#include <dali/public-api/render-tasks/render-task-list.h>
#include <dali/devel-api/adaptor-framework/orientation.h>
Window::Window()
: mSurface( NULL ),
mWindowBase(),
- mIndicatorVisible( Dali::Window::VISIBLE ),
+ mIndicatorVisible( Dali::Window::INVISIBLE ), // TODO: Enable this after indicator implementation based on tizen 5.
mIndicatorIsShown( false ),
mShowRotatedIndicatorOnClose( false ),
mStarted( false ),
DALI_ASSERT_ALWAYS( !mStarted && "Adaptor already started" );
mStarted = true;
- // Only create one overlay per window
+ // Create one overlay for the main window only
Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation(adaptor);
Integration::Core& core = adaptorImpl.GetCore();
mOverlay = &core.GetSystemOverlay();
- Dali::RenderTaskList taskList = mOverlay->GetOverlayRenderTasks();
- taskList.CreateTask();
+ // Only create render task list for the overlay once
+ if (!mOverlay->GetOverlayRenderTasks())
+ {
+ Dali::RenderTaskList overlayRenderTaskList = Integration::RenderTaskList::New();
+
+ Dali::Actor overlayRootActor = mOverlay->GetDefaultRootActor();
+ Dali::CameraActor overlayCameraActor = mOverlay->GetDefaultCameraActor();
+ Integration::RenderTaskList::CreateTask( overlayRenderTaskList, overlayRootActor, overlayCameraActor );
+
+ mOverlay->SetOverlayRenderTasks( overlayRenderTaskList );
+ }
mAdaptor = &adaptorImpl;
mAdaptor->AddObserver( *this );
void Window::ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode )
{
- mIndicatorVisible = visibleMode;
+ // TODO: Enable this after indicator implementation based on tizen 5.
+// mIndicatorVisible = visibleMode;
mWindowBase->ShowIndicator( mIndicatorVisible, mIndicatorOpacityMode );
void Window::SetIndicatorVisibleMode( Dali::Window::IndicatorVisibleMode mode )
{
- mIndicatorVisible = mode;
+ // TODO: Enable this after indicator implementation based on tizen 5.
+// mIndicatorVisible = mode;
}
void Window::RotateIndicator( Dali::Window::WindowOrientation orientation )
mResizeEnabled = true;
}
- PositionSize positionSize = mSurface->GetPositionSize();
+ PositionSize oldRect = mSurface->GetPositionSize();
- if( positionSize.width != size.GetWidth() || positionSize.height != size.GetHeight() )
- {
- positionSize.width = size.GetWidth();
- positionSize.height = size.GetHeight();
+ mSurface->MoveResize( PositionSize( oldRect.x, oldRect.y, size.GetWidth(), size.GetHeight() ) );
- mSurface->MoveResize( positionSize );
+ PositionSize newRect = mSurface->GetPositionSize();
+
+ // When surface size is updated, inform adaptor of resizing and emit ResizeSignal
+ if( ( oldRect.width != newRect.width ) || ( oldRect.height != newRect.height ) )
+ {
+ Uint16Pair newSize( newRect.width, newRect.height );
- mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ mAdaptor->SurfaceResizePrepare( newSize );
- // Emit signal
- mResizedSignal.Emit( Dali::Window::WindowSize( positionSize.width, positionSize.height ) );
+ mResizedSignal.Emit( newSize );
- mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ mAdaptor->SurfaceResizeComplete( newSize );
}
}
mResizeEnabled = true;
}
- PositionSize positionSize = mSurface->GetPositionSize();
-
- if( positionSize.x != position.GetX() || positionSize.y != position.GetY() )
- {
- positionSize.x = position.GetX();
- positionSize.y = position.GetY();
+ PositionSize oldRect = mSurface->GetPositionSize();
- mSurface->MoveResize( positionSize );
- }
+ mSurface->MoveResize( PositionSize( position.GetX(), position.GetY(), oldRect.width, oldRect.height ) );
}
Dali::Window::WindowPosition Window::GetPosition() const
return Dali::Window::WindowPosition( positionSize.x, positionSize.y );
}
+void Window::SetPositionSize( PositionSize positionSize )
+{
+ if( !mResizeEnabled )
+ {
+ AddAuxiliaryHint( "wm.policy.win.user.geometry", "1" );
+ mResizeEnabled = true;
+ }
+
+ PositionSize oldRect = mSurface->GetPositionSize();
+
+ mSurface->MoveResize( positionSize );
+
+ PositionSize newRect = mSurface->GetPositionSize();
+
+ // When surface size is updated, inform adaptor of resizing and emit ResizeSignal
+ if( ( oldRect.width != newRect.width ) || ( oldRect.height != newRect.height ) )
+ {
+ Uint16Pair newSize( newRect.width, newRect.height );
+
+ mAdaptor->SurfaceResizePrepare( newSize );
+
+ mResizedSignal.Emit( newSize );
+
+ mAdaptor->SurfaceResizeComplete( newSize );
+ }
+}
+
void Window::SetTransparency( bool transparent )
{
mSurface->SetTransparency( transparent );