Add SetParent in Window.
This function has additional flag whether child is the above or below of parent.
Change-Id: Ibcc1a3fd69b9f81cc0b856d634f4b39c908e9d1d
END_TEST;
}
+int UtcDaliWindowSetParentWithBelowParentNegative(void)
+{
+ try
+ {
+ Dali::Window arg1;
+ Dali::Window arg2;
+ DevelWindow::SetParent(arg1, arg2, true);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
int UtcDaliWindowAddInputRegion(void)
{
Dali::Window instance;
GetImplementation(window).SetParent(parent);
}
+void SetParent(Window window, Window parent, bool belowParent)
+{
+ GetImplementation(window).SetParent(parent, belowParent);
+}
+
void Unparent(Window window)
{
GetImplementation(window).Unparent();
DALI_ADAPTOR_API void SetParent(Window window, Window parent);
/**
+ * @brief Sets parent window of the window.
+ *
+ * After setting that, these windows do together when raise-up, lower and iconified/deiconified.
+ * This function has the additional flag whether the child is located above or below of the parent.
+ *
+ * @param[in] window The window instance
+ * @param[in] parent The parent window instance
+ * @param[in] belowParent The flag is whether the child is located above or below of the parent.
+ */
+DALI_ADAPTOR_API void SetParent(Window window, Window parent, bool belowParent);
+
+/**
* @brief Unsets parent window of the window.
*
* After unsetting, the window is disconnected his parent window.
{
}
-void WindowBaseAndroid::SetParent(WindowBase* parentWinBase)
+void WindowBaseAndroid::SetParent(WindowBase* parentWinBase, bool belowParent)
{
}
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
*/
- void SetParent(WindowBase* parentWinBase) override;
+ void SetParent(WindowBase* parentWinBase, bool belowParent) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateFrameRenderedSyncFence()
WindowBase* childWindowBase = renderSurface->GetWindowBase();
if(childWindowBase)
{
- childWindowBase->SetParent(mWindowBase.get());
+ childWindowBase->SetParent(mWindowBase.get(), false);
}
}
}
/**
* @copydoc Dali::Window::SetParent()
*/
- virtual void SetParent(WindowBase* parentWinBase) = 0;
+ virtual void SetParent(WindowBase* parentWinBase, bool belowParent) = 0;
/**
* @brief Create a sync fence that can tell the frame is rendered by the graphics driver.
{
Dali::DevelWindow::Unparent(parent);
}
- mWindowBase->SetParent(GetImplementation(mParentWindow).mWindowBase);
+ mWindowBase->SetParent(GetImplementation(mParentWindow).mWindowBase, false);
+ }
+}
+
+void Window::SetParent(Dali::Window& parent, bool belowParent)
+{
+ if(DALI_UNLIKELY(parent))
+ {
+ mParentWindow = parent;
+ Dali::Window self = Dali::Window(this);
+ // check circular parent window setting
+ if(Dali::DevelWindow::GetParent(parent) == self)
+ {
+ Dali::DevelWindow::Unparent(parent);
+ }
+ mWindowBase->SetParent(GetImplementation(mParentWindow).mWindowBase, belowParent);
}
}
void Window::Unparent()
{
- mWindowBase->SetParent(nullptr);
+ mWindowBase->SetParent(nullptr, false);
mParentWindow.Reset();
}
static Dali::Window Get(Dali::Actor actor);
/**
- * @copydoc Dali::DevelWindow::SetParent()
+ * @copydoc Dali::DevelWindow::SetParent(Window window, Window parent)
*/
void SetParent(Dali::Window& parent);
/**
+ * @copydoc Dali::DevelWindow::SetParent(Window window, Window parent, bool belowParent)
+ */
+ void SetParent(Dali::Window& parent, bool belowParent);
+
+ /**
* @copydoc Dali::DevelWindow::Unparent()
*/
void Unparent();
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
*/
- void SetParent(WindowBase* parentWinBase) override;
+ void SetParent(WindowBase* parentWinBase, bool belowParent) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateFrameRenderedSyncFence()
mImpl->mWindow.alphaValue = static_cast<CGFloat>(!transparent);
}
-void WindowBaseCocoa::SetParent( WindowBase* parentWinBase )
+void WindowBaseCocoa::SetParent(WindowBase* parentWinBase, bool belowParent)
{
auto &parent = dynamic_cast<WindowBaseCocoa&>(*parentWinBase);
[mImpl->mWindow setParentWindow:parent.mImpl->mWindow];
}
}
-void WindowBaseEcoreWl::SetParent(WindowBase* parentWinBase)
+void WindowBaseEcoreWl::SetParent(WindowBase* parentWinBase, bool belowParent)
{
Ecore_Wl_Window* ecoreParent = NULL;
if(parentWinBase)
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
*/
- void SetParent(WindowBase* parentWinBase) override;
+ void SetParent(WindowBase* parentWinBase, bool belowParent) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateFrameRenderedSyncFence()
ecore_wl2_window_type_set(mEcoreWindow, ECORE_WL2_WINDOW_TYPE_TOPLEVEL);
}
-void WindowBaseEcoreWl2::SetParent(WindowBase* parentWinBase)
+void WindowBaseEcoreWl2::SetParent(WindowBase* parentWinBase, bool belowParent)
{
Ecore_Wl2_Window* ecoreParent = NULL;
if(parentWinBase)
WindowBaseEcoreWl2* winBaseEcore2 = static_cast<WindowBaseEcoreWl2*>(parentWinBase);
ecoreParent = winBaseEcore2->mEcoreWindow;
}
- ecore_wl2_window_parent_set(mEcoreWindow, ecoreParent);
+ ecore_wl2_window_transient_parent_set(mEcoreWindow, ecoreParent, belowParent);
}
int WindowBaseEcoreWl2::CreateFrameRenderedSyncFence()
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
*/
- void SetParent(WindowBase* parentWinBase) override;
+ void SetParent(WindowBase* parentWinBase, bool belowParent) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateFrameRenderedSyncFence()
}
}
-void WindowBaseEcoreX::SetParent(WindowBase* parentWinBase)
+void WindowBaseEcoreX::SetParent(WindowBase* parentWinBase, bool belowParent)
{
Ecore_X_Window ecoreParent = 0;
if(parentWinBase)
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
*/
- void SetParent(WindowBase* parentWinBase) override;
+ void SetParent(WindowBase* parentWinBase, bool belowParent) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateFrameRenderedSyncFence()
}
}
-void WindowBaseWin::SetParent(WindowBase* parentWinBase)
+void WindowBaseWin::SetParent(WindowBase* parentWinBase, bool belowParent)
{
}
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
*/
- void SetParent(WindowBase* parentWinBase) override;
+ void SetParent(WindowBase* parentWinBase, bool belowParent) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::CreateFrameRenderedSyncFence()