From: huiyu,eun Date: Thu, 2 Nov 2017 04:16:35 +0000 (+0900) Subject: [NUI] Add layer children of window X-Git-Tag: 5.0.0-preview1-00362~3^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F93%2F158593%2F1;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Add layer children of window manage child layers. Change-Id: If85721af4db815df6022a470ac66fd87a56ffab8 Signed-off-by: huiyu,eun --- 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); } ///