File: cde.c

package info (click to toggle)
swt-gtk 3.4-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 11,896 kB
  • ctags: 21,996
  • sloc: java: 102,480; ansic: 28,645; cpp: 3,683; sh: 154; makefile: 43; xml: 42
file content (288 lines) | stat: -rw-r--r-- 10,831 bytes parent folder | download
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
/*******************************************************************************
 * Copyright (c) 2000, 2007 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 "cde_structs.h"
#include "cde_stats.h"

#define CDE_NATIVE(func) Java_org_eclipse_swt_internal_cde_CDE_##func

#ifndef NO_DtActionArg_1sizeof
JNIEXPORT jint JNICALL CDE_NATIVE(DtActionArg_1sizeof)
	(JNIEnv *env, jclass that)
{
	jint rc = 0;
	CDE_NATIVE_ENTER(env, that, DtActionArg_1sizeof_FUNC);
	rc = (jint)DtActionArg_sizeof();
	CDE_NATIVE_EXIT(env, that, DtActionArg_1sizeof_FUNC);
	return rc;
}
#endif

#ifndef NO__1DtActionInvoke
JNIEXPORT jlong JNICALL CDE_NATIVE(_1DtActionInvoke)
	(JNIEnv *env, jclass that, jint arg0, jbyteArray arg1, jobject arg2, jint arg3, jbyteArray arg4, jbyteArray arg5, jbyteArray arg6, jint arg7, jint arg8, jint arg9)
{
	jbyte *lparg1=NULL;
	DtActionArg _arg2, *lparg2=NULL;
	jbyte *lparg4=NULL;
	jbyte *lparg5=NULL;
	jbyte *lparg6=NULL;
	jlong rc = 0;
	CDE_NATIVE_ENTER(env, that, _1DtActionInvoke_FUNC);
	if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
	if (arg2) if ((lparg2 = getDtActionArgFields(env, arg2, &_arg2)) == NULL) goto fail;
	if (arg4) if ((lparg4 = (*env)->GetByteArrayElements(env, arg4, NULL)) == NULL) goto fail;
	if (arg5) if ((lparg5 = (*env)->GetByteArrayElements(env, arg5, NULL)) == NULL) goto fail;
	if (arg6) if ((lparg6 = (*env)->GetByteArrayElements(env, arg6, NULL)) == NULL) goto fail;
	rc = (jlong)DtActionInvoke((Widget)arg0, (char *)lparg1, lparg2, arg3, (char *)lparg4, (char *)lparg5, (char *)lparg6, arg7, (DtActionCallbackProc)arg8, (XtPointer)arg9);
fail:
	if (arg6 && lparg6) (*env)->ReleaseByteArrayElements(env, arg6, lparg6, 0);
	if (arg5 && lparg5) (*env)->ReleaseByteArrayElements(env, arg5, lparg5, 0);
	if (arg4 && lparg4) (*env)->ReleaseByteArrayElements(env, arg4, lparg4, 0);
	if (arg2 && lparg2) setDtActionArgFields(env, arg2, lparg2);
	if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
	CDE_NATIVE_EXIT(env, that, _1DtActionInvoke_FUNC);
	return rc;
}
#endif

#ifndef NO__1DtAppInitialize
JNIEXPORT jboolean JNICALL CDE_NATIVE(_1DtAppInitialize)
	(JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jbyteArray arg3, jbyteArray arg4)
{
	jbyte *lparg3=NULL;
	jbyte *lparg4=NULL;
	jboolean rc = 0;
	CDE_NATIVE_ENTER(env, that, _1DtAppInitialize_FUNC);
	if (arg3) if ((lparg3 = (*env)->GetByteArrayElements(env, arg3, NULL)) == NULL) goto fail;
	if (arg4) if ((lparg4 = (*env)->GetByteArrayElements(env, arg4, NULL)) == NULL) goto fail;
	rc = (jboolean)DtAppInitialize((XtAppContext)arg0, (Display *)arg1, (Widget)arg2, (char *)lparg3, (char *)lparg4);
fail:
	if (arg4 && lparg4) (*env)->ReleaseByteArrayElements(env, arg4, lparg4, 0);
	if (arg3 && lparg3) (*env)->ReleaseByteArrayElements(env, arg3, lparg3, 0);
	CDE_NATIVE_EXIT(env, that, _1DtAppInitialize_FUNC);
	return rc;
}
#endif

#ifndef NO__1DtDbLoad
JNIEXPORT void JNICALL CDE_NATIVE(_1DtDbLoad)
	(JNIEnv *env, jclass that)
{
	CDE_NATIVE_ENTER(env, that, _1DtDbLoad_FUNC);
	DtDbLoad();
	CDE_NATIVE_EXIT(env, that, _1DtDbLoad_FUNC);
}
#endif

#ifndef NO__1DtDtsDataTypeIsAction
JNIEXPORT jboolean JNICALL CDE_NATIVE(_1DtDtsDataTypeIsAction)
	(JNIEnv *env, jclass that, jbyteArray arg0)
{
	jbyte *lparg0=NULL;
	jboolean rc = 0;
	CDE_NATIVE_ENTER(env, that, _1DtDtsDataTypeIsAction_FUNC);
	if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
	rc = (jboolean)DtDtsDataTypeIsAction((char *)lparg0);
fail:
	if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
	CDE_NATIVE_EXIT(env, that, _1DtDtsDataTypeIsAction_FUNC);
	return rc;
}
#endif

#ifndef NO__1DtDtsDataTypeNames
JNIEXPORT jint JNICALL CDE_NATIVE(_1DtDtsDataTypeNames)
	(JNIEnv *env, jclass that)
{
	jint rc = 0;
	CDE_NATIVE_ENTER(env, that, _1DtDtsDataTypeNames_FUNC);
	rc = (jint)DtDtsDataTypeNames();
	CDE_NATIVE_EXIT(env, that, _1DtDtsDataTypeNames_FUNC);
	return rc;
}
#endif

#ifndef NO__1DtDtsDataTypeToAttributeValue
JNIEXPORT jint JNICALL CDE_NATIVE(_1DtDtsDataTypeToAttributeValue)
	(JNIEnv *env, jclass that, jbyteArray arg0, jbyteArray arg1, jbyteArray arg2)
{
	jbyte *lparg0=NULL;
	jbyte *lparg1=NULL;
	jbyte *lparg2=NULL;
	jint rc = 0;
	CDE_NATIVE_ENTER(env, that, _1DtDtsDataTypeToAttributeValue_FUNC);
	if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
	if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
	if (arg2) if ((lparg2 = (*env)->GetByteArrayElements(env, arg2, NULL)) == NULL) goto fail;
	rc = (jint)DtDtsDataTypeToAttributeValue((char *)lparg0, (char *)lparg1, (char *)lparg2);
fail:
	if (arg2 && lparg2) (*env)->ReleaseByteArrayElements(env, arg2, lparg2, 0);
	if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
	if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
	CDE_NATIVE_EXIT(env, that, _1DtDtsDataTypeToAttributeValue_FUNC);
	return rc;
}
#endif

#ifndef NO__1DtDtsFileToDataType
JNIEXPORT jint JNICALL CDE_NATIVE(_1DtDtsFileToDataType)
	(JNIEnv *env, jclass that, jbyteArray arg0)
{
	jbyte *lparg0=NULL;
	jint rc = 0;
	CDE_NATIVE_ENTER(env, that, _1DtDtsFileToDataType_FUNC);
	if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
	rc = (jint)DtDtsFileToDataType((char *)lparg0);
fail:
	if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
	CDE_NATIVE_EXIT(env, that, _1DtDtsFileToDataType_FUNC);
	return rc;
}
#endif

#ifndef NO__1DtDtsFreeAttributeValue
JNIEXPORT void JNICALL CDE_NATIVE(_1DtDtsFreeAttributeValue)
	(JNIEnv *env, jclass that, jint arg0)
{
	CDE_NATIVE_ENTER(env, that, _1DtDtsFreeAttributeValue_FUNC);
	DtDtsFreeAttributeValue((char *)arg0);
	CDE_NATIVE_EXIT(env, that, _1DtDtsFreeAttributeValue_FUNC);
}
#endif

#ifndef NO__1DtDtsFreeDataType
JNIEXPORT void JNICALL CDE_NATIVE(_1DtDtsFreeDataType)
	(JNIEnv *env, jclass that, jint arg0)
{
	CDE_NATIVE_ENTER(env, that, _1DtDtsFreeDataType_FUNC);
	DtDtsFreeDataType((char *)arg0);
	CDE_NATIVE_EXIT(env, that, _1DtDtsFreeDataType_FUNC);
}
#endif

#ifndef NO__1DtDtsFreeDataTypeNames
JNIEXPORT void JNICALL CDE_NATIVE(_1DtDtsFreeDataTypeNames)
	(JNIEnv *env, jclass that, jint arg0)
{
	CDE_NATIVE_ENTER(env, that, _1DtDtsFreeDataTypeNames_FUNC);
	DtDtsFreeDataTypeNames((char **)arg0);
	CDE_NATIVE_EXIT(env, that, _1DtDtsFreeDataTypeNames_FUNC);
}
#endif

#ifndef NO__1XtAppCreateShell
JNIEXPORT jint JNICALL CDE_NATIVE(_1XtAppCreateShell)
	(JNIEnv *env, jclass that, jbyteArray arg0, jbyteArray arg1, jint arg2, jint arg3, jintArray arg4, jint arg5)
{
	jbyte *lparg0=NULL;
	jbyte *lparg1=NULL;
	jint *lparg4=NULL;
	jint rc = 0;
	CDE_NATIVE_ENTER(env, that, _1XtAppCreateShell_FUNC);
	if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
	if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
	if (arg4) if ((lparg4 = (*env)->GetIntArrayElements(env, arg4, NULL)) == NULL) goto fail;
	rc = (jint)XtAppCreateShell((String)lparg0, (String)lparg1, (WidgetClass)arg2, (Display *)arg3, (ArgList)lparg4, arg5);
fail:
	if (arg4 && lparg4) (*env)->ReleaseIntArrayElements(env, arg4, lparg4, 0);
	if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
	if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
	CDE_NATIVE_EXIT(env, that, _1XtAppCreateShell_FUNC);
	return rc;
}
#endif

#ifndef NO__1XtCreateApplicationContext
JNIEXPORT jint JNICALL CDE_NATIVE(_1XtCreateApplicationContext)
	(JNIEnv *env, jclass that)
{
	jint rc = 0;
	CDE_NATIVE_ENTER(env, that, _1XtCreateApplicationContext_FUNC);
	rc = (jint)XtCreateApplicationContext();
	CDE_NATIVE_EXIT(env, that, _1XtCreateApplicationContext_FUNC);
	return rc;
}
#endif

#ifndef NO__1XtDisplayInitialize
JNIEXPORT void JNICALL CDE_NATIVE(_1XtDisplayInitialize)
	(JNIEnv *env, jclass that, jint arg0, jint arg1, jbyteArray arg2, jbyteArray arg3, jint arg4, jint arg5, jintArray arg6, jint arg7)
{
	jbyte *lparg2=NULL;
	jbyte *lparg3=NULL;
	jint *lparg6=NULL;
	CDE_NATIVE_ENTER(env, that, _1XtDisplayInitialize_FUNC);
	if (arg2) if ((lparg2 = (*env)->GetByteArrayElements(env, arg2, NULL)) == NULL) goto fail;
	if (arg3) if ((lparg3 = (*env)->GetByteArrayElements(env, arg3, NULL)) == NULL) goto fail;
	if (arg6) if ((lparg6 = (*env)->GetIntArrayElements(env, arg6, NULL)) == NULL) goto fail;
	XtDisplayInitialize((XtAppContext)arg0, (Display *)arg1, (String)lparg2, (String)lparg3, (XrmOptionDescRec *)arg4, (Cardinal)arg5, (int *)lparg6, (String *)arg7);
fail:
	if (arg6 && lparg6) (*env)->ReleaseIntArrayElements(env, arg6, lparg6, 0);
	if (arg3 && lparg3) (*env)->ReleaseByteArrayElements(env, arg3, lparg3, 0);
	if (arg2 && lparg2) (*env)->ReleaseByteArrayElements(env, arg2, lparg2, 0);
	CDE_NATIVE_EXIT(env, that, _1XtDisplayInitialize_FUNC);
}
#endif

#ifndef NO__1XtRealizeWidget
JNIEXPORT void JNICALL CDE_NATIVE(_1XtRealizeWidget)
	(JNIEnv *env, jclass that, jint arg0)
{
	CDE_NATIVE_ENTER(env, that, _1XtRealizeWidget_FUNC);
	XtRealizeWidget((Widget)arg0);
	CDE_NATIVE_EXIT(env, that, _1XtRealizeWidget_FUNC);
}
#endif

#ifndef NO__1XtResizeWidget
JNIEXPORT void JNICALL CDE_NATIVE(_1XtResizeWidget)
	(JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3)
{
	CDE_NATIVE_ENTER(env, that, _1XtResizeWidget_FUNC);
	XtResizeWidget((Widget)arg0, arg1, arg2, arg3);
	CDE_NATIVE_EXIT(env, that, _1XtResizeWidget_FUNC);
}
#endif

#ifndef NO__1XtSetMappedWhenManaged
JNIEXPORT void JNICALL CDE_NATIVE(_1XtSetMappedWhenManaged)
	(JNIEnv *env, jclass that, jint arg0, jboolean arg1)
{
	CDE_NATIVE_ENTER(env, that, _1XtSetMappedWhenManaged_FUNC);
	XtSetMappedWhenManaged((Widget)arg0, arg1);
	CDE_NATIVE_EXIT(env, that, _1XtSetMappedWhenManaged_FUNC);
}
#endif

#ifndef NO__1XtToolkitInitialize
JNIEXPORT void JNICALL CDE_NATIVE(_1XtToolkitInitialize)
	(JNIEnv *env, jclass that)
{
	CDE_NATIVE_ENTER(env, that, _1XtToolkitInitialize_FUNC);
	XtToolkitInitialize();
	CDE_NATIVE_EXIT(env, that, _1XtToolkitInitialize_FUNC);
}
#endif

#ifndef NO__1topLevelShellWidgetClass
JNIEXPORT jint JNICALL CDE_NATIVE(_1topLevelShellWidgetClass)
	(JNIEnv *env, jclass that)
{
	jint rc = 0;
	CDE_NATIVE_ENTER(env, that, _1topLevelShellWidgetClass_FUNC);
	rc = (jint)topLevelShellWidgetClass;
	CDE_NATIVE_EXIT(env, that, _1topLevelShellWidgetClass_FUNC);
	return rc;
}
#endif