src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c
branchihse-warnings-cflags-branch
changeset 56230 489867818774
parent 48578 2f2d159b03fc
equal deleted inserted replaced
56229:0015bf3a82e0 56230:489867818774
   225 }
   225 }
   226 
   226 
   227 /**
   227 /**
   228  * Functions for sun_awt_X11_GtkFileDialogPeer.c
   228  * Functions for sun_awt_X11_GtkFileDialogPeer.c
   229  */
   229  */
   230 static void gtk3_file_chooser_load()
   230 static void gtk3_file_chooser_load(void)
   231 {
   231 {
   232     fp_gtk_file_chooser_get_filename = dl_symbol(
   232     fp_gtk_file_chooser_get_filename = dl_symbol(
   233             "gtk_file_chooser_get_filename");
   233             "gtk_file_chooser_get_filename");
   234     fp_gtk_file_chooser_dialog_new = dl_symbol("gtk_file_chooser_dialog_new");
   234     fp_gtk_file_chooser_dialog_new = dl_symbol("gtk_file_chooser_dialog_new");
   235     fp_gtk_file_chooser_set_current_folder = dl_symbol(
   235     fp_gtk_file_chooser_set_current_folder = dl_symbol(
   252             "gtk_file_chooser_get_filenames");
   252             "gtk_file_chooser_get_filenames");
   253     fp_gtk_g_slist_length = dl_symbol("g_slist_length");
   253     fp_gtk_g_slist_length = dl_symbol("g_slist_length");
   254     fp_gdk_x11_drawable_get_xid = dl_symbol("gdk_x11_window_get_xid");
   254     fp_gdk_x11_drawable_get_xid = dl_symbol("gdk_x11_window_get_xid");
   255 }
   255 }
   256 
   256 
   257 static void empty() {}
   257 static void empty(void) {}
   258 
   258 
   259 static gboolean gtk3_version_3_10 = TRUE;
   259 static gboolean gtk3_version_3_10 = TRUE;
   260 static gboolean gtk3_version_3_14 = FALSE;
   260 static gboolean gtk3_version_3_14 = FALSE;
   261 
   261 
   262 GtkApi* gtk3_load(JNIEnv *env, const char* lib_name)
   262 GtkApi* gtk3_load(JNIEnv *env, const char* lib_name)
   641         return gtk;
   641         return gtk;
   642     }
   642     }
   643     return NULL;
   643     return NULL;
   644 }
   644 }
   645 
   645 
   646 static int gtk3_unload()
   646 static int gtk3_unload(void)
   647 {
   647 {
   648     int i;
   648     int i;
   649     char *gtk3_error;
   649     char *gtk3_error;
   650 
   650 
   651     if (!gtk3_libhandle)
   651     if (!gtk3_libhandle)
   677 }
   677 }
   678 
   678 
   679 /* Dispatch all pending events from the GTK event loop.
   679 /* Dispatch all pending events from the GTK event loop.
   680  * This is needed to catch theme change and update widgets' style.
   680  * This is needed to catch theme change and update widgets' style.
   681  */
   681  */
   682 static void flush_gtk_event_loop()
   682 static void flush_gtk_event_loop(void)
   683 {
   683 {
   684     while((*fp_g_main_context_iteration)(NULL));
   684     while((*fp_g_main_context_iteration)(NULL));
   685 }
   685 }
   686 
   686 
   687 /*
   687 /*
   688  * Initialize components of containment hierarchy. This creates a GtkFixed
   688  * Initialize components of containment hierarchy. This creates a GtkFixed
   689  * inside a GtkWindow. All widgets get realized.
   689  * inside a GtkWindow. All widgets get realized.
   690  */
   690  */
   691 static void init_containers()
   691 static void init_containers(void)
   692 {
   692 {
   693     if (gtk3_window == NULL)
   693     if (gtk3_window == NULL)
   694     {
   694     {
   695         gtk3_window = (*fp_gtk_window_new)(GTK_WINDOW_TOPLEVEL);
   695         gtk3_window = (*fp_gtk_window_new)(GTK_WINDOW_TOPLEVEL);
   696         gtk3_fixed = (GtkFixed *)(*fp_gtk_fixed_new)();
   696         gtk3_fixed = (GtkFixed *)(*fp_gtk_fixed_new)();
   895 
   895 
   896     (*fp_gtk_arrow_set)(arrow, arrow_type, shadow_type);
   896     (*fp_gtk_arrow_set)(arrow, arrow_type, shadow_type);
   897     return arrow;
   897     return arrow;
   898 }
   898 }
   899 
   899 
   900 static GtkAdjustment* create_adjustment()
   900 static GtkAdjustment* create_adjustment(void)
   901 {
   901 {
   902     return (GtkAdjustment *)
   902     return (GtkAdjustment *)
   903             (*fp_gtk_adjustment_new)(50.0, 0.0, 100.0, 10.0, 20.0, 20.0);
   903             (*fp_gtk_adjustment_new)(50.0, 0.0, 100.0, 10.0, 20.0, 20.0);
   904 }
   904 }
   905 
   905