/// <summary>
/// View is the base class for all views.
/// </summary>
- public class View : Animatable //CustomActor => Animatable
+ public class View : Container
{
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
internal View(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.View_SWIGUpcast(cPtr), cMemoryOwn)
{
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
-
- // Register this instance of view in the view registry.
- ViewRegistry.RegisterView(this);
+ PositionUsesPivotPoint = false;
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj)
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
- //you can override it to clean-up your own resources.
+ // From Container Base class
+
+ /// <summary>
+ /// Adds a child view to this View.
+ /// </summary>
+ /// <seealso cref="Container::Add()">
+ /// </seealso>
+ public override void Add(View child)
+ {
+ NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child));
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Removes a child View from this View. If the view was not a child of this view, this is a no-op.
+ /// </summary>
+ /// <seealso cref="Container::Remove()">
+ /// </seealso>
+ public override void Remove(View child)
+ {
+ NDalicPINVOKE.Actor_Remove(swigCPtr, View.getCPtr(child));
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Retrieves child view by index.
+ /// </summary>
+ /// <seealso cref="Container::GetChildAt()">
+ /// </seealso>
+ public override View GetChildAt(uint index)
+ {
+ IntPtr cPtr = NDalicPINVOKE.Actor_GetChildAt(swigCPtr, index);
+
+ View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
+
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret ?? null;
+ }
+
+ /// <summary>
+ /// Retrieves the number of children held by the view.
+ /// </summary>
+ /// <seealso cref="Container::GetChildCount()">
+ /// </seealso>
+ protected override uint GetChildCount()
+ {
+ uint ret = NDalicPINVOKE.Actor_GetChildCount(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Get the Views parent
+ /// </summary>
+ /// <seealso cref="Container::GetParent()">
+
+ protected override Container GetParent()
+ {
+ Container ret;
+ IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr);
+
+ BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr);
+
+ if(basehandle is Layer)
+ {
+ ret = basehandle as Layer;
+ }
+ else
+ {
+ ret = basehandle as View;
+ }
+
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ ///
+
+ // you can override it to clean-up your own resources.
protected override void Dispose(DisposeTypes type)
{
if(disposed)
//You should not access any managed member here except static instance.
//because the execution order of Finalizes is non-deterministic.
- //Unreference this from if a static instance refer to this.
- ViewRegistry.UnregisterView(this);
+ if (_onRelayoutEventCallback != null)
+ {
+ this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback);
+ }
+
+ if (_offWindowEventCallback != null)
+ {
+ this.OffWindowSignal().Disconnect(_offWindowEventCallback);
+ }
+
+ if (_onWindowEventCallback != null)
+ {
+ this.OnWindowSignal().Disconnect(_onWindowEventCallback);
+ }
+
+ if (_wheelEventCallback != null)
+ {
+ this.WheelEventSignal().Disconnect(_wheelEventCallback);
+ }
+
+ if (_hoverEventCallback != null)
+ {
+ this.HoveredSignal().Disconnect(_hoverEventCallback);
+ }
+
+ if (_touchDataCallback != null)
+ {
+ this.TouchSignal().Disconnect(_touchDataCallback);
+ }
+
+ if (_ResourcesLoadedCallback != null)
+ {
+ this.ResourcesLoadedSignal().Disconnect(_ResourcesLoadedCallback);
+ }
+
+ if (_offWindowEventCallback != null)
+ {
+ this.OffWindowSignal().Disconnect(_offWindowEventCallback);
+ }
+
+ if (_onWindowEventCallback != null)
+ {
+ this.OnWindowSignal().Disconnect(_onWindowEventCallback);
+ }
+
+ if (_wheelEventCallback != null)
+ {
+ this.WheelEventSignal().Disconnect(_wheelEventCallback);
+ }
+
+ if (_hoverEventCallback != null)
+ {
+ this.HoveredSignal().Disconnect(_hoverEventCallback);
+ }
+
+ if (_touchDataCallback != null)
+ {
+ this.TouchSignal().Disconnect(_touchDataCallback);
+ }
+
+ if (_onRelayoutEventCallback != null)
+ {
+ this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback);
+ }
+
+ if (_keyCallback != null)
+ {
+ this.KeyEventSignal().Disconnect(_keyCallback);
+ }
+
+ if (_keyInputFocusLostCallback != null)
+ {
+ this.KeyInputFocusLostSignal().Disconnect(_keyInputFocusLostCallback);
+ }
+
+ if (_keyInputFocusGainedCallback != null)
+ {
+ this.KeyInputFocusGainedSignal().Disconnect(_keyInputFocusGainedCallback);
+ }
if (swigCPtr.Handle != global::System.IntPtr.Zero)
{
{
KeyEventArgs e = new KeyEventArgs();
+ bool result = false;
+
e.Key = Tizen.NUI.Key.GetKeyFromPtr(keyEvent);
if (_keyEventHandler != null)
{
- return _keyEventHandler(this, e);
+ Delegate[] delegateList = _keyEventHandler.GetInvocationList();
+
+ // Oring the result of each callback.
+ foreach ( EventHandlerWithReturnType<object, KeyEventArgs, bool> del in delegateList )
+ {
+ result |= del( this, e );
+ }
}
- return false;
- }
+ return result;
+ }
private EventHandler _onRelayoutEventHandler;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
/// Event for OnRelayout signal which can be used to subscribe/unsubscribe the event handler.<br>
/// OnRelayout signal is emitted after the size has been set on the view during relayout.<br>
/// </summary>
- public event EventHandler OnRelayoutEvent
+ public event EventHandler Relayout
{
add
{
/// Event for Touched signal which can be used to subscribe/unsubscribe the event handler provided by the user.<br>
/// Touched signal is emitted when touch input is received.<br>
/// </summary>
- public event EventHandlerWithReturnType<object, TouchEventArgs, bool> Touched
+ public event EventHandlerWithReturnType<object, TouchEventArgs, bool> TouchEvent
{
add
{
/// Event for Hovered signal which can be used to subscribe/unsubscribe the event handler provided by the user.<br>
/// Hovered signal is emitted when hover input is received.<br>
/// </summary>
- public event EventHandlerWithReturnType<object, HoverEventArgs, bool> Hovered
+ public event EventHandlerWithReturnType<object, HoverEventArgs, bool> HoverEvent
{
add
{
/// Event for WheelMoved signal which can be used to subscribe/unsubscribe the event handler provided by the user.<br>
/// WheelMoved signal is emitted when wheel event is received.<br>
/// </summary>
- public event EventHandlerWithReturnType<object, WheelEventArgs, bool> WheelMoved
+ public event EventHandlerWithReturnType<object, WheelEventArgs, bool> WheelEvent
{
add
{
/// Event for OnWindow signal which can be used to subscribe/unsubscribe the event handler.<br>
/// OnWindow signal is emitted after the view has been connected to the Window.<br>
/// </summary>
- public event EventHandler OnWindowEvent
+ public event EventHandler AddedToWindow
{
add
{
/// Event for OffWindow signal which can be used to subscribe/unsubscribe the event handler.<br>
/// OffWindow signal is emitted after the view has been disconnected from the Window.<br>
/// </summary>
- public event EventHandler OffWindowEvent
+ public event EventHandler RemovedFromWindow
{
add
{
VisibilityChangedEventArgs e = new VisibilityChangedEventArgs();
if (data != null)
{
- e.View = View.GetViewFromPtr(data);
+ e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View;
}
e.Visibility = visibility;
e.Type = type;
}
}
- internal static View GetViewFromPtr(global::System.IntPtr cPtr)
- {
- View ret = new View(cPtr, false);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
+ // Resource Ready Signal
- internal IntPtr GetPtrfromView()
- {
- return (IntPtr)swigCPtr;
- }
+ private EventHandler _resourcesLoadedEventHandler;
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ private delegate void ResourcesLoadedCallbackType(IntPtr control);
+ private ResourcesLoadedCallbackType _ResourcesLoadedCallback;
- internal class Property : global::System.IDisposable
+ /// <summary>
+ /// Event for ResourcesLoadedSignal signal which can be used to subscribe/unsubscribe the event handler provided by the user.<br>
+ /// This signal is emitted after all resources required by a View are loaded and ready.<br>
+ /// </summary>
+ public event EventHandler ResourcesLoaded
{
- private global::System.Runtime.InteropServices.HandleRef swigCPtr;
- protected bool swigCMemOwn;
-
- internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
- {
- swigCMemOwn = cMemoryOwn;
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
- }
-
- internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
- {
- return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
- }
-
- //A Flag to check who called Dispose(). (By User or DisposeQueue)
- private bool isDisposeQueued = false;
- //A Flat to check if it is already disposed.
- protected bool disposed = false;
-
- ~Property()
+ add
{
- if (!isDisposeQueued)
+ if (_resourcesLoadedEventHandler == null)
{
- isDisposeQueued = true;
- DisposeQueue.Instance.Add(this);
+ _ResourcesLoadedCallback = OnResourcesLoaded;
+ this.ResourcesLoadedSignal().Connect(_ResourcesLoadedCallback);
}
+
+ _resourcesLoadedEventHandler += value;
}
- public void Dispose()
+ remove
{
- //Throw excpetion if Dispose() is called in separate thread.
- if (!Window.IsInstalled())
- {
- throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
- }
+ _resourcesLoadedEventHandler -= value;
- if (isDisposeQueued)
- {
- Dispose(DisposeTypes.Implicit);
- }
- else
+ if (_resourcesLoadedEventHandler == null && ResourcesLoadedSignal().Empty() == false)
{
- Dispose(DisposeTypes.Explicit);
- System.GC.SuppressFinalize(this);
+ this.ResourcesLoadedSignal().Disconnect(_ResourcesLoadedCallback);
}
}
+ }
- protected virtual void Dispose(DisposeTypes type)
+ private void OnResourcesLoaded(IntPtr view)
+ {
+ if (_resourcesLoadedEventHandler != null)
{
- if (disposed)
- {
- return;
- }
-
- if (type == DisposeTypes.Explicit)
- {
- //Called by User
- //Release your own managed resources here.
- //You should release all of your own disposable objects here.
-
- }
-
- //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)
- {
- if (swigCMemOwn)
- {
- swigCMemOwn = false;
- NDalicPINVOKE.delete_View_Property(swigCPtr);
- }
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
- }
-
- disposed = true;
+ _resourcesLoadedEventHandler(this, null);
}
+ }
+ internal IntPtr GetPtrfromView()
+ {
+ return (IntPtr)swigCPtr;
+ }
+
+ internal class Property
+ {
internal static readonly int TOOLTIP = NDalicManualPINVOKE.View_Property_TOOLTIP_get();
internal static readonly int STATE = NDalicManualPINVOKE.View_Property_STATE_get();
internal static readonly int SUB_STATE = NDalicManualPINVOKE.View_Property_SUB_STATE_get();
internal static readonly int RIGHT_FOCUSABLE_VIEW_ID = NDalicManualPINVOKE.View_Property_RIGHT_FOCUSABLE_ACTOR_ID_get();
internal static readonly int UP_FOCUSABLE_VIEW_ID = NDalicManualPINVOKE.View_Property_UP_FOCUSABLE_ACTOR_ID_get();
internal static readonly int DOWN_FOCUSABLE_VIEW_ID = NDalicManualPINVOKE.View_Property_DOWN_FOCUSABLE_ACTOR_ID_get();
-
- internal Property() : this(NDalicPINVOKE.new_View_Property(), true)
- {
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
-
internal static readonly int STYLE_NAME = NDalicPINVOKE.View_Property_STYLE_NAME_get();
- internal static readonly int BACKGROUND_COLOR = NDalicPINVOKE.View_Property_BACKGROUND_COLOR_get();
- internal static readonly int BACKGROUND_IMAGE = NDalicPINVOKE.View_Property_BACKGROUND_IMAGE_get();
- internal static readonly int KEY_INPUT_FOCUS = NDalicPINVOKE.View_Property_KEY_INPUT_FOCUS_get();
internal static readonly int BACKGROUND = NDalicPINVOKE.View_Property_BACKGROUND_get();
internal static readonly int SIBLING_ORDER = NDalicManualPINVOKE.Actor_Property_SIBLING_ORDER_get();
internal static readonly int OPACITY = NDalicManualPINVOKE.Actor_Property_OPACITY_get();
internal static readonly int SCALE_Z = NDalicPINVOKE.Actor_Property_SCALE_Z_get();
internal static readonly int WORLD_SCALE = NDalicPINVOKE.Actor_Property_WORLD_SCALE_get();
internal static readonly int VISIBLE = NDalicPINVOKE.Actor_Property_VISIBLE_get();
- internal static readonly int COLOR = NDalicPINVOKE.Actor_Property_COLOR_get();
- internal static readonly int COLOR_RED = NDalicPINVOKE.Actor_Property_COLOR_RED_get();
- internal static readonly int COLOR_GREEN = NDalicPINVOKE.Actor_Property_COLOR_GREEN_get();
- internal static readonly int COLOR_BLUE = NDalicPINVOKE.Actor_Property_COLOR_BLUE_get();
- internal static readonly int COLOR_ALPHA = NDalicPINVOKE.Actor_Property_COLOR_ALPHA_get();
internal static readonly int WORLD_COLOR = NDalicPINVOKE.Actor_Property_WORLD_COLOR_get();
internal static readonly int WORLD_MATRIX = NDalicPINVOKE.Actor_Property_WORLD_MATRIX_get();
internal static readonly int NAME = NDalicPINVOKE.Actor_Property_NAME_get();
internal static readonly int LEAVE_REQUIRED = NDalicPINVOKE.Actor_Property_LEAVE_REQUIRED_get();
internal static readonly int INHERIT_ORIENTATION = NDalicPINVOKE.Actor_Property_INHERIT_ORIENTATION_get();
internal static readonly int INHERIT_SCALE = NDalicPINVOKE.Actor_Property_INHERIT_SCALE_get();
- internal static readonly int COLOR_MODE = NDalicPINVOKE.Actor_Property_COLOR_MODE_get();
- internal static readonly int POSITION_INHERITANCE = NDalicPINVOKE.Actor_Property_POSITION_INHERITANCE_get();
internal static readonly int DRAW_MODE = NDalicPINVOKE.Actor_Property_DRAW_MODE_get();
internal static readonly int SIZE_MODE_FACTOR = NDalicPINVOKE.Actor_Property_SIZE_MODE_FACTOR_get();
internal static readonly int WIDTH_RESIZE_POLICY = NDalicPINVOKE.Actor_Property_WIDTH_RESIZE_POLICY_get();
internal static readonly int CLIPPING_MODE = NDalicPINVOKE.Actor_Property_CLIPPING_MODE_get();
}
-
/// <summary>
/// Describes the direction to move the focus towards.
/// </summary>
/// </summary>
public View() : this(NDalicPINVOKE.View_New(), true)
{
- PositionUsesAnchorPoint = false;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal View Assign(View handle)
- {
- View ret = new View(NDalicPINVOKE.View_Assign(swigCPtr, View.getCPtr(handle)), false);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
/// <summary>
/// Downcasts a handle to View handle.<br>
/// If handle points to a View, the downcast produces valid handle.<br>
/// </summary>
/// <param name="handle">Handle to an object</param>
/// <returns>A handle to a View or an uninitialized handle</returns>
+ [Obsolete("Please do not use! this will be deprecated, instead please use as keyword.")]
public new static View DownCast(BaseHandle handle)
{
- View ret = new View(NDalicPINVOKE.View_DownCast(BaseHandle.getCPtr(handle)), true);
+ View ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as View;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- /// <summary>
- /// Downcasts a handle to class which inherit View handle.
- /// </summary>
- /// <typeparam name="T">Class which inherit View</typeparam>
- /// <param name="view">View to an object</param>
- /// <returns>A object which inherit View</returns>
+ [Obsolete("Please do not use! this will be deprecated, instead please use as keyword.")]
public static T DownCast<T>(View view) where T : View
{
- View ret = ViewRegistry.GetViewFromBaseHandle(view);
+ T ret = Registry.GetManagedBaseHandleFromNativePtr(view) as T;
if (ret != null)
{
- return (T)ret;
+ return ret;
}
return null;
}
{
View view = null;
- if (Parent)
+ if (Parent is View)
{
- view = Parent.FindChildById(id);
+ View parentView = Parent as View;
+ view = parentView.FindChildById(id);
}
if (!view)
Tizen.NUI.PropertyMap background = Background;
int visualType = 0;
- background.Find(Visual.Property.Type).Get(ref visualType);
+ background.Find(Visual.Property.Type)?.Get(out visualType);
if (visualType == (int)Visual.Type.Color)
{
- background.Find(ColorVisualProperty.MixColor).Get(backgroundColor);
+ background.Find(ColorVisualProperty.MixColor)?.Get(backgroundColor);
}
return backgroundColor;
}
/// <summary>
+ /// Create an Animation to animate the background color visual. If there is no
+ /// background visual, creates one with transparent black as it's mixColor.
+ /// </summary>
+ public Animation AnimateBackgroundColor( object destinationValue,
+ int startTime,
+ int endTime,
+ AlphaFunction.BuiltinFunctions? alphaFunction = null,
+ object initialValue = null)
+ {
+ Tizen.NUI.PropertyMap background = Background;
+
+ if( background.Empty() )
+ {
+ // If there is no background yet, ensure there is a transparent
+ // color visual
+ BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f);
+ background = Background;
+ }
+ return AnimateColor( "background", destinationValue, startTime, endTime, alphaFunction, initialValue );
+ }
+
+ /// <summary>
+ /// Create an Animation to animate the mixColor of the named visual.
+ /// </summary>
+ public Animation AnimateColor( string targetVisual, object destinationColor, int startTime, int endTime, AlphaFunction.BuiltinFunctions? alphaFunction = null, object initialColor = null )
+ {
+ Animation animation = null;
+ {
+ PropertyMap _animator = new PropertyMap();
+ if( alphaFunction != null )
+ {
+ _animator.Add("alphaFunction", new PropertyValue( AlphaFunction.BuiltinToPropertyKey(alphaFunction) ) );
+ }
+
+ PropertyMap _timePeriod = new PropertyMap();
+ _timePeriod.Add( "duration", new PropertyValue((endTime-startTime)/1000.0f) );
+ _timePeriod.Add( "delay", new PropertyValue( startTime/1000.0f ) );
+ _animator.Add( "timePeriod", new PropertyValue( _timePeriod ) );
+
+ PropertyMap _transition = new PropertyMap();
+ _transition.Add( "animator", new PropertyValue( _animator ) );
+ _transition.Add( "target", new PropertyValue( targetVisual ) );
+ _transition.Add( "property", new PropertyValue( "mixColor" ) );
+
+ if( initialColor != null )
+ {
+ PropertyValue initValue = PropertyValue.CreateFromObject( initialColor );
+ _transition.Add( "initialValue", initValue );
+ }
+
+ PropertyValue destValue = PropertyValue.CreateFromObject( destinationColor );
+ _transition.Add( "targetValue", destValue );
+ TransitionData _transitionData = new TransitionData( _transition );
+
+ animation = new Animation( NDalicManualPINVOKE.View_CreateTransition(swigCPtr, TransitionData.getCPtr(_transitionData)), true );
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ return animation;
+ }
+
+ /// <summary>
/// mutually exclusive with BACKGROUND_COLOR & BACKGROUND, type Map.
/// </summary>
public string BackgroundImage
Tizen.NUI.PropertyMap background = Background;
int visualType = 0;
- background.Find(Visual.Property.Type).Get(ref visualType);
+ background.Find(Visual.Property.Type)?.Get(out visualType);
if (visualType == (int)Visual.Type.Image)
{
- background.Find(ImageVisualProperty.URL).Get(out backgroundImage);
+ background.Find(ImageVisualProperty.URL)?.Get(out backgroundImage);
}
return backgroundImage;
}
}
- internal bool KeyInputFocus
- {
- get
- {
- bool temp = false;
- GetProperty(View.Property.KEY_INPUT_FOCUS).Get(ref temp);
- return temp;
- }
- set
- {
- SetProperty(View.Property.KEY_INPUT_FOCUS, new Tizen.NUI.PropertyValue(value));
- }
- }
-
- /// <summary>
- /// mutually exclusive with BACKGROUND_COLOR & BACKGROUND_IMAGE, type Map or string for URL.
- /// </summary>
public Tizen.NUI.PropertyMap Background
{
get
{
Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
- GetProperty(View.Property.BACKGROUND).Get(temp);
+ GetProperty( View.Property.BACKGROUND ).Get(temp);
return temp;
}
set
}
}
+
/// <summary>
/// The current state of the view.
/// </summary>
get
{
int temp = 0;
- if (GetProperty(View.Property.STATE).Get(ref temp) == false)
+ if (GetProperty(View.Property.STATE).Get(out temp) == false)
{
-#if DEBUG_ON
- Tizen.Log.Error("NUI", "State get error!");
-#endif
+ NUILog.Error("State get error!");
}
switch (temp)
{
string temp;
if (GetProperty(View.Property.SUB_STATE).Get(out temp) == false)
{
-#if DEBUG_ON
- Tizen.Log.Error("NUI", "subState get error!");
-#endif
+ NUILog.Error("subState get error!");
}
switch (temp)
{
get
{
int temp = 0;
- GetProperty(View.Property.LEFT_FOCUSABLE_VIEW_ID).Get(ref temp);
+ GetProperty(View.Property.LEFT_FOCUSABLE_VIEW_ID).Get(out temp);
return temp;
}
set
get
{
int temp = 0;
- GetProperty(View.Property.RIGHT_FOCUSABLE_VIEW_ID).Get(ref temp);
+ GetProperty(View.Property.RIGHT_FOCUSABLE_VIEW_ID).Get(out temp);
return temp;
}
set
get
{
int temp = 0;
- GetProperty(View.Property.UP_FOCUSABLE_VIEW_ID).Get(ref temp);
+ GetProperty(View.Property.UP_FOCUSABLE_VIEW_ID).Get(out temp);
return temp;
}
set
get
{
int temp = 0;
- GetProperty(View.Property.DOWN_FOCUSABLE_VIEW_ID).Get(ref temp);
+ GetProperty(View.Property.DOWN_FOCUSABLE_VIEW_ID).Get(out temp);
return temp;
}
set
/// Child Property of FlexContainer.<br>
/// The proportion of the free space in the container the flex item will receive.<br>
/// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br>
- /// </summary>
+ /// </summary>
public float Flex
{
get
{
float temp = 0.0f;
- GetProperty(FlexContainer.ChildProperty.FLEX).Get(ref temp);
+ GetProperty(FlexContainer.ChildProperty.FLEX).Get(out temp);
return temp;
}
set
/// <summary>
/// Child Property of FlexContainer.<br>
/// The alignment of the flex item along the cross axis, which, if set, overides the default alignment for all items in the container.<br>
- /// </summary>
+ /// </summary>
public int AlignSelf
{
get
{
int temp = 0;
- GetProperty(FlexContainer.ChildProperty.ALIGN_SELF).Get(ref temp);
+ GetProperty(FlexContainer.ChildProperty.ALIGN_SELF).Get(out temp);
return temp;
}
set
/// <summary>
/// Child Property of FlexContainer.<br>
/// The space around the flex item.<br>
- /// </summary>
+ /// </summary>
public Vector4 FlexMargin
{
get
get
{
float temp = 0.0f;
- GetProperty(TableView.ChildProperty.ROW_SPAN).Get(ref temp);
+ GetProperty(TableView.ChildProperty.ROW_SPAN).Get(out temp);
return temp;
}
set
get
{
float temp = 0.0f;
- GetProperty(TableView.ChildProperty.COLUMN_SPAN).Get(ref temp);
+ GetProperty(TableView.ChildProperty.COLUMN_SPAN).Get(out temp);
return temp;
}
set
string temp;
if (GetProperty(TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT).Get(out temp) == false)
{
-#if DEBUG_ON
- Tizen.Log.Error("NUI", "CellHorizontalAlignment get error!");
-#endif
+ NUILog.Error("CellHorizontalAlignment get error!");
}
switch (temp)
string temp;
GetProperty(TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT).Get(out temp);
{
-#if DEBUG_ON
- Tizen.Log.Error("NUI", "CellVerticalAlignment get error!");
-#endif
+ NUILog.Error("CellVerticalAlignment get error!");
}
switch (temp)
{
Size temp = new Size(0.0f, 0.0f, 0.0f);
GetProperty(View.Property.SIZE).Get(temp);
- return new Size2D(temp);
+ Size2D size = new Size2D((int)temp.Width, (int)temp.Height);
+ return size;
}
set
{
/// Retrieves the size of the View.<br>
/// The coordinates are relative to the View's parent.<br>
/// </summary>
- public Size CurrentSize
+ public Size2D CurrentSize
{
get
{
}
}
- public bool Visibility
+ [Obsolete("Please do not use! this will be deprecated. Please use Visibility instead.")]
+ public bool Visible
{
get
{
get
{
float temp = 0.0f;
- GetProperty(View.Property.OPACITY).Get(ref temp);
+ GetProperty(View.Property.OPACITY).Get(out temp);
return temp;
}
set
/// <summary>
/// Sets the position of the View for X and Y.<br>
- /// By default, sets the position vector between the parent origin and anchor point(default).<br>
+ /// By default, sets the position vector between the parent origin and pivot point(default).<br>
/// If Position inheritance if disabled, sets the world position.<br>
/// </summary>
public Position2D Position2D
}
/// <summary>
- /// Determines whether the anchor point should be used to determine the position of the view.
+ /// Determines whether the pivot point should be used to determine the position of the view.
/// This is true by default.
/// </summary>
/// <remarks>If false, then the top-left of the view is used for the position.
/// Setting this to false will allow scaling or rotation around the anchor-point without affecting the view's position.
/// </remarks>
+ public bool PositionUsesPivotPoint
+ {
+ get
+ {
+ bool temp = false;
+ GetProperty(View.Property.POSITION_USES_ANCHOR_POINT).Get(out temp);
+ return temp;
+ }
+ set
+ {
+ SetProperty(View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
+ }
+ }
+
+ [Obsolete("Please do not use! this will be deprecated")]
public bool PositionUsesAnchorPoint
{
get
{
bool temp = false;
- GetProperty(View.Property.POSITION_USES_ANCHOR_POINT).Get(ref temp);
+ GetProperty(View.Property.POSITION_USES_ANCHOR_POINT).Get(out temp);
return temp;
}
set
}
}
- public bool StateFocusEnable
+ internal bool FocusState
{
get
{
get
{
int temp = 0;
- GetProperty(View.Property.SIBLING_ORDER).Get(ref temp);
+ GetProperty(View.Property.SIBLING_ORDER).Get(out temp);
return temp;
}
set
}
/// <summary>
- /// Gets the natural size of the view.<br>
+ /// Returns the natural size of the view.
/// </summary>
/// <remarks>
- /// Readonly.
+ /// Deriving classes stipulate the natural size and by default a view has a ZERO natural size.
/// </remarks>
+ [Obsolete("Please do not use! this will be deprecated, please use NaturalSize2D instead")]
public Vector3 NaturalSize
{
get
}
/// <summary>
+ /// Returns the natural size (Size2D) of the view.
+ /// </summary>
+ /// <remarks>
+ /// Deriving classes stipulate the natural size and by default a view has a ZERO natural size.
+ /// </remarks>
+ public Size2D NaturalSize2D
+ {
+ get
+ {
+ Vector3 temp = new Vector3(NDalicPINVOKE.Actor_GetNaturalSize(swigCPtr), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ return new Size2D((int)temp.Width, (int)temp.Height);
+ }
+ }
+
+ /// <summary>
/// Shows the View.
/// </summary>
/// <remarks>
}
/// <summary>
- /// Raise the view to above the target view.
+ /// Query if all resources required by a View are loaded and ready.
/// </summary>
- /// <remarks>Sibling order of views within the parent will be updated automatically.
- /// Views on the level above the target view will still be shown above this view.
- /// Raising this view above views with the same sibling order as each other will raise this view above them.
- /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion.
+ /// <remarks>Most resources are only loaded when the control is placed on stage
/// </remarks>
- /// <param name="target">Will be raised above this view</param>
- internal void RaiseAbove(View target)
+ public bool IsResourceReady()
+ {
+ bool ret = NDalicPINVOKE.IsResourceReady(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Raise the view to above the target view.
+ /// </summary>
+ /// <remarks>Sibling order of views within the parent will be updated automatically.
+ /// Views on the level above the target view will still be shown above this view.
+ /// Raising this view above views with the same sibling order as each other will raise this view above them.
+ /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion.
+ /// </remarks>
+ /// <param name="target">Will be raised above this view</param>
+ internal void RaiseAbove(View target)
{
NDalicPINVOKE.RaiseAbove(swigCPtr, View.getCPtr(target));
if (NDalicPINVOKE.SWIGPendingException.Pending)
return ret;
}
- internal bool IsLayer()
- {
- bool ret = NDalicPINVOKE.Actor_IsLayer(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
internal Layer GetLayer()
{
- Layer ret = new Layer(NDalicPINVOKE.Actor_GetLayer(swigCPtr), true);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
+ IntPtr cPtr = NDalicPINVOKE.Actor_GetLayer(swigCPtr);
+ Layer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Layer;
- /// <summary>
- /// Adds a child view to this View.
- /// </summary>
- /// <pre>This View(the parent) has been initialized. The child view has been initialized. The child view is not the same as the parent view.</pre>
- /// <post>The child will be referenced by its parent. This means that the child will be kept alive, even if the handle passed into this method is reset or destroyed.</post>
- /// <remarks>If the child already has a parent, it will be removed from old parent and reparented to this view. This may change child's position, color, scale etc as it now inherits them from this view.</remarks>
- /// <param name="child">The child</param>
- public void Add(View child)
- {
- NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child));
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
/// <summary>
- /// Removes a child View from this View. If the view was not a child of this view, this is a no-op.
+ /// Removes a View from its Parent View / Layer. If the View has no parent, this method does nothing.
/// </summary>
- /// <pre>This View(the parent) has been initialized. The child view is not the same as the parent view.</pre>
- /// <param name="child">The child</param>
- public void Remove(View child)
- {
- NDalicPINVOKE.Actor_Remove(swigCPtr, View.getCPtr(child));
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
-
- internal void Unparent()
+ /// <pre>The (child) View has been initialized. </pre>
+ public void Unparent()
{
NDalicPINVOKE.Actor_Unparent(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending)
}
/// <summary>
- /// Retrieves the number of children held by the view.
+ /// Search through this view's hierarchy for an view with the given name.
+ /// The view itself is also considered in the search.
/// </summary>
/// <pre>The View has been initialized.</pre>
- /// <returns>The number of children</returns>
- public uint GetChildCount()
+ /// <param name="viewName">The name of the view to find</param>
+ /// <returns>A handle to the view if found, or an empty handle if not</returns>
+ public View FindChildByName(string viewName)
{
- uint ret = NDalicPINVOKE.Actor_GetChildCount(swigCPtr);
+ IntPtr cPtr = NDalicPINVOKE.Actor_FindChildByName(swigCPtr, viewName);
+
+ View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
+
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- /// <summary>
- /// Retrieves child view by index.
- /// </summary>
- /// <pre>The View has been initialized.</pre>
- /// <param name="index">The index of the child to retrieve</param>
- /// <returns>The view for the given index or empty handle if children not initialized</returns>
- public View GetChildAt(uint index)
+ internal View FindChildById(uint id)
{
- IntPtr cPtr = NDalicPINVOKE.Actor_GetChildAt(swigCPtr, index);
- cPtr = NDalicPINVOKE.View_SWIGUpcast(cPtr);
- cPtr = NDalicPINVOKE.Handle_SWIGUpcast(cPtr);
-
- BaseHandle ret = new BaseHandle(cPtr, false);
-
- View temp = ViewRegistry.GetViewFromBaseHandle(ret);
-
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ IntPtr cPtr = NDalicPINVOKE.Actor_FindChildById(swigCPtr, id);
- return temp ?? null;
- }
+ View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
- /// <summary>
- /// Search through this view's hierarchy for an view with the given name.
- /// The view itself is also considered in the search.
- /// </summary>
- /// <pre>The View has been initialized.</pre>
- /// <param name="viewName">The name of the view to find</param>
- /// <returns>A handle to the view if found, or an empty handle if not</returns>
- public View FindChildByName(string viewName)
- {
- View ret = new View(NDalicPINVOKE.Actor_FindChildByName(swigCPtr, viewName), true);
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- internal View FindChildById(uint id)
+ /*internal View GetParent()
{
- View ret = new View(NDalicPINVOKE.Actor_FindChildById(swigCPtr, id), true);
+ View ret;
+ IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr);
+
+ BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr);
+
+ if(basehandle is Layer)
+ {
+ ret = new View(cPtr,false);
+ }
+ else
+ {
+ ret = basehandle as View;
+ }
+
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
- }
+ }*/
internal View GetParent()
{
- View ret = new View(NDalicPINVOKE.Actor_GetParent(swigCPtr), true);
+ View ret;
+ IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr);
+
+ BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr);
+
+ if(basehandle is Layer)
+ {
+ View ret2 = new View(cPtr,false);
+ return ret2;
+ }
+
+ ret = basehandle as View;
+
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
return ret;
}
- internal Size GetCurrentSize()
+ internal Size2D GetCurrentSize()
{
Size ret = new Size(NDalicPINVOKE.Actor_GetCurrentSize(swigCPtr), true);
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ Size2D size = new Size2D((int)ret.Width, (int)ret.Height);
+ return size;
}
internal Vector3 GetNaturalSize()
return ret;
}
- internal void SetSensitive(bool sensitive)
- {
- NDalicPINVOKE.Actor_SetSensitive(swigCPtr, sensitive);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
-
- internal bool IsSensitive()
- {
- bool ret = NDalicPINVOKE.Actor_IsSensitive(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
/// <summary>
/// Converts screen coordinates into the view's coordinate system using the default camera.
/// </summary>
return ret;
}
- internal void SetLeaveRequired(bool required)
- {
- NDalicPINVOKE.Actor_SetLeaveRequired(swigCPtr, required);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
-
- internal bool GetLeaveRequired()
- {
- bool ret = NDalicPINVOKE.Actor_GetLeaveRequired(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
internal void SetKeyboardFocusable(bool focusable)
{
NDalicPINVOKE.Actor_SetKeyboardFocusable(swigCPtr, focusable);
return ret;
}
- internal void SetSizeScalePolicy(SizeScalePolicyType policy)
- {
- NDalicPINVOKE.Actor_SetSizeScalePolicy(swigCPtr, (int)policy);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
-
- internal SizeScalePolicyType GetSizeScalePolicy()
- {
- SizeScalePolicyType ret = (SizeScalePolicyType)NDalicPINVOKE.Actor_GetSizeScalePolicy(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
/// <summary>
/// Sets the relative to parent size factor of the view.<br>
/// This factor is only used when ResizePolicy is set to either:
return ret;
}
- internal uint AddRenderer(Renderer renderer)
+ public uint AddRenderer(Renderer renderer)
{
uint ret = NDalicPINVOKE.Actor_AddRenderer(swigCPtr, Renderer.getCPtr(renderer));
if (NDalicPINVOKE.SWIGPendingException.Pending)
return ret;
}
- internal Renderer GetRendererAt(uint index)
+ public Renderer GetRendererAt(uint index)
{
- Renderer ret = new Renderer(NDalicPINVOKE.Actor_GetRendererAt(swigCPtr, index), true);
+ IntPtr cPtr = NDalicPINVOKE.Actor_GetRendererAt(swigCPtr, index);
+ Renderer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Renderer;
+
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- internal void RemoveRenderer(Renderer renderer)
+ public void RemoveRenderer(Renderer renderer)
{
NDalicPINVOKE.Actor_RemoveRenderer__SWIG_0(swigCPtr, Renderer.getCPtr(renderer));
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal void RemoveRenderer(uint index)
+ public void RemoveRenderer(uint index)
{
NDalicPINVOKE.Actor_RemoveRenderer__SWIG_1(swigCPtr, index);
if (NDalicPINVOKE.SWIGPendingException.Pending)
return ret;
}
+ internal ViewSignal ResourcesLoadedSignal()
+ {
+ ViewSignal ret = new ViewSignal(NDalicPINVOKE.ResourceReadySignal(swigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
/// <summary>
/// Gets/Sets the origin of an view, within its parent's area.<br>
/// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent, and(1.0, 1.0, 0.5) is the bottom-right corner.<br>
get
{
float temp = 0.0f;
- GetProperty(View.Property.PARENT_ORIGIN_X).Get(ref temp);
+ GetProperty(View.Property.PARENT_ORIGIN_X).Get(out temp);
return temp;
}
set
get
{
float temp = 0.0f;
- GetProperty(View.Property.PARENT_ORIGIN_Y).Get(ref temp);
+ GetProperty(View.Property.PARENT_ORIGIN_Y).Get(out temp);
return temp;
}
set
get
{
float temp = 0.0f;
- GetProperty(View.Property.PARENT_ORIGIN_Z).Get(ref temp);
+ GetProperty(View.Property.PARENT_ORIGIN_Z).Get(out temp);
return temp;
}
set
/// <summary>
/// Gets/Sets the anchor-point of an view.<br>
/// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the view, and (1.0, 1.0, 0.5) is the bottom-right corner.<br>
- /// The default anchor point is AnchorPoint.Center (0.5, 0.5, 0.5).<br>
+ /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br>
/// An view position is the distance between its parent-origin and this anchor-point.<br>
/// An view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br>
/// <pre>The View has been initialized.</pre>
/// </summary>
- public Position AnchorPoint
+ public Position PivotPoint
{
get
{
}
}
- internal float AnchorPointX
+ internal float PivotPointX
{
get
{
float temp = 0.0f;
- GetProperty(View.Property.ANCHOR_POINT_X).Get(ref temp);
+ GetProperty(View.Property.ANCHOR_POINT_X).Get(out temp);
return temp;
}
set
}
}
- internal float AnchorPointY
+ internal float PivotPointY
{
get
{
float temp = 0.0f;
- GetProperty(View.Property.ANCHOR_POINT_Y).Get(ref temp);
+ GetProperty(View.Property.ANCHOR_POINT_Y).Get(out temp);
return temp;
}
set
}
}
- internal float AnchorPointZ
+ internal float PivotPointZ
{
get
{
float temp = 0.0f;
- GetProperty(View.Property.ANCHOR_POINT_Z).Get(ref temp);
+ GetProperty(View.Property.ANCHOR_POINT_Z).Get(out temp);
return temp;
}
set
}
/// <summary>
- /// Gets/Sets the size of an view.<br>
- /// Geometry can be scaled to fit within this area.<br>
- /// This does not interfere with the views scale factor.<br>
- /// </summary>
- public Size Size
- {
- get
- {
- Size temp = new Size(0.0f, 0.0f, 0.0f);
- GetProperty(View.Property.SIZE).Get(temp);
- return temp;
- }
- set
- {
- SetProperty(View.Property.SIZE, new Tizen.NUI.PropertyValue(value));
- }
- }
-
- /// <summary>
/// Gets/Sets the size width of an view.
/// </summary>
public float SizeWidth
get
{
float temp = 0.0f;
- GetProperty(View.Property.SIZE_WIDTH).Get(ref temp);
+ GetProperty(View.Property.SIZE_WIDTH).Get(out temp);
return temp;
}
set
get
{
float temp = 0.0f;
- GetProperty(View.Property.SIZE_HEIGHT).Get(ref temp);
+ GetProperty(View.Property.SIZE_HEIGHT).Get(out temp);
return temp;
}
set
}
/// <summary>
- /// Gets/Sets the size depth of an view.
- /// </summary>
- public float SizeDepth
- {
- get
- {
- float temp = 0.0f;
- GetProperty(View.Property.SIZE_DEPTH).Get(ref temp);
- return temp;
- }
- set
- {
- SetProperty(View.Property.SIZE_DEPTH, new Tizen.NUI.PropertyValue(value));
- }
- }
-
- /// <summary>
/// Gets/Sets the position of the View.<br>
- /// By default, sets the position vector between the parent origin and anchor point(default).<br>
+ /// By default, sets the position vector between the parent origin and pivot point(default).<br>
/// If Position inheritance if disabled, sets the world position.<br>
/// </summary>
public Position Position
get
{
float temp = 0.0f;
- GetProperty(View.Property.POSITION_X).Get(ref temp);
+ GetProperty(View.Property.POSITION_X).Get(out temp);
return temp;
}
set
get
{
float temp = 0.0f;
- GetProperty(View.Property.POSITION_Y).Get(ref temp);
+ GetProperty(View.Property.POSITION_Y).Get(out temp);
return temp;
}
set
get
{
float temp = 0.0f;
- GetProperty(View.Property.POSITION_Z).Get(ref temp);
+ GetProperty(View.Property.POSITION_Z).Get(out temp);
return temp;
}
set
get
{
float temp = 0.0f;
- GetProperty(View.Property.WORLD_POSITION_X).Get(ref temp);
+ GetProperty(View.Property.WORLD_POSITION_X).Get(out temp);
return temp;
}
}
get
{
float temp = 0.0f;
- GetProperty(View.Property.WORLD_POSITION_Y).Get(ref temp);
+ GetProperty(View.Property.WORLD_POSITION_Y).Get(out temp);
return temp;
}
}
get
{
float temp = 0.0f;
- GetProperty(View.Property.WORLD_POSITION_Z).Get(ref temp);
+ GetProperty(View.Property.WORLD_POSITION_Z).Get(out temp);
return temp;
}
}
get
{
float temp = 0.0f;
- GetProperty(View.Property.SCALE_X).Get(ref temp);
+ GetProperty(View.Property.SCALE_X).Get(out temp);
return temp;
}
set
get
{
float temp = 0.0f;
- GetProperty(View.Property.SCALE_Y).Get(ref temp);
+ GetProperty(View.Property.SCALE_Y).Get(out temp);
return temp;
}
set
get
{
float temp = 0.0f;
- GetProperty(View.Property.SCALE_Z).Get(ref temp);
+ GetProperty(View.Property.SCALE_Z).Get(out temp);
return temp;
}
set
/// If an view is not visible, then the view and its children will not be rendered.
/// This is regardless of the individual visibility values of the children i.e.an view will only be rendered if all of its parents have visibility set to true.
/// </remarks>
- public bool Visible
+ public bool Visibility
{
get
{
bool temp = false;
- GetProperty(View.Property.VISIBLE).Get(ref temp);
+ GetProperty(View.Property.VISIBLE).Get(out temp);
return temp;
- }/* only get is required : removed
- set
- {
- SetProperty(View.Property.VISIBLE, new Tizen.NUI.PropertyValue(value));
- }*/
- }
-
- /// <summary>
- /// Gets/Sets the view's mix color red.
- /// </summary>
- public float ColorRed
- {
- get
- {
- float temp = 0.0f;
- GetProperty(View.Property.COLOR_RED).Get(ref temp);
- return temp;
- }
- set
- {
- SetProperty(View.Property.COLOR_RED, new Tizen.NUI.PropertyValue(value));
- }
- }
-
- /// <summary>
- /// Gets/Sets the view's mix color green.
- /// </summary>
- public float ColorGreen
- {
- get
- {
- float temp = 0.0f;
- GetProperty(View.Property.COLOR_GREEN).Get(ref temp);
- return temp;
- }
- set
- {
- SetProperty(View.Property.COLOR_GREEN, new Tizen.NUI.PropertyValue(value));
- }
- }
-
- /// <summary>
- /// Gets/Sets the view's mix color blue
- /// </summary>
- public float ColorBlue
- {
- get
- {
- float temp = 0.0f;
- GetProperty(View.Property.COLOR_BLUE).Get(ref temp);
- return temp;
- }
- set
- {
- SetProperty(View.Property.COLOR_BLUE, new Tizen.NUI.PropertyValue(value));
- }
- }
-
- /// <summary>
- /// Gets/Sets the view's mix color alpha.
- /// </summary>
- public float ColorAlpha
- {
- get
- {
- float temp = 0.0f;
- GetProperty(View.Property.COLOR_ALPHA).Get(ref temp);
- return temp;
- }
- set
- {
- SetProperty(View.Property.COLOR_ALPHA, new Tizen.NUI.PropertyValue(value));
}
}
}
/// <summary>
+ /// Gets the View's ID.
+ /// Readonly
+ /// </summary>
+ public uint ID
+ {
+ get
+ {
+ return GetId();
+ }
+ }
+
+ /// <summary>
/// Gets/Sets the status of whether an view should emit touch or hover signals.
/// </summary>
public bool Sensitive
get
{
bool temp = false;
- GetProperty(View.Property.SENSITIVE).Get(ref temp);
+ GetProperty(View.Property.SENSITIVE).Get(out temp);
return temp;
}
set
get
{
bool temp = false;
- GetProperty(View.Property.LEAVE_REQUIRED).Get(ref temp);
+ GetProperty(View.Property.LEAVE_REQUIRED).Get(out temp);
return temp;
}
set
get
{
bool temp = false;
- GetProperty(View.Property.INHERIT_ORIENTATION).Get(ref temp);
+ GetProperty(View.Property.INHERIT_ORIENTATION).Get(out temp);
return temp;
}
set
get
{
bool temp = false;
- GetProperty(View.Property.INHERIT_SCALE).Get(ref temp);
+ GetProperty(View.Property.INHERIT_SCALE).Get(out temp);
return temp;
}
set
}
/// <summary>
- /// Gets/Sets the view's color mode.<br>
- /// This specifies whether the View uses its own color, or inherits its parent color.<br>
- /// The default is UseOwnMultiplyParentAlpha.<br>
- /// </summary>
- public ColorMode ColorMode
- {
- get
- {
- string temp;
- if (GetProperty(View.Property.COLOR_MODE).Get(out temp) == false)
- {
-#if DEBUG_ON
- Tizen.Log.Error("NUI", "ColorMode get error!");
-#endif
- }
- switch (temp)
- {
- case "USE_OWN_COLOR":
- return ColorMode.UseOwnColor;
- case "USE_PARENT_COLOR":
- return ColorMode.UseParentColor;
- case "USE_OWN_MULTIPLY_PARENT_COLOR":
- return ColorMode.UseOwnMultiplyParentColor;
- case "USE_OWN_MULTIPLY_PARENT_ALPHA":
- return ColorMode.UseOwnMultiplyParentAlpha;
- default:
- return ColorMode.UseOwnMultiplyParentAlpha;
- }
- }
- set
- {
- SetProperty(View.Property.COLOR_MODE, new Tizen.NUI.PropertyValue((int)value));
- }
- }
-
- public string PositionInheritance
- {
- get
- {
- string temp;
- GetProperty(View.Property.POSITION_INHERITANCE).Get(out temp);
- return temp;
- }
- set
- {
- SetProperty(View.Property.POSITION_INHERITANCE, new Tizen.NUI.PropertyValue(value));
- }
- }
-
- /// <summary>
/// Gets/Sets the status of how the view and its children should be drawn.<br>
/// Not all views are renderable, but DrawMode can be inherited from any view.<br>
/// If an object is in a 3D layer, it will be depth-tested against other objects in the world i.e. it may be obscured if other objects are in front.<br>
string temp;
if (GetProperty(View.Property.DRAW_MODE).Get(out temp) == false)
{
-#if DEBUG_ON
- Tizen.Log.Error("NUI", "DrawMode get error!");
-#endif
+ NUILog.Error("DrawMode get error!");
}
switch (temp)
{
string temp;
if (GetProperty(View.Property.WIDTH_RESIZE_POLICY).Get(out temp) == false)
{
-#if DEBUG_ON
- Tizen.Log.Error("NUI", "WidthResizePolicy get error!");
-#endif
+ NUILog.Error("WidthResizePolicy get error!");
}
switch (temp)
{
string temp;
if (GetProperty(View.Property.HEIGHT_RESIZE_POLICY).Get(out temp) == false)
{
-#if DEBUG_ON
- Tizen.Log.Error("NUI", "HeightResizePolicy get error!");
-#endif
+ NUILog.Error("HeightResizePolicy get error!");
}
switch (temp)
{
string temp;
if (GetProperty(View.Property.SIZE_SCALE_POLICY).Get(out temp) == false)
{
-#if DEBUG_ON
- Tizen.Log.Error("NUI", "SizeScalePolicy get error!");
-#endif
+ NUILog.Error("SizeScalePolicy get error!");
}
switch (temp)
{
get
{
bool temp = false;
- GetProperty(View.Property.WIDTH_FOR_HEIGHT).Get(ref temp);
+ GetProperty(View.Property.WIDTH_FOR_HEIGHT).Get(out temp);
return temp;
}
set
get
{
bool temp = false;
- GetProperty(View.Property.HEIGHT_FOR_WIDTH).Get(ref temp);
+ GetProperty(View.Property.HEIGHT_FOR_WIDTH).Get(out temp);
return temp;
}
set
/// <summary>
/// Gets/Sets whether a child view inherits it's parent's position.<br>
/// Default is to inherit.<br>
- /// Switching this off means that using Position sets the view's world position, i.e. translates from the world origin(0,0,0) to the anchor point of the view.<br>
+ /// Switching this off means that using Position sets the view's world position, i.e. translates from the world origin(0,0,0) to the pivot point of the view.<br>
/// </summary>
public bool InheritPosition
{
get
{
bool temp = false;
- GetProperty(View.Property.INHERIT_POSITION).Get(ref temp);
+ GetProperty(View.Property.INHERIT_POSITION).Get(out temp);
return temp;
}
set
string temp;
if (GetProperty(View.Property.CLIPPING_MODE).Get(out temp) == false)
{
-#if DEBUG_ON
- Tizen.Log.Error("NUI", "ClippingMode get error!");
-#endif
+ NUILog.Error("ClippingMode get error!");
}
switch (temp)
{
SetProperty(View.Property.CLIPPING_MODE, new Tizen.NUI.PropertyValue((int)value));
}
}
- }
+ /// <summary>
+ /// Get the number of renderers held by the view.
+ /// </summary>
+ public uint RendererCount
+ {
+ get
+ {
+ return GetRendererCount();
+ }
+ }
+
+
+
+
+ [Obsolete("Please do not use! this will be deprecated")]
+ public event EventHandlerWithReturnType<object, TouchEventArgs, bool> Touched
+ {
+ add
+ {
+ if (_touchDataEventHandler == null)
+ {
+ _touchDataCallback = OnTouch;
+ this.TouchSignal().Connect(_touchDataCallback);
+ }
+
+ _touchDataEventHandler += value;
+ }
+
+ remove
+ {
+ _touchDataEventHandler -= value;
+
+ if (_touchDataEventHandler == null && TouchSignal().Empty() == false)
+ {
+ this.TouchSignal().Disconnect(_touchDataCallback);
+ }
+
+ }
+ }
+
+ [Obsolete("Please do not use! this will be deprecated")]
+ public event EventHandlerWithReturnType<object, HoverEventArgs, bool> Hovered
+ {
+ add
+ {
+ if (_hoverEventHandler == null)
+ {
+ _hoverEventCallback = OnHoverEvent;
+ this.HoveredSignal().Connect(_hoverEventCallback);
+ }
+
+ _hoverEventHandler += value;
+ }
+
+ remove
+ {
+ _hoverEventHandler -= value;
+
+ if (_hoverEventHandler == null && HoveredSignal().Empty() == false)
+ {
+ this.HoveredSignal().Disconnect(_hoverEventCallback);
+ }
+
+ }
+ }
+
+ [Obsolete("Please do not use! this will be deprecated")]
+ public event EventHandlerWithReturnType<object, WheelEventArgs, bool> WheelMoved
+ {
+ add
+ {
+ if (_wheelEventHandler == null)
+ {
+ _wheelEventCallback = OnWheelEvent;
+ this.WheelEventSignal().Connect(_wheelEventCallback);
+ }
+
+ _wheelEventHandler += value;
+ }
+
+ remove
+ {
+ _wheelEventHandler -= value;
+
+ if (_wheelEventHandler == null && WheelEventSignal().Empty() == false)
+ {
+ this.WheelEventSignal().Disconnect(_wheelEventCallback);
+ }
+
+ }
+ }
+
+ [Obsolete("Please do not use! this will be deprecated")]
+ public Position AnchorPoint
+ {
+ get
+ {
+ Position temp = new Position(0.0f, 0.0f, 0.0f);
+ GetProperty(View.Property.ANCHOR_POINT).Get(temp);
+ return temp;
+ }
+ set
+ {
+ SetProperty(View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
+ }
+ }
+
+ [Obsolete("Please do not use! this will be deprecated, please use Size2D instead")]
+ public Size Size
+ {
+ get
+ {
+ Size temp = new Size(0.0f, 0.0f, 0.0f);
+ GetProperty(View.Property.SIZE).Get(temp);
+ return temp;
+ }
+ set
+ {
+ SetProperty(View.Property.SIZE, new Tizen.NUI.PropertyValue(value));
+ }
+ }
+
+ [Obsolete("Please do not use! this will be deprecated")]
+ public event EventHandler OnWindowEvent
+ {
+ add
+ {
+ if (_onWindowEventHandler == null)
+ {
+ _onWindowEventCallback = OnWindow;
+ this.OnWindowSignal().Connect(_onWindowEventCallback);
+ }
+
+ _onWindowEventHandler += value;
+ }
+
+ remove
+ {
+ _onWindowEventHandler -= value;
+
+ if (_onWindowEventHandler == null && OnWindowSignal().Empty() == false)
+ {
+ this.OnWindowSignal().Disconnect(_onWindowEventCallback);
+ }
+ }
+ }
+
+ [Obsolete("Please do not use! this will be deprecated")]
+ public event EventHandler OffWindowEvent
+ {
+ add
+ {
+ if (_offWindowEventHandler == null)
+ {
+ _offWindowEventCallback = OffWindow;
+ this.OffWindowSignal().Connect(_offWindowEventCallback);
+ }
+
+ _offWindowEventHandler += value;
+ }
+
+ remove
+ {
+ _offWindowEventHandler -= value;
+
+ if (_offWindowEventHandler == null && OffWindowSignal().Empty() == false)
+ {
+ this.OffWindowSignal().Disconnect(_offWindowEventCallback);
+ }
+ }
+ }
+
+ [Obsolete("Please do not use! this will be deprecated")]
+ public event EventHandler OnRelayoutEvent
+ {
+ add
+ {
+ if (_onRelayoutEventHandler == null)
+ {
+ _onRelayoutEventCallback = OnRelayout;
+ this.OnRelayoutSignal().Connect(_onRelayoutEventCallback);
+ }
+
+ _onRelayoutEventHandler += value;
+ }
+
+ remove
+ {
+ _onRelayoutEventHandler -= value;
+
+ if (_onRelayoutEventHandler == null && OnRelayoutSignal().Empty() == false)
+ {
+ this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback);
+ }
+
+ }
+ }
+
+
+
+
+ }
}