gimp.m4 removed.

2001-02-19  Michael Natterer  <mitch@gimp.org>

	* 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/<libname>

	* 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.
This commit is contained in:
Michael Natterer 2001-02-19 00:05:03 +00:00 committed by Michael Natterer
parent a80dd4d071
commit 2beabbaf04
20 changed files with 492 additions and 773 deletions

View File

@ -15,7 +15,7 @@ config.status
libtool
aclocal.m4
gimprc_user
gimptool
gimptool-1.4
intl
config.h.in
stamp-h.in

View File

@ -1,3 +1,31 @@
2001-02-19 Michael Natterer <mitch@gimp.org>
* 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/<libname>
* 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 <mitch@gimp.org>
* app/gimpdnd.[ch]: added DND source functions which work by

View File

@ -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

View File

@ -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 */

View File

@ -18,8 +18,12 @@
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#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));

View File

@ -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,14 +2045,18 @@ control_motion (GradientEditor *gradient_editor,
if (str)
g_free (str);
if (gradient_editor->instant_update)
{
gimp_data_dirty (GIMP_DATA (gradient));
if (gradient_editor->instant_update)
ed_update_editor (gradient_editor,
GRAD_UPDATE_GRADIENT | GRAD_UPDATE_CONTROL);
}
else
{
ed_update_editor (gradient_editor, GRAD_UPDATE_CONTROL);
}
}
static void
control_compress_left (GimpGradientSegment *range_l,

View File

@ -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 */

View File

@ -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,14 +2045,18 @@ control_motion (GradientEditor *gradient_editor,
if (str)
g_free (str);
if (gradient_editor->instant_update)
{
gimp_data_dirty (GIMP_DATA (gradient));
if (gradient_editor->instant_update)
ed_update_editor (gradient_editor,
GRAD_UPDATE_GRADIENT | GRAD_UPDATE_CONTROL);
}
else
{
ed_update_editor (gradient_editor, GRAD_UPDATE_CONTROL);
}
}
static void
control_compress_left (GimpGradientSegment *range_l,

View File

@ -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 = 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);
lc_dialog->gimage = NULL;
lc_dialog->auto_follow_active = TRUE;
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);

View File

@ -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 */

View File

@ -18,8 +18,12 @@
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#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));

View File

@ -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,14 +2045,18 @@ control_motion (GradientEditor *gradient_editor,
if (str)
g_free (str);
if (gradient_editor->instant_update)
{
gimp_data_dirty (GIMP_DATA (gradient));
if (gradient_editor->instant_update)
ed_update_editor (gradient_editor,
GRAD_UPDATE_GRADIENT | GRAD_UPDATE_CONTROL);
}
else
{
ed_update_editor (gradient_editor, GRAD_UPDATE_CONTROL);
}
}
static void
control_compress_left (GimpGradientSegment *range_l,

View File

@ -767,7 +767,7 @@ gimp.1
gimprc
gimprc_user
gimprc.5
gimptool
gimptool-1.4
gimptool.1
gimp-remote.1
gimp.spec

View File

@ -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 <libgimp/gimp.h>
#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 <stdio.h>
#include <libgimp/gimp.h>
#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

View File

@ -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)

View File

@ -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 <<EOF
Usage: gimptool [OPTION]...
General options:
--help print this message
--quiet, --silent don't echo build commands
--version print the version of GIMP associated with this script
-n, --just-print, --dry-run, --recon
don't actually run any commands; just print them
Developer options:
--cflags print the compiler flags that are necessary to
compile a plug-in
--libs print the linker flags that are necessary to link a
plug-in
--prefix=PREFIX use PREFIX instead of the installation prefix that
GIMP was built when computing the output for --cflags
and --libs
--exec-prefix=PREFIX use PREFIX instead of the installation exec prefix
that GIMP was built when computing the output for
--cflags and --libs
Installation directory options:
--prefix --exec-prefix --bindir --sbindir --libexecdir --datadir --sysconfdir
--sharedstatedir --localstatedir --libdir --infodir --mandir --includedir
--gimpplugindir --gimpdatadir
The --cflags and --libs options can be appended with -noui to get appropriate
settings for plug-ins which do not use GTK+.
User options:
--build plug-in.c build a plug-in from a source file
--install plug-in.c same as --build, but installs the built
plug-in as well
--install-bin plug-in install a compiled plug-in
--install-script script.scm install a script-fu script
--uninstall-bin plug-in remove a plug-in again
--uninstall-script plug-in remove a script-fu script
The --install and --uninstall options have "admin" counterparts (with
prefix --install-admin instead of --install) that can be used instead to
install/uninstall a plug-in or script in the site directory instead of a
user directory.
For plug-ins which do not use GTK+, the --build and --install options can be
appended with -noui for appropriate settings. For plug-ins that use GTK+ but
not libgumpui, append -nogimpui.
All binary build and install options can be appended with -strip to discard
debugging information.
EOF
exit $1
}
noarg="\
Error: Need a plug-in source file to build"
notfound="\
Error: Couldn't find file to build/install/uninstall"
quiet=no
donothing=no
if test $# -eq 0; then
usage 1
fi
if test x${GTK_CONFIG+set} != xset ; then
gtk_cflags='@GTK_CFLAGS@'
gtk_libs='@GTK_LIBS@'
else
gtk_cflags=`$GTK_CONFIG --cflags`
gtk_libs=`$GTK_CONFIG --libs`
fi
if test x${INSTALL+set} != xset ; then
INSTALL='@INSTALL@'
if test "$INSTALL" = "./install-sh -c"; then
mydirname=`echo $0 | sed -e 's#\(.*\)/[^/].*$#\1#'`
INSTALL="$mydirname/gimpinstall"
fi
fi
if test x${CC+set} != xset ; then
cc='@CC@'
else
cc="$CC"
fi
if test x${CFLAGS+set} != xset ; then
cflags='@CFLAGS@'
else
cflags="$CFLAGS"
fi
if test x${LDFLAGS+set} != xset ; then
ldflags='@LDFLAGS@'
else
ldflags="$LDFLAGS"
fi
if test x${LIBS+set} != xset ; then
libs=""
else
libs="$LIBS"
fi
while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--version)
echo @GIMP_VERSION@
exit 0
;;
--help)
usage 0
;;
--quiet | --silent)
quiet=yes
;;
-n | --just-print | --dry-run | --recon)
donothing=yes
;;
--prefix=*)
prefix=$optarg
if test $exec_prefix_set = no ; then
exec_prefix=$optarg
fi
;;
--prefix)
echo $prefix
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
;;
--exec-prefix)
echo $exec_prefix
;;
--*dir)
dirname=\$`echo $1 | sed -e 's,^--,,'`
dirname=`eval echo $dirname`
test -z "$dirname" && exit 1
echo $dirname
exit 0
;;
--cflags | --cflags-noui | --cflags-nogimpui)
case $1 in
--cflags | --cflags-nogimpui)
my_gtk_cflags=$gtk_cflags ;;
--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
echo $includes $my_gtk_cflags
;;
--libs | --libs-nogimpui)
my_gtk_libs=
libdirs=-L@libdir@
for i in $gtk_libs ; do
if test $i != -L@libdir@ ; then
if test -z "$my_gtk_libs" ; then
my_gtk_libs="$i"
else
my_gtk_libs="$my_gtk_libs $i"
fi
fi
done
case $1 in
--libs)
echo $libdirs -lgimpui -lgimpwidgets -lgimp -lgimpcolor -lgimpmath $my_gtk_libs ;;
--libs-nogimpui)
echo $libdirs -lgimp -lgimpcolor -lgimpmath $my_gtk_libs ;;
esac
;;
--libs-noui)
glib_ldflags=`echo $gtk_libs | sed -e 's/^.*-lgdk[^ ]* *\(-L[^ ]*\).*$/\1/' -e 's/^.* -lgdk[^ ]* .*$//'`
if test -z "$glib_ldflags" ; then
glib_ldflags=`echo $gtk_libs | sed 's/^ *\(-L[^ ]*\) .*$/\1/'`
fi
glib_libs="$glib_ldflags `echo $gtk_libs | sed 's/^.*\(-lglib[^ ]*\).*$/\1/'`"
my_glib_libs=
libdirs=-L@libdir@
for i in $glib_libs ; do
if test $i != -L@libdir@ ; then
if test -z "$my_glib_libs" ; then
my_glib_libs="$i"
else
my_glib_libs="$my_glib_libs $i"
fi
fi
done
echo -L@libdir@ -lgimp -lgimpcolor -lgimpmath $my_glib_libs
;;
--install-bin | --install-admin-bin \
| --install-bin-strip | --install-admin-bin-strip \
| --install-script | --install-admin-script \
| --uninstall-bin | --uninstall-admin-bin \
| --uninstall-script | --uninstall-admin-script )
case $1 in
--*install-bin)
install_cmd="@INSTALL_PROGRAM@"
install_dir="$HOME/@gimpdir@/plug-ins"
;;
--install-bin-strip)
install_cmd="@INSTALL_PROGRAM@ -s"
install_dir="$HOME/@gimpdir@/plug-ins"
;;
--*install-admin-bin)
install_cmd="@INSTALL_PROGRAM@"
install_dir="$gimpplugindir/plug-ins"
;;
--install-admin-bin-strip)
install_cmd="@INSTALL_PROGRAM@ -s"
install_dir="$gimpplugindir/plug-ins"
;;
--*install-script)
install_cmd="@INSTALL_DATA@"
install_dir="$HOME/@gimpdir@/scripts"
;;
--*install-admin-script)
install_cmd="@INSTALL_DATA@"
install_dir="$gimpdatadir/scripts"
;;
esac
case $1 in
--uninstall-* )
shift
if test "x$1" != "x"; then
if test -f "$install_dir/$1"; then
cmd="rm -f $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
;;
*)
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

View File

@ -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)"\" \

View File

@ -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)"\" \

View File

@ -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)"\" \

View File

@ -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)"\" \