View | Details | Raw Unified | Return to bug 300403 | Differences between
and this patch

Collapse All | Expand All

(-)a/bundles/org.eclipse.swt.tools/JNI (+57 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2004, 2009 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
swt_copyright=/*******************************************************************************\n \
12
* Copyright (c) 2000, %END_YEAR IBM Corporation and others.\n \
13
* All rights reserved. This program and the accompanying materials\n \
14
* are made available under the terms of the Eclipse Public License v1.0\n \
15
* which accompanies this distribution, and is available at\n \
16
* http://www.eclipse.org/legal/epl-v10.html\n \
17
*\n \
18
* Contributors:\n \
19
*    IBM Corporation - initial API and implementation\n \
20
*******************************************************************************/\n
21
swt_properties_copyright=###############################################################################\n\
22
# Copyright (c) 2000, %END_YEAR IBM Corporation and others.\n\
23
# All rights reserved. This program and the accompanying materials\n\
24
# are made available under the terms of the Eclipse Public License v1.0\n\
25
# which accompanies this distribution, and is available at\n\
26
# http://www.eclipse.org/legal/epl-v10.html\n\
27
#\n\
28
# Contributors:\n\
29
#     IBM Corporation - initial API and implementation\n\
30
###############################################################################
31
swt_main_classes=\
32
org.eclipse.swt.internal.d2d.D2d,../org.eclipse.swt/Eclipse SWT PI/win32/library/,\
33
org.eclipse.swt.internal.dw.DW,../org.eclipse.swt/Eclipse SWT PI/win32/library/
34
#org.eclipse.swt.internal.accessibility.gtk.ATK,../org.eclipse.swt/Eclipse SWT PI/gtk/library/,\
35
#org.eclipse.swt.internal.carbon.OS,../org.eclipse.swt/Eclipse SWT PI/carbon/library/,\
36
#org.eclipse.swt.internal.cde.CDE,../org.eclipse.swt/Eclipse SWT Program/cde/library/,\
37
#org.eclipse.swt.internal.gnome.GNOME,../org.eclipse.swt/Eclipse SWT Program/gnome/library/,\
38
#org.eclipse.swt.internal.gtk.GTK,../org.eclipse.swt/Eclipse SWT PI/motif_gtk/library/,\
39
#org.eclipse.swt.internal.gtk.OS,../org.eclipse.swt/Eclipse SWT PI/gtk/library/,\
40
#org.eclipse.swt.internal.motif.OS,../org.eclipse.swt/Eclipse SWT PI/motif/library/,\
41
#org.eclipse.swt.internal.mozilla.XPCOM,../org.eclipse.swt/Eclipse SWT Mozilla/common/library/,\
42
#org.eclipse.swt.internal.mozilla.init.XPCOMInit,../org.eclipse.swt/Eclipse SWT Mozilla/common/library/,\
43
#org.eclipse.swt.internal.ole.win32.COM,../org.eclipse.swt/Eclipse SWT PI/win32/library/,\
44
#org.eclipse.swt.internal.photon.OS,../org.eclipse.swt/Eclipse SWT PI/photon/library/,\
45
#org.eclipse.swt.internal.win32.OS,../org.eclipse.swt/Eclipse SWT PI/win32/library/,\
46
#org.eclipse.swt.internal.gdip.Gdip,../org.eclipse.swt/Eclipse SWT PI/win32/library/,\
47
#org.eclipse.swt.internal.cairo.Cairo,../org.eclipse.swt/Eclipse SWT PI/cairo/library/,\
48
#org.eclipse.swt.internal.opengl.glx.GLX,../org.eclipse.swt/Eclipse SWT OpenGL/glx/library/,\
49
#org.eclipse.swt.internal.opengl.win32.WGL,../org.eclipse.swt/Eclipse SWT OpenGL/win32/library/,\
50
#org.eclipse.swt.internal.opengl.carbon.AGL,../org.eclipse.swt/Eclipse SWT OpenGL/carbon/library/,\
51
#org.eclipse.swt.internal.C,../org.eclipse.swt/Eclipse SWT PI/common/library/,\
52
#org.eclipse.swt.internal.wpf.OS,../org.eclipse.swt/Eclipse SWT PI/wpf/library/,\
53
#org.eclipse.swt.internal.win32.Win32,../org.eclipse.swt/Eclipse SWT PI/wpf_win32/library/,\
54
#org.eclipse.swt.internal.cocoa.Cocoa,../org.eclipse.swt/Eclipse SWT PI/carbon/library/,\
55
#org.eclipse.swt.internal.cocoa.OS,../org.eclipse.swt/Eclipse SWT PI/cocoa/library/,\
56
#org.eclipse.swt.internal.webkit.WebKitGTK,../org.eclipse.swt/Eclipse SWT WebKit/gtk/library/,\
57
#org.eclipse.swt.internal.webkit.WebKit_win32,../org.eclipse.swt/Eclipse SWT WebKit/win32/library/
(-)a/bundles/org.eclipse.swt.tools/JNI (+57 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2004, 2009 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
swt_copyright=/*******************************************************************************\n \
12
* Copyright (c) 2000, %END_YEAR IBM Corporation and others.\n \
13
* All rights reserved. This program and the accompanying materials\n \
14
* are made available under the terms of the Eclipse Public License v1.0\n \
15
* which accompanies this distribution, and is available at\n \
16
* http://www.eclipse.org/legal/epl-v10.html\n \
17
*\n \
18
* Contributors:\n \
19
*    IBM Corporation - initial API and implementation\n \
20
*******************************************************************************/\n
21
swt_properties_copyright=###############################################################################\n\
22
# Copyright (c) 2000, %END_YEAR IBM Corporation and others.\n\
23
# All rights reserved. This program and the accompanying materials\n\
24
# are made available under the terms of the Eclipse Public License v1.0\n\
25
# which accompanies this distribution, and is available at\n\
26
# http://www.eclipse.org/legal/epl-v10.html\n\
27
#\n\
28
# Contributors:\n\
29
#     IBM Corporation - initial API and implementation\n\
30
###############################################################################
31
swt_main_classes=\
32
org.eclipse.swt.internal.d2d.D2d,../org.eclipse.swt/Eclipse SWT PI/win32/library/,\
33
org.eclipse.swt.internal.dw.DW,../org.eclipse.swt/Eclipse SWT PI/win32/library/
34
#org.eclipse.swt.internal.accessibility.gtk.ATK,../org.eclipse.swt/Eclipse SWT PI/gtk/library/,\
35
#org.eclipse.swt.internal.carbon.OS,../org.eclipse.swt/Eclipse SWT PI/carbon/library/,\
36
#org.eclipse.swt.internal.cde.CDE,../org.eclipse.swt/Eclipse SWT Program/cde/library/,\
37
#org.eclipse.swt.internal.gnome.GNOME,../org.eclipse.swt/Eclipse SWT Program/gnome/library/,\
38
#org.eclipse.swt.internal.gtk.GTK,../org.eclipse.swt/Eclipse SWT PI/motif_gtk/library/,\
39
#org.eclipse.swt.internal.gtk.OS,../org.eclipse.swt/Eclipse SWT PI/gtk/library/,\
40
#org.eclipse.swt.internal.motif.OS,../org.eclipse.swt/Eclipse SWT PI/motif/library/,\
41
#org.eclipse.swt.internal.mozilla.XPCOM,../org.eclipse.swt/Eclipse SWT Mozilla/common/library/,\
42
#org.eclipse.swt.internal.mozilla.init.XPCOMInit,../org.eclipse.swt/Eclipse SWT Mozilla/common/library/,\
43
#org.eclipse.swt.internal.ole.win32.COM,../org.eclipse.swt/Eclipse SWT PI/win32/library/,\
44
#org.eclipse.swt.internal.photon.OS,../org.eclipse.swt/Eclipse SWT PI/photon/library/,\
45
#org.eclipse.swt.internal.win32.OS,../org.eclipse.swt/Eclipse SWT PI/win32/library/,\
46
#org.eclipse.swt.internal.gdip.Gdip,../org.eclipse.swt/Eclipse SWT PI/win32/library/,\
47
#org.eclipse.swt.internal.cairo.Cairo,../org.eclipse.swt/Eclipse SWT PI/cairo/library/,\
48
#org.eclipse.swt.internal.opengl.glx.GLX,../org.eclipse.swt/Eclipse SWT OpenGL/glx/library/,\
49
#org.eclipse.swt.internal.opengl.win32.WGL,../org.eclipse.swt/Eclipse SWT OpenGL/win32/library/,\
50
#org.eclipse.swt.internal.opengl.carbon.AGL,../org.eclipse.swt/Eclipse SWT OpenGL/carbon/library/,\
51
#org.eclipse.swt.internal.C,../org.eclipse.swt/Eclipse SWT PI/common/library/,\
52
#org.eclipse.swt.internal.wpf.OS,../org.eclipse.swt/Eclipse SWT PI/wpf/library/,\
53
#org.eclipse.swt.internal.win32.Win32,../org.eclipse.swt/Eclipse SWT PI/wpf_win32/library/,\
54
#org.eclipse.swt.internal.cocoa.Cocoa,../org.eclipse.swt/Eclipse SWT PI/carbon/library/,\
55
#org.eclipse.swt.internal.cocoa.OS,../org.eclipse.swt/Eclipse SWT PI/cocoa/library/,\
56
#org.eclipse.swt.internal.webkit.WebKitGTK,../org.eclipse.swt/Eclipse SWT WebKit/gtk/library/,\
57
#org.eclipse.swt.internal.webkit.WebKit_win32,../org.eclipse.swt/Eclipse SWT WebKit/win32/library/
(-)a/bundles/org.eclipse.swt/Eclipse (+479 lines)
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
12
#include "swt.h"
13
#include "d2d_structs.h"
14
#include "d2d_stats.h"
15
16
#ifndef D2d_NATIVE
17
#define D2d_NATIVE(func) Java_org_eclipse_swt_internal_d2d_D2d_##func
18
#endif
19
20
#ifndef NO_D2D1MakeRotateMatrix
21
extern "C" JNIEXPORT void JNICALL D2d_NATIVE(D2D1MakeRotateMatrix)(JNIEnv *env, jclass that, jfloat arg0, jobject arg1, jobject arg2);
22
JNIEXPORT void JNICALL D2d_NATIVE(D2D1MakeRotateMatrix)
23
	(JNIEnv *env, jclass that, jfloat arg0, jobject arg1, jobject arg2)
24
{
25
	D2D1_POINT_2F _arg1, *lparg1=NULL;
26
	D2D1_MATRIX_3X2_F _arg2, *lparg2=NULL;
27
	D2d_NATIVE_ENTER(env, that, D2D1MakeRotateMatrix_FUNC);
28
	if (arg1) if ((lparg1 = getD2D1_POINT_2FFields(env, arg1, &_arg1)) == NULL) goto fail;
29
	if (arg2) if ((lparg2 = getD2D1_MATRIX_3X2_FFields(env, arg2, &_arg2)) == NULL) goto fail;
30
	D2D1MakeRotateMatrix((FLOAT)arg0, *lparg1, (D2D1_MATRIX_3X2_F*)lparg2);
31
fail:
32
	if (arg2 && lparg2) setD2D1_MATRIX_3X2_FFields(env, arg2, lparg2);
33
	if (arg1 && lparg1) setD2D1_POINT_2FFields(env, arg1, lparg1);
34
	D2d_NATIVE_EXIT(env, that, D2D1MakeRotateMatrix_FUNC);
35
}
36
#endif
37
38
#ifndef NO_D2D1_1BRUSH_1PROPERTIES_1sizeof
39
extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1BRUSH_1PROPERTIES_1sizeof)(JNIEnv *env, jclass that);
40
JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1BRUSH_1PROPERTIES_1sizeof)
41
	(JNIEnv *env, jclass that)
42
{
43
	jint rc = 0;
44
	D2d_NATIVE_ENTER(env, that, D2D1_1BRUSH_1PROPERTIES_1sizeof_FUNC);
45
	rc = (jint)D2D1_BRUSH_PROPERTIES_sizeof();
46
	D2d_NATIVE_EXIT(env, that, D2D1_1BRUSH_1PROPERTIES_1sizeof_FUNC);
47
	return rc;
48
}
49
#endif
50
51
#ifndef NO_D2D1_1COLOR_1F_1sizeof
52
extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1COLOR_1F_1sizeof)(JNIEnv *env, jclass that);
53
JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1COLOR_1F_1sizeof)
54
	(JNIEnv *env, jclass that)
55
{
56
	jint rc = 0;
57
	D2d_NATIVE_ENTER(env, that, D2D1_1COLOR_1F_1sizeof_FUNC);
58
	rc = (jint)D2D1_COLOR_F_sizeof();
59
	D2d_NATIVE_EXIT(env, that, D2D1_1COLOR_1F_1sizeof_FUNC);
60
	return rc;
61
}
62
#endif
63
64
#ifndef NO_D2D1_1MATRIX_13X2_1F_1sizeof
65
extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1MATRIX_13X2_1F_1sizeof)(JNIEnv *env, jclass that);
66
JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1MATRIX_13X2_1F_1sizeof)
67
	(JNIEnv *env, jclass that)
68
{
69
	jint rc = 0;
70
	D2d_NATIVE_ENTER(env, that, D2D1_1MATRIX_13X2_1F_1sizeof_FUNC);
71
	rc = (jint)D2D1_MATRIX_3X2_F_sizeof();
72
	D2d_NATIVE_EXIT(env, that, D2D1_1MATRIX_13X2_1F_1sizeof_FUNC);
73
	return rc;
74
}
75
#endif
76
77
#ifndef NO_D2D1_1PIXEL_1FORMAT_1sizeof
78
extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1PIXEL_1FORMAT_1sizeof)(JNIEnv *env, jclass that);
79
JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1PIXEL_1FORMAT_1sizeof)
80
	(JNIEnv *env, jclass that)
81
{
82
	jint rc = 0;
83
	D2d_NATIVE_ENTER(env, that, D2D1_1PIXEL_1FORMAT_1sizeof_FUNC);
84
	rc = (jint)D2D1_PIXEL_FORMAT_sizeof();
85
	D2d_NATIVE_EXIT(env, that, D2D1_1PIXEL_1FORMAT_1sizeof_FUNC);
86
	return rc;
87
}
88
#endif
89
90
#ifndef NO_D2D1_1POINT_12F_1sizeof
91
extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1POINT_12F_1sizeof)(JNIEnv *env, jclass that);
92
JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1POINT_12F_1sizeof)
93
	(JNIEnv *env, jclass that)
94
{
95
	jint rc = 0;
96
	D2d_NATIVE_ENTER(env, that, D2D1_1POINT_12F_1sizeof_FUNC);
97
	rc = (jint)D2D1_POINT_2F_sizeof();
98
	D2d_NATIVE_EXIT(env, that, D2D1_1POINT_12F_1sizeof_FUNC);
99
	return rc;
100
}
101
#endif
102
103
#ifndef NO_D2D1_1RECT_1F_1sizeof
104
extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1RECT_1F_1sizeof)(JNIEnv *env, jclass that);
105
JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1RECT_1F_1sizeof)
106
	(JNIEnv *env, jclass that)
107
{
108
	jint rc = 0;
109
	D2d_NATIVE_ENTER(env, that, D2D1_1RECT_1F_1sizeof_FUNC);
110
	rc = (jint)D2D1_RECT_F_sizeof();
111
	D2d_NATIVE_EXIT(env, that, D2D1_1RECT_1F_1sizeof_FUNC);
112
	return rc;
113
}
114
#endif
115
116
#ifndef NO_D2D1_1RENDER_1TARGET_1PROPERTIES_1sizeof
117
extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1RENDER_1TARGET_1PROPERTIES_1sizeof)(JNIEnv *env, jclass that);
118
JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1RENDER_1TARGET_1PROPERTIES_1sizeof)
119
	(JNIEnv *env, jclass that)
120
{
121
	jint rc = 0;
122
	D2d_NATIVE_ENTER(env, that, D2D1_1RENDER_1TARGET_1PROPERTIES_1sizeof_FUNC);
123
	rc = (jint)D2D1_RENDER_TARGET_PROPERTIES_sizeof();
124
	D2d_NATIVE_EXIT(env, that, D2D1_1RENDER_1TARGET_1PROPERTIES_1sizeof_FUNC);
125
	return rc;
126
}
127
#endif
128
129
#ifndef NO_D2D1_1ROUNDED_1RECT_1sizeof
130
extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1ROUNDED_1RECT_1sizeof)(JNIEnv *env, jclass that);
131
JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1ROUNDED_1RECT_1sizeof)
132
	(JNIEnv *env, jclass that)
133
{
134
	jint rc = 0;
135
	D2d_NATIVE_ENTER(env, that, D2D1_1ROUNDED_1RECT_1sizeof_FUNC);
136
	rc = (jint)D2D1_ROUNDED_RECT_sizeof();
137
	D2d_NATIVE_EXIT(env, that, D2D1_1ROUNDED_1RECT_1sizeof_FUNC);
138
	return rc;
139
}
140
#endif
141
142
#ifndef NO_D2D1_1SIZE_1F_1sizeof
143
extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1SIZE_1F_1sizeof)(JNIEnv *env, jclass that);
144
JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1SIZE_1F_1sizeof)
145
	(JNIEnv *env, jclass that)
146
{
147
	jint rc = 0;
148
	D2d_NATIVE_ENTER(env, that, D2D1_1SIZE_1F_1sizeof_FUNC);
149
	rc = (jint)D2D1_SIZE_F_sizeof();
150
	D2d_NATIVE_EXIT(env, that, D2D1_1SIZE_1F_1sizeof_FUNC);
151
	return rc;
152
}
153
#endif
154
155
#ifndef NO_D2D1_1STROKE_1STYLE_1PROPERTIES_1sizeof
156
extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1STROKE_1STYLE_1PROPERTIES_1sizeof)(JNIEnv *env, jclass that);
157
JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1STROKE_1STYLE_1PROPERTIES_1sizeof)
158
	(JNIEnv *env, jclass that)
159
{
160
	jint rc = 0;
161
	D2d_NATIVE_ENTER(env, that, D2D1_1STROKE_1STYLE_1PROPERTIES_1sizeof_FUNC);
162
	rc = (jint)D2D1_STROKE_STYLE_PROPERTIES_sizeof();
163
	D2d_NATIVE_EXIT(env, that, D2D1_1STROKE_1STYLE_1PROPERTIES_1sizeof_FUNC);
164
	return rc;
165
}
166
#endif
167
168
#ifndef NO_ID2D1Brush_1SetOpacity
169
extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1Brush_1SetOpacity)(JNIEnv *env, jclass that, jintLong arg0, jfloat arg1);
170
JNIEXPORT void JNICALL D2d_NATIVE(ID2D1Brush_1SetOpacity)
171
	(JNIEnv *env, jclass that, jintLong arg0, jfloat arg1)
172
{
173
	D2d_NATIVE_ENTER(env, that, ID2D1Brush_1SetOpacity_FUNC);
174
	((ID2D1Brush*)arg0)->SetOpacity(arg1);
175
	D2d_NATIVE_EXIT(env, that, ID2D1Brush_1SetOpacity_FUNC);
176
}
177
#endif
178
179
#ifndef NO_ID2D1DCRenderTarget_1BindDC
180
extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1DCRenderTarget_1BindDC)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jobject arg2);
181
JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1DCRenderTarget_1BindDC)
182
	(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jobject arg2)
183
{
184
	RECT _arg2, *lparg2=NULL;
185
	jint rc = 0;
186
	D2d_NATIVE_ENTER(env, that, ID2D1DCRenderTarget_1BindDC_FUNC);
187
	if (arg2) if ((lparg2 = getRECTFields(env, arg2, &_arg2)) == NULL) goto fail;
188
	rc = (jint)((ID2D1DCRenderTarget *)arg0)->BindDC((HDC)arg1, (CONST RECT *)lparg2);
189
fail:
190
	if (arg2 && lparg2) setRECTFields(env, arg2, lparg2);
191
	D2d_NATIVE_EXIT(env, that, ID2D1DCRenderTarget_1BindDC_FUNC);
192
	return rc;
193
}
194
#endif
195
196
#ifndef NO_ID2D1Factory_1CreateDCRenderTarget
197
extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1Factory_1CreateDCRenderTarget)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLongArray arg2);
198
JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1Factory_1CreateDCRenderTarget)
199
	(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLongArray arg2)
200
{
201
	D2D1_RENDER_TARGET_PROPERTIES _arg1, *lparg1=NULL;
202
	jintLong *lparg2=NULL;
203
	jint rc = 0;
204
	D2d_NATIVE_ENTER(env, that, ID2D1Factory_1CreateDCRenderTarget_FUNC);
205
	if (arg1) if ((lparg1 = getD2D1_RENDER_TARGET_PROPERTIESFields(env, arg1, &_arg1)) == NULL) goto fail;
206
	if (arg2) if ((lparg2 = env->GetIntLongArrayElements(arg2, NULL)) == NULL) goto fail;
207
	rc = (jint)((ID2D1Factory *)arg0)->CreateDCRenderTarget(lparg1, (ID2D1DCRenderTarget**)lparg2);
208
fail:
209
	if (arg2 && lparg2) env->ReleaseIntLongArrayElements(arg2, lparg2, 0);
210
	if (arg1 && lparg1) setD2D1_RENDER_TARGET_PROPERTIESFields(env, arg1, lparg1);
211
	D2d_NATIVE_EXIT(env, that, ID2D1Factory_1CreateDCRenderTarget_FUNC);
212
	return rc;
213
}
214
#endif
215
216
#ifndef NO_ID2D1Factory_1CreateStrokeStyle
217
extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1Factory_1CreateStrokeStyle)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jfloatArray arg2, jint arg3, jintLongArray arg4);
218
JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1Factory_1CreateStrokeStyle)
219
	(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jfloatArray arg2, jint arg3, jintLongArray arg4)
220
{
221
	D2D1_STROKE_STYLE_PROPERTIES _arg1, *lparg1=NULL;
222
	jfloat *lparg2=NULL;
223
	jintLong *lparg4=NULL;
224
	jint rc = 0;
225
	D2d_NATIVE_ENTER(env, that, ID2D1Factory_1CreateStrokeStyle_FUNC);
226
	if (arg1) if ((lparg1 = getD2D1_STROKE_STYLE_PROPERTIESFields(env, arg1, &_arg1)) == NULL) goto fail;
227
	if (arg2) if ((lparg2 = env->GetFloatArrayElements(arg2, NULL)) == NULL) goto fail;
228
	if (arg4) if ((lparg4 = env->GetIntLongArrayElements(arg4, NULL)) == NULL) goto fail;
229
	rc = (jint)((ID2D1Factory *)arg0)->CreateStrokeStyle(lparg1, (CONST FLOAT*)lparg2, arg3, (ID2D1StrokeStyle**)lparg4);
230
fail:
231
	if (arg4 && lparg4) env->ReleaseIntLongArrayElements(arg4, lparg4, 0);
232
	if (arg2 && lparg2) env->ReleaseFloatArrayElements(arg2, lparg2, 0);
233
	if (arg1 && lparg1) setD2D1_STROKE_STYLE_PROPERTIESFields(env, arg1, lparg1);
234
	D2d_NATIVE_EXIT(env, that, ID2D1Factory_1CreateStrokeStyle_FUNC);
235
	return rc;
236
}
237
#endif
238
239
#ifndef NO_ID2D1GdiInteropRenderTarget_1GetDC
240
extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1GdiInteropRenderTarget_1GetDC)(JNIEnv *env, jclass that, jintLong arg0, jint arg1, jintLongArray arg2);
241
JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1GdiInteropRenderTarget_1GetDC)
242
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1, jintLongArray arg2)
243
{
244
	jintLong *lparg2=NULL;
245
	jint rc = 0;
246
	D2d_NATIVE_ENTER(env, that, ID2D1GdiInteropRenderTarget_1GetDC_FUNC);
247
	if (arg2) if ((lparg2 = env->GetIntLongArrayElements(arg2, NULL)) == NULL) goto fail;
248
	rc = (jint)((ID2D1GdiInteropRenderTarget  *)arg0)->GetDC((D2D1_DC_INITIALIZE_MODE)arg1, (HDC *)lparg2);
249
fail:
250
	if (arg2 && lparg2) env->ReleaseIntLongArrayElements(arg2, lparg2, 0);
251
	D2d_NATIVE_EXIT(env, that, ID2D1GdiInteropRenderTarget_1GetDC_FUNC);
252
	return rc;
253
}
254
#endif
255
256
#ifndef NO_ID2D1GdiInteropRenderTarget_1ReleaseDC
257
extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1GdiInteropRenderTarget_1ReleaseDC)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1);
258
JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1GdiInteropRenderTarget_1ReleaseDC)
259
	(JNIEnv *env, jclass that, jintLong arg0, jobject arg1)
260
{
261
	RECT _arg1, *lparg1=NULL;
262
	jint rc = 0;
263
	D2d_NATIVE_ENTER(env, that, ID2D1GdiInteropRenderTarget_1ReleaseDC_FUNC);
264
	if (arg1) if ((lparg1 = getRECTFields(env, arg1, &_arg1)) == NULL) goto fail;
265
	rc = (jint)((ID2D1GdiInteropRenderTarget  *)arg0)->ReleaseDC(lparg1);
266
fail:
267
	if (arg1 && lparg1) setRECTFields(env, arg1, lparg1);
268
	D2d_NATIVE_EXIT(env, that, ID2D1GdiInteropRenderTarget_1ReleaseDC_FUNC);
269
	return rc;
270
}
271
#endif
272
273
#ifndef NO_ID2D1HwndRenderTarget_1GetHwnd
274
extern "C" JNIEXPORT jintLong JNICALL D2d_NATIVE(ID2D1HwndRenderTarget_1GetHwnd)(JNIEnv *env, jclass that, jintLong arg0);
275
JNIEXPORT jintLong JNICALL D2d_NATIVE(ID2D1HwndRenderTarget_1GetHwnd)
276
	(JNIEnv *env, jclass that, jintLong arg0)
277
{
278
	jintLong rc = 0;
279
	D2d_NATIVE_ENTER(env, that, ID2D1HwndRenderTarget_1GetHwnd_FUNC);
280
	rc = (jintLong)((ID2D1HwndRenderTarget *)arg0)->GetHwnd();
281
	D2d_NATIVE_EXIT(env, that, ID2D1HwndRenderTarget_1GetHwnd_FUNC);
282
	return rc;
283
}
284
#endif
285
286
#ifndef NO_ID2D1RenderTarget_1BeginDraw
287
extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1BeginDraw)(JNIEnv *env, jclass that, jintLong arg0);
288
JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1BeginDraw)
289
	(JNIEnv *env, jclass that, jintLong arg0)
290
{
291
	D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1BeginDraw_FUNC);
292
	((ID2D1RenderTarget *)arg0)->BeginDraw();
293
	D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1BeginDraw_FUNC);
294
}
295
#endif
296
297
#ifndef NO_ID2D1RenderTarget_1Clear
298
extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1Clear)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1);
299
JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1Clear)
300
	(JNIEnv *env, jclass that, jintLong arg0, jobject arg1)
301
{
302
	D2D1_COLOR_F _arg1, *lparg1=NULL;
303
	D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1Clear_FUNC);
304
	if (arg1) if ((lparg1 = getD2D1_COLOR_FFields(env, arg1, &_arg1)) == NULL) goto fail;
305
	((ID2D1RenderTarget *)arg0)->Clear(lparg1);
306
fail:
307
	if (arg1 && lparg1) setD2D1_COLOR_FFields(env, arg1, lparg1);
308
	D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1Clear_FUNC);
309
}
310
#endif
311
312
#ifndef NO_ID2D1RenderTarget_1CreateSolidColorBrush
313
extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1RenderTarget_1CreateSolidColorBrush)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jobject arg2, jintLongArray arg3);
314
JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1RenderTarget_1CreateSolidColorBrush)
315
	(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jobject arg2, jintLongArray arg3)
316
{
317
	D2D1_COLOR_F _arg1, *lparg1=NULL;
318
	D2D1_BRUSH_PROPERTIES _arg2, *lparg2=NULL;
319
	jintLong *lparg3=NULL;
320
	jint rc = 0;
321
	D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1CreateSolidColorBrush_FUNC);
322
	if (arg1) if ((lparg1 = getD2D1_COLOR_FFields(env, arg1, &_arg1)) == NULL) goto fail;
323
	if (arg2) if ((lparg2 = getD2D1_BRUSH_PROPERTIESFields(env, arg2, &_arg2)) == NULL) goto fail;
324
	if (arg3) if ((lparg3 = env->GetIntLongArrayElements(arg3, NULL)) == NULL) goto fail;
325
	rc = (jint)((ID2D1RenderTarget *)arg0)->CreateSolidColorBrush(lparg1, lparg2, (ID2D1SolidColorBrush**)lparg3);
326
fail:
327
	if (arg3 && lparg3) env->ReleaseIntLongArrayElements(arg3, lparg3, 0);
328
	if (arg1 && lparg1) setD2D1_COLOR_FFields(env, arg1, lparg1);
329
	D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1CreateSolidColorBrush_FUNC);
330
	return rc;
331
}
332
#endif
333
334
#ifndef NO_ID2D1RenderTarget_1DrawLine
335
extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1DrawLine)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jobject arg2, jintLong arg3, jfloat arg4, jintLong arg5);
336
JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1DrawLine)
337
	(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jobject arg2, jintLong arg3, jfloat arg4, jintLong arg5)
338
{
339
	D2D1_POINT_2F _arg1, *lparg1=NULL;
340
	D2D1_POINT_2F _arg2, *lparg2=NULL;
341
	D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1DrawLine_FUNC);
342
	if (arg1) if ((lparg1 = getD2D1_POINT_2FFields(env, arg1, &_arg1)) == NULL) goto fail;
343
	if (arg2) if ((lparg2 = getD2D1_POINT_2FFields(env, arg2, &_arg2)) == NULL) goto fail;
344
	((ID2D1RenderTarget *)arg0)->DrawLine(*lparg1, *lparg2, (ID2D1Brush *)arg3, (FLOAT)arg4, (ID2D1StrokeStyle *)arg5);
345
fail:
346
	if (arg2 && lparg2) setD2D1_POINT_2FFields(env, arg2, lparg2);
347
	if (arg1 && lparg1) setD2D1_POINT_2FFields(env, arg1, lparg1);
348
	D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1DrawLine_FUNC);
349
}
350
#endif
351
352
#ifndef NO_ID2D1RenderTarget_1DrawRectangle
353
extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1DrawRectangle)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2, jfloat arg3, jintLong arg4);
354
JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1DrawRectangle)
355
	(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2, jfloat arg3, jintLong arg4)
356
{
357
	D2D1_RECT_F _arg1, *lparg1=NULL;
358
	D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1DrawRectangle_FUNC);
359
	if (arg1) if ((lparg1 = getD2D1_RECT_FFields(env, arg1, &_arg1)) == NULL) goto fail;
360
	((ID2D1RenderTarget *)arg0)->DrawRectangle(lparg1, (ID2D1Brush *)arg2, (FLOAT)arg3, (ID2D1StrokeStyle *)arg4);
361
fail:
362
	if (arg1 && lparg1) setD2D1_RECT_FFields(env, arg1, lparg1);
363
	D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1DrawRectangle_FUNC);
364
}
365
#endif
366
367
#ifndef NO_ID2D1RenderTarget_1DrawRoundedRectangle
368
extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1DrawRoundedRectangle)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2, jfloat arg3, jintLong arg4);
369
JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1DrawRoundedRectangle)
370
	(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2, jfloat arg3, jintLong arg4)
371
{
372
	D2D1_ROUNDED_RECT _arg1, *lparg1=NULL;
373
	D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1DrawRoundedRectangle_FUNC);
374
	if (arg1) if ((lparg1 = getD2D1_ROUNDED_RECTFields(env, arg1, &_arg1)) == NULL) goto fail;
375
	((ID2D1RenderTarget *)arg0)->DrawRoundedRectangle((D2D1_ROUNDED_RECT *)lparg1, (ID2D1Brush *)arg2, arg3, (ID2D1StrokeStyle *)arg4);
376
fail:
377
	D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1DrawRoundedRectangle_FUNC);
378
}
379
#endif
380
381
#ifndef NO_ID2D1RenderTarget_1DrawText
382
extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1DrawText)(JNIEnv *env, jclass that, jintLong arg0, jcharArray arg1, jint arg2, jintLong arg3, jobject arg4, jintLong arg5, jint arg6, jint arg7);
383
JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1DrawText)
384
	(JNIEnv *env, jclass that, jintLong arg0, jcharArray arg1, jint arg2, jintLong arg3, jobject arg4, jintLong arg5, jint arg6, jint arg7)
385
{
386
	jchar *lparg1=NULL;
387
	D2D1_RECT_F _arg4, *lparg4=NULL;
388
	D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1DrawText_FUNC);
389
	if (arg1) if ((lparg1 = env->GetCharArrayElements(arg1, NULL)) == NULL) goto fail;
390
	if (arg4) if ((lparg4 = getD2D1_RECT_FFields(env, arg4, &_arg4)) == NULL) goto fail;
391
	((ID2D1RenderTarget *)arg0)->DrawText((const WCHAR *)lparg1, (UINT)arg2, (IDWriteTextFormat*)arg3, lparg4, (ID2D1Brush *)arg5, (D2D1_DRAW_TEXT_OPTIONS)arg6, (DWRITE_MEASURING_MODE)arg7);
392
fail:
393
	if (arg4 && lparg4) setD2D1_RECT_FFields(env, arg4, lparg4);
394
	if (arg1 && lparg1) env->ReleaseCharArrayElements(arg1, lparg1, 0);
395
	D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1DrawText_FUNC);
396
}
397
#endif
398
399
#ifndef NO_ID2D1RenderTarget_1EndDraw
400
extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1EndDraw)(JNIEnv *env, jclass that, jintLong arg0);
401
JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1EndDraw)
402
	(JNIEnv *env, jclass that, jintLong arg0)
403
{
404
	D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1EndDraw_FUNC);
405
	((ID2D1RenderTarget *)arg0)->EndDraw();
406
	D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1EndDraw_FUNC);
407
}
408
#endif
409
410
#ifndef NO_ID2D1RenderTarget_1FillRectangle
411
extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1FillRectangle)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2);
412
JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1FillRectangle)
413
	(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2)
414
{
415
	D2D1_RECT_F _arg1, *lparg1=NULL;
416
	D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1FillRectangle_FUNC);
417
	if (arg1) if ((lparg1 = getD2D1_RECT_FFields(env, arg1, &_arg1)) == NULL) goto fail;
418
	((ID2D1RenderTarget *)arg0)->FillRectangle(lparg1, (ID2D1Brush *)arg2);
419
fail:
420
	if (arg1 && lparg1) setD2D1_RECT_FFields(env, arg1, lparg1);
421
	D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1FillRectangle_FUNC);
422
}
423
#endif
424
425
#ifndef NO_ID2D1RenderTarget_1SetAntialiasMode
426
extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1SetAntialiasMode)(JNIEnv *env, jclass that, jintLong arg0, jint arg1);
427
JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1SetAntialiasMode)
428
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
429
{
430
	D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1SetAntialiasMode_FUNC);
431
	((ID2D1RenderTarget *)arg0)->SetAntialiasMode((D2D1_ANTIALIAS_MODE)arg1);
432
	D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1SetAntialiasMode_FUNC);
433
}
434
#endif
435
436
#ifndef NO_ID2D1RenderTarget_1SetTextAntialiasMode
437
extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1SetTextAntialiasMode)(JNIEnv *env, jclass that, jintLong arg0, jint arg1);
438
JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1SetTextAntialiasMode)
439
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
440
{
441
	D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1SetTextAntialiasMode_FUNC);
442
	((ID2D1RenderTarget *)arg0)->SetTextAntialiasMode((D2D1_TEXT_ANTIALIAS_MODE)arg1);
443
	D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1SetTextAntialiasMode_FUNC);
444
}
445
#endif
446
447
#ifndef NO_ID2D1RenderTarget_1SetTransform
448
extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1SetTransform)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1);
449
JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1SetTransform)
450
	(JNIEnv *env, jclass that, jintLong arg0, jobject arg1)
451
{
452
	D2D1_MATRIX_3X2_F _arg1, *lparg1=NULL;
453
	D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1SetTransform_FUNC);
454
	if (arg1) if ((lparg1 = getD2D1_MATRIX_3X2_FFields(env, arg1, &_arg1)) == NULL) goto fail;
455
	((ID2D1RenderTarget *)arg0)->SetTransform(lparg1);
456
fail:
457
	if (arg1 && lparg1) setD2D1_MATRIX_3X2_FFields(env, arg1, lparg1);
458
	D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1SetTransform_FUNC);
459
}
460
#endif
461
462
#ifndef NO_ID2D1SolidColorBrush_1SetColor
463
extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1SolidColorBrush_1SetColor)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1);
464
JNIEXPORT void JNICALL D2d_NATIVE(ID2D1SolidColorBrush_1SetColor)
465
	(JNIEnv *env, jclass that, jintLong arg0, jobject arg1)
466
{
467
	D2D1_COLOR_F _arg1, *lparg1=NULL;
468
	D2d_NATIVE_ENTER(env, that, ID2D1SolidColorBrush_1SetColor_FUNC);
469
	if (arg1) if ((lparg1 = getD2D1_COLOR_FFields(env, arg1, &_arg1)) == NULL) goto fail;
470
	((ID2D1SolidColorBrush*)arg0)->SetColor(lparg1);
471
fail:
472
	D2d_NATIVE_EXIT(env, that, ID2D1SolidColorBrush_1SetColor_FUNC);
473
}
474
#endif
475
476
#ifndef ID2D1RenderTarget_NATIVE
477
#define ID2D1RenderTarget_NATIVE(func) Java_org_eclipse_swt_internal_d2d_ID2D1RenderTarget_##func
478
#endif
479
(-)a/bundles/org.eclipse.swt/Eclipse (+42 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2005 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
12
#ifndef INC_d2d_H
13
#define INC_d2d_H
14
15
#include <windows.h>
16
#include <d2d1.h>
17
#include <d2d1helper.h>
18
#include "d2d_custom.h"
19
20
#define D2D_LOAD_FUNCTION LOAD_FUNCTION
21
22
#define NATIVE_TRY(env, that, func) \
23
	__try {
24
#define NATIVE_CATCH(env, that, func) \
25
	} __except(EXCEPTION_EXECUTE_HANDLER) { \
26
		jclass expClass = (*env)->FindClass(env, "org/eclipse/swt/SWTError");  \
27
		if (expClass) { \
28
			char buffer[256]; \
29
			PRINT_CODE(buffer, 256, "cought native exception: 0x%x", GetExceptionCode()) \
30
			(*env)->ThrowNew(env, expClass, buffer); \
31
		} \
32
	}
33
34
#define D2d_NATIVE_ENTER_TRY(env, that, func) \
35
	D2d_NATIVE_ENTER(env, that, func); \
36
	NATIVE_TRY(env, that, func);
37
#define D2d_NATIVE_EXIT_CATCH(env, that, func) \
38
	NATIVE_CATCH(env, that, func); \
39
	D2d_NATIVE_EXIT(env, that, func);
40
41
42
#endif /* INC_d2d_H */
(-)a/bundles/org.eclipse.swt/Eclipse (+100 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 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
12
#include "swt.h"
13
#include "d2d_structs.h"
14
#include "d2d_stats.h"
15
16
#define D2d_NATIVE(func) Java_org_eclipse_swt_internal_d2d_D2d_##func
17
18
#ifndef NO_D2D1CreateFactory
19
#ifdef JNI64
20
#else
21
#endif
22
extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1CreateFactory)(JNIEnv *env, jclass that, jintLongArray arg0);
23
JNIEXPORT jint JNICALL D2d_NATIVE(D2D1CreateFactory)
24
	(JNIEnv *env, jclass that, jintLongArray arg0)
25
{
26
	jintLong *lparg0=NULL;
27
	jint rc = 0;
28
//	D2d_NATIVE_ENTER()
29
	if (arg0) if ((lparg0 = env->GetIntLongArrayElements(arg0, NULL)) == NULL) goto fail;
30
	ID2D1Factory* m_pD2DFactory;
31
	rc = (jint) D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, /*(ID2D1Factory**)&lparg0*/&m_pD2DFactory); 
32
	if (rc == S_OK) {
33
		lparg0[0] = (jintLong)m_pD2DFactory;
34
	}
35
fail:
36
	if (arg0 && lparg0) env->ReleaseIntLongArrayElements(arg0, lparg0, 0);
37
//	D2d_NATIVE_EXIT()
38
	return rc; 
39
} 
40
#endif 
41
42
#ifndef ID2D1RenderTarget_NATIVE
43
#define ID2D1RenderTarget_NATIVE(func) Java_org_eclipse_swt_internal_d2d_ID2D1RenderTarget_##func
44
#endif
45
46
#ifndef NO_ID2D1RenderTarget_1GetSize
47
extern "C" JNIEXPORT void JNICALL ID2D1RenderTarget_NATIVE(ID2D1RenderTarget_1GetSize)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1);
48
JNIEXPORT void JNICALL ID2D1RenderTarget_NATIVE(ID2D1RenderTarget_1GetSize)
49
	(JNIEnv *env, jclass that, jintLong arg0, jobject arg1)
50
{
51
	D2D1_SIZE_F _arg1, *lparg1=NULL;
52
	D2D1_SIZE_F s;
53
	ID2D1RenderTarget_NATIVE_ENTER(env, that, ID2D1RenderTarget_1GetSize_FUNC);
54
	if (arg1) if ((lparg1 = &_arg1) == NULL) goto fail;
55
	s = ((ID2D1RenderTarget *)arg0)->GetSize();
56
	lparg1 = &s;
57
fail:
58
	if (arg1 && lparg1) setD2D1_SIZE_FFields(env, arg1, lparg1);
59
	ID2D1RenderTarget_NATIVE_EXIT(env, that, ID2D1RenderTarget_1GetSize_FUNC);
60
}
61
#endif
62
63
//#ifndef ID2D1Brush_NATIVE
64
//#define ID2D1Brush_NATIVE(func) Java_org_eclipse_swt_internal_d2d_ID2D1Brush_##func
65
//#endif
66
67
#ifndef NO_ID2D1Brush_1GetOpacity
68
extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1Brush_1GetOpacity)(JNIEnv *env, jclass that, jintLong arg0, jfloatArray arg1);
69
JNIEXPORT void JNICALL D2d_NATIVE(ID2D1Brush_1GetOpacity)
70
	(JNIEnv *env, jclass that, jintLong arg0, jfloatArray arg1)
71
{
72
	jfloat *lparg1=NULL;
73
	D2d_NATIVE_ENTER(env, that, ID2D1Brush_1GetOpacity_FUNC);
74
	if (arg1) if ((lparg1 = env->GetFloatArrayElements(arg1, NULL)) == NULL) goto fail;
75
	FLOAT opacity = ((ID2D1Brush*)arg0)->GetOpacity();
76
	*lparg1 = opacity;
77
fail:
78
	if (arg1 && lparg1) env->ReleaseFloatArrayElements(arg1, lparg1, 0);
79
	D2d_NATIVE_EXIT(env, that, ID2D1Brush_1GetOpacity_FUNC);
80
}
81
#endif
82
83
//#ifndef ID2D1SolidColorBrush_NATIVE
84
//#define ID2D1SolidColorBrush_NATIVE(func) Java_org_eclipse_swt_internal_d2d_ID2D1SolidColorBrush_##func
85
//#endif
86
87
#ifndef NO_ID2D1SolidColorBrush_1GetColor
88
extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1SolidColorBrush_1GetColor)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1);
89
JNIEXPORT void JNICALL D2d_NATIVE(ID2D1SolidColorBrush_1GetColor)
90
	(JNIEnv *env, jclass that, jintLong arg0, jobject arg1)
91
{
92
	D2D1_COLOR_F *lparg1=NULL;
93
	D2d_NATIVE_ENTER(env, that, ID2D1SolidColorBrush_1GetColor_FUNC);
94
	D2D1_COLOR_F _arg1 = ((ID2D1SolidColorBrush*)arg0)->GetColor();
95
	lparg1=&_arg1;
96
	if (arg1 && lparg1) setD2D1_COLOR_FFields(env, arg1, lparg1);
97
	D2d_NATIVE_EXIT(env, that, ID2D1SolidColorBrush_1GetColor_FUNC);
98
}
99
#endif
100
(-)a/bundles/org.eclipse.swt/Eclipse (+11 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 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
(-)a/bundles/org.eclipse.swt/Eclipse (+77 lines)
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
12
#include "swt.h"
13
#include "d2d_stats.h"
14
15
#ifdef NATIVE_STATS
16
17
int D2d_nativeFunctionCount = 4;
18
int D2d_nativeFunctionCallCount[4];
19
char * D2d_nativeFunctionNames[] = {
20
	"D2D1CreateFactory",
21
	"D2D1_1PIXEL_1FORMAT_1sizeof",
22
	"D2D1_1RENDER_1TARGET_1PROPERTIES_1sizeof",
23
	"VtblCall",
24
};
25
26
#define STATS_NATIVE(func) Java_org_eclipse_swt_tools_internal_NativeStats_##func
27
28
JNIEXPORT jint JNICALL STATS_NATIVE(D2d_1GetFunctionCount)
29
	(JNIEnv *env, jclass that)
30
{
31
	return D2d_nativeFunctionCount;
32
}
33
34
JNIEXPORT jstring JNICALL STATS_NATIVE(D2d_1GetFunctionName)
35
	(JNIEnv *env, jclass that, jint index)
36
{
37
	return (*env)->NewStringUTF(env, D2d_nativeFunctionNames[index]);
38
}
39
40
JNIEXPORT jint JNICALL STATS_NATIVE(D2d_1GetFunctionCallCount)
41
	(JNIEnv *env, jclass that, jint index)
42
{
43
	return D2d_nativeFunctionCallCount[index];
44
}
45
46
#endif
47
#ifdef NATIVE_STATS
48
49
int ID2D1RenderTarget_nativeFunctionCount = 3;
50
int ID2D1RenderTarget_nativeFunctionCallCount[3];
51
char * ID2D1RenderTarget_nativeFunctionNames[] = {
52
	"ID2D1RenderTarget_1BeginDraw",
53
	"ID2D1RenderTarget_1Clear",
54
	"ID2D1RenderTarget_1EndDraw",
55
};
56
57
#define STATS_NATIVE(func) Java_org_eclipse_swt_tools_internal_NativeStats_##func
58
59
JNIEXPORT jint JNICALL STATS_NATIVE(ID2D1RenderTarget_1GetFunctionCount)
60
	(JNIEnv *env, jclass that)
61
{
62
	return ID2D1RenderTarget_nativeFunctionCount;
63
}
64
65
JNIEXPORT jstring JNICALL STATS_NATIVE(ID2D1RenderTarget_1GetFunctionName)
66
	(JNIEnv *env, jclass that, jint index)
67
{
68
	return (*env)->NewStringUTF(env, ID2D1RenderTarget_nativeFunctionNames[index]);
69
}
70
71
JNIEXPORT jint JNICALL STATS_NATIVE(ID2D1RenderTarget_1GetFunctionCallCount)
72
	(JNIEnv *env, jclass that, jint index)
73
{
74
	return ID2D1RenderTarget_nativeFunctionCallCount[index];
75
}
76
77
#endif
(-)a/bundles/org.eclipse.swt/Eclipse (+105 lines)
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
12
#include "swt.h"
13
#include "d2d_stats.h"
14
15
#ifdef NATIVE_STATS
16
17
int D2d_nativeFunctionCount = 34;
18
int D2d_nativeFunctionCallCount[34];
19
char * D2d_nativeFunctionNames[] = {
20
	"D2D1CreateFactory",
21
	"D2D1MakeRotateMatrix",
22
	"D2D1_1BRUSH_1PROPERTIES_1sizeof",
23
	"D2D1_1COLOR_1F_1sizeof",
24
	"D2D1_1MATRIX_13X2_1F_1sizeof",
25
	"D2D1_1PIXEL_1FORMAT_1sizeof",
26
	"D2D1_1POINT_12F_1sizeof",
27
	"D2D1_1RECT_1F_1sizeof",
28
	"D2D1_1RENDER_1TARGET_1PROPERTIES_1sizeof",
29
	"D2D1_1ROUNDED_1RECT_1sizeof",
30
	"D2D1_1SIZE_1F_1sizeof",
31
	"D2D1_1STROKE_1STYLE_1PROPERTIES_1sizeof",
32
	"ID2D1Brush_1GetOpacity",
33
	"ID2D1Brush_1SetOpacity",
34
	"ID2D1DCRenderTarget_1BindDC",
35
	"ID2D1Factory_1CreateDCRenderTarget",
36
	"ID2D1Factory_1CreateStrokeStyle",
37
	"ID2D1GdiInteropRenderTarget_1GetDC",
38
	"ID2D1GdiInteropRenderTarget_1ReleaseDC",
39
	"ID2D1HwndRenderTarget_1GetHwnd",
40
	"ID2D1RenderTarget_1BeginDraw",
41
	"ID2D1RenderTarget_1Clear",
42
	"ID2D1RenderTarget_1CreateSolidColorBrush",
43
	"ID2D1RenderTarget_1DrawLine",
44
	"ID2D1RenderTarget_1DrawRectangle",
45
	"ID2D1RenderTarget_1DrawRoundedRectangle",
46
	"ID2D1RenderTarget_1DrawText",
47
	"ID2D1RenderTarget_1EndDraw",
48
	"ID2D1RenderTarget_1FillRectangle",
49
	"ID2D1RenderTarget_1SetAntialiasMode",
50
	"ID2D1RenderTarget_1SetTextAntialiasMode",
51
	"ID2D1RenderTarget_1SetTransform",
52
	"ID2D1SolidColorBrush_1GetColor",
53
	"ID2D1SolidColorBrush_1SetColor",
54
};
55
56
#define STATS_NATIVE(func) Java_org_eclipse_swt_tools_internal_NativeStats_##func
57
58
JNIEXPORT jint JNICALL STATS_NATIVE(D2d_1GetFunctionCount)
59
	(JNIEnv *env, jclass that)
60
{
61
	return D2d_nativeFunctionCount;
62
}
63
64
JNIEXPORT jstring JNICALL STATS_NATIVE(D2d_1GetFunctionName)
65
	(JNIEnv *env, jclass that, jint index)
66
{
67
	return env->NewStringUTF(D2d_nativeFunctionNames[index]);
68
}
69
70
JNIEXPORT jint JNICALL STATS_NATIVE(D2d_1GetFunctionCallCount)
71
	(JNIEnv *env, jclass that, jint index)
72
{
73
	return D2d_nativeFunctionCallCount[index];
74
}
75
76
#endif
77
#ifdef NATIVE_STATS
78
79
int ID2D1RenderTarget_nativeFunctionCount = 1;
80
int ID2D1RenderTarget_nativeFunctionCallCount[1];
81
char * ID2D1RenderTarget_nativeFunctionNames[] = {
82
	"ID2D1RenderTarget_1GetSize",
83
};
84
85
#define STATS_NATIVE(func) Java_org_eclipse_swt_tools_internal_NativeStats_##func
86
87
JNIEXPORT jint JNICALL STATS_NATIVE(ID2D1RenderTarget_1GetFunctionCount)
88
	(JNIEnv *env, jclass that)
89
{
90
	return ID2D1RenderTarget_nativeFunctionCount;
91
}
92
93
JNIEXPORT jstring JNICALL STATS_NATIVE(ID2D1RenderTarget_1GetFunctionName)
94
	(JNIEnv *env, jclass that, jint index)
95
{
96
	return env->NewStringUTF(ID2D1RenderTarget_nativeFunctionNames[index]);
97
}
98
99
JNIEXPORT jint JNICALL STATS_NATIVE(ID2D1RenderTarget_1GetFunctionCallCount)
100
	(JNIEnv *env, jclass that, jint index)
101
{
102
	return ID2D1RenderTarget_nativeFunctionCallCount[index];
103
}
104
105
#endif
(-)a/bundles/org.eclipse.swt/Eclipse (+80 lines)
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
12
#ifdef NATIVE_STATS
13
extern int D2d_nativeFunctionCount;
14
extern int D2d_nativeFunctionCallCount[];
15
extern char* D2d_nativeFunctionNames[];
16
#define D2d_NATIVE_ENTER(env, that, func) D2d_nativeFunctionCallCount[func]++;
17
#define D2d_NATIVE_EXIT(env, that, func) 
18
#else
19
#ifndef D2d_NATIVE_ENTER
20
#define D2d_NATIVE_ENTER(env, that, func) 
21
#endif
22
#ifndef D2d_NATIVE_EXIT
23
#define D2d_NATIVE_EXIT(env, that, func) 
24
#endif
25
#endif
26
27
typedef enum {
28
	D2D1CreateFactory_FUNC,
29
	D2D1MakeRotateMatrix_FUNC,
30
	D2D1_1BRUSH_1PROPERTIES_1sizeof_FUNC,
31
	D2D1_1COLOR_1F_1sizeof_FUNC,
32
	D2D1_1MATRIX_13X2_1F_1sizeof_FUNC,
33
	D2D1_1PIXEL_1FORMAT_1sizeof_FUNC,
34
	D2D1_1POINT_12F_1sizeof_FUNC,
35
	D2D1_1RECT_1F_1sizeof_FUNC,
36
	D2D1_1RENDER_1TARGET_1PROPERTIES_1sizeof_FUNC,
37
	D2D1_1ROUNDED_1RECT_1sizeof_FUNC,
38
	D2D1_1SIZE_1F_1sizeof_FUNC,
39
	D2D1_1STROKE_1STYLE_1PROPERTIES_1sizeof_FUNC,
40
	ID2D1Brush_1GetOpacity_FUNC,
41
	ID2D1Brush_1SetOpacity_FUNC,
42
	ID2D1DCRenderTarget_1BindDC_FUNC,
43
	ID2D1Factory_1CreateDCRenderTarget_FUNC,
44
	ID2D1Factory_1CreateStrokeStyle_FUNC,
45
	ID2D1GdiInteropRenderTarget_1GetDC_FUNC,
46
	ID2D1GdiInteropRenderTarget_1ReleaseDC_FUNC,
47
	ID2D1HwndRenderTarget_1GetHwnd_FUNC,
48
	ID2D1RenderTarget_1BeginDraw_FUNC,
49
	ID2D1RenderTarget_1Clear_FUNC,
50
	ID2D1RenderTarget_1CreateSolidColorBrush_FUNC,
51
	ID2D1RenderTarget_1DrawLine_FUNC,
52
	ID2D1RenderTarget_1DrawRectangle_FUNC,
53
	ID2D1RenderTarget_1DrawRoundedRectangle_FUNC,
54
	ID2D1RenderTarget_1DrawText_FUNC,
55
	ID2D1RenderTarget_1EndDraw_FUNC,
56
	ID2D1RenderTarget_1FillRectangle_FUNC,
57
	ID2D1RenderTarget_1SetAntialiasMode_FUNC,
58
	ID2D1RenderTarget_1SetTextAntialiasMode_FUNC,
59
	ID2D1RenderTarget_1SetTransform_FUNC,
60
	ID2D1SolidColorBrush_1GetColor_FUNC,
61
	ID2D1SolidColorBrush_1SetColor_FUNC,
62
} D2d_FUNCS;
63
#ifdef NATIVE_STATS
64
extern int ID2D1RenderTarget_nativeFunctionCount;
65
extern int ID2D1RenderTarget_nativeFunctionCallCount[];
66
extern char* ID2D1RenderTarget_nativeFunctionNames[];
67
#define ID2D1RenderTarget_NATIVE_ENTER(env, that, func) ID2D1RenderTarget_nativeFunctionCallCount[func]++;
68
#define ID2D1RenderTarget_NATIVE_EXIT(env, that, func) 
69
#else
70
#ifndef ID2D1RenderTarget_NATIVE_ENTER
71
#define ID2D1RenderTarget_NATIVE_ENTER(env, that, func) 
72
#endif
73
#ifndef ID2D1RenderTarget_NATIVE_EXIT
74
#define ID2D1RenderTarget_NATIVE_EXIT(env, that, func) 
75
#endif
76
#endif
77
78
typedef enum {
79
	ID2D1RenderTarget_1GetSize_FUNC,
80
} ID2D1RenderTarget_FUNCS;
(-)a/bundles/org.eclipse.swt/Eclipse (+475 lines)
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
12
#include "swt.h"
13
#include "d2d_structs.h"
14
15
#ifndef NO_D2D1_BRUSH_PROPERTIES
16
typedef struct D2D1_BRUSH_PROPERTIES_FID_CACHE {
17
	int cached;
18
	jclass clazz;
19
	jfieldID opacity, transform__11, transform__12, transform__21, transform__22, transform__31, transform__32;
20
} D2D1_BRUSH_PROPERTIES_FID_CACHE;
21
22
D2D1_BRUSH_PROPERTIES_FID_CACHE D2D1_BRUSH_PROPERTIESFc;
23
24
void cacheD2D1_BRUSH_PROPERTIESFields(JNIEnv *env, jobject lpObject)
25
{
26
	if (D2D1_BRUSH_PROPERTIESFc.cached) return;
27
	D2D1_BRUSH_PROPERTIESFc.clazz = env->GetObjectClass(lpObject);
28
	D2D1_BRUSH_PROPERTIESFc.opacity = env->GetFieldID(D2D1_BRUSH_PROPERTIESFc.clazz, "opacity", "F");
29
	D2D1_BRUSH_PROPERTIESFc.transform__11 = env->GetFieldID(D2D1_BRUSH_PROPERTIESFc.clazz, "transform__11", "F");
30
	D2D1_BRUSH_PROPERTIESFc.transform__12 = env->GetFieldID(D2D1_BRUSH_PROPERTIESFc.clazz, "transform__12", "F");
31
	D2D1_BRUSH_PROPERTIESFc.transform__21 = env->GetFieldID(D2D1_BRUSH_PROPERTIESFc.clazz, "transform__21", "F");
32
	D2D1_BRUSH_PROPERTIESFc.transform__22 = env->GetFieldID(D2D1_BRUSH_PROPERTIESFc.clazz, "transform__22", "F");
33
	D2D1_BRUSH_PROPERTIESFc.transform__31 = env->GetFieldID(D2D1_BRUSH_PROPERTIESFc.clazz, "transform__31", "F");
34
	D2D1_BRUSH_PROPERTIESFc.transform__32 = env->GetFieldID(D2D1_BRUSH_PROPERTIESFc.clazz, "transform__32", "F");
35
	D2D1_BRUSH_PROPERTIESFc.cached = 1;
36
}
37
38
D2D1_BRUSH_PROPERTIES *getD2D1_BRUSH_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_BRUSH_PROPERTIES *lpStruct)
39
{
40
	if (!D2D1_BRUSH_PROPERTIESFc.cached) cacheD2D1_BRUSH_PROPERTIESFields(env, lpObject);
41
	lpStruct->opacity = (FLOAT)env->GetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.opacity);
42
	lpStruct->transform._11 = (FLOAT)env->GetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__11);
43
	lpStruct->transform._12 = (FLOAT)env->GetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__12);
44
	lpStruct->transform._21 = (FLOAT)env->GetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__21);
45
	lpStruct->transform._22 = (FLOAT)env->GetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__22);
46
	lpStruct->transform._31 = (FLOAT)env->GetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__31);
47
	lpStruct->transform._32 = (FLOAT)env->GetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__32);
48
	return lpStruct;
49
}
50
51
void setD2D1_BRUSH_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_BRUSH_PROPERTIES *lpStruct)
52
{
53
	if (!D2D1_BRUSH_PROPERTIESFc.cached) cacheD2D1_BRUSH_PROPERTIESFields(env, lpObject);
54
	env->SetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.opacity, (jfloat)lpStruct->opacity);
55
	env->SetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__11, (jfloat)lpStruct->transform._11);
56
	env->SetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__12, (jfloat)lpStruct->transform._12);
57
	env->SetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__21, (jfloat)lpStruct->transform._21);
58
	env->SetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__22, (jfloat)lpStruct->transform._22);
59
	env->SetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__31, (jfloat)lpStruct->transform._31);
60
	env->SetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__32, (jfloat)lpStruct->transform._32);
61
}
62
#endif
63
64
#ifndef NO_D2D1_COLOR_F
65
typedef struct D2D1_COLOR_F_FID_CACHE {
66
	int cached;
67
	jclass clazz;
68
	jfieldID r, g, b, a;
69
} D2D1_COLOR_F_FID_CACHE;
70
71
D2D1_COLOR_F_FID_CACHE D2D1_COLOR_FFc;
72
73
void cacheD2D1_COLOR_FFields(JNIEnv *env, jobject lpObject)
74
{
75
	if (D2D1_COLOR_FFc.cached) return;
76
	D2D1_COLOR_FFc.clazz = env->GetObjectClass(lpObject);
77
	D2D1_COLOR_FFc.r = env->GetFieldID(D2D1_COLOR_FFc.clazz, "r", "F");
78
	D2D1_COLOR_FFc.g = env->GetFieldID(D2D1_COLOR_FFc.clazz, "g", "F");
79
	D2D1_COLOR_FFc.b = env->GetFieldID(D2D1_COLOR_FFc.clazz, "b", "F");
80
	D2D1_COLOR_FFc.a = env->GetFieldID(D2D1_COLOR_FFc.clazz, "a", "F");
81
	D2D1_COLOR_FFc.cached = 1;
82
}
83
84
D2D1_COLOR_F *getD2D1_COLOR_FFields(JNIEnv *env, jobject lpObject, D2D1_COLOR_F *lpStruct)
85
{
86
	if (!D2D1_COLOR_FFc.cached) cacheD2D1_COLOR_FFields(env, lpObject);
87
	lpStruct->r = env->GetFloatField(lpObject, D2D1_COLOR_FFc.r);
88
	lpStruct->g = env->GetFloatField(lpObject, D2D1_COLOR_FFc.g);
89
	lpStruct->b = env->GetFloatField(lpObject, D2D1_COLOR_FFc.b);
90
	lpStruct->a = env->GetFloatField(lpObject, D2D1_COLOR_FFc.a);
91
	return lpStruct;
92
}
93
94
void setD2D1_COLOR_FFields(JNIEnv *env, jobject lpObject, D2D1_COLOR_F *lpStruct)
95
{
96
	if (!D2D1_COLOR_FFc.cached) cacheD2D1_COLOR_FFields(env, lpObject);
97
	env->SetFloatField(lpObject, D2D1_COLOR_FFc.r, (jfloat)lpStruct->r);
98
	env->SetFloatField(lpObject, D2D1_COLOR_FFc.g, (jfloat)lpStruct->g);
99
	env->SetFloatField(lpObject, D2D1_COLOR_FFc.b, (jfloat)lpStruct->b);
100
	env->SetFloatField(lpObject, D2D1_COLOR_FFc.a, (jfloat)lpStruct->a);
101
}
102
#endif
103
104
#ifndef NO_D2D1_MATRIX_3X2_F
105
typedef struct D2D1_MATRIX_3X2_F_FID_CACHE {
106
	int cached;
107
	jclass clazz;
108
	jfieldID _11, _12, _21, _22, _31, _32;
109
} D2D1_MATRIX_3X2_F_FID_CACHE;
110
111
D2D1_MATRIX_3X2_F_FID_CACHE D2D1_MATRIX_3X2_FFc;
112
113
void cacheD2D1_MATRIX_3X2_FFields(JNIEnv *env, jobject lpObject)
114
{
115
	if (D2D1_MATRIX_3X2_FFc.cached) return;
116
	D2D1_MATRIX_3X2_FFc.clazz = env->GetObjectClass(lpObject);
117
	D2D1_MATRIX_3X2_FFc._11 = env->GetFieldID(D2D1_MATRIX_3X2_FFc.clazz, "_11", "F");
118
	D2D1_MATRIX_3X2_FFc._12 = env->GetFieldID(D2D1_MATRIX_3X2_FFc.clazz, "_12", "F");
119
	D2D1_MATRIX_3X2_FFc._21 = env->GetFieldID(D2D1_MATRIX_3X2_FFc.clazz, "_21", "F");
120
	D2D1_MATRIX_3X2_FFc._22 = env->GetFieldID(D2D1_MATRIX_3X2_FFc.clazz, "_22", "F");
121
	D2D1_MATRIX_3X2_FFc._31 = env->GetFieldID(D2D1_MATRIX_3X2_FFc.clazz, "_31", "F");
122
	D2D1_MATRIX_3X2_FFc._32 = env->GetFieldID(D2D1_MATRIX_3X2_FFc.clazz, "_32", "F");
123
	D2D1_MATRIX_3X2_FFc.cached = 1;
124
}
125
126
D2D1_MATRIX_3X2_F *getD2D1_MATRIX_3X2_FFields(JNIEnv *env, jobject lpObject, D2D1_MATRIX_3X2_F *lpStruct)
127
{
128
	if (!D2D1_MATRIX_3X2_FFc.cached) cacheD2D1_MATRIX_3X2_FFields(env, lpObject);
129
	lpStruct->_11 = env->GetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._11);
130
	lpStruct->_12 = env->GetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._12);
131
	lpStruct->_21 = env->GetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._21);
132
	lpStruct->_22 = env->GetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._22);
133
	lpStruct->_31 = env->GetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._31);
134
	lpStruct->_32 = env->GetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._32);
135
	return lpStruct;
136
}
137
138
void setD2D1_MATRIX_3X2_FFields(JNIEnv *env, jobject lpObject, D2D1_MATRIX_3X2_F *lpStruct)
139
{
140
	if (!D2D1_MATRIX_3X2_FFc.cached) cacheD2D1_MATRIX_3X2_FFields(env, lpObject);
141
	env->SetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._11, (jfloat)lpStruct->_11);
142
	env->SetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._12, (jfloat)lpStruct->_12);
143
	env->SetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._21, (jfloat)lpStruct->_21);
144
	env->SetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._22, (jfloat)lpStruct->_22);
145
	env->SetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._31, (jfloat)lpStruct->_31);
146
	env->SetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._32, (jfloat)lpStruct->_32);
147
}
148
#endif
149
150
#ifndef NO_D2D1_PIXEL_FORMAT
151
typedef struct D2D1_PIXEL_FORMAT_FID_CACHE {
152
	int cached;
153
	jclass clazz;
154
	jfieldID format, alphaMode;
155
} D2D1_PIXEL_FORMAT_FID_CACHE;
156
157
D2D1_PIXEL_FORMAT_FID_CACHE D2D1_PIXEL_FORMATFc;
158
159
void cacheD2D1_PIXEL_FORMATFields(JNIEnv *env, jobject lpObject)
160
{
161
	if (D2D1_PIXEL_FORMATFc.cached) return;
162
	D2D1_PIXEL_FORMATFc.clazz = env->GetObjectClass(lpObject);
163
	D2D1_PIXEL_FORMATFc.format = env->GetFieldID(D2D1_PIXEL_FORMATFc.clazz, "format", "I");
164
	D2D1_PIXEL_FORMATFc.alphaMode = env->GetFieldID(D2D1_PIXEL_FORMATFc.clazz, "alphaMode", "I");
165
	D2D1_PIXEL_FORMATFc.cached = 1;
166
}
167
168
D2D1_PIXEL_FORMAT *getD2D1_PIXEL_FORMATFields(JNIEnv *env, jobject lpObject, D2D1_PIXEL_FORMAT *lpStruct)
169
{
170
	if (!D2D1_PIXEL_FORMATFc.cached) cacheD2D1_PIXEL_FORMATFields(env, lpObject);
171
	lpStruct->format = (DXGI_FORMAT)env->GetIntField(lpObject, D2D1_PIXEL_FORMATFc.format);
172
	lpStruct->alphaMode = (D2D1_ALPHA_MODE)env->GetIntField(lpObject, D2D1_PIXEL_FORMATFc.alphaMode);
173
	return lpStruct;
174
}
175
176
void setD2D1_PIXEL_FORMATFields(JNIEnv *env, jobject lpObject, D2D1_PIXEL_FORMAT *lpStruct)
177
{
178
	if (!D2D1_PIXEL_FORMATFc.cached) cacheD2D1_PIXEL_FORMATFields(env, lpObject);
179
	env->SetIntField(lpObject, D2D1_PIXEL_FORMATFc.format, (jint)lpStruct->format);
180
	env->SetIntField(lpObject, D2D1_PIXEL_FORMATFc.alphaMode, (jint)lpStruct->alphaMode);
181
}
182
#endif
183
184
#ifndef NO_D2D1_POINT_2F
185
typedef struct D2D1_POINT_2F_FID_CACHE {
186
	int cached;
187
	jclass clazz;
188
	jfieldID x, y;
189
} D2D1_POINT_2F_FID_CACHE;
190
191
D2D1_POINT_2F_FID_CACHE D2D1_POINT_2FFc;
192
193
void cacheD2D1_POINT_2FFields(JNIEnv *env, jobject lpObject)
194
{
195
	if (D2D1_POINT_2FFc.cached) return;
196
	D2D1_POINT_2FFc.clazz = env->GetObjectClass(lpObject);
197
	D2D1_POINT_2FFc.x = env->GetFieldID(D2D1_POINT_2FFc.clazz, "x", "F");
198
	D2D1_POINT_2FFc.y = env->GetFieldID(D2D1_POINT_2FFc.clazz, "y", "F");
199
	D2D1_POINT_2FFc.cached = 1;
200
}
201
202
D2D1_POINT_2F *getD2D1_POINT_2FFields(JNIEnv *env, jobject lpObject, D2D1_POINT_2F *lpStruct)
203
{
204
	if (!D2D1_POINT_2FFc.cached) cacheD2D1_POINT_2FFields(env, lpObject);
205
	lpStruct->x = env->GetFloatField(lpObject, D2D1_POINT_2FFc.x);
206
	lpStruct->y = env->GetFloatField(lpObject, D2D1_POINT_2FFc.y);
207
	return lpStruct;
208
}
209
210
void setD2D1_POINT_2FFields(JNIEnv *env, jobject lpObject, D2D1_POINT_2F *lpStruct)
211
{
212
	if (!D2D1_POINT_2FFc.cached) cacheD2D1_POINT_2FFields(env, lpObject);
213
	env->SetFloatField(lpObject, D2D1_POINT_2FFc.x, (jfloat)lpStruct->x);
214
	env->SetFloatField(lpObject, D2D1_POINT_2FFc.y, (jfloat)lpStruct->y);
215
}
216
#endif
217
218
#ifndef NO_D2D1_RECT_F
219
typedef struct D2D1_RECT_F_FID_CACHE {
220
	int cached;
221
	jclass clazz;
222
	jfieldID left, top, right, bottom;
223
} D2D1_RECT_F_FID_CACHE;
224
225
D2D1_RECT_F_FID_CACHE D2D1_RECT_FFc;
226
227
void cacheD2D1_RECT_FFields(JNIEnv *env, jobject lpObject)
228
{
229
	if (D2D1_RECT_FFc.cached) return;
230
	D2D1_RECT_FFc.clazz = env->GetObjectClass(lpObject);
231
	D2D1_RECT_FFc.left = env->GetFieldID(D2D1_RECT_FFc.clazz, "left", "F");
232
	D2D1_RECT_FFc.top = env->GetFieldID(D2D1_RECT_FFc.clazz, "top", "F");
233
	D2D1_RECT_FFc.right = env->GetFieldID(D2D1_RECT_FFc.clazz, "right", "F");
234
	D2D1_RECT_FFc.bottom = env->GetFieldID(D2D1_RECT_FFc.clazz, "bottom", "F");
235
	D2D1_RECT_FFc.cached = 1;
236
}
237
238
D2D1_RECT_F *getD2D1_RECT_FFields(JNIEnv *env, jobject lpObject, D2D1_RECT_F *lpStruct)
239
{
240
	if (!D2D1_RECT_FFc.cached) cacheD2D1_RECT_FFields(env, lpObject);
241
	lpStruct->left = env->GetFloatField(lpObject, D2D1_RECT_FFc.left);
242
	lpStruct->top = env->GetFloatField(lpObject, D2D1_RECT_FFc.top);
243
	lpStruct->right = env->GetFloatField(lpObject, D2D1_RECT_FFc.right);
244
	lpStruct->bottom = env->GetFloatField(lpObject, D2D1_RECT_FFc.bottom);
245
	return lpStruct;
246
}
247
248
void setD2D1_RECT_FFields(JNIEnv *env, jobject lpObject, D2D1_RECT_F *lpStruct)
249
{
250
	if (!D2D1_RECT_FFc.cached) cacheD2D1_RECT_FFields(env, lpObject);
251
	env->SetFloatField(lpObject, D2D1_RECT_FFc.left, (jfloat)lpStruct->left);
252
	env->SetFloatField(lpObject, D2D1_RECT_FFc.top, (jfloat)lpStruct->top);
253
	env->SetFloatField(lpObject, D2D1_RECT_FFc.right, (jfloat)lpStruct->right);
254
	env->SetFloatField(lpObject, D2D1_RECT_FFc.bottom, (jfloat)lpStruct->bottom);
255
}
256
#endif
257
258
#ifndef NO_D2D1_RENDER_TARGET_PROPERTIES
259
typedef struct D2D1_RENDER_TARGET_PROPERTIES_FID_CACHE {
260
	int cached;
261
	jclass clazz;
262
	jfieldID type, pixelFormat_format, pixelFormat_alphaMode, dpiX, dpiY, usage, minLevel;
263
} D2D1_RENDER_TARGET_PROPERTIES_FID_CACHE;
264
265
D2D1_RENDER_TARGET_PROPERTIES_FID_CACHE D2D1_RENDER_TARGET_PROPERTIESFc;
266
267
void cacheD2D1_RENDER_TARGET_PROPERTIESFields(JNIEnv *env, jobject lpObject)
268
{
269
	if (D2D1_RENDER_TARGET_PROPERTIESFc.cached) return;
270
	D2D1_RENDER_TARGET_PROPERTIESFc.clazz = env->GetObjectClass(lpObject);
271
	D2D1_RENDER_TARGET_PROPERTIESFc.type = env->GetFieldID(D2D1_RENDER_TARGET_PROPERTIESFc.clazz, "type", "I");
272
	D2D1_RENDER_TARGET_PROPERTIESFc.pixelFormat_format = env->GetFieldID(D2D1_RENDER_TARGET_PROPERTIESFc.clazz, "pixelFormat_format", "I");
273
	D2D1_RENDER_TARGET_PROPERTIESFc.pixelFormat_alphaMode = env->GetFieldID(D2D1_RENDER_TARGET_PROPERTIESFc.clazz, "pixelFormat_alphaMode", "I");
274
	D2D1_RENDER_TARGET_PROPERTIESFc.dpiX = env->GetFieldID(D2D1_RENDER_TARGET_PROPERTIESFc.clazz, "dpiX", "F");
275
	D2D1_RENDER_TARGET_PROPERTIESFc.dpiY = env->GetFieldID(D2D1_RENDER_TARGET_PROPERTIESFc.clazz, "dpiY", "F");
276
	D2D1_RENDER_TARGET_PROPERTIESFc.usage = env->GetFieldID(D2D1_RENDER_TARGET_PROPERTIESFc.clazz, "usage", "I");
277
	D2D1_RENDER_TARGET_PROPERTIESFc.minLevel = env->GetFieldID(D2D1_RENDER_TARGET_PROPERTIESFc.clazz, "minLevel", "I");
278
	D2D1_RENDER_TARGET_PROPERTIESFc.cached = 1;
279
}
280
281
D2D1_RENDER_TARGET_PROPERTIES *getD2D1_RENDER_TARGET_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_RENDER_TARGET_PROPERTIES *lpStruct)
282
{
283
	if (!D2D1_RENDER_TARGET_PROPERTIESFc.cached) cacheD2D1_RENDER_TARGET_PROPERTIESFields(env, lpObject);
284
	lpStruct->type = (D2D1_RENDER_TARGET_TYPE)env->GetIntField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.type);
285
	lpStruct->pixelFormat.format = (DXGI_FORMAT)env->GetIntField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.pixelFormat_format);
286
	lpStruct->pixelFormat.alphaMode = (D2D1_ALPHA_MODE)env->GetIntField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.pixelFormat_alphaMode);
287
	lpStruct->dpiX = env->GetFloatField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.dpiX);
288
	lpStruct->dpiY = env->GetFloatField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.dpiY);
289
	lpStruct->usage = (D2D1_RENDER_TARGET_USAGE)env->GetIntField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.usage);
290
	lpStruct->minLevel = (D2D1_FEATURE_LEVEL)env->GetIntField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.minLevel);
291
	return lpStruct;
292
}
293
294
void setD2D1_RENDER_TARGET_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_RENDER_TARGET_PROPERTIES *lpStruct)
295
{
296
	if (!D2D1_RENDER_TARGET_PROPERTIESFc.cached) cacheD2D1_RENDER_TARGET_PROPERTIESFields(env, lpObject);
297
	env->SetIntField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.type, (jint)lpStruct->type);
298
	env->SetIntField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.pixelFormat_format, (jint)lpStruct->pixelFormat.format);
299
	env->SetIntField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.pixelFormat_alphaMode, (jint)lpStruct->pixelFormat.alphaMode);
300
	env->SetFloatField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.dpiX, (jfloat)lpStruct->dpiX);
301
	env->SetFloatField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.dpiY, (jfloat)lpStruct->dpiY);
302
	env->SetIntField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.usage, (jint)lpStruct->usage);
303
	env->SetIntField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.minLevel, (jint)lpStruct->minLevel);
304
}
305
#endif
306
307
#ifndef NO_D2D1_ROUNDED_RECT
308
typedef struct D2D1_ROUNDED_RECT_FID_CACHE {
309
	int cached;
310
	jclass clazz;
311
	jfieldID rect_left, rect_top, rect_right, rect_bottom, radiusX, radiusY;
312
} D2D1_ROUNDED_RECT_FID_CACHE;
313
314
D2D1_ROUNDED_RECT_FID_CACHE D2D1_ROUNDED_RECTFc;
315
316
void cacheD2D1_ROUNDED_RECTFields(JNIEnv *env, jobject lpObject)
317
{
318
	if (D2D1_ROUNDED_RECTFc.cached) return;
319
	D2D1_ROUNDED_RECTFc.clazz = env->GetObjectClass(lpObject);
320
	D2D1_ROUNDED_RECTFc.rect_left = env->GetFieldID(D2D1_ROUNDED_RECTFc.clazz, "rect_left", "F");
321
	D2D1_ROUNDED_RECTFc.rect_top = env->GetFieldID(D2D1_ROUNDED_RECTFc.clazz, "rect_top", "F");
322
	D2D1_ROUNDED_RECTFc.rect_right = env->GetFieldID(D2D1_ROUNDED_RECTFc.clazz, "rect_right", "F");
323
	D2D1_ROUNDED_RECTFc.rect_bottom = env->GetFieldID(D2D1_ROUNDED_RECTFc.clazz, "rect_bottom", "F");
324
	D2D1_ROUNDED_RECTFc.radiusX = env->GetFieldID(D2D1_ROUNDED_RECTFc.clazz, "radiusX", "F");
325
	D2D1_ROUNDED_RECTFc.radiusY = env->GetFieldID(D2D1_ROUNDED_RECTFc.clazz, "radiusY", "F");
326
	D2D1_ROUNDED_RECTFc.cached = 1;
327
}
328
329
D2D1_ROUNDED_RECT *getD2D1_ROUNDED_RECTFields(JNIEnv *env, jobject lpObject, D2D1_ROUNDED_RECT *lpStruct)
330
{
331
	if (!D2D1_ROUNDED_RECTFc.cached) cacheD2D1_ROUNDED_RECTFields(env, lpObject);
332
	lpStruct->rect.left = (FLOAT)env->GetFloatField(lpObject, D2D1_ROUNDED_RECTFc.rect_left);
333
	lpStruct->rect.top = (FLOAT)env->GetFloatField(lpObject, D2D1_ROUNDED_RECTFc.rect_top);
334
	lpStruct->rect.right = (FLOAT)env->GetFloatField(lpObject, D2D1_ROUNDED_RECTFc.rect_right);
335
	lpStruct->rect.bottom = (FLOAT)env->GetFloatField(lpObject, D2D1_ROUNDED_RECTFc.rect_bottom);
336
	lpStruct->radiusX = env->GetFloatField(lpObject, D2D1_ROUNDED_RECTFc.radiusX);
337
	lpStruct->radiusY = env->GetFloatField(lpObject, D2D1_ROUNDED_RECTFc.radiusY);
338
	return lpStruct;
339
}
340
341
void setD2D1_ROUNDED_RECTFields(JNIEnv *env, jobject lpObject, D2D1_ROUNDED_RECT *lpStruct)
342
{
343
	if (!D2D1_ROUNDED_RECTFc.cached) cacheD2D1_ROUNDED_RECTFields(env, lpObject);
344
	env->SetFloatField(lpObject, D2D1_ROUNDED_RECTFc.rect_left, (jfloat)lpStruct->rect.left);
345
	env->SetFloatField(lpObject, D2D1_ROUNDED_RECTFc.rect_top, (jfloat)lpStruct->rect.top);
346
	env->SetFloatField(lpObject, D2D1_ROUNDED_RECTFc.rect_right, (jfloat)lpStruct->rect.right);
347
	env->SetFloatField(lpObject, D2D1_ROUNDED_RECTFc.rect_bottom, (jfloat)lpStruct->rect.bottom);
348
	env->SetFloatField(lpObject, D2D1_ROUNDED_RECTFc.radiusX, (jfloat)lpStruct->radiusX);
349
	env->SetFloatField(lpObject, D2D1_ROUNDED_RECTFc.radiusY, (jfloat)lpStruct->radiusY);
350
}
351
#endif
352
353
#ifndef NO_D2D1_SIZE_F
354
typedef struct D2D1_SIZE_F_FID_CACHE {
355
	int cached;
356
	jclass clazz;
357
	jfieldID width, height;
358
} D2D1_SIZE_F_FID_CACHE;
359
360
D2D1_SIZE_F_FID_CACHE D2D1_SIZE_FFc;
361
362
void cacheD2D1_SIZE_FFields(JNIEnv *env, jobject lpObject)
363
{
364
	if (D2D1_SIZE_FFc.cached) return;
365
	D2D1_SIZE_FFc.clazz = env->GetObjectClass(lpObject);
366
	D2D1_SIZE_FFc.width = env->GetFieldID(D2D1_SIZE_FFc.clazz, "width", "F");
367
	D2D1_SIZE_FFc.height = env->GetFieldID(D2D1_SIZE_FFc.clazz, "height", "F");
368
	D2D1_SIZE_FFc.cached = 1;
369
}
370
371
D2D1_SIZE_F *getD2D1_SIZE_FFields(JNIEnv *env, jobject lpObject, D2D1_SIZE_F *lpStruct)
372
{
373
	if (!D2D1_SIZE_FFc.cached) cacheD2D1_SIZE_FFields(env, lpObject);
374
	lpStruct->width = env->GetFloatField(lpObject, D2D1_SIZE_FFc.width);
375
	lpStruct->height = env->GetFloatField(lpObject, D2D1_SIZE_FFc.height);
376
	return lpStruct;
377
}
378
379
void setD2D1_SIZE_FFields(JNIEnv *env, jobject lpObject, D2D1_SIZE_F *lpStruct)
380
{
381
	if (!D2D1_SIZE_FFc.cached) cacheD2D1_SIZE_FFields(env, lpObject);
382
	env->SetFloatField(lpObject, D2D1_SIZE_FFc.width, (jfloat)lpStruct->width);
383
	env->SetFloatField(lpObject, D2D1_SIZE_FFc.height, (jfloat)lpStruct->height);
384
}
385
#endif
386
387
#ifndef NO_D2D1_STROKE_STYLE_PROPERTIES
388
typedef struct D2D1_STROKE_STYLE_PROPERTIES_FID_CACHE {
389
	int cached;
390
	jclass clazz;
391
	jfieldID startCap, endCap, dashCap, lineJoin, miterLimit, dashStyle, dashOffset;
392
} D2D1_STROKE_STYLE_PROPERTIES_FID_CACHE;
393
394
D2D1_STROKE_STYLE_PROPERTIES_FID_CACHE D2D1_STROKE_STYLE_PROPERTIESFc;
395
396
void cacheD2D1_STROKE_STYLE_PROPERTIESFields(JNIEnv *env, jobject lpObject)
397
{
398
	if (D2D1_STROKE_STYLE_PROPERTIESFc.cached) return;
399
	D2D1_STROKE_STYLE_PROPERTIESFc.clazz = env->GetObjectClass(lpObject);
400
	D2D1_STROKE_STYLE_PROPERTIESFc.startCap = env->GetFieldID(D2D1_STROKE_STYLE_PROPERTIESFc.clazz, "startCap", "I");
401
	D2D1_STROKE_STYLE_PROPERTIESFc.endCap = env->GetFieldID(D2D1_STROKE_STYLE_PROPERTIESFc.clazz, "endCap", "I");
402
	D2D1_STROKE_STYLE_PROPERTIESFc.dashCap = env->GetFieldID(D2D1_STROKE_STYLE_PROPERTIESFc.clazz, "dashCap", "I");
403
	D2D1_STROKE_STYLE_PROPERTIESFc.lineJoin = env->GetFieldID(D2D1_STROKE_STYLE_PROPERTIESFc.clazz, "lineJoin", "I");
404
	D2D1_STROKE_STYLE_PROPERTIESFc.miterLimit = env->GetFieldID(D2D1_STROKE_STYLE_PROPERTIESFc.clazz, "miterLimit", "F");
405
	D2D1_STROKE_STYLE_PROPERTIESFc.dashStyle = env->GetFieldID(D2D1_STROKE_STYLE_PROPERTIESFc.clazz, "dashStyle", "I");
406
	D2D1_STROKE_STYLE_PROPERTIESFc.dashOffset = env->GetFieldID(D2D1_STROKE_STYLE_PROPERTIESFc.clazz, "dashOffset", "F");
407
	D2D1_STROKE_STYLE_PROPERTIESFc.cached = 1;
408
}
409
410
D2D1_STROKE_STYLE_PROPERTIES *getD2D1_STROKE_STYLE_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_STROKE_STYLE_PROPERTIES *lpStruct)
411
{
412
	if (!D2D1_STROKE_STYLE_PROPERTIESFc.cached) cacheD2D1_STROKE_STYLE_PROPERTIESFields(env, lpObject);
413
	lpStruct->startCap = (D2D1_CAP_STYLE)env->GetIntField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.startCap);
414
	lpStruct->endCap = (D2D1_CAP_STYLE)env->GetIntField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.endCap);
415
	lpStruct->dashCap = (D2D1_CAP_STYLE)env->GetIntField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.dashCap);
416
	lpStruct->lineJoin = (D2D1_LINE_JOIN)env->GetIntField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.lineJoin);
417
	lpStruct->miterLimit = (FLOAT)env->GetFloatField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.miterLimit);
418
	lpStruct->dashStyle = (D2D1_DASH_STYLE)env->GetIntField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.dashStyle);
419
	lpStruct->dashOffset = (FLOAT)env->GetFloatField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.dashOffset);
420
	return lpStruct;
421
}
422
423
void setD2D1_STROKE_STYLE_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_STROKE_STYLE_PROPERTIES *lpStruct)
424
{
425
	if (!D2D1_STROKE_STYLE_PROPERTIESFc.cached) cacheD2D1_STROKE_STYLE_PROPERTIESFields(env, lpObject);
426
	env->SetIntField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.startCap, (jint)lpStruct->startCap);
427
	env->SetIntField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.endCap, (jint)lpStruct->endCap);
428
	env->SetIntField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.dashCap, (jint)lpStruct->dashCap);
429
	env->SetIntField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.lineJoin, (jint)lpStruct->lineJoin);
430
	env->SetFloatField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.miterLimit, (jfloat)lpStruct->miterLimit);
431
	env->SetIntField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.dashStyle, (jint)lpStruct->dashStyle);
432
	env->SetFloatField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.dashOffset, (jfloat)lpStruct->dashOffset);
433
}
434
#endif
435
436
#ifndef NO_RECT
437
typedef struct RECT_FID_CACHE {
438
	int cached;
439
	jclass clazz;
440
	jfieldID left, top, right, bottom;
441
} RECT_FID_CACHE;
442
443
RECT_FID_CACHE RECTFc;
444
445
void cacheRECTFields(JNIEnv *env, jobject lpObject)
446
{
447
	if (RECTFc.cached) return;
448
	RECTFc.clazz = env->GetObjectClass(lpObject);
449
	RECTFc.left = env->GetFieldID(RECTFc.clazz, "left", "I");
450
	RECTFc.top = env->GetFieldID(RECTFc.clazz, "top", "I");
451
	RECTFc.right = env->GetFieldID(RECTFc.clazz, "right", "I");
452
	RECTFc.bottom = env->GetFieldID(RECTFc.clazz, "bottom", "I");
453
	RECTFc.cached = 1;
454
}
455
456
RECT *getRECTFields(JNIEnv *env, jobject lpObject, RECT *lpStruct)
457
{
458
	if (!RECTFc.cached) cacheRECTFields(env, lpObject);
459
	lpStruct->left = env->GetIntField(lpObject, RECTFc.left);
460
	lpStruct->top = env->GetIntField(lpObject, RECTFc.top);
461
	lpStruct->right = env->GetIntField(lpObject, RECTFc.right);
462
	lpStruct->bottom = env->GetIntField(lpObject, RECTFc.bottom);
463
	return lpStruct;
464
}
465
466
void setRECTFields(JNIEnv *env, jobject lpObject, RECT *lpStruct)
467
{
468
	if (!RECTFc.cached) cacheRECTFields(env, lpObject);
469
	env->SetIntField(lpObject, RECTFc.left, (jint)lpStruct->left);
470
	env->SetIntField(lpObject, RECTFc.top, (jint)lpStruct->top);
471
	env->SetIntField(lpObject, RECTFc.right, (jint)lpStruct->right);
472
	env->SetIntField(lpObject, RECTFc.bottom, (jint)lpStruct->bottom);
473
}
474
#endif
475
(-)a/bundles/org.eclipse.swt/Eclipse (+145 lines)
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
12
#include "d2d.h"
13
14
#ifndef NO_D2D1_BRUSH_PROPERTIES
15
void cacheD2D1_BRUSH_PROPERTIESFields(JNIEnv *env, jobject lpObject);
16
D2D1_BRUSH_PROPERTIES *getD2D1_BRUSH_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_BRUSH_PROPERTIES *lpStruct);
17
void setD2D1_BRUSH_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_BRUSH_PROPERTIES *lpStruct);
18
#define D2D1_BRUSH_PROPERTIES_sizeof() sizeof(D2D1_BRUSH_PROPERTIES)
19
#else
20
#define cacheD2D1_BRUSH_PROPERTIESFields(a,b)
21
#define getD2D1_BRUSH_PROPERTIESFields(a,b,c) NULL
22
#define setD2D1_BRUSH_PROPERTIESFields(a,b,c)
23
#define D2D1_BRUSH_PROPERTIES_sizeof() 0
24
#endif
25
26
#ifndef NO_D2D1_COLOR_F
27
void cacheD2D1_COLOR_FFields(JNIEnv *env, jobject lpObject);
28
D2D1_COLOR_F *getD2D1_COLOR_FFields(JNIEnv *env, jobject lpObject, D2D1_COLOR_F *lpStruct);
29
void setD2D1_COLOR_FFields(JNIEnv *env, jobject lpObject, D2D1_COLOR_F *lpStruct);
30
#define D2D1_COLOR_F_sizeof() sizeof(D2D1_COLOR_F)
31
#else
32
#define cacheD2D1_COLOR_FFields(a,b)
33
#define getD2D1_COLOR_FFields(a,b,c) NULL
34
#define setD2D1_COLOR_FFields(a,b,c)
35
#define D2D1_COLOR_F_sizeof() 0
36
#endif
37
38
#ifndef NO_D2D1_MATRIX_3X2_F
39
void cacheD2D1_MATRIX_3X2_FFields(JNIEnv *env, jobject lpObject);
40
D2D1_MATRIX_3X2_F *getD2D1_MATRIX_3X2_FFields(JNIEnv *env, jobject lpObject, D2D1_MATRIX_3X2_F *lpStruct);
41
void setD2D1_MATRIX_3X2_FFields(JNIEnv *env, jobject lpObject, D2D1_MATRIX_3X2_F *lpStruct);
42
#define D2D1_MATRIX_3X2_F_sizeof() sizeof(D2D1_MATRIX_3X2_F)
43
#else
44
#define cacheD2D1_MATRIX_3X2_FFields(a,b)
45
#define getD2D1_MATRIX_3X2_FFields(a,b,c) NULL
46
#define setD2D1_MATRIX_3X2_FFields(a,b,c)
47
#define D2D1_MATRIX_3X2_F_sizeof() 0
48
#endif
49
50
#ifndef NO_D2D1_PIXEL_FORMAT
51
void cacheD2D1_PIXEL_FORMATFields(JNIEnv *env, jobject lpObject);
52
D2D1_PIXEL_FORMAT *getD2D1_PIXEL_FORMATFields(JNIEnv *env, jobject lpObject, D2D1_PIXEL_FORMAT *lpStruct);
53
void setD2D1_PIXEL_FORMATFields(JNIEnv *env, jobject lpObject, D2D1_PIXEL_FORMAT *lpStruct);
54
#define D2D1_PIXEL_FORMAT_sizeof() sizeof(D2D1_PIXEL_FORMAT)
55
#else
56
#define cacheD2D1_PIXEL_FORMATFields(a,b)
57
#define getD2D1_PIXEL_FORMATFields(a,b,c) NULL
58
#define setD2D1_PIXEL_FORMATFields(a,b,c)
59
#define D2D1_PIXEL_FORMAT_sizeof() 0
60
#endif
61
62
#ifndef NO_D2D1_POINT_2F
63
void cacheD2D1_POINT_2FFields(JNIEnv *env, jobject lpObject);
64
D2D1_POINT_2F *getD2D1_POINT_2FFields(JNIEnv *env, jobject lpObject, D2D1_POINT_2F *lpStruct);
65
void setD2D1_POINT_2FFields(JNIEnv *env, jobject lpObject, D2D1_POINT_2F *lpStruct);
66
#define D2D1_POINT_2F_sizeof() sizeof(D2D1_POINT_2F)
67
#else
68
#define cacheD2D1_POINT_2FFields(a,b)
69
#define getD2D1_POINT_2FFields(a,b,c) NULL
70
#define setD2D1_POINT_2FFields(a,b,c)
71
#define D2D1_POINT_2F_sizeof() 0
72
#endif
73
74
#ifndef NO_D2D1_RECT_F
75
void cacheD2D1_RECT_FFields(JNIEnv *env, jobject lpObject);
76
D2D1_RECT_F *getD2D1_RECT_FFields(JNIEnv *env, jobject lpObject, D2D1_RECT_F *lpStruct);
77
void setD2D1_RECT_FFields(JNIEnv *env, jobject lpObject, D2D1_RECT_F *lpStruct);
78
#define D2D1_RECT_F_sizeof() sizeof(D2D1_RECT_F)
79
#else
80
#define cacheD2D1_RECT_FFields(a,b)
81
#define getD2D1_RECT_FFields(a,b,c) NULL
82
#define setD2D1_RECT_FFields(a,b,c)
83
#define D2D1_RECT_F_sizeof() 0
84
#endif
85
86
#ifndef NO_D2D1_RENDER_TARGET_PROPERTIES
87
void cacheD2D1_RENDER_TARGET_PROPERTIESFields(JNIEnv *env, jobject lpObject);
88
D2D1_RENDER_TARGET_PROPERTIES *getD2D1_RENDER_TARGET_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_RENDER_TARGET_PROPERTIES *lpStruct);
89
void setD2D1_RENDER_TARGET_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_RENDER_TARGET_PROPERTIES *lpStruct);
90
#define D2D1_RENDER_TARGET_PROPERTIES_sizeof() sizeof(D2D1_RENDER_TARGET_PROPERTIES)
91
#else
92
#define cacheD2D1_RENDER_TARGET_PROPERTIESFields(a,b)
93
#define getD2D1_RENDER_TARGET_PROPERTIESFields(a,b,c) NULL
94
#define setD2D1_RENDER_TARGET_PROPERTIESFields(a,b,c)
95
#define D2D1_RENDER_TARGET_PROPERTIES_sizeof() 0
96
#endif
97
98
#ifndef NO_D2D1_ROUNDED_RECT
99
void cacheD2D1_ROUNDED_RECTFields(JNIEnv *env, jobject lpObject);
100
D2D1_ROUNDED_RECT *getD2D1_ROUNDED_RECTFields(JNIEnv *env, jobject lpObject, D2D1_ROUNDED_RECT *lpStruct);
101
void setD2D1_ROUNDED_RECTFields(JNIEnv *env, jobject lpObject, D2D1_ROUNDED_RECT *lpStruct);
102
#define D2D1_ROUNDED_RECT_sizeof() sizeof(D2D1_ROUNDED_RECT)
103
#else
104
#define cacheD2D1_ROUNDED_RECTFields(a,b)
105
#define getD2D1_ROUNDED_RECTFields(a,b,c) NULL
106
#define setD2D1_ROUNDED_RECTFields(a,b,c)
107
#define D2D1_ROUNDED_RECT_sizeof() 0
108
#endif
109
110
#ifndef NO_D2D1_SIZE_F
111
void cacheD2D1_SIZE_FFields(JNIEnv *env, jobject lpObject);
112
D2D1_SIZE_F *getD2D1_SIZE_FFields(JNIEnv *env, jobject lpObject, D2D1_SIZE_F *lpStruct);
113
void setD2D1_SIZE_FFields(JNIEnv *env, jobject lpObject, D2D1_SIZE_F *lpStruct);
114
#define D2D1_SIZE_F_sizeof() sizeof(D2D1_SIZE_F)
115
#else
116
#define cacheD2D1_SIZE_FFields(a,b)
117
#define getD2D1_SIZE_FFields(a,b,c) NULL
118
#define setD2D1_SIZE_FFields(a,b,c)
119
#define D2D1_SIZE_F_sizeof() 0
120
#endif
121
122
#ifndef NO_D2D1_STROKE_STYLE_PROPERTIES
123
void cacheD2D1_STROKE_STYLE_PROPERTIESFields(JNIEnv *env, jobject lpObject);
124
D2D1_STROKE_STYLE_PROPERTIES *getD2D1_STROKE_STYLE_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_STROKE_STYLE_PROPERTIES *lpStruct);
125
void setD2D1_STROKE_STYLE_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_STROKE_STYLE_PROPERTIES *lpStruct);
126
#define D2D1_STROKE_STYLE_PROPERTIES_sizeof() sizeof(D2D1_STROKE_STYLE_PROPERTIES)
127
#else
128
#define cacheD2D1_STROKE_STYLE_PROPERTIESFields(a,b)
129
#define getD2D1_STROKE_STYLE_PROPERTIESFields(a,b,c) NULL
130
#define setD2D1_STROKE_STYLE_PROPERTIESFields(a,b,c)
131
#define D2D1_STROKE_STYLE_PROPERTIES_sizeof() 0
132
#endif
133
134
#ifndef NO_RECT
135
void cacheRECTFields(JNIEnv *env, jobject lpObject);
136
RECT *getRECTFields(JNIEnv *env, jobject lpObject, RECT *lpStruct);
137
void setRECTFields(JNIEnv *env, jobject lpObject, RECT *lpStruct);
138
#define RECT_sizeof() sizeof(RECT)
139
#else
140
#define cacheRECTFields(a,b)
141
#define getRECTFields(a,b,c) NULL
142
#define setRECTFields(a,b,c)
143
#define RECT_sizeof() 0
144
#endif
145
(-)a/bundles/org.eclipse.swt/Eclipse (+68 lines)
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
12
#include "swt.h"
13
#include "dw_structs.h"
14
#include "dw_stats.h"
15
16
#ifndef DW_NATIVE
17
#define DW_NATIVE(func) Java_org_eclipse_swt_internal_dw_DW_##func
18
#endif
19
20
#ifndef NO_IDWriteFactory_1CreateTextFormat
21
extern "C" JNIEXPORT jint JNICALL DW_NATIVE(IDWriteFactory_1CreateTextFormat)(JNIEnv *env, jclass that, jintLong arg0, jcharArray arg1, jintLong arg2, jint arg3, jint arg4, jint arg5, jfloat arg6, jcharArray arg7, jintLongArray arg8);
22
JNIEXPORT jint JNICALL DW_NATIVE(IDWriteFactory_1CreateTextFormat)
23
	(JNIEnv *env, jclass that, jintLong arg0, jcharArray arg1, jintLong arg2, jint arg3, jint arg4, jint arg5, jfloat arg6, jcharArray arg7, jintLongArray arg8)
24
{
25
	jchar *lparg1=NULL;
26
	jchar *lparg7=NULL;
27
	jintLong *lparg8=NULL;
28
	jint rc = 0;
29
	DW_NATIVE_ENTER(env, that, IDWriteFactory_1CreateTextFormat_FUNC);
30
	if (arg1) if ((lparg1 = env->GetCharArrayElements(arg1, NULL)) == NULL) goto fail;
31
	if (arg7) if ((lparg7 = env->GetCharArrayElements(arg7, NULL)) == NULL) goto fail;
32
	if (arg8) if ((lparg8 = env->GetIntLongArrayElements(arg8, NULL)) == NULL) goto fail;
33
	rc = (jint)((IDWriteFactory*)arg0)->CreateTextFormat((const WCHAR *)lparg1, (IDWriteFontCollection*)arg2, (DWRITE_FONT_WEIGHT)arg3, (DWRITE_FONT_STYLE)arg4, (DWRITE_FONT_STRETCH)arg5, arg6, (const WCHAR *)lparg7, (IDWriteTextFormat**)lparg8);
34
fail:
35
	if (arg8 && lparg8) env->ReleaseIntLongArrayElements(arg8, lparg8, 0);
36
	if (arg7 && lparg7) env->ReleaseCharArrayElements(arg7, lparg7, 0);
37
	if (arg1 && lparg1) env->ReleaseCharArrayElements(arg1, lparg1, 0);
38
	DW_NATIVE_EXIT(env, that, IDWriteFactory_1CreateTextFormat_FUNC);
39
	return rc;
40
}
41
#endif
42
43
#ifndef NO_IDWriteTextFormat_1SetParagraphAlignment
44
extern "C" JNIEXPORT jint JNICALL DW_NATIVE(IDWriteTextFormat_1SetParagraphAlignment)(JNIEnv *env, jclass that, jintLong arg0, jint arg1);
45
JNIEXPORT jint JNICALL DW_NATIVE(IDWriteTextFormat_1SetParagraphAlignment)
46
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
47
{
48
	jint rc = 0;
49
	DW_NATIVE_ENTER(env, that, IDWriteTextFormat_1SetParagraphAlignment_FUNC);
50
	rc = (jint)((IDWriteTextFormat*)arg0)->SetParagraphAlignment((DWRITE_PARAGRAPH_ALIGNMENT)arg1);
51
	DW_NATIVE_EXIT(env, that, IDWriteTextFormat_1SetParagraphAlignment_FUNC);
52
	return rc;
53
}
54
#endif
55
56
#ifndef NO_IDWriteTextFormat_1SetTextAlignment
57
extern "C" JNIEXPORT jint JNICALL DW_NATIVE(IDWriteTextFormat_1SetTextAlignment)(JNIEnv *env, jclass that, jintLong arg0, jint arg1);
58
JNIEXPORT jint JNICALL DW_NATIVE(IDWriteTextFormat_1SetTextAlignment)
59
	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
60
{
61
	jint rc = 0;
62
	DW_NATIVE_ENTER(env, that, IDWriteTextFormat_1SetTextAlignment_FUNC);
63
	rc = (jint)((IDWriteTextFormat*)arg0)->SetTextAlignment((DWRITE_TEXT_ALIGNMENT)arg1);
64
	DW_NATIVE_EXIT(env, that, IDWriteTextFormat_1SetTextAlignment_FUNC);
65
	return rc;
66
}
67
#endif
68
(-)a/bundles/org.eclipse.swt/Eclipse (+57 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2005 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
12
#ifndef INC_dw_H
13
#define INC_dw_H
14
15
#include <windows.h>
16
#include <Dwrite.h>
17
#include "dw_custom.h"
18
19
#define NATIVE_TRY(env, that, func) \
20
	__try {
21
#define NATIVE_CATCH(env, that, func) \
22
	} __except(EXCEPTION_EXECUTE_HANDLER) { \
23
		jclass expClass = (*env)->FindClass(env, "org/eclipse/swt/SWTError");  \
24
		if (expClass) { \
25
			char buffer[256]; \
26
			PRINT_CODE(buffer, 256, "cought native exception: 0x%x", GetExceptionCode()) \
27
			(*env)->ThrowNew(env, expClass, buffer); \
28
		} \
29
	}
30
31
#define DW_NATIVE_ENTER_TRY(env, that, func) \
32
	DW_NATIVE_ENTER(env, that, func); \
33
	NATIVE_TRY(env, that, func);
34
#define DW_NATIVE_EXIT_CATCH(env, that, func) \
35
	NATIVE_CATCH(env, that, func); \
36
	DW_NATIVE_EXIT(env, that, func);
37
38
#ifdef __cplusplus
39
extern "C" {
40
#endif
41
42
#define CALLING_CONVENTION CALLBACK
43
#define DWrite_LOAD_FUNCTION(var, name, proc) \
44
		static int initialized = 0; \
45
		static FARPROC var = NULL; \
46
		if (!initialized) { \
47
			HMODULE hm = LoadLibrary(name##_LIB); \
48
			if (hm) var = GetProcAddress(hm, proc); \
49
			initialized = 1; \
50
		}
51
52
#ifdef __cplusplus
53
}
54
#endif
55
56
57
#endif /* INC_dw_H */
(-)a/bundles/org.eclipse.swt/Eclipse (+48 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 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
12
#include "swt.h"
13
#include "dw.h"
14
#include "dw_stats.h"
15
16
#define DW_NATIVE(func) Java_org_eclipse_swt_internal_dw_DW_##func
17
18
#ifndef NO_DWriteCreateFactory
19
extern "C" JNIEXPORT jint JNICALL DW_NATIVE(DWriteCreateFactory)(JNIEnv *env, jclass that, jint arg0, jbyteArray arg1, jintLongArray arg2);
20
JNIEXPORT jint JNICALL DW_NATIVE(DWriteCreateFactory)
21
	(JNIEnv *env, jclass that, jint arg0, jbyteArray arg1, jintLongArray arg2)
22
{
23
24
	jbyte *lparg1=NULL;
25
	jintLong *lparg2=NULL;
26
	jint rc = 0;
27
	DW_NATIVE_ENTER(env, that, DWriteCreateFactory_FUNC);
28
	if (arg1) if ((lparg1 = env->GetByteArrayElements(arg1, NULL)) == NULL) goto fail;
29
	if (arg2) if ((lparg2 = env->GetIntLongArrayElements(arg2, NULL)) == NULL) goto fail;
30
31
//	rc = (jint)DWriteCreateFactory((DWRITE_FACTORY_TYPE)arg0, (GUID*)lparg1, (IUnknown**)lparg2);
32
	rc = (jint)DWriteCreateFactory((DWRITE_FACTORY_TYPE)arg0, __uuidof(IDWriteFactory), (IUnknown**)lparg2);
33
/*
34
	{
35
		DWrite_LOAD_FUNCTION(factory, Dwrite, DWriteCreateFactory)
36
		if (factory) {
37
			rc = (jint)((jint (*)(jint, jbyte*, jintLong*))factory)(arg0, lparg1, lparg2);
38
		}
39
	}
40
*/
41
fail:
42
	if (arg2 && lparg2) env->ReleaseIntLongArrayElements(arg2, lparg2, 0);
43
	if (arg1 && lparg1) env->ReleaseByteArrayElements(arg1, lparg1, JNI_ABORT);
44
	DW_NATIVE_EXIT(env, that, DWriteCreateFactory_FUNC);
45
	return rc;
46
}
47
#endif
48
(-)a/bundles/org.eclipse.swt/Eclipse (+13 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 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
12
#define Dwrite_LIB "Dwrite.dll"
13
(-)a/bundles/org.eclipse.swt/Eclipse (+46 lines)
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
12
#include "swt.h"
13
#include "dw_stats.h"
14
15
#ifdef NATIVE_STATS
16
17
int DW_nativeFunctionCount = 4;
18
int DW_nativeFunctionCallCount[4];
19
char * DW_nativeFunctionNames[] = {
20
	"DWriteCreateFactory",
21
	"IDWriteFactory_1CreateTextFormat",
22
	"IDWriteTextFormat_1SetParagraphAlignment",
23
	"IDWriteTextFormat_1SetTextAlignment",
24
};
25
26
#define STATS_NATIVE(func) Java_org_eclipse_swt_tools_internal_NativeStats_##func
27
28
JNIEXPORT jint JNICALL STATS_NATIVE(DW_1GetFunctionCount)
29
	(JNIEnv *env, jclass that)
30
{
31
	return DW_nativeFunctionCount;
32
}
33
34
JNIEXPORT jstring JNICALL STATS_NATIVE(DW_1GetFunctionName)
35
	(JNIEnv *env, jclass that, jint index)
36
{
37
	return env->NewStringUTF(DW_nativeFunctionNames[index]);
38
}
39
40
JNIEXPORT jint JNICALL STATS_NATIVE(DW_1GetFunctionCallCount)
41
	(JNIEnv *env, jclass that, jint index)
42
{
43
	return DW_nativeFunctionCallCount[index];
44
}
45
46
#endif
(-)a/bundles/org.eclipse.swt/Eclipse (+32 lines)
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
12
#ifdef NATIVE_STATS
13
extern int DW_nativeFunctionCount;
14
extern int DW_nativeFunctionCallCount[];
15
extern char* DW_nativeFunctionNames[];
16
#define DW_NATIVE_ENTER(env, that, func) DW_nativeFunctionCallCount[func]++;
17
#define DW_NATIVE_EXIT(env, that, func) 
18
#else
19
#ifndef DW_NATIVE_ENTER
20
#define DW_NATIVE_ENTER(env, that, func) 
21
#endif
22
#ifndef DW_NATIVE_EXIT
23
#define DW_NATIVE_EXIT(env, that, func) 
24
#endif
25
#endif
26
27
typedef enum {
28
	DWriteCreateFactory_FUNC,
29
	IDWriteFactory_1CreateTextFormat_FUNC,
30
	IDWriteTextFormat_1SetParagraphAlignment_FUNC,
31
	IDWriteTextFormat_1SetTextAlignment_FUNC,
32
} DW_FUNCS;
(-)a/bundles/org.eclipse.swt/Eclipse (+13 lines)
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
12
#include "dw.h"
13
(-)a/bundles/org.eclipse.swt/Eclipse (+14 lines)
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
12
maj_ver=4
13
min_ver=233
14
comma_ver=4,2,3,3
(-)a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_win32.mak (+17 lines)
Lines 32-37 GDIP_LIB = $(GDIP_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).dll Link Here
32
GDIP_LIBS    = gdiplus.lib
32
GDIP_LIBS    = gdiplus.lib
33
GDIP_OBJS    = gdip.obj gdip_structs.obj gdip_stats.obj gdip_custom.obj
33
GDIP_OBJS    = gdip.obj gdip_structs.obj gdip_stats.obj gdip_custom.obj
34
34
35
D2D_PREFIX   = swt-d2d
36
D2D_LIB     = $(D2D_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).dll
37
D2D_LIBS    = d2d1.lib Dwrite.lib
38
D2D_OBJS    = d2d.obj d2d_structs.obj d2d_stats.obj d2d_custom.obj dw.obj dw_stats.obj dw_custom.obj
39
35
AWT_PREFIX = swt-awt
40
AWT_PREFIX = swt-awt
36
AWT_LIB    = $(AWT_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).dll
41
AWT_LIB    = $(AWT_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).dll
37
AWT_LIBS   = "$(JAVA_HOME)\jre\bin\jawt.lib"
42
AWT_LIBS   = "$(JAVA_HOME)\jre\bin\jawt.lib"
Lines 125-130 make_swt: $(SWT_OBJS) swt.res Link Here
125
	link @templrf
130
	link @templrf
126
	del templrf
131
	del templrf
127
132
133
make_d2d: $(D2D_OBJS) swt_d2d.res
134
	echo $(ldebug) $(dlllflags) $(guilibsmt) >templrf
135
	echo $(D2D_LIBS) >>templrf
136
	echo $(D2D_OBJS) >>templrf
137
	echo swt_d2d.res >>templrf
138
	echo -out:$(D2D_LIB) >>templrf
139
	link @templrf
140
	del templrf
141
128
make_gdip: $(GDIP_OBJS) swt_gdip.res
142
make_gdip: $(GDIP_OBJS) swt_gdip.res
129
	echo $(ldebug) $(dlllflags) $(guilibsmt) >templrf
143
	echo $(ldebug) $(dlllflags) $(guilibsmt) >templrf
130
	echo $(GDIP_LIBS) >>templrf
144
	echo $(GDIP_LIBS) >>templrf
Lines 173-178 make_xulrunner: $(XULRUNNER_OBJS) swt_xpcom.res Link Here
173
swt.res:
187
swt.res:
174
	rc $(RCFLAGS) -DSWT_ORG_FILENAME=\"$(SWT_LIB)\" -r -fo swt.res swt.rc
188
	rc $(RCFLAGS) -DSWT_ORG_FILENAME=\"$(SWT_LIB)\" -r -fo swt.res swt.rc
175
189
190
swt_d2d.res:
191
	rc $(RCFLAGS) -DSWT_ORG_FILENAME=\"$(D2D_LIB)\" -r -fo swt_d2d.res swt_d2d.rc
192
176
swt_gdip.res:
193
swt_gdip.res:
177
	rc $(RCFLAGS) -DSWT_ORG_FILENAME=\"$(GDIP_LIB)\" -r -fo swt_gdip.res swt_gdip.rc
194
	rc $(RCFLAGS) -DSWT_ORG_FILENAME=\"$(GDIP_LIB)\" -r -fo swt_gdip.res swt_gdip.rc
178
195
(-)a/bundles/org.eclipse.swt/Eclipse (+45 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2011 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
 
12
#include "windows.h"
13
14
VS_VERSION_INFO VERSIONINFO
15
 FILEVERSION SWT_COMMA_VERSION
16
 PRODUCTVERSION 0,0,0,0
17
 FILEFLAGSMASK 0x3fL
18
#ifdef _DEBUG
19
 FILEFLAGS 0x1L
20
#else
21
 FILEFLAGS 0x0L
22
#endif
23
 FILEOS 0x40000L
24
 FILETYPE 0x2L
25
 FILESUBTYPE 0x0L
26
BEGIN
27
    BLOCK "StringFileInfo"
28
    BEGIN
29
        BLOCK "040904b0"
30
        BEGIN
31
            VALUE "CompanyName", "Eclipse Foundation\0"
32
            VALUE "FileDescription", "SWT for Windows native library\0"
33
            VALUE "FileVersion", SWT_FILE_VERSION
34
            VALUE "InternalName", "SWT\0"
35
            VALUE "LegalCopyright", "Copyright (c) 2000, 2011 IBM Corp.  All Rights Reserved.\0"
36
            VALUE "OriginalFilename", SWT_ORG_FILENAME
37
            VALUE "ProductName", "Standard Widget Toolkit\0"
38
            VALUE "ProductVersion", "0,0,0,0\0"
39
        END
40
    END
41
    BLOCK "VarFileInfo"
42
    BEGIN
43
        VALUE "Translation", 0x409, 1200
44
    END
45
END
(-)a/bundles/org.eclipse.swt/Eclipse (+30 lines)
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
/** @jniclass flags=cpp */
14
public class D2D1_BRUSH_PROPERTIES {
15
	/** @field cast=(FLOAT) */
16
	public float opacity;
17
	/** @field accessor=transform._11, cast=(FLOAT) */
18
	public float transform__11;
19
	/** @field accessor=transform._12, cast=(FLOAT) */
20
	public float transform__12;
21
	/** @field accessor=transform._21, cast=(FLOAT) */
22
	public float transform__21;
23
	/** @field accessor=transform._22, cast=(FLOAT) */
24
	public float transform__22;
25
	/** @field accessor=transform._31, cast=(FLOAT) */
26
	public float transform__31;
27
	/** @field accessor=transform._32, cast=(FLOAT) */
28
	public float transform__32;
29
	public static final int sizeof = D2d.D2D1_BRUSH_PROPERTIES_sizeof();
30
}
(-)a/bundles/org.eclipse.swt/Eclipse (+19 lines)
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
public class D2D1_COLOR_F {
14
	public float r;
15
	public float g;
16
	public float b;
17
	public float a;
18
	public static final int sizeof = D2d.D2D1_COLOR_F_sizeof();
19
}
(-)a/bundles/org.eclipse.swt/Eclipse (+87 lines)
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
/** @jniclass flags=cpp */
14
public class D2D1_MATRIX_3X2_F {
15
	public float _11;
16
	public float _12;
17
	public float _21;
18
	public float _22;
19
	public float _31;
20
	public float _32;
21
	public static final int sizeof = D2d.D2D1_MATRIX_3X2_F_sizeof();
22
23
public D2D1_MATRIX_3X2_F translate(D2D1_SIZE_F size) {
24
	return translate(size.width, size.height);	
25
}
26
27
public D2D1_MATRIX_3X2_F translate(float x, float y) {
28
	_11 = 1.0f; _12 = 0.0f;
29
	_21 = 0.0f; _22 = 1.0f;
30
	_31 = x;
31
	_32 = y;
32
	return this;
33
}
34
35
public D2D1_MATRIX_3X2_F scale(float dx, float dy, D2D1_POINT_2F center) {
36
	_11 = dx; _12 = 0.0f;
37
	_21 = 0.0f; _22 = dy;
38
	_31 = center.x - dx * center.x;
39
	_32 = center.y - dy * center.y;
40
	return this;
41
}
42
43
public D2D1_MATRIX_3X2_F compose(D2D1_MATRIX_3X2_F m) {
44
	float r_11, r_12, r_21, r_22, r_31, r_32;
45
    r_11 = _11 * m._11 + _12 * m._21;
46
    r_12 = _11 * m._12 + _12 * m._22;
47
    r_21 = _21 * m._11 + _22 * m._21;
48
    r_22 = _21 * m._12 + _22 * m._22;
49
    r_31 = _31 * m._11 + _32 * m._21 + m._31;
50
    r_32 = _31 * m._12 + _32 * m._22 + m._32;
51
    _11 = r_11;
52
    _12 = r_12;
53
    _21 = r_21;
54
    _22 = r_22;
55
    _31 = r_31;
56
    _32 = r_32;
57
    return this;
58
}
59
60
public D2D1_MATRIX_3X2_F rotate(float r, D2D1_POINT_2F center) {
61
	D2d.D2D1MakeRotateMatrix(r, center, this);
62
	return this;
63
}
64
65
public D2D1_MATRIX_3X2_F skew() {
66
	return this;
67
}
68
69
public D2D1_MATRIX_3X2_F identify() {
70
	_11 = 1.0f; _12 = 0.0f;
71
	_21 = 1.0f; _22 = 0.0f;
72
	_31 = 0.0f;
73
	_32 = 0.0f;
74
	return this;
75
}
76
77
public D2D1_MATRIX_3X2_F setComposed(D2D1_MATRIX_3X2_F a, D2D1_MATRIX_3X2_F b) {
78
    _11 = a._11 * b._11 + a._12 * b._21;
79
    _12 = a._11 * b._12 + a._12 * b._22;
80
    _21 = a._21 * b._11 + a._22 * b._21;
81
    _22 = a._21 * b._12 + a._22 * b._22;
82
    _31 = a._31 * b._11 + a._32 * b._21 + b._31;
83
    _32 = a._31 * b._12 + a._32 * b._22 + b._32;
84
	return this;
85
}
86
87
}
(-)a/bundles/org.eclipse.swt/Eclipse (+20 lines)
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
/** @jniclass flags=cpp */
14
public class D2D1_PIXEL_FORMAT {
15
	/** @field cast=(DXGI_FORMAT) */
16
	public int format;
17
	/** @field cast=(D2D1_ALPHA_MODE) */
18
	public int alphaMode;
19
	public static final int sizeof = D2d.D2D1_PIXEL_FORMAT_sizeof ();
20
}
(-)a/bundles/org.eclipse.swt/Eclipse (+17 lines)
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
public class D2D1_POINT_2F {
14
	public float x;
15
	public float y;
16
	public static final int sizeof = D2d.D2D1_POINT_2F_sizeof();
17
}
(-)a/bundles/org.eclipse.swt/Eclipse (+20 lines)
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
/** @jniclass flags=cpp */
14
public class D2D1_RECT_F {
15
	public float left;
16
	public float top;
17
	public float right;
18
	public float bottom;
19
	public static final int sizeof = D2d.D2D1_RECT_F_sizeof();
20
}
(-)a/bundles/org.eclipse.swt/Eclipse (+28 lines)
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
/** @jniclass flags=cpp */
14
public class D2D1_RENDER_TARGET_PROPERTIES {
15
	/** @field cast=(D2D1_RENDER_TARGET_TYPE) */
16
	public int type;
17
	/** @field accessor=pixelFormat.format, cast=(DXGI_FORMAT) */
18
	public int pixelFormat_format;
19
	/** @field accessor=pixelFormat.alphaMode, cast=(D2D1_ALPHA_MODE) */
20
	public int pixelFormat_alphaMode;
21
	public float dpiX;
22
	public float dpiY;
23
	/** @field cast=(D2D1_RENDER_TARGET_USAGE) */
24
	public int usage;
25
	/** @field cast=(D2D1_FEATURE_LEVEL) */
26
	public int minLevel;
27
	public static final int sizeof = D2d.D2D1_RENDER_TARGET_PROPERTIES_sizeof();
28
}
(-)a/bundles/org.eclipse.swt/Eclipse (+25 lines)
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
public class D2D1_ROUNDED_RECT {
14
	/** @field accessor=rect.left, cast=(FLOAT) */
15
	public float rect_left;
16
	/** @field accessor=rect.top, cast=(FLOAT) */
17
	public float rect_top;
18
	/** @field accessor=rect.right, cast=(FLOAT) */
19
	public float rect_right;
20
	/** @field accessor=rect.bottom, cast=(FLOAT) */
21
	public float rect_bottom;
22
	public float radiusX;
23
	public float radiusY;
24
	public static final int sizeof = D2d.D2D1_ROUNDED_RECT_sizeof();
25
}
(-)a/bundles/org.eclipse.swt/Eclipse (+18 lines)
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
/** @jniclass flags=cpp */
14
public class D2D1_SIZE_F {
15
	public float width;
16
	public float height;
17
	public static final int sizeof = D2d.D2D1_SIZE_F_sizeof();
18
}
(-)a/bundles/org.eclipse.swt/Eclipse (+30 lines)
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
/** @jniclass flags=cpp */
14
public class D2D1_STROKE_STYLE_PROPERTIES {
15
	/** @field cast=(D2D1_CAP_STYLE) */
16
	public int startCap;
17
	/** @field cast=(D2D1_CAP_STYLE) */
18
	public int endCap;
19
	/** @field cast=(D2D1_CAP_STYLE) */
20
	public int dashCap;
21
	/** @field cast=(D2D1_LINE_JOIN) */
22
	public int lineJoin;
23
	/** @field cast=(FLOAT) */
24
	public float miterLimit;
25
	/** @field cast=(D2D1_DASH_STYLE) */
26
	public int dashStyle;
27
	/** @field cast=(FLOAT) */
28
	public float dashOffset;
29
	public static final int sizeof = D2d.D2D1_STROKE_STYLE_PROPERTIES_sizeof();
30
}
(-)a/bundles/org.eclipse.swt/Eclipse (+616 lines)
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
}
(-)a/bundles/org.eclipse.swt/Eclipse (+20 lines)
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
/** jniclass flags=cpp */
14
public class ID2D1Bitmap extends ID2D1Resource {
15
16
public ID2D1Bitmap(long /*int*/ address) {
17
	super(address);
18
}
19
20
}
(-)a/bundles/org.eclipse.swt/Eclipse (+21 lines)
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
/** jniclass flags=cpp */
14
public class ID2D1BitmapBrush extends ID2D1Brush {
15
16
	/** jniclass flags=cpp */
17
public ID2D1BitmapBrush(long /*int*/ address) {
18
	super(address);
19
}
20
21
}
(-)a/bundles/org.eclipse.swt/Eclipse (+30 lines)
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
/** jniclass flags=cpp */
14
public class ID2D1Brush extends ID2D1Resource {
15
16
public ID2D1Brush(long /*int*/ address) {
17
	super(address);
18
}
19
20
public void SetOpacity(float opacity) {
21
	D2d.ID2D1Brush_SetOpacity(address, opacity);
22
}
23
24
public float GetOpacity() {
25
	float[] opacity = new float[1]; 
26
	D2d.ID2D1Brush_GetOpacity(address, opacity);
27
	return opacity[0];
28
}
29
30
}
(-)a/bundles/org.eclipse.swt/Eclipse (+24 lines)
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
/** jniclass flags=cpp */
14
public class ID2D1DCRenderTarget extends ID2D1RenderTarget {
15
16
public ID2D1DCRenderTarget(long /*int*/ address) {
17
	super(address);
18
}
19
20
public final int BindDC(long /*int*/ hDC, RECT pSubRect) {
21
	return D2d.ID2D1DCRenderTarget_BindDC(address, hDC, pSubRect);
22
}
23
24
}
(-)a/bundles/org.eclipse.swt/Eclipse (+35 lines)
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
public class ID2D1Factory extends IUnknown {
14
15
/** jniclass flags=cpp */
16
public ID2D1Factory(long /*int*/ address) {
17
	super(address);
18
}
19
public ID2D1DCRenderTarget CreateDCRenderTarget(D2D1_RENDER_TARGET_PROPERTIES renderTargetProperties) {
20
	long /*int*/ dcRenderTarget[] = new long /*int*/[1];
21
	dcRenderTarget[0] = 0;
22
	int rc = D2d.ID2D1Factory_CreateDCRenderTarget(address, renderTargetProperties, dcRenderTarget);
23
	return rc == 0 ? new ID2D1DCRenderTarget(dcRenderTarget[0]) : null;
24
}
25
26
public ID2D1StrokeStyle CreateStrokeStyle(D2D1_STROKE_STYLE_PROPERTIES strokeStyleProperties, float dashes, int dashesCount) {
27
	long /*int*/ strokeStyle[] = new long /*int*/[1];
28
	strokeStyle[0] = 0;
29
	float ddashes[] = new float[1];
30
	ddashes[0] = dashes;
31
	int rc = D2d.ID2D1Factory_CreateStrokeStyle(address, strokeStyleProperties, ddashes, dashesCount, strokeStyle);
32
	return rc == 0 ? new ID2D1StrokeStyle(strokeStyle[0]) : null;
33
}
34
35
}
(-)a/bundles/org.eclipse.swt/Eclipse (+29 lines)
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
public class ID2D1GdiInteropRenderTarget extends IUnknown {
14
15
public ID2D1GdiInteropRenderTarget(long /*int*/ address) {
16
	super(address);
17
}
18
19
public long /*int*/ GetDC(int mode) {
20
	long /*int*/ hdc[] = new long /*int*/ [1];
21
	int rc = D2d.ID2D1GdiInteropRenderTarget_GetDC(address, mode, hdc);
22
	return rc == 0 ? hdc[0] : 0;
23
}
24
25
public int ReleaseDC() {
26
	return D2d.ID2D1GdiInteropRenderTarget_ReleaseDC(address, null);
27
}
28
29
}
(-)a/bundles/org.eclipse.swt/Eclipse (+24 lines)
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
public class ID2D1HwndRenderTarget extends ID2D1RenderTarget {
14
15
/** jniclass flags=cpp */
16
public ID2D1HwndRenderTarget(int address) {
17
	super(address);
18
}
19
20
public long /*int*/ GetHwndD() {
21
	return D2d.ID2D1HwndRenderTarget_GetHwnd(address);
22
}
23
24
}
(-)a/bundles/org.eclipse.swt/Eclipse (+20 lines)
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
/** jniclass flags=cpp */
14
public class ID2D1Layer extends ID2D1Resource {
15
16
public ID2D1Layer(long /*int*/ address) {
17
	super(address);
18
}
19
20
}
(-)a/bundles/org.eclipse.swt/Eclipse (+138 lines)
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.dw.DW;
14
import org.eclipse.swt.internal.dw.IDWriteTextFormat;
15
16
/** @jniclass flags=cpp */
17
public class ID2D1RenderTarget extends ID2D1Resource {
18
19
public ID2D1RenderTarget(long /*int*/ address) {
20
	super(address);
21
}
22
23
public final void BeginDraw() {
24
	D2d.ID2D1RenderTarget_BeginDraw(address);
25
}
26
27
public final void Clear(D2D1_COLOR_F color) {
28
	D2d.ID2D1RenderTarget_Clear(address, color);
29
}
30
31
public final void EndDraw() {
32
	D2d.ID2D1RenderTarget_EndDraw(address);
33
}
34
35
public final void SetAntialiasMode(int mode) {
36
	D2d.ID2D1RenderTarget_SetAntialiasMode(address, mode);
37
}
38
39
public final void SetTextAntialiasMode(int mode) {
40
	D2d.ID2D1RenderTarget_SetTextAntialiasMode(address, mode);
41
}
42
43
public final D2D1_SIZE_F GetSize() {
44
	D2D1_SIZE_F size = new D2D1_SIZE_F();
45
	ID2D1RenderTarget_GetSize(address, size);
46
	return size;
47
}
48
49
public final ID2D1SolidColorBrush CreateSolidColorBrush(D2D1_COLOR_F color, D2D1_BRUSH_PROPERTIES brushProperties) {
50
	long /*int*/ solidColorBrush[] = new long /*int*/[1];
51
	solidColorBrush[0] = 0;
52
	int rc = D2d.ID2D1RenderTarget_CreateSolidColorBrush(address, color, brushProperties, solidColorBrush);
53
	return rc == 0 ? new ID2D1SolidColorBrush(solidColorBrush[0]) : null;
54
}
55
56
public final void SetTransform(D2D1_MATRIX_3X2_F transform) {
57
	D2d.ID2D1RenderTarget_SetTransform(address, transform);
58
}
59
60
public final void DrawLine(D2D1_POINT_2F point0, D2D1_POINT_2F point1, ID2D1Brush brush, float lineWidth) {
61
	D2d.ID2D1RenderTarget_DrawLine(address, point0, point1, brush.address, 1, 0);
62
}
63
64
public final void DrawLine(D2D1_POINT_2F point0, D2D1_POINT_2F point1, ID2D1Brush brush, float lineWidth, float strokeWidth, ID2D1StrokeStyle strokeStyle) {
65
	D2d.ID2D1RenderTarget_DrawLine(address, point0, point1, brush.address, strokeWidth, strokeStyle.address);
66
}
67
68
public final void DrawRectangle(D2D1_RECT_F rect, ID2D1Brush brush, float lineWidth) {
69
	D2d.ID2D1RenderTarget_DrawRectangle(address, rect, brush.address, 1, 0);
70
}
71
72
public final void DrawRectangle(D2D1_RECT_F rect, ID2D1Brush brush, float lineWidth, float strokeWidth, ID2D1StrokeStyle strokeStyle) {
73
	D2d.ID2D1RenderTarget_DrawRectangle(address, rect, brush.address, strokeWidth, strokeStyle.address);
74
}
75
76
public final void FillRectangle(D2D1_RECT_F rect, ID2D1Brush brush) {
77
	D2d.ID2D1RenderTarget_FillRectangle(address, rect, brush.address);
78
}
79
80
public final void DrawRoundedRectangle(D2D1_ROUNDED_RECT roundedRect, ID2D1Brush brush) {
81
	D2d.ID2D1RenderTarget_DrawRoundedRectangle(address, roundedRect, brush.address, 1, 0);
82
}
83
84
public final void DrawRoundedRectangle(D2D1_ROUNDED_RECT roundedRect, ID2D1Brush brush, float strokeWidth, ID2D1StrokeStyle strokeStyle) {
85
	D2d.ID2D1RenderTarget_DrawRoundedRectangle(address, roundedRect,  brush.address, strokeWidth, strokeStyle.address);
86
}
87
88
//    STDMETHOD_(void, DrawRoundedRectangle)(
89
//        __in CONST D2D1_ROUNDED_RECT *roundedRect,
90
//        __in ID2D1Brush *brush,
91
//        FLOAT strokeWidth = 1.0f,
92
//        __in_opt ID2D1StrokeStyle *strokeStyle = NULL 
93
//        ) PURE;
94
//    
95
//    STDMETHOD_(void, FillRoundedRectangle)(
96
//        __in CONST D2D1_ROUNDED_RECT *roundedRect,
97
//        __in ID2D1Brush *brush 
98
//        ) PURE;
99
//    
100
//    STDMETHOD_(void, DrawEllipse)(
101
//        __in CONST D2D1_ELLIPSE *ellipse,
102
//        __in ID2D1Brush *brush,
103
//        FLOAT strokeWidth = 1.0f,
104
//        __in_opt ID2D1StrokeStyle *strokeStyle = NULL 
105
//        ) PURE;
106
//    
107
//    STDMETHOD_(void, FillEllipse)(
108
//        __in CONST D2D1_ELLIPSE *ellipse,
109
//        __in ID2D1Brush *brush 
110
//        ) PURE;
111
//    
112
//    STDMETHOD_(void, DrawGeometry)(
113
//        __in ID2D1Geometry *geometry,
114
//        __in ID2D1Brush *brush,
115
//        FLOAT strokeWidth = 1.0f,
116
//        __in_opt ID2D1StrokeStyle *strokeStyle = NULL 
117
//        ) PURE;
118
//    
119
//    STDMETHOD_(void, FillGeometry)(
120
//        __in ID2D1Geometry *geometry,
121
//        __in ID2D1Brush *brush,
122
123
public final void DrawText(char[] string, int  stringLength, IDWriteTextFormat textFormat, D2D1_RECT_F layoutRect, ID2D1Brush defaultForegroundBrush) {
124
	D2d.ID2D1RenderTarget_DrawText(address, string, stringLength, textFormat.getAddress(), layoutRect, defaultForegroundBrush.getAddress(), D2d.D2D1_DRAW_TEXT_OPTIONS_NONE, DW.DWRITE_MEASURING_MODE_NATURAL);
125
}
126
127
public final void DrawText(char[] string, int  stringLength, IDWriteTextFormat textFormat, D2D1_RECT_F layoutRect, ID2D1Brush defaultForegroundBrush, int options, int measuringMode) {
128
	D2d.ID2D1RenderTarget_DrawText(address, string, stringLength, textFormat.getAddress(), layoutRect, defaultForegroundBrush.getAddress(), options, measuringMode);
129
}
130
131
132
/**
133
 * @method flags=cpp no_gen
134
 * @param This cast=(ID2D1RenderTarget *)
135
 */
136
public static final native void ID2D1RenderTarget_GetSize(long /*int*/ This, D2D1_SIZE_F size);
137
138
}
(-)a/bundles/org.eclipse.swt/Eclipse (+28 lines)
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.ole.win32.COM;
14
15
/** jniclass flags=cpp */
16
public class ID2D1Resource extends IUnknown {
17
18
public ID2D1Resource(long /*int*/ address) {
19
	super(address);
20
}
21
22
public ID2D1Factory GetFactory() {
23
	long /*int*/ factory[] = new long /*int*/[1];
24
	long /*int*/ rc = COM.VtblCall(3, address, factory);
25
	return rc != 0 ? new ID2D1Factory(factory[0]) : null; 
26
}
27
28
}
(-)a/bundles/org.eclipse.swt/Eclipse (+30 lines)
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
/** jniclass flags=cpp */
14
public class ID2D1SolidColorBrush extends ID2D1Brush {
15
16
public ID2D1SolidColorBrush(long /*int*/ address) {
17
	super(address);
18
}
19
20
public void SetColor(D2D1_COLOR_F color) {
21
	D2d.ID2D1SolidColorBrush_SetColor(address, color);
22
}
23
24
public D2D1_COLOR_F GetColor() {
25
	D2D1_COLOR_F color = new D2D1_COLOR_F();
26
	D2d.ID2D1SolidColorBrush_GetColor(address, color);
27
	return color;
28
}
29
30
}
(-)a/bundles/org.eclipse.swt/Eclipse (+52 lines)
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
public class ID2D1StrokeStyle extends ID2D1Resource {
14
15
public ID2D1StrokeStyle(long /*int*/ address) {
16
	super(address);
17
}
18
19
//STDMETHOD_(D2D1_CAP_STYLE, GetStartCap)(
20
//    ) CONST PURE;
21
//
22
//STDMETHOD_(D2D1_CAP_STYLE, GetEndCap)(
23
//    ) CONST PURE;
24
//
25
//STDMETHOD_(D2D1_CAP_STYLE, GetDashCap)(
26
//    ) CONST PURE;
27
//
28
//STDMETHOD_(FLOAT, GetMiterLimit)(
29
//    ) CONST PURE;
30
//
31
//STDMETHOD_(D2D1_LINE_JOIN, GetLineJoin)(
32
//    ) CONST PURE;
33
//
34
//STDMETHOD_(FLOAT, GetDashOffset)(
35
//    ) CONST PURE;
36
//
37
//STDMETHOD_(D2D1_DASH_STYLE, GetDashStyle)(
38
//    ) CONST PURE;
39
//
40
//STDMETHOD_(UINT32, GetDashesCount)(
41
//    ) CONST PURE;
42
//
43
//
44
////
45
//// Returns the dashes from the object into a user allocated array. The user must
46
//// call GetDashesCount to retrieve the required size.
47
////
48
//STDMETHOD_(void, GetDashes)(
49
//    __out_ecount(dashesCount) FLOAT *dashes,
50
//    UINT dashesCount 
51
//    ) CONST PURE;
52
}
(-)a/bundles/org.eclipse.swt/Eclipse (+40 lines)
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.ole.win32.*;
14
15
public class IUnknown
16
{
17
long /*int*/ address;
18
public IUnknown(long /*int*/ address) {
19
	this.address = address;
20
}
21
public int AddRef() {
22
	return COM.VtblCall(1, address);
23
}
24
public long /*int*/ getAddress() {
25
	return address;
26
}
27
public int QueryInterface(GUID riid, long /*int*/[] ppvObject) {
28
	return COM.VtblCall(0, address, riid, ppvObject);
29
}
30
public int Release() {
31
	return COM.VtblCall(2, address);
32
}
33
34
public String toString() {
35
	StringBuffer sb = new StringBuffer();
36
	sb.append("[").append(address).append("]");
37
	return sb.toString();
38
}
39
40
}
(-)a/bundles/org.eclipse.swt/Eclipse (+19 lines)
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
public class RECT {
14
	public int left;
15
	public int top;
16
	public int right;
17
	public int bottom;
18
//	public static final int sizeof = D2d.RECT_sizeof ();
19
}
(-)a/bundles/org.eclipse.swt/Eclipse (+160 lines)
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.dw;
12
13
import org.eclipse.swt.internal.*;
14
import org.eclipse.swt.internal.d2d.*;
15
import org.eclipse.swt.internal.ole.win32.*;
16
import org.eclipse.swt.internal.ole.win32.IUnknown;
17
import org.eclipse.swt.internal.win32.OS;
18
19
/** @jniclass flags=cpp */
20
public class DW extends C {
21
		
22
	static {
23
		Library.loadLibrary ("swt-d2d"); //$NON-NLS-1$
24
	}
25
26
public static final IDWriteFactory DWriteCreateFactory() {
27
	GUID iid = DW.IDWriteFactory;
28
	long /*int*/ factory[] = new long /*int*/[1];
29
	factory[0] = 0;
30
	byte[] refiid = new byte[GUID.sizeof];
31
	OS.IIDFromString ((iid.toString () + '\0').toCharArray (), refiid);
32
	long /*int*/ rc = DW.DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, refiid, factory);
33
	return rc == 0 ? new IDWriteFactory(factory[0]) : null; 
34
}
35
36
//--------------------------------------------------------------------------------------
37
38
public static final GUID IDWriteTextFormat = IIDFromString("{9c906818-31d7-4fd3-a151-7c5e225db55a}"); //$NON-NLS-1$
39
public static final GUID IDWriteTypography = IIDFromString("{55f1112b-1dc2-4b3c-9541-f46894ed85b6}"); //$NON-NLS-1$
40
public static final GUID IDWriteNumberSubstitution = IIDFromString("{14885CC9-BAB0-4f90-B6ED-5C366A2CD03D}"); //$NON-NLS-1$
41
public static final GUID IDWriteTextAnalysisSource = IIDFromString("{688e1a58-5094-47c8-adc8-fbcea60ae92b}"); //$NON-NLS-1$
42
public static final GUID IDWriteTextAnalysisSink = IIDFromString("{5810cd44-0ca0-4701-b3fa-bec5182ae4f6}"); //$NON-NLS-1$
43
public static final GUID IDWriteTextAnalyzer = IIDFromString("{b7e6163e-7f46-43b4-84b3-e4e6249c365d}"); //$NON-NLS-1$
44
public static final GUID IDWriteInlineObject = IIDFromString("{8339FDE3-106F-47ab-8373-1C6295EB10B3}"); //$NON-NLS-1$
45
public static final GUID IDWritePixelSnapping = IIDFromString("{eaf3a2da-ecf4-4d24-b644-b34f6842024b]"); //$NON-NLS-1$
46
public static final GUID IDWriteTextRenderer = IIDFromString("{ef8a8135-5cc6-45fe-8825-c5a0724eb819}"); //$NON-NLS-1$
47
public static final GUID IDWriteTextLayout = IIDFromString("{53737037-6d14-410b-9bfe-0b182bb70961}"); //$NON-NLS-1$
48
public static final GUID IDWriteBitmapRenderTarget = IIDFromString("{5e5a32a3-8dff-4773-9ff6-0696eab77267}"); //$NON-NLS-1$
49
public static final GUID IDWriteGdiInterop = IIDFromString("{1edd9491-9853-4299-898f-6432983b6f3a}"); //$NON-NLS-1$
50
public static final GUID IDWriteGlyphRunAnalysis = IIDFromString("{7d97dbf7-e085-42d4-81e3-6a883bded118}"); //$NON-NLS-1$
51
public static final GUID IDWriteFactory = IIDFromString("{b859ee5a-d838-4b5b-a2e8-1adc7d93db48}"); //$NON-NLS-1$
52
53
private static GUID IIDFromString(String lpsz) {
54
	int length = lpsz.length();
55
	char[] buffer = new char[length + 1];
56
	lpsz.getChars(0, length, buffer, 0);
57
	GUID lpiid = new GUID();
58
	if (COM.IIDFromString(buffer, lpiid) == COM.S_OK) return lpiid;
59
	return null;
60
}
61
62
//--------------------------------------------------------------------------------------
63
64
// DWRITE_FACTORY_TYPE 
65
public static final int DWRITE_FACTORY_TYPE_SHARED = 0;
66
public static final int DWRITE_FACTORY_TYPE_ISOLATED = 1; 
67
68
// DWRITE_FONT_WEIGHT
69
public static final int 	  DWRITE_FONT_WEIGHT_THIN          = 100;
70
public static final int 	  DWRITE_FONT_WEIGHT_EXTRA_LIGHT   = 200;
71
public static final int 	  DWRITE_FONT_WEIGHT_ULTRA_LIGHT   = 200;
72
public static final int 	  DWRITE_FONT_WEIGHT_LIGHT         = 300;
73
public static final int 	  DWRITE_FONT_WEIGHT_SEMILIGHT     = 350;
74
public static final int 	  DWRITE_FONT_WEIGHT_NORMAL        = 400;
75
public static final int 	  DWRITE_FONT_WEIGHT_REGULAR       = 400;
76
public static final int 	  DWRITE_FONT_WEIGHT_MEDIUM        = 500;
77
public static final int 	  DWRITE_FONT_WEIGHT_DEMI_BOLD     = 600;
78
public static final int 	  DWRITE_FONT_WEIGHT_SEMI_BOLD     = 600;
79
public static final int 	  DWRITE_FONT_WEIGHT_BOLD          = 700;
80
public static final int 	  DWRITE_FONT_WEIGHT_EXTRA_BOLD    = 800;
81
public static final int 	  DWRITE_FONT_WEIGHT_ULTRA_BOLD    = 800;
82
public static final int 	  DWRITE_FONT_WEIGHT_BLACK         = 900;
83
public static final int 	  DWRITE_FONT_WEIGHT_HEAVY         = 900;
84
public static final int 	  DWRITE_FONT_WEIGHT_EXTRA_BLACK   = 950;
85
public static final int 	  DWRITE_FONT_WEIGHT_ULTRA_BLACK   = 950;
86
87
// DWRITE_FONT_STYLE 
88
public static final int 	  DWRITE_FONT_STYLE_NORMAL = 0;
89
public static final int 	  DWRITE_FONT_STYLE_OBLIQUE = 1;
90
public static final int 	  DWRITE_FONT_STYLE_ITALIC = 2;
91
92
// DWRITE_FONT_STRETCH 
93
public static final int	  DWRITE_FONT_STRETCH_UNDEFINED         = 0;
94
public static final int	  DWRITE_FONT_STRETCH_ULTRA_CONDENSED   = 1;
95
public static final int	  DWRITE_FONT_STRETCH_EXTRA_CONDENSED   = 2;
96
public static final int	  DWRITE_FONT_STRETCH_CONDENSED         = 3;
97
public static final int	  DWRITE_FONT_STRETCH_SEMI_CONDENSED    = 4;
98
public static final int	  DWRITE_FONT_STRETCH_NORMAL            = 5;
99
public static final int	  DWRITE_FONT_STRETCH_MEDIUM            = 5;
100
public static final int	  DWRITE_FONT_STRETCH_SEMI_EXPANDED     = 6;
101
public static final int	  DWRITE_FONT_STRETCH_EXPANDED          = 7;
102
public static final int	  DWRITE_FONT_STRETCH_EXTRA_EXPANDED    = 8;
103
public static final int	  DWRITE_FONT_STRETCH_ULTRA_EXPANDED    = 9;
104
	  
105
// DWRITE_TEXT_ALIGNMENT
106
public static final int	  DWRITE_TEXT_ALIGNMENT_LEADING = 0;
107
public static final int	  DWRITE_TEXT_ALIGNMENT_TRAILING = 1;
108
public static final int	  DWRITE_TEXT_ALIGNMENT_CENTER = 2;
109
public static final int	  DWRITE_TEXT_ALIGNMENT_JUSTIFIED = 3;
110
111
// DWRITE_PARAGRAPH_ALIGNMENT
112
public static final int	  DWRITE_PARAGRAPH_ALIGNMENT_NEAR = 0;
113
public static final int	  DWRITE_PARAGRAPH_ALIGNMENT_FAR = 1;
114
public static final int	  DWRITE_PARAGRAPH_ALIGNMENT_CENTER = 2;
115
116
// DWRITE_MEASURING_MODE
117
public static final int	  DWRITE_MEASURING_MODE_NATURAL = 0;
118
public static final int	  DWRITE_MEASURING_MODE_GDI_CLASSIC = 1;
119
public static final int	  DWRITE_MEASURING_MODE_GDI_NATURAL = 2;
120
121
//--------------------------------------------------------------------------------------
122
123
/**
124
 * @method flags=no_gen
125
 * @param factoryType cast=(DWRITE_FACTORY_TYPE)
126
 * @param iid cast=(GUID*), flags=no_out
127
 * @param factory cast=(IUnknown**)
128
 */
129
public static final native int DWriteCreateFactory(int factoryType, byte[] iid, long /*int*/ [] factory); 
130
131
132
/**
133
 * @method flags=cpp
134
 * @param This cast=(IDWriteFactory*)
135
 * @param fontFamilyName cast=(const WCHAR *)
136
 * @param fontCollection cast=(IDWriteFontCollection*)
137
 * @param fontWeight cast=(DWRITE_FONT_WEIGHT)
138
 * @param fontStyle cast=(DWRITE_FONT_STYLE)
139
 * @param fontStretch cast=(DWRITE_FONT_STRETCH)
140
 * @param localeName cast=(const WCHAR *)
141
 * @param textFormat cast=(IDWriteTextFormat**), flags=no_in
142
 */
143
public static final native int IDWriteFactory_CreateTextFormat(long /*int*/ This, char[] fontFamilyName, long /*int*/ fontCollection, int fontWeight, int fontStyle, int fontStretch, float fontSize, char[] localeName, long /*int*/[] textFormat);
144
145
146
/**
147
 * @method flags=cpp
148
 * @param This cast=(IDWriteTextFormat*)
149
 * @param textAlignment cast=(DWRITE_TEXT_ALIGNMENT)
150
 */
151
public static final native int IDWriteTextFormat_SetTextAlignment(long /*int*/ This, int textAlignment);
152
/**
153
 * @method flags=cpp
154
 * @param This cast=(IDWriteTextFormat*)
155
 * @param paragraphAlignment cast=(DWRITE_PARAGRAPH_ALIGNMENT)
156
 */
157
public static final native int IDWriteTextFormat_SetParagraphAlignment(long /*int*/ This, int paragraphAlignment);
158
	
159
160
}
(-)a/bundles/org.eclipse.swt/Eclipse (+8 lines)
Added Link Here
1
/**
2
 * 
3
 */
4
package org.eclipse.swt.internal.dw;
5
6
public class DWRITE_TEXT_RANGE {
7
8
}
(-)a/bundles/org.eclipse.swt/Eclipse (+38 lines)
Added Link Here
1
/**
2
 * 
3
 */
4
package org.eclipse.swt.internal.dw;
5
6
import org.eclipse.swt.internal.ole.win32.IUnknown;
7
8
public class IDWriteFactory extends IUnknown {
9
10
public IDWriteFactory(long /*int*/ address) {
11
	super(address);
12
}
13
14
public IDWriteTextFormat CreateTextFormat(String fontFamilyName, IDWriteFontCollection fontCollection, int fontWeight, int fontStyle,int fontStretch, float fontSize, String localeName) {
15
	char[]buffer1 = null; 
16
	if (fontFamilyName != null) {
17
		int length = fontFamilyName.length();
18
		buffer1 = new char [length];
19
		fontFamilyName.getChars(0, length, buffer1, 0);
20
	}
21
22
	char[]buffer2 = null;
23
	if (localeName != null) {
24
		int length = localeName.length();
25
		buffer2 = new char [length];
26
		localeName.getChars(0, length, buffer2, 0);
27
	}
28
	return CreateTextFormat(buffer1, fontCollection, fontWeight, fontStyle, fontStretch, fontSize, buffer2);
29
}
30
31
public IDWriteTextFormat CreateTextFormat(char[] fontFamilyName, IDWriteFontCollection fontCollection, int fontWeight, int fontStyle,int fontStretch, float fontSize, char[]localeName) {
32
	long /*int*/[] textFormat = new long /*int*/[1];
33
	textFormat[0] = 0;
34
	int rc = DW.IDWriteFactory_CreateTextFormat(getAddress(), fontFamilyName, fontCollection != null ? fontCollection.getAddress() : 0, fontWeight, fontStyle, fontStretch, fontSize, localeName, textFormat);
35
	return rc == 0 ? new IDWriteTextFormat(textFormat[0]) : null;
36
}
37
38
}
(-)a/bundles/org.eclipse.swt/Eclipse (+14 lines)
Added Link Here
1
/**
2
 * 
3
 */
4
package org.eclipse.swt.internal.dw;
5
6
import org.eclipse.swt.internal.ole.win32.IUnknown;
7
8
public class IDWriteFontCollection extends IUnknown {
9
10
public IDWriteFontCollection(long /*int*/ address) {
11
	super(address);
12
}
13
14
}
(-)a/bundles/org.eclipse.swt/Eclipse (+22 lines)
Added Link Here
1
/**
2
 * 
3
 */
4
package org.eclipse.swt.internal.dw;
5
6
import org.eclipse.swt.internal.ole.win32.IUnknown;
7
8
public class IDWriteTextFormat extends IUnknown {
9
10
public IDWriteTextFormat(long /*int*/ address) {
11
	super(address);
12
}
13
14
public int SetTextAlignment(int dwriteTextAlignmentCenter) {
15
	return DW.IDWriteTextFormat_SetTextAlignment(getAddress(), dwriteTextAlignmentCenter);
16
}
17
18
public int SetParagraphAlignment(int dwriteParagraphAlignmentCenter) {
19
	return DW.IDWriteTextFormat_SetParagraphAlignment(getAddress(), dwriteParagraphAlignmentCenter);
20
}
21
22
}
(-)a/bundles/org.eclipse.swt/Eclipse (-1 / +14 lines)
Added Link Here
0
- 
1
/**
2
 * 
3
 */
4
package org.eclipse.swt.internal.dw;
5
6
import org.eclipse.swt.internal.ole.win32.IUnknown;
7
8
public class IDWriteTextLayout extends IUnknown {
9
10
public IDWriteTextLayout(long /*int*/ address) {
11
	super(address);
12
}
13
14
}

Return to bug 300403