Add parent set for multi window.
After setting, parent and child window works together when window raise, lower and iconfined/diconifed.
Change-Id: I6043b50338ab9be2742d9e17f2d971c6dffdf3b9
return GetImplementation( window ).WheelEventSignal();
}
+void SetParent( Window window, Window parent )
+{
+ GetImplementation( window ).SetParent( parent );
+}
+
+void Unparent( Window window )
+{
+ GetImplementation( window ).Unparent();
+}
+
+Window GetParent( Window window )
+{
+ return GetImplementation( window ).GetParent();
+}
+
} // namespace DevelWindow
} // namespace Dali
*/
DALI_ADAPTOR_API WheelEventSignalType& WheelEventSignal( Window window );
+/**
+ * @brief Sets parent window of the window.
+ *
+ * After setting that, these windows do together when raise-up, lower and iconified/deiconified.
+ *
+ * @param[in] window The window instance
+ * @param[in] parent The parent window instance
+ */
+DALI_ADAPTOR_API void SetParent( Window window, Window parent );
+
+/**
+ * @brief Unsets parent window of the window.
+ *
+ * After unsetting, the window is disconnected his parent window.
+ *
+ * @param[in] window The window instance
+ */
+DALI_ADAPTOR_API void Unparent( Window window );
+
+/**
+ * @brief Gets parent window of the window.
+ *
+ * @param[in] window The window instance
+ * @return The parent window of the window
+ */
+DALI_ADAPTOR_API Window GetParent( Window window );
+
} // namespace DevelWindow
} // namespace Dali
*/
virtual void SetTransparency( bool transparent ) = 0;
+ /**
+ * @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;
+
// Signals
/**
mOpaqueState( false ),
mResizeEnabled( false ),
mType( Dali::Window::NORMAL ),
+ mParentWindow( NULL ),
mPreferredOrientation( Dali::Window::PORTRAIT ),
mRotationAngle( 0 ),
mWindowWidth( 0 ),
return Dali::Window( windowImpl );
}
+
+void Window::SetParent( Dali::Window& parent )
+{
+ if ( DALI_UNLIKELY( parent ) )
+ {
+ mParentWindow = parent;
+ Dali::Window grandParent = Dali::DevelWindow::GetParent( parent );
+ // check circular parent window setting
+ if ( DALI_UNLIKELY( grandParent ) && mWindowBase->IsMatchedWindow( grandParent.GetNativeHandle() ) )
+ {
+ Dali::DevelWindow::Unparent( parent );
+ }
+ mWindowBase->SetParent( parent.GetNativeHandle() );
+ }
+}
+
+void Window::Unparent()
+{
+ Any parent;
+ mWindowBase->SetParent( parent );
+}
+
+Dali::Window Window::GetParent()
+{
+ return mParentWindow;
+}
+
} // Adaptor
} // Internal
*/
static Dali::Window Get( Dali::Actor actor );
+ /**
+ * @copydoc Dali::DevelWindow::SetParent()
+ */
+ void SetParent( Dali::Window& parent );
+
+ /**
+ * @copydoc Dali::DevelWindow::Unparent()
+ */
+ void Unparent();
+
+ /**
+ * @copydoc Dali::DevelWindow::GetParent()
+ */
+ Dali::Window GetParent();
+
public: // Dali::Internal::Adaptor::SceneHolder
/**
bool mOpaqueState:1;
bool mResizeEnabled:1;
Dali::Window::Type mType;
+ Dali::Window mParentWindow;
OrientationPtr mOrientation;
std::vector<Dali::Window::WindowOrientation> mAvailableOrientations;
}
}
+void WindowBaseEcoreWl::SetParent( Any parent )
+{
+ Ecore_Wl_Window* mEcoreParent;
+ if( parent.Empty() == false )
+ {
+ // 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;
+ }
+ }
+ return ret;
+}
+
} // namespace Adaptor
} // namespace Internal
*/
virtual void SetTransparency( bool transparent ) override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
+ */
+ virtual void SetParent( Any parent ) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMatchedWindow()
+ */
+ virtual bool IsMatchedWindow( Any window ) override;
+
private:
/**
#ifdef DALI_ELDBUS_AVAILABLE
Eldbus_Connection* mSystemConnection;
#endif // DALI_ELDBUS_AVAILABLE
+
};
} // namespace Adaptor
ecore_wl2_window_type_set( mEcoreWindow, ECORE_WL2_WINDOW_TYPE_TOPLEVEL );
}
+void WindowBaseEcoreWl2::SetParent( Any parent )
+{
+ Ecore_Wl2_Window* mEcoreParent;
+ if( parent.Empty() == false )
+ {
+ // 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;
+ }
+ }
+ return ret;
+}
+
} // namespace Adaptor
} // namespace Internal
*/
virtual void SetTransparency( bool transparent ) override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
+ */
+ virtual void SetParent( Any parent ) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMatchedWindow()
+ */
+ virtual bool IsMatchedWindow( Any window ) override;
+
private:
/**
}
}
+void WindowBaseEcoreX::SetParent( Any parent )
+{
+ Ecore_X_Window mEcoreParent;
+ if ( parent.Empty() == false )
+ {
+ // 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
+ {
+ 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
*/
virtual void SetTransparency( bool transparent ) override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
+ */
+ virtual void SetParent( Any parent ) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMatchedWindow()
+ */
+ virtual bool IsMatchedWindow( Any window ) override;
+
private:
/**
void WindowBaseWin::OnWindowDamaged( int type, TWinEventInfo *event )
{
- Event_Mouse_Button* windowDamagedEvent( (Event_Mouse_Button*)event );\r
-\r
- if( windowDamagedEvent->window == mWin32Window )\r
- {\r
- DamageArea area;\r
- area.x = 0;\r
- area.y = 0;\r
- WindowSystem::GetScreenSize( area.width, area.height );\r
-\r
- mWindowDamagedSignal.Emit( area );\r
- }\r
+ Event_Mouse_Button* windowDamagedEvent( (Event_Mouse_Button*)event );
+
+ if( windowDamagedEvent->window == mWin32Window )
+ {
+ DamageArea area;
+ area.x = 0;
+ area.y = 0;
+ WindowSystem::GetScreenSize( area.width, area.height );
+
+ mWindowDamagedSignal.Emit( area );
+ }
}
void WindowBaseWin::OnMouseButtonDown( int type, TWinEventInfo *event )
{
Event_Mouse_Button touchEvent = *((Event_Mouse_Button*)event);
touchEvent.timestamp = GetTickCount();
- touchEvent.x = LOWORD( event->lParam );\r
- touchEvent.y = HIWORD( event->lParam );\r
+ touchEvent.x = LOWORD( event->lParam );
+ touchEvent.y = HIWORD( event->lParam );
touchEvent.multi.device = DEVICE_MOUSE;
if( touchEvent.window == mWin32Window )
{
Event_Mouse_Button touchEvent = *( (Event_Mouse_Button*)event );
touchEvent.timestamp = GetTickCount();
- touchEvent.x = LOWORD( event->lParam );\r
- touchEvent.y = HIWORD( event->lParam );\r
+ touchEvent.x = LOWORD( event->lParam );
+ touchEvent.y = HIWORD( event->lParam );
touchEvent.multi.device = DEVICE_MOUSE;
if( touchEvent.window == mWin32Window )
{
Event_Mouse_Button touchEvent = *((Event_Mouse_Button*)event);
touchEvent.timestamp = GetTickCount();
- touchEvent.x = LOWORD( event->lParam );\r
- touchEvent.y = HIWORD( event->lParam );\r
+ touchEvent.x = LOWORD( event->lParam );
+ touchEvent.y = HIWORD( event->lParam );
touchEvent.multi.device = DEVICE_MOUSE;
if( touchEvent.window == mWin32Window )
void WindowBaseWin::CreateWinWindow( PositionSize positionSize, bool isTransparent )
{
- long hWnd = WindowsPlatformImplementation::CreateHwnd( "Demo", "Demo", positionSize.x, positionSize.y, positionSize.width, positionSize.height, NULL );\r
-\r
- WindowsPlatformImplementation::ShowWindow( hWnd );\r
-\r
- mWin32Window = (WinWindowHandle)hWnd;\r
+ long hWnd = WindowsPlatformImplementation::CreateHwnd( "Demo", "Demo", positionSize.x, positionSize.y, positionSize.width, positionSize.height, NULL );
+
+ WindowsPlatformImplementation::ShowWindow( hWnd );
+
+ mWin32Window = (WinWindowHandle)hWnd;
DALI_ASSERT_ALWAYS( mWin32Window != 0 && "There is no Windows window" );
}
{
unsigned int uMsg = event->uMsg;
- switch( uMsg )\r
- {\r
- case WM_SETFOCUS:\r
- {\r
- OnFocusIn( uMsg, event );\r
- break;\r
- }\r
-\r
- case WM_KILLFOCUS:\r
- {\r
- OnFocusOut( uMsg, event );\r
- break;\r
- }\r
-\r
- case WM_PAINT:\r
- {\r
- OnWindowDamaged( uMsg, event );\r
- break;\r
- }\r
-\r
- case WM_LBUTTONDOWN:\r
- {\r
- OnMouseButtonDown( uMsg, event );\r
- break;\r
- }\r
-\r
- case WM_LBUTTONUP:\r
- {\r
- OnMouseButtonUp( uMsg, event );\r
- break;\r
- }\r
-\r
- case WM_MOUSEMOVE:\r
- {\r
- OnMouseButtonMove( uMsg, event );\r
- break;\r
- }\r
-\r
- case WM_MOUSEWHEEL:\r
- {\r
- OnMouseWheel( uMsg, event );\r
- break;\r
- }\r
-\r
- case WM_KEYDOWN:\r
- {\r
- OnKeyDown( uMsg, event );\r
- break;\r
- }\r
-\r
- case WM_KEYUP:\r
- {\r
- OnKeyUp( uMsg, event );\r
- break;\r
- }\r
-\r
+ switch( uMsg )
+ {
+ case WM_SETFOCUS:
+ {
+ OnFocusIn( uMsg, event );
+ break;
+ }
+
+ case WM_KILLFOCUS:
+ {
+ OnFocusOut( uMsg, event );
+ break;
+ }
+
+ case WM_PAINT:
+ {
+ OnWindowDamaged( uMsg, event );
+ break;
+ }
+
+ case WM_LBUTTONDOWN:
+ {
+ OnMouseButtonDown( uMsg, event );
+ break;
+ }
+
+ case WM_LBUTTONUP:
+ {
+ OnMouseButtonUp( uMsg, event );
+ break;
+ }
+
+ case WM_MOUSEMOVE:
+ {
+ OnMouseButtonMove( uMsg, event );
+ break;
+ }
+
+ case WM_MOUSEWHEEL:
+ {
+ OnMouseWheel( uMsg, event );
+ break;
+ }
+
+ case WM_KEYDOWN:
+ {
+ OnKeyDown( uMsg, event );
+ break;
+ }
+
+ case WM_KEYUP:
+ {
+ OnKeyUp( uMsg, event );
+ break;
+ }
+
default:
- break;\r
+ break;
}
}
+void WindowBaseWin::SetParent( Any parent )
+{
+
+}
+
+bool WindowBaseWin::IsMatchedWindow( Any window )
+{
+ return false;
+}
+
} // namespace Adaptor
} // namespace Internal
*/
virtual void SetTransparency( bool transparent ) override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
+ */
+ virtual void SetParent( Any parent ) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMatchedWindow()
+ */
+ virtual bool IsMatchedWindow( Any window ) override;
+
private:
/**