1 11 package org.eclipse.swt.internal.gdip; 12 13 import org.eclipse.swt.internal.*; 14 15 public class Gdip extends Platform { 16 static { 17 Library.loadLibrary ("swt-gdip"); } 19 20 21 public static final int BrushTypeSolidColor = 0; 22 public static final int BrushTypeHatchFill = 1; 23 public static final int BrushTypeTextureFill = 2; 24 public static final int BrushTypePathGradient = 3; 25 public static final int BrushTypeLinearGradient = 4; 26 public static final int ColorAdjustTypeBitmap = 1; 27 public static final int ColorMatrixFlagsDefault = 0; 28 public static final int CombineModeReplace = 0; 29 public static final int CombineModeIntersect = 1; 30 public static final int CombineModeUnion = 2; 31 public static final int CombineModeXor = 3; 32 public static final int CombineModeExclude = 4; 33 public static final int CombineModeComplement = 5; 34 public static final int FillModeAlternate = 0; 35 public static final int FillModeWinding = 1; 36 public static final int DashCapFlat = 0; 37 public static final int DashCapRound = 2; 38 public static final int DashCapTriangle = 3; 39 public static final int DashStyleSolid = 0; 40 public static final int DashStyleDash = 1; 41 public static final int DashStyleDot = 2; 42 public static final int DashStyleDashDot = 3; 43 public static final int DashStyleDashDotDot = 4; 44 public static final int DashStyleCustom = 5; 45 public static final int FontStyleRegular = 0; 46 public static final int FontStyleBold = 1; 47 public static final int FontStyleItalic = 2; 48 public static final int FontStyleBoldItalic = 3; 49 public static final int FontStyleUnderline = 4; 50 public static final int FontStyleStrikeout = 8; 51 public static final int PaletteFlagsHasAlpha = 0x0001; 52 public static final int FlushIntentionFlush = 0; 53 public static final int FlushIntentionSync = 1; 54 public static final int HotkeyPrefixNone = 0; 55 public static final int HotkeyPrefixShow = 1; 56 public static final int HotkeyPrefixHide = 2; 57 public static final int LineJoinMiter = 0; 58 public static final int LineJoinBevel = 1; 59 public static final int LineJoinRound = 2; 60 public static final int LineCapFlat = 0; 61 public static final int LineCapSquare = 1; 62 public static final int LineCapRound = 2; 63 public static final int MatrixOrderPrepend = 0; 64 public static final int MatrixOrderAppend = 1; 65 public static final int QualityModeDefault = 0; 66 public static final int QualityModeLow = 1; 67 public static final int QualityModeHigh = 2; 68 public static final int InterpolationModeDefault = QualityModeDefault; 69 public static final int InterpolationModeLowQuality = QualityModeLow; 70 public static final int InterpolationModeHighQuality = QualityModeHigh; 71 public static final int InterpolationModeBilinear = QualityModeHigh + 1; 72 public static final int InterpolationModeBicubic = QualityModeHigh + 2; 73 public static final int InterpolationModeNearestNeighbor = QualityModeHigh + 3; 74 public static final int InterpolationModeHighQualityBilinear = QualityModeHigh + 4; 75 public static final int InterpolationModeHighQualityBicubic = QualityModeHigh + 5; 76 public static final int PathPointTypeStart = 0; 77 public static final int PathPointTypeLine = 1; 78 public static final int PathPointTypeBezier = 3; 79 public static final int PathPointTypePathTypeMask = 0x7; 80 public static final int PathPointTypePathDashMode = 0x10; 81 public static final int PathPointTypePathMarker = 0x20; 82 public static final int PathPointTypeCloseSubpath = 0x80; 83 public static final int PathPointTypeBezier3 = 3; 84 public static final int PixelFormatIndexed = 0x00010000; 85 public static final int PixelFormatGDI = 0x00020000; 86 public static final int PixelFormatAlpha = 0x00040000; 87 public static final int PixelFormatPAlpha = 0x00080000; 88 public static final int PixelFormatExtended = 0x00100000; 89 public static final int PixelFormatCanonical = 0x00200000; 90 public static final int PixelFormat1bppIndexed = (1 | ( 1 << 8) | PixelFormatIndexed | PixelFormatGDI); 91 public static final int PixelFormat4bppIndexed = (2 | ( 4 << 8) | PixelFormatIndexed | PixelFormatGDI); 92 public static final int PixelFormat8bppIndexed = (3 | ( 8 << 8) | PixelFormatIndexed | PixelFormatGDI); 93 public static final int PixelFormat16bppGrayScale = (4 | (16 << 8) | PixelFormatExtended); 94 public static final int PixelFormat16bppRGB555 = (5 | (16 << 8) | PixelFormatGDI); 95 public static final int PixelFormat16bppRGB565 = (6 | (16 << 8) | PixelFormatGDI); 96 public static final int PixelFormat16bppARGB1555 = (7 | (16 << 8) | PixelFormatAlpha | PixelFormatGDI); 97 public static final int PixelFormat24bppRGB = (8 | (24 << 8) | PixelFormatGDI); 98 public static final int PixelFormat32bppRGB = (9 | (32 << 8) | PixelFormatGDI); 99 public static final int PixelFormat32bppARGB = (10 | (32 << 8) | PixelFormatAlpha | PixelFormatGDI | PixelFormatCanonical); 100 public static final int PixelFormat32bppPARGB = (11 | (32 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatGDI); 101 public static final int PixelFormat48bppRGB = (12 | (48 << 8) | PixelFormatExtended); 102 public static final int PixelFormat64bppARGB = (13 | (64 << 8) | PixelFormatAlpha | PixelFormatCanonical | PixelFormatExtended); 103 public static final int PixelFormat64bppPARGB = (14 | (64 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatExtended); 104 public static final int PixelFormatMax = 15; 105 public static final int PixelOffsetModeNone = QualityModeHigh + 1; 106 public static final int PixelOffsetModeHalf = QualityModeHigh + 2; 107 public static final int SmoothingModeDefault = QualityModeDefault; 108 public static final int SmoothingModeHighSpeed = QualityModeLow; 109 public static final int SmoothingModeHighQuality = QualityModeHigh; 110 public static final int SmoothingModeNone = 3; 111 public static final int SmoothingModeAntiAlias8x4 = 4; 112 public static final int SmoothingModeAntiAlias = SmoothingModeAntiAlias8x4; 113 public static final int SmoothingModeAntiAlias8x8 = 5; 114 public static final int StringFormatFlagsDirectionRightToLeft = 0x00000001; 115 public static final int StringFormatFlagsDirectionVertical = 0x00000002; 116 public static final int StringFormatFlagsNoFitBlackBox = 0x00000004; 117 public static final int StringFormatFlagsDisplayFormatControl = 0x00000020; 118 public static final int StringFormatFlagsNoFontFallback = 0x00000400; 119 public static final int StringFormatFlagsMeasureTrailingSpaces = 0x00000800; 120 public static final int StringFormatFlagsNoWrap = 0x00001000; 121 public static final int StringFormatFlagsLineLimit = 0x00002000; 122 public static final int StringFormatFlagsNoClip = 0x00004000; 123 public static final int TextRenderingHintSystemDefault = 0; 124 public static final int TextRenderingHintSingleBitPerPixelGridFit = 1; 125 public static final int TextRenderingHintSingleBitPerPixel = 2; 126 public static final int TextRenderingHintAntiAliasGridFit = 3; 127 public static final int TextRenderingHintAntiAlias = 4; 128 public static final int TextRenderingHintClearTypeGridFit = 5; 129 public static final int UnitPixel = 2; 130 public static final int WrapModeTile = 0; 131 public static final int WrapModeTileFlipX = 1; 132 public static final int WrapModeTileFlipY = 2; 133 public static final int WrapModeTileFlipXY = 3; 134 public static final int WrapModeClamp = 4; 135 136 137 public static final native int ColorPalette_sizeof(); 138 public static final native int GdiplusStartupInput_sizeof(); 139 140 141 public static final native int GdiplusStartup(int [] token, GdiplusStartupInput input, int output); 142 public static final native void GdiplusShutdown(int token); 143 public static final native int Bitmap_new(int hbm, int hpal); 144 public static final native int Bitmap_new(int hicon); 145 public static final native int Bitmap_new(int width, int height, int stride, int format, int scan0); 146 public static final native int Bitmap_new(char[] filename, boolean useIcm); 147 public static final native void Bitmap_delete(int bitmap); 148 public static final native int Bitmap_GetHBITMAP(int bitmap, int colorBackground, int [] hbmReturn); 149 public static final native int Bitmap_GetHICON(int bitmap, int [] hicon); 150 public static final native int BitmapData_new(); 151 public static final native void BitmapData_delete(int bitmapData); 152 public static final native int Bitmap_LockBits(int bitmap, int rect, int flags, int pixelFormat, int lockedBitmapData); 153 public static final native int Bitmap_UnlockBits(int bitmap, int lockedBitmapData); 154 public static final native int Brush_Clone(int brush); 155 public static final native int Brush_GetType(int brush); 156 public static final native int Color_new(int argb); 157 public static final native void Color_delete(int color); 158 public static final native int Font_new(int hdc, int hfont); 159 public static final native int Font_new(char[] familyName, float emSize, int style, int unit, int fontCollection); 160 public static final native void Font_delete(int font); 161 public static final native int Font_GetFamily(int font, int family); 162 public static final native float Font_GetSize(int font); 163 public static final native int Font_GetStyle(int font); 164 public static final native boolean Font_IsAvailable(int font); 165 public static final native int FontFamily_new(); 166 public static final native void FontFamily_delete(int family); 167 public static final native int FontFamily_GetFamilyName(int family, char[] name, char language); 168 public static final native int Graphics_new(int hdc); 169 public static final native void Graphics_delete(int graphics); 170 public static final native int Graphics_DrawArc(int graphics, int pen, int x, int y, int width, int height, float startAngle, float sweepAngle); 171 public static final native int Graphics_DrawEllipse(int graphics, int pen, int x, int y, int width, int height); 172 public static final native int Graphics_DrawImage(int graphics, int image, int x, int y); 173 public static final native int Graphics_DrawImage(int graphics, int image, Rect destRect, int srcx, int srcy, int srcwidth, int srcheight, int srcUnit, int imageAttributes, int callback, int callbackData); 174 public static final native int Graphics_DrawLine(int graphics, int pen, int x1, int y1, int x2, int y2); 175 public static final native int Graphics_DrawLines(int graphics, int pen, int[] points, int count); 176 public static final native int Graphics_DrawPath(int graphics, int pen, int path); 177 public static final native int Graphics_DrawPolygon(int graphics, int pen, int[] points, int count); 178 public static final native int Graphics_DrawRectangle(int graphics, int pen, int x, int y, int width, int height); 179 public static final native int Graphics_DrawString(int graphics, char[] string, int length, int font, PointF origin, int brush); 180 public static final native int Graphics_DrawString(int graphics, char[] string, int length, int font, PointF origin, int format, int brush); 181 public static final native int Graphics_FillEllipse(int graphics, int brush, int x, int y, int width, int height); 182 public static final native int Graphics_FillPath(int graphics, int brush, int path); 183 public static final native void Graphics_Flush(int graphics, int intention); 184 public static final native int Graphics_FillPie(int graphics, int brush, int x, int y, int width, int height, float startAngle, float sweepAngle); 185 public static final native int Graphics_FillPolygon(int graphics, int brush, int[] points, int count, int fillMode); 186 public static final native int Graphics_FillRectangle(int graphics, int brush, int x, int y, int width, int height); 187 public static final native int Graphics_GetClipBounds(int graphics, RectF rect); 188 public static final native int Graphics_GetClipBounds(int graphics, Rect rect); 189 public static final native int Graphics_GetClip(int graphics, int region); 190 public static final native int Graphics_GetHDC(int graphics); 191 public static final native void Graphics_ReleaseHDC(int graphics, int hdc); 192 public static final native int Graphics_GetInterpolationMode(int graphics); 193 public static final native int Graphics_GetSmoothingMode(int graphics); 194 public static final native int Graphics_GetTextRenderingHint(int graphics); 195 public static final native int Graphics_GetTransform(int graphics, int matrix); 196 public static final native int Graphics_GetVisibleClipBounds(int graphics, Rect rect); 197 public static final native int Graphics_MeasureString(int graphics, char[] string, int length, int font, PointF origin, RectF boundingBox); 198 public static final native int Graphics_MeasureString(int graphics, char[] string, int length, int font, PointF origin, int format, RectF boundingBox); 199 public static final native int Graphics_ResetClip(int graphics); 200 public static final native int Graphics_Restore(int graphics, int gstate); 201 public static final native int Graphics_Save(int graphics); 202 public static final native int Graphics_ScaleTransform(int graphics, float sx, float sy, int order); 203 public static final native int Graphics_SetClip(int graphics, int hrgn, int combineMode); 204 public static final native int Graphics_SetClip(int graphics, int path); 205 public static final native int Graphics_SetClip(int graphics, Rect rect, int combineMode); 206 public static final native int Graphics_SetCompositingQuality(int graphics, int compositingQuality); 207 public static final native int Graphics_SetPageUnit(int graphics, int unit); 208 public static final native int Graphics_SetPixelOffsetMode(int graphics, int pixelOffsetMode); 209 public static final native int Graphics_SetSmoothingMode(int graphics, int smoothingMode); 210 public static final native int Graphics_SetTransform(int graphics, int matrix); 211 public static final native int Graphics_SetInterpolationMode(int graphics, int mode); 212 public static final native int Graphics_SetTextRenderingHint(int graphics, int mode); 213 public static final native int Graphics_TranslateTransform(int graphics, float dx, float dy, int order); 214 public static final native int GraphicsPath_new(int fillMode); 215 public static final native int GraphicsPath_new(int[] points, byte[] types, int count, int fillMode); 216 public static final native void GraphicsPath_delete(int path); 217 public static final native int GraphicsPath_AddArc(int path, float x, float y, float width, float height, float startAngle, float sweepAngle); 218 public static final native int GraphicsPath_AddBezier(int path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4); 219 public static final native int GraphicsPath_AddLine(int path, float x1, float y1, float x2, float y2); 220 public static final native int GraphicsPath_AddPath(int path, int addingPath, boolean connect); 221 public static final native int GraphicsPath_AddRectangle(int path, RectF rect); 222 public static final native int GraphicsPath_AddString(int path, char[] string, int length, int family, int style, float emSize, PointF origin, int format); 223 public static final native int GraphicsPath_CloseFigure(int path); 224 public static final native int GraphicsPath_Flatten(int path, int matrix, float flatness); 225 public static final native int GraphicsPath_GetBounds(int path, RectF bounds, int matrix, int pen); 226 public static final native int GraphicsPath_GetLastPoint(int path, PointF lastPoint); 227 public static final native int GraphicsPath_GetPathPoints(int path, float[] points, int count); 228 public static final native int GraphicsPath_GetPathTypes(int path, byte[] types, int count); 229 public static final native int GraphicsPath_GetPointCount(int path); 230 public static final native boolean GraphicsPath_IsOutlineVisible(int path, float x, float y, int pen, int g); 231 public static final native boolean GraphicsPath_IsVisible(int path, float x, float y, int g); 232 public static final native int GraphicsPath_SetFillMode(int path, int fillmode); 233 public static final native int GraphicsPath_StartFigure(int path); 234 public static final native int GraphicsPath_Transform(int path, int matrix); 235 public static final native int HatchBrush_new(int hatchStyle, int foreColor, int backColor); 236 public static final native int Image_GetLastStatus(int image); 237 public static final native int Image_GetPixelFormat(int image); 238 public static final native int Image_GetWidth(int image); 239 public static final native int Image_GetHeight(int image); 240 public static final native int Image_GetPalette(int image, int palette, int size); 241 public static final native int Image_GetPaletteSize(int image); 242 public static final native int ImageAttributes_new(); 243 public static final native void ImageAttributes_delete(int attrib); 244 public static final native int ImageAttributes_SetWrapMode(int attrib, int wrap); 245 public static final native int ImageAttributes_SetColorMatrix(int attrib, float[] matrix, int mode, int type); 246 public static final native void HatchBrush_delete(int brush); 247 public static final native int LinearGradientBrush_new(PointF point1, PointF point2, int color1, int color2); 248 public static final native void LinearGradientBrush_delete(int brush); 249 public static final native int LinearGradientBrush_SetInterpolationColors(int brush, int [] presetColors, float[] blendPositions, int count); 250 public static final native int LinearGradientBrush_SetWrapMode(int brush, int wrapMode); 251 public static final native int LinearGradientBrush_ResetTransform(int brush); 252 public static final native int LinearGradientBrush_ScaleTransform(int brush, float sx, float sy, int order); 253 public static final native int LinearGradientBrush_TranslateTransform(int brush, float dx, float dy, int order); 254 public static final native int Matrix_new(float m11, float m12, float m21, float m22, float dx, float dy); 255 public static final native void Matrix_delete(int matrix); 256 public static final native int Matrix_GetElements(int matrix, float[] m); 257 public static final native int Matrix_Invert(int matrix); 258 public static final native boolean Matrix_IsIdentity(int matrix); 259 public static final native int Matrix_Multiply(int matrix, int matrix1, int order); 260 public static final native int Matrix_Rotate(int matrix, float angle, int order); 261 public static final native int Matrix_Scale(int matrix, float scaleX, float scaleY, int order); 262 public static final native int Matrix_Shear(int matrix, float shearX, float shearY, int order); 263 public static final native int Matrix_TransformPoints(int matrix, PointF pts, int count); 264 public static final native int Matrix_TransformPoints(int matrix, float[] pts, int count); 265 public static final native int Matrix_Translate(int matrix, float offsetX, float offsetY, int order); 266 public static final native int Matrix_SetElements(int matrix, float m11, float m12, float m21, float m22, float dx, float dy); 267 public static final native void MoveMemory(ColorPalette Destination, int SourcePtr, int Length); 268 public static final native void MoveMemory(BitmapData Destination, int SourcePtr); 269 public static final native int PathGradientBrush_new(int path); 270 public static final native void PathGradientBrush_delete(int brush); 271 public static final native int PathGradientBrush_SetCenterColor(int brush, int color); 272 public static final native int PathGradientBrush_SetCenterPoint(int brush, PointF pt); 273 public static final native int PathGradientBrush_SetSurroundColors(int brush, int [] colors, int[] count); 274 public static final native int PathGradientBrush_SetGraphicsPath(int brush, int path); 275 public static final native int Pen_new(int brush, float width); 276 public static final native void Pen_delete(int pen); 277 public static final native int Pen_GetBrush(int pen); 278 public static final native int Pen_SetBrush(int pen, int brush); 279 public static final native int Pen_SetDashOffset(int pen, float dashOffset); 280 public static final native int Pen_SetDashPattern(int pen, float[] dashArray, int count); 281 public static final native int Pen_SetDashStyle(int pen, int dashStyle); 282 public static final native int Pen_SetLineCap(int pen, int startCap, int endCap, int dashCap); 283 public static final native int Pen_SetLineJoin(int pen, int lineJoin); 284 public static final native int Pen_SetMiterLimit(int pen, float miterLimit); 285 public static final native int Pen_SetWidth(int pen, float width); 286 public static final native int Point_new(int x, int y); 287 public static final native void Point_delete(int point); 288 public static final native int Region_new(int hRgn); 289 public static final native int Region_new(); 290 public static final native void Region_delete(int region); 291 public static final native int Region_GetHRGN(int region, int graphics); 292 public static final native boolean Region_IsInfinite(int region, int graphics); 293 public static final native int SolidBrush_new(int color); 294 public static final native void SolidBrush_delete(int brush); 295 public static final native void StringFormat_delete(int format); 296 public static final native int StringFormat_Clone(int format); 297 public static final native int StringFormat_GenericDefault(); 298 public static final native int StringFormat_GenericTypographic(); 299 public static final native int StringFormat_GetFormatFlags(int format); 300 public static final native int StringFormat_SetHotkeyPrefix(int format, int hotkeyPrefix); 301 public static final native int StringFormat_SetFormatFlags(int format, int flags); 302 public static final native int StringFormat_SetTabStops(int format, float firstTabOffset, int count, float[] tabStops); 303 public static final native int TextureBrush_new(int image, int wrapMode, float dstX, float dstY, float dstWidth, float dstHeight); 304 public static final native void TextureBrush_delete(int brush); 305 public static final native int TextureBrush_SetTransform(int brush, int matrix); 306 public static final native int TextureBrush_ResetTransform(int brush); 307 public static final native int TextureBrush_ScaleTransform(int brush, float sx, float sy, int order); 308 public static final native int TextureBrush_TranslateTransform(int brush, float dx, float dy, int order); 309 } 310 | Popular Tags |