internal View(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.View_SWIGUpcast(cPtr), cMemoryOwn)
{
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
- PositionUsesPivotPoint = false;
+ if (HasBody())
+ {
+ PositionUsesPivotPoint = false;
+ }
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj)
/// <since_tizen> 4 </since_tizen>
public override void Add(View child)
{
- NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child));
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
- Children.Add(child);
+ Container oldParent = child.GetParent();
+ if(oldParent != this)
+ {
+ if (oldParent != null)
+ {
+ oldParent.Remove(child);
+ }
+ NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child));
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ Children.Add(child);
+ }
}
/// <summary>
/// <since_tizen> 4 </since_tizen>
public override Container GetParent()
{
+ //to fix memory leak issue, match the handle count with native side.
IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr);
-
- BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr);
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
internal bool IsTopLevelView()
{
- if(GetParent() is Layer)
+ if (GetParent() is Layer)
{
return true;
}
/// <since_tizen> 3 </since_tizen>
protected override void Dispose(DisposeTypes type)
{
- if(disposed)
+ if (disposed)
{
return;
}
- if(type == DisposeTypes.Explicit)
+ if (type == DisposeTypes.Explicit)
{
//Called by User
//Release your own managed resources 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.
-
- DisConnectFromSignals();
+ if (this != null)
+ {
+ DisConnectFromSignals();
+ }
if (swigCPtr.Handle != global::System.IntPtr.Zero)
{
private bool OnKeyEvent(IntPtr view, IntPtr keyEvent)
{
+ if (keyEvent == global::System.IntPtr.Zero)
+ {
+ NUILog.Error("keyEvent should not be null!");
+ return true;
+ }
+
KeyEventArgs e = new KeyEventArgs();
bool result = false;
Delegate[] delegateList = _keyEventHandler.GetInvocationList();
// Oring the result of each callback.
- foreach ( EventHandlerWithReturnType<object, KeyEventArgs, bool> del in delegateList )
+ foreach (EventHandlerWithReturnType<object, KeyEventArgs, bool> del in delegateList)
{
- result |= del( this, e );
+ result |= del(this, e);
}
}
// Callback for View TouchSignal
private bool OnTouch(IntPtr view, IntPtr touchData)
{
+ if (touchData == global::System.IntPtr.Zero)
+ {
+ NUILog.Error("touchData should not be null!");
+ return true;
+ }
+
TouchEventArgs e = new TouchEventArgs();
e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData);
// Callback for View Hover signal
private bool OnHoverEvent(IntPtr view, IntPtr hoverEvent)
{
+ if (hoverEvent == global::System.IntPtr.Zero)
+ {
+ NUILog.Error("hoverEvent should not be null!");
+ return true;
+ }
+
HoverEventArgs e = new HoverEventArgs();
e.Hover = Tizen.NUI.Hover.GetHoverFromPtr(hoverEvent);
// Callback for View Wheel signal
private bool OnWheelEvent(IntPtr view, 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);
internal static readonly int SIZE_SCALE_POLICY = NDalicPINVOKE.Actor_Property_SIZE_SCALE_POLICY_get();
internal static readonly int WIDTH_FOR_HEIGHT = NDalicPINVOKE.Actor_Property_WIDTH_FOR_HEIGHT_get();
internal static readonly int HEIGHT_FOR_WIDTH = NDalicPINVOKE.Actor_Property_HEIGHT_FOR_WIDTH_get();
- internal static readonly int PADDING = NDalicPINVOKE.Actor_Property_PADDING_get();
internal static readonly int MINIMUM_SIZE = NDalicPINVOKE.Actor_Property_MINIMUM_SIZE_get();
internal static readonly int MAXIMUM_SIZE = NDalicPINVOKE.Actor_Property_MAXIMUM_SIZE_get();
internal static readonly int INHERIT_POSITION = NDalicPINVOKE.Actor_Property_INHERIT_POSITION_get();
internal static readonly int INHERIT_LAYOUT_DIRECTION = NDalicManualPINVOKE.Actor_Property_INHERIT_LAYOUT_DIRECTION_get();
internal static readonly int LAYOUT_DIRECTION = NDalicManualPINVOKE.Actor_Property_LAYOUT_DIRECTION_get();
internal static readonly int MARGIN = NDalicPINVOKE.View_Property_MARGIN_get();
- internal static readonly int PADDINGEX = NDalicPINVOKE.View_Property_PADDING_get();
+ internal static readonly int PADDING = NDalicPINVOKE.View_Property_PADDING_get();
}
/// <summary>
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- /// <summary>
- /// Downcasts a handle to view handle.<br />
- /// If handle points to a view, the downcast produces a valid handle.<br />
- /// If not, the returned handle is left uninitialized.<br />
- /// </summary>
- /// <param name="handle">A handle to an object.</param>
- /// <returns>A handle to a view or an uninitialized handle.</returns>
- /// <since_tizen> 3 </since_tizen>
- [Obsolete("Please do not use! this will be deprecated, instead please use as keyword.")]
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static View DownCast(BaseHandle handle)
- {
- View ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as View;
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- /// <summary>
- /// [Obsolete("Please do not use! this will be deprecated, instead please use as keyword.")]
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- [Obsolete("Please do not use! this will be deprecated, instead please use as keyword.")]
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static T DownCast<T>(View view) where T : View
- {
- T ret = Registry.GetManagedBaseHandleFromNativePtr(view) as T;
- if (ret != null)
- {
- return ret;
- }
- return null;
- }
-
private View ConvertIdToView(uint id)
{
View view = null;
/// background visual, creates one with transparent black as it's mixColor.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public Animation AnimateBackgroundColor( object destinationValue,
+ public Animation AnimateBackgroundColor(object destinationValue,
int startTime,
int endTime,
AlphaFunction.BuiltinFunctions? alphaFunction = null,
{
Tizen.NUI.PropertyMap background = Background;
- if( background.Empty() )
+ 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 );
+ return AnimateColor("background", destinationValue, startTime, endTime, alphaFunction, initialValue);
}
/// <summary>
/// Creates an animation to animate the mixColor of the named visual.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public Animation AnimateColor( string targetVisual, object destinationColor, int startTime, int endTime, AlphaFunction.BuiltinFunctions? alphaFunction = null, object initialColor = null )
+ 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 )
+ if (alphaFunction != null)
{
- _animator.Add("alphaFunction", new PropertyValue( AlphaFunction.BuiltinToPropertyKey(alphaFunction) ) );
+ _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 ) );
+ _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" ) );
+ _transition.Add("animator", new PropertyValue(_animator));
+ _transition.Add("target", new PropertyValue(targetVisual));
+ _transition.Add("property", new PropertyValue("mixColor"));
- if( initialColor != null )
+ if (initialColor != null)
{
- PropertyValue initValue = PropertyValue.CreateFromObject( initialColor );
- _transition.Add( "initialValue", initValue );
+ PropertyValue initValue = PropertyValue.CreateFromObject(initialColor);
+ _transition.Add("initialValue", initValue);
}
- PropertyValue destValue = PropertyValue.CreateFromObject( destinationColor );
- _transition.Add( "targetValue", destValue );
- TransitionData _transitionData = new TransitionData( _transition );
+ 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 );
+ animation = new Animation(NDalicManualPINVOKE.View_CreateTransition(swigCPtr, TransitionData.getCPtr(_transitionData)), true);
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
{
Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
- GetProperty( View.Property.BACKGROUND ).Get(temp);
+ GetProperty(View.Property.BACKGROUND).Get(temp);
return temp;
}
set
switch (temp)
{
case 0:
- {
- return States.Normal;
- }
+ {
+ return States.Normal;
+ }
case 1:
- {
- return States.Focused;
- }
+ {
+ return States.Focused;
+ }
case 2:
- {
- return States.Disabled;
- }
+ {
+ return States.Disabled;
+ }
default:
- {
- return States.Normal;
- }
+ {
+ return States.Normal;
+ }
}
}
set
switch (value)
{
case States.Normal:
- {
- valueToString = "NORMAL";
- break;
- }
+ {
+ valueToString = "NORMAL";
+ break;
+ }
case States.Focused:
- {
- valueToString = "FOCUSED";
- break;
- }
+ {
+ valueToString = "FOCUSED";
+ break;
+ }
case States.Disabled:
- {
- valueToString = "DISABLED";
- break;
- }
+ {
+ valueToString = "DISABLED";
+ break;
+ }
default:
- {
- valueToString = "NORMAL";
- break;
- }
+ {
+ valueToString = "NORMAL";
+ break;
+ }
}
SetProperty(View.Property.SUB_STATE, new Tizen.NUI.PropertyValue(valueToString));
}
switch (value)
{
case Tizen.NUI.HorizontalAlignmentType.Left:
- {
- valueToString = "left";
- break;
- }
+ {
+ valueToString = "left";
+ break;
+ }
case Tizen.NUI.HorizontalAlignmentType.Center:
- {
- valueToString = "center";
- break;
- }
+ {
+ valueToString = "center";
+ break;
+ }
case Tizen.NUI.HorizontalAlignmentType.Right:
- {
- valueToString = "right";
- break;
- }
+ {
+ valueToString = "right";
+ break;
+ }
default:
- {
- valueToString = "left";
- break;
- }
+ {
+ valueToString = "left";
+ break;
+ }
}
SetProperty(TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
}
switch (value)
{
case Tizen.NUI.VerticalAlignmentType.Top:
- {
- valueToString = "top";
- break;
- }
+ {
+ valueToString = "top";
+ break;
+ }
case Tizen.NUI.VerticalAlignmentType.Center:
- {
- valueToString = "center";
- break;
- }
+ {
+ valueToString = "center";
+ break;
+ }
case Tizen.NUI.VerticalAlignmentType.Bottom:
- {
- valueToString = "bottom";
- break;
- }
+ {
+ valueToString = "bottom";
+ break;
+ }
default:
- {
- valueToString = "top";
- break;
- }
+ {
+ valueToString = "top";
+ break;
+ }
}
SetProperty(TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
}
}
set
{
- if(value)
+ if (value)
{
LeftFocusableViewId = (int)value.GetId();
}
}
set
{
- if(value)
+ if (value)
{
RightFocusableViewId = (int)value.GetId();
}
}
set
{
- if(value)
+ if (value)
{
UpFocusableViewId = (int)value.GetId();
}
}
set
{
- if(value)
+ if (value)
{
DownFocusableViewId = (int)value.GetId();
}
}
/// <summary>
- /// [Obsolete("Please do not use! this will be deprecated. Please use Visibility instead.")]
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- [Obsolete("Please do not use! this will be deprecated. Please use Visibility instead.")]
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool Visible
- {
- get
- {
- return IsVisible();
- }
- }
-
- /// <summary>
/// Retrieves and sets the view's opacity.<br />
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// Please do not use! this will be deprecated!
/// Instead please use PositionUsesPivotPoint.
/// <since_tizen> 3 </since_tizen>
- [Obsolete("Please do not use! this will be deprecated, instead please use PositionUsesPivotPoint")]
+ [Obsolete("Please do not use! This will be deprecated! Please use PositionUsesPivotPoint instead! " +
+ "Like: " +
+ "View view = new View(); " +
+ "view.PivotPoint = PivotPoint.Center; " +
+ "view.PositionUsesPivotPoint = true;")]
[EditorBrowsable(EditorBrowsableState.Never)]
public bool PositionUsesAnchorPoint
{
/// Sets the sibling order of the view so the depth position can be defined within the same parent.
/// </summary>
/// <remarks>
- /// Note the initial value is 0.
+ /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
/// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
/// The values set by this property will likely change.
/// </remarks>
{
get
{
- int temp = 0;
- GetProperty(View.Property.SIBLING_ORDER).Get(out temp);
- return temp;
+ var parentChildren = GetParent()?.Children;
+ int currentOrder = 0;
+ if (parentChildren != null)
+ {
+ currentOrder = parentChildren.IndexOf(this);
+
+ if (currentOrder < 0)
+ {
+ return 0;
+ }
+ else if (currentOrder < parentChildren.Count)
+ {
+ return currentOrder;
+ }
+ }
+
+ return 0;
}
set
{
- SetProperty(View.Property.SIBLING_ORDER, new Tizen.NUI.PropertyValue(value));
+ if(value < 0)
+ {
+ NUILog.Error("SiblingOrder should be bigger than 0 or equal to 0.");
+ return;
+ }
+ var siblings = GetParent()?.Children;
+ if (siblings != null)
+ {
+ int currentOrder = siblings.IndexOf(this);
+ if (value != currentOrder)
+ {
+ if (value == 0)
+ {
+ LowerToBottom();
+ }
+ else if (value < siblings.Count - 1)
+ {
+ if (value > currentOrder)
+ {
+ RaiseAbove(siblings[value]);
+ }
+ else
+ {
+ LowerBelow(siblings[value]);
+ }
+ }
+ else
+ {
+ RaiseToTop();
+ }
+ }
+ }
}
}
/// /// Please do not use! this will be deprecated!
/// Instead please use NaturalSize2D.
/// <since_tizen> 3 </since_tizen>
- [Obsolete("Please do not use! this will be deprecated, please use NaturalSize2D instead")]
+ [Obsolete("Please do not use! This will be deprecated! Please use NaturalSize2D instead! " +
+ "Like: " +
+ "TextLabel label = new TextLabel(\"Hello World!\"); " +
+ "Size2D size = label.NaturalSize2D;")]
[EditorBrowsable(EditorBrowsableState.Never)]
public Vector3 NaturalSize
{
internal void Raise()
{
- var parentChildren = Parent?.Children;
+ var parentChildren = GetParent()?.Children;
if (parentChildren != null)
{
int currentIndex = parentChildren.IndexOf(this);
// If the view is not already the last item in the list.
- if (currentIndex != parentChildren.Count -1)
+ if (currentIndex >= 0 && currentIndex < parentChildren.Count -1)
{
View temp = parentChildren[currentIndex + 1];
parentChildren[currentIndex + 1] = this;
parentChildren[currentIndex] = temp;
+
+ NDalicPINVOKE.Raise(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
}
- NDalicPINVOKE.Raise(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
internal void Lower()
{
- var parentChildren = Parent?.Children;
+ var parentChildren = GetParent()?.Children;
if (parentChildren != null)
{
int currentIndex = parentChildren.IndexOf(this);
// If the view is not already the first item in the list.
- if (currentIndex > 0)
+ if (currentIndex > 0 && currentIndex < parentChildren.Count)
{
View temp = parentChildren[currentIndex - 1];
parentChildren[currentIndex - 1] = this;
parentChildren[currentIndex] = temp;
+
+ NDalicPINVOKE.Lower(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
}
-
- NDalicPINVOKE.Lower(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// <since_tizen> 3 </since_tizen>
public void RaiseToTop()
{
- var parentChildren = Parent?.Children;
+ var parentChildren = GetParent()?.Children;
if (parentChildren != null)
{
parentChildren.Remove(this);
parentChildren.Add(this);
+
+ NDalicPINVOKE.RaiseToTop(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- NDalicPINVOKE.RaiseToTop(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// <since_tizen> 3 </since_tizen>
public void LowerToBottom()
{
- var parentChildren = Parent?.Children;
+ var parentChildren = GetParent()?.Children;
if (parentChildren != null)
{
parentChildren.Remove(this);
parentChildren.Insert(0, this);
- }
- NDalicPINVOKE.LowerToBottom(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ NDalicPINVOKE.LowerToBottom(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
}
/// <summary>
/// <param name="target">Will be raised above this view.</param>
internal void RaiseAbove(View target)
{
- var parentChildren = Parent?.Children;
+ var parentChildren = GetParent()?.Children;
if (parentChildren != null)
{
int currentIndex = parentChildren.IndexOf(this);
int targetIndex = parentChildren.IndexOf(target);
+ if(currentIndex < 0 || targetIndex < 0 ||
+ currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
+ {
+ NUILog.Error("index should be bigger than 0 and less than children of layer count");
+ return;
+ }
// If the currentIndex is less than the target index and the target has the same parent.
if (currentIndex < targetIndex)
{
parentChildren.Remove(this);
parentChildren.Insert(targetIndex, this);
+
+ NDalicPINVOKE.RaiseAbove(swigCPtr, View.getCPtr(target));
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
}
- NDalicPINVOKE.RaiseAbove(swigCPtr, View.getCPtr(target));
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// <param name="target">Will be lowered below this view.</param>
internal void LowerBelow(View target)
{
- var parentChildren = Parent?.Children;
+ var parentChildren = GetParent()?.Children;
if (parentChildren != null)
{
int currentIndex = parentChildren.IndexOf(this);
int targetIndex = parentChildren.IndexOf(target);
+ if(currentIndex < 0 || targetIndex < 0 ||
+ currentIndex >= parentChildren.Count ||targetIndex >= parentChildren.Count)
+ {
+ NUILog.Error("index should be bigger than 0 and less than children of layer count");
+ return;
+ }
// If the currentIndex is not already the 0th index and the target has the same parent.
if ((currentIndex != 0) && (targetIndex != -1) &&
{
parentChildren.Remove(this);
parentChildren.Insert(targetIndex, this);
+
+ NDalicPINVOKE.LowerBelow(swigCPtr, View.getCPtr(target));
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
}
- NDalicPINVOKE.LowerBelow(swigCPtr, View.getCPtr(target));
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
internal string GetName()
[EditorBrowsable(EditorBrowsableState.Never)]
public Layer GetLayer()
{
+ //to fix memory leak issue, match the handle count with native side.
IntPtr cPtr = NDalicPINVOKE.Actor_GetLayer(swigCPtr);
- Layer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Layer;
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ Layer ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Layer;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
/// <since_tizen> 3 </since_tizen>
public View FindChildByName(string viewName)
{
+ //to fix memory leak issue, match the handle count with native side.
IntPtr cPtr = NDalicPINVOKE.Actor_FindChildByName(swigCPtr, viewName);
-
- View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
internal View FindChildById(uint id)
{
+ //to fix memory leak issue, match the handle count with native side.
IntPtr cPtr = NDalicPINVOKE.Actor_FindChildById(swigCPtr, id);
-
- View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
/// <since_tizen> 3 </since_tizen>
public Renderer GetRendererAt(uint index)
{
+ //to fix memory leak issue, match the handle count with native side.
IntPtr cPtr = NDalicPINVOKE.Actor_GetRendererAt(swigCPtr, index);
- Renderer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Renderer;
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ Renderer ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Renderer;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- internal ViewVisibilityChangedSignal VisibilityChangedSignal(View view) {
+ internal ViewVisibilityChangedSignal VisibilityChangedSignal(View view)
+ {
ViewVisibilityChangedSignal ret = new ViewVisibilityChangedSignal(NDalicPINVOKE.VisibilityChangedSignal(View.getCPtr(view)), false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- internal ViewLayoutDirectionChangedSignal LayoutDirectionChangedSignal(View view) {
+ internal ViewLayoutDirectionChangedSignal LayoutDirectionChangedSignal(View view)
+ {
ViewLayoutDirectionChangedSignal ret = new ViewLayoutDirectionChangedSignal(NDalicManualPINVOKE.LayoutDirectionChangedSignal(View.getCPtr(view)), false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
switch (temp)
{
case "NORMAL":
- return DrawModeType.Normal;
+ return DrawModeType.Normal;
case "OVERLAY_2D":
- return DrawModeType.Overlay2D;
+ return DrawModeType.Overlay2D;
case "STENCIL":
- return DrawModeType.Stencil;
+ return DrawModeType.Stencil;
default:
- return DrawModeType.Normal;
+ return DrawModeType.Normal;
}
}
set
/// <summary>
/// Gets or sets the padding for use in layout.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public Vector4 Padding
+ /// <since_tizen> 4 </since_tizen>
+ public Extents Padding
{
get
{
- Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
+ Extents temp = new Extents(0, 0, 0, 0);
GetProperty(View.Property.PADDING).Get(temp);
return temp;
}
switch (temp)
{
case "DISABLED":
- return ClippingModeType.Disabled;
+ return ClippingModeType.Disabled;
case "CLIP_CHILDREN":
- return ClippingModeType.ClipChildren;
+ return ClippingModeType.ClipChildren;
case "CLIP_TO_BOUNDING_BOX":
- return ClippingModeType.ClipToBoundingBox;
+ return ClippingModeType.ClipToBoundingBox;
default:
- return ClippingModeType.Disabled;
+ return ClippingModeType.Disabled;
}
}
set
}
}
-
-
- /// <summary>
- /// [Obsolete("Please do not use! this will be deprecated")]
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- /// Please do not use! this will be deprecated!
- /// Instead please use TouchEvent.
- [Obsolete("Please do not use! this will be deprecated, instead please use TouchEvent.")]
- [EditorBrowsable(EditorBrowsableState.Never)]
- 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);
- }
-
- }
- }
-
- /// <summary>
- /// [Obsolete("Please do not use! this will be deprecated")]
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- /// Please do not use! this will be deprecated!
- /// Instead please use HoverEvent.
- [Obsolete("Please do not use! this will be deprecated, instead please use HoverEvent.")]
- [EditorBrowsable(EditorBrowsableState.Never)]
- 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);
- }
-
- }
- }
-
- /// <summary>
- /// Please do not use! this will be deprecated.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- /// Please do not use! this will be deprecated!
- /// Instead please use WheelEvent.
- [Obsolete("Please do not use! this will be deprecated, instead please use WheelEvent.")]
- [EditorBrowsable(EditorBrowsableState.Never)]
- 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);
- }
-
- }
- }
-
/// <summary>
/// [Obsolete("Please do not use! this will be deprecated")]
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// Please do not use! this will be deprecated!
/// Instead please use PivotPoint.
- [Obsolete("Please do not use! this will be deprecated, instead please use PivotPoint")]
+ [Obsolete("Please do not use! This will be deprecated! Please use PivotPoint instead! " +
+ "Like: " +
+ "View view = new View(); " +
+ "view.PivotPoint = PivotPoint.Center; " +
+ "view.PositionUsesPivotPoint = true;")]
[EditorBrowsable(EditorBrowsableState.Never)]
public Position AnchorPoint
{
/// [Obsolete("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 Size2D instead")]
+ [Obsolete("Please do not use! This will be deprecated! Please use Size2D instead! " +
+ "Like: " +
+ "View view = new View(); " +
+ "view.Size2D = new Size2D(100, 100);")]
[EditorBrowsable(EditorBrowsableState.Never)]
public Size Size
{
}
/// <summary>
- /// [Obsolete("Please do not use! this will be deprecated")]
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- /// Please do not use! this will be deprecated!
- /// Instead please use AddedToWindow.
- [Obsolete("Please do not use! this will be deprecated, instead please use AddedToWindow")]
- [EditorBrowsable(EditorBrowsableState.Never)]
- 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);
- }
- }
- }
-
- /// <summary>
- /// [Obsolete("Please do not use! this will be deprecated")]
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- /// Please do not use! this will be deprecated!
- /// Instead please use RemovedFromWindow.
- [Obsolete("Please do not use! this will be deprecated, instead please use RemovedFromWindow")]
- [EditorBrowsable(EditorBrowsableState.Never)]
- 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);
- }
- }
- }
-
- /// <summary>
- /// [Obsolete("Please do not use! this will be deprecated")]
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- /// Please do not use! this will be deprecated!
- /// Instead please use Relayout.
- [Obsolete("Please do not use! this will be deprecated, instead please use Relayout")]
- [EditorBrowsable(EditorBrowsableState.Never)]
- 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);
- }
-
- }
- }
-
- /// <summary>
/// "Please DO NOT use! This will be deprecated! Please use 'Container GetParent() for derived class' instead!"
/// </summary>
/// <since_tizen> 3 </since_tizen>
- //"Please DO NOT use! This will be deprecated! Please use 'Container GetParent() for derived class' instead!"
- /// <since_tizen> 3 </since_tizen>
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
+ [Obsolete("Please do not use! This will be deprecated! Please use 'Container GetParent() for derived class' instead! " +
+ "Like: " +
+ "Container parent = view.GetParent(); " +
+ "View view = parent as View;")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public new View Parent
{
get
{
View ret;
IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr);
-
BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr);
+ //HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ //BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
+ //NDalicPINVOKE.delete_BaseHandle(CPtr);
+ //CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
if (basehandle is Layer)
{
}
/// <summary>
- /// Gets or sets the Padding for use in layout.
+ /// [Obsolete("Please do not use! this will be deprecated")]
/// </summary>
+ /// Please do not use! this will be deprecated!
+ /// Instead please use Padding.
/// <since_tizen> 4 </since_tizen>
+ [Obsolete("Please do not use! this will be deprecated, instead please use Padding.")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public Extents PaddingEX
{
get
{
Extents temp = new Extents(0, 0, 0, 0);
- GetProperty(View.Property.PADDINGEX).Get(temp);
+ GetProperty(View.Property.PADDING).Get(temp);
return temp;
}
set
{
- SetProperty(View.Property.PADDINGEX, new Tizen.NUI.PropertyValue(value));
+ SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value));
}
}
+
+ /// <summary>
+ /// Perform an action on a visual registered to this view. <br />
+ /// Visuals will have actions, this API is used to perform one of these actions with the given attributes.
+ /// </summary>
+ /// <param name="propertyIndexOfVisual">The Property index of the visual.</param>
+ /// <param name="propertyIndexOfActionId">The action to perform. See Visual to find supported actions.</param>
+ /// <param name="attributes">Optional attributes for the action.</param>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void DoAction(int propertyIndexOfVisual, int propertyIndexOfActionId, PropertyValue attributes)
+ {
+ NDalicManualPINVOKE.View_DoAction(swigCPtr, propertyIndexOfVisual, propertyIndexOfActionId, PropertyValue.getCPtr(attributes));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
}
/// <summary>