Commit cf622160 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

app/interface.c app/gui/about-dialog.c app/gui/brush-editor.c

2001-08-14  Michael Natterer  <mitch@gimp.org>

	* app/interface.c
	* app/gui/about-dialog.c
	* app/gui/brush-editor.c
	* app/gui/brush-select.c
	* app/gui/color-notebook.c
	* app/gui/color-select.c
	* app/gui/convert-dialog.c
	* app/gui/file-commands.c
	* app/gui/file-dialog-utils.c
	* app/gui/file-dialog-utils.h
	* app/gui/file-new-dialog.c
	* app/gui/file-open-dialog.c
	* app/gui/file-save-dialog.c
	* app/gui/gradient-editor.c
	* app/gui/gradients-commands.c
	* app/gui/gui.c
	* app/gui/image-commands.c
	* app/gui/info-window.c
	* app/gui/layer-select.c
	* app/gui/menus.c
	* app/gui/paths-dialog.c
	* app/gui/preferences-dialog.c
	* app/gui/resolution-calibrate-dialog.c
	* app/gui/select-commands.c
	* app/gui/splash.c
	* app/gui/test-commands.c
	* app/gui/tips-dialog.c
	* app/tools/gimpthresholdtool.c
	* app/tools/paint_options.c
	* app/widgets/gimpdock.c
	* app/widgets/gimpdockbook.c: got rid of all
	gtk_object_[get|set]_data() and almost all gtk_signal_foo()
	function calls.
parent ecc78cf7
2001-08-14 Michael Natterer <mitch@gimp.org>
* app/interface.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brush-select.c
* app/gui/color-notebook.c
* app/gui/color-select.c
* app/gui/convert-dialog.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-dialog-utils.h
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.c
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/gui.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layer-select.c
* app/gui/menus.c
* app/gui/paths-dialog.c
* app/gui/preferences-dialog.c
* app/gui/resolution-calibrate-dialog.c
* app/gui/select-commands.c
* app/gui/splash.c
* app/gui/test-commands.c
* app/gui/tips-dialog.c
* app/tools/gimpthresholdtool.c
* app/tools/paint_options.c
* app/widgets/gimpdock.c
* app/widgets/gimpdockbook.c: got rid of all
gtk_object_[get|set]_data() and almost all gtk_signal_foo()
function calls.
2001-08-14 Michael Natterer <mitch@gimp.org>
* app/gdisplay.h: an evil temp_hack which lets GimpContext manage
......
......@@ -206,7 +206,7 @@ file_revert_cmd_callback (GtkWidget *widget,
filename = gimp_object_get_name (GIMP_OBJECT (gdisp->gimage));
query_box = gtk_object_get_data (GTK_OBJECT (gdisp->gimage), REVERT_DATA_KEY);
query_box = g_object_get_data (G_OBJECT (gdisp->gimage), REVERT_DATA_KEY);
if (! filename)
{
......@@ -241,8 +241,8 @@ file_revert_cmd_callback (GtkWidget *widget,
g_free (text);
gtk_object_set_data (GTK_OBJECT (gdisp->gimage), REVERT_DATA_KEY,
query_box);
g_object_set_data (G_OBJECT (gdisp->gimage), REVERT_DATA_KEY,
query_box);
gtk_widget_show (query_box);
}
......@@ -277,7 +277,7 @@ file_revert_confirm_callback (GtkWidget *widget,
old_gimage = (GimpImage *) data;
gtk_object_set_data (GTK_OBJECT (old_gimage), REVERT_DATA_KEY, NULL);
g_object_set_data (G_OBJECT (old_gimage), REVERT_DATA_KEY, NULL);
if (revert)
{
......
......@@ -130,7 +130,7 @@ gradients_save_as_pov_query (GimpContainerEditor *editor)
gradient);
g_signal_connect_swapped (G_OBJECT (filesel->cancel_button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
G_CALLBACK (gtk_widget_destroy),
filesel);
g_signal_connect_swapped (G_OBJECT (filesel), "delete_event",
......
......@@ -209,10 +209,9 @@ image_resize_cmd_callback (GtkWidget *widget,
NULL,
image_resize);
gtk_signal_connect_object (GTK_OBJECT (image_resize->resize->resize_shell),
"destroy",
GTK_SIGNAL_FUNC (g_free),
(GtkObject *) image_resize);
g_object_weak_ref (G_OBJECT (image_resize->resize->resize_shell),
(GWeakNotify) g_free,
image_resize);
gtk_widget_show (image_resize->resize->resize_shell);
}
......@@ -246,10 +245,9 @@ image_scale_cmd_callback (GtkWidget *widget,
NULL,
image_scale);
gtk_signal_connect_object (GTK_OBJECT (image_scale->resize->resize_shell),
"destroy",
GTK_SIGNAL_FUNC (g_free),
(GtkObject *) image_scale);
g_object_weak_ref (G_OBJECT (image_scale->resize->resize_shell),
(GWeakNotify) g_free,
image_scale);
gtk_widget_show (image_scale->resize->resize_shell);
}
......
......@@ -174,8 +174,8 @@ select_shrink_cmd_callback (GtkWidget *widget,
/* eeek */
gtk_box_pack_start (GTK_BOX (g_list_nth_data (gtk_container_children (GTK_CONTAINER (GTK_DIALOG (shrink_dialog)->vbox)), 0)), edge_lock,
FALSE, FALSE, 0);
gtk_object_set_data (GTK_OBJECT (shrink_dialog), "edge_lock_toggle",
edge_lock);
g_object_set_data (G_OBJECT (shrink_dialog), "edge_lock_toggle",
edge_lock);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (edge_lock),
! selection_shrink_edge_lock);
gtk_widget_show (edge_lock);
......@@ -359,8 +359,8 @@ gimage_mask_shrink_callback (GtkWidget *widget,
radius_x = radius_y = selection_shrink_pixels;
selection_shrink_edge_lock =
! GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (widget),
"edge_lock_toggle"))->active;
! GTK_TOGGLE_BUTTON (g_object_get_data (G_OBJECT (widget),
"edge_lock_toggle"))->active;
if (unit != GIMP_UNIT_PIXEL)
{
......
......@@ -380,13 +380,12 @@ threshold_dialog_new (void)
spinbutton = gtk_spin_button_new (td->low_threshold_data, 1.0, 0);
gtk_widget_set_usize (spinbutton, 75, -1);
gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
gtk_widget_show (spinbutton);
g_signal_connect (G_OBJECT (td->low_threshold_data), "value_changed",
GTK_SIGNAL_FUNC (threshold_low_threshold_adjustment_update),
G_CALLBACK (threshold_low_threshold_adjustment_update),
td);
gtk_widget_show (spinbutton);
/* high threshold spinbutton */
data = gtk_adjustment_new (td->high_threshold, 0.0, 255.0, 1.0, 10.0, 0.0);
td->high_threshold_data = GTK_ADJUSTMENT (data);
......@@ -394,52 +393,47 @@ threshold_dialog_new (void)
spinbutton = gtk_spin_button_new (td->high_threshold_data, 1.0, 0);
gtk_widget_set_usize (spinbutton, 75, -1);
gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
gtk_widget_show (spinbutton);
g_signal_connect (G_OBJECT (td->high_threshold_data), "value_changed",
GTK_SIGNAL_FUNC (threshold_high_threshold_adjustment_update),
G_CALLBACK (threshold_high_threshold_adjustment_update),
td);
gtk_widget_show (spinbutton);
gtk_widget_show (hbox);
/* The threshold histogram */
hbox = gtk_hbox_new (TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, FALSE, 0);
gtk_widget_show (frame);
td->histogram = histogram_widget_new (HISTOGRAM_WIDTH, HISTOGRAM_HEIGHT);
gtk_container_add (GTK_CONTAINER (frame), GTK_WIDGET (td->histogram));
gtk_widget_show (GTK_WIDGET (td->histogram));
g_signal_connect (G_OBJECT (td->histogram), "range_changed",
GTK_SIGNAL_FUNC (threshold_histogram_range),
G_CALLBACK (threshold_histogram_range),
td);
gtk_widget_show (GTK_WIDGET(td->histogram));
gtk_widget_show (frame);
gtk_widget_show (hbox);
/* Horizontal box for preview */
hbox = gtk_hbox_new (FALSE, 4);
gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
/* The preview toggle */
toggle = gtk_check_button_new_with_label (_("Preview"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), td->preview);
gtk_box_pack_end (GTK_BOX (hbox), toggle, FALSE, FALSE, 0);
gtk_widget_show (toggle);
g_signal_connect (G_OBJECT (toggle), "toggled",
GTK_SIGNAL_FUNC (threshold_preview_update),
G_CALLBACK (threshold_preview_update),
td);
gtk_widget_show (toggle);
gtk_widget_show (hbox);
gtk_widget_show (vbox);
gtk_widget_show (td->shell);
......
......@@ -141,18 +141,18 @@ about_dialog_create (void)
gimp_help_connect (about_dialog, gimp_standard_help_func,
"dialogs/about.html");
gtk_signal_connect (GTK_OBJECT (about_dialog), "destroy",
GTK_SIGNAL_FUNC (about_dialog_destroy),
NULL);
gtk_signal_connect (GTK_OBJECT (about_dialog), "unmap_event",
GTK_SIGNAL_FUNC (about_dialog_unmap),
NULL);
gtk_signal_connect (GTK_OBJECT (about_dialog), "button_press_event",
GTK_SIGNAL_FUNC (about_dialog_button),
NULL);
gtk_signal_connect (GTK_OBJECT (about_dialog), "key_press_event",
GTK_SIGNAL_FUNC (about_dialog_key),
NULL);
g_signal_connect (G_OBJECT (about_dialog), "destroy",
G_CALLBACK (about_dialog_destroy),
NULL);
g_signal_connect (G_OBJECT (about_dialog), "unmap_event",
G_CALLBACK (about_dialog_unmap),
NULL);
g_signal_connect (G_OBJECT (about_dialog), "button_press_event",
G_CALLBACK (about_dialog_button),
NULL);
g_signal_connect (G_OBJECT (about_dialog), "key_press_event",
G_CALLBACK (about_dialog_key),
NULL);
/* dnd stuff */
gimp_gtk_drag_dest_set_by_type (about_dialog,
......@@ -185,15 +185,16 @@ about_dialog_create (void)
gtk_widget_show (aboutframe);
logo_area = gtk_drawing_area_new ();
gtk_signal_connect (GTK_OBJECT (logo_area), "expose_event",
GTK_SIGNAL_FUNC (about_dialog_logo_expose),
NULL);
gtk_drawing_area_size (GTK_DRAWING_AREA (logo_area),
logo_width, logo_height);
gtk_widget_set_events (logo_area, GDK_EXPOSURE_MASK);
gtk_container_add (GTK_CONTAINER (aboutframe), logo_area);
gtk_widget_show (logo_area);
g_signal_connect (G_OBJECT (logo_area), "expose_event",
G_CALLBACK (about_dialog_logo_expose),
NULL);
gtk_widget_realize (logo_area);
gdk_window_set_background (logo_area->window, &logo_area->style->black);
......
......@@ -334,8 +334,8 @@ color_notebook_new (const gchar *title,
show_alpha,
color_notebook_update_callback, csel,
&csel->selector_data);
gtk_object_set_data (GTK_OBJECT (csel->frame), "gimp_color_notebook",
csel);
g_object_set_data (G_OBJECT (csel->frame), "gimp_color_notebook",
csel);
if (cnp->notebook)
{
......
......@@ -181,9 +181,9 @@ convert_to_indexed (GimpImage *gimage)
gtk_radio_button_new_with_label (NULL, _("Generate Optimal Palette:"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (toggle));
gtk_box_pack_start (GTK_BOX (hbox), toggle, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
&(dialog->makepal_flag));
g_signal_connect (G_OBJECT (toggle), "toggled",
G_CALLBACK (gimp_toggle_button_update),
&(dialog->makepal_flag));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
dialog->makepal_flag);
gtk_widget_show (toggle);
......@@ -199,20 +199,21 @@ convert_to_indexed (GimpImage *gimage)
spinbutton = gimp_spin_button_new (&adjustment, dialog->num_cols,
2, 256, 1, 5, 0, 1, 0);
gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
&(dialog->num_cols));
gtk_box_pack_end (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
gtk_widget_show (spinbutton);
g_signal_connect (G_OBJECT (adjustment), "value_changed",
G_CALLBACK (gimp_int_adjustment_update),
&dialog->num_cols);
label = gtk_label_new (_("# of Colors:"));
gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
gtk_widget_set_sensitive (GTK_WIDGET (spinbutton), dialog->num_cols);
gtk_widget_set_sensitive (GTK_WIDGET (label), dialog->num_cols);
gtk_object_set_data (GTK_OBJECT (toggle), "set_sensitive", spinbutton);
gtk_object_set_data (GTK_OBJECT (spinbutton), "set_sensitive", label);
g_object_set_data (G_OBJECT (toggle), "set_sensitive", spinbutton);
g_object_set_data (G_OBJECT (spinbutton), "set_sensitive", label);
gtk_widget_show (hbox);
......@@ -230,29 +231,30 @@ convert_to_indexed (GimpImage *gimage)
toggle = gtk_check_button_new_with_label (_("Remove Unused Colors from Final Palette"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), dialog->remdups);
gtk_box_pack_start (GTK_BOX (hbox), toggle, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
&(dialog->remdups));
gtk_widget_show (toggle);
gtk_widget_show (hbox);
g_signal_connect (G_OBJECT (toggle), "toggled",
G_CALLBACK (gimp_toggle_button_update),
&dialog->remdups);
/* 'custom' palette from dialog */
hbox = gtk_hbox_new (FALSE, 4);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
toggle = gtk_radio_button_new_with_label (group, _("Use Custom Palette:"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (toggle));
gtk_box_pack_start (GTK_BOX (hbox), toggle, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
&(dialog->custompal_flag));
g_signal_connect (G_OBJECT (toggle), "toggled",
G_CALLBACK (gimp_toggle_button_update),
&dialog->custompal_flag);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
dialog->custompal_flag);
gtk_object_set_data (GTK_OBJECT (toggle), "set_sensitive", custom_frame);
g_object_set_data (G_OBJECT (toggle), "set_sensitive", custom_frame);
gtk_widget_show (toggle);
gtk_signal_connect (GTK_OBJECT (dialog->custom_palette_button), "clicked",
GTK_SIGNAL_FUNC (indexed_custom_palette_button_callback),
dialog);
g_signal_connect (G_OBJECT (dialog->custom_palette_button), "clicked",
G_CALLBACK (indexed_custom_palette_button_callback),
dialog);
gtk_box_pack_end (GTK_BOX (hbox), dialog->custom_palette_button, TRUE, TRUE, 0);
gtk_widget_show (dialog->custom_palette_button);
gtk_widget_show (hbox);
......@@ -261,9 +263,9 @@ convert_to_indexed (GimpImage *gimage)
dialog->custompal_flag);
gtk_widget_set_sensitive (GTK_WIDGET (dialog->custom_palette_button),
dialog->custompal_flag);
gtk_object_set_data (GTK_OBJECT (toggle), "set_sensitive", custom_frame);
gtk_object_set_data (GTK_OBJECT (custom_frame), "set_sensitive",
dialog->custom_palette_button);
g_object_set_data (G_OBJECT (toggle), "set_sensitive", custom_frame);
g_object_set_data (G_OBJECT (custom_frame), "set_sensitive",
dialog->custom_palette_button);
}
if (! UserHasWebPal)
......@@ -279,9 +281,9 @@ convert_to_indexed (GimpImage *gimage)
gtk_radio_button_new_with_label (group, _("Use WWW-Optimized Palette"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (toggle));
gtk_box_pack_start (GTK_BOX (hbox), toggle, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
&(dialog->webpal_flag));
g_signal_connect (G_OBJECT (toggle), "toggled",
G_CALLBACK (gimp_toggle_button_update),
&dialog->webpal_flag);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
dialog->webpal_flag);
gtk_widget_show (toggle);
......@@ -295,9 +297,9 @@ convert_to_indexed (GimpImage *gimage)
gtk_radio_button_new_with_label (group, _("Use Black/White (1-Bit) Palette"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (toggle));
gtk_box_pack_start (GTK_BOX (hbox), toggle, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
&(dialog->monopal_flag));
g_signal_connect (G_OBJECT (toggle), "toggled",
G_CALLBACK (gimp_toggle_button_update),
&dialog->monopal_flag);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
dialog->monopal_flag);
gtk_widget_show (toggle);
......@@ -319,9 +321,9 @@ convert_to_indexed (GimpImage *gimage)
toggle = gtk_radio_button_new_with_label (NULL, _("No Color Dithering"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (toggle));
gtk_box_pack_start (GTK_BOX (hbox), toggle, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
&(dialog->nodither_flag));
g_signal_connect (G_OBJECT (toggle), "toggled",
G_CALLBACK (gimp_toggle_button_update),
&dialog->nodither_flag);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
dialog->nodither_flag);
gtk_widget_show (toggle);
......@@ -333,9 +335,9 @@ convert_to_indexed (GimpImage *gimage)
toggle = gtk_radio_button_new_with_label (group, _("Positioned Color Dithering"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (toggle));
gtk_box_pack_start (GTK_BOX (hbox), toggle, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
&(dialog->fixeddither_flag));
g_signal_connect (G_OBJECT (toggle), "toggled",
G_CALLBACK (gimp_toggle_button_update),
&dialog->fixeddither_flag);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
dialog->fixeddither_flag);
gtk_widget_show (toggle);
......@@ -347,9 +349,9 @@ convert_to_indexed (GimpImage *gimage)
toggle = gtk_radio_button_new_with_label (group, _("Floyd-Steinberg Color Dithering (Reduced Color Bleeding)"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (toggle));
gtk_box_pack_start (GTK_BOX (hbox), toggle, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
&(dialog->fslowbleeddither_flag));
g_signal_connect (G_OBJECT (toggle), "toggled",
G_CALLBACK (gimp_toggle_button_update),
&dialog->fslowbleeddither_flag);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
dialog->fslowbleeddither_flag);
gtk_widget_show (toggle);
......@@ -360,9 +362,9 @@ convert_to_indexed (GimpImage *gimage)
toggle = gtk_radio_button_new_with_label (group, _("Floyd-Steinberg Color Dithering (Normal)"));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (toggle));
gtk_box_pack_start (GTK_BOX (hbox), toggle, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
&(dialog->fsdither_flag));
g_signal_connect (G_OBJECT (toggle), "toggled",
G_CALLBACK (gimp_toggle_button_update),
&dialog->fsdither_flag);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
dialog->fsdither_flag);
gtk_widget_show (toggle);
......@@ -375,9 +377,9 @@ convert_to_indexed (GimpImage *gimage)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
dialog->alphadither);
gtk_box_pack_start (GTK_BOX (hbox), toggle, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
&(dialog->alphadither));
g_signal_connect (G_OBJECT (toggle), "toggled",
G_CALLBACK (gimp_toggle_button_update),
&dialog->alphadither);
gtk_widget_show (toggle);
gtk_widget_show (hbox);
......@@ -623,13 +625,13 @@ indexed_custom_palette_button_callback (GtkWidget *widget,
palette_select_new (_("Select Custom Palette"),
GIMP_OBJECT (theCustomPalette)->name);
gtk_signal_connect (GTK_OBJECT (dialog->palette_select->shell), "destroy",
GTK_SIGNAL_FUNC (indexed_palette_select_destroy_callback),
dialog);
gtk_signal_connect (GTK_OBJECT (dialog->palette_select->context),
"palette_changed",
GTK_SIGNAL_FUNC (indexed_palette_select_palette),
dialog);
g_signal_connect (G_OBJECT (dialog->palette_select->shell), "destroy",
G_CALLBACK (indexed_palette_select_destroy_callback),
dialog);
g_signal_connect (G_OBJECT (dialog->palette_select->context),
"palette_changed",
G_CALLBACK (indexed_palette_select_palette),
dialog);
}
else
{
......
......@@ -46,7 +46,7 @@ file_dialog_show (GtkWidget *filesel)
gtk_widget_show (filesel);
}
void
gboolean
file_dialog_hide (GtkWidget *filesel)
{
gimp_dialog_hide (filesel);
......@@ -60,11 +60,14 @@ file_dialog_hide (GtkWidget *filesel)
menus_set_sensitive ("<Image>/File/Save as...", TRUE);
menus_set_sensitive ("<Image>/File/Save a Copy as...", TRUE);
}
/* return FALSE because we are used as "delete_event" handler */
return FALSE;
}
void
file_dialog_update_name (PlugInProcDef *proc,
GtkWidget *filesel)
file_dialog_update_name (PlugInProcDef *proc,
GtkFileSelection *filesel)
{
if (proc->extensions_list)
{
......@@ -72,7 +75,7 @@ file_dialog_update_name (PlugInProcDef *proc,
gchar *last_dot;
GString *s;
text = gtk_entry_get_text (GTK_ENTRY (GTK_FILE_SELECTION (filesel)->selection_entry));
text = gtk_entry_get_text (GTK_ENTRY (filesel->selection_entry));
last_dot = strrchr (text, '.');
if (last_dot == text || !text[0])
......@@ -86,7 +89,7 @@ file_dialog_update_name (PlugInProcDef *proc,
g_string_append (s, ".");
g_string_append (s, (gchar *) proc->extensions_list->data);
gtk_entry_set_text (GTK_ENTRY (GTK_FILE_SELECTION (filesel)->selection_entry), s->str);
gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), s->str);
g_string_free (s, TRUE);
}
......
......@@ -20,13 +20,13 @@
#define __FILE_DIALOG_UTILS_H__
void file_dialog_show (GtkWidget *filesel);
void file_dialog_hide (GtkWidget *filesel);
void file_dialog_show (GtkWidget *filesel);
gboolean file_dialog_hide (GtkWidget *filesel);
void file_dialog_update_name (PlugInProcDef *proc,
GtkWidget *filesel);
void file_dialog_update_menus (GSList *procs,
gint image_type);
void file_dialog_update_name (PlugInProcDef *proc,
GtkFileSelection *filesel);
void file_dialog_update_menus (GSList *procs,
gint image_type);
#endif /* __FILE_DIALOG_UTILS_H__ */
......@@ -206,25 +206,28 @@ file_open_with_proc_and_display (const gchar *filename,
static void
file_open_dialog_create (void)
{
GtkFileSelection *file_sel;
fileload = gtk_file_selection_new (_("Load Image"));
gtk_window_set_position (GTK_WINDOW (fileload), GTK_WIN_POS_MOUSE);
gtk_window_set_wmclass (GTK_WINDOW (fileload), "load_image", "Gimp");
file_sel = GTK_FILE_SELECTION (fileload);
gtk_container_set_border_width (GTK_CONTAINER (fileload), 2);
gtk_container_set_border_width
(GTK_CONTAINER (GTK_FILE_SELECTION (fileload)->button_area), 2);
gtk_signal_connect_object
(GTK_OBJECT (GTK_FILE_SELECTION (fileload)->cancel_button), "clicked",
GTK_SIGNAL_FUNC (file_dialog_hide),
GTK_OBJECT (fileload));
gtk_signal_connect (GTK_OBJECT (fileload), "delete_event",
GTK_SIGNAL_FUNC (file_dialog_hide),
NULL);
gtk_signal_connect
(GTK_OBJECT (GTK_FILE_SELECTION (fileload)->ok_button), "clicked",
GTK_SIGNAL_FUNC (file_open_ok_callback),
fileload);
gtk_container_set_border_width (GTK_CONTAINER (file_sel->button_area), 2);
g_signal_connect_swapped (G_OBJECT (file_sel->cancel_button), "clicked",
G_CALLBACK (file_dialog_hide),
fileload);
g_signal_connect (G_OBJECT (fileload), "delete_event",
G_CALLBACK (file_dialog_hide),
NULL);
g_signal_connect (G_OBJECT (file_sel->ok_button), "clicked",
G_CALLBACK (file_open_ok_callback),
fileload);
gtk_quit_add_destroy (1, GTK_OBJECT (fileload));
gtk_clist_set_selection_mode
......@@ -232,10 +235,9 @@ file_open_dialog_create (void)
GTK_SELECTION_EXTENDED);
/* Catch file-clist clicks so we can update the preview thumbnail */
gtk_signal_connect
(GTK_OBJECT (GTK_FILE_SELECTION (fileload)->file_list), "select_row",
GTK_SIGNAL_FUNC (file_open_clistrow_callback),
fileload);
g_signal_connect (G_OBJECT (file_sel->file_list), "select_row",
G_CALLBACK (file_open_clistrow_callback),
fileload);
/* Connect the "F1" help key */
gimp_help_connect (fileload,
......@@ -289,13 +291,14 @@ file_open_dialog_create (void)
gtk_widget_show (hbox);
open_options_genbutton = gtk_button_new ();
gtk_signal_connect (GTK_OBJECT (open_options_genbutton), "clicked",
GTK_SIGNAL_FUNC (file_open_genbutton_callback),
fileload);
gtk_box_pack_start (GTK_BOX (hbox), open_options_genbutton,
TRUE, FALSE, 0);
gtk_widget_show (open_options_genbutton);