JNIEXPORT jboolean JNICALL Java_org_gnome_gtk_GtkWindow_gtk_1window_1get_1destroy_1with_1parent ( JNIEnv* env, jclass cls, jlong _self ) { gboolean result; jboolean _result; GtkWindow* self; // convert parameter self self = (GtkWindow*) _self; // call function result = gtk_window_get_destroy_with_parent(self); // cleanup parameter self // translate return value to JNI type _result = (jboolean) result; // and finally return _result; }
void gb_window_write_standard_source (GtkWidget * widget, GbWidgetWriteSourceData * data, gchar *title_p, gchar *type_p, gchar *position_p, gchar *modal_p, gchar *default_width_p, gchar *default_height_p, gchar *shrink_p, gchar *grow_p, gchar *auto_shrink_p, gchar *wmname_p, gchar *wmclass_p, gchar *resizable_p, gchar *destroy_with_parent_p, gchar *icon_p) { gint type, position, default_width, default_height; #if 0 gchar *wmname, *wmclass; #endif if (title_p) { if (GTK_WINDOW (widget)->title && strlen (GTK_WINDOW (widget)->title) > 0) source_add (data, " gtk_window_set_title (GTK_WINDOW (%s), %s);\n", data->wname, source_make_string (GTK_WINDOW (widget)->title, data->use_gettext)); } if (type_p) { type = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (widget), type_p)); if (type != GTK_WINDOW_TOPLEVEL) { /* Note: there is no gtk_window_set_type () */ source_add (data, " GTK_WINDOW (%s)->type = %s;\n", data->wname, GbTypeSymbols[type]); } } if (position_p) { position = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (widget), position_p)); if (GbPositionValues[position] != GTK_WIN_POS_NONE) { source_add (data, " gtk_window_set_position (GTK_WINDOW (%s), %s);\n", data->wname, GbPositionSymbols[position]); } } if (modal_p) { if (gtk_object_get_data (GTK_OBJECT (widget), modal_p)) { source_add (data, " gtk_window_set_modal (GTK_WINDOW (%s), TRUE);\n", data->wname); } } if (default_width_p && default_height_p) { default_width = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (widget), DefaultWidth)); default_height = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (widget), DefaultHeight)); if (default_width || default_height ) { source_add (data, " gtk_window_set_default_size (GTK_WINDOW (%s), %i, %i);\n", data->wname, default_width ? default_width : -1, default_height ? default_height : -1); } } #if 0 if (shrink_p && grow_p) { if (GTK_WINDOW (widget)->allow_grow != TRUE || GTK_WINDOW (widget)->allow_shrink != FALSE) source_add (data, " gtk_window_set_policy (GTK_WINDOW (%s), %s, %s, %s);\n", data->wname, GTK_WINDOW (widget)->allow_shrink ? "TRUE" : "FALSE", GTK_WINDOW (widget)->allow_grow ? "TRUE" : "FALSE", "FALSE"); } #endif #if 0 /* These aren't necessary, and have been used incorrectly for ages. */ if (wmname_p && wmclass_p) { wmname = gtk_object_get_data (GTK_OBJECT (widget), wmname_p); wmclass = gtk_object_get_data (GTK_OBJECT (widget), wmclass_p); if (wmname || wmclass) { source_add (data, " gtk_window_set_wmclass (GTK_WINDOW (%s), %s,", data->wname, wmname ? source_make_string (wmname, FALSE) : "\"\""); source_add (data, " %s);\n", wmclass ? source_make_string (wmclass, FALSE) : "\"\""); } } #endif if (resizable_p) { if (!gtk_window_get_resizable (GTK_WINDOW (widget))) source_add (data, " gtk_window_set_resizable (GTK_WINDOW (%s), FALSE);\n", data->wname); } if (destroy_with_parent_p) { if (gtk_window_get_destroy_with_parent (GTK_WINDOW (widget))) source_add (data, " gtk_window_set_destroy_with_parent (GTK_WINDOW (%s), TRUE);\n", data->wname); } if (icon_p) { gchar *filename = gtk_object_get_data (GTK_OBJECT (widget), icon_p); if (filename && *filename) { char *pixbuf_name = g_strdup_printf ("%s_icon_pixbuf", data->wname); source_add_decl (data, " GdkPixbuf *%s;\n", pixbuf_name); source_create_pixbuf (data, pixbuf_name, filename); source_add (data, " if (%s)\n" " {\n" " gtk_window_set_icon (GTK_WINDOW (%s), %s);\n" " gdk_pixbuf_unref (%s);\n" " }\n", pixbuf_name, data->wname, pixbuf_name, pixbuf_name); g_free (pixbuf_name); } } }
void gb_window_get_standard_properties (GtkWidget * widget, GbWidgetGetArgData * data, gchar *title_p, gchar *type_p, gchar *position_p, gchar *modal_p, gchar *default_width_p, gchar *default_height_p, gchar *shrink_p, gchar *grow_p, gchar *auto_shrink_p, gchar *wmname_p, gchar *wmclass_p, gchar *resizable_p, gchar *destroy_with_parent_p, gchar *icon_p) { gint type, position, default_width, default_height; if (title_p) gb_widget_output_translatable_string (data, title_p, GTK_WINDOW (widget)->title); /* The type is stored in the object datalist as we can't change it after the window is realized. It will default to 0, which is OK. */ if (type_p) { type = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (widget), type_p)); gb_widget_output_choice (data, type_p, type, GbTypeSymbols[type]); } /* The position is stored in the object datalist so that it doesn't affect the displaying of the window within Glade. It will default to 0, i.e. GTK_WIN_POS_NONE, which is OK. */ if (position_p) { position = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (widget), position_p)); gb_widget_output_choice (data, position_p, position, GbPositionSymbols[position]); } if (modal_p) { gb_widget_output_bool (data, modal_p, gtk_object_get_data (GTK_OBJECT (widget), modal_p) != NULL ? TRUE : FALSE); } if (default_width_p && default_height_p) { default_width = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (widget), DefaultWidth)); gb_widget_output_optional_int (data, default_width_p, default_width, default_width != 0 ? TRUE : FALSE); default_height = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (widget), DefaultHeight)); gb_widget_output_optional_int (data, default_height_p, default_height, default_height != 0 ? TRUE : FALSE); } #if 0 /* These are deprecated. */ if (grow_p && shrink_p) { gb_widget_output_bool (data, grow_p, GTK_WINDOW (widget)->allow_grow); gb_widget_output_bool (data, shrink_p, GTK_WINDOW (widget)->allow_shrink); } #endif /* These are stored in the object hash since we can't set them after the window is realized. */ #if 0 /* These aren't necessary, and have been used incorrectly for ages. */ if (wmname_p) gb_widget_output_string (data, wmname_p, gtk_object_get_data (GTK_OBJECT (widget), wmname_p)); if (wmclass_p) gb_widget_output_string (data, wmclass_p, gtk_object_get_data (GTK_OBJECT (widget), wmclass_p)); #endif if (resizable_p) gb_widget_output_bool (data, resizable_p, gtk_window_get_resizable (GTK_WINDOW (widget))); if (destroy_with_parent_p) gb_widget_output_bool (data, destroy_with_parent_p, gtk_window_get_destroy_with_parent (GTK_WINDOW (widget))); if (icon_p) gb_widget_output_pixmap_filename (data, icon_p, gtk_object_get_data (GTK_OBJECT (widget), icon_p)); }