From a01892bc92e4eaed8cad3c4fdc5965740ed40b65 Mon Sep 17 00:00:00 2001 From: "huiyu,eun" Date: Thu, 2 Nov 2017 13:16:35 +0900 Subject: [PATCH] [NUI] Add layer children of window manage child layers. Change-Id: If85721af4db815df6022a470ac66fd87a56ffab8 Signed-off-by: huiyu,eun --- src/Tizen.NUI/src/public/Window.cs | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/Tizen.NUI/src/public/Window.cs b/src/Tizen.NUI/src/public/Window.cs index 5306c67..de11d8d 100644 --- a/src/Tizen.NUI/src/public/Window.cs +++ b/src/Tizen.NUI/src/public/Window.cs @@ -18,6 +18,7 @@ using System; using System.Runtime.InteropServices; using Tizen.NUI.BaseComponents; using System.ComponentModel; +using System.Collections.Generic; namespace Tizen.NUI { @@ -33,6 +34,15 @@ namespace Tizen.NUI private Layer _rootLayer; private string _windowTitle; + private List _childLayers = new List(); + private List LayersChildren + { + get + { + return _childLayers; + } + } + internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Window_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); @@ -652,12 +662,16 @@ namespace Tizen.NUI { NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + LayersChildren.Add(layer); } internal void Remove(Layer layer) { NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + LayersChildren.Remove(layer); } /// @@ -701,9 +715,10 @@ namespace Tizen.NUI /// Note that a default layer is always provided (count >= 1). internal uint GetLayerCount() { - uint ret = NDalicPINVOKE.Stage_GetLayerCount(stageCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + if (LayersChildren == null || LayersChildren.Count < 0) + return 0; + + return (uint) LayersChildren.Count; } /// @@ -729,6 +744,7 @@ namespace Tizen.NUI { _rootLayer = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + LayersChildren.Add(_rootLayer); } return _rootLayer; } @@ -1523,6 +1539,8 @@ namespace Tizen.NUI { NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + LayersChildren.Add(layer); } /// @@ -1534,6 +1552,8 @@ namespace Tizen.NUI { NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + LayersChildren.Remove(layer); } /// -- 2.7.4