[NUI] Add GetOverlayLayer in NUI window.
authorEunki, Hong <eunkiki.hong@samsung.com>
Mon, 27 Mar 2023 13:25:22 +0000 (22:25 +0900)
committerJaehyun Cho <jaehyun0cho@gmail.com>
Tue, 28 Mar 2023 07:45:27 +0000 (16:45 +0900)
This PR is FrontPort of #4922

Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
src/Tizen.NUI/src/internal/Interop/Interop.Window.cs
src/Tizen.NUI/src/public/Window/Window.cs

index 03d756b5e2853a69dba511b7417339fe46353a75..32933b3b4a65e7f72d7c89d7045f1ab588a349e1 100755 (executable)
@@ -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);
 
index a016d1488f69a782494a0b38769e5921c9bac645..0d1fea910f6c7d42e542ecf20f62126ed8150983 100755 (executable)
@@ -36,6 +36,7 @@ namespace Tizen.NUI
     {
         private HandleRef stageCPtr;
         private Layer rootLayer;
+        private Layer overlayLayer;
         private Layer borderLayer;
         private string windowTitle;
         private List<Layer> childLayers = new List<Layer>();
@@ -930,6 +931,24 @@ namespace Tizen.NUI
             return this.GetRootLayer();
         }
 
+        /// <summary>
+        /// Gets the overlay layer.
+        /// </summary>
+        /// <returns>The overlay layer.</returns>
+        [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;
+        }
+
         /// <summary>
         /// Add a child view to window.
         /// </summary>