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 _GTK3_INTERFACE_H
26#define _GTK3_INTERFACE_H
27
28#include <stdlib.h>
29#include <jni.h>
30#include <X11/X.h>
31#include "gtk_interface.h"
32
33#define LIGHTNESS_MULT 1.3
34#define DARKNESS_MULT 0.7
35
36#define G_PI 3.1415926535897932384626433832795028841971693993751
37
38typedef enum
39{
40 GTK_STATE_FLAG_NORMAL = 0,
41 GTK_STATE_FLAG_ACTIVE = 1 << 0,
42 GTK_STATE_FLAG_PRELIGHT = 1 << 1,
43 GTK_STATE_FLAG_SELECTED = 1 << 2,
44 GTK_STATE_FLAG_INSENSITIVE = 1 << 3,
45 GTK_STATE_FLAG_INCONSISTENT = 1 << 4,
46 GTK_STATE_FLAG_FOCUSED = 1 << 5,
47 GTK_STATE_FLAG_BACKDROP = 1 << 6,
48 GTK_STATE_FLAG_DIR_LTR = 1 << 7,
49 GTK_STATE_FLAG_DIR_RTL = 1 << 8,
50 GTK_STATE_FLAG_LINK = 1 << 9,
51 GTK_STATE_FLAG_VISITED = 1 << 10,
52 GTK_STATE_FLAG_CHECKED = 1 << 11
53} GtkStateFlags;
54
55typedef enum {
56 GTK_JUNCTION_NONE = 0,
57 GTK_JUNCTION_CORNER_TOPLEFT = 1 << 0,
58 GTK_JUNCTION_CORNER_TOPRIGHT = 1 << 1,
59 GTK_JUNCTION_CORNER_BOTTOMLEFT = 1 << 2,
60 GTK_JUNCTION_CORNER_BOTTOMRIGHT = 1 << 3,
61 GTK_JUNCTION_TOP =
62 (GTK_JUNCTION_CORNER_TOPLEFT | GTK_JUNCTION_CORNER_TOPRIGHT),
63 GTK_JUNCTION_BOTTOM =
64 (GTK_JUNCTION_CORNER_BOTTOMLEFT | GTK_JUNCTION_CORNER_BOTTOMRIGHT),
65 GTK_JUNCTION_LEFT =
66 (GTK_JUNCTION_CORNER_TOPLEFT | GTK_JUNCTION_CORNER_BOTTOMLEFT),
67 GTK_JUNCTION_RIGHT =
68 (GTK_JUNCTION_CORNER_TOPRIGHT | GTK_JUNCTION_CORNER_BOTTOMRIGHT)
69} GtkJunctionSides;
70
71typedef enum {
72 GTK_REGION_EVEN = 1 << 0,
73 GTK_REGION_ODD = 1 << 1,
74 GTK_REGION_FIRST = 1 << 2,
75 GTK_REGION_LAST = 1 << 3,
76 GTK_REGION_ONLY = 1 << 4,
77 GTK_REGION_SORTED = 1 << 5
78} GtkRegionFlags;
79
80typedef enum
81{
82 GTK_WINDOW_TOPLEVEL,
83 GTK_WINDOW_POPUP
84} GtkWindowType;
85
86typedef enum
87{
88 G_PARAM_READABLE = 1 << 0,
89 G_PARAM_WRITABLE = 1 << 1,
90 G_PARAM_CONSTRUCT = 1 << 2,
91 G_PARAM_CONSTRUCT_ONLY = 1 << 3,
92 G_PARAM_LAX_VALIDATION = 1 << 4,
93 G_PARAM_STATIC_NAME = 1 << 5
94} GParamFlags;
95
96typedef enum
97{
98 GTK_ICON_LOOKUP_NO_SVG = 1 << 0,
99 GTK_ICON_LOOKUP_FORCE_SVG = 1 << 1,
100 GTK_ICON_LOOKUP_USE_BUILTIN = 1 << 2,
101 GTK_ICON_LOOKUP_GENERIC_FALLBACK = 1 << 3,
102 GTK_ICON_LOOKUP_FORCE_SIZE = 1 << 4
103} GtkIconLookupFlags;
104
105typedef enum
106{
107 GTK_UPDATE_CONTINUOUS,
108 GTK_UPDATE_DISCONTINUOUS,
109 GTK_UPDATE_DELAYED
110} GtkUpdateType;
111
112typedef enum
113{
114 GTK_PROGRESS_CONTINUOUS,
115 GTK_PROGRESS_DISCRETE
116} GtkProgressBarStyle;
117
118typedef enum
119{
120 GTK_PROGRESS_LEFT_TO_RIGHT,
121 GTK_PROGRESS_RIGHT_TO_LEFT,
122 GTK_PROGRESS_BOTTOM_TO_TOP,
123 GTK_PROGRESS_TOP_TO_BOTTOM
124} GtkProgressBarOrientation;
125
126typedef enum {
127 CAIRO_FORMAT_INVALID = -1,
128 CAIRO_FORMAT_ARGB32 = 0,
129 CAIRO_FORMAT_RGB24 = 1,
130 CAIRO_FORMAT_A8 = 2,
131 CAIRO_FORMAT_A1 = 3,
132 CAIRO_FORMAT_RGB16_565 = 4
133} cairo_format_t;
134
135/* We define all structure pointers to be void* */
136typedef void GdkPixbuf;
137typedef void GMainContext;
138typedef void GVfs;
139
140typedef void GdkColormap;
141typedef void GdkDrawable;
142typedef void GdkGC;
143typedef void GdkPixmap;
144typedef void GtkStyleContext;
145typedef void GtkFixed;
146typedef void GtkMenuItem;
147typedef void GtkMenuShell;
148typedef void GtkWidgetClass;
149typedef void PangoFontDescription;
150typedef void GtkSettings;
151typedef void GtkStyleProvider;
152typedef void cairo_pattern_t;
153typedef void cairo_t;
154typedef void cairo_surface_t;
155typedef void GtkScrolledWindow;
156typedef void GtkIconTheme;
157typedef void GtkWidget;
158typedef void GtkMisc;
159typedef void GtkContainer;
160typedef void GtkBin;
161typedef void GtkAdjustment;
162typedef void GtkRange;
163typedef void GtkProgressBar;
164typedef void GtkProgress;
165typedef void GtkWidgetPath;
166typedef void GtkPaned;
167
168/* Some real structures */
169typedef struct
170{
171 guint32 pixel;
172 guint16 red;
173 guint16 green;
174 guint16 blue;
175} GdkColor;
176
177typedef struct
178{
179 gdouble red;
180 gdouble green;
181 gdouble blue;
182 gdouble alpha;
183} GdkRGBA;
184
185typedef struct {
186 gint fd;
187 gushort events;
188 gushort revents;
189} GPollFD;
190
191typedef struct {
192 gint x;
193 gint y;
194 gint width;
195 gint height;
196} GdkRectangle;
197
198typedef struct {
199 int x, y;
200 int width, height;
201} GtkAllocation;
202
203typedef struct {
204 gint width;
205 gint height;
206} GtkRequisition;
207
208typedef struct {
209 GtkWidgetClass *g_class;
210} GTypeInstance;
211
212typedef struct {
213 gint16 left;
214 gint16 right;
215 gint16 top;
216 gint16 bottom;
217} GtkBorder;
218
219typedef struct
220{
221 GType g_type;
222 union {
223 gint v_int;
224 guint v_uint;
225 glong v_long;
226 gulong v_ulong;
227 gint64 v_int64;
228 guint64 v_uint64;
229 gfloat v_float;
230 gdouble v_double;
231 gpointer v_pointer;
232 } data[2];
233} GValue;
234
235typedef struct {
236 GTypeInstance g_type_instance;
237 const gchar *name;
238 GParamFlags flags;
239 GType value_type;
240 GType owner_type;
241} GParamSpec;
242
243static gchar* (*fp_glib_check_version)(guint required_major,
244 guint required_minor, guint required_micro);
245
246/**
247 * Returns :
248 * NULL if the GTK+ library is compatible with the given version, or a string
249 * describing the version mismatch.
250 */
251static gchar* (*fp_gtk_check_version)(guint required_major, guint
252 required_minor, guint required_micro);
253
254static void (*fp_g_free)(gpointer mem);
255static void (*fp_g_object_unref)(gpointer object);
256static GdkWindow *(*fp_gdk_get_default_root_window) (void);
257static int (*fp_gdk_window_get_scale_factor) (GdkWindow *window);
258
259static int (*fp_gdk_pixbuf_get_bits_per_sample)(const GdkPixbuf *pixbuf);
260static guchar *(*fp_gdk_pixbuf_get_pixels)(const GdkPixbuf *pixbuf);
261static gboolean (*fp_gdk_pixbuf_get_has_alpha)(const GdkPixbuf *pixbuf);
262static int (*fp_gdk_pixbuf_get_height)(const GdkPixbuf *pixbuf);
263static int (*fp_gdk_pixbuf_get_n_channels)(const GdkPixbuf *pixbuf);
264static int (*fp_gdk_pixbuf_get_rowstride)(const GdkPixbuf *pixbuf);
265static int (*fp_gdk_pixbuf_get_width)(const GdkPixbuf *pixbuf);
266static GdkPixbuf *(*fp_gdk_pixbuf_new_from_file)(const char *filename,
267 GError **error);
268static GdkColorspace (*fp_gdk_pixbuf_get_colorspace)(const GdkPixbuf *pixbuf);
269
270static GdkPixbuf *(*fp_gdk_pixbuf_get_from_drawable)(GdkWindow *window,
271 int src_x, int src_y, int width, int height);
272static GdkPixbuf *(*fp_gdk_pixbuf_scale_simple)(GdkPixbuf *src,
273 int dest_width, int dest_heigh, GdkInterpType interp_type);
274
275
276static void (*fp_gtk_widget_destroy)(void *widget);
277static void (*fp_gtk_window_present)(GtkWindow *window);
278static void (*fp_gtk_window_move)(GtkWindow *window, gint x, gint y);
279static void (*fp_gtk_window_resize)(GtkWindow *window, gint width, gint height);
280
281/**
282 * Function Pointers for GtkFileChooser
283 */
284static gchar* (*fp_gtk_file_chooser_get_filename)(GtkFileChooser *chooser);
285static void (*fp_gtk_widget_hide)(void *widget);
286static void (*fp_gtk_main_quit)(void);
287static void* (*fp_gtk_file_chooser_dialog_new)(const gchar *title,
288 GtkWindow *parent, GtkFileChooserAction action,
289 const gchar *first_button_text, ...);
290static gboolean (*fp_gtk_file_chooser_set_current_folder)
291 (GtkFileChooser *chooser, const gchar *filename);
292static gboolean (*fp_gtk_file_chooser_set_filename)(GtkFileChooser *chooser,
293 const char *filename);
294static void (*fp_gtk_file_chooser_set_current_name)(GtkFileChooser *chooser,
295 const gchar *name);
296static void (*fp_gtk_file_filter_add_custom)(GtkFileFilter *filter,
297 GtkFileFilterFlags needed, GtkFileFilterFunc func, gpointer data,
298 GDestroyNotify notify);
299static void (*fp_gtk_file_chooser_set_filter)(GtkFileChooser *chooser,
300 GtkFileFilter *filter);
301static GType (*fp_gtk_file_chooser_get_type)(void);
302static GtkFileFilter* (*fp_gtk_file_filter_new)(void);
303static void (*fp_gtk_file_chooser_set_do_overwrite_confirmation)(
304 GtkFileChooser *chooser, gboolean do_overwrite_confirmation);
305static void (*fp_gtk_file_chooser_set_select_multiple)(
306 GtkFileChooser *chooser, gboolean select_multiple);
307static gchar* (*fp_gtk_file_chooser_get_current_folder)
308 (GtkFileChooser *chooser);
309static GSList* (*fp_gtk_file_chooser_get_filenames)(GtkFileChooser *chooser);
310static guint (*fp_gtk_g_slist_length)(GSList *list);
311static gulong (*fp_g_signal_connect_data)(gpointer instance,
312 const gchar *detailed_signal, GCallback c_handler, gpointer data,
313 GClosureNotify destroy_data, GConnectFlags connect_flags);
314static void (*fp_gtk_widget_show)(void *widget);
315static void (*fp_gtk_main)(void);
316static guint (*fp_gtk_main_level)(void);
317static gchar* (*fp_g_path_get_dirname) (const gchar *file_name);
318static XID (*fp_gdk_x11_drawable_get_xid) (GdkWindow *drawable);
319
320static GList* (*fp_g_list_append) (GList *list, gpointer data);
321static void (*fp_g_list_free) (GList *list);
322static void (*fp_g_list_free_full) (GList *list, GDestroyNotify free_func);
323
324static void (*fp_gdk_threads_enter)(void);
325static void (*fp_gdk_threads_leave)(void);
326
327static gboolean (*fp_gtk_show_uri)(GdkScreen *screen, const gchar *uri,
328 guint32 timestamp, GError **error);
329
330// Implementation functions prototypes
331static void gtk3_init(GtkApi* gtk);
332static GValue* (*fp_g_value_init)(GValue *value, GType g_type);
333static gboolean (*fp_g_type_is_a)(GType type, GType is_a_type);
334static gboolean (*fp_g_value_get_boolean)(const GValue *value);
335static gchar (*fp_g_value_get_char)(const GValue *value);
336static guchar (*fp_g_value_get_uchar)(const GValue *value);
337static gint (*fp_g_value_get_int)(const GValue *value);
338static guint (*fp_g_value_get_uint)(const GValue *value);
339static glong (*fp_g_value_get_long)(const GValue *value);
340static gulong (*fp_g_value_get_ulong)(const GValue *value);
341static gint64 (*fp_g_value_get_int64)(const GValue *value);
342static guint64 (*fp_g_value_get_uint64)(const GValue *value);
343static gfloat (*fp_g_value_get_float)(const GValue *value);
344static gdouble (*fp_g_value_get_double)(const GValue *value);
345static const gchar* (*fp_g_value_get_string)(const GValue *value);
346static gint (*fp_g_value_get_enum)(const GValue *value);
347static guint (*fp_g_value_get_flags)(const GValue *value);
348static GParamSpec* (*fp_g_value_get_param)(const GValue *value);
349static gpointer* (*fp_g_value_get_boxed)(const GValue *value);
350static gpointer* (*fp_g_value_get_pointer)(const GValue *value);
351static void (*fp_g_object_get)(gpointer object,
352 const gchar* fpn, ...);
353static void (*fp_g_object_set)(gpointer object,
354 const gchar *first_property_name,
355 ...);
356
357static gboolean (*fp_g_main_context_iteration)(GMainContext *context);
358static gboolean (*fp_g_str_has_prefix)(const gchar *str, const gchar *prefix);
359static gchar** (*fp_g_strsplit)(const gchar *string, const gchar *delimiter,
360 gint max_tokens);
361static void (*fp_g_strfreev)(gchar **str_array);
362
363
364static cairo_surface_t* (*fp_cairo_image_surface_create)(cairo_format_t format,
365 int width, int height);
366static void (*fp_cairo_surface_destroy)(cairo_surface_t *surface);
367static cairo_t* (*fp_cairo_create)(cairo_surface_t *target);
368static void (*fp_cairo_destroy)(cairo_t *cr);
369static void (*fp_cairo_fill)(cairo_t *cr);
370static void (*fp_cairo_surface_flush)(cairo_surface_t *surface);
371static void (*fp_cairo_rectangle)(cairo_t *cr, double x, double y, double width,
372 double height);
373static void (*fp_cairo_set_source_rgb)(cairo_t *cr, double red, double green,
374 double blue);
375static void (*fp_cairo_set_source_rgba)(cairo_t *cr, double red, double green,
376 double blue, double alpha);
377static void (*fp_cairo_paint)(cairo_t *cr);
378static void (*fp_cairo_clip)(cairo_t *cr);
379static unsigned char* (*fp_cairo_image_surface_get_data)(
380 cairo_surface_t *surface);
381static int (*fp_cairo_image_surface_get_stride) (cairo_surface_t *surface);
382static GdkPixbuf* (*fp_gdk_pixbuf_get_from_surface)(cairo_surface_t *surface,
383 gint src_x, gint src_y, gint width, gint height);
384static GtkStateType (*fp_gtk_widget_get_state)(GtkWidget *widget);
385static void (*fp_gtk_widget_set_state)(GtkWidget *widget, GtkStateType state);
386static gboolean (*fp_gtk_widget_is_focus)(GtkWidget *widget);
387static void (*fp_gtk_widget_set_allocation)(GtkWidget *widget,
388 const GtkAllocation *allocation);
389static GtkWidget* (*fp_gtk_widget_get_parent)(GtkWidget *widget);
390static GtkStyleContext* (*fp_gtk_widget_get_style_context)(GtkWidget *widget);
391static void (*fp_gtk_style_context_get_color)(GtkStyleContext *context,
392 GtkStateFlags state, GdkRGBA *color);
393static void (*fp_gtk_style_context_get_background_color)
394 (GtkStyleContext *context, GtkStateFlags state, GdkRGBA *color);
395static void (*fp_gtk_style_context_get)(GtkStyleContext *context,
396 GtkStateFlags state, ...);
397static GtkStateFlags (*fp_gtk_widget_get_state_flags)(GtkWidget* widget);
398static void (*fp_gtk_style_context_set_state)(GtkStyleContext* style,
399 GtkStateFlags flags);
400static void (*fp_gtk_style_context_add_class)(GtkStyleContext *context,
401 const gchar *class_name);
402static void (*fp_gtk_style_context_save)(GtkStyleContext *context);
403static void (*fp_gtk_style_context_restore)(GtkStyleContext *context);
404static void (*fp_gtk_render_check)(GtkStyleContext *context, cairo_t *cr,
405 gdouble x, gdouble y, gdouble width, gdouble height);
406static void (*fp_gtk_render_option)(GtkStyleContext *context, cairo_t *cr,
407 gdouble x, gdouble y, gdouble width, gdouble height);
408static void (*fp_gtk_render_extension)(GtkStyleContext *context, cairo_t *cr,
409 gdouble x, gdouble y, gdouble width, gdouble height,
410 GtkPositionType gap_side);
411static void (*fp_gtk_render_expander)(GtkStyleContext *context, cairo_t *cr,
412 gdouble x, gdouble y, gdouble width, gdouble height);
413static void (*fp_gtk_render_frame_gap)(GtkStyleContext *context, cairo_t *cr,
414 gdouble x, gdouble y, gdouble width, gdouble height,
415 GtkPositionType gap_side, gdouble xy0_gap,
416 gdouble xy1_gap);
417static void (*fp_gtk_render_line)(GtkStyleContext *context, cairo_t *cr,
418 gdouble x0, gdouble y0, gdouble x1, gdouble y1);
419static GdkPixbuf* (*fp_gtk_widget_render_icon_pixbuf)(GtkWidget *widget,
420 const gchar *stock_id, GtkIconSize size);
421static cairo_surface_t* (*fp_gdk_window_create_similar_image_surface)(
422 GdkWindow *window, cairo_format_t format, int width,
423 int height, int scale);
424static cairo_surface_t* (*fp_gdk_window_create_similar_surface)(
425 GdkWindow *window, cairo_format_t format,
426 int width, int height);
427static GdkWindow* (*fp_gtk_widget_get_window)(GtkWidget *widget);
428static GtkSettings *(*fp_gtk_settings_get_for_screen)(GdkScreen *screen);
429static GdkScreen *(*fp_gtk_widget_get_screen)(GtkWidget *widget);
430static GtkStyleProvider* (*fp_gtk_css_provider_get_named)(const gchar *name,
431 const gchar *variant);
432static void (*fp_gtk_style_context_add_provider)(GtkStyleContext *context,
433 GtkStyleProvider *provider, guint priority);
434static void (*fp_gtk_render_frame)(GtkStyleContext *context,cairo_t *cr,
435 gdouble x, gdouble y, gdouble width, gdouble height);
436static void (*fp_gtk_render_focus)(GtkStyleContext *context,cairo_t *cr,
437 gdouble x, gdouble y, gdouble width, gdouble height);
438static void (*fp_gtk_render_handle)(GtkStyleContext *context,cairo_t *cr,
439 gdouble x, gdouble y, gdouble width, gdouble height);
440static void (*fp_gtk_style_context_get_property)(GtkStyleContext *context,
441 const gchar *property, GtkStateFlags state, GValue *value);
442static void (*fp_gtk_render_activity)(GtkStyleContext *context, cairo_t *cr,
443 gdouble x, gdouble y, gdouble width, gdouble height);
444static void (*fp_gtk_render_background)(GtkStyleContext *context, cairo_t *cr,
445 gdouble x, gdouble y, gdouble width, gdouble height);
446static gboolean (*fp_gtk_style_context_has_class)(GtkStyleContext *context,
447 const gchar *class_name);
448static void transform_detail_string (const gchar *detail,
449 GtkStyleContext *context);
450void (*fp_gtk_style_context_set_junction_sides)(GtkStyleContext *context,
451 GtkJunctionSides sides);
452void (*fp_gtk_style_context_add_region)(GtkStyleContext *context,
453 const gchar *region_name, GtkRegionFlags flags);
454void (*fp_gtk_render_arrow)(GtkStyleContext *context, cairo_t *cr,
455 gdouble angle, gdouble x, gdouble y, gdouble size);
456void (*fp_gtk_bin_set_child)(GtkBin *bin, GtkWidget *widget);
457void (*fp_gtk_scrolled_window_set_shadow_type)(
458 GtkScrolledWindow *scrolled_window, GtkShadowType type);
459static void (*fp_gtk_render_slider)(GtkStyleContext *context, cairo_t *cr,
460 gdouble x, gdouble y, gdouble width, gdouble height,
461 GtkOrientation orientation);
462static void (*fp_gtk_style_context_get_padding)(GtkStyleContext *self,
463 GtkStateFlags state, GtkBorder* padding);
464static void (*fp_gtk_range_set_inverted)(GtkRange *range, gboolean setting);
465static PangoFontDescription* (*fp_gtk_style_context_get_font)(
466 GtkStyleContext *context, GtkStateFlags state);
467static int (*fp_gtk_widget_get_allocated_width)(GtkWidget *widget);
468static int (*fp_gtk_widget_get_allocated_height)(GtkWidget *widget);
469static GtkIconTheme* (*fp_gtk_icon_theme_get_default)(void);
470static GdkPixbuf* (*fp_gtk_icon_theme_load_icon)(GtkIconTheme *icon_theme,
471 const gchar *icon_name, gint size,
472 GtkIconLookupFlags flags, GError **error);
473static void (*fp_gtk_adjustment_set_lower)(GtkAdjustment *adjustment,
474 gdouble lower);
475static void (*fp_gtk_adjustment_set_page_increment)(GtkAdjustment *adjustment,
476 gdouble page_increment);
477static void (*fp_gtk_adjustment_set_page_size)(GtkAdjustment *adjustment,
478 gdouble page_size);
479static void (*fp_gtk_adjustment_set_step_increment)(GtkAdjustment *adjustment,
480 gdouble step_increment);
481static void (*fp_gtk_adjustment_set_upper)(GtkAdjustment *adjustment,
482 gdouble upper);
483static void (*fp_gtk_adjustment_set_value)(GtkAdjustment *adjustment,
484 gdouble value);
485static GdkGC *(*fp_gdk_gc_new)(GdkDrawable*);
486static void (*fp_gdk_rgb_gc_set_foreground)(GdkGC*, guint32);
487static void (*fp_gdk_draw_rectangle)(GdkDrawable*, GdkGC*, gboolean,
488 gint, gint, gint, gint);
489static GdkPixbuf *(*fp_gdk_pixbuf_new)(GdkColorspace colorspace,
490 gboolean has_alpha, int bits_per_sample, int width, int height);
491static void (*fp_gdk_drawable_get_size)(GdkDrawable *drawable,
492 gint* width, gint* height);
493static gboolean (*fp_gtk_init_check)(int* argc, char** argv);
494
495/* Widget creation */
496static GtkWidget* (*fp_gtk_arrow_new)(GtkArrowType arrow_type,
497 GtkShadowType shadow_type);
498static GtkWidget* (*fp_gtk_button_new)();
499static GtkWidget* (*fp_gtk_check_button_new)();
500static GtkWidget* (*fp_gtk_check_menu_item_new)();
501static GtkWidget* (*fp_gtk_color_selection_dialog_new)(const gchar* title);
502static GtkWidget* (*fp_gtk_combo_box_new)();
503static GtkWidget* (*fp_gtk_combo_box_entry_new)();
504static GtkWidget* (*fp_gtk_entry_new)();
505static GtkWidget* (*fp_gtk_fixed_new)();
506static GtkWidget* (*fp_gtk_handle_box_new)();
507static GtkWidget* (*fp_gtk_paned_new)(GtkOrientation orientation);
508static GtkWidget* (*fp_gtk_scale_new)(GtkOrientation orientation,
509 GtkAdjustment* adjustment);
510static GtkWidget* (*fp_gtk_hscrollbar_new)(GtkAdjustment* adjustment);
511static GtkWidget* (*fp_gtk_vscrollbar_new)(GtkAdjustment* adjustment);
512static GtkWidget* (*fp_gtk_hseparator_new)();
513static GtkWidget* (*fp_gtk_vseparator_new)();
514static GtkWidget* (*fp_gtk_image_new)();
515static GtkWidget* (*fp_gtk_label_new)(const gchar* str);
516static GtkWidget* (*fp_gtk_menu_new)();
517static GtkWidget* (*fp_gtk_menu_bar_new)();
518static GtkWidget* (*fp_gtk_menu_item_new)();
519static GtkWidget* (*fp_gtk_notebook_new)();
520static GtkWidget* (*fp_gtk_progress_bar_new)();
521static GtkWidget* (*fp_gtk_progress_bar_set_orientation)(
522 GtkProgressBar *pbar,
523 GtkProgressBarOrientation orientation);
524static GtkWidget* (*fp_gtk_radio_button_new)(GSList *group);
525static GtkWidget* (*fp_gtk_radio_menu_item_new)(GSList *group);
526static GtkWidget* (*fp_gtk_scrolled_window_new)(GtkAdjustment *hadjustment,
527 GtkAdjustment *vadjustment);
528static GtkWidget* (*fp_gtk_separator_menu_item_new)();
529static GtkWidget* (*fp_gtk_separator_tool_item_new)();
530static GtkWidget* (*fp_gtk_text_view_new)();
531static GtkWidget* (*fp_gtk_toggle_button_new)();
532static GtkWidget* (*fp_gtk_toolbar_new)();
533static GtkWidget* (*fp_gtk_tree_view_new)();
534static GtkWidget* (*fp_gtk_viewport_new)(GtkAdjustment *hadjustment,
535 GtkAdjustment *vadjustment);
536static GtkWidget* (*fp_gtk_window_new)(GtkWindowType type);
537static GtkWidget* (*fp_gtk_dialog_new)();
538static GtkWidget* (*fp_gtk_spin_button_new)(GtkAdjustment *adjustment,
539 gdouble climb_rate, guint digits);
540static GtkWidget* (*fp_gtk_frame_new)(const gchar *label);
541
542/* Other widget operations */
543static GtkAdjustment* (*fp_gtk_adjustment_new)(gdouble value,
544 gdouble lower, gdouble upper, gdouble step_increment,
545 gdouble page_increment, gdouble page_size);
546static void (*fp_gtk_container_add)(GtkContainer *window, GtkWidget *widget);
547static void (*fp_gtk_menu_shell_append)(GtkMenuShell *menu_shell,
548 GtkWidget *child);
549static void (*fp_gtk_menu_item_set_submenu)(GtkMenuItem *menu_item,
550 GtkWidget *submenu);
551static void (*fp_gtk_widget_realize)(GtkWidget *widget);
552static GdkPixbuf* (*fp_gtk_widget_render_icon)(GtkWidget *widget,
553 const gchar *stock_id, GtkIconSize size, const gchar *detail);
554static void (*fp_gtk_widget_set_name)(GtkWidget *widget, const gchar *name);
555static void (*fp_gtk_widget_set_parent)(GtkWidget *widget, GtkWidget *parent);
556static void (*fp_gtk_widget_set_direction)(GtkWidget *widget,
557 GtkTextDirection direction);
558static void (*fp_gtk_widget_style_get)(GtkWidget *widget,
559 const gchar *first_property_name, ...);
560static void (*fp_gtk_widget_class_install_style_property)(
561 GtkWidgetClass* class, GParamSpec *pspec);
562static GParamSpec* (*fp_gtk_widget_class_find_style_property)(
563 GtkWidgetClass* class, const gchar* property_name);
564static void (*fp_gtk_widget_style_get_property)(GtkWidget* widget,
565 const gchar* property_name, GValue* value);
566static char* (*fp_pango_font_description_to_string)(
567 const PangoFontDescription* fd);
568static GtkSettings* (*fp_gtk_settings_get_default)();
569static GtkSettings* (*fp_gtk_widget_get_settings)(GtkWidget *widget);
570static GType (*fp_gtk_border_get_type)();
571static void (*fp_gtk_arrow_set)(GtkWidget* arrow,
572 GtkArrowType arrow_type,
573 GtkShadowType shadow_type);
574static void (*fp_gtk_widget_size_request)(GtkWidget *widget,
575 GtkRequisition *requisition);
576static GtkAdjustment* (*fp_gtk_range_get_adjustment)(GtkRange* range);
577static GtkWidgetPath* (*fp_gtk_widget_path_copy)
578 (const GtkWidgetPath *path);
579static const GtkWidgetPath* (*fp_gtk_style_context_get_path)
580 (GtkStyleContext *context);
581static GtkWidgetPath* (*fp_gtk_widget_path_new) (void);
582static gint (*fp_gtk_widget_path_append_type)
583 (GtkWidgetPath *path, GType type);
584static void (*fp_gtk_widget_path_iter_set_object_name)
585 (GtkWidgetPath *path, gint pos, const char *name);
586static void (*fp_gtk_style_context_set_path)
587 (GtkStyleContext *context, GtkWidgetPath *path);
588static void (*fp_gtk_widget_path_unref) (GtkWidgetPath *path);
589static GtkStyleContext* (*fp_gtk_style_context_new) (void);
590
591#endif /* !_GTK3_INTERFACE_H */
592