[NUI] Add NUIApplicaion.GetScreenSize
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Tue, 17 Jan 2023 06:05:24 +0000 (15:05 +0900)
committerJaehyun Cho <jaehyun0cho@gmail.com>
Tue, 18 Apr 2023 01:43:53 +0000 (10:43 +0900)
To provide the screen size, NUIApplication.GetScreenSize is added.

src/Tizen.NUI/src/internal/Interop/Interop.Application.cs
src/Tizen.NUI/src/public/Application/NUIApplication.cs

index 05856cd..f48e992 100755 (executable)
@@ -98,6 +98,8 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_GetRenderThreadId")]
             public static extern int GetRenderThreadId(global::System.Runtime.InteropServices.HandleRef application);
 
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GetScreenSize")]
+            public static extern global::System.IntPtr GetScreenSize();
         }
     }
 }
index 1d4b940..18484bb 100755 (executable)
@@ -472,6 +472,18 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Gets the screen size
+        /// </summary>
+        /// <returns>Screen size</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        static public Size GetScreenSize()
+        {
+            var ret = new Size(Interop.Application.GetScreenSize(), true);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
         /// Overrides this method if you want to handle behavior.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>