Commit 2fd2a4e6 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/channel_ops.c app/channels_dialog.c app/commands.c app/floating_sel.c

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

	* app/channel_ops.c
	* app/channels_dialog.c
	* app/commands.c
	* app/floating_sel.c
	* app/gdisplay.c
	* app/gimpimage.[ch]
	* app/layer_select.c
	* app/layers_dialog.c
	* app/undo.c
	* app/xcf.c
	* app/tools/move.c: remove direct access of gimage->active_layer and
	gimage->active_channel. Reading access is of course harmless, but
	gimp_image_set_active_blah() will trigger a signal emission soon.

	It will probably be neccessary to change the functions to accept
	NULL layers and channels to acheive exactly what weird places like
	floating_sel.c did before by setting it directly.

	* gimptool-1.4.in
	* libgimp/Makefile.am
	* libgimpcolor/Makefile.am
	* libgimpmath/Makefile.am
	* libgimpwidgets/Makefile.am
	* plug-ins/libgck/gck/Makefile.am: made linking against stable
	GIMP installed in the same prefix work again by renaming all our
	libraries explicitly to libgimp<foo>-1.3.* (not as part of the
	libtool revision but as part of the library name). Removed the
	libtool revision to avoid double versioning. This has to be
	hardcoded in the libraries' Makefile.am ...

	* app/Makefile.am
	* plug-ins/FractalExplorer/Makefile.am
	* plug-ins/Lighting/Makefile.am
	* plug-ins/MapObject/Makefile.am
	* plug-ins/bmp/Makefile.am
	* plug-ins/common/Makefile.am
	* plug-ins/common/mkgen.pl
	* plug-ins/dbbrowser/Makefile.am
	* plug-ins/faxg3/Makefile.am
	* plug-ins/fits/Makefile.am
	* plug-ins/flame/Makefile.am
	* plug-ins/fp/Makefile.am
	* plug-ins/gap/Makefile.am
	* plug-ins/gdyntext/Makefile.am
	* plug-ins/gfig/Makefile.am
	* plug-ins/gflare/Makefile.am
	* plug-ins/gfli/Makefile.am
	* plug-ins/gimpressionist/Makefile.am
	* plug-ins/helpbrowser/Makefile.am
	* plug-ins/ifscompose/Makefile.am
	* plug-ins/imagemap/Makefile.am
	* plug-ins/maze/Makefile.am
	* plug-ins/mosaic/Makefile.am
	* plug-ins/pagecurl/Makefile.am
	* plug-ins/plugin-helper/Makefile.am
	* plug-ins/print/Makefile.am
	* plug-ins/rcm/Makefile.am
	* plug-ins/script-fu/Makefile.am
	* plug-ins/sel2path/Makefile.am
	* plug-ins/sgi/Makefile.am
	* plug-ins/webbrowser/Makefile.am
	* plug-ins/xjt/Makefile.am: ... while all other Makefiles can simply
	link against "libgimp<foo>-$(LT_REVISION).la"
parent 539ee1fe
2001-02-25 Michael Natterer <mitch@gimp.org>
* app/channel_ops.c
* app/channels_dialog.c
* app/commands.c
* app/floating_sel.c
* app/gdisplay.c
* app/gimpimage.[ch]
* app/layer_select.c
* app/layers_dialog.c
* app/undo.c
* app/xcf.c
* app/tools/move.c: remove direct access of gimage->active_layer and
gimage->active_channel. Reading access is of course harmless, but
gimp_image_set_active_blah() will trigger a signal emission soon.
It will probably be neccessary to change the functions to accept
NULL layers and channels to acheive exactly what weird places like
floating_sel.c did before by setting it directly.
* gimptool-1.4.in
* libgimp/Makefile.am
* libgimpcolor/Makefile.am
* libgimpmath/Makefile.am
* libgimpwidgets/Makefile.am
* plug-ins/libgck/gck/Makefile.am: made linking against stable
GIMP installed in the same prefix work again by renaming all our
libraries explicitly to libgimp<foo>-1.3.* (not as part of the
libtool revision but as part of the library name). Removed the
libtool revision to avoid double versioning. This has to be
hardcoded in the libraries' Makefile.am ...
* app/Makefile.am
* plug-ins/FractalExplorer/Makefile.am
* plug-ins/Lighting/Makefile.am
* plug-ins/MapObject/Makefile.am
* plug-ins/bmp/Makefile.am
* plug-ins/common/Makefile.am
* plug-ins/common/mkgen.pl
* plug-ins/dbbrowser/Makefile.am
* plug-ins/faxg3/Makefile.am
* plug-ins/fits/Makefile.am
* plug-ins/flame/Makefile.am
* plug-ins/fp/Makefile.am
* plug-ins/gap/Makefile.am
* plug-ins/gdyntext/Makefile.am
* plug-ins/gfig/Makefile.am
* plug-ins/gflare/Makefile.am
* plug-ins/gfli/Makefile.am
* plug-ins/gimpressionist/Makefile.am
* plug-ins/helpbrowser/Makefile.am
* plug-ins/ifscompose/Makefile.am
* plug-ins/imagemap/Makefile.am
* plug-ins/maze/Makefile.am
* plug-ins/mosaic/Makefile.am
* plug-ins/pagecurl/Makefile.am
* plug-ins/plugin-helper/Makefile.am
* plug-ins/print/Makefile.am
* plug-ins/rcm/Makefile.am
* plug-ins/script-fu/Makefile.am
* plug-ins/sel2path/Makefile.am
* plug-ins/sgi/Makefile.am
* plug-ins/webbrowser/Makefile.am
* plug-ins/xjt/Makefile.am: ... while all other Makefiles can simply
link against "libgimp<foo>-$(LT_REVISION).la"
2001-02-24 Michael Natterer <mitch@gimp.org>
* app/pixmaps2.h: commented out "text_width" and "text_height"
......
......@@ -318,16 +318,16 @@ gimp_SOURCES = \
histogramwidget.c \
histogramwidget.h \
\
marching_ants.h \
marching_ants.h \
pixmaps2.h
EXTRA_DIST = \
makefile.mingw \
makefile.mingw.in \
makefile.msc \
gimp.rc \
gimp.sym \
wilber.ico \
makefile.mingw \
makefile.mingw.in \
makefile.msc \
gimp.rc \
gimp.sym \
wilber.ico \
arch/i386/mmx/paint_funcs_mmx.S
......@@ -348,15 +348,15 @@ INCLUDES = \
-I$(includedir)
gimp_LDADD = \
pdb/libapppdb.la \
tools/libapptools.la \
$(top_builddir)/libgimpcolor/libgimpcolor.la \
$(top_builddir)/libgimpmath/libgimpmath.la \
$(top_builddir)/libgimpwidgets/libgimpwidgets.la \
$(top_builddir)/libgimp/libgimpi.a \
$(GTK_LIBS) \
$(GIMP_THREAD_LIBS) \
$(GIMP_MP_LIBS) \
pdb/libapppdb.la \
tools/libapptools.la \
$(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \
$(top_builddir)/libgimpmath/libgimpmath-$(LT_RELEASE).la \
$(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \
$(top_builddir)/libgimp/libgimpi.a \
$(GTK_LIBS) \
$(GIMP_THREAD_LIBS) \
$(GIMP_MP_LIBS) \
$(INTLLIBS)
.PHONY: files
......
......@@ -940,10 +940,12 @@ layers_previous_cmd_callback (GtkWidget *widget,
return_if_no_display (gdisp);
current_layer =
gimp_image_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer);
gimp_image_get_layer_index (gdisp->gimage,
gimp_image_get_active_layer (gdisp->gimage));
new_layer = (GimpLayer *) gimp_container_get_child_by_index (gdisp->gimage->layers,
current_layer - 1);
new_layer = (GimpLayer *)
gimp_container_get_child_by_index (gdisp->gimage->layers,
current_layer - 1);
if (new_layer)
{
......@@ -964,10 +966,12 @@ layers_next_cmd_callback (GtkWidget *widget,
return_if_no_display (gdisp);
current_layer =
gimp_image_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer);
gimp_image_get_layer_index (gdisp->gimage,
gimp_image_get_active_layer (gdisp->gimage));
new_layer = (GimpLayer *) gimp_container_get_child_by_index (gdisp->gimage->layers,
current_layer + 1);
new_layer = (GimpLayer *)
gimp_container_get_child_by_index (gdisp->gimage->layers,
current_layer + 1);
if (new_layer)
{
......@@ -984,7 +988,8 @@ layers_raise_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
gimp_image_raise_layer (gdisp->gimage, gdisp->gimage->active_layer);
gimp_image_raise_layer (gdisp->gimage,
gimp_image_get_active_layer (gdisp->gimage));
gdisplays_flush ();
}
......@@ -995,7 +1000,8 @@ layers_lower_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
gimp_image_lower_layer (gdisp->gimage, gdisp->gimage->active_layer);
gimp_image_lower_layer (gdisp->gimage,
gimp_image_get_active_layer (gdisp->gimage));
gdisplays_flush ();
}
......@@ -1006,7 +1012,8 @@ layers_raise_to_top_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
gimp_image_raise_layer_to_top (gdisp->gimage, gdisp->gimage->active_layer);
gimp_image_raise_layer_to_top (gdisp->gimage,
gimp_image_get_active_layer (gdisp->gimage));
gdisplays_flush ();
}
......@@ -1017,7 +1024,8 @@ layers_lower_to_bottom_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
gimp_image_lower_layer_to_bottom (gdisp->gimage, gdisp->gimage->active_layer);
gimp_image_lower_layer_to_bottom (gdisp->gimage,
gimp_image_get_active_layer (gdisp->gimage));
gdisplays_flush ();
}
......@@ -1060,7 +1068,8 @@ layers_mask_select_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
gimage_mask_layer_mask (gdisp->gimage, gdisp->gimage->active_layer);
gimage_mask_layer_mask (gdisp->gimage,
gimp_image_get_active_layer (gdisp->gimage));
gdisplays_flush ();
}
......@@ -1071,7 +1080,7 @@ layers_add_alpha_channel_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
gimp_layer_add_alpha ( gdisp->gimage->active_layer);
gimp_layer_add_alpha (gimp_image_get_active_layer (gdisp->gimage));
gdisplays_flush ();
}
......@@ -1082,7 +1091,8 @@ layers_alpha_select_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
gimage_mask_layer_alpha (gdisp->gimage, gdisp->gimage->active_layer);
gimage_mask_layer_alpha (gdisp->gimage,
gimp_image_get_active_layer (gdisp->gimage));
gdisplays_flush ();
}
......@@ -1093,7 +1103,7 @@ layers_resize_to_image_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
gimp_layer_resize_to_image (gdisp->gimage->active_layer);
gimp_layer_resize_to_image (gimp_image_get_active_layer (gdisp->gimage));
gdisplays_flush ();
}
......
......@@ -576,7 +576,7 @@ duplicate (GimpImage *gimage)
GimpChannel *channel, *new_channel;
GList *list;
Guide *guide = NULL;
GimpLayer *active_layer = NULL;
GimpLayer *active_layer = NULL;
GimpChannel *active_channel = NULL;
GimpDrawable *new_floating_sel_drawable = NULL;
GimpDrawable *floating_sel_drawable = NULL;
......@@ -627,7 +627,7 @@ duplicate (GimpImage *gimage)
gimp_object_get_name (GIMP_OBJECT (layer->mask)));
}
if (gimage->active_layer == layer)
if (gimp_image_get_active_layer (gimage) == layer)
active_layer = new_layer;
if (gimage->floating_sel == layer)
......@@ -656,7 +656,7 @@ duplicate (GimpImage *gimage)
gimp_object_set_name (GIMP_OBJECT (new_channel),
gimp_object_get_name (GIMP_OBJECT (channel)));
if (gimage->active_channel == channel)
if (gimp_image_get_active_channel (gimage) == channel)
active_channel = (new_channel);
if (floating_sel_drawable == GIMP_DRAWABLE (channel))
......@@ -678,8 +678,12 @@ duplicate (GimpImage *gimage)
new_gimage->selection_mask->boundary_known = FALSE;
/* Set active layer, active channel */
new_gimage->active_layer = active_layer;
new_gimage->active_channel = active_channel;
if (active_layer)
gimp_image_set_active_layer (new_gimage, active_layer);
if (active_channel)
gimp_image_set_active_channel (new_gimage, active_channel);
if (floating_layer)
floating_sel_attach (floating_layer, new_floating_sel_drawable);
......
......@@ -618,8 +618,8 @@ channels_dialog_flush (void)
}
/* Set the active channel */
if (channelsD->active_channel != gimage->active_channel)
channelsD->active_channel = gimage->active_channel;
if (channelsD->active_channel != gimp_image_get_active_channel (gimage))
channelsD->active_channel = gimp_image_get_active_channel (gimage);
/* set the menus if floating sel status has changed */
if (channelsD->floating_sel != gimage->floating_sel)
......@@ -1044,9 +1044,9 @@ channels_dialog_raise_channel_callback (GtkWidget *widget,
if (!channelsD || !(gimage = channelsD->gimage))
return;
if (gimage->active_channel != NULL)
if (gimp_image_get_active_channel (gimage))
{
gimp_image_raise_channel (gimage, gimage->active_channel);
gimp_image_raise_channel (gimage, gimp_image_get_active_channel (gimage));
gdisplays_flush ();
}
}
......@@ -1060,9 +1060,9 @@ channels_dialog_lower_channel_callback (GtkWidget *widget,
if (!channelsD || !(gimage = channelsD->gimage))
return;
if (gimage->active_channel != NULL)
if (gimp_image_get_active_channel (gimage))
{
gimp_image_lower_channel (gimage, gimage->active_channel);
gimp_image_lower_channel (gimage, gimp_image_get_active_channel (gimage));
gdisplays_flush ();
}
}
......@@ -1090,14 +1090,15 @@ void
channels_dialog_delete_channel_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpImage *gimage;
GimpChannel *active_channel;
if (!channelsD || !(gimage = channelsD->gimage))
return;
if (gimage->active_channel != NULL)
if ((active_channel = gimp_image_get_active_channel (gimage)))
{
gimp_image_remove_channel (gimage, gimage->active_channel);
gimp_image_remove_channel (gimage, active_channel);
gdisplays_flush ();
}
}
......@@ -1106,14 +1107,15 @@ void
channels_dialog_channel_to_sel_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpImage *gimage;
GimpChannel *active_channel;
if (!channelsD || !(gimage = channelsD->gimage))
return;
if (gimage->active_channel != NULL)
if ((active_channel = gimp_image_get_active_channel (gimage)))
{
gimage_mask_load (gimage, gimage->active_channel);
gimage_mask_load (gimage, active_channel);
gdisplays_flush ();
}
}
......
......@@ -940,10 +940,12 @@ layers_previous_cmd_callback (GtkWidget *widget,
return_if_no_display (gdisp);
current_layer =
gimp_image_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer);
gimp_image_get_layer_index (gdisp->gimage,
gimp_image_get_active_layer (gdisp->gimage));
new_layer = (GimpLayer *) gimp_container_get_child_by_index (gdisp->gimage->layers,
current_layer - 1);
new_layer = (GimpLayer *)
gimp_container_get_child_by_index (gdisp->gimage->layers,
current_layer - 1);
if (new_layer)
{
......@@ -964,10 +966,12 @@ layers_next_cmd_callback (GtkWidget *widget,
return_if_no_display (gdisp);
current_layer =
gimp_image_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer);
gimp_image_get_layer_index (gdisp->gimage,
gimp_image_get_active_layer (gdisp->gimage));
new_layer = (GimpLayer *) gimp_container_get_child_by_index (gdisp->gimage->layers,
current_layer + 1);
new_layer = (GimpLayer *)
gimp_container_get_child_by_index (gdisp->gimage->layers,
current_layer + 1);
if (new_layer)
{
......@@ -984,7 +988,8 @@ layers_raise_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
gimp_image_raise_layer (gdisp->gimage, gdisp->gimage->active_layer);
gimp_image_raise_layer (gdisp->gimage,
gimp_image_get_active_layer (gdisp->gimage));
gdisplays_flush ();
}
......@@ -995,7 +1000,8 @@ layers_lower_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
gimp_image_lower_layer (gdisp->gimage, gdisp->gimage->active_layer);
gimp_image_lower_layer (gdisp->gimage,
gimp_image_get_active_layer (gdisp->gimage));
gdisplays_flush ();
}
......@@ -1006,7 +1012,8 @@ layers_raise_to_top_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
gimp_image_raise_layer_to_top (gdisp->gimage, gdisp->gimage->active_layer);
gimp_image_raise_layer_to_top (gdisp->gimage,
gimp_image_get_active_layer (gdisp->gimage));
gdisplays_flush ();
}
......@@ -1017,7 +1024,8 @@ layers_lower_to_bottom_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
gimp_image_lower_layer_to_bottom (gdisp->gimage, gdisp->gimage->active_layer);
gimp_image_lower_layer_to_bottom (gdisp->gimage,
gimp_image_get_active_layer (gdisp->gimage));
gdisplays_flush ();
}
......@@ -1060,7 +1068,8 @@ layers_mask_select_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
gimage_mask_layer_mask (gdisp->gimage, gdisp->gimage->active_layer);
gimage_mask_layer_mask (gdisp->gimage,
gimp_image_get_active_layer (gdisp->gimage));
gdisplays_flush ();
}
......@@ -1071,7 +1080,7 @@ layers_add_alpha_channel_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
gimp_layer_add_alpha ( gdisp->gimage->active_layer);
gimp_layer_add_alpha (gimp_image_get_active_layer (gdisp->gimage));
gdisplays_flush ();
}
......@@ -1082,7 +1091,8 @@ layers_alpha_select_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
gimage_mask_layer_alpha (gdisp->gimage, gdisp->gimage->active_layer);
gimage_mask_layer_alpha (gdisp->gimage,
gimp_image_get_active_layer (gdisp->gimage));
gdisplays_flush ();
}
......@@ -1093,7 +1103,7 @@ layers_resize_to_image_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
gimp_layer_resize_to_image (gdisp->gimage->active_layer);
gimp_layer_resize_to_image (gimp_image_get_active_layer (gdisp->gimage));
gdisplays_flush ();
}
......
......@@ -576,7 +576,7 @@ duplicate (GimpImage *gimage)
GimpChannel *channel, *new_channel;
GList *list;
Guide *guide = NULL;
GimpLayer *active_layer = NULL;
GimpLayer *active_layer = NULL;
GimpChannel *active_channel = NULL;
GimpDrawable *new_floating_sel_drawable = NULL;
GimpDrawable *floating_sel_drawable = NULL;
......@@ -627,7 +627,7 @@ duplicate (GimpImage *gimage)
gimp_object_get_name (GIMP_OBJECT (layer->mask)));
}
if (gimage->active_layer == layer)
if (gimp_image_get_active_layer (gimage) == layer)
active_layer = new_layer;
if (gimage->floating_sel == layer)
......@@ -656,7 +656,7 @@ duplicate (GimpImage *gimage)
gimp_object_set_name (GIMP_OBJECT (new_channel),
gimp_object_get_name (GIMP_OBJECT (channel)));
if (gimage->active_channel == channel)
if (gimp_image_get_active_channel (gimage) == channel)
active_channel = (new_channel);
if (floating_sel_drawable == GIMP_DRAWABLE (channel))
......@@ -678,8 +678,12 @@ duplicate (GimpImage *gimage)
new_gimage->selection_mask->boundary_known = FALSE;
/* Set active layer, active channel */
new_gimage->active_layer = active_layer;
new_gimage->active_channel = active_channel;
if (active_layer)
gimp_image_set_active_layer (new_gimage, active_layer);
if (active_channel)
gimp_image_set_active_channel (new_gimage, active_channel);
if (floating_layer)
floating_sel_attach (floating_layer, new_floating_sel_drawable);
......
......@@ -576,7 +576,7 @@ duplicate (GimpImage *gimage)
GimpChannel *channel, *new_channel;
GList *list;
Guide *guide = NULL;
GimpLayer *active_layer = NULL;
GimpLayer *active_layer = NULL;
GimpChannel *active_channel = NULL;
GimpDrawable *new_floating_sel_drawable = NULL;
GimpDrawable *floating_sel_drawable = NULL;
......@@ -627,7 +627,7 @@ duplicate (GimpImage *gimage)
gimp_object_get_name (GIMP_OBJECT (layer->mask)));
}
if (gimage->active_layer == layer)
if (gimp_image_get_active_layer (gimage) == layer)
active_layer = new_layer;
if (gimage->floating_sel == layer)
......@@ -656,7 +656,7 @@ duplicate (GimpImage *gimage)
gimp_object_set_name (GIMP_OBJECT (new_channel),
gimp_object_get_name (GIMP_OBJECT (channel)));
if (gimage->active_channel == channel)
if (gimp_image_get_active_channel (gimage) == channel)
active_channel = (new_channel);
if (floating_sel_drawable == GIMP_DRAWABLE (channel))
......@@ -678,8 +678,12 @@ duplicate (GimpImage *gimage)
new_gimage->selection_mask->boundary_known = FALSE;
/* Set active layer, active channel */
new_gimage->active_layer = active_layer;
new_gimage->active_channel = active_channel;
if (active_layer)
gimp_image_set_active_layer (new_gimage, active_layer);
if (active_channel)
gimp_image_set_active_channel (new_gimage, active_channel);
if (floating_layer)
floating_sel_attach (floating_layer, new_floating_sel_drawable);
......
......@@ -717,7 +717,8 @@ gimp_image_scale (GimpImage *gimage,
if ((new_width == 0) || (new_height == 0))
{
g_message (("gimp_image_scale: Scaling to zero width or height has been rejected."));
g_message ("%s(): Scaling to zero width or height has been rejected.",
G_GNUC_FUNCTION);
return;
}
......@@ -884,7 +885,7 @@ gimp_image_apply_image (GimpImage *gimage,
operation = valid_combinations[gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("gimp_image_apply_image sent illegal parameters");
g_message ("%s(): illegal parameters", G_GNUC_FUNCTION);
return;
}
......@@ -991,7 +992,7 @@ gimp_image_replace_image (GimpImage *gimage,
operation = valid_combinations [gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("gimp_image_apply_image sent illegal parameters");
g_message ("%s(): got illegal parameters", G_GNUC_FUNCTION);
return;
}
......@@ -1561,7 +1562,7 @@ project_indexed (GimpImage *gimage,
initial_region (src, dest, NULL, gimage->cmap, layer->opacity,
layer->mode, gimage->visible, INITIAL_INDEXED);
else
g_message ("Unable to project indexed image.");
g_message ("%s(): unable to project indexed image.", G_GNUC_FUNCTION);
}
static void
......@@ -2298,7 +2299,9 @@ gimp_image_layer_boundary (const GimpImage *gimage,
/* The second boundary corresponds to the active layer's
* perimeter...
*/
if ((layer = gimage->active_layer))
layer = gimp_image_get_active_layer (gimage);
if (layer)
{
*segs = gimp_layer_boundary (layer, n_segs);
return TRUE;
......@@ -2474,7 +2477,8 @@ gimp_image_raise_layer (GimpImage *gimage,
/* is this the top layer already? */
if (curpos == 0)
{
g_message (_("Layer cannot be raised any further"));
g_message (_("%s(): layer cannot be raised any further"),
G_GNUC_FUNCTION);
return FALSE;
}
......@@ -2501,7 +2505,8 @@ gimp_image_lower_layer (GimpImage *gimage,
length = gimp_container_num_children (gimage->layers);
if (curpos >= length - 1)
{
g_message (_("Layer cannot be lowered any further"));
g_message (_("%s(): layer cannot be lowered any further"),
G_GNUC_FUNCTION);
return FALSE;
}
......@@ -2525,13 +2530,14 @@ gimp_image_raise_layer_to_top (GimpImage *gimage,
if (curpos == 0)
{
g_message (_("Layer is already on top"));
g_message (_("%s(): layer is already on top"),
G_GNUC_FUNCTION);
return FALSE;
}
if (! gimp_layer_has_alpha (layer))
{
g_message (_("Can't raise Layer without alpha"));
g_message (_("%s(): can't raise Layer without alpha"), G_GNUC_FUNCTION);
return FALSE;
}
......@@ -2558,7 +2564,7 @@ gimp_image_lower_layer_to_bottom (GimpImage *gimage,
if (curpos >= length - 1)
{
g_message (_("Layer is already on bottom"));
g_message (_("%s(): layer is already on bottom"), G_GNUC_FUNCTION);
return FALSE;
}
......@@ -2615,7 +2621,7 @@ gimp_image_position_layer (GimpImage *gimage,
}
if (push_undo)
undo_push_layer_reposition (gimage, layer);
undo_push_layer_reposition (gimage, layer);
gimp_container_reorder (gimage->layers, GIMP_OBJECT (layer), new_index);
......@@ -2816,8 +2822,8 @@ gimp_image_merge_layers (GimpImage *gimage,
{
x1 = off_x;
y1 = off_y;
x2 = off_x + gimp_drawable_width (GIMP_DRAWABLE(layer));
y2 = off_y + gimp_drawable_height (GIMP_DRAWABLE(layer));
x2 = off_x + gimp_drawable_width (GIMP_DRAWABLE (layer));
y2 = off_y + gimp_drawable_height (GIMP_DRAWABLE (layer));
}
else
{
......@@ -2825,10 +2831,10 @@ gimp_image_merge_layers (GimpImage *gimage,
x1 = off_x;
if (off_y < y1)
y1 = off_y;
if ((off_x + gimp_drawable_width (GIMP_DRAWABLE(layer))) > x2)
x2 = (off_x + gimp_drawable_width (GIMP_DRAWABLE(layer)));
if ((off_y + gimp_drawable_height (GIMP_DRAWABLE(layer))) > y2)
y2 = (off_y + gimp_drawable_height (GIMP_DRAWABLE(layer)));
if ((off_x + gimp_drawable_width (GIMP_DRAWABLE (layer))) > x2)
x2 = (off_x + gimp_drawable_width (GIMP_DRAWABLE (layer)));
if ((off_y + gimp_drawable_height (GIMP_DRAWABLE (layer))) > y2)
y2 = (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)));
}
if (merge_type == CLIP_TO_IMAGE)
{
......@@ -2844,8 +2850,8 @@ gimp_image_merge_layers (GimpImage *gimage,
{
x1 = off_x;
y1 = off_y;
x2 = off_x + gimp_drawable_width (GIMP_DRAWABLE(layer));
y2 = off_y + gimp_drawable_height (GIMP_DRAWABLE(layer));
x2 = off_x + gimp_drawable_width (GIMP_DRAWABLE (layer));
y2 = off_y + gimp_drawable_height (GIMP_DRAWABLE (layer));
}
break;
......@@ -2936,7 +2942,7 @@ gimp_image_merge_layers (GimpImage *gimage,
/* Set the layer to transparent */
pixel_region_init (&src1PR,
gimp_drawable_data (GIMP_DRAWABLE(merge_layer)),
gimp_drawable_data (GIMP_DRAWABLE (merge_layer)),
0, 0,
(x2 - x1), (y2 - y1),
TRUE);
......@@ -2972,7 +2978,7 @@ gimp_image_merge_layers (GimpImage *gimage,
gimp_drawable_set_tattoo (GIMP_DRAWABLE (merge_layer),
gimp_drawable_get_tattoo (GIMP_DRAWABLE (layer)));
GIMP_DRAWABLE (merge_layer)->parasites =
parasite_list_copy (GIMP_DRAWABLE(layer)->parasites);
parasite_list_copy (GIMP_DRAWABLE (layer)->parasites);
while (reverse_list)
{
......@@ -3109,7 +3115,7 @@ gimp_image_add_layer (GimpImage *gimage,
lu = g_new (LayerUndo, 1);
lu->layer = layer;
lu->prev_position = 0;
lu->prev_layer = gimage->active_layer;
lu->prev_layer = gimp_image_get_active_layer (gimage);
undo_push_layer (gimage, LAYER_ADD_UNDO, lu);
/* If the layer is a floating selection, set the ID */
......@@ -3143,8 +3149,6 @@ gimp_image_add_layer (GimpImage *gimage,
gimp_container_insert (gimage->layers, GIMP_OBJECT (layer), position);
gimage->layer_stack = g_slist_prepend (gimage->layer_stack, layer);
/* notify the layers dialog of the currently active layer */
gimp_image_set_active_layer (gimage, layer);
......@@ -3197,7 +3201,7 @@ gimp_image_remove_layer (GimpImage *gimage,
floating_sel_reset (layer);
}
if (gimage->active_layer == layer)
if (layer == gimp_image_get_active_layer (gimage))
{
if (gimage->layer_stack)
gimp_image_set_active_layer (gimage, gimage->layer_stack->data);
......@@ -3223,6 +3227,8 @@ gimp_image_add_layer_mask (GimpImage *gimage,
LayerMaskUndo *lmu;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
g_return_val_if_fail (GIMP_IS_LAYER (layer), NULL);
g_return_val_if_fail (GIMP_IS_LAYER_MASK (mask), NULL);
if (layer->mask != NULL)
{
......@@ -3274,7 +3280,8 @@ gimp_image_remove_layer_mask (GimpImage *gimage,
gint off_x;
gint off_y;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage) && GIMP_IS_LAYER (layer), NULL);