The new `SetLayout` method allows users to easily snap windows to specific positions and sizes.
This feature is similar to the snap window feature found in many operating systems,
allowing users to quickly arrange their windows in a convenient and efficient manner.
Change-Id: I59b7ef154494cbbc8af39a85747d5b0cde57feb4
END_TEST;
}
+int UtcDaliWindowSetLayoutNegative(void)
+{
+ Dali::Window instance;
+ try
+ {
+ unsigned int arg1(0);
+ instance.SetLayout(arg1, arg1, arg1, arg1, arg1, arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
int UtcDaliWindowGetRootLayerNegative(void)
{
Dali::Window instance;
{
}
+void WindowBaseAndroid::SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan)
+{
+}
+
void WindowBaseAndroid::SetClass(const std::string& name, const std::string& className)
{
}
*/
void MoveResize(PositionSize positionSize) override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetLayout()
+ */
+ void SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan) override;
+
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetClass()
*/
virtual void MoveResize(Dali::PositionSize positionSize) = 0;
/**
+ * @copydoc Dali::Window::SetLayout()
+ */
+ virtual void SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan) = 0;
+
+ /**
* @copydoc Dali::Window::SetClass()
*/
virtual void SetClass(const std::string& name, const std::string& className) = 0;
Dali::Accessibility::Accessible::Get(mScene.GetRootLayer())->EmitBoundsChanged(Dali::Rect<>(positionSize.x, positionSize.y, positionSize.width, positionSize.height));
}
+void Window::SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan)
+{
+ mWindowBase->SetLayout(numCols, numRows, column, row, colSpan, rowSpan);
+}
+
Dali::Layer Window::GetRootLayer() const
{
return mScene.GetRootLayer();
PositionSize GetPositionSize() const;
/**
+ * @copydoc Dali::Window::SetLayout()
+ */
+ void SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan);
+
+ /**
* @copydoc Dali::Window::GetRootLayer()
*/
Dali::Layer GetRootLayer() const;
*/
void MoveResize(PositionSize positionSize) override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetLayout()
+ */
+ void SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan) override;
+
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetClass()
*/
[mImpl->mWindow.contentView setFrameSize:size];
}
+void WindowBaseCocoa::SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan)
+{
+}
+
void WindowBaseCocoa::SetClass( const std::string& name, const std::string& className )
{
}
ecore_wl_window_update_size(mEcoreWindow, positionSize.width, positionSize.height);
}
+void WindowBaseEcoreWl::SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan)
+{
+}
+
void WindowBaseEcoreWl::SetClass(const std::string& name, const std::string& className)
{
ecore_wl_window_title_set(mEcoreWindow, name.c_str());
*/
void MoveResize(PositionSize positionSize) override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetLayout()
+ */
+ void SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan) override;
+
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetClass()
*/
ecore_wl2_window_sync_geometry_set(mEcoreWindow, ++mMoveResizeSerial, newPositionSize.x, newPositionSize.y, newPositionSize.width, newPositionSize.height);
}
+void WindowBaseEcoreWl2::SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan)
+{
+ DALI_LOG_RELEASE_INFO("ecore_wl2_window_layout_set, numCols[%d], numRows[%d], column[%d], row[%d], colSpan[%d], rowSpan[%d]\n", numCols, numRows, column, row, colSpan, rowSpan);
+ ecore_wl2_window_layout_set(mEcoreWindow, numCols, numRows, column, row, colSpan, rowSpan);
+}
+
void WindowBaseEcoreWl2::SetClass(const std::string& name, const std::string& className)
{
ecore_wl2_window_title_set(mEcoreWindow, name.c_str());
*/
void MoveResize(PositionSize positionSize) override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetLayout()
+ */
+ void SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan) override;
+
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetClass()
*/
ecore_x_window_move_resize(mEcoreWindow, positionSize.x, positionSize.y, positionSize.width, positionSize.height);
}
+void WindowBaseEcoreX::SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan)
+{
+}
+
void WindowBaseEcoreX::SetClass(const std::string& name, const std::string& className)
{
ecore_x_icccm_title_set(mEcoreWindow, name.c_str());
void MoveResize(PositionSize positionSize) override;
/**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetLayout()
+ */
+ void SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan) override;
+
+ /**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetClass()
*/
void SetClass(const std::string& name, const std::string& className) override;
{
}
+void WindowBaseWin::SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan)
+{
+}
+
void WindowBaseWin::SetClass(const std::string& name, const std::string& className)
{
}
void MoveResize(PositionSize positionSize) override;
/**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetLayout()
+ */
+ void SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan) override;
+
+ /**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetClass()
*/
void SetClass(const std::string& name, const std::string& className) override;
WindowSystem::GetImplementation().MoveResize(mWindow, positionSize.x, positionSize.y, positionSize.width, positionSize.height);
}
+void WindowBaseX::SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan)
+{
+}
+
void WindowBaseX::SetClass(const std::string& name, const std::string& className)
{
WindowSystem::GetImplementation().SetClass(mWindow, name, className);
*/
void MoveResize(PositionSize positionSize) override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetLayout()
+ */
+ void SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan) override;
+
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetClass()
*/
return GetImplementation(*this).GetPosition();
}
+void Window::SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan)
+{
+ return GetImplementation(*this).SetLayout(numCols, numRows, column, row, colSpan, rowSpan);
+}
+
void Window::SetTransparency(bool transparent)
{
GetImplementation(*this).SetTransparency(transparent);
WindowPosition GetPosition() const;
/**
+ * @brief Sets the layout of the window.
+ *
+ * This method sets the layout of the window based on the specified number of columns and rows,
+ * as well as the position and size of the window within that layout.
+ *
+ * @param numCols The number of columns in the layout.
+ * @param numRows The number of rows in the layout.
+ * @param column The column number of the window within the layout.
+ * @param row The row number of the window within the layout.
+ * @param colSpan The number of columns the window should span within the layout.
+ * @param rowSpan The number of rows the window should span within the layout.
+ * @SINCE_2_2.20
+ */
+ void SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan);
+
+ /**
* @brief Sets whether the window is transparent or not.
*
* @SINCE_1_2.60