[NUI] Add to get current window orientation. (#1251)
authorWonsik Jung <sidein@samsung.com>
Fri, 27 Dec 2019 09:59:49 +0000 (18:59 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Fri, 27 Dec 2019 09:59:49 +0000 (18:59 +0900)
Add the API to get current window orientation.
It is to return the logical orientation

src/Tizen.NUI/src/internal/Interop/Interop.Window.cs
src/Tizen.NUI/src/public/Window.cs

index bd225aa..65f646e 100755 (executable)
@@ -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
+}
index e869a4b..248bef3 100755 (executable)
@@ -1081,6 +1081,19 @@ namespace Tizen.NUI
             return ret;
         }
 
+        /// <summary>
+        /// Gets current orientation of the window.
+        /// </summary>
+        /// <since_tizen> 6 </since_tizen>
+        /// <returns>The current window orientation if previously set, or none.</returns>
+        [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);