/**
* @copydoc Dali::Window::SetParent()
*/
- virtual void SetParent( Any parent ) = 0;
-
- /**
- * @brief Check whether the window is matched or not.
- * @return The result of matched.
- */
- virtual bool IsMatchedWindow( Any window ) = 0;
+ virtual void SetParent( WindowBase* parentWinBase ) = 0;
// Signals
SurfaceResized();
- mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( mRotationAngle, mWindowHeight ) );
+ mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( mWindowWidth, mWindowHeight ) );
// Emit signal
Dali::Window handle( this );
- mResizedSignal.Emit( Dali::Window::WindowSize( mRotationAngle, mWindowHeight ) );
- mResizeSignal.Emit( handle, Dali::Window::WindowSize( mRotationAngle, mWindowHeight ) );
+ mResizedSignal.Emit( Dali::Window::WindowSize( mWindowWidth, mWindowHeight ) );
+ mResizeSignal.Emit( handle, Dali::Window::WindowSize( mWindowWidth, mWindowHeight ) );
- mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( mRotationAngle, mWindowHeight ) );
+ mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( mWindowWidth, mWindowHeight ) );
}
void Window::OnPause()
if ( DALI_UNLIKELY( parent ) )
{
mParentWindow = parent;
- Dali::Window grandParent = Dali::DevelWindow::GetParent( parent );
+ Dali::Window self = Dali::Window( this );
// check circular parent window setting
- if ( DALI_UNLIKELY( grandParent ) && mWindowBase->IsMatchedWindow( grandParent.GetNativeHandle() ) )
+ if ( Dali::DevelWindow::GetParent( parent ) == self )
{
Dali::DevelWindow::Unparent( parent );
}
- mWindowBase->SetParent( parent.GetNativeHandle() );
+ mWindowBase->SetParent( GetImplementation( mParentWindow ).mWindowBase );
}
}
void Window::Unparent()
{
- Any parent;
- mWindowBase->SetParent( parent );
+ mWindowBase->SetParent( nullptr );
+ mParentWindow.Reset();
}
Dali::Window Window::GetParent()
}
}
-void WindowBaseEcoreWl::SetParent( Any parent )
+void WindowBaseEcoreWl::SetParent( WindowBase* parentWinBase )
{
- Ecore_Wl_Window* mEcoreParent;
- if( parent.Empty() == false )
+ Ecore_Wl_Window* ecoreParent = NULL;
+ if( parentWinBase )
{
- // check we have a valid type
- DALI_ASSERT_ALWAYS( ( parent.GetType() == typeid (Ecore_Wl_Window *) ) && "Parent's surface type is invalid" );
- mEcoreParent = AnyCast< Ecore_Wl_Window* >( parent );
- }
- else
- {
- mEcoreParent = NULL;
- }
- ecore_wl_window_parent_set( mEcoreWindow, mEcoreParent );
-}
-
-bool WindowBaseEcoreWl::IsMatchedWindow( Any window )
-{
- bool ret = false;
- if ( window.Empty() == false )
- {
- // check we have a valid type
- DALI_ASSERT_ALWAYS( ( window.GetType() == typeid (Ecore_Wl_Window *) ) && "Window's surface type is invalid" );
- if ( AnyCast< Ecore_Wl_Window* >( window ) == mEcoreWindow )
- {
- ret = true;
- }
+ WindowBaseEcoreWl* winBaseEcore = static_cast<WindowBaseEcoreWl*>( parentWinBase );
+ ecoreParent = winBaseEcore->mEcoreWindow;
}
- return ret;
+ ecore_wl_window_parent_set( mEcoreWindow, ecoreParent );
}
} // namespace Adaptor
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
*/
- virtual void SetParent( Any parent ) override;
-
- /**
- * @copydoc Dali::Internal::Adaptor::WindowBase::IsMatchedWindow()
- */
- virtual bool IsMatchedWindow( Any window ) override;
+ virtual void SetParent( WindowBase* parentWinBase ) override;
private:
}
case 90:
{
- rotation = WL_EGL_WINDOW_TIZEN_ROTATION_90;
+ rotation = WL_EGL_WINDOW_TIZEN_ROTATION_270;
break;
}
case 180:
ecore_wl2_window_type_set( mEcoreWindow, ECORE_WL2_WINDOW_TYPE_TOPLEVEL );
}
-void WindowBaseEcoreWl2::SetParent( Any parent )
+void WindowBaseEcoreWl2::SetParent( WindowBase* parentWinBase )
{
- Ecore_Wl2_Window* mEcoreParent;
- if( parent.Empty() == false )
+ Ecore_Wl2_Window* ecoreParent = NULL;
+ if( parentWinBase )
{
- // check we have a valid type
- DALI_ASSERT_ALWAYS( ( parent.GetType() == typeid (Ecore_Wl2_Window *) ) && "Parent's surface type is invalid" );
- mEcoreParent = AnyCast< Ecore_Wl2_Window* >( parent );
- }
- else
- {
- mEcoreParent = NULL;
- }
- ecore_wl2_window_parent_set( mEcoreWindow, mEcoreParent );
-}
-
-bool WindowBaseEcoreWl2::IsMatchedWindow( Any window )
-{
- bool ret = false;
- if ( window.Empty() == false )
- {
- // check we have a valid type
- DALI_ASSERT_ALWAYS( ( window.GetType() == typeid (Ecore_Wl2_Window *) ) && "Window's surface type is invalid" );
- if ( AnyCast< Ecore_Wl2_Window*>( window ) == mEcoreWindow )
- {
- ret = true;
- }
+ WindowBaseEcoreWl2* winBaseEcore2 = static_cast<WindowBaseEcoreWl2*>( parentWinBase );
+ ecoreParent = winBaseEcore2->mEcoreWindow;
}
- return ret;
+ ecore_wl2_window_parent_set( mEcoreWindow, ecoreParent );
}
} // namespace Adaptor
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
*/
- virtual void SetParent( Any parent ) override;
-
- /**
- * @copydoc Dali::Internal::Adaptor::WindowBase::IsMatchedWindow()
- */
- virtual bool IsMatchedWindow( Any window ) override;
+ virtual void SetParent( WindowBase* parentWinBase ) override;
private:
}
}
-void WindowBaseEcoreX::SetParent( Any parent )
+void WindowBaseEcoreX::SetParent( WindowBase* parentWinBase )
{
- Ecore_X_Window mEcoreParent;
- if ( parent.Empty() == false )
+ Ecore_X_Window ecoreParent = 0;
+ if( parentWinBase )
{
- // check we have a valid type
- DALI_ASSERT_ALWAYS( ( (parent.GetType() == typeid (Ecore_X_Window) ) )
- && "Surface type is invalid" );
-
- if ( parent.GetType() == typeid (Ecore_X_Window) )
- {
- mEcoreParent = AnyCast< Ecore_X_Window >( parent );
- ecore_x_icccm_transient_for_set( mEcoreWindow, mEcoreParent );
- }
- else
- {
- mEcoreParent = 0;
- ecore_x_icccm_transient_for_unset( mEcoreWindow );
- }
+ WindowBaseEcoreX* winBaseEcoreX = static_cast<WindowBaseEcoreX*>( parentWinBase );
+ ecoreParent = winBaseEcoreX->mEcoreWindow;
+ ecore_x_icccm_transient_for_set( mEcoreWindow, ecoreParent );
}
else
{
- mEcoreParent = 0;
+ ecoreParent = 0;
ecore_x_icccm_transient_for_unset( mEcoreWindow );
}
}
-bool WindowBaseEcoreX::IsMatchedWindow( Any window )
-{
- bool ret = false;
- if ( window.Empty() == false )
- {
- // check we have a valid type
- DALI_ASSERT_ALWAYS( ( (window.GetType() == typeid (Ecore_X_Window) ) ) && "Surface type is invalid" );
- if ( AnyCast< Ecore_X_Window >( window ) == mEcoreWindow )
- {
- ret = true;
- }
- }
- return ret;
-}
-
} // namespace Adaptor
} // namespace Internal
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
*/
- virtual void SetParent( Any parent ) override;
-
- /**
- * @copydoc Dali::Internal::Adaptor::WindowBase::IsMatchedWindow()
- */
- virtual bool IsMatchedWindow( Any window ) override;
+ virtual void SetParent( WindowBase* parentWinBase ) override;
private:
}
}
-void WindowBaseWin::SetParent( Any parent )
+void WindowBaseWin::SetParent( WindowBase* parentWinBase )
{
}
-bool WindowBaseWin::IsMatchedWindow( Any window )
-{
- return false;
-}
-
} // namespace Adaptor
} // namespace Internal
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
*/
- virtual void SetParent( Any parent ) override;
-
- /**
- * @copydoc Dali::Internal::Adaptor::WindowBase::IsMatchedWindow()
- */
- virtual bool IsMatchedWindow( Any window ) override;
+ virtual void SetParent( WindowBase* parentWinBase ) override;
private: