From: Jiyun Yang Date: Mon, 26 Nov 2018 06:13:22 +0000 (+0900) Subject: [NUI] Add WindowPositionSize property (#581) X-Git-Tag: accepted/tizen/5.0/unified/20181127.073200~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fbcac418e0791c3a3ed404c06894a8d03c372788;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Add WindowPositionSize property (#581) Add WindowPositionSize property for atomic "move" and "resize" of window. (in-house only) Signed-off-by: Jiyun Yang --- diff --git a/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs b/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs index 8aa585d..cc9dbda 100755 --- a/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs +++ b/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs @@ -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(); diff --git a/src/Tizen.NUI/src/public/Window.cs b/src/Tizen.NUI/src/public/Window.cs index 606292f..a470427 100755 --- a/src/Tizen.NUI/src/public/Window.cs +++ b/src/Tizen.NUI/src/public/Window.cs @@ -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(); + } + /// /// Sets whether the window is transparent or not. /// @@ -1694,6 +1700,26 @@ namespace Tizen.NUI } /// + /// Sets position and size of the window. This API guarantees that + /// both moving and resizing of window will appear on the screen at once. + /// + [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); + } + } + + /// /// Feeds a key event into the window. /// /// The key event to feed.