diff --git a/.cvsignore b/.cvsignore index f4ce062cc3..b83c05b72d 100644 --- a/.cvsignore +++ b/.cvsignore @@ -15,7 +15,7 @@ config.status libtool aclocal.m4 gimprc_user -gimptool +gimptool-1.4 intl config.h.in stamp-h.in diff --git a/ChangeLog b/ChangeLog index 7be3169cf4..37474912fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,31 @@ +2001-02-19 Michael Natterer + + * gimp.m4 + * gimptool.in: removed. + + * gimp-1.4.m4 + * gimptool-1.4.in: added modified versions. gimp-1.4.m4 is untested. + The m4 macro is now called AM_PATH_GIMP_1_4() + + * .cvsignore + * Makefile.am + * configure.in: changed accordingly. + + * libgimp/Makefile.am + * libgimpcolor/Makefile.am + * libgimpmath/Makefile.am + * libgimpwidgets/Makefile.am: install the header files in + $includedir/gimp-MAJOR.MINOR/ + + * app/brush_edit.c: increased toplevel container border size to 4. + + * app/gimpdatafactoryview.c: don't generate multiple "copy"s when + duplicating data objects. + + * app/gradient_editor.c: cleaned up the GUI. + + * app/lc_dialog.c: removed the "Close" button. + 2001-02-18 Michael Natterer * app/gimpdnd.[ch]: added DND source functions which work by diff --git a/Makefile.am b/Makefile.am index a5e3975508..25a0c22a48 100644 --- a/Makefile.am +++ b/Makefile.am @@ -24,7 +24,7 @@ SUBDIRS = \ devel-docs \ build -bin_SCRIPTS = gimptool @GIMPINSTALL@ +bin_SCRIPTS = gimptool-1.4 @GIMPINSTALL@ EXTRA_SCRIPTS = gimpinstall @@ -46,7 +46,7 @@ EXTRA_DIST = \ user_install \ user_install.bat \ ps-menurc \ - gimp.m4 \ + gimp-1.4.m4 \ gimprc.win32 \ config.h.win32 @@ -67,7 +67,7 @@ gimpdata_SCRIPTS = user_install man_MANS = gimp.1 gimptool.1 gimp-remote.1 gimprc.5 m4datadir = $(datadir)/aclocal -m4data_DATA = gimp.m4 +m4data_DATA = gimp-1.4.m4 scriptdata = @@ -76,11 +76,11 @@ gimpinstall: install-exec-local: cd $(DESTDIR)$(bindir) \ - && rm -f gimp-config \ - && $(LN_S) gimptool gimp-config + && rm -f gimp-config-1.4 \ + && $(LN_S) gimptool-1.4 gimp-config-1.4 uninstall-local: - rm -f $(DESTDIR)$(bindir)/gimp-config + rm -f $(DESTDIR)$(bindir)/gimp-config-1.4 .PHONY: files populate checkin release diff --git a/app/brush_edit.c b/app/brush_edit.c index 456fd5c905..60b89f9812 100644 --- a/app/brush_edit.c +++ b/app/brush_edit.c @@ -104,7 +104,7 @@ brush_edit_generated_new (void) gtk_widget_hide (GTK_DIALOG (begw->shell)->action_area); vbox = gtk_vbox_new (FALSE, 1); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 2); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_container_add (GTK_CONTAINER (GTK_DIALOG (begw->shell)->vbox), vbox); /* Brush's name */ diff --git a/app/gimpdatafactoryview.c b/app/gimpdatafactoryview.c index 9567e20807..c85ea43cb8 100644 --- a/app/gimpdatafactoryview.c +++ b/app/gimpdatafactoryview.c @@ -18,8 +18,12 @@ #include "config.h" +#include +#include + #include +#include "libgimpmath/gimpmath.h" #include "libgimpwidgets/gimpwidgets.h" #include "apptypes.h" @@ -377,13 +381,33 @@ gimp_data_factory_view_duplicate_clicked (GtkWidget *widget, if (new_data) { - gchar *name; + const gchar *name; + gchar *ext; + gint copy_len; + gint number; + gchar *new_name; - name = g_strdup_printf (_("%s copy"), GIMP_OBJECT (data)->name); + name = gimp_object_get_name (GIMP_OBJECT (data)); - gimp_object_set_name (GIMP_OBJECT (new_data), name); + ext = strrchr (name, '#'); + copy_len = strlen (_("copy")); - g_free (name); + if ((strlen (name) >= copy_len && + strcmp (&name[strlen (name) - copy_len], _("copy")) == 0) || + (ext && (number = atoi (ext + 1)) > 0 && + ((gint) (log10 (number) + 1)) == strlen (ext + 1))) + { + /* don't have redundant "copy"s */ + new_name = g_strdup (name); + } + else + { + new_name = g_strdup_printf (_("%s copy"), name); + } + + gimp_object_set_name (GIMP_OBJECT (new_data), new_name); + + g_free (new_name); gimp_container_add (view->factory->container, GIMP_OBJECT (new_data)); diff --git a/app/gradient_editor.c b/app/gradient_editor.c index c35c59e5fb..486b48693e 100644 --- a/app/gradient_editor.c +++ b/app/gradient_editor.c @@ -535,6 +535,7 @@ gradient_editor_new (void) GtkWidget *main_vbox; GtkWidget *hbox; GtkWidget *vbox; + GtkWidget *vbox2; GtkWidget *button; GtkWidget *frame; gint i; @@ -560,19 +561,19 @@ gradient_editor_new (void) NULL); - gtk_widget_hide (GTK_WIDGET (g_list_nth_data (gtk_container_children (GTK_CONTAINER (GTK_DIALOG (gradient_editor->shell)->vbox)), 0))); - - gtk_widget_hide (GTK_DIALOG (gradient_editor->shell)->action_area); - main_vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 4); gtk_container_add (GTK_CONTAINER (GTK_DIALOG (gradient_editor->shell)->vbox), main_vbox); gtk_widget_show (main_vbox); + vbox = gtk_vbox_new (FALSE, 1); + gtk_box_pack_start (GTK_BOX (main_vbox), vbox, TRUE, TRUE, 0); + gtk_widget_show (vbox); + /* Gradient's name */ gradient_editor->name = gtk_entry_new (); - gtk_box_pack_start (GTK_BOX (main_vbox), gradient_editor->name, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox), gradient_editor->name, TRUE, TRUE, 0); gtk_widget_show (gradient_editor->name); gtk_signal_connect (GTK_OBJECT (gradient_editor->name), "activate", @@ -582,99 +583,15 @@ gradient_editor_new (void) GTK_SIGNAL_FUNC (gradient_editor_name_focus_out), gradient_editor); - /* Horizontal box for zoom controls, scrollbar and instant update toggle */ - hbox = gtk_hbox_new (FALSE, 4); - gtk_container_set_border_width (GTK_CONTAINER (hbox), 0); - gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0); - gtk_widget_show (hbox); - - /* Save as POV-Ray button */ - button = gtk_button_new_with_label (_("Save as POV-Ray")); - gimp_help_set_help_data (button, NULL, - "dialogs/gradient_editor/save_as_povray.html"); - gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0); - gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); - gtk_widget_show (button); - - GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); - - gtk_signal_connect (GTK_OBJECT (button), "clicked", - GTK_SIGNAL_FUNC (ed_save_pov_callback), - gradient_editor); - - /* Zoom all button */ - button = gtk_button_new_with_label (_("Zoom all")); - gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0); - gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); - gtk_widget_show (button); - - GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); - - gtk_signal_connect (GTK_OBJECT (button), "clicked", - GTK_SIGNAL_FUNC (ed_zoom_all_callback), - gradient_editor); - - /* + and - buttons */ - gtk_widget_realize (gradient_editor->shell); - - button = gimp_pixmap_button_new (zoom_in_xpm, NULL); - GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); - gtk_signal_connect (GTK_OBJECT (button), "clicked", - GTK_SIGNAL_FUNC (ed_zoom_in_callback), - gradient_editor); - gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); - gtk_widget_show (button); - - button = gimp_pixmap_button_new (zoom_out_xpm, NULL); - GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); - gtk_signal_connect (GTK_OBJECT (button), "clicked", - GTK_SIGNAL_FUNC (ed_zoom_out_callback), - gradient_editor); - gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); - gtk_widget_show (button); - - /* Scrollbar */ - gradient_editor->zoom_factor = 1; - - gradient_editor->scroll_data = gtk_adjustment_new (0.0, 0.0, 1.0, - 1.0 * GRAD_SCROLLBAR_STEP_SIZE, - 1.0 * GRAD_SCROLLBAR_PAGE_SIZE, - 1.0); - - gtk_signal_connect (gradient_editor->scroll_data, "value_changed", - GTK_SIGNAL_FUNC (ed_scrollbar_update), - gradient_editor); - gtk_signal_connect (gradient_editor->scroll_data, "changed", - GTK_SIGNAL_FUNC (ed_scrollbar_update), - gradient_editor); - - gradient_editor->scrollbar = - gtk_hscrollbar_new (GTK_ADJUSTMENT (gradient_editor->scroll_data)); - gtk_range_set_update_policy (GTK_RANGE (gradient_editor->scrollbar), - GTK_UPDATE_CONTINUOUS); - gtk_box_pack_start (GTK_BOX (hbox), gradient_editor->scrollbar, TRUE, TRUE, 0); - gtk_widget_hide (gradient_editor->scrollbar); - - /* Instant update toggle */ - gradient_editor->instant_update = TRUE; - - button = gtk_check_button_new_with_label (_("Instant update")); - gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); - gtk_signal_connect (GTK_OBJECT (button), "toggled", - GTK_SIGNAL_FUNC (ed_instant_update_update), - gradient_editor); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); - gtk_widget_show (button); - /* Frame for gradient preview and gradient control */ frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); - gtk_box_pack_start (GTK_BOX (main_vbox), frame, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); gtk_widget_show (frame); - vbox = gtk_vbox_new (FALSE, 0); - gtk_container_add (GTK_CONTAINER (frame), vbox); - gtk_widget_show (vbox); + vbox2 = gtk_vbox_new (FALSE, 0); + gtk_container_add (GTK_CONTAINER (frame), vbox2); + gtk_widget_show (vbox2); /* Gradient preview */ gradient_editor->preview_rows[0] = NULL; @@ -706,7 +623,7 @@ gradient_editor_new (void) gradient_editor_drop_gradient, gradient_editor); - gtk_box_pack_start (GTK_BOX (vbox), gradient_editor->preview, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox2), gradient_editor->preview, TRUE, TRUE, 0); gtk_widget_show (gradient_editor->preview); /* Gradient control */ @@ -762,13 +679,106 @@ gradient_editor_new (void) gtk_signal_connect (GTK_OBJECT (gradient_editor->control), "event", GTK_SIGNAL_FUNC (control_events), gradient_editor); - gtk_box_pack_start (GTK_BOX (vbox), gradient_editor->control, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox2), gradient_editor->control, + FALSE, FALSE, 0); gtk_widget_show (gradient_editor->control); - /* Hint bar and close button */ + /* Scrollbar */ + gradient_editor->zoom_factor = 1; + + gradient_editor->scroll_data = + gtk_adjustment_new (0.0, 0.0, 1.0, + 1.0 * GRAD_SCROLLBAR_STEP_SIZE, + 1.0 * GRAD_SCROLLBAR_PAGE_SIZE, + 1.0); + + gtk_signal_connect (gradient_editor->scroll_data, "value_changed", + GTK_SIGNAL_FUNC (ed_scrollbar_update), + gradient_editor); + gtk_signal_connect (gradient_editor->scroll_data, "changed", + GTK_SIGNAL_FUNC (ed_scrollbar_update), + gradient_editor); + + gradient_editor->scrollbar = + gtk_hscrollbar_new (GTK_ADJUSTMENT (gradient_editor->scroll_data)); + gtk_range_set_update_policy (GTK_RANGE (gradient_editor->scrollbar), + GTK_UPDATE_CONTINUOUS); + gtk_box_pack_start (GTK_BOX (vbox), gradient_editor->scrollbar, + FALSE, FALSE, 0); + gtk_widget_show (gradient_editor->scrollbar); + + /* Horizontal box for name, zoom controls and instant update toggle */ + hbox = gtk_hbox_new (FALSE, 4); + gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0); + gtk_widget_show (hbox); + + /* Save as POV-Ray button */ + button = gtk_button_new_with_label (_("Save as POV-Ray")); + gimp_help_set_help_data (button, NULL, + "dialogs/gradient_editor/save_as_povray.html"); + gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); + + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (ed_save_pov_callback), + gradient_editor); + + /* + and - buttons */ + gtk_widget_realize (gradient_editor->shell); + + button = gimp_pixmap_button_new (zoom_out_xpm, NULL); + GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); + gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (ed_zoom_out_callback), + gradient_editor); + + button = gimp_pixmap_button_new (zoom_in_xpm, NULL); + GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); + gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (ed_zoom_in_callback), + gradient_editor); + + /* Zoom all button */ + button = gtk_button_new_with_label (_("Zoom all")); + gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0); + gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); + + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (ed_zoom_all_callback), + gradient_editor); + + /* Instant update toggle */ + gradient_editor->instant_update = TRUE; + + button = gtk_check_button_new_with_label (_("Instant update")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); + gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + gtk_signal_connect (GTK_OBJECT (button), "toggled", + GTK_SIGNAL_FUNC (ed_instant_update_update), + gradient_editor); + + /* Hint bar */ + hbox = GTK_DIALOG (gradient_editor->shell)->action_area; + gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); + gtk_box_set_homogeneous (GTK_BOX (hbox), FALSE); + gradient_editor->hint_label = gtk_label_new (""); gtk_misc_set_alignment (GTK_MISC (gradient_editor->hint_label), 0.0, 0.5); - gtk_box_pack_start (GTK_BOX (main_vbox), gradient_editor->hint_label, + gtk_box_pack_start (GTK_BOX (hbox), gradient_editor->hint_label, FALSE, FALSE, 0); gtk_widget_show (gradient_editor->hint_label); @@ -1150,8 +1160,6 @@ ed_zoom_all_callback (GtkWidget *widget, gradient_editor->zoom_factor = 1; - gtk_widget_hide (gradient_editor->scrollbar); - adjustment->value = 0.0; adjustment->page_size = 1.0; adjustment->step_increment = 1.0 * GRAD_SCROLLBAR_STEP_SIZE; @@ -1180,11 +1188,6 @@ ed_zoom_out_callback (GtkWidget *widget, gradient_editor->zoom_factor--; - if (gradient_editor->zoom_factor==1) - gtk_widget_hide (gradient_editor->scrollbar); - else - gtk_widget_show (gradient_editor->scrollbar); - page_size = 1.0 / gradient_editor->zoom_factor; value = old_value - (page_size - old_page_size) / 2.0; @@ -1225,7 +1228,6 @@ ed_zoom_in_callback (GtkWidget *widget, adjustment->page_increment = page_size * GRAD_SCROLLBAR_PAGE_SIZE; gtk_adjustment_changed (GTK_ADJUSTMENT (gradient_editor->scroll_data)); - gtk_widget_show (gradient_editor->scrollbar); } static void @@ -1631,6 +1633,9 @@ control_events (GtkWidget *widget, if ((time - gradient_editor->control_click_time) >= GRAD_MOVE_TIME) { + if (! gradient_editor->instant_update) + gimp_data_dirty (GIMP_DATA (gradient)); + ed_update_editor (gradient_editor, GRAD_UPDATE_GRADIENT); /* Possible move */ } @@ -2040,13 +2045,17 @@ control_motion (GradientEditor *gradient_editor, if (str) g_free (str); - gimp_data_dirty (GIMP_DATA (gradient)); - if (gradient_editor->instant_update) - ed_update_editor (gradient_editor, - GRAD_UPDATE_GRADIENT | GRAD_UPDATE_CONTROL); + { + gimp_data_dirty (GIMP_DATA (gradient)); + + ed_update_editor (gradient_editor, + GRAD_UPDATE_GRADIENT | GRAD_UPDATE_CONTROL); + } else - ed_update_editor (gradient_editor, GRAD_UPDATE_CONTROL); + { + ed_update_editor (gradient_editor, GRAD_UPDATE_CONTROL); + } } static void diff --git a/app/gui/brush-editor.c b/app/gui/brush-editor.c index 456fd5c905..60b89f9812 100644 --- a/app/gui/brush-editor.c +++ b/app/gui/brush-editor.c @@ -104,7 +104,7 @@ brush_edit_generated_new (void) gtk_widget_hide (GTK_DIALOG (begw->shell)->action_area); vbox = gtk_vbox_new (FALSE, 1); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 2); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_container_add (GTK_CONTAINER (GTK_DIALOG (begw->shell)->vbox), vbox); /* Brush's name */ diff --git a/app/gui/gradient-editor.c b/app/gui/gradient-editor.c index c35c59e5fb..486b48693e 100644 --- a/app/gui/gradient-editor.c +++ b/app/gui/gradient-editor.c @@ -535,6 +535,7 @@ gradient_editor_new (void) GtkWidget *main_vbox; GtkWidget *hbox; GtkWidget *vbox; + GtkWidget *vbox2; GtkWidget *button; GtkWidget *frame; gint i; @@ -560,19 +561,19 @@ gradient_editor_new (void) NULL); - gtk_widget_hide (GTK_WIDGET (g_list_nth_data (gtk_container_children (GTK_CONTAINER (GTK_DIALOG (gradient_editor->shell)->vbox)), 0))); - - gtk_widget_hide (GTK_DIALOG (gradient_editor->shell)->action_area); - main_vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 4); gtk_container_add (GTK_CONTAINER (GTK_DIALOG (gradient_editor->shell)->vbox), main_vbox); gtk_widget_show (main_vbox); + vbox = gtk_vbox_new (FALSE, 1); + gtk_box_pack_start (GTK_BOX (main_vbox), vbox, TRUE, TRUE, 0); + gtk_widget_show (vbox); + /* Gradient's name */ gradient_editor->name = gtk_entry_new (); - gtk_box_pack_start (GTK_BOX (main_vbox), gradient_editor->name, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox), gradient_editor->name, TRUE, TRUE, 0); gtk_widget_show (gradient_editor->name); gtk_signal_connect (GTK_OBJECT (gradient_editor->name), "activate", @@ -582,99 +583,15 @@ gradient_editor_new (void) GTK_SIGNAL_FUNC (gradient_editor_name_focus_out), gradient_editor); - /* Horizontal box for zoom controls, scrollbar and instant update toggle */ - hbox = gtk_hbox_new (FALSE, 4); - gtk_container_set_border_width (GTK_CONTAINER (hbox), 0); - gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0); - gtk_widget_show (hbox); - - /* Save as POV-Ray button */ - button = gtk_button_new_with_label (_("Save as POV-Ray")); - gimp_help_set_help_data (button, NULL, - "dialogs/gradient_editor/save_as_povray.html"); - gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0); - gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); - gtk_widget_show (button); - - GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); - - gtk_signal_connect (GTK_OBJECT (button), "clicked", - GTK_SIGNAL_FUNC (ed_save_pov_callback), - gradient_editor); - - /* Zoom all button */ - button = gtk_button_new_with_label (_("Zoom all")); - gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0); - gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); - gtk_widget_show (button); - - GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); - - gtk_signal_connect (GTK_OBJECT (button), "clicked", - GTK_SIGNAL_FUNC (ed_zoom_all_callback), - gradient_editor); - - /* + and - buttons */ - gtk_widget_realize (gradient_editor->shell); - - button = gimp_pixmap_button_new (zoom_in_xpm, NULL); - GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); - gtk_signal_connect (GTK_OBJECT (button), "clicked", - GTK_SIGNAL_FUNC (ed_zoom_in_callback), - gradient_editor); - gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); - gtk_widget_show (button); - - button = gimp_pixmap_button_new (zoom_out_xpm, NULL); - GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); - gtk_signal_connect (GTK_OBJECT (button), "clicked", - GTK_SIGNAL_FUNC (ed_zoom_out_callback), - gradient_editor); - gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); - gtk_widget_show (button); - - /* Scrollbar */ - gradient_editor->zoom_factor = 1; - - gradient_editor->scroll_data = gtk_adjustment_new (0.0, 0.0, 1.0, - 1.0 * GRAD_SCROLLBAR_STEP_SIZE, - 1.0 * GRAD_SCROLLBAR_PAGE_SIZE, - 1.0); - - gtk_signal_connect (gradient_editor->scroll_data, "value_changed", - GTK_SIGNAL_FUNC (ed_scrollbar_update), - gradient_editor); - gtk_signal_connect (gradient_editor->scroll_data, "changed", - GTK_SIGNAL_FUNC (ed_scrollbar_update), - gradient_editor); - - gradient_editor->scrollbar = - gtk_hscrollbar_new (GTK_ADJUSTMENT (gradient_editor->scroll_data)); - gtk_range_set_update_policy (GTK_RANGE (gradient_editor->scrollbar), - GTK_UPDATE_CONTINUOUS); - gtk_box_pack_start (GTK_BOX (hbox), gradient_editor->scrollbar, TRUE, TRUE, 0); - gtk_widget_hide (gradient_editor->scrollbar); - - /* Instant update toggle */ - gradient_editor->instant_update = TRUE; - - button = gtk_check_button_new_with_label (_("Instant update")); - gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); - gtk_signal_connect (GTK_OBJECT (button), "toggled", - GTK_SIGNAL_FUNC (ed_instant_update_update), - gradient_editor); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); - gtk_widget_show (button); - /* Frame for gradient preview and gradient control */ frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); - gtk_box_pack_start (GTK_BOX (main_vbox), frame, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); gtk_widget_show (frame); - vbox = gtk_vbox_new (FALSE, 0); - gtk_container_add (GTK_CONTAINER (frame), vbox); - gtk_widget_show (vbox); + vbox2 = gtk_vbox_new (FALSE, 0); + gtk_container_add (GTK_CONTAINER (frame), vbox2); + gtk_widget_show (vbox2); /* Gradient preview */ gradient_editor->preview_rows[0] = NULL; @@ -706,7 +623,7 @@ gradient_editor_new (void) gradient_editor_drop_gradient, gradient_editor); - gtk_box_pack_start (GTK_BOX (vbox), gradient_editor->preview, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox2), gradient_editor->preview, TRUE, TRUE, 0); gtk_widget_show (gradient_editor->preview); /* Gradient control */ @@ -762,13 +679,106 @@ gradient_editor_new (void) gtk_signal_connect (GTK_OBJECT (gradient_editor->control), "event", GTK_SIGNAL_FUNC (control_events), gradient_editor); - gtk_box_pack_start (GTK_BOX (vbox), gradient_editor->control, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox2), gradient_editor->control, + FALSE, FALSE, 0); gtk_widget_show (gradient_editor->control); - /* Hint bar and close button */ + /* Scrollbar */ + gradient_editor->zoom_factor = 1; + + gradient_editor->scroll_data = + gtk_adjustment_new (0.0, 0.0, 1.0, + 1.0 * GRAD_SCROLLBAR_STEP_SIZE, + 1.0 * GRAD_SCROLLBAR_PAGE_SIZE, + 1.0); + + gtk_signal_connect (gradient_editor->scroll_data, "value_changed", + GTK_SIGNAL_FUNC (ed_scrollbar_update), + gradient_editor); + gtk_signal_connect (gradient_editor->scroll_data, "changed", + GTK_SIGNAL_FUNC (ed_scrollbar_update), + gradient_editor); + + gradient_editor->scrollbar = + gtk_hscrollbar_new (GTK_ADJUSTMENT (gradient_editor->scroll_data)); + gtk_range_set_update_policy (GTK_RANGE (gradient_editor->scrollbar), + GTK_UPDATE_CONTINUOUS); + gtk_box_pack_start (GTK_BOX (vbox), gradient_editor->scrollbar, + FALSE, FALSE, 0); + gtk_widget_show (gradient_editor->scrollbar); + + /* Horizontal box for name, zoom controls and instant update toggle */ + hbox = gtk_hbox_new (FALSE, 4); + gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0); + gtk_widget_show (hbox); + + /* Save as POV-Ray button */ + button = gtk_button_new_with_label (_("Save as POV-Ray")); + gimp_help_set_help_data (button, NULL, + "dialogs/gradient_editor/save_as_povray.html"); + gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); + + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (ed_save_pov_callback), + gradient_editor); + + /* + and - buttons */ + gtk_widget_realize (gradient_editor->shell); + + button = gimp_pixmap_button_new (zoom_out_xpm, NULL); + GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); + gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (ed_zoom_out_callback), + gradient_editor); + + button = gimp_pixmap_button_new (zoom_in_xpm, NULL); + GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); + gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (ed_zoom_in_callback), + gradient_editor); + + /* Zoom all button */ + button = gtk_button_new_with_label (_("Zoom all")); + gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0); + gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); + + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (ed_zoom_all_callback), + gradient_editor); + + /* Instant update toggle */ + gradient_editor->instant_update = TRUE; + + button = gtk_check_button_new_with_label (_("Instant update")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); + gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + gtk_signal_connect (GTK_OBJECT (button), "toggled", + GTK_SIGNAL_FUNC (ed_instant_update_update), + gradient_editor); + + /* Hint bar */ + hbox = GTK_DIALOG (gradient_editor->shell)->action_area; + gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); + gtk_box_set_homogeneous (GTK_BOX (hbox), FALSE); + gradient_editor->hint_label = gtk_label_new (""); gtk_misc_set_alignment (GTK_MISC (gradient_editor->hint_label), 0.0, 0.5); - gtk_box_pack_start (GTK_BOX (main_vbox), gradient_editor->hint_label, + gtk_box_pack_start (GTK_BOX (hbox), gradient_editor->hint_label, FALSE, FALSE, 0); gtk_widget_show (gradient_editor->hint_label); @@ -1150,8 +1160,6 @@ ed_zoom_all_callback (GtkWidget *widget, gradient_editor->zoom_factor = 1; - gtk_widget_hide (gradient_editor->scrollbar); - adjustment->value = 0.0; adjustment->page_size = 1.0; adjustment->step_increment = 1.0 * GRAD_SCROLLBAR_STEP_SIZE; @@ -1180,11 +1188,6 @@ ed_zoom_out_callback (GtkWidget *widget, gradient_editor->zoom_factor--; - if (gradient_editor->zoom_factor==1) - gtk_widget_hide (gradient_editor->scrollbar); - else - gtk_widget_show (gradient_editor->scrollbar); - page_size = 1.0 / gradient_editor->zoom_factor; value = old_value - (page_size - old_page_size) / 2.0; @@ -1225,7 +1228,6 @@ ed_zoom_in_callback (GtkWidget *widget, adjustment->page_increment = page_size * GRAD_SCROLLBAR_PAGE_SIZE; gtk_adjustment_changed (GTK_ADJUSTMENT (gradient_editor->scroll_data)); - gtk_widget_show (gradient_editor->scrollbar); } static void @@ -1631,6 +1633,9 @@ control_events (GtkWidget *widget, if ((time - gradient_editor->control_click_time) >= GRAD_MOVE_TIME) { + if (! gradient_editor->instant_update) + gimp_data_dirty (GIMP_DATA (gradient)); + ed_update_editor (gradient_editor, GRAD_UPDATE_GRADIENT); /* Possible move */ } @@ -2040,13 +2045,17 @@ control_motion (GradientEditor *gradient_editor, if (str) g_free (str); - gimp_data_dirty (GIMP_DATA (gradient)); - if (gradient_editor->instant_update) - ed_update_editor (gradient_editor, - GRAD_UPDATE_GRADIENT | GRAD_UPDATE_CONTROL); + { + gimp_data_dirty (GIMP_DATA (gradient)); + + ed_update_editor (gradient_editor, + GRAD_UPDATE_GRADIENT | GRAD_UPDATE_CONTROL); + } else - ed_update_editor (gradient_editor, GRAD_UPDATE_CONTROL); + { + ed_update_editor (gradient_editor, GRAD_UPDATE_CONTROL); + } } static void diff --git a/app/lc_dialog.c b/app/lc_dialog.c index 9d8b0e2dbd..491986616a 100644 --- a/app/lc_dialog.c +++ b/app/lc_dialog.c @@ -97,7 +97,6 @@ lc_dialog_create (GimpImage *gimage) { GtkWidget *util_box; GtkWidget *auto_button; - GtkWidget *button; GtkWidget *label; GtkWidget *separator; gint default_index; @@ -121,25 +120,31 @@ lc_dialog_create (GimpImage *gimage) return; } - lc_dialog = g_new (LCDialog, 1); - lc_dialog->shell = - gimp_dialog_new (_("Layers, Channels & Paths"), "layers_channels_paths", - lc_dialog_help_func, - "dialogs/layers_and_channels.html", - GTK_WIN_POS_NONE, - FALSE, TRUE, FALSE, - NULL); - lc_dialog->gimage = NULL; + lc_dialog = g_new0 (LCDialog, 1); + + lc_dialog->gimage = NULL; lc_dialog->auto_follow_active = TRUE; + lc_dialog->shell = gimp_dialog_new (_("Layers, Channels & Paths"), + "layers_channels_paths", + lc_dialog_help_func, + "dialogs/layers_and_channels.html", + GTK_WIN_POS_NONE, + FALSE, TRUE, FALSE, + + "_delete_event_", lc_dialog_close_callback, + lc_dialog, NULL, NULL, TRUE, TRUE, + + NULL); + + gtk_widget_hide (GTK_WIDGET (g_list_nth_data (gtk_container_children (GTK_CONTAINER (GTK_DIALOG (lc_dialog->shell)->vbox)), 0))); + + gtk_widget_hide (GTK_DIALOG (lc_dialog->shell)->action_area); + /* Register the dialog */ dialog_register (lc_dialog->shell); session_set_window_geometry (lc_dialog->shell, &lc_dialog_session_info, TRUE); - /* Handle the WM delete event */ - gtk_signal_connect (GTK_OBJECT (lc_dialog->shell), "delete_event", - GTK_SIGNAL_FUNC (lc_dialog_close_callback), NULL); - /* The toplevel vbox */ lc_dialog->subshell = gtk_vbox_new (FALSE, 1); gtk_container_add (GTK_CONTAINER (GTK_DIALOG (lc_dialog->shell)->vbox), @@ -218,15 +223,6 @@ lc_dialog_create (GimpImage *gimage) gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (lc_dialog->shell)->action_area), 1); - /* The close button */ - button = gtk_button_new_with_label (_("Close")); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (lc_dialog->shell)->action_area), - button, TRUE, TRUE, 0); - gtk_signal_connect (GTK_OBJECT (button), "clicked", - (GtkSignalFunc) lc_dialog_close_callback, - lc_dialog->shell); - gtk_widget_show (button); - /* Make sure the channels page is realized */ gtk_notebook_set_page (GTK_NOTEBOOK (lc_dialog->notebook), 1); gtk_notebook_set_page (GTK_NOTEBOOK (lc_dialog->notebook), 0); diff --git a/app/widgets/gimpbrusheditor.c b/app/widgets/gimpbrusheditor.c index 456fd5c905..60b89f9812 100644 --- a/app/widgets/gimpbrusheditor.c +++ b/app/widgets/gimpbrusheditor.c @@ -104,7 +104,7 @@ brush_edit_generated_new (void) gtk_widget_hide (GTK_DIALOG (begw->shell)->action_area); vbox = gtk_vbox_new (FALSE, 1); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 2); + gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_container_add (GTK_CONTAINER (GTK_DIALOG (begw->shell)->vbox), vbox); /* Brush's name */ diff --git a/app/widgets/gimpdatafactoryview.c b/app/widgets/gimpdatafactoryview.c index 9567e20807..c85ea43cb8 100644 --- a/app/widgets/gimpdatafactoryview.c +++ b/app/widgets/gimpdatafactoryview.c @@ -18,8 +18,12 @@ #include "config.h" +#include +#include + #include +#include "libgimpmath/gimpmath.h" #include "libgimpwidgets/gimpwidgets.h" #include "apptypes.h" @@ -377,13 +381,33 @@ gimp_data_factory_view_duplicate_clicked (GtkWidget *widget, if (new_data) { - gchar *name; + const gchar *name; + gchar *ext; + gint copy_len; + gint number; + gchar *new_name; - name = g_strdup_printf (_("%s copy"), GIMP_OBJECT (data)->name); + name = gimp_object_get_name (GIMP_OBJECT (data)); - gimp_object_set_name (GIMP_OBJECT (new_data), name); + ext = strrchr (name, '#'); + copy_len = strlen (_("copy")); - g_free (name); + if ((strlen (name) >= copy_len && + strcmp (&name[strlen (name) - copy_len], _("copy")) == 0) || + (ext && (number = atoi (ext + 1)) > 0 && + ((gint) (log10 (number) + 1)) == strlen (ext + 1))) + { + /* don't have redundant "copy"s */ + new_name = g_strdup (name); + } + else + { + new_name = g_strdup_printf (_("%s copy"), name); + } + + gimp_object_set_name (GIMP_OBJECT (new_data), new_name); + + g_free (new_name); gimp_container_add (view->factory->container, GIMP_OBJECT (new_data)); diff --git a/app/widgets/gimpgradienteditor.c b/app/widgets/gimpgradienteditor.c index c35c59e5fb..486b48693e 100644 --- a/app/widgets/gimpgradienteditor.c +++ b/app/widgets/gimpgradienteditor.c @@ -535,6 +535,7 @@ gradient_editor_new (void) GtkWidget *main_vbox; GtkWidget *hbox; GtkWidget *vbox; + GtkWidget *vbox2; GtkWidget *button; GtkWidget *frame; gint i; @@ -560,19 +561,19 @@ gradient_editor_new (void) NULL); - gtk_widget_hide (GTK_WIDGET (g_list_nth_data (gtk_container_children (GTK_CONTAINER (GTK_DIALOG (gradient_editor->shell)->vbox)), 0))); - - gtk_widget_hide (GTK_DIALOG (gradient_editor->shell)->action_area); - main_vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 4); gtk_container_add (GTK_CONTAINER (GTK_DIALOG (gradient_editor->shell)->vbox), main_vbox); gtk_widget_show (main_vbox); + vbox = gtk_vbox_new (FALSE, 1); + gtk_box_pack_start (GTK_BOX (main_vbox), vbox, TRUE, TRUE, 0); + gtk_widget_show (vbox); + /* Gradient's name */ gradient_editor->name = gtk_entry_new (); - gtk_box_pack_start (GTK_BOX (main_vbox), gradient_editor->name, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox), gradient_editor->name, TRUE, TRUE, 0); gtk_widget_show (gradient_editor->name); gtk_signal_connect (GTK_OBJECT (gradient_editor->name), "activate", @@ -582,99 +583,15 @@ gradient_editor_new (void) GTK_SIGNAL_FUNC (gradient_editor_name_focus_out), gradient_editor); - /* Horizontal box for zoom controls, scrollbar and instant update toggle */ - hbox = gtk_hbox_new (FALSE, 4); - gtk_container_set_border_width (GTK_CONTAINER (hbox), 0); - gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0); - gtk_widget_show (hbox); - - /* Save as POV-Ray button */ - button = gtk_button_new_with_label (_("Save as POV-Ray")); - gimp_help_set_help_data (button, NULL, - "dialogs/gradient_editor/save_as_povray.html"); - gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0); - gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); - gtk_widget_show (button); - - GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); - - gtk_signal_connect (GTK_OBJECT (button), "clicked", - GTK_SIGNAL_FUNC (ed_save_pov_callback), - gradient_editor); - - /* Zoom all button */ - button = gtk_button_new_with_label (_("Zoom all")); - gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0); - gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); - gtk_widget_show (button); - - GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); - - gtk_signal_connect (GTK_OBJECT (button), "clicked", - GTK_SIGNAL_FUNC (ed_zoom_all_callback), - gradient_editor); - - /* + and - buttons */ - gtk_widget_realize (gradient_editor->shell); - - button = gimp_pixmap_button_new (zoom_in_xpm, NULL); - GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); - gtk_signal_connect (GTK_OBJECT (button), "clicked", - GTK_SIGNAL_FUNC (ed_zoom_in_callback), - gradient_editor); - gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); - gtk_widget_show (button); - - button = gimp_pixmap_button_new (zoom_out_xpm, NULL); - GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); - gtk_signal_connect (GTK_OBJECT (button), "clicked", - GTK_SIGNAL_FUNC (ed_zoom_out_callback), - gradient_editor); - gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); - gtk_widget_show (button); - - /* Scrollbar */ - gradient_editor->zoom_factor = 1; - - gradient_editor->scroll_data = gtk_adjustment_new (0.0, 0.0, 1.0, - 1.0 * GRAD_SCROLLBAR_STEP_SIZE, - 1.0 * GRAD_SCROLLBAR_PAGE_SIZE, - 1.0); - - gtk_signal_connect (gradient_editor->scroll_data, "value_changed", - GTK_SIGNAL_FUNC (ed_scrollbar_update), - gradient_editor); - gtk_signal_connect (gradient_editor->scroll_data, "changed", - GTK_SIGNAL_FUNC (ed_scrollbar_update), - gradient_editor); - - gradient_editor->scrollbar = - gtk_hscrollbar_new (GTK_ADJUSTMENT (gradient_editor->scroll_data)); - gtk_range_set_update_policy (GTK_RANGE (gradient_editor->scrollbar), - GTK_UPDATE_CONTINUOUS); - gtk_box_pack_start (GTK_BOX (hbox), gradient_editor->scrollbar, TRUE, TRUE, 0); - gtk_widget_hide (gradient_editor->scrollbar); - - /* Instant update toggle */ - gradient_editor->instant_update = TRUE; - - button = gtk_check_button_new_with_label (_("Instant update")); - gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); - gtk_signal_connect (GTK_OBJECT (button), "toggled", - GTK_SIGNAL_FUNC (ed_instant_update_update), - gradient_editor); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); - gtk_widget_show (button); - /* Frame for gradient preview and gradient control */ frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); - gtk_box_pack_start (GTK_BOX (main_vbox), frame, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); gtk_widget_show (frame); - vbox = gtk_vbox_new (FALSE, 0); - gtk_container_add (GTK_CONTAINER (frame), vbox); - gtk_widget_show (vbox); + vbox2 = gtk_vbox_new (FALSE, 0); + gtk_container_add (GTK_CONTAINER (frame), vbox2); + gtk_widget_show (vbox2); /* Gradient preview */ gradient_editor->preview_rows[0] = NULL; @@ -706,7 +623,7 @@ gradient_editor_new (void) gradient_editor_drop_gradient, gradient_editor); - gtk_box_pack_start (GTK_BOX (vbox), gradient_editor->preview, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox2), gradient_editor->preview, TRUE, TRUE, 0); gtk_widget_show (gradient_editor->preview); /* Gradient control */ @@ -762,13 +679,106 @@ gradient_editor_new (void) gtk_signal_connect (GTK_OBJECT (gradient_editor->control), "event", GTK_SIGNAL_FUNC (control_events), gradient_editor); - gtk_box_pack_start (GTK_BOX (vbox), gradient_editor->control, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox2), gradient_editor->control, + FALSE, FALSE, 0); gtk_widget_show (gradient_editor->control); - /* Hint bar and close button */ + /* Scrollbar */ + gradient_editor->zoom_factor = 1; + + gradient_editor->scroll_data = + gtk_adjustment_new (0.0, 0.0, 1.0, + 1.0 * GRAD_SCROLLBAR_STEP_SIZE, + 1.0 * GRAD_SCROLLBAR_PAGE_SIZE, + 1.0); + + gtk_signal_connect (gradient_editor->scroll_data, "value_changed", + GTK_SIGNAL_FUNC (ed_scrollbar_update), + gradient_editor); + gtk_signal_connect (gradient_editor->scroll_data, "changed", + GTK_SIGNAL_FUNC (ed_scrollbar_update), + gradient_editor); + + gradient_editor->scrollbar = + gtk_hscrollbar_new (GTK_ADJUSTMENT (gradient_editor->scroll_data)); + gtk_range_set_update_policy (GTK_RANGE (gradient_editor->scrollbar), + GTK_UPDATE_CONTINUOUS); + gtk_box_pack_start (GTK_BOX (vbox), gradient_editor->scrollbar, + FALSE, FALSE, 0); + gtk_widget_show (gradient_editor->scrollbar); + + /* Horizontal box for name, zoom controls and instant update toggle */ + hbox = gtk_hbox_new (FALSE, 4); + gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0); + gtk_widget_show (hbox); + + /* Save as POV-Ray button */ + button = gtk_button_new_with_label (_("Save as POV-Ray")); + gimp_help_set_help_data (button, NULL, + "dialogs/gradient_editor/save_as_povray.html"); + gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); + + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (ed_save_pov_callback), + gradient_editor); + + /* + and - buttons */ + gtk_widget_realize (gradient_editor->shell); + + button = gimp_pixmap_button_new (zoom_out_xpm, NULL); + GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); + gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (ed_zoom_out_callback), + gradient_editor); + + button = gimp_pixmap_button_new (zoom_in_xpm, NULL); + GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); + gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (ed_zoom_in_callback), + gradient_editor); + + /* Zoom all button */ + button = gtk_button_new_with_label (_("Zoom all")); + gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0); + gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT); + + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (ed_zoom_all_callback), + gradient_editor); + + /* Instant update toggle */ + gradient_editor->instant_update = TRUE; + + button = gtk_check_button_new_with_label (_("Instant update")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); + gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + gtk_signal_connect (GTK_OBJECT (button), "toggled", + GTK_SIGNAL_FUNC (ed_instant_update_update), + gradient_editor); + + /* Hint bar */ + hbox = GTK_DIALOG (gradient_editor->shell)->action_area; + gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); + gtk_box_set_homogeneous (GTK_BOX (hbox), FALSE); + gradient_editor->hint_label = gtk_label_new (""); gtk_misc_set_alignment (GTK_MISC (gradient_editor->hint_label), 0.0, 0.5); - gtk_box_pack_start (GTK_BOX (main_vbox), gradient_editor->hint_label, + gtk_box_pack_start (GTK_BOX (hbox), gradient_editor->hint_label, FALSE, FALSE, 0); gtk_widget_show (gradient_editor->hint_label); @@ -1150,8 +1160,6 @@ ed_zoom_all_callback (GtkWidget *widget, gradient_editor->zoom_factor = 1; - gtk_widget_hide (gradient_editor->scrollbar); - adjustment->value = 0.0; adjustment->page_size = 1.0; adjustment->step_increment = 1.0 * GRAD_SCROLLBAR_STEP_SIZE; @@ -1180,11 +1188,6 @@ ed_zoom_out_callback (GtkWidget *widget, gradient_editor->zoom_factor--; - if (gradient_editor->zoom_factor==1) - gtk_widget_hide (gradient_editor->scrollbar); - else - gtk_widget_show (gradient_editor->scrollbar); - page_size = 1.0 / gradient_editor->zoom_factor; value = old_value - (page_size - old_page_size) / 2.0; @@ -1225,7 +1228,6 @@ ed_zoom_in_callback (GtkWidget *widget, adjustment->page_increment = page_size * GRAD_SCROLLBAR_PAGE_SIZE; gtk_adjustment_changed (GTK_ADJUSTMENT (gradient_editor->scroll_data)); - gtk_widget_show (gradient_editor->scrollbar); } static void @@ -1631,6 +1633,9 @@ control_events (GtkWidget *widget, if ((time - gradient_editor->control_click_time) >= GRAD_MOVE_TIME) { + if (! gradient_editor->instant_update) + gimp_data_dirty (GIMP_DATA (gradient)); + ed_update_editor (gradient_editor, GRAD_UPDATE_GRADIENT); /* Possible move */ } @@ -2040,13 +2045,17 @@ control_motion (GradientEditor *gradient_editor, if (str) g_free (str); - gimp_data_dirty (GIMP_DATA (gradient)); - if (gradient_editor->instant_update) - ed_update_editor (gradient_editor, - GRAD_UPDATE_GRADIENT | GRAD_UPDATE_CONTROL); + { + gimp_data_dirty (GIMP_DATA (gradient)); + + ed_update_editor (gradient_editor, + GRAD_UPDATE_GRADIENT | GRAD_UPDATE_CONTROL); + } else - ed_update_editor (gradient_editor, GRAD_UPDATE_CONTROL); + { + ed_update_editor (gradient_editor, GRAD_UPDATE_CONTROL); + } } static void diff --git a/configure.in b/configure.in index 4f01d19e5a..5229337246 100644 --- a/configure.in +++ b/configure.in @@ -767,7 +767,7 @@ gimp.1 gimprc gimprc_user gimprc.5 -gimptool +gimptool-1.4 gimptool.1 gimp-remote.1 gimp.spec diff --git a/gimp.m4 b/gimp-1.4.m4 similarity index 76% rename from gimp.m4 rename to gimp-1.4.m4 index 313f1800e9..8a54becf91 100644 --- a/gimp.m4 +++ b/gimp-1.4.m4 @@ -2,12 +2,12 @@ # Manish Singh 98-6-11 # Shamelessly stolen from Owen Taylor -dnl AM_PATH_GIMP([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl AM_PATH_GIMP_1_4([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for GIMP, and define GIMP_CFLAGS and GIMP_LIBS dnl -AC_DEFUN(AM_PATH_GIMP, +AC_DEFUN(AM_PATH_GIMP_1_4, [dnl -dnl Get the cflags and libraries from the gimptool script +dnl Get the cflags and libraries from the gimptool-1.4 script dnl AC_ARG_WITH(gimp-prefix,[ --with-gimp-prefix=PFX Prefix where GIMP is installed (optional)], gimptool_prefix="$withval", gimptool_prefix="") @@ -19,17 +19,17 @@ AC_ARG_ENABLE(gimptest, [ --disable-gimptest Do not try to compile and run if test x$gimptool_exec_prefix != x ; then gimptool_args="$gimptool_args --exec-prefix=$gimptool_exec_prefix" if test x${GIMPTOOL+set} != xset ; then - GIMPTOOL=$gimptool_exec_prefix/bin/gimptool + GIMPTOOL=$gimptool_exec_prefix/bin/gimptool-1.4 fi fi if test x$gimptool_prefix != x ; then gimptool_args="$gimptool_args --prefix=$gimptool_prefix" if test x${GIMPTOOL+set} != xset ; then - GIMPTOOL=$gimptool_prefix/bin/gimptool + GIMPTOOL=$gimptool_prefix/bin/gimptool-1.4 fi fi - AC_PATH_PROG(GIMPTOOL, gimptool, no) + AC_PATH_PROG(GIMPTOOL, gimptool-1.4, no) min_gimp_version=ifelse([$1], ,1.0.0,$1) AC_MSG_CHECKING(for GIMP - version >= $min_gimp_version) no_gimp="" @@ -69,7 +69,7 @@ AC_ARG_ENABLE(gimptest, [ --disable-gimptest Do not try to compile and run LIBS="$LIBS $GIMP_LIBS" dnl dnl Now check if the installed GIMP is sufficiently new. (Also sanity -dnl checks the results of gimptool to some extent +dnl checks the results of gimptool-1.4 to some extent dnl rm -f conf.gimptest AC_TRY_RUN([ @@ -78,20 +78,7 @@ dnl #include -#ifndef GIMP_CHECK_VERSION -#define GIMP_CHECK_VERSION(major, minor, micro) \ - (GIMP_MAJOR_VERSION > (major) || \ - (GIMP_MAJOR_VERSION == (major) && GIMP_MINOR_VERSION > (minor)) || \ - (GIMP_MAJOR_VERSION == (major) && GIMP_MINOR_VERSION == (minor) && \ - GIMP_MICRO_VERSION >= (micro))) -#endif - -#if GIMP_CHECK_VERSION(1,1,24) -GimpPlugInInfo -#else -GPlugInInfo -#endif -PLUG_IN_INFO = +GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ @@ -121,11 +108,11 @@ int main () } else { - printf("\n*** 'gimptool --version' returned %d.%d.%d, but the minimum version\n", $gimptool_major_version, $gimptool_minor_version, $gimptool_micro_version); - printf("*** of GIMP required is %d.%d.%d. If gimptool is correct, then it is\n", major, minor, micro); + printf("\n*** 'gimptool-1.4 --version' returned %d.%d.%d, but the minimum version\n", $gimptool_major_version, $gimptool_minor_version, $gimptool_micro_version); + printf("*** of GIMP required is %d.%d.%d. If gimptool-1.4 is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); - printf("*** If gimptool was wrong, set the environment variable GIMPTOOL\n"); - printf("*** to point to the correct copy of gimptool, and remove the file\n"); + printf("*** If gimptool-1.4 was wrong, set the environment variable GIMPTOOL\n"); + printf("*** to point to the correct copy of gimptool-1.4, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } @@ -142,10 +129,10 @@ int main () else AC_MSG_RESULT(no) if test "$GIMPTOOL" = "no" ; then - echo "*** The gimptool script installed by GIMP could not be found" + echo "*** The gimptool-1.4 script installed by GIMP could not be found" echo "*** If GIMP was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the GIMPTOOL environment variable to the" - echo "*** full path to gimptool." + echo "*** full path to gimptool-1.4." else if test -f conf.gimptest ; then : @@ -157,20 +144,7 @@ int main () #include #include -#ifndef GIMP_CHECK_VERSION -#define GIMP_CHECK_VERSION(major, minor, micro) \ - (GIMP_MAJOR_VERSION > (major) || \ - (GIMP_MAJOR_VERSION == (major) && GIMP_MINOR_VERSION > (minor)) || \ - (GIMP_MAJOR_VERSION == (major) && GIMP_MINOR_VERSION == (minor) && \ - GIMP_MICRO_VERSION >= (micro))) -#endif - -#if GIMP_CHECK_VERSION(1,1,24) -GimpPlugInInfo -#else -GPlugInInfo -#endif -PLUG_IN_INFO = +GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ @@ -190,7 +164,7 @@ PLUG_IN_INFO = [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GIMP was incorrectly installed" echo "*** or that you have moved GIMP since it was installed. In the latter case, you" - echo "*** may want to edit the gimptool script: $GIMPTOOL" ]) + echo "*** may want to edit the gimptool-1.4 script: $GIMPTOOL" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi diff --git a/gimptool-1.2.in b/gimptool-1.4.in similarity index 97% rename from gimptool-1.2.in rename to gimptool-1.4.in index 772f565efa..1d289b62f8 100644 --- a/gimptool-1.2.in +++ b/gimptool-1.4.in @@ -179,14 +179,7 @@ while test $# -gt 0; do --cflags-noui) my_gtk_cflags=`echo $gtk_cflags | sed 's/^.*\(-I[^ ]*glib[^ ]* *-I[^ ]*\).*$/\1/'` ;; esac - if test @includedir@ != /usr/include ; then - includes=-I@includedir@ - for i in $my_gtk_cflags ; do - if test $i = -I@includedir@ ; then - includes="" - fi - done - fi + includes=-I@includedir@/gimp-@GIMP_MAJOR_VERSION@.@GIMP_MINOR_VERSION@ echo $includes $my_gtk_cflags ;; --libs | --libs-nogimpui) diff --git a/gimptool.in b/gimptool.in deleted file mode 100644 index 772f565efa..0000000000 --- a/gimptool.in +++ /dev/null @@ -1,347 +0,0 @@ -#! /bin/sh - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -exec_prefix_set=no - -bindir=@bindir@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ -datadir=@datadir@ -sysconfdir=@sysconfdir@ -sharedstatedir=@sharedstatedir@ -localstatedir=@localstatedir@ -libdir=@libdir@ -infodir=@infodir@ -mandir=@mandir@ -includedir=@includedir@ - -gimpplugindir=@gimpplugindir@ -gimpdatadir=@gimpdatadir@ - -usage() -{ - cat <&2 - exit 1 - fi - else - echo "${noarg}" 1>&2 - exit 1 - fi - ;; - *) - shift - if test "x$1" != "x"; then - if test -r "$1"; then - cmd="$install_cmd $1 $install_dir/$1" - test $quiet = "yes" || echo $cmd - test $donothing = "yes" || exec $cmd - else - echo "${notfound}" 1>&2 - exit 1 - fi - else - echo "${noarg}" 1>&2 - exit 1 - fi - ;; - esac - ;; - --build | --install | --install-admin | --build-strip | --install-strip \ - | --install-admin-strip | --build-nogimpui | --install-nogimpui \ - | --install-admin-nogimpui | --build-nogimpui-strip \ - | --install-nogimpui-strip | --install-admin-nogimpui-strip \ - | --build-noui | --install-noui | --install-admin-noui \ - | --build-noui-strip | --install-noui-strip | --install-admin-noui-strip) - opt=`echo $1 | sed 's/-strip$//'` - if test "x$opt" != "x$1" ; then - cflags=`echo $cflags | sed -e 's/-g //g' -e 's/ -g//g'` - fi - case $opt in - --build | --build-noui | --build-nogimpui) - install_dir=. ;; - --install | --install-noui | --install-nogimpui) - install_dir="$HOME/@gimpdir@/plug-ins" ;; - --install-admin | --install-admin-noui | --install-admin-nogimpui) - install_dir="$gimpplugindir/plug-ins" ;; - esac - noui=`echo $opt | sed 's/^.*\(noui\)$/\1/'` - nogimpui=`echo $opt | sed 's/^.*\(nogimpui\)$/\1/'` - if test "$noui" = "noui" ; then - gimp_cflags=`$0 --cflags-noui` - gimp_libs=`$0 --libs-noui` - elif test "$nogimpui" = "nogimpui" ; then - gimp_cflags=`$0 --cflags-nogimpui` - gimp_libs=`$0 --libs-nogimpui` - else - gimp_cflags=`$0 --cflags` - gimp_libs=`$0 --libs` - fi - shift - if test "x$1" != "x"; then - if test -r "$1"; then - dest=`echo $1 | sed -e 's#.*/\([^/].*\)$#\1#' -e 's/\.[^.]*$//'` - cmd="$cc $cflags $gimp_cflags -o $install_dir/$dest $1 $ldflags $gimp_libs $libs" - test $quiet = "yes" || echo $cmd - test $donothing = "yes" || exec $cmd - else - echo "${notfound}" 1>&2 - exit 1 - fi - else - echo "${noarg}" 1>&2 - exit 1 - fi - ;; - *) - usage 1 - ;; - esac - shift -done diff --git a/libgimp/Makefile.am b/libgimp/Makefile.am index 4908db847a..089b7e786f 100644 --- a/libgimp/Makefile.am +++ b/libgimp/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -gimpincludedir = $(includedir)/libgimp +gimpincludedir = $(includedir)/gimp-$(GIMP_MAJOR_VERSION).$(GIMP_MINOR_VERSION)/libgimp AM_CPPFLAGS = \ -DGIMPDIR=\""$(gimpdir)"\" \ diff --git a/libgimpcolor/Makefile.am b/libgimpcolor/Makefile.am index 250591f8d3..f90e195476 100644 --- a/libgimpcolor/Makefile.am +++ b/libgimpcolor/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -libgimpcolorincludedir = $(includedir)/libgimpcolor +libgimpcolorincludedir = $(includedir)/gimp-$(GIMP_MAJOR_VERSION).$(GIMP_MINOR_VERSION)/libgimpcolor AM_CPPFLAGS = \ -DGIMPDIR=\""$(gimpdir)"\" \ diff --git a/libgimpmath/Makefile.am b/libgimpmath/Makefile.am index 0ad0265265..c64f6d19f3 100644 --- a/libgimpmath/Makefile.am +++ b/libgimpmath/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -libgimpmathincludedir = $(includedir)/libgimpmath +libgimpmathincludedir = $(includedir)/gimp-$(GIMP_MAJOR_VERSION).$(GIMP_MINOR_VERSION)/libgimpmath AM_CPPFLAGS = \ -DGIMPDIR=\""$(gimpdir)"\" \ diff --git a/libgimpwidgets/Makefile.am b/libgimpwidgets/Makefile.am index d8e55102f5..fe913118a2 100644 --- a/libgimpwidgets/Makefile.am +++ b/libgimpwidgets/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -libgimpwidgetsincludedir = $(includedir)/libgimpwidgets +libgimpwidgetsincludedir = $(includedir)/gimp-$(GIMP_MAJOR_VERSION).$(GIMP_MINOR_VERSION)/libgimpwidgets AM_CPPFLAGS = \ -DGIMPDIR=\""$(gimpdir)"\" \