1 | /* |
2 | * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. |
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | * |
5 | * This code is free software; you can redistribute it and/or modify it |
6 | * under the terms of the GNU General Public License version 2 only, as |
7 | * published by the Free Software Foundation. Oracle designates this |
8 | * particular file as subject to the "Classpath" exception as provided |
9 | * by Oracle in the LICENSE file that accompanied this code. |
10 | * |
11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
14 | * version 2 for more details (a copy is included in the LICENSE file that |
15 | * accompanied this code). |
16 | * |
17 | * You should have received a copy of the GNU General Public License version |
18 | * 2 along with this work; if not, write to the Free Software Foundation, |
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
20 | * |
21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 | * or visit www.oracle.com if you need additional information or have any |
23 | * questions. |
24 | */ |
25 | #ifndef _GTK_INTERFACE_H |
26 | #define _GTK_INTERFACE_H |
27 | |
28 | #include <X11/X.h> |
29 | #include <jni.h> |
30 | |
31 | #ifndef FALSE |
32 | #define FALSE (0) |
33 | #define TRUE (!FALSE) |
34 | #endif |
35 | |
36 | #define GTHREAD_LIB_VERSIONED VERSIONED_JNI_LIB_NAME("gthread-2.0", "0") |
37 | #define GTHREAD_LIB JNI_LIB_NAME("gthread-2.0") |
38 | |
39 | #define _G_TYPE_CIC(ip, gt, ct) ((ct*) ip) |
40 | #define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) \ |
41 | (_G_TYPE_CIC ((instance), (g_type), c_type)) |
42 | #define GTK_TYPE_FILE_CHOOSER (fp_gtk_file_chooser_get_type ()) |
43 | #define GTK_FILE_CHOOSER(obj) \ |
44 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FILE_CHOOSER, GtkFileChooser)) |
45 | #define G_CALLBACK(f) ((GCallback) (f)) |
46 | #define G_TYPE_FUNDAMENTAL_SHIFT (2) |
47 | #define G_TYPE_MAKE_FUNDAMENTAL(x) ((GType) ((x) << G_TYPE_FUNDAMENTAL_SHIFT)) |
48 | #define G_TYPE_OBJECT G_TYPE_MAKE_FUNDAMENTAL (20) |
49 | #define GTK_STOCK_CANCEL "gtk-cancel" |
50 | #define GTK_STOCK_SAVE "gtk-save" |
51 | #define GTK_STOCK_OPEN "gtk-open" |
52 | #define GDK_CURRENT_TIME 0L |
53 | |
54 | #define G_TYPE_INVALID G_TYPE_MAKE_FUNDAMENTAL (0) |
55 | #define G_TYPE_NONE G_TYPE_MAKE_FUNDAMENTAL (1) |
56 | #define G_TYPE_INTERFACE G_TYPE_MAKE_FUNDAMENTAL (2) |
57 | #define G_TYPE_CHAR G_TYPE_MAKE_FUNDAMENTAL (3) |
58 | #define G_TYPE_UCHAR G_TYPE_MAKE_FUNDAMENTAL (4) |
59 | #define G_TYPE_BOOLEAN G_TYPE_MAKE_FUNDAMENTAL (5) |
60 | #define G_TYPE_INT G_TYPE_MAKE_FUNDAMENTAL (6) |
61 | #define G_TYPE_UINT G_TYPE_MAKE_FUNDAMENTAL (7) |
62 | #define G_TYPE_LONG G_TYPE_MAKE_FUNDAMENTAL (8) |
63 | #define G_TYPE_ULONG G_TYPE_MAKE_FUNDAMENTAL (9) |
64 | #define G_TYPE_INT64 G_TYPE_MAKE_FUNDAMENTAL (10) |
65 | #define G_TYPE_UINT64 G_TYPE_MAKE_FUNDAMENTAL (11) |
66 | #define G_TYPE_ENUM G_TYPE_MAKE_FUNDAMENTAL (12) |
67 | #define G_TYPE_FLAGS G_TYPE_MAKE_FUNDAMENTAL (13) |
68 | #define G_TYPE_FLOAT G_TYPE_MAKE_FUNDAMENTAL (14) |
69 | #define G_TYPE_DOUBLE G_TYPE_MAKE_FUNDAMENTAL (15) |
70 | #define G_TYPE_STRING G_TYPE_MAKE_FUNDAMENTAL (16) |
71 | #define G_TYPE_POINTER G_TYPE_MAKE_FUNDAMENTAL (17) |
72 | #define G_TYPE_BOXED G_TYPE_MAKE_FUNDAMENTAL (18) |
73 | #define G_TYPE_PARAM G_TYPE_MAKE_FUNDAMENTAL (19) |
74 | #define G_TYPE_OBJECT G_TYPE_MAKE_FUNDAMENTAL (20) |
75 | |
76 | #define GTK_TYPE_BORDER ((*fp_gtk_border_get_type)()) |
77 | |
78 | #define G_TYPE_FUNDAMENTAL_SHIFT (2) |
79 | #define G_TYPE_MAKE_FUNDAMENTAL(x) ((GType) ((x) << G_TYPE_FUNDAMENTAL_SHIFT)) |
80 | |
81 | #ifndef MIN |
82 | #define MIN(a, b) (((a) < (b)) ? (a) : (b)) |
83 | #endif |
84 | |
85 | #define CONV_BUFFER_SIZE 128 |
86 | #define NO_SYMBOL_EXCEPTION 1 |
87 | |
88 | /* basic types */ |
89 | typedef char gchar; |
90 | typedef short gshort; |
91 | typedef int gint; |
92 | typedef long glong; |
93 | typedef float gfloat; |
94 | typedef double gdouble; |
95 | typedef void* gpointer; |
96 | typedef gint gboolean; |
97 | typedef signed char gint8; |
98 | typedef signed short gint16; |
99 | typedef signed int gint32; |
100 | typedef unsigned char guchar; |
101 | typedef unsigned char guint8; |
102 | typedef unsigned short gushort; |
103 | typedef unsigned short guint16; |
104 | typedef unsigned int guint; |
105 | typedef unsigned int guint32; |
106 | typedef unsigned int gsize; |
107 | typedef unsigned long gulong; |
108 | typedef signed long long gint64; |
109 | typedef unsigned long long guint64; |
110 | typedef gulong GType; |
111 | |
112 | typedef struct _GList GList; |
113 | struct _GList |
114 | { |
115 | gpointer data; |
116 | GList *next; |
117 | GList *prev; |
118 | }; |
119 | |
120 | typedef struct _GSList GSList; |
121 | struct _GSList { |
122 | gpointer data; |
123 | GSList *next; |
124 | }; |
125 | |
126 | typedef enum { |
127 | BUTTON, /* GtkButton */ |
128 | CHECK_BOX, /* GtkCheckButton */ |
129 | , /* GtkCheckMenuItem */ |
130 | COLOR_CHOOSER, /* GtkColorSelectionDialog */ |
131 | COMBO_BOX, /* GtkComboBox */ |
132 | COMBO_BOX_ARROW_BUTTON, /* GtkComboBoxEntry */ |
133 | COMBO_BOX_TEXT_FIELD, /* GtkComboBoxEntry */ |
134 | DESKTOP_ICON, /* GtkLabel */ |
135 | DESKTOP_PANE, /* GtkContainer */ |
136 | EDITOR_PANE, /* GtkTextView */ |
137 | FORMATTED_TEXT_FIELD, /* GtkEntry */ |
138 | HANDLE_BOX, /* GtkHandleBox */ |
139 | HPROGRESS_BAR, /* GtkProgressBar */ |
140 | HSCROLL_BAR, /* GtkHScrollbar */ |
141 | HSCROLL_BAR_BUTTON_LEFT, /* GtkHScrollbar */ |
142 | HSCROLL_BAR_BUTTON_RIGHT, /* GtkHScrollbar */ |
143 | HSCROLL_BAR_TRACK, /* GtkHScrollbar */ |
144 | HSCROLL_BAR_THUMB, /* GtkHScrollbar */ |
145 | HSEPARATOR, /* GtkHSeparator */ |
146 | HSLIDER, /* GtkHScale */ |
147 | HSLIDER_TRACK, /* GtkHScale */ |
148 | HSLIDER_THUMB, /* GtkHScale */ |
149 | HSPLIT_PANE_DIVIDER, /* GtkHPaned */ |
150 | INTERNAL_FRAME, /* GtkWindow */ |
151 | INTERNAL_FRAME_TITLE_PANE, /* GtkLabel */ |
152 | IMAGE, /* GtkImage */ |
153 | LABEL, /* GtkLabel */ |
154 | LIST, /* GtkTreeView */ |
155 | , /* GtkMenu */ |
156 | , /* GtkMenuBar */ |
157 | , /* GtkMenuItem */ |
158 | , /* GtkLabel */ |
159 | OPTION_PANE, /* GtkMessageDialog */ |
160 | PANEL, /* GtkContainer */ |
161 | PASSWORD_FIELD, /* GtkEntry */ |
162 | , /* GtkMenu */ |
163 | , /* GtkSeparatorMenuItem */ |
164 | RADIO_BUTTON, /* GtkRadioButton */ |
165 | , /* GtkRadioMenuItem */ |
166 | ROOT_PANE, /* GtkContainer */ |
167 | SCROLL_PANE, /* GtkScrolledWindow */ |
168 | SPINNER, /* GtkSpinButton */ |
169 | SPINNER_ARROW_BUTTON, /* GtkSpinButton */ |
170 | SPINNER_TEXT_FIELD, /* GtkSpinButton */ |
171 | SPLIT_PANE, /* GtkPaned */ |
172 | TABBED_PANE, /* GtkNotebook */ |
173 | TABBED_PANE_TAB_AREA, /* GtkNotebook */ |
174 | TABBED_PANE_CONTENT, /* GtkNotebook */ |
175 | TABBED_PANE_TAB, /* GtkNotebook */ |
176 | TABLE, /* GtkTreeView */ |
177 | , /* GtkButton */ |
178 | TEXT_AREA, /* GtkTextView */ |
179 | TEXT_FIELD, /* GtkEntry */ |
180 | TEXT_PANE, /* GtkTextView */ |
181 | TITLED_BORDER, /* GtkFrame */ |
182 | TOGGLE_BUTTON, /* GtkToggleButton */ |
183 | TOOL_BAR, /* GtkToolbar */ |
184 | TOOL_BAR_DRAG_WINDOW, /* GtkToolbar */ |
185 | TOOL_BAR_SEPARATOR, /* GtkSeparatorToolItem */ |
186 | TOOL_TIP, /* GtkWindow */ |
187 | TREE, /* GtkTreeView */ |
188 | TREE_CELL, /* GtkTreeView */ |
189 | VIEWPORT, /* GtkViewport */ |
190 | VPROGRESS_BAR, /* GtkProgressBar */ |
191 | VSCROLL_BAR, /* GtkVScrollbar */ |
192 | VSCROLL_BAR_BUTTON_UP, /* GtkVScrollbar */ |
193 | VSCROLL_BAR_BUTTON_DOWN, /* GtkVScrollbar */ |
194 | VSCROLL_BAR_TRACK, /* GtkVScrollbar */ |
195 | VSCROLL_BAR_THUMB, /* GtkVScrollbar */ |
196 | VSEPARATOR, /* GtkVSeparator */ |
197 | VSLIDER, /* GtkVScale */ |
198 | VSLIDER_TRACK, /* GtkVScale */ |
199 | VSLIDER_THUMB, /* GtkVScale */ |
200 | VSPLIT_PANE_DIVIDER, /* GtkVPaned */ |
201 | WIDGET_TYPE_SIZE |
202 | } WidgetType; |
203 | |
204 | typedef enum |
205 | { |
206 | _GTK_ARROW_TYPE, |
207 | _GTK_BUTTON_TYPE, |
208 | _GTK_CHECK_BUTTON_TYPE, |
209 | , |
210 | _GTK_COLOR_SELECTION_DIALOG_TYPE, |
211 | _GTK_COMBO_BOX_TYPE, |
212 | _GTK_COMBO_BOX_ARROW_BUTTON_TYPE, |
213 | _GTK_COMBO_BOX_TEXT_FIELD_TYPE, |
214 | _GTK_CONTAINER_TYPE, |
215 | _GTK_ENTRY_TYPE, |
216 | _GTK_FRAME_TYPE, |
217 | _GTK_HANDLE_BOX_TYPE, |
218 | _GTK_HPANED_TYPE, |
219 | _GTK_HPROGRESS_BAR_TYPE, |
220 | _GTK_HSCALE_TYPE, |
221 | _GTK_HSCROLLBAR_TYPE, |
222 | _GTK_HSEPARATOR_TYPE, |
223 | _GTK_IMAGE_TYPE, |
224 | , |
225 | , |
226 | , |
227 | _GTK_NOTEBOOK_TYPE, |
228 | _GTK_LABEL_TYPE, |
229 | _GTK_RADIO_BUTTON_TYPE, |
230 | , |
231 | _GTK_SCROLLED_WINDOW_TYPE, |
232 | , |
233 | _GTK_SEPARATOR_TOOL_ITEM_TYPE, |
234 | _GTK_SPIN_BUTTON_TYPE, |
235 | _GTK_TEXT_VIEW_TYPE, |
236 | _GTK_TOGGLE_BUTTON_TYPE, |
237 | _GTK_TOOLBAR_TYPE, |
238 | _GTK_TOOLTIP_TYPE, |
239 | _GTK_TREE_VIEW_TYPE, |
240 | _GTK_VIEWPORT_TYPE, |
241 | _GTK_VPANED_TYPE, |
242 | _GTK_VPROGRESS_BAR_TYPE, |
243 | _GTK_VSCALE_TYPE, |
244 | _GTK_VSCROLLBAR_TYPE, |
245 | _GTK_VSEPARATOR_TYPE, |
246 | _GTK_WINDOW_TYPE, |
247 | _GTK_DIALOG_TYPE, |
248 | _GTK_WIDGET_TYPE_SIZE |
249 | } GtkWidgetType; |
250 | |
251 | typedef enum |
252 | { |
253 | GTK_STATE_NORMAL, |
254 | GTK_STATE_ACTIVE, |
255 | GTK_STATE_PRELIGHT, |
256 | GTK_STATE_SELECTED, |
257 | GTK_STATE_INSENSITIVE, |
258 | GTK_STATE_INCONSISTENT, |
259 | GTK_STATE_FOCUSED |
260 | } GtkStateType; |
261 | |
262 | typedef enum |
263 | { |
264 | GTK_SHADOW_NONE, |
265 | GTK_SHADOW_IN, |
266 | GTK_SHADOW_OUT, |
267 | GTK_SHADOW_ETCHED_IN, |
268 | GTK_SHADOW_ETCHED_OUT |
269 | } GtkShadowType; |
270 | |
271 | typedef enum |
272 | { |
273 | GTK_EXPANDER_COLLAPSED, |
274 | GTK_EXPANDER_SEMI_COLLAPSED, |
275 | GTK_EXPANDER_SEMI_EXPANDED, |
276 | GTK_EXPANDER_EXPANDED |
277 | } GtkExpanderStyle; |
278 | |
279 | typedef enum |
280 | { |
281 | GTK_ICON_SIZE_INVALID, |
282 | , |
283 | GTK_ICON_SIZE_SMALL_TOOLBAR, |
284 | GTK_ICON_SIZE_LARGE_TOOLBAR, |
285 | GTK_ICON_SIZE_BUTTON, |
286 | GTK_ICON_SIZE_DND, |
287 | GTK_ICON_SIZE_DIALOG |
288 | } GtkIconSize; |
289 | |
290 | typedef enum |
291 | { |
292 | GTK_ORIENTATION_HORIZONTAL, |
293 | GTK_ORIENTATION_VERTICAL |
294 | } GtkOrientation; |
295 | |
296 | typedef enum |
297 | { |
298 | FOREGROUND, |
299 | BACKGROUND, |
300 | TEXT_FOREGROUND, |
301 | TEXT_BACKGROUND, |
302 | FOCUS, |
303 | LIGHT, |
304 | DARK, |
305 | MID, |
306 | BLACK, |
307 | WHITE |
308 | } ColorType; |
309 | |
310 | typedef enum |
311 | { |
312 | GTK_FONT_NAME, |
313 | GTK_ICON_SIZES, |
314 | GTK_CURSOR_BLINK, |
315 | GTK_CURSOR_BLINK_TIME |
316 | } Setting; |
317 | |
318 | typedef enum |
319 | { |
320 | GTK_ARROW_UP, |
321 | GTK_ARROW_DOWN, |
322 | GTK_ARROW_LEFT, |
323 | GTK_ARROW_RIGHT, |
324 | GTK_ARROW_NONE |
325 | } GtkArrowType; |
326 | |
327 | typedef enum |
328 | { |
329 | GTK_TEXT_DIR_NONE, |
330 | GTK_TEXT_DIR_LTR, |
331 | GTK_TEXT_DIR_RTL |
332 | } GtkTextDirection; |
333 | |
334 | typedef enum |
335 | { |
336 | GTK_POS_LEFT, |
337 | GTK_POS_RIGHT, |
338 | GTK_POS_TOP, |
339 | GTK_POS_BOTTOM |
340 | } GtkPositionType; |
341 | |
342 | /* SynthConstants */ |
343 | static const gint ENABLED = 1 << 0; |
344 | static const gint MOUSE_OVER = 1 << 1; |
345 | static const gint PRESSED = 1 << 2; |
346 | static const gint DISABLED = 1 << 3; |
347 | static const gint FOCUSED = 1 << 8; |
348 | static const gint SELECTED = 1 << 9; |
349 | static const gint DEFAULT = 1 << 10; |
350 | |
351 | typedef enum |
352 | { |
353 | GTK_ANY, |
354 | GTK_1, |
355 | GTK_2, |
356 | GTK_3 |
357 | } GtkVersion; |
358 | |
359 | //------------------------------ |
360 | |
361 | |
362 | |
363 | typedef enum { |
364 | GTK_RESPONSE_NONE = -1, |
365 | GTK_RESPONSE_REJECT = -2, |
366 | GTK_RESPONSE_ACCEPT = -3, |
367 | GTK_RESPONSE_DELETE_EVENT = -4, |
368 | GTK_RESPONSE_OK = -5, |
369 | GTK_RESPONSE_CANCEL = -6, |
370 | GTK_RESPONSE_CLOSE = -7, |
371 | GTK_RESPONSE_YES = -8, |
372 | GTK_RESPONSE_NO = -9, |
373 | GTK_RESPONSE_APPLY = -10, |
374 | GTK_RESPONSE_HELP = -11 |
375 | } GtkResponseType; |
376 | |
377 | typedef enum { |
378 | GTK_FILE_CHOOSER_ACTION_OPEN, |
379 | GTK_FILE_CHOOSER_ACTION_SAVE, |
380 | GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, |
381 | GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER |
382 | } GtkFileChooserAction; |
383 | |
384 | typedef enum { |
385 | GTK_FILE_FILTER_FILENAME = 1 << 0, |
386 | GTK_FILE_FILTER_URI = 1 << 1, |
387 | GTK_FILE_FILTER_DISPLAY_NAME = 1 << 2, |
388 | GTK_FILE_FILTER_MIME_TYPE = 1 << 3 |
389 | } GtkFileFilterFlags; |
390 | |
391 | typedef enum { |
392 | GDK_COLORSPACE_RGB |
393 | } GdkColorspace; |
394 | |
395 | typedef enum { |
396 | GDK_INTERP_NEAREST, |
397 | GDK_INTERP_TILES, |
398 | GDK_INTERP_BILINEAR, |
399 | GDK_INTERP_HYPER |
400 | } GdkInterpType; |
401 | |
402 | typedef enum { |
403 | G_CONNECT_AFTER = 1 << 0, G_CONNECT_SWAPPED = 1 << 1 |
404 | } GConnectFlags; |
405 | //------------------------------ |
406 | |
407 | |
408 | typedef void GError; |
409 | typedef void GdkScreen; |
410 | typedef void GtkWindow; |
411 | typedef void GdkWindow; |
412 | typedef void GClosure; |
413 | typedef void GtkFileChooser; |
414 | typedef void GtkFileFilter; |
415 | typedef struct { |
416 | GtkFileFilterFlags contains; |
417 | const gchar *filename; |
418 | const gchar *uri; |
419 | const gchar *display_name; |
420 | const gchar *mime_type; |
421 | } GtkFileFilterInfo; |
422 | typedef gboolean (*GtkFileFilterFunc)(const GtkFileFilterInfo *filter_info, |
423 | gpointer data); |
424 | typedef void (*GClosureNotify)(gpointer data, GClosure *closure); |
425 | typedef void (*GDestroyNotify)(gpointer data); |
426 | typedef void (*GCallback)(void); |
427 | |
428 | |
429 | typedef struct GtkApi { |
430 | int version; |
431 | gboolean (*show_uri_load)(JNIEnv *env); |
432 | gboolean (*unload)(); |
433 | void (*flush_event_loop)(); |
434 | gchar* (*gtk_check_version)(guint required_major, guint required_minor, |
435 | guint required_micro); |
436 | jobject (*get_setting)(JNIEnv *env, Setting property); |
437 | |
438 | void (*paint_arrow)(WidgetType widget_type, GtkStateType state_type, |
439 | GtkShadowType shadow_type, const gchar *detail, |
440 | gint x, gint y, gint width, gint height, |
441 | GtkArrowType arrow_type, gboolean fill); |
442 | void (*paint_box)(WidgetType widget_type, GtkStateType state_type, |
443 | GtkShadowType shadow_type, const gchar *detail, |
444 | gint x, gint y, gint width, gint height, |
445 | gint synth_state, GtkTextDirection dir); |
446 | void (*paint_box_gap)(WidgetType widget_type, GtkStateType state_type, |
447 | GtkShadowType shadow_type, const gchar *detail, |
448 | gint x, gint y, gint width, gint height, |
449 | GtkPositionType gap_side, gint gap_x, gint gap_width); |
450 | void (*paint_expander)(WidgetType widget_type, GtkStateType state_type, |
451 | const gchar *detail, gint x, gint y, gint width, gint height, |
452 | GtkExpanderStyle expander_style); |
453 | void (*paint_extension)(WidgetType widget_type, GtkStateType state_type, |
454 | GtkShadowType shadow_type, const gchar *detail, |
455 | gint x, gint y, gint width, gint height, GtkPositionType gap_side); |
456 | void (*paint_flat_box)(WidgetType widget_type, GtkStateType state_type, |
457 | GtkShadowType shadow_type, const gchar *detail, |
458 | gint x, gint y, gint width, gint height, gboolean has_focus); |
459 | void (*paint_focus)(WidgetType widget_type, GtkStateType state_type, |
460 | const char *detail, gint x, gint y, gint width, gint height); |
461 | void (*paint_handle)(WidgetType widget_type, GtkStateType state_type, |
462 | GtkShadowType shadow_type, const gchar *detail, |
463 | gint x, gint y, gint width, gint height, GtkOrientation orientation); |
464 | void (*paint_hline)(WidgetType widget_type, GtkStateType state_type, |
465 | const gchar *detail, gint x, gint y, gint width, gint height); |
466 | void (*paint_vline)(WidgetType widget_type, GtkStateType state_type, |
467 | const gchar *detail, gint x, gint y, gint width, gint height); |
468 | void (*paint_option)(WidgetType widget_type, gint synth_state, |
469 | const gchar *detail, gint x, gint y, gint width, gint height); |
470 | void (*paint_shadow)(WidgetType widget_type, GtkStateType state_type, |
471 | GtkShadowType shadow_type, const gchar *detail, |
472 | gint x, gint y, gint width, gint height, |
473 | gint synth_state, GtkTextDirection dir); |
474 | void (*paint_slider)(WidgetType widget_type, GtkStateType state_type, |
475 | GtkShadowType shadow_type, const gchar *detail, |
476 | gint x, gint y, gint width, gint height, GtkOrientation orientation, |
477 | gboolean has_focus); |
478 | void (*paint_background)(WidgetType widget_type, GtkStateType state_type, |
479 | gint x, gint y, gint width, gint height); |
480 | void (*paint_check)(WidgetType widget_type, gint synth_state, |
481 | const gchar *detail, gint x, gint y, gint width, gint height); |
482 | void (*set_range_value)(WidgetType widget_type, jdouble value, |
483 | jdouble min, jdouble max, jdouble visible); |
484 | |
485 | void (*init_painting)(JNIEnv *env, gint w, gint h); |
486 | gint (*copy_image)(gint *dest, gint width, gint height); |
487 | |
488 | gint (*get_xthickness)(JNIEnv *env, WidgetType widget_type); |
489 | gint (*get_ythickness)(JNIEnv *env, WidgetType widget_type); |
490 | gint (*get_color_for_state)(JNIEnv *env, WidgetType widget_type, |
491 | GtkStateType state_type, ColorType color_type); |
492 | jobject (*get_class_value)(JNIEnv *env, WidgetType widget_type, |
493 | const char* key); |
494 | |
495 | jstring (*get_pango_font_name)(JNIEnv *env, WidgetType widget_type); |
496 | jboolean (*get_icon_data)(JNIEnv *env, gint widget_type, |
497 | const gchar *stock_id, GtkIconSize size, |
498 | GtkTextDirection direction, const char *detail, |
499 | jmethodID icon_upcall_method, jobject this); |
500 | jboolean (*get_file_icon_data)(JNIEnv *env, const char *filename, |
501 | GError **error, jmethodID icon_upcall_method, jobject this); |
502 | void (*gdk_threads_enter)(void); |
503 | void (*gdk_threads_leave)(void); |
504 | gboolean (*gtk_show_uri)(GdkScreen *screen, const gchar *uri, |
505 | guint32 timestamp, GError **error); |
506 | gboolean (*get_drawable_data)(JNIEnv *env, jintArray pixelArray, |
507 | jint x, jint y, jint width, jint height, |
508 | jint jwidth, int dx, int dy, jint scale); |
509 | void (*g_free)(gpointer mem); |
510 | |
511 | |
512 | gchar* (*gtk_file_chooser_get_filename)(GtkFileChooser *chooser); |
513 | void (*gtk_widget_hide)(void* widget); |
514 | void (*gtk_main_quit)(void); |
515 | void* (*gtk_file_chooser_dialog_new)(const gchar *title, |
516 | GtkWindow *parent, GtkFileChooserAction action, |
517 | const gchar *first_button_text, ...); |
518 | gboolean (*gtk_file_chooser_set_current_folder)(GtkFileChooser *chooser, |
519 | const gchar *filename); |
520 | gboolean (*gtk_file_chooser_set_filename)(GtkFileChooser *chooser, |
521 | const char *filename); |
522 | void (*gtk_file_chooser_set_current_name)(GtkFileChooser *chooser, |
523 | const gchar *name); |
524 | void (*gtk_file_filter_add_custom)(GtkFileFilter *filter, |
525 | GtkFileFilterFlags needed, GtkFileFilterFunc func, gpointer data, |
526 | GDestroyNotify notify); |
527 | void (*gtk_file_chooser_set_filter)(GtkFileChooser *chooser, |
528 | GtkFileFilter *filter); |
529 | GType (*gtk_file_chooser_get_type)(void); |
530 | GtkFileFilter* (*gtk_file_filter_new)(void); |
531 | void (*gtk_file_chooser_set_do_overwrite_confirmation)( |
532 | GtkFileChooser *chooser, gboolean do_overwrite_confirmation); |
533 | void (*gtk_file_chooser_set_select_multiple)( |
534 | GtkFileChooser *chooser, gboolean select_multiple); |
535 | gchar* (*gtk_file_chooser_get_current_folder)(GtkFileChooser *chooser); |
536 | GSList* (*gtk_file_chooser_get_filenames)(GtkFileChooser *chooser); |
537 | guint (*gtk_g_slist_length)(GSList *list); |
538 | gulong (*g_signal_connect_data)(gpointer instance, |
539 | const gchar *detailed_signal, GCallback c_handler, gpointer data, |
540 | GClosureNotify destroy_data, GConnectFlags connect_flags); |
541 | void (*gtk_widget_show)(void *widget); |
542 | void (*gtk_main)(void); |
543 | guint (*gtk_main_level)(void); |
544 | gchar* (*g_path_get_dirname) (const gchar *file_name); |
545 | XID (*gdk_x11_drawable_get_xid) (void *drawable); |
546 | void (*gtk_widget_destroy)(void *widget); |
547 | void (*gtk_window_present)(void *window); |
548 | void (*gtk_window_move)(void *window, gint x, gint y); |
549 | void (*gtk_window_resize)(void *window, gint width, gint height); |
550 | GdkWindow *(*get_window)(void *widget); |
551 | |
552 | void (*g_object_unref)(gpointer object); |
553 | GList* (*g_list_append) (GList *list, gpointer data); |
554 | void (*g_list_free) (GList *list); |
555 | void (*g_list_free_full) (GList *list, GDestroyNotify free_func); |
556 | } GtkApi; |
557 | |
558 | gboolean gtk_load(JNIEnv *env, GtkVersion version, gboolean verbose); |
559 | gboolean gtk_check_version(GtkVersion version); |
560 | |
561 | typedef struct _GThreadFunctions GThreadFunctions; |
562 | static gboolean (*fp_g_thread_get_initialized)(void); |
563 | static void (*fp_g_thread_init)(GThreadFunctions *vtable); |
564 | static void (*fp_gdk_threads_init)(void); |
565 | static void (*fp_gdk_threads_enter)(void); |
566 | static void (*fp_gdk_threads_leave)(void); |
567 | |
568 | extern GtkApi* gtk; |
569 | |
570 | #endif /* !_GTK_INTERFACE_H */ |
571 | |