[NUI] Supports to set/get full screen sized window
authorWonsik Jung <sidein@samsung.com>
Tue, 24 Oct 2023 07:22:16 +0000 (16:22 +0900)
committerEunki Hong <h.pichulia@gmail.com>
Wed, 25 Oct 2023 12:48:44 +0000 (21:48 +0900)
To support set/get full screen sized window.
The full screen sized window means the window is resized with screen size.
In addition, this window is the z-order is the highest.

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/WindowTest.cs
test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Window/TSWindow.cs

index 5cf427c..84427a9 100755 (executable)
@@ -393,6 +393,13 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_KeyboardUnGrab")]
             [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
             public static extern bool KeyboardUnGrab(global::System.Runtime.InteropServices.HandleRef window);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_SetFullScreen")]
+            public static extern void SetFullScreen(global::System.Runtime.InteropServices.HandleRef window, bool fullscreen);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_GetFullScreen")]
+            [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
+            public static extern bool GetFullScreen(global::System.Runtime.InteropServices.HandleRef window);
         }
     }
 }
index 3779dfe..6df4dd1 100755 (executable)
@@ -2424,6 +2424,32 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Sets to resize window with full screen.
+        /// If full screen size is set for the window,
+        /// window will be resized with full screen.
+        /// In addition, the full screen sized window's z-order is the highest.
+        /// </summary>
+        /// <param name="fullscreen"> If fullscreen is true, set fullscreen or unset.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetFullScreen(bool fullscreen)
+        {
+            Interop.Window.SetFullScreen(SwigCPtr, fullscreen);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Gets whether the full screen sized window or not.
+        /// </summary>
+        /// <returns>Returns true if the full screen sized window is.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool GetFullScreen()
+        {
+            bool ret = Interop.Window.GetFullScreen(SwigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+              return ret;
+        }
+
+        /// <summary>
         /// Get Native Window handle.
         /// <example>
         /// How to get Native Window handle
index f3fe59b..583bc7d 100644 (file)
@@ -179,6 +179,16 @@ namespace Tizen.NUI.Samples
                     case KEY_NUM_7:
                         mainWin.SetMimimumSize(new Size2D(100, 100));
                         break;
+                    case KEY_NUM_8:
+                        if(mainWin.GetFullScreen() == false)
+                        {
+                            mainWin.SetFullScreen(true);
+                        }
+                        else
+                        {
+                            mainWin.SetFullScreen(false);
+                        }
+                        break;
 
                     default:
                         log.Fatal(tag, $"no test!");
index 0e5955f..e4e814a 100755 (executable)
@@ -1625,5 +1625,29 @@ namespace Tizen.NUI.Devel.Tests
 
             tlog.Debug(tag, $"WindowRequestResizeToServer END (OK)");
         }
+
+        [Test]
+        [Category("P1")]
+        [Description("Window SetFullScreen")]
+        [Property("SPEC", "Tizen.NUI.Window.SetFullScreen M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        public void SetFullScreen()
+        {
+            tlog.Debug(tag, $"SetFullScreen START");
+
+            try
+            {
+                win.SetFullScreen(true);
+                Assert.IsTrue(win.GetFullScreen());
+            }
+            catch (Exception e)
+            {
+                tlog.Debug(tag, e.Message.ToString());
+                Assert.Fail("Caught Exception : Failed!");
+            }
+
+            tlog.Debug(tag, $"SetFullScreen END (OK)");
+        }
     }
 }