* limitations under the License.
*
*/
-
+
namespace Tizen.NUI
{
internal static partial class Interop
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Drawable_Transform")]
public static extern bool Transform(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] float[] jarg2);
}
-}
}
+}
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_New")]
public static extern global::System.IntPtr New();
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_AddRect")]
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_AddRect")]
public static extern bool AddRect(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2, float jarg3, float jarg4, float jarg5, float jarg6, float jarg7);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_AddCircle")]
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_SetStrokeDash")]
public static extern void SetStrokeDash(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] float[] jarg2, int jarg3);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_GetStrokeDashIndexOf")]
public static extern float GetStrokeDashIndexOf(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shape_GetStrokeDashCount")]
public static extern int GetStrokeDashCount(global::System.Runtime.InteropServices.HandleRef jarg1);
namespace Tizen.NUI.BaseComponents.VectorGraphics
{
/// <summary>
- /// CanvasView is a class for displaying vector primitives.<br />
+ /// CanvasView is a class for displaying vector primitives.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public class CanvasView : View
- {
+ {
static CanvasView() { }
/// <summary>
}
/// <summary>
- /// you can override it to clean-up your own resources.
+ /// You can override it to clean-up your own resources.
/// </summary>
/// <param name="type">DisposeTypes</param>
[EditorBrowsable(EditorBrowsableState.Never)]
Interop.CanvasView.DeleteCanvasView(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
-
+
/// <summary>
/// Add drawable object to the CanvasView.
/// This method is similar to registration. The added shape is drawn on the inner canvas.
/// <param name="drawable">Drawable object</param>
[EditorBrowsable(EditorBrowsableState.Never)]
public void AddDrawable(Drawable drawable)
- {
+ {
Interop.CanvasView.AddDrawable(View.getCPtr(this), BaseHandle.getCPtr(drawable));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
}
-}
\ No newline at end of file
+}
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public float Opacity
- {
- get {
+ {
+ get
+ {
return Interop.Drawable.GetOpacity(BaseHandle.getCPtr(this));
}
- set {
+ set
+ {
Interop.Drawable.SetOpacity(BaseHandle.getCPtr(this), value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
+ }
}
/// <summary>
/// <returns>True when it's successful. False otherwise.</returns>
[EditorBrowsable(EditorBrowsableState.Never)]
public bool Rotate(float degree)
- {
+ {
bool ret = Interop.Drawable.Rotate(BaseHandle.getCPtr(this), degree);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
/// <returns>True when it's successful. False otherwise.</returns>
[EditorBrowsable(EditorBrowsableState.Never)]
public bool Scale(float factor)
- {
+ {
bool ret = Interop.Drawable.Scale(BaseHandle.getCPtr(this), factor);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
/// <exception cref="ArgumentException"> Thrown when matrix array length is not 9. </exception>
[EditorBrowsable(EditorBrowsableState.Never)]
public bool Transform(float[] matrix)
- {
+ {
if (matrix == null)
{
throw new ArgumentNullException(nameof(matrix));
/// <returns>True when it's successful. False otherwise.</returns>
[EditorBrowsable(EditorBrowsableState.Never)]
public bool Translate(float x, float y)
- {
+ {
bool ret = Interop.Drawable.Translate(BaseHandle.getCPtr(this), x, y);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
-/*
+/*
* Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public Color FillColor
- {
- get {
+ {
+ get
+ {
global::System.IntPtr cPtr = Interop.Shape.GetFillColor(BaseHandle.getCPtr(this));
return Vector4.GetVector4FromPtr(cPtr);
}
- set {
+ set
+ {
Interop.Shape.SetFillColor(BaseHandle.getCPtr(this), Vector4.getCPtr(value));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
[EditorBrowsable(EditorBrowsableState.Never)]
public FillRuleType FillRule
{
- get {
+ get
+ {
return (FillRuleType)Interop.Shape.GetFillRule(BaseHandle.getCPtr(this));
}
- set {
+ set
+ {
Interop.Shape.SetFillRule(BaseHandle.getCPtr(this), (int)value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
[EditorBrowsable(EditorBrowsableState.Never)]
public float StrokeWidth
{
- get {
+ get
+ {
return Interop.Shape.GetStrokeWidth(BaseHandle.getCPtr(this));
}
- set {
+ set
+ {
Interop.Shape.SetStrokeWidth(BaseHandle.getCPtr(this), value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
[EditorBrowsable(EditorBrowsableState.Never)]
public Color StrokeColor
{
- get {
+ get
+ {
global::System.IntPtr cPtr = Interop.Shape.GetStrokeColor(BaseHandle.getCPtr(this));
return Vector4.GetVector4FromPtr(cPtr);
}
- set {
+ set
+ {
Interop.Shape.SetStrokeColor(BaseHandle.getCPtr(this), Vector4.getCPtr(value));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
[EditorBrowsable(EditorBrowsableState.Never)]
public StrokeCapType StrokeCap
{
- get {
+ get
+ {
return (StrokeCapType)Interop.Shape.GetStrokeCap(BaseHandle.getCPtr(this));
}
- set {
+ set
+ {
Interop.Shape.SetStrokeCap(BaseHandle.getCPtr(this), (int)value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
[EditorBrowsable(EditorBrowsableState.Never)]
public StrokeJoinType StrokeJoin
{
- get {
+ get
+ {
return (StrokeJoinType)Interop.Shape.GetStrokeJoin(BaseHandle.getCPtr(this));
}
- set {
+ set
+ {
Interop.Shape.SetStrokeJoin(BaseHandle.getCPtr(this), (int)value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
+ }
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public ReadOnlyCollection<float> StrokeDash
{
- get {
+ get
+ {
List<float> retList = new List<float>();
int patternCount = Interop.Shape.GetStrokeDashCount(BaseHandle.getCPtr(this));
for (int i = 0; i < patternCount; i++)
{
retList.Add(Interop.Shape.GetStrokeDashIndexOf(BaseHandle.getCPtr(this), i));
}
-
+
ReadOnlyCollection<float> ret = new ReadOnlyCollection<float>(retList);
return ret;
}
- set {
+ set
+ {
if (value == null)
{
throw new ArgumentNullException(nameof(value));
}
Interop.Shape.SetStrokeDash(BaseHandle.getCPtr(this), pattern, value.Count);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
+ }
}
/// <summary>
/// <returns>True when it's successful. False otherwise.</returns>
[EditorBrowsable(EditorBrowsableState.Never)]
public bool AddRect(float x, float y, float width, float height, float roundedCornerX, float roundedCornerY)
- {
+ {
bool ret = Interop.Shape.AddRect(BaseHandle.getCPtr(this), x, y, width, height, roundedCornerX, roundedCornerY);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
[EditorBrowsable(EditorBrowsableState.Never)]
public bool AddCubicTo(float controlPoint1X, float controlPoint1Y, float controlPoint2X, float controlPoint2Y, float endPointX, float endPointY)
{
- bool ret = Interop.Shape.AddCubicTo(BaseHandle.getCPtr(this), controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, endPointX, endPointY);
+ bool ret = Interop.Shape.AddCubicTo(BaseHandle.getCPtr(this), controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, endPointX, endPointY);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
const string tag = "NUITEST";
private View root;
- private CanvasView canvasView ;
+ private CanvasView canvasView;
private Shape shape;
private Timer timer;
private int count = 0;
FillColor = new Color(0.0f, 0.0f, 1.0f, 1.0f),
StrokeColor = new Color(1.0f, 1.0f, 0.0f, 1.0f),
StrokeWidth = 10.0f,
- StrokeDash = new List<float>(){15.0f, 30.0f}.AsReadOnly(),
+ StrokeDash = new List<float>() { 15.0f, 30.0f }.AsReadOnly(),
};
shape2.AddCircle(0.0f, 0.0f, 150.0f, 100.0f);
- shape2.Transform(new float[] {0.6f, 0.0f, 350.0f, 0.0f, 0.6f, 100.0f, 0.0f, 0.0f, 1.0f});
+ shape2.Transform(new float[] { 0.6f, 0.0f, 350.0f, 0.0f, 0.6f, 100.0f, 0.0f, 0.0f, 1.0f });
canvasView.AddDrawable(shape2);
shape4.AddMoveTo(0.0f, -160.0f);
shape4.AddLineTo(125.0f, 160.0f);
shape4.AddLineTo(-180.0f, -45.0f);
- shape4.AddLineTo(180.0f, -45.0f);
+ shape4.AddLineTo(180.0f, -45.0f);
shape4.AddLineTo(-125.0f, 160.0f);
shape4.Close();
-
+
canvasView.AddDrawable(shape4);
shape = new Shape()
// Exception test.
try
{
- shape2.Transform(new float[] {0.6f, 0.0f});
+ shape2.Transform(new float[] { 0.6f, 0.0f });
}
catch (ArgumentException e)
{
{
log.Debug(tag, "StrokeDash setter : " + e.Message + "\n");
}
-
+
root.Add(canvasView);
timer = new Timer(1000 / 32);