Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 6 additions & 0 deletions src/Tizen.NUI/src/internal/Interop/Interop.ActorProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,12 @@ internal static partial class ActorProperty

[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Actor_Property_CHILDREN_DEPTH_INDEX_POLICY_get")]
public static extern int ChildrenDepthIndexPolicyGet();

[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Actor_Property_IGNORED_get")]
public static extern int IgnoredGet();

[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Actor_Property_WORLD_IGNORED_get")]
public static extern int WorldIgnoredGet();
}
}
}
33 changes: 26 additions & 7 deletions src/Tizen.NUI/src/public/BaseComponents/View.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7225,17 +7225,36 @@ public bool Ignored

private void SetInternalIgnored(bool ignored)
{
Interop.Actor.SetIgnored(SwigCPtr, ignored);
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
Object.InternalSetPropertyBool(SwigCPtr, Property.Ignored, ignored);
}

private bool IsInternalIgnored()
{
bool isIgnored = Interop.Actor.IsIgnored(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return isIgnored;
return Object.InternalGetPropertyBool(SwigCPtr, Property.Ignored);
}

/// <summary>
/// Gets the flag to identify the View is ignored or not currently.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public bool CurrentIgnored
{
get
{
return IsCurrentIgnored();
}
}

/// <summary>
/// Gets the flag to identify the View is world ignored or not currently.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public bool WorldIgnored
{
get
{
return IsWorldIgnored();
}
}

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions src/Tizen.NUI/src/public/BaseComponents/ViewEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ internal class Property
internal static readonly int DispatchTouchMotion = Interop.ActorProperty.DispatchTouchMotionGet();
internal static readonly int DispatchHoverMotion = Interop.ActorProperty.DispatchHoverMotionGet();
internal static readonly int ChildrenDepthIndexPolicy = Interop.ActorProperty.ChildrenDepthIndexPolicyGet();
internal static readonly int Ignored = Interop.ActorProperty.IgnoredGet();
internal static readonly int WorldIgnored = Interop.ActorProperty.WorldIgnoredGet();
internal static readonly int OffScreenRendering = Interop.ViewProperty.OffScreenRenderingGet();
internal static readonly int InnerShadow = Interop.ViewProperty.InnerShadowGet();
internal static readonly int Borderline = Interop.ViewProperty.BorderlineGet();
Expand Down
17 changes: 17 additions & 0 deletions src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,23 @@ internal Vector4 GetCurrentWorldColor()
return internalCurrentWorldColor;
}

internal bool IsCurrentIgnored()
{
// TODO : Need to bind new API for current property getter
using var value = Object.GetCurrentProperty(SwigCPtr, Property.Ignored);
bool ret = false;
if (value != null)
{
value.Get(out ret);
}
return ret;
}

internal bool IsWorldIgnored()
{
return Object.InternalGetPropertyBool(SwigCPtr, Property.WorldIgnored);
}

internal void SetDrawMode(DrawModeType drawMode)
{
Interop.ActorInternal.SetDrawMode(SwigCPtr, (int)drawMode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ public class FrameUpdateCallbackToggleTest : IExample
private TextLabel ignoredLabel;
private IgnoredToggler ignoredToggler;

private PropertyNotification lessThanNotification;
private PropertyNotification greaterThanNotification;
private TextLabel lessThanLabel;
private TextLabel greaterThanLabel;

// FrameUpdateCallback to toggle the ignored state of an actor
private class IgnoredToggler : FrameUpdateCallbackInterface
{
Expand Down Expand Up @@ -110,13 +115,67 @@ public void Activate()
// Pass null as the root view, as the callback doesn't need to be tied to a specific view's lifecycle
// and Layer cannot be directly cast to View for this method.
window.AddFrameUpdateCallback(ignoredToggler, null);

// Create TextLabels to display the property notification
lessThanNotification = imageView.AddPropertyNotification("Ignored", PropertyCondition.LessThan(0.5f));
lessThanNotification.Notified += (o, e) =>
{
if (lessThanLabel != null)
{
lessThanLabel.Ignored = false;
}
if (greaterThanLabel != null)
{
greaterThanLabel.Ignored = true;
}
};
lessThanLabel = new TextLabel("1 -> 0 Notified")
{
ParentOrigin = ParentOrigin.TopLeft,
PivotPoint = PivotPoint.TopLeft,
PositionUsesPivotPoint = true,
TextColor = Color.Black,
HorizontalAlignment = HorizontalAlignment.Begin,
PointSize = 12
};
window.GetDefaultLayer().Add(lessThanLabel); // Add to window directly
lessThanLabel.Ignored = true;

greaterThanNotification = imageView.AddPropertyNotification("Ignored", PropertyCondition.GreaterThan(0.5f));
greaterThanNotification.Notified += (o, e) =>
{
if (lessThanLabel != null)
{
lessThanLabel.Ignored = true;
}
if (greaterThanLabel != null)
{
greaterThanLabel.Ignored = false;
}
};
greaterThanLabel = new TextLabel("0 -> 1 Notified")
{
ParentOrigin = ParentOrigin.TopRight,
PivotPoint = PivotPoint.TopRight,
PositionUsesPivotPoint = true,
TextColor = Color.Black,
HorizontalAlignment = HorizontalAlignment.End,
PointSize = 12
};
window.GetDefaultLayer().Add(greaterThanLabel); // Add to window directly
greaterThanLabel.Ignored = true;


}

public void Deactivate()
{
if (ignoredToggler != null)
{
window.RemoveFrameUpdateCallback(ignoredToggler);
if (window != null)
{
window.RemoveFrameUpdateCallback(ignoredToggler);
}
ignoredToggler = null;
}

Expand All @@ -134,8 +193,32 @@ public void Deactivate()
visibleLabel = null;
}

if (lessThanLabel != null)
{
lessThanLabel.Unparent();
lessThanLabel.Dispose();
lessThanLabel = null;
}

if (greaterThanLabel != null)
{
greaterThanLabel.Unparent();
greaterThanLabel.Dispose();
greaterThanLabel = null;
}

if (imageView != null)
{
if (lessThanNotification != null)
{
imageView.RemovePropertyNotification(lessThanNotification);
lessThanNotification.Dispose();
}
if (greaterThanNotification != null)
{
imageView.RemovePropertyNotification(greaterThanNotification);
greaterThanNotification.Dispose();
}
imageView.Unparent();
imageView.Dispose();
imageView = null;
Expand Down
Loading