From fd39068f561b2c7ad92e4d14febcfb50ad0569ce Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Mon, 27 Mar 2023 22:25:22 +0900 Subject: [PATCH] [NUI] Add GetOverlayLayer in NUI window. This PR is FrontPort of #4922 Signed-off-by: Eunki, Hong --- src/Tizen.NUI/src/internal/Interop/Interop.Window.cs | 3 +++ src/Tizen.NUI/src/public/Window/Window.cs | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs index 03d756b..32933b3 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs @@ -209,6 +209,9 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_GetRootLayer")] public static extern global::System.IntPtr GetRootLayer(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_GetOverlayLayer")] + public static extern global::System.IntPtr GetOverlayLayer(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_KeyEventSignal")] public static extern global::System.IntPtr KeyEventSignal(global::System.Runtime.InteropServices.HandleRef jarg1); diff --git a/src/Tizen.NUI/src/public/Window/Window.cs b/src/Tizen.NUI/src/public/Window/Window.cs index a016d14..0d1fea9 100755 --- a/src/Tizen.NUI/src/public/Window/Window.cs +++ b/src/Tizen.NUI/src/public/Window/Window.cs @@ -36,6 +36,7 @@ namespace Tizen.NUI { private HandleRef stageCPtr; private Layer rootLayer; + private Layer overlayLayer; private Layer borderLayer; private string windowTitle; private List childLayers = new List(); @@ -931,6 +932,24 @@ namespace Tizen.NUI } /// + /// Gets the overlay layer. + /// + /// The overlay layer. + [EditorBrowsable(EditorBrowsableState.Never)] + public Layer GetOverlayLayer() + { + // Window.IsInstalled() is actually true only when called from event thread and + // Core has been initialized, not when Stage is ready. + if (overlayLayer == null && Window.IsInstalled()) + { + overlayLayer = new Layer(Interop.Window.GetOverlayLayer(SwigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + overlayLayer.SetWindow(this); + } + return overlayLayer; + } + + /// /// Add a child view to window. /// /// the child should be added to the window. -- 2.7.4