src/solaris/native/sun/awt/gtk2_interface.c

Print this page


   1 /*
   2  * Copyright (c) 2005, 2013, 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


 315 static GtkWidget* (*fp_gtk_toggle_button_new)();
 316 static GtkWidget* (*fp_gtk_toolbar_new)();
 317 static GtkWidget* (*fp_gtk_tree_view_new)();
 318 static GtkWidget* (*fp_gtk_viewport_new)(GtkAdjustment *hadjustment,
 319         GtkAdjustment *vadjustment);
 320 static GtkWidget* (*fp_gtk_window_new)(GtkWindowType type);
 321 static GtkWidget* (*fp_gtk_dialog_new)();
 322 static GtkWidget* (*fp_gtk_spin_button_new)(GtkAdjustment *adjustment,
 323         gdouble climb_rate, guint digits);
 324 static GtkWidget* (*fp_gtk_frame_new)(const gchar *label);
 325 
 326 /* Other widget operations */
 327 static GtkObject* (*fp_gtk_adjustment_new)(gdouble value,
 328         gdouble lower, gdouble upper, gdouble step_increment,
 329         gdouble page_increment, gdouble page_size);
 330 static void (*fp_gtk_container_add)(GtkContainer *window, GtkWidget *widget);
 331 static void (*fp_gtk_menu_shell_append)(GtkMenuShell *menu_shell,
 332         GtkWidget *child);
 333 static void (*fp_gtk_menu_item_set_submenu)(GtkMenuItem *menu_item,
 334         GtkWidget *submenu);
 335 static void (*fp_gtk_widget_realize)(GtkWidget *widget);
 336 static GdkPixbuf* (*fp_gtk_widget_render_icon)(GtkWidget *widget,
 337         const gchar *stock_id, GtkIconSize size, const gchar *detail);
 338 static void (*fp_gtk_widget_set_name)(GtkWidget *widget, const gchar *name);
 339 static void (*fp_gtk_widget_set_parent)(GtkWidget *widget, GtkWidget *parent);
 340 static void (*fp_gtk_widget_set_direction)(GtkWidget *widget,
 341         GtkTextDirection direction);
 342 static void (*fp_gtk_widget_style_get)(GtkWidget *widget,
 343         const gchar *first_property_name, ...);
 344 static void (*fp_gtk_widget_class_install_style_property)(
 345         GtkWidgetClass* class, GParamSpec *pspec);
 346 static GParamSpec* (*fp_gtk_widget_class_find_style_property)(
 347         GtkWidgetClass* class, const gchar* property_name);
 348 static void (*fp_gtk_widget_style_get_property)(GtkWidget* widget,
 349         const gchar* property_name, GValue* value);
 350 static char* (*fp_pango_font_description_to_string)(
 351         const PangoFontDescription* fd);
 352 static GtkSettings* (*fp_gtk_settings_get_default)();
 353 static GtkSettings* (*fp_gtk_widget_get_settings)(GtkWidget *widget);
 354 static GType        (*fp_gtk_border_get_type)();
 355 static void (*fp_gtk_arrow_set)(GtkWidget* arrow,


 772         fp_gtk_range_get_adjustment =
 773             dl_symbol("gtk_range_get_adjustment");
 774 
 775         fp_gtk_widget_hide = dl_symbol("gtk_widget_hide");
 776         fp_gtk_main_quit = dl_symbol("gtk_main_quit");
 777         fp_g_signal_connect_data = dl_symbol("g_signal_connect_data");
 778         fp_gtk_widget_show = dl_symbol("gtk_widget_show");
 779         fp_gtk_main = dl_symbol("gtk_main");
 780 
 781         /**
 782          * GLib thread system
 783          */
 784         if (GLIB_CHECK_VERSION(2, 20, 0)) {
 785             fp_g_thread_get_initialized = dl_symbol_gthread("g_thread_get_initialized");
 786         }
 787         fp_g_thread_init = dl_symbol_gthread("g_thread_init");
 788         fp_gdk_threads_init = dl_symbol("gdk_threads_init");
 789         fp_gdk_threads_enter = dl_symbol("gdk_threads_enter");
 790         fp_gdk_threads_leave = dl_symbol("gdk_threads_leave");
 791 

 792         /**
 793          * Functions for sun_awt_X11_GtkFileDialogPeer.c
 794          */
 795         if (fp_gtk_check_version(2, 4, 0) == NULL) {
 796             // The current GtkFileChooser is available from GTK+ 2.4
 797             gtk2_file_chooser_load();
 798         }
 799 
 800         /* Some functions may be missing in pre-2.4 GTK.
 801            We handle them specially here.
 802          */
 803         fp_gtk_combo_box_new = dlsym(gtk2_libhandle, "gtk_combo_box_new");
 804         if (fp_gtk_combo_box_new == NULL) {
 805             fp_gtk_combo_box_new = dl_symbol("gtk_combo_new");
 806         }
 807 
 808         fp_gtk_combo_box_entry_new =
 809             dlsym(gtk2_libhandle, "gtk_combo_box_entry_new");
 810         if (fp_gtk_combo_box_entry_new == NULL) {
 811             fp_gtk_combo_box_entry_new = dl_symbol("gtk_combo_new");


   1 /*
   2  * Copyright (c) 2005, 2014, 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


 315 static GtkWidget* (*fp_gtk_toggle_button_new)();
 316 static GtkWidget* (*fp_gtk_toolbar_new)();
 317 static GtkWidget* (*fp_gtk_tree_view_new)();
 318 static GtkWidget* (*fp_gtk_viewport_new)(GtkAdjustment *hadjustment,
 319         GtkAdjustment *vadjustment);
 320 static GtkWidget* (*fp_gtk_window_new)(GtkWindowType type);
 321 static GtkWidget* (*fp_gtk_dialog_new)();
 322 static GtkWidget* (*fp_gtk_spin_button_new)(GtkAdjustment *adjustment,
 323         gdouble climb_rate, guint digits);
 324 static GtkWidget* (*fp_gtk_frame_new)(const gchar *label);
 325 
 326 /* Other widget operations */
 327 static GtkObject* (*fp_gtk_adjustment_new)(gdouble value,
 328         gdouble lower, gdouble upper, gdouble step_increment,
 329         gdouble page_increment, gdouble page_size);
 330 static void (*fp_gtk_container_add)(GtkContainer *window, GtkWidget *widget);
 331 static void (*fp_gtk_menu_shell_append)(GtkMenuShell *menu_shell,
 332         GtkWidget *child);
 333 static void (*fp_gtk_menu_item_set_submenu)(GtkMenuItem *menu_item,
 334         GtkWidget *submenu);

 335 static GdkPixbuf* (*fp_gtk_widget_render_icon)(GtkWidget *widget,
 336         const gchar *stock_id, GtkIconSize size, const gchar *detail);
 337 static void (*fp_gtk_widget_set_name)(GtkWidget *widget, const gchar *name);
 338 static void (*fp_gtk_widget_set_parent)(GtkWidget *widget, GtkWidget *parent);
 339 static void (*fp_gtk_widget_set_direction)(GtkWidget *widget,
 340         GtkTextDirection direction);
 341 static void (*fp_gtk_widget_style_get)(GtkWidget *widget,
 342         const gchar *first_property_name, ...);
 343 static void (*fp_gtk_widget_class_install_style_property)(
 344         GtkWidgetClass* class, GParamSpec *pspec);
 345 static GParamSpec* (*fp_gtk_widget_class_find_style_property)(
 346         GtkWidgetClass* class, const gchar* property_name);
 347 static void (*fp_gtk_widget_style_get_property)(GtkWidget* widget,
 348         const gchar* property_name, GValue* value);
 349 static char* (*fp_pango_font_description_to_string)(
 350         const PangoFontDescription* fd);
 351 static GtkSettings* (*fp_gtk_settings_get_default)();
 352 static GtkSettings* (*fp_gtk_widget_get_settings)(GtkWidget *widget);
 353 static GType        (*fp_gtk_border_get_type)();
 354 static void (*fp_gtk_arrow_set)(GtkWidget* arrow,


 771         fp_gtk_range_get_adjustment =
 772             dl_symbol("gtk_range_get_adjustment");
 773 
 774         fp_gtk_widget_hide = dl_symbol("gtk_widget_hide");
 775         fp_gtk_main_quit = dl_symbol("gtk_main_quit");
 776         fp_g_signal_connect_data = dl_symbol("g_signal_connect_data");
 777         fp_gtk_widget_show = dl_symbol("gtk_widget_show");
 778         fp_gtk_main = dl_symbol("gtk_main");
 779 
 780         /**
 781          * GLib thread system
 782          */
 783         if (GLIB_CHECK_VERSION(2, 20, 0)) {
 784             fp_g_thread_get_initialized = dl_symbol_gthread("g_thread_get_initialized");
 785         }
 786         fp_g_thread_init = dl_symbol_gthread("g_thread_init");
 787         fp_gdk_threads_init = dl_symbol("gdk_threads_init");
 788         fp_gdk_threads_enter = dl_symbol("gdk_threads_enter");
 789         fp_gdk_threads_leave = dl_symbol("gdk_threads_leave");
 790 
 791         fp_gdk_x11_drawable_get_xid = dl_symbol("gdk_x11_drawable_get_xid");
 792         /**
 793          * Functions for sun_awt_X11_GtkFileDialogPeer.c
 794          */
 795         if (fp_gtk_check_version(2, 4, 0) == NULL) {
 796             // The current GtkFileChooser is available from GTK+ 2.4
 797             gtk2_file_chooser_load();
 798         }
 799 
 800         /* Some functions may be missing in pre-2.4 GTK.
 801            We handle them specially here.
 802          */
 803         fp_gtk_combo_box_new = dlsym(gtk2_libhandle, "gtk_combo_box_new");
 804         if (fp_gtk_combo_box_new == NULL) {
 805             fp_gtk_combo_box_new = dl_symbol("gtk_combo_new");
 806         }
 807 
 808         fp_gtk_combo_box_entry_new =
 809             dlsym(gtk2_libhandle, "gtk_combo_box_entry_new");
 810         if (fp_gtk_combo_box_entry_new == NULL) {
 811             fp_gtk_combo_box_entry_new = dl_symbol("gtk_combo_new");