File: gnome.c

package info (click to toggle)
swt-gtk 3.2.1-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 10,484 kB
  • ctags: 19,176
  • sloc: java: 88,626; ansic: 23,896; cpp: 2,589; sh: 138; makefile: 63; xml: 42
file content (362 lines) | stat: -rw-r--r-- 12,941 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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
/*******************************************************************************
 * Copyright (c) 2000, 2006 IBM Corporation and others. All rights reserved.
 * The contents of this file are made available under the terms
 * of the GNU Lesser General Public License (LGPL) Version 2.1 that
 * accompanies this distribution (lgpl-v21.txt).  The LGPL is also
 * available at http://www.gnu.org/licenses/lgpl.html.  If the version
 * of the LGPL at http://www.gnu.org is different to the version of
 * the LGPL accompanying this distribution and there is any conflict
 * between the two license versions, the terms of the LGPL accompanying
 * this distribution shall govern.
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

#include "swt.h"
#include "gnome_structs.h"
#include "gnome_stats.h"

#define GNOME_NATIVE(func) Java_org_eclipse_swt_internal_gnome_GNOME_##func

#ifndef NO_GnomeVFSMimeApplication_1sizeof
JNIEXPORT jint JNICALL GNOME_NATIVE(GnomeVFSMimeApplication_1sizeof)
	(JNIEnv *env, jclass that)
{
	jint rc = 0;
	GNOME_NATIVE_ENTER(env, that, GnomeVFSMimeApplication_1sizeof_FUNC);
	rc = (jint)GnomeVFSMimeApplication_sizeof();
	GNOME_NATIVE_EXIT(env, that, GnomeVFSMimeApplication_1sizeof_FUNC);
	return rc;
}
#endif

#ifndef NO__1g_1free
JNIEXPORT void JNICALL GNOME_NATIVE(_1g_1free)
	(JNIEnv *env, jclass that, jint arg0)
{
	GNOME_NATIVE_ENTER(env, that, _1g_1free_FUNC);
	g_free((gpointer)arg0);
	GNOME_NATIVE_EXIT(env, that, _1g_1free_FUNC);
}
#endif

#ifndef NO__1g_1list_1append
JNIEXPORT jint JNICALL GNOME_NATIVE(_1g_1list_1append)
	(JNIEnv *env, jclass that, jint arg0, jint arg1)
{
	jint rc = 0;
	GNOME_NATIVE_ENTER(env, that, _1g_1list_1append_FUNC);
	rc = (jint)g_list_append((GList *)arg0, (gpointer)arg1);
	GNOME_NATIVE_EXIT(env, that, _1g_1list_1append_FUNC);
	return rc;
}
#endif

#ifndef NO__1g_1list_1free
JNIEXPORT void JNICALL GNOME_NATIVE(_1g_1list_1free)
	(JNIEnv *env, jclass that, jint arg0)
{
	GNOME_NATIVE_ENTER(env, that, _1g_1list_1free_FUNC);
	g_list_free((GList *)arg0);
	GNOME_NATIVE_EXIT(env, that, _1g_1list_1free_FUNC);
}
#endif

#ifndef NO__1g_1list_1next
JNIEXPORT jint JNICALL GNOME_NATIVE(_1g_1list_1next)
	(JNIEnv *env, jclass that, jint arg0)
{
	jint rc = 0;
	GNOME_NATIVE_ENTER(env, that, _1g_1list_1next_FUNC);
	rc = (jint)g_list_next(arg0);
	GNOME_NATIVE_EXIT(env, that, _1g_1list_1next_FUNC);
	return rc;
}
#endif

#ifndef NO__1g_1object_1unref
JNIEXPORT void JNICALL GNOME_NATIVE(_1g_1object_1unref)
	(JNIEnv *env, jclass that, jint arg0)
{
	GNOME_NATIVE_ENTER(env, that, _1g_1object_1unref_FUNC);
	g_object_unref((gpointer)arg0);
	GNOME_NATIVE_EXIT(env, that, _1g_1object_1unref_FUNC);
}
#endif

#ifndef NO__1gnome_1icon_1lookup
JNIEXPORT jint JNICALL GNOME_NATIVE(_1gnome_1icon_1lookup)
	(JNIEnv *env, jclass that, jint arg0, jint arg1, jbyteArray arg2, jbyteArray arg3, jint arg4, jbyteArray arg5, jint arg6, jintArray arg7)
{
	jbyte *lparg2=NULL;
	jbyte *lparg3=NULL;
	jbyte *lparg5=NULL;
	jint *lparg7=NULL;
	jint rc = 0;
	GNOME_NATIVE_ENTER(env, that, _1gnome_1icon_1lookup_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 (arg5) if ((lparg5 = (*env)->GetByteArrayElements(env, arg5, NULL)) == NULL) goto fail;
	if (arg7) if ((lparg7 = (*env)->GetIntArrayElements(env, arg7, NULL)) == NULL) goto fail;
	rc = (jint)gnome_icon_lookup((GnomeIconTheme *)arg0, (GnomeThumbnailFactory *)arg1, (const char *)lparg2, (const char *)lparg3, (GnomeVFSFileInfo *)arg4, (const char *)lparg5, (GnomeIconLookupFlags)arg6, (GnomeIconLookupResultFlags *)lparg7);
fail:
	if (arg7 && lparg7) (*env)->ReleaseIntArrayElements(env, arg7, lparg7, 0);
	if (arg5 && lparg5) (*env)->ReleaseByteArrayElements(env, arg5, lparg5, 0);
	if (arg3 && lparg3) (*env)->ReleaseByteArrayElements(env, arg3, lparg3, 0);
	if (arg2 && lparg2) (*env)->ReleaseByteArrayElements(env, arg2, lparg2, 0);
	GNOME_NATIVE_EXIT(env, that, _1gnome_1icon_1lookup_FUNC);
	return rc;
}
#endif

#ifndef NO__1gnome_1icon_1theme_1lookup_1icon
JNIEXPORT jint JNICALL GNOME_NATIVE(_1gnome_1icon_1theme_1lookup_1icon)
	(JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jintArray arg3, jintArray arg4)
{
	jint *lparg3=NULL;
	jint *lparg4=NULL;
	jint rc = 0;
	GNOME_NATIVE_ENTER(env, that, _1gnome_1icon_1theme_1lookup_1icon_FUNC);
	if (arg3) if ((lparg3 = (*env)->GetIntArrayElements(env, arg3, NULL)) == NULL) goto fail;
	if (arg4) if ((lparg4 = (*env)->GetIntArrayElements(env, arg4, NULL)) == NULL) goto fail;
	rc = (jint)gnome_icon_theme_lookup_icon((GnomeIconTheme *)arg0, (const char *)arg1, arg2, (const GnomeIconData **)lparg3, lparg4);
fail:
	if (arg4 && lparg4) (*env)->ReleaseIntArrayElements(env, arg4, lparg4, 0);
	if (arg3 && lparg3) (*env)->ReleaseIntArrayElements(env, arg3, lparg3, 0);
	GNOME_NATIVE_EXIT(env, that, _1gnome_1icon_1theme_1lookup_1icon_FUNC);
	return rc;
}
#endif

#ifndef NO__1gnome_1icon_1theme_1new
JNIEXPORT jint JNICALL GNOME_NATIVE(_1gnome_1icon_1theme_1new)
	(JNIEnv *env, jclass that)
{
	jint rc = 0;
	GNOME_NATIVE_ENTER(env, that, _1gnome_1icon_1theme_1new_FUNC);
	rc = (jint)gnome_icon_theme_new();
	GNOME_NATIVE_EXIT(env, that, _1gnome_1icon_1theme_1new_FUNC);
	return rc;
}
#endif

#ifndef NO__1gnome_1vfs_1get_1registered_1mime_1types
JNIEXPORT jint JNICALL GNOME_NATIVE(_1gnome_1vfs_1get_1registered_1mime_1types)
	(JNIEnv *env, jclass that)
{
	jint rc = 0;
	GNOME_NATIVE_ENTER(env, that, _1gnome_1vfs_1get_1registered_1mime_1types_FUNC);
	rc = (jint)gnome_vfs_get_registered_mime_types();
	GNOME_NATIVE_EXIT(env, that, _1gnome_1vfs_1get_1registered_1mime_1types_FUNC);
	return rc;
}
#endif

#ifndef NO__1gnome_1vfs_1init
JNIEXPORT jboolean JNICALL GNOME_NATIVE(_1gnome_1vfs_1init)
	(JNIEnv *env, jclass that)
{
	jboolean rc = 0;
	GNOME_NATIVE_ENTER(env, that, _1gnome_1vfs_1init_FUNC);
	rc = (jboolean)gnome_vfs_init();
	GNOME_NATIVE_EXIT(env, that, _1gnome_1vfs_1init_FUNC);
	return rc;
}
#endif

#ifndef NO__1gnome_1vfs_1make_1uri_1from_1input
JNIEXPORT jint JNICALL GNOME_NATIVE(_1gnome_1vfs_1make_1uri_1from_1input)
	(JNIEnv *env, jclass that, jbyteArray arg0)
{
	jbyte *lparg0=NULL;
	jint rc = 0;
	GNOME_NATIVE_ENTER(env, that, _1gnome_1vfs_1make_1uri_1from_1input_FUNC);
	if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
	rc = (jint)gnome_vfs_make_uri_from_input((const char *)lparg0);
fail:
	if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
	GNOME_NATIVE_EXIT(env, that, _1gnome_1vfs_1make_1uri_1from_1input_FUNC);
	return rc;
}
#endif

#ifndef NO__1gnome_1vfs_1make_1uri_1from_1input_1with_1dirs
JNIEXPORT jint JNICALL GNOME_NATIVE(_1gnome_1vfs_1make_1uri_1from_1input_1with_1dirs)
	(JNIEnv *env, jclass that, jbyteArray arg0, jint arg1)
{
	jbyte *lparg0=NULL;
	jint rc = 0;
	GNOME_NATIVE_ENTER(env, that, _1gnome_1vfs_1make_1uri_1from_1input_1with_1dirs_FUNC);
	if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
/*
	rc = (jint)gnome_vfs_make_uri_from_input_with_dirs((const char *)lparg0, arg1);
*/
	{
		static int initialized = 0;
		static void *handle = NULL;
		typedef jint (*FPTR)(const char *, jint);
		static FPTR fptr;
		rc = 0;
		if (!initialized) {
			if (!handle) handle = dlopen(gnome_vfs_make_uri_from_input_with_dirs_LIB, RTLD_LAZY);
			if (handle) fptr = (FPTR)dlsym(handle, "gnome_vfs_make_uri_from_input_with_dirs");
			initialized = 1;
		}
		if (fptr) {
			rc = (jint)(*fptr)((const char *)lparg0, arg1);
		}
	}
fail:
	if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
	GNOME_NATIVE_EXIT(env, that, _1gnome_1vfs_1make_1uri_1from_1input_1with_1dirs_FUNC);
	return rc;
}
#endif

#ifndef NO__1gnome_1vfs_1mime_1application_1free
JNIEXPORT void JNICALL GNOME_NATIVE(_1gnome_1vfs_1mime_1application_1free)
	(JNIEnv *env, jclass that, jint arg0)
{
	GNOME_NATIVE_ENTER(env, that, _1gnome_1vfs_1mime_1application_1free_FUNC);
	gnome_vfs_mime_application_free((GnomeVFSMimeApplication *)arg0);
	GNOME_NATIVE_EXIT(env, that, _1gnome_1vfs_1mime_1application_1free_FUNC);
}
#endif

#ifndef NO__1gnome_1vfs_1mime_1application_1launch
JNIEXPORT jint JNICALL GNOME_NATIVE(_1gnome_1vfs_1mime_1application_1launch)
	(JNIEnv *env, jclass that, jint arg0, jint arg1)
{
	jint rc = 0;
	GNOME_NATIVE_ENTER(env, that, _1gnome_1vfs_1mime_1application_1launch_FUNC);
/*
	rc = (jint)gnome_vfs_mime_application_launch((GnomeVFSMimeApplication *)arg0, (GList *)arg1);
*/
	{
		static int initialized = 0;
		static void *handle = NULL;
		typedef jint (*FPTR)(GnomeVFSMimeApplication *, GList *);
		static FPTR fptr;
		rc = 0;
		if (!initialized) {
			if (!handle) handle = dlopen(gnome_vfs_mime_application_launch_LIB, RTLD_LAZY);
			if (handle) fptr = (FPTR)dlsym(handle, "gnome_vfs_mime_application_launch");
			initialized = 1;
		}
		if (fptr) {
			rc = (jint)(*fptr)((GnomeVFSMimeApplication *)arg0, (GList *)arg1);
		}
	}
	GNOME_NATIVE_EXIT(env, that, _1gnome_1vfs_1mime_1application_1launch_FUNC);
	return rc;
}
#endif

#ifndef NO__1gnome_1vfs_1mime_1extensions_1list_1free
JNIEXPORT void JNICALL GNOME_NATIVE(_1gnome_1vfs_1mime_1extensions_1list_1free)
	(JNIEnv *env, jclass that, jint arg0)
{
	GNOME_NATIVE_ENTER(env, that, _1gnome_1vfs_1mime_1extensions_1list_1free_FUNC);
	gnome_vfs_mime_extensions_list_free((GList *)arg0);
	GNOME_NATIVE_EXIT(env, that, _1gnome_1vfs_1mime_1extensions_1list_1free_FUNC);
}
#endif

#ifndef NO__1gnome_1vfs_1mime_1get_1default_1application
JNIEXPORT jint JNICALL GNOME_NATIVE(_1gnome_1vfs_1mime_1get_1default_1application)
	(JNIEnv *env, jclass that, jbyteArray arg0)
{
	jbyte *lparg0=NULL;
	jint rc = 0;
	GNOME_NATIVE_ENTER(env, that, _1gnome_1vfs_1mime_1get_1default_1application_FUNC);
	if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
	rc = (jint)gnome_vfs_mime_get_default_application((const char *)lparg0);
fail:
	if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
	GNOME_NATIVE_EXIT(env, that, _1gnome_1vfs_1mime_1get_1default_1application_FUNC);
	return rc;
}
#endif

#ifndef NO__1gnome_1vfs_1mime_1get_1extensions_1list
JNIEXPORT jint JNICALL GNOME_NATIVE(_1gnome_1vfs_1mime_1get_1extensions_1list)
	(JNIEnv *env, jclass that, jint arg0)
{
	jint rc = 0;
	GNOME_NATIVE_ENTER(env, that, _1gnome_1vfs_1mime_1get_1extensions_1list_FUNC);
	rc = (jint)gnome_vfs_mime_get_extensions_list((const char *)arg0);
	GNOME_NATIVE_EXIT(env, that, _1gnome_1vfs_1mime_1get_1extensions_1list_FUNC);
	return rc;
}
#endif

#ifndef NO__1gnome_1vfs_1mime_1registered_1mime_1type_1list_1free
JNIEXPORT void JNICALL GNOME_NATIVE(_1gnome_1vfs_1mime_1registered_1mime_1type_1list_1free)
	(JNIEnv *env, jclass that, jint arg0)
{
	GNOME_NATIVE_ENTER(env, that, _1gnome_1vfs_1mime_1registered_1mime_1type_1list_1free_FUNC);
	gnome_vfs_mime_registered_mime_type_list_free((GList *)arg0);
	GNOME_NATIVE_EXIT(env, that, _1gnome_1vfs_1mime_1registered_1mime_1type_1list_1free_FUNC);
}
#endif

#ifndef NO__1gnome_1vfs_1mime_1type_1from_1name
JNIEXPORT jint JNICALL GNOME_NATIVE(_1gnome_1vfs_1mime_1type_1from_1name)
	(JNIEnv *env, jclass that, jbyteArray arg0)
{
	jbyte *lparg0=NULL;
	jint rc = 0;
	GNOME_NATIVE_ENTER(env, that, _1gnome_1vfs_1mime_1type_1from_1name_FUNC);
	if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
	rc = (jint)gnome_vfs_mime_type_from_name((const char *)lparg0);
fail:
	if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
	GNOME_NATIVE_EXIT(env, that, _1gnome_1vfs_1mime_1type_1from_1name_FUNC);
	return rc;
}
#endif

#ifndef NO__1gnome_1vfs_1url_1show
JNIEXPORT jint JNICALL GNOME_NATIVE(_1gnome_1vfs_1url_1show)
	(JNIEnv *env, jclass that, jint arg0)
{
	jint rc = 0;
	GNOME_NATIVE_ENTER(env, that, _1gnome_1vfs_1url_1show_FUNC);
/*
	rc = (jint)gnome_vfs_url_show((const char *)arg0);
*/
	{
		static int initialized = 0;
		static void *handle = NULL;
		typedef jint (*FPTR)(const char *);
		static FPTR fptr;
		rc = 0;
		if (!initialized) {
			if (!handle) handle = dlopen(gnome_vfs_url_show_LIB, RTLD_LAZY);
			if (handle) fptr = (FPTR)dlsym(handle, "gnome_vfs_url_show");
			initialized = 1;
		}
		if (fptr) {
			rc = (jint)(*fptr)((const char *)arg0);
		}
	}
	GNOME_NATIVE_EXIT(env, that, _1gnome_1vfs_1url_1show_FUNC);
	return rc;
}
#endif

#ifndef NO_memmove
JNIEXPORT void JNICALL GNOME_NATIVE(memmove)
	(JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2)
{
	GnomeVFSMimeApplication _arg0, *lparg0=NULL;
	GNOME_NATIVE_ENTER(env, that, memmove_FUNC);
	if (arg0) if ((lparg0 = &_arg0) == NULL) goto fail;
	memmove((void *)lparg0, (const void *)arg1, (size_t)arg2);
fail:
	if (arg0 && lparg0) setGnomeVFSMimeApplicationFields(env, arg0, lparg0);
	GNOME_NATIVE_EXIT(env, that, memmove_FUNC);
}
#endif