// Generated API outline. Implementation bodies omitted.
#nullable enable
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using System.Threading;
using System;
using nfloat = System.Runtime.InteropServices.NFloat;
using static Xui.Core.Math2D.Constants;
namespace Xui.Core.Canvas.SVG
{
///
/// Specifies the size of the arc to be drawn when interpreting an SVG arc command.
/// Used in conjunction with the sweep flag to determine the final arc segment.
///
/// This corresponds to the "large-arc-flag" in the SVG path specification.
///
public enum ArcFlag
{
///
/// Draw the smaller of the two possible arc sweeps (less than or equal to 180 degrees).
///
Small = 0,
///
/// Draw the larger of the two possible arc sweeps (greater than 180 degrees).
///
Large = 1
}
///
/// Provides SVG-related extension methods for the interface.
///
public static class Extensions
{
///
/// Creates a for the given path drawing context.
///
/// This enables fluent parsing or construction of SVG path commands targeting the current canvas context.
///
/// The path drawing context (e.g., a canvas or drawing surface).
/// A instance for building or parsing SVG paths.
public static PathDataBuilder PathData(this IPathDrawingContext @this);
}
}
namespace Xui.Core.Canvas.SVG
{
using Xui.Core.Math2D;
///
/// A utility for converting parsed SVG path commands into drawing operations
/// on an target.
///
/// This builder supports both absolute (e.g., M, L, C) and relative (e.g., m, l, c) SVG commands,
/// and tracks the current drawing point and control points for smooth curves.
///
public ref struct PathDataBuilder
{
///
/// The target drawing context that receives path commands.
///
public readonly IPathDrawingContext Sink;
///
/// The starting point of the current subpath (used for Z command).
///
public Point? StartPoint;
///
/// The current position of the pen after the last command.
///
public Point CurrentPoint;
///
/// The reflected control point for the next cubic Bézier curve (used in S, s).
///
public Point NextCubicControlPoint;
///
/// The reflected control point for the next quadratic Bézier curve (used in T, t).
///
public Point NextQuadraticControlPoint;
///
/// Initializes a new targeting the specified drawing context.
///
/// The drawing context that will receive the path instructions.
public PathDataBuilder(IPathDrawingContext sink);
///
/// Begins a new path on the drawing context.
///
public PathDataBuilder Begin();
public PathDataBuilder M(Point point);
public PathDataBuilder m(Vector vector);
public PathDataBuilder L(Point point);
public PathDataBuilder l(Vector vector);
public PathDataBuilder H(nfloat h);
public PathDataBuilder h(nfloat h);
public PathDataBuilder V(nfloat v);
public PathDataBuilder v(nfloat v);
public PathDataBuilder C(Point cp1, Point cp2, Point to);
public PathDataBuilder c(Vector cv1, Vector cv2, Vector to);
public PathDataBuilder S(Point cp, Point to);
public PathDataBuilder s(Vector cv, Vector to);
public PathDataBuilder Q(Point cp, Point to);
public PathDataBuilder q(Vector cv, Vector to);
public PathDataBuilder T(Point to);
public PathDataBuilder t(Vector to);
public PathDataBuilder A(Vector sr, nfloat xAxisRotationDeg, ArcFlag largeArcFlag, Winding sweepDirection, Point p2);
public PathDataBuilder a(Vector v2, nfloat xAxisRotationDeg, ArcFlag largeArcFlag, Winding sweepDirection, Vector sr);
public PathDataBuilder Z();
public PathDataBuilder z();
}
}