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

app/base/Makefile.am app/core/Makefile.am app/gui/Makefile.am added

2001-05-30  Michael Natterer  <mitch@gimp.org>

	* app/base/Makefile.am
	* app/core/Makefile.am
	* app/gui/Makefile.am
	* app/paint-funcs/Makefile.am: added makefile.msc to EXTRA_DIST.

	* app/core/gimpimage.c: don't try to create previews with width or
	height < 1.

	* app/gui/color-notebook.c: Major (??) dialog repacking. Don't
	show an action_area for the main color selection (it's now about
	half the size of the 1.2 one).

	* libgimp/gimpcolorselector.h: define some gui size constants
	here.

	* app/gui/color-select.c
	* modules/colorsel_triangle.c
	* modules/colorsel_water.c: use the constants and removed the
	spacing around the main container.

	* libgimpwidgets/gimpcolorarea.[ch]: rendering in the idle loop
	fixes a race condition when accessing widget->window during widget
	resizing.

	* modules/Makefile.am: disabled the "GTK" color notebook page (we
	will put the GtkHSV widget of gtk+ 2.0 here).

2001-05-30  Michael Natterer  <mitch@gimp.org>

	* libgimpmath/libgimpmath-docs.sgml: s/libgimpcolor/libgimpmath/.
parent 80a22ec5
2001-05-30 Michael Natterer <mitch@gimp.org>
* app/base/Makefile.am
* app/core/Makefile.am
* app/gui/Makefile.am
* app/paint-funcs/Makefile.am: added makefile.msc to EXTRA_DIST.
* app/core/gimpimage.c: don't try to create previews with width or
height < 1.
* app/gui/color-notebook.c: Major (??) dialog repacking. Don't
show an action_area for the main color selection (it's now about
half the size of the 1.2 one).
* libgimp/gimpcolorselector.h: define some gui size constants
here.
* app/gui/color-select.c
* modules/colorsel_triangle.c
* modules/colorsel_water.c: use the constants and removed the
spacing around the main container.
* libgimpwidgets/gimpcolorarea.[ch]: rendering in the idle loop
fixes a race condition when accessing widget->window during widget
resizing.
* modules/Makefile.am: disabled the "GTK" color notebook page (we
will put the GtkHSV widget of gtk+ 2.0 here).
2001-05-29 Simon Budig <simon@gimp.org>
* po/POTFILES.in: Added app/tools/gimpposterizetool.c
......
......@@ -37,6 +37,9 @@ libappbase_la_SOURCES = \
tile-swap.c \
tile-swap.h
EXTRA_DIST = \
makefile.msc
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Gimp-Base\"
......
......@@ -82,6 +82,9 @@ libappcore_la_SOURCES = \
gimpviewable.c \
gimpviewable.h
EXTRS_DIST = \
makefile.msc
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Gimp-Core\"
......
......@@ -4091,6 +4091,7 @@ gimp_image_get_new_preview (GimpViewable *viewable,
temp_buf_data_clear (comp);
floating_sel = NULL;
for (list = GIMP_LIST (gimage->layers)->list;
list;
list = g_list_next (list))
......@@ -4101,16 +4102,19 @@ gimp_image_get_new_preview (GimpViewable *viewable,
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
{
/* floating selections are added right above the layer
they are attached to */
* they are attached to
*/
if (gimp_layer_is_floating_sel (layer))
{
floating_sel = layer;
}
else
{
if (floating_sel &&
if (floating_sel &&
floating_sel->fs.drawable == GIMP_DRAWABLE (layer))
reverse_list = g_slist_prepend (reverse_list, floating_sel);
{
reverse_list = g_slist_prepend (reverse_list, floating_sel);
}
reverse_list = g_slist_prepend (reverse_list, layer);
}
......@@ -4119,16 +4123,19 @@ gimp_image_get_new_preview (GimpViewable *viewable,
construct_flag = FALSE;
while (reverse_list)
for (; reverse_list; reverse_list = g_slist_next (reverse_list))
{
layer = (GimpLayer *) reverse_list->data;
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
x = (gint) RINT (ratio * off_x);
y = (gint) RINT (ratio * off_y);
w = (gint) RINT (ratio * gimp_drawable_width (GIMP_DRAWABLE (layer)));
h = (gint) RINT (ratio * gimp_drawable_height (GIMP_DRAWABLE (layer)));
y = (gint) RINT (ratio * off_y);
w = (gint) RINT (ratio * gimp_drawable_width (GIMP_DRAWABLE (layer)));
h = (gint) RINT (ratio * gimp_drawable_height (GIMP_DRAWABLE (layer)));
if (w < 1 || h < 1)
continue;
x1 = CLAMP (x, 0, width);
y1 = CLAMP (y, 0, height);
......@@ -4207,8 +4214,6 @@ gimp_image_get_new_preview (GimpViewable *viewable,
}
construct_flag = TRUE;
reverse_list = g_slist_next (reverse_list);
}
g_slist_free (reverse_list);
......
......@@ -4091,6 +4091,7 @@ gimp_image_get_new_preview (GimpViewable *viewable,
temp_buf_data_clear (comp);
floating_sel = NULL;
for (list = GIMP_LIST (gimage->layers)->list;
list;
list = g_list_next (list))
......@@ -4101,16 +4102,19 @@ gimp_image_get_new_preview (GimpViewable *viewable,
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
{
/* floating selections are added right above the layer
they are attached to */
* they are attached to
*/
if (gimp_layer_is_floating_sel (layer))
{
floating_sel = layer;
}
else
{
if (floating_sel &&
if (floating_sel &&
floating_sel->fs.drawable == GIMP_DRAWABLE (layer))
reverse_list = g_slist_prepend (reverse_list, floating_sel);
{
reverse_list = g_slist_prepend (reverse_list, floating_sel);
}
reverse_list = g_slist_prepend (reverse_list, layer);
}
......@@ -4119,16 +4123,19 @@ gimp_image_get_new_preview (GimpViewable *viewable,
construct_flag = FALSE;
while (reverse_list)
for (; reverse_list; reverse_list = g_slist_next (reverse_list))
{
layer = (GimpLayer *) reverse_list->data;
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
x = (gint) RINT (ratio * off_x);
y = (gint) RINT (ratio * off_y);
w = (gint) RINT (ratio * gimp_drawable_width (GIMP_DRAWABLE (layer)));
h = (gint) RINT (ratio * gimp_drawable_height (GIMP_DRAWABLE (layer)));
y = (gint) RINT (ratio * off_y);
w = (gint) RINT (ratio * gimp_drawable_width (GIMP_DRAWABLE (layer)));
h = (gint) RINT (ratio * gimp_drawable_height (GIMP_DRAWABLE (layer)));
if (w < 1 || h < 1)
continue;
x1 = CLAMP (x, 0, width);
y1 = CLAMP (y, 0, height);
......@@ -4207,8 +4214,6 @@ gimp_image_get_new_preview (GimpViewable *viewable,
}
construct_flag = TRUE;
reverse_list = g_slist_next (reverse_list);
}
g_slist_free (reverse_list);
......
......@@ -4091,6 +4091,7 @@ gimp_image_get_new_preview (GimpViewable *viewable,
temp_buf_data_clear (comp);
floating_sel = NULL;
for (list = GIMP_LIST (gimage->layers)->list;
list;
list = g_list_next (list))
......@@ -4101,16 +4102,19 @@ gimp_image_get_new_preview (GimpViewable *viewable,
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
{
/* floating selections are added right above the layer
they are attached to */
* they are attached to
*/
if (gimp_layer_is_floating_sel (layer))
{
floating_sel = layer;
}
else
{
if (floating_sel &&
if (floating_sel &&
floating_sel->fs.drawable == GIMP_DRAWABLE (layer))
reverse_list = g_slist_prepend (reverse_list, floating_sel);
{
reverse_list = g_slist_prepend (reverse_list, floating_sel);
}
reverse_list = g_slist_prepend (reverse_list, layer);
}
......@@ -4119,16 +4123,19 @@ gimp_image_get_new_preview (GimpViewable *viewable,
construct_flag = FALSE;
while (reverse_list)
for (; reverse_list; reverse_list = g_slist_next (reverse_list))
{
layer = (GimpLayer *) reverse_list->data;
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
x = (gint) RINT (ratio * off_x);
y = (gint) RINT (ratio * off_y);
w = (gint) RINT (ratio * gimp_drawable_width (GIMP_DRAWABLE (layer)));
h = (gint) RINT (ratio * gimp_drawable_height (GIMP_DRAWABLE (layer)));
y = (gint) RINT (ratio * off_y);
w = (gint) RINT (ratio * gimp_drawable_width (GIMP_DRAWABLE (layer)));
h = (gint) RINT (ratio * gimp_drawable_height (GIMP_DRAWABLE (layer)));
if (w < 1 || h < 1)
continue;
x1 = CLAMP (x, 0, width);
y1 = CLAMP (y, 0, height);
......@@ -4207,8 +4214,6 @@ gimp_image_get_new_preview (GimpViewable *viewable,
}
construct_flag = TRUE;
reverse_list = g_slist_next (reverse_list);
}
g_slist_free (reverse_list);
......
......@@ -4091,6 +4091,7 @@ gimp_image_get_new_preview (GimpViewable *viewable,
temp_buf_data_clear (comp);
floating_sel = NULL;
for (list = GIMP_LIST (gimage->layers)->list;
list;
list = g_list_next (list))
......@@ -4101,16 +4102,19 @@ gimp_image_get_new_preview (GimpViewable *viewable,
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
{
/* floating selections are added right above the layer
they are attached to */
* they are attached to
*/
if (gimp_layer_is_floating_sel (layer))
{
floating_sel = layer;
}
else
{
if (floating_sel &&
if (floating_sel &&
floating_sel->fs.drawable == GIMP_DRAWABLE (layer))
reverse_list = g_slist_prepend (reverse_list, floating_sel);
{
reverse_list = g_slist_prepend (reverse_list, floating_sel);
}
reverse_list = g_slist_prepend (reverse_list, layer);
}
......@@ -4119,16 +4123,19 @@ gimp_image_get_new_preview (GimpViewable *viewable,
construct_flag = FALSE;
while (reverse_list)
for (; reverse_list; reverse_list = g_slist_next (reverse_list))
{
layer = (GimpLayer *) reverse_list->data;
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
x = (gint) RINT (ratio * off_x);
y = (gint) RINT (ratio * off_y);
w = (gint) RINT (ratio * gimp_drawable_width (GIMP_DRAWABLE (layer)));
h = (gint) RINT (ratio * gimp_drawable_height (GIMP_DRAWABLE (layer)));
y = (gint) RINT (ratio * off_y);
w = (gint) RINT (ratio * gimp_drawable_width (GIMP_DRAWABLE (layer)));
h = (gint) RINT (ratio * gimp_drawable_height (GIMP_DRAWABLE (layer)));
if (w < 1 || h < 1)
continue;
x1 = CLAMP (x, 0, width);
y1 = CLAMP (y, 0, height);
......@@ -4207,8 +4214,6 @@ gimp_image_get_new_preview (GimpViewable *viewable,
}
construct_flag = TRUE;
reverse_list = g_slist_next (reverse_list);
}
g_slist_free (reverse_list);
......
......@@ -4091,6 +4091,7 @@ gimp_image_get_new_preview (GimpViewable *viewable,
temp_buf_data_clear (comp);
floating_sel = NULL;
for (list = GIMP_LIST (gimage->layers)->list;
list;
list = g_list_next (list))
......@@ -4101,16 +4102,19 @@ gimp_image_get_new_preview (GimpViewable *viewable,
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
{
/* floating selections are added right above the layer
they are attached to */
* they are attached to
*/
if (gimp_layer_is_floating_sel (layer))
{
floating_sel = layer;
}
else
{
if (floating_sel &&
if (floating_sel &&
floating_sel->fs.drawable == GIMP_DRAWABLE (layer))
reverse_list = g_slist_prepend (reverse_list, floating_sel);
{
reverse_list = g_slist_prepend (reverse_list, floating_sel);
}
reverse_list = g_slist_prepend (reverse_list, layer);
}
......@@ -4119,16 +4123,19 @@ gimp_image_get_new_preview (GimpViewable *viewable,
construct_flag = FALSE;
while (reverse_list)
for (; reverse_list; reverse_list = g_slist_next (reverse_list))
{
layer = (GimpLayer *) reverse_list->data;
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
x = (gint) RINT (ratio * off_x);
y = (gint) RINT (ratio * off_y);
w = (gint) RINT (ratio * gimp_drawable_width (GIMP_DRAWABLE (layer)));
h = (gint) RINT (ratio * gimp_drawable_height (GIMP_DRAWABLE (layer)));
y = (gint) RINT (ratio * off_y);
w = (gint) RINT (ratio * gimp_drawable_width (GIMP_DRAWABLE (layer)));
h = (gint) RINT (ratio * gimp_drawable_height (GIMP_DRAWABLE (layer)));
if (w < 1 || h < 1)
continue;
x1 = CLAMP (x, 0, width);
y1 = CLAMP (y, 0, height);
......@@ -4207,8 +4214,6 @@ gimp_image_get_new_preview (GimpViewable *viewable,
}
construct_flag = TRUE;
reverse_list = g_slist_next (reverse_list);
}
g_slist_free (reverse_list);
......
......@@ -4091,6 +4091,7 @@ gimp_image_get_new_preview (GimpViewable *viewable,
temp_buf_data_clear (comp);
floating_sel = NULL;
for (list = GIMP_LIST (gimage->layers)->list;
list;
list = g_list_next (list))
......@@ -4101,16 +4102,19 @@ gimp_image_get_new_preview (GimpViewable *viewable,
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
{
/* floating selections are added right above the layer
they are attached to */
* they are attached to
*/
if (gimp_layer_is_floating_sel (layer))
{
floating_sel = layer;
}
else
{
if (floating_sel &&
if (floating_sel &&
floating_sel->fs.drawable == GIMP_DRAWABLE (layer))
reverse_list = g_slist_prepend (reverse_list, floating_sel);
{
reverse_list = g_slist_prepend (reverse_list, floating_sel);
}
reverse_list = g_slist_prepend (reverse_list, layer);
}
......@@ -4119,16 +4123,19 @@ gimp_image_get_new_preview (GimpViewable *viewable,
construct_flag = FALSE;
while (reverse_list)
for (; reverse_list; reverse_list = g_slist_next (reverse_list))
{
layer = (GimpLayer *) reverse_list->data;
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
x = (gint) RINT (ratio * off_x);
y = (gint) RINT (ratio * off_y);
w = (gint) RINT (ratio * gimp_drawable_width (GIMP_DRAWABLE (layer)));
h = (gint) RINT (ratio * gimp_drawable_height (GIMP_DRAWABLE (layer)));
y = (gint) RINT (ratio * off_y);
w = (gint) RINT (ratio * gimp_drawable_width (GIMP_DRAWABLE (layer)));
h = (gint) RINT (ratio * gimp_drawable_height (GIMP_DRAWABLE (layer)));
if (w < 1 || h < 1)
continue;
x1 = CLAMP (x, 0, width);
y1 = CLAMP (y, 0, height);
......@@ -4207,8 +4214,6 @@ gimp_image_get_new_preview (GimpViewable *viewable,
}
construct_flag = TRUE;
reverse_list = g_slist_next (reverse_list);
}
g_slist_free (reverse_list);
......
......@@ -4091,6 +4091,7 @@ gimp_image_get_new_preview (GimpViewable *viewable,
temp_buf_data_clear (comp);
floating_sel = NULL;
for (list = GIMP_LIST (gimage->layers)->list;
list;
list = g_list_next (list))
......@@ -4101,16 +4102,19 @@ gimp_image_get_new_preview (GimpViewable *viewable,
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
{
/* floating selections are added right above the layer
they are attached to */
* they are attached to
*/
if (gimp_layer_is_floating_sel (layer))
{
floating_sel = layer;
}
else
{
if (floating_sel &&
if (floating_sel &&
floating_sel->fs.drawable == GIMP_DRAWABLE (layer))
reverse_list = g_slist_prepend (reverse_list, floating_sel);
{
reverse_list = g_slist_prepend (reverse_list, floating_sel);
}
reverse_list = g_slist_prepend (reverse_list, layer);
}
......@@ -4119,16 +4123,19 @@ gimp_image_get_new_preview (GimpViewable *viewable,
construct_flag = FALSE;
while (reverse_list)
for (; reverse_list; reverse_list = g_slist_next (reverse_list))
{
layer = (GimpLayer *) reverse_list->data;
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
x = (gint) RINT (ratio * off_x);
y = (gint) RINT (ratio * off_y);
w = (gint) RINT (ratio * gimp_drawable_width (GIMP_DRAWABLE (layer)));
h = (gint) RINT (ratio * gimp_drawable_height (GIMP_DRAWABLE (layer)));
y = (gint) RINT (ratio * off_y);
w = (gint) RINT (ratio * gimp_drawable_width (GIMP_DRAWABLE (layer)));
h = (gint) RINT (ratio * gimp_drawable_height (GIMP_DRAWABLE (layer)));
if (w < 1 || h < 1)
continue;
x1 = CLAMP (x, 0, width);
y1 = CLAMP (y, 0, height);
......@@ -4207,8 +4214,6 @@ gimp_image_get_new_preview (GimpViewable *viewable,
}
construct_flag = TRUE;
reverse_list = g_slist_next (reverse_list);
}
g_slist_free (reverse_list);
......
......@@ -41,6 +41,8 @@
#include "libgimp/gimpintl.h"
#include "pixmaps/refresh.xpm"
#define COLOR_AREA_SIZE 20
#define COLOR_HISTORY_SIZE 16
......@@ -55,7 +57,7 @@ typedef enum
} ColorNotebookUpdateType;
/* "class" information we keep on each registered colour selector */
/* "class" information we keep on each registered color selector */
typedef struct _ColorSelectorInfo ColorSelectorInfo;
......@@ -123,6 +125,8 @@ static void color_notebook_ok_callback (GtkWidget *widget,
gpointer data);
static void color_notebook_cancel_callback (GtkWidget *widget,
gpointer data);
static void color_notebook_reset_callback (GtkWidget *widget,
gpointer data);
static void color_notebook_update_callback (gpointer data,
const GimpHSV *hsv,
const GimpRGB *rgb);
......@@ -187,13 +191,14 @@ color_notebook_new (const gchar *title,
ColorNotebook *cnp;
GtkWidget *main_vbox;
GtkWidget *main_hbox;
GtkWidget *left_vbox;
GtkWidget *right_vbox;
GtkWidget *colors_frame;
GtkWidget *color_frame;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *label;
GtkWidget *button;
GtkWidget *pixmap;
GtkWidget *arrow;
GtkWidget *color_area;
GimpRGB bw;
......@@ -248,36 +253,66 @@ color_notebook_new (const gchar *title,
color_notebook_update_hsv_values (cnp);
cnp->shell =
gimp_dialog_new (title, "color_selection",
color_notebook_help_func, (const gchar *) cnp,
GTK_WIN_POS_NONE,
FALSE, TRUE, TRUE,
if (wants_updates)
{
cnp->shell =
gimp_dialog_new (title, "color_selection",
color_notebook_help_func, (const gchar *) cnp,
GTK_WIN_POS_NONE,
FALSE, TRUE, TRUE,
"_delete_event_", color_notebook_ok_callback,
cnp, NULL, NULL, TRUE, TRUE,
NULL);
gtk_widget_hide (GTK_WIDGET (g_list_nth_data (gtk_container_children (GTK_CONTAINER (GTK_BIN (cnp->shell)->child)), 0)));
gtk_widget_hide (GTK_DIALOG (cnp->shell)->action_area);
}
else
{
cnp->shell =
gimp_dialog_new (title, "color_selection",
color_notebook_help_func, (const gchar *) cnp,
GTK_WIN_POS_NONE,
FALSE, TRUE, TRUE,
_("OK"), color_notebook_ok_callback,
cnp, NULL, NULL, TRUE, FALSE,
wants_updates ? _("Close") : _("OK"),
color_notebook_ok_callback,
cnp, NULL, NULL, TRUE, wants_updates,
wants_updates ? _("Revert to Old Color") : _("Cancel"),
color_notebook_cancel_callback,
cnp, NULL, NULL, FALSE, !wants_updates,
_("Cancel"), color_notebook_cancel_callback,
cnp, NULL, NULL, FALSE, TRUE,
NULL);
NULL);
}
main_vbox = gtk_vbox_new (FALSE, 6);
main_vbox = gtk_vbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 2);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (cnp->shell)->vbox), main_vbox);
gtk_widget_show (main_vbox);
main_hbox = gtk_hbox_new (FALSE, 6);
main_hbox = gtk_hbox_new (FALSE, 4);
gtk_container_add (GTK_CONTAINER (main_vbox), main_hbox);
gtk_widget_show (main_hbox);
/* The left vbox with the notebook */
left_vbox = gtk_vbox_new (FALSE, 4);
gtk_box_pack_start (GTK_BOX (main_hbox), left_vbox, FALSE, FALSE, 0);
gtk_widget_show (left_vbox);
/* The right vbox with color areas and color space sliders */
right_vbox = gtk_vbox_new (FALSE, 4);
gtk_box_pack_start (GTK_BOX (main_hbox), right_vbox, TRUE, TRUE, 0);
gtk_widget_show (right_vbox);