[NUI] Add getter property about WindowPositionSizeWithBorder and WindowSizeWithBorder
authorjoogab.yun <joogab.yun@samsung.com>
Mon, 6 Mar 2023 09:40:34 +0000 (18:40 +0900)
committerJoogabYun <40262755+JoogabYun@users.noreply.github.com>
Tue, 7 Mar 2023 01:47:15 +0000 (10:47 +0900)
In the case of a border window, the size including the border area is required.

src/Tizen.NUI/src/public/Window/BorderWindow.cs

index 7195468..b4a5edd 100755 (executable)
@@ -460,6 +460,44 @@ namespace Tizen.NUI
             return direction;
         }
 
+        /// <summary>
+        /// Gets position and size of the border window
+        /// </summary>
+        /// <returns>The total window size including the border area in the default window.</returns>
+        [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;
+            }
+        }
+
+        /// <summary>
+        /// Gets size of the border window
+        /// </summary>
+        /// <returns>The total window size including the border area in the default window.</returns>
+        [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)