From: Wonsik Jung Date: Wed, 25 Sep 2024 03:51:21 +0000 (+0900) Subject: [NUI] Supports to set window layer to bottom X-Git-Tag: submit/tizen/20240925.121854~1^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f29482cebed397cb13059165e90d6296c238ff2b;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Supports to set window layer to bottom Supports to set window layer to bottom. The related patches are the belows. https://review.tizen.org/gerrit/#/c/platform/core/uifw/dali-adaptor/+/318118/ https://review.tizen.org/gerrit/#/c/platform/core/uifw/dali-csharp-binder/+/318127/ --- diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs index 19d41f90a..9caff4253 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs @@ -385,6 +385,13 @@ namespace Tizen.NUI [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool IsAlwaysOnTop(global::System.Runtime.InteropServices.HandleRef window); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_SetBottom")] + public static extern void SetBottom(global::System.Runtime.InteropServices.HandleRef window, bool enable); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_IsBottom")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool IsBottom(global::System.Runtime.InteropServices.HandleRef window); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_RelativeMotionGrab")] [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool RelativeMotionGrab(global::System.Runtime.InteropServices.HandleRef window, uint boundary); diff --git a/src/Tizen.NUI/src/public/Window/Window.cs b/src/Tizen.NUI/src/public/Window/Window.cs index d00d5ccd5..cf165fce2 100755 --- a/src/Tizen.NUI/src/public/Window/Window.cs +++ b/src/Tizen.NUI/src/public/Window/Window.cs @@ -2582,8 +2582,9 @@ namespace Tizen.NUI /// - /// Gets or sets a value indicating whether the window is alwats on top of other windows or not. - /// Its behavior is effective among windows with the same notification level. + /// Gets or sets a value indicating whether the window is always on top of other windows or not. + /// This is valid between windows that have no notification level or a notification level of 'none'. + /// If it has a notification level, this will not do anything. /// [EditorBrowsable(EditorBrowsableState.Never)] public bool IsAlwaysOnTop @@ -2601,6 +2602,27 @@ namespace Tizen.NUI } } + /// + /// Gets or sets a value indicating whether the window is the bottom of other windows or not. + /// If the enable flag is true, this window will be placed below other windows. + /// Otherwise, if it's called with a false value, it will be located above other windows.. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool IsBottom + { + get + { + bool ret = Interop.Window.IsBottom(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + set + { + Interop.Window.SetBottom(SwigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + /// /// Requests relative motion grab /// diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/WindowTest1.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/WindowTest1.cs index 1da43a490..3f99ed8dd 100644 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/WindowTest1.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/WindowTest1.cs @@ -18,7 +18,7 @@ namespace Tizen.NUI.Samples int screenHeight; int addingInput; - private Window subWindow = null; + Window subWindow = null; private const string KEY_NUM_1 = "1"; private const string KEY_NUM_2 = "2"; @@ -483,6 +483,15 @@ namespace Tizen.NUI.Samples log.Fatal(tag, $"OnSubWindowResizeCompleted() called!, width:{size.Width}, height:{size.Height}"); } + bool testOnTick(object o, Timer.TickEventArgs e) + { + if(subWindow.IsBottom) + { + log.Fatal(tag, $"current bottom flag is true and change to false"); + subWindow.IsBottom = false; + } + return false; + } public void OnSubWindowKeyEvent(object sender, Window.KeyEventArgs e) { @@ -563,7 +572,7 @@ namespace Tizen.NUI.Samples case KEY_NUM_7: log.Fatal(tag, $"Always On Top Window Test"); - if(mainWin.IsAlwaysOnTop) + if(subWindow.IsAlwaysOnTop) { log.Fatal(tag, $"current AlwaysOnTop is true and change to false"); subWindow.IsAlwaysOnTop = false; @@ -587,6 +596,21 @@ namespace Tizen.NUI.Samples break; case KEY_NUM_9: + log.Fatal(tag, $"Set Bottom Test"); + if(subWindow.IsBottom) + { + log.Fatal(tag, $"current bottom flag is true and change to false"); + subWindow.IsBottom = false; + } + else + { + log.Fatal(tag, $"current bottom is false and change to true"); + subWindow.IsBottom = true; + + Timer timer = new Timer(5000); + timer.Tick += testOnTick; + timer.Start(); + } break; default: