[NUI] Add GetRectangleFromPtr() in Rectangle
authorDaekwang Ryu <dkdk.ryu@samsung.com>
Wed, 17 Aug 2022 05:45:13 +0000 (14:45 +0900)
committerJaehyun Cho <jaehyun0cho@gmail.com>
Tue, 29 Nov 2022 09:02:38 +0000 (18:02 +0900)
src/Tizen.NUI/src/public/Common/Rectangle.cs

index 2a24ceb..77caf5a 100755 (executable)
@@ -522,5 +522,17 @@ namespace Tizen.NUI
         /// Determines whether the reference is null or the Rectangle has all 0 properties.
         /// </summary>
         internal static bool IsNullOrZero(Rectangle rectangle) => (rectangle == null || (rectangle.top == 0 && rectangle.right == 0 && rectangle.bottom == 0 && rectangle.left == 0));
+
+        /// <summary>
+        /// Get Rectangle from Intptr.<br/>
+        /// </summary>
+        /// <param name="cPtr">An object of IntPtr type.</param>
+        /// <returns>An object of the Rectangle type.</returns>
+        internal static Rectangle GetRectangleFromPtr(global::System.IntPtr cPtr)
+        {
+            Rectangle ret = new Rectangle(cPtr, false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
     }
 }