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 ),
void Window::Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className)
{
- // create a window render surface
+ // Create a window render surface
Any surface;
auto renderSurfaceFactory = Dali::Internal::Adaptor::GetRenderSurfaceFactory();
- auto windowRenderSurface = renderSurfaceFactory->CreateWindowRenderSurface( positionSize, surface, name, className, mIsTransparent );
+ auto windowRenderSurface = renderSurfaceFactory->CreateWindowRenderSurface( positionSize, surface, mIsTransparent );
mSurface = windowRenderSurface.release();
- // create a window base
- auto windowFactory = Dali::Internal::Adaptor::GetWindowFactory();
- mWindowBase = windowFactory->CreateWindowBase( this, mSurface );
+ // Get a window base
+ mWindowBase = mSurface->GetWindowBase();
- mWindowBase->Initialize();
+ // Connect signals
+ mWindowBase->IconifyChangedSignal().Connect( this, &Window::OnIconifyChanged );
+ mWindowBase->FocusChangedSignal().Connect( this, &Window::OnFocusChanged );
+ mWindowBase->DeleteRequestSignal().Connect( this, &Window::OnDeleteRequest );
+ mWindowBase->IndicatorFlickedSignal().Connect( this, &Window::OnIndicatorFlicked );
+
+ mSurface->OutputTransformedSignal().Connect( this, &Window::OnOutputTransformed );
if( !positionSize.IsEmpty() )
{
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 )
Dali::Any Window::GetNativeHandle() const
{
- return mSurface->GetWindow();
+ return mSurface->GetNativeWindow();
}
void Window::SetAcceptFocus( bool accept )
mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( width, height ) );
}
-void Window::OnIconifyChanged( bool iconified )
-{
- if( iconified )
- {
- mIconified = true;
-
- if( mVisible )
- {
- WindowVisibilityObserver* observer( mAdaptor );
- observer->OnWindowHidden();
- DALI_LOG_RELEASE_INFO( "Window (%p) Iconified\n", this );
- }
- }
- else
- {
- mIconified = false;
-
- if( mVisible )
- {
- WindowVisibilityObserver* observer( mAdaptor );
- observer->OnWindowShown();
- DALI_LOG_RELEASE_INFO( "Window (%p) Deiconified\n", this );
- }
- }
-}
-
-void Window::OnFocusChanged( bool focusIn )
-{
- mFocusChangedSignal.Emit( focusIn );
-}
-
-void Window::OnOutputTransformed()
-{
- PositionSize positionSize = mSurface->GetPositionSize();
- mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
- mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
-}
-
-void Window::OnDeleteRequest()
-{
- mDeleteRequestSignal.Emit();
-}
-
void Window::DoShowIndicator( Dali::Window::WindowOrientation lastOrientation )
{
if( mIndicator == NULL )
mWindowBase->SetIndicatorProperties( isShow, lastOrientation );
}
+void Window::OnIconifyChanged( bool iconified )
+{
+ if( iconified )
+ {
+ mIconified = true;
+
+ if( mVisible )
+ {
+ WindowVisibilityObserver* observer( mAdaptor );
+ observer->OnWindowHidden();
+ DALI_LOG_RELEASE_INFO( "Window (%p) Iconified\n", this );
+ }
+ }
+ else
+ {
+ mIconified = false;
+
+ if( mVisible )
+ {
+ WindowVisibilityObserver* observer( mAdaptor );
+ observer->OnWindowShown();
+ DALI_LOG_RELEASE_INFO( "Window (%p) Deiconified\n", this );
+ }
+ }
+}
+
+void Window::OnFocusChanged( bool focusIn )
+{
+ mFocusChangedSignal.Emit( focusIn );
+}
+
+void Window::OnOutputTransformed()
+{
+ PositionSize positionSize = mSurface->GetPositionSize();
+ mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+}
+
+void Window::OnDeleteRequest()
+{
+ mDeleteRequestSignal.Emit();
+}
+
+void Window::OnIndicatorFlicked()
+{
+ if( mIndicator )
+ {
+ mIndicator->Flicked();
+ }
+}
+
void Window::IndicatorTypeChanged( IndicatorInterface::Type type )
{
mWindowBase->IndicatorTypeChanged( type );