return ret;
}
- /// <summary>
- /// Callback when CornerRadius property changed.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- internal override void ApplyCornerRadius()
- {
- base.ApplyCornerRadius();
-
- if (backgroundExtraData == null) return;
-
- // Update corner radius properties to image by ActionUpdateProperty
- if (backgroundExtraDataUpdatedFlag.HasFlag(BackgroundExtraDataUpdatedFlag.ContentsCornerRadius))
- {
- if (backgroundExtraData.CornerRadius != null)
- {
- using var setValue = new Tizen.NUI.PropertyValue(backgroundExtraData.CornerRadius);
- SetProperty(Interop.SceneView.CornerRadiusGet(), setValue);
- }
- if (backgroundExtraData.CornerSquareness != null)
- {
- using var setValue = new Tizen.NUI.PropertyValue(backgroundExtraData.CornerSquareness);
- SetProperty(Interop.SceneView.CornerSquarenessGet(), setValue);
- }
- {
- using var setValue = new Tizen.NUI.PropertyValue((int)backgroundExtraData.CornerRadiusPolicy);
- SetProperty(Interop.SceneView.CornerRadiusPolicyGet(), setValue);
- }
- }
- }
-
/// <summary>
/// Callback when Borderline property changed.
/// </summary>
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_Property_OFFSCREEN_RENDERING_get")]
public static extern int OffScreenRenderingGet();
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_Property_CORNER_RADIUS_POLICY_get")]
+ public static extern int CornerRadiusPolicyGet();
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_Property_CORNER_RADIUS_get")]
+ public static extern int CornerRadiusGet();
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_Property_CORNER_SQUARENESS_get")]
+ public static extern int CornerSquarenessGet();
}
}
}
return ret;
}
- [EditorBrowsable(EditorBrowsableState.Never)]
- internal override void ApplyCornerRadius()
- {
- base.ApplyCornerRadius();
-
- if (backgroundExtraData == null) return;
-
- // Update corner radius properties to image by ActionUpdateProperty
- if (backgroundExtraDataUpdatedFlag.HasFlag(BackgroundExtraDataUpdatedFlag.ContentsCornerRadius))
- {
- if (backgroundExtraData.CornerRadius != null)
- {
- _ = Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, ImageView.Property.IMAGE, Visual.Property.CornerRadius, Vector4.getCPtr(backgroundExtraData.CornerRadius));
- }
- if (backgroundExtraData.CornerSquareness != null)
- {
- _ = Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, ImageView.Property.IMAGE, Visual.Property.CornerSquareness, Vector4.getCPtr(backgroundExtraData.CornerSquareness));
- }
- _ = Interop.View.InternalUpdateVisualPropertyInt(this.SwigCPtr, ImageView.Property.IMAGE, Visual.Property.CornerRadiusPolicy, (int)backgroundExtraData.CornerRadiusPolicy);
- }
- }
-
[EditorBrowsable(EditorBrowsableState.Never)]
internal override void ApplyBorderline()
{
}
}
- if (backgroundExtraData != null && backgroundExtraData.CornerRadius != null)
- {
- cachedImagePropertyMap.Set(Visual.Property.CornerRadius, backgroundExtraData.CornerRadius);
- cachedImagePropertyMap.Set(Visual.Property.CornerRadiusPolicy, (int)backgroundExtraData.CornerRadiusPolicy);
-
- if (backgroundExtraData.CornerSquareness != null)
- {
- cachedImagePropertyMap.Set(Visual.Property.CornerSquareness, backgroundExtraData.CornerSquareness);
- }
- }
-
if (backgroundExtraData != null && backgroundExtraData.BorderlineWidth > 0.0f)
{
cachedImagePropertyMap.Set(Visual.Property.BorderlineWidth, backgroundExtraData.BorderlineWidth);
}
// We already applied background extra data now.
- backgroundExtraDataUpdatedFlag &= ~BackgroundExtraDataUpdatedFlag.ContentsCornerRadius;
backgroundExtraDataUpdatedFlag &= ~BackgroundExtraDataUpdatedFlag.ContentsBorderline;
UpdateImageMap();
if (backgroundExtraData != null)
{
- if (backgroundExtraData.CornerRadius != null || backgroundExtraData.CornerSquareness != null)
- {
- UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.ContentsCornerRadius);
- }
if (backgroundExtraData.BorderlineWidth > 0.0f)
{
UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.ContentsBorderline);
}
}
- private void SetInternalCornerRadius(Vector4 newValue)
+ private void SetInternalCornerRadius(Vector4 cornerRadius)
{
- (backgroundExtraData ?? (backgroundExtraData = new BackgroundExtraData())).CornerRadius = newValue;
- UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.CornerRadius);
+ Object.InternalSetPropertyVector4(SwigCPtr, Property.CornerRadius, cornerRadius.SwigCPtr);
}
private Vector4 GetInternalCornerRadius()
{
- return backgroundExtraData == null ? Vector4.Zero : backgroundExtraData.CornerRadius;
+ Vector4 value = new Vector4();
+ Object.InternalRetrievingPropertyVector4(SwigCPtr, Property.CornerRadius, value.SwigCPtr);
+ return value;
}
/// <summary>
}
}
- private void SetInternalCornerRadiusPolicy(VisualTransformPolicyType value)
+ private void SetInternalCornerRadiusPolicy(VisualTransformPolicyType cornerRadiusPolicy)
{
- (backgroundExtraData ?? (backgroundExtraData = new BackgroundExtraData())).CornerRadiusPolicy = value;
-
- if (backgroundExtraData.CornerRadius != null)
- {
- UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.CornerRadius);
- }
+ Object.InternalSetPropertyInt(SwigCPtr, Property.CornerRadiusPolicy, (int)cornerRadiusPolicy);
}
private VisualTransformPolicyType GetInternalCornerRadiusPolicy()
{
- return backgroundExtraData == null ? VisualTransformPolicyType.Absolute : backgroundExtraData.CornerRadiusPolicy;
+ return (VisualTransformPolicyType)(Object.InternalGetPropertyInt(SwigCPtr, Property.CornerRadiusPolicy));
}
/// <summary>
{
get
{
- return GetInternalCornerSqurenessProperty();
+ return GetInternalCornerSqureness();
}
set
{
- SetInternalCornerSqurenessProperty(value);
+ SetInternalCornerSqureness(value);
NotifyPropertyChanged();
}
}
- internal void SetInternalCornerSqurenessProperty(Vector4 cornerSquareness)
+ internal void SetInternalCornerSqureness(Vector4 cornerSquareness)
{
- (backgroundExtraData ?? (backgroundExtraData = new BackgroundExtraData())).CornerSquareness = cornerSquareness;
- UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.CornerRadius);
+ Object.InternalSetPropertyVector4(SwigCPtr, Property.CornerSquareness, cornerSquareness.SwigCPtr);
}
- internal Vector4 GetInternalCornerSqurenessProperty()
+ internal Vector4 GetInternalCornerSqureness()
{
- return backgroundExtraData == null ? Vector4.Zero : backgroundExtraData.CornerSquareness;
+ Vector4 value = new Vector4();
+ Object.InternalRetrievingPropertyVector4(SwigCPtr, Property.CornerSquareness, value.SwigCPtr);
+ return value;
}
/// <summary>
if (backgroundExtraData != null)
{
- map.Add(Visual.Property.CornerRadius, backgroundExtraData.CornerRadius)
- .Add(Visual.Property.CornerSquareness, backgroundExtraData.CornerSquareness)
- .Add(Visual.Property.CornerRadiusPolicy, (int)backgroundExtraData.CornerRadiusPolicy)
- .Add(Visual.Property.BorderlineWidth, backgroundExtraData.BorderlineWidth)
+ map.Add(Visual.Property.BorderlineWidth, backgroundExtraData.BorderlineWidth)
.Add(Visual.Property.BorderlineColor, backgroundExtraData.BorderlineColor == null ? Color.Black : backgroundExtraData.BorderlineColor)
.Add(Visual.Property.BorderlineOffset, backgroundExtraData.BorderlineOffset);
}
map.Add(Visual.Property.Type, (int)Visual.Type.Color)
.Add(ColorVisualProperty.MixColor, value)
- .Add(Visual.Property.CornerRadius, backgroundExtraData.CornerRadius)
- .Add(Visual.Property.CornerSquareness, backgroundExtraData.CornerSquareness)
- .Add(Visual.Property.CornerRadiusPolicy, (int)(backgroundExtraData.CornerRadiusPolicy))
.Add(Visual.Property.BorderlineWidth, backgroundExtraData.BorderlineWidth)
.Add(Visual.Property.BorderlineColor, backgroundExtraData.BorderlineColor == null ? Color.Black : backgroundExtraData.BorderlineColor)
.Add(Visual.Property.BorderlineOffset, backgroundExtraData.BorderlineOffset);
private void SetShadow(ShadowBase value)
{
- backgroundExtraDataUpdatedFlag &= ~BackgroundExtraDataUpdatedFlag.Shadow;
Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)SwigCPtr, View.Property.SHADOW, value == null ? new PropertyValue() : value.ToPropertyValue(this));
}
}
internal static readonly int DispatchTouchMotion = Interop.ActorProperty.DispatchTouchMotionGet();
internal static readonly int DispatchHoverMotion = Interop.ActorProperty.DispatchHoverMotionGet();
internal static readonly int OffScreenRendering = Interop.ViewProperty.OffScreenRenderingGet();
+ internal static readonly int CornerRadiusPolicy = Interop.ViewProperty.CornerRadiusPolicyGet();
+ internal static readonly int CornerRadius = Interop.ViewProperty.CornerRadiusGet();
+ internal static readonly int CornerSquareness = Interop.ViewProperty.CornerSquarenessGet();
}
}
}
[Flags]
internal enum BackgroundExtraDataUpdatedFlag : byte
{
- BackgroundCornerRadius = 1 << 0,
BackgroundBorderline = 1 << 1,
- ShadowCornerRadius = 1 << 2,
- ContentsCornerRadius = 1 << 3, /// Subclass cases.
ContentsBorderline = 1 << 4, /// Subclass cases.
- Background = BackgroundCornerRadius | BackgroundBorderline,
- Shadow = ShadowCornerRadius,
+ Background = BackgroundBorderline,
- CornerRadius = BackgroundCornerRadius | ShadowCornerRadius | ContentsCornerRadius,
Borderline = BackgroundBorderline | ContentsBorderline,
None = 0,
- All = Background | Shadow,
+ All = Background,
}
internal BackgroundExtraDataUpdatedFlag backgroundExtraDataUpdatedFlag = BackgroundExtraDataUpdatedFlag.None;
return;
}
- if (IsShadowEmpty())
- {
- backgroundExtraDataUpdatedFlag &= ~BackgroundExtraDataUpdatedFlag.Shadow;
- }
if (!Rectangle.IsNullOrZero(backgroundExtraData.BackgroundImageBorder))
{
backgroundExtraDataUpdatedFlag &= ~BackgroundExtraDataUpdatedFlag.Background;
{
ApplyBorderline();
}
- if ((backgroundExtraDataUpdatedFlag & BackgroundExtraDataUpdatedFlag.CornerRadius) != BackgroundExtraDataUpdatedFlag.None)
- {
- ApplyCornerRadius();
- }
+
backgroundExtraDataUpdatedFlag = BackgroundExtraDataUpdatedFlag.None;
}
- [EditorBrowsable(EditorBrowsableState.Never)]
+ [Obsolete("Do not use this, that is deprecated in API13.")]
internal virtual void ApplyCornerRadius()
{
- if (backgroundExtraData == null) return;
-
- // Update corner radius properties to background and shadow by ActionUpdateProperty
- if (backgroundExtraDataUpdatedFlag.HasFlag(BackgroundExtraDataUpdatedFlag.BackgroundCornerRadius))
- {
- if (backgroundExtraData.CornerRadius != null)
- {
- _ = Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, View.Property.BACKGROUND, Visual.Property.CornerRadius, Vector4.getCPtr(backgroundExtraData.CornerRadius));
- }
- if (backgroundExtraData.CornerSquareness != null)
- {
- _ = Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, View.Property.BACKGROUND, Visual.Property.CornerSquareness, Vector4.getCPtr(backgroundExtraData.CornerSquareness));
- }
- _ = Interop.View.InternalUpdateVisualPropertyInt(this.SwigCPtr, View.Property.BACKGROUND, Visual.Property.CornerRadiusPolicy, (int)backgroundExtraData.CornerRadiusPolicy);
- }
- if (backgroundExtraDataUpdatedFlag.HasFlag(BackgroundExtraDataUpdatedFlag.ShadowCornerRadius))
- {
- if (backgroundExtraData.CornerRadius != null)
- {
- _ = Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, View.Property.SHADOW, Visual.Property.CornerRadius, Vector4.getCPtr(backgroundExtraData.CornerRadius));
- }
- if (backgroundExtraData.CornerSquareness != null)
- {
- _ = Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, View.Property.SHADOW, Visual.Property.CornerSquareness, Vector4.getCPtr(backgroundExtraData.CornerSquareness));
- }
- _ = Interop.View.InternalUpdateVisualPropertyInt(this.SwigCPtr, View.Property.SHADOW, Visual.Property.CornerRadiusPolicy, (int)backgroundExtraData.CornerRadiusPolicy);
- }
+ Tizen.Log.Error("NUI", "ApplyCornerRadius() deprecated internally, Please don't use it.\n");
}
[EditorBrowsable(EditorBrowsableState.Never)]
using var map = new PropertyMap()
.Append(Visual.Property.Type, (int)Visual.Type.Color)
.Append(ColorVisualProperty.MixColor, color)
- .Append(Visual.Property.CornerRadius, backgroundExtraData.CornerRadius)
- .Append(Visual.Property.CornerSquareness, backgroundExtraData.CornerSquareness)
- .Append(Visual.Property.CornerRadiusPolicy, (int)backgroundExtraData.CornerRadiusPolicy)
.Append(Visual.Property.BorderlineWidth, backgroundExtraData.BorderlineWidth)
.Append(Visual.Property.BorderlineColor, backgroundExtraData.BorderlineColor ?? Color.Black)
.Append(Visual.Property.BorderlineOffset, backgroundExtraData.BorderlineOffset);
- backgroundExtraDataUpdatedFlag &= ~BackgroundExtraDataUpdatedFlag.Background;
-
Object.InternalSetPropertyMap(SwigCPtr, Property.BACKGROUND, map.SwigCPtr);
}
{
themeData?.selectorData?.ClearShadow(this);
- backgroundExtraDataUpdatedFlag &= ~BackgroundExtraDataUpdatedFlag.Shadow;
-
using var map = shadow.BuildMap(this);
Object.InternalSetPropertyMap(SwigCPtr, Property.SHADOW, map.SwigCPtr);
internal BackgroundExtraData(BackgroundExtraData other)
{
BackgroundImageBorder = other.BackgroundImageBorder;
- CornerRadius = other.CornerRadius;
- CornerSquareness = other.CornerSquareness;
- CornerRadiusPolicy = other.CornerRadiusPolicy;
BorderlineWidth = other.BorderlineWidth;
BorderlineColor = other.BorderlineColor;
BorderlineOffset = other.BorderlineOffset;
}
/// <summary></summary>
+ [Obsolete("Do not use this, that is deprecated in API13.")]
internal Vector4 CornerRadius { get; set; }
/// <summary></summary>
+ [Obsolete("Do not use this, that is deprecated in API13.")]
internal Vector4 CornerSquareness { get; set; }
/// <summary>
/// Whether the CornerRadius value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
/// </summary>
+ [Obsolete("Do not use this, that is deprecated in API13.")]
internal VisualTransformPolicyType CornerRadiusPolicy { get; set; } = VisualTransformPolicyType.Absolute;
/// <summary></summary>
return ret;
}
- [EditorBrowsable(EditorBrowsableState.Never)]
- internal override void ApplyCornerRadius()
- {
- base.ApplyCornerRadius();
-
- if (backgroundExtraData == null)
- {
- return;
- }
-
- // Update corner radius properties to webView by ActionUpdateProperty
- if (backgroundExtraData.CornerRadius != null)
- {
- _ = Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, WebView.Property.Url, Visual.Property.CornerRadius, Vector4.getCPtr(backgroundExtraData.CornerRadius));
- }
- if (backgroundExtraData.CornerSquareness != null)
- {
- _ = Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, WebView.Property.Url, Visual.Property.CornerSquareness, Vector4.getCPtr(backgroundExtraData.CornerSquareness));
- }
- _ = Interop.View.InternalUpdateVisualPropertyInt(this.SwigCPtr, WebView.Property.Url, Visual.Property.CornerRadiusPolicy, (int)backgroundExtraData.CornerRadiusPolicy);
- }
-
private void OnPageLoadStarted(string pageUrl)
{
WebViewPageLoadEventArgs e = new WebViewPageLoadEventArgs();
tlog.Debug(tag, $"ImageViewIsResourceReady END (OK)");
}
-
- [Test]
- [Category("P1")]
- [Description("ImageView ApplyCornerRadius.")]
- [Property("SPEC", "Tizen.NUI.ImageView.ApplyCornerRadius M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
- public void ImageViewApplyCornerRadius()
- {
- tlog.Debug(tag, $"ImageViewApplyCornerRadius START");
-
- var testingTarget = new ImageView();
- Assert.IsNotNull(testingTarget, "Can't create success object ImageView");
- Assert.IsInstanceOf<ImageView>(testingTarget, "Should be an instance of ImageView type.");
-
- try
- {
- testingTarget.ApplyCornerRadius();
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- Assert.Fail("Caught Exception: Failed!");
- }
-
- testingTarget.Dispose();
- tlog.Debug(tag, $"ImageViewApplyCornerRadius END (OK)");
- }
- [Test]
- [Category("P1")]
- [Description("ImageView ApplyCornerRadius.")]
- [Property("SPEC", "Tizen.NUI.ImageView.ApplyCornerRadius M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
- public void ImageViewApplyCornerRadiusWithBackgroundExtraData()
- {
- tlog.Debug(tag, $"ImageViewApplyCornerRadiusWithBackgroundExtraData START");
-
- var testingTarget = new ImageView();
- Assert.IsNotNull(testingTarget, "Can't create success object ImageView");
- Assert.IsInstanceOf<ImageView>(testingTarget, "Should be an instance of ImageView type.");
-
- testingTarget.CornerRadius = new Vector4(0.3f, 0.8f, 0.6f, 1.0f);
-
- try
- {
- testingTarget.ApplyCornerRadius();
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- Assert.Fail("Caught Exception: Failed!");
- }
-
- testingTarget.Dispose();
- tlog.Debug(tag, $"ImageViewApplyCornerRadiusWithBackgroundExtraData END (OK)");
- }
[Test]
[Category("P1")]