Show
Ignore:
Timestamp:
07/25/08 20:48:20 (6 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

Removed version=TANGOSVN for release 0.99.7

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/internal/gdip/Gdip.d

    r253 r264  
    99 *    IBM Corporation - initial API and implementation 
    1010 * Port to the D programming language: 
    11  *       John Reimer <terminal.node@gmail.com> 
     11 *   John Reimer <terminal.node@gmail.com> 
    1212 *    Frank Benoit <benoit@tionex.de> 
    1313 *******************************************************************************/ 
     
    4747        } 
    4848    } 
    49    /************************************************************************** 
    50  
    51    **************************************************************************/ 
     49    /************************************************************************** 
     50 
     51    **************************************************************************/ 
    5252 
    5353private: 
    5454 
    55    static FontFamily GenericSansSerifFontFamily = null; 
    56    static FontFamily GenericSerifFontFamily     = null; 
    57    static FontFamily GenericMonospaceFontFamily = null; 
    58  
    59    /************************************************************************** 
    60  
    61    **************************************************************************/ 
    62  
    63    struct FontFamily_T 
    64    
    65        Handle  nativeFamily; 
    66        Status  lastResult; 
    67    
    68  
    69    struct StringFormat_T 
    70    
    71  
    72        StringFormat format; 
    73        Status  lastError; 
    74    
    75  
    76    static ubyte GenericTypographicStringFormatBuffer[StringFormat_T.sizeof] = 0; 
    77    static ubyte GenericDefaultStringFormatBuffer [StringFormat_T.sizeof] = 0; 
    78    static ubyte GenericSansSerifFontFamilyBuffer [FontFamily_T.sizeof] = 0; 
    79    static ubyte GenericSerifFontFamilyBuffer     [FontFamily_T.sizeof] = 0; 
    80    static ubyte GenericMonospaceFontFamilyBuffer [FontFamily_T.sizeof] = 0; 
    81  
    82    /************************************************************************** 
    83  
    84    **************************************************************************/ 
     55    static FontFamily GenericSansSerifFontFamily = null; 
     56    static FontFamily GenericSerifFontFamily     = null; 
     57    static FontFamily GenericMonospaceFontFamily = null; 
     58 
     59    /************************************************************************** 
     60 
     61    **************************************************************************/ 
     62 
     63    struct FontFamily_T 
     64   
     65        Handle  nativeFamily; 
     66        Status  lastResult; 
     67   
     68 
     69    struct StringFormat_T 
     70   
     71 
     72        StringFormat format; 
     73        Status  lastError; 
     74   
     75 
     76    static ubyte GenericTypographicStringFormatBuffer[StringFormat_T.sizeof] = 0; 
     77    static ubyte GenericDefaultStringFormatBuffer [StringFormat_T.sizeof] = 0; 
     78    static ubyte GenericSansSerifFontFamilyBuffer [FontFamily_T.sizeof] = 0; 
     79    static ubyte GenericSerifFontFamilyBuffer     [FontFamily_T.sizeof] = 0; 
     80    static ubyte GenericMonospaceFontFamilyBuffer [FontFamily_T.sizeof] = 0; 
     81 
     82    /************************************************************************** 
     83 
     84    **************************************************************************/ 
    8585 
    8686public: 
    8787 
    88    alias GpPoint           Point; 
    89    alias GpPointF          PointF; 
    90    alias GpRect            Rect; 
    91    alias GpRectF           RectF; 
    92    alias GpBitmapData      BitmapData; 
    93    alias GpColorPalette    ColorPalette; 
    94    alias GpDrawImageAbort  DrawImageAbort; 
    95    alias GpColorMatrix     ColorMatrix; 
    96  
    97    alias GpFontFamily          FontFamily; 
    98    alias GpImage               Image; 
    99    alias GpBrush               Brush; 
    100    alias GpFont                Font; 
    101    alias GpFontCollection      FontCollection; 
    102    alias GpGraphics            Graphics; 
    103    alias GpGraphicsPath        GraphicsPath; 
    104    alias GpImageAttributes     ImageAttributes; 
    105    alias GpHatchBrush          HatchBrush; 
    106    alias GpLinearGradientBrush LinearGradientBrush; 
    107    alias GpMatrix              Matrix; 
    108    alias GpPen                 Pen; 
    109    alias GpRegion              Region; 
    110    alias GpSolidBrush          SolidBrush; 
    111    alias GpStringFormat        StringFormat; 
    112    alias GpTextureBrush        TextureBrush; 
    113    alias GpPath                Path; 
    114  
    115    alias Image  Bitmap; 
    116  
    117    alias  uint ARGB; 
    118  
    119    alias dwt.internal.gdip.native.GdiplusStartupInput  GdiplusStartupInput; 
    120    alias dwt.internal.gdip.native.GdiplusStartupOutput GdiplusStartupOutput; 
    121  
    122    /************************************************************************** 
    123  
    124        Gdi+ Constants 
    125  
    126    **************************************************************************/ 
    127  
    128    enum { 
    129        BrushTypeSolidColor = 0, 
    130        BrushTypeHatchFill = 1, 
    131        BrushTypeTextureFill = 2, 
    132        BrushTypePathGradient = 3, 
    133        BrushTypeLinearGradient = 4, 
    134        //  ColorAdjustTypeBitmap = 1, 
    135        ColorMatrixFlagsDefault = 0, 
    136        CombineModeReplace = 0, 
    137        CombineModeIntersect = 1, 
    138        CombineModeUnion = 2, 
    139        CombineModeXor = 3, 
    140        CombineModeExclude = 4, 
    141        CombineModeComplement = 5, 
    142        FillModeAlternate = 0, 
    143        FillModeWinding = 1, 
    144        DashCapFlat = 0, 
    145        DashCapRound = 2, 
    146        DashCapTriangle = 3, 
    147        DashStyleSolid = 0, 
    148        DashStyleDash = 1, 
    149        DashStyleDot = 2, 
    150        DashStyleDashDot = 3, 
    151        DashStyleDashDotDot = 4, 
    152        DashStyleCustom = 5, 
    153        FontStyleRegular = 0, 
    154        FontStyleBold = 1, 
    155        FontStyleItalic = 2, 
    156        FontStyleBoldItalic = 3, 
    157        FontStyleUnderline = 4, 
    158        FontStyleStrikeout = 8, 
    159        PaletteFlagsHasAlpha = 0x0001, 
    160        FlushIntentionFlush = 0, 
    161        FlushIntentionSync = 1, 
    162        HotkeyPrefixNone = 0, 
    163        HotkeyPrefixShow = 1, 
    164        HotkeyPrefixHide = 2, 
    165        LineJoinMiter = 0, 
    166        LineJoinBevel = 1, 
    167        LineJoinRound = 2, 
    168        LineCapFlat = 0, 
    169        LineCapSquare = 1, 
    170        LineCapRound = 2, 
    171        MatrixOrderPrepend = 0, 
    172        MatrixOrderAppend = 1, 
    173        QualityModeDefault = 0, 
    174        QualityModeLow = 1, 
    175        QualityModeHigh = 2, 
    176        InterpolationModeInvalid = -1, 
    177        InterpolationModeDefault = QualityModeDefault, 
    178        InterpolationModeLowQuality = QualityModeLow, 
    179        InterpolationModeHighQuality = QualityModeHigh, 
    180        InterpolationModeBilinear = QualityModeHigh + 1, 
    181        InterpolationModeBicubic = QualityModeHigh + 2, 
    182        InterpolationModeNearestNeighbor = QualityModeHigh + 3, 
    183        InterpolationModeHighQualityBilinear = QualityModeHigh + 4, 
    184        InterpolationModeHighQualityBicubic = QualityModeHigh + 5, 
    185        PathPointTypeStart = 0, 
    186        PathPointTypeLine = 1, 
    187        PathPointTypeBezier = 3, 
    188        PathPointTypePathTypeMask = 0x7, 
    189        PathPointTypePathDashMode = 0x10, 
    190        PathPointTypePathMarker = 0x20, 
    191        PathPointTypeCloseSubpath = 0x80, 
    192        PathPointTypeBezier3 = 3, 
    193        PixelFormatIndexed = 0x00010000, 
    194        PixelFormatGDI = 0x00020000, 
    195        PixelFormatAlpha = 0x00040000, 
    196        PixelFormatPAlpha = 0x00080000, 
    197        PixelFormatExtended = 0x00100000, 
    198        PixelFormatCanonical = 0x00200000, 
    199        PixelFormat1bppIndexed = (1 | ( 1 << 8) | PixelFormatIndexed | PixelFormatGDI), 
    200        PixelFormat4bppIndexed = (2 | ( 4 << 8) | PixelFormatIndexed | PixelFormatGDI), 
    201        PixelFormat8bppIndexed = (3 | ( 8 << 8) | PixelFormatIndexed | PixelFormatGDI), 
    202        PixelFormat16bppGrayScale = (4 | (16 << 8) | PixelFormatExtended), 
    203        PixelFormat16bppRGB555 = (5 | (16 << 8) | PixelFormatGDI), 
    204        PixelFormat16bppRGB565 = (6 | (16 << 8) | PixelFormatGDI), 
    205        PixelFormat16bppARGB1555 = (7 | (16 << 8) | PixelFormatAlpha | PixelFormatGDI), 
    206        PixelFormat24bppRGB = (8 | (24 << 8) | PixelFormatGDI), 
    207        PixelFormat32bppRGB = (9 | (32 << 8) | PixelFormatGDI), 
    208        PixelFormat32bppARGB = (10 | (32 << 8) | PixelFormatAlpha | PixelFormatGDI | PixelFormatCanonical), 
    209        PixelFormat32bppPARGB = (11 | (32 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatGDI), 
    210        PixelFormat48bppRGB = (12 | (48 << 8) | PixelFormatExtended), 
    211        PixelFormat64bppARGB = (13 | (64 << 8) | PixelFormatAlpha  | PixelFormatCanonical | PixelFormatExtended), 
    212        PixelFormat64bppPARGB = (14 | (64 << 8) | PixelFormatAlpha  | PixelFormatPAlpha | PixelFormatExtended), 
    213        PixelFormatMax = 15, 
    214        PixelOffsetModeNone = QualityModeHigh + 1, 
    215        PixelOffsetModeHalf = QualityModeHigh + 2, 
    216        SmoothingModeInvalid = -1, 
    217        SmoothingModeDefault = QualityModeDefault, 
    218        SmoothingModeHighSpeed = QualityModeLow, 
    219        SmoothingModeHighQuality = QualityModeHigh, 
    220        SmoothingModeNone = 3, 
    221        SmoothingModeAntiAlias8x4 = 4, 
    222        SmoothingModeAntiAlias = SmoothingModeAntiAlias8x4, 
    223        SmoothingModeAntiAlias8x8 = 5, 
    224        StringFormatFlagsDirectionRightToLeft = 0x00000001, 
    225        StringFormatFlagsDirectionVertical = 0x00000002, 
    226        StringFormatFlagsNoFitBlackBox = 0x00000004, 
    227        StringFormatFlagsDisplayFormatControl = 0x00000020, 
    228        StringFormatFlagsNoFontFallback = 0x00000400, 
    229        StringFormatFlagsMeasureTrailingSpaces = 0x00000800, 
    230        StringFormatFlagsNoWrap = 0x00001000, 
    231        StringFormatFlagsLineLimit = 0x00002000, 
    232        StringFormatFlagsNoClip = 0x00004000, 
    233        TextRenderingHintSystemDefault = 0, 
    234        TextRenderingHintSingleBitPerPixelGridFit = 1, 
    235        TextRenderingHintSingleBitPerPixel = 2, 
    236        TextRenderingHintAntiAliasGridFit = 3, 
    237        TextRenderingHintAntiAlias = 4, 
    238        TextRenderingHintClearTypeGridFit = 5, 
    239        //  UnitPixel = 2, 
    240        WrapModeTile = 0, 
    241        WrapModeTileFlipX = 1, 
    242        WrapModeTileFlipY = 2, 
    243        WrapModeTileFlipXY = 3, 
    244        WrapModeClamp = 4 
    245    
    246  
    247    enum 
    248    
    249        PenTypeSolidColor       = BrushTypeSolidColor, 
    250        PenTypeHatchFill        = BrushTypeHatchFill, 
    251        PenTypeTextureFill      = BrushTypeTextureFill, 
    252        PenTypePathGradient     = BrushTypePathGradient, 
    253        PenTypeLinearGradient   = BrushTypeLinearGradient, 
    254        PenTypeUnknown          = -1 
    255    
    256  
    257    enum 
    258    
    259        UnitWorld,      // 0 -- World coordinate (non-physical unit) 
    260        UnitDisplay,    // 1 -- Variable -- for PageTransform only 
    261        UnitPixel,      // 2 -- Each unit is one device pixel. 
    262        UnitPoint,      // 3 -- Each unit is a printer's point, or 1/72 inch. 
    263        UnitInch,       // 4 -- Each unit is 1 inch. 
    264        UnitDocument,   // 5 -- Each unit is 1/300 inch. 
    265        UnitMillimeter  // 6 -- Each unit is 1 millimeter. 
    266    
    267  
    268    enum 
     88    alias GpPoint           Point; 
     89    alias GpPointF          PointF; 
     90    alias GpRect            Rect; 
     91    alias GpRectF           RectF; 
     92    alias GpBitmapData      BitmapData; 
     93    alias GpColorPalette    ColorPalette; 
     94    alias GpDrawImageAbort  DrawImageAbort; 
     95    alias GpColorMatrix     ColorMatrix; 
     96 
     97    alias GpFontFamily          FontFamily; 
     98    alias GpImage               Image; 
     99    alias GpBrush               Brush; 
     100    alias GpFont                Font; 
     101    alias GpFontCollection      FontCollection; 
     102    alias GpGraphics            Graphics; 
     103    alias GpGraphicsPath        GraphicsPath; 
     104    alias GpImageAttributes     ImageAttributes; 
     105    alias GpHatchBrush          HatchBrush; 
     106    alias GpLinearGradientBrush LinearGradientBrush; 
     107    alias GpMatrix              Matrix; 
     108    alias GpPen                 Pen; 
     109    alias GpRegion              Region; 
     110    alias GpSolidBrush          SolidBrush; 
     111    alias GpStringFormat        StringFormat; 
     112    alias GpTextureBrush        TextureBrush; 
     113    alias GpPath                Path; 
     114 
     115    alias Image  Bitmap; 
     116 
     117    alias  uint ARGB; 
     118 
     119    alias dwt.internal.gdip.native.GdiplusStartupInput  GdiplusStartupInput; 
     120    alias dwt.internal.gdip.native.GdiplusStartupOutput GdiplusStartupOutput; 
     121 
     122    /************************************************************************** 
     123 
     124        Gdi+ Constants 
     125 
     126    **************************************************************************/ 
     127 
     128    enum { 
     129        BrushTypeSolidColor = 0, 
     130        BrushTypeHatchFill = 1, 
     131        BrushTypeTextureFill = 2, 
     132        BrushTypePathGradient = 3, 
     133        BrushTypeLinearGradient = 4, 
     134        //  ColorAdjustTypeBitmap = 1, 
     135        ColorMatrixFlagsDefault = 0, 
     136        CombineModeReplace = 0, 
     137        CombineModeIntersect = 1, 
     138        CombineModeUnion = 2, 
     139        CombineModeXor = 3, 
     140        CombineModeExclude = 4, 
     141        CombineModeComplement = 5, 
     142        FillModeAlternate = 0, 
     143        FillModeWinding = 1, 
     144        DashCapFlat = 0, 
     145        DashCapRound = 2, 
     146        DashCapTriangle = 3, 
     147        DashStyleSolid = 0, 
     148        DashStyleDash = 1, 
     149        DashStyleDot = 2, 
     150        DashStyleDashDot = 3, 
     151        DashStyleDashDotDot = 4, 
     152        DashStyleCustom = 5, 
     153        FontStyleRegular = 0, 
     154        FontStyleBold = 1, 
     155        FontStyleItalic = 2, 
     156        FontStyleBoldItalic = 3, 
     157        FontStyleUnderline = 4, 
     158        FontStyleStrikeout = 8, 
     159        PaletteFlagsHasAlpha = 0x0001, 
     160        FlushIntentionFlush = 0, 
     161        FlushIntentionSync = 1, 
     162        HotkeyPrefixNone = 0, 
     163        HotkeyPrefixShow = 1, 
     164        HotkeyPrefixHide = 2, 
     165        LineJoinMiter = 0, 
     166        LineJoinBevel = 1, 
     167        LineJoinRound = 2, 
     168        LineCapFlat = 0, 
     169        LineCapSquare = 1, 
     170        LineCapRound = 2, 
     171        MatrixOrderPrepend = 0, 
     172        MatrixOrderAppend = 1, 
     173        QualityModeDefault = 0, 
     174        QualityModeLow = 1, 
     175        QualityModeHigh = 2, 
     176        InterpolationModeInvalid = -1, 
     177        InterpolationModeDefault = QualityModeDefault, 
     178        InterpolationModeLowQuality = QualityModeLow, 
     179        InterpolationModeHighQuality = QualityModeHigh, 
     180        InterpolationModeBilinear = QualityModeHigh + 1, 
     181        InterpolationModeBicubic = QualityModeHigh + 2, 
     182        InterpolationModeNearestNeighbor = QualityModeHigh + 3, 
     183        InterpolationModeHighQualityBilinear = QualityModeHigh + 4, 
     184        InterpolationModeHighQualityBicubic = QualityModeHigh + 5, 
     185        PathPointTypeStart = 0, 
     186        PathPointTypeLine = 1, 
     187        PathPointTypeBezier = 3, 
     188        PathPointTypePathTypeMask = 0x7, 
     189        PathPointTypePathDashMode = 0x10, 
     190        PathPointTypePathMarker = 0x20, 
     191        PathPointTypeCloseSubpath = 0x80, 
     192        PathPointTypeBezier3 = 3, 
     193        PixelFormatIndexed = 0x00010000, 
     194        PixelFormatGDI = 0x00020000, 
     195        PixelFormatAlpha = 0x00040000, 
     196        PixelFormatPAlpha = 0x00080000, 
     197        PixelFormatExtended = 0x00100000, 
     198        PixelFormatCanonical = 0x00200000, 
     199        PixelFormat1bppIndexed = (1 | ( 1 << 8) | PixelFormatIndexed | PixelFormatGDI), 
     200        PixelFormat4bppIndexed = (2 | ( 4 << 8) | PixelFormatIndexed | PixelFormatGDI), 
     201        PixelFormat8bppIndexed = (3 | ( 8 << 8) | PixelFormatIndexed | PixelFormatGDI), 
     202        PixelFormat16bppGrayScale = (4 | (16 << 8) | PixelFormatExtended), 
     203        PixelFormat16bppRGB555 = (5 | (16 << 8) | PixelFormatGDI), 
     204        PixelFormat16bppRGB565 = (6 | (16 << 8) | PixelFormatGDI), 
     205        PixelFormat16bppARGB1555 = (7 | (16 << 8) | PixelFormatAlpha | PixelFormatGDI), 
     206        PixelFormat24bppRGB = (8 | (24 << 8) | PixelFormatGDI), 
     207        PixelFormat32bppRGB = (9 | (32 << 8) | PixelFormatGDI), 
     208        PixelFormat32bppARGB = (10 | (32 << 8) | PixelFormatAlpha | PixelFormatGDI | PixelFormatCanonical), 
     209        PixelFormat32bppPARGB = (11 | (32 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatGDI), 
     210        PixelFormat48bppRGB = (12 | (48 << 8) | PixelFormatExtended), 
     211        PixelFormat64bppARGB = (13 | (64 << 8) | PixelFormatAlpha  | PixelFormatCanonical | PixelFormatExtended), 
     212        PixelFormat64bppPARGB = (14 | (64 << 8) | PixelFormatAlpha  | PixelFormatPAlpha | PixelFormatExtended), 
     213        PixelFormatMax = 15, 
     214        PixelOffsetModeNone = QualityModeHigh + 1, 
     215        PixelOffsetModeHalf = QualityModeHigh + 2, 
     216        SmoothingModeInvalid = -1, 
     217        SmoothingModeDefault = QualityModeDefault, 
     218        SmoothingModeHighSpeed = QualityModeLow, 
     219        SmoothingModeHighQuality = QualityModeHigh, 
     220        SmoothingModeNone = 3, 
     221        SmoothingModeAntiAlias8x4 = 4, 
     222        SmoothingModeAntiAlias = SmoothingModeAntiAlias8x4, 
     223        SmoothingModeAntiAlias8x8 = 5, 
     224        StringFormatFlagsDirectionRightToLeft = 0x00000001, 
     225        StringFormatFlagsDirectionVertical = 0x00000002, 
     226        StringFormatFlagsNoFitBlackBox = 0x00000004, 
     227        StringFormatFlagsDisplayFormatControl = 0x00000020, 
     228        StringFormatFlagsNoFontFallback = 0x00000400, 
     229        StringFormatFlagsMeasureTrailingSpaces = 0x00000800, 
     230        StringFormatFlagsNoWrap = 0x00001000, 
     231        StringFormatFlagsLineLimit = 0x00002000, 
     232        StringFormatFlagsNoClip = 0x00004000, 
     233        TextRenderingHintSystemDefault = 0, 
     234        TextRenderingHintSingleBitPerPixelGridFit = 1, 
     235        TextRenderingHintSingleBitPerPixel = 2, 
     236        TextRenderingHintAntiAliasGridFit = 3, 
     237        TextRenderingHintAntiAlias = 4, 
     238        TextRenderingHintClearTypeGridFit = 5, 
     239        //  UnitPixel = 2, 
     240        WrapModeTile = 0, 
     241        WrapModeTileFlipX = 1, 
     242        WrapModeTileFlipY = 2, 
     243        WrapModeTileFlipXY = 3, 
     244        WrapModeClamp = 4 
     245   
     246 
     247    enum 
     248   
     249        PenTypeSolidColor       = BrushTypeSolidColor, 
     250        PenTypeHatchFill        = BrushTypeHatchFill, 
     251        PenTypeTextureFill      = BrushTypeTextureFill, 
     252        PenTypePathGradient     = BrushTypePathGradient, 
     253        PenTypeLinearGradient   = BrushTypeLinearGradient, 
     254        PenTypeUnknown          = -1 
     255   
     256 
     257    enum 
     258   
     259        UnitWorld,      // 0 -- World coordinate (non-physical unit) 
     260        UnitDisplay,    // 1 -- Variable -- for PageTransform only 
     261        UnitPixel,      // 2 -- Each unit is one device pixel. 
     262        UnitPoint,      // 3 -- Each unit is a printer's point, or 1/72 inch. 
     263        UnitInch,       // 4 -- Each unit is 1 inch. 
     264        UnitDocument,   // 5 -- Each unit is 1/300 inch. 
     265        UnitMillimeter  // 6 -- Each unit is 1 millimeter. 
     266   
     267 
     268    enum 
    269269    { 
    270270        AliceBlue            = 0xFFF0F8FF, 
     
    429429    } 
    430430 
    431    enum 
    432    
    433        ColorAdjustTypeDefault, 
    434        ColorAdjustTypeBitmap, 
    435        ColorAdjustTypeBrush, 
    436        ColorAdjustTypePen, 
    437        ColorAdjustTypeText, 
    438        ColorAdjustTypeCount, 
    439        ColorAdjustTypeAny      // Reserved 
    440    
    441  
    442    static ARGB MakeARGB( ubyte a, 
     431    enum 
     432   
     433        ColorAdjustTypeDefault, 
     434        ColorAdjustTypeBitmap, 
     435        ColorAdjustTypeBrush, 
     436        ColorAdjustTypePen, 
     437        ColorAdjustTypeText, 
     438        ColorAdjustTypeCount, 
     439        ColorAdjustTypeAny      // Reserved 
     440   
     441 
     442    static ARGB MakeARGB( ubyte a, 
    443443                          ubyte r, 
    444444                          ubyte g, 
     
    453453/************************************************************************** 
    454454 
    455    Error Status control 
     455    Error Status control 
    456456 
    457457**************************************************************************/ 
     
    469469/************************************************************************** 
    470470 
    471    GDI+ Bitmap Wrap Interface 
     471    GDI+ Bitmap Wrap Interface 
    472472 
    473473**************************************************************************/ 
     
    475475public: 
    476476 
    477    static void BitmapData_delete (BitmapData* bitmapdata) 
    478    
    479        delete bitmapdata; 
    480    
    481  
    482    /************************************************************************** 
    483  
    484    **************************************************************************/ 
    485  
    486    static BitmapData* BitmapData_new() 
    487    
    488        return new BitmapData; 
    489    
    490  
    491    /************************************************************************** 
    492  
    493    **************************************************************************/ 
    494  
    495    static int Bitmap_GetHBITMAP( Bitmap bitmap, ARGB colorBackground, 
    496                                        out HBITMAP hbmReturn                ) 
    497    
    498        return SetStatus( GdipCreateHBITMAPFromBitmap( bitmap, hbmReturn, 
    499                                                       colorBackground ) ); 
    500    
    501  
    502    /************************************************************************** 
    503  
    504    **************************************************************************/ 
    505  
    506    static int Bitmap_GetHICON( Bitmap bitmap, out HICON hIconReturn) 
    507    
    508        return SetStatus( GdipCreateHICONFromBitmap( bitmap, hIconReturn ) ); 
    509    
    510  
    511    /************************************************************************** 
    512  
    513    **************************************************************************/ 
    514  
    515    static int Bitmap_LockBits( Bitmap bitmap, Rect* rect, 
    516                                      uint flags, PixelFormat pixelFormat, 
    517                                    BitmapData* lockedBitmapData        ) 
    518    
    519        return SetStatus( GdipBitmapLockBits( bitmap, rect, flags, 
    520                                        pixelFormat, lockedBitmapData ) ); 
    521    
    522  
    523    /************************************************************************** 
    524  
    525    **************************************************************************/ 
    526  
    527    static int Bitmap_UnlockBits( Bitmap bitmap, BitmapData* lockedBitmapData ) 
    528    
    529        return SetStatus( GdipBitmapUnlockBits( bitmap, lockedBitmapData ) ); 
    530    
    531  
    532    /************************************************************************** 
    533  
    534    **************************************************************************/ 
    535  
    536    static void Bitmap_delete( Bitmap bitmap ) 
    537    
    538        GdipDisposeImage( bitmap ); 
    539    
    540  
    541    /************************************************************************** 
    542  
    543    **************************************************************************/ 
    544  
    545    static Bitmap Bitmap_new( HICON hicon ) 
    546    
    547        Bitmap bitmap; 
    548        Gdip.lastResult = GdipCreateBitmapFromHICON( hicon, bitmap ); 
    549        return bitmap; 
    550    
    551  
    552    /************************************************************************** 
    553  
    554    **************************************************************************/ 
    555  
    556    static Bitmap Bitmap_new( HBITMAP hbm, HPALETTE hpal ) 
    557    
    558        Bitmap bitmap; 
    559        Gdip.lastResult = GdipCreateBitmapFromHBITMAP( hbm, hpal, bitmap ); 
    560        return bitmap; 
    561    
    562  
    563    /************************************************************************** 
    564  
    565    **************************************************************************/ 
    566  
    567    static Bitmap Bitmap_new( int width, int height, int stride, 
    568                       PixelFormat format, ubyte* scan0  ) 
    569    
    570        Bitmap bitmap; 
    571        Gdip.lastResult = GdipCreateBitmapFromScan0( width, height, stride, 
    572                                                    format, scan0, 
    573                                                    bitmap ); 
    574        return bitmap; 
    575    
    576  
    577    /************************************************************************** 
    578  
    579    **************************************************************************/ 
    580  
    581    static Bitmap Bitmap_new( wchar* filename, bool useIcm ) 
    582    
    583        Bitmap bitmap; 
    584        if (useIcm) { 
    585            Gdip.lastResult = GdipCreateBitmapFromFileICM( filename, bitmap ); 
    586        } else { 
    587            Gdip.lastResult = GdipCreateBitmapFromFile( filename, bitmap ); 
    588        
    589        return bitmap; 
    590    
     477    static void BitmapData_delete (BitmapData* bitmapdata) 
     478   
     479        delete bitmapdata; 
     480   
     481 
     482    /************************************************************************** 
     483 
     484    **************************************************************************/ 
     485 
     486    static BitmapData* BitmapData_new() 
     487   
     488        return new BitmapData; 
     489   
     490 
     491    /************************************************************************** 
     492 
     493    **************************************************************************/ 
     494 
     495    static int Bitmap_GetHBITMAP( Bitmap bitmap, ARGB colorBackground, 
     496                                        out HBITMAP hbmReturn                ) 
     497   
     498        return SetStatus( GdipCreateHBITMAPFromBitmap( bitmap, hbmReturn, 
     499                                                       colorBackground ) ); 
     500   
     501 
     502    /************************************************************************** 
     503 
     504    **************************************************************************/ 
     505 
     506    static int Bitmap_GetHICON( Bitmap bitmap, out HICON hIconReturn) 
     507   
     508        return SetStatus( GdipCreateHICONFromBitmap( bitmap, hIconReturn ) ); 
     509   
     510 
     511    /************************************************************************** 
     512 
     513    **************************************************************************/ 
     514 
     515    static int Bitmap_LockBits( Bitmap bitmap, Rect* rect, 
     516                                      uint flags, PixelFormat pixelFormat, 
     517                                    BitmapData* lockedBitmapData        ) 
     518   
     519        return SetStatus( GdipBitmapLockBits( bitmap, rect, flags, 
     520                                        pixelFormat, lockedBitmapData ) ); 
     521   
     522 
     523    /************************************************************************** 
     524 
     525    **************************************************************************/ 
     526 
     527    static int Bitmap_UnlockBits( Bitmap bitmap, BitmapData* lockedBitmapData ) 
     528   
     529        return SetStatus( GdipBitmapUnlockBits( bitmap, lockedBitmapData ) ); 
     530   
     531 
     532    /************************************************************************** 
     533 
     534    **************************************************************************/ 
     535 
     536    static void Bitmap_delete( Bitmap bitmap ) 
     537   
     538        GdipDisposeImage( bitmap ); 
     539   
     540 
     541    /************************************************************************** 
     542 
     543    **************************************************************************/ 
     544 
     545    static Bitmap Bitmap_new( HICON hicon ) 
     546   
     547        Bitmap bitmap; 
     548        Gdip.lastResult = GdipCreateBitmapFromHICON( hicon, bitmap ); 
     549        return bitmap; 
     550   
     551 
     552    /************************************************************************** 
     553 
     554    **************************************************************************/ 
     555 
     556    static Bitmap Bitmap_new( HBITMAP hbm, HPALETTE hpal ) 
     557   
     558        Bitmap bitmap; 
     559        Gdip.lastResult = GdipCreateBitmapFromHBITMAP( hbm, hpal, bitmap ); 
     560        return bitmap; 
     561   
     562 
     563    /************************************************************************** 
     564 
     565    **************************************************************************/ 
     566 
     567    static Bitmap Bitmap_new( int width, int height, int stride, 
     568                       PixelFormat format, ubyte* scan0  ) 
     569   
     570        Bitmap bitmap; 
     571        Gdip.lastResult = GdipCreateBitmapFromScan0( width, height, stride, 
     572                                                    format, scan0, 
     573                                                    bitmap ); 
     574        return bitmap; 
     575   
     576 
     577    /************************************************************************** 
     578 
     579    **************************************************************************/ 
     580 
     581    static Bitmap Bitmap_new( wchar* filename, bool useIcm ) 
     582   
     583        Bitmap bitmap; 
     584        if (useIcm) { 
     585            Gdip.lastResult = GdipCreateBitmapFromFileICM( filename, bitmap ); 
     586        } else { 
     587            Gdip.lastResult = GdipCreateBitmapFromFile( filename, bitmap ); 
     588       
     589        return bitmap; 
     590   
    591591 
    592592 
    593593/************************************************************************** 
    594594 
    595    Gdi+ Image Wrap Interface 
     595    Gdi+ Image Wrap Interface 
    596596 
    597597**************************************************************************/ 
    598598 
    599    static Status Image_GetLastStatus( Image image ) 
    600    
    601        Status lastStatus = Gdip.lastResult; 
    602        Gdip.lastResult = Status.OK; 
    603        return lastStatus; 
    604    
    605  
    606    /************************************************************************** 
    607  
    608    **************************************************************************/ 
     599    static Status Image_GetLastStatus( Image image ) 
     600   
     601        Status lastStatus = Gdip.lastResult; 
     602        Gdip.lastResult = Status.OK; 
     603        return lastStatus; 
     604   
     605 
     606    /************************************************************************** 
     607 
     608    **************************************************************************/ 
    609609 
    610610    static PixelFormat Image_GetPixelFormat( Image image ) 
    611    
    612        PixelFormat format; 
    613        SetStatus( GdipGetImagePixelFormat( image, format ) ); 
    614        return format; 
    615    
    616  
    617    /************************************************************************** 
    618  
    619    **************************************************************************/ 
     611   
     612        PixelFormat format; 
     613        SetStatus( GdipGetImagePixelFormat( image, format ) ); 
     614        return format; 
     615   
     616 
     617    /************************************************************************** 
     618 
     619    **************************************************************************/ 
    620620 
    621621    static uint Image_GetWidth( Image image ) 
    622    
    623        uint width = 0; 
    624        SetStatus( GdipGetImageWidth( image, width ) ); 
    625        return width; 
    626    
    627  
    628    /************************************************************************** 
    629  
    630    **************************************************************************/ 
     622   
     623        uint width = 0; 
     624        SetStatus( GdipGetImageWidth( image, width ) ); 
     625        return width; 
     626   
     627 
     628    /************************************************************************** 
     629 
     630    **************************************************************************/ 
    631631 
    632632    static uint Image_GetHeight( Image image ) 
    633    
    634        uint height = 0; 
    635        SetStatus( GdipGetImageHeight( image, height ) ); 
    636        return height; 
    637    
    638  
    639    /************************************************************************** 
    640  
    641    **************************************************************************/ 
     633   
     634        uint height = 0; 
     635        SetStatus( GdipGetImageHeight( image, height ) ); 
     636        return height; 
     637   
     638 
     639    /************************************************************************** 
     640 
     641    **************************************************************************/ 
    642642 
    643643    static Status Image_GetPalette( Image image, ColorPalette* palette, int size ) 
    644644    { 
    645        return SetStatus( GdipGetImagePalette( image, palette, size ) ); 
    646    
    647  
    648    /************************************************************************** 
    649  
    650    **************************************************************************/ 
    651  
    652    static int Image_GetPaletteSize( Image image ) 
    653    
    654        int size = 0; 
    655        SetStatus( GdipGetImagePaletteSize( image, size ) ); 
    656        return size; 
    657    
     645        return SetStatus( GdipGetImagePalette( image, palette, size ) ); 
     646   
     647 
     648    /************************************************************************** 
     649 
     650    **************************************************************************/ 
     651 
     652    static int Image_GetPaletteSize( Image image ) 
     653   
     654        int size = 0; 
     655        SetStatus( GdipGetImagePaletteSize( image, size ) ); 
     656        return size; 
     657   
    658658 
    659659/************************************************************************** 
    660660 
    661    Gdi+ ImageAttributes Wrap Interface 
     661    Gdi+ ImageAttributes Wrap Interface 
    662662 
    663663**************************************************************************/ 
    664664 
    665    static ImageAttributes ImageAttributes_new() 
    666    
    667        ImageAttributes ImageAttr = null; 
     665    static ImageAttributes ImageAttributes_new() 
     666   
     667        ImageAttributes ImageAttr = null; 
    668668        Gdip.lastResult = GdipCreateImageAttributes( ImageAttr ); 
    669        return ImageAttr; 
    670    
    671  
    672    /************************************************************************** 
    673  
    674    **************************************************************************/ 
    675  
    676    static void ImageAttributes_delete( ImageAttributes attrib ) 
    677    
    678        GdipDisposeImageAttributes( attrib ); 
    679    
    680  
    681    /************************************************************************** 
    682  
    683    **************************************************************************/ 
    684  
    685    static Status ImageAttributes_SetWrapMode( ImageAttributes attrib, 
    686                                               WrapMode wrap, 
    687                                               ARGB color = Gdip.Black, 
    688                                               bool clamp = false ) 
    689    
     669        return ImageAttr; 
     670   
     671 
     672    /************************************************************************** 
     673 
     674    **************************************************************************/ 
     675 
     676    static void ImageAttributes_delete( ImageAttributes attrib ) 
     677   
     678        GdipDisposeImageAttributes( attrib ); 
     679   
     680 
     681    /************************************************************************** 
     682 
     683    **************************************************************************/ 
     684 
     685    static Status ImageAttributes_SetWrapMode( ImageAttributes attrib, 
     686                                               WrapMode wrap, 
     687                                               ARGB color = Gdip.Black, 
     688                                               bool clamp = false ) 
     689   
    690690        return SetStatus(GdipSetImageAttributesWrapMode( 
    691691                           attrib, wrap, color, clamp)); 
    692    
    693  
    694  
    695    /************************************************************************** 
    696  
    697    **************************************************************************/ 
    698  
    699    static Status ImageAttributes_SetColorMatrix( ImageAttributes attrib, 
    700                                                  ref ColorMatrix matrix, 
    701                                               ColorMatrixFlag mode = Gdip.ColorMatrixFlagsDefault, 
    702                                               ColorAdjustType type = Gdip.ColorAdjustTypeDefault  ) 
    703    
    704        return SetStatus( GdipSetImageAttributesColorMatrix( 
     692   
     693 
     694 
     695    /************************************************************************** 
     696 
     697    **************************************************************************/ 
     698 
     699    static Status ImageAttributes_SetColorMatrix( ImageAttributes attrib, 
     700                                                  ref ColorMatrix matrix, 
     701                                               ColorMatrixFlag mode = Gdip.ColorMatrixFlagsDefault, 
     702                                               ColorAdjustType type = Gdip.ColorAdjustTypeDefault  ) 
     703   
     704        return SetStatus( GdipSetImageAttributesColorMatrix( 
    705705                                            attrib, 
    706706                                            type, 
     
    709709                                            null, 
    710710                                            mode)); 
    711    
     711   
    712712 
    713713 
    714714/************************************************************************** 
    715715 
    716    Gdi+ Brush Wrap Interface 
     716    Gdi+ Brush Wrap Interface 
    717717 
    718718**************************************************************************/ 
    719719 
    720    static Brush Brush_Clone( Brush brush ) 
    721    
    722        Brush cloneBrush; 
    723        SetStatus( GdipCloneBrush( brush, cloneBrush ) ); 
    724        return cloneBrush; 
    725    
    726  
    727    /************************************************************************** 
    728  
    729    **************************************************************************/ 
    730  
    731    static BrushType Brush_GetType( Brush brush ) 
    732    
    733        BrushType brushType = -1; 
    734        SetStatus( GdipGetBrushType( brush, brushType ) ); 
    735        return brushType; 
    736    
     720    static Brush Brush_Clone( Brush brush ) 
     721   
     722        Brush cloneBrush; 
     723        SetStatus( GdipCloneBrush( brush, cloneBrush ) ); 
     724        return cloneBrush; 
     725   
     726 
     727    /************************************************************************** 
     728 
     729    **************************************************************************/ 
     730 
     731    static BrushType Brush_GetType( Brush brush ) 
     732   
     733        BrushType brushType = -1; 
     734        SetStatus( GdipGetBrushType( brush, brushType ) ); 
     735        return brushType; 
     736   
    737737 
    738738/************************************************************************** 
    739739 
    740    Gdi+ HatchedBrush Wrap Interface 
     740    Gdi+ HatchedBrush Wrap Interface 
    741741 
    742742**************************************************************************/ 
    743743 
    744    static void HatchBrush_delete( HatchBrush brush ) 
    745    
    746        GdipDeleteBrush(brush); 
    747    
    748  
    749