/**
* @copydoc Dali::Window::SetParent()
*/
- virtual void SetParent( WindowBase* parentWinBase ) = 0;
+ 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;
// Signals
SurfaceResized();
- mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( mWindowWidth, mWindowHeight ) );
+ mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( mRotationAngle, mWindowHeight ) );
// Emit signal
Dali::Window handle( this );
- mResizedSignal.Emit( Dali::Window::WindowSize( mWindowWidth, mWindowHeight ) );
- mResizeSignal.Emit( handle, Dali::Window::WindowSize( mWindowWidth, mWindowHeight ) );
+ mResizedSignal.Emit( Dali::Window::WindowSize( mRotationAngle, mWindowHeight ) );
+ mResizeSignal.Emit( handle, Dali::Window::WindowSize( mRotationAngle, mWindowHeight ) );
- mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( mWindowWidth, mWindowHeight ) );
+ mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( mRotationAngle, mWindowHeight ) );
}
void Window::OnPause()
if ( DALI_UNLIKELY( parent ) )
{
mParentWindow = parent;
- Dali::Window self = Dali::Window( this );
+ Dali::Window grandParent = Dali::DevelWindow::GetParent( parent );
// check circular parent window setting
- if ( Dali::DevelWindow::GetParent( parent ) == self )
+ if ( DALI_UNLIKELY( grandParent ) && mWindowBase->IsMatchedWindow( grandParent.GetNativeHandle() ) )
{
Dali::DevelWindow::Unparent( parent );
}
- mWindowBase->SetParent( GetImplementation( mParentWindow ).mWindowBase );
+ mWindowBase->SetParent( parent.GetNativeHandle() );
}
}
void Window::Unparent()
{
- mWindowBase->SetParent( nullptr );
- mParentWindow.Reset();
+ Any parent;
+ mWindowBase->SetParent( parent );
}
Dali::Window Window::GetParent()
}
}
-void WindowBaseEcoreWl::SetParent( WindowBase* parentWinBase )
+void WindowBaseEcoreWl::SetParent( Any parent )
{
- Ecore_Wl_Window* ecoreParent = NULL;
- if( parentWinBase )
+ Ecore_Wl_Window* mEcoreParent;
+ if( parent.Empty() == false )
{
- WindowBaseEcoreWl* winBaseEcore = static_cast<WindowBaseEcoreWl*>( parentWinBase );
- ecoreParent = winBaseEcore->mEcoreWindow;
+ // 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;
+ }
}
- ecore_wl_window_parent_set( mEcoreWindow, ecoreParent );
+ return ret;
}
} // namespace Adaptor
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
*/
- virtual void SetParent( WindowBase* parentWinBase ) override;
+ virtual void SetParent( Any parent ) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMatchedWindow()
+ */
+ virtual bool IsMatchedWindow( Any window ) override;
private:
}
case 90:
{
- rotation = WL_EGL_WINDOW_TIZEN_ROTATION_270;
+ rotation = WL_EGL_WINDOW_TIZEN_ROTATION_90;
break;
}
case 180:
ecore_wl2_window_type_set( mEcoreWindow, ECORE_WL2_WINDOW_TYPE_TOPLEVEL );
}
-void WindowBaseEcoreWl2::SetParent( WindowBase* parentWinBase )
+void WindowBaseEcoreWl2::SetParent( Any parent )
{
- Ecore_Wl2_Window* ecoreParent = NULL;
- if( parentWinBase )
+ Ecore_Wl2_Window* mEcoreParent;
+ if( parent.Empty() == false )
{
- WindowBaseEcoreWl2* winBaseEcore2 = static_cast<WindowBaseEcoreWl2*>( parentWinBase );
- ecoreParent = winBaseEcore2->mEcoreWindow;
+ // 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;
+ }
}
- ecore_wl2_window_parent_set( mEcoreWindow, ecoreParent );
+ return ret;
}
} // namespace Adaptor
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
*/
- virtual void SetParent( WindowBase* parentWinBase ) override;
+ virtual void SetParent( Any parent ) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMatchedWindow()
+ */
+ virtual bool IsMatchedWindow( Any window ) override;
private:
}
}
-void WindowBaseEcoreX::SetParent( WindowBase* parentWinBase )
+void WindowBaseEcoreX::SetParent( Any parent )
{
- Ecore_X_Window ecoreParent = 0;
- if( parentWinBase )
+ Ecore_X_Window mEcoreParent;
+ if ( parent.Empty() == false )
{
- WindowBaseEcoreX* winBaseEcoreX = static_cast<WindowBaseEcoreX*>( parentWinBase );
- ecoreParent = winBaseEcoreX->mEcoreWindow;
- ecore_x_icccm_transient_for_set( mEcoreWindow, ecoreParent );
+ // 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 );
+ }
}
else
{
- ecoreParent = 0;
+ mEcoreParent = 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( WindowBase* parentWinBase ) override;
+ virtual void SetParent( Any parent ) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMatchedWindow()
+ */
+ virtual bool IsMatchedWindow( Any window ) override;
private:
}
}
-void WindowBaseWin::SetParent( WindowBase* parentWinBase )
+void WindowBaseWin::SetParent( Any parent )
{
}
+bool WindowBaseWin::IsMatchedWindow( Any window )
+{
+ return false;
+}
+
} // namespace Adaptor
} // namespace Internal
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
*/
- virtual void SetParent( WindowBase* parentWinBase ) override;
+ virtual void SetParent( Any parent ) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMatchedWindow()
+ */
+ virtual bool IsMatchedWindow( Any window ) override;
private: