# HG changeset patch # User Frank Benoit # Date 1217033300 -7200 # Node ID a63e2cd5485e629bc50bfcee3ba83b0a345504b9 # Parent 27244095ce149ef98172e5eb9252b60f8716f60a Removed version=TANGOSVN for release 0.99.7 diff -r 27244095ce14 -r a63e2cd5485e dwt/custom/DefaultContent.d --- a/dwt/custom/DefaultContent.d Sat Jul 26 02:08:41 2008 +0200 +++ b/dwt/custom/DefaultContent.d Sat Jul 26 02:48:20 2008 +0200 @@ -22,25 +22,14 @@ import dwt.custom.StyledTextListener; import dwt.custom.StyledText; -version(TANGOSVN){ - static import tango.io.model.IFile; -} -else{ - static import tango.io.FileConst; -} - +static import tango.io.model.IFile; static import tango.text.Text; import dwt.dwthelper.utils; alias tango.text.Text.Text!(char) StringBuffer; class DefaultContent : StyledTextContent { -version(TANGOSVN){ private final static String LineDelimiter = tango.io.model.IFile.FileConst.NewlineString; -} -else{ - private final static String LineDelimiter = tango.io.FileConst.FileConst.NewlineString; -} StyledTextListener[] textListeners; // stores text listeners for event sending String textStore; // stores the actual text diff -r 27244095ce14 -r a63e2cd5485e dwt/custom/StyledText.d --- a/dwt/custom/StyledText.d Sat Jul 26 02:08:41 2008 +0200 +++ b/dwt/custom/StyledText.d Sat Jul 26 02:48:20 2008 +0200 @@ -85,12 +85,7 @@ static import tango.text.Text; static import tango.text.Util; -version(TANGOSVN){ - static import tango.io.model.IFile; -} -else{ - static import tango.io.FileConst; -} +static import tango.io.model.IFile; static import tango.text.convert.Utf; import tango.util.Convert; import dwt.dwthelper.utils; @@ -158,12 +153,7 @@ alias Canvas.computeSize computeSize; static const char TAB = '\t'; -version(TANGOSVN){ static const String PlatformLineDelimiter = tango.io.model.IFile.FileConst.NewlineString; -} -else{ - static const String PlatformLineDelimiter = tango.io.FileConst.FileConst.NewlineString; -} static const int BIDI_CARET_WIDTH = 3; static const int DEFAULT_WIDTH = 64; static const int DEFAULT_HEIGHT = 64; diff -r 27244095ce14 -r a63e2cd5485e dwt/dwthelper/ByteArrayOutputStream.d --- a/dwt/dwthelper/ByteArrayOutputStream.d Sat Jul 26 02:08:41 2008 +0200 +++ b/dwt/dwthelper/ByteArrayOutputStream.d Sat Jul 26 02:48:20 2008 +0200 @@ -6,12 +6,7 @@ public import dwt.dwthelper.OutputStream; import dwt.dwthelper.utils; import tango.io.Buffer; -version(TANGOSVN) { - import tango.io.Buffer; -} -else{ - import tango.io.GrowBuffer; -} +import tango.io.Buffer; public class ByteArrayOutputStream : dwt.dwthelper.OutputStream.OutputStream { diff -r 27244095ce14 -r a63e2cd5485e dwt/dwthelper/File.d --- a/dwt/dwthelper/File.d Sat Jul 26 02:08:41 2008 +0200 +++ b/dwt/dwthelper/File.d Sat Jul 26 02:48:20 2008 +0200 @@ -5,12 +5,7 @@ import dwt.dwthelper.utils; -version(TANGOSVN) { - static import tango.io.model.IFile; -} -else{ - static import tango.io.FileConst; -} +static import tango.io.model.IFile; static import tango.io.FilePath; static import tango.io.FileSystem; @@ -24,18 +19,10 @@ private tango.io.FilePath.FilePath mFilePath; static this(){ -version(TANGOSVN) { separator = tango.io.model.IFile.FileConst.PathSeparatorString; separatorChar = tango.io.model.IFile.FileConst.PathSeparatorChar; pathSeparator = tango.io.model.IFile.FileConst.SystemPathString; pathSeparatorChar = tango.io.model.IFile.FileConst.SystemPathChar; -} -else{ - separator = tango.io.FileConst.FileConst.PathSeparatorString; - separatorChar = tango.io.FileConst.FileConst.PathSeparatorChar; - pathSeparator = tango.io.FileConst.FileConst.SystemPathString; - pathSeparatorChar = tango.io.FileConst.FileConst.SystemPathChar; -} } public this ( String pathname ){ diff -r 27244095ce14 -r a63e2cd5485e dwt/dwthelper/InflaterInputStream.d --- a/dwt/dwthelper/InflaterInputStream.d Sat Jul 26 02:08:41 2008 +0200 +++ b/dwt/dwthelper/InflaterInputStream.d Sat Jul 26 02:48:20 2008 +0200 @@ -12,9 +12,8 @@ pragma(link,"zlib"); } } -version(TANGOSVN) { - import tango.io.Conduit; -} +import tango.io.Conduit; + class InputStreamWrapper : tango.io.model.IConduit.InputStream { dwt.dwthelper.InputStream.InputStream istr; @@ -27,12 +26,9 @@ int res = istr.read( cast(byte[])dst ); return res; } -version(TANGOSVN) { void[] load (void[] dst = null) { return Conduit.load (this, dst); } -} - tango.io.model.IConduit.InputStream clear (){ return this; diff -r 27244095ce14 -r a63e2cd5485e dwt/dwthelper/utils.d --- a/dwt/dwthelper/utils.d Sat Jul 26 02:08:41 2008 +0200 +++ b/dwt/dwthelper/utils.d Sat Jul 26 02:48:20 2008 +0200 @@ -149,30 +149,15 @@ } public static String toHexString( int i ){ -version(TANGOSVN) { return tango.text.convert.Integer.toString(i, "x" ); -} -else{ - return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Hex ); -} } public static String toOctalString( int i ){ -version(TANGOSVN) { return tango.text.convert.Integer.toString(i, "o" ); -} -else{ - return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Octal ); -} } public static String toBinaryString( int i ){ -version(TANGOSVN) { return tango.text.convert.Integer.toString(i, "b" ); -} -else{ - return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Binary ); -} } public static String toString( int i ){ @@ -650,7 +635,6 @@ public alias tango.stdc.stringz.fromString16z fromString16z; static String toHex(uint value, bool prefix = true, int radix = 8){ -version(TANGOSVN) { return tango.text.convert.Integer.toString( value, radix is 10 ? "d" : @@ -658,17 +642,6 @@ radix is 16 ? "x" : "d" ); } -else{ - return tango.text.convert.Integer.toString( - value, - radix is 10 ? tango.text.convert.Integer.Style.Signed : - radix is 8 ? tango.text.convert.Integer.Style.Octal : - radix is 16 ? tango.text.convert.Integer.Style.Hex : - tango.text.convert.Integer.Style.Signed, - prefix ? tango.text.convert.Integer.Flags.Prefix : tango.text.convert.Integer.Flags.None - ); -} -} class RuntimeException : Exception { this( String e = null){ diff -r 27244095ce14 -r a63e2cd5485e dwt/internal/gdip/Gdip.d --- a/dwt/internal/gdip/Gdip.d Sat Jul 26 02:08:41 2008 +0200 +++ b/dwt/internal/gdip/Gdip.d Sat Jul 26 02:48:20 2008 +0200 @@ -8,7 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation * Port to the D programming language: - * John Reimer + * John Reimer * Frank Benoit *******************************************************************************/ @@ -46,226 +46,226 @@ loadLib_Gdip(); } } - /************************************************************************** - - **************************************************************************/ + /************************************************************************** + + **************************************************************************/ private: - static FontFamily GenericSansSerifFontFamily = null; - static FontFamily GenericSerifFontFamily = null; - static FontFamily GenericMonospaceFontFamily = null; - - /************************************************************************** - - **************************************************************************/ - - struct FontFamily_T - { - Handle nativeFamily; - Status lastResult; - } - - struct StringFormat_T - { - - StringFormat format; - Status lastError; - } - - static ubyte GenericTypographicStringFormatBuffer[StringFormat_T.sizeof] = 0; - static ubyte GenericDefaultStringFormatBuffer [StringFormat_T.sizeof] = 0; - static ubyte GenericSansSerifFontFamilyBuffer [FontFamily_T.sizeof] = 0; - static ubyte GenericSerifFontFamilyBuffer [FontFamily_T.sizeof] = 0; - static ubyte GenericMonospaceFontFamilyBuffer [FontFamily_T.sizeof] = 0; - - /************************************************************************** - - **************************************************************************/ + static FontFamily GenericSansSerifFontFamily = null; + static FontFamily GenericSerifFontFamily = null; + static FontFamily GenericMonospaceFontFamily = null; + + /************************************************************************** + + **************************************************************************/ + + struct FontFamily_T + { + Handle nativeFamily; + Status lastResult; + } + + struct StringFormat_T + { + + StringFormat format; + Status lastError; + } + + static ubyte GenericTypographicStringFormatBuffer[StringFormat_T.sizeof] = 0; + static ubyte GenericDefaultStringFormatBuffer [StringFormat_T.sizeof] = 0; + static ubyte GenericSansSerifFontFamilyBuffer [FontFamily_T.sizeof] = 0; + static ubyte GenericSerifFontFamilyBuffer [FontFamily_T.sizeof] = 0; + static ubyte GenericMonospaceFontFamilyBuffer [FontFamily_T.sizeof] = 0; + + /************************************************************************** + + **************************************************************************/ public: - alias GpPoint Point; - alias GpPointF PointF; - alias GpRect Rect; - alias GpRectF RectF; - alias GpBitmapData BitmapData; - alias GpColorPalette ColorPalette; - alias GpDrawImageAbort DrawImageAbort; - alias GpColorMatrix ColorMatrix; - - alias GpFontFamily FontFamily; - alias GpImage Image; - alias GpBrush Brush; - alias GpFont Font; - alias GpFontCollection FontCollection; - alias GpGraphics Graphics; - alias GpGraphicsPath GraphicsPath; - alias GpImageAttributes ImageAttributes; - alias GpHatchBrush HatchBrush; - alias GpLinearGradientBrush LinearGradientBrush; - alias GpMatrix Matrix; - alias GpPen Pen; - alias GpRegion Region; - alias GpSolidBrush SolidBrush; - alias GpStringFormat StringFormat; - alias GpTextureBrush TextureBrush; - alias GpPath Path; - - alias Image Bitmap; - - alias uint ARGB; - - alias dwt.internal.gdip.native.GdiplusStartupInput GdiplusStartupInput; - alias dwt.internal.gdip.native.GdiplusStartupOutput GdiplusStartupOutput; - - /************************************************************************** - - Gdi+ Constants - - **************************************************************************/ - - enum { - BrushTypeSolidColor = 0, - BrushTypeHatchFill = 1, - BrushTypeTextureFill = 2, - BrushTypePathGradient = 3, - BrushTypeLinearGradient = 4, - // ColorAdjustTypeBitmap = 1, - ColorMatrixFlagsDefault = 0, - CombineModeReplace = 0, - CombineModeIntersect = 1, - CombineModeUnion = 2, - CombineModeXor = 3, - CombineModeExclude = 4, - CombineModeComplement = 5, - FillModeAlternate = 0, - FillModeWinding = 1, - DashCapFlat = 0, - DashCapRound = 2, - DashCapTriangle = 3, - DashStyleSolid = 0, - DashStyleDash = 1, - DashStyleDot = 2, - DashStyleDashDot = 3, - DashStyleDashDotDot = 4, - DashStyleCustom = 5, - FontStyleRegular = 0, - FontStyleBold = 1, - FontStyleItalic = 2, - FontStyleBoldItalic = 3, - FontStyleUnderline = 4, - FontStyleStrikeout = 8, - PaletteFlagsHasAlpha = 0x0001, - FlushIntentionFlush = 0, - FlushIntentionSync = 1, - HotkeyPrefixNone = 0, - HotkeyPrefixShow = 1, - HotkeyPrefixHide = 2, - LineJoinMiter = 0, - LineJoinBevel = 1, - LineJoinRound = 2, - LineCapFlat = 0, - LineCapSquare = 1, - LineCapRound = 2, - MatrixOrderPrepend = 0, - MatrixOrderAppend = 1, - QualityModeDefault = 0, - QualityModeLow = 1, - QualityModeHigh = 2, - InterpolationModeInvalid = -1, - InterpolationModeDefault = QualityModeDefault, - InterpolationModeLowQuality = QualityModeLow, - InterpolationModeHighQuality = QualityModeHigh, - InterpolationModeBilinear = QualityModeHigh + 1, - InterpolationModeBicubic = QualityModeHigh + 2, - InterpolationModeNearestNeighbor = QualityModeHigh + 3, - InterpolationModeHighQualityBilinear = QualityModeHigh + 4, - InterpolationModeHighQualityBicubic = QualityModeHigh + 5, - PathPointTypeStart = 0, - PathPointTypeLine = 1, - PathPointTypeBezier = 3, - PathPointTypePathTypeMask = 0x7, - PathPointTypePathDashMode = 0x10, - PathPointTypePathMarker = 0x20, - PathPointTypeCloseSubpath = 0x80, - PathPointTypeBezier3 = 3, - PixelFormatIndexed = 0x00010000, - PixelFormatGDI = 0x00020000, - PixelFormatAlpha = 0x00040000, - PixelFormatPAlpha = 0x00080000, - PixelFormatExtended = 0x00100000, - PixelFormatCanonical = 0x00200000, - PixelFormat1bppIndexed = (1 | ( 1 << 8) | PixelFormatIndexed | PixelFormatGDI), - PixelFormat4bppIndexed = (2 | ( 4 << 8) | PixelFormatIndexed | PixelFormatGDI), - PixelFormat8bppIndexed = (3 | ( 8 << 8) | PixelFormatIndexed | PixelFormatGDI), - PixelFormat16bppGrayScale = (4 | (16 << 8) | PixelFormatExtended), - PixelFormat16bppRGB555 = (5 | (16 << 8) | PixelFormatGDI), - PixelFormat16bppRGB565 = (6 | (16 << 8) | PixelFormatGDI), - PixelFormat16bppARGB1555 = (7 | (16 << 8) | PixelFormatAlpha | PixelFormatGDI), - PixelFormat24bppRGB = (8 | (24 << 8) | PixelFormatGDI), - PixelFormat32bppRGB = (9 | (32 << 8) | PixelFormatGDI), - PixelFormat32bppARGB = (10 | (32 << 8) | PixelFormatAlpha | PixelFormatGDI | PixelFormatCanonical), - PixelFormat32bppPARGB = (11 | (32 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatGDI), - PixelFormat48bppRGB = (12 | (48 << 8) | PixelFormatExtended), - PixelFormat64bppARGB = (13 | (64 << 8) | PixelFormatAlpha | PixelFormatCanonical | PixelFormatExtended), - PixelFormat64bppPARGB = (14 | (64 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatExtended), - PixelFormatMax = 15, - PixelOffsetModeNone = QualityModeHigh + 1, - PixelOffsetModeHalf = QualityModeHigh + 2, - SmoothingModeInvalid = -1, - SmoothingModeDefault = QualityModeDefault, - SmoothingModeHighSpeed = QualityModeLow, - SmoothingModeHighQuality = QualityModeHigh, - SmoothingModeNone = 3, - SmoothingModeAntiAlias8x4 = 4, - SmoothingModeAntiAlias = SmoothingModeAntiAlias8x4, - SmoothingModeAntiAlias8x8 = 5, - StringFormatFlagsDirectionRightToLeft = 0x00000001, - StringFormatFlagsDirectionVertical = 0x00000002, - StringFormatFlagsNoFitBlackBox = 0x00000004, - StringFormatFlagsDisplayFormatControl = 0x00000020, - StringFormatFlagsNoFontFallback = 0x00000400, - StringFormatFlagsMeasureTrailingSpaces = 0x00000800, - StringFormatFlagsNoWrap = 0x00001000, - StringFormatFlagsLineLimit = 0x00002000, - StringFormatFlagsNoClip = 0x00004000, - TextRenderingHintSystemDefault = 0, - TextRenderingHintSingleBitPerPixelGridFit = 1, - TextRenderingHintSingleBitPerPixel = 2, - TextRenderingHintAntiAliasGridFit = 3, - TextRenderingHintAntiAlias = 4, - TextRenderingHintClearTypeGridFit = 5, - // UnitPixel = 2, - WrapModeTile = 0, - WrapModeTileFlipX = 1, - WrapModeTileFlipY = 2, - WrapModeTileFlipXY = 3, - WrapModeClamp = 4 - } - - enum - { - PenTypeSolidColor = BrushTypeSolidColor, - PenTypeHatchFill = BrushTypeHatchFill, - PenTypeTextureFill = BrushTypeTextureFill, - PenTypePathGradient = BrushTypePathGradient, - PenTypeLinearGradient = BrushTypeLinearGradient, - PenTypeUnknown = -1 - } - - enum - { - UnitWorld, // 0 -- World coordinate (non-physical unit) - UnitDisplay, // 1 -- Variable -- for PageTransform only - UnitPixel, // 2 -- Each unit is one device pixel. - UnitPoint, // 3 -- Each unit is a printer's point, or 1/72 inch. - UnitInch, // 4 -- Each unit is 1 inch. - UnitDocument, // 5 -- Each unit is 1/300 inch. - UnitMillimeter // 6 -- Each unit is 1 millimeter. - } - - enum + alias GpPoint Point; + alias GpPointF PointF; + alias GpRect Rect; + alias GpRectF RectF; + alias GpBitmapData BitmapData; + alias GpColorPalette ColorPalette; + alias GpDrawImageAbort DrawImageAbort; + alias GpColorMatrix ColorMatrix; + + alias GpFontFamily FontFamily; + alias GpImage Image; + alias GpBrush Brush; + alias GpFont Font; + alias GpFontCollection FontCollection; + alias GpGraphics Graphics; + alias GpGraphicsPath GraphicsPath; + alias GpImageAttributes ImageAttributes; + alias GpHatchBrush HatchBrush; + alias GpLinearGradientBrush LinearGradientBrush; + alias GpMatrix Matrix; + alias GpPen Pen; + alias GpRegion Region; + alias GpSolidBrush SolidBrush; + alias GpStringFormat StringFormat; + alias GpTextureBrush TextureBrush; + alias GpPath Path; + + alias Image Bitmap; + + alias uint ARGB; + + alias dwt.internal.gdip.native.GdiplusStartupInput GdiplusStartupInput; + alias dwt.internal.gdip.native.GdiplusStartupOutput GdiplusStartupOutput; + + /************************************************************************** + + Gdi+ Constants + + **************************************************************************/ + + enum { + BrushTypeSolidColor = 0, + BrushTypeHatchFill = 1, + BrushTypeTextureFill = 2, + BrushTypePathGradient = 3, + BrushTypeLinearGradient = 4, + // ColorAdjustTypeBitmap = 1, + ColorMatrixFlagsDefault = 0, + CombineModeReplace = 0, + CombineModeIntersect = 1, + CombineModeUnion = 2, + CombineModeXor = 3, + CombineModeExclude = 4, + CombineModeComplement = 5, + FillModeAlternate = 0, + FillModeWinding = 1, + DashCapFlat = 0, + DashCapRound = 2, + DashCapTriangle = 3, + DashStyleSolid = 0, + DashStyleDash = 1, + DashStyleDot = 2, + DashStyleDashDot = 3, + DashStyleDashDotDot = 4, + DashStyleCustom = 5, + FontStyleRegular = 0, + FontStyleBold = 1, + FontStyleItalic = 2, + FontStyleBoldItalic = 3, + FontStyleUnderline = 4, + FontStyleStrikeout = 8, + PaletteFlagsHasAlpha = 0x0001, + FlushIntentionFlush = 0, + FlushIntentionSync = 1, + HotkeyPrefixNone = 0, + HotkeyPrefixShow = 1, + HotkeyPrefixHide = 2, + LineJoinMiter = 0, + LineJoinBevel = 1, + LineJoinRound = 2, + LineCapFlat = 0, + LineCapSquare = 1, + LineCapRound = 2, + MatrixOrderPrepend = 0, + MatrixOrderAppend = 1, + QualityModeDefault = 0, + QualityModeLow = 1, + QualityModeHigh = 2, + InterpolationModeInvalid = -1, + InterpolationModeDefault = QualityModeDefault, + InterpolationModeLowQuality = QualityModeLow, + InterpolationModeHighQuality = QualityModeHigh, + InterpolationModeBilinear = QualityModeHigh + 1, + InterpolationModeBicubic = QualityModeHigh + 2, + InterpolationModeNearestNeighbor = QualityModeHigh + 3, + InterpolationModeHighQualityBilinear = QualityModeHigh + 4, + InterpolationModeHighQualityBicubic = QualityModeHigh + 5, + PathPointTypeStart = 0, + PathPointTypeLine = 1, + PathPointTypeBezier = 3, + PathPointTypePathTypeMask = 0x7, + PathPointTypePathDashMode = 0x10, + PathPointTypePathMarker = 0x20, + PathPointTypeCloseSubpath = 0x80, + PathPointTypeBezier3 = 3, + PixelFormatIndexed = 0x00010000, + PixelFormatGDI = 0x00020000, + PixelFormatAlpha = 0x00040000, + PixelFormatPAlpha = 0x00080000, + PixelFormatExtended = 0x00100000, + PixelFormatCanonical = 0x00200000, + PixelFormat1bppIndexed = (1 | ( 1 << 8) | PixelFormatIndexed | PixelFormatGDI), + PixelFormat4bppIndexed = (2 | ( 4 << 8) | PixelFormatIndexed | PixelFormatGDI), + PixelFormat8bppIndexed = (3 | ( 8 << 8) | PixelFormatIndexed | PixelFormatGDI), + PixelFormat16bppGrayScale = (4 | (16 << 8) | PixelFormatExtended), + PixelFormat16bppRGB555 = (5 | (16 << 8) | PixelFormatGDI), + PixelFormat16bppRGB565 = (6 | (16 << 8) | PixelFormatGDI), + PixelFormat16bppARGB1555 = (7 | (16 << 8) | PixelFormatAlpha | PixelFormatGDI), + PixelFormat24bppRGB = (8 | (24 << 8) | PixelFormatGDI), + PixelFormat32bppRGB = (9 | (32 << 8) | PixelFormatGDI), + PixelFormat32bppARGB = (10 | (32 << 8) | PixelFormatAlpha | PixelFormatGDI | PixelFormatCanonical), + PixelFormat32bppPARGB = (11 | (32 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatGDI), + PixelFormat48bppRGB = (12 | (48 << 8) | PixelFormatExtended), + PixelFormat64bppARGB = (13 | (64 << 8) | PixelFormatAlpha | PixelFormatCanonical | PixelFormatExtended), + PixelFormat64bppPARGB = (14 | (64 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatExtended), + PixelFormatMax = 15, + PixelOffsetModeNone = QualityModeHigh + 1, + PixelOffsetModeHalf = QualityModeHigh + 2, + SmoothingModeInvalid = -1, + SmoothingModeDefault = QualityModeDefault, + SmoothingModeHighSpeed = QualityModeLow, + SmoothingModeHighQuality = QualityModeHigh, + SmoothingModeNone = 3, + SmoothingModeAntiAlias8x4 = 4, + SmoothingModeAntiAlias = SmoothingModeAntiAlias8x4, + SmoothingModeAntiAlias8x8 = 5, + StringFormatFlagsDirectionRightToLeft = 0x00000001, + StringFormatFlagsDirectionVertical = 0x00000002, + StringFormatFlagsNoFitBlackBox = 0x00000004, + StringFormatFlagsDisplayFormatControl = 0x00000020, + StringFormatFlagsNoFontFallback = 0x00000400, + StringFormatFlagsMeasureTrailingSpaces = 0x00000800, + StringFormatFlagsNoWrap = 0x00001000, + StringFormatFlagsLineLimit = 0x00002000, + StringFormatFlagsNoClip = 0x00004000, + TextRenderingHintSystemDefault = 0, + TextRenderingHintSingleBitPerPixelGridFit = 1, + TextRenderingHintSingleBitPerPixel = 2, + TextRenderingHintAntiAliasGridFit = 3, + TextRenderingHintAntiAlias = 4, + TextRenderingHintClearTypeGridFit = 5, + // UnitPixel = 2, + WrapModeTile = 0, + WrapModeTileFlipX = 1, + WrapModeTileFlipY = 2, + WrapModeTileFlipXY = 3, + WrapModeClamp = 4 + } + + enum + { + PenTypeSolidColor = BrushTypeSolidColor, + PenTypeHatchFill = BrushTypeHatchFill, + PenTypeTextureFill = BrushTypeTextureFill, + PenTypePathGradient = BrushTypePathGradient, + PenTypeLinearGradient = BrushTypeLinearGradient, + PenTypeUnknown = -1 + } + + enum + { + UnitWorld, // 0 -- World coordinate (non-physical unit) + UnitDisplay, // 1 -- Variable -- for PageTransform only + UnitPixel, // 2 -- Each unit is one device pixel. + UnitPoint, // 3 -- Each unit is a printer's point, or 1/72 inch. + UnitInch, // 4 -- Each unit is 1 inch. + UnitDocument, // 5 -- Each unit is 1/300 inch. + UnitMillimeter // 6 -- Each unit is 1 millimeter. + } + + enum { AliceBlue = 0xFFF0F8FF, AntiqueWhite = 0xFFFAEBD7, @@ -428,18 +428,18 @@ BlueMask = 0x000000ff } - enum - { - ColorAdjustTypeDefault, - ColorAdjustTypeBitmap, - ColorAdjustTypeBrush, - ColorAdjustTypePen, - ColorAdjustTypeText, - ColorAdjustTypeCount, - ColorAdjustTypeAny // Reserved - } - - static ARGB MakeARGB( ubyte a, + enum + { + ColorAdjustTypeDefault, + ColorAdjustTypeBitmap, + ColorAdjustTypeBrush, + ColorAdjustTypePen, + ColorAdjustTypeText, + ColorAdjustTypeCount, + ColorAdjustTypeAny // Reserved + } + + static ARGB MakeARGB( ubyte a, ubyte r, ubyte g, ubyte b ) @@ -452,7 +452,7 @@ /************************************************************************** - Error Status control + Error Status control **************************************************************************/ @@ -468,833 +468,833 @@ /************************************************************************** - GDI+ Bitmap Wrap Interface + GDI+ Bitmap Wrap Interface **************************************************************************/ public: - static void BitmapData_delete (BitmapData* bitmapdata) - { - delete bitmapdata; - } - - /************************************************************************** - - **************************************************************************/ - - static BitmapData* BitmapData_new() - { - return new BitmapData; - } - - /************************************************************************** - - **************************************************************************/ - - static int Bitmap_GetHBITMAP( Bitmap bitmap, ARGB colorBackground, - out HBITMAP hbmReturn ) - { - return SetStatus( GdipCreateHBITMAPFromBitmap( bitmap, hbmReturn, - colorBackground ) ); - } - - /************************************************************************** - - **************************************************************************/ - - static int Bitmap_GetHICON( Bitmap bitmap, out HICON hIconReturn) - { - return SetStatus( GdipCreateHICONFromBitmap( bitmap, hIconReturn ) ); - } - - /************************************************************************** - - **************************************************************************/ - - static int Bitmap_LockBits( Bitmap bitmap, Rect* rect, - uint flags, PixelFormat pixelFormat, - BitmapData* lockedBitmapData ) - { - return SetStatus( GdipBitmapLockBits( bitmap, rect, flags, - pixelFormat, lockedBitmapData ) ); - } - - /************************************************************************** - - **************************************************************************/ - - static int Bitmap_UnlockBits( Bitmap bitmap, BitmapData* lockedBitmapData ) - { - return SetStatus( GdipBitmapUnlockBits( bitmap, lockedBitmapData ) ); - } - - /************************************************************************** - - **************************************************************************/ - - static void Bitmap_delete( Bitmap bitmap ) - { - GdipDisposeImage( bitmap ); - } - - /************************************************************************** - - **************************************************************************/ - - static Bitmap Bitmap_new( HICON hicon ) - { - Bitmap bitmap; - Gdip.lastResult = GdipCreateBitmapFromHICON( hicon, bitmap ); - return bitmap; - } - - /************************************************************************** - - **************************************************************************/ - - static Bitmap Bitmap_new( HBITMAP hbm, HPALETTE hpal ) - { - Bitmap bitmap; - Gdip.lastResult = GdipCreateBitmapFromHBITMAP( hbm, hpal, bitmap ); - return bitmap; - } - - /************************************************************************** - - **************************************************************************/ - - static Bitmap Bitmap_new( int width, int height, int stride, - PixelFormat format, ubyte* scan0 ) - { - Bitmap bitmap; - Gdip.lastResult = GdipCreateBitmapFromScan0( width, height, stride, - format, scan0, - bitmap ); - return bitmap; - } - - /************************************************************************** - - **************************************************************************/ - - static Bitmap Bitmap_new( wchar* filename, bool useIcm ) - { - Bitmap bitmap; - if (useIcm) { - Gdip.lastResult = GdipCreateBitmapFromFileICM( filename, bitmap ); - } else { - Gdip.lastResult = GdipCreateBitmapFromFile( filename, bitmap ); - } - return bitmap; - } + static void BitmapData_delete (BitmapData* bitmapdata) + { + delete bitmapdata; + } + + /************************************************************************** + + **************************************************************************/ + + static BitmapData* BitmapData_new() + { + return new BitmapData; + } + + /************************************************************************** + + **************************************************************************/ + + static int Bitmap_GetHBITMAP( Bitmap bitmap, ARGB colorBackground, + out HBITMAP hbmReturn ) + { + return SetStatus( GdipCreateHBITMAPFromBitmap( bitmap, hbmReturn, + colorBackground ) ); + } + + /************************************************************************** + + **************************************************************************/ + + static int Bitmap_GetHICON( Bitmap bitmap, out HICON hIconReturn) + { + return SetStatus( GdipCreateHICONFromBitmap( bitmap, hIconReturn ) ); + } + + /************************************************************************** + + **************************************************************************/ + + static int Bitmap_LockBits( Bitmap bitmap, Rect* rect, + uint flags, PixelFormat pixelFormat, + BitmapData* lockedBitmapData ) + { + return SetStatus( GdipBitmapLockBits( bitmap, rect, flags, + pixelFormat, lockedBitmapData ) ); + } + + /************************************************************************** + + **************************************************************************/ + + static int Bitmap_UnlockBits( Bitmap bitmap, BitmapData* lockedBitmapData ) + { + return SetStatus( GdipBitmapUnlockBits( bitmap, lockedBitmapData ) ); + } + + /************************************************************************** + + **************************************************************************/ + + static void Bitmap_delete( Bitmap bitmap ) + { + GdipDisposeImage( bitmap ); + } + + /************************************************************************** + + **************************************************************************/ + + static Bitmap Bitmap_new( HICON hicon ) + { + Bitmap bitmap; + Gdip.lastResult = GdipCreateBitmapFromHICON( hicon, bitmap ); + return bitmap; + } + + /************************************************************************** + + **************************************************************************/ + + static Bitmap Bitmap_new( HBITMAP hbm, HPALETTE hpal ) + { + Bitmap bitmap; + Gdip.lastResult = GdipCreateBitmapFromHBITMAP( hbm, hpal, bitmap ); + return bitmap; + } + + /************************************************************************** + + **************************************************************************/ + + static Bitmap Bitmap_new( int width, int height, int stride, + PixelFormat format, ubyte* scan0 ) + { + Bitmap bitmap; + Gdip.lastResult = GdipCreateBitmapFromScan0( width, height, stride, + format, scan0, + bitmap ); + return bitmap; + } + + /************************************************************************** + + **************************************************************************/ + + static Bitmap Bitmap_new( wchar* filename, bool useIcm ) + { + Bitmap bitmap; + if (useIcm) { + Gdip.lastResult = GdipCreateBitmapFromFileICM( filename, bitmap ); + } else { + Gdip.lastResult = GdipCreateBitmapFromFile( filename, bitmap ); + } + return bitmap; + } /************************************************************************** - Gdi+ Image Wrap Interface + Gdi+ Image Wrap Interface **************************************************************************/ - static Status Image_GetLastStatus( Image image ) - { - Status lastStatus = Gdip.lastResult; - Gdip.lastResult = Status.OK; - return lastStatus; - } - - /************************************************************************** - - **************************************************************************/ + static Status Image_GetLastStatus( Image image ) + { + Status lastStatus = Gdip.lastResult; + Gdip.lastResult = Status.OK; + return lastStatus; + } + + /************************************************************************** + + **************************************************************************/ static PixelFormat Image_GetPixelFormat( Image image ) - { - PixelFormat format; - SetStatus( GdipGetImagePixelFormat( image, format ) ); - return format; - } - - /************************************************************************** - - **************************************************************************/ + { + PixelFormat format; + SetStatus( GdipGetImagePixelFormat( image, format ) ); + return format; + } + + /************************************************************************** + + **************************************************************************/ static uint Image_GetWidth( Image image ) - { - uint width = 0; - SetStatus( GdipGetImageWidth( image, width ) ); - return width; - } - - /************************************************************************** - - **************************************************************************/ + { + uint width = 0; + SetStatus( GdipGetImageWidth( image, width ) ); + return width; + } + + /************************************************************************** + + **************************************************************************/ static uint Image_GetHeight( Image image ) - { - uint height = 0; - SetStatus( GdipGetImageHeight( image, height ) ); - return height; - } - - /************************************************************************** - - **************************************************************************/ + { + uint height = 0; + SetStatus( GdipGetImageHeight( image, height ) ); + return height; + } + + /************************************************************************** + + **************************************************************************/ static Status Image_GetPalette( Image image, ColorPalette* palette, int size ) { - return SetStatus( GdipGetImagePalette( image, palette, size ) ); - } - - /************************************************************************** - - **************************************************************************/ - - static int Image_GetPaletteSize( Image image ) - { - int size = 0; - SetStatus( GdipGetImagePaletteSize( image, size ) ); - return size; - } + return SetStatus( GdipGetImagePalette( image, palette, size ) ); + } + + /************************************************************************** + + **************************************************************************/ + + static int Image_GetPaletteSize( Image image ) + { + int size = 0; + SetStatus( GdipGetImagePaletteSize( image, size ) ); + return size; + } /************************************************************************** - Gdi+ ImageAttributes Wrap Interface + Gdi+ ImageAttributes Wrap Interface **************************************************************************/ - static ImageAttributes ImageAttributes_new() - { - ImageAttributes ImageAttr = null; + static ImageAttributes ImageAttributes_new() + { + ImageAttributes ImageAttr = null; Gdip.lastResult = GdipCreateImageAttributes( ImageAttr ); - return ImageAttr; - } - - /************************************************************************** - - **************************************************************************/ - - static void ImageAttributes_delete( ImageAttributes attrib ) - { - GdipDisposeImageAttributes( attrib ); - } - - /************************************************************************** - - **************************************************************************/ - - static Status ImageAttributes_SetWrapMode( ImageAttributes attrib, - WrapMode wrap, - ARGB color = Gdip.Black, - bool clamp = false ) - { + return ImageAttr; + } + + /************************************************************************** + + **************************************************************************/ + + static void ImageAttributes_delete( ImageAttributes attrib ) + { + GdipDisposeImageAttributes( attrib ); + } + + /************************************************************************** + + **************************************************************************/ + + static Status ImageAttributes_SetWrapMode( ImageAttributes attrib, + WrapMode wrap, + ARGB color = Gdip.Black, + bool clamp = false ) + { return SetStatus(GdipSetImageAttributesWrapMode( attrib, wrap, color, clamp)); - } - - - /************************************************************************** - - **************************************************************************/ - - static Status ImageAttributes_SetColorMatrix( ImageAttributes attrib, - ref ColorMatrix matrix, - ColorMatrixFlag mode = Gdip.ColorMatrixFlagsDefault, - ColorAdjustType type = Gdip.ColorAdjustTypeDefault ) - { - return SetStatus( GdipSetImageAttributesColorMatrix( + } + + + /************************************************************************** + + **************************************************************************/ + + static Status ImageAttributes_SetColorMatrix( ImageAttributes attrib, + ref ColorMatrix matrix, + ColorMatrixFlag mode = Gdip.ColorMatrixFlagsDefault, + ColorAdjustType type = Gdip.ColorAdjustTypeDefault ) + { + return SetStatus( GdipSetImageAttributesColorMatrix( attrib, type, true, &matrix, null, mode)); - } + } /************************************************************************** - Gdi+ Brush Wrap Interface + Gdi+ Brush Wrap Interface **************************************************************************/ - static Brush Brush_Clone( Brush brush ) - { - Brush cloneBrush; - SetStatus( GdipCloneBrush( brush, cloneBrush ) ); - return cloneBrush; - } - - /************************************************************************** - - **************************************************************************/ - - static BrushType Brush_GetType( Brush brush ) - { - BrushType brushType = -1; - SetStatus( GdipGetBrushType( brush, brushType ) ); - return brushType; - } + static Brush Brush_Clone( Brush brush ) + { + Brush cloneBrush; + SetStatus( GdipCloneBrush( brush, cloneBrush ) ); + return cloneBrush; + } + + /************************************************************************** + + **************************************************************************/ + + static BrushType Brush_GetType( Brush brush ) + { + BrushType brushType = -1; + SetStatus( GdipGetBrushType( brush, brushType ) ); + return brushType; + } /************************************************************************** - Gdi+ HatchedBrush Wrap Interface + Gdi+ HatchedBrush Wrap Interface **************************************************************************/ - static void HatchBrush_delete( HatchBrush brush ) - { - GdipDeleteBrush(brush); - } - - /************************************************************************** - - **************************************************************************/ - - static HatchBrush HatchBrush_new( HatchStyle hatchStyle, - ARGB foreColor, ARGB backColor ) - { - HatchBrush brush = null; + static void HatchBrush_delete( HatchBrush brush ) + { + GdipDeleteBrush(brush); + } + + /************************************************************************** + + **************************************************************************/ + + static HatchBrush HatchBrush_new( HatchStyle hatchStyle, + ARGB foreColor, ARGB backColor ) + { + HatchBrush brush = null; Gdip.lastResult = GdipCreateHatchBrush( hatchStyle, - foreColor, - backColor, - brush ); + foreColor, + backColor, + brush ); return brush; - } + } /************************************************************************** - Gdi+ LinearGradientBrush Wrap Interface + Gdi+ LinearGradientBrush Wrap Interface **************************************************************************/ - static LinearGradientBrush LinearGradientBrush_new( ref PointF point1, ref PointF point2, - ARGB color1, ARGB color2 ) - { - LinearGradientBrush brush = null; + static LinearGradientBrush LinearGradientBrush_new( ref PointF point1, ref PointF point2, + ARGB color1, ARGB color2 ) + { + LinearGradientBrush brush = null; lastResult = GdipCreateLineBrush(point1, point2, - color1, color2, - WrapModeTile, brush); - return brush; - - } - - /************************************************************************** - - **************************************************************************/ - - static void LinearGradientBrush_delete( LinearGradientBrush brush ) - { - GdipDeleteBrush(brush); - } - - /************************************************************************** - - **************************************************************************/ - - static Status LinearGradientBrush_SetInterpolationColors( LinearGradientBrush brush, - ARGB* presetColors, float* blendPositions, int count ) - { - if ((count <= 0) || presetColors is null) + color1, color2, + WrapModeTile, brush); + return brush; + + } + + /************************************************************************** + + **************************************************************************/ + + static void LinearGradientBrush_delete( LinearGradientBrush brush ) + { + GdipDeleteBrush(brush); + } + + /************************************************************************** + + **************************************************************************/ + + static Status LinearGradientBrush_SetInterpolationColors( LinearGradientBrush brush, + ARGB* presetColors, float* blendPositions, int count ) + { + if ((count <= 0) || presetColors is null) return SetStatus(Status.InvalidParameter); - return SetStatus(GdipSetLinePresetBlend(brush, presetColors, - blendPositions, - count ) ); - } - - /************************************************************************** - - **************************************************************************/ - - static Status LinearGradientBrush_SetWrapMode( LinearGradientBrush brush, WrapMode wrapMode ) - { - return SetStatus(GdipSetLineWrapMode( brush, wrapMode)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status LinearGradientBrush_ResetTransform(LinearGradientBrush brush ) - { - return SetStatus(GdipResetLineTransform(brush)); - } - - /************************************************************************** - - **************************************************************************/ - - static int LinearGradientBrush_ScaleTransform( LinearGradientBrush brush, - float sx, float sy, - MatrixOrder order = MatrixOrderPrepend ) - { - return SetStatus(GdipScaleLineTransform(brush, sx, sy, order)); - } - - /************************************************************************** - - **************************************************************************/ - - static int LinearGradientBrush_TranslateTransform( LinearGradientBrush brush, - float dx, float dy, - MatrixOrder order = MatrixOrderPrepend ) - { - return SetStatus(GdipTranslateLineTransform(brush, dx, dy, order)); - } + return SetStatus(GdipSetLinePresetBlend(brush, presetColors, + blendPositions, + count ) ); + } + + /************************************************************************** + + **************************************************************************/ + + static Status LinearGradientBrush_SetWrapMode( LinearGradientBrush brush, WrapMode wrapMode ) + { + return SetStatus(GdipSetLineWrapMode( brush, wrapMode)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status LinearGradientBrush_ResetTransform(LinearGradientBrush brush ) + { + return SetStatus(GdipResetLineTransform(brush)); + } + + /************************************************************************** + + **************************************************************************/ + + static int LinearGradientBrush_ScaleTransform( LinearGradientBrush brush, + float sx, float sy, + MatrixOrder order = MatrixOrderPrepend ) + { + return SetStatus(GdipScaleLineTransform(brush, sx, sy, order)); + } + + /************************************************************************** + + **************************************************************************/ + + static int LinearGradientBrush_TranslateTransform( LinearGradientBrush brush, + float dx, float dy, + MatrixOrder order = MatrixOrderPrepend ) + { + return SetStatus(GdipTranslateLineTransform(brush, dx, dy, order)); + } /************************************************************************** - GDI+ TextureBrush Wrap Interface + GDI+ TextureBrush Wrap Interface **************************************************************************/ - static TextureBrush TextureBrush_new( Image image, WrapMode wrapMode, - float dstX, float dstY, - float dstWidth, float dstHeight ) - { - TextureBrush brush = null; + static TextureBrush TextureBrush_new( Image image, WrapMode wrapMode, + float dstX, float dstY, + float dstWidth, float dstHeight ) + { + TextureBrush brush = null; Gdip.lastResult = GdipCreateTexture2( image, - wrapMode, - dstX, dstY, - dstWidth, dstHeight, - brush ); - return brush; - - } - - /************************************************************************** - - **************************************************************************/ - - static void TextureBrush_delete( TextureBrush brush ) - { - GdipDeleteBrush( brush ); - } - - /************************************************************************** - - **************************************************************************/ + wrapMode, + dstX, dstY, + dstWidth, dstHeight, + brush ); + return brush; + + } + + /************************************************************************** + + **************************************************************************/ + + static void TextureBrush_delete( TextureBrush brush ) + { + GdipDeleteBrush( brush ); + } + + /************************************************************************** + + **************************************************************************/ static Status TextureBrush_SetTransform( TextureBrush brush, Matrix matrix ) - { + { return SetStatus(GdipSetTextureTransform(brush, matrix)); - } - - /************************************************************************** - - **************************************************************************/ + } + + /************************************************************************** + + **************************************************************************/ static Status TextureBrush_ResetTransform( TextureBrush brush ) - { - return SetStatus(GdipResetTextureTransform(brush)); - } - - /************************************************************************** - - **************************************************************************/ + { + return SetStatus(GdipResetTextureTransform(brush)); + } + + /************************************************************************** + + **************************************************************************/ static Status TextureBrush_ScaleTransform( TextureBrush brush, - float sx, float sy, - MatrixOrder order = MatrixOrderPrepend ) - { - return SetStatus(GdipScaleTextureTransform(brush, sx, sy, order)); - } - - /************************************************************************** - - **************************************************************************/ + float sx, float sy, + MatrixOrder order = MatrixOrderPrepend ) + { + return SetStatus(GdipScaleTextureTransform(brush, sx, sy, order)); + } + + /************************************************************************** + + **************************************************************************/ static Status TextureBrush_TranslateTransform( TextureBrush brush, - float dx, float dy, - MatrixOrder order = MatrixOrderPrepend ) - { - return SetStatus(GdipTranslateTextureTransform(brush, dx, dy, order)); - } + float dx, float dy, + MatrixOrder order = MatrixOrderPrepend ) + { + return SetStatus(GdipTranslateTextureTransform(brush, dx, dy, order)); + } /************************************************************************** - GDI+ Pen Wrap Interface + GDI+ Pen Wrap Interface **************************************************************************/ - static SolidBrush SolidBrush_new( ARGB color ) - { - SolidBrush brush = null; + static SolidBrush SolidBrush_new( ARGB color ) + { + SolidBrush brush = null; Gdip.lastResult = GdipCreateSolidFill( color, brush ); - return brush; - } - - /************************************************************************** - - **************************************************************************/ - - static void SolidBrush_delete( SolidBrush brush ) - { - GdipDeleteBrush(brush); - } + return brush; + } + + /************************************************************************** + + **************************************************************************/ + + static void SolidBrush_delete( SolidBrush brush ) + { + GdipDeleteBrush(brush); + } /************************************************************************** - GDI+ Pen Wrap Interface + GDI+ Pen Wrap Interface **************************************************************************/ - static Pen Pen_new( Brush brush, float width ) - { - Unit unit = UnitWorld; + static Pen Pen_new( Brush brush, float width ) + { + Unit unit = UnitWorld; Pen pen = null; Gdip.lastResult = GdipCreatePen2(brush, width, unit, pen); - return pen; - } - - /************************************************************************** - - **************************************************************************/ - - static void Pen_delete( Pen pen ) - { - GdipDeletePen(pen); - } - - /************************************************************************** - - **************************************************************************/ - - static PenType Pen_GetPenType( Pen pen ) + return pen; + } + + /************************************************************************** + + **************************************************************************/ + + static void Pen_delete( Pen pen ) + { + GdipDeletePen(pen); + } + + /************************************************************************** + + **************************************************************************/ + + static PenType Pen_GetPenType( Pen pen ) { PenType type; SetStatus(GdipGetPenFillType( pen, type )); - return type; + return type; + } + + /************************************************************************** + + **************************************************************************/ + + static Brush Pen_GetBrush( Pen pen ) + { + Brush brush; + SetStatus(GdipGetPenBrushFill(pen, brush)); + return brush; + } + + /************************************************************************** + + **************************************************************************/ + + static Status Pen_SetBrush( Pen pen, Brush brush ) + { + return SetStatus(GdipSetPenBrushFill(pen, brush)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Pen_SetDashOffset( Pen pen, float dashOffset ) + { + return SetStatus(GdipSetPenDashOffset(pen, dashOffset)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Pen_SetDashPattern( Pen pen, float* dashArray, int count ) + { + return SetStatus(GdipSetPenDashArray(pen, dashArray, count)); } - /************************************************************************** - - **************************************************************************/ - - static Brush Pen_GetBrush( Pen pen ) - { - Brush brush; - SetStatus(GdipGetPenBrushFill(pen, brush)); - return brush; - } - - /************************************************************************** - - **************************************************************************/ - - static Status Pen_SetBrush( Pen pen, Brush brush ) - { - return SetStatus(GdipSetPenBrushFill(pen, brush)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Pen_SetDashOffset( Pen pen, float dashOffset ) - { - return SetStatus(GdipSetPenDashOffset(pen, dashOffset)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Pen_SetDashPattern( Pen pen, float* dashArray, int count ) - { - return SetStatus(GdipSetPenDashArray(pen, dashArray, count)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Pen_SetDashStyle( Pen pen, DashStyle dashStyle ) - { - return SetStatus(GdipSetPenDashStyle(pen, dashStyle)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Pen_SetLineCap( Pen pen, LineCap startCap, LineCap endCap, DashCap dashCap ) - { + /************************************************************************** + + **************************************************************************/ + + static Status Pen_SetDashStyle( Pen pen, DashStyle dashStyle ) + { + return SetStatus(GdipSetPenDashStyle(pen, dashStyle)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Pen_SetLineCap( Pen pen, LineCap startCap, LineCap endCap, DashCap dashCap ) + { return SetStatus(GdipSetPenLineCap197819(pen, startCap, endCap, dashCap)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Pen_SetLineJoin( Pen pen, LineJoin lineJoin ) - { - return SetStatus(GdipSetPenLineJoin(pen, lineJoin)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Pen_SetMiterLimit( Pen pen, float miterLimit ) - { - return SetStatus(GdipSetPenMiterLimit(pen, miterLimit)); - } - - /************************************************************************** - - **************************************************************************/ + } + + /************************************************************************** + + **************************************************************************/ + + static Status Pen_SetLineJoin( Pen pen, LineJoin lineJoin ) + { + return SetStatus(GdipSetPenLineJoin(pen, lineJoin)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Pen_SetMiterLimit( Pen pen, float miterLimit ) + { + return SetStatus(GdipSetPenMiterLimit(pen, miterLimit)); + } + + /************************************************************************** + + **************************************************************************/ static Status Pen_SetWidth( Pen pen, float width ) - { - return SetStatus(GdipSetPenWidth(pen, width)); - } + { + return SetStatus(GdipSetPenWidth(pen, width)); + } /************************************************************************** - GDI+ Color Wrap Interface + GDI+ Color Wrap Interface **************************************************************************/ - // The following two color functions appear to serve little use - // and should probably be replaced with an actual ARGB type assignment - // wherever they are used. - - // I'm guessing they are being used in case of future adoption of the - // gdi+ Color class functionality in Swt. - - static void Color_delete( ARGB color ) - { - // no op - } - - /************************************************************************** - - **************************************************************************/ - - static ARGB Color_new( ARGB color ) - { - return color; - } + // The following two color functions appear to serve little use + // and should probably be replaced with an actual ARGB type assignment + // wherever they are used. + + // I'm guessing they are being used in case of future adoption of the + // gdi+ Color class functionality in Swt. + + static void Color_delete( ARGB color ) + { + // no op + } + + /************************************************************************** + + **************************************************************************/ + + static ARGB Color_new( ARGB color ) + { + return color; + } /************************************************************************** - GDI+ FontFamily Wrap Interface + GDI+ FontFamily Wrap Interface **************************************************************************/ - static int FontFamily_GetFamilyName( FontFamily family, wchar* name, int language ) - { - return SetStatus( GdipGetFamilyName( family, name, language ) ); - } - - /************************************************************************** - - **************************************************************************/ - - // CAUTION: Next two methods need to be tested - JJR - - static void FontFamily_delete( FontFamily family ) - { - if (family !is null) - GdipDeleteFontFamily( family ); - } - - /************************************************************************** - - FontFamily_new() returns a null because flat Gdi+ FontFamily is - internally assigned a null until it is associated with a font - (see gdi+ C++ wrapper for details). - - **************************************************************************/ - - static FontFamily FontFamily_new() - { - return null; - } + static int FontFamily_GetFamilyName( FontFamily family, wchar* name, int language ) + { + return SetStatus( GdipGetFamilyName( family, name, language ) ); + } + + /************************************************************************** + + **************************************************************************/ + + // CAUTION: Next two methods need to be tested - JJR + + static void FontFamily_delete( FontFamily family ) + { + if (family !is null) + GdipDeleteFontFamily( family ); + } + + /************************************************************************** + + FontFamily_new() returns a null because flat Gdi+ FontFamily is + internally assigned a null until it is associated with a font + (see gdi+ C++ wrapper for details). + + **************************************************************************/ + + static FontFamily FontFamily_new() + { + return null; + } /************************************************************************** - GDI+ Font Wrap Interface + GDI+ Font Wrap Interface **************************************************************************/ - static int Font_GetFamily( Font font, ref FontFamily family ) - { - return SetStatus( GdipGetFamily( font, family ) ); - } - - /************************************************************************** - - **************************************************************************/ - - static float Font_GetSize( Font font ) - { - float size; - SetStatus( GdipGetFontSize( font, size ) ); - return size; - } - - /************************************************************************** - - **************************************************************************/ - - static int Font_GetStyle( Font font ) - { - int style; - SetStatus( GdipGetFontStyle( font, style ) ); - return style; - } - - /************************************************************************** - - **************************************************************************/ - - static bool Font_IsAvailable( Font font ) - { - return (font !is null); - } - - /************************************************************************** - - **************************************************************************/ - - static void Font_delete( Font font ) - { - GdipDeleteFont( font ); - } - - /************************************************************************** - - **************************************************************************/ - - static Font Font_new( HDC hdc, HFONT hfont ) - { - Font font = null; - - if (hfont is null) { - Gdip.lastResult = GdipCreateFontFromDC( hdc, font ); - } else { - LOGFONTA logfont; - if (GetObjectA( hfont, LOGFONTA.sizeof, &logfont )) - Gdip.lastResult = GdipCreateFontFromLogfontA(hdc, logfont, font); - else - Gdip.lastResult = GdipCreateFontFromDC(hdc, font); - } - - return font; - } - - - /************************************************************************** - - **************************************************************************/ - - static Font Font_new( wchar* familyName, float emSize, int style, uint unit, - FontCollection fontCollection ) - { - Font nativeFont = null; - FontFamily nativeFamily = null; - - Gdip.lastResult = GdipCreateFontFamilyFromName( familyName, fontCollection, nativeFamily ); - - if (Gdip.lastResult != Status.OK) - { - if (GenericSansSerifFontFamily != null) - { - nativeFamily = GenericSansSerifFontFamily; - } - //TODO: access buffer via "ptr" property? - GenericSansSerifFontFamily = cast(FontFamily) GenericSansSerifFontFamilyBuffer; - Gdip.lastResult = GdipGetGenericFontFamilySansSerif( GenericSansSerifFontFamily ); - - nativeFamily = GenericSansSerifFontFamily; - - if (Gdip.lastResult != Status.OK) - return null; - } - - Gdip.lastResult = GdipCreateFont( nativeFamily, emSize, style, unit, nativeFont ); - - if (Gdip.lastResult != Status.OK) - { - if (GenericSansSerifFontFamily != null) - { - nativeFamily = GenericSansSerifFontFamily; - } - - GenericSansSerifFontFamily = cast(FontFamily) GenericSansSerifFontFamilyBuffer; - Gdip.lastResult = GdipGetGenericFontFamilySansSerif( GenericSansSerifFontFamily ); - - nativeFamily = GenericSansSerifFontFamily; - - if (Gdip.lastResult != Status.OK) - return null; - - Gdip.lastResult = GdipCreateFont( nativeFamily, emSize, style, - unit, nativeFont ); - } - - return nativeFont; - } + static int Font_GetFamily( Font font, ref FontFamily family ) + { + return SetStatus( GdipGetFamily( font, family ) ); + } + + /************************************************************************** + + **************************************************************************/ + + static float Font_GetSize( Font font ) + { + float size; + SetStatus( GdipGetFontSize( font, size ) ); + return size; + } + + /************************************************************************** + + **************************************************************************/ + + static int Font_GetStyle( Font font ) + { + int style; + SetStatus( GdipGetFontStyle( font, style ) ); + return style; + } + + /************************************************************************** + + **************************************************************************/ + + static bool Font_IsAvailable( Font font ) + { + return (font !is null); + } + + /************************************************************************** + + **************************************************************************/ + + static void Font_delete( Font font ) + { + GdipDeleteFont( font ); + } + + /************************************************************************** + + **************************************************************************/ + + static Font Font_new( HDC hdc, HFONT hfont ) + { + Font font = null; + + if (hfont is null) { + Gdip.lastResult = GdipCreateFontFromDC( hdc, font ); + } else { + LOGFONTA logfont; + if (GetObjectA( hfont, LOGFONTA.sizeof, &logfont )) + Gdip.lastResult = GdipCreateFontFromLogfontA(hdc, logfont, font); + else + Gdip.lastResult = GdipCreateFontFromDC(hdc, font); + } + + return font; + } + + + /************************************************************************** + + **************************************************************************/ + + static Font Font_new( wchar* familyName, float emSize, int style, uint unit, + FontCollection fontCollection ) + { + Font nativeFont = null; + FontFamily nativeFamily = null; + + Gdip.lastResult = GdipCreateFontFamilyFromName( familyName, fontCollection, nativeFamily ); + + if (Gdip.lastResult != Status.OK) + { + if (GenericSansSerifFontFamily != null) + { + nativeFamily = GenericSansSerifFontFamily; + } + //TODO: access buffer via "ptr" property? + GenericSansSerifFontFamily = cast(FontFamily) GenericSansSerifFontFamilyBuffer; + Gdip.lastResult = GdipGetGenericFontFamilySansSerif( GenericSansSerifFontFamily ); + + nativeFamily = GenericSansSerifFontFamily; + + if (Gdip.lastResult != Status.OK) + return null; + } + + Gdip.lastResult = GdipCreateFont( nativeFamily, emSize, style, unit, nativeFont ); + + if (Gdip.lastResult != Status.OK) + { + if (GenericSansSerifFontFamily != null) + { + nativeFamily = GenericSansSerifFontFamily; + } + + GenericSansSerifFontFamily = cast(FontFamily) GenericSansSerifFontFamilyBuffer; + Gdip.lastResult = GdipGetGenericFontFamilySansSerif( GenericSansSerifFontFamily ); + + nativeFamily = GenericSansSerifFontFamily; + + if (Gdip.lastResult != Status.OK) + return null; + + Gdip.lastResult = GdipCreateFont( nativeFamily, emSize, style, + unit, nativeFont ); + } + + return nativeFont; + } /************************************************************************** - GDI+ Startup and Shutdown Wrap Interface + GDI+ Startup and Shutdown Wrap Interface **************************************************************************/ - alias .GdiplusShutdown GdiplusShutdown; - - /************************************************************************** - - **************************************************************************/ - - alias .GdiplusStartup GdiplusStartup; + alias .GdiplusShutdown GdiplusShutdown; + + /************************************************************************** + + **************************************************************************/ + + alias .GdiplusStartup GdiplusStartup; /************************************************************************** - GDI+ Graphics Path Wrap Interface + GDI+ Graphics Path Wrap Interface **************************************************************************/ - static Path GraphicsPath_new( FillMode fillMode = FillModeAlternate ) - { - Path path = null; + static Path GraphicsPath_new( FillMode fillMode = FillModeAlternate ) + { + Path path = null; lastResult = GdipCreatePath(fillMode, path); - return path; - } - - /************************************************************************** - - **************************************************************************/ - - static Path GraphicsPath_new( Point* points, ubyte* types, int count, - FillMode fillMode = FillModeAlternate ) - { + return path; + } + + /************************************************************************** + + **************************************************************************/ + + static Path GraphicsPath_new( Point* points, ubyte* types, int count, + FillMode fillMode = FillModeAlternate ) + { Path path = null; lastResult = GdipCreatePath2I(points, types, count, fillMode, path); - return path; - } - - /************************************************************************** - - **************************************************************************/ - - static void GraphicsPath_delete( Path path ) - { - GdipDeletePath(path); - } + return path; + } + + /************************************************************************** + + **************************************************************************/ + + static void GraphicsPath_delete( Path path ) + { + GdipDeletePath(path); + } static Path GraphicsPath_Clone( Handle path ){ Path clonepath = null; SetStatus( GdipClonePath(path, clonepath)); @@ -1302,557 +1302,557 @@ } - static Status GraphicsPath_AddArcF( Path path, float x, float y, - float width, float height, - float startAngle, float sweepAngle ) - { + static Status GraphicsPath_AddArcF( Path path, float x, float y, + float width, float height, + float startAngle, float sweepAngle ) + { return SetStatus( GdipAddPathArc( path, x, y, width, - height, startAngle, sweepAngle) ); - } - - /************************************************************************** - - **************************************************************************/ - - static Status GraphicsPath_AddArc( Path path, int x, int y, - int width, int height, - float startAngle, float sweepAngle ) - { - return SetStatus(GdipAddPathArcI( path, - x, + height, startAngle, sweepAngle) ); + } + + /************************************************************************** + + **************************************************************************/ + + static Status GraphicsPath_AddArc( Path path, int x, int y, + int width, int height, + float startAngle, float sweepAngle ) + { + return SetStatus(GdipAddPathArcI( path, + x, y, width, height, startAngle, sweepAngle)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status GraphicsPath_AddBezier( Path path, float x1, float y1, - float x2, float y2, - float x3, float y3, - float x4, float y4 ) - { + } + + /************************************************************************** + + **************************************************************************/ + + static Status GraphicsPath_AddBezier( Path path, float x1, float y1, + float x2, float y2, + float x3, float y3, + float x4, float y4 ) + { return SetStatus( GdipAddPathBezier( path, x1, y1, x2, y2, - x3, y3, x4, y4 ) ); - } - - /************************************************************************** - - **************************************************************************/ - - static Status GraphicsPath_AddLine( Path path, float x1, float y1, - float x2, float y2 ) - { - return SetStatus( GdipAddPathLine( path, x1, y1, x2, y2 ) ); - } - - - /************************************************************************** - - **************************************************************************/ - - static Status GraphicsPath_AddPath( Path path, Path addingPath, bool connect ) - { + x3, y3, x4, y4 ) ); + } + + /************************************************************************** + + **************************************************************************/ + + static Status GraphicsPath_AddLine( Path path, float x1, float y1, + float x2, float y2 ) + { + return SetStatus( GdipAddPathLine( path, x1, y1, x2, y2 ) ); + } + + + /************************************************************************** + + **************************************************************************/ + + static Status GraphicsPath_AddPath( Path path, Path addingPath, bool connect ) + { return SetStatus( GdipAddPathPath( path, addingPath, connect ) ); - } - - /************************************************************************** - - **************************************************************************/ - - static Status GraphicsPath_AddRectangle( Path path, RectF rect ) - { - return SetStatus( GdipAddPathRectangle( path, - rect.X, - rect.Y, - rect.Width, - rect.Height ) ); - } - - - /************************************************************************** - - **************************************************************************/ - - static Status GraphicsPath_AddString( Path path, wchar* string, - int length, FontFamily family, - int style, float emSize, - ref PointF origin, StringFormat format ) - { - RectF rect = { origin.X, origin.Y, 0.0f, 0.0f }; + } + + /************************************************************************** + + **************************************************************************/ + + static Status GraphicsPath_AddRectangle( Path path, RectF rect ) + { + return SetStatus( GdipAddPathRectangle( path, + rect.X, + rect.Y, + rect.Width, + rect.Height ) ); + } + + + /************************************************************************** + + **************************************************************************/ + + static Status GraphicsPath_AddString( Path path, wchar* string, + int length, FontFamily family, + int style, float emSize, + ref PointF origin, StringFormat format ) + { + RectF rect = { origin.X, origin.Y, 0.0f, 0.0f }; return SetStatus( GdipAddPathString( path, string, length, family, - style, emSize, rect, format ) ); - } - - - /************************************************************************** - - **************************************************************************/ - - static Status GraphicsPath_CloseFigure( Path path ) - { - return SetStatus( GdipClosePathFigure(path) ); - } - - - /************************************************************************** - - **************************************************************************/ - - static Status GraphicsPath_Flatten( Path path, Matrix matrix, float flatness ) - { + style, emSize, rect, format ) ); + } + + + /************************************************************************** + + **************************************************************************/ + + static Status GraphicsPath_CloseFigure( Path path ) + { + return SetStatus( GdipClosePathFigure(path) ); + } + + + /************************************************************************** + + **************************************************************************/ + + static Status GraphicsPath_Flatten( Path path, Matrix matrix, float flatness ) + { return SetStatus( GdipFlattenPath( path, matrix, flatness ) ); - } - - - /************************************************************************** - - **************************************************************************/ - - static Status GraphicsPath_GetBounds( Path path, ref RectF bounds, - Matrix matrix, Pen pen ) - { - - return SetStatus( GdipGetPathWorldBounds( path, bounds, - matrix, pen ) ); - } - - /************************************************************************** - - **************************************************************************/ - - static Status GraphicsPath_GetLastPoint( Path path, out PointF lastPoint ) - { - return SetStatus( GdipGetPathLastPoint( path, lastPoint) ); - } - - /************************************************************************** - - **************************************************************************/ - - static Status GraphicsPath_GetPathTypes( Path path, byte* types, int count ) - { - return SetStatus( GdipGetPathTypes( path, types, count) ); - } - - /************************************************************************** - - **************************************************************************/ - - static Status GraphicsPath_GetPathPoints( Path path, PointF* points, int count) + } + + + /************************************************************************** + + **************************************************************************/ + + static Status GraphicsPath_GetBounds( Path path, ref RectF bounds, + Matrix matrix, Pen pen ) + { + + return SetStatus( GdipGetPathWorldBounds( path, bounds, + matrix, pen ) ); + } + + /************************************************************************** + + **************************************************************************/ + + static Status GraphicsPath_GetLastPoint( Path path, out PointF lastPoint ) + { + return SetStatus( GdipGetPathLastPoint( path, lastPoint) ); + } + + /************************************************************************** + + **************************************************************************/ + + static Status GraphicsPath_GetPathTypes( Path path, byte* types, int count ) + { + return SetStatus( GdipGetPathTypes( path, types, count) ); + } + + /************************************************************************** + + **************************************************************************/ + + static Status GraphicsPath_GetPathPoints( Path path, PointF* points, int count) { return SetStatus(GdipGetPathPoints(path, points, count)); } - /************************************************************************** - - **************************************************************************/ - - static int GraphicsPath_GetPointCount( Path path ) - { - int count = 0; + /************************************************************************** + + **************************************************************************/ + + static int GraphicsPath_GetPointCount( Path path ) + { + int count = 0; SetStatus(GdipGetPointCount(path, count)); return count; - } - - /************************************************************************** - - **************************************************************************/ - - static bool GraphicsPath_IsOutlineVisible( Path path, - float x, float y, Pen pen, Graphics g = null ) - { - int booln = false; - SetStatus( GdipIsOutlineVisiblePathPoint( path, x, y, - pen, g, - booln ) ); - return (booln == true); - } - - /************************************************************************** - - **************************************************************************/ + } + + /************************************************************************** + + **************************************************************************/ + + static bool GraphicsPath_IsOutlineVisible( Path path, + float x, float y, Pen pen, Graphics g = null ) + { + int booln = false; + SetStatus( GdipIsOutlineVisiblePathPoint( path, x, y, + pen, g, + booln ) ); + return (booln == true); + } + + /************************************************************************** + + **************************************************************************/ static bool GraphicsPath_IsVisible( Path path, float x, float y, Graphics graphics ) - { - int booln = false; - - SetStatus(GdipIsVisiblePathPoint(path, x, y, graphics, booln)); - - return (booln == true); - } - - /************************************************************************** - - **************************************************************************/ - - static int GraphicsPath_SetFillMode( Path path, FillMode fillmode ) - { - return SetStatus( GdipSetPathFillMode(path, fillmode) ); - } - - /************************************************************************** - - **************************************************************************/ - - static int GraphicsPath_StartFigure( Path path ) - { - return SetStatus(GdipStartPathFigure(path)); - } - - /************************************************************************** - - **************************************************************************/ - - static int GraphicsPath_Transform( Path path, Matrix matrix ) - { - if(matrix) + { + int booln = false; + + SetStatus(GdipIsVisiblePathPoint(path, x, y, graphics, booln)); + + return (booln == true); + } + + /************************************************************************** + + **************************************************************************/ + + static int GraphicsPath_SetFillMode( Path path, FillMode fillmode ) + { + return SetStatus( GdipSetPathFillMode(path, fillmode) ); + } + + /************************************************************************** + + **************************************************************************/ + + static int GraphicsPath_StartFigure( Path path ) + { + return SetStatus(GdipStartPathFigure(path)); + } + + /************************************************************************** + + **************************************************************************/ + + static int GraphicsPath_Transform( Path path, Matrix matrix ) + { + if(matrix) return SetStatus( GdipTransformPath(path, matrix)); else return Status.OK; - } + } /************************************************************************** - GDI+ Graphics Wrap Interface + GDI+ Graphics Wrap Interface **************************************************************************/ - static Graphics Graphics_new( HDC hdc ) - { + static Graphics Graphics_new( HDC hdc ) + { Graphics graphics = null; Gdip.lastResult = GdipCreateFromHDC(hdc, graphics); return graphics; - } - - /************************************************************************** - - **************************************************************************/ - - static void Graphics_delete( Graphics graphics) - { - GdipDeleteGraphics(graphics); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_DrawArc( Graphics graphics, Pen pen, - int x, int y, int width, int height, - float startAngle, float sweepAngle ) - { + } + + /************************************************************************** + + **************************************************************************/ + + static void Graphics_delete( Graphics graphics) + { + GdipDeleteGraphics(graphics); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_DrawArc( Graphics graphics, Pen pen, + int x, int y, int width, int height, + float startAngle, float sweepAngle ) + { return SetStatus(GdipDrawArcI(graphics, pen, - x, y, width, height, - startAngle, sweepAngle)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_DrawEllipse(Graphics graphics, Pen pen, - int x, int y, - int width, int height) - { - return SetStatus(GdipDrawEllipseI(graphics, pen, - x, y, width, height)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_DrawImage(Graphics graphics, Image image, int x, int y) - { - return SetStatus(GdipDrawImageI(graphics,image, x, y)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_DrawImage( Graphics graphics, Image image, ref Rect destRect, - int srcx, int srcy, int srcwidth, int srcheight, - Unit srcUnit, ImageAttributes imageAttributes = null, - DrawImageAbort callback = null, void* callbackData = null ) - { - return SetStatus(GdipDrawImageRectRectI(graphics, image, - destRect.X, destRect.Y, - destRect.Width, destRect.Height, - srcx, srcy, - srcwidth, srcheight, - srcUnit, imageAttributes, - callback, callbackData)); - } - - /************************************************************************** - - **************************************************************************/ + x, y, width, height, + startAngle, sweepAngle)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_DrawEllipse(Graphics graphics, Pen pen, + int x, int y, + int width, int height) + { + return SetStatus(GdipDrawEllipseI(graphics, pen, + x, y, width, height)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_DrawImage(Graphics graphics, Image image, int x, int y) + { + return SetStatus(GdipDrawImageI(graphics,image, x, y)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_DrawImage( Graphics graphics, Image image, ref Rect destRect, + int srcx, int srcy, int srcwidth, int srcheight, + Unit srcUnit, ImageAttributes imageAttributes = null, + DrawImageAbort callback = null, void* callbackData = null ) + { + return SetStatus(GdipDrawImageRectRectI(graphics, image, + destRect.X, destRect.Y, + destRect.Width, destRect.Height, + srcx, srcy, + srcwidth, srcheight, + srcUnit, imageAttributes, + callback, callbackData)); + } + + /************************************************************************** + + **************************************************************************/ static Status Graphics_DrawLine( Graphics graphics, Pen pen, - int x1, int y1, int x2, int y2 ) - { - return SetStatus(GdipDrawLineI(graphics, pen, x1, y1, x2, y2)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_DrawLines( Graphics graphics, Pen pen, Point* points, uint count ) - { - return SetStatus(GdipDrawLinesI(graphics, pen, points, count)); - } - - /************************************************************************** - - **************************************************************************/ + int x1, int y1, int x2, int y2 ) + { + return SetStatus(GdipDrawLineI(graphics, pen, x1, y1, x2, y2)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_DrawLines( Graphics graphics, Pen pen, Point* points, uint count ) + { + return SetStatus(GdipDrawLinesI(graphics, pen, points, count)); + } + + /************************************************************************** + + **************************************************************************/ static Status Graphics_DrawPath( Graphics graphics, Pen pen, Path path ) - { - return SetStatus(GdipDrawPath(graphics, pen, path)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_DrawPolygon(Graphics graphics, Pen pen, Point* points, uint count ) - { - return SetStatus(GdipDrawPolygonI(graphics, pen, points, count)); - - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_DrawRectangle( Graphics graphics, Pen pen, int x, int y, - int width, int height ) - { - return SetStatus(GdipDrawRectangleI(graphics, pen, x, y, width, height)); + { + return SetStatus(GdipDrawPath(graphics, pen, path)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_DrawPolygon(Graphics graphics, Pen pen, Point* points, uint count ) + { + return SetStatus(GdipDrawPolygonI(graphics, pen, points, count)); + } - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_DrawString( Graphics graphics, wchar* string, int length, - Font font, ref PointF origin, Brush brush ) - { - RectF rect = {origin.X, origin.Y, 0.0f, 0.0f}; + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_DrawRectangle( Graphics graphics, Pen pen, int x, int y, + int width, int height ) + { + return SetStatus(GdipDrawRectangleI(graphics, pen, x, y, width, height)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_DrawString( Graphics graphics, wchar* string, int length, + Font font, ref PointF origin, Brush brush ) + { + RectF rect = {origin.X, origin.Y, 0.0f, 0.0f}; return SetStatus(GdipDrawString(graphics,string,length, font, rect, null, brush)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_DrawString( Graphics graphics, wchar* string, int length, - Font font, ref PointF origin, - StringFormat format, Brush brush ) - { - RectF rect = { origin.X, origin.Y, 0.0f, 0.0f }; + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_DrawString( Graphics graphics, wchar* string, int length, + Font font, ref PointF origin, + StringFormat format, Brush brush ) + { + RectF rect = { origin.X, origin.Y, 0.0f, 0.0f }; return SetStatus(GdipDrawString(graphics, string, length, font, rect, format, brush)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_FillEllipse( Graphics graphics, Brush brush, - int x, int y, - int width, int height ) - { - return SetStatus(GdipFillEllipseI(graphics, brush, x,y, width, height)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_FillPath( Graphics graphics, Brush brush, Path path ) - { - return SetStatus(GdipFillPath(graphics,brush,path)); - } - - /************************************************************************** - - **************************************************************************/ - - static void Graphics_Flush( Graphics graphics, FlushIntention intention = FlushIntentionFlush ) - { - GdipFlush(graphics, intention); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_FillPie( Graphics graphics, Brush brush, - int x, int y, - int width, int height, - float startAngle, float sweepAngle ) - { - return SetStatus(GdipFillPieI(graphics, brush, - x, y, width, height, - startAngle, sweepAngle)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_FillPolygon( Graphics graphics, Brush brush, - Point* points, int count, FillMode fillMode ) - { - return SetStatus(GdipFillPolygonI(graphics, brush, points, count, fillMode)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_FillRectangle( Graphics graphics, Brush brush, - int x, int y, - int width, int height ) - { - return SetStatus(GdipFillRectangleI(graphics, brush, - x, y, - width, height)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_GetClipBounds( Graphics graphics, out RectF rect ) - { - return SetStatus(GdipGetClipBounds(graphics, rect)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_GetClipBounds( Graphics graphics, out Rect rect ) - { - return SetStatus(GdipGetClipBoundsI(graphics, rect)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_GetClip( Graphics graphics, Region region ) - { - return SetStatus(GdipGetClip(graphics, region)); - } - - /************************************************************************** - - **************************************************************************/ - - static HDC Graphics_GetHDC(Graphics graphics) - { - HDC hdc = null; + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_FillEllipse( Graphics graphics, Brush brush, + int x, int y, + int width, int height ) + { + return SetStatus(GdipFillEllipseI(graphics, brush, x,y, width, height)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_FillPath( Graphics graphics, Brush brush, Path path ) + { + return SetStatus(GdipFillPath(graphics,brush,path)); + } + + /************************************************************************** + + **************************************************************************/ + + static void Graphics_Flush( Graphics graphics, FlushIntention intention = FlushIntentionFlush ) + { + GdipFlush(graphics, intention); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_FillPie( Graphics graphics, Brush brush, + int x, int y, + int width, int height, + float startAngle, float sweepAngle ) + { + return SetStatus(GdipFillPieI(graphics, brush, + x, y, width, height, + startAngle, sweepAngle)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_FillPolygon( Graphics graphics, Brush brush, + Point* points, int count, FillMode fillMode ) + { + return SetStatus(GdipFillPolygonI(graphics, brush, points, count, fillMode)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_FillRectangle( Graphics graphics, Brush brush, + int x, int y, + int width, int height ) + { + return SetStatus(GdipFillRectangleI(graphics, brush, + x, y, + width, height)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_GetClipBounds( Graphics graphics, out RectF rect ) + { + return SetStatus(GdipGetClipBounds(graphics, rect)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_GetClipBounds( Graphics graphics, out Rect rect ) + { + return SetStatus(GdipGetClipBoundsI(graphics, rect)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_GetClip( Graphics graphics, Region region ) + { + return SetStatus(GdipGetClip(graphics, region)); + } + + /************************************************************************** + + **************************************************************************/ + + static HDC Graphics_GetHDC(Graphics graphics) + { + HDC hdc = null; SetStatus(GdipGetDC(graphics, hdc)); return hdc; - } - - /************************************************************************** - - **************************************************************************/ - - static void Graphics_ReleaseHDC(Graphics graphics, HDC hdc) - { - SetStatus(GdipReleaseDC(graphics, hdc)); - } - - /************************************************************************** - - **************************************************************************/ - - static InterpolationMode Graphics_GetInterpolationMode( Graphics graphics ) - { + } + + /************************************************************************** + + **************************************************************************/ + + static void Graphics_ReleaseHDC(Graphics graphics, HDC hdc) + { + SetStatus(GdipReleaseDC(graphics, hdc)); + } + + /************************************************************************** + + **************************************************************************/ + + static InterpolationMode Graphics_GetInterpolationMode( Graphics graphics ) + { InterpolationMode mode = InterpolationModeInvalid; SetStatus(GdipGetInterpolationMode(graphics, mode)); return mode; - } - - /************************************************************************** - - **************************************************************************/ - - static SmoothingMode Graphics_GetSmoothingMode( Graphics graphics ) - { - SmoothingMode smoothingMode = SmoothingModeInvalid; + } + + /************************************************************************** + + **************************************************************************/ + + static SmoothingMode Graphics_GetSmoothingMode( Graphics graphics ) + { + SmoothingMode smoothingMode = SmoothingModeInvalid; SetStatus(GdipGetSmoothingMode(graphics, smoothingMode)); return smoothingMode; - } - - /************************************************************************** - - **************************************************************************/ - - static TextRenderingHint Graphics_GetTextRenderingHint( Graphics graphics ) - { - TextRenderingHint hint; + } + + /************************************************************************** + + **************************************************************************/ + + static TextRenderingHint Graphics_GetTextRenderingHint( Graphics graphics ) + { + TextRenderingHint hint; SetStatus(GdipGetTextRenderingHint(graphics, hint)); return hint; - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_GetTransform( Graphics graphics, Matrix matrix ) - { - return SetStatus(GdipGetWorldTransform(graphics, matrix)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_GetVisibleClipBounds( Graphics graphics, out Rect rect ) - { + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_GetTransform( Graphics graphics, Matrix matrix ) + { + return SetStatus(GdipGetWorldTransform(graphics, matrix)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_GetVisibleClipBounds( Graphics graphics, out Rect rect ) + { return SetStatus(GdipGetVisibleClipBoundsI(graphics, rect)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_MeasureString( Graphics graphics, wchar* string, int length, - Font font, ref PointF origin, - ref RectF boundingBox ) - { + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_MeasureString( Graphics graphics, wchar* string, int length, + Font font, ref PointF origin, + ref RectF boundingBox ) + { RectF rect = {origin.X, origin.Y, 0.0f, 0.0f}; return SetStatus(GdipMeasureString( @@ -1866,17 +1866,17 @@ null, null )); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_MeasureString( Graphics graphics, wchar* string, int length, - Font font, ref PointF origin, - StringFormat format, ref RectF boundingBox ) - { - RectF rect = {origin.X, origin.Y, 0.0f, 0.0f}; + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_MeasureString( Graphics graphics, wchar* string, int length, + Font font, ref PointF origin, + StringFormat format, ref RectF boundingBox ) + { + RectF rect = {origin.X, origin.Y, 0.0f, 0.0f}; return SetStatus(GdipMeasureString( graphics, @@ -1889,361 +1889,361 @@ null, null )); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_ResetClip( Graphics graphics ) - { - return SetStatus(GdipResetClip(graphics)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_Restore( Graphics graphics, GraphicsState gstate ) - { - return SetStatus(GdipRestoreGraphics(graphics, gstate)); - } - - /************************************************************************** - - **************************************************************************/ - - static GraphicsState Graphics_Save( Graphics graphics ) - { - GraphicsState gstate; + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_ResetClip( Graphics graphics ) + { + return SetStatus(GdipResetClip(graphics)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_Restore( Graphics graphics, GraphicsState gstate ) + { + return SetStatus(GdipRestoreGraphics(graphics, gstate)); + } + + /************************************************************************** + + **************************************************************************/ + + static GraphicsState Graphics_Save( Graphics graphics ) + { + GraphicsState gstate; SetStatus(GdipSaveGraphics(graphics, gstate)); return gstate; - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_ScaleTransform( Graphics graphics, float sx, float sy, - MatrixOrder order = MatrixOrderPrepend ) - { - return SetStatus(GdipScaleWorldTransform(graphics, sx, sy, order)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_SetClip( Graphics graphics, HRGN hrgn, - CombineMode combineMode = CombineModeReplace ) - { - return SetStatus(GdipSetClipHrgn(graphics, hrgn, combineMode)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_SetClipPath( Graphics graphics, Path path, - CombineMode combineMode = CombineModeReplace ) - { - return SetStatus(GdipSetClipPath(graphics, path, combineMode)); - } - - /************************************************************************** - - **************************************************************************/ + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_ScaleTransform( Graphics graphics, float sx, float sy, + MatrixOrder order = MatrixOrderPrepend ) + { + return SetStatus(GdipScaleWorldTransform(graphics, sx, sy, order)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_SetClip( Graphics graphics, HRGN hrgn, + CombineMode combineMode = CombineModeReplace ) + { + return SetStatus(GdipSetClipHrgn(graphics, hrgn, combineMode)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_SetClipPath( Graphics graphics, Path path, + CombineMode combineMode = CombineModeReplace ) + { + return SetStatus(GdipSetClipPath(graphics, path, combineMode)); + } + + /************************************************************************** + + **************************************************************************/ static Status Graphics_SetClip( Graphics graphics, ref Rect rect, - CombineMode combineMode = CombineModeReplace ) - { + CombineMode combineMode = CombineModeReplace ) + { return SetStatus( GdipSetClipRectI( graphics, rect.X, rect.Y, rect.Width, rect.Height, combineMode)); - } + } //static Status Graphics_SetClipPath(Graphics graphics, GraphicsPath path ){ // return SetStatus( SetClipPath( graphics, path )); //} - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_SetCompositingQuality( Graphics graphics, - CompositingQuality compositingQuality ) - { - return SetStatus(GdipSetCompositingQuality(graphics, compositingQuality)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_SetPageUnit( Graphics graphics, Unit unit ) - { - return SetStatus(GdipSetPageUnit(graphics, unit)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_SetPixelOffsetMode( Graphics graphics, - PixelOffsetMode pixelOffsetMode ) - { - return SetStatus(GdipSetPixelOffsetMode(graphics, pixelOffsetMode)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_SetSmoothingMode( Graphics graphics, - SmoothingMode smoothingMode ) - { - return SetStatus(GdipSetSmoothingMode(graphics, smoothingMode)); - } - - /************************************************************************** - - **************************************************************************/ + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_SetCompositingQuality( Graphics graphics, + CompositingQuality compositingQuality ) + { + return SetStatus(GdipSetCompositingQuality(graphics, compositingQuality)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_SetPageUnit( Graphics graphics, Unit unit ) + { + return SetStatus(GdipSetPageUnit(graphics, unit)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_SetPixelOffsetMode( Graphics graphics, + PixelOffsetMode pixelOffsetMode ) + { + return SetStatus(GdipSetPixelOffsetMode(graphics, pixelOffsetMode)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_SetSmoothingMode( Graphics graphics, + SmoothingMode smoothingMode ) + { + return SetStatus(GdipSetSmoothingMode(graphics, smoothingMode)); + } + + /************************************************************************** + + **************************************************************************/ static Status Graphics_SetTransform( Graphics graphics, Matrix matrix ) - { - return SetStatus(GdipSetWorldTransform(graphics, matrix)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_SetInterpolationMode( Graphics graphics, - InterpolationMode mode ) - { - return SetStatus(GdipSetInterpolationMode(graphics, mode)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_SetTextRenderingHint( Graphics graphics, TextRenderingHint mode ) - { - return SetStatus(GdipSetTextRenderingHint(graphics, mode)); - } - - /************************************************************************** - - **************************************************************************/ - - static Status Graphics_TranslateTransform( Graphics graphics, float dx, float dy, - MatrixOrder order = MatrixOrderPrepend ) - { - return SetStatus(GdipTranslateWorldTransform(graphics, dx, dy, order)); - } + { + return SetStatus(GdipSetWorldTransform(graphics, matrix)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_SetInterpolationMode( Graphics graphics, + InterpolationMode mode ) + { + return SetStatus(GdipSetInterpolationMode(graphics, mode)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_SetTextRenderingHint( Graphics graphics, TextRenderingHint mode ) + { + return SetStatus(GdipSetTextRenderingHint(graphics, mode)); + } + + /************************************************************************** + + **************************************************************************/ + + static Status Graphics_TranslateTransform( Graphics graphics, float dx, float dy, + MatrixOrder order = MatrixOrderPrepend ) + { + return SetStatus(GdipTranslateWorldTransform(graphics, dx, dy, order)); + } /************************************************************************** - Gdi+ Region Wrap Interface + Gdi+ Region Wrap Interface **************************************************************************/ static Region Region_new( HRGN hRgn ) - { - Region region = null; - - Gdip.lastResult = GdipCreateRegionHrgn( hRgn, region); - - return region; - } - - /************************************************************************** - - **************************************************************************/ - - static Region Region_new() - { - Region region = null; - - Gdip.lastResult = GdipCreateRegion(region); - - return region; - } - - /************************************************************************** - - **************************************************************************/ - - static void Region_delete( Region region ) - { - GdipDeleteRegion(region); - } - - /************************************************************************** - - **************************************************************************/ - - static HRGN Region_GetHRGN( Region region, Graphics graphics ) - { - HRGN hrgn; - - SetStatus(GdipGetRegionHRgn(region, graphics, hrgn)); - - return hrgn; - } - - /************************************************************************** - - **************************************************************************/ - - static int Region_IsInfinite( Region region, Graphics graphics ) - { - int booln = false; - - SetStatus(GdipIsInfiniteRegion(region, graphics, booln)); - - return booln; - } + { + Region region = null; + + Gdip.lastResult = GdipCreateRegionHrgn( hRgn, region); + + return region; + } + + /************************************************************************** + + **************************************************************************/ + + static Region Region_new() + { + Region region = null; + + Gdip.lastResult = GdipCreateRegion(region); + + return region; + } + + /************************************************************************** + + **************************************************************************/ + + static void Region_delete( Region region ) + { + GdipDeleteRegion(region); + } + + /************************************************************************** + + **************************************************************************/ + + static HRGN Region_GetHRGN( Region region, Graphics graphics ) + { + HRGN hrgn; + + SetStatus(GdipGetRegionHRgn(region, graphics, hrgn)); + + return hrgn; + } + + /************************************************************************** + + **************************************************************************/ + + static int Region_IsInfinite( Region region, Graphics graphics ) + { + int booln = false; + + SetStatus(GdipIsInfiniteRegion(region, graphics, booln)); + + return booln; + } /************************************************************************** - Gdi+ Matrix Wrap Interface + Gdi+ Matrix Wrap Interface **************************************************************************/ - static Matrix Matrix_new(float m11, float m12, float m21, float m22, float dx, float dy) - { - Matrix matrix = null; + static Matrix Matrix_new(float m11, float m12, float m21, float m22, float dx, float dy) + { + Matrix matrix = null; Gdip.lastResult = GdipCreateMatrix2(m11, m12, m21, m22, dx, dy, matrix); return matrix; - } - - /************************************************************************** - - **************************************************************************/ - - static void Matrix_delete( Matrix matrix ) - { - GdipDeleteMatrix( matrix ); - } - - /************************************************************************** - - **************************************************************************/ + } + + /************************************************************************** + + **************************************************************************/ + + static void Matrix_delete( Matrix matrix ) + { + GdipDeleteMatrix( matrix ); + } + + /************************************************************************** + + **************************************************************************/ static Status Matrix_GetElements( Matrix matrix, float* m ) - { - return SetStatus( GdipGetMatrixElements( matrix, m ) ); - } - - /************************************************************************** - - **************************************************************************/ + { + return SetStatus( GdipGetMatrixElements( matrix, m ) ); + } + + /************************************************************************** + + **************************************************************************/ static Status Matrix_Invert( Matrix matrix ) - { - return SetStatus( GdipInvertMatrix( matrix ) ); - } - - /************************************************************************** - - **************************************************************************/ + { + return SetStatus( GdipInvertMatrix( matrix ) ); + } + + /************************************************************************** + + **************************************************************************/ static int Matrix_IsIdentity( Matrix matrix ) - { - int result = false; - - SetStatus(GdipIsMatrixIdentity( matrix, result ) ); - - return result; - } - - /************************************************************************** - - **************************************************************************/ + { + int result = false; + + SetStatus(GdipIsMatrixIdentity( matrix, result ) ); + + return result; + } + + /************************************************************************** + + **************************************************************************/ static Status Matrix_Multiply( Matrix nativeMatrix, Matrix matrix, - MatrixOrder order = MatrixOrderPrepend ) - { - return SetStatus( GdipMultiplyMatrix( nativeMatrix, matrix, order) ); - } - - /************************************************************************** - - **************************************************************************/ + MatrixOrder order = MatrixOrderPrepend ) + { + return SetStatus( GdipMultiplyMatrix( nativeMatrix, matrix, order) ); + } + + /************************************************************************** + + **************************************************************************/ static int Matrix_Rotate( Matrix matrix, float angle, MatrixOrder order = MatrixOrderPrepend ) - { - return SetStatus( GdipRotateMatrix( matrix, angle, order ) ); - } - - /************************************************************************** - - **************************************************************************/ + { + return SetStatus( GdipRotateMatrix( matrix, angle, order ) ); + } + + /************************************************************************** + + **************************************************************************/ static Status Matrix_Scale( Matrix matrix, float scaleX , float scaleY, - MatrixOrder order = MatrixOrderPrepend ) - { - return SetStatus( GdipScaleMatrix(matrix, scaleX, scaleY, order) ); - } + MatrixOrder order = MatrixOrderPrepend ) + { + return SetStatus( GdipScaleMatrix(matrix, scaleX, scaleY, order) ); + } static Status Matrix_Shear( Matrix matrix, float shearX, float shearY, MatrixOrder order ){ return SetStatus( GdipShearMatrix(matrix, shearX, shearY, order)); } - /************************************************************************** - - **************************************************************************/ + /************************************************************************** + + **************************************************************************/ static Status Matrix_SetElements( Matrix matrix, float m11, float m12, - float m21, float m22, - float dx, float dy ) - { - return SetStatus( GdipSetMatrixElements( matrix, m11, m12, m21, m22, dx, dy ) ); - } - - /************************************************************************** - - **************************************************************************/ + float m21, float m22, + float dx, float dy ) + { + return SetStatus( GdipSetMatrixElements( matrix, m11, m12, m21, m22, dx, dy ) ); + } + + /************************************************************************** + + **************************************************************************/ static Status Matrix_TransformPoints( Matrix matrix, PointF* pts, int count = 1 ) - { - return SetStatus( GdipTransformMatrixPoints( matrix, pts, count ) ); - } - - /************************************************************************** - - **************************************************************************/ + { + return SetStatus( GdipTransformMatrixPoints( matrix, pts, count ) ); + } + + /************************************************************************** + + **************************************************************************/ static Status Matrix_Translate( Matrix matrix, float offsetX, float offsetY, - MatrixOrder order = MatrixOrderPrepend ) - { - return SetStatus( GdipTranslateMatrix( matrix, offsetX, offsetY, order ) ); - } + MatrixOrder order = MatrixOrderPrepend ) + { + return SetStatus( GdipTranslateMatrix( matrix, offsetX, offsetY, order ) ); + } /************************************************************************** - Gdi+ StringFromat Wrap Interface + Gdi+ StringFromat Wrap Interface **************************************************************************/ - static void StringFormat_delete( StringFormat format ) - { - GdipDeleteStringFormat( format ); - } - - /************************************************************************** - - **************************************************************************/ - - static StringFormat StringFormat_Clone( StringFormat format ) - { - StringFormat clonedStringFormat = null; + static void StringFormat_delete( StringFormat format ) + { + GdipDeleteStringFormat( format ); + } + + /************************************************************************** + + **************************************************************************/ + + static StringFormat StringFormat_Clone( StringFormat format ) + { + StringFormat clonedStringFormat = null; Gdip.lastResult = GdipCloneStringFormat( format, clonedStringFormat ); @@ -2251,86 +2251,86 @@ return clonedStringFormat; else return null; - } - - /************************************************************************** - - **************************************************************************/ - - static StringFormat StringFormat_GenericDefault() - { - // TODO: do we need to access buffer through "ptr" property? - StringFormat genericDefaultStringFormat = - cast(StringFormat) GenericDefaultStringFormatBuffer; - - Gdip.lastResult = GdipStringFormatGetGenericDefault( genericDefaultStringFormat ); - - return genericDefaultStringFormat; - } - - /************************************************************************** - - **************************************************************************/ - - static StringFormat StringFormat_GenericTypographic() - { - // TODO: do we need to access buffer through "ptr" property? - StringFormat genericTypographicStringFormat = - cast(StringFormat) GenericTypographicStringFormatBuffer; - - Gdip.lastResult = GdipStringFormatGetGenericTypographic( + } + + /************************************************************************** + + **************************************************************************/ + + static StringFormat StringFormat_GenericDefault() + { + // TODO: do we need to access buffer through "ptr" property? + StringFormat genericDefaultStringFormat = + cast(StringFormat) GenericDefaultStringFormatBuffer; + + Gdip.lastResult = GdipStringFormatGetGenericDefault( genericDefaultStringFormat ); + + return genericDefaultStringFormat; + } + + /************************************************************************** + + **************************************************************************/ + + static StringFormat StringFormat_GenericTypographic() + { + // TODO: do we need to access buffer through "ptr" property? + StringFormat genericTypographicStringFormat = + cast(StringFormat) GenericTypographicStringFormatBuffer; + + Gdip.lastResult = GdipStringFormatGetGenericTypographic( genericTypographicStringFormat ); - return genericTypographicStringFormat; - } - - /************************************************************************** - - **************************************************************************/ - - // TODO: StringFormat class in Gdi+ maintains it's own lastError status - // Right now all lastError and lastResult status for dwt's gdip objects - // are combined in one Gdip SetStatus method and lastResult member. - // Consider if there is a need to maintain per object lastResult - // monitoring. For now, this /should/ work as is. - - static int StringFormat_GetFormatFlags(StringFormat format) - { - int flags; + return genericTypographicStringFormat; + } + + /************************************************************************** + + **************************************************************************/ + + // TODO: StringFormat class in Gdi+ maintains it's own lastError status + // Right now all lastError and lastResult status for dwt's gdip objects + // are combined in one Gdip SetStatus method and lastResult member. + // Consider if there is a need to maintain per object lastResult + // monitoring. For now, this /should/ work as is. + + static int StringFormat_GetFormatFlags(StringFormat format) + { + int flags; SetStatus( GdipGetStringFormatFlags(format, flags)); return flags; - } - - /************************************************************************** - - **************************************************************************/ - - static int StringFormat_SetHotkeyPrefix( StringFormat format, int hotkeyPrefix ) - { + } + + /************************************************************************** + + **************************************************************************/ + + static int StringFormat_SetHotkeyPrefix( StringFormat format, int hotkeyPrefix ) + { return SetStatus(GdipSetStringFormatHotkeyPrefix(format, hotkeyPrefix)); - } - - /************************************************************************** - - **************************************************************************/ - - static int StringFormat_SetFormatFlags( StringFormat format, int flags ) - { + } + + /************************************************************************** + + **************************************************************************/ + + static int StringFormat_SetFormatFlags( StringFormat format, int flags ) + { return SetStatus(GdipSetStringFormatFlags(format, flags)); - } - - /************************************************************************** - - **************************************************************************/ - - static int StringFormat_SetTabStops( StringFormat format, float firstTabOffset, - int count, float* tabStops) - { - return SetStatus( GdipSetStringFormatTabStops( format, firstTabOffset, - count, tabStops ) ); - } - - /************************************************************************** - - **************************************************************************/ + } + + /************************************************************************** + + **************************************************************************/ + + static int StringFormat_SetTabStops( StringFormat format, float firstTabOffset, + int count, float* tabStops) + { + return SetStatus( GdipSetStringFormatTabStops( format, firstTabOffset, + count, tabStops ) ); + } + + /************************************************************************** + + **************************************************************************/ }