From c043295743889127565d910b351176f61e3fb541 Mon Sep 17 00:00:00 2001 From: Jaehyun Cho Date: Tue, 17 Jan 2023 15:05:24 +0900 Subject: [PATCH] [NUI] Add NUIApplicaion.GetScreenSize To provide the screen size, NUIApplication.GetScreenSize is added. --- src/Tizen.NUI/src/internal/Interop/Interop.Application.cs | 2 ++ src/Tizen.NUI/src/public/Application/NUIApplication.cs | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Application.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Application.cs index 05856cd..f48e992 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Application.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Application.cs @@ -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(); } } } diff --git a/src/Tizen.NUI/src/public/Application/NUIApplication.cs b/src/Tizen.NUI/src/public/Application/NUIApplication.cs index 1d4b940..18484bb 100755 --- a/src/Tizen.NUI/src/public/Application/NUIApplication.cs +++ b/src/Tizen.NUI/src/public/Application/NUIApplication.cs @@ -472,6 +472,18 @@ namespace Tizen.NUI } /// + /// Gets the screen size + /// + /// Screen size + [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; + } + + /// /// Overrides this method if you want to handle behavior. /// /// 3 -- 2.7.4