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> 2001-02-24 Michael Natterer <mitch@gimp.org>
* app/pixmaps2.h: commented out "text_width" and "text_height" * app/pixmaps2.h: commented out "text_width" and "text_height"
......
...@@ -350,9 +350,9 @@ INCLUDES = \ ...@@ -350,9 +350,9 @@ INCLUDES = \
gimp_LDADD = \ gimp_LDADD = \
pdb/libapppdb.la \ pdb/libapppdb.la \
tools/libapptools.la \ tools/libapptools.la \
$(top_builddir)/libgimpcolor/libgimpcolor.la \ $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \
$(top_builddir)/libgimpmath/libgimpmath.la \ $(top_builddir)/libgimpmath/libgimpmath-$(LT_RELEASE).la \
$(top_builddir)/libgimpwidgets/libgimpwidgets.la \ $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \
$(top_builddir)/libgimp/libgimpi.a \ $(top_builddir)/libgimp/libgimpi.a \
$(GTK_LIBS) \ $(GTK_LIBS) \
$(GIMP_THREAD_LIBS) \ $(GIMP_THREAD_LIBS) \
......
...@@ -940,9 +940,11 @@ layers_previous_cmd_callback (GtkWidget *widget, ...@@ -940,9 +940,11 @@ layers_previous_cmd_callback (GtkWidget *widget,
return_if_no_display (gdisp); return_if_no_display (gdisp);
current_layer = 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, new_layer = (GimpLayer *)
gimp_container_get_child_by_index (gdisp->gimage->layers,
current_layer - 1); current_layer - 1);
if (new_layer) if (new_layer)
...@@ -964,9 +966,11 @@ layers_next_cmd_callback (GtkWidget *widget, ...@@ -964,9 +966,11 @@ layers_next_cmd_callback (GtkWidget *widget,
return_if_no_display (gdisp); return_if_no_display (gdisp);
current_layer = 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, new_layer = (GimpLayer *)
gimp_container_get_child_by_index (gdisp->gimage->layers,
current_layer + 1); current_layer + 1);
if (new_layer) if (new_layer)
...@@ -984,7 +988,8 @@ layers_raise_cmd_callback (GtkWidget *widget, ...@@ -984,7 +988,8 @@ layers_raise_cmd_callback (GtkWidget *widget,
GDisplay *gdisp; GDisplay *gdisp;
return_if_no_display (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 (); gdisplays_flush ();
} }
...@@ -995,7 +1000,8 @@ layers_lower_cmd_callback (GtkWidget *widget, ...@@ -995,7 +1000,8 @@ layers_lower_cmd_callback (GtkWidget *widget,
GDisplay *gdisp; GDisplay *gdisp;
return_if_no_display (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 (); gdisplays_flush ();
} }
...@@ -1006,7 +1012,8 @@ layers_raise_to_top_cmd_callback (GtkWidget *widget, ...@@ -1006,7 +1012,8 @@ layers_raise_to_top_cmd_callback (GtkWidget *widget,
GDisplay *gdisp; GDisplay *gdisp;
return_if_no_display (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 (); gdisplays_flush ();
} }
...@@ -1017,7 +1024,8 @@ layers_lower_to_bottom_cmd_callback (GtkWidget *widget, ...@@ -1017,7 +1024,8 @@ layers_lower_to_bottom_cmd_callback (GtkWidget *widget,
GDisplay *gdisp; GDisplay *gdisp;
return_if_no_display (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 (); gdisplays_flush ();
} }
...@@ -1060,7 +1068,8 @@ layers_mask_select_cmd_callback (GtkWidget *widget, ...@@ -1060,7 +1068,8 @@ layers_mask_select_cmd_callback (GtkWidget *widget,
GDisplay *gdisp; GDisplay *gdisp;
return_if_no_display (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 (); gdisplays_flush ();
} }
...@@ -1071,7 +1080,7 @@ layers_add_alpha_channel_cmd_callback (GtkWidget *widget, ...@@ -1071,7 +1080,7 @@ layers_add_alpha_channel_cmd_callback (GtkWidget *widget,
GDisplay *gdisp; GDisplay *gdisp;
return_if_no_display (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 (); gdisplays_flush ();
} }
...@@ -1082,7 +1091,8 @@ layers_alpha_select_cmd_callback (GtkWidget *widget, ...@@ -1082,7 +1091,8 @@ layers_alpha_select_cmd_callback (GtkWidget *widget,
GDisplay *gdisp; GDisplay *gdisp;
return_if_no_display (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 (); gdisplays_flush ();
} }
...@@ -1093,7 +1103,7 @@ layers_resize_to_image_cmd_callback (GtkWidget *widget, ...@@ -1093,7 +1103,7 @@ layers_resize_to_image_cmd_callback (GtkWidget *widget,
GDisplay *gdisp; GDisplay *gdisp;
return_if_no_display (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 (); gdisplays_flush ();
} }
......
...@@ -627,7 +627,7 @@ duplicate (GimpImage *gimage) ...@@ -627,7 +627,7 @@ duplicate (GimpImage *gimage)
gimp_object_get_name (GIMP_OBJECT (layer->mask))); 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; active_layer = new_layer;
if (gimage->floating_sel == layer) if (gimage->floating_sel == layer)
...@@ -656,7 +656,7 @@ duplicate (GimpImage *gimage) ...@@ -656,7 +656,7 @@ duplicate (GimpImage *gimage)
gimp_object_set_name (GIMP_OBJECT (new_channel), gimp_object_set_name (GIMP_OBJECT (new_channel),
gimp_object_get_name (GIMP_OBJECT (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); active_channel = (new_channel);
if (floating_sel_drawable == GIMP_DRAWABLE (channel)) if (floating_sel_drawable == GIMP_DRAWABLE (channel))
...@@ -678,8 +678,12 @@ duplicate (GimpImage *gimage) ...@@ -678,8 +678,12 @@ duplicate (GimpImage *gimage)
new_gimage->selection_mask->boundary_known = FALSE; new_gimage->selection_mask->boundary_known = FALSE;
/* Set active layer, active channel */ /* Set active layer, active channel */
new_gimage->active_layer = active_layer; if (active_layer)
new_gimage->active_channel = active_channel; gimp_image_set_active_layer (new_gimage, active_layer);
if (active_channel)
gimp_image_set_active_channel (new_gimage, active_channel);
if (floating_layer) if (floating_layer)
floating_sel_attach (floating_layer, new_floating_sel_drawable); floating_sel_attach (floating_layer, new_floating_sel_drawable);
......
...@@ -618,8 +618,8 @@ channels_dialog_flush (void) ...@@ -618,8 +618,8 @@ channels_dialog_flush (void)
} }
/* Set the active channel */ /* Set the active channel */
if (channelsD->active_channel != gimage->active_channel) if (channelsD->active_channel != gimp_image_get_active_channel (gimage))
channelsD->active_channel = gimage->active_channel; channelsD->active_channel = gimp_image_get_active_channel (gimage);
/* set the menus if floating sel status has changed */ /* set the menus if floating sel status has changed */
if (channelsD->floating_sel != gimage->floating_sel) if (channelsD->floating_sel != gimage->floating_sel)
...@@ -1044,9 +1044,9 @@ channels_dialog_raise_channel_callback (GtkWidget *widget, ...@@ -1044,9 +1044,9 @@ channels_dialog_raise_channel_callback (GtkWidget *widget,
if (!channelsD || !(gimage = channelsD->gimage)) if (!channelsD || !(gimage = channelsD->gimage))
return; 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 (); gdisplays_flush ();
} }
} }
...@@ -1060,9 +1060,9 @@ channels_dialog_lower_channel_callback (GtkWidget *widget, ...@@ -1060,9 +1060,9 @@ channels_dialog_lower_channel_callback (GtkWidget *widget,
if (!channelsD || !(gimage = channelsD->gimage)) if (!channelsD || !(gimage = channelsD->gimage))
return; 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 (); gdisplays_flush ();
} }
} }
...@@ -1091,13 +1091,14 @@ channels_dialog_delete_channel_callback (GtkWidget *widget, ...@@ -1091,13 +1091,14 @@ channels_dialog_delete_channel_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GimpImage *gimage; GimpImage *gimage;
GimpChannel *active_channel;
if (!channelsD || !(gimage = channelsD->gimage)) if (!channelsD || !(gimage = channelsD->gimage))
return; 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 (); gdisplays_flush ();
} }
} }
...@@ -1107,13 +1108,14 @@ channels_dialog_channel_to_sel_callback (GtkWidget *widget, ...@@ -1107,13 +1108,14 @@ channels_dialog_channel_to_sel_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GimpImage *gimage; GimpImage *gimage;
GimpChannel *active_channel;
if (!channelsD || !(gimage = channelsD->gimage)) if (!channelsD || !(gimage = channelsD->gimage))
return; 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 (); gdisplays_flush ();
} }
} }
......
...@@ -940,9 +940,11 @@ layers_previous_cmd_callback (GtkWidget *widget, ...@@ -940,9 +940,11 @@ layers_previous_cmd_callback (GtkWidget *widget,
return_if_no_display (gdisp); return_if_no_display (gdisp);
current_layer = 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, new_layer = (GimpLayer *)
gimp_container_get_child_by_index (gdisp->gimage->layers,
current_layer - 1); current_layer - 1);
if (new_layer) if (new_layer)
...@@ -964,9 +966,11 @@ layers_next_cmd_callback (GtkWidget *widget, ...@@ -964,9 +966,11 @@ layers_next_cmd_callback (GtkWidget *widget,
return_if_no_display (gdisp); return_if_no_display (gdisp);
current_layer = 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, new_layer = (GimpLayer *)
gimp_container_get_child_by_index (gdisp->gimage->layers,
current_layer + 1); current_layer + 1);
if (new_layer) if (new_layer)
...@@ -984,7 +988,8 @@ layers_raise_cmd_callback (GtkWidget *widget, ...@@ -984,7 +988,8 @@ layers_raise_cmd_callback (GtkWidget *widget,
GDisplay *gdisp; GDisplay *gdisp;
return_if_no_display (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 (); gdisplays_flush ();
} }
...@@ -995,7 +1000,8 @@ layers_lower_cmd_callback (GtkWidget *widget, ...@@ -995,7 +1000,8 @@ layers_lower_cmd_callback (GtkWidget *widget,
GDisplay *gdisp; GDisplay *gdisp;
return_if_no_display (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 (); gdisplays_flush ();
} }
...@@ -1006,7 +1012,8 @@ layers_raise_to_top_cmd_callback (GtkWidget *widget, ...@@ -1006,7 +1012,8 @@ layers_raise_to_top_cmd_callback (GtkWidget *widget,
GDisplay *gdisp; GDisplay *gdisp;
return_if_no_display (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 (); gdisplays_flush ();
} }
...@@ -1017,7 +1024,8 @@ layers_lower_to_bottom_cmd_callback (GtkWidget *widget, ...@@ -1017,7 +1024,8 @@ layers_lower_to_bottom_cmd_callback (GtkWidget *widget,
GDisplay *gdisp; GDisplay *gdisp;
return_if_no_display (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 (); gdisplays_flush ();
} }
...@@ -1060,7 +1068,8 @@ layers_mask_select_cmd_callback (GtkWidget *widget, ...@@ -1060,7 +1068,8 @@ layers_mask_select_cmd_callback (GtkWidget *widget,
GDisplay *gdisp; GDisplay *gdisp;
return_if_no_display (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 (); gdisplays_flush ();
} }
...@@ -1071,7 +1080,7 @@ layers_add_alpha_channel_cmd_callback (GtkWidget *widget, ...@@ -1071,7 +1080,7 @@ layers_add_alpha_channel_cmd_callback (GtkWidget *widget,
GDisplay *gdisp; GDisplay *gdisp;
return_if_no_display (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 (); gdisplays_flush ();
} }
...@@ -1082,7 +1091,8 @@ layers_alpha_select_cmd_callback (GtkWidget *widget, ...@@ -1082,7 +1091,8 @@ layers_alpha_select_cmd_callback (GtkWidget *widget,
GDisplay *gdisp; GDisplay *gdisp;
return_if_no_display (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 (); gdisplays_flush ();
} }
...@@ -1093,7 +1103,7 @@ layers_resize_to_image_cmd_callback (GtkWidget *widget, ...@@ -1093,7 +1103,7 @@ layers_resize_to_image_cmd_callback (GtkWidget *widget,
GDisplay *gdisp; GDisplay *gdisp;
return_if_no_display (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 (); gdisplays_flush ();
} }
......
...@@ -627,7 +627,7 @@ duplicate (GimpImage *gimage) ...@@ -627,7 +627,7 @@ duplicate (GimpImage *gimage)
gimp_object_get_name (GIMP_OBJECT (layer->mask))); 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; active_layer = new_layer;
if (gimage->floating_sel == layer) if (gimage->floating_sel == layer)
...@@ -656,7 +656,7 @@ duplicate (GimpImage *gimage) ...@@ -656,7 +656,7 @@ duplicate (GimpImage *gimage)
gimp_object_set_name (GIMP_OBJECT (new_channel), gimp_object_set_name (GIMP_OBJECT (new_channel),
gimp_object_get_name (GIMP_OBJECT (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); active_channel = (new_channel);
if (floating_sel_drawable == GIMP_DRAWABLE (channel)) if (floating_sel_drawable == GIMP_DRAWABLE (channel))
...@@ -678,8 +678,12 @@ duplicate (GimpImage *gimage) ...@@ -678,8 +678,12 @@ duplicate (GimpImage *gimage)
new_gimage->selection_mask->boundary_known = FALSE; new_gimage->selection_mask->boundary_known = FALSE;
/* Set active layer, active channel */ /* Set active layer, active channel */
new_gimage->active_layer = active_layer; if (active_layer)
new_gimage->active_channel = active_channel; gimp_image_set_active_layer (new_gimage, active_layer);
if (active_channel)
gimp_image_set_active_channel (new_gimage, active_channel);
if (floating_layer) if (floating_layer)
floating_sel_attach (floating_layer, new_floating_sel_drawable); floating_sel_attach (floating_layer, new_floating_sel_drawable);
......
...@@ -627,7 +627,7 @@ duplicate (GimpImage *gimage) ...@@ -627,7 +627,7 @@ duplicate (GimpImage *gimage)
gimp_object_get_name (GIMP_OBJECT (layer->mask))); 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; active_layer = new_layer;
if (gimage->floating_sel == layer) if (gimage->floating_sel == layer)
...@@ -656,7 +656,7 @@ duplicate (GimpImage *gimage) ...@@ -656,7 +656,7 @@ duplicate (GimpImage *gimage)
gimp_object_set_name (GIMP_OBJECT (new_channel), gimp_object_set_name (GIMP_OBJECT (new_channel),
gimp_object_get_name (GIMP_OBJECT (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); active_channel = (new_channel);
if (floating_sel_drawable == GIMP_DRAWABLE (channel)) if (floating_sel_drawable == GIMP_DRAWABLE (channel))
...@@ -678,8 +678,12 @@ duplicate (GimpImage *gimage) ...@@ -678,8 +678,12 @@ duplicate (GimpImage *gimage)
new_gimage->selection_mask->boundary_known = FALSE; new_gimage->selection_mask->boundary_known = FALSE;
/* Set active layer, active channel */ /* Set active layer, active channel */
new_gimage->active_layer = active_layer; if (active_layer)
new_gimage->active_channel = active_channel; gimp_image_set_active_layer (new_gimage, active_layer);
if (active_channel)
gimp_image_set_active_channel (new_gimage, active_channel);
if (floating_layer) if (floating_layer)