From a55bc10e5ec35dbe6d7eb125e9e021ca93dab44d Mon Sep 17 00:00:00 2001 From: "joogab.yun" Date: Mon, 6 Mar 2023 18:40:34 +0900 Subject: [PATCH] [NUI] Add getter property about WindowPositionSizeWithBorder and WindowSizeWithBorder In the case of a border window, the size including the border area is required. --- src/Tizen.NUI/src/public/Window/BorderWindow.cs | 38 +++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/Tizen.NUI/src/public/Window/BorderWindow.cs b/src/Tizen.NUI/src/public/Window/BorderWindow.cs index 7195468..b4a5edd 100755 --- a/src/Tizen.NUI/src/public/Window/BorderWindow.cs +++ b/src/Tizen.NUI/src/public/Window/BorderWindow.cs @@ -460,6 +460,44 @@ namespace Tizen.NUI return direction; } + /// + /// Gets position and size of the border window + /// + /// The total window size including the border area in the default window. + [EditorBrowsable(EditorBrowsableState.Never)] + public Rectangle WindowPositionSizeWithBorder + { + get + { + using var position = GetPosition(); + using var size = GetWindowSizeWithBorder(); + Rectangle ret = new Rectangle(position?.X ?? 0, position?.Y ?? 0, size?.Width ?? 0, size?.Height ?? 0); + return ret; + } + } + + /// + /// Gets size of the border window + /// + /// The total window size including the border area in the default window. + [EditorBrowsable(EditorBrowsableState.Never)] + public Size2D WindowSizeWithBorder + { + get + { + return GetWindowSizeWithBorder(); + } + } + + private Size2D GetWindowSizeWithBorder() + { + var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), true); + Size2D size = new Size2D(val.GetWidth(), val.GetHeight()); + val.Dispose(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return size; + } + private void DoOverlayMode(bool enable) { if (borderInterface.OverlayMode == true) -- 2.7.4