# HG changeset patch # User Frank Benoit # Date 1217071751 -7200 # Node ID 2443a18f96b84bb285d0d72d57e7c0dcc23cf610 # Parent 91eec9fa94dec3d1251f6b25608f8c24f8f1e5a4# Parent a63e2cd5485e629bc50bfcee3ba83b0a345504b9 merge diff -r 91eec9fa94de -r 2443a18f96b8 dwt/custom/DefaultContent.d --- a/dwt/custom/DefaultContent.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/custom/DefaultContent.d Sat Jul 26 13:29:11 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 91eec9fa94de -r 2443a18f96b8 dwt/custom/StyledText.d --- a/dwt/custom/StyledText.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/custom/StyledText.d Sat Jul 26 13:29:11 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 91eec9fa94de -r 2443a18f96b8 dwt/dwthelper/ByteArrayOutputStream.d --- a/dwt/dwthelper/ByteArrayOutputStream.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/dwthelper/ByteArrayOutputStream.d Sat Jul 26 13:29:11 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 91eec9fa94de -r 2443a18f96b8 dwt/dwthelper/File.d --- a/dwt/dwthelper/File.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/dwthelper/File.d Sat Jul 26 13:29:11 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 91eec9fa94de -r 2443a18f96b8 dwt/dwthelper/InflaterInputStream.d --- a/dwt/dwthelper/InflaterInputStream.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/dwthelper/InflaterInputStream.d Sat Jul 26 13:29:11 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 91eec9fa94de -r 2443a18f96b8 dwt/dwthelper/utils.d --- a/dwt/dwthelper/utils.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/dwthelper/utils.d Sat Jul 26 13:29:11 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 91eec9fa94de -r 2443a18f96b8 dwt/internal/gdip/Gdip.d --- a/dwt/internal/gdip/Gdip.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/internal/gdip/Gdip.d Sat Jul 26 13:29:11 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 ) ); + } + + /************************************************************************** + + **************************************************************************/ } diff -r 91eec9fa94de -r 2443a18f96b8 dwt/internal/win32/OS.d --- a/dwt/internal/win32/OS.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/internal/win32/OS.d Sat Jul 26 13:29:11 2008 +0200 @@ -22,7 +22,7 @@ else{ private import dwt.internal.win32.WINAPI; alias dwt.internal.win32.WINAPI WINAPI; - alias dwt.internal.win32.WINAPI USERGDIAPI; + alias dwt.internal.win32.WINAPI DWTWINAPI; } import dwt.internal.C; @@ -122,6 +122,24 @@ return lgid & 0x3FF; } + public static int LVITEM_sizeof(){ + return ( !OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION( 5, 1 )) ? LVITEM.sizeof : 40; + } + public static int MENUITEMINFO_sizeof(){ + return ( !OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION( 5, 0 )) ? MENUITEMINFO.sizeof : 44; + } + public static int NMLVCUSTOMDRAW_sizeof(){ + return ( !OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION( 5, 1 )) ? NMLVCUSTOMDRAW.sizeof : 60; + } + public static int NMLVDISPINFO_sizeof(){ + return ( !OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION( 5, 1 )) ? NMLVDISPINFO.sizeof : 52; + } + public static int OPENFILENAME_sizeof(){ + return ( !OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION( 5, 0 )) ? OPENFILENAME.sizeof : 76; + } + public static int TOOLINFO_sizeof(){ + return ( !OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION( 5, 1 )) ? TOOLINFO.sizeof : 44; + } // private static int getNOTIFYICONDATAA_V2_SIZE (){ // // hm, NOTIFYICONDATAA.dwInfoFlags.offsetof did not compile // return IsWinCE ? NOTIFYICONDATAA.sizeof : cast(int)(&(cast(NOTIFYICONDATAA*)null).dwInfoFlags) + int.sizeof; @@ -282,7 +300,7 @@ if (OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (5, 1)) { loadLib( Symbols_CoreImm, `Coreimm.dll` ); } - if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) { + if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (5, 0)) { loadLib( Symbols_User32, `User32.dll` ); } if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (4, 0)) { diff -r 91eec9fa94de -r 2443a18f96b8 dwt/internal/win32/WINAPI.d --- a/dwt/internal/win32/WINAPI.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/internal/win32/WINAPI.d Sat Jul 26 13:29:11 2008 +0200 @@ -303,7 +303,7 @@ // HWND FindTextA(LPFINDREPLACE); // HWND ReplaceTextA(LPFINDREPLACE); // WINBOOL ChooseFontA(LPCHOOSEFONT); -// WINBOOL PrintDlgA(LPPRINTDLG); + WINBOOL PrintDlgA(LPPRINTDLG); // WINBOOL PageSetupDlgA(LPPAGESETUPDLG); // WINBOOL CreateProcessA(LPCSTR, LPSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, WINBOOL, DWORD, LPVOID, LPCSTR, LPSTARTUPINFO, LPPROCESS_INFORMATION); // void GetStartupInfoA(LPSTARTUPINFO); @@ -695,7 +695,7 @@ // HWND ReplaceTextW(LPFINDREPLACE); // WINBOOL ChooseFontW(LPCHOOSEFONT); // HWND FindTextW(LPFINDREPLACE); -// WINBOOL PrintDlgW(LPPRINTDLG); + WINBOOL PrintDlgW(LPPRINTDLG); // WINBOOL PageSetupDlgW(LPPAGESETUPDLG); WINBOOL CreateProcessW(LPCWSTR, LPWSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, WINBOOL, DWORD, LPVOID, LPCWSTR, LPSTARTUPINFO, LPPROCESS_INFORMATION); void GetStartupInfoW(LPSTARTUPINFO); diff -r 91eec9fa94de -r 2443a18f96b8 dwt/internal/win32/WINTYPES.d --- a/dwt/internal/win32/WINTYPES.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/internal/win32/WINTYPES.d Sat Jul 26 13:29:11 2008 +0200 @@ -4,6 +4,7 @@ module dwt.internal.win32.WINTYPES; + /* adopted form tango Author: Trevor Parscal @@ -123,6 +124,7 @@ alias wchar* LPWSTR; alias wchar* NWPSTR; alias WINBOOL* PWINBOOL; +alias ubyte BOOLEAN; alias ubyte* PBOOLEAN; alias ubyte* PBYTE; alias PCHAR PCCH; @@ -6451,7 +6453,7 @@ alias BLOB TBLOB; alias BLOB* PBLOB; -struct SHITEMID +align(1) struct SHITEMID { USHORT cb; ubyte[1 + 0] abID; @@ -6539,7 +6541,7 @@ struct FIXED { ushort fract; - int value; + short value; } alias FIXED _FIXED; @@ -7076,9 +7078,10 @@ UINT CtlID; HWND hwndItem; UINT itemID1; - DWORD itemData1; + ULONG_PTR itemData1; UINT itemID2; - DWORD itemData2; + ULONG_PTR itemData2; + DWORD dwLocaleId; } alias COMPAREITEMSTRUCT TAGCOMPAREITEMSTRUCT; @@ -7261,25 +7264,26 @@ alias LIST_ENTRY TLISTENTRY; alias LIST_ENTRY* PLISTENTRY; -struct CRITICAL_SECTION_DEBUG -{ - ushort _Type; - ushort CreatorBackTraceIndex; +align(1) struct CRITICAL_SECTION_DEBUG +{ + WORD _Type; + WORD CreatorBackTraceIndex; _CRITICAL_SECTION* CriticalSection; LIST_ENTRY ProcessLocksList; DWORD EntryCount; DWORD ContentionCount; - DWORD Depth; - PVOID[1 + 4] OwnerBackTrace; + DWORD Flags; + WORD CreatorBackTraceIndexHigh; + WORD SpareWORD ; } alias CRITICAL_SECTION_DEBUG* LPCRITICAL_SECTION_DEBUG; -alias CRITICAL_SECTION_DEBUG PCRITICAL_SECTION_DEBUG; +alias CRITICAL_SECTION_DEBUG* PCRITICAL_SECTION_DEBUG; alias CRITICAL_SECTION_DEBUG _CRITICAL_SECTION_DEBUG; alias CRITICAL_SECTION_DEBUG TCRITICALSECTIONDEBUG; alias CRITICAL_SECTION_DEBUG* PCRITICALSECTIONDEBUG; -struct CRITICAL_SECTION +align(1) struct CRITICAL_SECTION { PCRITICAL_SECTION_DEBUG DebugInfo; LONG LockCount; @@ -7295,12 +7299,13 @@ alias CRITICAL_SECTION TCRITICALSECTION; alias CRITICAL_SECTION* PCRITICALSECTION; +alias ubyte SECURITY_CONTEXT_TRACKING_MODE; struct SECURITY_QUALITY_OF_SERVICE { DWORD Length; SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; - WINBOOL ContextTrackingMode; - ubyte EffectiveOnly; + SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode; + BOOLEAN EffectiveOnly; } alias SECURITY_QUALITY_OF_SERVICE* PSECURITY_QUALITY_OF_SERVICE; @@ -7498,7 +7503,7 @@ struct DDEADVISE { ushort flag0; - int cfFormat; + short cfFormat; } alias DDEADVISE TDDEADVISE; @@ -7515,7 +7520,7 @@ struct DDEDATA { ushort flag0; - int cfFormat; + short cfFormat; ubyte[1 + 0] Value; } @@ -7536,7 +7541,7 @@ struct DDELN { ushort flag0; - int cfFormat; + short cfFormat; } alias DDELN TDDELN; @@ -7567,7 +7572,7 @@ struct DDEPOKE { ushort flag0; - int cfFormat; + short cfFormat; ubyte[1 + 0] Value; } @@ -7584,7 +7589,7 @@ struct DDEUP { ushort flag0; - int cfFormat; + short cfFormat; ubyte[1 + 0] rgb; } @@ -7942,9 +7947,14 @@ LARGE_INTEGER BytesWritten; LARGE_INTEGER ReadTime; LARGE_INTEGER WriteTime; + LARGE_INTEGER IdleTime; DWORD ReadCount; DWORD WriteCount; DWORD QueueDepth; + DWORD SplitCount; + LARGE_INTEGER QueryTime; + DWORD StorageDeviceNumber; + WCHAR StorageManagerName[8]; } alias DISK_PERFORMANCE _DISK_PERFORMANCE; @@ -7955,11 +7965,11 @@ { DWORD style; DWORD dwExtendedStyle; - int x; - int y; - int cx; - int cy; - ushort id; + short x; + short y; + short cx; + short cy; + WORD id; } alias DLGITEMTEMPLATE* LPDLGITEMTEMPLATE; @@ -7970,11 +7980,11 @@ { DWORD style; DWORD dwExtendedStyle; - ushort cdit; - int x; - int y; - int cx; - int cy; + WORD cdit; + short x; + short y; + short cx; + short cy; } alias DLGTEMPLATE* LPDLGTEMPLATE; @@ -8233,6 +8243,7 @@ COLORREF crBkColorSrc; DWORD iUsageSrc; DWORD offBmiSrc; + DWORD cbBmiSrc; DWORD offBitsSrc; DWORD cbBitsSrc; } @@ -8265,7 +8276,7 @@ alias LONG LCSCSTYPE; alias LONG LCSGAMUTMATCH; -struct LOGCOLORSPACE +struct LOGCOLORSPACEA { DWORD lcsSignature; DWORD lcsVersion; @@ -8276,7 +8287,26 @@ DWORD lcsGammaRed; DWORD lcsGammaGreen; DWORD lcsGammaBlue; - TCHAR[1 + MAX_PATH-1] lcsFilename; + CHAR[1 + MAX_PATH-1] lcsFilename; +} +struct LOGCOLORSPACEW +{ + DWORD lcsSignature; + DWORD lcsVersion; + DWORD lcsSize; + LCSCSTYPE lcsCSType; + LCSGAMUTMATCH lcsIntent; + CIEXYZTRIPLE lcsEndpoints; + DWORD lcsGammaRed; + DWORD lcsGammaGreen; + DWORD lcsGammaBlue; + WCHAR[1 + MAX_PATH-1] lcsFilename; +} +version(Win32SansUnicode) { + alias LOGCOLORSPACEA LOGCOLORSPACE; +} +else { + alias LOGCOLORSPACEW LOGCOLORSPACE; } alias LOGCOLORSPACE* LPLOGCOLORSPACE; @@ -8285,11 +8315,10 @@ alias LOGCOLORSPACE TLOGCOLORSPACEA; alias LOGCOLORSPACE* PLOGCOLORSPACE; -struct EMRCREATECOLORSPACE -{ - EMR emr; - DWORD ihCS; - LOGCOLORSPACE lcs; +struct EMRCREATECOLORSPACE { + EMR emr; + DWORD ihCS; + LOGCOLORSPACEA lcs; } alias EMRCREATECOLORSPACE TAGEMRCREATECOLORSPACE; @@ -8443,8 +8472,8 @@ struct EXTLOGFONT { LOGFONT elfLogFont; - BCHAR[1 + LF_FULLFACESIZE-1] elfFullName; - BCHAR[1 + LF_FACESIZE-1] elfStyle; + TCHAR[1 + LF_FULLFACESIZE-1] elfFullName; + TCHAR[1 + LF_FACESIZE-1] elfStyle; DWORD elfVersion; DWORD elfStyleSize; DWORD elfMatch; @@ -8799,7 +8828,7 @@ EMR emr; RECTL rclBounds; DWORD cpts; - POINTL[1 + 0] apts; + POINTS[1 + 0] apts; } alias EMRPOLYLINE16 TAGEMRPOLYLINE16; @@ -9263,7 +9292,7 @@ alias ENOLEOPFAILED TENOLEOPFAILED; alias ENOLEOPFAILED* PENOLEOPFAILED; -struct ENHMETAHEADER +align(2) struct ENHMETAHEADER { DWORD iType; DWORD nSize; @@ -9280,6 +9309,14 @@ DWORD nPalEntries; SIZEL szlDevice; SIZEL szlMillimeters; +//#if (WINVER >= 0x0400) + DWORD cbPixelFormat; + DWORD offPixelFormat; + DWORD bOpenGL; +//#endif /* WINVER >= 0x0400 */ +//#if (WINVER >= 0x0500) + SIZEL szlMicrometers; +//#endif /* WINVER >= 0x0500 */ } alias ENHMETAHEADER* LPENHMETAHEADER; @@ -9502,6 +9539,7 @@ } alias TFINDTEXT _FINDTEXT; +alias TFINDTEXT FINDTEXT; alias TFINDTEXT* PFINDTEXT; struct FINDTEXTEX @@ -9669,8 +9707,8 @@ UINT gmBlackBoxX; UINT gmBlackBoxY; POINT gmptGlyphOrigin; - int gmCellIncX; - int gmCellIncY; + short gmCellIncX; + short gmCellIncY; } alias GLYPHMETRICS* LPGLYPHMETRICS; @@ -9708,6 +9746,14 @@ int cchTextMax; int fmt; LPARAM lParam; + // _WIN32_IE >= 0x300 + int iImage; + int iOrder; + // _WIN32_IE >= 0x500 + UINT type; + void* pvFilter; + // _WIN32_WINNT >= 0x600 + //UINT state; } alias HD_ITEM _HD_ITEM; @@ -10074,7 +10120,7 @@ struct LANA_ENUM { UCHAR length; - UCHAR[1 + MAX_LANA-1] lana; + UCHAR[1 + MAX_LANA] lana; } alias LANA_ENUM _LANA_ENUM; @@ -10162,7 +10208,10 @@ alias FXPT16DOT16* LPFXPT16DOT16; alias FXPT16DOT16 TFXPT16DOT16; alias FXPT16DOT16* PFXPT16DOT16; -alias LARGE_INTEGER LUID; +struct LUID { + DWORD LowPart; + LONG HighPart; +} alias LUID TLUID; alias LUID* PLUID; @@ -10180,32 +10229,104 @@ alias LUID_AND_ATTRIBUTES_ARRAY TLUIDANDATTRIBUTESARRAY; alias LUID_AND_ATTRIBUTES_ARRAY* PLUIDANDATTRIBUTESARRAY; -struct LV_COLUMN -{ +struct LVCOLUMNA { + UINT mask; + int fmt; + int cx; + LPSTR pszText; + int cchTextMax; + int iSubItem; + int iImage; + //if (_WIN32_IE >= 0x0300) + int iOrder; + //endif + //if (_WIN32_WINNT >= 0x0600) + //int cxMin; + //int cxDefault; + //int cxIdeal; + //endif +} +struct LVCOLUMNW { UINT mask; int fmt; int cx; - LPTSTR pszText; + LPWSTR pszText; int cchTextMax; int iSubItem; -} - + int iImage; + //if (_WIN32_IE >= 0x0300) + int iOrder; + //endif + //if (_WIN32_WINNT >= 0x0600) + //int cxMin; + //int cxDefault; + //int cxIdeal; + //endif +} +version(Win32SansUnicode){ + alias LVCOLUMNA LVCOLUMN; +}else{ + alias LVCOLUMNW LVCOLUMN; +} +alias LVCOLUMN* LPLVCOLUMN; +alias LVCOLUMN LV_COLUMN; alias LV_COLUMN _LV_COLUMN; alias LV_COLUMN TLVCOLUMN; alias LV_COLUMN* PLVCOLUMN; -struct LV_ITEM -{ - UINT mask; - int iItem; - int iSubItem; - UINT state; - UINT stateMask; - LPTSTR pszText; - int cchTextMax; - int iImage; +struct LVITEMA { + UINT mask; + int iItem; + int iSubItem; + UINT state; + UINT stateMask; + LPSTR pszText; + int cchTextMax; + int iImage; LPARAM lParam; -} +//if (_WIN32_IE >= 0x0300) + int iIndent; +//endif +//if (_WIN32_WINNT >= 0x560) + int iGroupId; + UINT cColumns; // tile view columns + PUINT puColumns; +//endif +//if (_WIN32_WINNT >= 0x0600) +// int* piColFmt; +// int iGroup; +//endif +} +struct LVITEMW { + UINT mask; + int iItem; + int iSubItem; + UINT state; + UINT stateMask; + LPWSTR pszText; + int cchTextMax; + int iImage; + LPARAM lParam; +//if (_WIN32_IE >= 0x0300) + int iIndent; +//endif +//if (_WIN32_WINNT >= 0x560) + int iGroupId; + UINT cColumns; // tile view columns + PUINT puColumns; +//endif +//if (_WIN32_WINNT >= 0x0600) +// int* piColFmt; +// int iGroup; +//endif +} +version(Win32SansUnicode){ + alias LVITEMA LVITEM; +}else{ + alias LVITEMW LVITEM; +} +alias LVITEM* LPLVITEM; +alias LVITEM LV_ITEM; alias LV_ITEM _LV_ITEM; alias LV_ITEM TLVITEM; @@ -10234,18 +10355,24 @@ alias LV_FINDINFO TLVFINDINFO; alias LV_FINDINFO* PLVFINDINFO; -struct LV_HITTESTINFO +struct LVHITTESTINFO { POINT pt; UINT flags; int iItem; -} + int iSubItem; +//#if _WIN32_WINNT >= 0x0600 +// int iGroup; +//#endif +} + +alias LVHITTESTINFO LV_HITTESTINFO; alias LV_HITTESTINFO _LV_HITTESTINFO; alias LV_HITTESTINFO TLVHITTESTINFO; alias LV_HITTESTINFO* PLVHITTESTINFO; -struct LV_KEYDOWN +align(2) struct LV_KEYDOWN { NMHDR hdr; ushort wVKey; @@ -11003,6 +11130,52 @@ alias TVITEM TV_ITEM; alias TVITEM* PTVITEM; +struct TVITEMEXA { + UINT mask; + HTREEITEM hItem; + UINT state; + UINT stateMask; + LPSTR pszText; + int cchTextMax; + int iImage; + int iSelectedImage; + int cChildren; + LPARAM lParam; + int iIntegral; +//#if (_WIN32_IE >= 0x0600) +// UINT uStateEx; +// HWND hwnd; +// int iExpandedImage; +//#endif +} +struct TVITEMEXW { + UINT mask; + HTREEITEM hItem; + UINT state; + UINT stateMask; + LPWSTR pszText; + int cchTextMax; + int iImage; + int iSelectedImage; + int cChildren; + LPARAM lParam; + int iIntegral; +//#if (_WIN32_IE >= 0x0600) +// UINT uStateEx; +// HWND hwnd; +// int iExpandedImage; +//#endif +} +version(Win32SansUnicode) +{ + alias TVITEMEXA TVITEMEX; +} +else +{ + alias TVITEMEXW TVITEMEX; +} +alias TVITEMEX * LPTVITEMEX; + struct NMTREEVIEW { NMHDR hdr; @@ -11046,6 +11219,10 @@ LOGFONTA lfMenuFont; LOGFONTA lfStatusFont; LOGFONTA lfMessageFont; +//if (WINVER >= 0x0600) +// int iPaddedBorderWidth; +//endif + } struct NONCLIENTMETRICSW { int cbSize; @@ -11063,6 +11240,9 @@ LOGFONTW lfMenuFont; LOGFONTW lfStatusFont; LOGFONTW lfMessageFont; +//if (WINVER >= 0x0600) +// int iPaddedBorderWidth; +//endif } version(Win32SansUnicode) { @@ -11213,6 +11393,11 @@ DWORD lCustData; LPOFNHOOKPROC lpfnHook; LPCTSTR lpTemplateName; +//if (_WIN32_WINNT >= 0x0500) + void * pvReserved; + DWORD dwReserved; + DWORD FlagsEx; +//endif // (_WIN32_WINNT >= 0x0500) } alias OPENFILENAME* LPOPENFILENAME; @@ -11269,7 +11454,6 @@ alias OSVERSIONINFO* POSVERSIONINFO; struct TEXTMETRICA { - align(1): LONG tmHeight; LONG tmAscent; LONG tmDescent; @@ -11294,7 +11478,6 @@ BYTE tmCharSet; } struct TEXTMETRICW { - align(1): LONG tmHeight; LONG tmAscent; LONG tmDescent; @@ -11449,6 +11632,7 @@ HGLOBAL hPageSetupTemplate; } +alias TPAGESETUPDLG PAGESETUPDLG; alias TPAGESETUPDLG* LPPAGESETUPDLG; alias TPAGESETUPDLG* PPAGESETUPDLG; alias TPAGESETUPDLG TAGPSD; @@ -11619,8 +11803,7 @@ alias PREVENT_MEDIA_REMOVAL TPREVENTMEDIAREMOVAL; alias PREVENT_MEDIA_REMOVAL* PPREVENTMEDIAREMOVAL; -struct PRINTDLGA { // pd - align(2): +align(2) struct PRINTDLGA { // pd DWORD lStructSize; HWND hwndOwner; HANDLE hDevMode; @@ -11643,8 +11826,7 @@ } alias PRINTDLGA* PPRINTDLGA; alias PRINTDLGA* LPPRINTDLGA; -struct PRINTDLGW { // pd - align(2): +align(2) struct PRINTDLGW { // pd DWORD lStructSize; HWND hwndOwner; HANDLE hDevMode; @@ -11888,52 +12070,32 @@ extern(Windows){alias UINT (*LPFNPSPCALLBACK)(HWND, UINT, LPVOID);} alias LPFNPSPCALLBACK TFNPSPCALLBACK; -struct PROPSHEETPAGE_U1 -{ - - union - { - struct - { - LPCTSTR pszTemplate; - } - struct - { - LPCDLGTEMPLATE pResource; - } - } -} - - -struct PROPSHEETPAGE_U2 -{ - - union - { - struct - { - HICON hIcon; - } - struct - { - LPCTSTR pszIcon; - } - } -} - struct PROPSHEETPAGE { DWORD dwSize; DWORD dwFlags; HINST hInstance; - PROPSHEETPAGE_U1 u1; - PROPSHEETPAGE_U2 u2; + union { + LPCTSTR pszTemplate; + LPCDLGTEMPLATE pResource; + } + union { + HICON hIcon; + LPCTSTR pszIcon; + } LPCTSTR pszTitle; DLGPROC pfnDlgProc; LPARAM lParam; LPFNPSPCALLBACK pfnCallback; UINT* pcRefParent; +//if (_WIN32_IE >= 0x0500) + LPCTSTR pszHeaderTitle; + LPCTSTR pszHeaderSubTitle; +//endif +//if (_WIN32_WINNT >= 0x0501) + HANDLE hActCtx; +//endif } alias PROPSHEETPAGE* LPPROPSHEETPAGE; @@ -12011,6 +12173,17 @@ PROPSHEETHEADER_U2 u2; PROPSHEETHEADER_U3 u3; PFNPROPSHEETCALLBACK pfnCallback; +//if (_WIN32_IE >= 0x0400) + union { + HBITMAP hbmWatermark; + LPCTSTR pszbmWatermark; + } + HPALETTE hplWatermark; + union { + HBITMAP hbmHeader; + LPCSTR pszbmHeader; + } +//endif } alias PROPSHEETHEADER* LPPROPSHEETHEADER; @@ -12182,7 +12355,7 @@ { DWORD dwSize; DWORD dwError; - TCHAR[1 + (RAS_MaxIpAddress+1)-1] szIpAddress; + TCHAR[RAS_MaxIpAddress+1] szIpAddress; } alias RASPPPIP _RASPPPIP; @@ -12216,9 +12389,9 @@ struct RASTERIZER_STATUS { - int nSize; - int wFlags; - int nLanguageID; + short nSize; + short wFlags; + short nLanguageID; } alias RASTERIZER_STATUS* LPRASTERIZER_STATUS; @@ -12345,6 +12518,7 @@ LPSTR lpszPort; DWORD iBaudRate; DWORD iPortState; + UINT iActive; } alias SERIALKEYS* LPSERIALKEYS; @@ -12459,7 +12633,7 @@ alias FILEOP_FLAGS TFILEOPFLAGS; alias FILEOP_FLAGS* PFILEOPFLAGS; -struct SHFILEOPSTRUCT +align(2) struct SHFILEOPSTRUCT { HWND hwnd; UINT wFunc; @@ -12604,7 +12778,7 @@ struct STYLEBUF { DWORD dwStyle; - char[1 + 31] szDescription; + TCHAR[1 + 31] szDescription; } alias STYLEBUF* LPSTYLEBUF; @@ -12634,36 +12808,23 @@ alias SYSTEM_AUDIT_ACE TSYSTEMAUDITACE; alias SYSTEM_AUDIT_ACE* PSYSTEMAUDITACE; -struct SYSTEM_INFO_U -{ - - union - { - struct - { - DWORD dwOemId; - } - struct - { - ushort wProcessorArchitecture; - ushort wReserved; +struct SYSTEM_INFO { + union { + DWORD dwOemId; + struct { + WORD wProcessorArchitecture; + WORD wReserved; } } -} - - -struct SYSTEM_INFO -{ - SYSTEM_INFO_U u; DWORD dwPageSize; LPVOID lpMinimumApplicationAddress; LPVOID lpMaximumApplicationAddress; - DWORD dwActiveProcessorMask; + DWORD_PTR dwActiveProcessorMask; DWORD dwNumberOfProcessors; DWORD dwProcessorType; DWORD dwAllocationGranularity; - ushort wProcessorLevel; - ushort wProcessorRevision; + WORD wProcessorLevel; + WORD wProcessorRevision; } alias SYSTEM_INFO* LPSYSTEM_INFO; @@ -12688,7 +12849,8 @@ struct TAPE_ERASE { - ULONG _Type; + DWORD Type; + BOOLEAN Immediate; } alias TAPE_ERASE _TAPE_ERASE; @@ -12741,7 +12903,8 @@ struct TAPE_PREPARE { - ULONG Operation; + DWORD Operation; + BOOLEAN Immediate; } alias TAPE_PREPARE _TAPE_PREPARE; @@ -12774,8 +12937,8 @@ { ULONG Method; ULONG Partition; - ULONG OffsetLow; - ULONG OffsetHigh; + LARGE_INTEGER Offset; + BOOLEAN Immediate; } alias TAPE_SET_POSITION _TAPE_SET_POSITION; @@ -12786,6 +12949,7 @@ { ULONG _Type; ULONG Count; + BOOLEAN Immediate; } alias TAPE_WRITE_MARKS _TAPE_WRITE_MARKS; @@ -12809,9 +12973,9 @@ BYTE fsState; BYTE fsStyle; //#ifdef _WIN64 -// BYTE bReserved[6] // padding for alignment +// BYTE bReserved[6]; // padding for alignment //#elif defined(_WIN32) -// BYTE bReserved[2] // padding for alignment + BYTE bReserved[2]; // padding for alignment //#endif DWORD_PTR dwData; INT_PTR iString; @@ -12823,14 +12987,32 @@ alias TBBUTTON TTBBUTTON; alias TBBUTTON* PTBBUTTON; -struct TBNOTIFY -{ - NMHDR hdr; - int iItem; +struct NMTOOLBARA { + align(2): + NMHDR hdr; + int iItem; TBBUTTON tbButton; - int cchText; - LPTSTR pszText; -} + int cchText; + LPSTR pszText; + RECT rcButton; +} +struct NMTOOLBARW { + align(2): + NMHDR hdr; + int iItem; + TBBUTTON tbButton; + int cchText; + LPWSTR pszText; + RECT rcButton; +} +version(Win32SansUnicode){ + alias NMTOOLBARA NMTOOLBAR; +}else{ + alias NMTOOLBARW NMTOOLBAR; +} +alias NMTOOLBAR* LPNMTOOLBAR; + +alias NMTOOLBAR TBNOTIFY; alias TBNOTIFY* LPTBNOTIFY; alias TBNOTIFY TTBNOTIFY; @@ -12886,13 +13068,14 @@ alias TC_ITEMHEADER TTCITEMHEADER; alias TC_ITEMHEADER* PTCITEMHEADER; -struct TC_KEYDOWN +align(1) struct NMTCKEYDOWN { NMHDR hdr; - ushort wVKey; + WORD wVKey; UINT flags; } +alias NMTCKEYDOWN TC_KEYDOWN; alias TC_KEYDOWN _TC_KEYDOWN; alias TC_KEYDOWN TTCKEYDOWN; alias TC_KEYDOWN* PTCKEYDOWN; @@ -12997,7 +13180,7 @@ struct TOKEN_PRIVILEGES { DWORD PrivilegeCount; - LUID_AND_ATTRIBUTES[1 + ANYSIZE_ARRAY-1] Privileges; + LUID_AND_ATTRIBUTES[ANYSIZE_ARRAY] Privileges; } alias TOKEN_PRIVILEGES* PTOKEN_PRIVILEGES; @@ -13042,6 +13225,12 @@ RECT rect; HINST hinst; LPSTR lpszText; +//if (_WIN32_IE >= 0x0300) + LPARAM lParam; +//endif +//if (_WIN32_WINNT >= 0x0501) + void *lpReserved; +//endif } struct TOOLINFOW { @@ -13052,6 +13241,13 @@ RECT rect; HINST hinst; LPWSTR lpszText; +//if (_WIN32_IE >= 0x0300) + LPARAM lParam; +//endif +//if (_WIN32_WINNT >= 0x0501) + void *lpReserved; +//endif + } version(Win32SansUnicode) { @@ -13065,22 +13261,32 @@ alias TOOLINFO TTOOLINFO; alias TOOLINFO* PTOOLINFO; -struct TOOLTIPTEXTA -{ +struct NMTTDISPINFOA { NMHDR hdr; LPSTR lpszText; - CHAR[80] szText; - HINST hinst; + char szText[80]; + HINSTANCE hinst; UINT uFlags; -} -struct TOOLTIPTEXTW -{ + LPARAM lParam; +} + +struct NMTTDISPINFOW { NMHDR hdr; LPWSTR lpszText; - WCHAR[80] szText; - HINST hinst; + WCHAR szText[80]; + HINSTANCE hinst; UINT uFlags; -} + LPARAM lParam; +} +version(Win32SansUnicode){ + alias NMTTDISPINFOA NMTTDISPINFO; +} else { + alias NMTTDISPINFOW NMTTDISPINFO; +} + + +alias NMTTDISPINFOA TOOLTIPTEXTA; +alias NMTTDISPINFOW TOOLTIPTEXTW; version(Win32SansUnicode) { alias TOOLTIPTEXTA TOOLTIPTEXT; @@ -13178,13 +13384,19 @@ { HTREEITEM hParent; HTREEITEM hInsertAfter; - TVITEMA item; + union { + TVITEMEXA itemex; + TVITEMA item; + } } struct TVINSERTSTRUCTW { HTREEITEM hParent; HTREEITEM hInsertAfter; - TVITEMW item; + union { + TVITEMEXW itemex; + TVITEMW item; + } } version(Win32SansUnicode) { @@ -13201,7 +13413,7 @@ alias TVINSERTSTRUCT TTVINSERTSTRUCT; alias TVINSERTSTRUCT* PTVINSERTSTRUCT; -struct TV_KEYDOWN +align(2) struct TV_KEYDOWN { NMHDR hdr; ushort wVKey; @@ -13830,6 +14042,7 @@ alias TVARIANT VARIANT; alias int MMRESULT; alias TWAVEFORMATEX* PWAVEFORMATEX; +alias TWAVEFORMATEX WAVEFORMATEX; align(1) struct TWAVEFORMATEX { @@ -13881,7 +14094,7 @@ alias HANDLE HMONITOR; -struct tagMONITORINFOEX +struct MONITORINFOEX { DWORD cbSize; RECT rcMonitor; @@ -13889,17 +14102,15 @@ DWORD dwFlags; TCHAR szDevice[CCHDEVICENAME]; } -alias tagMONITORINFOEX MONITORINFOEX; alias MONITORINFOEX* LPMONITORINFOEX; -struct tagMONITORINFO +struct MONITORINFO { DWORD cbSize; RECT rcMonitor; RECT rcWork; DWORD dwFlags; } -alias tagMONITORINFO MONITORINFO; alias MONITORINFO* LPMONITORINFO; struct WINDOWINFO @@ -14061,6 +14272,8 @@ NMHDR hdr; TVITEM item; } + +// only on Vista struct NMTVITEMCHANGE { NMHDR hdr; UINT uChanged; @@ -14519,8 +14732,17 @@ int cchTextMax; int fmt; LPARAM lParam; +//#if (_WIN32_IE >= 0x0300) int iImage; int iOrder; +//#endif +//#if (_WIN32_IE >= 0x0500) + UINT type; + void *pvFilter; +//#endif +//#if _WIN32_WINNT >= 0x0600 +// UINT state; +//#endif } struct HDITEMW { UINT mask; @@ -14530,8 +14752,17 @@ int cchTextMax; int fmt; LPARAM lParam; +//#if (_WIN32_IE >= 0x0300) int iImage; int iOrder; +//#endif +//#if (_WIN32_IE >= 0x0500) + UINT type; + void *pvFilter; +//#endif +//#if _WIN32_WINNT >= 0x0600 +// UINT state; +//#endif } version(Win32SansUnicode){ alias HDITEMA HDITEM; @@ -14586,32 +14817,6 @@ // } -struct LVCOLUMNA { - UINT mask; - int fmt; - int cx; - LPSTR pszText; - int cchTextMax; - int iSubItem; - int iImage; - int iOrder; -} -struct LVCOLUMNW { - UINT mask; - int fmt; - int cx; - LPWSTR pszText; - int cchTextMax; - int iSubItem; - int iImage; - int iOrder; -} -version(Win32SansUnicode){ - alias LVCOLUMNA LVCOLUMN; -}else{ - alias LVCOLUMNW LVCOLUMN; -} -alias LVCOLUMN* LPLVCOLUMN; struct LVFINDINFOA { UINT flags; @@ -14636,45 +14841,6 @@ alias LVFINDINFOW LVFINDINFO; } -struct LVHITTESTINFO -{ - POINT pt; - UINT flags; - int iItem; - int iSubItem; -} - - -struct LVITEMA { - UINT mask; - int iItem; - int iSubItem; - UINT state; - UINT stateMask; - LPSTR pszText; - int cchTextMax; - int iImage; - LPARAM lParam; - int iIndent; -} -struct LVITEMW { - UINT mask; - int iItem; - int iSubItem; - UINT state; - UINT stateMask; - LPWSTR pszText; - int cchTextMax; - int iImage; - LPARAM lParam; - int iIndent; -} -version(Win32SansUnicode){ - alias LVITEMA LVITEM; -}else{ - alias LVITEMW LVITEM; -} -alias LVITEM* LPLVITEM; struct MARGINS { int cxLeftWidth; @@ -14688,9 +14854,12 @@ RECT rcBar; HMENU hMenu; HWND hwndMenu; - BOOL fBarFocused; - BOOL fFocused; -}alias MENUBARINFO* PMENUBARINFO, LPMENUBARINFO; + BOOL flags; + //fBarFocused : 1; + //fFocused : 1; +} +alias MENUBARINFO* PMENUBARINFO; +alias MENUBARINFO* LPMENUBARINFO; struct MENUINFO { DWORD cbSize; @@ -14880,6 +15049,18 @@ //#if (_WIN32_IE >= 0x0400) int iSubItem; //#endif +//if (_WIN32_IE >= 0x560) + DWORD dwItemType; + // Item Custom Draw + COLORREF clrFace; + int iIconEffect; + int iIconPhase; + int iPartId; + int iStateId; + // Group Custom Draw + RECT rcText; + UINT uAlign; +//endif } struct NMLVDISPINFOA { @@ -14933,52 +15114,7 @@ int y; int dwItemSpec; } -struct NMTOOLBARA { - align(2): - NMHDR hdr; - int iItem; - TBBUTTON tbButton; - int cchText; - LPSTR pszText; -} -struct NMTOOLBARW { - align(2): - NMHDR hdr; - int iItem; - TBBUTTON tbButton; - int cchText; - LPWSTR pszText; -} -version(Win32SansUnicode){ - alias NMTOOLBARA NMTOOLBAR; -}else{ - alias NMTOOLBARW NMTOOLBAR; -} -alias NMTOOLBAR* LPNMTOOLBAR; - - -struct NMTTDISPINFOA { - NMHDR hdr; - LPSTR lpszText; - char szText[80]; - HINSTANCE hinst; - UINT uFlags; - LPARAM lParam; -} - -struct NMTTDISPINFOW { - NMHDR hdr; - LPWSTR lpszText; - WCHAR szText[80]; - HINSTANCE hinst; - UINT uFlags; - LPARAM lParam; -} -version(Win32SansUnicode){ - alias NMTTDISPINFOA NMTTDISPINFO; -} else { - alias NMTTDISPINFOW NMTTDISPINFO; -} + struct NMTVCUSTOMDRAW { NMCUSTOMDRAW nmcd; @@ -15007,8 +15143,8 @@ }; char szInfoTitle[64] = '\0'; DWORD dwInfoFlags; - //GUID guidItem; - //HICON hBalloonIcon; + GUID guidItem; + HICON hBalloonIcon; } alias NOTIFYICONDATAA* PNOTIFYICONDATAA, LPNOTIFYICONDATAA; struct NOTIFYICONDATAW { @@ -15028,8 +15164,8 @@ } WCHAR szInfoTitle[64] = '\0'; DWORD dwInfoFlags; - //GUID guidItem; - //HICON hBalloonIcon; + GUID guidItem; + HICON hBalloonIcon; } alias NOTIFYICONDATAW* PNOTIFYICONDATAW, LPNOTIFYICONDATAW; @@ -15127,6 +15263,7 @@ UINT cx; HBITMAP hbmBack; UINT wID; +//if (_WIN32_IE >= 0x0400) UINT cyChild; UINT cyMaxChild; UINT cyIntegral; @@ -15134,6 +15271,11 @@ LPARAM lParam; UINT cxHeader; /* Note in WinCE. The field cxHeader is not defined. */ +//endif +//if (_WIN32_WINNT >= 0x0600) +// RECT rcChevronLocation; +// UINT uChevronState; +//endif } struct REBARBANDINFOW { UINT cbSize; @@ -15150,6 +15292,7 @@ UINT cx; HBITMAP hbmBack; UINT wID; +//if (_WIN32_IE >= 0x0400) UINT cyChild; UINT cyMaxChild; UINT cyIntegral; @@ -15157,6 +15300,11 @@ LPARAM lParam; UINT cxHeader; /* Note in WinCE. The field cxHeader is not defined. */ +//endif +//if (_WIN32_WINNT >= 0x0600) +// RECT rcChevronLocation; +// UINT uChevronState; +//endif } version(Win32SansUnicode){ alias REBARBANDINFOA REBARBANDINFO; @@ -15518,6 +15666,7 @@ LPSTR pszText; int cchTextMax; int iImage; + LPARAM lParam; } struct TCITEMW { UINT mask; diff -r 91eec9fa94de -r 2443a18f96b8 dwt/ole/win32/OleFrame.d --- a/dwt/ole/win32/OleFrame.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/ole/win32/OleFrame.d Sat Jul 26 13:29:11 2008 +0200 @@ -399,7 +399,7 @@ private int getMenuItemID(HMENU hMenu, int index) { int id = 0; MENUITEMINFO lpmii; - lpmii.cbSize = MENUITEMINFO.sizeof; + lpmii.cbSize = OS.MENUITEMINFO_sizeof; lpmii.fMask = OS.MIIM_STATE | OS.MIIM_SUBMENU | OS.MIIM_ID; OS.GetMenuItemInfo(hMenu, index, true, &lpmii); if ((lpmii.fState & OS.MF_POPUP) is OS.MF_POPUP) { @@ -450,7 +450,7 @@ int cch = 128; int byteCount = cch * TCHAR.sizeof; auto pszText = cast(TCHAR*) OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, byteCount); - lpmii.cbSize = MENUITEMINFO.sizeof; + lpmii.cbSize = OS.MENUITEMINFO_sizeof; lpmii.fMask = OS.MIIM_STATE | OS.MIIM_ID | OS.MIIM_TYPE | OS.MIIM_SUBMENU | OS.MIIM_DATA; lpmii.dwTypeData = pszText; lpmii.cch = cch; diff -r 91eec9fa94de -r 2443a18f96b8 dwt/widgets/Control.d --- a/dwt/widgets/Control.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/widgets/Control.d Sat Jul 26 13:29:11 2008 +0200 @@ -4276,7 +4276,7 @@ if ((code & OS.MF_POPUP) !is 0) { int index = OS.LOWORD (wParam); MENUITEMINFO info; - info.cbSize = MENUITEMINFO.sizeof; + info.cbSize = OS.MENUITEMINFO_sizeof; info.fMask = OS.MIIM_SUBMENU; if (OS.GetMenuItemInfo (cast(HANDLE)lParam, index, true, &info)) { Menu newMenu = menuShell.findMenu (info.hSubMenu); diff -r 91eec9fa94de -r 2443a18f96b8 dwt/widgets/Decorations.d --- a/dwt/widgets/Decorations.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/widgets/Decorations.d Sat Jul 26 13:29:11 2008 +0200 @@ -1304,7 +1304,7 @@ if ((style & DWT.CLOSE) is 0 || newCount !is oldCount) { OS.DeleteMenu (hMenu, OS.SC_TASKLIST, OS.MF_BYCOMMAND); MENUITEMINFO info; - info.cbSize = MENUITEMINFO.sizeof; + info.cbSize = OS.MENUITEMINFO_sizeof; info.fMask = OS.MIIM_ID; int index = 0; while (index < newCount) { diff -r 91eec9fa94de -r 2443a18f96b8 dwt/widgets/Display.d --- a/dwt/widgets/Display.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/widgets/Display.d Sat Jul 26 13:29:11 2008 +0200 @@ -4617,7 +4617,7 @@ switch (hdr.code) { case OS.LVN_GETDISPINFOA: case OS.LVN_GETDISPINFOW: { - OS.MoveMemory (plvfi, lParam, NMLVDISPINFO.sizeof); + OS.MoveMemory (plvfi, lParam, OS.NMLVDISPINFO_sizeof); if (0 <= plvfi.item.iSubItem && plvfi.item.iSubItem < columnCount) { if (!columnVisible [plvfi.item.iSubItem]) return 0; } diff -r 91eec9fa94de -r 2443a18f96b8 dwt/widgets/FileDialog.d --- a/dwt/widgets/FileDialog.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/widgets/FileDialog.d Sat Jul 26 13:29:11 2008 +0200 @@ -209,7 +209,7 @@ if (lResult > 0) { lResult += OS.MAX_PATH; OPENFILENAME* lpofn = ofn.lpOFN; - //OS.MoveMemory (lpofn, ofn.lpOFN, OPENFILENAME.sizeof); + //OS.MoveMemory (lpofn, ofn.lpOFN, OS.OPENFILENAME_sizeof); if (lpofn.nMaxFile < lResult) { auto hHeap = OS.GetProcessHeap (); auto lpstrFile = cast(TCHAR*) OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, lResult * TCHAR.sizeof); @@ -217,7 +217,7 @@ if (lpofn.lpstrFile !is null) OS.HeapFree (hHeap, 0, lpofn.lpstrFile); lpofn.lpstrFile = lpstrFile; lpofn.nMaxFile = lResult; - //OS.MoveMemory (ofn.lpOFN, lpofn, OPENFILENAME.sizeof); + //OS.MoveMemory (ofn.lpOFN, lpofn, OS.OPENFILENAME_sizeof); } } } @@ -331,7 +331,7 @@ /* Create the file dialog struct */ OPENFILENAME struct_; - struct_.lStructSize = OPENFILENAME.sizeof; + struct_.lStructSize = OS.OPENFILENAME_sizeof; struct_.Flags = OS.OFN_HIDEREADONLY | OS.OFN_NOCHANGEDIR; bool save = (style & DWT.SAVE) !is 0; if (save && overwrite) struct_.Flags |= OS.OFN_OVERWRITEPROMPT; diff -r 91eec9fa94de -r 2443a18f96b8 dwt/widgets/Menu.d --- a/dwt/widgets/Menu.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/widgets/Menu.d Sat Jul 26 13:29:11 2008 +0200 @@ -487,7 +487,7 @@ success = OS.InsertMenu (handle, index, uFlags, item.id, lpNewItem); if (success) { MENUITEMINFO info = new MENUITEMINFO (); - info.cbSize = MENUITEMINFO.sizeof; + info.cbSize = OS.MENUITEMINFO_sizeof; info.fMask = OS.MIIM_DATA; info.dwItemData = item.id; success = OS.SetMenuItemInfo (handle, index, true, info); @@ -511,7 +511,7 @@ auto pszText = cast(TCHAR*) OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount); OS.MoveMemory (pszText, buffer.ptr, byteCount); MENUITEMINFO info; - info.cbSize = MENUITEMINFO.sizeof; + info.cbSize = OS.MENUITEMINFO_sizeof; info.fMask = OS.MIIM_ID | OS.MIIM_TYPE | OS.MIIM_DATA; info.wID = item.id; info.dwItemData = item.id; @@ -582,7 +582,7 @@ } else { int index = 0; MENUITEMINFO info; - info.cbSize = MENUITEMINFO.sizeof; + info.cbSize = OS.MENUITEMINFO_sizeof; info.fMask = OS.MIIM_DATA; while (OS.GetMenuItemInfo (handle, index, true, &info)) { if (info.dwItemData is item.id) break; @@ -736,7 +736,7 @@ int id = OS.GetMenuDefaultItem (handle, OS.MF_BYCOMMAND, OS.GMDI_USEDISABLED); if (id is -1) return null; MENUITEMINFO info; - info.cbSize = MENUITEMINFO.sizeof; + info.cbSize = OS.MENUITEMINFO_sizeof; info.fMask = OS.MIIM_ID; if (OS.GetMenuItemInfo (handle, id, false, &info)) { return display.getMenuItem (info.wID); @@ -810,7 +810,7 @@ } } else { MENUITEMINFO info; - info.cbSize = MENUITEMINFO.sizeof; + info.cbSize = OS.MENUITEMINFO_sizeof; info.fMask = OS.MIIM_DATA; if (!OS.GetMenuItemInfo (handle, index, true, &info)) { error (DWT.ERROR_INVALID_RANGE); @@ -873,7 +873,7 @@ int length = OS.IsWinCE ? 4 : OS.GetMenuItemCount (handle); MenuItem [] items = new MenuItem [length]; MENUITEMINFO info; - info.cbSize = MENUITEMINFO.sizeof; + info.cbSize = OS.MENUITEMINFO_sizeof; info.fMask = OS.MIIM_DATA; while (OS.GetMenuItemInfo (handle, index, true, &info)) { if (count is items.length) { @@ -898,7 +898,7 @@ } int count = 0; MENUITEMINFO info; - info.cbSize = MENUITEMINFO.sizeof; + info.cbSize = OS.MENUITEMINFO_sizeof; while (OS.GetMenuItemInfo (handle, count, true, &info)) count++; return count; } @@ -1078,7 +1078,7 @@ } int index = 0; MENUITEMINFO info; - info.cbSize = MENUITEMINFO.sizeof; + info.cbSize = OS.MENUITEMINFO_sizeof; info.fMask = OS.MIIM_DATA; while (OS.GetMenuItemInfo (handle, index, true, &info)) { if (info.dwItemData is item.id) return index; @@ -1525,7 +1525,7 @@ if (!OS.IsWin95) { if (OS.WIN32_VERSION < OS.VERSION (6, 0)) { MENUITEMINFO info; - info.cbSize = MENUITEMINFO.sizeof; + info.cbSize = OS.MENUITEMINFO_sizeof; info.fMask = OS.MIIM_BITMAP; for (int i=0; i= 6) { if (toolTipHandle_ is null) return; TOOLINFO lpti; - lpti.cbSize = TOOLINFO.sizeof; + lpti.cbSize = OS.TOOLINFO_sizeof; if (OS.SendMessage (toolTipHandle_, OS.TTM_GETCURRENTTOOL, 0, &lpti) !is 0) { if ((lpti.uFlags & OS.TTF_IDISHWND) !is 0) { OS.SendMessage (toolTipHandle_, OS.TTM_DELTOOL, 0, &lpti); @@ -939,7 +939,7 @@ if (hwndToolTip is null) return null; if (OS.SendMessage (hwndToolTip, OS.TTM_GETCURRENTTOOL, 0, 0) !is 0) { TOOLINFO lpti; - lpti.cbSize = TOOLINFO.sizeof; + lpti.cbSize = OS.TOOLINFO_sizeof; if (OS.SendMessage (hwndToolTip, OS.TTM_GETCURRENTTOOL, 0, &lpti) !is 0) { if ((lpti.uFlags & OS.TTF_IDISHWND) is 0) return findToolTip (lpti.uId); } @@ -1675,7 +1675,7 @@ void setToolTipText (HWND hwnd, String text) { static if (OS.IsWinCE) return; TOOLINFO lpti; - lpti.cbSize = TOOLINFO.sizeof; + lpti.cbSize = OS.TOOLINFO_sizeof; lpti.hwnd = handle; lpti.uId = cast(uint) hwnd; auto hwndToolTip = toolTipHandle (); diff -r 91eec9fa94de -r 2443a18f96b8 dwt/widgets/TabFolder.d --- a/dwt/widgets/TabFolder.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/widgets/TabFolder.d Sat Jul 26 13:29:11 2008 +0200 @@ -851,7 +851,7 @@ */ if (OS.COMCTL32_MAJOR >= 6) { TOOLINFO lpti; - lpti.cbSize = TOOLINFO.sizeof; + lpti.cbSize = OS.TOOLINFO_sizeof; auto hwndToolTip = cast(HWND) OS.SendMessage (handle, OS.TCM_GETTOOLTIPS, 0, 0); if (OS.SendMessage (hwndToolTip, OS.TTM_GETCURRENTTOOL, 0, &lpti) !is 0) { if ((lpti.uFlags & OS.TTF_IDISHWND) is 0) { diff -r 91eec9fa94de -r 2443a18f96b8 dwt/widgets/Table.d --- a/dwt/widgets/Table.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/widgets/Table.d Sat Jul 26 13:29:11 2008 +0200 @@ -546,7 +546,7 @@ if ((dwExStyle & OS.LVS_EX_FULLROWSELECT) is 0) { if ((nmcd.nmcd.uItemState & OS.CDIS_FOCUS) !is 0) { nmcd.nmcd.uItemState &= ~OS.CDIS_FOCUS; - OS.MoveMemory (cast(NMLVCUSTOMDRAW*)lParam, nmcd, NMLVCUSTOMDRAW.sizeof); + OS.MoveMemory (cast(NMLVCUSTOMDRAW*)lParam, nmcd, OS.NMLVCUSTOMDRAW_sizeof); } } } @@ -899,7 +899,7 @@ } else { nmcd.clrTextBk = selectionForeground !is -1 ? OS.CLR_NONE : clrTextBk; } - OS.MoveMemory (lParam, nmcd, NMLVCUSTOMDRAW.sizeof); + OS.MoveMemory (lParam, nmcd, OS.NMLVCUSTOMDRAW_sizeof); } code |= OS.CDRF_NEWFONT; } @@ -942,7 +942,7 @@ nmcd.clrTextBk = OS.GetSysColor (OS.COLOR_3DFACE); } nmcd.nmcd.uItemState &= ~OS.CDIS_SELECTED; - OS.MoveMemory (lParam, nmcd, NMLVCUSTOMDRAW.sizeof); + OS.MoveMemory (lParam, nmcd, OS.NMLVCUSTOMDRAW_sizeof); code |= OS.CDRF_NEWFONT; } return new LRESULT (code); @@ -1596,7 +1596,7 @@ auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0); if (OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, &rect) !is 0) { TOOLINFO lpti; - lpti.cbSize = TOOLINFO.sizeof; + lpti.cbSize = OS.TOOLINFO_sizeof; lpti.uFlags = OS.TTF_SUBCLASS; lpti.hwnd = hwndHeader; lpti.uId = column.id = display.nextToolTipId++; @@ -1987,7 +1987,7 @@ /* Remove the tool tip item for the header */ if (headerToolTipHandle !is null) { TOOLINFO lpti; - lpti.cbSize = TOOLINFO.sizeof; + lpti.cbSize = OS.TOOLINFO_sizeof; lpti.uId = column.id; lpti.hwnd = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0); OS.SendMessage (headerToolTipHandle, OS.TTM_DELTOOL, 0, &lpti); @@ -3385,12 +3385,12 @@ selectionForeground = clrSelectionText; } nmcd.nmcd.uItemState &= ~OS.CDIS_SELECTED; - OS.MoveMemory (lParam, nmcd, NMLVCUSTOMDRAW.sizeof); + OS.MoveMemory (lParam, nmcd, OS.NMLVCUSTOMDRAW_sizeof); } } else { if (ignoreDrawSelection) { nmcd.nmcd.uItemState |= OS.CDIS_SELECTED; - OS.MoveMemory (lParam, nmcd, NMLVCUSTOMDRAW.sizeof); + OS.MoveMemory (lParam, nmcd, OS.NMLVCUSTOMDRAW_sizeof); } } @@ -3412,7 +3412,7 @@ } if (!ignoreDrawFocus) { nmcd.nmcd.uItemState &= ~OS.CDIS_FOCUS; - OS.MoveMemory (cast(void*)lParam, &nmcd, NMLVCUSTOMDRAW.sizeof); + OS.MoveMemory (cast(void*)lParam, &nmcd, OS.NMLVCUSTOMDRAW_sizeof); focusRect = new RECT; *focusRect = textRect; } @@ -3450,7 +3450,7 @@ } if (focused && ignoreDrawFocus) { nmcd.nmcd.uItemState &= ~OS.CDIS_FOCUS; - OS.MoveMemory (lParam, nmcd, NMLVCUSTOMDRAW.sizeof); + OS.MoveMemory (lParam, nmcd, OS.NMLVCUSTOMDRAW_sizeof); } if (ignoreDrawForeground) { RECT clipRect = item.getBounds (nmcd.nmcd.dwItemSpec, nmcd.iSubItem, true, true, true, false, hDC); @@ -5282,7 +5282,7 @@ auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0); RECT rect; TOOLINFO lpti; - lpti.cbSize = TOOLINFO.sizeof; + lpti.cbSize = OS.TOOLINFO_sizeof; lpti.uFlags = OS.TTF_SUBCLASS; lpti.hwnd = hwndHeader; lpti.lpszText = OS.LPSTR_TEXTCALLBACK; @@ -6293,7 +6293,7 @@ case OS.LVN_GETDISPINFOW: { // if (drawCount !is 0 || !OS.IsWindowVisible (handle)) break; NMLVDISPINFO* plvfi = cast(NMLVDISPINFO*)lParam; - //OS.MoveMemory (plvfi, lParam, NMLVDISPINFO.sizeof); + //OS.MoveMemory (plvfi, lParam, OS.NMLVDISPINFO_sizeof); bool [] visible = display.columnVisible; if (visible !is null && !visible [plvfi.item.iSubItem]) { @@ -6418,7 +6418,7 @@ move = true; } } - //if (move) OS.MoveMemory (lParam, plvfi, NMLVDISPINFO.sizeof); + //if (move) OS.MoveMemory (lParam, plvfi, OS.NMLVDISPINFO_sizeof); break; } case OS.NM_CUSTOMDRAW: { @@ -6441,7 +6441,7 @@ } } NMLVCUSTOMDRAW* nmcd = cast(NMLVCUSTOMDRAW*)lParam; - //OS.MoveMemory (nmcd, lParam, NMLVCUSTOMDRAW.sizeof); + //OS.MoveMemory (nmcd, lParam, OS.NMLVCUSTOMDRAW_sizeof); switch (nmcd.nmcd.dwDrawStage) { case OS.CDDS_PREPAINT: return CDDS_PREPAINT (nmcd, wParam, lParam); case OS.CDDS_ITEMPREPAINT: return CDDS_ITEMPREPAINT (nmcd, wParam, lParam); diff -r 91eec9fa94de -r 2443a18f96b8 dwt/widgets/TableColumn.d --- a/dwt/widgets/TableColumn.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/widgets/TableColumn.d Sat Jul 26 13:29:11 2008 +0200 @@ -872,7 +872,7 @@ RECT rect; if (OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, &rect) !is 0) { TOOLINFO lpti; - lpti.cbSize = TOOLINFO.sizeof; + lpti.cbSize = OS.TOOLINFO_sizeof; lpti.hwnd = hwndHeader; lpti.uId = id; lpti.rect.left = rect.left; diff -r 91eec9fa94de -r 2443a18f96b8 dwt/widgets/ToolBar.d --- a/dwt/widgets/ToolBar.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/widgets/ToolBar.d Sat Jul 26 13:29:11 2008 +0200 @@ -1209,7 +1209,7 @@ */ if (OS.COMCTL32_MAJOR >= 6) { TOOLINFO lpti; - lpti.cbSize = TOOLINFO.sizeof; + lpti.cbSize = OS.TOOLINFO_sizeof; auto hwndToolTip = cast(HWND) OS.SendMessage (handle, OS.TB_GETTOOLTIPS, 0, 0); if (OS.SendMessage (hwndToolTip, OS.TTM_GETCURRENTTOOL, 0, &lpti) !is 0) { if ((lpti.uFlags & OS.TTF_IDISHWND) is 0) { diff -r 91eec9fa94de -r 2443a18f96b8 dwt/widgets/ToolTip.d --- a/dwt/widgets/ToolTip.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/widgets/ToolTip.d Sat Jul 26 13:29:11 2008 +0200 @@ -229,7 +229,7 @@ auto hwndToolTip_ = hwndToolTip (); if (OS.SendMessage (hwndToolTip_, OS.TTM_GETCURRENTTOOL, 0, 0) !is 0) { TOOLINFO lpti; - lpti.cbSize = TOOLINFO.sizeof; + lpti.cbSize = OS.TOOLINFO_sizeof; if (OS.SendMessage (hwndToolTip_, OS.TTM_GETCURRENTTOOL, 0, &lpti) !is 0) { return (lpti.uFlags & OS.TTF_IDISHWND) is 0 && lpti.uId is id; } @@ -275,7 +275,7 @@ auto hwndToolTip_ = hwndToolTip (); if (OS.SendMessage (hwndToolTip_, OS.TTM_GETCURRENTTOOL, 0, 0) !is 0) { TOOLINFO lpti; - lpti.cbSize = TOOLINFO.sizeof; + lpti.cbSize = OS.TOOLINFO_sizeof; if (OS.SendMessage (hwndToolTip_, OS.TTM_GETCURRENTTOOL, 0, &lpti) !is 0) { if ((lpti.uFlags & OS.TTF_IDISHWND) is 0) { if (lpti.uId is id) { @@ -452,7 +452,7 @@ if (item is null) { auto hwnd = parent.handle; TOOLINFO lpti; - lpti.cbSize = TOOLINFO.sizeof; + lpti.cbSize = OS.TOOLINFO_sizeof; lpti.uId = id; lpti.hwnd = hwnd; auto hwndToolTip_ = hwndToolTip (); diff -r 91eec9fa94de -r 2443a18f96b8 dwt/widgets/Tree.d --- a/dwt/widgets/Tree.d Mon Jul 21 22:36:02 2008 +0200 +++ b/dwt/widgets/Tree.d Sat Jul 26 13:29:11 2008 +0200 @@ -2080,7 +2080,7 @@ RECT rect; if (OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, &rect) !is 0) { TOOLINFO lpti; - lpti.cbSize = TOOLINFO.sizeof; + lpti.cbSize = OS.TOOLINFO_sizeof; lpti.uFlags = OS.TTF_SUBCLASS; lpti.hwnd = hwndHeader; lpti.uId = column.id = display.nextToolTipId++; @@ -2249,7 +2249,7 @@ if (itemToolTipHandle is null) error (DWT.ERROR_NO_HANDLES); OS.SendMessage (itemToolTipHandle, OS.TTM_SETDELAYTIME, OS.TTDT_INITIAL, 0); TOOLINFO lpti; - lpti.cbSize = TOOLINFO.sizeof; + lpti.cbSize = OS.TOOLINFO_sizeof; lpti.hwnd = handle; lpti.uId = cast(int)handle; lpti.uFlags = OS.TTF_SUBCLASS | OS.TTF_TRANSPARENT; @@ -2565,7 +2565,7 @@ /* Remove the tool tip item for the header */ if (headerToolTipHandle !is null) { TOOLINFO lpti; - lpti.cbSize = TOOLINFO.sizeof; + lpti.cbSize = OS.TOOLINFO_sizeof; lpti.uId = column.id; lpti.hwnd = hwndHeader; OS.SendMessage (headerToolTipHandle, OS.TTM_DELTOOL, 0, &lpti); @@ -5466,7 +5466,7 @@ if (headerToolTipHandle is null) return; RECT rect; TOOLINFO lpti; - lpti.cbSize = TOOLINFO.sizeof; + lpti.cbSize = OS.TOOLINFO_sizeof; lpti.uFlags = OS.TTF_SUBCLASS; lpti.hwnd = hwndHeader; lpti.lpszText = OS.LPSTR_TEXTCALLBACK; @@ -6690,7 +6690,7 @@ } } TOOLINFO lpti; - lpti.cbSize = TOOLINFO.sizeof; + lpti.cbSize = OS.TOOLINFO_sizeof; lpti.hwnd = handle; lpti.uId = cast(int) handle; lpti.uFlags = OS.TTF_SUBCLASS | OS.TTF_TRANSPARENT; @@ -7732,7 +7732,7 @@ } if (OS.SendMessage (itemToolTipHandle, OS.TTM_GETCURRENTTOOL, 0, 0) !is 0) { TOOLINFO lpti; - lpti.cbSize = TOOLINFO.sizeof; + lpti.cbSize = OS.TOOLINFO_sizeof; if (OS.SendMessage (itemToolTipHandle, OS.TTM_GETCURRENTTOOL, 0, cast(int)&lpti) !is 0) { int index; TreeItem item;