You've already forked linux-packaging-mono
Imported Upstream version 5.8.0.22
Former-commit-id: df344e34b07851d296efb3e6604c8db42b6f7aa3
This commit is contained in:
parent
5f4a27cc8a
commit
7d05485754
@@ -36,8 +36,9 @@ namespace System.Drawing.Drawing2D {
|
||||
[MonoTODO ("libgdiplus/cairo doesn't support path gradients - unless it can be mapped to a radial gradient")]
|
||||
public sealed class PathGradientBrush : Brush {
|
||||
|
||||
internal PathGradientBrush (IntPtr native) : base (native)
|
||||
internal PathGradientBrush (IntPtr native)
|
||||
{
|
||||
SetNativeBrush (native);
|
||||
}
|
||||
|
||||
public PathGradientBrush (GraphicsPath path)
|
||||
@@ -45,8 +46,10 @@ namespace System.Drawing.Drawing2D {
|
||||
if (path == null)
|
||||
throw new ArgumentNullException ("path");
|
||||
|
||||
Status status = GDIPlus.GdipCreatePathGradientFromPath (path.NativeObject, out nativeObject);
|
||||
IntPtr nativeObject;
|
||||
Status status = GDIPlus.GdipCreatePathGradientFromPath (path.nativePath, out nativeObject);
|
||||
GDIPlus.CheckStatus (status);
|
||||
SetNativeBrush (nativeObject);
|
||||
}
|
||||
|
||||
public PathGradientBrush (Point [] points) : this (points, WrapMode.Clamp)
|
||||
@@ -64,8 +67,10 @@ namespace System.Drawing.Drawing2D {
|
||||
if ((wrapMode < WrapMode.Tile) || (wrapMode > WrapMode.Clamp))
|
||||
throw new InvalidEnumArgumentException ("WrapMode");
|
||||
|
||||
IntPtr nativeObject;
|
||||
Status status = GDIPlus.GdipCreatePathGradientI (points, points.Length, wrapMode, out nativeObject);
|
||||
GDIPlus.CheckStatus (status);
|
||||
SetNativeBrush (nativeObject);
|
||||
}
|
||||
|
||||
public PathGradientBrush (PointF [] points, WrapMode wrapMode)
|
||||
@@ -75,8 +80,10 @@ namespace System.Drawing.Drawing2D {
|
||||
if ((wrapMode < WrapMode.Tile) || (wrapMode > WrapMode.Clamp))
|
||||
throw new InvalidEnumArgumentException ("WrapMode");
|
||||
|
||||
IntPtr nativeObject;
|
||||
Status status = GDIPlus.GdipCreatePathGradient (points, points.Length, wrapMode, out nativeObject);
|
||||
GDIPlus.CheckStatus (status);
|
||||
SetNativeBrush (nativeObject);
|
||||
}
|
||||
|
||||
// Properties
|
||||
@@ -84,11 +91,11 @@ namespace System.Drawing.Drawing2D {
|
||||
public Blend Blend {
|
||||
get {
|
||||
int count;
|
||||
Status status = GDIPlus.GdipGetPathGradientBlendCount (nativeObject, out count);
|
||||
Status status = GDIPlus.GdipGetPathGradientBlendCount (NativeBrush, out count);
|
||||
GDIPlus.CheckStatus (status);
|
||||
float [] factors = new float [count];
|
||||
float [] positions = new float [count];
|
||||
status = GDIPlus.GdipGetPathGradientBlend (nativeObject, factors, positions, count);
|
||||
status = GDIPlus.GdipGetPathGradientBlend (NativeBrush, factors, positions, count);
|
||||
GDIPlus.CheckStatus (status);
|
||||
|
||||
Blend blend = new Blend ();
|
||||
@@ -116,7 +123,7 @@ namespace System.Drawing.Drawing2D {
|
||||
if (positions [count - 1] != 1.0F)
|
||||
throw new ArgumentException ("Invalid Blend object. The positions array must have 1.0 as its last element.");
|
||||
|
||||
Status status = GDIPlus.GdipSetPathGradientBlend (nativeObject, factors, positions, count);
|
||||
Status status = GDIPlus.GdipSetPathGradientBlend (NativeBrush, factors, positions, count);
|
||||
GDIPlus.CheckStatus (status);
|
||||
}
|
||||
}
|
||||
@@ -124,12 +131,12 @@ namespace System.Drawing.Drawing2D {
|
||||
public Color CenterColor {
|
||||
get {
|
||||
int centerColor;
|
||||
Status status = GDIPlus.GdipGetPathGradientCenterColor (nativeObject, out centerColor);
|
||||
Status status = GDIPlus.GdipGetPathGradientCenterColor (NativeBrush, out centerColor);
|
||||
GDIPlus.CheckStatus (status);
|
||||
return Color.FromArgb (centerColor);
|
||||
}
|
||||
set {
|
||||
Status status = GDIPlus.GdipSetPathGradientCenterColor (nativeObject, value.ToArgb ());
|
||||
Status status = GDIPlus.GdipSetPathGradientCenterColor (NativeBrush, value.ToArgb ());
|
||||
GDIPlus.CheckStatus (status);
|
||||
}
|
||||
}
|
||||
@@ -137,14 +144,14 @@ namespace System.Drawing.Drawing2D {
|
||||
public PointF CenterPoint {
|
||||
get {
|
||||
PointF center;
|
||||
Status status = GDIPlus.GdipGetPathGradientCenterPoint (nativeObject, out center);
|
||||
Status status = GDIPlus.GdipGetPathGradientCenterPoint (NativeBrush, out center);
|
||||
GDIPlus.CheckStatus (status);
|
||||
|
||||
return center;
|
||||
}
|
||||
set {
|
||||
PointF center = value;
|
||||
Status status = GDIPlus.GdipSetPathGradientCenterPoint (nativeObject, ref center);
|
||||
Status status = GDIPlus.GdipSetPathGradientCenterPoint (NativeBrush, ref center);
|
||||
GDIPlus.CheckStatus (status);
|
||||
}
|
||||
}
|
||||
@@ -153,13 +160,13 @@ namespace System.Drawing.Drawing2D {
|
||||
get {
|
||||
float xScale;
|
||||
float yScale;
|
||||
Status status = GDIPlus.GdipGetPathGradientFocusScales (nativeObject, out xScale, out yScale);
|
||||
Status status = GDIPlus.GdipGetPathGradientFocusScales (NativeBrush, out xScale, out yScale);
|
||||
GDIPlus.CheckStatus (status);
|
||||
|
||||
return new PointF (xScale, yScale);
|
||||
}
|
||||
set {
|
||||
Status status = GDIPlus.GdipSetPathGradientFocusScales (nativeObject, value.X, value.Y);
|
||||
Status status = GDIPlus.GdipSetPathGradientFocusScales (NativeBrush, value.X, value.Y);
|
||||
GDIPlus.CheckStatus (status);
|
||||
}
|
||||
}
|
||||
@@ -167,7 +174,7 @@ namespace System.Drawing.Drawing2D {
|
||||
public ColorBlend InterpolationColors {
|
||||
get {
|
||||
int count;
|
||||
Status status = GDIPlus.GdipGetPathGradientPresetBlendCount (nativeObject, out count);
|
||||
Status status = GDIPlus.GdipGetPathGradientPresetBlendCount (NativeBrush, out count);
|
||||
GDIPlus.CheckStatus (status);
|
||||
// if no failure, then the "managed" minimum is 1
|
||||
if (count < 1)
|
||||
@@ -177,7 +184,7 @@ namespace System.Drawing.Drawing2D {
|
||||
float [] positions = new float [count];
|
||||
// status would fail if we ask points or types with a < 2 count
|
||||
if (count > 1) {
|
||||
status = GDIPlus.GdipGetPathGradientPresetBlend (nativeObject, intcolors, positions, count);
|
||||
status = GDIPlus.GdipGetPathGradientPresetBlend (NativeBrush, intcolors, positions, count);
|
||||
GDIPlus.CheckStatus (status);
|
||||
}
|
||||
|
||||
@@ -213,7 +220,7 @@ namespace System.Drawing.Drawing2D {
|
||||
for (int i = 0; i < colors.Length; i++)
|
||||
blend [i] = colors [i].ToArgb ();
|
||||
|
||||
Status status = GDIPlus.GdipSetPathGradientPresetBlend (nativeObject, blend, positions, count);
|
||||
Status status = GDIPlus.GdipSetPathGradientPresetBlend (NativeBrush, blend, positions, count);
|
||||
GDIPlus.CheckStatus (status);
|
||||
}
|
||||
}
|
||||
@@ -221,7 +228,7 @@ namespace System.Drawing.Drawing2D {
|
||||
public RectangleF Rectangle {
|
||||
get {
|
||||
RectangleF rect;
|
||||
Status status = GDIPlus.GdipGetPathGradientRect (nativeObject, out rect);
|
||||
Status status = GDIPlus.GdipGetPathGradientRect (NativeBrush, out rect);
|
||||
GDIPlus.CheckStatus (status);
|
||||
|
||||
return rect;
|
||||
@@ -231,11 +238,11 @@ namespace System.Drawing.Drawing2D {
|
||||
public Color [] SurroundColors {
|
||||
get {
|
||||
int count;
|
||||
Status status = GDIPlus.GdipGetPathGradientSurroundColorCount (nativeObject, out count);
|
||||
Status status = GDIPlus.GdipGetPathGradientSurroundColorCount (NativeBrush, out count);
|
||||
GDIPlus.CheckStatus (status);
|
||||
|
||||
int [] intcolors = new int [count];
|
||||
status = GDIPlus.GdipGetPathGradientSurroundColorsWithCount (nativeObject, intcolors, ref count);
|
||||
status = GDIPlus.GdipGetPathGradientSurroundColorsWithCount (NativeBrush, intcolors, ref count);
|
||||
GDIPlus.CheckStatus (status);
|
||||
|
||||
Color [] colors = new Color [count];
|
||||
@@ -251,7 +258,7 @@ namespace System.Drawing.Drawing2D {
|
||||
for (int i = 0; i < count; i++)
|
||||
colors [i] = value [i].ToArgb ();
|
||||
|
||||
Status status = GDIPlus.GdipSetPathGradientSurroundColorsWithCount (nativeObject, colors, ref count);
|
||||
Status status = GDIPlus.GdipSetPathGradientSurroundColorsWithCount (NativeBrush, colors, ref count);
|
||||
GDIPlus.CheckStatus (status);
|
||||
}
|
||||
}
|
||||
@@ -259,7 +266,7 @@ namespace System.Drawing.Drawing2D {
|
||||
public Matrix Transform {
|
||||
get {
|
||||
Matrix matrix = new Matrix ();
|
||||
Status status = GDIPlus.GdipGetPathGradientTransform (nativeObject, matrix.nativeMatrix);
|
||||
Status status = GDIPlus.GdipGetPathGradientTransform (NativeBrush, matrix.nativeMatrix);
|
||||
GDIPlus.CheckStatus (status);
|
||||
|
||||
return matrix;
|
||||
@@ -268,7 +275,7 @@ namespace System.Drawing.Drawing2D {
|
||||
if (value == null)
|
||||
throw new ArgumentNullException ("Transform");
|
||||
|
||||
Status status = GDIPlus.GdipSetPathGradientTransform (nativeObject, value.nativeMatrix);
|
||||
Status status = GDIPlus.GdipSetPathGradientTransform (NativeBrush, value.nativeMatrix);
|
||||
GDIPlus.CheckStatus (status);
|
||||
}
|
||||
}
|
||||
@@ -276,7 +283,7 @@ namespace System.Drawing.Drawing2D {
|
||||
public WrapMode WrapMode {
|
||||
get {
|
||||
WrapMode wrapMode;
|
||||
Status status = GDIPlus.GdipGetPathGradientWrapMode (nativeObject, out wrapMode);
|
||||
Status status = GDIPlus.GdipGetPathGradientWrapMode (NativeBrush, out wrapMode);
|
||||
GDIPlus.CheckStatus (status);
|
||||
|
||||
return wrapMode;
|
||||
@@ -285,7 +292,7 @@ namespace System.Drawing.Drawing2D {
|
||||
if ((value < WrapMode.Tile) || (value > WrapMode.Clamp))
|
||||
throw new InvalidEnumArgumentException ("WrapMode");
|
||||
|
||||
Status status = GDIPlus.GdipSetPathGradientWrapMode (nativeObject, value);
|
||||
Status status = GDIPlus.GdipSetPathGradientWrapMode (NativeBrush, value);
|
||||
GDIPlus.CheckStatus (status);
|
||||
}
|
||||
}
|
||||
@@ -302,13 +309,13 @@ namespace System.Drawing.Drawing2D {
|
||||
if (matrix == null)
|
||||
throw new ArgumentNullException ("matrix");
|
||||
|
||||
Status status = GDIPlus.GdipMultiplyPathGradientTransform (nativeObject, matrix.nativeMatrix, order);
|
||||
Status status = GDIPlus.GdipMultiplyPathGradientTransform (NativeBrush, matrix.nativeMatrix, order);
|
||||
GDIPlus.CheckStatus (status);
|
||||
}
|
||||
|
||||
public void ResetTransform ()
|
||||
{
|
||||
Status status = GDIPlus.GdipResetPathGradientTransform (nativeObject);
|
||||
Status status = GDIPlus.GdipResetPathGradientTransform (NativeBrush);
|
||||
GDIPlus.CheckStatus (status);
|
||||
}
|
||||
|
||||
@@ -319,7 +326,7 @@ namespace System.Drawing.Drawing2D {
|
||||
|
||||
public void RotateTransform (float angle, MatrixOrder order)
|
||||
{
|
||||
Status status = GDIPlus.GdipRotatePathGradientTransform (nativeObject, angle, order);
|
||||
Status status = GDIPlus.GdipRotatePathGradientTransform (NativeBrush, angle, order);
|
||||
GDIPlus.CheckStatus (status);
|
||||
}
|
||||
|
||||
@@ -330,7 +337,7 @@ namespace System.Drawing.Drawing2D {
|
||||
|
||||
public void ScaleTransform (float sx, float sy, MatrixOrder order)
|
||||
{
|
||||
Status status = GDIPlus.GdipScalePathGradientTransform (nativeObject, sx, sy, order);
|
||||
Status status = GDIPlus.GdipScalePathGradientTransform (NativeBrush, sx, sy, order);
|
||||
GDIPlus.CheckStatus (status);
|
||||
}
|
||||
|
||||
@@ -344,7 +351,7 @@ namespace System.Drawing.Drawing2D {
|
||||
if (focus < 0 || focus > 1 || scale < 0 || scale > 1)
|
||||
throw new ArgumentException ("Invalid parameter passed.");
|
||||
|
||||
Status status = GDIPlus.GdipSetPathGradientLinearBlend (nativeObject, focus, scale);
|
||||
Status status = GDIPlus.GdipSetPathGradientLinearBlend (NativeBrush, focus, scale);
|
||||
GDIPlus.CheckStatus (status);
|
||||
}
|
||||
|
||||
@@ -358,7 +365,7 @@ namespace System.Drawing.Drawing2D {
|
||||
if (focus < 0 || focus > 1 || scale < 0 || scale > 1)
|
||||
throw new ArgumentException ("Invalid parameter passed.");
|
||||
|
||||
Status status = GDIPlus.GdipSetPathGradientSigmaBlend (nativeObject, focus, scale);
|
||||
Status status = GDIPlus.GdipSetPathGradientSigmaBlend (NativeBrush, focus, scale);
|
||||
GDIPlus.CheckStatus (status);
|
||||
}
|
||||
|
||||
@@ -369,14 +376,14 @@ namespace System.Drawing.Drawing2D {
|
||||
|
||||
public void TranslateTransform (float dx, float dy, MatrixOrder order)
|
||||
{
|
||||
Status status = GDIPlus.GdipTranslatePathGradientTransform (nativeObject, dx, dy, order);
|
||||
Status status = GDIPlus.GdipTranslatePathGradientTransform (NativeBrush, dx, dy, order);
|
||||
GDIPlus.CheckStatus (status);
|
||||
}
|
||||
|
||||
public override object Clone ()
|
||||
{
|
||||
IntPtr clonePtr;
|
||||
Status status = GDIPlus.GdipCloneBrush (nativeObject, out clonePtr);
|
||||
Status status = GDIPlus.GdipCloneBrush (NativeBrush, out clonePtr);
|
||||
GDIPlus.CheckStatus (status);
|
||||
|
||||
PathGradientBrush clone = new PathGradientBrush (clonePtr);
|
||||
|
||||
Reference in New Issue
Block a user