1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
|
/*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
#include "swt.h"
#include "os_structs.h"
#include "os_stats.h"
#define OS_NATIVE(func) Java_org_eclipse_swt_internal_carbon_OS_##func
#ifndef NO_NewGlobalRef
JNIEXPORT jint JNICALL OS_NATIVE(NewGlobalRef)
(JNIEnv *env, jclass that, jobject arg0)
{
jint rc = 0;
OS_NATIVE_ENTER(env, that, NewGlobalRef_FUNC);
rc = (jint)(*env)->NewGlobalRef(env, arg0);
OS_NATIVE_EXIT(env, that, NewGlobalRef_FUNC);
return rc;
}
#endif
#ifndef NO_DeleteGlobalRef
JNIEXPORT void JNICALL OS_NATIVE(DeleteGlobalRef)
(JNIEnv *env, jclass that, jint arg0)
{
OS_NATIVE_ENTER(env, that, DeleteGlobalRef_FUNC);
(*env)->DeleteGlobalRef(env, (jobject)arg0);
OS_NATIVE_EXIT(env, that, DeleteGlobalRef_FUNC);
}
#endif
#ifndef NO_JNIGetObject
JNIEXPORT jobject JNICALL OS_NATIVE(JNIGetObject)
(JNIEnv *env, jclass that, jint arg0)
{
jobject rc = 0;
OS_NATIVE_ENTER(env, that, JNIGetObject_FUNC);
rc = (jobject)arg0;
OS_NATIVE_EXIT(env, that, JNIGetObject_FUNC);
return rc;
}
#endif
#ifndef NO_CGAffineTransformConcat
JNIEXPORT void JNICALL OS_NATIVE(CGAffineTransformConcat)
(JNIEnv *env, jclass that, jfloatArray arg0, jfloatArray arg1, jfloatArray arg2)
{
jfloat *lparg0=NULL;
jfloat *lparg1=NULL;
jfloat *lparg2=NULL;
OS_NATIVE_ENTER(env, that, CGAffineTransformConcat_FUNC);
if (arg0) if ((lparg0 = (*env)->GetFloatArrayElements(env, arg0, NULL)) == NULL) goto fail;
if (arg1) if ((lparg1 = (*env)->GetFloatArrayElements(env, arg1, NULL)) == NULL) goto fail;
if (arg2) if ((lparg2 = (*env)->GetFloatArrayElements(env, arg2, NULL)) == NULL) goto fail;
*(CGAffineTransform *)lparg2 = CGAffineTransformConcat(*(CGAffineTransform *)lparg0, *(CGAffineTransform *)lparg1);
fail:
if (arg2 && lparg2) (*env)->ReleaseFloatArrayElements(env, arg2, lparg2, 0);
if (arg1 && lparg1) (*env)->ReleaseFloatArrayElements(env, arg1, lparg1, JNI_ABORT);
if (arg0 && lparg0) (*env)->ReleaseFloatArrayElements(env, arg0, lparg0, JNI_ABORT);
OS_NATIVE_EXIT(env, that, CGAffineTransformConcat_FUNC);
}
#endif
#ifndef NO_CGAffineTransformInvert
JNIEXPORT void JNICALL OS_NATIVE(CGAffineTransformInvert)
(JNIEnv *env, jclass that, jfloatArray arg0, jfloatArray arg1)
{
jfloat *lparg0=NULL;
jfloat *lparg1=NULL;
OS_NATIVE_ENTER(env, that, CGAffineTransformInvert_FUNC);
if (arg0) if ((lparg0 = (*env)->GetFloatArrayElements(env, arg0, NULL)) == NULL) goto fail;
if (arg1) if ((lparg1 = (*env)->GetFloatArrayElements(env, arg1, NULL)) == NULL) goto fail;
*(CGAffineTransform *)lparg1 = CGAffineTransformInvert(*(CGAffineTransform *)lparg0);
fail:
if (arg1 && lparg1) (*env)->ReleaseFloatArrayElements(env, arg1, lparg1, 0);
if (arg0 && lparg0) (*env)->ReleaseFloatArrayElements(env, arg0, lparg0, JNI_ABORT);
OS_NATIVE_EXIT(env, that, CGAffineTransformInvert_FUNC);
}
#endif
#ifndef NO_CGAffineTransformMake
JNIEXPORT void JNICALL OS_NATIVE(CGAffineTransformMake)
(JNIEnv *env, jclass that, jfloat arg0, jfloat arg1, jfloat arg2, jfloat arg3, jfloat arg4, jfloat arg5, jfloatArray arg6)
{
jfloat *lparg6=NULL;
OS_NATIVE_ENTER(env, that, CGAffineTransformMake_FUNC);
if (arg6) if ((lparg6 = (*env)->GetFloatArrayElements(env, arg6, NULL)) == NULL) goto fail;
*(CGAffineTransform *)lparg6 = CGAffineTransformMake(arg0, arg1, arg2, arg3, arg4, arg5);
fail:
if (arg6 && lparg6) (*env)->ReleaseFloatArrayElements(env, arg6, lparg6, 0);
OS_NATIVE_EXIT(env, that, CGAffineTransformMake_FUNC);
}
#endif
#ifndef NO_CGAffineTransformRotate
JNIEXPORT void JNICALL OS_NATIVE(CGAffineTransformRotate)
(JNIEnv *env, jclass that, jfloatArray arg0, jfloat arg1, jfloatArray arg2)
{
jfloat *lparg0=NULL;
jfloat *lparg2=NULL;
OS_NATIVE_ENTER(env, that, CGAffineTransformRotate_FUNC);
if (arg0) if ((lparg0 = (*env)->GetFloatArrayElements(env, arg0, NULL)) == NULL) goto fail;
if (arg2) if ((lparg2 = (*env)->GetFloatArrayElements(env, arg2, NULL)) == NULL) goto fail;
*(CGAffineTransform *)lparg2 = CGAffineTransformRotate(*(CGAffineTransform *)lparg0, arg1);
fail:
if (arg2 && lparg2) (*env)->ReleaseFloatArrayElements(env, arg2, lparg2, 0);
if (arg0 && lparg0) (*env)->ReleaseFloatArrayElements(env, arg0, lparg0, JNI_ABORT);
OS_NATIVE_EXIT(env, that, CGAffineTransformRotate_FUNC);
}
#endif
#ifndef NO_CGAffineTransformScale
JNIEXPORT void JNICALL OS_NATIVE(CGAffineTransformScale)
(JNIEnv *env, jclass that, jfloatArray arg0, jfloat arg1, jfloat arg2, jfloatArray arg3)
{
jfloat *lparg0=NULL;
jfloat *lparg3=NULL;
OS_NATIVE_ENTER(env, that, CGAffineTransformScale_FUNC);
if (arg0) if ((lparg0 = (*env)->GetFloatArrayElements(env, arg0, NULL)) == NULL) goto fail;
if (arg3) if ((lparg3 = (*env)->GetFloatArrayElements(env, arg3, NULL)) == NULL) goto fail;
*(CGAffineTransform *)lparg3 = CGAffineTransformScale(*(CGAffineTransform *)lparg0, arg1, arg2);
fail:
if (arg3 && lparg3) (*env)->ReleaseFloatArrayElements(env, arg3, lparg3, 0);
if (arg0 && lparg0) (*env)->ReleaseFloatArrayElements(env, arg0, lparg0, JNI_ABORT);
OS_NATIVE_EXIT(env, that, CGAffineTransformScale_FUNC);
}
#endif
#ifndef NO_CGAffineTransformTranslate
JNIEXPORT void JNICALL OS_NATIVE(CGAffineTransformTranslate)
(JNIEnv *env, jclass that, jfloatArray arg0, jfloat arg1, jfloat arg2, jfloatArray arg3)
{
jfloat *lparg0=NULL;
jfloat *lparg3=NULL;
OS_NATIVE_ENTER(env, that, CGAffineTransformTranslate_FUNC);
if (arg0) if ((lparg0 = (*env)->GetFloatArrayElements(env, arg0, NULL)) == NULL) goto fail;
if (arg3) if ((lparg3 = (*env)->GetFloatArrayElements(env, arg3, NULL)) == NULL) goto fail;
*(CGAffineTransform *)lparg3 = CGAffineTransformTranslate(*(CGAffineTransform *)lparg0, arg1, arg2);
fail:
if (arg3 && lparg3) (*env)->ReleaseFloatArrayElements(env, arg3, lparg3, 0);
if (arg0 && lparg0) (*env)->ReleaseFloatArrayElements(env, arg0, lparg0, JNI_ABORT);
OS_NATIVE_EXIT(env, that, CGAffineTransformTranslate_FUNC);
}
#endif
#ifndef NO_CGContextGetCTM
JNIEXPORT void JNICALL OS_NATIVE(CGContextGetCTM)
(JNIEnv *env, jclass that, jint arg0, jfloatArray arg1)
{
jfloat *lparg1=NULL;
OS_NATIVE_ENTER(env, that, CGContextGetCTM_FUNC);
if (arg1) if ((lparg1 = (*env)->GetFloatArrayElements(env, arg1, NULL)) == NULL) goto fail;
*(CGAffineTransform *)lparg1 = CGContextGetCTM((CGContextRef)arg0);
fail:
if (arg1 && lparg1) (*env)->ReleaseFloatArrayElements(env, arg1, lparg1, 0);
OS_NATIVE_EXIT(env, that, CGContextGetCTM_FUNC);
}
#endif
#ifndef NO_CGContextGetPathBoundingBox
JNIEXPORT void JNICALL OS_NATIVE(CGContextGetPathBoundingBox)
(JNIEnv *env, jclass that, jint arg0, jobject arg1)
{
CGRect _arg1, *lparg1=NULL;
OS_NATIVE_ENTER(env, that, CGContextGetPathBoundingBox_FUNC);
if (arg1) if ((lparg1 = getCGRectFields(env, arg1, &_arg1)) == NULL) goto fail;
*lparg1 = CGContextGetPathBoundingBox((CGContextRef)arg0);
fail:
if (arg1 && lparg1) setCGRectFields(env, arg1, lparg1);
OS_NATIVE_EXIT(env, that, CGContextGetPathBoundingBox_FUNC);
}
#endif
#ifndef NO_CGContextGetTextPosition
JNIEXPORT void JNICALL OS_NATIVE(CGContextGetTextPosition)
(JNIEnv *env, jclass that, jint arg0, jobject arg1)
{
CGPoint _arg1, *lparg1=NULL;
OS_NATIVE_ENTER(env, that, CGContextGetTextPosition_FUNC)
if (arg1) if ((lparg1 = getCGPointFields(env, arg1, &_arg1)) == NULL) goto failTag;
*lparg1 = CGContextGetTextPosition((CGContextRef)arg0);
failTag:
if (arg1 && lparg1) setCGPointFields(env, arg1, lparg1);
OS_NATIVE_EXIT(env, that, CGContextGetTextPosition_FUNC)
}
#endif
#ifndef NO_CGDisplayBounds
JNIEXPORT void JNICALL OS_NATIVE(CGDisplayBounds)
(JNIEnv *env, jclass that, jint arg0, jobject arg1)
{
CGRect _arg1, *lparg1=NULL;
OS_NATIVE_ENTER(env, that, CGDisplayBounds_FUNC);
if (arg1) if ((lparg1 = getCGRectFields(env, arg1, &_arg1)) == NULL) goto fail;
*lparg1 = CGDisplayBounds((CGDirectDisplayID)arg0);
fail:
if (arg1 && lparg1) setCGRectFields(env, arg1, lparg1);
OS_NATIVE_EXIT(env, that, CGDisplayBounds_FUNC);
}
#endif
#ifndef NO_CGPathGetBoundingBox
JNIEXPORT void JNICALL OS_NATIVE(CGPathGetBoundingBox)
(JNIEnv *env, jclass that, jint arg0, jobject arg1)
{
CGRect _arg1, *lparg1=NULL;
OS_NATIVE_ENTER(env, that, CGPathGetBoundingBox_FUNC);
if (arg1) if ((lparg1 = getCGRectFields(env, arg1, &_arg1)) == NULL) goto fail;
*lparg1 = CGPathGetBoundingBox((CGPathRef)arg0);
fail:
if (arg1 && lparg1) setCGRectFields(env, arg1, lparg1);
OS_NATIVE_EXIT(env, that, CGPathGetBoundingBox_FUNC);
}
#endif
#ifndef NO_CGPathGetCurrentPoint
JNIEXPORT void JNICALL OS_NATIVE(CGPathGetCurrentPoint)
(JNIEnv *env, jclass that, jint arg0, jobject arg1)
{
CGPoint _arg1, *lparg1=NULL;
OS_NATIVE_ENTER(env, that, CGPathGetCurrentPoint_FUNC);
if (arg1) if ((lparg1 = getCGPointFields(env, arg1, &_arg1)) == NULL) goto fail;
*lparg1 = CGPathGetCurrentPoint((CGPathRef)arg0);
fail:
if (arg1 && lparg1) setCGPointFields(env, arg1, lparg1);
OS_NATIVE_EXIT(env, that, CGPathGetCurrentPoint_FUNC);
}
#endif
#ifndef NO_CGPointApplyAffineTransform
JNIEXPORT void JNICALL OS_NATIVE(CGPointApplyAffineTransform)
(JNIEnv *env, jclass that, jobject arg0, jfloatArray arg1, jobject arg2)
{
CGPoint _arg0, *lparg0=NULL;
jfloat *lparg1=NULL;
CGPoint _arg2, *lparg2=NULL;
OS_NATIVE_ENTER(env, that, CGPointApplyAffineTransform_FUNC);
if (arg0) if ((lparg0 = getCGPointFields(env, arg0, &_arg0)) == NULL) goto fail;
if (arg1) if ((lparg1 = (*env)->GetFloatArrayElements(env, arg1, NULL)) == NULL) goto fail;
if (arg2) if ((lparg2 = getCGPointFields(env, arg2, &_arg2)) == NULL) goto fail;
*(CGPoint *)lparg2 = CGPointApplyAffineTransform(*(CGPoint *)lparg0, *(CGAffineTransform *)lparg1);
fail:
if (arg2 && lparg2) setCGPointFields(env, arg2, lparg2);
if (arg1 && lparg1) (*env)->ReleaseFloatArrayElements(env, arg1, lparg1, JNI_ABORT);
OS_NATIVE_EXIT(env, that, CGPointApplyAffineTransform_FUNC);
}
#endif
#ifndef NO_CGSizeApplyAffineTransform
JNIEXPORT void JNICALL OS_NATIVE(CGSizeApplyAffineTransform)
(JNIEnv *env, jclass that, jobject arg0, jfloatArray arg1, jobject arg2)
{
CGSize _arg0, *lparg0=NULL;
jfloat *lparg1=NULL;
CGSize _arg2, *lparg2=NULL;
OS_NATIVE_ENTER(env, that, CGSizeApplyAffineTransform_FUNC);
if (arg0) if ((lparg0 = getCGSizeFields(env, arg0, &_arg0)) == NULL) goto fail;
if (arg1) if ((lparg1 = (*env)->GetFloatArrayElements(env, arg1, NULL)) == NULL) goto fail;
if (arg2) if ((lparg2 = getCGSizeFields(env, arg2, &_arg2)) == NULL) goto fail;
*(CGSize *)lparg2 = CGSizeApplyAffineTransform(*(CGSize *)lparg0, *(CGAffineTransform *)lparg1);
fail:
if (arg2 && lparg2) setCGSizeFields(env, arg2, lparg2);
if (arg1 && lparg1) (*env)->ReleaseFloatArrayElements(env, arg1, lparg1, 0);
OS_NATIVE_EXIT(env, that, CGSizeApplyAffineTransform_FUNC);
}
#endif
#ifndef NO__1_1BIG_1ENDIAN_1_1
JNIEXPORT jboolean JNICALL OS_NATIVE(_1_1BIG_1ENDIAN_1_1)
(JNIEnv *env, jclass that)
{
jboolean rc;
OS_NATIVE_ENTER(env, that, _1_1BIG_1ENDIAN_1_1_FUNC)
#ifdef __BIG_ENDIAN__
rc = (jboolean)TRUE;
#else
rc = (jboolean)FALSE;
#endif
OS_NATIVE_EXIT(env, that, _1_1BIG_1ENDIAN_1_1_FUNC)
return rc;
}
#endif
#ifndef QDPictGetBounds
JNIEXPORT void JNICALL OS_NATIVE(QDPictGetBounds)
(JNIEnv *env, jclass that, jint arg0, jobject arg1)
{
CGRect _arg1, *lparg1=NULL;
OS_NATIVE_ENTER(env, that, QDPictGetBounds_FUNC);
if (arg1) if ((lparg1 = getCGRectFields(env, arg1, &_arg1)) == NULL) goto fail;
*lparg1 = QDPictGetBounds((QDPictRef)arg0);
fail:
if (arg1 && lparg1) setCGRectFields(env, arg1, lparg1);
OS_NATIVE_EXIT(env, that, QDPictGetBounds_FUNC);
}
#endif
|