From d0d1971591dd6018024086a99d3fe5e00f29193c Mon Sep 17 00:00:00 2001 From: Wonsik Jung Date: Wed, 26 Feb 2020 13:07:43 +0900 Subject: [PATCH] [NUI] Add to set Available Orientations (#1257) Add to set Available Orientations. This API is for adding serveral orientations one time. --- src/Tizen.NUI/src/internal/Interop/Interop.Window.cs | 3 +++ src/Tizen.NUI/src/public/Window.cs | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs index 65f646e..ecbb5fa 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs @@ -61,6 +61,9 @@ namespace Tizen.NUI [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_SetAvailableOrientations")] + public static extern void Window_SetAvailableOrientations(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); [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); diff --git a/src/Tizen.NUI/src/public/Window.cs b/src/Tizen.NUI/src/public/Window.cs index e27c7aa..6e14478 100755 --- a/src/Tizen.NUI/src/public/Window.cs +++ b/src/Tizen.NUI/src/public/Window.cs @@ -1087,6 +1087,25 @@ namespace Tizen.NUI return ret; } + /// + /// Sets available orientations of the window. + /// This API is for setting several orientations one time. + /// + /// The list of orientations. + /// 6 + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetAvailableOrientations( List orientations ) + { + PropertyArray orientationArray = new PropertyArray(); + for( int i = 0; i < orientations.Count; i++ ) + { + orientationArray.PushBack(new PropertyValue((int)orientations[i])); + } + + Interop.Window.Window_SetAvailableOrientations(swigCPtr, PropertyArray.getCPtr(orientationArray)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + internal Any GetNativeHandle() { Any ret = new Any(Interop.WindowInternal.Window_GetNativeHandle(swigCPtr), true); -- 2.7.4