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