From 8afafa25224e624d68401c4a957346c96fbb1a07 Mon Sep 17 00:00:00 2001 From: Wonsik Jung Date: Fri, 27 Dec 2019 18:59:49 +0900 Subject: [PATCH] [NUI] Add to get current window orientation. (#1251) Add the API to get current window orientation. It is to return the logical orientation --- src/Tizen.NUI/src/internal/Interop/Interop.Window.cs | 5 ++++- src/Tizen.NUI/src/public/Window.cs | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs index bd225aa..65f646e 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs @@ -58,6 +58,9 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_GetPreferredOrientation")] public static extern int Window_GetPreferredOrientation(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_GetCurrentOrientation")] + public static extern int Window_GetCurrentOrientation(global::System.Runtime.InteropServices.HandleRef jarg1); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_SetPositionSize")] public static extern void Window_SetPositionSize(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); @@ -217,4 +220,4 @@ namespace Tizen.NUI public static extern global::System.IntPtr GetParent(global::System.Runtime.InteropServices.HandleRef jarg1); } } -} \ No newline at end of file +} diff --git a/src/Tizen.NUI/src/public/Window.cs b/src/Tizen.NUI/src/public/Window.cs index e869a4b..248bef3 100755 --- a/src/Tizen.NUI/src/public/Window.cs +++ b/src/Tizen.NUI/src/public/Window.cs @@ -1081,6 +1081,19 @@ namespace Tizen.NUI return ret; } + /// + /// Gets current orientation of the window. + /// + /// 6 + /// The current window orientation if previously set, or none. + [EditorBrowsable(EditorBrowsableState.Never)] + public Window.WindowOrientation GetCurrentOrientation() + { + Window.WindowOrientation ret = (Window.WindowOrientation)Interop.Window.Window_GetCurrentOrientation(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + internal Any GetNativeHandle() { Any ret = new Any(Interop.WindowInternal.Window_GetNativeHandle(swigCPtr), true); -- 2.7.4