diff options
author | Eric Mellino <erme@microsoft.com> | 2017-08-08 05:54:01 +0300 |
---|---|---|
committer | Stephen Toub <stoub@microsoft.com> | 2017-08-08 05:54:01 +0300 |
commit | abc9443560d7a1226d5d1fd75df923d2fb37bf91 (patch) | |
tree | 93dffc16783aad6296d2c3ac0b5e3cc774e8fd8d /src | |
parent | 486a64a4b8bc1fb7a3f5815b6857ce02ed58dffc (diff) |
Unify implementations for System.Drawing.Pen and related types. (#23029)
Diffstat (limited to 'src')
8 files changed, 249 insertions, 3648 deletions
diff --git a/src/System.Drawing.Common/src/System.Drawing.Common.csproj b/src/System.Drawing.Common/src/System.Drawing.Common.csproj index 6bba96312c..855c67986a 100644 --- a/src/System.Drawing.Common/src/System.Drawing.Common.csproj +++ b/src/System.Drawing.Common/src/System.Drawing.Common.csproj @@ -45,7 +45,10 @@ <Compile Include="System\Drawing\BitmapSuffixInSatelliteAssemblyAttribute.cs" /> <Compile Include="System\Drawing\IDeviceContext.cs" /> <Compile Include="System\Drawing\GdiplusNative.cs" /> + <Compile Include="System\Drawing\Pen.cs" /> + <Compile Include="System\Drawing\Pens.cs" /> <Compile Include="System\Drawing\RotateFlipType.cs" /> + <Compile Include="System\Drawing\SystemPens.cs" /> <Compile Include="System\Drawing\Printing\PrinterUnit.cs" /> <Compile Include="System\Drawing\Printing\PreviewPageInfo.cs" /> <Compile Include="System\Drawing\Printing\PrintEventHandler.cs" /> @@ -211,8 +214,6 @@ <Compile Include="System\Drawing\Internal\GPStream.cs" /> <Compile Include="System\Drawing\Internal\SystemColorTracker.cs" /> <Compile Include="System\Drawing\LocalAppContextSwitches.cs" /> - <Compile Include="System\Drawing\Pen.cs" /> - <Compile Include="System\Drawing\Pens.cs" /> <Compile Include="System\Drawing\Printing\DefaultPrintController.cs" /> <Compile Include="System\Drawing\Printing\ModeField.cs" /> <Compile Include="System\Drawing\Printing\PageSettings.cs" /> @@ -231,7 +232,6 @@ <Compile Include="System\Drawing\SystemColors.cs" /> <Compile Include="System\Drawing\SystemFonts.cs" /> <Compile Include="System\Drawing\SystemIcons.cs" /> - <Compile Include="System\Drawing\SystemPens.cs" /> <Compile Include="System\Drawing\Text\PrivateFontCollection.cs" /> <Compile Include="System\Drawing\ToolboxBitmapAttribute.cs" /> <Compile Include="System\Drawing\Unit.cs" /> @@ -300,15 +300,12 @@ <Compile Include="Unix\System.Drawing\ImageAnimator.cs" /> <Compile Include="Unix\System.Drawing\Image.cs" /> <Compile Include="Unix\System.Drawing\KnownColors.cs" /> - <Compile Include="Unix\System.Drawing\Pen.cs" /> - <Compile Include="Unix\System.Drawing\Pens.cs" /> <Compile Include="Unix\System.Drawing\Region.cs" /> <Compile Include="Unix\System.Drawing\SRDescriptionAttribute.cs" /> <Compile Include="Unix\System.Drawing\StringFormat.cs" /> <Compile Include="Unix\System.Drawing\SystemColors.cs" /> <Compile Include="Unix\System.Drawing\SystemFonts.cs" /> <Compile Include="Unix\System.Drawing\SystemIcons.cs" /> - <Compile Include="Unix\System.Drawing\SystemPens.cs" /> <Compile Include="Unix\System.Drawing\ToolboxBitmapAttribute.cs" /> <Compile Include="Unix\System.Drawing.Drawing2D\GraphicsContainer.cs" /> <Compile Include="Unix\System.Drawing.Drawing2D\GraphicsPath.cs" /> diff --git a/src/System.Drawing.Common/src/System/Drawing/GdiplusNative.Unix.cs b/src/System.Drawing.Common/src/System/Drawing/GdiplusNative.Unix.cs index 49685e39a7..7b814414fa 100644 --- a/src/System.Drawing.Common/src/System/Drawing/GdiplusNative.Unix.cs +++ b/src/System.Drawing.Common/src/System/Drawing/GdiplusNative.Unix.cs @@ -246,51 +246,6 @@ namespace System.Drawing GdipFlush_ptr = LoadFunction<GdipFlush_delegate>("GdipFlush"); GdipAddPathString_ptr = LoadFunction<GdipAddPathString_delegate>("GdipAddPathString"); GdipAddPathStringI_ptr = LoadFunction<GdipAddPathStringI_delegate>("GdipAddPathStringI"); - GdipCreatePen1_ptr = LoadFunction<GdipCreatePen1_delegate>("GdipCreatePen1"); - GdipCreatePen2_ptr = LoadFunction<GdipCreatePen2_delegate>("GdipCreatePen2"); - GdipClonePen_ptr = LoadFunction<GdipClonePen_delegate>("GdipClonePen"); - GdipDeletePen_ptr = LoadFunction<GdipDeletePen_delegate>("GdipDeletePen"); - GdipSetPenBrushFill_ptr = LoadFunction<GdipSetPenBrushFill_delegate>("GdipSetPenBrushFill"); - GdipGetPenBrushFill_ptr = LoadFunction<GdipGetPenBrushFill_delegate>("GdipGetPenBrushFill"); - GdipGetPenFillType_ptr = LoadFunction<GdipGetPenFillType_delegate>("GdipGetPenFillType"); - GdipSetPenColor_ptr = LoadFunction<GdipSetPenColor_delegate>("GdipSetPenColor"); - GdipGetPenColor_ptr = LoadFunction<GdipGetPenColor_delegate>("GdipGetPenColor"); - GdipSetPenCompoundArray_ptr = LoadFunction<GdipSetPenCompoundArray_delegate>("GdipSetPenCompoundArray"); - GdipGetPenCompoundArray_ptr = LoadFunction<GdipGetPenCompoundArray_delegate>("GdipGetPenCompoundArray"); - GdipGetPenCompoundCount_ptr = LoadFunction<GdipGetPenCompoundCount_delegate>("GdipGetPenCompoundCount"); - GdipSetPenDashCap197819_ptr = LoadFunction<GdipSetPenDashCap197819_delegate>("GdipSetPenDashCap197819"); - GdipGetPenDashCap197819_ptr = LoadFunction<GdipGetPenDashCap197819_delegate>("GdipGetPenDashCap197819"); - GdipSetPenDashStyle_ptr = LoadFunction<GdipSetPenDashStyle_delegate>("GdipSetPenDashStyle"); - GdipGetPenDashStyle_ptr = LoadFunction<GdipGetPenDashStyle_delegate>("GdipGetPenDashStyle"); - GdipSetPenDashOffset_ptr = LoadFunction<GdipSetPenDashOffset_delegate>("GdipSetPenDashOffset"); - GdipGetPenDashOffset_ptr = LoadFunction<GdipGetPenDashOffset_delegate>("GdipGetPenDashOffset"); - GdipGetPenDashCount_ptr = LoadFunction<GdipGetPenDashCount_delegate>("GdipGetPenDashCount"); - GdipSetPenDashArray_ptr = LoadFunction<GdipSetPenDashArray_delegate>("GdipSetPenDashArray"); - GdipGetPenDashArray_ptr = LoadFunction<GdipGetPenDashArray_delegate>("GdipGetPenDashArray"); - GdipSetPenMiterLimit_ptr = LoadFunction<GdipSetPenMiterLimit_delegate>("GdipSetPenMiterLimit"); - GdipGetPenMiterLimit_ptr = LoadFunction<GdipGetPenMiterLimit_delegate>("GdipGetPenMiterLimit"); - GdipSetPenLineJoin_ptr = LoadFunction<GdipSetPenLineJoin_delegate>("GdipSetPenLineJoin"); - GdipGetPenLineJoin_ptr = LoadFunction<GdipGetPenLineJoin_delegate>("GdipGetPenLineJoin"); - GdipSetPenLineCap197819_ptr = LoadFunction<GdipSetPenLineCap197819_delegate>("GdipSetPenLineCap197819"); - GdipSetPenMode_ptr = LoadFunction<GdipSetPenMode_delegate>("GdipSetPenMode"); - GdipGetPenMode_ptr = LoadFunction<GdipGetPenMode_delegate>("GdipGetPenMode"); - GdipSetPenStartCap_ptr = LoadFunction<GdipSetPenStartCap_delegate>("GdipSetPenStartCap"); - GdipGetPenStartCap_ptr = LoadFunction<GdipGetPenStartCap_delegate>("GdipGetPenStartCap"); - GdipSetPenEndCap_ptr = LoadFunction<GdipSetPenEndCap_delegate>("GdipSetPenEndCap"); - GdipGetPenEndCap_ptr = LoadFunction<GdipGetPenEndCap_delegate>("GdipGetPenEndCap"); - GdipSetPenCustomStartCap_ptr = LoadFunction<GdipSetPenCustomStartCap_delegate>("GdipSetPenCustomStartCap"); - GdipGetPenCustomStartCap_ptr = LoadFunction<GdipGetPenCustomStartCap_delegate>("GdipGetPenCustomStartCap"); - GdipSetPenCustomEndCap_ptr = LoadFunction<GdipSetPenCustomEndCap_delegate>("GdipSetPenCustomEndCap"); - GdipGetPenCustomEndCap_ptr = LoadFunction<GdipGetPenCustomEndCap_delegate>("GdipGetPenCustomEndCap"); - GdipSetPenTransform_ptr = LoadFunction<GdipSetPenTransform_delegate>("GdipSetPenTransform"); - GdipGetPenTransform_ptr = LoadFunction<GdipGetPenTransform_delegate>("GdipGetPenTransform"); - GdipSetPenWidth_ptr = LoadFunction<GdipSetPenWidth_delegate>("GdipSetPenWidth"); - GdipGetPenWidth_ptr = LoadFunction<GdipGetPenWidth_delegate>("GdipGetPenWidth"); - GdipResetPenTransform_ptr = LoadFunction<GdipResetPenTransform_delegate>("GdipResetPenTransform"); - GdipMultiplyPenTransform_ptr = LoadFunction<GdipMultiplyPenTransform_delegate>("GdipMultiplyPenTransform"); - GdipRotatePenTransform_ptr = LoadFunction<GdipRotatePenTransform_delegate>("GdipRotatePenTransform"); - GdipScalePenTransform_ptr = LoadFunction<GdipScalePenTransform_delegate>("GdipScalePenTransform"); - GdipTranslatePenTransform_ptr = LoadFunction<GdipTranslatePenTransform_delegate>("GdipTranslatePenTransform"); GdipCreateFromHWND_ptr = LoadFunction<GdipCreateFromHWND_delegate>("GdipCreateFromHWND"); GdipMeasureString_ptr = LoadFunction<GdipMeasureString_delegate>("GdipMeasureString"); GdipMeasureCharacterRanges_ptr = LoadFunction<GdipMeasureCharacterRanges_delegate>("GdipMeasureCharacterRanges"); @@ -1349,187 +1304,6 @@ namespace System.Drawing private static FunctionWrapper<GdipAddPathStringI_delegate> GdipAddPathStringI_ptr; internal static Status GdipAddPathStringI(IntPtr path, string s, int lenght, IntPtr family, int style, float emSize, ref Rectangle layoutRect, IntPtr format) => GdipAddPathStringI_ptr.Delegate(path, s, lenght, family, style, emSize, ref layoutRect, format); - private delegate Status GdipCreatePen1_delegate(int argb, float width, GraphicsUnit unit, out IntPtr pen); - private static FunctionWrapper<GdipCreatePen1_delegate> GdipCreatePen1_ptr; - internal static Status GdipCreatePen1(int argb, float width, GraphicsUnit unit, out IntPtr pen) => GdipCreatePen1_ptr.Delegate(argb, width, unit, out pen); - - private delegate Status GdipCreatePen2_delegate(IntPtr brush, float width, GraphicsUnit unit, out IntPtr pen); - private static FunctionWrapper<GdipCreatePen2_delegate> GdipCreatePen2_ptr; - internal static Status GdipCreatePen2(IntPtr brush, float width, GraphicsUnit unit, out IntPtr pen) => GdipCreatePen2_ptr.Delegate(brush, width, unit, out pen); - - private delegate Status GdipClonePen_delegate(IntPtr pen, out IntPtr clonepen); - private static FunctionWrapper<GdipClonePen_delegate> GdipClonePen_ptr; - internal static Status GdipClonePen(IntPtr pen, out IntPtr clonepen) => GdipClonePen_ptr.Delegate(pen, out clonepen); - - private delegate Status GdipDeletePen_delegate(IntPtr pen); - private static FunctionWrapper<GdipDeletePen_delegate> GdipDeletePen_ptr; - internal static Status GdipDeletePen(IntPtr pen) => GdipDeletePen_ptr.Delegate(pen); - internal static int IntGdipDeletePen(HandleRef pen) => (int)GdipDeletePen_ptr.Delegate(pen.Handle); - - private delegate Status GdipSetPenBrushFill_delegate(IntPtr pen, IntPtr brush); - private static FunctionWrapper<GdipSetPenBrushFill_delegate> GdipSetPenBrushFill_ptr; - internal static Status GdipSetPenBrushFill(IntPtr pen, IntPtr brush) => GdipSetPenBrushFill_ptr.Delegate(pen, brush); - - private delegate Status GdipGetPenBrushFill_delegate(IntPtr pen, out IntPtr brush); - private static FunctionWrapper<GdipGetPenBrushFill_delegate> GdipGetPenBrushFill_ptr; - internal static Status GdipGetPenBrushFill(IntPtr pen, out IntPtr brush) => GdipGetPenBrushFill_ptr.Delegate(pen, out brush); - - private delegate Status GdipGetPenFillType_delegate(IntPtr pen, out PenType type); - private static FunctionWrapper<GdipGetPenFillType_delegate> GdipGetPenFillType_ptr; - internal static Status GdipGetPenFillType(IntPtr pen, out PenType type) => GdipGetPenFillType_ptr.Delegate(pen, out type); - - private delegate Status GdipSetPenColor_delegate(IntPtr pen, int color); - private static FunctionWrapper<GdipSetPenColor_delegate> GdipSetPenColor_ptr; - internal static Status GdipSetPenColor(IntPtr pen, int color) => GdipSetPenColor_ptr.Delegate(pen, color); - - private delegate Status GdipGetPenColor_delegate(IntPtr pen, out int color); - private static FunctionWrapper<GdipGetPenColor_delegate> GdipGetPenColor_ptr; - internal static Status GdipGetPenColor(IntPtr pen, out int color) => GdipGetPenColor_ptr.Delegate(pen, out color); - - private delegate Status GdipSetPenCompoundArray_delegate(IntPtr pen, float[] dash, int count); - private static FunctionWrapper<GdipSetPenCompoundArray_delegate> GdipSetPenCompoundArray_ptr; - internal static Status GdipSetPenCompoundArray(IntPtr pen, float[] dash, int count) => GdipSetPenCompoundArray_ptr.Delegate(pen, dash, count); - - private delegate Status GdipGetPenCompoundArray_delegate(IntPtr pen, float[] dash, int count); - private static FunctionWrapper<GdipGetPenCompoundArray_delegate> GdipGetPenCompoundArray_ptr; - internal static Status GdipGetPenCompoundArray(IntPtr pen, float[] dash, int count) => GdipGetPenCompoundArray_ptr.Delegate(pen, dash, count); - - private delegate Status GdipGetPenCompoundCount_delegate(IntPtr pen, out int count); - private static FunctionWrapper<GdipGetPenCompoundCount_delegate> GdipGetPenCompoundCount_ptr; - internal static Status GdipGetPenCompoundCount(IntPtr pen, out int count) => GdipGetPenCompoundCount_ptr.Delegate(pen, out count); - - private delegate Status GdipSetPenDashCap197819_delegate(IntPtr pen, DashCap dashCap); - private static FunctionWrapper<GdipSetPenDashCap197819_delegate> GdipSetPenDashCap197819_ptr; - internal static Status GdipSetPenDashCap197819(IntPtr pen, DashCap dashCap) => GdipSetPenDashCap197819_ptr.Delegate(pen, dashCap); - - private delegate Status GdipGetPenDashCap197819_delegate(IntPtr pen, out DashCap dashCap); - private static FunctionWrapper<GdipGetPenDashCap197819_delegate> GdipGetPenDashCap197819_ptr; - internal static Status GdipGetPenDashCap197819(IntPtr pen, out DashCap dashCap) => GdipGetPenDashCap197819_ptr.Delegate(pen, out dashCap); - - private delegate Status GdipSetPenDashStyle_delegate(IntPtr pen, DashStyle dashStyle); - private static FunctionWrapper<GdipSetPenDashStyle_delegate> GdipSetPenDashStyle_ptr; - internal static Status GdipSetPenDashStyle(IntPtr pen, DashStyle dashStyle) => GdipSetPenDashStyle_ptr.Delegate(pen, dashStyle); - - private delegate Status GdipGetPenDashStyle_delegate(IntPtr pen, out DashStyle dashStyle); - private static FunctionWrapper<GdipGetPenDashStyle_delegate> GdipGetPenDashStyle_ptr; - internal static Status GdipGetPenDashStyle(IntPtr pen, out DashStyle dashStyle) => GdipGetPenDashStyle_ptr.Delegate(pen, out dashStyle); - - private delegate Status GdipSetPenDashOffset_delegate(IntPtr pen, float offset); - private static FunctionWrapper<GdipSetPenDashOffset_delegate> GdipSetPenDashOffset_ptr; - internal static Status GdipSetPenDashOffset(IntPtr pen, float offset) => GdipSetPenDashOffset_ptr.Delegate(pen, offset); - - private delegate Status GdipGetPenDashOffset_delegate(IntPtr pen, out float offset); - private static FunctionWrapper<GdipGetPenDashOffset_delegate> GdipGetPenDashOffset_ptr; - internal static Status GdipGetPenDashOffset(IntPtr pen, out float offset) => GdipGetPenDashOffset_ptr.Delegate(pen, out offset); - - private delegate Status GdipGetPenDashCount_delegate(IntPtr pen, out int count); - private static FunctionWrapper<GdipGetPenDashCount_delegate> GdipGetPenDashCount_ptr; - internal static Status GdipGetPenDashCount(IntPtr pen, out int count) => GdipGetPenDashCount_ptr.Delegate(pen, out count); - - private delegate Status GdipSetPenDashArray_delegate(IntPtr pen, float[] dash, int count); - private static FunctionWrapper<GdipSetPenDashArray_delegate> GdipSetPenDashArray_ptr; - internal static Status GdipSetPenDashArray(IntPtr pen, float[] dash, int count) => GdipSetPenDashArray_ptr.Delegate(pen, dash, count); - - private delegate Status GdipGetPenDashArray_delegate(IntPtr pen, float[] dash, int count); - private static FunctionWrapper<GdipGetPenDashArray_delegate> GdipGetPenDashArray_ptr; - internal static Status GdipGetPenDashArray(IntPtr pen, float[] dash, int count) => GdipGetPenDashArray_ptr.Delegate(pen, dash, count); - - private delegate Status GdipSetPenMiterLimit_delegate(IntPtr pen, float miterLimit); - private static FunctionWrapper<GdipSetPenMiterLimit_delegate> GdipSetPenMiterLimit_ptr; - internal static Status GdipSetPenMiterLimit(IntPtr pen, float miterLimit) => GdipSetPenMiterLimit_ptr.Delegate(pen, miterLimit); - - private delegate Status GdipGetPenMiterLimit_delegate(IntPtr pen, out float miterLimit); - private static FunctionWrapper<GdipGetPenMiterLimit_delegate> GdipGetPenMiterLimit_ptr; - internal static Status GdipGetPenMiterLimit(IntPtr pen, out float miterLimit) => GdipGetPenMiterLimit_ptr.Delegate(pen, out miterLimit); - - private delegate Status GdipSetPenLineJoin_delegate(IntPtr pen, LineJoin lineJoin); - private static FunctionWrapper<GdipSetPenLineJoin_delegate> GdipSetPenLineJoin_ptr; - internal static Status GdipSetPenLineJoin(IntPtr pen, LineJoin lineJoin) => GdipSetPenLineJoin_ptr.Delegate(pen, lineJoin); - - private delegate Status GdipGetPenLineJoin_delegate(IntPtr pen, out LineJoin lineJoin); - private static FunctionWrapper<GdipGetPenLineJoin_delegate> GdipGetPenLineJoin_ptr; - internal static Status GdipGetPenLineJoin(IntPtr pen, out LineJoin lineJoin) => GdipGetPenLineJoin_ptr.Delegate(pen, out lineJoin); - - private delegate Status GdipSetPenLineCap197819_delegate(IntPtr pen, LineCap startCap, LineCap endCap, DashCap dashCap); - private static FunctionWrapper<GdipSetPenLineCap197819_delegate> GdipSetPenLineCap197819_ptr; - internal static Status GdipSetPenLineCap197819(IntPtr pen, LineCap startCap, LineCap endCap, DashCap dashCap) => GdipSetPenLineCap197819_ptr.Delegate(pen, startCap, endCap, dashCap); - - private delegate Status GdipSetPenMode_delegate(IntPtr pen, PenAlignment alignment); - private static FunctionWrapper<GdipSetPenMode_delegate> GdipSetPenMode_ptr; - internal static Status GdipSetPenMode(IntPtr pen, PenAlignment alignment) => GdipSetPenMode_ptr.Delegate(pen, alignment); - - private delegate Status GdipGetPenMode_delegate(IntPtr pen, out PenAlignment alignment); - private static FunctionWrapper<GdipGetPenMode_delegate> GdipGetPenMode_ptr; - internal static Status GdipGetPenMode(IntPtr pen, out PenAlignment alignment) => GdipGetPenMode_ptr.Delegate(pen, out alignment); - - private delegate Status GdipSetPenStartCap_delegate(IntPtr pen, LineCap startCap); - private static FunctionWrapper<GdipSetPenStartCap_delegate> GdipSetPenStartCap_ptr; - internal static Status GdipSetPenStartCap(IntPtr pen, LineCap startCap) => GdipSetPenStartCap_ptr.Delegate(pen, startCap); - - private delegate Status GdipGetPenStartCap_delegate(IntPtr pen, out LineCap startCap); - private static FunctionWrapper<GdipGetPenStartCap_delegate> GdipGetPenStartCap_ptr; - internal static Status GdipGetPenStartCap(IntPtr pen, out LineCap startCap) => GdipGetPenStartCap_ptr.Delegate(pen, out startCap); - - private delegate Status GdipSetPenEndCap_delegate(IntPtr pen, LineCap endCap); - private static FunctionWrapper<GdipSetPenEndCap_delegate> GdipSetPenEndCap_ptr; - internal static Status GdipSetPenEndCap(IntPtr pen, LineCap endCap) => GdipSetPenEndCap_ptr.Delegate(pen, endCap); - - private delegate Status GdipGetPenEndCap_delegate(IntPtr pen, out LineCap endCap); - private static FunctionWrapper<GdipGetPenEndCap_delegate> GdipGetPenEndCap_ptr; - internal static Status GdipGetPenEndCap(IntPtr pen, out LineCap endCap) => GdipGetPenEndCap_ptr.Delegate(pen, out endCap); - - private delegate Status GdipSetPenCustomStartCap_delegate(IntPtr pen, IntPtr customCap); - private static FunctionWrapper<GdipSetPenCustomStartCap_delegate> GdipSetPenCustomStartCap_ptr; - internal static Status GdipSetPenCustomStartCap(IntPtr pen, IntPtr customCap) => GdipSetPenCustomStartCap_ptr.Delegate(pen, customCap); - - private delegate Status GdipGetPenCustomStartCap_delegate(IntPtr pen, out IntPtr customCap); - private static FunctionWrapper<GdipGetPenCustomStartCap_delegate> GdipGetPenCustomStartCap_ptr; - internal static Status GdipGetPenCustomStartCap(IntPtr pen, out IntPtr customCap) => GdipGetPenCustomStartCap_ptr.Delegate(pen, out customCap); - - private delegate Status GdipSetPenCustomEndCap_delegate(IntPtr pen, IntPtr customCap); - private static FunctionWrapper<GdipSetPenCustomEndCap_delegate> GdipSetPenCustomEndCap_ptr; - internal static Status GdipSetPenCustomEndCap(IntPtr pen, IntPtr customCap) => GdipSetPenCustomEndCap_ptr.Delegate(pen, customCap); - - private delegate Status GdipGetPenCustomEndCap_delegate(IntPtr pen, out IntPtr customCap); - private static FunctionWrapper<GdipGetPenCustomEndCap_delegate> GdipGetPenCustomEndCap_ptr; - internal static Status GdipGetPenCustomEndCap(IntPtr pen, out IntPtr customCap) => GdipGetPenCustomEndCap_ptr.Delegate(pen, out customCap); - - private delegate Status GdipSetPenTransform_delegate(IntPtr pen, IntPtr matrix); - private static FunctionWrapper<GdipSetPenTransform_delegate> GdipSetPenTransform_ptr; - internal static Status GdipSetPenTransform(IntPtr pen, IntPtr matrix) => GdipSetPenTransform_ptr.Delegate(pen, matrix); - - private delegate Status GdipGetPenTransform_delegate(IntPtr pen, IntPtr matrix); - private static FunctionWrapper<GdipGetPenTransform_delegate> GdipGetPenTransform_ptr; - internal static Status GdipGetPenTransform(IntPtr pen, IntPtr matrix) => GdipGetPenTransform_ptr.Delegate(pen, matrix); - - private delegate Status GdipSetPenWidth_delegate(IntPtr pen, float width); - private static FunctionWrapper<GdipSetPenWidth_delegate> GdipSetPenWidth_ptr; - internal static Status GdipSetPenWidth(IntPtr pen, float width) => GdipSetPenWidth_ptr.Delegate(pen, width); - - private delegate Status GdipGetPenWidth_delegate(IntPtr pen, out float width); - private static FunctionWrapper<GdipGetPenWidth_delegate> GdipGetPenWidth_ptr; - internal static Status GdipGetPenWidth(IntPtr pen, out float width) => GdipGetPenWidth_ptr.Delegate(pen, out width); - - private delegate Status GdipResetPenTransform_delegate(IntPtr pen); - private static FunctionWrapper<GdipResetPenTransform_delegate> GdipResetPenTransform_ptr; - internal static Status GdipResetPenTransform(IntPtr pen) => GdipResetPenTransform_ptr.Delegate(pen); - - private delegate Status GdipMultiplyPenTransform_delegate(IntPtr pen, IntPtr matrix, MatrixOrder order); - private static FunctionWrapper<GdipMultiplyPenTransform_delegate> GdipMultiplyPenTransform_ptr; - internal static Status GdipMultiplyPenTransform(IntPtr pen, IntPtr matrix, MatrixOrder order) => GdipMultiplyPenTransform_ptr.Delegate(pen, matrix, order); - - private delegate Status GdipRotatePenTransform_delegate(IntPtr pen, float angle, MatrixOrder order); - private static FunctionWrapper<GdipRotatePenTransform_delegate> GdipRotatePenTransform_ptr; - internal static Status GdipRotatePenTransform(IntPtr pen, float angle, MatrixOrder order) => GdipRotatePenTransform_ptr.Delegate(pen, angle, order); - - private delegate Status GdipScalePenTransform_delegate(IntPtr pen, float sx, float sy, MatrixOrder order); - private static FunctionWrapper<GdipScalePenTransform_delegate> GdipScalePenTransform_ptr; - internal static Status GdipScalePenTransform(IntPtr pen, float sx, float sy, MatrixOrder order) => GdipScalePenTransform_ptr.Delegate(pen, sx, sy, order); - - private delegate Status GdipTranslatePenTransform_delegate(IntPtr pen, float dx, float dy, MatrixOrder order); - private static FunctionWrapper<GdipTranslatePenTransform_delegate> GdipTranslatePenTransform_ptr; - internal static Status GdipTranslatePenTransform(IntPtr pen, float dx, float dy, MatrixOrder order) => GdipTranslatePenTransform_ptr.Delegate(pen, dx, dy, order); - private delegate Status GdipCreateFromHWND_delegate(IntPtr hwnd, out IntPtr graphics); private static FunctionWrapper<GdipCreateFromHWND_delegate> GdipCreateFromHWND_ptr; internal static Status GdipCreateFromHWND(IntPtr hwnd, out IntPtr graphics) => GdipCreateFromHWND_ptr.Delegate(hwnd, out graphics); diff --git a/src/System.Drawing.Common/src/System/Drawing/GdiplusNative.Windows.cs b/src/System.Drawing.Common/src/System/Drawing/GdiplusNative.Windows.cs index 94728da367..429fc281f5 100644 --- a/src/System.Drawing.Common/src/System/Drawing/GdiplusNative.Windows.cs +++ b/src/System.Drawing.Common/src/System/Drawing/GdiplusNative.Windows.cs @@ -201,51 +201,6 @@ namespace System.Drawing GdipRotatePathGradientTransform_ptr = LoadFunction<GdipRotatePathGradientTransform_delegate>("GdipRotatePathGradientTransform"); GdipGetPathGradientFocusScales_ptr = LoadFunction<GdipGetPathGradientFocusScales_delegate>("GdipGetPathGradientFocusScales"); GdipSetPathGradientFocusScales_ptr = LoadFunction<GdipSetPathGradientFocusScales_delegate>("GdipSetPathGradientFocusScales"); - GdipCreatePen1_ptr = LoadFunction<GdipCreatePen1_delegate>("GdipCreatePen1"); - GdipCreatePen2_ptr = LoadFunction<GdipCreatePen2_delegate>("GdipCreatePen2"); - GdipClonePen_ptr = LoadFunction<GdipClonePen_delegate>("GdipClonePen"); - GdipDeletePen_ptr = LoadFunction<GdipDeletePen_delegate>("GdipDeletePen"); - GdipSetPenMode_ptr = LoadFunction<GdipSetPenMode_delegate>("GdipSetPenMode"); - GdipGetPenMode_ptr = LoadFunction<GdipGetPenMode_delegate>("GdipGetPenMode"); - GdipSetPenWidth_ptr = LoadFunction<GdipSetPenWidth_delegate>("GdipSetPenWidth"); - GdipGetPenWidth_ptr = LoadFunction<GdipGetPenWidth_delegate>("GdipGetPenWidth"); - GdipSetPenLineCap197819_ptr = LoadFunction<GdipSetPenLineCap197819_delegate>("GdipSetPenLineCap197819"); - GdipSetPenStartCap_ptr = LoadFunction<GdipSetPenStartCap_delegate>("GdipSetPenStartCap"); - GdipSetPenEndCap_ptr = LoadFunction<GdipSetPenEndCap_delegate>("GdipSetPenEndCap"); - GdipGetPenStartCap_ptr = LoadFunction<GdipGetPenStartCap_delegate>("GdipGetPenStartCap"); - GdipGetPenEndCap_ptr = LoadFunction<GdipGetPenEndCap_delegate>("GdipGetPenEndCap"); - GdipGetPenDashCap197819_ptr = LoadFunction<GdipGetPenDashCap197819_delegate>("GdipGetPenDashCap197819"); - GdipSetPenDashCap197819_ptr = LoadFunction<GdipSetPenDashCap197819_delegate>("GdipSetPenDashCap197819"); - GdipSetPenLineJoin_ptr = LoadFunction<GdipSetPenLineJoin_delegate>("GdipSetPenLineJoin"); - GdipGetPenLineJoin_ptr = LoadFunction<GdipGetPenLineJoin_delegate>("GdipGetPenLineJoin"); - GdipSetPenCustomStartCap_ptr = LoadFunction<GdipSetPenCustomStartCap_delegate>("GdipSetPenCustomStartCap"); - GdipGetPenCustomStartCap_ptr = LoadFunction<GdipGetPenCustomStartCap_delegate>("GdipGetPenCustomStartCap"); - GdipSetPenCustomEndCap_ptr = LoadFunction<GdipSetPenCustomEndCap_delegate>("GdipSetPenCustomEndCap"); - GdipGetPenCustomEndCap_ptr = LoadFunction<GdipGetPenCustomEndCap_delegate>("GdipGetPenCustomEndCap"); - GdipSetPenMiterLimit_ptr = LoadFunction<GdipSetPenMiterLimit_delegate>("GdipSetPenMiterLimit"); - GdipGetPenMiterLimit_ptr = LoadFunction<GdipGetPenMiterLimit_delegate>("GdipGetPenMiterLimit"); - GdipSetPenTransform_ptr = LoadFunction<GdipSetPenTransform_delegate>("GdipSetPenTransform"); - GdipGetPenTransform_ptr = LoadFunction<GdipGetPenTransform_delegate>("GdipGetPenTransform"); - GdipResetPenTransform_ptr = LoadFunction<GdipResetPenTransform_delegate>("GdipResetPenTransform"); - GdipMultiplyPenTransform_ptr = LoadFunction<GdipMultiplyPenTransform_delegate>("GdipMultiplyPenTransform"); - GdipTranslatePenTransform_ptr = LoadFunction<GdipTranslatePenTransform_delegate>("GdipTranslatePenTransform"); - GdipScalePenTransform_ptr = LoadFunction<GdipScalePenTransform_delegate>("GdipScalePenTransform"); - GdipRotatePenTransform_ptr = LoadFunction<GdipRotatePenTransform_delegate>("GdipRotatePenTransform"); - GdipSetPenColor_ptr = LoadFunction<GdipSetPenColor_delegate>("GdipSetPenColor"); - GdipGetPenColor_ptr = LoadFunction<GdipGetPenColor_delegate>("GdipGetPenColor"); - GdipSetPenBrushFill_ptr = LoadFunction<GdipSetPenBrushFill_delegate>("GdipSetPenBrushFill"); - GdipGetPenBrushFill_ptr = LoadFunction<GdipGetPenBrushFill_delegate>("GdipGetPenBrushFill"); - GdipGetPenFillType_ptr = LoadFunction<GdipGetPenFillType_delegate>("GdipGetPenFillType"); - GdipGetPenDashStyle_ptr = LoadFunction<GdipGetPenDashStyle_delegate>("GdipGetPenDashStyle"); - GdipSetPenDashStyle_ptr = LoadFunction<GdipSetPenDashStyle_delegate>("GdipSetPenDashStyle"); - GdipSetPenDashArray_ptr = LoadFunction<GdipSetPenDashArray_delegate>("GdipSetPenDashArray"); - GdipGetPenDashOffset_ptr = LoadFunction<GdipGetPenDashOffset_delegate>("GdipGetPenDashOffset"); - GdipSetPenDashOffset_ptr = LoadFunction<GdipSetPenDashOffset_delegate>("GdipSetPenDashOffset"); - GdipGetPenDashCount_ptr = LoadFunction<GdipGetPenDashCount_delegate>("GdipGetPenDashCount"); - GdipGetPenDashArray_ptr = LoadFunction<GdipGetPenDashArray_delegate>("GdipGetPenDashArray"); - GdipGetPenCompoundCount_ptr = LoadFunction<GdipGetPenCompoundCount_delegate>("GdipGetPenCompoundCount"); - GdipSetPenCompoundArray_ptr = LoadFunction<GdipSetPenCompoundArray_delegate>("GdipSetPenCompoundArray"); - GdipGetPenCompoundArray_ptr = LoadFunction<GdipGetPenCompoundArray_delegate>("GdipGetPenCompoundArray"); GdipLoadImageFromStream_ptr = LoadFunction<GdipLoadImageFromStream_delegate>("GdipLoadImageFromStream"); GdipLoadImageFromFile_ptr = LoadFunction<GdipLoadImageFromFile_delegate>("GdipLoadImageFromFile"); GdipLoadImageFromStreamICM_ptr = LoadFunction<GdipLoadImageFromStreamICM_delegate>("GdipLoadImageFromStreamICM"); @@ -1207,186 +1162,6 @@ namespace System.Drawing private static FunctionWrapper<GdipSetPathGradientFocusScales_delegate> GdipSetPathGradientFocusScales_ptr; internal static int GdipSetPathGradientFocusScales(HandleRef brush, float xScale, float yScale) => GdipSetPathGradientFocusScales_ptr.Delegate(brush, xScale, yScale); - private delegate int GdipCreatePen1_delegate(int argb, float width, int unit, out IntPtr pen); - private static FunctionWrapper<GdipCreatePen1_delegate> GdipCreatePen1_ptr; - internal static int GdipCreatePen1(int argb, float width, int unit, out IntPtr pen) => GdipCreatePen1_ptr.Delegate(argb, width, unit, out pen); - - private delegate int GdipCreatePen2_delegate(HandleRef brush, float width, int unit, out IntPtr pen); - private static FunctionWrapper<GdipCreatePen2_delegate> GdipCreatePen2_ptr; - internal static int GdipCreatePen2(HandleRef brush, float width, int unit, out IntPtr pen) => GdipCreatePen2_ptr.Delegate(brush, width, unit, out pen); - - private delegate int GdipClonePen_delegate(HandleRef pen, out IntPtr clonepen); - private static FunctionWrapper<GdipClonePen_delegate> GdipClonePen_ptr; - internal static int GdipClonePen(HandleRef pen, out IntPtr clonepen) => GdipClonePen_ptr.Delegate(pen, out clonepen); - - private delegate int GdipDeletePen_delegate(HandleRef Pen); - private static FunctionWrapper<GdipDeletePen_delegate> GdipDeletePen_ptr; - internal static int IntGdipDeletePen(HandleRef Pen) => GdipDeletePen_ptr.Delegate(Pen); - - private delegate int GdipSetPenMode_delegate(HandleRef pen, PenAlignment penAlign); - private static FunctionWrapper<GdipSetPenMode_delegate> GdipSetPenMode_ptr; - internal static int GdipSetPenMode(HandleRef pen, PenAlignment penAlign) => GdipSetPenMode_ptr.Delegate(pen, penAlign); - - private delegate int GdipGetPenMode_delegate(HandleRef pen, out PenAlignment penAlign); - private static FunctionWrapper<GdipGetPenMode_delegate> GdipGetPenMode_ptr; - internal static int GdipGetPenMode(HandleRef pen, out PenAlignment penAlign) => GdipGetPenMode_ptr.Delegate(pen, out penAlign); - - private delegate int GdipSetPenWidth_delegate(HandleRef pen, float width); - private static FunctionWrapper<GdipSetPenWidth_delegate> GdipSetPenWidth_ptr; - internal static int GdipSetPenWidth(HandleRef pen, float width) => GdipSetPenWidth_ptr.Delegate(pen, width); - - private delegate int GdipGetPenWidth_delegate(HandleRef pen, float[] width); - private static FunctionWrapper<GdipGetPenWidth_delegate> GdipGetPenWidth_ptr; - internal static int GdipGetPenWidth(HandleRef pen, float[] width) => GdipGetPenWidth_ptr.Delegate(pen, width); - - private delegate int GdipSetPenLineCap197819_delegate(HandleRef pen, int startCap, int endCap, int dashCap); - private static FunctionWrapper<GdipSetPenLineCap197819_delegate> GdipSetPenLineCap197819_ptr; - internal static int GdipSetPenLineCap197819(HandleRef pen, int startCap, int endCap, int dashCap) => GdipSetPenLineCap197819_ptr.Delegate(pen, startCap, endCap, dashCap); - - private delegate int GdipSetPenStartCap_delegate(HandleRef pen, int startCap); - private static FunctionWrapper<GdipSetPenStartCap_delegate> GdipSetPenStartCap_ptr; - internal static int GdipSetPenStartCap(HandleRef pen, int startCap) => GdipSetPenStartCap_ptr.Delegate(pen, startCap); - - private delegate int GdipSetPenEndCap_delegate(HandleRef pen, int endCap); - private static FunctionWrapper<GdipSetPenEndCap_delegate> GdipSetPenEndCap_ptr; - internal static int GdipSetPenEndCap(HandleRef pen, int endCap) => GdipSetPenEndCap_ptr.Delegate(pen, endCap); - - private delegate int GdipGetPenStartCap_delegate(HandleRef pen, out int startCap); - private static FunctionWrapper<GdipGetPenStartCap_delegate> GdipGetPenStartCap_ptr; - internal static int GdipGetPenStartCap(HandleRef pen, out int startCap) => GdipGetPenStartCap_ptr.Delegate(pen, out startCap); - - private delegate int GdipGetPenEndCap_delegate(HandleRef pen, out int endCap); - private static FunctionWrapper<GdipGetPenEndCap_delegate> GdipGetPenEndCap_ptr; - internal static int GdipGetPenEndCap(HandleRef pen, out int endCap) => GdipGetPenEndCap_ptr.Delegate(pen, out endCap); - - private delegate int GdipGetPenDashCap197819_delegate(HandleRef pen, out int dashCap); - private static FunctionWrapper<GdipGetPenDashCap197819_delegate> GdipGetPenDashCap197819_ptr; - internal static int GdipGetPenDashCap197819(HandleRef pen, out int dashCap) => GdipGetPenDashCap197819_ptr.Delegate(pen, out dashCap); - - private delegate int GdipSetPenDashCap197819_delegate(HandleRef pen, int dashCap); - private static FunctionWrapper<GdipSetPenDashCap197819_delegate> GdipSetPenDashCap197819_ptr; - internal static int GdipSetPenDashCap197819(HandleRef pen, int dashCap) => GdipSetPenDashCap197819_ptr.Delegate(pen, dashCap); - - private delegate int GdipSetPenLineJoin_delegate(HandleRef pen, int lineJoin); - private static FunctionWrapper<GdipSetPenLineJoin_delegate> GdipSetPenLineJoin_ptr; - internal static int GdipSetPenLineJoin(HandleRef pen, int lineJoin) => GdipSetPenLineJoin_ptr.Delegate(pen, lineJoin); - - private delegate int GdipGetPenLineJoin_delegate(HandleRef pen, out int lineJoin); - private static FunctionWrapper<GdipGetPenLineJoin_delegate> GdipGetPenLineJoin_ptr; - internal static int GdipGetPenLineJoin(HandleRef pen, out int lineJoin) => GdipGetPenLineJoin_ptr.Delegate(pen, out lineJoin); - - private delegate int GdipSetPenCustomStartCap_delegate(HandleRef pen, HandleRef customCap); - private static FunctionWrapper<GdipSetPenCustomStartCap_delegate> GdipSetPenCustomStartCap_ptr; - internal static int GdipSetPenCustomStartCap(HandleRef pen, HandleRef customCap) => GdipSetPenCustomStartCap_ptr.Delegate(pen, customCap); - - private delegate int GdipGetPenCustomStartCap_delegate(HandleRef pen, out IntPtr customCap); - private static FunctionWrapper<GdipGetPenCustomStartCap_delegate> GdipGetPenCustomStartCap_ptr; - internal static int GdipGetPenCustomStartCap(HandleRef pen, out IntPtr customCap) => GdipGetPenCustomStartCap_ptr.Delegate(pen, out customCap); - - private delegate int GdipSetPenCustomEndCap_delegate(HandleRef pen, HandleRef customCap); - private static FunctionWrapper<GdipSetPenCustomEndCap_delegate> GdipSetPenCustomEndCap_ptr; - internal static int GdipSetPenCustomEndCap(HandleRef pen, HandleRef customCap) => GdipSetPenCustomEndCap_ptr.Delegate(pen, customCap); - - private delegate int GdipGetPenCustomEndCap_delegate(HandleRef pen, out IntPtr customCap); - private static FunctionWrapper<GdipGetPenCustomEndCap_delegate> GdipGetPenCustomEndCap_ptr; - internal static int GdipGetPenCustomEndCap(HandleRef pen, out IntPtr customCap) => GdipGetPenCustomEndCap_ptr.Delegate(pen, out customCap); - - private delegate int GdipSetPenMiterLimit_delegate(HandleRef pen, float miterLimit); - private static FunctionWrapper<GdipSetPenMiterLimit_delegate> GdipSetPenMiterLimit_ptr; - internal static int GdipSetPenMiterLimit(HandleRef pen, float miterLimit) => GdipSetPenMiterLimit_ptr.Delegate(pen, miterLimit); - - private delegate int GdipGetPenMiterLimit_delegate(HandleRef pen, float[] miterLimit); - private static FunctionWrapper<GdipGetPenMiterLimit_delegate> GdipGetPenMiterLimit_ptr; - internal static int GdipGetPenMiterLimit(HandleRef pen, float[] miterLimit) => GdipGetPenMiterLimit_ptr.Delegate(pen, miterLimit); - - private delegate int GdipSetPenTransform_delegate(HandleRef pen, HandleRef matrix); - private static FunctionWrapper<GdipSetPenTransform_delegate> GdipSetPenTransform_ptr; - internal static int GdipSetPenTransform(HandleRef pen, HandleRef matrix) => GdipSetPenTransform_ptr.Delegate(pen, matrix); - - private delegate int GdipGetPenTransform_delegate(HandleRef pen, HandleRef matrix); - private static FunctionWrapper<GdipGetPenTransform_delegate> GdipGetPenTransform_ptr; - internal static int GdipGetPenTransform(HandleRef pen, HandleRef matrix) => GdipGetPenTransform_ptr.Delegate(pen, matrix); - - private delegate int GdipResetPenTransform_delegate(HandleRef brush); - private static FunctionWrapper<GdipResetPenTransform_delegate> GdipResetPenTransform_ptr; - internal static int GdipResetPenTransform(HandleRef brush) => GdipResetPenTransform_ptr.Delegate(brush); - - private delegate int GdipMultiplyPenTransform_delegate(HandleRef brush, HandleRef matrix, MatrixOrder order); - private static FunctionWrapper<GdipMultiplyPenTransform_delegate> GdipMultiplyPenTransform_ptr; - internal static int GdipMultiplyPenTransform(HandleRef brush, HandleRef matrix, MatrixOrder order) => GdipMultiplyPenTransform_ptr.Delegate(brush, matrix, order); - - private delegate int GdipTranslatePenTransform_delegate(HandleRef brush, float dx, float dy, MatrixOrder order); - private static FunctionWrapper<GdipTranslatePenTransform_delegate> GdipTranslatePenTransform_ptr; - internal static int GdipTranslatePenTransform(HandleRef brush, float dx, float dy, MatrixOrder order) => GdipTranslatePenTransform_ptr.Delegate(brush, dx, dy, order); - - private delegate int GdipScalePenTransform_delegate(HandleRef brush, float sx, float sy, MatrixOrder order); - private static FunctionWrapper<GdipScalePenTransform_delegate> GdipScalePenTransform_ptr; - internal static int GdipScalePenTransform(HandleRef brush, float sx, float sy, MatrixOrder order) => GdipScalePenTransform_ptr.Delegate(brush, sx, sy, order); - - private delegate int GdipRotatePenTransform_delegate(HandleRef brush, float angle, MatrixOrder order); - private static FunctionWrapper<GdipRotatePenTransform_delegate> GdipRotatePenTransform_ptr; - internal static int GdipRotatePenTransform(HandleRef brush, float angle, MatrixOrder order) => GdipRotatePenTransform_ptr.Delegate(brush, angle, order); - - private delegate int GdipSetPenColor_delegate(HandleRef pen, int argb); - private static FunctionWrapper<GdipSetPenColor_delegate> GdipSetPenColor_ptr; - internal static int GdipSetPenColor(HandleRef pen, int argb) => GdipSetPenColor_ptr.Delegate(pen, argb); - - private delegate int GdipGetPenColor_delegate(HandleRef pen, out int argb); - private static FunctionWrapper<GdipGetPenColor_delegate> GdipGetPenColor_ptr; - internal static int GdipGetPenColor(HandleRef pen, out int argb) => GdipGetPenColor_ptr.Delegate(pen, out argb); - - private delegate int GdipSetPenBrushFill_delegate(HandleRef pen, HandleRef brush); - private static FunctionWrapper<GdipSetPenBrushFill_delegate> GdipSetPenBrushFill_ptr; - internal static int GdipSetPenBrushFill(HandleRef pen, HandleRef brush) => GdipSetPenBrushFill_ptr.Delegate(pen, brush); - - private delegate int GdipGetPenBrushFill_delegate(HandleRef pen, out IntPtr brush); - private static FunctionWrapper<GdipGetPenBrushFill_delegate> GdipGetPenBrushFill_ptr; - internal static int GdipGetPenBrushFill(HandleRef pen, out IntPtr brush) => GdipGetPenBrushFill_ptr.Delegate(pen, out brush); - - private delegate int GdipGetPenFillType_delegate(HandleRef pen, out int pentype); - private static FunctionWrapper<GdipGetPenFillType_delegate> GdipGetPenFillType_ptr; - internal static int GdipGetPenFillType(HandleRef pen, out int pentype) => GdipGetPenFillType_ptr.Delegate(pen, out pentype); - - private delegate int GdipGetPenDashStyle_delegate(HandleRef pen, out int dashstyle); - private static FunctionWrapper<GdipGetPenDashStyle_delegate> GdipGetPenDashStyle_ptr; - internal static int GdipGetPenDashStyle(HandleRef pen, out int dashstyle) => GdipGetPenDashStyle_ptr.Delegate(pen, out dashstyle); - - private delegate int GdipSetPenDashStyle_delegate(HandleRef pen, int dashstyle); - private static FunctionWrapper<GdipSetPenDashStyle_delegate> GdipSetPenDashStyle_ptr; - internal static int GdipSetPenDashStyle(HandleRef pen, int dashstyle) => GdipSetPenDashStyle_ptr.Delegate(pen, dashstyle); - - private delegate int GdipSetPenDashArray_delegate(HandleRef pen, HandleRef memorydash, int count); - private static FunctionWrapper<GdipSetPenDashArray_delegate> GdipSetPenDashArray_ptr; - internal static int GdipSetPenDashArray(HandleRef pen, HandleRef memorydash, int count) => GdipSetPenDashArray_ptr.Delegate(pen, memorydash, count); - - private delegate int GdipGetPenDashOffset_delegate(HandleRef pen, float[] dashoffset); - private static FunctionWrapper<GdipGetPenDashOffset_delegate> GdipGetPenDashOffset_ptr; - internal static int GdipGetPenDashOffset(HandleRef pen, float[] dashoffset) => GdipGetPenDashOffset_ptr.Delegate(pen, dashoffset); - - private delegate int GdipSetPenDashOffset_delegate(HandleRef pen, float dashoffset); - private static FunctionWrapper<GdipSetPenDashOffset_delegate> GdipSetPenDashOffset_ptr; - internal static int GdipSetPenDashOffset(HandleRef pen, float dashoffset) => GdipSetPenDashOffset_ptr.Delegate(pen, dashoffset); - - private delegate int GdipGetPenDashCount_delegate(HandleRef pen, out int dashcount); - private static FunctionWrapper<GdipGetPenDashCount_delegate> GdipGetPenDashCount_ptr; - internal static int GdipGetPenDashCount(HandleRef pen, out int dashcount) => GdipGetPenDashCount_ptr.Delegate(pen, out dashcount); - - private delegate int GdipGetPenDashArray_delegate(HandleRef pen, IntPtr memorydash, int count); - private static FunctionWrapper<GdipGetPenDashArray_delegate> GdipGetPenDashArray_ptr; - internal static int GdipGetPenDashArray(HandleRef pen, IntPtr memorydash, int count) => GdipGetPenDashArray_ptr.Delegate(pen, memorydash, count); - - private delegate int GdipGetPenCompoundCount_delegate(HandleRef pen, out int count); - private static FunctionWrapper<GdipGetPenCompoundCount_delegate> GdipGetPenCompoundCount_ptr; - internal static int GdipGetPenCompoundCount(HandleRef pen, out int count) => GdipGetPenCompoundCount_ptr.Delegate(pen, out count); - - private delegate int GdipSetPenCompoundArray_delegate(HandleRef pen, float[] array, int count); - private static FunctionWrapper<GdipSetPenCompoundArray_delegate> GdipSetPenCompoundArray_ptr; - internal static int GdipSetPenCompoundArray(HandleRef pen, float[] array, int count) => GdipSetPenCompoundArray_ptr.Delegate(pen, array, count); - - private delegate int GdipGetPenCompoundArray_delegate(HandleRef pen, float[] array, int count); - private static FunctionWrapper<GdipGetPenCompoundArray_delegate> GdipGetPenCompoundArray_ptr; - internal static int GdipGetPenCompoundArray(HandleRef pen, float[] array, int count) => GdipGetPenCompoundArray_ptr.Delegate(pen, array, count); - private delegate int GdipLoadImageFromStream_delegate(UnsafeNativeMethods.IStream stream, out IntPtr image); private static FunctionWrapper<GdipLoadImageFromStream_delegate> GdipLoadImageFromStream_ptr; internal static int GdipLoadImageFromStream(UnsafeNativeMethods.IStream stream, out IntPtr image) => GdipLoadImageFromStream_ptr.Delegate(stream, out image); diff --git a/src/System.Drawing.Common/src/System/Drawing/GdiplusNative.cs b/src/System.Drawing.Common/src/System/Drawing/GdiplusNative.cs index ea70a6eb82..ee0298deca 100644 --- a/src/System.Drawing.Common/src/System/Drawing/GdiplusNative.cs +++ b/src/System.Drawing.Common/src/System/Drawing/GdiplusNative.cs @@ -139,6 +139,51 @@ namespace System.Drawing GdipGetFontCollectionFamilyList_ptr = LoadFunction<GdipGetFontCollectionFamilyList_delegate>("GdipGetFontCollectionFamilyList"); GdipCloneFontFamily_ptr = LoadFunction<GdipCloneFontFamily_delegate>("GdipCloneFontFamily"); GdipNewInstalledFontCollection_ptr = LoadFunction<GdipNewInstalledFontCollection_delegate>("GdipNewInstalledFontCollection"); + GdipCreatePen1_ptr = LoadFunction<GdipCreatePen1_delegate>("GdipCreatePen1"); + GdipCreatePen2_ptr = LoadFunction<GdipCreatePen2_delegate>("GdipCreatePen2"); + GdipClonePen_ptr = LoadFunction<GdipClonePen_delegate>("GdipClonePen"); + GdipDeletePen_ptr = LoadFunction<GdipDeletePen_delegate>("GdipDeletePen"); + GdipSetPenMode_ptr = LoadFunction<GdipSetPenMode_delegate>("GdipSetPenMode"); + GdipGetPenMode_ptr = LoadFunction<GdipGetPenMode_delegate>("GdipGetPenMode"); + GdipSetPenWidth_ptr = LoadFunction<GdipSetPenWidth_delegate>("GdipSetPenWidth"); + GdipGetPenWidth_ptr = LoadFunction<GdipGetPenWidth_delegate>("GdipGetPenWidth"); + GdipSetPenLineCap197819_ptr = LoadFunction<GdipSetPenLineCap197819_delegate>("GdipSetPenLineCap197819"); + GdipSetPenStartCap_ptr = LoadFunction<GdipSetPenStartCap_delegate>("GdipSetPenStartCap"); + GdipSetPenEndCap_ptr = LoadFunction<GdipSetPenEndCap_delegate>("GdipSetPenEndCap"); + GdipGetPenStartCap_ptr = LoadFunction<GdipGetPenStartCap_delegate>("GdipGetPenStartCap"); + GdipGetPenEndCap_ptr = LoadFunction<GdipGetPenEndCap_delegate>("GdipGetPenEndCap"); + GdipGetPenDashCap197819_ptr = LoadFunction<GdipGetPenDashCap197819_delegate>("GdipGetPenDashCap197819"); + GdipSetPenDashCap197819_ptr = LoadFunction<GdipSetPenDashCap197819_delegate>("GdipSetPenDashCap197819"); + GdipSetPenLineJoin_ptr = LoadFunction<GdipSetPenLineJoin_delegate>("GdipSetPenLineJoin"); + GdipGetPenLineJoin_ptr = LoadFunction<GdipGetPenLineJoin_delegate>("GdipGetPenLineJoin"); + GdipSetPenCustomStartCap_ptr = LoadFunction<GdipSetPenCustomStartCap_delegate>("GdipSetPenCustomStartCap"); + GdipGetPenCustomStartCap_ptr = LoadFunction<GdipGetPenCustomStartCap_delegate>("GdipGetPenCustomStartCap"); + GdipSetPenCustomEndCap_ptr = LoadFunction<GdipSetPenCustomEndCap_delegate>("GdipSetPenCustomEndCap"); + GdipGetPenCustomEndCap_ptr = LoadFunction<GdipGetPenCustomEndCap_delegate>("GdipGetPenCustomEndCap"); + GdipSetPenMiterLimit_ptr = LoadFunction<GdipSetPenMiterLimit_delegate>("GdipSetPenMiterLimit"); + GdipGetPenMiterLimit_ptr = LoadFunction<GdipGetPenMiterLimit_delegate>("GdipGetPenMiterLimit"); + GdipSetPenTransform_ptr = LoadFunction<GdipSetPenTransform_delegate>("GdipSetPenTransform"); + GdipGetPenTransform_ptr = LoadFunction<GdipGetPenTransform_delegate>("GdipGetPenTransform"); + GdipResetPenTransform_ptr = LoadFunction<GdipResetPenTransform_delegate>("GdipResetPenTransform"); + GdipMultiplyPenTransform_ptr = LoadFunction<GdipMultiplyPenTransform_delegate>("GdipMultiplyPenTransform"); + GdipTranslatePenTransform_ptr = LoadFunction<GdipTranslatePenTransform_delegate>("GdipTranslatePenTransform"); + GdipScalePenTransform_ptr = LoadFunction<GdipScalePenTransform_delegate>("GdipScalePenTransform"); + GdipRotatePenTransform_ptr = LoadFunction<GdipRotatePenTransform_delegate>("GdipRotatePenTransform"); + GdipSetPenColor_ptr = LoadFunction<GdipSetPenColor_delegate>("GdipSetPenColor"); + GdipGetPenColor_ptr = LoadFunction<GdipGetPenColor_delegate>("GdipGetPenColor"); + GdipSetPenBrushFill_ptr = LoadFunction<GdipSetPenBrushFill_delegate>("GdipSetPenBrushFill"); + GdipGetPenBrushFill_ptr = LoadFunction<GdipGetPenBrushFill_delegate>("GdipGetPenBrushFill"); + GdipGetPenFillType_ptr = LoadFunction<GdipGetPenFillType_delegate>("GdipGetPenFillType"); + GdipGetPenDashStyle_ptr = LoadFunction<GdipGetPenDashStyle_delegate>("GdipGetPenDashStyle"); + GdipSetPenDashStyle_ptr = LoadFunction<GdipSetPenDashStyle_delegate>("GdipSetPenDashStyle"); + GdipSetPenDashArray_ptr = LoadFunction<GdipSetPenDashArray_delegate>("GdipSetPenDashArray"); + GdipGetPenDashOffset_ptr = LoadFunction<GdipGetPenDashOffset_delegate>("GdipGetPenDashOffset"); + GdipSetPenDashOffset_ptr = LoadFunction<GdipSetPenDashOffset_delegate>("GdipSetPenDashOffset"); + GdipGetPenDashCount_ptr = LoadFunction<GdipGetPenDashCount_delegate>("GdipGetPenDashCount"); + GdipGetPenDashArray_ptr = LoadFunction<GdipGetPenDashArray_delegate>("GdipGetPenDashArray"); + GdipGetPenCompoundCount_ptr = LoadFunction<GdipGetPenCompoundCount_delegate>("GdipGetPenCompoundCount"); + GdipSetPenCompoundArray_ptr = LoadFunction<GdipSetPenCompoundArray_delegate>("GdipSetPenCompoundArray"); + GdipGetPenCompoundArray_ptr = LoadFunction<GdipGetPenCompoundArray_delegate>("GdipGetPenCompoundArray"); } // Shared function imports (all platforms) @@ -463,6 +508,186 @@ namespace System.Drawing private delegate int GdipNewInstalledFontCollection_delegate(out IntPtr fontCollection); private static FunctionWrapper<GdipNewInstalledFontCollection_delegate> GdipNewInstalledFontCollection_ptr; internal static int GdipNewInstalledFontCollection(out IntPtr fontCollection) => GdipNewInstalledFontCollection_ptr.Delegate(out fontCollection); + + private delegate int GdipCreatePen1_delegate(int argb, float width, int unit, out IntPtr pen); + private static FunctionWrapper<GdipCreatePen1_delegate> GdipCreatePen1_ptr; + internal static int GdipCreatePen1(int argb, float width, int unit, out IntPtr pen) => GdipCreatePen1_ptr.Delegate(argb, width, unit, out pen); + + private delegate int GdipCreatePen2_delegate(HandleRef brush, float width, int unit, out IntPtr pen); + private static FunctionWrapper<GdipCreatePen2_delegate> GdipCreatePen2_ptr; + internal static int GdipCreatePen2(HandleRef brush, float width, int unit, out IntPtr pen) => GdipCreatePen2_ptr.Delegate(brush, width, unit, out pen); + + private delegate int GdipClonePen_delegate(HandleRef pen, out IntPtr clonepen); + private static FunctionWrapper<GdipClonePen_delegate> GdipClonePen_ptr; + internal static int GdipClonePen(HandleRef pen, out IntPtr clonepen) => GdipClonePen_ptr.Delegate(pen, out clonepen); + + private delegate int GdipDeletePen_delegate(HandleRef Pen); + private static FunctionWrapper<GdipDeletePen_delegate> GdipDeletePen_ptr; + internal static int IntGdipDeletePen(HandleRef Pen) => GdipDeletePen_ptr.Delegate(Pen); + + private delegate int GdipSetPenMode_delegate(HandleRef pen, PenAlignment penAlign); + private static FunctionWrapper<GdipSetPenMode_delegate> GdipSetPenMode_ptr; + internal static int GdipSetPenMode(HandleRef pen, PenAlignment penAlign) => GdipSetPenMode_ptr.Delegate(pen, penAlign); + + private delegate int GdipGetPenMode_delegate(HandleRef pen, out PenAlignment penAlign); + private static FunctionWrapper<GdipGetPenMode_delegate> GdipGetPenMode_ptr; + internal static int GdipGetPenMode(HandleRef pen, out PenAlignment penAlign) => GdipGetPenMode_ptr.Delegate(pen, out penAlign); + + private delegate int GdipSetPenWidth_delegate(HandleRef pen, float width); + private static FunctionWrapper<GdipSetPenWidth_delegate> GdipSetPenWidth_ptr; + internal static int GdipSetPenWidth(HandleRef pen, float width) => GdipSetPenWidth_ptr.Delegate(pen, width); + + private delegate int GdipGetPenWidth_delegate(HandleRef pen, float[] width); + private static FunctionWrapper<GdipGetPenWidth_delegate> GdipGetPenWidth_ptr; + internal static int GdipGetPenWidth(HandleRef pen, float[] width) => GdipGetPenWidth_ptr.Delegate(pen, width); + + private delegate int GdipSetPenLineCap197819_delegate(HandleRef pen, int startCap, int endCap, int dashCap); + private static FunctionWrapper<GdipSetPenLineCap197819_delegate> GdipSetPenLineCap197819_ptr; + internal static int GdipSetPenLineCap197819(HandleRef pen, int startCap, int endCap, int dashCap) => GdipSetPenLineCap197819_ptr.Delegate(pen, startCap, endCap, dashCap); + + private delegate int GdipSetPenStartCap_delegate(HandleRef pen, int startCap); + private static FunctionWrapper<GdipSetPenStartCap_delegate> GdipSetPenStartCap_ptr; + internal static int GdipSetPenStartCap(HandleRef pen, int startCap) => GdipSetPenStartCap_ptr.Delegate(pen, startCap); + + private delegate int GdipSetPenEndCap_delegate(HandleRef pen, int endCap); + private static FunctionWrapper<GdipSetPenEndCap_delegate> GdipSetPenEndCap_ptr; + internal static int GdipSetPenEndCap(HandleRef pen, int endCap) => GdipSetPenEndCap_ptr.Delegate(pen, endCap); + + private delegate int GdipGetPenStartCap_delegate(HandleRef pen, out int startCap); + private static FunctionWrapper<GdipGetPenStartCap_delegate> GdipGetPenStartCap_ptr; + internal static int GdipGetPenStartCap(HandleRef pen, out int startCap) => GdipGetPenStartCap_ptr.Delegate(pen, out startCap); + + private delegate int GdipGetPenEndCap_delegate(HandleRef pen, out int endCap); + private static FunctionWrapper<GdipGetPenEndCap_delegate> GdipGetPenEndCap_ptr; + internal static int GdipGetPenEndCap(HandleRef pen, out int endCap) => GdipGetPenEndCap_ptr.Delegate(pen, out endCap); + + private delegate int GdipGetPenDashCap197819_delegate(HandleRef pen, out int dashCap); + private static FunctionWrapper<GdipGetPenDashCap197819_delegate> GdipGetPenDashCap197819_ptr; + internal static int GdipGetPenDashCap197819(HandleRef pen, out int dashCap) => GdipGetPenDashCap197819_ptr.Delegate(pen, out dashCap); + + private delegate int GdipSetPenDashCap197819_delegate(HandleRef pen, int dashCap); + private static FunctionWrapper<GdipSetPenDashCap197819_delegate> GdipSetPenDashCap197819_ptr; + internal static int GdipSetPenDashCap197819(HandleRef pen, int dashCap) => GdipSetPenDashCap197819_ptr.Delegate(pen, dashCap); + + private delegate int GdipSetPenLineJoin_delegate(HandleRef pen, int lineJoin); + private static FunctionWrapper<GdipSetPenLineJoin_delegate> GdipSetPenLineJoin_ptr; + internal static int GdipSetPenLineJoin(HandleRef pen, int lineJoin) => GdipSetPenLineJoin_ptr.Delegate(pen, lineJoin); + + private delegate int GdipGetPenLineJoin_delegate(HandleRef pen, out int lineJoin); + private static FunctionWrapper<GdipGetPenLineJoin_delegate> GdipGetPenLineJoin_ptr; + internal static int GdipGetPenLineJoin(HandleRef pen, out int lineJoin) => GdipGetPenLineJoin_ptr.Delegate(pen, out lineJoin); + + private delegate int GdipSetPenCustomStartCap_delegate(HandleRef pen, HandleRef customCap); + private static FunctionWrapper<GdipSetPenCustomStartCap_delegate> GdipSetPenCustomStartCap_ptr; + internal static int GdipSetPenCustomStartCap(HandleRef pen, HandleRef customCap) => GdipSetPenCustomStartCap_ptr.Delegate(pen, customCap); + + private delegate int GdipGetPenCustomStartCap_delegate(HandleRef pen, out IntPtr customCap); + private static FunctionWrapper<GdipGetPenCustomStartCap_delegate> GdipGetPenCustomStartCap_ptr; + internal static int GdipGetPenCustomStartCap(HandleRef pen, out IntPtr customCap) => GdipGetPenCustomStartCap_ptr.Delegate(pen, out customCap); + + private delegate int GdipSetPenCustomEndCap_delegate(HandleRef pen, HandleRef customCap); + private static FunctionWrapper<GdipSetPenCustomEndCap_delegate> GdipSetPenCustomEndCap_ptr; + internal static int GdipSetPenCustomEndCap(HandleRef pen, HandleRef customCap) => GdipSetPenCustomEndCap_ptr.Delegate(pen, customCap); + + private delegate int GdipGetPenCustomEndCap_delegate(HandleRef pen, out IntPtr customCap); + private static FunctionWrapper<GdipGetPenCustomEndCap_delegate> GdipGetPenCustomEndCap_ptr; + internal static int GdipGetPenCustomEndCap(HandleRef pen, out IntPtr customCap) => GdipGetPenCustomEndCap_ptr.Delegate(pen, out customCap); + + private delegate int GdipSetPenMiterLimit_delegate(HandleRef pen, float miterLimit); + private static FunctionWrapper<GdipSetPenMiterLimit_delegate> GdipSetPenMiterLimit_ptr; + internal static int GdipSetPenMiterLimit(HandleRef pen, float miterLimit) => GdipSetPenMiterLimit_ptr.Delegate(pen, miterLimit); + + private delegate int GdipGetPenMiterLimit_delegate(HandleRef pen, float[] miterLimit); + private static FunctionWrapper<GdipGetPenMiterLimit_delegate> GdipGetPenMiterLimit_ptr; + internal static int GdipGetPenMiterLimit(HandleRef pen, float[] miterLimit) => GdipGetPenMiterLimit_ptr.Delegate(pen, miterLimit); + + private delegate int GdipSetPenTransform_delegate(HandleRef pen, HandleRef matrix); + private static FunctionWrapper<GdipSetPenTransform_delegate> GdipSetPenTransform_ptr; + internal static int GdipSetPenTransform(HandleRef pen, HandleRef matrix) => GdipSetPenTransform_ptr.Delegate(pen, matrix); + + private delegate int GdipGetPenTransform_delegate(HandleRef pen, HandleRef matrix); + private static FunctionWrapper<GdipGetPenTransform_delegate> GdipGetPenTransform_ptr; + internal static int GdipGetPenTransform(HandleRef pen, HandleRef matrix) => GdipGetPenTransform_ptr.Delegate(pen, matrix); + + private delegate int GdipResetPenTransform_delegate(HandleRef brush); + private static FunctionWrapper<GdipResetPenTransform_delegate> GdipResetPenTransform_ptr; + internal static int GdipResetPenTransform(HandleRef brush) => GdipResetPenTransform_ptr.Delegate(brush); + + private delegate int GdipMultiplyPenTransform_delegate(HandleRef brush, HandleRef matrix, MatrixOrder order); + private static FunctionWrapper<GdipMultiplyPenTransform_delegate> GdipMultiplyPenTransform_ptr; + internal static int GdipMultiplyPenTransform(HandleRef brush, HandleRef matrix, MatrixOrder order) => GdipMultiplyPenTransform_ptr.Delegate(brush, matrix, order); + + private delegate int GdipTranslatePenTransform_delegate(HandleRef brush, float dx, float dy, MatrixOrder order); + private static FunctionWrapper<GdipTranslatePenTransform_delegate> GdipTranslatePenTransform_ptr; + internal static int GdipTranslatePenTransform(HandleRef brush, float dx, float dy, MatrixOrder order) => GdipTranslatePenTransform_ptr.Delegate(brush, dx, dy, order); + + private delegate int GdipScalePenTransform_delegate(HandleRef brush, float sx, float sy, MatrixOrder order); + private static FunctionWrapper<GdipScalePenTransform_delegate> GdipScalePenTransform_ptr; + internal static int GdipScalePenTransform(HandleRef brush, float sx, float sy, MatrixOrder order) => GdipScalePenTransform_ptr.Delegate(brush, sx, sy, order); + + private delegate int GdipRotatePenTransform_delegate(HandleRef brush, float angle, MatrixOrder order); + private static FunctionWrapper<GdipRotatePenTransform_delegate> GdipRotatePenTransform_ptr; + internal static int GdipRotatePenTransform(HandleRef brush, float angle, MatrixOrder order) => GdipRotatePenTransform_ptr.Delegate(brush, angle, order); + + private delegate int GdipSetPenColor_delegate(HandleRef pen, int argb); + private static FunctionWrapper<GdipSetPenColor_delegate> GdipSetPenColor_ptr; + internal static int GdipSetPenColor(HandleRef pen, int argb) => GdipSetPenColor_ptr.Delegate(pen, argb); + + private delegate int GdipGetPenColor_delegate(HandleRef pen, out int argb); + private static FunctionWrapper<GdipGetPenColor_delegate> GdipGetPenColor_ptr; + internal static int GdipGetPenColor(HandleRef pen, out int argb) => GdipGetPenColor_ptr.Delegate(pen, out argb); + + private delegate int GdipSetPenBrushFill_delegate(HandleRef pen, HandleRef brush); + private static FunctionWrapper<GdipSetPenBrushFill_delegate> GdipSetPenBrushFill_ptr; + internal static int GdipSetPenBrushFill(HandleRef pen, HandleRef brush) => GdipSetPenBrushFill_ptr.Delegate(pen, brush); + + private delegate int GdipGetPenBrushFill_delegate(HandleRef pen, out IntPtr brush); + private static FunctionWrapper<GdipGetPenBrushFill_delegate> GdipGetPenBrushFill_ptr; + internal static int GdipGetPenBrushFill(HandleRef pen, out IntPtr brush) => GdipGetPenBrushFill_ptr.Delegate(pen, out brush); + + private delegate int GdipGetPenFillType_delegate(HandleRef pen, out int pentype); + private static FunctionWrapper<GdipGetPenFillType_delegate> GdipGetPenFillType_ptr; + internal static int GdipGetPenFillType(HandleRef pen, out int pentype) => GdipGetPenFillType_ptr.Delegate(pen, out pentype); + + private delegate int GdipGetPenDashStyle_delegate(HandleRef pen, out int dashstyle); + private static FunctionWrapper<GdipGetPenDashStyle_delegate> GdipGetPenDashStyle_ptr; + internal static int GdipGetPenDashStyle(HandleRef pen, out int dashstyle) => GdipGetPenDashStyle_ptr.Delegate(pen, out dashstyle); + + private delegate int GdipSetPenDashStyle_delegate(HandleRef pen, int dashstyle); + private static FunctionWrapper<GdipSetPenDashStyle_delegate> GdipSetPenDashStyle_ptr; + internal static int GdipSetPenDashStyle(HandleRef pen, int dashstyle) => GdipSetPenDashStyle_ptr.Delegate(pen, dashstyle); + + private delegate int GdipSetPenDashArray_delegate(HandleRef pen, HandleRef memorydash, int count); + private static FunctionWrapper<GdipSetPenDashArray_delegate> GdipSetPenDashArray_ptr; + internal static int GdipSetPenDashArray(HandleRef pen, HandleRef memorydash, int count) => GdipSetPenDashArray_ptr.Delegate(pen, memorydash, count); + + private delegate int GdipGetPenDashOffset_delegate(HandleRef pen, float[] dashoffset); + private static FunctionWrapper<GdipGetPenDashOffset_delegate> GdipGetPenDashOffset_ptr; + internal static int GdipGetPenDashOffset(HandleRef pen, float[] dashoffset) => GdipGetPenDashOffset_ptr.Delegate(pen, dashoffset); + + private delegate int GdipSetPenDashOffset_delegate(HandleRef pen, float dashoffset); + private static FunctionWrapper<GdipSetPenDashOffset_delegate> GdipSetPenDashOffset_ptr; + internal static int GdipSetPenDashOffset(HandleRef pen, float dashoffset) => GdipSetPenDashOffset_ptr.Delegate(pen, dashoffset); + + private delegate int GdipGetPenDashCount_delegate(HandleRef pen, out int dashcount); + private static FunctionWrapper<GdipGetPenDashCount_delegate> GdipGetPenDashCount_ptr; + internal static int GdipGetPenDashCount(HandleRef pen, out int dashcount) => GdipGetPenDashCount_ptr.Delegate(pen, out dashcount); + + private delegate int GdipGetPenDashArray_delegate(HandleRef pen, IntPtr memorydash, int count); + private static FunctionWrapper<GdipGetPenDashArray_delegate> GdipGetPenDashArray_ptr; + internal static int GdipGetPenDashArray(HandleRef pen, IntPtr memorydash, int count) => GdipGetPenDashArray_ptr.Delegate(pen, memorydash, count); + + private delegate int GdipGetPenCompoundCount_delegate(HandleRef pen, out int count); + private static FunctionWrapper<GdipGetPenCompoundCount_delegate> GdipGetPenCompoundCount_ptr; + internal static int GdipGetPenCompoundCount(HandleRef pen, out int count) => GdipGetPenCompoundCount_ptr.Delegate(pen, out count); + + private delegate int GdipSetPenCompoundArray_delegate(HandleRef pen, float[] array, int count); + private static FunctionWrapper<GdipSetPenCompoundArray_delegate> GdipSetPenCompoundArray_ptr; + internal static int GdipSetPenCompoundArray(HandleRef pen, float[] array, int count) => GdipSetPenCompoundArray_ptr.Delegate(pen, array, count); + + private delegate int GdipGetPenCompoundArray_delegate(HandleRef pen, float[] array, int count); + private static FunctionWrapper<GdipGetPenCompoundArray_delegate> GdipGetPenCompoundArray_ptr; + internal static int GdipGetPenCompoundArray(HandleRef pen, float[] array, int count) => GdipGetPenCompoundArray_ptr.Delegate(pen, array, count); } [StructLayout(LayoutKind.Sequential)] diff --git a/src/System.Drawing.Common/src/System/Drawing/Pen.cs b/src/System.Drawing.Common/src/System/Drawing/Pen.cs index a6bf180a62..194bea21ca 100644 --- a/src/System.Drawing.Common/src/System/Drawing/Pen.cs +++ b/src/System.Drawing.Common/src/System/Drawing/Pen.cs @@ -820,6 +820,14 @@ namespace System.Drawing throw new ArgumentException(SR.Format(SR.InvalidDashPattern)); } + foreach (float val in value) + { + if (val <= 0) + { + throw new ArgumentException(SR.Format(SR.InvalidDashPattern)); + } + } + int count = value.Length; IntPtr buf = Marshal.AllocHGlobal(checked(4 * count)); @@ -861,6 +869,19 @@ namespace System.Drawing throw new ArgumentException(SR.Format(SR.CantChangeImmutableObjects, nameof(Pen))); } + if (value.Length <= 1) + { + throw new ArgumentException(SR.Format(SR.GdiplusInvalidParameter)); + } + + foreach (float val in value) + { + if (val < 0 || val > 1) + { + throw new ArgumentException(SR.Format(SR.GdiplusInvalidParameter)); + } + } + int status = SafeNativeMethods.Gdip.GdipSetPenCompoundArray(new HandleRef(this, NativePen), value, value.Length); SafeNativeMethods.Gdip.CheckStatus(status); } diff --git a/src/System.Drawing.Common/src/Unix/System.Drawing/Pen.cs b/src/System.Drawing.Common/src/Unix/System.Drawing/Pen.cs deleted file mode 100644 index 9a130a5ddf..0000000000 --- a/src/System.Drawing.Common/src/Unix/System.Drawing/Pen.cs +++ /dev/null @@ -1,613 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// See the LICENSE file in the project root for more information. -// -// System.Drawing.Pen.cs -// -// Authors: -// Miguel de Icaza (miguel@ximian.com) -// Alexandre Pigolkine (pigolkine@gmx.de) -// Duncan Mak (duncan@ximian.com) -// Ravindra (rkumar@novell.com) -// -// Copyright (C) Ximian, Inc. http://www.ximian.com -// Copyright (C) 2004,2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.ComponentModel; -using System.Drawing.Drawing2D; -using System.Runtime.InteropServices; - -namespace System.Drawing -{ - public sealed class Pen : MarshalByRefObject, ICloneable, IDisposable - { - internal IntPtr nativeObject; - internal bool isModifiable = true; - private Color color; - private CustomLineCap startCap; - private CustomLineCap endCap; - - internal Pen(IntPtr p) - { - nativeObject = p; - } - - public Pen(Brush brush) : this(brush, 1.0F) - { - } - - public Pen(Color color) : this(color, 1.0F) - { - } - - public Pen(Brush brush, float width) - { - if (brush == null) - throw new ArgumentNullException("brush"); - - Status status = SafeNativeMethods.Gdip.GdipCreatePen2(brush.NativeBrush, width, GraphicsUnit.World, out nativeObject); - SafeNativeMethods.Gdip.CheckStatus(status); - color = Color.Empty; - } - - public Pen(Color color, float width) - { - Status status = SafeNativeMethods.Gdip.GdipCreatePen1(color.ToArgb(), width, GraphicsUnit.World, out nativeObject); - SafeNativeMethods.Gdip.CheckStatus(status); - this.color = color; - } - - // - // Properties - // - [MonoLimitation("Libgdiplus doesn't use this property for rendering")] - public PenAlignment Alignment - { - get - { - PenAlignment retval; - Status status = SafeNativeMethods.Gdip.GdipGetPenMode(nativeObject, out retval); - SafeNativeMethods.Gdip.CheckStatus(status); - return retval; - } - - set - { - if ((value < PenAlignment.Center) || (value > PenAlignment.Right)) - throw new InvalidEnumArgumentException("Alignment", (int)value, typeof(PenAlignment)); - - if (isModifiable) - { - Status status = SafeNativeMethods.Gdip.GdipSetPenMode(nativeObject, value); - SafeNativeMethods.Gdip.CheckStatus(status); - } - else - throw new ArgumentException("This Pen object can't be modified."); - } - } - - public Brush Brush - { - get - { - IntPtr brush; - Status status = SafeNativeMethods.Gdip.GdipGetPenBrushFill(nativeObject, out brush); - SafeNativeMethods.Gdip.CheckStatus(status); - return new SolidBrush(brush); - } - - set - { - if (value == null) - throw new ArgumentNullException("Brush"); - if (!isModifiable) - throw new ArgumentException("This Pen object can't be modified."); - - Status status = SafeNativeMethods.Gdip.GdipSetPenBrushFill(nativeObject, value.NativeBrush); - SafeNativeMethods.Gdip.CheckStatus(status); - color = Color.Empty; - } - } - - public Color Color - { - get - { - if (color.Equals(Color.Empty)) - { - int c; - Status status = SafeNativeMethods.Gdip.GdipGetPenColor(nativeObject, out c); - SafeNativeMethods.Gdip.CheckStatus(status); - color = Color.FromArgb(c); - } - return color; - } - - set - { - if (!isModifiable) - throw new ArgumentException("This Pen object can't be modified."); - - Status status = SafeNativeMethods.Gdip.GdipSetPenColor(nativeObject, value.ToArgb()); - SafeNativeMethods.Gdip.CheckStatus(status); - color = value; - } - } - - public float[] CompoundArray - { - get - { - int count; - Status status = SafeNativeMethods.Gdip.GdipGetPenCompoundCount(nativeObject, out count); - SafeNativeMethods.Gdip.CheckStatus(status); - - float[] compArray = new float[count]; - status = SafeNativeMethods.Gdip.GdipGetPenCompoundArray(nativeObject, compArray, count); - SafeNativeMethods.Gdip.CheckStatus(status); - - return compArray; - } - - set - { - if (isModifiable) - { - int length = value.Length; - if (length < 2) - throw new ArgumentException("Invalid parameter."); - foreach (float val in value) - if (val < 0 || val > 1) - throw new ArgumentException("Invalid parameter."); - - Status status = SafeNativeMethods.Gdip.GdipSetPenCompoundArray(nativeObject, value, value.Length); - SafeNativeMethods.Gdip.CheckStatus(status); - } - else - throw new ArgumentException("This Pen object can't be modified."); - } - } - - public CustomLineCap CustomEndCap - { - get - { - return endCap; - } - - set - { - if (isModifiable) - { - Status status = SafeNativeMethods.Gdip.GdipSetPenCustomEndCap(nativeObject, value.nativeCap); - SafeNativeMethods.Gdip.CheckStatus(status); - endCap = value; - } - else - throw new ArgumentException("This Pen object can't be modified."); - } - } - - public CustomLineCap CustomStartCap - { - get - { - return startCap; - } - - set - { - if (isModifiable) - { - Status status = SafeNativeMethods.Gdip.GdipSetPenCustomStartCap(nativeObject, value.nativeCap); - SafeNativeMethods.Gdip.CheckStatus(status); - startCap = value; - } - else - throw new ArgumentException("This Pen object can't be modified."); - } - } - - public DashCap DashCap - { - - get - { - DashCap retval; - Status status = SafeNativeMethods.Gdip.GdipGetPenDashCap197819(nativeObject, out retval); - SafeNativeMethods.Gdip.CheckStatus(status); - return retval; - } - - set - { - if ((value < DashCap.Flat) || (value > DashCap.Triangle)) - throw new InvalidEnumArgumentException("DashCap", (int)value, typeof(DashCap)); - - if (isModifiable) - { - Status status = SafeNativeMethods.Gdip.GdipSetPenDashCap197819(nativeObject, value); - SafeNativeMethods.Gdip.CheckStatus(status); - } - else - throw new ArgumentException("This Pen object can't be modified."); - } - } - - public float DashOffset - { - - get - { - float retval; - Status status = SafeNativeMethods.Gdip.GdipGetPenDashOffset(nativeObject, out retval); - SafeNativeMethods.Gdip.CheckStatus(status); - return retval; - } - - set - { - if (isModifiable) - { - Status status = SafeNativeMethods.Gdip.GdipSetPenDashOffset(nativeObject, value); - SafeNativeMethods.Gdip.CheckStatus(status); - } - else - throw new ArgumentException("This Pen object can't be modified."); - } - } - - public float[] DashPattern - { - get - { - int count; - Status status = SafeNativeMethods.Gdip.GdipGetPenDashCount(nativeObject, out count); - SafeNativeMethods.Gdip.CheckStatus(status); - - float[] pattern; - // don't call GdipGetPenDashArray with a 0 count - if (count > 0) - { - pattern = new float[count]; - status = SafeNativeMethods.Gdip.GdipGetPenDashArray(nativeObject, pattern, count); - SafeNativeMethods.Gdip.CheckStatus(status); - } - else if (DashStyle == DashStyle.Custom) - { - // special case (not handled inside GDI+) - pattern = new float[1]; - pattern[0] = 1.0f; - } - else - { - pattern = new float[0]; - } - return pattern; - } - - set - { - if (isModifiable) - { - int length = value.Length; - if (length == 0) - throw new ArgumentException("Invalid parameter."); - foreach (float val in value) - if (val <= 0) - throw new ArgumentException("Invalid parameter."); - Status status = SafeNativeMethods.Gdip.GdipSetPenDashArray(nativeObject, value, value.Length); - SafeNativeMethods.Gdip.CheckStatus(status); - } - else - throw new ArgumentException("This Pen object can't be modified."); - } - } - - public DashStyle DashStyle - { - get - { - DashStyle retval; - Status status = SafeNativeMethods.Gdip.GdipGetPenDashStyle(nativeObject, out retval); - SafeNativeMethods.Gdip.CheckStatus(status); - return retval; - } - - set - { - if ((value < DashStyle.Solid) || (value > DashStyle.Custom)) - throw new InvalidEnumArgumentException("DashStyle", (int)value, typeof(DashStyle)); - - if (isModifiable) - { - Status status = SafeNativeMethods.Gdip.GdipSetPenDashStyle(nativeObject, value); - SafeNativeMethods.Gdip.CheckStatus(status); - } - else - throw new ArgumentException("This Pen object can't be modified."); - } - } - - public LineCap StartCap - { - get - { - LineCap retval; - Status status = SafeNativeMethods.Gdip.GdipGetPenStartCap(nativeObject, out retval); - SafeNativeMethods.Gdip.CheckStatus(status); - - return retval; - } - - set - { - if ((value < LineCap.Flat) || (value > LineCap.Custom)) - throw new InvalidEnumArgumentException("StartCap", (int)value, typeof(LineCap)); - - if (isModifiable) - { - Status status = SafeNativeMethods.Gdip.GdipSetPenStartCap(nativeObject, value); - SafeNativeMethods.Gdip.CheckStatus(status); - } - else - throw new ArgumentException("This Pen object can't be modified."); - } - } - - public LineCap EndCap - { - get - { - LineCap retval; - Status status = SafeNativeMethods.Gdip.GdipGetPenEndCap(nativeObject, out retval); - SafeNativeMethods.Gdip.CheckStatus(status); - - return retval; - } - - set - { - if ((value < LineCap.Flat) || (value > LineCap.Custom)) - throw new InvalidEnumArgumentException("EndCap", (int)value, typeof(LineCap)); - - if (isModifiable) - { - Status status = SafeNativeMethods.Gdip.GdipSetPenEndCap(nativeObject, value); - SafeNativeMethods.Gdip.CheckStatus(status); - } - else - throw new ArgumentException("This Pen object can't be modified."); - } - } - - public LineJoin LineJoin - { - - get - { - LineJoin result; - Status status = SafeNativeMethods.Gdip.GdipGetPenLineJoin(nativeObject, out result); - SafeNativeMethods.Gdip.CheckStatus(status); - return result; - } - - set - { - if ((value < LineJoin.Miter) || (value > LineJoin.MiterClipped)) - throw new InvalidEnumArgumentException("LineJoin", (int)value, typeof(LineJoin)); - - if (isModifiable) - { - Status status = SafeNativeMethods.Gdip.GdipSetPenLineJoin(nativeObject, value); - SafeNativeMethods.Gdip.CheckStatus(status); - } - else - throw new ArgumentException("This Pen object can't be modified."); - } - - } - - public float MiterLimit - { - - get - { - float result; - Status status = SafeNativeMethods.Gdip.GdipGetPenMiterLimit(nativeObject, out result); - SafeNativeMethods.Gdip.CheckStatus(status); - return result; - } - - set - { - if (isModifiable) - { - Status status = SafeNativeMethods.Gdip.GdipSetPenMiterLimit(nativeObject, value); - SafeNativeMethods.Gdip.CheckStatus(status); - } - else - throw new ArgumentException("This Pen object can't be modified."); - } - - } - - public PenType PenType - { - get - { - PenType type; - Status status = SafeNativeMethods.Gdip.GdipGetPenFillType(nativeObject, out type); - SafeNativeMethods.Gdip.CheckStatus(status); - - return type; - } - } - - public Matrix Transform - { - - get - { - Matrix matrix = new Matrix(); - Status status = SafeNativeMethods.Gdip.GdipGetPenTransform(nativeObject, matrix.nativeMatrix); - SafeNativeMethods.Gdip.CheckStatus(status); - - return matrix; - } - - set - { - if (value == null) - throw new ArgumentNullException("Transform"); - - if (isModifiable) - { - Status status = SafeNativeMethods.Gdip.GdipSetPenTransform(nativeObject, value.nativeMatrix); - SafeNativeMethods.Gdip.CheckStatus(status); - } - else - throw new ArgumentException("This Pen object can't be modified."); - } - } - - public float Width - { - get - { - float f; - Status status = SafeNativeMethods.Gdip.GdipGetPenWidth(nativeObject, out f); - SafeNativeMethods.Gdip.CheckStatus(status); - return f; - } - set - { - if (isModifiable) - { - Status status = SafeNativeMethods.Gdip.GdipSetPenWidth(nativeObject, value); - SafeNativeMethods.Gdip.CheckStatus(status); - } - else - throw new ArgumentException("This Pen object can't be modified."); - } - } - - internal IntPtr NativePen => nativeObject; - - public object Clone() - { - IntPtr ptr; - Status status = SafeNativeMethods.Gdip.GdipClonePen(nativeObject, out ptr); - SafeNativeMethods.Gdip.CheckStatus(status); - Pen p = new Pen(ptr); - p.startCap = startCap; - p.endCap = endCap; - - return p; - } - - public void Dispose() - { - Dispose(true); - System.GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposing && !isModifiable) - throw new ArgumentException("This Pen object can't be modified."); - - if (nativeObject != IntPtr.Zero) - { - Status status = SafeNativeMethods.Gdip.GdipDeletePen(nativeObject); - nativeObject = IntPtr.Zero; - SafeNativeMethods.Gdip.CheckStatus(status); - } - } - - ~Pen() - { - Dispose(false); - } - - public void MultiplyTransform(Matrix matrix) - { - MultiplyTransform(matrix, MatrixOrder.Prepend); - } - - public void MultiplyTransform(Matrix matrix, MatrixOrder order) - { - Status status = SafeNativeMethods.Gdip.GdipMultiplyPenTransform(nativeObject, matrix.nativeMatrix, order); - SafeNativeMethods.Gdip.CheckStatus(status); - } - - public void ResetTransform() - { - Status status = SafeNativeMethods.Gdip.GdipResetPenTransform(nativeObject); - SafeNativeMethods.Gdip.CheckStatus(status); - } - - public void RotateTransform(float angle) - { - RotateTransform(angle, MatrixOrder.Prepend); - } - - public void RotateTransform(float angle, MatrixOrder order) - { - Status status = SafeNativeMethods.Gdip.GdipRotatePenTransform(nativeObject, angle, order); - SafeNativeMethods.Gdip.CheckStatus(status); - } - - public void ScaleTransform(float sx, float sy) - { - ScaleTransform(sx, sy, MatrixOrder.Prepend); - } - - public void ScaleTransform(float sx, float sy, MatrixOrder order) - { - Status status = SafeNativeMethods.Gdip.GdipScalePenTransform(nativeObject, sx, sy, order); - SafeNativeMethods.Gdip.CheckStatus(status); - } - - public void SetLineCap(LineCap startCap, LineCap endCap, DashCap dashCap) - { - if (isModifiable) - { - Status status = SafeNativeMethods.Gdip.GdipSetPenLineCap197819(nativeObject, startCap, endCap, dashCap); - SafeNativeMethods.Gdip.CheckStatus(status); - } - else - throw new ArgumentException("This Pen object can't be modified."); - } - - public void TranslateTransform(float dx, float dy) - { - TranslateTransform(dx, dy, MatrixOrder.Prepend); - } - - public void TranslateTransform(float dx, float dy, MatrixOrder order) - { - Status status = SafeNativeMethods.Gdip.GdipTranslatePenTransform(nativeObject, dx, dy, order); - SafeNativeMethods.Gdip.CheckStatus(status); - } - } -} diff --git a/src/System.Drawing.Common/src/Unix/System.Drawing/Pens.cs b/src/System.Drawing.Common/src/Unix/System.Drawing/Pens.cs deleted file mode 100644 index 6a8ac3d350..0000000000 --- a/src/System.Drawing.Common/src/Unix/System.Drawing/Pens.cs +++ /dev/null @@ -1,2022 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// See the LICENSE file in the project root for more information. -// -// System.Drawing.Pens.cs -// -// Authors: -// Matt Stump (mstump@swfo.arizona.edu) -// Ravindra (rkumar@novell.com) -// Jordi Mas i Hernandez <jordi@ximian.com> -// -// Copyright (C) 2002 Ximian, Inc. http://www.ximian.com -// Copyright (C) 2004-2005 Novell, Inc. http://www.novell.com -// - -// -// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Drawing -{ - public sealed class Pens - { - private static Pen aliceblue; - private static Pen antiquewhite; - private static Pen aqua; - private static Pen aquamarine; - private static Pen azure; - private static Pen beige; - private static Pen bisque; - private static Pen black; - private static Pen blanchedalmond; - private static Pen blue; - private static Pen blueviolet; - private static Pen brown; - private static Pen burlywood; - private static Pen cadetblue; - private static Pen chartreuse; - private static Pen chocolate; - private static Pen coral; - private static Pen cornflowerblue; - private static Pen cornsilk; - private static Pen crimson; - private static Pen cyan; - private static Pen darkblue; - private static Pen darkcyan; - private static Pen darkgoldenrod; - private static Pen darkgray; - private static Pen darkgreen; - private static Pen darkkhaki; - private static Pen darkmagenta; - private static Pen darkolivegreen; - private static Pen darkorange; - private static Pen darkorchid; - private static Pen darkred; - private static Pen darksalmon; - private static Pen darkseagreen; - private static Pen darkslateblue; - private static Pen darkslategray; - private static Pen darkturquoise; - private static Pen darkviolet; - private static Pen deeppink; - private static Pen deepskyblue; - private static Pen dimgray; - private static Pen dodgerblue; - private static Pen firebrick; - private static Pen floralwhite; - private static Pen forestgreen; - private static Pen fuchsia; - private static Pen gainsboro; - private static Pen ghostwhite; - private static Pen gold; - private static Pen goldenrod; - private static Pen gray; - private static Pen green; - private static Pen greenyellow; - private static Pen honeydew; - private static Pen hotpink; - private static Pen indianred; - private static Pen indigo; - private static Pen ivory; - private static Pen khaki; - private static Pen lavender; - private static Pen lavenderblush; - private static Pen lawngreen; - private static Pen lemonchiffon; - private static Pen lightblue; - private static Pen lightcoral; - private static Pen lightcyan; - private static Pen lightgoldenrodyellow; - private static Pen lightgray; - private static Pen lightgreen; - private static Pen lightpink; - private static Pen lightsalmon; - private static Pen lightseagreen; - private static Pen lightskyblue; - private static Pen lightslategray; - private static Pen lightsteelblue; - private static Pen lightyellow; - private static Pen lime; - private static Pen limegreen; - private static Pen linen; - private static Pen magenta; - private static Pen maroon; - private static Pen mediumaquamarine; - private static Pen mediumblue; - private static Pen mediumorchid; - private static Pen mediumpurple; - private static Pen mediumseagreen; - private static Pen mediumslateblue; - private static Pen mediumspringgreen; - private static Pen mediumturquoise; - private static Pen mediumvioletred; - private static Pen midnightblue; - private static Pen mintcream; - private static Pen mistyrose; - private static Pen moccasin; - private static Pen navajowhite; - private static Pen navy; - private static Pen oldlace; - private static Pen olive; - private static Pen olivedrab; - private static Pen orange; - private static Pen orangered; - private static Pen orchid; - private static Pen palegoldenrod; - private static Pen palegreen; - private static Pen paleturquoise; - private static Pen palevioletred; - private static Pen papayawhip; - private static Pen peachpuff; - private static Pen peru; - private static Pen pink; - private static Pen plum; - private static Pen powderblue; - private static Pen purple; - private static Pen red; - private static Pen rosybrown; - private static Pen royalblue; - private static Pen saddlebrown; - private static Pen salmon; - private static Pen sandybrown; - private static Pen seagreen; - private static Pen seashell; - private static Pen sienna; - private static Pen silver; - private static Pen skyblue; - private static Pen slateblue; - private static Pen slategray; - private static Pen snow; - private static Pen springgreen; - private static Pen steelblue; - private static Pen tan; - private static Pen teal; - private static Pen thistle; - private static Pen tomato; - private static Pen transparent; - private static Pen turquoise; - private static Pen violet; - private static Pen wheat; - private static Pen white; - private static Pen whitesmoke; - private static Pen yellow; - private static Pen yellowgreen; - - private Pens() { } - - public static Pen AliceBlue - { - get - { - if (aliceblue == null) - { - aliceblue = new Pen(Color.AliceBlue); - aliceblue.isModifiable = false; - } - return aliceblue; - } - } - - public static Pen AntiqueWhite - { - get - { - if (antiquewhite == null) - { - antiquewhite = new Pen(Color.AntiqueWhite); - antiquewhite.isModifiable = false; - } - return antiquewhite; - } - } - - public static Pen Aqua - { - get - { - if (aqua == null) - { - aqua = new Pen(Color.Aqua); - aqua.isModifiable = false; - } - return aqua; - } - } - - public static Pen Aquamarine - { - get - { - if (aquamarine == null) - { - aquamarine = new Pen(Color.Aquamarine); - aquamarine.isModifiable = false; - } - return aquamarine; - } - } - - public static Pen Azure - { - get - { - if (azure == null) - { - azure = new Pen(Color.Azure); - azure.isModifiable = false; - } - return azure; - } - } - - public static Pen Beige - { - get - { - if (beige == null) - { - beige = new Pen(Color.Beige); - beige.isModifiable = false; - } - return beige; - } - } - - public static Pen Bisque - { - get - { - if (bisque == null) - { - bisque = new Pen(Color.Bisque); - bisque.isModifiable = false; - } - return bisque; - } - } - - public static Pen Black - { - get - { - if (black == null) - { - black = new Pen(Color.Black); - black.isModifiable = false; - } - return black; - } - } - - public static Pen BlanchedAlmond - { - get - { - if (blanchedalmond == null) - { - blanchedalmond = new Pen(Color.BlanchedAlmond); - blanchedalmond.isModifiable = false; - } - return blanchedalmond; - } - } - - public static Pen Blue - { - get - { - if (blue == null) - { - blue = new Pen(Color.Blue); - blue.isModifiable = false; - } - return blue; - } - } - - public static Pen BlueViolet - { - get - { - if (blueviolet == null) - { - blueviolet = new Pen(Color.BlueViolet); - blueviolet.isModifiable = false; - } - return blueviolet; - } - } - - public static Pen Brown - { - get - { - if (brown == null) - { - brown = new Pen(Color.Brown); - brown.isModifiable = false; - } - return brown; - } - } - - public static Pen BurlyWood - { - get - { - if (burlywood == null) - { - burlywood = new Pen(Color.BurlyWood); - burlywood.isModifiable = false; - } - return burlywood; - } - } - - public static Pen CadetBlue - { - get - { - if (cadetblue == null) - { - cadetblue = new Pen(Color.CadetBlue); - cadetblue.isModifiable = false; - } - return cadetblue; - } - } - - public static Pen Chartreuse - { - get - { - if (chartreuse == null) - { - chartreuse = new Pen(Color.Chartreuse); - chartreuse.isModifiable = false; - } - return chartreuse; - } - } - - public static Pen Chocolate - { - get - { - if (chocolate == null) - { - chocolate = new Pen(Color.Chocolate); - chocolate.isModifiable = false; - } - return chocolate; - } - } - - public static Pen Coral - { - get - { - if (coral == null) - { - coral = new Pen(Color.Coral); - coral.isModifiable = false; - } - return coral; - } - } - - public static Pen CornflowerBlue - { - get - { - if (cornflowerblue == null) - { - cornflowerblue = new Pen(Color.CornflowerBlue); - cornflowerblue.isModifiable = false; - } - return cornflowerblue; - } - } - - public static Pen Cornsilk - { - get - { - if (cornsilk == null) - { - cornsilk = new Pen(Color.Cornsilk); - cornsilk.isModifiable = false; - } - return cornsilk; - } - } - - public static Pen Crimson - { - get - { - if (crimson == null) - { - crimson = new Pen(Color.Crimson); - crimson.isModifiable = false; - } - return crimson; - } - } - - public static Pen Cyan - { - get - { - if (cyan == null) - { - cyan = new Pen(Color.Cyan); - cyan.isModifiable = false; - } - return cyan; - } - } - - public static Pen DarkBlue - { - get - { - if (darkblue == null) - { - darkblue = new Pen(Color.DarkBlue); - darkblue.isModifiable = false; - } - return darkblue; - } - } - - public static Pen DarkCyan - { - get - { - if (darkcyan == null) - { - darkcyan = new Pen(Color.DarkCyan); - darkcyan.isModifiable = false; - } - return darkcyan; - } - } - - public static Pen DarkGoldenrod - { - get - { - if (darkgoldenrod == null) - { - darkgoldenrod = new Pen(Color.DarkGoldenrod); - darkgoldenrod.isModifiable = false; - } - return darkgoldenrod; - } - } - - public static Pen DarkGray - { - get - { - if (darkgray == null) - { - darkgray = new Pen(Color.DarkGray); - darkgray.isModifiable = false; - } - return darkgray; - } - } - - public static Pen DarkGreen - { - get - { - if (darkgreen == null) - { - darkgreen = new Pen(Color.DarkGreen); - darkgreen.isModifiable = false; - } - return darkgreen; - } - } - - public static Pen DarkKhaki - { - get - { - if (darkkhaki == null) - { - darkkhaki = new Pen(Color.DarkKhaki); - darkkhaki.isModifiable = false; - } - return darkkhaki; - } - } - - public static Pen DarkMagenta - { - get - { - if (darkmagenta == null) - { - darkmagenta = new Pen(Color.DarkMagenta); - darkmagenta.isModifiable = false; - } - return darkmagenta; - } - } - - public static Pen DarkOliveGreen - { - get - { - if (darkolivegreen == null) - { - darkolivegreen = new Pen(Color.DarkOliveGreen); - darkolivegreen.isModifiable = false; - } - return darkolivegreen; - } - } - - public static Pen DarkOrange - { - get - { - if (darkorange == null) - { - darkorange = new Pen(Color.DarkOrange); - darkorange.isModifiable = false; - } - return darkorange; - } - } - - public static Pen DarkOrchid - { - get - { - if (darkorchid == null) - { - darkorchid = new Pen(Color.DarkOrchid); - darkorchid.isModifiable = false; - } - return darkorchid; - } - } - - public static Pen DarkRed - { - get - { - if (darkred == null) - { - darkred = new Pen(Color.DarkRed); - darkred.isModifiable = false; - } - return darkred; - } - } - - public static Pen DarkSalmon - { - get - { - if (darksalmon == null) - { - darksalmon = new Pen(Color.DarkSalmon); - darksalmon.isModifiable = false; - } - return darksalmon; - } - } - - public static Pen DarkSeaGreen - { - get - { - if (darkseagreen == null) - { - darkseagreen = new Pen(Color.DarkSeaGreen); - darkseagreen.isModifiable = false; - } - return darkseagreen; - } - } - - public static Pen DarkSlateBlue - { - get - { - if (darkslateblue == null) - { - darkslateblue = new Pen(Color.DarkSlateBlue); - darkslateblue.isModifiable = false; - } - return darkslateblue; - } - } - - public static Pen DarkSlateGray - { - get - { - if (darkslategray == null) - { - darkslategray = new Pen(Color.DarkSlateGray); - darkslategray.isModifiable = false; - } - return darkslategray; - } - } - - public static Pen DarkTurquoise - { - get - { - if (darkturquoise == null) - { - darkturquoise = new Pen(Color.DarkTurquoise); - darkturquoise.isModifiable = false; - } - return darkturquoise; - } - } - - public static Pen DarkViolet - { - get - { - if (darkviolet == null) - { - darkviolet = new Pen(Color.DarkViolet); - darkviolet.isModifiable = false; - } - return darkviolet; - } - } - - public static Pen DeepPink - { - get - { - if (deeppink == null) - { - deeppink = new Pen(Color.DeepPink); - deeppink.isModifiable = false; - } - return deeppink; - } - } - - public static Pen DeepSkyBlue - { - get - { - if (deepskyblue == null) - { - deepskyblue = new Pen(Color.DeepSkyBlue); - deepskyblue.isModifiable = false; - } - return deepskyblue; - } - } - - public static Pen DimGray - { - get - { - if (dimgray == null) - { - dimgray = new Pen(Color.DimGray); - dimgray.isModifiable = false; - } - return dimgray; - } - } - - public static Pen DodgerBlue - { - get - { - if (dodgerblue == null) - { - dodgerblue = new Pen(Color.DodgerBlue); - dodgerblue.isModifiable = false; - } - return dodgerblue; - } - } - - public static Pen Firebrick - { - get - { - if (firebrick == null) - { - firebrick = new Pen(Color.Firebrick); - firebrick.isModifiable = false; - } - return firebrick; - } - } - - public static Pen FloralWhite - { - get - { - if (floralwhite == null) - { - floralwhite = new Pen(Color.FloralWhite); - floralwhite.isModifiable = false; - } - return floralwhite; - } - } - - public static Pen ForestGreen - { - get - { - if (forestgreen == null) - { - forestgreen = new Pen(Color.ForestGreen); - forestgreen.isModifiable = false; - } - return forestgreen; - } - } - - public static Pen Fuchsia - { - get - { - if (fuchsia == null) - { - fuchsia = new Pen(Color.Fuchsia); - fuchsia.isModifiable = false; - } - return fuchsia; - } - } - - public static Pen Gainsboro - { - get - { - if (gainsboro == null) - { - gainsboro = new Pen(Color.Gainsboro); - gainsboro.isModifiable = false; - } - return gainsboro; - } - } - - public static Pen GhostWhite - { - get - { - if (ghostwhite == null) - { - ghostwhite = new Pen(Color.GhostWhite); - ghostwhite.isModifiable = false; - } - return ghostwhite; - } - } - - public static Pen Gold - { - get - { - if (gold == null) - { - gold = new Pen(Color.Gold); - gold.isModifiable = false; - } - return gold; - } - } - - public static Pen Goldenrod - { - get - { - if (goldenrod == null) - { - goldenrod = new Pen(Color.Goldenrod); - goldenrod.isModifiable = false; - } - return goldenrod; - } - } - - public static Pen Gray - { - get - { - if (gray == null) - { - gray = new Pen(Color.Gray); - gray.isModifiable = false; - } - return gray; - } - } - - public static Pen Green - { - get - { - if (green == null) - { - green = new Pen(Color.Green); - green.isModifiable = false; - } - return green; - } - } - - public static Pen GreenYellow - { - get - { - if (greenyellow == null) - { - greenyellow = new Pen(Color.GreenYellow); - greenyellow.isModifiable = false; - } - return greenyellow; - } - } - - public static Pen Honeydew - { - get - { - if (honeydew == null) - { - honeydew = new Pen(Color.Honeydew); - honeydew.isModifiable = false; - } - return honeydew; - } - } - - public static Pen HotPink - { - get - { - if (hotpink == null) - { - hotpink = new Pen(Color.HotPink); - hotpink.isModifiable = false; - } - return hotpink; - } - } - - public static Pen IndianRed - { - get - { - if (indianred == null) - { - indianred = new Pen(Color.IndianRed); - indianred.isModifiable = false; - } - return indianred; - } - } - - public static Pen Indigo - { - get - { - if (indigo == null) - { - indigo = new Pen(Color.Indigo); - indigo.isModifiable = false; - } - return indigo; - } - } - - public static Pen Ivory - { - get - { - if (ivory == null) - { - ivory = new Pen(Color.Ivory); - ivory.isModifiable = false; - } - return ivory; - } - } - - public static Pen Khaki - { - get - { - if (khaki == null) - { - khaki = new Pen(Color.Khaki); - khaki.isModifiable = false; - } - return khaki; - } - } - - public static Pen Lavender - { - get - { - if (lavender == null) - { - lavender = new Pen(Color.Lavender); - lavender.isModifiable = false; - } - return lavender; - } - } - - public static Pen LavenderBlush - { - get - { - if (lavenderblush == null) - { - lavenderblush = new Pen(Color.LavenderBlush); - lavenderblush.isModifiable = false; - } - return lavenderblush; - } - } - - public static Pen LawnGreen - { - get - { - if (lawngreen == null) - { - lawngreen = new Pen(Color.LawnGreen); - lawngreen.isModifiable = false; - } - return lawngreen; - } - } - - public static Pen LemonChiffon - { - get - { - if (lemonchiffon == null) - { - lemonchiffon = new Pen(Color.LemonChiffon); - lemonchiffon.isModifiable = false; - } - return lemonchiffon; - } - } - - public static Pen LightBlue - { - get - { - if (lightblue == null) - { - lightblue = new Pen(Color.LightBlue); - lightblue.isModifiable = false; - } - return lightblue; - } - } - - public static Pen LightCoral - { - get - { - if (lightcoral == null) - { - lightcoral = new Pen(Color.LightCoral); - lightcoral.isModifiable = false; - } - return lightcoral; - } - } - - public static Pen LightCyan - { - get - { - if (lightcyan == null) - { - lightcyan = new Pen(Color.LightCyan); - lightcyan.isModifiable = false; - } - return lightcyan; - } - } - - public static Pen LightGoldenrodYellow - { - get - { - if (lightgoldenrodyellow == null) - { - lightgoldenrodyellow = new Pen(Color.LightGoldenrodYellow); - lightgoldenrodyellow.isModifiable = false; - } - return lightgoldenrodyellow; - } - } - - public static Pen LightGray - { - get - { - if (lightgray == null) - { - lightgray = new Pen(Color.LightGray); - lightgray.isModifiable = false; - } - return lightgray; - } - } - - public static Pen LightGreen - { - get - { - if (lightgreen == null) - { - lightgreen = new Pen(Color.LightGreen); - lightgreen.isModifiable = false; - } - return lightgreen; - } - } - - public static Pen LightPink - { - get - { - if (lightpink == null) - { - lightpink = new Pen(Color.LightPink); - lightpink.isModifiable = false; - } - return lightpink; - } - } - - public static Pen LightSalmon - { - get - { - if (lightsalmon == null) - { - lightsalmon = new Pen(Color.LightSalmon); - lightsalmon.isModifiable = false; - } - return lightsalmon; - } - } - - public static Pen LightSeaGreen - { - get - { - if (lightseagreen == null) - { - lightseagreen = new Pen(Color.LightSeaGreen); - lightseagreen.isModifiable = false; - } - return lightseagreen; - } - } - - public static Pen LightSkyBlue - { - get - { - if (lightskyblue == null) - { - lightskyblue = new Pen(Color.LightSkyBlue); - lightskyblue.isModifiable = false; - } - return lightskyblue; - } - } - - public static Pen LightSlateGray - { - get - { - if (lightslategray == null) - { - lightslategray = new Pen(Color.LightSlateGray); - lightslategray.isModifiable = false; - } - return lightslategray; - } - } - - public static Pen LightSteelBlue - { - get - { - if (lightsteelblue == null) - { - lightsteelblue = new Pen(Color.LightSteelBlue); - lightsteelblue.isModifiable = false; - } - return lightsteelblue; - } - } - - public static Pen LightYellow - { - get - { - if (lightyellow == null) - { - lightyellow = new Pen(Color.LightYellow); - lightyellow.isModifiable = false; - } - return lightyellow; - } - } - - public static Pen Lime - { - get - { - if (lime == null) - { - lime = new Pen(Color.Lime); - lime.isModifiable = false; - } - return lime; - } - } - - public static Pen LimeGreen - { - get - { - if (limegreen == null) - { - limegreen = new Pen(Color.LimeGreen); - limegreen.isModifiable = false; - } - return limegreen; - } - } - - public static Pen Linen - { - get - { - if (linen == null) - { - linen = new Pen(Color.Linen); - linen.isModifiable = false; - } - return linen; - } - } - - public static Pen Magenta - { - get - { - if (magenta == null) - { - magenta = new Pen(Color.Magenta); - magenta.isModifiable = false; - } - return magenta; - } - } - - public static Pen Maroon - { - get - { - if (maroon == null) - { - maroon = new Pen(Color.Maroon); - maroon.isModifiable = false; - } - return maroon; - } - } - - public static Pen MediumAquamarine - { - get - { - if (mediumaquamarine == null) - { - mediumaquamarine = new Pen(Color.MediumAquamarine); - mediumaquamarine.isModifiable = false; - } - return mediumaquamarine; - } - } - - public static Pen MediumBlue - { - get - { - if (mediumblue == null) - { - mediumblue = new Pen(Color.MediumBlue); - mediumblue.isModifiable = false; - } - return mediumblue; - } - } - - public static Pen MediumOrchid - { - get - { - if (mediumorchid == null) - { - mediumorchid = new Pen(Color.MediumOrchid); - mediumorchid.isModifiable = false; - } - return mediumorchid; - } - } - - public static Pen MediumPurple - { - get - { - if (mediumpurple == null) - { - mediumpurple = new Pen(Color.MediumPurple); - mediumpurple.isModifiable = false; - } - return mediumpurple; - } - } - - public static Pen MediumSeaGreen - { - get - { - if (mediumseagreen == null) - { - mediumseagreen = new Pen(Color.MediumSeaGreen); - mediumseagreen.isModifiable = false; - } - return mediumseagreen; - } - } - - public static Pen MediumSlateBlue - { - get - { - if (mediumslateblue == null) - { - mediumslateblue = new Pen(Color.MediumSlateBlue); - mediumslateblue.isModifiable = false; - } - return mediumslateblue; - } - } - - public static Pen MediumSpringGreen - { - get - { - if (mediumspringgreen == null) - { - mediumspringgreen = new Pen(Color.MediumSpringGreen); - mediumspringgreen.isModifiable = false; - } - return mediumspringgreen; - } - } - - public static Pen MediumTurquoise - { - get - { - if (mediumturquoise == null) - { - mediumturquoise = new Pen(Color.MediumTurquoise); - mediumturquoise.isModifiable = false; - } - return mediumturquoise; - } - } - - public static Pen MediumVioletRed - { - get - { - if (mediumvioletred == null) - { - mediumvioletred = new Pen(Color.MediumVioletRed); - mediumvioletred.isModifiable = false; - } - return mediumvioletred; - } - } - - public static Pen MidnightBlue - { - get - { - if (midnightblue == null) - { - midnightblue = new Pen(Color.MidnightBlue); - midnightblue.isModifiable = false; - } - return midnightblue; - } - } - - public static Pen MintCream - { - get - { - if (mintcream == null) - { - mintcream = new Pen(Color.MintCream); - mintcream.isModifiable = false; - } - return mintcream; - } - } - - public static Pen MistyRose - { - get - { - if (mistyrose == null) - { - mistyrose = new Pen(Color.MistyRose); - mistyrose.isModifiable = false; - } - return mistyrose; - } - } - - public static Pen Moccasin - { - get - { - if (moccasin == null) - { - moccasin = new Pen(Color.Moccasin); - moccasin.isModifiable = false; - } - return moccasin; - } - } - - public static Pen NavajoWhite - { - get - { - if (navajowhite == null) - { - navajowhite = new Pen(Color.NavajoWhite); - navajowhite.isModifiable = false; - } - return navajowhite; - } - } - - public static Pen Navy - { - get - { - if (navy == null) - { - navy = new Pen(Color.Navy); - navy.isModifiable = false; - } - return navy; - } - } - - public static Pen OldLace - { - get - { - if (oldlace == null) - { - oldlace = new Pen(Color.OldLace); - oldlace.isModifiable = false; - } - return oldlace; - } - } - - public static Pen Olive - { - get - { - if (olive == null) - { - olive = new Pen(Color.Olive); - olive.isModifiable = false; - } - return olive; - } - } - - public static Pen OliveDrab - { - get - { - if (olivedrab == null) - { - olivedrab = new Pen(Color.OliveDrab); - olivedrab.isModifiable = false; - } - return olivedrab; - } - } - - public static Pen Orange - { - get - { - if (orange == null) - { - orange = new Pen(Color.Orange); - orange.isModifiable = false; - } - return orange; - } - } - - public static Pen OrangeRed - { - get - { - if (orangered == null) - { - orangered = new Pen(Color.OrangeRed); - orangered.isModifiable = false; - } - return orangered; - } - } - - public static Pen Orchid - { - get - { - if (orchid == null) - { - orchid = new Pen(Color.Orchid); - orchid.isModifiable = false; - } - return orchid; - } - } - - public static Pen PaleGoldenrod - { - get - { - if (palegoldenrod == null) - { - palegoldenrod = new Pen(Color.PaleGoldenrod); - palegoldenrod.isModifiable = false; - } - return palegoldenrod; - } - } - - public static Pen PaleGreen - { - get - { - if (palegreen == null) - { - palegreen = new Pen(Color.PaleGreen); - palegreen.isModifiable = false; - } - return palegreen; - } - } - - public static Pen PaleTurquoise - { - get - { - if (paleturquoise == null) - { - paleturquoise = new Pen(Color.PaleTurquoise); - paleturquoise.isModifiable = false; - } - return paleturquoise; - } - } - - public static Pen PaleVioletRed - { - get - { - if (palevioletred == null) - { - palevioletred = new Pen(Color.PaleVioletRed); - palevioletred.isModifiable = false; - } - return palevioletred; - } - } - - public static Pen PapayaWhip - { - get - { - if (papayawhip == null) - { - papayawhip = new Pen(Color.PapayaWhip); - papayawhip.isModifiable = false; - } - return papayawhip; - } - } - - public static Pen PeachPuff - { - get - { - if (peachpuff == null) - { - peachpuff = new Pen(Color.PeachPuff); - peachpuff.isModifiable = false; - } - return peachpuff; - } - } - - public static Pen Peru - { - get - { - if (peru == null) - { - peru = new Pen(Color.Peru); - peru.isModifiable = false; - } - return peru; - } - } - - public static Pen Pink - { - get - { - if (pink == null) - { - pink = new Pen(Color.Pink); - pink.isModifiable = false; - } - return pink; - } - } - - public static Pen Plum - { - get - { - if (plum == null) - { - plum = new Pen(Color.Plum); - plum.isModifiable = false; - } - return plum; - } - } - - public static Pen PowderBlue - { - get - { - if (powderblue == null) - { - powderblue = new Pen(Color.PowderBlue); - powderblue.isModifiable = false; - } - return powderblue; - } - } - - public static Pen Purple - { - get - { - if (purple == null) - { - purple = new Pen(Color.Purple); - purple.isModifiable = false; - } - return purple; - } - } - - public static Pen Red - { - get - { - if (red == null) - { - red = new Pen(Color.Red); - red.isModifiable = false; - } - return red; - } - } - - public static Pen RosyBrown - { - get - { - if (rosybrown == null) - { - rosybrown = new Pen(Color.RosyBrown); - rosybrown.isModifiable = false; - } - return rosybrown; - } - } - - public static Pen RoyalBlue - { - get - { - if (royalblue == null) - { - royalblue = new Pen(Color.RoyalBlue); - royalblue.isModifiable = false; - } - return royalblue; - } - } - - public static Pen SaddleBrown - { - get - { - if (saddlebrown == null) - { - saddlebrown = new Pen(Color.SaddleBrown); - saddlebrown.isModifiable = false; - } - return saddlebrown; - } - } - - public static Pen Salmon - { - get - { - if (salmon == null) - { - salmon = new Pen(Color.Salmon); - salmon.isModifiable = false; - } - return salmon; - } - } - - public static Pen SandyBrown - { - get - { - if (sandybrown == null) - { - sandybrown = new Pen(Color.SandyBrown); - sandybrown.isModifiable = false; - } - return sandybrown; - } - } - - public static Pen SeaGreen - { - get - { - if (seagreen == null) - { - seagreen = new Pen(Color.SeaGreen); - seagreen.isModifiable = false; - } - return seagreen; - } - } - - public static Pen SeaShell - { - get - { - if (seashell == null) - { - seashell = new Pen(Color.SeaShell); - seashell.isModifiable = false; - } - return seashell; - } - } - - public static Pen Sienna - { - get - { - if (sienna == null) - { - sienna = new Pen(Color.Sienna); - sienna.isModifiable = false; - } - return sienna; - } - } - - public static Pen Silver - { - get - { - if (silver == null) - { - silver = new Pen(Color.Silver); - silver.isModifiable = false; - } - return silver; - } - } - - public static Pen SkyBlue - { - get - { - if (skyblue == null) - { - skyblue = new Pen(Color.SkyBlue); - skyblue.isModifiable = false; - } - return skyblue; - } - } - - public static Pen SlateBlue - { - get - { - if (slateblue == null) - { - slateblue = new Pen(Color.SlateBlue); - slateblue.isModifiable = false; - } - return slateblue; - } - } - - public static Pen SlateGray - { - get - { - if (slategray == null) - { - slategray = new Pen(Color.SlateGray); - slategray.isModifiable = false; - } - return slategray; - } - } - - public static Pen Snow - { - get - { - if (snow == null) - { - snow = new Pen(Color.Snow); - snow.isModifiable = false; - } - return snow; - } - } - - public static Pen SpringGreen - { - get - { - if (springgreen == null) - { - springgreen = new Pen(Color.SpringGreen); - springgreen.isModifiable = false; - } - return springgreen; - } - } - - public static Pen SteelBlue - { - get - { - if (steelblue == null) - { - steelblue = new Pen(Color.SteelBlue); - steelblue.isModifiable = false; - } - return steelblue; - } - } - - public static Pen Tan - { - get - { - if (tan == null) - { - tan = new Pen(Color.Tan); - tan.isModifiable = false; - } - return tan; - } - } - - public static Pen Teal - { - get - { - if (teal == null) - { - teal = new Pen(Color.Teal); - teal.isModifiable = false; - } - return teal; - } - } - - public static Pen Thistle - { - get - { - if (thistle == null) - { - thistle = new Pen(Color.Thistle); - thistle.isModifiable = false; - } - return thistle; - } - } - - public static Pen Tomato - { - get - { - if (tomato == null) - { - tomato = new Pen(Color.Tomato); - tomato.isModifiable = false; - } - return tomato; - } - } - - public static Pen Transparent - { - get - { - if (transparent == null) - { - transparent = new Pen(Color.Transparent); - transparent.isModifiable = false; - } - return transparent; - } - } - - public static Pen Turquoise - { - get - { - if (turquoise == null) - { - turquoise = new Pen(Color.Turquoise); - turquoise.isModifiable = false; - } - return turquoise; - } - } - - public static Pen Violet - { - get - { - if (violet == null) - { - violet = new Pen(Color.Violet); - violet.isModifiable = false; - } - return violet; - } - } - - public static Pen Wheat - { - get - { - if (wheat == null) - { - wheat = new Pen(Color.Wheat); - wheat.isModifiable = false; - } - return wheat; - } - } - - public static Pen White - { - get - { - if (white == null) - { - white = new Pen(Color.White); - white.isModifiable = false; - } - return white; - } - } - - public static Pen WhiteSmoke - { - get - { - if (whitesmoke == null) - { - whitesmoke = new Pen(Color.WhiteSmoke); - whitesmoke.isModifiable = false; - } - return whitesmoke; - } - } - - public static Pen Yellow - { - get - { - if (yellow == null) - { - yellow = new Pen(Color.Yellow); - yellow.isModifiable = false; - } - return yellow; - } - } - - public static Pen YellowGreen - { - get - { - if (yellowgreen == null) - { - yellowgreen = new Pen(Color.YellowGreen); - yellowgreen.isModifiable = false; - } - return yellowgreen; - - } - } - } -} diff --git a/src/System.Drawing.Common/src/Unix/System.Drawing/SystemPens.cs b/src/System.Drawing.Common/src/Unix/System.Drawing/SystemPens.cs deleted file mode 100644 index 1d3fcf5540..0000000000 --- a/src/System.Drawing.Common/src/Unix/System.Drawing/SystemPens.cs +++ /dev/null @@ -1,556 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// See the LICENSE file in the project root for more information. -// -// System.Drawing.SystemPens.cs -// -// Authors: -// Miguel de Icaza (miguel@ximian.com) -// Ravindra (rkumar@novell.com) -// Jordi Mas i Hernandez <jordimash@gmail.com> -// -// Copyright (C) 2003-2005 Novell, Inc. http://www.novell.com -// - -// -// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Drawing -{ - public sealed class SystemPens - { - static private Pen active_caption_text; - static private Pen control; - static private Pen control_dark; - static private Pen control_dark_dark; - static private Pen control_light; - static private Pen control_light_light; - static private Pen control_text; - static private Pen gray_text; - static private Pen highlight; - static private Pen highlight_text; - static private Pen inactive_caption_text; - static private Pen info_text; - static private Pen menu_text; - static private Pen window_frame; - static private Pen window_text; - static private Pen active_border; - static private Pen active_caption; - static private Pen app_workspace; - static private Pen button_face; - static private Pen button_highlight; - static private Pen button_shadow; - static private Pen desktop; - static private Pen gradient_activecaption; - static private Pen gradient_inactivecaption; - static private Pen hot_track; - static private Pen inactive_border; - static private Pen inactive_caption; - static private Pen info; - static private Pen menu; - static private Pen menu_bar; - static private Pen menu_highlight; - static private Pen scroll_bar; - static private Pen window; - - private SystemPens() { } - - public static Pen ActiveCaptionText - { - get - { - if (active_caption_text == null) - { - active_caption_text = new Pen(SystemColors.ActiveCaptionText); - active_caption_text.isModifiable = false; - } - - return active_caption_text; - } - } - - public static Pen Control - { - get - { - if (control == null) - { - control = new Pen(SystemColors.Control); - control.isModifiable = false; - } - - return control; - } - } - - public static Pen ControlDark - { - get - { - if (control_dark == null) - { - control_dark = new Pen(SystemColors.ControlDark); - control_dark.isModifiable = false; - } - - return control_dark; - } - } - - public static Pen ControlDarkDark - { - get - { - if (control_dark_dark == null) - { - control_dark_dark = new Pen(SystemColors.ControlDarkDark); - control_dark_dark.isModifiable = false; - } - - return control_dark_dark; - } - } - - public static Pen ControlLight - { - get - { - if (control_light == null) - { - control_light = new Pen(SystemColors.ControlLight); - control_light.isModifiable = false; - } - - return control_light; - } - } - - public static Pen ControlLightLight - { - get - { - if (control_light_light == null) - { - control_light_light = new Pen(SystemColors.ControlLightLight); - control_light_light.isModifiable = false; - } - - return control_light_light; - } - } - - public static Pen ControlText - { - get - { - if (control_text == null) - { - control_text = new Pen(SystemColors.ControlText); - control_text.isModifiable = false; - } - - return control_text; - } - } - - public static Pen GrayText - { - get - { - if (gray_text == null) - { - gray_text = new Pen(SystemColors.GrayText); - gray_text.isModifiable = false; - } - - return gray_text; - } - } - - public static Pen Highlight - { - get - { - if (highlight == null) - { - highlight = new Pen(SystemColors.Highlight); - highlight.isModifiable = false; - } - - return highlight; - } - } - - public static Pen HighlightText - { - get - { - if (highlight_text == null) - { - highlight_text = new Pen(SystemColors.HighlightText); - highlight_text.isModifiable = false; - } - - return highlight_text; - } - } - - public static Pen InactiveCaptionText - { - get - { - if (inactive_caption_text == null) - { - inactive_caption_text = new Pen(SystemColors.InactiveCaptionText); - inactive_caption_text.isModifiable = false; - } - - return inactive_caption_text; - } - } - - public static Pen InfoText - { - get - { - if (info_text == null) - { - info_text = new Pen(SystemColors.InfoText); - info_text.isModifiable = false; - } - - return info_text; - } - } - - public static Pen MenuText - { - get - { - if (menu_text == null) - { - menu_text = new Pen(SystemColors.MenuText); - menu_text.isModifiable = false; - } - - return menu_text; - } - } - - public static Pen WindowFrame - { - get - { - if (window_frame == null) - { - window_frame = new Pen(SystemColors.WindowFrame); - window_frame.isModifiable = false; - } - - return window_frame; - } - } - - public static Pen WindowText - { - get - { - if (window_text == null) - { - window_text = new Pen(SystemColors.WindowText); - window_text.isModifiable = false; - } - - return window_text; - } - } - - public static Pen FromSystemColor(Color c) - { - if (ColorUtil.IsSystemColor(c)) - { - Pen newPen = new Pen(c); - newPen.isModifiable = false; - return newPen; - } - - String message = String.Format("The color {0} is not a system color.", c); - throw new ArgumentException(message); - } - - public static Pen ActiveBorder - { - get - { - if (active_border == null) - { - active_border = new Pen(SystemColors.ActiveBorder); - active_border.isModifiable = false; - } - - return active_border; - } - } - - public static Pen ActiveCaption - { - get - { - if (active_caption == null) - { - active_caption = new Pen(SystemColors.ActiveCaption); - active_caption.isModifiable = false; - } - - return active_caption; - } - } - - public static Pen AppWorkspace - { - get - { - if (app_workspace == null) - { - app_workspace = new Pen(SystemColors.AppWorkspace); - app_workspace.isModifiable = false; - } - - return app_workspace; - } - } - - public static Pen ButtonFace - { - get - { - if (button_face == null) - { - button_face = new Pen(SystemColors.ButtonFace); - button_face.isModifiable = false; - } - - return button_face; - } - } - - public static Pen ButtonHighlight - { - get - { - if (button_highlight == null) - { - button_highlight = new Pen(SystemColors.ButtonHighlight); - button_highlight.isModifiable = false; - } - - return button_highlight; - } - } - - public static Pen ButtonShadow - { - get - { - if (button_shadow == null) - { - button_shadow = new Pen(SystemColors.ButtonShadow); - button_shadow.isModifiable = false; - } - - return button_shadow; - } - } - - public static Pen Desktop - { - get - { - if (desktop == null) - { - desktop = new Pen(SystemColors.Desktop); - desktop.isModifiable = false; - } - - return desktop; - } - } - - public static Pen GradientActiveCaption - { - get - { - if (gradient_activecaption == null) - { - gradient_activecaption = new Pen(SystemColors.GradientActiveCaption); - gradient_activecaption.isModifiable = false; - } - - return gradient_activecaption; - } - } - - public static Pen GradientInactiveCaption - { - get - { - if (gradient_inactivecaption == null) - { - gradient_inactivecaption = new Pen(SystemColors.GradientInactiveCaption); - gradient_inactivecaption.isModifiable = false; - } - - return gradient_inactivecaption; - } - } - - public static Pen HotTrack - { - get - { - if (hot_track == null) - { - hot_track = new Pen(SystemColors.HotTrack); - hot_track.isModifiable = false; - } - - return hot_track; - } - } - - public static Pen InactiveBorder - { - get - { - if (inactive_border == null) - { - inactive_border = new Pen(SystemColors.InactiveBorder); - inactive_border.isModifiable = false; - } - - return inactive_border; - } - } - - public static Pen InactiveCaption - { - get - { - if (inactive_caption == null) - { - inactive_caption = new Pen(SystemColors.InactiveCaption); - inactive_caption.isModifiable = false; - } - - return inactive_caption; - } - } - - public static Pen Info - { - get - { - if (info == null) - { - info = new Pen(SystemColors.Info); - info.isModifiable = false; - } - - return info; - } - } - - public static Pen Menu - { - get - { - if (menu == null) - { - menu = new Pen(SystemColors.Menu); - menu.isModifiable = false; - } - - return menu; - } - } - - public static Pen MenuBar - { - get - { - if (menu_bar == null) - { - menu_bar = new Pen(SystemColors.MenuBar); - menu_bar.isModifiable = false; - } - - return menu_bar; - } - } - - public static Pen MenuHighlight - { - get - { - if (menu_highlight == null) - { - menu_highlight = new Pen(SystemColors.MenuHighlight); - menu_highlight.isModifiable = false; - } - - return menu_highlight; - } - } - - public static Pen ScrollBar - { - get - { - if (scroll_bar == null) - { - scroll_bar = new Pen(SystemColors.ScrollBar); - scroll_bar.isModifiable = false; - } - - return scroll_bar; - } - } - - public static Pen Window - { - get - { - if (window == null) - { - window = new Pen(SystemColors.Window); - window.isModifiable = false; - } - - return window; - } - } - - } -} - |