using System.Runtime.InteropServices;
using Tizen.NUI.BaseComponents;
using System.ComponentModel;
+using System.Collections.Generic;
namespace Tizen.NUI
{
private Layer _rootLayer;
private string _windowTitle;
+ private List<Layer> _childLayers = new List<Layer>();
+ internal List<Layer> 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);
/// Dispose() method in Singletone classes (ex: FocusManager, StyleManager, VisualFactory, IMFManager, TtsPlayer, Window) is not required.
/// Because it is Sigletone, so it is alive for one thread until the NUI is terminated, so it never be disposed.
/// <since_tizen> 3 </since_tizen>
+ [Obsolete("Please do not use! This will be deprecated!")]
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void Dispose(DisposeTypes type)
{
}
/// <summary>
- /// Sets a transparent window's visual state to opaque.
+ /// Sets a transparent window's visual state to opaque. <br />
+ /// If a visual state of a transparent window is opaque, <br />
+ /// then the window manager could handle it as an opaque window when calculating visibility.
/// </summary>
/// <param name="opaque">Whether the window's visual state is opaque.</param>
+ /// <remarks>This will have no effect on an opaque window. <br />
+ /// It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window.
+ /// </remarks>
/// <since_tizen> 3 </since_tizen>
public void SetOpaqueState(bool opaque)
{
/// Returns whether a transparent window's visual state is opaque or not.
/// </summary>
/// <returns>True if the window's visual state is opaque, false otherwise.</returns>
+ /// <remarks> The return value has no meaning on an opaque window. </remarks>
/// <since_tizen> 3 </since_tizen>
public bool IsOpaqueState()
{
{
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);
}
/// <summary>
/// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
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;
}
/// <summary>
/// <since_tizen> 3 </since_tizen>
public Layer GetLayer(uint depth)
{
- IntPtr cPtr = NDalicPINVOKE.Stage_GetLayer(stageCPtr, depth);
- Layer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Layer;
-
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ if (depth < LayersChildren.Count)
+ {
+ Layer ret = LayersChildren[Convert.ToInt32(depth)];
+ return ret;
+ }
+ else
+ {
+ return null;
+ }
}
internal Layer GetRootLayer()
{
_rootLayer = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ LayersChildren.Add(_rootLayer);
}
return _rootLayer;
}
/// <since_tizen> 5 </since_tizen>
/// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public void SetTransparency(bool transparent) {
+ public void SetTransparency(bool transparent)
+ {
NDalicManualPINVOKE.SetTransparency(swigCPtr, transparent);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
{
NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ LayersChildren.Add(layer);
}
/// <summary>
{
NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ LayersChildren.Remove(layer);
}
/// <summary>
/// Please do not use! this will be deprecated
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ [Obsolete("Please do not use! This will be deprecated! Please use FocusChangedEventArgs instead! " +
+ "Like: " +
+ "Window.Instance.FocusChanged = OnFocusChanged; " +
+ "private void OnFocusChanged(object source, Window.FocusChangedEventArgs args) {...}")]
[EditorBrowsable(EditorBrowsableState.Never)]
public class WindowFocusChangedEventArgs : EventArgs
{
/// <since_tizen> 3 </since_tizen>
/// Please do not use! this will be deprecated!
/// Instead please use FocusChanged.
- [Obsolete("Please do not use! this will be deprecated, instead please use FocusChanged")]
+ [Obsolete("Please do not use! This will be deprecated! Please use FocusChanged instead! " +
+ "Like: " +
+ "Window.Instance.FocusChanged = OnFocusChanged; " +
+ "private void OnFocusChanged(object source, Window.FocusChangedEventArgs args) {...}")]
[EditorBrowsable(EditorBrowsableState.Never)]
public event EventHandler<WindowFocusChangedEventArgs> WindowFocusChanged
{
/// <summary>
/// Feed a key-event into the window.
/// </summary>
+ /// <param name="keyEvent">The key event to feed.</param>
+ /// <since_tizen> 5 </since_tizen>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void FeedKey(Key keyEvent)
+ {
+ NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Feed a key-event into the window.
+ /// </summary>
+ /// <param name="keyEvent">The key event to feed.</param>
/// <since_tizen> 4 </since_tizen>
+ [Obsolete("Please do not use! This will be deprecated! Please use FeedKey(Key keyEvent) instead!")]
public static void FeedKeyEvent(Key keyEvent)
{
NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent));