From: Wonsik Jung Date: Tue, 24 Oct 2023 07:22:16 +0000 (+0900) Subject: [NUI] Supports to set/get full screen sized window X-Git-Tag: accepted/tizen/unified/20231205.024657~71 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ec95af606d3c791af5ac8b2fdb3c16e245e3883f;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Supports to set/get full screen sized window 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. --- diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs index 5cf427c..84427a9 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs @@ -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); } } } diff --git a/src/Tizen.NUI/src/public/Window/Window.cs b/src/Tizen.NUI/src/public/Window/Window.cs index 3779dfe..6df4dd1 100755 --- a/src/Tizen.NUI/src/public/Window/Window.cs +++ b/src/Tizen.NUI/src/public/Window/Window.cs @@ -2424,6 +2424,32 @@ namespace Tizen.NUI } /// + /// 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. + /// + /// If fullscreen is true, set fullscreen or unset. + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetFullScreen(bool fullscreen) + { + Interop.Window.SetFullScreen(SwigCPtr, fullscreen); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets whether the full screen sized window or not. + /// + /// Returns true if the full screen sized window is. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool GetFullScreen() + { + bool ret = Interop.Window.GetFullScreen(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// /// Get Native Window handle. /// /// How to get Native Window handle diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/WindowTest.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/WindowTest.cs index f3fe59b..583bc7d 100644 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/WindowTest.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/WindowTest.cs @@ -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!"); diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Window/TSWindow.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Window/TSWindow.cs index 0e5955f..e4e814a 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Window/TSWindow.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Window/TSWindow.cs @@ -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)"); + } } }