[NUI] Supports to set window layer to bottom
authorWonsik Jung <sidein@samsung.com>
Wed, 25 Sep 2024 03:51:21 +0000 (12:51 +0900)
committerbshsqa <32317749+bshsqa@users.noreply.github.com>
Wed, 25 Sep 2024 12:13:40 +0000 (21:13 +0900)
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/

src/Tizen.NUI/src/internal/Interop/Interop.Window.cs
src/Tizen.NUI/src/public/Window/Window.cs
test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/WindowTest1.cs

index 19d41f90abdaa95970f95b4f39bbee1d72b6d56d..9caff4253d33095be237d556077e3363927026ca 100755 (executable)
@@ -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);
index d00d5ccd5772aab1ca19b3e08b2b977c394bf348..cf165fce230575a18d2d7dd8d8b21e92f3d92799 100755 (executable)
@@ -2582,8 +2582,9 @@ namespace Tizen.NUI
 
 
         /// <summary>
-        /// 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.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
         public bool IsAlwaysOnTop
@@ -2601,6 +2602,27 @@ namespace Tizen.NUI
             }
         }
 
+        /// <summary>
+        /// 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..
+        /// </summary>
+        [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();
+            }
+        }
+
         /// <summary>
         /// Requests relative motion grab
         /// </summary>
index 1da43a490b95bfa6f83878741b7731499c4d4b67..3f99ed8ddd6d7bdbb7461dd46045536291da0180 100644 (file)
@@ -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: