Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NUI] Remove DALi instance from Size #6688

Open
wants to merge 4 commits into
base: DevelNUI
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/Tizen.NUI/src/public/BaseComponents/TextUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,10 @@ public Size Size
{
set
{
Interop.EmbeddedItemInfo.SizeSet(SwigCPtr, Size.getCPtr(value));
var handle = Size.GetHandleRef(value);
Interop.EmbeddedItemInfo.SizeSet(SwigCPtr, handle);
Size.ReleaseHandleRef(handle);

if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
Expand All @@ -778,7 +781,10 @@ public Size RotatedSize
{
set
{
Interop.EmbeddedItemInfo.RotatedSizeSet(SwigCPtr, Size.getCPtr(value));
var handleRef = Size.GetHandleRef(value);
Interop.EmbeddedItemInfo.RotatedSizeSet(SwigCPtr, handleRef);
Size.ReleaseHandleRef (handleRef);

if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
Expand Down
12 changes: 11 additions & 1 deletion src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,17 @@ internal static object GetInternalSizeProperty(BindableObject bindable)
{
view.internalSize = new Size(view.OnSizeChanged, 0, 0, 0);
}
Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.SIZE, view.internalSize.SwigCPtr);

var w = Interop.Actor.InternalGetPropertyFloat(view.SwigCPtr, Property.SizeWidth);
var h = Interop.Actor.InternalGetPropertyFloat(view.SwigCPtr, Property.SizeHeight);
var d = view.sizeDepth;

view.internalSize.ResetValue(w, h, d);

if (NDalicPINVOKE.SWIGPendingException.Pending)
{
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}

return view.internalSize;
}
Expand Down
2 changes: 2 additions & 0 deletions src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,10 @@ internal void SetSize(float width, float height)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}

private float sizeDepth = 0.0f;
internal void SetSize(float width, float height, float depth)
{
sizeDepth = depth;
Interop.ActorInternal.SetSize(SwigCPtr, width, height, depth);
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
Expand Down
16 changes: 11 additions & 5 deletions src/Tizen.NUI/src/public/Common/PropertyValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,8 @@ public PropertyValue(PropertyValue value) : this(Interop.PropertyValue.NewProper
/// Creates a Size property value.
/// </summary>
/// <param name="vectorValue">Size values.</param>
internal PropertyValue(Size vectorValue) : this(Interop.PropertyValue.NewPropertyValueVector3(Size.getCPtr(vectorValue)), true)
internal PropertyValue(Size vectorValue) : this(vectorValue.Width, vectorValue.Height, vectorValue.Depth)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
internal PropertyValue(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
Expand Down Expand Up @@ -548,7 +547,8 @@ static public PropertyValue CreateFromObject(System.Object obj)
}
else if (type.Equals(typeof(Size)))
{
value = Interop.PropertyValue.NewPropertyValueVector3(Size.getCPtr((Size)obj));
var size = obj as Size;
value = Interop.PropertyValue.NewPropertyValueVector3Componentwise(size.Width, size.Height, size.Depth);
}
else if (type.Equals(typeof(Size2D)))
{
Expand Down Expand Up @@ -655,8 +655,14 @@ public bool Get(Position2D vectorValue)
[EditorBrowsable(EditorBrowsableState.Never)]
public bool Get(Size vectorValue)
{
bool ret = Interop.PropertyValue.GetVector3(SwigCPtr, Size.getCPtr(vectorValue));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
if (null == vectorValue)
{
throw new ArgumentNullException(nameof(vectorValue));
}

var ret = GetVector3Component(out var w, out var h, out var d);
vectorValue.ResetValue(w, h, d);

return ret;
}

Expand Down
Loading
Loading