/*
- * Copyright(c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
using System;
-using System.Runtime.InteropServices;
-using Tizen.NUI.BaseComponents;
using System.ComponentModel;
using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using Tizen.NUI.BaseComponents;
namespace Tizen.NUI
{
/// The window has an orientation and indicator properties.<br />
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public class Window : BaseHandle
+ public partial class Window : BaseHandle
{
+ private static readonly Window instance = Application.Instance?.GetWindow();
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
private global::System.Runtime.InteropServices.HandleRef stageCPtr;
- private global::System.Runtime.InteropServices.HandleRef rootLayoutCPtr;
- private global::System.IntPtr rootLayoutIntPtr;
private Layer _rootLayer;
private string _windowTitle;
-
private List<Layer> _childLayers = new List<Layer>();
- internal List<Layer> LayersChildren
- {
- get
- {
- return _childLayers;
- }
- }
+ private LayoutController localController;
- internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Window_SWIGUpcast(cPtr), cMemoryOwn)
+ internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Window.Window_SWIGUpcast(cPtr), cMemoryOwn)
{
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
- if (NDalicPINVOKE.Stage_IsInstalled())
+ if (Interop.Stage.Stage_IsInstalled())
{
- stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.Stage_GetCurrent());
- // Create a root layout (AbsoluteLayout) that is invisible to the user but enables layouts added to the Window
- // Enables layouts added to the Window to have a parent layout. As parent layout is needed to store measure spec properties.
- // Currently without these measure specs the new layout added will always be the size of the window.
- rootLayoutIntPtr = NDalicManualPINVOKE.Window_NewRootLayout();
- // Store HandleRef used by Add()
- rootLayoutCPtr = new global::System.Runtime.InteropServices.HandleRef(this, rootLayoutIntPtr);
- Layer rootLayer = GetRootLayer();
- // Add the root layout created above to the root layer.
- NDalicPINVOKE.Actor_Add( Layer.getCPtr(rootLayer), rootLayoutCPtr );
- }
- }
-
- internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj)
- {
- return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
- }
+ stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, Interop.Stage.Stage_GetCurrent());
- internal static Window GetCurrent()
- {
- Window ret = new Window(NDalicPINVOKE.Stage_GetCurrent(), true);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ localController = new LayoutController(this);
+ NUILog.Debug("layoutController id:" + localController.GetId() );
+ }
}
-
- internal static bool IsInstalled()
+
+ /// <summary>
+ /// Creates a new Window.<br />
+ /// This creates an extra window in addition to the default main window<br />
+ /// </summary>
+ /// <param name="windowPosition">The position and size of the Window.</param>
+ /// <param name="isTranslucent">Whether Window is translucent.</param>
+ /// <returns>A new Window.</returns>
+ /// <since_tizen> 6 </since_tizen>
+ public Window(Rectangle windowPosition = null , bool isTranslucent = false) : this(Interop.Window.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), "", isTranslucent), true)
{
- bool ret = NDalicPINVOKE.Stage_IsInstalled();
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
}
/// <summary>
- /// Sets whether the window accepts a focus or not.
+ /// Creates a new Window with a specific name.<br />
+ /// This creates an extra window in addition to the default main window<br />
/// </summary>
- /// <param name="accept">If a focus is accepted or not. The default is true.</param>
- /// <since_tizen> 3 </since_tizen>
- public void SetAcceptFocus(bool accept)
+ /// <param name="name">The name for extra window. </param>
+ /// <param name="windowPosition">The position and size of the Window.</param>
+ /// <param name="isTranslucent">Whether Window is translucent.</param>
+ /// <returns>A new Window.</returns>
+ /// <since_tizen> 6 </since_tizen>
+ public Window(string name, Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.Window.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTranslucent), true)
{
- NDalicPINVOKE.SetAcceptFocus(swigCPtr, accept);
+ this._windowTitle = name;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
- /// Returns whether the window accepts a focus or not.
+ /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
/// </summary>
- /// <returns>True if the window accepts a focus, false otherwise.</returns>
/// <since_tizen> 3 </since_tizen>
- public bool IsFocusAcceptable()
+ public enum WindowOrientation
{
- bool ret = NDalicPINVOKE.IsFocusAcceptable(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
- return ret;
+ /// <summary>
+ /// Portrait orientation. The height of the display area is greater than the width.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ Portrait = 0,
+ /// <summary>
+ /// Landscape orientation. A wide view area is needed.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ Landscape = 90,
+ /// <summary>
+ /// Portrait inverse orientation.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ PortraitInverse = 180,
+ /// <summary>
+ /// Landscape inverse orientation.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ LandscapeInverse = 270,
+ /// <summary>
+ /// No orientation. It is for the preferred orientation
+ /// Especially, NoOrientationPreference only has the effect for the preferred orientation.
+ /// It is used to unset the preferred orientation with SetPreferredOrientation.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ NoOrientationPreference = -1
}
/// <summary>
- /// Shows the window if it is hidden.
+ /// Enumeration for the key grab mode for platform-level APIs.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public void Show()
+ public enum KeyGrabMode
{
- NDalicPINVOKE.Show(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
+ /// <summary>
+ /// Grabs a key only when on the top of the grabbing-window stack mode.
+ /// </summary>
+ Topmost = 0,
+ /// <summary>
+ /// Grabs a key together with the other client window(s) mode.
+ /// </summary>
+ Shared,
+ /// <summary>
+ /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack with the possibility of overriding the grab by the other client window mode.
+ /// </summary>
+ OverrideExclusive,
+ /// <summary>
+ /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack mode.
+ /// </summary>
+ Exclusive
+ };
/// <summary>
- /// Hides the window if it is showing.
+ /// Enumeration for transition effect's state.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public void Hide()
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public enum EffectStates
{
- NDalicPINVOKE.Hide(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ /// <summary>
+ /// None state.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ None = 0,
+ /// <summary>
+ /// Transition effect is started.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Start,
+ /// <summary>
+ /// Transition effect is ended.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ End,
}
/// <summary>
- /// Retrieves whether the window is visible or not.
+ /// Enumeration for transition effect's type.
/// </summary>
- /// <returns>True if the window is visible.</returns>
- /// <since_tizen> 3 </since_tizen>
- public bool IsVisible()
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public enum EffectTypes
{
- bool temp = NDalicPINVOKE.IsVisible(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return temp;
+ /// <summary>
+ /// None type.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ None = 0,
+ /// <summary>
+ /// Window show effect.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Show,
+ /// <summary>
+ /// Window hide effect.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Hide,
}
/// <summary>
- /// Gets the count of supported auxiliary hints of the window.
+ /// Enumeration for opacity of the indicator.
/// </summary>
- /// <returns>The number of supported auxiliary hints.</returns>
- /// <since_tizen> 3 </since_tizen>
- public uint GetSupportedAuxiliaryHintCount()
+ internal enum IndicatorBackgroundOpacity
{
- uint ret = NDalicPINVOKE.GetSupportedAuxiliaryHintCount(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ Opaque = 100,
+ Translucent = 50,
+ Transparent = 0
}
/// <summary>
- /// Gets the supported auxiliary hint string of the window.
+ /// Enumeration for visible mode of the indicator.
/// </summary>
- /// <param name="index">The index of the supported auxiliary hint lists.</param>
- /// <returns>The auxiliary hint string of the index.</returns>
- /// <since_tizen> 3 </since_tizen>
- public string GetSupportedAuxiliaryHint(uint index)
+ internal enum IndicatorVisibleMode
{
- string ret = NDalicPINVOKE.GetSupportedAuxiliaryHint(swigCPtr, index);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ Invisible = 0,
+ Visible = 1,
+ Auto = 2
}
/// <summary>
- /// Creates an auxiliary hint of the window.
+ /// The stage instance property (read-only).<br />
+ /// Gets the current window.<br />
/// </summary>
- /// <param name="hint">The auxiliary hint string.</param>
- /// <param name="value">The value string.</param>
- /// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
/// <since_tizen> 3 </since_tizen>
- public uint AddAuxiliaryHint(string hint, string value)
+ public static Window Instance
{
- uint ret = NDalicPINVOKE.AddAuxiliaryHint(swigCPtr, hint, value);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ get
+ {
+ return instance;
+ }
}
/// <summary>
- /// Removes an auxiliary hint of the window.
+ /// Get Resource ID of window
/// </summary>
- /// <param name="id">The ID of the auxiliary hint.</param>
- /// <returns>True if no error occurred, false otherwise.</returns>
- /// <since_tizen> 3 </since_tizen>
- public bool RemoveAuxiliaryHint(uint id)
+ internal int ResourceID
{
- bool ret = NDalicPINVOKE.RemoveAuxiliaryHint(swigCPtr, id);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ get
+ {
+ int ret = Interop.Window.GetResouceID(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
}
/// <summary>
- /// Changes a value of the auxiliary hint.
+ /// Gets or sets a window type.
/// </summary>
- /// <param name="id">The auxiliary hint ID.</param>
- /// <param name="value">The value string to be set.</param>
- /// <returns>True if no error occurred, false otherwise.</returns>
/// <since_tizen> 3 </since_tizen>
- public bool SetAuxiliaryHintValue(uint id, string value)
+ public WindowType Type
{
- bool ret = NDalicPINVOKE.SetAuxiliaryHintValue(swigCPtr, id, value);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ get
+ {
+ WindowType ret = (WindowType)Interop.Window.GetType(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+ set
+ {
+ Interop.Window.SetType(swigCPtr, (int)value);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
}
/// <summary>
- /// Gets a value of the auxiliary hint.
+ /// Gets/Sets a window title.
/// </summary>
- /// <param name="id">The auxiliary hint ID.</param>
- /// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
- /// <since_tizen> 3 </since_tizen>
- public string GetAuxiliaryHintValue(uint id)
+ /// <since_tizen> 4 </since_tizen>
+ public string Title
{
- string ret = NDalicPINVOKE.GetAuxiliaryHintValue(swigCPtr, id);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ get
+ {
+ return _windowTitle;
+ }
+ set
+ {
+ _windowTitle = value;
+ SetClass(_windowTitle, "");
+ }
}
/// <summary>
- /// Gets an ID of the auxiliary hint string.
+ /// The rendering behavior of a Window.
/// </summary>
- /// <param name="hint">The auxiliary hint string.</param>
- /// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
- /// <since_tizen> 3 </since_tizen>
- public uint GetAuxiliaryHintId(string hint)
+ /// <since_tizen> 5 </since_tizen>
+ public RenderingBehaviorType RenderingBehavior
{
- uint ret = NDalicPINVOKE.GetAuxiliaryHintId(swigCPtr, hint);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ get
+ {
+ return GetRenderingBehavior();
+ }
+ set
+ {
+ SetRenderingBehavior(value);
+ }
}
/// <summary>
- /// Sets a region to accept input events.
+ /// The window size property (read-only).
/// </summary>
- /// <param name="inputRegion">The region to accept input events.</param>
/// <since_tizen> 3 </since_tizen>
- public void SetInputRegion(Rectangle inputRegion)
+ public Size2D Size
{
- NDalicPINVOKE.SetInputRegion(swigCPtr, Rectangle.getCPtr(inputRegion));
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ get
+ {
+ Size2D ret = GetSize();
+ return ret;
+ }
}
/// <summary>
- /// Gets or sets a window type.
+ /// The background color property.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public WindowType Type
+ public Color BackgroundColor
{
- get
+ set
{
- WindowType ret = (WindowType)NDalicPINVOKE.GetType(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ SetBackgroundColor(value);
}
- set
+ get
{
- NDalicPINVOKE.SetType(swigCPtr, (int)value);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ Color ret = GetBackgroundColor();
+ return ret;
}
}
/// <summary>
- /// Sets a priority level for the specified notification window.
+ /// The DPI property (read-only).<br />
+ /// Retrieves the DPI of the display device to which the Window is connected.<br />
/// </summary>
- /// <param name="level">The notification window level.</param>
- /// <returns>True if no error occurred, false otherwise.</returns>
/// <since_tizen> 3 </since_tizen>
- public bool SetNotificationLevel(NotificationLevel level)
+ public Vector2 Dpi
{
- bool ret = NDalicPINVOKE.SetNotificationLevel(swigCPtr, (int)level);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ get
+ {
+ return GetDpi();
+ }
}
/// <summary>
- /// Gets a priority level for the specified notification window.
+ /// The layer count property (read-only).<br />
+ /// Queries the number of on-Window layers.<br />
/// </summary>
- /// <returns>The notification window level.</returns>
/// <since_tizen> 3 </since_tizen>
- public NotificationLevel GetNotificationLevel()
- {
- NotificationLevel ret = (NotificationLevel)NDalicPINVOKE.GetNotificationLevel(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- /// <summary>
- /// 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)
- {
- NDalicPINVOKE.SetOpaqueState(swigCPtr, opaque);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
-
- /// <summary>
- /// 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()
+ public uint LayerCount
{
- bool ret = NDalicPINVOKE.IsOpaqueState(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ get
+ {
+ return GetLayerCount();
+ }
}
/// <summary>
- /// Sets a window's screen off mode.
+ /// Gets or sets a size of the window.
/// </summary>
- /// <param name="screenOffMode">The screen mode.</param>
- /// <returns>True if no error occurred, false otherwise.</returns>
/// <since_tizen> 4 </since_tizen>
- public bool SetScreenOffMode(ScreenOffMode screenOffMode)
+ public Size2D WindowSize
{
- bool ret = NDalicPINVOKE.SetScreenOffMode(swigCPtr, (int)screenOffMode);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ get
+ {
+ return GetWindowSize();
+ }
+ set
+ {
+ SetWindowSize(value);
+ }
}
/// <summary>
- /// Gets the screen mode of the window.
+ /// Gets or sets a position of the window.
/// </summary>
- /// <returns>The screen off mode.</returns>
/// <since_tizen> 4 </since_tizen>
- public ScreenOffMode GetScreenOffMode()
- {
- ScreenOffMode ret = (ScreenOffMode)NDalicPINVOKE.GetScreenOffMode(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- /// <summary>
- /// Sets preferred brightness of the window.
- /// </summary>
- /// <param name="brightness">The preferred brightness (0 to 100).</param>
- /// <returns>True if no error occurred, false otherwise.</returns>
- /// <since_tizen> 3 </since_tizen>
- public bool SetBrightness(int brightness)
- {
- bool ret = NDalicPINVOKE.SetBrightness(swigCPtr, brightness);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- /// <summary>
- /// Gets the preferred brightness of the window.
- /// </summary>
- /// <returns>The preferred brightness.</returns>
- /// <since_tizen> 3 </since_tizen>
- public int GetBrightness()
- {
- int ret = NDalicPINVOKE.GetBrightness(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- /// <summary>
- /// The focus changed event argument.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public class FocusChangedEventArgs : EventArgs
+ public Position2D WindowPosition
{
- /// <summary>
- /// FocusGained flag.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public bool FocusGained
+ get
+ {
+ return GetPosition();
+ }
+ set
{
- get;
- set;
+ SetPosition(value);
}
}
- private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback;
- [UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void WindowFocusChangedEventCallbackType(bool focusGained);
- private event EventHandler<FocusChangedEventArgs> _windowFocusChangedEventHandler;
-
/// <summary>
- /// FocusChanged event.
+ /// Sets position and size of the window. This API guarantees that
+ /// both moving and resizing of window will appear on the screen at once.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public event EventHandler<FocusChangedEventArgs> FocusChanged
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Rectangle WindowPositionSize
{
- add
+ get
{
- if (_windowFocusChangedEventHandler == null)
- {
- _windowFocusChangedEventCallback = OnWindowFocusedChanged;
- WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback);
- }
-
- _windowFocusChangedEventHandler += value;
+ Position2D position = GetPosition();
+ Size2D size = GetSize();
+ Rectangle ret = new Rectangle(position.X, position.Y, size.Width, size.Height);
+ return ret;
}
- remove
+ set
{
- _windowFocusChangedEventHandler -= value;
-
- if (_windowFocusChangedEventHandler == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback != null)
- {
- WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
- }
+ SetPositionSize(value);
}
}
- private void OnWindowFocusedChanged(bool focusGained)
+ internal static Vector4 DEFAULT_BACKGROUND_COLOR
{
- FocusChangedEventArgs e = new FocusChangedEventArgs();
-
- e.FocusGained = focusGained;
-
- if (_windowFocusChangedEventHandler != null)
+ get
{
- _windowFocusChangedEventHandler(this, e);
+ global::System.IntPtr cPtr = Interop.Stage.Stage_DEFAULT_BACKGROUND_COLOR_get();
+ Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
}
- /// <summary>
- /// Gets/Sets a window title.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- public string Title
+ internal static Vector4 DEBUG_BACKGROUND_COLOR
{
get
{
- return _windowTitle;
+ global::System.IntPtr cPtr = Interop.Stage.Stage_DEBUG_BACKGROUND_COLOR_get();
+ Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- set
+ }
+
+ internal List<Layer> LayersChildren
+ {
+ get
{
- _windowTitle = value;
- SetClass(_windowTitle, "");
+ return _childLayers;
}
}
/// <summary>
- /// The rendering behavior of a Window.
+ /// Get the LayoutController for this Window.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
- public RenderingBehaviorType RenderingBehavior
+ internal LayoutController LayoutController
{
get
{
- return GetRenderingBehavior();
- }
- set
- {
- SetRenderingBehavior(value);
+ return localController;
}
}
- internal WindowFocusSignalType WindowFocusChangedSignal()
+ /// <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)
{
- WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
+ Interop.Window.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
}
- internal Window(Rectangle windowPosition, string name, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true)
+ /// <summary>
+ /// Sets whether the window accepts a focus or not.
+ /// </summary>
+ /// <param name="accept">If a focus is accepted or not. The default is true.</param>
+ /// <since_tizen> 3 </since_tizen>
+ public void SetAcceptFocus(bool accept)
{
+ Interop.Window.SetAcceptFocus(swigCPtr, accept);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal Window(Rectangle windowPosition, string name) : this(NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true)
+ /// <summary>
+ /// Returns whether the window accepts a focus or not.
+ /// </summary>
+ /// <returns>True if the window accepts a focus, false otherwise.</returns>
+ /// <since_tizen> 3 </since_tizen>
+ public bool IsFocusAcceptable()
{
+ bool ret = Interop.Window.IsFocusAcceptable(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
- internal Window(Rectangle windowPosition, string name, string className, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true)
- {
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- internal Window(Rectangle windowPosition, string name, string className) : this(NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true)
+ /// <summary>
+ /// Shows the window if it is hidden.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public void Show()
{
+ Interop.Window.Show(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal void ShowIndicator(Window.IndicatorVisibleMode visibleMode)
+ /// <summary>
+ /// Hides the window if it is showing.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public void Hide()
{
- NDalicPINVOKE.Window_ShowIndicator(swigCPtr, (int)visibleMode);
+ Interop.Window.Hide(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal void SetIndicatorBackgroundOpacity(Window.IndicatorBackgroundOpacity opacity)
+ /// <summary>
+ /// Retrieves whether the window is visible or not.
+ /// </summary>
+ /// <returns>True if the window is visible.</returns>
+ /// <since_tizen> 3 </since_tizen>
+ public bool IsVisible()
{
- NDalicPINVOKE.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity);
+ bool temp = Interop.Window.IsVisible(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return temp;
}
- internal void RotateIndicator(Window.WindowOrientation orientation)
+ /// <summary>
+ /// Gets the count of supported auxiliary hints of the window.
+ /// </summary>
+ /// <returns>The number of supported auxiliary hints.</returns>
+ /// <since_tizen> 3 </since_tizen>
+ public uint GetSupportedAuxiliaryHintCount()
{
- NDalicPINVOKE.Window_RotateIndicator(swigCPtr, (int)orientation);
+ uint ret = Interop.Window.GetSupportedAuxiliaryHintCount(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
/// <summary>
- /// Sets the window name and the class string.
+ /// Gets the supported auxiliary hint string of the window.
/// </summary>
- /// <param name="name">The name of the window.</param>
- /// <param name="klass">The class of the window.</param>
- /// <since_tizen> 4 </since_tizen>
- public void SetClass(string name, string klass)
+ /// <param name="index">The index of the supported auxiliary hint lists.</param>
+ /// <returns>The auxiliary hint string of the index.</returns>
+ /// <since_tizen> 3 </since_tizen>
+ public string GetSupportedAuxiliaryHint(uint index)
{
- NDalicPINVOKE.Window_SetClass(swigCPtr, name, klass);
+ string ret = Interop.Window.GetSupportedAuxiliaryHint(swigCPtr, index);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
/// <summary>
- /// Raises the window to the top of the window stack.
+ /// Creates an auxiliary hint of the window.
/// </summary>
+ /// <param name="hint">The auxiliary hint string.</param>
+ /// <param name="value">The value string.</param>
+ /// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
/// <since_tizen> 3 </since_tizen>
- public void Raise()
+ public uint AddAuxiliaryHint(string hint, string value)
{
- NDalicPINVOKE.Window_Raise(swigCPtr);
+ uint ret = Interop.Window.AddAuxiliaryHint(swigCPtr, hint, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
/// <summary>
- /// Lowers the window to the bottom of the window stack.
+ /// Removes an auxiliary hint of the window.
/// </summary>
+ /// <param name="id">The ID of the auxiliary hint.</param>
+ /// <returns>True if no error occurred, false otherwise.</returns>
/// <since_tizen> 3 </since_tizen>
- public void Lower()
+ public bool RemoveAuxiliaryHint(uint id)
{
- NDalicPINVOKE.Window_Lower(swigCPtr);
+ bool ret = Interop.Window.RemoveAuxiliaryHint(swigCPtr, id);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
/// <summary>
- /// Activates the window to the top of the window stack even it is iconified.
+ /// Changes a value of the auxiliary hint.
/// </summary>
+ /// <param name="id">The auxiliary hint ID.</param>
+ /// <param name="value">The value string to be set.</param>
+ /// <returns>True if no error occurred, false otherwise.</returns>
/// <since_tizen> 3 </since_tizen>
- public void Activate()
+ public bool SetAuxiliaryHintValue(uint id, string value)
{
- NDalicPINVOKE.Window_Activate(swigCPtr);
+ bool ret = Interop.Window.SetAuxiliaryHintValue(swigCPtr, id, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- internal void AddAvailableOrientation(Window.WindowOrientation orientation)
+ /// <summary>
+ /// Gets a value of the auxiliary hint.
+ /// </summary>
+ /// <param name="id">The auxiliary hint ID.</param>
+ /// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
+ /// <since_tizen> 3 </since_tizen>
+ public string GetAuxiliaryHintValue(uint id)
{
- NDalicPINVOKE.Window_AddAvailableOrientation(swigCPtr, (int)orientation);
+ string ret = Interop.Window.GetAuxiliaryHintValue(swigCPtr, id);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- internal void RemoveAvailableOrientation(Window.WindowOrientation orientation)
+ /// <summary>
+ /// Gets an ID of the auxiliary hint string.
+ /// </summary>
+ /// <param name="hint">The auxiliary hint string.</param>
+ /// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
+ /// <since_tizen> 3 </since_tizen>
+ public uint GetAuxiliaryHintId(string hint)
{
- NDalicPINVOKE.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation);
+ uint ret = Interop.Window.GetAuxiliaryHintId(swigCPtr, hint);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- internal void SetPreferredOrientation(Window.WindowOrientation orientation)
+ /// <summary>
+ /// Sets a region to accept input events.
+ /// </summary>
+ /// <param name="inputRegion">The region to accept input events.</param>
+ /// <since_tizen> 3 </since_tizen>
+ public void SetInputRegion(Rectangle inputRegion)
{
- NDalicPINVOKE.Window_SetPreferredOrientation(swigCPtr, (int)orientation);
+ Interop.Window.SetInputRegion(swigCPtr, Rectangle.getCPtr(inputRegion));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal Window.WindowOrientation GetPreferredOrientation()
+ /// <summary>
+ /// Sets a priority level for the specified notification window.
+ /// </summary>
+ /// <param name="level">The notification window level.</param>
+ /// <returns>True if no error occurred, false otherwise.</returns>
+ /// <since_tizen> 3 </since_tizen>
+ public bool SetNotificationLevel(NotificationLevel level)
{
- Window.WindowOrientation ret = (Window.WindowOrientation)NDalicPINVOKE.Window_GetPreferredOrientation(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- internal DragAndDropDetector GetDragAndDropDetector()
- {
- DragAndDropDetector ret = new DragAndDropDetector(NDalicPINVOKE.Window_GetDragAndDropDetector(swigCPtr), true);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- internal Any GetNativeHandle()
- {
- Any ret = new Any(NDalicPINVOKE.Window_GetNativeHandle(swigCPtr), true);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- internal WindowFocusSignalType FocusChangedSignal()
- {
- WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
+ bool ret = Interop.Window.SetNotificationLevel(swigCPtr, (int)level);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
- /// Gets the default ( root ) layer.
+ /// Gets a priority level for the specified notification window.
/// </summary>
- /// <returns>The root layer.</returns>
+ /// <returns>The notification window level.</returns>
/// <since_tizen> 3 </since_tizen>
- public Layer GetDefaultLayer()
- {
- return this.GetRootLayer();
- }
-
- internal void Add(Layer layer)
- {
- NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
- LayersChildren.Add(layer);
- }
-
- internal void Remove(Layer layer)
+ public NotificationLevel GetNotificationLevel()
{
- NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
+ NotificationLevel ret = (NotificationLevel)Interop.Window.GetNotificationLevel(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
- LayersChildren.Remove(layer);
+ return ret;
}
/// <summary>
- /// Add a child view to window.
+ /// 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="view">the child should be added to the window.</param>
+ /// <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 Add(View view)
+ public void SetOpaqueState(bool opaque)
{
- NDalicPINVOKE.Actor_Add( rootLayoutCPtr, View.getCPtr(view) );
+ Interop.Window.SetOpaqueState(swigCPtr, opaque);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- this.GetRootLayer().AddViewToLayerList(view); // Maintain the children list in the Layer
- view.InternalParent = this.GetRootLayer();
}
/// <summary>
- /// Remove a child view from window.
+ /// Returns whether a transparent window's visual state is opaque or not.
/// </summary>
- /// <param name="view">the child to be removed.</param>
+ /// <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 void Remove(View view)
- {
- NDalicPINVOKE.Actor_Remove( rootLayoutCPtr, View.getCPtr(view) );
- this.GetRootLayer().RemoveViewFromLayerList(view); // Maintain the children list in the Layer
- view.InternalParent = null;
- }
-
- internal Vector2 GetSize()
+ public bool IsOpaqueState()
{
- Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetSize(stageCPtr), true);
+ bool ret = Interop.Window.IsOpaqueState(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- internal RenderTaskList GetRenderTaskList()
+ /// <summary>
+ /// Sets a window's screen off mode.
+ /// </summary>
+ /// <param name="screenOffMode">The screen mode.</param>
+ /// <returns>True if no error occurred, false otherwise.</returns>
+ /// <since_tizen> 4 </since_tizen>
+ public bool SetScreenOffMode(ScreenOffMode screenOffMode)
{
- RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.Stage_GetRenderTaskList(stageCPtr), true);
+ bool ret = Interop.Window.SetScreenOffMode(swigCPtr, (int)screenOffMode);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
- /// Queries the number of on-window layers.
+ /// Gets the screen mode of the window.
/// </summary>
- /// <returns>The number of layers.</returns>
- /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
- internal uint GetLayerCount()
+ /// <returns>The screen off mode.</returns>
+ /// <since_tizen> 4 </since_tizen>
+ public ScreenOffMode GetScreenOffMode()
{
- if (LayersChildren == null || LayersChildren.Count < 0)
- return 0;
-
- return (uint) LayersChildren.Count;
+ ScreenOffMode ret = (ScreenOffMode)Interop.Window.GetScreenOffMode(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
/// <summary>
- /// Retrieves the layer at a specified depth.
+ /// Sets preferred brightness of the window.
/// </summary>
- /// <param name="depth">The layer's depth index.</param>
- /// <returns>The layer found at the given depth.</returns>
+ /// <param name="brightness">The preferred brightness (0 to 100).</param>
+ /// <returns>True if no error occurred, false otherwise.</returns>
/// <since_tizen> 3 </since_tizen>
- public Layer GetLayer(uint depth)
- {
- if (depth < LayersChildren.Count)
- {
- Layer ret = LayersChildren[Convert.ToInt32(depth)];
- return ret;
- }
- else
- {
- return null;
- }
- }
-
- internal Layer GetRootLayer()
- {
- // Window.IsInstalled() is actually true only when called from event thread and
- // Core has been initialized, not when Stage is ready.
- if (_rootLayer == null && Window.IsInstalled())
- {
- _rootLayer = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- LayersChildren.Add(_rootLayer);
- }
- return _rootLayer;
- }
-
- internal void SetBackgroundColor(Vector4 color)
- {
- NDalicPINVOKE.Stage_SetBackgroundColor(stageCPtr, Vector4.getCPtr(color));
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
-
- internal Vector4 GetBackgroundColor()
- {
- Vector4 ret = new Vector4(NDalicPINVOKE.Stage_GetBackgroundColor(stageCPtr), true);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- internal Vector2 GetDpi()
- {
- Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetDpi(stageCPtr), true);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- internal ObjectRegistry GetObjectRegistry()
+ public bool SetBrightness(int brightness)
{
- ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.Stage_GetObjectRegistry(stageCPtr), true);
+ bool ret = Interop.Window.SetBrightness(swigCPtr, brightness);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
- /// Keep rendering for at least the given amount of time.
+ /// Gets the preferred brightness of the window.
/// </summary>
- /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame.</param>
+ /// <returns>The preferred brightness.</returns>
/// <since_tizen> 3 </since_tizen>
- public void KeepRendering(float durationSeconds)
- {
- NDalicPINVOKE.Stage_KeepRendering(stageCPtr, durationSeconds);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
-
- internal void SetRenderingBehavior(RenderingBehaviorType renderingBehavior)
- {
- NDalicPINVOKE.Stage_SetRenderingBehavior(stageCPtr, (int)renderingBehavior);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
-
- internal RenderingBehaviorType GetRenderingBehavior()
- {
- RenderingBehaviorType ret = (RenderingBehaviorType)NDalicPINVOKE.Stage_GetRenderingBehavior(stageCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- internal KeyEventSignal KeyEventSignal()
+ public int GetBrightness()
{
- KeyEventSignal ret = new KeyEventSignal(NDalicPINVOKE.Stage_KeyEventSignal(stageCPtr), false);
+ int ret = Interop.Window.GetBrightness(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- internal VoidSignal EventProcessingFinishedSignal()
+ /// <summary>
+ /// Sets the window name and the class string.
+ /// </summary>
+ /// <param name="name">The name of the window.</param>
+ /// <param name="klass">The class of the window.</param>
+ /// <since_tizen> 4 </since_tizen>
+ public void SetClass(string name, string klass)
{
- VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_EventProcessingFinishedSignal(stageCPtr), false);
+ Interop.Window.Window_SetClass(swigCPtr, name, klass);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
}
- internal TouchSignal TouchSignal()
+ /// <summary>
+ /// Raises the window to the top of the window stack.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public void Raise()
{
- TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(stageCPtr), false);
+ Interop.Window.Window_Raise(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- internal TouchDataSignal TouchDataSignal()
- {
- TouchDataSignal ret = new TouchDataSignal(NDalicPINVOKE.Actor_TouchSignal(Layer.getCPtr(GetRootLayer())), false);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
}
- private StageWheelSignal WheelEventSignal()
+ /// <summary>
+ /// Lowers the window to the bottom of the window stack.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public void Lower()
{
- StageWheelSignal ret = new StageWheelSignal(NDalicPINVOKE.Stage_WheelEventSignal(stageCPtr), false);
+ Interop.Window.Window_Lower(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
-
- private WheelSignal StageWheelEventSignal()
- {
- WheelSignal ret = new WheelSignal(NDalicPINVOKE.Actor_WheelEventSignal(Layer.getCPtr(this.GetRootLayer())), false);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
}
-
- internal VoidSignal ContextLostSignal()
+ /// <summary>
+ /// Activates the window to the top of the window stack even it is iconified.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public void Activate()
{
- VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextLostSignal(stageCPtr), false);
+ Interop.Window.Window_Activate(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
}
- internal VoidSignal ContextRegainedSignal()
+ /// <summary>
+ /// Gets the default ( root ) layer.
+ /// </summary>
+ /// <returns>The root layer.</returns>
+ /// <since_tizen> 3 </since_tizen>
+ public Layer GetDefaultLayer()
{
- VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextRegainedSignal(stageCPtr), false);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ return this.GetRootLayer();
}
- internal VoidSignal SceneCreatedSignal()
+ /// <summary>
+ /// Add a child view to window.
+ /// </summary>
+ /// <param name="view">the child should be added to the window.</param>
+ /// <since_tizen> 3 </since_tizen>
+ public void Add(View view)
{
- VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_SceneCreatedSignal(stageCPtr), false);
+ Interop.Actor.Actor_Add(Layer.getCPtr(GetRootLayer()), View.getCPtr(view));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ this.GetRootLayer().AddViewToLayerList(view); // Maintain the children list in the Layer
+ view.InternalParent = this.GetRootLayer();
}
- internal ResizedSignal ResizedSignal()
+ /// <summary>
+ /// Remove a child view from window.
+ /// </summary>
+ /// <param name="view">the child to be removed.</param>
+ /// <since_tizen> 3 </since_tizen>
+ public void Remove(View view)
{
- ResizedSignal ret = new ResizedSignal(NDalicManualPINVOKE.Window_ResizedSignal(swigCPtr), false);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ Interop.Actor.Actor_Remove(Layer.getCPtr(GetRootLayer()), View.getCPtr(view));
+ this.GetRootLayer().RemoveViewFromLayerList(view); // Maintain the children list in the Layer
+ view.InternalParent = null;
}
- internal static Vector4 DEFAULT_BACKGROUND_COLOR
+ /// <summary>
+ /// Retrieves the layer at a specified depth.
+ /// </summary>
+ /// <param name="depth">The layer's depth index.</param>
+ /// <returns>The layer found at the given depth.</returns>
+ /// <since_tizen> 3 </since_tizen>
+ public Layer GetLayer(uint depth)
{
- get
+ if (depth < LayersChildren?.Count)
{
- global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEFAULT_BACKGROUND_COLOR_get();
- Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ Layer ret = LayersChildren?[Convert.ToInt32(depth)];
return ret;
}
- }
-
- internal static Vector4 DEBUG_BACKGROUND_COLOR
- {
- get
+ else
{
- global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEBUG_BACKGROUND_COLOR_get();
- Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ return null;
}
}
- private static readonly Window instance = Application.Instance.GetWindow();
+ /// <summary>
+ /// Destroy the window immediately.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void Destroy()
+ {
+ this.Dispose();
+ }
/// <summary>
- /// The stage instance property (read-only).<br />
- /// Gets the current window.<br />
+ /// Keep rendering for at least the given amount of time.
/// </summary>
+ /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame.</param>
/// <since_tizen> 3 </since_tizen>
- public static Window Instance
+ public void KeepRendering(float durationSeconds)
{
- get
- {
- return instance;
- }
+ Interop.Stage.Stage_KeepRendering(stageCPtr, durationSeconds);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// <since_tizen> 3 </since_tizen>
public bool GrabKeyTopmost(int DaliKey)
{
- bool ret = NDalicManualPINVOKE.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
+ bool ret = Interop.Window.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <since_tizen> 3 </since_tizen>
public bool UngrabKeyTopmost(int DaliKey)
{
- bool ret = NDalicManualPINVOKE.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
+ bool ret = Interop.Window.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <since_tizen> 3 </since_tizen>
public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
{
- bool ret = NDalicManualPINVOKE.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode);
+ bool ret = Interop.Window.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <since_tizen> 3 </since_tizen>
public bool UngrabKey(int DaliKey)
{
- bool ret = NDalicManualPINVOKE.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
+ bool ret = Interop.Window.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <since_tizen> 5 </since_tizen>
public bool SetKeyboardRepeatInfo(float rate, float delay)
{
- bool ret = NDalicManualPINVOKE.SetKeyboardRepeatInfo(rate, delay);
+ bool ret = Interop.Window.SetKeyboardRepeatInfo(rate, delay);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <since_tizen> 5 </since_tizen>
public bool GetKeyboardRepeatInfo(out float rate, out float delay)
{
- bool ret = NDalicManualPINVOKE.GetKeyboardRepeatInfo(out rate, out delay);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- internal System.IntPtr GetNativeWindowHandler()
- {
- System.IntPtr ret = NDalicManualPINVOKE.GetNativeWindowHandler(HandleRef.ToIntPtr(this.swigCPtr));
+ bool ret = Interop.Window.GetKeyboardRepeatInfo(out rate, out delay);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
- /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
+ /// Adds a layer to the stage.
/// </summary>
+ /// <param name="layer">Layer to add.</param>
/// <since_tizen> 3 </since_tizen>
- public enum WindowOrientation
+ public void AddLayer(Layer layer)
{
- /// <summary>
- /// Portrait orientation. The height of the display area is greater than the width.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Portrait = 0,
- /// <summary>
- /// Landscape orientation. A wide view area is needed.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- Landscape = 90,
- /// <summary>
- /// Portrait inverse orientation.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- PortraitInverse = 180,
- /// <summary>
- /// Landscape inverse orientation.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- LandscapeInverse = 270
+ Interop.Window.Add(swigCPtr, Layer.getCPtr(layer));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ LayersChildren?.Add(layer);
+ layer.SetWindow(this);
}
/// <summary>
- /// Enumeration for the key grab mode for platform-level APIs.
+ /// Removes a layer from the stage.
/// </summary>
+ /// <param name="layer">Layer to remove.</param>
/// <since_tizen> 3 </since_tizen>
- public enum KeyGrabMode
+ public void RemoveLayer(Layer layer)
{
- /// <summary>
- /// Grabs a key only when on the top of the grabbing-window stack mode.
- /// </summary>
- Topmost = 0,
- /// <summary>
- /// Grabs a key together with the other client window(s) mode.
- /// </summary>
- Shared,
- /// <summary>
- /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack with the possibility of overriding the grab by the other client window mode.
- /// </summary>
- OverrideExclusive,
- /// <summary>
- /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack mode.
- /// </summary>
- Exclusive
- };
+ Interop.Window.Remove(swigCPtr, Layer.getCPtr(layer));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- /// <summary>
- /// Enumeration for opacity of the indicator.
- /// </summary>
- internal enum IndicatorBackgroundOpacity
- {
- Opaque = 100,
- Translucent = 50,
- Transparent = 0
+ LayersChildren?.Remove(layer);
+ layer.SetWindow(null);
}
/// <summary>
- /// Enumeration for visible mode of the indicator.
+ /// Feeds a key event into the window.
/// </summary>
- internal enum IndicatorVisibleMode
+ /// <param name="keyEvent">The key event to feed.</param>
+ /// <since_tizen> 5 </since_tizen>
+ public void FeedKey(Key keyEvent)
{
- Invisible = 0,
- Visible = 1,
- Auto = 2
+ Interop.Window.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
- /// The touch event argument.
+ /// Allows at least one more render, even when paused.
+ /// The window should be shown, not minimised.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public class TouchEventArgs : EventArgs
+ /// <since_tizen> 4 </since_tizen>
+ public void RenderOnce()
{
- private Touch _touch;
-
- /// <summary>
- /// Touch.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public Touch Touch
- {
- get
- {
- return _touch;
- }
- set
- {
- _touch = value;
- }
- }
+ Interop.Window.Window_RenderOnce(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
-
- private event EventHandler<TouchEventArgs> _rootLayerTouchDataEventHandler;
- [UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate bool RootLayerTouchDataCallbackType(IntPtr view, IntPtr touchData);
- private RootLayerTouchDataCallbackType _rootLayerTouchDataCallback;
/// <summary>
- /// This event is emitted when the screen is touched and when the touch ends.<br />
- /// If there are multiple touch points, then this will be emitted when the first touch occurs and
- /// then when the last finger is lifted.<br />
- /// An interrupted event will also be emitted (if it occurs).<br />
+ /// Sets whether the window is transparent or not.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public event EventHandler<TouchEventArgs> TouchEvent
- {
- add
- {
- if (_rootLayerTouchDataEventHandler == null)
- {
- _rootLayerTouchDataCallback = OnWindowTouch;
- this.TouchDataSignal().Connect(_rootLayerTouchDataCallback);
- }
- _rootLayerTouchDataEventHandler += value;
- }
- remove
- {
- _rootLayerTouchDataEventHandler -= value;
- if (_rootLayerTouchDataEventHandler == null && TouchSignal().Empty() == false)
- {
- this.TouchDataSignal().Disconnect(_rootLayerTouchDataCallback);
- }
- }
- }
-
- private bool OnWindowTouch(IntPtr view, IntPtr touchData)
+ /// <param name="transparent">Whether the window is transparent or not.</param>
+ /// <since_tizen> 5 </since_tizen>
+ public void SetTransparency(bool transparent)
{
- if (touchData == global::System.IntPtr.Zero)
- {
- NUILog.Error("touchData should not be null!");
- return false;
- }
-
- TouchEventArgs e = new TouchEventArgs();
-
- e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData);
+ Interop.Window.SetTransparency(swigCPtr, transparent);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- if (_rootLayerTouchDataEventHandler != null)
- {
- _rootLayerTouchDataEventHandler(this, e);
- }
- return false;
+ // Setting transparency of the window should request a relayout of the tree in the case the window changes from fully transparent.
}
/// <summary>
- /// Wheel event arguments.
+ /// Sets parent window of the window.
+ /// After setting that, these windows do together when raise-up, lower and iconified/deiconified.
+ /// Initially, the window is located on top of the parent. The window can go below parent by calling Lower().
+ /// If parent's window stack is changed by calling Raise() or Lower(), child windows are located on top of the parent again.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public class WheelEventArgs : EventArgs
+ /// <param name="parent">The parent window.</param>
+ /// <since_tizen> 6 </since_tizen>
+ public void SetParent(Window parent)
{
- private Wheel _wheel;
-
- /// <summary>
- /// Wheel.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public Wheel Wheel
- {
- get
- {
- return _wheel;
- }
- set
- {
- _wheel = value;
- }
- }
- }
-
- private event EventHandler<WheelEventArgs> _stageWheelHandler;
-
- [UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate bool WheelEventCallbackType(IntPtr view, IntPtr wheelEvent);
- private WheelEventCallbackType _wheelEventCallback;
-
- /// <summary>
- /// This event is emitted when the wheel event is received.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public event EventHandler<WheelEventArgs> WheelEvent
- {
- add
- {
- if (_stageWheelHandler == null)
- {
- _wheelEventCallback = OnStageWheel;
- this.StageWheelEventSignal().Connect(_wheelEventCallback);
- }
- _stageWheelHandler += value;
- }
- remove
- {
- _stageWheelHandler -= value;
- if (_stageWheelHandler == null && StageWheelEventSignal().Empty() == false)
- {
- this.StageWheelEventSignal().Disconnect(_wheelEventCallback);
- }
- }
- }
-
- private bool OnStageWheel(IntPtr rootLayer, IntPtr wheelEvent)
- {
- if (wheelEvent == global::System.IntPtr.Zero)
- {
- NUILog.Error("wheelEvent should not be null!");
- return true;
- }
-
- WheelEventArgs e = new WheelEventArgs();
-
- e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent);
-
- if (_stageWheelHandler != null)
- {
- _stageWheelHandler(this, e);
- }
- return true;
+ Interop.Window.SetParent(swigCPtr, Window.getCPtr(parent));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
- /// Key event arguments.
+ /// Unsets parent window of the window.
+ /// After unsetting, the window is disconnected his parent window.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public class KeyEventArgs : EventArgs
+ /// <since_tizen> 6 </since_tizen>
+ public void Unparent()
{
- private Key _key;
-
- /// <summary>
- /// Key.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public Key Key
- {
- get
- {
- return _key;
- }
- set
- {
- _key = value;
- }
- }
+ Interop.Window.Unparent(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- private event EventHandler<KeyEventArgs> _stageKeyHandler;
- private EventCallbackDelegateType1 _stageKeyCallbackDelegate;
-
/// <summary>
- /// This event is emitted when the key event is received.
+ /// Gets parent window of the window.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public event EventHandler<KeyEventArgs> KeyEvent
- {
- add
- {
- if (_stageKeyHandler == null)
- {
- _stageKeyCallbackDelegate = OnStageKey;
- KeyEventSignal().Connect(_stageKeyCallbackDelegate);
- }
- _stageKeyHandler += value;
- }
- remove
- {
- _stageKeyHandler -= value;
- if (_stageKeyHandler == null && KeyEventSignal().Empty() == false)
- {
- KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
- }
- }
- }
-
- // Callback for Stage KeyEventsignal
- private void OnStageKey(IntPtr data)
+ /// <returns>The parent window of the window.</returns>
+ /// <since_tizen> 6 </since_tizen>
+ public Window GetParent()
{
- KeyEventArgs e = new KeyEventArgs();
-
- if (data != null)
- {
- e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
- }
-
- if (_stageKeyHandler != null)
- {
- //here we send all data to user event handlers
- _stageKeyHandler(this, e);
- }
- }
-
-
- private event EventHandler _stageEventProcessingFinishedEventHandler;
- private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate;
-
- internal event EventHandler EventProcessingFinished
- {
- add
- {
- if (_stageEventProcessingFinishedEventHandler == null)
- {
- _stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished;
- EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate);
- }
- _stageEventProcessingFinishedEventHandler += value;
-
- }
- remove
- {
- _stageEventProcessingFinishedEventHandler -= value;
- if (_stageEventProcessingFinishedEventHandler == null && EventProcessingFinishedSignal().Empty() == false)
- {
- EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
- }
- }
+ Window ret = Registry.GetManagedBaseHandleFromNativePtr(Interop.Window.GetParent(swigCPtr)) as Window;
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- // Callback for Stage EventProcessingFinishedSignal
- private void OnEventProcessingFinished()
+ internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj)
{
- if (_stageEventProcessingFinishedEventHandler != null)
- {
- _stageEventProcessingFinishedEventHandler(this, null);
- }
+ return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
-
- private EventHandler _stageContextLostEventHandler;
- private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate;
-
- internal event EventHandler ContextLost
+ internal static Window GetCurrent()
{
- add
- {
- if (_stageContextLostEventHandler == null)
- {
- _stageContextLostEventCallbackDelegate = OnContextLost;
- ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate);
- }
- _stageContextLostEventHandler += value;
- }
- remove
- {
- _stageContextLostEventHandler -= value;
- if (_stageContextLostEventHandler == null && ContextLostSignal().Empty() == false)
- {
- ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
- }
- }
+ Window ret = new Window(Interop.Stage.Stage_GetCurrent(), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- // Callback for Stage ContextLostSignal
- private void OnContextLost()
+ internal static bool IsInstalled()
{
- if (_stageContextLostEventHandler != null)
- {
- _stageContextLostEventHandler(this, null);
- }
+ bool ret = Interop.Stage.Stage_IsInstalled();
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
-
- private EventHandler _stageContextRegainedEventHandler;
- private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate;
-
- internal event EventHandler ContextRegained
+ internal void ShowIndicator(Window.IndicatorVisibleMode visibleMode)
{
- add
- {
- if (_stageContextRegainedEventHandler == null)
- {
- _stageContextRegainedEventCallbackDelegate = OnContextRegained;
- ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate);
- }
- _stageContextRegainedEventHandler += value;
- }
- remove
- {
- _stageContextRegainedEventHandler -= value;
- if (_stageContextRegainedEventHandler == null && ContextRegainedSignal().Empty() == false)
- {
- this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
- }
- }
+ Interop.WindowInternal.Window_ShowIndicator(swigCPtr, (int)visibleMode);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- // Callback for Stage ContextRegainedSignal
- private void OnContextRegained()
+ internal void SetIndicatorBackgroundOpacity(Window.IndicatorBackgroundOpacity opacity)
{
- if (_stageContextRegainedEventHandler != null)
- {
- _stageContextRegainedEventHandler(this, null);
- }
+ Interop.WindowInternal.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
-
- private EventHandler _stageSceneCreatedEventHandler;
- private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate;
-
- internal event EventHandler SceneCreated
+ internal void RotateIndicator(Window.WindowOrientation orientation)
{
- add
- {
- if (_stageSceneCreatedEventHandler == null)
- {
- _stageSceneCreatedEventCallbackDelegate = OnSceneCreated;
- SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate);
- }
- _stageSceneCreatedEventHandler += value;
- }
- remove
- {
- _stageSceneCreatedEventHandler -= value;
- if (_stageSceneCreatedEventHandler == null && SceneCreatedSignal().Empty() == false)
- {
- SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
- }
- }
+ Interop.WindowInternal.Window_RotateIndicator(swigCPtr, (int)orientation);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- // Callback for Stage SceneCreatedSignal
- private void OnSceneCreated()
+ /// <summary>
+ /// Adds an orientation to the list of available orientations.
+ /// </summary>
+ /// <param name="orientation">The available orientation to add</param>
+ /// <since_tizen> 6 </since_tizen>
+ public void AddAvailableOrientation(Window.WindowOrientation orientation)
{
- if (_stageSceneCreatedEventHandler != null)
- {
- _stageSceneCreatedEventHandler(this, null);
- }
+ Interop.Window.Window_AddAvailableOrientation(swigCPtr, (int)orientation);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
- /// This resized event arguments.
+ /// Removes an orientation from the list of available orientations.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public class ResizedEventArgs : EventArgs
+ /// <param name="orientation">The available orientation to remove.</param>
+ /// <since_tizen> 6 </since_tizen>
+ public void RemoveAvailableOrientation(Window.WindowOrientation orientation)
{
- Size2D _windowSize;
-
- /// <summary>
- /// This window size.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- public Size2D WindowSize
- {
- get
- {
- return _windowSize;
- }
- set
- {
- _windowSize = value;
- }
- }
+ Interop.Window.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- private WindowResizedEventCallbackType _windowResizedEventCallback;
- [UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void WindowResizedEventCallbackType(IntPtr windowSize);
- private event EventHandler<ResizedEventArgs> _windowResizedEventHandler;
-
/// <summary>
- /// This event is emitted when the window resized.
+ /// Sets a preferred orientation.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public event EventHandler<ResizedEventArgs> Resized
+ /// <param name="orientation">The preferred orientation.</param>
+ /// <since_tizen> 6 </since_tizen>
+ public void SetPreferredOrientation(Window.WindowOrientation orientation)
{
- add
- {
- if (_windowResizedEventHandler == null)
- {
- _windowResizedEventCallback = OnResized;
- ResizedSignal().Connect(_windowResizedEventCallback);
- }
-
- _windowResizedEventHandler += value;
- }
- remove
- {
- _windowResizedEventHandler -= value;
-
- if (_windowResizedEventHandler == null && ResizedSignal().Empty() == false && _windowResizedEventCallback != null)
- {
- ResizedSignal().Disconnect(_windowResizedEventCallback);
- }
- }
+ Interop.Window.Window_SetPreferredOrientation(swigCPtr, (int)orientation);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- private void OnResized(IntPtr windowSize)
+ /// <summary>
+ /// Gets the preferred orientation.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// <returns>The preferred orientation if previously set, or none.</returns>
+ public Window.WindowOrientation GetPreferredOrientation()
{
- ResizedEventArgs e = new ResizedEventArgs();
- var val = new Uint16Pair(windowSize, false);
- e.WindowSize = new Size2D(val.GetWidth(), val.GetHeight());
- val.Dispose();
-
- if (_windowResizedEventHandler != null)
- {
- _windowResizedEventHandler(this, e);
- }
+ Window.WindowOrientation ret = (Window.WindowOrientation)Interop.Window.Window_GetPreferredOrientation(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- internal void SetWindowSize(Size2D size)
+ internal Any GetNativeHandle()
{
- var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
- NDalicManualPINVOKE.SetSize(swigCPtr, Uint16Pair.getCPtr(val));
-
+ Any ret = new Any(Interop.WindowInternal.Window_GetNativeHandle(swigCPtr), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- internal Size2D GetWindowSize()
+ internal void Add(Layer layer)
{
- var val = new Uint16Pair(NDalicManualPINVOKE.GetSize(swigCPtr), false);
- Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
-
+ Interop.Window.Add(swigCPtr, Layer.getCPtr(layer));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+
+ LayersChildren?.Add(layer);
+ layer.SetWindow(this);
}
- internal void SetPosition(Position2D position)
+ internal void Remove(Layer layer)
{
- var val = new Uint16Pair((uint)position.X, (uint)position.Y);
- NDalicManualPINVOKE.SetPosition(swigCPtr, Uint16Pair.getCPtr(val));
-
+ Interop.Window.Remove(swigCPtr, Layer.getCPtr(layer));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ LayersChildren?.Remove(layer);
+ layer.SetWindow(null);
}
- internal Position2D GetPosition()
+ internal Vector2 GetSize()
{
- var val = new Uint16Pair(NDalicManualPINVOKE.GetPosition(swigCPtr), true);
- Position2D ret = new Position2D(val.GetX(), val.GetY());
-
+ var val = new Uint16Pair(Interop.Window.GetSize(swigCPtr), false);
+ Vector2 ret = new Vector2(val.GetWidth(), val.GetHeight());
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- /// <summary>
- /// Sets whether the window is transparent or not.
- /// </summary>
- /// <param name="transparent">Whether the window is transparent or not.</param>
- /// <since_tizen> 5 </since_tizen>
- public void SetTransparency(bool transparent) {
- NDalicManualPINVOKE.SetTransparency(swigCPtr, transparent);
+ internal RenderTaskList GetRenderTaskList()
+ {
+ RenderTaskList ret = new RenderTaskList(Interop.Stage.Stage_GetRenderTaskList(stageCPtr), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
/// <summary>
- /// The window size property (read-only).
+ /// Queries the number of on-window layers.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public Size2D Size
+ /// <returns>The number of layers.</returns>
+ /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
+ internal uint GetLayerCount()
{
- get
- {
- Size2D ret = GetSize();
- return ret;
- }
+ if (LayersChildren == null || LayersChildren.Count < 0)
+ return 0;
+
+ return (uint) LayersChildren.Count;
}
- /// <summary>
- /// The background color property.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public Color BackgroundColor
+ internal Layer GetRootLayer()
{
- set
- {
- SetBackgroundColor(value);
- }
- get
+ // Window.IsInstalled() is actually true only when called from event thread and
+ // Core has been initialized, not when Stage is ready.
+ if (_rootLayer == null && Window.IsInstalled())
{
- Color ret = GetBackgroundColor();
- return ret;
+ _rootLayer = new Layer(Interop.Window.GetRootLayer(swigCPtr), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ LayersChildren?.Add(_rootLayer);
+ _rootLayer.SetWindow(this);
}
+ return _rootLayer;
}
- /// <summary>
- /// The DPI property (read-only).<br />
- /// Retrieves the DPI of the display device to which the Window is connected.<br />
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public Vector2 Dpi
+ internal void SetBackgroundColor(Vector4 color)
{
- get
- {
- return GetDpi();
- }
+ Interop.Window.SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- /// <summary>
- /// The layer count property (read-only).<br />
- /// Queries the number of on-Window layers.<br />
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public uint LayerCount
+ internal Vector4 GetBackgroundColor()
{
- get
- {
- return GetLayerCount();
- }
+ Vector4 ret = new Vector4(Interop.Window.GetBackgroundColor(swigCPtr), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
-
- /// <summary>
- /// Adds a layer to the stage.
- /// </summary>
- /// <param name="layer">Layer to add.</param>
- /// <since_tizen> 3 </since_tizen>
- public void AddLayer(Layer layer)
+ internal Vector2 GetDpi()
{
- NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
+ Vector2 ret = new Vector2(Interop.Stage.Stage_GetDpi(stageCPtr), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
- LayersChildren.Add(layer);
+ return ret;
}
- /// <summary>
- /// Removes a layer from the stage.
- /// </summary>
- /// <param name="layer">Layer to remove.</param>
- /// <since_tizen> 3 </since_tizen>
- public void RemoveLayer(Layer layer)
+ internal ObjectRegistry GetObjectRegistry()
{
- NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
+ ObjectRegistry ret = new ObjectRegistry(Interop.Stage.Stage_GetObjectRegistry(stageCPtr), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
- LayersChildren.Remove(layer);
+ return ret;
}
- /// <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
+ internal void SetRenderingBehavior(RenderingBehaviorType renderingBehavior)
{
- /// <summary>
- /// Please do not use! this will be deprecated
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public bool FocusGained
- {
- get;
- set;
- }
+ Interop.Stage.Stage_SetRenderingBehavior(stageCPtr, (int)renderingBehavior);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback2;
- [UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void WindowFocusChangedEventCallbackType2(bool focusGained);
- private event EventHandler<WindowFocusChangedEventArgs> _windowFocusChangedEventHandler2;
-
- /// <summary>
- /// Please do not use! this will be deprecated. Please use 'FocusChanged' event instead.
- /// </summary>
- /// <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! 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
+ internal RenderingBehaviorType GetRenderingBehavior()
{
- add
- {
- if (_windowFocusChangedEventHandler2 == null)
- {
- _windowFocusChangedEventCallback2 = OnWindowFocusedChanged2;
- WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback2);
- }
-
- _windowFocusChangedEventHandler2 += value;
- }
- remove
- {
- _windowFocusChangedEventHandler2 -= value;
-
- if (_windowFocusChangedEventHandler2 == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback2 != null)
- {
- WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2);
- }
- }
+ RenderingBehaviorType ret = (RenderingBehaviorType)Interop.Stage.Stage_GetRenderingBehavior(stageCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- private void OnWindowFocusedChanged2(bool focusGained)
+ internal void SetWindowSize(Size2D size)
{
- WindowFocusChangedEventArgs e = new WindowFocusChangedEventArgs();
+ var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
+ Interop.Window.SetSize(swigCPtr, Uint16Pair.getCPtr(val));
- e.FocusGained = focusGained;
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- if (_windowFocusChangedEventHandler2 != null)
- {
- _windowFocusChangedEventHandler2(this, e);
- }
+ // Resetting Window size should request a relayout of the tree.
}
- /// <summary>
- /// Gets or sets a size of the window.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- public Size2D WindowSize
+ internal Size2D GetWindowSize()
{
- get
- {
- return GetWindowSize();
- }
- set
- {
- SetWindowSize(value);
- }
- }
+ var val = new Uint16Pair(Interop.Window.GetSize(swigCPtr), false);
+ Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
- /// <summary>
- /// Gets or sets a position of the window.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- public Position2D WindowPosition
- {
- get
- {
- return GetPosition();
- }
- set
- {
- SetPosition(value);
- }
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- /// <summary>
- /// Feeds a key event into the window.
- /// </summary>
- /// <param name="keyEvent">The key event to feed.</param>
- /// <since_tizen> 5 </since_tizen>
- public void FeedKey(Key keyEvent)
+ internal void SetPosition(Position2D position)
{
- NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
+ var val = new Uint16Pair((uint)position.X, (uint)position.Y);
+ Interop.Window.SetPosition(swigCPtr, Uint16Pair.getCPtr(val));
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ // Setting Position of the window should request a relayout of the tree.
}
- /// <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)
+ internal Position2D GetPosition()
{
- NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
+ var val = new Uint16Pair(Interop.Window.GetPosition(swigCPtr), true);
+ Position2D ret = new Position2D(val.GetX(), val.GetY());
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- /// <summary>
- /// Allows at least one more render, even when paused.
- /// The window should be shown, not minimised.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- public void RenderOnce()
+ internal void SetPositionSize(Rectangle positionSize)
{
- NDalicManualPINVOKE.Window_RenderOnce(swigCPtr);
+ Interop.Window.Window_SetPositionSize(swigCPtr, Rectangle.getCPtr(positionSize));
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ // Setting Position of the window should request a relayout of the tree.
}
/// <summary>
- /// Contains and encapsulates Native Window handle.
+ /// Dispose for Window
/// </summary>
- /// <since_tizen> 4 </since_tizen>
- public class SafeNativeWindowHandle : SafeHandle
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override void Dispose(DisposeTypes type)
{
- /// <summary>
- /// Contructor, Native window handle is set to handle.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- public SafeNativeWindowHandle() : base(IntPtr.Zero, false)
+ if (disposed)
{
- SetHandle(Tizen.NUI.Window.Instance.GetNativeWindowHandler());
+ return;
}
- /// <summary>
- /// Null check if the handle is valid or not.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- public override bool IsInvalid
+
+ if (type == DisposeTypes.Explicit)
{
- get
+ //Called by User
+ //Release your own managed resources here.
+ //You should release all of your own disposable objects here.
+
+ _rootLayer.Dispose();
+ localController.Dispose();
+
+ foreach(var layer in _childLayers)
{
- return this.handle == IntPtr.Zero;
+ layer.Dispose();
}
+ _childLayers.Clear();
}
- /// <summary>
- /// Release handle itself.
- /// </summary>
- /// <returns>true when released successfully.</returns>
- /// <since_tizen> 4 </since_tizen>
- protected override bool ReleaseHandle()
+
+ this.DisconnectNativeSignals();
+
+ //Release your own unmanaged resources here.
+ //You should not access any managed member here except static instance.
+ //because the execution order of Finalizes is non-deterministic.
+
+ if (swigCPtr.Handle != global::System.IntPtr.Zero)
{
- return true;
+ if (swigCMemOwn)
+ {
+ swigCMemOwn = false;
+ Interop.Window.delete_Window(swigCPtr);
+ }
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
- }
+ base.Dispose(type);
+ }
}
}