Added
Link Here
|
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2012 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 |
package org.eclipse.swt.internal.d2d; |
12 |
|
13 |
import org.eclipse.swt.internal.*; |
14 |
import org.eclipse.swt.internal.ole.win32.*; |
15 |
|
16 |
|
17 |
/** @jniclass flags=cpp */ |
18 |
public class D2d extends C { |
19 |
|
20 |
static { |
21 |
Library.loadLibrary ("swt-d2d"); //$NON-NLS-1$ |
22 |
} |
23 |
|
24 |
// ------------------------------------------------------------------------------------- |
25 |
|
26 |
static int sc_redShift = 16; |
27 |
static int sc_greenShift = 8; |
28 |
static int sc_blueShift = 0; |
29 |
|
30 |
static int sc_redMask = 0xff << sc_redShift; |
31 |
static int sc_greenMask = 0xff << sc_greenShift; |
32 |
static int sc_blueMask = 0xff << sc_blueShift; |
33 |
public static final D2D1_COLOR_F fromRGB(int rgb) { |
34 |
D2D1_COLOR_F color = new D2D1_COLOR_F(); |
35 |
color.a = 1.0f; |
36 |
color.r = ((rgb & sc_redMask) >> sc_redShift) / 255.f; |
37 |
color.g = ((rgb & sc_greenMask) >> sc_greenShift) / 255.f; |
38 |
color.b = ((rgb & sc_blueMask) >> sc_blueShift) / 255.f; |
39 |
return color; |
40 |
} |
41 |
|
42 |
public static final D2D1_COLOR_F AliceBlue = fromRGB(0xF0F8FF); |
43 |
public static final D2D1_COLOR_F AntiqueWhite = fromRGB(0xFAEBD7); |
44 |
public static final D2D1_COLOR_F Aqua = fromRGB(0x00FFFF); |
45 |
public static final D2D1_COLOR_F Aquamarine = fromRGB(0x7FFFD4); |
46 |
public static final D2D1_COLOR_F Azure = fromRGB(0xF0FFFF); |
47 |
public static final D2D1_COLOR_F Beige = fromRGB(0xF5F5DC); |
48 |
public static final D2D1_COLOR_F Bisque = fromRGB(0xFFE4C4); |
49 |
public static final D2D1_COLOR_F Black = fromRGB(0x000000); |
50 |
public static final D2D1_COLOR_F BlanchedAlmond = fromRGB(0xFFEBCD); |
51 |
public static final D2D1_COLOR_F Blue = fromRGB(0x0000FF); |
52 |
public static final D2D1_COLOR_F BlueViolet = fromRGB(0x8A2BE2); |
53 |
public static final D2D1_COLOR_F Brown = fromRGB(0xA52A2A); |
54 |
public static final D2D1_COLOR_F BurlyWood = fromRGB(0xDEB887); |
55 |
public static final D2D1_COLOR_F CadetBlue = fromRGB(0x5F9EA0); |
56 |
public static final D2D1_COLOR_F Chartreuse = fromRGB(0x7FFF00); |
57 |
public static final D2D1_COLOR_F Chocolate = fromRGB(0xD2691E); |
58 |
public static final D2D1_COLOR_F Coral = fromRGB(0xFF7F50); |
59 |
public static final D2D1_COLOR_F CornflowerBlue = fromRGB(0x6495ED); |
60 |
public static final D2D1_COLOR_F Cornsilk = fromRGB(0xFFF8DC); |
61 |
public static final D2D1_COLOR_F Crimson = fromRGB(0xDC143C); |
62 |
public static final D2D1_COLOR_F Cyan = fromRGB(0x00FFFF); |
63 |
public static final D2D1_COLOR_F DarkBlue = fromRGB(0x00008B); |
64 |
public static final D2D1_COLOR_F DarkCyan = fromRGB(0x008B8B); |
65 |
public static final D2D1_COLOR_F DarkGoldenrod = fromRGB(0xB8860B); |
66 |
public static final D2D1_COLOR_F DarkGray = fromRGB(0xA9A9A9); |
67 |
public static final D2D1_COLOR_F DarkGreen = fromRGB(0x006400); |
68 |
public static final D2D1_COLOR_F DarkKhaki = fromRGB(0xBDB76B); |
69 |
public static final D2D1_COLOR_F DarkMagenta = fromRGB(0x8B008B); |
70 |
public static final D2D1_COLOR_F DarkOliveGreen = fromRGB(0x556B2F); |
71 |
public static final D2D1_COLOR_F DarkOrange = fromRGB(0xFF8C00); |
72 |
public static final D2D1_COLOR_F DarkOrchid = fromRGB(0x9932CC); |
73 |
public static final D2D1_COLOR_F DarkRed = fromRGB(0x8B0000); |
74 |
public static final D2D1_COLOR_F DarkSalmon = fromRGB(0xE9967A); |
75 |
public static final D2D1_COLOR_F DarkSeaGreen = fromRGB(0x8FBC8F); |
76 |
public static final D2D1_COLOR_F DarkSlateBlue = fromRGB(0x483D8B); |
77 |
public static final D2D1_COLOR_F DarkSlateGray = fromRGB(0x2F4F4F); |
78 |
public static final D2D1_COLOR_F DarkTurquoise = fromRGB(0x00CED1); |
79 |
public static final D2D1_COLOR_F DarkViolet = fromRGB(0x9400D3); |
80 |
public static final D2D1_COLOR_F DeepPink = fromRGB(0xFF1493); |
81 |
public static final D2D1_COLOR_F DeepSkyBlue = fromRGB(0x00BFFF); |
82 |
public static final D2D1_COLOR_F DimGray = fromRGB(0x696969); |
83 |
public static final D2D1_COLOR_F DodgerBlue = fromRGB(0x1E90FF); |
84 |
public static final D2D1_COLOR_F Firebrick = fromRGB(0xB22222); |
85 |
public static final D2D1_COLOR_F FloralWhite = fromRGB(0xFFFAF0); |
86 |
public static final D2D1_COLOR_F ForestGreen = fromRGB(0x228B22); |
87 |
public static final D2D1_COLOR_F Fuchsia = fromRGB(0xFF00FF); |
88 |
public static final D2D1_COLOR_F Gainsboro = fromRGB(0xDCDCDC); |
89 |
public static final D2D1_COLOR_F GhostWhite = fromRGB(0xF8F8FF); |
90 |
public static final D2D1_COLOR_F Gold = fromRGB(0xFFD700); |
91 |
public static final D2D1_COLOR_F Goldenrod = fromRGB(0xDAA520); |
92 |
public static final D2D1_COLOR_F Gray = fromRGB(0x808080); |
93 |
public static final D2D1_COLOR_F Green = fromRGB(0x008000); |
94 |
public static final D2D1_COLOR_F GreenYellow = fromRGB(0xADFF2F); |
95 |
public static final D2D1_COLOR_F Honeydew = fromRGB(0xF0FFF0); |
96 |
public static final D2D1_COLOR_F HotPink = fromRGB(0xFF69B4); |
97 |
public static final D2D1_COLOR_F IndianRed = fromRGB(0xCD5C5C); |
98 |
public static final D2D1_COLOR_F Indigo = fromRGB(0x4B0082); |
99 |
public static final D2D1_COLOR_F Ivory = fromRGB(0xFFFFF0); |
100 |
public static final D2D1_COLOR_F Khaki = fromRGB(0xF0E68C); |
101 |
public static final D2D1_COLOR_F Lavender = fromRGB(0xE6E6FA); |
102 |
public static final D2D1_COLOR_F LavenderBlush = fromRGB(0xFFF0F5); |
103 |
public static final D2D1_COLOR_F LawnGreen = fromRGB(0x7CFC00); |
104 |
public static final D2D1_COLOR_F LemonChiffon = fromRGB(0xFFFACD); |
105 |
public static final D2D1_COLOR_F LightBlue = fromRGB(0xADD8E6); |
106 |
public static final D2D1_COLOR_F LightCoral = fromRGB(0xF08080); |
107 |
public static final D2D1_COLOR_F LightCyan = fromRGB(0xE0FFFF); |
108 |
public static final D2D1_COLOR_F LightGoldenrodYellow = fromRGB(0xFAFAD2); |
109 |
public static final D2D1_COLOR_F LightGreen = fromRGB(0x90EE90); |
110 |
public static final D2D1_COLOR_F LightGray = fromRGB(0xD3D3D3); |
111 |
public static final D2D1_COLOR_F LightPink = fromRGB(0xFFB6C1); |
112 |
public static final D2D1_COLOR_F LightSalmon = fromRGB(0xFFA07A); |
113 |
public static final D2D1_COLOR_F LightSeaGreen = fromRGB(0x20B2AA); |
114 |
public static final D2D1_COLOR_F LightSkyBlue = fromRGB(0x87CEFA); |
115 |
public static final D2D1_COLOR_F LightSlateGray = fromRGB(0x778899); |
116 |
public static final D2D1_COLOR_F LightSteelBlue = fromRGB(0xB0C4DE); |
117 |
public static final D2D1_COLOR_F LightYellow = fromRGB(0xFFFFE0); |
118 |
public static final D2D1_COLOR_F Lime = fromRGB(0x00FF00); |
119 |
public static final D2D1_COLOR_F LimeGreen = fromRGB(0x32CD32); |
120 |
public static final D2D1_COLOR_F Linen = fromRGB(0xFAF0E6); |
121 |
public static final D2D1_COLOR_F Magenta = fromRGB(0xFF00FF); |
122 |
public static final D2D1_COLOR_F Maroon = fromRGB(0x800000); |
123 |
public static final D2D1_COLOR_F MediumAquamarine = fromRGB(0x66CDAA); |
124 |
public static final D2D1_COLOR_F MediumBlue = fromRGB(0x0000CD); |
125 |
public static final D2D1_COLOR_F MediumOrchid = fromRGB(0xBA55D3); |
126 |
public static final D2D1_COLOR_F MediumPurple = fromRGB(0x9370DB); |
127 |
public static final D2D1_COLOR_F MediumSeaGreen = fromRGB(0x3CB371); |
128 |
public static final D2D1_COLOR_F MediumSlateBlue = fromRGB(0x7B68EE); |
129 |
public static final D2D1_COLOR_F MediumSpringGreen = fromRGB(0x00FA9A); |
130 |
public static final D2D1_COLOR_F MediumTurquoise = fromRGB(0x48D1CC); |
131 |
public static final D2D1_COLOR_F MediumVioletRed = fromRGB(0xC71585); |
132 |
public static final D2D1_COLOR_F MidnightBlue = fromRGB(0x191970); |
133 |
public static final D2D1_COLOR_F MintCream = fromRGB(0xF5FFFA); |
134 |
public static final D2D1_COLOR_F MistyRose = fromRGB(0xFFE4E1); |
135 |
public static final D2D1_COLOR_F Moccasin = fromRGB(0xFFE4B5); |
136 |
public static final D2D1_COLOR_F NavajoWhite = fromRGB(0xFFDEAD); |
137 |
public static final D2D1_COLOR_F Navy = fromRGB(0x000080); |
138 |
public static final D2D1_COLOR_F OldLace = fromRGB(0xFDF5E6); |
139 |
public static final D2D1_COLOR_F Olive = fromRGB(0x808000); |
140 |
public static final D2D1_COLOR_F OliveDrab = fromRGB(0x6B8E23); |
141 |
public static final D2D1_COLOR_F Orange = fromRGB(0xFFA500); |
142 |
public static final D2D1_COLOR_F OrangeRed = fromRGB(0xFF4500); |
143 |
public static final D2D1_COLOR_F Orchid = fromRGB(0xDA70D6); |
144 |
public static final D2D1_COLOR_F PaleGoldenrod = fromRGB(0xEEE8AA); |
145 |
public static final D2D1_COLOR_F PaleGreen = fromRGB(0x98FB98); |
146 |
public static final D2D1_COLOR_F PaleTurquoise = fromRGB(0xAFEEEE); |
147 |
public static final D2D1_COLOR_F PaleVioletRed = fromRGB(0xDB7093); |
148 |
public static final D2D1_COLOR_F PapayaWhip = fromRGB(0xFFEFD5); |
149 |
public static final D2D1_COLOR_F PeachPuff = fromRGB(0xFFDAB9); |
150 |
public static final D2D1_COLOR_F Peru = fromRGB(0xCD853F); |
151 |
public static final D2D1_COLOR_F Pink = fromRGB(0xFFC0CB); |
152 |
public static final D2D1_COLOR_F Plum = fromRGB(0xDDA0DD); |
153 |
public static final D2D1_COLOR_F PowderBlue = fromRGB(0xB0E0E6); |
154 |
public static final D2D1_COLOR_F Purple = fromRGB(0x800080); |
155 |
public static final D2D1_COLOR_F Red = fromRGB(0xFF0000); |
156 |
public static final D2D1_COLOR_F RosyBrown = fromRGB(0xBC8F8F); |
157 |
public static final D2D1_COLOR_F RoyalBlue = fromRGB(0x4169E1); |
158 |
public static final D2D1_COLOR_F SaddleBrown = fromRGB(0x8B4513); |
159 |
public static final D2D1_COLOR_F Salmon = fromRGB(0xFA8072); |
160 |
public static final D2D1_COLOR_F SandyBrown = fromRGB(0xF4A460); |
161 |
public static final D2D1_COLOR_F SeaGreen = fromRGB(0x2E8B57); |
162 |
public static final D2D1_COLOR_F SeaShell = fromRGB(0xFFF5EE); |
163 |
public static final D2D1_COLOR_F Sienna = fromRGB(0xA0522D); |
164 |
public static final D2D1_COLOR_F Silver = fromRGB(0xC0C0C0); |
165 |
public static final D2D1_COLOR_F SkyBlue = fromRGB(0x87CEEB); |
166 |
public static final D2D1_COLOR_F SlateBlue = fromRGB(0x6A5ACD); |
167 |
public static final D2D1_COLOR_F SlateGray = fromRGB(0x708090); |
168 |
public static final D2D1_COLOR_F Snow = fromRGB(0xFFFAFA); |
169 |
public static final D2D1_COLOR_F SpringGreen = fromRGB(0x00FF7F); |
170 |
public static final D2D1_COLOR_F SteelBlue = fromRGB(0x4682B4); |
171 |
public static final D2D1_COLOR_F Tan = fromRGB(0xD2B48C); |
172 |
public static final D2D1_COLOR_F Teal = fromRGB(0x008080); |
173 |
public static final D2D1_COLOR_F Thistle = fromRGB(0xD8BFD8); |
174 |
public static final D2D1_COLOR_F Tomato = fromRGB(0xFF6347); |
175 |
public static final D2D1_COLOR_F Turquoise = fromRGB(0x40E0D0); |
176 |
public static final D2D1_COLOR_F Violet = fromRGB(0xEE82EE); |
177 |
public static final D2D1_COLOR_F Wheat = fromRGB(0xF5DEB3); |
178 |
public static final D2D1_COLOR_F White = fromRGB(0xFFFFFF); |
179 |
public static final D2D1_COLOR_F WhiteSmoke = fromRGB(0xF5F5F5); |
180 |
public static final D2D1_COLOR_F Yellow = fromRGB(0xFFFF00); |
181 |
public static final D2D1_COLOR_F YellowGreen = fromRGB(0x9ACD32); |
182 |
|
183 |
// ------------------------------------------------------------------------------------- |
184 |
|
185 |
public static final GUID CLSID_ID2D1Resource = D2d.IIDFromString("{2cd90691-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ |
186 |
public static final GUID CLSID_ID2D1Bitmap = D2d.IIDFromString("{a2296057-ea42-4099-983b-539fb6505426}"); //$NON-NLS-1$ |
187 |
public static final GUID CLSID_ID2D1GradientStopCollection = D2d.IIDFromString("{2cd906a7-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ |
188 |
public static final GUID CLSID_ID2D1Brush = D2d.IIDFromString("{2cd906a8-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ |
189 |
public static final GUID CLSID_ID2D1BitmapBrush = D2d.IIDFromString("{2cd906aa-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ |
190 |
public static final GUID CLSID_ID2D1SolidColorBrush = D2d.IIDFromString("{2cd906a9-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ |
191 |
public static final GUID CLSID_ID2D1LinearGradientBrush = D2d.IIDFromString("{2cd906ab-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ |
192 |
public static final GUID CLSID_ID2D1RadialGradientBrush = D2d.IIDFromString("{2cd906ac-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ |
193 |
public static final GUID CLSID_ID2D1StrokeStyle = D2d.IIDFromString("{2cd9069d-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ |
194 |
public static final GUID CLSID_ID2D1Geometry = D2d.IIDFromString("{2cd906a1-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ |
195 |
public static final GUID CLSID_ID2D1RectangleGeometry = D2d.IIDFromString("{2cd906a2-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ |
196 |
public static final GUID CLSID_ID2D1RoundedRectangleGeometry = D2d.IIDFromString("{2cd906a3-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ |
197 |
public static final GUID CLSID_ID2D1EllipseGeometry = D2d.IIDFromString("{2cd906a4-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ |
198 |
public static final GUID CLSID_ID2D1TransformedGeometry = D2d.IIDFromString("{2cd906bb-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ |
199 |
public static final GUID CLSID_ID2D1SimplifiedGeometrySink = D2d.IIDFromString("{2cd9069e-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ |
200 |
public static final GUID CLSID_ID2D1GeometrySink = D2d.IIDFromString("{2cd9069f-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ |
201 |
public static final GUID CLSID_ID2D1TessellationSink = D2d.IIDFromString("{2cd906c1-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ |
202 |
public static final GUID CLSID_ID2D1PathGeometry = D2d.IIDFromString("{2cd906a5-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ : public ID2D1Geometry |
203 |
public static final GUID CLSID_ID2D1Mesh = D2d.IIDFromString("{2cd906c2-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ : public ID2D1Resource |
204 |
public static final GUID CLSID_ID2D1Layer = D2d.IIDFromString("{2cd9069b-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ : public ID2D1Resource |
205 |
public static final GUID CLSID_ID2D1DrawingStateBlock = D2d.IIDFromString("{28506e39-ebf6-46a1-bb47-fd85565ab957}"); //$NON-NLS-1$ : public ID2D1Resource |
206 |
public static final GUID CLSID_ID2D1RenderTarget = D2d.IIDFromString("{2cd90694-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ : public ID2D1Resource |
207 |
public static final GUID CLSID_ID2D1BitmapRenderTarget = D2d.IIDFromString("{2cd90695-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ : public ID2D1RenderTarget |
208 |
public static final GUID CLSID_ID2D1HwndRenderTarget = D2d.IIDFromString("{2cd90698-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ : public ID2D1RenderTarget |
209 |
public static final GUID CLSID_ID2D1GdiInteropRenderTarget = D2d.IIDFromString("{e0db51c3-6f77-4bae-b3d5-e47509b35838}"); //$NON-NLS-1$ : public IUnknown |
210 |
public static final GUID CLSID_ID2D1DCRenderTarget = D2d.IIDFromString("{1c51bc64-de61-46fd-9899-63a5d8f03950}"); //$NON-NLS-1$ : public ID2D1RenderTarget |
211 |
public static final GUID CLSID_ID2D1Factory = D2d.IIDFromString("{06152247-6f50-465a-9245-118bfd3b6007}"); //$NON-NLS-1$ : public IUnknown |
212 |
|
213 |
public static GUID IIDFromString(String lpsz) { |
214 |
int length = lpsz.length(); |
215 |
char[] buffer = new char[length + 1]; |
216 |
lpsz.getChars(0, length, buffer, 0); |
217 |
GUID lpiid = new GUID(); |
218 |
if (COM.IIDFromString(buffer, lpiid) == COM.S_OK) return lpiid; |
219 |
return null; |
220 |
} |
221 |
|
222 |
// ------------------------------------------------------------------------------------- |
223 |
|
224 |
|
225 |
// if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 1)) {} // TEST WIN7 |
226 |
|
227 |
// D2D1_FACTORY_TYPE |
228 |
public static final int D2D1_FACTORY_TYPE_SINGLE_THREADED = 0; |
229 |
public static final int D2D1_FACTORY_TYPE_MULTI_THREADED = 1; |
230 |
|
231 |
// D2D1_RENDER_TARGET_TYPE |
232 |
public static final int D2D1_RENDER_TARGET_TYPE_DEFAULT = 0; |
233 |
public static final int D2D1_RENDER_TARGET_TYPE_SOFTWARE = 1; |
234 |
public static final int D2D1_RENDER_TARGET_TYPE_HARDWARE = 2; |
235 |
|
236 |
// DXGI_FORMAT |
237 |
public static final int DXGI_FORMAT_UNKNOWN = 0; |
238 |
public static final int DXGI_FORMAT_R32G32B32A32_TYPELESS = 1; |
239 |
public static final int DXGI_FORMAT_R32G32B32A32_FLOAT = 2; |
240 |
public static final int DXGI_FORMAT_R32G32B32A32_UINT = 3; |
241 |
public static final int DXGI_FORMAT_R32G32B32A32_SINT = 4; |
242 |
public static final int DXGI_FORMAT_R32G32B32_TYPELESS = 5; |
243 |
public static final int DXGI_FORMAT_R32G32B32_FLOAT = 6; |
244 |
public static final int DXGI_FORMAT_R32G32B32_UINT = 7; |
245 |
public static final int DXGI_FORMAT_R32G32B32_SINT = 8; |
246 |
public static final int DXGI_FORMAT_R16G16B16A16_TYPELESS = 9; |
247 |
public static final int DXGI_FORMAT_R16G16B16A16_FLOAT = 10; |
248 |
public static final int DXGI_FORMAT_R16G16B16A16_UNORM = 11; |
249 |
public static final int DXGI_FORMAT_R16G16B16A16_UINT = 12; |
250 |
public static final int DXGI_FORMAT_R16G16B16A16_SNORM = 13; |
251 |
public static final int DXGI_FORMAT_R16G16B16A16_SINT = 14; |
252 |
public static final int DXGI_FORMAT_R32G32_TYPELESS = 15; |
253 |
public static final int DXGI_FORMAT_R32G32_FLOAT = 16; |
254 |
public static final int DXGI_FORMAT_R32G32_UINT = 17; |
255 |
public static final int DXGI_FORMAT_R32G32_SINT = 18; |
256 |
public static final int DXGI_FORMAT_R32G8X24_TYPELESS = 19; |
257 |
public static final int DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20; |
258 |
public static final int DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21; |
259 |
public static final int DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22; |
260 |
public static final int DXGI_FORMAT_R10G10B10A2_TYPELESS = 23; |
261 |
public static final int DXGI_FORMAT_R10G10B10A2_UNORM = 24; |
262 |
public static final int DXGI_FORMAT_R10G10B10A2_UINT = 25; |
263 |
public static final int DXGI_FORMAT_R11G11B10_FLOAT = 26; |
264 |
public static final int DXGI_FORMAT_R8G8B8A8_TYPELESS = 27; |
265 |
public static final int DXGI_FORMAT_R8G8B8A8_UNORM = 28; |
266 |
public static final int DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29; |
267 |
public static final int DXGI_FORMAT_R8G8B8A8_UINT = 30; |
268 |
public static final int DXGI_FORMAT_R8G8B8A8_SNORM = 31; |
269 |
public static final int DXGI_FORMAT_R8G8B8A8_SINT = 32; |
270 |
public static final int DXGI_FORMAT_R16G16_TYPELESS = 33; |
271 |
public static final int DXGI_FORMAT_R16G16_FLOAT = 34; |
272 |
public static final int DXGI_FORMAT_R16G16_UNORM = 35; |
273 |
public static final int DXGI_FORMAT_R16G16_UINT = 36; |
274 |
public static final int DXGI_FORMAT_R16G16_SNORM = 37; |
275 |
public static final int DXGI_FORMAT_R16G16_SINT = 38; |
276 |
public static final int DXGI_FORMAT_R32_TYPELESS = 39; |
277 |
public static final int DXGI_FORMAT_D32_FLOAT = 40; |
278 |
public static final int DXGI_FORMAT_R32_FLOAT = 41; |
279 |
public static final int DXGI_FORMAT_R32_UINT = 42; |
280 |
public static final int DXGI_FORMAT_R32_SINT = 43; |
281 |
public static final int DXGI_FORMAT_R24G8_TYPELESS = 44; |
282 |
public static final int DXGI_FORMAT_D24_UNORM_S8_UINT = 45; |
283 |
public static final int DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46; |
284 |
public static final int DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47; |
285 |
public static final int DXGI_FORMAT_R8G8_TYPELESS = 48; |
286 |
public static final int DXGI_FORMAT_R8G8_UNORM = 49; |
287 |
public static final int DXGI_FORMAT_R8G8_UINT = 50; |
288 |
public static final int DXGI_FORMAT_R8G8_SNORM = 51; |
289 |
public static final int DXGI_FORMAT_R8G8_SINT = 52; |
290 |
public static final int DXGI_FORMAT_R16_TYPELESS = 53; |
291 |
public static final int DXGI_FORMAT_R16_FLOAT = 54; |
292 |
public static final int DXGI_FORMAT_D16_UNORM = 55; |
293 |
public static final int DXGI_FORMAT_R16_UNORM = 56; |
294 |
public static final int DXGI_FORMAT_R16_UINT = 57; |
295 |
public static final int DXGI_FORMAT_R16_SNORM = 58; |
296 |
public static final int DXGI_FORMAT_R16_SINT = 59; |
297 |
public static final int DXGI_FORMAT_R8_TYPELESS = 60; |
298 |
public static final int DXGI_FORMAT_R8_UNORM = 61; |
299 |
public static final int DXGI_FORMAT_R8_UINT = 62; |
300 |
public static final int DXGI_FORMAT_R8_SNORM = 63; |
301 |
public static final int DXGI_FORMAT_R8_SINT = 64; |
302 |
public static final int DXGI_FORMAT_A8_UNORM = 65; |
303 |
public static final int DXGI_FORMAT_R1_UNORM = 66; |
304 |
public static final int DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67; |
305 |
public static final int DXGI_FORMAT_R8G8_B8G8_UNORM = 68; |
306 |
public static final int DXGI_FORMAT_G8R8_G8B8_UNORM = 69; |
307 |
public static final int DXGI_FORMAT_BC1_TYPELESS = 70; |
308 |
public static final int DXGI_FORMAT_BC1_UNORM = 71; |
309 |
public static final int DXGI_FORMAT_BC1_UNORM_SRGB = 72; |
310 |
public static final int DXGI_FORMAT_BC2_TYPELESS = 73; |
311 |
public static final int DXGI_FORMAT_BC2_UNORM = 74; |
312 |
public static final int DXGI_FORMAT_BC2_UNORM_SRGB = 75; |
313 |
public static final int DXGI_FORMAT_BC3_TYPELESS = 76; |
314 |
public static final int DXGI_FORMAT_BC3_UNORM = 77; |
315 |
public static final int DXGI_FORMAT_BC3_UNORM_SRGB = 78; |
316 |
public static final int DXGI_FORMAT_BC4_TYPELESS = 79; |
317 |
public static final int DXGI_FORMAT_BC4_UNORM = 80; |
318 |
public static final int DXGI_FORMAT_BC4_SNORM = 81; |
319 |
public static final int DXGI_FORMAT_BC5_TYPELESS = 82; |
320 |
public static final int DXGI_FORMAT_BC5_UNORM = 83; |
321 |
public static final int DXGI_FORMAT_BC5_SNORM = 84; |
322 |
public static final int DXGI_FORMAT_B5G6R5_UNORM = 85; |
323 |
public static final int DXGI_FORMAT_B5G5R5A1_UNORM = 86; |
324 |
public static final int DXGI_FORMAT_B8G8R8A8_UNORM = 87; |
325 |
public static final int DXGI_FORMAT_B8G8R8X8_UNORM = 88; |
326 |
public static final int DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89; |
327 |
public static final int DXGI_FORMAT_B8G8R8A8_TYPELESS = 90; |
328 |
public static final int DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91; |
329 |
public static final int DXGI_FORMAT_B8G8R8X8_TYPELESS = 92; |
330 |
public static final int DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93; |
331 |
public static final int DXGI_FORMAT_BC6H_TYPELESS = 94; |
332 |
public static final int DXGI_FORMAT_BC6H_UF16 = 95; |
333 |
public static final int DXGI_FORMAT_BC6H_SF16 = 96; |
334 |
public static final int DXGI_FORMAT_BC7_TYPELESS = 97; |
335 |
public static final int DXGI_FORMAT_BC7_UNORM = 98; |
336 |
public static final int DXGI_FORMAT_BC7_UNORM_SRGB = 99; |
337 |
public static final int DXGI_FORMAT_AYUV = 100; |
338 |
public static final int DXGI_FORMAT_Y410 = 101; |
339 |
public static final int DXGI_FORMAT_Y416 = 102; |
340 |
public static final int DXGI_FORMAT_NV12 = 103; |
341 |
public static final int DXGI_FORMAT_P010 = 104; |
342 |
public static final int DXGI_FORMAT_P016 = 105; |
343 |
public static final int DXGI_FORMAT_420_OPAQUE = 106; |
344 |
public static final int DXGI_FORMAT_YUY2 = 107; |
345 |
public static final int DXGI_FORMAT_Y210 = 108; |
346 |
public static final int DXGI_FORMAT_Y216 = 109; |
347 |
public static final int DXGI_FORMAT_NV11 = 110; |
348 |
public static final int DXGI_FORMAT_AI44 = 111; |
349 |
public static final int DXGI_FORMAT_IA44 = 112; |
350 |
public static final int DXGI_FORMAT_P8 = 113; |
351 |
public static final int DXGI_FORMAT_A8P8 = 114; |
352 |
public static final int DXGI_FORMAT_B4G4R4A4_UNORM = 115; |
353 |
//public static final int DXGI_FORMAT_FORCE_UINT = 0xffffffffUL; |
354 |
|
355 |
// D2D1_ALPHA_MODE |
356 |
public static final int D2D1_ALPHA_MODE_UNKNOWN = 0; |
357 |
public static final int D2D1_ALPHA_MODE_PREMULTIPLIED = 1; |
358 |
public static final int D2D1_ALPHA_MODE_STRAIGHT = 2; |
359 |
public static final int D2D1_ALPHA_MODE_IGNORE = 3; |
360 |
|
361 |
// D2D1_RENDER_TARGET_USAGE |
362 |
public static final int D2D1_RENDER_TARGET_USAGE_NONE = 0x00000000; |
363 |
public static final int D2D1_RENDER_TARGET_USAGE_FORCE_BITMAP_REMOTING = 0x00000001; |
364 |
public static final int D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE = 0x00000002; |
365 |
|
366 |
// D2D1_DC_INITIALIZE_MODE |
367 |
public static final int D2D1_DC_INITIALIZE_MODE_COPY = 0; |
368 |
public static final int D2D1_DC_INITIALIZE_MODE_CLEAR = 1; |
369 |
|
370 |
// D2D1_FEATURE_LEVEL |
371 |
public static final int D2D1_FEATURE_LEVEL_DEFAULT = 0; |
372 |
//public static final int D2D1_FEATURE_LEVEL_9 = D3D10_FEATURE_LEVEL_9_1; |
373 |
//public static final int D2D1_FEATURE_LEVEL_10 = D3D10_FEATURE_LEVEL_10_0; |
374 |
|
375 |
// D2D1_CAP_STYLE |
376 |
public static final int D2D1_CAP_STYLE_FLAT = 0; |
377 |
public static final int D2D1_CAP_STYLE_SQUARE = 1; |
378 |
public static final int D2D1_CAP_STYLE_ROUND = 2; |
379 |
public static final int D2D1_CAP_STYLE_TRIANGLE = 3; |
380 |
|
381 |
// D2D1_LINE_JOIN |
382 |
public static final int D2D1_LINE_JOIN_MITER = 0; |
383 |
public static final int D2D1_LINE_JOIN_BEVEL = 1; |
384 |
public static final int D2D1_LINE_JOIN_ROUND = 2; |
385 |
public static final int D2D1_LINE_JOIN_MITER_OR_BEVEL = 3; |
386 |
|
387 |
// D2D1_DASH_STYLE |
388 |
public static final int D2D1_DASH_STYLE_SOLID = 0; |
389 |
public static final int D2D1_DASH_STYLE_DASH = 1; |
390 |
public static final int D2D1_DASH_STYLE_DOT = 2; |
391 |
public static final int D2D1_DASH_STYLE_DASH_DOT = 3; |
392 |
public static final int D2D1_DASH_STYLE_DASH_DOT_DOT = 4; |
393 |
public static final int D2D1_DASH_STYLE_CUSTOM = 5; |
394 |
|
395 |
// D2D1_ANTIALIAS_MODE |
396 |
public static final int D2D1_ANTIALIAS_MODE_PER_PRIMITIVE = 0; |
397 |
public static final int D2D1_ANTIALIAS_MODE_ALIASED = 1; |
398 |
|
399 |
// D2D1_TEXT_ANTIALIAS_MODE |
400 |
public static final int D2D1_TEXT_ANTIALIAS_MODE_DEFAULT = 0; |
401 |
public static final int D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE = 1; |
402 |
public static final int D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE = 2; |
403 |
public static final int D2D1_TEXT_ANTIALIAS_MODE_ALIASED = 3; |
404 |
|
405 |
// D2D1_DRAW_TEXT_OPTIONS |
406 |
public static final int D2D1_DRAW_TEXT_OPTIONS_NO_SNAP = 0x00000001; |
407 |
public static final int D2D1_DRAW_TEXT_OPTIONS_CLIP = 0x00000002; |
408 |
public static final int D2D1_DRAW_TEXT_OPTIONS_NONE = 0x00000000; |
409 |
|
410 |
|
411 |
// -------------------------------------------------------------------------------------- |
412 |
|
413 |
public static final ID2D1Factory factory() { |
414 |
long /*int*/ factory[] = new long /*int*/[1]; |
415 |
factory[0] = 0; |
416 |
// long /*int*/ rc = D2d._D2D1CreateFactory(D2d.D2D1_FACTORY_TYPE_SINGLE_THREADED, null, factory); |
417 |
long /*int*/ rc = D2d.D2D1CreateFactory(factory); |
418 |
return rc == 0 ? new ID2D1Factory(factory[0]) : null; |
419 |
} |
420 |
|
421 |
|
422 |
/* sizeof's */ |
423 |
public static final native int D2D1_PIXEL_FORMAT_sizeof(); |
424 |
public static final native int D2D1_RENDER_TARGET_PROPERTIES_sizeof(); |
425 |
public static final native int D2D1_COLOR_F_sizeof(); |
426 |
public static final native int D2D1_POINT_2F_sizeof(); |
427 |
public static final native int D2D1_RECT_F_sizeof(); |
428 |
public static final native int D2D1_STROKE_STYLE_PROPERTIES_sizeof(); |
429 |
public static final native int D2D1_MATRIX_3X2_F_sizeof(); |
430 |
public static final native int D2D1_BRUSH_PROPERTIES_sizeof(); |
431 |
public static final native int D2D1_SIZE_F_sizeof(); |
432 |
public static final native int D2D1_ROUNDED_RECT_sizeof(); |
433 |
|
434 |
|
435 |
// -------------------------------------------------------------------------------------- |
436 |
|
437 |
// |
438 |
///* VTable calls */ |
439 |
//public static native int VtblCall(int fnNumber, long /*int*/ ppVtbl, D2D1_RENDER_TARGET_PROPERTIES arg0, long /*int*/[] arg1); |
440 |
// |
441 |
|
442 |
//-------------------------------------------------------------------------------------- |
443 |
|
444 |
/** @method flags=cpp no_gen */ |
445 |
public static final native long /*int*/ D2D1CreateFactory(long /*int*/[] result); |
446 |
|
447 |
/** |
448 |
* @method flags=cpp |
449 |
* @param This cast=(ID2D1Factory *) |
450 |
* @paran renderTargetProperties cast=(D2D1_RENDER_TARGET_PROPERTIES), flags=no_out |
451 |
* @param dcRenderTarget cast=(ID2D1DCRenderTarget**), flags=no_in |
452 |
*/ |
453 |
public static final native int ID2D1Factory_CreateDCRenderTarget(long /*int*/ This, D2D1_RENDER_TARGET_PROPERTIES renderTargetProperties, long /*int*/ [] dcRenderTarget); |
454 |
|
455 |
/** |
456 |
* @method flags=cpp |
457 |
* @param This cast=(ID2D1Factory *) |
458 |
* @paran strokeStyleProperties cast=(CONST D2D1_STROKE_STYLE_PROPERTIES*), flags=no_out |
459 |
* @param dashes cast=(CONST FLOAT*) |
460 |
* @param strokeStyle cast=(ID2D1StrokeStyle**), flags=no_in |
461 |
*/ |
462 |
public static final native int ID2D1Factory_CreateStrokeStyle(long /*int*/ This, D2D1_STROKE_STYLE_PROPERTIES strokeStyleProperties, float[] dashes, int dashesCount, long /*int*/ [] strokeStyle); |
463 |
|
464 |
|
465 |
/** |
466 |
* @method flags=cpp |
467 |
* @param This cast=(ID2D1RenderTarget *) |
468 |
*/ |
469 |
public static final native void ID2D1RenderTarget_BeginDraw(long /*int*/ This); |
470 |
/** |
471 |
* @method flags=cpp |
472 |
* @param This cast=(ID2D1RenderTarget *) |
473 |
*/ |
474 |
public static final native void ID2D1RenderTarget_EndDraw(long /*int*/ This); |
475 |
/** |
476 |
* @method flags=cpp |
477 |
* @param This cast=(ID2D1RenderTarget *) |
478 |
*/ |
479 |
public static final native void ID2D1RenderTarget_Clear(long /*int*/ This, D2D1_COLOR_F color); |
480 |
/** |
481 |
* @method flags=cpp |
482 |
* @param This cast=(ID2D1RenderTarget *) |
483 |
*/ |
484 |
public static final native void ID2D1RenderTarget_SetTransform(long /*int*/ This, D2D1_MATRIX_3X2_F transform); |
485 |
/** |
486 |
* @method flags=cpp |
487 |
* @param This cast=(ID2D1RenderTarget *) |
488 |
* @param point0 flags=struct |
489 |
* @param point1 flags=struct |
490 |
* @param brush cast=(ID2D1Brush *), flags=no_out |
491 |
* @param strokeWidth cast=(FLOAT) |
492 |
* @param strokeStyle cast=(ID2D1StrokeStyle *) |
493 |
*/ |
494 |
public static final native void ID2D1RenderTarget_DrawLine(long /*int*/ This, D2D1_POINT_2F point0, D2D1_POINT_2F point1, long /*int*/ brush, float strokeWidth, long /*int*/ strokeStyle); |
495 |
/** |
496 |
* @method flags=cpp |
497 |
* @param This cast=(ID2D1RenderTarget *) |
498 |
* @param brush cast=(ID2D1Brush *), flags=no_out |
499 |
* @param strokeWidth cast=(FLOAT) |
500 |
* @param strokeStyle cast=(ID2D1StrokeStyle *) |
501 |
*/ |
502 |
public static final native void ID2D1RenderTarget_DrawRectangle(long /*int*/ This, D2D1_RECT_F rect, long /*int*/ brush, float strokeWidth, long /*int*/ strokeStyle); |
503 |
/** |
504 |
* @method flags=cpp |
505 |
* @param This cast=(ID2D1RenderTarget *) |
506 |
* @param brush cast=(ID2D1Brush *), flags=no_out |
507 |
*/ |
508 |
public static final native void ID2D1RenderTarget_FillRectangle(long /*int*/ This, D2D1_RECT_F rect, long /*int*/ brush); |
509 |
/** |
510 |
* @method flags=cpp |
511 |
* @param This cast=(ID2D1RenderTarget *) |
512 |
* @param roundedRect cast=(D2D1_ROUNDED_RECT *), flags=no_out |
513 |
* @param brush cast=(ID2D1Brush *), flags=no_out |
514 |
* @param strokeStyle cast=(ID2D1StrokeStyle *), flags=no_out |
515 |
*/ |
516 |
public static final native void ID2D1RenderTarget_DrawRoundedRectangle(long /*int*/ This, D2D1_ROUNDED_RECT roundedRect, long /*int*/ brush, float strokeWidth, long /*int*/ strokeStyle); |
517 |
|
518 |
/** |
519 |
* @method flags=cpp |
520 |
* @param This cast=(ID2D1RenderTarget *) |
521 |
* @param string cast=(const WCHAR *) |
522 |
* @param stringLength cast=(UINT) |
523 |
* @param textFormat cast=(IDWriteTextFormat*) |
524 |
* @param defaultForegroundBrush cast=(ID2D1Brush *) |
525 |
* @param options cast=(D2D1_DRAW_TEXT_OPTIONS) |
526 |
* @param measuringMode cast=(DWRITE_MEASURING_MODE) |
527 |
*/ |
528 |
public static final native void ID2D1RenderTarget_DrawText(long /*int*/ This, char[] string, int stringLength, long /*int*/ textFormat, D2D1_RECT_F layoutRect, long /*int*/defaultForegroundBrush, int options, int measuringMode); |
529 |
|
530 |
/** |
531 |
* @method flags=cpp |
532 |
* @param This cast=(ID2D1RenderTarget *) |
533 |
* @param brushProperties flags=no_out |
534 |
* @param solidColorBrush cast=(ID2D1SolidColorBrush**), flags=no_in |
535 |
*/ |
536 |
public static final native int ID2D1RenderTarget_CreateSolidColorBrush(long /*int*/ This, D2D1_COLOR_F color, D2D1_BRUSH_PROPERTIES brushProperties, long /*int*/ [] solidColorBrush); |
537 |
/** |
538 |
* @method flags=cpp |
539 |
* @param This cast=(ID2D1RenderTarget *) |
540 |
* @param mode cast=(D2D1_ANTIALIAS_MODE) |
541 |
*/ |
542 |
public static final native void ID2D1RenderTarget_SetAntialiasMode(long /*int*/ This, int mode); |
543 |
/** |
544 |
* @method flags=cpp |
545 |
* @param This cast=(ID2D1RenderTarget *) |
546 |
* @param mode cast=(D2D1_TEXT_ANTIALIAS_MODE) |
547 |
*/ |
548 |
public static final native void ID2D1RenderTarget_SetTextAntialiasMode(long /*int*/ This, int mode); |
549 |
|
550 |
|
551 |
/** |
552 |
* @method flags=cpp |
553 |
* @param This cast=(ID2D1DCRenderTarget *) |
554 |
* @param hDC cast=(HDC) |
555 |
* @param pSubRect cast=(CONST RECT *) |
556 |
*/ |
557 |
public static final native int ID2D1DCRenderTarget_BindDC(long /*int*/ This, long /*int*/ hDC, RECT pSubRect); |
558 |
|
559 |
|
560 |
/** |
561 |
* @method flags=cpp |
562 |
* @param This cast=(ID2D1HwndRenderTarget *) |
563 |
*/ |
564 |
public static final native long /*int*/ ID2D1HwndRenderTarget_GetHwnd(long /*int*/ This); |
565 |
|
566 |
|
567 |
/** |
568 |
* @method flags=cpp |
569 |
* @param This cast=(ID2D1GdiInteropRenderTarget *) |
570 |
* @param mode cast=(D2D1_DC_INITIALIZE_MODE) |
571 |
* @param hdc cast=(HDC *) |
572 |
*/ |
573 |
public static final native int ID2D1GdiInteropRenderTarget_GetDC(long /*int*/ This, int mode, long /*int*/ [] hdc); |
574 |
/** |
575 |
* @method flags=cpp |
576 |
* @param This cast=(ID2D1GdiInteropRenderTarget *) |
577 |
*/ |
578 |
public static final native int ID2D1GdiInteropRenderTarget_ReleaseDC(long /*int*/ This, RECT rect); |
579 |
|
580 |
|
581 |
/** |
582 |
* @method flags=cpp |
583 |
* @param This cast=(ID2D1Brush*) |
584 |
*/ |
585 |
public static native void ID2D1Brush_SetOpacity(long /*int*/ This, float opacity); |
586 |
/** |
587 |
* @method flags=cpp no_gen |
588 |
* @param This cast=(ID2D1Brush*) |
589 |
* @param opacity cast=(FLOAT**) |
590 |
*/ |
591 |
public static native void ID2D1Brush_GetOpacity(long /*int*/ This, float[] opacity); |
592 |
|
593 |
|
594 |
/** |
595 |
* @method flags=cpp |
596 |
* @param This cast=(ID2D1SolidColorBrush*) |
597 |
* @param color flags=no_out |
598 |
*/ |
599 |
public static native void ID2D1SolidColorBrush_SetColor(long /*int*/ This, D2D1_COLOR_F color); |
600 |
/** |
601 |
* @method flags=cpp no_gen |
602 |
* @param This cast=(ID2D1SolidColorBrush*) |
603 |
* @param color flags=no_in |
604 |
*/ |
605 |
public static native void ID2D1SolidColorBrush_GetColor(long /*int*/ This, D2D1_COLOR_F color); |
606 |
|
607 |
|
608 |
/** |
609 |
* @param angle cast=(FLOAT) |
610 |
* @param center flags=struct |
611 |
* @param rotation cast=(D2D1_MATRIX_3X2_F*) |
612 |
*/ |
613 |
public static final native void D2D1MakeRotateMatrix(float angle, D2D1_POINT_2F center, D2D1_MATRIX_3X2_F rotation); |
614 |
|
615 |
|
616 |
} |