[NUI] Add WindowPositionSize property (#581)
authorJiyun Yang <ji.yang@samsung.com>
Mon, 26 Nov 2018 06:13:22 +0000 (15:13 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Mon, 26 Nov 2018 06:13:22 +0000 (15:13 +0900)
Add WindowPositionSize property for atomic "move" and "resize" of window.
(in-house only)

Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
src/Tizen.NUI/src/internal/NDalicPINVOKE.cs
src/Tizen.NUI/src/public/Window.cs

index 8aa585d..cc9dbda 100755 (executable)
@@ -36828,6 +36828,24 @@ namespace Tizen.NUI
             }
         }
 
+        [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_Window_SetPositionSize")]
+        public static extern void Window_SetPositionSize_gl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_Window_SetPositionSize")]
+        public static extern void Window_SetPositionSize_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        public static void Window_SetPositionSize(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
+        {
+            if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan)
+            {
+                Window_SetPositionSize_vulkan(jarg1, jarg2);
+            }
+            else
+            {
+                Window_SetPositionSize_gl(jarg1, jarg2);
+            }
+        }
+
         [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_Application_New__SWIG_0")]
         public static extern global::System.IntPtr Application_New__SWIG_0_gl();
 
index 606292f..a470427 100755 (executable)
@@ -1495,6 +1495,12 @@ namespace Tizen.NUI
             return ret;
         }
 
+        internal void SetPositionSize(Rectangle positionSize)
+        {
+            NDalicPINVOKE.Window_SetPositionSize(swigCPtr, Rectangle.getCPtr(positionSize));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
         /// <summary>
         /// Sets whether the window is transparent or not.
         /// </summary>
@@ -1694,6 +1700,26 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Sets position and size of the window. This API guarantees that
+        /// both moving and resizing of window will appear on the screen at once.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Rectangle WindowPositionSize
+        {
+            get
+            {
+                Position2D position = GetPosition();
+                Size2D size = GetSize();
+                Rectangle ret = new Rectangle(position.X, position.Y, size.Width, size.Height);
+                return ret;
+            }
+            set
+            {
+                SetPositionSize(value);
+            }
+        }
+
+        /// <summary>
         /// Feeds a key event into the window.
         /// </summary>
         /// <param name="keyEvent">The key event to feed.</param>