Mercurial > projects > dwt-win
annotate 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 |
rev | line source |
---|---|
19 | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2007 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 *******************************************************************************/ | |
11 module dwt.internal.gdip.Gdip; | |
12 | |
13 import dwt.internal.Library; | |
14 import dwt.internal.Platform; | |
22
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
15 import dwt.internal.win32.OS; |
21 | 16 |
17 | |
19 | 18 |
19 alias extern(Windows) void function(int level, char *message) DebugEventProc; | |
20 struct GdiplusStartupInput { | |
21 uint GdiplusVersion; | |
22 DebugEventProc DebugEventCallback; | |
23 int SuppressBackgroundThread; | |
24 int SuppressExternalCodecs; | |
25 } | |
26 alias extern(Windows) int function(uint* token) NotificationHookProc; | |
27 alias extern(Windows) void function(uint* token) NotificationUnhookProc; | |
28 struct GdiplusStartupOutput { | |
29 NotificationHookProc NotificationHook; | |
30 NotificationUnhookProc NotificationUnhook; | |
31 }; | |
32 | |
33 struct API { | |
34 static extern(Windows) int GdiplusStartup( | |
35 uint** token, | |
36 GdiplusStartupInput *input, | |
37 GdiplusStartupOutput *output | |
38 ); | |
39 static extern(Windows) void GdiplusShutdown( | |
40 uint** token | |
41 ); | |
42 | |
43 } | |
44 | |
45 | |
46 public class Gdip : Platform { | |
47 | |
48 /** GdiPlus constants */ | |
49 public static const int BrushTypeSolidColor = 0; | |
50 public static const int BrushTypeHatchFill = 1; | |
51 public static const int BrushTypeTextureFill = 2; | |
52 public static const int BrushTypePathGradient = 3; | |
53 public static const int BrushTypeLinearGradient = 4; | |
54 public static const int ColorAdjustTypeBitmap = 1; | |
55 public static const int ColorMatrixFlagsDefault = 0; | |
56 public static const int CombineModeReplace = 0; | |
57 public static const int CombineModeIntersect = 1; | |
58 public static const int CombineModeUnion = 2; | |
59 public static const int CombineModeXor = 3; | |
60 public static const int CombineModeExclude = 4; | |
61 public static const int CombineModeComplement = 5; | |
62 public static const int FillModeAlternate = 0; | |
63 public static const int FillModeWinding = 1; | |
64 public static const int DashCapFlat = 0; | |
65 public static const int DashCapRound = 2; | |
66 public static const int DashCapTriangle = 3; | |
67 public static const int DashStyleSolid = 0; | |
68 public static const int DashStyleDash = 1; | |
69 public static const int DashStyleDot = 2; | |
70 public static const int DashStyleDashDot = 3; | |
71 public static const int DashStyleDashDotDot = 4; | |
72 public static const int DashStyleCustom = 5; | |
73 public static const int FontStyleRegular = 0; | |
74 public static const int FontStyleBold = 1; | |
75 public static const int FontStyleItalic = 2; | |
76 public static const int FontStyleBoldItalic = 3; | |
77 public static const int FontStyleUnderline = 4; | |
78 public static const int FontStyleStrikeout = 8; | |
79 public static const int PaletteFlagsHasAlpha = 0x0001; | |
80 public static const int FlushIntentionFlush = 0; | |
81 public static const int FlushIntentionSync = 1; | |
82 public static const int HotkeyPrefixNone = 0; | |
83 public static const int HotkeyPrefixShow = 1; | |
84 public static const int HotkeyPrefixHide = 2; | |
85 public static const int LineJoinMiter = 0; | |
86 public static const int LineJoinBevel = 1; | |
87 public static const int LineJoinRound = 2; | |
88 public static const int LineCapFlat = 0; | |
89 public static const int LineCapSquare = 1; | |
90 public static const int LineCapRound = 2; | |
91 public static const int MatrixOrderPrepend = 0; | |
92 public static const int MatrixOrderAppend = 1; | |
93 public static const int QualityModeDefault = 0; | |
94 public static const int QualityModeLow = 1; | |
95 public static const int QualityModeHigh = 2; | |
96 public static const int InterpolationModeDefault = QualityModeDefault; | |
97 public static const int InterpolationModeLowQuality = QualityModeLow; | |
98 public static const int InterpolationModeHighQuality = QualityModeHigh; | |
99 public static const int InterpolationModeBilinear = QualityModeHigh + 1; | |
100 public static const int InterpolationModeBicubic = QualityModeHigh + 2; | |
101 public static const int InterpolationModeNearestNeighbor = QualityModeHigh + 3; | |
102 public static const int InterpolationModeHighQualityBilinear = QualityModeHigh + 4; | |
103 public static const int InterpolationModeHighQualityBicubic = QualityModeHigh + 5; | |
104 public static const int PathPointTypeStart = 0; | |
105 public static const int PathPointTypeLine = 1; | |
106 public static const int PathPointTypeBezier = 3; | |
107 public static const int PathPointTypePathTypeMask = 0x7; | |
108 public static const int PathPointTypePathDashMode = 0x10; | |
109 public static const int PathPointTypePathMarker = 0x20; | |
110 public static const int PathPointTypeCloseSubpath = 0x80; | |
111 public static const int PathPointTypeBezier3 = 3; | |
112 public static const int PixelFormatIndexed = 0x00010000; | |
113 public static const int PixelFormatGDI = 0x00020000; | |
114 public static const int PixelFormatAlpha = 0x00040000; | |
115 public static const int PixelFormatPAlpha = 0x00080000; | |
116 public static const int PixelFormatExtended = 0x00100000; | |
117 public static const int PixelFormatCanonical = 0x00200000; | |
118 public static const int PixelFormat1bppIndexed = (1 | ( 1 << 8) | PixelFormatIndexed | PixelFormatGDI); | |
119 public static const int PixelFormat4bppIndexed = (2 | ( 4 << 8) | PixelFormatIndexed | PixelFormatGDI); | |
120 public static const int PixelFormat8bppIndexed = (3 | ( 8 << 8) | PixelFormatIndexed | PixelFormatGDI); | |
121 public static const int PixelFormat16bppGrayScale = (4 | (16 << 8) | PixelFormatExtended); | |
122 public static const int PixelFormat16bppRGB555 = (5 | (16 << 8) | PixelFormatGDI); | |
123 public static const int PixelFormat16bppRGB565 = (6 | (16 << 8) | PixelFormatGDI); | |
124 public static const int PixelFormat16bppARGB1555 = (7 | (16 << 8) | PixelFormatAlpha | PixelFormatGDI); | |
125 public static const int PixelFormat24bppRGB = (8 | (24 << 8) | PixelFormatGDI); | |
126 public static const int PixelFormat32bppRGB = (9 | (32 << 8) | PixelFormatGDI); | |
127 public static const int PixelFormat32bppARGB = (10 | (32 << 8) | PixelFormatAlpha | PixelFormatGDI | PixelFormatCanonical); | |
128 public static const int PixelFormat32bppPARGB = (11 | (32 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatGDI); | |
129 public static const int PixelFormat48bppRGB = (12 | (48 << 8) | PixelFormatExtended); | |
130 public static const int PixelFormat64bppARGB = (13 | (64 << 8) | PixelFormatAlpha | PixelFormatCanonical | PixelFormatExtended); | |
131 public static const int PixelFormat64bppPARGB = (14 | (64 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatExtended); | |
132 public static const int PixelFormatMax = 15; | |
133 public static const int PixelOffsetModeNone = QualityModeHigh + 1; | |
134 public static const int PixelOffsetModeHalf = QualityModeHigh + 2; | |
135 public static const int SmoothingModeDefault = QualityModeDefault; | |
136 public static const int SmoothingModeHighSpeed = QualityModeLow; | |
137 public static const int SmoothingModeHighQuality = QualityModeHigh; | |
138 public static const int SmoothingModeNone = 3; | |
139 public static const int SmoothingModeAntiAlias8x4 = 4; | |
140 public static const int SmoothingModeAntiAlias = SmoothingModeAntiAlias8x4; | |
141 public static const int SmoothingModeAntiAlias8x8 = 5; | |
142 public static const int StringFormatFlagsDirectionRightToLeft = 0x00000001; | |
143 public static const int StringFormatFlagsDirectionVertical = 0x00000002; | |
144 public static const int StringFormatFlagsNoFitBlackBox = 0x00000004; | |
145 public static const int StringFormatFlagsDisplayFormatControl = 0x00000020; | |
146 public static const int StringFormatFlagsNoFontFallback = 0x00000400; | |
147 public static const int StringFormatFlagsMeasureTrailingSpaces = 0x00000800; | |
148 public static const int StringFormatFlagsNoWrap = 0x00001000; | |
149 public static const int StringFormatFlagsLineLimit = 0x00002000; | |
150 public static const int StringFormatFlagsNoClip = 0x00004000; | |
151 public static const int TextRenderingHintSystemDefault = 0; | |
152 public static const int TextRenderingHintSingleBitPerPixelGridFit = 1; | |
153 public static const int TextRenderingHintSingleBitPerPixel = 2; | |
154 public static const int TextRenderingHintAntiAliasGridFit = 3; | |
155 public static const int TextRenderingHintAntiAlias = 4; | |
156 public static const int TextRenderingHintClearTypeGridFit = 5; | |
157 public static const int UnitPixel = 2; | |
158 public static const int WrapModeTile = 0; | |
159 public static const int WrapModeTileFlipX = 1; | |
160 public static const int WrapModeTileFlipY = 2; | |
161 public static const int WrapModeTileFlipXY = 3; | |
162 public static const int WrapModeClamp = 4; | |
163 | |
164 | |
22
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
165 public struct RectF { |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
166 public float X; |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
167 public float Y; |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
168 public float Width; |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
169 public float Height; |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
170 } |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
171 |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
172 public struct Rect { |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
173 public int X; |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
174 public int Y; |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
175 public int Width; |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
176 public int Height; |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
177 } |
24 | 178 public struct Point { |
179 public int X; | |
180 public int Y; | |
181 } | |
22
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
182 public struct PointF { |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
183 public float X; |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
184 public float Y; |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
185 } |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
186 |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
187 public struct ColorPalette { |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
188 public int Flags; |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
189 public int Count; |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
190 public int[1] Entries; |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
191 } |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
192 public struct BitmapData { |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
193 public int Width; |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
194 public int Height; |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
195 public int Stride; |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
196 public int PixelFormat; |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
197 public void* Scan0; |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
198 public int Reserved; |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
199 } |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
200 |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
201 struct Bitmap{} |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
202 struct Brush{} |
24 | 203 struct Color{} |
22
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
204 struct Font{} |
24 | 205 struct FontCollection{} |
206 struct FontFamily{} | |
207 struct Graphics{} | |
22
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
208 struct GraphicsPath{} |
24 | 209 struct Image{} |
22
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
210 struct ImageAttributes{} |
24 | 211 struct HatchBrush{} |
212 struct LinearGradientBrush{} | |
213 struct Matrix{} | |
214 struct Pen{} | |
215 struct Region{} | |
216 struct SolidBrush{} | |
217 struct StringFormat{} | |
218 struct TextureBrush{} | |
219 alias extern(Windows) int function(void*) ImageAbort; | |
220 alias ImageAbort DrawImageAbort; | |
19 | 221 |
222 public alias API.GdiplusStartup GdiplusStartup; | |
223 public alias API.GdiplusShutdown GdiplusShutdown; | |
224 | |
24 | 225 public static extern(Windows) { |
226 Matrix* Matrix_new(float m11, float m12, float m21, float m22, float dx, float dy); | |
227 void Matrix_delete(Matrix*); | |
228 int Matrix_GetElements(Matrix*,float* m); | |
229 int Matrix_Invert(Matrix*); | |
230 int Matrix_IsIdentity(Matrix*); | |
231 int Matrix_Multiply(Matrix*,Matrix*,int); | |
232 int Matrix_Rotate(Matrix*,float,int); | |
233 int Matrix_Scale(Matrix*,float,float,int); | |
234 int Matrix_SetElements(Matrix*,float m11, float m12, float m21, float m22, float dx, float dy); | |
235 int Matrix_TransformPoints(Matrix*,PointF*, int); | |
236 int Matrix_Translate(Matrix*,float, float, float); | |
237 | |
238 Bitmap* Bitmap_new(HBITMAP hbm, HPALETTE hpal); | |
239 Bitmap* Bitmap_new(HICON hicon); | |
240 Bitmap* Bitmap_new(int width, int height, int stride, int format, byte* scan0); | |
241 Bitmap* Bitmap_new(wchar* filename, int useIcm); | |
242 void Bitmap_delete(Bitmap* bitmap); | |
243 // colorBackground is C++ &-reference Color | |
244 int Bitmap_GetHBITMAP(Bitmap*bitmap, void* colorBackground, HBITMAP* hbmReturn); | |
245 int Bitmap_GetHICON(Bitmap* bitmap, HICON* hicon); | |
246 int Bitmap_LockBits(Bitmap* bitmap, Rect* rect, int flags, int pixelFormat, BitmapData* lockedBitmapData); | |
247 int Bitmap_UnlockBits(Bitmap* bitmap, BitmapData* lockedBitmapData); | |
248 | |
249 BitmapData* BitmapData_new(); | |
250 void BitmapData_delete(BitmapData* bitmapData); | |
251 | |
252 int Image_GetLastStatus(Image* image); | |
253 int Image_GetPixelFormat(Image* image); | |
254 uint Image_GetWidth(Image* image); | |
255 uint Image_GetHeight(Image* image); | |
256 int Image_GetPalette(Image* image, ColorPalette* palette, int size); | |
257 int Image_GetPaletteSize(Image* image); | |
19 | 258 |
24 | 259 Graphics* Graphics_new(HDC hdc); |
260 void Graphics_delete(Graphics* graphics); | |
261 int Graphics_DrawArc(Graphics* graphics, Pen* pen, int x, int y, int width, int height, float startAngle, float sweepAngle); | |
262 int Graphics_DrawEllipse(Graphics* graphics, Pen* pen, int x, int y, int width, int height); | |
263 int Graphics_DrawImage(Graphics* graphics, Image* image, int x, int y); | |
264 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); | |
265 int Graphics_DrawLine(Graphics* graphics, Pen* pen, int x1, int y1, int x2, int y2); | |
25 | 266 int Graphics_DrawLines(Graphics* graphics, Pen* pen, Point* points, int count); |
24 | 267 int Graphics_DrawPath(Graphics* graphics, Pen* pen, GraphicsPath* path); |
268 int Graphics_DrawPolygon(Graphics* graphics, Pen* pen, int[] points, int count); | |
269 int Graphics_DrawRectangle(Graphics* graphics, Pen* pen, int x, int y, int width, int height); | |
270 int Graphics_DrawString(Graphics* graphics, wchar* string, int length, Font* font, PointF origin, Brush* brush); | |
271 int Graphics_DrawString(Graphics* graphics, wchar* string, int length, Font* font, PointF origin, StringFormat* format, Brush* brush); | |
272 int Graphics_FillEllipse(Graphics* graphics, Brush* brush, int x, int y, int width, int height); | |
273 int Graphics_FillPath(Graphics* graphics, Brush* brush, GraphicsPath* path); | |
274 void Graphics_Flush(Graphics* graphics, int intention); | |
275 int Graphics_FillPie(Graphics* graphics, Brush* brush, int x, int y, int width, int height, float startAngle, float sweepAngle); | |
276 int Graphics_FillPolygon(Graphics* graphics, Brush* brush, int[] points, int count, int fillMode); | |
277 int Graphics_FillRectangle(Graphics* graphics, Brush* brush, int x, int y, int width, int height); | |
278 int Graphics_GetClipBounds(Graphics* graphics, RectF rect); | |
279 int Graphics_GetClipBounds(Graphics* graphics, Rect rect); | |
280 int Graphics_GetClip(Graphics* graphics, Region* region); | |
281 HDC Graphics_GetHDC(Graphics* graphics); | |
282 void Graphics_ReleaseHDC(Graphics* graphics, HDC hdc); | |
283 int Graphics_GetInterpolationMode(Graphics* graphics); | |
284 int Graphics_GetSmoothingMode(Graphics* graphics); | |
285 int Graphics_GetTextRenderingHint(Graphics* graphics); | |
286 int Graphics_GetTransform(Graphics* graphics, Matrix* matrix); | |
287 int Graphics_GetVisibleClipBounds(Graphics* graphics, Rect rect); | |
25 | 288 int Graphics_MeasureString(Graphics* graphics, wchar* string, int length, Font* font, PointF origin, RectF* boundingBox); |
289 int Graphics_MeasureString(Graphics* graphics, wchar* string, int length, Font* font, PointF origin, StringFormat* format, RectF* boundingBox); | |
24 | 290 int Graphics_ResetClip(Graphics* graphics); |
291 int Graphics_Restore(Graphics* graphics, int gstate); | |
292 int Graphics_Save(Graphics* graphics); | |
293 int Graphics_ScaleTransform(Graphics* graphics, float sx, float sy, int order); | |
294 int Graphics_SetClip(Graphics* graphics, HRGN hrgn, int combineMode); | |
295 int Graphics_SetClip(Graphics* graphics, GraphicsPath* path); | |
296 int Graphics_SetClip(Graphics* graphics, Rect rect, int combineMode); | |
297 int Graphics_SetCompositingQuality(Graphics* graphics, int compositingQuality); | |
298 int Graphics_SetPageUnit(Graphics* graphics, int unit); | |
299 int Graphics_SetPixelOffsetMode(Graphics* graphics, int pixelOffsetMode); | |
300 int Graphics_SetSmoothingMode(Graphics* graphics, int smoothingMode); | |
301 int Graphics_SetTransform(Graphics* graphics, Matrix* matrix); | |
302 int Graphics_SetInterpolationMode(Graphics* graphics, int mode); | |
303 int Graphics_SetTextRenderingHint(Graphics* graphics, int mode); | |
304 int Graphics_TranslateTransform(Graphics* graphics, float dx, float dy, int order); | |
22
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
305 |
24 | 306 SolidBrush* SolidBrush_new(Color* color); |
307 void SolidBrush_delete(SolidBrush* brush); | |
308 | |
309 Brush* Brush_Clone(Brush* brush); | |
310 int Brush_GetType(Brush* brush); | |
311 | |
312 TextureBrush* TextureBrush_new(Image* image, int wrapMode, float dstX, float dstY, float dstWidth, float dstHeight); | |
313 void TextureBrush_delete(TextureBrush* brush); | |
314 int TextureBrush_SetTransform(TextureBrush* brush, Matrix* matrix); | |
315 int TextureBrush_ResetTransform(TextureBrush* brush); | |
316 int TextureBrush_ScaleTransform(TextureBrush* brush, float sx, float sy, int order); | |
317 int TextureBrush_TranslateTransform(TextureBrush* brush, float dx, float dy, int order); | |
318 | |
319 Color* Color_new(int argb); | |
320 void Color_delete(Color* color); | |
321 | |
322 | |
323 Pen* Pen_new(Brush* brush, float width); | |
324 void Pen_delete(Pen* pen); | |
325 Brush* Pen_GetBrush(Pen* pen); | |
326 int Pen_SetBrush(Pen* pen, Brush* brush); | |
327 int Pen_SetDashOffset(Pen* pen, float dashOffset); | |
328 int Pen_SetDashPattern(Pen* pen, float* dashArray, int count); | |
329 int Pen_SetDashStyle(Pen* pen, int dashStyle); | |
330 int Pen_SetLineCap(Pen* pen, int startCap, int endCap, int dashCap); | |
331 int Pen_SetLineJoin(Pen* pen, int lineJoin); | |
332 int Pen_SetMiterLimit(Pen* pen, float miterLimit); | |
333 int Pen_SetWidth(Pen* pen, float width); | |
334 | |
335 Font* Font_new(HDC hdc, HFONT hfont); | |
336 Font* Font_new(wchar* familyName, float emSize, int style, int unit, FontCollection* fontCollection); | |
337 void Font_delete(Font* font); | |
338 int Font_GetFamily(Font* font, FontFamily* family); | |
339 float Font_GetSize(Font* font); | |
340 int Font_GetStyle(Font* font); | |
341 bool Font_IsAvailable(Font* font); | |
342 | |
343 | |
344 void HatchBrush_delete(HatchBrush* brush); | |
345 | |
346 LinearGradientBrush* LinearGradientBrush_new(PointF point1, PointF point2, Color* color1, Color* color2); | |
347 void LinearGradientBrush_delete(LinearGradientBrush* brush); | |
348 int LinearGradientBrush_SetInterpolationColors(LinearGradientBrush* brush, Color* presetColors, float* blendPositions, int count); | |
349 int LinearGradientBrush_SetWrapMode(LinearGradientBrush* brush, int wrapMode); | |
350 int LinearGradientBrush_ResetTransform(LinearGradientBrush* brush); | |
351 int LinearGradientBrush_ScaleTransform(LinearGradientBrush* brush, float sx, float sy, int order); | |
352 int LinearGradientBrush_TranslateTransform(LinearGradientBrush* brush, float dx, float dy, int order); | |
353 | |
354 GraphicsPath* GraphicsPath_new(int fillMode); | |
355 GraphicsPath* GraphicsPath_new(Point* points, byte* types, int count, int fillMode); | |
356 void GraphicsPath_delete(GraphicsPath* path); | |
357 int GraphicsPath_AddArc(GraphicsPath* path, float x, float y, float width, float height, float startAngle, float sweepAngle); | |
358 int GraphicsPath_AddBezier(GraphicsPath* path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4); | |
359 int GraphicsPath_AddLine(GraphicsPath* path, float x1, float y1, float x2, float y2); | |
360 int GraphicsPath_AddPath(GraphicsPath* path, GraphicsPath* addingPath, bool connect); | |
361 int GraphicsPath_AddRectangle(GraphicsPath* path, RectF* rect); | |
362 int GraphicsPath_AddString(GraphicsPath* path, wchar* string, int length, FontFamily* family, int style, float emSize, PointF origin, StringFormat* format); | |
363 int GraphicsPath_CloseFigure(GraphicsPath* path); | |
364 int GraphicsPath_Flatten(GraphicsPath* path, Matrix* matrix, float flatness); | |
365 int GraphicsPath_GetBounds(GraphicsPath* path, RectF bounds, Matrix* matrix, Pen* pen); | |
366 int GraphicsPath_GetLastPoint(GraphicsPath* path, PointF lastPoint); | |
367 int GraphicsPath_GetPathPoints(GraphicsPath* path, float* points, int count); | |
368 int GraphicsPath_GetPathTypes(GraphicsPath* path, byte[] types, int count); | |
369 int GraphicsPath_GetPointCount(GraphicsPath* path); | |
370 bool GraphicsPath_IsOutlineVisible(GraphicsPath* path, float x, float y, Pen* pen, Graphics* g); | |
371 bool GraphicsPath_IsVisible(GraphicsPath* path, float x, float y, Graphics* g); | |
372 int GraphicsPath_SetFillMode(GraphicsPath* path, int fillmode); | |
373 int GraphicsPath_StartFigure(GraphicsPath* path); | |
374 int GraphicsPath_Transform(GraphicsPath* path, Matrix* matrix); | |
375 | |
376 Region* Region_new(HRGN hRgn); | |
377 Region* Region_new(); | |
378 void Region_delete(Region* region); | |
379 HRGN Region_GetHRGN(Region* region, Graphics* graphics); | |
380 bool Region_IsInfinite(Region* region, Graphics* graphics); | |
381 | |
382 ImageAttributes* ImageAttributes_new(); | |
383 void ImageAttributes_delete(ImageAttributes* attrib); | |
384 int ImageAttributes_SetWrapMode(ImageAttributes* attrib, int wrap); | |
385 int ImageAttributes_SetColorMatrix(ImageAttributes* attrib, float* matrix, int mode, int type); | |
25 | 386 |
387 void StringFormat_delete(StringFormat* format); | |
388 StringFormat* StringFormat_Clone(StringFormat* format); | |
389 StringFormat* StringFormat_GenericDefault(); | |
390 StringFormat* StringFormat_GenericTypographic(); | |
391 int StringFormat_GetFormatFlags(StringFormat* format); | |
392 int StringFormat_SetHotkeyPrefix(StringFormat* format, int hotkeyPrefix); | |
393 int StringFormat_SetFormatFlags(StringFormat* format, int flags); | |
394 int StringFormat_SetTabStops(StringFormat* format, float firstTabOffset, int count, float* tabStops); | |
395 | |
26 | 396 FontFamily* FontFamily_new(); |
397 void FontFamily_delete(FontFamily* family); | |
398 int FontFamily_GetFamilyName(FontFamily* family, wchar* name, wchar language); | |
24 | 399 } |
400 | |
22
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
401 |
5f2e72114476
Image in work, this revision does not compile
Frank Benoit <benoit@tionex.de>
parents:
21
diff
changeset
|
402 |
19 | 403 /++ |
404 /** 64 bit */ | |
405 public static final native int ColorPalette_sizeof(); | |
406 public static final native int GdiplusStartupInput_sizeof(); | |
407 | |
408 /** GdiPlus natives */ | |
409 public static final native int GdiplusStartup(int /*long*/[] token, GdiplusStartupInput input, int /*long*/ output); | |
410 public static final native void GdiplusShutdown(int /*long*/ token); | |
411 public static final native int /*long*/ Bitmap_new(int /*long*/ hbm, int /*long*/ hpal); | |
412 public static final native int /*long*/ Bitmap_new(int /*long*/ hicon); | |
413 public static final native int /*long*/ Bitmap_new(int width, int height, int stride, int format, int /*long*/ scan0); | |
414 public static final native int /*long*/ Bitmap_new(char[] filename, bool useIcm); | |
415 public static final native void Bitmap_delete(int /*long*/ bitmap); | |
416 public static final native int Bitmap_GetHBITMAP(int /*long*/ bitmap, int /*long*/ colorBackground, int /*long*/[] hbmReturn); | |
417 public static final native int Bitmap_GetHICON(int /*long*/ bitmap, int /*long*/[] hicon); | |
418 public static final native int /*long*/ BitmapData_new(); | |
419 public static final native void BitmapData_delete(int /*long*/ bitmapData); | |
420 public static final native int Bitmap_LockBits(int /*long*/ bitmap, int /*long*/ rect, int flags, int pixelFormat, int /*long*/ lockedBitmapData); | |
421 public static final native int Bitmap_UnlockBits(int /*long*/ bitmap, int /*long*/ lockedBitmapData); | |
422 public static final native int /*long*/ Brush_Clone(int /*long*/ brush); | |
423 public static final native int Brush_GetType(int /*long*/ brush); | |
424 public static final native int /*long*/ Color_new(int argb); | |
425 public static final native void Color_delete(int /*long*/ color); | |
426 public static final native int /*long*/ Font_new(int /*long*/ hdc, int /*long*/ hfont); | |
427 public static final native int /*long*/ Font_new(char[] familyName, float emSize, int style, int unit, int /*long*/ fontCollection); | |
428 public static final native void Font_delete(int /*long*/ font); | |
429 public static final native int Font_GetFamily(int /*long*/ font, int /*long*/ family); | |
430 public static final native float Font_GetSize(int /*long*/ font); | |
431 public static final native int Font_GetStyle(int /*long*/ font); | |
432 public static final native bool Font_IsAvailable(int /*long*/ font); | |
433 public static final native int /*long*/ FontFamily_new(); | |
434 public static final native void FontFamily_delete(int /*long*/ family); | |
435 public static final native int FontFamily_GetFamilyName(int /*long*/ family, char[] name, char language); | |
436 public static final native int /*long*/ Graphics_new(int /*long*/ hdc); | |
437 public static final native void Graphics_delete(int /*long*/ graphics); | |
438 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); | |
439 public static final native int Graphics_DrawEllipse(int /*long*/ graphics, int /*long*/ pen, int x, int y, int width, int height); | |
440 public static final native int Graphics_DrawImage(int /*long*/ graphics, int /*long*/ image, int x, int y); | |
441 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); | |
442 public static final native int Graphics_DrawLine(int /*long*/ graphics, int /*long*/ pen, int x1, int y1, int x2, int y2); | |
443 public static final native int Graphics_DrawLines(int /*long*/ graphics, int /*long*/ pen, int[] points, int count); | |
444 public static final native int Graphics_DrawPath(int /*long*/ graphics, int /*long*/ pen, int /*long*/ path); | |
445 public static final native int Graphics_DrawPolygon(int /*long*/ graphics, int /*long*/ pen, int[] points, int count); | |
446 public static final native int Graphics_DrawRectangle(int /*long*/ graphics, int /*long*/ pen, int x, int y, int width, int height); | |
447 public static final native int Graphics_DrawString(int /*long*/ graphics, char[] string, int length, int /*long*/ font, PointF origin, int /*long*/ brush); | |
448 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); | |
449 public static final native int Graphics_FillEllipse(int /*long*/ graphics, int /*long*/ brush, int x, int y, int width, int height); | |
450 public static final native int Graphics_FillPath(int /*long*/ graphics, int /*long*/ brush, int /*long*/ path); | |
451 public static final native void Graphics_Flush(int /*long*/ graphics, int intention); | |
452 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); | |
453 public static final native int Graphics_FillPolygon(int /*long*/ graphics, int /*long*/ brush, int[] points, int count, int fillMode); | |
454 public static final native int Graphics_FillRectangle(int /*long*/ graphics, int /*long*/ brush, int x, int y, int width, int height); | |
455 public static final native int Graphics_GetClipBounds(int /*long*/ graphics, RectF rect); | |
456 public static final native int Graphics_GetClipBounds(int /*long*/ graphics, Rect rect); | |
457 public static final native int Graphics_GetClip(int /*long*/ graphics, int /*long*/ region); | |
458 public static final native int /*long*/ Graphics_GetHDC(int /*long*/ graphics); | |
459 public static final native void Graphics_ReleaseHDC(int /*long*/ graphics, int /*long*/ hdc); | |
460 public static final native int Graphics_GetInterpolationMode(int /*long*/ graphics); | |
461 public static final native int Graphics_GetSmoothingMode(int /*long*/ graphics); | |
462 public static final native int Graphics_GetTextRenderingHint(int /*long*/ graphics); | |
463 public static final native int Graphics_GetTransform(int /*long*/ graphics, int /*long*/ matrix); | |
464 public static final native int Graphics_GetVisibleClipBounds(int /*long*/ graphics, Rect rect); | |
465 public static final native int Graphics_MeasureString(int /*long*/ graphics, char[] string, int length, int /*long*/ font, PointF origin, RectF boundingBox); | |
466 public static final native int Graphics_MeasureString(int /*long*/ graphics, char[] string, int length, int /*long*/ font, PointF origin, int /*long*/ format, RectF boundingBox); | |
467 public static final native int Graphics_ResetClip(int /*long*/ graphics); | |
468 public static final native int Graphics_Restore(int /*long*/ graphics, int gstate); | |
469 public static final native int Graphics_Save(int /*long*/ graphics); | |
470 public static final native int Graphics_ScaleTransform(int /*long*/ graphics, float sx, float sy, int order); | |
471 public static final native int Graphics_SetClip(int /*long*/ graphics, int /*long*/ hrgn, int combineMode); | |
472 public static final native int Graphics_SetClip(int /*long*/ graphics, int /*long*/ path); | |
473 public static final native int Graphics_SetClip(int /*long*/ graphics, Rect rect, int combineMode); | |
474 public static final native int Graphics_SetCompositingQuality(int /*long*/ graphics, int compositingQuality); | |
475 public static final native int Graphics_SetPageUnit(int /*long*/ graphics, int unit); | |
476 public static final native int Graphics_SetPixelOffsetMode(int /*long*/ graphics, int pixelOffsetMode); | |
477 public static final native int Graphics_SetSmoothingMode(int /*long*/ graphics, int smoothingMode); | |
478 public static final native int Graphics_SetTransform(int /*long*/ graphics, int /*long*/ matrix); | |
479 public static final native int Graphics_SetInterpolationMode(int /*long*/ graphics, int mode); | |
480 public static final native int Graphics_SetTextRenderingHint(int /*long*/ graphics, int mode); | |
481 public static final native int Graphics_TranslateTransform(int /*long*/ graphics, float dx, float dy, int order); | |
482 public static final native int /*long*/ GraphicsPath_new(int fillMode); | |
483 public static final native int /*long*/ GraphicsPath_new(int[] points, byte[] types, int count, int fillMode); | |
484 public static final native void GraphicsPath_delete(int /*long*/ path); | |
485 public static final native int GraphicsPath_AddArc(int /*long*/ path, float x, float y, float width, float height, float startAngle, float sweepAngle); | |
486 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); | |
487 public static final native int GraphicsPath_AddLine(int /*long*/ path, float x1, float y1, float x2, float y2); | |
488 public static final native int GraphicsPath_AddPath(int /*long*/ path, int /*long*/ addingPath, bool connect); | |
489 public static final native int GraphicsPath_AddRectangle(int /*long*/ path, RectF rect); | |
490 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); | |
491 public static final native int GraphicsPath_CloseFigure(int /*long*/ path); | |
492 public static final native int GraphicsPath_Flatten(int /*long*/ path, int /*long*/ matrix, float flatness); | |
493 public static final native int GraphicsPath_GetBounds(int /*long*/ path, RectF bounds, int /*long*/ matrix, int /*long*/ pen); | |
494 public static final native int GraphicsPath_GetLastPoint(int /*long*/ path, PointF lastPoint); | |
495 public static final native int GraphicsPath_GetPathPoints(int /*long*/ path, float[] points, int count); | |
496 public static final native int GraphicsPath_GetPathTypes(int /*long*/ path, byte[] types, int count); | |
497 public static final native int GraphicsPath_GetPointCount(int /*long*/ path); | |
498 public static final native bool GraphicsPath_IsOutlineVisible(int /*long*/ path, float x, float y, int /*long*/ pen, int /*long*/ g); | |
499 public static final native bool GraphicsPath_IsVisible(int /*long*/ path, float x, float y, int /*long*/ g); | |
500 public static final native int GraphicsPath_SetFillMode(int /*long*/ path, int fillmode); | |
501 public static final native int GraphicsPath_StartFigure(int /*long*/ path); | |
502 public static final native int GraphicsPath_Transform(int /*long*/ path, int /*long*/ matrix); | |
503 public static final native int /*long*/ HatchBrush_new(int hatchStyle, int /*long*/ foreColor, int /*long*/ backColor); | |
504 public static final native int Image_GetLastStatus(int /*long*/ image); | |
505 public static final native int Image_GetPixelFormat(int /*long*/ image); | |
506 public static final native int Image_GetWidth(int /*long*/ image); | |
507 public static final native int Image_GetHeight(int /*long*/ image); | |
508 public static final native int Image_GetPalette(int /*long*/ image, int /*long*/ palette, int size); | |
509 public static final native int Image_GetPaletteSize(int /*long*/ image); | |
510 public static final native int /*long*/ ImageAttributes_new(); | |
511 public static final native void ImageAttributes_delete(int /*long*/ attrib); | |
512 public static final native int ImageAttributes_SetWrapMode(int /*long*/ attrib, int wrap); | |
513 public static final native int ImageAttributes_SetColorMatrix(int /*long*/ attrib, float[] matrix, int mode, int type); | |
514 public static final native void HatchBrush_delete(int /*long*/ brush); | |
515 public static final native int /*long*/ LinearGradientBrush_new(PointF point1, PointF point2, int /*long*/ color1, int /*long*/ color2); | |
516 public static final native void LinearGradientBrush_delete(int /*long*/ brush); | |
517 public static final native int LinearGradientBrush_SetInterpolationColors(int /*long*/ brush, int /*long*/[] presetColors, float[] blendPositions, int count); | |
518 public static final native int LinearGradientBrush_SetWrapMode(int /*long*/ brush, int wrapMode); | |
519 public static final native int LinearGradientBrush_ResetTransform(int /*long*/ brush); | |
520 public static final native int LinearGradientBrush_ScaleTransform(int /*long*/ brush, float sx, float sy, int order); | |
521 public static final native int LinearGradientBrush_TranslateTransform(int /*long*/ brush, float dx, float dy, int order); | |
522 public static final native int /*long*/ Matrix_new(float m11, float m12, float m21, float m22, float dx, float dy); | |
523 public static final native void Matrix_delete(int /*long*/ matrix); | |
524 public static final native int Matrix_GetElements(int /*long*/ matrix, float[] m); | |
525 public static final native int Matrix_Invert(int /*long*/ matrix); | |
526 public static final native bool Matrix_IsIdentity(int /*long*/ matrix); | |
527 public static final native int Matrix_Multiply(int /*long*/ matrix, int /*long*/ matrix1, int order); | |
528 public static final native int Matrix_Rotate(int /*long*/ matrix, float angle, int order); | |
529 public static final native int Matrix_Scale(int /*long*/ matrix, float scaleX, float scaleY, int order); | |
530 public static final native int Matrix_Shear(int /*long*/ matrix, float shearX, float shearY, int order); | |
531 public static final native int Matrix_TransformPoints(int /*long*/ matrix, PointF pts, int count); | |
532 public static final native int Matrix_TransformPoints(int /*long*/ matrix, float[] pts, int count); | |
533 public static final native int Matrix_Translate(int /*long*/ matrix, float offsetX, float offsetY, int order); | |
534 public static final native int Matrix_SetElements(int /*long*/ matrix, float m11, float m12, float m21, float m22, float dx, float dy); | |
535 public static final native void MoveMemory(ColorPalette Destination, int /*long*/ SourcePtr, int Length); | |
536 public static final native void MoveMemory(BitmapData Destination, int /*long*/ SourcePtr); | |
537 public static final native int /*long*/ PathGradientBrush_new(int /*long*/ path); | |
538 public static final native void PathGradientBrush_delete(int /*long*/ brush); | |
539 public static final native int PathGradientBrush_SetCenterColor(int /*long*/ brush, int /*long*/ color); | |
540 public static final native int PathGradientBrush_SetCenterPoint(int /*long*/ brush, PointF pt); | |
541 public static final native int PathGradientBrush_SetSurroundColors(int /*long*/ brush, int /*long*/[] colors, int[] count); | |
542 public static final native int PathGradientBrush_SetGraphicsPath(int /*long*/ brush, int /*long*/ path); | |
543 public static final native int /*long*/ Pen_new(int /*long*/ brush, float width); | |
544 public static final native void Pen_delete(int /*long*/ pen); | |
545 public static final native int /*long*/ Pen_GetBrush(int /*long*/ pen); | |
546 public static final native int Pen_SetBrush(int /*long*/ pen, int /*long*/ brush); | |
547 public static final native int Pen_SetDashOffset(int /*long*/ pen, float dashOffset); | |
548 public static final native int Pen_SetDashPattern(int /*long*/ pen, float[] dashArray, int count); | |
549 public static final native int Pen_SetDashStyle(int /*long*/ pen, int dashStyle); | |
550 public static final native int Pen_SetLineCap(int /*long*/ pen, int startCap, int endCap, int dashCap); | |
551 public static final native int Pen_SetLineJoin(int /*long*/ pen, int lineJoin); | |
552 public static final native int Pen_SetMiterLimit(int /*long*/ pen, float miterLimit); | |
553 public static final native int Pen_SetWidth(int /*long*/ pen, float width); | |
554 public static final native int /*long*/ Point_new(int x, int y); | |
555 public static final native void Point_delete(int /*long*/ point); | |
556 public static final native int /*long*/ Region_new(int /*long*/ hRgn); | |
557 public static final native int /*long*/ Region_new(); | |
558 public static final native void Region_delete(int /*long*/ region); | |
559 public static final native int /*long*/ Region_GetHRGN(int /*long*/ region, int /*long*/ graphics); | |
560 public static final native bool Region_IsInfinite(int /*long*/ region, int /*long*/ graphics); | |
561 public static final native int /*long*/ SolidBrush_new(int /*long*/ color); | |
562 public static final native void SolidBrush_delete(int /*long*/ brush); | |
563 public static final native void StringFormat_delete(int /*long*/ format); | |
564 public static final native int /*long*/ StringFormat_Clone(int /*long*/ format); | |
565 public static final native int /*long*/ StringFormat_GenericDefault(); | |
566 public static final native int /*long*/ StringFormat_GenericTypographic(); | |
567 public static final native int StringFormat_GetFormatFlags(int /*long*/ format); | |
568 public static final native int StringFormat_SetHotkeyPrefix(int /*long*/ format, int hotkeyPrefix); | |
569 public static final native int StringFormat_SetFormatFlags(int /*long*/ format, int flags); | |
570 public static final native int StringFormat_SetTabStops(int /*long*/ format, float firstTabOffset, int count, float[] tabStops); | |
571 public static final native int /*long*/ TextureBrush_new(int /*long*/ image, int wrapMode, float dstX, float dstY, float dstWidth, float dstHeight); | |
572 public static final native void TextureBrush_delete(int /*long*/ brush); | |
573 public static final native int TextureBrush_SetTransform(int /*long*/ brush, int /*long*/ matrix); | |
574 public static final native int TextureBrush_ResetTransform(int /*long*/ brush); | |
575 public static final native int TextureBrush_ScaleTransform(int /*long*/ brush, float sx, float sy, int order); | |
576 public static final native int TextureBrush_TranslateTransform(int /*long*/ brush, float dx, float dy, int order); | |
577 ++/ | |
578 } |