view dwt/internal/gdip/Gdip.d @ 26:fa34113bf4be

Path
author Frank Benoit <benoit@tionex.de>
date Sun, 27 Jan 2008 23:29:42 +0100
parents d6fa61ac6912
children 0405e18fec7f
line wrap: on
line source

/*******************************************************************************
 * Copyright (c) 2000, 2007 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
module dwt.internal.gdip.Gdip;

import dwt.internal.Library;
import dwt.internal.Platform;
import dwt.internal.win32.OS;



alias extern(Windows) void function(int level, char *message) DebugEventProc;
struct GdiplusStartupInput {
    uint GdiplusVersion;
    DebugEventProc DebugEventCallback;
    int SuppressBackgroundThread;
    int SuppressExternalCodecs;
}
alias extern(Windows) int function(uint* token) NotificationHookProc;
alias extern(Windows) void function(uint* token) NotificationUnhookProc;
struct GdiplusStartupOutput {
  NotificationHookProc NotificationHook;
  NotificationUnhookProc NotificationUnhook;
};

struct API {
    static extern(Windows) int GdiplusStartup(
        uint** token,
        GdiplusStartupInput *input,
        GdiplusStartupOutput *output
        );
    static extern(Windows) void GdiplusShutdown(
        uint** token
        );

}


public class Gdip : Platform {

    /** GdiPlus constants */
    public static const int BrushTypeSolidColor = 0;
    public static const int BrushTypeHatchFill = 1;
    public static const int BrushTypeTextureFill = 2;
    public static const int BrushTypePathGradient = 3;
    public static const int BrushTypeLinearGradient = 4;
    public static const int ColorAdjustTypeBitmap = 1;
    public static const int ColorMatrixFlagsDefault = 0;
    public static const int CombineModeReplace = 0;
    public static const int CombineModeIntersect = 1;
    public static const int CombineModeUnion = 2;
    public static const int CombineModeXor = 3;
    public static const int CombineModeExclude = 4;
    public static const int CombineModeComplement = 5;
    public static const int FillModeAlternate = 0;
    public static const int FillModeWinding = 1;
    public static const int DashCapFlat = 0;
    public static const int DashCapRound = 2;
    public static const int DashCapTriangle = 3;
    public static const int DashStyleSolid = 0;
    public static const int DashStyleDash = 1;
    public static const int DashStyleDot = 2;
    public static const int DashStyleDashDot = 3;
    public static const int DashStyleDashDotDot = 4;
    public static const int DashStyleCustom = 5;
    public static const int FontStyleRegular = 0;
    public static const int FontStyleBold = 1;
    public static const int FontStyleItalic = 2;
    public static const int FontStyleBoldItalic = 3;
    public static const int FontStyleUnderline = 4;
    public static const int FontStyleStrikeout = 8;
    public static const int PaletteFlagsHasAlpha = 0x0001;
    public static const int FlushIntentionFlush = 0;
    public static const int FlushIntentionSync = 1;
    public static const int HotkeyPrefixNone = 0;
    public static const int HotkeyPrefixShow = 1;
    public static const int HotkeyPrefixHide = 2;
    public static const int LineJoinMiter = 0;
    public static const int LineJoinBevel = 1;
    public static const int LineJoinRound = 2;
    public static const int LineCapFlat = 0;
    public static const int LineCapSquare = 1;
    public static const int LineCapRound = 2;
    public static const int MatrixOrderPrepend = 0;
    public static const int MatrixOrderAppend = 1;
    public static const int QualityModeDefault = 0;
    public static const int QualityModeLow = 1;
    public static const int QualityModeHigh = 2;
    public static const int InterpolationModeDefault = QualityModeDefault;
    public static const int InterpolationModeLowQuality = QualityModeLow;
    public static const int InterpolationModeHighQuality = QualityModeHigh;
    public static const int InterpolationModeBilinear = QualityModeHigh + 1;
    public static const int InterpolationModeBicubic = QualityModeHigh + 2;
    public static const int InterpolationModeNearestNeighbor = QualityModeHigh + 3;
    public static const int InterpolationModeHighQualityBilinear = QualityModeHigh + 4;
    public static const int InterpolationModeHighQualityBicubic = QualityModeHigh + 5;
    public static const int PathPointTypeStart = 0;
    public static const int PathPointTypeLine = 1;
    public static const int PathPointTypeBezier = 3;
    public static const int PathPointTypePathTypeMask = 0x7;
    public static const int PathPointTypePathDashMode = 0x10;
    public static const int PathPointTypePathMarker = 0x20;
    public static const int PathPointTypeCloseSubpath = 0x80;
    public static const int PathPointTypeBezier3 = 3;
    public static const int PixelFormatIndexed = 0x00010000;
    public static const int PixelFormatGDI = 0x00020000;
    public static const int PixelFormatAlpha = 0x00040000;
    public static const int PixelFormatPAlpha = 0x00080000;
    public static const int PixelFormatExtended = 0x00100000;
    public static const int PixelFormatCanonical = 0x00200000;
    public static const int PixelFormat1bppIndexed = (1 | ( 1 << 8) | PixelFormatIndexed | PixelFormatGDI);
    public static const int PixelFormat4bppIndexed = (2 | ( 4 << 8) | PixelFormatIndexed | PixelFormatGDI);
    public static const int PixelFormat8bppIndexed = (3 | ( 8 << 8) | PixelFormatIndexed | PixelFormatGDI);
    public static const int PixelFormat16bppGrayScale = (4 | (16 << 8) | PixelFormatExtended);
    public static const int PixelFormat16bppRGB555 = (5 | (16 << 8) | PixelFormatGDI);
    public static const int PixelFormat16bppRGB565 = (6 | (16 << 8) | PixelFormatGDI);
    public static const int PixelFormat16bppARGB1555 = (7 | (16 << 8) | PixelFormatAlpha | PixelFormatGDI);
    public static const int PixelFormat24bppRGB = (8 | (24 << 8) | PixelFormatGDI);
    public static const int PixelFormat32bppRGB = (9 | (32 << 8) | PixelFormatGDI);
    public static const int PixelFormat32bppARGB = (10 | (32 << 8) | PixelFormatAlpha | PixelFormatGDI | PixelFormatCanonical);
    public static const int PixelFormat32bppPARGB = (11 | (32 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatGDI);
    public static const int PixelFormat48bppRGB = (12 | (48 << 8) | PixelFormatExtended);
    public static const int PixelFormat64bppARGB = (13 | (64 << 8) | PixelFormatAlpha  | PixelFormatCanonical | PixelFormatExtended);
    public static const int PixelFormat64bppPARGB = (14 | (64 << 8) | PixelFormatAlpha  | PixelFormatPAlpha | PixelFormatExtended);
    public static const int PixelFormatMax = 15;
    public static const int PixelOffsetModeNone = QualityModeHigh + 1;
    public static const int PixelOffsetModeHalf = QualityModeHigh + 2;
    public static const int SmoothingModeDefault = QualityModeDefault;
    public static const int SmoothingModeHighSpeed = QualityModeLow;
    public static const int SmoothingModeHighQuality = QualityModeHigh;
    public static const int SmoothingModeNone = 3;
    public static const int SmoothingModeAntiAlias8x4 = 4;
    public static const int SmoothingModeAntiAlias = SmoothingModeAntiAlias8x4;
    public static const int SmoothingModeAntiAlias8x8 = 5;
    public static const int StringFormatFlagsDirectionRightToLeft = 0x00000001;
    public static const int StringFormatFlagsDirectionVertical = 0x00000002;
    public static const int StringFormatFlagsNoFitBlackBox = 0x00000004;
    public static const int StringFormatFlagsDisplayFormatControl = 0x00000020;
    public static const int StringFormatFlagsNoFontFallback = 0x00000400;
    public static const int StringFormatFlagsMeasureTrailingSpaces = 0x00000800;
    public static const int StringFormatFlagsNoWrap = 0x00001000;
    public static const int StringFormatFlagsLineLimit = 0x00002000;
    public static const int StringFormatFlagsNoClip = 0x00004000;
    public static const int TextRenderingHintSystemDefault = 0;
    public static const int TextRenderingHintSingleBitPerPixelGridFit = 1;
    public static const int TextRenderingHintSingleBitPerPixel = 2;
    public static const int TextRenderingHintAntiAliasGridFit = 3;
    public static const int TextRenderingHintAntiAlias = 4;
    public static const int TextRenderingHintClearTypeGridFit = 5;
    public static const int UnitPixel = 2;
    public static const int WrapModeTile = 0;
    public static const int WrapModeTileFlipX = 1;
    public static const int WrapModeTileFlipY = 2;
    public static const int WrapModeTileFlipXY = 3;
    public static const int WrapModeClamp = 4;


public struct RectF {
    public float X;
    public float Y;
    public float Width;
    public float Height;
}

public struct Rect {
    public int X;
    public int Y;
    public int Width;
    public int Height;
}
public struct Point {
    public int X;
    public int Y;
}
public struct PointF {
    public float X;
    public float Y;
}

public struct ColorPalette {
    public int Flags;
    public int Count;
    public int[1] Entries;
}
public struct BitmapData {
    public int Width;
    public int Height;
    public int Stride;
    public int PixelFormat;
    public void* Scan0;
    public int   Reserved;
}

struct Bitmap{}
struct Brush{}
struct Color{}
struct Font{}
struct FontCollection{}
struct FontFamily{}
struct Graphics{}
struct GraphicsPath{}
struct Image{}
struct ImageAttributes{}
struct HatchBrush{}
struct LinearGradientBrush{}
struct Matrix{}
struct Pen{}
struct Region{}
struct SolidBrush{}
struct StringFormat{}
struct TextureBrush{}
alias extern(Windows) int function(void*) ImageAbort;
alias ImageAbort DrawImageAbort;

    public alias API.GdiplusStartup  GdiplusStartup;
    public alias API.GdiplusShutdown GdiplusShutdown;

    public static extern(Windows) {
        Matrix* Matrix_new(float m11, float m12, float m21, float m22, float dx, float dy);
        void Matrix_delete(Matrix*);
        int  Matrix_GetElements(Matrix*,float* m);
        int  Matrix_Invert(Matrix*);
        int  Matrix_IsIdentity(Matrix*);
        int  Matrix_Multiply(Matrix*,Matrix*,int);
        int  Matrix_Rotate(Matrix*,float,int);
        int  Matrix_Scale(Matrix*,float,float,int);
        int  Matrix_SetElements(Matrix*,float m11, float m12, float m21, float m22, float dx, float dy);
        int  Matrix_TransformPoints(Matrix*,PointF*, int);
        int  Matrix_Translate(Matrix*,float, float, float);

        Bitmap* Bitmap_new(HBITMAP hbm, HPALETTE hpal);
        Bitmap* Bitmap_new(HICON hicon);
        Bitmap* Bitmap_new(int width, int height, int stride, int format, byte* scan0);
        Bitmap* Bitmap_new(wchar* filename, int useIcm);
        void Bitmap_delete(Bitmap* bitmap);
        // colorBackground is C++ &-reference Color
        int Bitmap_GetHBITMAP(Bitmap*bitmap, void* colorBackground, HBITMAP* hbmReturn);
        int Bitmap_GetHICON(Bitmap* bitmap, HICON* hicon);
        int Bitmap_LockBits(Bitmap* bitmap, Rect* rect, int flags, int pixelFormat, BitmapData* lockedBitmapData);
        int Bitmap_UnlockBits(Bitmap* bitmap, BitmapData* lockedBitmapData);

        BitmapData* BitmapData_new();
        void BitmapData_delete(BitmapData* bitmapData);

        int Image_GetLastStatus(Image* image);
        int Image_GetPixelFormat(Image* image);
        uint Image_GetWidth(Image* image);
        uint Image_GetHeight(Image* image);
        int Image_GetPalette(Image* image, ColorPalette* palette, int size);
        int Image_GetPaletteSize(Image* image);

        Graphics* Graphics_new(HDC hdc);
        void Graphics_delete(Graphics* graphics);
        int Graphics_DrawArc(Graphics* graphics, Pen* pen, int x, int y, int width, int height, float startAngle, float sweepAngle);
        int Graphics_DrawEllipse(Graphics* graphics, Pen* pen, int x, int y, int width, int height);
        int Graphics_DrawImage(Graphics* graphics, Image* image, int x, int y);
        int Graphics_DrawImage(Graphics* graphics, Image* image, Rect* destRect, int srcx, int srcy, int srcwidth, int srcheight, int srcUnit, ImageAttributes* imageAttributes, DrawImageAbort callback, void* callbackData);
        int Graphics_DrawLine(Graphics* graphics, Pen* pen, int x1, int y1, int x2, int y2);
        int Graphics_DrawLines(Graphics* graphics, Pen* pen, Point* points, int count);
        int Graphics_DrawPath(Graphics* graphics, Pen* pen, GraphicsPath* path);
        int Graphics_DrawPolygon(Graphics* graphics, Pen* pen, int[] points, int count);
        int Graphics_DrawRectangle(Graphics* graphics, Pen* pen, int x, int y, int width, int height);
        int Graphics_DrawString(Graphics* graphics, wchar* string, int length, Font* font, PointF origin, Brush* brush);
        int Graphics_DrawString(Graphics* graphics, wchar* string, int length, Font* font, PointF origin, StringFormat* format, Brush* brush);
        int Graphics_FillEllipse(Graphics* graphics, Brush* brush, int x, int y, int width, int height);
        int Graphics_FillPath(Graphics* graphics, Brush* brush, GraphicsPath* path);
        void Graphics_Flush(Graphics* graphics, int intention);
        int Graphics_FillPie(Graphics* graphics, Brush* brush, int x, int y, int width, int height, float startAngle, float sweepAngle);
        int Graphics_FillPolygon(Graphics* graphics, Brush* brush, int[] points, int count, int fillMode);
        int Graphics_FillRectangle(Graphics* graphics, Brush* brush, int x, int y, int width, int height);
        int Graphics_GetClipBounds(Graphics* graphics, RectF rect);
        int Graphics_GetClipBounds(Graphics* graphics, Rect rect);
        int Graphics_GetClip(Graphics* graphics, Region* region);
        HDC Graphics_GetHDC(Graphics* graphics);
        void Graphics_ReleaseHDC(Graphics* graphics, HDC hdc);
        int Graphics_GetInterpolationMode(Graphics* graphics);
        int Graphics_GetSmoothingMode(Graphics* graphics);
        int Graphics_GetTextRenderingHint(Graphics* graphics);
        int Graphics_GetTransform(Graphics* graphics, Matrix* matrix);
        int Graphics_GetVisibleClipBounds(Graphics* graphics, Rect rect);
        int Graphics_MeasureString(Graphics* graphics, wchar* string, int length, Font* font, PointF origin, RectF* boundingBox);
        int Graphics_MeasureString(Graphics* graphics, wchar* string, int length, Font* font, PointF origin, StringFormat* format, RectF* boundingBox);
        int Graphics_ResetClip(Graphics* graphics);
        int Graphics_Restore(Graphics* graphics, int gstate);
        int Graphics_Save(Graphics* graphics);
        int Graphics_ScaleTransform(Graphics* graphics, float sx, float sy, int order);
        int Graphics_SetClip(Graphics* graphics, HRGN hrgn, int combineMode);
        int Graphics_SetClip(Graphics* graphics, GraphicsPath* path);
        int Graphics_SetClip(Graphics* graphics, Rect rect, int combineMode);
        int Graphics_SetCompositingQuality(Graphics* graphics, int compositingQuality);
        int Graphics_SetPageUnit(Graphics* graphics, int unit);
        int Graphics_SetPixelOffsetMode(Graphics* graphics, int pixelOffsetMode);
        int Graphics_SetSmoothingMode(Graphics* graphics, int smoothingMode);
        int Graphics_SetTransform(Graphics* graphics, Matrix* matrix);
        int Graphics_SetInterpolationMode(Graphics* graphics, int mode);
        int Graphics_SetTextRenderingHint(Graphics* graphics, int mode);
        int Graphics_TranslateTransform(Graphics* graphics, float dx, float dy, int order);

        SolidBrush* SolidBrush_new(Color* color);
        void SolidBrush_delete(SolidBrush* brush);

        Brush* Brush_Clone(Brush* brush);
        int Brush_GetType(Brush* brush);

        TextureBrush* TextureBrush_new(Image* image, int wrapMode, float dstX, float dstY, float dstWidth, float dstHeight);
        void TextureBrush_delete(TextureBrush* brush);
        int TextureBrush_SetTransform(TextureBrush* brush, Matrix* matrix);
        int TextureBrush_ResetTransform(TextureBrush* brush);
        int TextureBrush_ScaleTransform(TextureBrush* brush, float sx, float sy, int order);
        int TextureBrush_TranslateTransform(TextureBrush* brush, float dx, float dy, int order);

        Color* Color_new(int argb);
        void Color_delete(Color* color);


        Pen* Pen_new(Brush* brush, float width);
        void Pen_delete(Pen* pen);
        Brush* Pen_GetBrush(Pen* pen);
        int Pen_SetBrush(Pen* pen, Brush* brush);
        int Pen_SetDashOffset(Pen* pen, float dashOffset);
        int Pen_SetDashPattern(Pen* pen, float* dashArray, int count);
        int Pen_SetDashStyle(Pen* pen, int dashStyle);
        int Pen_SetLineCap(Pen* pen, int startCap, int endCap, int dashCap);
        int Pen_SetLineJoin(Pen* pen, int lineJoin);
        int Pen_SetMiterLimit(Pen* pen, float miterLimit);
        int Pen_SetWidth(Pen* pen, float width);

        Font* Font_new(HDC hdc, HFONT hfont);
        Font* Font_new(wchar* familyName, float emSize, int style, int unit, FontCollection* fontCollection);
        void Font_delete(Font* font);
        int Font_GetFamily(Font* font, FontFamily* family);
        float Font_GetSize(Font* font);
        int Font_GetStyle(Font* font);
        bool Font_IsAvailable(Font* font);


        void HatchBrush_delete(HatchBrush* brush);

        LinearGradientBrush* LinearGradientBrush_new(PointF point1, PointF point2, Color* color1, Color* color2);
        void LinearGradientBrush_delete(LinearGradientBrush* brush);
        int LinearGradientBrush_SetInterpolationColors(LinearGradientBrush* brush, Color* presetColors, float* blendPositions, int count);
        int LinearGradientBrush_SetWrapMode(LinearGradientBrush* brush, int wrapMode);
        int LinearGradientBrush_ResetTransform(LinearGradientBrush* brush);
        int LinearGradientBrush_ScaleTransform(LinearGradientBrush* brush, float sx, float sy, int order);
        int LinearGradientBrush_TranslateTransform(LinearGradientBrush* brush, float dx, float dy, int order);

        GraphicsPath* GraphicsPath_new(int fillMode);
        GraphicsPath* GraphicsPath_new(Point* points, byte* types, int count, int fillMode);
        void GraphicsPath_delete(GraphicsPath* path);
        int GraphicsPath_AddArc(GraphicsPath* path, float x, float y, float width, float height, float startAngle, float sweepAngle);
        int GraphicsPath_AddBezier(GraphicsPath* path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
        int GraphicsPath_AddLine(GraphicsPath* path, float x1, float y1, float x2, float y2);
        int GraphicsPath_AddPath(GraphicsPath* path, GraphicsPath* addingPath, bool connect);
        int GraphicsPath_AddRectangle(GraphicsPath* path, RectF* rect);
        int GraphicsPath_AddString(GraphicsPath* path, wchar* string, int length, FontFamily* family, int style, float emSize, PointF origin, StringFormat* format);
        int GraphicsPath_CloseFigure(GraphicsPath* path);
        int GraphicsPath_Flatten(GraphicsPath* path, Matrix* matrix, float flatness);
        int GraphicsPath_GetBounds(GraphicsPath* path, RectF bounds, Matrix* matrix, Pen* pen);
        int GraphicsPath_GetLastPoint(GraphicsPath* path, PointF lastPoint);
        int GraphicsPath_GetPathPoints(GraphicsPath* path, float* points, int count);
        int GraphicsPath_GetPathTypes(GraphicsPath* path, byte[] types, int count);
        int GraphicsPath_GetPointCount(GraphicsPath* path);
        bool GraphicsPath_IsOutlineVisible(GraphicsPath* path, float x, float y, Pen* pen, Graphics* g);
        bool GraphicsPath_IsVisible(GraphicsPath* path, float x, float y, Graphics* g);
        int GraphicsPath_SetFillMode(GraphicsPath* path, int fillmode);
        int GraphicsPath_StartFigure(GraphicsPath* path);
        int GraphicsPath_Transform(GraphicsPath* path, Matrix* matrix);

        Region* Region_new(HRGN hRgn);
        Region* Region_new();
        void Region_delete(Region* region);
        HRGN Region_GetHRGN(Region* region, Graphics* graphics);
        bool Region_IsInfinite(Region* region, Graphics* graphics);

        ImageAttributes* ImageAttributes_new();
        void ImageAttributes_delete(ImageAttributes* attrib);
        int ImageAttributes_SetWrapMode(ImageAttributes* attrib, int wrap);
        int ImageAttributes_SetColorMatrix(ImageAttributes* attrib, float* matrix, int mode, int type);

        void StringFormat_delete(StringFormat* format);
        StringFormat* StringFormat_Clone(StringFormat* format);
        StringFormat* StringFormat_GenericDefault();
        StringFormat* StringFormat_GenericTypographic();
        int StringFormat_GetFormatFlags(StringFormat* format);
        int StringFormat_SetHotkeyPrefix(StringFormat* format, int hotkeyPrefix);
        int StringFormat_SetFormatFlags(StringFormat* format, int flags);
        int StringFormat_SetTabStops(StringFormat* format, float firstTabOffset, int count, float* tabStops);

        FontFamily* FontFamily_new();
        void FontFamily_delete(FontFamily* family);
        int FontFamily_GetFamilyName(FontFamily* family, wchar* name, wchar language);
    }



/++
/** 64 bit */
public static final native int ColorPalette_sizeof();
public static final native int GdiplusStartupInput_sizeof();

/** GdiPlus natives */
public static final native int GdiplusStartup(int /*long*/[] token, GdiplusStartupInput input, int /*long*/ output);
public static final native void GdiplusShutdown(int /*long*/ token);
public static final native int /*long*/ Bitmap_new(int /*long*/ hbm, int /*long*/ hpal);
public static final native int /*long*/ Bitmap_new(int /*long*/ hicon);
public static final native int /*long*/ Bitmap_new(int width, int height, int stride, int format, int /*long*/ scan0);
public static final native int /*long*/ Bitmap_new(char[] filename, bool useIcm);
public static final native void Bitmap_delete(int /*long*/ bitmap);
public static final native int Bitmap_GetHBITMAP(int /*long*/ bitmap, int /*long*/ colorBackground, int /*long*/[] hbmReturn);
public static final native int Bitmap_GetHICON(int /*long*/ bitmap, int /*long*/[] hicon);
public static final native int /*long*/ BitmapData_new();
public static final native void BitmapData_delete(int /*long*/ bitmapData);
public static final native int Bitmap_LockBits(int /*long*/ bitmap, int /*long*/ rect, int flags, int pixelFormat, int /*long*/ lockedBitmapData);
public static final native int Bitmap_UnlockBits(int /*long*/ bitmap, int /*long*/ lockedBitmapData);
public static final native int /*long*/ Brush_Clone(int /*long*/ brush);
public static final native int Brush_GetType(int /*long*/ brush);
public static final native int /*long*/ Color_new(int argb);
public static final native void Color_delete(int /*long*/ color);
public static final native int /*long*/ Font_new(int /*long*/ hdc, int /*long*/ hfont);
public static final native int /*long*/ Font_new(char[] familyName, float emSize, int style, int unit, int /*long*/ fontCollection);
public static final native void Font_delete(int /*long*/ font);
public static final native int Font_GetFamily(int /*long*/ font, int /*long*/ family);
public static final native float Font_GetSize(int /*long*/ font);
public static final native int Font_GetStyle(int /*long*/ font);
public static final native bool Font_IsAvailable(int /*long*/ font);
public static final native int /*long*/ FontFamily_new();
public static final native void FontFamily_delete(int /*long*/ family);
public static final native int FontFamily_GetFamilyName(int /*long*/ family, char[] name, char language);
public static final native int /*long*/ Graphics_new(int /*long*/ hdc);
public static final native void Graphics_delete(int /*long*/ graphics);
public static final native int Graphics_DrawArc(int /*long*/ graphics, int /*long*/ pen, int x, int y, int width, int height, float startAngle, float sweepAngle);
public static final native int Graphics_DrawEllipse(int /*long*/ graphics, int /*long*/ pen, int x, int y, int width, int height);
public static final native int Graphics_DrawImage(int /*long*/ graphics, int /*long*/ image, int x, int y);
public static final native int Graphics_DrawImage(int /*long*/ graphics, int /*long*/ image, Rect destRect, int srcx, int srcy, int srcwidth, int srcheight, int srcUnit, int /*long*/ imageAttributes, int /*long*/ callback, int /*long*/ callbackData);
public static final native int Graphics_DrawLine(int /*long*/ graphics, int /*long*/ pen, int x1, int y1, int x2, int y2);
public static final native int Graphics_DrawLines(int /*long*/ graphics, int /*long*/ pen, int[] points, int count);
public static final native int Graphics_DrawPath(int /*long*/ graphics, int /*long*/ pen, int /*long*/ path);
public static final native int Graphics_DrawPolygon(int /*long*/ graphics, int /*long*/ pen, int[] points, int count);
public static final native int Graphics_DrawRectangle(int /*long*/ graphics, int /*long*/ pen, int x, int y, int width, int height);
public static final native int Graphics_DrawString(int /*long*/ graphics, char[] string, int length, int /*long*/ font, PointF origin, int /*long*/ brush);
public static final native int Graphics_DrawString(int /*long*/ graphics, char[] string, int length, int /*long*/ font, PointF origin, int /*long*/ format, int /*long*/ brush);
public static final native int Graphics_FillEllipse(int /*long*/ graphics, int /*long*/ brush, int x, int y, int width, int height);
public static final native int Graphics_FillPath(int /*long*/ graphics, int /*long*/ brush, int /*long*/ path);
public static final native void Graphics_Flush(int /*long*/ graphics, int intention);
public static final native int Graphics_FillPie(int /*long*/ graphics, int /*long*/ brush, int x, int y, int width, int height, float startAngle, float sweepAngle);
public static final native int Graphics_FillPolygon(int /*long*/ graphics, int /*long*/ brush, int[] points, int count, int fillMode);
public static final native int Graphics_FillRectangle(int /*long*/ graphics, int /*long*/ brush, int x, int y, int width, int height);
public static final native int Graphics_GetClipBounds(int /*long*/ graphics, RectF rect);
public static final native int Graphics_GetClipBounds(int /*long*/ graphics, Rect rect);
public static final native int Graphics_GetClip(int /*long*/ graphics, int /*long*/ region);
public static final native int /*long*/ Graphics_GetHDC(int /*long*/ graphics);
public static final native void Graphics_ReleaseHDC(int /*long*/ graphics, int /*long*/ hdc);
public static final native int Graphics_GetInterpolationMode(int /*long*/ graphics);
public static final native int Graphics_GetSmoothingMode(int /*long*/ graphics);
public static final native int Graphics_GetTextRenderingHint(int /*long*/ graphics);
public static final native int Graphics_GetTransform(int /*long*/ graphics, int /*long*/ matrix);
public static final native int Graphics_GetVisibleClipBounds(int /*long*/ graphics, Rect rect);
public static final native int Graphics_MeasureString(int /*long*/ graphics, char[] string, int length, int /*long*/ font, PointF origin, RectF boundingBox);
public static final native int Graphics_MeasureString(int /*long*/ graphics, char[] string, int length, int /*long*/ font, PointF origin, int /*long*/ format, RectF boundingBox);
public static final native int Graphics_ResetClip(int /*long*/ graphics);
public static final native int Graphics_Restore(int /*long*/ graphics, int gstate);
public static final native int Graphics_Save(int /*long*/ graphics);
public static final native int Graphics_ScaleTransform(int /*long*/ graphics, float sx, float sy, int order);
public static final native int Graphics_SetClip(int /*long*/ graphics, int /*long*/ hrgn, int combineMode);
public static final native int Graphics_SetClip(int /*long*/ graphics, int /*long*/ path);
public static final native int Graphics_SetClip(int /*long*/ graphics, Rect rect, int combineMode);
public static final native int Graphics_SetCompositingQuality(int /*long*/ graphics, int compositingQuality);
public static final native int Graphics_SetPageUnit(int /*long*/ graphics, int unit);
public static final native int Graphics_SetPixelOffsetMode(int /*long*/ graphics, int pixelOffsetMode);
public static final native int Graphics_SetSmoothingMode(int /*long*/ graphics, int smoothingMode);
public static final native int Graphics_SetTransform(int /*long*/ graphics, int /*long*/ matrix);
public static final native int Graphics_SetInterpolationMode(int /*long*/ graphics, int mode);
public static final native int Graphics_SetTextRenderingHint(int /*long*/ graphics, int mode);
public static final native int Graphics_TranslateTransform(int /*long*/ graphics, float dx, float dy, int order);
public static final native int /*long*/ GraphicsPath_new(int fillMode);
public static final native int /*long*/ GraphicsPath_new(int[] points, byte[] types, int count, int fillMode);
public static final native void GraphicsPath_delete(int /*long*/ path);
public static final native int GraphicsPath_AddArc(int /*long*/ path, float x, float y, float width, float height, float startAngle, float sweepAngle);
public static final native int GraphicsPath_AddBezier(int /*long*/ path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
public static final native int GraphicsPath_AddLine(int /*long*/ path, float x1, float y1, float x2, float y2);
public static final native int GraphicsPath_AddPath(int /*long*/ path, int /*long*/ addingPath, bool connect);
public static final native int GraphicsPath_AddRectangle(int /*long*/ path, RectF rect);
public static final native int GraphicsPath_AddString(int /*long*/ path, char[] string, int length, int /*long*/ family, int style, float emSize, PointF origin, int /*long*/ format);
public static final native int GraphicsPath_CloseFigure(int /*long*/ path);
public static final native int GraphicsPath_Flatten(int /*long*/ path, int /*long*/ matrix, float flatness);
public static final native int GraphicsPath_GetBounds(int /*long*/ path, RectF bounds, int /*long*/ matrix, int /*long*/ pen);
public static final native int GraphicsPath_GetLastPoint(int /*long*/ path, PointF lastPoint);
public static final native int GraphicsPath_GetPathPoints(int /*long*/ path, float[] points, int count);
public static final native int GraphicsPath_GetPathTypes(int /*long*/ path, byte[] types, int count);
public static final native int GraphicsPath_GetPointCount(int /*long*/ path);
public static final native bool GraphicsPath_IsOutlineVisible(int /*long*/ path, float x, float y, int /*long*/ pen, int /*long*/ g);
public static final native bool GraphicsPath_IsVisible(int /*long*/ path, float x, float y, int /*long*/ g);
public static final native int GraphicsPath_SetFillMode(int /*long*/ path, int fillmode);
public static final native int GraphicsPath_StartFigure(int /*long*/ path);
public static final native int GraphicsPath_Transform(int /*long*/ path, int /*long*/ matrix);
public static final native int /*long*/ HatchBrush_new(int hatchStyle, int /*long*/ foreColor, int /*long*/ backColor);
public static final native int Image_GetLastStatus(int /*long*/ image);
public static final native int Image_GetPixelFormat(int /*long*/ image);
public static final native int Image_GetWidth(int /*long*/ image);
public static final native int Image_GetHeight(int /*long*/ image);
public static final native int Image_GetPalette(int /*long*/ image, int /*long*/ palette, int size);
public static final native int Image_GetPaletteSize(int /*long*/ image);
public static final native int /*long*/ ImageAttributes_new();
public static final native void ImageAttributes_delete(int /*long*/ attrib);
public static final native int ImageAttributes_SetWrapMode(int /*long*/ attrib, int wrap);
public static final native int ImageAttributes_SetColorMatrix(int /*long*/ attrib, float[] matrix, int mode, int type);
public static final native void HatchBrush_delete(int /*long*/ brush);
public static final native int /*long*/ LinearGradientBrush_new(PointF point1, PointF point2, int /*long*/ color1, int /*long*/ color2);
public static final native void LinearGradientBrush_delete(int /*long*/ brush);
public static final native int LinearGradientBrush_SetInterpolationColors(int /*long*/ brush, int /*long*/[] presetColors, float[] blendPositions, int count);
public static final native int LinearGradientBrush_SetWrapMode(int /*long*/ brush, int wrapMode);
public static final native int LinearGradientBrush_ResetTransform(int /*long*/ brush);
public static final native int LinearGradientBrush_ScaleTransform(int /*long*/ brush, float sx, float sy, int order);
public static final native int LinearGradientBrush_TranslateTransform(int /*long*/ brush, float dx, float dy, int order);
public static final native int /*long*/ Matrix_new(float m11, float m12, float m21, float m22, float dx, float dy);
public static final native void Matrix_delete(int /*long*/ matrix);
public static final native int Matrix_GetElements(int /*long*/ matrix, float[] m);
public static final native int Matrix_Invert(int /*long*/ matrix);
public static final native bool Matrix_IsIdentity(int /*long*/ matrix);
public static final native int Matrix_Multiply(int /*long*/ matrix, int /*long*/ matrix1, int order);
public static final native int Matrix_Rotate(int /*long*/ matrix, float angle, int order);
public static final native int Matrix_Scale(int /*long*/ matrix, float scaleX, float scaleY, int order);
public static final native int Matrix_Shear(int /*long*/ matrix, float shearX, float shearY, int order);
public static final native int Matrix_TransformPoints(int /*long*/ matrix, PointF pts, int count);
public static final native int Matrix_TransformPoints(int /*long*/ matrix, float[] pts, int count);
public static final native int Matrix_Translate(int /*long*/ matrix, float offsetX, float offsetY, int order);
public static final native int Matrix_SetElements(int /*long*/ matrix, float m11, float m12, float m21, float m22, float dx, float dy);
public static final native void MoveMemory(ColorPalette Destination, int /*long*/ SourcePtr, int Length);
public static final native void MoveMemory(BitmapData Destination, int /*long*/ SourcePtr);
public static final native int /*long*/ PathGradientBrush_new(int /*long*/ path);
public static final native void PathGradientBrush_delete(int /*long*/ brush);
public static final native int PathGradientBrush_SetCenterColor(int /*long*/ brush, int /*long*/ color);
public static final native int PathGradientBrush_SetCenterPoint(int /*long*/ brush, PointF pt);
public static final native int PathGradientBrush_SetSurroundColors(int /*long*/ brush, int /*long*/[] colors, int[] count);
public static final native int PathGradientBrush_SetGraphicsPath(int /*long*/ brush, int /*long*/ path);
public static final native int /*long*/ Pen_new(int /*long*/ brush, float width);
public static final native void Pen_delete(int /*long*/ pen);
public static final native int /*long*/ Pen_GetBrush(int /*long*/ pen);
public static final native int Pen_SetBrush(int /*long*/ pen, int /*long*/ brush);
public static final native int Pen_SetDashOffset(int /*long*/ pen, float dashOffset);
public static final native int Pen_SetDashPattern(int /*long*/ pen, float[] dashArray, int count);
public static final native int Pen_SetDashStyle(int /*long*/ pen, int dashStyle);
public static final native int Pen_SetLineCap(int /*long*/ pen, int startCap, int endCap, int dashCap);
public static final native int Pen_SetLineJoin(int /*long*/ pen, int lineJoin);
public static final native int Pen_SetMiterLimit(int /*long*/ pen, float miterLimit);
public static final native int Pen_SetWidth(int /*long*/ pen, float width);
public static final native int /*long*/ Point_new(int x, int y);
public static final native void Point_delete(int /*long*/ point);
public static final native int /*long*/ Region_new(int /*long*/ hRgn);
public static final native int /*long*/ Region_new();
public static final native void Region_delete(int /*long*/ region);
public static final native int /*long*/ Region_GetHRGN(int /*long*/ region, int /*long*/ graphics);
public static final native bool Region_IsInfinite(int /*long*/ region, int /*long*/ graphics);
public static final native int /*long*/ SolidBrush_new(int /*long*/ color);
public static final native void SolidBrush_delete(int /*long*/ brush);
public static final native void StringFormat_delete(int /*long*/ format);
public static final native int /*long*/ StringFormat_Clone(int /*long*/ format);
public static final native int /*long*/ StringFormat_GenericDefault();
public static final native int /*long*/ StringFormat_GenericTypographic();
public static final native int StringFormat_GetFormatFlags(int /*long*/ format);
public static final native int StringFormat_SetHotkeyPrefix(int /*long*/ format, int hotkeyPrefix);
public static final native int StringFormat_SetFormatFlags(int /*long*/ format, int flags);
public static final native int StringFormat_SetTabStops(int /*long*/ format, float firstTabOffset, int count, float[] tabStops);
public static final native int /*long*/ TextureBrush_new(int /*long*/ image, int wrapMode, float dstX, float dstY, float dstWidth, float dstHeight);
public static final native void TextureBrush_delete(int /*long*/ brush);
public static final native int TextureBrush_SetTransform(int /*long*/ brush, int /*long*/ matrix);
public static final native int TextureBrush_ResetTransform(int /*long*/ brush);
public static final native int TextureBrush_ScaleTransform(int /*long*/ brush, float sx, float sy, int order);
public static final native int TextureBrush_TranslateTransform(int /*long*/ brush, float dx, float dy, int order);
++/
}