diff --git a/ChangeLog b/ChangeLog index 6f7f2a6663..0ebc01e37b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,69 @@ +2001-02-25 Michael Natterer + + * 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-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-$(LT_REVISION).la" + 2001-02-24 Michael Natterer * app/pixmaps2.h: commented out "text_width" and "text_height" diff --git a/app/Makefile.am b/app/Makefile.am index 8c9e734d03..bc1c31b297 100644 --- a/app/Makefile.am +++ b/app/Makefile.am @@ -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 diff --git a/app/actions/help-commands.c b/app/actions/help-commands.c index a4d614b090..f92ff8fca8 100644 --- a/app/actions/help-commands.c +++ b/app/actions/help-commands.c @@ -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 (); } diff --git a/app/channel_ops.c b/app/channel_ops.c index a728e64be3..11e5390c1e 100644 --- a/app/channel_ops.c +++ b/app/channel_ops.c @@ -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); diff --git a/app/channels_dialog.c b/app/channels_dialog.c index 51677fc290..4f2de9e46d 100644 --- a/app/channels_dialog.c +++ b/app/channels_dialog.c @@ -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 (); } } diff --git a/app/commands.c b/app/commands.c index a4d614b090..f92ff8fca8 100644 --- a/app/commands.c +++ b/app/commands.c @@ -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 (); } diff --git a/app/core/gimpdrawable-offset.c b/app/core/gimpdrawable-offset.c index a728e64be3..11e5390c1e 100644 --- a/app/core/gimpdrawable-offset.c +++ b/app/core/gimpdrawable-offset.c @@ -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); diff --git a/app/core/gimpimage-duplicate.c b/app/core/gimpimage-duplicate.c index a728e64be3..11e5390c1e 100644 --- a/app/core/gimpimage-duplicate.c +++ b/app/core/gimpimage-duplicate.c @@ -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); diff --git a/app/core/gimpimage-guides.c b/app/core/gimpimage-guides.c index 1bbde96973..3017fc8ab0 100644 --- a/app/core/gimpimage-guides.c +++ b/app/core/gimpimage-guides.c @@ -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); + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_LAYER (layer), NULL); if (!layer || !layer->mask) return NULL; @@ -3419,16 +3426,18 @@ gimp_image_add_channel (GimpImage *gimage, g_return_val_if_fail (channel != NULL, FALSE); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE); - if (GIMP_DRAWABLE(channel)->gimage != NULL && - GIMP_DRAWABLE(channel)->gimage != gimage) + if (GIMP_DRAWABLE (channel)->gimage != NULL && + GIMP_DRAWABLE (channel)->gimage != gimage) { - g_message ("gimp_image_add_channel: attempt to add channel to wrong image"); + g_message ("%s(): attempt to add channel to wrong image", + G_GNUC_FUNCTION); return FALSE; } if (gimp_container_have (gimage->channels, GIMP_OBJECT (channel))) { - g_message ("gimp_image_add_channel: trying to add channel to image twice"); + g_message ("%s(): trying to add channel to image twice", + G_GNUC_FUNCTION); return FALSE; } @@ -3436,7 +3445,7 @@ gimp_image_add_channel (GimpImage *gimage, cu = g_new (ChannelUndo, 1); cu->channel = channel; cu->prev_position = 0; - cu->prev_channel = gimage->active_channel; + cu->prev_channel = gimp_image_get_active_channel (gimage); undo_push_channel (gimage, CHANNEL_ADD_UNDO, cu); /* add the channel to the list */ @@ -3475,9 +3484,9 @@ gimp_image_remove_channel (GimpImage *gimage, cu->channel = channel; cu->prev_position = gimp_container_get_child_index (gimage->channels, GIMP_OBJECT (channel)); - cu->prev_channel = gimage->active_channel; + cu->prev_channel = gimp_image_get_active_channel (gimage); undo_push_channel (gimage, CHANNEL_REMOVE_UNDO, cu); - + gtk_object_ref (GTK_OBJECT (channel)); gimp_container_remove (gimage->channels, GIMP_OBJECT (channel)); @@ -3485,9 +3494,12 @@ gimp_image_remove_channel (GimpImage *gimage, /* Send out REMOVED signal from channel */ gimp_drawable_removed (GIMP_DRAWABLE (channel)); - if (gimage->active_channel == channel) - gimage->active_channel = - GIMP_CHANNEL (gimp_container_get_child_by_index (gimage->channels, 0)); + if (channel == gimp_image_get_active_channel (gimage)) + { + gimp_image_set_active_channel + (gimage, + GIMP_CHANNEL (gimp_container_get_child_by_index (gimage->channels, 0))); + } gtk_object_unref (GTK_OBJECT (channel)); @@ -3520,11 +3532,11 @@ gimp_image_active_drawable (const GimpImage *gimage) /* If there is an active channel (a saved selection, etc.), * we ignore the active layer */ - if (gimage->active_channel != NULL) + if (gimage->active_channel) { return GIMP_DRAWABLE (gimage->active_channel); } - else if (gimage->active_layer != NULL) + else if (gimage->active_layer) { layer = gimage->active_layer; diff --git a/app/core/gimpimage-guides.h b/app/core/gimpimage-guides.h index dff739843e..805e30de37 100644 --- a/app/core/gimpimage-guides.h +++ b/app/core/gimpimage-guides.h @@ -91,7 +91,7 @@ struct _GimpImage TileManager *shadow; /* shadow buffer tiles */ - /* Projection attributes */ + /* Projection attributes */ gint construct_flag; /* flag for construction */ GimpImageType proj_type; /* type of the projection image */ gint proj_bytes; /* bpp in projection image */ @@ -101,15 +101,15 @@ struct _GimpImage GList *guides; /* guides */ - /* Layer/Channel attributes */ + /* Layer/Channel attributes */ GimpContainer *layers; /* the list of layers */ GimpContainer *channels; /* the list of masks */ GSList *layer_stack; /* the layers in MRU order */ - GimpLayer *active_layer; /* ID of active layer */ - GimpChannel *active_channel; /* ID of active channel */ - GimpLayer *floating_sel; /* ID of fs layer */ - GimpChannel *selection_mask; /* selection mask channel */ + GimpLayer *active_layer; /* the active layer */ + GimpChannel *active_channel; /* the active channel */ + GimpLayer *floating_sel; /* the FS layer */ + GimpChannel *selection_mask; /* the selection mask channel */ ParasiteList *parasites; /* Plug-in parasite data */ @@ -124,7 +124,7 @@ struct _GimpImage gboolean qmask_state; /* TRUE if qmask is on */ GimpRGB qmask_color; /* rgba triplet of the color */ - /* Undo apparatus */ + /* Undo apparatus */ GSList *undo_stack; /* stack for undo operations */ GSList *redo_stack; /* stack for redo operations */ gint undo_bytes; /* bytes in undo stack */ @@ -133,7 +133,7 @@ struct _GimpImage UndoType pushing_undo_group; /* undo group status flag */ GtkWidget *undo_history; /* history viewer, or NULL */ - /* Composite preview */ + /* Composite preview */ TempBuf *comp_preview; /* the composite preview */ gboolean comp_preview_valid; /* preview valid-1/channel */ }; diff --git a/app/core/gimpimage-merge.c b/app/core/gimpimage-merge.c index 1bbde96973..3017fc8ab0 100644 --- a/app/core/gimpimage-merge.c +++ b/app/core/gimpimage-merge.c @@ -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); + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_LAYER (layer), NULL); if (!layer || !layer->mask) return NULL; @@ -3419,16 +3426,18 @@ gimp_image_add_channel (GimpImage *gimage, g_return_val_if_fail (channel != NULL, FALSE); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE); - if (GIMP_DRAWABLE(channel)->gimage != NULL && - GIMP_DRAWABLE(channel)->gimage != gimage) + if (GIMP_DRAWABLE (channel)->gimage != NULL && + GIMP_DRAWABLE (channel)->gimage != gimage) { - g_message ("gimp_image_add_channel: attempt to add channel to wrong image"); + g_message ("%s(): attempt to add channel to wrong image", + G_GNUC_FUNCTION); return FALSE; } if (gimp_container_have (gimage->channels, GIMP_OBJECT (channel))) { - g_message ("gimp_image_add_channel: trying to add channel to image twice"); + g_message ("%s(): trying to add channel to image twice", + G_GNUC_FUNCTION); return FALSE; } @@ -3436,7 +3445,7 @@ gimp_image_add_channel (GimpImage *gimage, cu = g_new (ChannelUndo, 1); cu->channel = channel; cu->prev_position = 0; - cu->prev_channel = gimage->active_channel; + cu->prev_channel = gimp_image_get_active_channel (gimage); undo_push_channel (gimage, CHANNEL_ADD_UNDO, cu); /* add the channel to the list */ @@ -3475,9 +3484,9 @@ gimp_image_remove_channel (GimpImage *gimage, cu->channel = channel; cu->prev_position = gimp_container_get_child_index (gimage->channels, GIMP_OBJECT (channel)); - cu->prev_channel = gimage->active_channel; + cu->prev_channel = gimp_image_get_active_channel (gimage); undo_push_channel (gimage, CHANNEL_REMOVE_UNDO, cu); - + gtk_object_ref (GTK_OBJECT (channel)); gimp_container_remove (gimage->channels, GIMP_OBJECT (channel)); @@ -3485,9 +3494,12 @@ gimp_image_remove_channel (GimpImage *gimage, /* Send out REMOVED signal from channel */ gimp_drawable_removed (GIMP_DRAWABLE (channel)); - if (gimage->active_channel == channel) - gimage->active_channel = - GIMP_CHANNEL (gimp_container_get_child_by_index (gimage->channels, 0)); + if (channel == gimp_image_get_active_channel (gimage)) + { + gimp_image_set_active_channel + (gimage, + GIMP_CHANNEL (gimp_container_get_child_by_index (gimage->channels, 0))); + } gtk_object_unref (GTK_OBJECT (channel)); @@ -3520,11 +3532,11 @@ gimp_image_active_drawable (const GimpImage *gimage) /* If there is an active channel (a saved selection, etc.), * we ignore the active layer */ - if (gimage->active_channel != NULL) + if (gimage->active_channel) { return GIMP_DRAWABLE (gimage->active_channel); } - else if (gimage->active_layer != NULL) + else if (gimage->active_layer) { layer = gimage->active_layer; diff --git a/app/core/gimpimage-merge.h b/app/core/gimpimage-merge.h index dff739843e..805e30de37 100644 --- a/app/core/gimpimage-merge.h +++ b/app/core/gimpimage-merge.h @@ -91,7 +91,7 @@ struct _GimpImage TileManager *shadow; /* shadow buffer tiles */ - /* Projection attributes */ + /* Projection attributes */ gint construct_flag; /* flag for construction */ GimpImageType proj_type; /* type of the projection image */ gint proj_bytes; /* bpp in projection image */ @@ -101,15 +101,15 @@ struct _GimpImage GList *guides; /* guides */ - /* Layer/Channel attributes */ + /* Layer/Channel attributes */ GimpContainer *layers; /* the list of layers */ GimpContainer *channels; /* the list of masks */ GSList *layer_stack; /* the layers in MRU order */ - GimpLayer *active_layer; /* ID of active layer */ - GimpChannel *active_channel; /* ID of active channel */ - GimpLayer *floating_sel; /* ID of fs layer */ - GimpChannel *selection_mask; /* selection mask channel */ + GimpLayer *active_layer; /* the active layer */ + GimpChannel *active_channel; /* the active channel */ + GimpLayer *floating_sel; /* the FS layer */ + GimpChannel *selection_mask; /* the selection mask channel */ ParasiteList *parasites; /* Plug-in parasite data */ @@ -124,7 +124,7 @@ struct _GimpImage gboolean qmask_state; /* TRUE if qmask is on */ GimpRGB qmask_color; /* rgba triplet of the color */ - /* Undo apparatus */ + /* Undo apparatus */ GSList *undo_stack; /* stack for undo operations */ GSList *redo_stack; /* stack for redo operations */ gint undo_bytes; /* bytes in undo stack */ @@ -133,7 +133,7 @@ struct _GimpImage UndoType pushing_undo_group; /* undo group status flag */ GtkWidget *undo_history; /* history viewer, or NULL */ - /* Composite preview */ + /* Composite preview */ TempBuf *comp_preview; /* the composite preview */ gboolean comp_preview_valid; /* preview valid-1/channel */ }; diff --git a/app/core/gimpimage-projection.c b/app/core/gimpimage-projection.c index 1bbde96973..3017fc8ab0 100644 --- a/app/core/gimpimage-projection.c +++ b/app/core/gimpimage-projection.c @@ -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); + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_LAYER (layer), NULL); if (!layer || !layer->mask) return NULL; @@ -3419,16 +3426,18 @@ gimp_image_add_channel (GimpImage *gimage, g_return_val_if_fail (channel != NULL, FALSE); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE); - if (GIMP_DRAWABLE(channel)->gimage != NULL && - GIMP_DRAWABLE(channel)->gimage != gimage) + if (GIMP_DRAWABLE (channel)->gimage != NULL && + GIMP_DRAWABLE (channel)->gimage != gimage) { - g_message ("gimp_image_add_channel: attempt to add channel to wrong image"); + g_message ("%s(): attempt to add channel to wrong image", + G_GNUC_FUNCTION); return FALSE; } if (gimp_container_have (gimage->channels, GIMP_OBJECT (channel))) { - g_message ("gimp_image_add_channel: trying to add channel to image twice"); + g_message ("%s(): trying to add channel to image twice", + G_GNUC_FUNCTION); return FALSE; } @@ -3436,7 +3445,7 @@ gimp_image_add_channel (GimpImage *gimage, cu = g_new (ChannelUndo, 1); cu->channel = channel; cu->prev_position = 0; - cu->prev_channel = gimage->active_channel; + cu->prev_channel = gimp_image_get_active_channel (gimage); undo_push_channel (gimage, CHANNEL_ADD_UNDO, cu); /* add the channel to the list */ @@ -3475,9 +3484,9 @@ gimp_image_remove_channel (GimpImage *gimage, cu->channel = channel; cu->prev_position = gimp_container_get_child_index (gimage->channels, GIMP_OBJECT (channel)); - cu->prev_channel = gimage->active_channel; + cu->prev_channel = gimp_image_get_active_channel (gimage); undo_push_channel (gimage, CHANNEL_REMOVE_UNDO, cu); - + gtk_object_ref (GTK_OBJECT (channel)); gimp_container_remove (gimage->channels, GIMP_OBJECT (channel)); @@ -3485,9 +3494,12 @@ gimp_image_remove_channel (GimpImage *gimage, /* Send out REMOVED signal from channel */ gimp_drawable_removed (GIMP_DRAWABLE (channel)); - if (gimage->active_channel == channel) - gimage->active_channel = - GIMP_CHANNEL (gimp_container_get_child_by_index (gimage->channels, 0)); + if (channel == gimp_image_get_active_channel (gimage)) + { + gimp_image_set_active_channel + (gimage, + GIMP_CHANNEL (gimp_container_get_child_by_index (gimage->channels, 0))); + } gtk_object_unref (GTK_OBJECT (channel)); @@ -3520,11 +3532,11 @@ gimp_image_active_drawable (const GimpImage *gimage) /* If there is an active channel (a saved selection, etc.), * we ignore the active layer */ - if (gimage->active_channel != NULL) + if (gimage->active_channel) { return GIMP_DRAWABLE (gimage->active_channel); } - else if (gimage->active_layer != NULL) + else if (gimage->active_layer) { layer = gimage->active_layer; diff --git a/app/core/gimpimage-projection.h b/app/core/gimpimage-projection.h index dff739843e..805e30de37 100644 --- a/app/core/gimpimage-projection.h +++ b/app/core/gimpimage-projection.h @@ -91,7 +91,7 @@ struct _GimpImage TileManager *shadow; /* shadow buffer tiles */ - /* Projection attributes */ + /* Projection attributes */ gint construct_flag; /* flag for construction */ GimpImageType proj_type; /* type of the projection image */ gint proj_bytes; /* bpp in projection image */ @@ -101,15 +101,15 @@ struct _GimpImage GList *guides; /* guides */ - /* Layer/Channel attributes */ + /* Layer/Channel attributes */ GimpContainer *layers; /* the list of layers */ GimpContainer *channels; /* the list of masks */ GSList *layer_stack; /* the layers in MRU order */ - GimpLayer *active_layer; /* ID of active layer */ - GimpChannel *active_channel; /* ID of active channel */ - GimpLayer *floating_sel; /* ID of fs layer */ - GimpChannel *selection_mask; /* selection mask channel */ + GimpLayer *active_layer; /* the active layer */ + GimpChannel *active_channel; /* the active channel */ + GimpLayer *floating_sel; /* the FS layer */ + GimpChannel *selection_mask; /* the selection mask channel */ ParasiteList *parasites; /* Plug-in parasite data */ @@ -124,7 +124,7 @@ struct _GimpImage gboolean qmask_state; /* TRUE if qmask is on */ GimpRGB qmask_color; /* rgba triplet of the color */ - /* Undo apparatus */ + /* Undo apparatus */ GSList *undo_stack; /* stack for undo operations */ GSList *redo_stack; /* stack for redo operations */ gint undo_bytes; /* bytes in undo stack */ @@ -133,7 +133,7 @@ struct _GimpImage UndoType pushing_undo_group; /* undo group status flag */ GtkWidget *undo_history; /* history viewer, or NULL */ - /* Composite preview */ + /* Composite preview */ TempBuf *comp_preview; /* the composite preview */ gboolean comp_preview_valid; /* preview valid-1/channel */ }; diff --git a/app/core/gimpimage-resize.c b/app/core/gimpimage-resize.c index 1bbde96973..3017fc8ab0 100644 --- a/app/core/gimpimage-resize.c +++ b/app/core/gimpimage-resize.c @@ -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); + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_LAYER (layer), NULL); if (!layer || !layer->mask) return NULL; @@ -3419,16 +3426,18 @@ gimp_image_add_channel (GimpImage *gimage, g_return_val_if_fail (channel != NULL, FALSE); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE); - if (GIMP_DRAWABLE(channel)->gimage != NULL && - GIMP_DRAWABLE(channel)->gimage != gimage) + if (GIMP_DRAWABLE (channel)->gimage != NULL && + GIMP_DRAWABLE (channel)->gimage != gimage) { - g_message ("gimp_image_add_channel: attempt to add channel to wrong image"); + g_message ("%s(): attempt to add channel to wrong image", + G_GNUC_FUNCTION); return FALSE; } if (gimp_container_have (gimage->channels, GIMP_OBJECT (channel))) { - g_message ("gimp_image_add_channel: trying to add channel to image twice"); + g_message ("%s(): trying to add channel to image twice", + G_GNUC_FUNCTION); return FALSE; } @@ -3436,7 +3445,7 @@ gimp_image_add_channel (GimpImage *gimage, cu = g_new (ChannelUndo, 1); cu->channel = channel; cu->prev_position = 0; - cu->prev_channel = gimage->active_channel; + cu->prev_channel = gimp_image_get_active_channel (gimage); undo_push_channel (gimage, CHANNEL_ADD_UNDO, cu); /* add the channel to the list */ @@ -3475,9 +3484,9 @@ gimp_image_remove_channel (GimpImage *gimage, cu->channel = channel; cu->prev_position = gimp_container_get_child_index (gimage->channels, GIMP_OBJECT (channel)); - cu->prev_channel = gimage->active_channel; + cu->prev_channel = gimp_image_get_active_channel (gimage); undo_push_channel (gimage, CHANNEL_REMOVE_UNDO, cu); - + gtk_object_ref (GTK_OBJECT (channel)); gimp_container_remove (gimage->channels, GIMP_OBJECT (channel)); @@ -3485,9 +3494,12 @@ gimp_image_remove_channel (GimpImage *gimage, /* Send out REMOVED signal from channel */ gimp_drawable_removed (GIMP_DRAWABLE (channel)); - if (gimage->active_channel == channel) - gimage->active_channel = - GIMP_CHANNEL (gimp_container_get_child_by_index (gimage->channels, 0)); + if (channel == gimp_image_get_active_channel (gimage)) + { + gimp_image_set_active_channel + (gimage, + GIMP_CHANNEL (gimp_container_get_child_by_index (gimage->channels, 0))); + } gtk_object_unref (GTK_OBJECT (channel)); @@ -3520,11 +3532,11 @@ gimp_image_active_drawable (const GimpImage *gimage) /* If there is an active channel (a saved selection, etc.), * we ignore the active layer */ - if (gimage->active_channel != NULL) + if (gimage->active_channel) { return GIMP_DRAWABLE (gimage->active_channel); } - else if (gimage->active_layer != NULL) + else if (gimage->active_layer) { layer = gimage->active_layer; diff --git a/app/core/gimpimage-resize.h b/app/core/gimpimage-resize.h index dff739843e..805e30de37 100644 --- a/app/core/gimpimage-resize.h +++ b/app/core/gimpimage-resize.h @@ -91,7 +91,7 @@ struct _GimpImage TileManager *shadow; /* shadow buffer tiles */ - /* Projection attributes */ + /* Projection attributes */ gint construct_flag; /* flag for construction */ GimpImageType proj_type; /* type of the projection image */ gint proj_bytes; /* bpp in projection image */ @@ -101,15 +101,15 @@ struct _GimpImage GList *guides; /* guides */ - /* Layer/Channel attributes */ + /* Layer/Channel attributes */ GimpContainer *layers; /* the list of layers */ GimpContainer *channels; /* the list of masks */ GSList *layer_stack; /* the layers in MRU order */ - GimpLayer *active_layer; /* ID of active layer */ - GimpChannel *active_channel; /* ID of active channel */ - GimpLayer *floating_sel; /* ID of fs layer */ - GimpChannel *selection_mask; /* selection mask channel */ + GimpLayer *active_layer; /* the active layer */ + GimpChannel *active_channel; /* the active channel */ + GimpLayer *floating_sel; /* the FS layer */ + GimpChannel *selection_mask; /* the selection mask channel */ ParasiteList *parasites; /* Plug-in parasite data */ @@ -124,7 +124,7 @@ struct _GimpImage gboolean qmask_state; /* TRUE if qmask is on */ GimpRGB qmask_color; /* rgba triplet of the color */ - /* Undo apparatus */ + /* Undo apparatus */ GSList *undo_stack; /* stack for undo operations */ GSList *redo_stack; /* stack for redo operations */ gint undo_bytes; /* bytes in undo stack */ @@ -133,7 +133,7 @@ struct _GimpImage UndoType pushing_undo_group; /* undo group status flag */ GtkWidget *undo_history; /* history viewer, or NULL */ - /* Composite preview */ + /* Composite preview */ TempBuf *comp_preview; /* the composite preview */ gboolean comp_preview_valid; /* preview valid-1/channel */ }; diff --git a/app/core/gimpimage-scale.c b/app/core/gimpimage-scale.c index 1bbde96973..3017fc8ab0 100644 --- a/app/core/gimpimage-scale.c +++ b/app/core/gimpimage-scale.c @@ -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); + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_LAYER (layer), NULL); if (!layer || !layer->mask) return NULL; @@ -3419,16 +3426,18 @@ gimp_image_add_channel (GimpImage *gimage, g_return_val_if_fail (channel != NULL, FALSE); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE); - if (GIMP_DRAWABLE(channel)->gimage != NULL && - GIMP_DRAWABLE(channel)->gimage != gimage) + if (GIMP_DRAWABLE (channel)->gimage != NULL && + GIMP_DRAWABLE (channel)->gimage != gimage) { - g_message ("gimp_image_add_channel: attempt to add channel to wrong image"); + g_message ("%s(): attempt to add channel to wrong image", + G_GNUC_FUNCTION); return FALSE; } if (gimp_container_have (gimage->channels, GIMP_OBJECT (channel))) { - g_message ("gimp_image_add_channel: trying to add channel to image twice"); + g_message ("%s(): trying to add channel to image twice", + G_GNUC_FUNCTION); return FALSE; } @@ -3436,7 +3445,7 @@ gimp_image_add_channel (GimpImage *gimage, cu = g_new (ChannelUndo, 1); cu->channel = channel; cu->prev_position = 0; - cu->prev_channel = gimage->active_channel; + cu->prev_channel = gimp_image_get_active_channel (gimage); undo_push_channel (gimage, CHANNEL_ADD_UNDO, cu); /* add the channel to the list */ @@ -3475,9 +3484,9 @@ gimp_image_remove_channel (GimpImage *gimage, cu->channel = channel; cu->prev_position = gimp_container_get_child_index (gimage->channels, GIMP_OBJECT (channel)); - cu->prev_channel = gimage->active_channel; + cu->prev_channel = gimp_image_get_active_channel (gimage); undo_push_channel (gimage, CHANNEL_REMOVE_UNDO, cu); - + gtk_object_ref (GTK_OBJECT (channel)); gimp_container_remove (gimage->channels, GIMP_OBJECT (channel)); @@ -3485,9 +3494,12 @@ gimp_image_remove_channel (GimpImage *gimage, /* Send out REMOVED signal from channel */ gimp_drawable_removed (GIMP_DRAWABLE (channel)); - if (gimage->active_channel == channel) - gimage->active_channel = - GIMP_CHANNEL (gimp_container_get_child_by_index (gimage->channels, 0)); + if (channel == gimp_image_get_active_channel (gimage)) + { + gimp_image_set_active_channel + (gimage, + GIMP_CHANNEL (gimp_container_get_child_by_index (gimage->channels, 0))); + } gtk_object_unref (GTK_OBJECT (channel)); @@ -3520,11 +3532,11 @@ gimp_image_active_drawable (const GimpImage *gimage) /* If there is an active channel (a saved selection, etc.), * we ignore the active layer */ - if (gimage->active_channel != NULL) + if (gimage->active_channel) { return GIMP_DRAWABLE (gimage->active_channel); } - else if (gimage->active_layer != NULL) + else if (gimage->active_layer) { layer = gimage->active_layer; diff --git a/app/core/gimpimage-scale.h b/app/core/gimpimage-scale.h index dff739843e..805e30de37 100644 --- a/app/core/gimpimage-scale.h +++ b/app/core/gimpimage-scale.h @@ -91,7 +91,7 @@ struct _GimpImage TileManager *shadow; /* shadow buffer tiles */ - /* Projection attributes */ + /* Projection attributes */ gint construct_flag; /* flag for construction */ GimpImageType proj_type; /* type of the projection image */ gint proj_bytes; /* bpp in projection image */ @@ -101,15 +101,15 @@ struct _GimpImage GList *guides; /* guides */ - /* Layer/Channel attributes */ + /* Layer/Channel attributes */ GimpContainer *layers; /* the list of layers */ GimpContainer *channels; /* the list of masks */ GSList *layer_stack; /* the layers in MRU order */ - GimpLayer *active_layer; /* ID of active layer */ - GimpChannel *active_channel; /* ID of active channel */ - GimpLayer *floating_sel; /* ID of fs layer */ - GimpChannel *selection_mask; /* selection mask channel */ + GimpLayer *active_layer; /* the active layer */ + GimpChannel *active_channel; /* the active channel */ + GimpLayer *floating_sel; /* the FS layer */ + GimpChannel *selection_mask; /* the selection mask channel */ ParasiteList *parasites; /* Plug-in parasite data */ @@ -124,7 +124,7 @@ struct _GimpImage gboolean qmask_state; /* TRUE if qmask is on */ GimpRGB qmask_color; /* rgba triplet of the color */ - /* Undo apparatus */ + /* Undo apparatus */ GSList *undo_stack; /* stack for undo operations */ GSList *redo_stack; /* stack for redo operations */ gint undo_bytes; /* bytes in undo stack */ @@ -133,7 +133,7 @@ struct _GimpImage UndoType pushing_undo_group; /* undo group status flag */ GtkWidget *undo_history; /* history viewer, or NULL */ - /* Composite preview */ + /* Composite preview */ TempBuf *comp_preview; /* the composite preview */ gboolean comp_preview_valid; /* preview valid-1/channel */ }; diff --git a/app/core/gimpimage-undo-push.c b/app/core/gimpimage-undo-push.c index 4b42d5585d..5e4b0760e1 100644 --- a/app/core/gimpimage-undo-push.c +++ b/app/core/gimpimage-undo-push.c @@ -1488,11 +1488,11 @@ undo_pop_layer (GimpImage *gimage, else { /* record the active layer */ - lu->prev_layer = gimage->active_layer; + lu->prev_layer = gimp_image_get_active_layer (gimage); /* hide the current selection--for all views */ - if (gimage->active_layer != NULL) - gimp_layer_invalidate_boundary ((gimage->active_layer)); + if (gimp_image_get_active_layer (gimage)) + gimp_layer_invalidate_boundary (gimp_image_get_active_layer (gimage)); /* if this is a floating selection, set the fs pointer */ if (gimp_layer_is_floating_sel (lu->layer)) @@ -1501,8 +1501,7 @@ undo_pop_layer (GimpImage *gimage, /* add the new layer */ gimp_container_insert (gimage->layers, GIMP_OBJECT (lu->layer), lu->prev_position); - gimage->layer_stack = g_slist_prepend (gimage->layer_stack, lu->layer); - gimage->active_layer = lu->layer; + gimp_image_set_active_layer (gimage, lu->layer); drawable_update (GIMP_DRAWABLE (lu->layer), 0, 0, GIMP_DRAWABLE (lu->layer)->width, @@ -1834,7 +1833,7 @@ undo_pop_channel (GimpImage *gimage, else { /* record the active channel */ - cu->prev_channel = gimage->active_channel; + cu->prev_channel = gimp_image_get_active_channel (gimage); /* add the new channel */ gimp_container_insert (gimage->channels, @@ -2009,7 +2008,7 @@ undo_pop_fs_to_layer (GimpImage *gimage, gimp_viewable_invalidate_preview (GIMP_VIEWABLE (fsu->layer)); fsu->layer->fs.drawable = fsu->drawable; - gimage->active_layer = fsu->layer; + gimp_image_set_active_layer (gimage, fsu->layer); gimage->floating_sel = fsu->layer; /* restore the contents of the drawable */ diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c index 1bbde96973..3017fc8ab0 100644 --- a/app/core/gimpimage.c +++ b/app/core/gimpimage.c @@ -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); + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_LAYER (layer), NULL); if (!layer || !layer->mask) return NULL; @@ -3419,16 +3426,18 @@ gimp_image_add_channel (GimpImage *gimage, g_return_val_if_fail (channel != NULL, FALSE); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE); - if (GIMP_DRAWABLE(channel)->gimage != NULL && - GIMP_DRAWABLE(channel)->gimage != gimage) + if (GIMP_DRAWABLE (channel)->gimage != NULL && + GIMP_DRAWABLE (channel)->gimage != gimage) { - g_message ("gimp_image_add_channel: attempt to add channel to wrong image"); + g_message ("%s(): attempt to add channel to wrong image", + G_GNUC_FUNCTION); return FALSE; } if (gimp_container_have (gimage->channels, GIMP_OBJECT (channel))) { - g_message ("gimp_image_add_channel: trying to add channel to image twice"); + g_message ("%s(): trying to add channel to image twice", + G_GNUC_FUNCTION); return FALSE; } @@ -3436,7 +3445,7 @@ gimp_image_add_channel (GimpImage *gimage, cu = g_new (ChannelUndo, 1); cu->channel = channel; cu->prev_position = 0; - cu->prev_channel = gimage->active_channel; + cu->prev_channel = gimp_image_get_active_channel (gimage); undo_push_channel (gimage, CHANNEL_ADD_UNDO, cu); /* add the channel to the list */ @@ -3475,9 +3484,9 @@ gimp_image_remove_channel (GimpImage *gimage, cu->channel = channel; cu->prev_position = gimp_container_get_child_index (gimage->channels, GIMP_OBJECT (channel)); - cu->prev_channel = gimage->active_channel; + cu->prev_channel = gimp_image_get_active_channel (gimage); undo_push_channel (gimage, CHANNEL_REMOVE_UNDO, cu); - + gtk_object_ref (GTK_OBJECT (channel)); gimp_container_remove (gimage->channels, GIMP_OBJECT (channel)); @@ -3485,9 +3494,12 @@ gimp_image_remove_channel (GimpImage *gimage, /* Send out REMOVED signal from channel */ gimp_drawable_removed (GIMP_DRAWABLE (channel)); - if (gimage->active_channel == channel) - gimage->active_channel = - GIMP_CHANNEL (gimp_container_get_child_by_index (gimage->channels, 0)); + if (channel == gimp_image_get_active_channel (gimage)) + { + gimp_image_set_active_channel + (gimage, + GIMP_CHANNEL (gimp_container_get_child_by_index (gimage->channels, 0))); + } gtk_object_unref (GTK_OBJECT (channel)); @@ -3520,11 +3532,11 @@ gimp_image_active_drawable (const GimpImage *gimage) /* If there is an active channel (a saved selection, etc.), * we ignore the active layer */ - if (gimage->active_channel != NULL) + if (gimage->active_channel) { return GIMP_DRAWABLE (gimage->active_channel); } - else if (gimage->active_layer != NULL) + else if (gimage->active_layer) { layer = gimage->active_layer; diff --git a/app/core/gimpimage.h b/app/core/gimpimage.h index dff739843e..805e30de37 100644 --- a/app/core/gimpimage.h +++ b/app/core/gimpimage.h @@ -91,7 +91,7 @@ struct _GimpImage TileManager *shadow; /* shadow buffer tiles */ - /* Projection attributes */ + /* Projection attributes */ gint construct_flag; /* flag for construction */ GimpImageType proj_type; /* type of the projection image */ gint proj_bytes; /* bpp in projection image */ @@ -101,15 +101,15 @@ struct _GimpImage GList *guides; /* guides */ - /* Layer/Channel attributes */ + /* Layer/Channel attributes */ GimpContainer *layers; /* the list of layers */ GimpContainer *channels; /* the list of masks */ GSList *layer_stack; /* the layers in MRU order */ - GimpLayer *active_layer; /* ID of active layer */ - GimpChannel *active_channel; /* ID of active channel */ - GimpLayer *floating_sel; /* ID of fs layer */ - GimpChannel *selection_mask; /* selection mask channel */ + GimpLayer *active_layer; /* the active layer */ + GimpChannel *active_channel; /* the active channel */ + GimpLayer *floating_sel; /* the FS layer */ + GimpChannel *selection_mask; /* the selection mask channel */ ParasiteList *parasites; /* Plug-in parasite data */ @@ -124,7 +124,7 @@ struct _GimpImage gboolean qmask_state; /* TRUE if qmask is on */ GimpRGB qmask_color; /* rgba triplet of the color */ - /* Undo apparatus */ + /* Undo apparatus */ GSList *undo_stack; /* stack for undo operations */ GSList *redo_stack; /* stack for redo operations */ gint undo_bytes; /* bytes in undo stack */ @@ -133,7 +133,7 @@ struct _GimpImage UndoType pushing_undo_group; /* undo group status flag */ GtkWidget *undo_history; /* history viewer, or NULL */ - /* Composite preview */ + /* Composite preview */ TempBuf *comp_preview; /* the composite preview */ gboolean comp_preview_valid; /* preview valid-1/channel */ }; diff --git a/app/core/gimplayer-floating-sel.c b/app/core/gimplayer-floating-sel.c index dee93955d2..5bf46f2c80 100644 --- a/app/core/gimplayer-floating-sel.c +++ b/app/core/gimplayer-floating-sel.c @@ -155,18 +155,23 @@ floating_sel_reset (GimpLayer *layer) /* set the underlying drawable to active */ if (GIMP_IS_LAYER (layer->fs.drawable)) - gimp_image_set_active_layer (gimage, GIMP_LAYER (layer->fs.drawable)); + { + gimp_image_set_active_layer (gimage, GIMP_LAYER (layer->fs.drawable)); + } else if (GIMP_IS_LAYER_MASK (layer->fs.drawable)) - gimp_image_set_active_layer (gimage, - GIMP_LAYER_MASK (layer->fs.drawable)->layer); + { + gimp_image_set_active_layer (gimage, + GIMP_LAYER_MASK (layer->fs.drawable)->layer); + } else if (GIMP_IS_CHANNEL (layer->fs.drawable)) { gimp_image_set_active_channel (gimage, GIMP_CHANNEL (layer->fs.drawable)); if (gimp_container_num_children (gimage->layers)) - gimage->active_layer = (((GimpLayer *) gimage->layer_stack->data)); - else - gimage->active_layer = NULL; + { + gimp_image_set_active_layer (gimage, + (GimpLayer *) gimage->layer_stack->data); + } } } diff --git a/app/core/gimpprojection-construct.c b/app/core/gimpprojection-construct.c index 1bbde96973..3017fc8ab0 100644 --- a/app/core/gimpprojection-construct.c +++ b/app/core/gimpprojection-construct.c @@ -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); + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_LAYER (layer), NULL); if (!layer || !layer->mask) return NULL; @@ -3419,16 +3426,18 @@ gimp_image_add_channel (GimpImage *gimage, g_return_val_if_fail (channel != NULL, FALSE); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE); - if (GIMP_DRAWABLE(channel)->gimage != NULL && - GIMP_DRAWABLE(channel)->gimage != gimage) + if (GIMP_DRAWABLE (channel)->gimage != NULL && + GIMP_DRAWABLE (channel)->gimage != gimage) { - g_message ("gimp_image_add_channel: attempt to add channel to wrong image"); + g_message ("%s(): attempt to add channel to wrong image", + G_GNUC_FUNCTION); return FALSE; } if (gimp_container_have (gimage->channels, GIMP_OBJECT (channel))) { - g_message ("gimp_image_add_channel: trying to add channel to image twice"); + g_message ("%s(): trying to add channel to image twice", + G_GNUC_FUNCTION); return FALSE; } @@ -3436,7 +3445,7 @@ gimp_image_add_channel (GimpImage *gimage, cu = g_new (ChannelUndo, 1); cu->channel = channel; cu->prev_position = 0; - cu->prev_channel = gimage->active_channel; + cu->prev_channel = gimp_image_get_active_channel (gimage); undo_push_channel (gimage, CHANNEL_ADD_UNDO, cu); /* add the channel to the list */ @@ -3475,9 +3484,9 @@ gimp_image_remove_channel (GimpImage *gimage, cu->channel = channel; cu->prev_position = gimp_container_get_child_index (gimage->channels, GIMP_OBJECT (channel)); - cu->prev_channel = gimage->active_channel; + cu->prev_channel = gimp_image_get_active_channel (gimage); undo_push_channel (gimage, CHANNEL_REMOVE_UNDO, cu); - + gtk_object_ref (GTK_OBJECT (channel)); gimp_container_remove (gimage->channels, GIMP_OBJECT (channel)); @@ -3485,9 +3494,12 @@ gimp_image_remove_channel (GimpImage *gimage, /* Send out REMOVED signal from channel */ gimp_drawable_removed (GIMP_DRAWABLE (channel)); - if (gimage->active_channel == channel) - gimage->active_channel = - GIMP_CHANNEL (gimp_container_get_child_by_index (gimage->channels, 0)); + if (channel == gimp_image_get_active_channel (gimage)) + { + gimp_image_set_active_channel + (gimage, + GIMP_CHANNEL (gimp_container_get_child_by_index (gimage->channels, 0))); + } gtk_object_unref (GTK_OBJECT (channel)); @@ -3520,11 +3532,11 @@ gimp_image_active_drawable (const GimpImage *gimage) /* If there is an active channel (a saved selection, etc.), * we ignore the active layer */ - if (gimage->active_channel != NULL) + if (gimage->active_channel) { return GIMP_DRAWABLE (gimage->active_channel); } - else if (gimage->active_layer != NULL) + else if (gimage->active_layer) { layer = gimage->active_layer; diff --git a/app/core/gimpprojection-construct.h b/app/core/gimpprojection-construct.h index dff739843e..805e30de37 100644 --- a/app/core/gimpprojection-construct.h +++ b/app/core/gimpprojection-construct.h @@ -91,7 +91,7 @@ struct _GimpImage TileManager *shadow; /* shadow buffer tiles */ - /* Projection attributes */ + /* Projection attributes */ gint construct_flag; /* flag for construction */ GimpImageType proj_type; /* type of the projection image */ gint proj_bytes; /* bpp in projection image */ @@ -101,15 +101,15 @@ struct _GimpImage GList *guides; /* guides */ - /* Layer/Channel attributes */ + /* Layer/Channel attributes */ GimpContainer *layers; /* the list of layers */ GimpContainer *channels; /* the list of masks */ GSList *layer_stack; /* the layers in MRU order */ - GimpLayer *active_layer; /* ID of active layer */ - GimpChannel *active_channel; /* ID of active channel */ - GimpLayer *floating_sel; /* ID of fs layer */ - GimpChannel *selection_mask; /* selection mask channel */ + GimpLayer *active_layer; /* the active layer */ + GimpChannel *active_channel; /* the active channel */ + GimpLayer *floating_sel; /* the FS layer */ + GimpChannel *selection_mask; /* the selection mask channel */ ParasiteList *parasites; /* Plug-in parasite data */ @@ -124,7 +124,7 @@ struct _GimpImage gboolean qmask_state; /* TRUE if qmask is on */ GimpRGB qmask_color; /* rgba triplet of the color */ - /* Undo apparatus */ + /* Undo apparatus */ GSList *undo_stack; /* stack for undo operations */ GSList *redo_stack; /* stack for redo operations */ gint undo_bytes; /* bytes in undo stack */ @@ -133,7 +133,7 @@ struct _GimpImage UndoType pushing_undo_group; /* undo group status flag */ GtkWidget *undo_history; /* history viewer, or NULL */ - /* Composite preview */ + /* Composite preview */ TempBuf *comp_preview; /* the composite preview */ gboolean comp_preview_valid; /* preview valid-1/channel */ }; diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c index 91d0fd6fbd..eeb7b67375 100644 --- a/app/core/gimpprojection.c +++ b/app/core/gimpprojection.c @@ -1965,8 +1965,7 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp) alpha = gimp_layer_has_alpha (layer); } - lind = gimp_image_get_layer_index (gdisp->gimage, - gdisp->gimage->active_layer); + lind = gimp_image_get_layer_index (gdisp->gimage, layer); lnum = gimp_container_num_children (gdisp->gimage->layers); } } diff --git a/app/display/gimpdisplay.c b/app/display/gimpdisplay.c index 91d0fd6fbd..eeb7b67375 100644 --- a/app/display/gimpdisplay.c +++ b/app/display/gimpdisplay.c @@ -1965,8 +1965,7 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp) alpha = gimp_layer_has_alpha (layer); } - lind = gimp_image_get_layer_index (gdisp->gimage, - gdisp->gimage->active_layer); + lind = gimp_image_get_layer_index (gdisp->gimage, layer); lnum = gimp_container_num_children (gdisp->gimage->layers); } } diff --git a/app/display/gimpdisplayshell-layer-select.c b/app/display/gimpdisplayshell-layer-select.c index c639058f93..7ad1809dc5 100644 --- a/app/display/gimpdisplayshell-layer-select.c +++ b/app/display/gimpdisplayshell-layer-select.c @@ -266,7 +266,8 @@ layer_select_end (LayerSelect *layer_select, gtk_widget_hide (layer_select->shell); /* only reset the active layer if a new layer was specified */ - if (layer_select->current_layer != layer_select->gimage->active_layer) + if (layer_select->current_layer != + gimp_image_get_active_layer (layer_select->gimage)) { gimp_image_set_active_layer (layer_select->gimage, layer_select->current_layer); @@ -281,9 +282,9 @@ layer_select_set_gimage (LayerSelect *layer_select, gint image_width; gint image_height; - layer_select->gimage = gimage; - layer_select->current_layer = gimage->active_layer; - layer_select->dirty = TRUE; + layer_select->gimage = gimage; + layer_select->current_layer = gimp_image_get_active_layer (gimage); + layer_select->dirty = TRUE; /* Get the image width and height variables, based on the gimage */ if (gimage->width > gimage->height) diff --git a/app/floating_sel.c b/app/floating_sel.c index dee93955d2..5bf46f2c80 100644 --- a/app/floating_sel.c +++ b/app/floating_sel.c @@ -155,18 +155,23 @@ floating_sel_reset (GimpLayer *layer) /* set the underlying drawable to active */ if (GIMP_IS_LAYER (layer->fs.drawable)) - gimp_image_set_active_layer (gimage, GIMP_LAYER (layer->fs.drawable)); + { + gimp_image_set_active_layer (gimage, GIMP_LAYER (layer->fs.drawable)); + } else if (GIMP_IS_LAYER_MASK (layer->fs.drawable)) - gimp_image_set_active_layer (gimage, - GIMP_LAYER_MASK (layer->fs.drawable)->layer); + { + gimp_image_set_active_layer (gimage, + GIMP_LAYER_MASK (layer->fs.drawable)->layer); + } else if (GIMP_IS_CHANNEL (layer->fs.drawable)) { gimp_image_set_active_channel (gimage, GIMP_CHANNEL (layer->fs.drawable)); if (gimp_container_num_children (gimage->layers)) - gimage->active_layer = (((GimpLayer *) gimage->layer_stack->data)); - else - gimage->active_layer = NULL; + { + gimp_image_set_active_layer (gimage, + (GimpLayer *) gimage->layer_stack->data); + } } } diff --git a/app/gdisplay.c b/app/gdisplay.c index 91d0fd6fbd..eeb7b67375 100644 --- a/app/gdisplay.c +++ b/app/gdisplay.c @@ -1965,8 +1965,7 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp) alpha = gimp_layer_has_alpha (layer); } - lind = gimp_image_get_layer_index (gdisp->gimage, - gdisp->gimage->active_layer); + lind = gimp_image_get_layer_index (gdisp->gimage, layer); lnum = gimp_container_num_children (gdisp->gimage->layers); } } diff --git a/app/gimpdrawable-offset.c b/app/gimpdrawable-offset.c index a728e64be3..11e5390c1e 100644 --- a/app/gimpdrawable-offset.c +++ b/app/gimpdrawable-offset.c @@ -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); diff --git a/app/gimpimage-duplicate.c b/app/gimpimage-duplicate.c index a728e64be3..11e5390c1e 100644 --- a/app/gimpimage-duplicate.c +++ b/app/gimpimage-duplicate.c @@ -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); diff --git a/app/gimpimage.c b/app/gimpimage.c index 1bbde96973..3017fc8ab0 100644 --- a/app/gimpimage.c +++ b/app/gimpimage.c @@ -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); + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_LAYER (layer), NULL); if (!layer || !layer->mask) return NULL; @@ -3419,16 +3426,18 @@ gimp_image_add_channel (GimpImage *gimage, g_return_val_if_fail (channel != NULL, FALSE); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE); - if (GIMP_DRAWABLE(channel)->gimage != NULL && - GIMP_DRAWABLE(channel)->gimage != gimage) + if (GIMP_DRAWABLE (channel)->gimage != NULL && + GIMP_DRAWABLE (channel)->gimage != gimage) { - g_message ("gimp_image_add_channel: attempt to add channel to wrong image"); + g_message ("%s(): attempt to add channel to wrong image", + G_GNUC_FUNCTION); return FALSE; } if (gimp_container_have (gimage->channels, GIMP_OBJECT (channel))) { - g_message ("gimp_image_add_channel: trying to add channel to image twice"); + g_message ("%s(): trying to add channel to image twice", + G_GNUC_FUNCTION); return FALSE; } @@ -3436,7 +3445,7 @@ gimp_image_add_channel (GimpImage *gimage, cu = g_new (ChannelUndo, 1); cu->channel = channel; cu->prev_position = 0; - cu->prev_channel = gimage->active_channel; + cu->prev_channel = gimp_image_get_active_channel (gimage); undo_push_channel (gimage, CHANNEL_ADD_UNDO, cu); /* add the channel to the list */ @@ -3475,9 +3484,9 @@ gimp_image_remove_channel (GimpImage *gimage, cu->channel = channel; cu->prev_position = gimp_container_get_child_index (gimage->channels, GIMP_OBJECT (channel)); - cu->prev_channel = gimage->active_channel; + cu->prev_channel = gimp_image_get_active_channel (gimage); undo_push_channel (gimage, CHANNEL_REMOVE_UNDO, cu); - + gtk_object_ref (GTK_OBJECT (channel)); gimp_container_remove (gimage->channels, GIMP_OBJECT (channel)); @@ -3485,9 +3494,12 @@ gimp_image_remove_channel (GimpImage *gimage, /* Send out REMOVED signal from channel */ gimp_drawable_removed (GIMP_DRAWABLE (channel)); - if (gimage->active_channel == channel) - gimage->active_channel = - GIMP_CHANNEL (gimp_container_get_child_by_index (gimage->channels, 0)); + if (channel == gimp_image_get_active_channel (gimage)) + { + gimp_image_set_active_channel + (gimage, + GIMP_CHANNEL (gimp_container_get_child_by_index (gimage->channels, 0))); + } gtk_object_unref (GTK_OBJECT (channel)); @@ -3520,11 +3532,11 @@ gimp_image_active_drawable (const GimpImage *gimage) /* If there is an active channel (a saved selection, etc.), * we ignore the active layer */ - if (gimage->active_channel != NULL) + if (gimage->active_channel) { return GIMP_DRAWABLE (gimage->active_channel); } - else if (gimage->active_layer != NULL) + else if (gimage->active_layer) { layer = gimage->active_layer; diff --git a/app/gimpimage.h b/app/gimpimage.h index dff739843e..805e30de37 100644 --- a/app/gimpimage.h +++ b/app/gimpimage.h @@ -91,7 +91,7 @@ struct _GimpImage TileManager *shadow; /* shadow buffer tiles */ - /* Projection attributes */ + /* Projection attributes */ gint construct_flag; /* flag for construction */ GimpImageType proj_type; /* type of the projection image */ gint proj_bytes; /* bpp in projection image */ @@ -101,15 +101,15 @@ struct _GimpImage GList *guides; /* guides */ - /* Layer/Channel attributes */ + /* Layer/Channel attributes */ GimpContainer *layers; /* the list of layers */ GimpContainer *channels; /* the list of masks */ GSList *layer_stack; /* the layers in MRU order */ - GimpLayer *active_layer; /* ID of active layer */ - GimpChannel *active_channel; /* ID of active channel */ - GimpLayer *floating_sel; /* ID of fs layer */ - GimpChannel *selection_mask; /* selection mask channel */ + GimpLayer *active_layer; /* the active layer */ + GimpChannel *active_channel; /* the active channel */ + GimpLayer *floating_sel; /* the FS layer */ + GimpChannel *selection_mask; /* the selection mask channel */ ParasiteList *parasites; /* Plug-in parasite data */ @@ -124,7 +124,7 @@ struct _GimpImage gboolean qmask_state; /* TRUE if qmask is on */ GimpRGB qmask_color; /* rgba triplet of the color */ - /* Undo apparatus */ + /* Undo apparatus */ GSList *undo_stack; /* stack for undo operations */ GSList *redo_stack; /* stack for redo operations */ gint undo_bytes; /* bytes in undo stack */ @@ -133,7 +133,7 @@ struct _GimpImage UndoType pushing_undo_group; /* undo group status flag */ GtkWidget *undo_history; /* history viewer, or NULL */ - /* Composite preview */ + /* Composite preview */ TempBuf *comp_preview; /* the composite preview */ gboolean comp_preview_valid; /* preview valid-1/channel */ }; diff --git a/app/gui/channels-dialog.c b/app/gui/channels-dialog.c index 51677fc290..4f2de9e46d 100644 --- a/app/gui/channels-dialog.c +++ b/app/gui/channels-dialog.c @@ -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 (); } } diff --git a/app/gui/commands.c b/app/gui/commands.c index a4d614b090..f92ff8fca8 100644 --- a/app/gui/commands.c +++ b/app/gui/commands.c @@ -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 (); } diff --git a/app/gui/help-commands.c b/app/gui/help-commands.c index a4d614b090..f92ff8fca8 100644 --- a/app/gui/help-commands.c +++ b/app/gui/help-commands.c @@ -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 (); } diff --git a/app/gui/layer-select.c b/app/gui/layer-select.c index c639058f93..7ad1809dc5 100644 --- a/app/gui/layer-select.c +++ b/app/gui/layer-select.c @@ -266,7 +266,8 @@ layer_select_end (LayerSelect *layer_select, gtk_widget_hide (layer_select->shell); /* only reset the active layer if a new layer was specified */ - if (layer_select->current_layer != layer_select->gimage->active_layer) + if (layer_select->current_layer != + gimp_image_get_active_layer (layer_select->gimage)) { gimp_image_set_active_layer (layer_select->gimage, layer_select->current_layer); @@ -281,9 +282,9 @@ layer_select_set_gimage (LayerSelect *layer_select, gint image_width; gint image_height; - layer_select->gimage = gimage; - layer_select->current_layer = gimage->active_layer; - layer_select->dirty = TRUE; + layer_select->gimage = gimage; + layer_select->current_layer = gimp_image_get_active_layer (gimage); + layer_select->dirty = TRUE; /* Get the image width and height variables, based on the gimage */ if (gimage->width > gimage->height) diff --git a/app/gui/layers-dialog.c b/app/gui/layers-dialog.c index 71ab0f0262..c8dbd0cf28 100644 --- a/app/gui/layers-dialog.c +++ b/app/gui/layers-dialog.c @@ -695,12 +695,12 @@ layers_dialog_flush (void) } /* Set the active layer */ - if (layersD->active_layer != gimage->active_layer) - layersD->active_layer = gimage->active_layer; + if (layersD->active_layer != gimp_image_get_active_layer (gimage)) + layersD->active_layer = gimp_image_get_active_layer (gimage); /* Set the active channel */ - if (layersD->active_channel != gimage->active_channel) - layersD->active_channel = gimage->active_channel; + if (layersD->active_channel != gimp_image_get_active_channel (gimage)) + layersD->active_channel = gimp_image_get_active_channel (gimage); /* set the menus if floating sel status has changed */ if (layersD->floating_sel != gimage->floating_sel) @@ -1390,7 +1390,8 @@ paint_mode_menu_callback (GtkWidget *widget, GimpLayer *layer; LayerModeEffects mode; - if (!(gimage = layersD->gimage) || !(layer = gimage->active_layer)) + if (! (gimage = layersD->gimage) || + ! (layer = gimp_image_get_active_layer (gimage))) return; /* If the layer has an alpha channel, set the transparency and redraw */ @@ -1418,7 +1419,8 @@ opacity_scale_update (GtkAdjustment *adjustment, GimpLayer *layer; gint opacity; - if (!(gimage = layersD->gimage) || !(layer = gimage->active_layer)) + if (! (gimage = layersD->gimage) || + ! (layer = gimp_image_get_active_layer (gimage))) return; /* add the 0.001 to insure there are no subtle rounding errors */ @@ -1442,7 +1444,8 @@ preserve_trans_update (GtkWidget *widget, GimpImage *gimage; GimpLayer *layer; - if (!(gimage = layersD->gimage) || !(layer = gimage->active_layer)) + if (! (gimage = layersD->gimage) || + ! (layer = gimp_image_get_active_layer (gimage))) return; if (GTK_TOGGLE_BUTTON (widget)->active) @@ -1538,16 +1541,19 @@ layers_dialog_previous_layer_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - current_layer = gimp_image_get_layer_index (gimage, gimage->active_layer); + current_layer = + gimp_image_get_layer_index (gimage, gimp_image_get_active_layer (gimage)); - new_layer = - GIMP_LAYER (gimp_container_get_child_by_index (gimage->layers, - current_layer - 1)); - - if (new_layer) + if (current_layer > 0) { - gimp_image_set_active_layer (gimage, new_layer); - gdisplays_flush (); + new_layer = (GimpLayer *) + gimp_container_get_child_by_index (gimage->layers, current_layer - 1); + + if (new_layer) + { + gimp_image_set_active_layer (gimage, new_layer); + gdisplays_flush (); + } } } @@ -1562,7 +1568,8 @@ layers_dialog_next_layer_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - current_layer = gimp_image_get_layer_index (gimage, gimage->active_layer); + current_layer = + gimp_image_get_layer_index (gimage, gimp_image_get_active_layer (gimage)); new_layer = GIMP_LAYER (gimp_container_get_child_by_index (gimage->layers, @@ -1584,7 +1591,7 @@ layers_dialog_raise_layer_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - gimp_image_raise_layer (gimage, gimage->active_layer); + gimp_image_raise_layer (gimage, gimp_image_get_active_layer (gimage)); gdisplays_flush (); } @@ -1597,7 +1604,7 @@ layers_dialog_lower_layer_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - gimp_image_lower_layer (gimage, gimage->active_layer); + gimp_image_lower_layer (gimage, gimp_image_get_active_layer (gimage)); gdisplays_flush (); } @@ -1610,7 +1617,7 @@ layers_dialog_raise_layer_to_top_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - gimp_image_raise_layer_to_top (gimage, gimage->active_layer); + gimp_image_raise_layer_to_top (gimage, gimp_image_get_active_layer (gimage)); gdisplays_flush (); } @@ -1623,7 +1630,8 @@ layers_dialog_lower_layer_to_bottom_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - gimp_image_lower_layer_to_bottom (gimage, gimage->active_layer); + gimp_image_lower_layer_to_bottom (gimage, + gimp_image_get_active_layer (gimage)); gdisplays_flush (); } @@ -1681,16 +1689,16 @@ layers_dialog_delete_layer_callback (GtkWidget *widget, GimpImage *gimage; GimpLayer *layer; - if (!layersD || - !(gimage = layersD->gimage) || - !(layer = gimp_image_get_active_layer (gimage))) + if (! layersD || + ! (gimage = layersD->gimage) || + ! (layer = gimp_image_get_active_layer (gimage))) return; /* if the layer is a floating selection, take special care */ if (gimp_layer_is_floating_sel (layer)) floating_sel_remove (layer); else - gimp_image_remove_layer (gimage, gimage->active_layer); + gimp_image_remove_layer (gimage, gimp_image_get_active_layer (gimage)); gdisplays_flush_now (); } @@ -1704,7 +1712,8 @@ layers_dialog_scale_layer_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - layers_dialog_scale_layer_query (gimage, gimage->active_layer); + layers_dialog_scale_layer_query (gimage, + gimp_image_get_active_layer (gimage)); } void @@ -1716,7 +1725,8 @@ layers_dialog_resize_layer_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - layers_dialog_resize_layer_query (gimage, gimage->active_layer); + layers_dialog_resize_layer_query (gimage, + gimp_image_get_active_layer (gimage)); } void @@ -1728,7 +1738,7 @@ layers_dialog_resize_to_image_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - gimp_layer_resize_to_image (gimage->active_layer); + gimp_layer_resize_to_image (gimp_image_get_active_layer (gimage)); gdisplays_flush (); } @@ -1742,7 +1752,7 @@ layers_dialog_add_layer_mask_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - layers_dialog_add_mask_query (gimage->active_layer); + layers_dialog_add_mask_query (gimp_image_get_active_layer (gimage)); } void @@ -1755,11 +1765,12 @@ layers_dialog_apply_layer_mask_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; + layer = gimp_image_get_active_layer (gimage); + /* Make sure there is a layer mask to apply */ - if ((layer = gimage->active_layer) != NULL && - gimp_layer_get_mask (layer)) + if (layer && gimp_layer_get_mask (layer)) { - gboolean flush = !layer->apply_mask || layer->show_mask; + gboolean flush = ! layer->apply_mask || layer->show_mask; gimp_image_remove_layer_mask (gimp_drawable_gimage (GIMP_DRAWABLE (layer)), layer, APPLY); @@ -1788,9 +1799,10 @@ layers_dialog_delete_layer_mask_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; + layer = gimp_image_get_active_layer (gimage); + /* Make sure there is a layer mask to apply */ - if ((layer = gimage->active_layer) != NULL && - gimp_layer_get_mask (layer)) + if (layer && gimp_layer_get_mask (layer)) { gboolean flush = layer->apply_mask || layer->show_mask; @@ -1845,7 +1857,8 @@ layers_dialog_merge_down_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - gimp_image_merge_down (gimage, gimage->active_layer, EXPAND_AS_NECESSARY); + gimp_image_merge_down (gimage, gimp_image_get_active_layer (gimage), + EXPAND_AS_NECESSARY); gdisplays_flush (); } @@ -1871,7 +1884,7 @@ layers_dialog_alpha_select_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - gimage_mask_layer_alpha (gimage, gimage->active_layer); + gimage_mask_layer_alpha (gimage, gimp_image_get_active_layer (gimage)); gdisplays_flush (); } @@ -1884,7 +1897,7 @@ layers_dialog_mask_select_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - gimage_mask_layer_mask (gimage, gimage->active_layer); + gimage_mask_layer_mask (gimage, gimp_image_get_active_layer (gimage)); gdisplays_flush (); } diff --git a/app/layer_select.c b/app/layer_select.c index c639058f93..7ad1809dc5 100644 --- a/app/layer_select.c +++ b/app/layer_select.c @@ -266,7 +266,8 @@ layer_select_end (LayerSelect *layer_select, gtk_widget_hide (layer_select->shell); /* only reset the active layer if a new layer was specified */ - if (layer_select->current_layer != layer_select->gimage->active_layer) + if (layer_select->current_layer != + gimp_image_get_active_layer (layer_select->gimage)) { gimp_image_set_active_layer (layer_select->gimage, layer_select->current_layer); @@ -281,9 +282,9 @@ layer_select_set_gimage (LayerSelect *layer_select, gint image_width; gint image_height; - layer_select->gimage = gimage; - layer_select->current_layer = gimage->active_layer; - layer_select->dirty = TRUE; + layer_select->gimage = gimage; + layer_select->current_layer = gimp_image_get_active_layer (gimage); + layer_select->dirty = TRUE; /* Get the image width and height variables, based on the gimage */ if (gimage->width > gimage->height) diff --git a/app/layers_dialog.c b/app/layers_dialog.c index 71ab0f0262..c8dbd0cf28 100644 --- a/app/layers_dialog.c +++ b/app/layers_dialog.c @@ -695,12 +695,12 @@ layers_dialog_flush (void) } /* Set the active layer */ - if (layersD->active_layer != gimage->active_layer) - layersD->active_layer = gimage->active_layer; + if (layersD->active_layer != gimp_image_get_active_layer (gimage)) + layersD->active_layer = gimp_image_get_active_layer (gimage); /* Set the active channel */ - if (layersD->active_channel != gimage->active_channel) - layersD->active_channel = gimage->active_channel; + if (layersD->active_channel != gimp_image_get_active_channel (gimage)) + layersD->active_channel = gimp_image_get_active_channel (gimage); /* set the menus if floating sel status has changed */ if (layersD->floating_sel != gimage->floating_sel) @@ -1390,7 +1390,8 @@ paint_mode_menu_callback (GtkWidget *widget, GimpLayer *layer; LayerModeEffects mode; - if (!(gimage = layersD->gimage) || !(layer = gimage->active_layer)) + if (! (gimage = layersD->gimage) || + ! (layer = gimp_image_get_active_layer (gimage))) return; /* If the layer has an alpha channel, set the transparency and redraw */ @@ -1418,7 +1419,8 @@ opacity_scale_update (GtkAdjustment *adjustment, GimpLayer *layer; gint opacity; - if (!(gimage = layersD->gimage) || !(layer = gimage->active_layer)) + if (! (gimage = layersD->gimage) || + ! (layer = gimp_image_get_active_layer (gimage))) return; /* add the 0.001 to insure there are no subtle rounding errors */ @@ -1442,7 +1444,8 @@ preserve_trans_update (GtkWidget *widget, GimpImage *gimage; GimpLayer *layer; - if (!(gimage = layersD->gimage) || !(layer = gimage->active_layer)) + if (! (gimage = layersD->gimage) || + ! (layer = gimp_image_get_active_layer (gimage))) return; if (GTK_TOGGLE_BUTTON (widget)->active) @@ -1538,16 +1541,19 @@ layers_dialog_previous_layer_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - current_layer = gimp_image_get_layer_index (gimage, gimage->active_layer); + current_layer = + gimp_image_get_layer_index (gimage, gimp_image_get_active_layer (gimage)); - new_layer = - GIMP_LAYER (gimp_container_get_child_by_index (gimage->layers, - current_layer - 1)); - - if (new_layer) + if (current_layer > 0) { - gimp_image_set_active_layer (gimage, new_layer); - gdisplays_flush (); + new_layer = (GimpLayer *) + gimp_container_get_child_by_index (gimage->layers, current_layer - 1); + + if (new_layer) + { + gimp_image_set_active_layer (gimage, new_layer); + gdisplays_flush (); + } } } @@ -1562,7 +1568,8 @@ layers_dialog_next_layer_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - current_layer = gimp_image_get_layer_index (gimage, gimage->active_layer); + current_layer = + gimp_image_get_layer_index (gimage, gimp_image_get_active_layer (gimage)); new_layer = GIMP_LAYER (gimp_container_get_child_by_index (gimage->layers, @@ -1584,7 +1591,7 @@ layers_dialog_raise_layer_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - gimp_image_raise_layer (gimage, gimage->active_layer); + gimp_image_raise_layer (gimage, gimp_image_get_active_layer (gimage)); gdisplays_flush (); } @@ -1597,7 +1604,7 @@ layers_dialog_lower_layer_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - gimp_image_lower_layer (gimage, gimage->active_layer); + gimp_image_lower_layer (gimage, gimp_image_get_active_layer (gimage)); gdisplays_flush (); } @@ -1610,7 +1617,7 @@ layers_dialog_raise_layer_to_top_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - gimp_image_raise_layer_to_top (gimage, gimage->active_layer); + gimp_image_raise_layer_to_top (gimage, gimp_image_get_active_layer (gimage)); gdisplays_flush (); } @@ -1623,7 +1630,8 @@ layers_dialog_lower_layer_to_bottom_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - gimp_image_lower_layer_to_bottom (gimage, gimage->active_layer); + gimp_image_lower_layer_to_bottom (gimage, + gimp_image_get_active_layer (gimage)); gdisplays_flush (); } @@ -1681,16 +1689,16 @@ layers_dialog_delete_layer_callback (GtkWidget *widget, GimpImage *gimage; GimpLayer *layer; - if (!layersD || - !(gimage = layersD->gimage) || - !(layer = gimp_image_get_active_layer (gimage))) + if (! layersD || + ! (gimage = layersD->gimage) || + ! (layer = gimp_image_get_active_layer (gimage))) return; /* if the layer is a floating selection, take special care */ if (gimp_layer_is_floating_sel (layer)) floating_sel_remove (layer); else - gimp_image_remove_layer (gimage, gimage->active_layer); + gimp_image_remove_layer (gimage, gimp_image_get_active_layer (gimage)); gdisplays_flush_now (); } @@ -1704,7 +1712,8 @@ layers_dialog_scale_layer_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - layers_dialog_scale_layer_query (gimage, gimage->active_layer); + layers_dialog_scale_layer_query (gimage, + gimp_image_get_active_layer (gimage)); } void @@ -1716,7 +1725,8 @@ layers_dialog_resize_layer_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - layers_dialog_resize_layer_query (gimage, gimage->active_layer); + layers_dialog_resize_layer_query (gimage, + gimp_image_get_active_layer (gimage)); } void @@ -1728,7 +1738,7 @@ layers_dialog_resize_to_image_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - gimp_layer_resize_to_image (gimage->active_layer); + gimp_layer_resize_to_image (gimp_image_get_active_layer (gimage)); gdisplays_flush (); } @@ -1742,7 +1752,7 @@ layers_dialog_add_layer_mask_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - layers_dialog_add_mask_query (gimage->active_layer); + layers_dialog_add_mask_query (gimp_image_get_active_layer (gimage)); } void @@ -1755,11 +1765,12 @@ layers_dialog_apply_layer_mask_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; + layer = gimp_image_get_active_layer (gimage); + /* Make sure there is a layer mask to apply */ - if ((layer = gimage->active_layer) != NULL && - gimp_layer_get_mask (layer)) + if (layer && gimp_layer_get_mask (layer)) { - gboolean flush = !layer->apply_mask || layer->show_mask; + gboolean flush = ! layer->apply_mask || layer->show_mask; gimp_image_remove_layer_mask (gimp_drawable_gimage (GIMP_DRAWABLE (layer)), layer, APPLY); @@ -1788,9 +1799,10 @@ layers_dialog_delete_layer_mask_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; + layer = gimp_image_get_active_layer (gimage); + /* Make sure there is a layer mask to apply */ - if ((layer = gimage->active_layer) != NULL && - gimp_layer_get_mask (layer)) + if (layer && gimp_layer_get_mask (layer)) { gboolean flush = layer->apply_mask || layer->show_mask; @@ -1845,7 +1857,8 @@ layers_dialog_merge_down_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - gimp_image_merge_down (gimage, gimage->active_layer, EXPAND_AS_NECESSARY); + gimp_image_merge_down (gimage, gimp_image_get_active_layer (gimage), + EXPAND_AS_NECESSARY); gdisplays_flush (); } @@ -1871,7 +1884,7 @@ layers_dialog_alpha_select_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - gimage_mask_layer_alpha (gimage, gimage->active_layer); + gimage_mask_layer_alpha (gimage, gimp_image_get_active_layer (gimage)); gdisplays_flush (); } @@ -1884,7 +1897,7 @@ layers_dialog_mask_select_callback (GtkWidget *widget, if (!layersD || !(gimage = layersD->gimage)) return; - gimage_mask_layer_mask (gimage, gimage->active_layer); + gimage_mask_layer_mask (gimage, gimp_image_get_active_layer (gimage)); gdisplays_flush (); } diff --git a/app/tools/gimpmovetool.c b/app/tools/gimpmovetool.c index 8ec52cccc5..c26f2ba1bc 100644 --- a/app/tools/gimpmovetool.c +++ b/app/tools/gimpmovetool.c @@ -493,7 +493,7 @@ move_tool_cursor_update (GimpTool *tool, GIMP_RECT_SELECT_TOOL_CURSOR, GIMP_CURSOR_MODIFIER_ANCHOR); } - else if (layer == gdisp->gimage->active_layer) + else if (layer == gimp_image_get_active_layer (gdisp->gimage)) { gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR, GIMP_MOVE_TOOL_CURSOR, diff --git a/app/tools/move.c b/app/tools/move.c index 8ec52cccc5..c26f2ba1bc 100644 --- a/app/tools/move.c +++ b/app/tools/move.c @@ -493,7 +493,7 @@ move_tool_cursor_update (GimpTool *tool, GIMP_RECT_SELECT_TOOL_CURSOR, GIMP_CURSOR_MODIFIER_ANCHOR); } - else if (layer == gdisp->gimage->active_layer) + else if (layer == gimp_image_get_active_layer (gdisp->gimage)) { gdisplay_install_tool_cursor (gdisp, GIMP_MOUSE_CURSOR, GIMP_MOVE_TOOL_CURSOR, diff --git a/app/undo.c b/app/undo.c index 4b42d5585d..5e4b0760e1 100644 --- a/app/undo.c +++ b/app/undo.c @@ -1488,11 +1488,11 @@ undo_pop_layer (GimpImage *gimage, else { /* record the active layer */ - lu->prev_layer = gimage->active_layer; + lu->prev_layer = gimp_image_get_active_layer (gimage); /* hide the current selection--for all views */ - if (gimage->active_layer != NULL) - gimp_layer_invalidate_boundary ((gimage->active_layer)); + if (gimp_image_get_active_layer (gimage)) + gimp_layer_invalidate_boundary (gimp_image_get_active_layer (gimage)); /* if this is a floating selection, set the fs pointer */ if (gimp_layer_is_floating_sel (lu->layer)) @@ -1501,8 +1501,7 @@ undo_pop_layer (GimpImage *gimage, /* add the new layer */ gimp_container_insert (gimage->layers, GIMP_OBJECT (lu->layer), lu->prev_position); - gimage->layer_stack = g_slist_prepend (gimage->layer_stack, lu->layer); - gimage->active_layer = lu->layer; + gimp_image_set_active_layer (gimage, lu->layer); drawable_update (GIMP_DRAWABLE (lu->layer), 0, 0, GIMP_DRAWABLE (lu->layer)->width, @@ -1834,7 +1833,7 @@ undo_pop_channel (GimpImage *gimage, else { /* record the active channel */ - cu->prev_channel = gimage->active_channel; + cu->prev_channel = gimp_image_get_active_channel (gimage); /* add the new channel */ gimp_container_insert (gimage->channels, @@ -2009,7 +2008,7 @@ undo_pop_fs_to_layer (GimpImage *gimage, gimp_viewable_invalidate_preview (GIMP_VIEWABLE (fsu->layer)); fsu->layer->fs.drawable = fsu->drawable; - gimage->active_layer = fsu->layer; + gimp_image_set_active_layer (gimage, fsu->layer); gimage->floating_sel = fsu->layer; /* restore the contents of the drawable */ diff --git a/app/xcf.c b/app/xcf.c index 67d0381a5f..646773a2d9 100644 --- a/app/xcf.c +++ b/app/xcf.c @@ -649,7 +649,7 @@ xcf_save_layer_props (XcfInfo *info, GImage *gimage, GimpLayer *layer) { - if (layer == gimage->active_layer) + if (layer == gimp_image_get_active_layer (gimage)) xcf_save_prop (info, PROP_ACTIVE_LAYER); if (layer == gimp_image_floating_sel (gimage)) @@ -679,7 +679,7 @@ xcf_save_channel_props (XcfInfo *info, GImage *gimage, GimpChannel *channel) { - if (channel == gimage->active_channel) + if (channel == gimp_image_get_active_channel (gimage)) xcf_save_prop (info, PROP_ACTIVE_CHANNEL); if (channel == gimage->selection_mask) diff --git a/app/xcf/xcf.c b/app/xcf/xcf.c index 67d0381a5f..646773a2d9 100644 --- a/app/xcf/xcf.c +++ b/app/xcf/xcf.c @@ -649,7 +649,7 @@ xcf_save_layer_props (XcfInfo *info, GImage *gimage, GimpLayer *layer) { - if (layer == gimage->active_layer) + if (layer == gimp_image_get_active_layer (gimage)) xcf_save_prop (info, PROP_ACTIVE_LAYER); if (layer == gimp_image_floating_sel (gimage)) @@ -679,7 +679,7 @@ xcf_save_channel_props (XcfInfo *info, GImage *gimage, GimpChannel *channel) { - if (channel == gimage->active_channel) + if (channel == gimp_image_get_active_channel (gimage)) xcf_save_prop (info, PROP_ACTIVE_CHANNEL); if (channel == gimage->selection_mask) diff --git a/gimptool-1.4.in b/gimptool-1.4.in index 1d289b62f8..4d791409ed 100644 --- a/gimptool-1.4.in +++ b/gimptool-1.4.in @@ -22,7 +22,7 @@ gimpdatadir=@gimpdatadir@ usage() { cat <{ui}) { - $libgimp .= "\t\t\t\\\n\t$libgimp"; - $libgimp =~ s/gimp\./gimpui./; + $libgimp .= "\t\t\\\n\t$libgimp"; + $libgimp =~ s/gimp-/gimpui-/; - $libgimp .= "\t\t\t\\\n\t\$(top_builddir)/libgimpwidgets/libgimpwidgets.la"; - $libgimp .= "\t\\\n\t\$(top_builddir)/libgimpcolor/libgimpcolor.la"; + $libgimp .= "\t\t\\\n\t\$(top_builddir)/libgimpwidgets/libgimpwidgets-\$(LT_RELEASE).la"; + $libgimp .= "\t\\\n\t\$(top_builddir)/libgimpcolor/libgimpcolor-\$(LT_RELEASE).la"; } else { - $libgimp .= "\t\t\t\\\n\t\$(top_builddir)/libgimpcolor/libgimpcolor.la"; + $libgimp .= "\t\t\\\n\t\$(top_builddir)/libgimpcolor/libgimpcolor-\$(LT_RELEASE).la"; } my $optlib = ""; if (exists $plugins{$_}->{optional}) { my $name = exists $plugins{$_}->{libopt} ? $plugins{$_}->{libopt} : $_; - $optlib = "\n\t\$(LIB\U$name\E)\t\t\t\t\t\t\\"; + $optlib = "\n\t\$(LIB\U$name\E)\t\t\t\t\t\t\t\\"; } if (exists $plugins{$_}->{libsupp}) { @@ -109,8 +109,8 @@ ${_}_SOURCES = \\ $_.c ${_}_LDADD = \\ - $libgimp \\$optlib - \$(\U$plugins{$_}->{libdep}\E_LIBS) \\ + $libgimp \\$optlib + \$(\U$plugins{$_}->{libdep}\E_LIBS) \\ \$(INTLLIBS) EOT diff --git a/plug-ins/dbbrowser/Makefile.am b/plug-ins/dbbrowser/Makefile.am index bd75736bca..236434a293 100644 --- a/plug-ins/dbbrowser/Makefile.am +++ b/plug-ins/dbbrowser/Makefile.am @@ -20,11 +20,11 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ $(INTLLIBS) .PHONY: files diff --git a/plug-ins/faxg3/Makefile.am b/plug-ins/faxg3/Makefile.am index ad2b81ff78..0f6273d953 100644 --- a/plug-ins/faxg3/Makefile.am +++ b/plug-ins/faxg3/Makefile.am @@ -19,9 +19,9 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GLIB_LIBS) \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GLIB_LIBS) \ $(INTLLIBS) .PHONY: files diff --git a/plug-ins/fits/Makefile.am b/plug-ins/fits/Makefile.am index c4055a83fe..7fa1c5900b 100644 --- a/plug-ins/fits/Makefile.am +++ b/plug-ins/fits/Makefile.am @@ -15,11 +15,11 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ $(INTLLIBS) AM_CPPFLAGS = \ diff --git a/plug-ins/flame/Makefile.am b/plug-ins/flame/Makefile.am index 8eb7a4bd21..50c7f5d7c6 100644 --- a/plug-ins/flame/Makefile.am +++ b/plug-ins/flame/Makefile.am @@ -23,12 +23,12 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ - $(LIBUCB) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ + $(LIBUCB) \ $(INTLLIBS) .PHONY: files diff --git a/plug-ins/fp/Makefile.am b/plug-ins/fp/Makefile.am index 7d7823d112..34621eacde 100644 --- a/plug-ins/fp/Makefile.am +++ b/plug-ins/fp/Makefile.am @@ -20,11 +20,11 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ $(INTLLIBS) .PHONY: files diff --git a/plug-ins/gap/Makefile.am b/plug-ins/gap/Makefile.am index b738f7136d..59c6844b12 100644 --- a/plug-ins/gap/Makefile.am +++ b/plug-ins/gap/Makefile.am @@ -209,20 +209,20 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ $(INTLLIBS) gap_decode_mpeg_LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(LIBMPEG) \ - $(GTK_LIBS) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(LIBMPEG) \ + $(GTK_LIBS) \ $(INTLLIBS) files: diff --git a/plug-ins/gdyntext/Makefile.am b/plug-ins/gdyntext/Makefile.am index 372f029de9..fb73eacf4b 100644 --- a/plug-ins/gdyntext/Makefile.am +++ b/plug-ins/gdyntext/Makefile.am @@ -52,11 +52,11 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ $(INTLLIBS) AM_CPPFLAGS = \ diff --git a/plug-ins/gfig/Makefile.am b/plug-ins/gfig/Makefile.am index f2a384a134..982b1141be 100644 --- a/plug-ins/gfig/Makefile.am +++ b/plug-ins/gfig/Makefile.am @@ -21,11 +21,11 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ $(INTLLIBS) .PHONY: files diff --git a/plug-ins/gflare/Makefile.am b/plug-ins/gflare/Makefile.am index 671c7455e3..7735de075e 100644 --- a/plug-ins/gflare/Makefile.am +++ b/plug-ins/gflare/Makefile.am @@ -22,11 +22,11 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ $(INTLLIBS) .PHONY: files diff --git a/plug-ins/gfli/Makefile.am b/plug-ins/gfli/Makefile.am index 72bb4a0b30..679980197a 100644 --- a/plug-ins/gfli/Makefile.am +++ b/plug-ins/gfli/Makefile.am @@ -15,11 +15,11 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ $(INTLLIBS) AM_CPPFLAGS = \ diff --git a/plug-ins/gimpressionist/Makefile.am b/plug-ins/gimpressionist/Makefile.am index af32ff6496..a7d4aebceb 100644 --- a/plug-ins/gimpressionist/Makefile.am +++ b/plug-ins/gimpressionist/Makefile.am @@ -40,11 +40,11 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ $(INTLLIBS) .PHONY: files diff --git a/plug-ins/helpbrowser/Makefile.am b/plug-ins/helpbrowser/Makefile.am index 242e06f6b5..9d3e5754f5 100644 --- a/plug-ins/helpbrowser/Makefile.am +++ b/plug-ins/helpbrowser/Makefile.am @@ -18,12 +18,12 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ - $(GTKXMHTML_LIBS) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ + $(GTKXMHTML_LIBS) \ $(INTLLIBS) AM_CPPFLAGS = \ diff --git a/plug-ins/ifscompose/Makefile.am b/plug-ins/ifscompose/Makefile.am index 611f422fa6..01cd3a93e2 100644 --- a/plug-ins/ifscompose/Makefile.am +++ b/plug-ins/ifscompose/Makefile.am @@ -18,11 +18,11 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ $(INTLLIBS) AM_CPPFLAGS = \ diff --git a/plug-ins/imagemap/Makefile.am b/plug-ins/imagemap/Makefile.am index 4d0a990b23..ff9e0ad1f6 100644 --- a/plug-ins/imagemap/Makefile.am +++ b/plug-ins/imagemap/Makefile.am @@ -172,11 +172,11 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ $(INTLLIBS) AM_CPPFLAGS = \ diff --git a/plug-ins/libgck/gck/Makefile.am b/plug-ins/libgck/gck/Makefile.am index 374136fbe3..a398205058 100644 --- a/plug-ins/libgck/gck/Makefile.am +++ b/plug-ins/libgck/gck/Makefile.am @@ -1,17 +1,17 @@ ## Process this file with automake to produce Makefile.in -gckincludedir = $(includedir)/gck +gckincludedir = $(includedir)/gimp-$(LT_RELEASE)/gck -lib_LTLIBRARIES = libgck.la +lib_LTLIBRARIES = libgck-1.3.la -libgck_la_SOURCES = \ +libgck_1_3_la_SOURCES = \ gckcolor.c gckinclude_HEADERS = \ gck.h -libgck_la_LDFLAGS = \ - -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE) +libgck_1_3_la_LDFLAGS = \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) INCLUDES = \ -I.. \ @@ -20,7 +20,7 @@ INCLUDES = \ $(GTK_CFLAGS) \ -I$(includedir) -libgck_la_LIBADD = \ +libgck_1_3_la_LIBADD = \ $(GTK_LIBS) .PHONY: files diff --git a/plug-ins/maze/Makefile.am b/plug-ins/maze/Makefile.am index 02574a7ee1..9e995053e4 100644 --- a/plug-ins/maze/Makefile.am +++ b/plug-ins/maze/Makefile.am @@ -20,11 +20,11 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ $(INTLLIBS) .PHONY: files diff --git a/plug-ins/mosaic/Makefile.am b/plug-ins/mosaic/Makefile.am index 08a9a1ad3d..27d37f7dd7 100644 --- a/plug-ins/mosaic/Makefile.am +++ b/plug-ins/mosaic/Makefile.am @@ -17,11 +17,11 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ $(INTLLIBS) .PHONY: files diff --git a/plug-ins/pagecurl/Makefile.am b/plug-ins/pagecurl/Makefile.am index 5c2e87d207..5746cea48e 100644 --- a/plug-ins/pagecurl/Makefile.am +++ b/plug-ins/pagecurl/Makefile.am @@ -24,12 +24,12 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(top_builddir)/libgimpmath/libgimpmath.la \ - $(GTK_LIBS) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(top_builddir)/libgimpmath/libgimpmath-$(LT_RELEASE).la \ + $(GTK_LIBS) \ $(INTLLIBS) .PHONY: files diff --git a/plug-ins/plugin-helper/Makefile.am b/plug-ins/plugin-helper/Makefile.am index 7e71d23a84..e5438b123c 100644 --- a/plug-ins/plugin-helper/Makefile.am +++ b/plug-ins/plugin-helper/Makefile.am @@ -8,20 +8,20 @@ plugin_helper_SOURCES = \ plugin-helper.c AM_CPPFLAGS = \ - -DLOCALEDIR=\""$(localedir)"\" + -DLOCALEDIR=\""$(localedir)"\" INCLUDES = \ - -I$(top_srcdir) \ - $(GTK_CFLAGS) \ + -I$(top_srcdir) \ + $(GTK_CFLAGS) \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ - $(INTLLIBS) + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ + $(INTLLIBS) .PHONY: files diff --git a/plug-ins/print/Makefile.am b/plug-ins/print/Makefile.am index bdb11ed343..9da1f32bbc 100644 --- a/plug-ins/print/Makefile.am +++ b/plug-ins/print/Makefile.am @@ -47,11 +47,11 @@ AM_CPPFLAGS = \ -DRELEASE_DATE=\"$(GIMP_PRINT_RELEASE_DATE)\" LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ $(INTLLIBS) escputil_LDADD = diff --git a/plug-ins/rcm/Makefile.am b/plug-ins/rcm/Makefile.am index f59e32455f..bde3a710b9 100644 --- a/plug-ins/rcm/Makefile.am +++ b/plug-ins/rcm/Makefile.am @@ -31,11 +31,11 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ $(INTLLIBS) .PHONY: files diff --git a/plug-ins/script-fu/Makefile.am b/plug-ins/script-fu/Makefile.am index b509b6530f..6c1f398098 100644 --- a/plug-ins/script-fu/Makefile.am +++ b/plug-ins/script-fu/Makefile.am @@ -38,12 +38,12 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/plug-ins/dbbrowser/dbbrowser_utils.o \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ + $(top_builddir)/plug-ins/dbbrowser/dbbrowser_utils.o \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ $(INTLLIBS) AM_CPPFLAGS = \ diff --git a/plug-ins/sel2path/Makefile.am b/plug-ins/sel2path/Makefile.am index 3580304a02..14f49dcfeb 100644 --- a/plug-ins/sel2path/Makefile.am +++ b/plug-ins/sel2path/Makefile.am @@ -38,11 +38,11 @@ AM_CPPFLAGS = \ -DLOCALEDIR=\""$(localedir)"\" LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ $(INTLLIBS) .PHONY: files diff --git a/plug-ins/sgi/Makefile.am b/plug-ins/sgi/Makefile.am index 9b6d0cfdc6..5490baf979 100644 --- a/plug-ins/sgi/Makefile.am +++ b/plug-ins/sgi/Makefile.am @@ -18,11 +18,11 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ $(INTLLIBS) .PHONY: files diff --git a/plug-ins/webbrowser/Makefile.am b/plug-ins/webbrowser/Makefile.am index 5a03e38aa8..c1ff246f3b 100644 --- a/plug-ins/webbrowser/Makefile.am +++ b/plug-ins/webbrowser/Makefile.am @@ -20,12 +20,12 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ - $(LIBXMU) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ + $(LIBXMU) \ $(INTLLIBS) EXTRA_DIST = $(scriptdata_DATA) diff --git a/plug-ins/xjt/Makefile.am b/plug-ins/xjt/Makefile.am index 2b5b8eff93..17ac2fe083 100644 --- a/plug-ins/xjt/Makefile.am +++ b/plug-ins/xjt/Makefile.am @@ -19,12 +19,12 @@ INCLUDES = \ -I$(includedir) LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimpwidgets/libgimpwidgets.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(top_builddir)/libgimpcolor/libgimpcolor.la \ - $(GTK_LIBS) \ - $(LIBJPEG) \ + $(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \ + $(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \ + $(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \ + $(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \ + $(GTK_LIBS) \ + $(LIBJPEG) \ $(INTLLIBS) AM_CPPFLAGS = \