From 227eea67cb39d678be70d69486688fbdde5bc11a Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Mon, 29 Jan 2001 02:45:02 +0000 Subject: [PATCH] app/Makefile.am new file. 2001-01-29 Michael Natterer * app/Makefile.am * app/undo_history.h: new file. * app/apptypes.h: removed the "Channel" typedef. * app/channel.[ch]: renamed all functions to gimp_channel_*() * app/channel_ops.c * app/channels_dialog.c * app/commands.c * app/disp_callbacks.c * app/gdisplay.c * app/gimage_mask.[ch] * app/gimpdnd.c * app/gimphistogram.c * app/gimpimage.[ch] * app/global_edit.c * app/layer.c * app/layers_dialog.c * app/qmask.c * app/scan_convert.c * app/scan_convert.h * app/toolbox.c * app/undo.[ch] * app/undo_history.c * app/xcf.[ch] * app/pdb/channel_cmds.c * app/pdb/color_cmds.c * app/pdb/drawable_cmds.c * app/pdb/image_cmds.c * app/pdb/pdb_glue.h * app/pdb/selection_cmds.c * app/pdb/tools_cmds.c * app/tools/bezier_select.c * app/tools/bezier_selectP.h * app/tools/blend.c * app/tools/bucket_fill.c * app/tools/by_color_select.c * app/tools/crop.c * app/tools/ellipse_select.c * app/tools/free_select.c * app/tools/fuzzy_select.c * app/tools/fuzzy_select.h * app/tools/iscissors.c * app/tools/rect_select.c * app/tools/text_tool.c * app/tools/transform_core.c * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/tools.pdb: changed accordingly. --- ChangeLog | 56 ++++ app/Makefile.am | 1 + app/actions/help-commands.c | 1 + app/actions/qmask-commands.c | 18 +- app/actions/quick-mask-commands.c | 18 +- app/apptypes.h | 1 - app/base/gimphistogram.c | 4 +- app/channel.c | 377 ++++++++++++----------- app/channel.h | 234 +++++++------- app/channel_ops.c | 10 +- app/channels_dialog.c | 164 +++++----- app/commands.c | 1 + app/core/gimp-edit.c | 2 +- app/core/gimpchannel-combine.c | 377 ++++++++++++----------- app/core/gimpchannel-combine.h | 234 +++++++------- app/core/gimpchannel.c | 377 ++++++++++++----------- app/core/gimpchannel.h | 234 +++++++------- app/core/gimpdrawable-blend.c | 2 +- app/core/gimpdrawable-offset.c | 10 +- app/core/gimpedit.c | 2 +- app/core/gimpimage-duplicate.c | 10 +- app/core/gimpimage-guides.c | 218 ++++++------- app/core/gimpimage-guides.h | 174 +++++------ app/core/gimpimage-mask.c | 120 ++++---- app/core/gimpimage-mask.h | 4 +- app/core/gimpimage-merge.c | 218 ++++++------- app/core/gimpimage-merge.h | 174 +++++------ app/core/gimpimage-projection.c | 218 ++++++------- app/core/gimpimage-projection.h | 174 +++++------ app/core/gimpimage-qmask.c | 18 +- app/core/gimpimage-quick-mask.c | 18 +- app/core/gimpimage-resize.c | 218 ++++++------- app/core/gimpimage-resize.h | 174 +++++------ app/core/gimpimage-scale.c | 218 ++++++------- app/core/gimpimage-scale.h | 174 +++++------ app/core/gimpimage-undo-push.c | 28 +- app/core/gimpimage-undo-push.h | 6 - app/core/gimpimage.c | 218 ++++++------- app/core/gimpimage.h | 174 +++++------ app/core/gimplayer.c | 12 +- app/core/gimpprojection-construct.c | 218 ++++++------- app/core/gimpprojection-construct.h | 174 +++++------ app/core/gimpprojection.c | 6 +- app/core/gimpscanconvert.c | 8 +- app/core/gimpscanconvert.h | 2 +- app/disp_callbacks.c | 6 +- app/display/gimpdisplay-callbacks.c | 6 +- app/display/gimpdisplay.c | 6 +- app/display/gimpdisplayshell-callbacks.c | 6 +- app/display/gimpdisplayshell-qmask.c | 18 +- app/gdisplay.c | 6 +- app/gimage_mask.c | 120 ++++---- app/gimage_mask.h | 4 +- app/gimpchannel.c | 377 ++++++++++++----------- app/gimpchannel.h | 234 +++++++------- app/gimpdnd.c | 2 +- app/gimpdrawable-offset.c | 10 +- app/gimphistogram.c | 4 +- app/gimpimage-duplicate.c | 10 +- app/gimpimage.c | 218 ++++++------- app/gimpimage.h | 174 +++++------ app/gimplayer.c | 12 +- app/global_edit.c | 2 +- app/gui/channels-dialog.c | 164 +++++----- app/gui/commands.c | 1 + app/gui/help-commands.c | 1 + app/gui/layers-dialog.c | 16 +- app/gui/qmask-commands.c | 18 +- app/gui/toolbox.c | 6 +- app/layer.c | 12 +- app/layers_dialog.c | 16 +- app/pdb/channel_cmds.c | 52 ++-- app/pdb/color_cmds.c | 2 +- app/pdb/drawable_cmds.c | 2 +- app/pdb/image_cmds.c | 14 +- app/pdb/pdb_glue.h | 8 +- app/pdb/selection_cmds.c | 18 +- app/pdb/tools_cmds.c | 2 +- app/qmask.c | 18 +- app/scan_convert.c | 8 +- app/scan_convert.h | 2 +- app/toolbox.c | 6 +- app/tools/bezier_select.c | 28 +- app/tools/bezier_selectP.h | 2 +- app/tools/blend.c | 2 +- app/tools/bucket_fill.c | 4 +- app/tools/by_color_select.c | 44 +-- app/tools/crop.c | 24 +- app/tools/ellipse_select.c | 29 +- app/tools/free_select.c | 18 +- app/tools/fuzzy_select.c | 36 +-- app/tools/fuzzy_select.h | 30 +- app/tools/gimpblendtool.c | 2 +- app/tools/gimpbucketfilltool.c | 4 +- app/tools/gimpbycolorselecttool.c | 44 +-- app/tools/gimpcroptool.c | 24 +- app/tools/gimpellipseselecttool.c | 29 +- app/tools/gimpfreeselecttool.c | 18 +- app/tools/gimpfuzzyselecttool.c | 36 +-- app/tools/gimpfuzzyselecttool.h | 30 +- app/tools/gimpiscissorstool.c | 23 +- app/tools/gimprectselecttool.c | 25 +- app/tools/gimpregionselecttool.c | 36 +-- app/tools/gimpregionselecttool.h | 30 +- app/tools/gimptexttool.c | 2 +- app/tools/iscissors.c | 23 +- app/tools/rect_select.c | 25 +- app/tools/text_tool.c | 2 +- app/tools/transform_core.c | 6 +- app/undo.c | 28 +- app/undo.h | 6 - app/undo_history.c | 12 +- app/undo_history.h | 26 ++ app/widgets/gimpdnd.c | 2 +- app/widgets/gimptoolbox.c | 6 +- app/xcf.c | 84 ++--- app/xcf.h | 2 +- app/xcf/xcf.c | 84 ++--- app/xcf/xcf.h | 2 +- tools/pdbgen/pdb.pl | 4 +- tools/pdbgen/pdb/channel.pdb | 12 +- tools/pdbgen/pdb/color.pdb | 2 +- tools/pdbgen/pdb/drawable.pdb | 2 +- tools/pdbgen/pdb/misc_tools.pdb | 2 +- tools/pdbgen/pdb/paint_tools.pdb | 2 +- tools/pdbgen/pdb/selection.pdb | 12 +- tools/pdbgen/pdb/tools.pdb | 2 +- tools/pdbgen/pdb/transform_tools.pdb | 2 +- 128 files changed, 3833 insertions(+), 3715 deletions(-) create mode 100644 app/undo_history.h diff --git a/ChangeLog b/ChangeLog index c8de0d0bea..4e006a651c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,59 @@ +2001-01-29 Michael Natterer + + * app/Makefile.am + * app/undo_history.h: new file. + + * app/apptypes.h: removed the "Channel" typedef. + + * app/channel.[ch]: renamed all functions to gimp_channel_*() + + * app/channel_ops.c + * app/channels_dialog.c + * app/commands.c + * app/disp_callbacks.c + * app/gdisplay.c + * app/gimage_mask.[ch] + * app/gimpdnd.c + * app/gimphistogram.c + * app/gimpimage.[ch] + * app/global_edit.c + * app/layer.c + * app/layers_dialog.c + * app/qmask.c + * app/scan_convert.c + * app/scan_convert.h + * app/toolbox.c + * app/undo.[ch] + * app/undo_history.c + * app/xcf.[ch] + * app/pdb/channel_cmds.c + * app/pdb/color_cmds.c + * app/pdb/drawable_cmds.c + * app/pdb/image_cmds.c + * app/pdb/pdb_glue.h + * app/pdb/selection_cmds.c + * app/pdb/tools_cmds.c + * app/tools/bezier_select.c + * app/tools/bezier_selectP.h + * app/tools/blend.c + * app/tools/bucket_fill.c + * app/tools/by_color_select.c + * app/tools/crop.c + * app/tools/ellipse_select.c + * app/tools/free_select.c + * app/tools/fuzzy_select.c + * app/tools/fuzzy_select.h + * app/tools/iscissors.c + * app/tools/rect_select.c + * app/tools/text_tool.c + * app/tools/transform_core.c + * tools/pdbgen/pdb.pl + * tools/pdbgen/pdb/channel.pdb + * tools/pdbgen/pdb/color.pdb + * tools/pdbgen/pdb/drawable.pdb + * tools/pdbgen/pdb/selection.pdb + * tools/pdbgen/pdb/tools.pdb: changed accordingly. + 2001-01-29 Michael Natterer * app/pdb/Makefile.am diff --git a/app/Makefile.am b/app/Makefile.am index 7c5ae36d8a..2dde155076 100644 --- a/app/Makefile.am +++ b/app/Makefile.am @@ -276,6 +276,7 @@ gimp_SOURCES = \ undo.c \ undo.h \ undo_history.c \ + undo_history.h \ undo_types.h \ unitrc.h \ user_install.c \ diff --git a/app/actions/help-commands.c b/app/actions/help-commands.c index f156662c7c..38474c3c47 100644 --- a/app/actions/help-commands.c +++ b/app/actions/help-commands.c @@ -73,6 +73,7 @@ #include "selection.h" #include "tips_dialog.h" #include "undo.h" +#include "undo_history.h" #ifdef DISPLAY_FILTERS #include "gdisplay_color_ui.h" diff --git a/app/actions/qmask-commands.c b/app/actions/qmask-commands.c index a7c594e558..3d078909c9 100644 --- a/app/actions/qmask-commands.c +++ b/app/actions/qmask-commands.c @@ -232,11 +232,11 @@ qmask_activate (GtkWidget *widget, floating_sel_to_layer (layer); } - gmask = channel_new (gimg, - gimg->width, - gimg->height, - "Qmask", - &color); + gmask = gimp_channel_new (gimg, + gimg->width, + gimg->height, + "Qmask", + &color); gimp_image_add_channel (gimg, gmask, 0); drawable_fill (GIMP_DRAWABLE (gmask), TRANSPARENT_FILL); } @@ -244,9 +244,9 @@ qmask_activate (GtkWidget *widget, { /* if selection */ - gmask = channel_copy (gimp_image_get_mask (gimg)); + gmask = gimp_channel_copy (gimp_image_get_mask (gimg)); gimp_image_add_channel (gimg, gmask, 0); - channel_set_color (gmask, &color); + gimp_channel_set_color (gmask, &color); gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask"); gimage_mask_none (gimg); /* Clear the selection */ } @@ -349,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget, gpointer data) { EditQmaskOptions *options; - Channel *channel; + GimpChannel *channel; GimpRGB color; options = (EditQmaskOptions *) data; @@ -364,7 +364,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget, if (gimp_rgba_distance (&color, &channel->color) > 0.0001) { channel->color = color; - channel_update (channel); + gimp_channel_update (channel); } } diff --git a/app/actions/quick-mask-commands.c b/app/actions/quick-mask-commands.c index a7c594e558..3d078909c9 100644 --- a/app/actions/quick-mask-commands.c +++ b/app/actions/quick-mask-commands.c @@ -232,11 +232,11 @@ qmask_activate (GtkWidget *widget, floating_sel_to_layer (layer); } - gmask = channel_new (gimg, - gimg->width, - gimg->height, - "Qmask", - &color); + gmask = gimp_channel_new (gimg, + gimg->width, + gimg->height, + "Qmask", + &color); gimp_image_add_channel (gimg, gmask, 0); drawable_fill (GIMP_DRAWABLE (gmask), TRANSPARENT_FILL); } @@ -244,9 +244,9 @@ qmask_activate (GtkWidget *widget, { /* if selection */ - gmask = channel_copy (gimp_image_get_mask (gimg)); + gmask = gimp_channel_copy (gimp_image_get_mask (gimg)); gimp_image_add_channel (gimg, gmask, 0); - channel_set_color (gmask, &color); + gimp_channel_set_color (gmask, &color); gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask"); gimage_mask_none (gimg); /* Clear the selection */ } @@ -349,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget, gpointer data) { EditQmaskOptions *options; - Channel *channel; + GimpChannel *channel; GimpRGB color; options = (EditQmaskOptions *) data; @@ -364,7 +364,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget, if (gimp_rgba_distance (&color, &channel->color) > 0.0001) { channel->color = color; - channel_update (channel); + gimp_channel_update (channel); } } diff --git a/app/apptypes.h b/app/apptypes.h index 7ff568487e..d5d358e970 100644 --- a/app/apptypes.h +++ b/app/apptypes.h @@ -44,7 +44,6 @@ typedef struct _GimpContext GimpContext; typedef struct _GimpDrawable GimpDrawable; typedef struct _GimpChannel GimpChannel; -typedef GimpChannel Channel; /* convenience */ typedef struct _GimpLayer GimpLayer; typedef struct _GimpLayerMask GimpLayerMask; diff --git a/app/base/gimphistogram.c b/app/base/gimphistogram.c index 539357a44f..ad78e67b29 100644 --- a/app/base/gimphistogram.c +++ b/app/base/gimphistogram.c @@ -365,8 +365,8 @@ gimp_histogram_calculate_drawable (GimpHistogram *histogram, if (!no_mask) { - Channel *sel_mask; - GimpImage *gimage; + GimpChannel *sel_mask; + GimpImage *gimage; gimage = gimp_drawable_gimage (drawable); sel_mask = gimp_image_get_mask (gimage); diff --git a/app/channel.c b/app/channel.c index 174b27dc3e..bb1567a548 100644 --- a/app/channel.c +++ b/app/channel.c @@ -50,13 +50,13 @@ #include "libgimp/gimpintl.h" -static void gimp_channel_class_init (GimpChannelClass *klass); -static void gimp_channel_init (GimpChannel *channel); -static void gimp_channel_destroy (GtkObject *object); +static void gimp_channel_class_init (GimpChannelClass *klass); +static void gimp_channel_init (GimpChannel *channel); +static void gimp_channel_destroy (GtkObject *object); -static TempBuf * channel_preview_private (Channel *channel, - gint width, - gint height); +static TempBuf * gimp_channel_preview_private (GimpChannel *channel, + gint width, + gint height); static GimpDrawableClass *parent_class = NULL; @@ -109,28 +109,28 @@ gimp_channel_init (GimpChannel *channel) /**************************/ static void -channel_validate (TileManager *tm, - Tile *tile) +gimp_channel_validate (TileManager *tm, + Tile *tile) { /* Set the contents of the tile to empty */ memset (tile_data_pointer (tile, 0, 0), TRANSPARENT_OPACITY, tile_size (tile)); } -Channel * -channel_new (GimpImage *gimage, - gint width, - gint height, - const gchar *name, - const GimpRGB *color) +GimpChannel * +gimp_channel_new (GimpImage *gimage, + gint width, + gint height, + const gchar *name, + const GimpRGB *color) { - Channel *channel; + GimpChannel *channel; g_return_val_if_fail (color != NULL, NULL); channel = gtk_type_new (GIMP_TYPE_CHANNEL); - gimp_drawable_configure (GIMP_DRAWABLE (channel), + gimp_drawable_configure (GIMP_DRAWABLE (channel), gimage, width, height, GRAY_GIMAGE, name); /* set the channel color and opacity */ @@ -154,11 +154,11 @@ channel_new (GimpImage *gimage, return channel; } -Channel * -channel_copy (const Channel *channel) +GimpChannel * +gimp_channel_copy (const GimpChannel *channel) { gchar *channel_name; - Channel *new_channel; + GimpChannel *new_channel; PixelRegion srcPR, destPR; gchar *ext; gint number; @@ -180,11 +180,11 @@ channel_copy (const Channel *channel) channel_name = g_strdup_printf (_("%s copy"), name); /* allocate a new channel object */ - new_channel = channel_new (GIMP_DRAWABLE (channel)->gimage, - GIMP_DRAWABLE (channel)->width, - GIMP_DRAWABLE (channel)->height, - channel_name, - &channel->color); + new_channel = gimp_channel_new (GIMP_DRAWABLE (channel)->gimage, + GIMP_DRAWABLE (channel)->width, + GIMP_DRAWABLE (channel)->height, + channel_name, + &channel->color); GIMP_DRAWABLE (new_channel)->visible = GIMP_DRAWABLE (channel)->visible; new_channel->show_masked = channel->show_masked; @@ -209,8 +209,8 @@ channel_copy (const Channel *channel) } void -channel_set_color (Channel *channel, - const GimpRGB *color) +gimp_channel_set_color (GimpChannel *channel, + const GimpRGB *color) { g_return_if_fail (channel != NULL); g_return_if_fail (GIMP_IS_CHANNEL (channel)); @@ -220,7 +220,7 @@ channel_set_color (Channel *channel, } const GimpRGB * -channel_get_color (const Channel *channel) +gimp_channel_get_color (const GimpChannel *channel) { g_return_val_if_fail (channel != NULL, NULL); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), NULL); @@ -229,7 +229,7 @@ channel_get_color (const Channel *channel) } gint -channel_get_opacity (const Channel *channel) +gimp_channel_get_opacity (const GimpChannel *channel) { g_return_val_if_fail (channel != NULL, 0); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), 0); @@ -238,8 +238,8 @@ channel_get_opacity (const Channel *channel) } void -channel_set_opacity (Channel *channel, - gint opacity) +gimp_channel_set_opacity (GimpChannel *channel, + gint opacity) { g_return_if_fail (channel != NULL); g_return_if_fail (GIMP_IS_CHANNEL (channel)); @@ -270,9 +270,9 @@ gimp_channel_destroy (GtkObject *object) } void -channel_scale (Channel *channel, - gint new_width, - gint new_height) +gimp_channel_scale (GimpChannel *channel, + gint new_width, + gint new_height) { PixelRegion srcPR, destPR; TileManager *new_tiles; @@ -318,11 +318,11 @@ channel_scale (Channel *channel, } void -channel_resize (Channel *channel, - gint new_width, - gint new_height, - gint offx, - gint offy) +gimp_channel_resize (GimpChannel *channel, + gint new_width, + gint new_height, + gint offx, + gint offy) { PixelRegion srcPR, destPR; TileManager *new_tiles; @@ -415,7 +415,7 @@ channel_resize (Channel *channel, } void -channel_update (Channel *channel) +gimp_channel_update (GimpChannel *channel) { drawable_update (GIMP_DRAWABLE (channel), 0, 0, @@ -429,7 +429,7 @@ channel_update (Channel *channel) /**********************/ gboolean -channel_toggle_visibility (Channel *channel) +gimp_channel_toggle_visibility (GimpChannel *channel) { GIMP_DRAWABLE (channel)->visible = !GIMP_DRAWABLE (channel)->visible; @@ -437,9 +437,9 @@ channel_toggle_visibility (Channel *channel) } TempBuf * -channel_preview (Channel *channel, - gint width, - gint height) +gimp_channel_preview (GimpChannel *channel, + gint width, + gint height) { /* Ok prime the cache with a large preview if the cache is invalid */ if (! GIMP_DRAWABLE (channel)->preview_valid && @@ -449,9 +449,9 @@ channel_preview (Channel *channel, GIMP_DRAWABLE (channel)->gimage->width > PREVIEW_CACHE_PRIME_WIDTH && GIMP_DRAWABLE (channel)->gimage->height > PREVIEW_CACHE_PRIME_HEIGHT) { - TempBuf * tb = channel_preview_private (channel, - PREVIEW_CACHE_PRIME_WIDTH, - PREVIEW_CACHE_PRIME_HEIGHT); + TempBuf * tb = gimp_channel_preview_private (channel, + PREVIEW_CACHE_PRIME_WIDTH, + PREVIEW_CACHE_PRIME_HEIGHT); /* Save the 2nd call */ if (width == PREVIEW_CACHE_PRIME_WIDTH && @@ -460,13 +460,13 @@ channel_preview (Channel *channel, } /* Second call - should NOT visit the tile cache... */ - return channel_preview_private (channel, width, height); + return gimp_channel_preview_private (channel, width, height); } static TempBuf * -channel_preview_private (Channel *channel, - gint width, - gint height) +gimp_channel_preview_private (GimpChannel *channel, + gint width, + gint height) { MaskBuf *preview_buf; PixelRegion srcPR; @@ -526,35 +526,35 @@ channel_preview_private (Channel *channel, /* selection mask functions */ /******************************/ -Channel * -channel_new_mask (GimpImage *gimage, - gint width, - gint height) +GimpChannel * +gimp_channel_new_mask (GimpImage *gimage, + gint width, + gint height) { - GimpRGB black = { 0.0, 0.0, 0.0, 0.5 }; - Channel *new_channel; + GimpRGB black = { 0.0, 0.0, 0.0, 0.5 }; + GimpChannel *new_channel; /* Create the new channel */ - new_channel = channel_new (gimage, width, height, - _("Selection Mask"), &black); + new_channel = gimp_channel_new (gimage, width, height, + _("Selection Mask"), &black); /* Set the validate procedure */ tile_manager_set_validate_proc (GIMP_DRAWABLE (new_channel)->tiles, - channel_validate); + gimp_channel_validate); return new_channel; } gboolean -channel_boundary (Channel *mask, - BoundSeg **segs_in, - BoundSeg **segs_out, - gint *num_segs_in, - gint *num_segs_out, - gint x1, - gint y1, - gint x2, - gint y2) +gimp_channel_boundary (GimpChannel *mask, + BoundSeg **segs_in, + BoundSeg **segs_out, + gint *num_segs_in, + gint *num_segs_out, + gint x1, + gint y1, + gint x2, + gint y2) { gint x3, y3, x4, y4; PixelRegion bPR; @@ -567,7 +567,7 @@ channel_boundary (Channel *mask, if (mask->segs_out) g_free (mask->segs_out); - if (channel_bounds (mask, &x3, &y3, &x4, &y4)) + if (gimp_channel_bounds (mask, &x3, &y3, &x4, &y4)) { pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x3, y3, (x4 - x3), (y4 - y3), FALSE); @@ -616,9 +616,9 @@ channel_boundary (Channel *mask, } gint -channel_value (Channel *mask, - gint x, - gint y) +gimp_channel_value (GimpChannel *mask, + gint x, + gint y) { Tile *tile; gint val; @@ -646,11 +646,11 @@ channel_value (Channel *mask, } gboolean -channel_bounds (Channel *mask, - gint *x1, - gint *y1, - gint *x2, - gint *y2) +gimp_channel_bounds (GimpChannel *mask, + gint *x1, + gint *y1, + gint *x2, + gint *y2) { PixelRegion maskPR; guchar *data, *data1; @@ -760,7 +760,7 @@ channel_bounds (Channel *mask, } gboolean -channel_is_empty (Channel *mask) +gimp_channel_is_empty (GimpChannel *mask) { PixelRegion maskPR; guchar *data; @@ -811,11 +811,11 @@ channel_is_empty (Channel *mask) } void -channel_add_segment (Channel *mask, - gint x, - gint y, - gint width, - gint value) +gimp_channel_add_segment (GimpChannel *mask, + gint x, + gint y, + gint width, + gint value) { PixelRegion maskPR; guchar *data; @@ -854,11 +854,11 @@ channel_add_segment (Channel *mask, } void -channel_sub_segment (Channel *mask, - gint x, - gint y, - gint width, - gint value) +gimp_channel_sub_segment (GimpChannel *mask, + gint x, + gint y, + gint width, + gint value) { PixelRegion maskPR; guchar *data; @@ -896,12 +896,12 @@ channel_sub_segment (Channel *mask, } void -channel_combine_rect (Channel *mask, - ChannelOps op, - gint x, - gint y, - gint w, - gint h) +gimp_channel_combine_rect (GimpChannel *mask, + ChannelOps op, + gint x, + gint y, + gint w, + gint h) { gint x2, y2; PixelRegion maskPR; @@ -956,13 +956,13 @@ channel_combine_rect (Channel *mask, } void -channel_combine_ellipse (Channel *mask, - ChannelOps op, - gint x, - gint y, - gint w, - gint h, - gboolean antialias) +gimp_channel_combine_ellipse (GimpChannel *mask, + ChannelOps op, + gint x, + gint y, + gint w, + gint h, + gboolean antialias) { gint i, j; gint x0, x1, x2; @@ -1002,10 +1002,10 @@ channel_combine_ellipse (Channel *mask, { case CHANNEL_OP_ADD: case CHANNEL_OP_REPLACE: - channel_add_segment (mask, x1, i, (x2 - x1), 255); + gimp_channel_add_segment (mask, x1, i, (x2 - x1), 255); break; case CHANNEL_OP_SUB: - channel_sub_segment (mask, x1, i, (x2 - x1), 255); + gimp_channel_sub_segment (mask, x1, i, (x2 - x1), 255); break; default: g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); @@ -1046,10 +1046,10 @@ channel_combine_ellipse (Channel *mask, { case CHANNEL_OP_ADD: case CHANNEL_OP_REPLACE: - channel_add_segment (mask, x0, i, j - x0, last); + gimp_channel_add_segment (mask, x0, i, j - x0, last); break; case CHANNEL_OP_SUB: - channel_sub_segment (mask, x0, i, j - x0, last); + gimp_channel_sub_segment (mask, x0, i, j - x0, last); break; default: g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); @@ -1071,9 +1071,9 @@ channel_combine_ellipse (Channel *mask, if (last) { if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE) - channel_add_segment (mask, x0, i, j - x0, last); + gimp_channel_add_segment (mask, x0, i, j - x0, last); else if (op == CHANNEL_OP_SUB) - channel_sub_segment (mask, x0, i, j - x0, last); + gimp_channel_sub_segment (mask, x0, i, j - x0, last); else g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); } @@ -1112,9 +1112,9 @@ channel_combine_ellipse (Channel *mask, } static void -channel_combine_sub_region_add (void *unused, - PixelRegion *srcPR, - PixelRegion *destPR) +gimp_channel_combine_sub_region_add (void *unused, + PixelRegion *srcPR, + PixelRegion *destPR) { guchar *src, *dest; gint x, y, val; @@ -1138,9 +1138,9 @@ channel_combine_sub_region_add (void *unused, } static void -channel_combine_sub_region_sub (void *unused, - PixelRegion *srcPR, - PixelRegion *destPR) +gimp_channel_combine_sub_region_sub (void *unused, + PixelRegion *srcPR, + PixelRegion *destPR) { guchar *src, *dest; gint x, y; @@ -1163,9 +1163,9 @@ channel_combine_sub_region_sub (void *unused, } static void -channel_combine_sub_region_intersect (void *unused, - PixelRegion *srcPR, - PixelRegion *destPR) +gimp_channel_combine_sub_region_intersect (void *unused, + PixelRegion *srcPR, + PixelRegion *destPR) { guchar *src, *dest; gint x, y; @@ -1185,11 +1185,11 @@ channel_combine_sub_region_intersect (void *unused, } void -channel_combine_mask (Channel *mask, - Channel *add_on, - ChannelOps op, - gint off_x, - gint off_y) +gimp_channel_combine_mask (GimpChannel *mask, + GimpChannel *add_on, + ChannelOps op, + gint off_x, + gint off_y) { PixelRegion srcPR, destPR; gint x1, y1, x2, y2; @@ -1213,35 +1213,38 @@ channel_combine_mask (Channel *mask, { case CHANNEL_OP_ADD: case CHANNEL_OP_REPLACE: - pixel_regions_process_parallel ((p_func) channel_combine_sub_region_add, + pixel_regions_process_parallel ((p_func) + gimp_channel_combine_sub_region_add, NULL, 2, &srcPR, &destPR); break; case CHANNEL_OP_SUB: - pixel_regions_process_parallel ((p_func) channel_combine_sub_region_sub, + pixel_regions_process_parallel ((p_func) + gimp_channel_combine_sub_region_sub, NULL, 2, &srcPR, &destPR); break; case CHANNEL_OP_INTERSECT: pixel_regions_process_parallel ((p_func) - channel_combine_sub_region_intersect, + gimp_channel_combine_sub_region_intersect, NULL, 2, &srcPR, &destPR); break; default: g_message ("Error: unknown opperation type in channel_combine_mask\n"); break; } + mask->bounds_known = FALSE; } void -channel_feather (Channel *input, - Channel *output, - gdouble radius_x, - gdouble radius_y, - ChannelOps op, - gint off_x, - gint off_y) +gimp_channel_feather (GimpChannel *input, + GimpChannel *output, + gdouble radius_x, + gdouble radius_y, + ChannelOps op, + gint off_x, + gint off_y) { - gint x1, y1, x2, y2; + gint x1, y1, x2, y2; PixelRegion srcPR; x1 = CLAMP (off_x, 0, GIMP_DRAWABLE (output)->width); @@ -1256,22 +1259,22 @@ channel_feather (Channel *input, gaussian_blur_region (&srcPR, radius_x, radius_y); if (input != output) - channel_combine_mask (output, input, op, 0, 0); + gimp_channel_combine_mask (output, input, op, 0, 0); output->bounds_known = FALSE; } void -channel_push_undo (Channel *mask) +gimp_channel_push_undo (GimpChannel *mask) { - gint x1, y1, x2, y2; - MaskUndo *mask_undo; + gint x1, y1, x2, y2; + MaskUndo *mask_undo; TileManager *undo_tiles; - PixelRegion srcPR, destPR; - GImage *gimage; + PixelRegion srcPR, destPR; + GImage *gimage; mask_undo = g_new (MaskUndo, 1); - if (channel_bounds (mask, &x1, &y1, &x2, &y2)) + if (gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) { undo_tiles = tile_manager_new ((x2 - x1), (y2 - y1), 1); pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles, @@ -1296,13 +1299,13 @@ channel_push_undo (Channel *mask) } void -channel_clear (Channel *mask) +gimp_channel_clear (GimpChannel *mask) { PixelRegion maskPR; - guchar bg = 0; + guchar bg = 0; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); if (mask->bounds_known && !mask->empty) { @@ -1331,13 +1334,13 @@ channel_clear (Channel *mask) } void -channel_invert (Channel *mask) +gimp_channel_invert (GimpChannel *mask) { PixelRegion maskPR; GimpLut *lut; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, 0, 0, @@ -1353,13 +1356,13 @@ channel_invert (Channel *mask) } void -channel_sharpen (Channel *mask) +gimp_channel_sharpen (GimpChannel *mask) { PixelRegion maskPR; GimpLut *lut; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, 0, 0, @@ -1373,13 +1376,13 @@ channel_sharpen (Channel *mask) } void -channel_all (Channel *mask) +gimp_channel_all (GimpChannel *mask) { PixelRegion maskPR; guchar bg = 255; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); /* clear the mask */ pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, @@ -1398,9 +1401,9 @@ channel_all (Channel *mask) } void -channel_border (Channel *mask, - gint radius_x, - gint radius_y) +gimp_channel_border (GimpChannel *mask, + gint radius_x, + gint radius_y) { PixelRegion bPR; gint x1, y1, x2, y2; @@ -1408,9 +1411,9 @@ channel_border (Channel *mask, if (radius_x < 0 || radius_y < 0) return; - if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) + if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) return; - if (channel_is_empty (mask)) + if (gimp_channel_is_empty (mask)) return; if (x1 - radius_x < 0) @@ -1430,8 +1433,9 @@ channel_border (Channel *mask, y2 = GIMP_DRAWABLE (mask)->height; else y2 += radius_y; + /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2-x1), (y2-y1), TRUE); @@ -1442,9 +1446,9 @@ channel_border (Channel *mask, } void -channel_grow (Channel *mask, - gint radius_x, - gint radius_y) +gimp_channel_grow (GimpChannel *mask, + gint radius_x, + gint radius_y) { PixelRegion bPR; gint x1, y1, x2, y2; @@ -1454,16 +1458,16 @@ channel_grow (Channel *mask, if (radius_x <= 0 && radius_y <= 0) { - channel_shrink (mask, -radius_x, -radius_y, FALSE); + gimp_channel_shrink (mask, -radius_x, -radius_y, FALSE); return; } if (radius_x < 0 || radius_y < 0) return; - if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) + if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) return; - if (channel_is_empty (mask)) + if (gimp_channel_is_empty (mask)) return; if (x1 - radius_x > 0) @@ -1484,7 +1488,7 @@ channel_grow (Channel *mask, y2 = GIMP_DRAWABLE (mask)->height; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); /* need full extents for grow, not! */ pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1), @@ -1496,10 +1500,10 @@ channel_grow (Channel *mask, } void -channel_shrink (Channel *mask, - gint radius_x, - gint radius_y, - gboolean edge_lock) +gimp_channel_shrink (GimpChannel *mask, + gint radius_x, + gint radius_y, + gboolean edge_lock) { PixelRegion bPR; gint x1, y1, x2, y2; @@ -1509,16 +1513,16 @@ channel_shrink (Channel *mask, if (radius_x <= 0 && radius_y <= 0) { - channel_grow (mask, -radius_x, -radius_y); + gimp_channel_grow (mask, -radius_x, -radius_y); return; } if (radius_x < 0 || radius_y < 0) return; - if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) + if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) return; - if (channel_is_empty (mask)) + if (gimp_channel_is_empty (mask)) return; if (x1 > 0) @@ -1531,7 +1535,7 @@ channel_shrink (Channel *mask, y2++; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1), (y2 - y1), TRUE); @@ -1542,12 +1546,12 @@ channel_shrink (Channel *mask, } void -channel_translate (Channel *mask, - gint off_x, - gint off_y) +gimp_channel_translate (GimpChannel *mask, + gint off_x, + gint off_y) { gint width, height; - Channel *tmp_mask; + GimpChannel *tmp_mask; PixelRegion srcPR, destPR; guchar empty = 0; gint x1, y1, x2, y2; @@ -1555,9 +1559,9 @@ channel_translate (Channel *mask, tmp_mask = NULL; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); - channel_bounds (mask, &x1, &y1, &x2, &y2); + gimp_channel_bounds (mask, &x1, &y1, &x2, &y2); x1 = CLAMP ((x1 + off_x), 0, GIMP_DRAWABLE (mask)->width); y1 = CLAMP ((y1 + off_y), 0, GIMP_DRAWABLE (mask)->height); x2 = CLAMP ((x2 + off_x), 0, GIMP_DRAWABLE (mask)->width); @@ -1572,7 +1576,8 @@ channel_translate (Channel *mask, /* copy the portion of the mask we will keep to a * temporary buffer */ - tmp_mask = channel_new_mask (GIMP_DRAWABLE (mask)->gimage, width, height); + tmp_mask = gimp_channel_new_mask (GIMP_DRAWABLE (mask)->gimage, + width, height); pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles, x1 - off_x, y1 - off_y, width, height, FALSE); @@ -1619,13 +1624,13 @@ channel_translate (Channel *mask, } void -channel_load (Channel *mask, - Channel *channel) +gimp_channel_load (GimpChannel *mask, + GimpChannel *channel) { PixelRegion srcPR, destPR; /* push the current mask onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); /* copy the channel to the mask */ pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles, @@ -1642,15 +1647,15 @@ channel_load (Channel *mask, } void -channel_layer_alpha (Channel *mask, - GimpLayer *layer) +gimp_channel_layer_alpha (GimpChannel *mask, + GimpLayer *layer) { PixelRegion srcPR, destPR; guchar empty = 0; gint x1, y1, x2, y2; /* push the current mask onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); /* clear the mask */ pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles, @@ -1678,15 +1683,15 @@ channel_layer_alpha (Channel *mask, } void -channel_layer_mask (Channel *mask, - GimpLayer *layer) +gimp_channel_layer_mask (GimpChannel *mask, + GimpLayer *layer) { PixelRegion srcPR, destPR; guchar empty = 0; gint x1, y1, x2, y2; /* push the current mask onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); /* clear the mask */ pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles, @@ -1717,7 +1722,7 @@ channel_layer_mask (Channel *mask, } void -channel_invalidate_bounds (Channel *channel) +gimp_channel_invalidate_bounds (GimpChannel *channel) { channel->bounds_known = FALSE; } diff --git a/app/channel.h b/app/channel.h index 9bd6a4b739..158b7c09c5 100644 --- a/app/channel.h +++ b/app/channel.h @@ -16,8 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __CHANNEL_H__ -#define __CHANNEL_H__ +#ifndef __GIMP_CHANNEL_H__ +#define __GIMP_CHANNEL_H__ #include "gimpdrawable.h" @@ -26,7 +26,6 @@ /* Half way point where a region is no longer visible in a selection */ #define HALF_WAY 127 -/* structure declarations */ #define GIMP_TYPE_CHANNEL (gimp_channel_get_type ()) #define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel)) @@ -63,21 +62,18 @@ struct _GimpChannelClass }; +/* Special undo types */ -/* Special undo type */ typedef struct _ChannelUndo ChannelUndo; +typedef struct _MaskUndo MaskUndo; struct _ChannelUndo { - Channel *channel; /* the actual channel */ - gint prev_position; /* former position in list */ - Channel *prev_channel; /* previous active channel */ + GimpChannel *channel; /* the actual channel */ + gint prev_position; /* former position in list */ + GimpChannel *prev_channel; /* previous active channel */ }; - -/* Special undo type */ -typedef struct _MaskUndo MaskUndo; - struct _MaskUndo { TileManager *tiles; /* the actual mask */ @@ -87,128 +83,128 @@ struct _MaskUndo /* function declarations */ -GtkType gimp_channel_get_type (void); +GtkType gimp_channel_get_type (void); -Channel * channel_new (GimpImage *gimage, - gint width, - gint height, - const gchar *name, - const GimpRGB *color); -Channel * channel_copy (const Channel *channel); +GimpChannel * gimp_channel_new (GimpImage *gimage, + gint width, + gint height, + const gchar *name, + const GimpRGB *color); +GimpChannel * gimp_channel_copy (const GimpChannel *channel); -gint channel_get_opacity (const Channel *channel); -void channel_set_opacity (Channel *channel, - gint opacity); +gint gimp_channel_get_opacity (const GimpChannel *channel); +void gimp_channel_set_opacity (GimpChannel *channel, + gint opacity); -const GimpRGB * channel_get_color (const Channel *channel); -void channel_set_color (Channel *channel, - const GimpRGB *color); +const GimpRGB * gimp_channel_get_color (const GimpChannel *channel); +void gimp_channel_set_color (GimpChannel *channel, + const GimpRGB *color); -void channel_scale (Channel *channel, - gint new_width, - gint new_height); -void channel_resize (Channel *channel, - gint new_width, - gint new_height, - gint offx, - gint offy); -void channel_update (Channel *channel); +void gimp_channel_scale (GimpChannel *channel, + gint new_width, + gint new_height); +void gimp_channel_resize (GimpChannel *channel, + gint new_width, + gint new_height, + gint offx, + gint offy); +void gimp_channel_update (GimpChannel *channel); /* access functions */ -gboolean channel_toggle_visibility (Channel *channel); -TempBuf * channel_preview (Channel *channel, - gint width, - gint height); +gboolean gimp_channel_toggle_visibility (GimpChannel *channel); +TempBuf * gimp_channel_preview (GimpChannel *channel, + gint width, + gint height); /* selection mask functions */ -Channel * channel_new_mask (GimpImage *gimage, - gint width, - gint height); -gboolean channel_boundary (Channel *mask, - BoundSeg **segs_in, - BoundSeg **segs_out, - gint *num_segs_in, - gint *num_segs_out, - gint x1, - gint y1, - gint x2, - gint y2); -gboolean channel_bounds (Channel *mask, - gint *x1, - gint *y1, - gint *x2, - gint *y2); -gint channel_value (Channel *mask, - gint x, - gint y); -gboolean channel_is_empty (Channel *mask); -void channel_add_segment (Channel *mask, - gint x, - gint y, - gint width, - gint value); -void channel_sub_segment (Channel *mask, - gint x, - gint y, - gint width, - gint value); -void channel_combine_rect (Channel *mask, - ChannelOps op, - gint x, - gint y, - gint w, - gint h); -void channel_combine_ellipse (Channel *mask, - ChannelOps op, - gint x, - gint y, - gint w, - gint h, - gboolean antialias); -void channel_combine_mask (Channel *mask, - Channel *add_on, - ChannelOps op, - gint off_x, - gint off_y); -void channel_feather (Channel *input, - Channel *output, - gdouble radius_x, - gdouble radius_y, - ChannelOps op, - gint off_x, - gint off_y); +GimpChannel * gimp_channel_new_mask (GimpImage *gimage, + gint width, + gint height); +gboolean gimp_channel_boundary (GimpChannel *mask, + BoundSeg **segs_in, + BoundSeg **segs_out, + gint *num_segs_in, + gint *num_segs_out, + gint x1, + gint y1, + gint x2, + gint y2); +gboolean gimp_channel_bounds (GimpChannel *mask, + gint *x1, + gint *y1, + gint *x2, + gint *y2); +gint gimp_channel_value (GimpChannel *mask, + gint x, + gint y); +gboolean gimp_channel_is_empty (GimpChannel *mask); +void gimp_channel_add_segment (GimpChannel *mask, + gint x, + gint y, + gint width, + gint value); +void gimp_channel_sub_segment (GimpChannel *mask, + gint x, + gint y, + gint width, + gint value); +void gimp_channel_combine_rect (GimpChannel *mask, + ChannelOps op, + gint x, + gint y, + gint w, + gint h); +void gimp_channel_combine_ellipse (GimpChannel *mask, + ChannelOps op, + gint x, + gint y, + gint w, + gint h, + gboolean antialias); +void gimp_channel_combine_mask (GimpChannel *mask, + GimpChannel *add_on, + ChannelOps op, + gint off_x, + gint off_y); +void gimp_channel_feather (GimpChannel *input, + GimpChannel *output, + gdouble radius_x, + gdouble radius_y, + ChannelOps op, + gint off_x, + gint off_y); -void channel_push_undo (Channel *mask); -void channel_clear (Channel *mask); -void channel_invert (Channel *mask); -void channel_sharpen (Channel *mask); -void channel_all (Channel *mask); +void gimp_channel_push_undo (GimpChannel *mask); +void gimp_channel_clear (GimpChannel *mask); +void gimp_channel_invert (GimpChannel *mask); +void gimp_channel_sharpen (GimpChannel *mask); +void gimp_channel_all (GimpChannel *mask); -void channel_border (Channel *mask, - gint radius_x, - gint radius_y); -void channel_grow (Channel *mask, - gint radius_x, - gint radius_y); -void channel_shrink (Channel *mask, - gint radius_x, - gint radius_y, - gboolean edge_lock); +void gimp_channel_border (GimpChannel *mask, + gint radius_x, + gint radius_y); +void gimp_channel_grow (GimpChannel *mask, + gint radius_x, + gint radius_y); +void gimp_channel_shrink (GimpChannel *mask, + gint radius_x, + gint radius_y, + gboolean edge_lock); -void channel_translate (Channel *mask, - gint off_x, - gint off_y); -void channel_load (Channel *mask, - Channel *channel); +void gimp_channel_translate (GimpChannel *mask, + gint off_x, + gint off_y); +void gimp_channel_load (GimpChannel *mask, + GimpChannel *channel); -void channel_layer_alpha (Channel *mask, - GimpLayer *layer); -void channel_layer_mask (Channel *mask, - GimpLayer *layer); +void gimp_channel_layer_alpha (GimpChannel *mask, + GimpLayer *layer); +void gimp_channel_layer_mask (GimpChannel *mask, + GimpLayer *layer); -void channel_invalidate_bounds (Channel *channel); +void gimp_channel_invalidate_bounds (GimpChannel *channel); -#endif /* __CHANNEL_H__ */ +#endif /* __GIMP_CHANNEL_H__ */ diff --git a/app/channel_ops.c b/app/channel_ops.c index b61378c299..6b693844cc 100644 --- a/app/channel_ops.c +++ b/app/channel_ops.c @@ -569,12 +569,12 @@ duplicate (GimpImage *gimage) GimpImage *new_gimage; GimpLayer *layer, *new_layer; GimpLayer *floating_layer; - Channel *channel, *new_channel; + GimpChannel *channel, *new_channel; GSList *list; GList *glist; Guide *guide = NULL; GimpLayer *active_layer = NULL; - Channel *active_channel = NULL; + GimpChannel *active_channel = NULL; GimpDrawable *new_floating_sel_drawable = NULL; GimpDrawable *floating_sel_drawable = NULL; ParasiteList *parasites; @@ -645,12 +645,12 @@ duplicate (GimpImage *gimage) count = 0; while (list) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; list = g_slist_next (list); - new_channel = channel_copy (channel); + new_channel = gimp_channel_copy (channel); - gimp_drawable_set_gimage(GIMP_DRAWABLE(new_channel), new_gimage); + gimp_drawable_set_gimage (GIMP_DRAWABLE (new_channel), new_gimage); /* Make sure the copied channel doesn't say: " copy" */ gimp_object_set_name (GIMP_OBJECT (new_channel), diff --git a/app/channels_dialog.c b/app/channels_dialog.c index 45a3d4c5d8..3bcae08688 100644 --- a/app/channels_dialog.c +++ b/app/channels_dialog.c @@ -81,7 +81,7 @@ struct _ChannelsDialog gint base_type; ChannelType components[3]; - Channel *active_channel; + GimpChannel *active_channel; GimpLayer *floating_sel; GSList *channel_widgets; }; @@ -100,7 +100,7 @@ struct _ChannelWidget /* state information */ GimpImage *gimage; - Channel *channel; + GimpChannel *channel; gint width, height; ChannelType type; @@ -115,9 +115,9 @@ static void channels_dialog_preview_extents (void); static void channels_dialog_set_menu_sensitivity (void); static void channels_dialog_set_channel (ChannelWidget *cw); static void channels_dialog_unset_channel (ChannelWidget *cw); -static void channels_dialog_position_channel (Channel *channel, +static void channels_dialog_position_channel (GimpChannel *channel, gint position); -static void channels_dialog_add_channel (Channel *channel); +static void channels_dialog_add_channel (GimpChannel *channel); static void channels_dialog_remove_channel (ChannelWidget *cw); static gint channel_list_events (GtkWidget *widget, @@ -156,9 +156,9 @@ static gboolean channels_dialog_drag_delete_channel_callback guint time); /* channel widget function prototypes */ -static ChannelWidget * channel_widget_get_ID (Channel *channel); +static ChannelWidget * channel_widget_get_ID (GimpChannel *channel); static ChannelWidget * channel_widget_create (GimpImage *gimage, - Channel *channel, + GimpChannel *channel, ChannelType channel_type); static gboolean channel_widget_drag_motion_callback @@ -410,7 +410,7 @@ void channels_dialog_free (void) { ChannelWidget *cw; - GSList *list; + GSList *list; if (!channelsD) return; @@ -441,7 +441,7 @@ channels_dialog_free (void) void channels_dialog_update (GimpImage* gimage) { - Channel *channel; + GimpChannel *channel; ChannelWidget *cw; GSList *list; GList *item_list; @@ -517,9 +517,11 @@ channels_dialog_update (GimpImage* gimage) for (list = gimage->channels; list; list = g_slist_next (list)) { /* create a channel list item */ - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; + cw = channel_widget_create (gimage, channel, AUXILLARY_CHANNEL); - channelsD->channel_widgets = g_slist_append (channelsD->channel_widgets, cw); + channelsD->channel_widgets = + g_slist_append (channelsD->channel_widgets, cw); item_list = g_list_append (item_list, cw->list_item); } @@ -532,7 +534,7 @@ void channels_dialog_flush (void) { GimpImage *gimage; - Channel *channel; + GimpChannel *channel; ChannelWidget *cw; GSList *list; gint pos; @@ -560,7 +562,7 @@ channels_dialog_flush (void) /* Add any missing channels */ for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; cw = channel_widget_get_ID (channel); /* If the channel isn't in the channel widget list, add it */ @@ -590,7 +592,7 @@ channels_dialog_flush (void) pos = 0; for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; channels_dialog_position_channel (channel, pos++); } @@ -659,8 +661,8 @@ static void channels_dialog_set_menu_sensitivity (void) { ChannelWidget *cw; - gint fs_sens; - gint aux_sens; + gint fs_sens; + gint aux_sens; cw = channel_widget_get_ID (channelsD->active_channel); fs_sens = (channelsD->floating_sel != NULL); @@ -843,11 +845,11 @@ channels_dialog_unset_channel (ChannelWidget *channel_widget) } static void -channels_dialog_position_channel (Channel *channel, - gint new_index) +channels_dialog_position_channel (GimpChannel *channel, + gint new_index) { ChannelWidget *channel_widget; - GList *list = NULL; + GList *list = NULL; channel_widget = channel_widget_get_ID (channel); if (!channelsD || !channel_widget) @@ -881,12 +883,12 @@ channels_dialog_position_channel (Channel *channel, } static void -channels_dialog_add_channel (Channel *channel) +channels_dialog_add_channel (GimpChannel *channel) { ChannelWidget *channel_widget; - GimpImage *gimage; - GList *item_list; - gint position; + GimpImage *gimage; + GList *item_list; + gint position; if (!channelsD || !channel || !(gimage = channelsD->gimage)) return; @@ -1042,16 +1044,16 @@ void channels_dialog_duplicate_channel_callback (GtkWidget *widget, gpointer data) { - GimpImage *gimage; - Channel *active_channel; - Channel *new_channel; + GimpImage *gimage; + GimpChannel *active_channel; + GimpChannel *new_channel; if (!channelsD || !(gimage = channelsD->gimage)) return; if ((active_channel = gimp_image_get_active_channel (gimage))) { - new_channel = channel_copy (active_channel); + new_channel = gimp_channel_copy (active_channel); gimp_image_add_channel (gimage, new_channel, -1); gdisplays_flush (); } @@ -1093,20 +1095,20 @@ void channels_dialog_add_channel_to_sel_callback (GtkWidget *widget, gpointer data) { - GimpImage *gimage; - Channel *active_channel; - Channel *new_channel; + GimpImage *gimage; + GimpChannel *active_channel; + GimpChannel *new_channel; if (!channelsD || !(gimage = channelsD->gimage)) return; if ((active_channel = gimp_image_get_active_channel (gimage))) { - new_channel = channel_copy (gimp_image_get_mask (gimage)); - channel_combine_mask (new_channel, - active_channel, - CHANNEL_OP_ADD, - 0, 0); /* off x/y */ + new_channel = gimp_channel_copy (gimp_image_get_mask (gimage)); + gimp_channel_combine_mask (new_channel, + active_channel, + CHANNEL_OP_ADD, + 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); gtk_object_unref (GTK_OBJECT (new_channel)); gdisplays_flush (); @@ -1117,20 +1119,20 @@ void channels_dialog_sub_channel_from_sel_callback (GtkWidget *widget, gpointer data) { - GimpImage *gimage; - Channel *active_channel; - Channel *new_channel; + GimpImage *gimage; + GimpChannel *active_channel; + GimpChannel *new_channel; if (!channelsD || !(gimage = channelsD->gimage)) return; if ((active_channel = gimp_image_get_active_channel (gimage))) { - new_channel = channel_copy (gimp_image_get_mask (gimage)); - channel_combine_mask (new_channel, - active_channel, - CHANNEL_OP_SUB, - 0, 0); /* off x/y */ + new_channel = gimp_channel_copy (gimp_image_get_mask (gimage)); + gimp_channel_combine_mask (new_channel, + active_channel, + CHANNEL_OP_SUB, + 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); gtk_object_unref (GTK_OBJECT (new_channel)); gdisplays_flush (); @@ -1141,20 +1143,20 @@ void channels_dialog_intersect_channel_with_sel_callback (GtkWidget *widget, gpointer data) { - GimpImage *gimage; - Channel *active_channel; - Channel *new_channel; + GimpImage *gimage; + GimpChannel *active_channel; + GimpChannel *new_channel; if (!channelsD || !(gimage = channelsD->gimage)) return; if ((active_channel = gimp_image_get_active_channel (gimage))) { - new_channel = channel_copy (gimp_image_get_mask (gimage)); - channel_combine_mask (new_channel, - active_channel, - CHANNEL_OP_INTERSECT, - 0, 0); /* off x/y */ + new_channel = gimp_channel_copy (gimp_image_get_mask (gimage)); + gimp_channel_combine_mask (new_channel, + active_channel, + CHANNEL_OP_INTERSECT, + 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); gtk_object_unref (GTK_OBJECT (new_channel)); gdisplays_flush (); @@ -1199,10 +1201,10 @@ channels_dialog_drag_new_channel_callback (GtkWidget *widget, if (src && src->channel == channelsD->active_channel) { - Channel *channel; - GimpImage *gimage; - gint width, height; - gint off_x, off_y; + GimpChannel *channel; + GimpImage *gimage; + gint width, height; + gint off_x, off_y; gimage = channelsD->gimage; @@ -1213,13 +1215,13 @@ channels_dialog_drag_new_channel_callback (GtkWidget *widget, /* Start a group undo */ undo_push_group_start (gimage, EDIT_PASTE_UNDO); - channel = channel_new (gimage, width, height, - _("Empty Channel Copy"), - &src->channel->color); + channel = gimp_channel_new (gimage, width, height, + _("Empty Channel Copy"), + &src->channel->color); if (channel) { drawable_fill (GIMP_DRAWABLE (channel), TRANSPARENT_FILL); - channel_translate (channel, off_x, off_y); + gimp_channel_translate (channel, off_x, off_y); gimp_image_add_channel (gimage, channel, -1); /* End the group undo */ @@ -1340,10 +1342,10 @@ channels_dialog_drag_delete_channel_callback (GtkWidget *widget, /******************************/ static ChannelWidget * -channel_widget_get_ID (Channel *channel) +channel_widget_get_ID (GimpChannel *channel) { ChannelWidget *lw; - GSList *list; + GSList *list; if (!channelsD) return NULL; @@ -1361,14 +1363,14 @@ channel_widget_get_ID (Channel *channel) static ChannelWidget * channel_widget_create (GimpImage *gimage, - Channel *channel, + GimpChannel *channel, ChannelType type) { ChannelWidget *channel_widget; - GtkWidget *list_item; - GtkWidget *hbox; - GtkWidget *vbox; - GtkWidget *alignment; + GtkWidget *list_item; + GtkWidget *hbox; + GtkWidget *vbox; + GtkWidget *alignment; list_item = gtk_list_item_new (); @@ -1632,9 +1634,9 @@ channel_widget_drag_begin_callback (GtkWidget *widget, typedef struct { - GimpImage *gimage; - Channel *channel; - gint dest_index; + GimpImage *gimage; + GimpChannel *channel; + gint dest_index; } ChannelDrop; static gint @@ -1760,7 +1762,7 @@ channel_widget_drop_color (GtkWidget *widget, gpointer data) { ChannelWidget *channel_widget; - Channel *channel; + GimpChannel *channel; channel_widget = (ChannelWidget *) data; channel = channel_widget->channel; @@ -2102,18 +2104,18 @@ channel_widget_preview_redraw (ChannelWidget *channel_widget) if (channelsD->ratio > 1.0) /* Preview is scaling up! */ { - preview_buf = channel_preview (channel_widget->channel, - channelsD->gimage_width, - channelsD->gimage_height); + preview_buf = gimp_channel_preview (channel_widget->channel, + channelsD->gimage_width, + channelsD->gimage_height); preview_buf = gimp_preview_scale (preview_buf, channel_widget->width, channel_widget->height); } else { - preview_buf = channel_preview (channel_widget->channel, - channel_widget->width, - channel_widget->height); + preview_buf = gimp_channel_preview (channel_widget->channel, + channel_widget->width, + channel_widget->height); } break; @@ -2382,7 +2384,7 @@ channel_widget_channel_flush (GtkWidget *widget, gpointer data) { ChannelWidget *channel_widget; - gboolean update_preview = FALSE; + gboolean update_preview = FALSE; channel_widget = (ChannelWidget *) gtk_object_get_user_data (GTK_OBJECT (widget)); @@ -2507,7 +2509,7 @@ new_channel_query_ok_callback (GtkWidget *widget, gpointer data) { NewChannelOptions *options; - Channel *new_channel; + GimpChannel *new_channel; GimpImage *gimage; options = (NewChannelOptions *) data; @@ -2520,9 +2522,9 @@ new_channel_query_ok_callback (GtkWidget *widget, { gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel), &channel_color); - new_channel = channel_new (gimage, gimage->width, gimage->height, - channel_name, - &channel_color); + new_channel = gimp_channel_new (gimage, gimage->width, gimage->height, + channel_name, + &channel_color); drawable_fill (GIMP_DRAWABLE (new_channel), TRANSPARENT_FILL); @@ -2654,7 +2656,7 @@ edit_channel_query_ok_callback (GtkWidget *widget, gpointer data) { EditChannelOptions *options; - Channel *channel; + GimpChannel *channel; GimpRGB color; options = (EditChannelOptions *) data; diff --git a/app/commands.c b/app/commands.c index f156662c7c..38474c3c47 100644 --- a/app/commands.c +++ b/app/commands.c @@ -73,6 +73,7 @@ #include "selection.h" #include "tips_dialog.h" #include "undo.h" +#include "undo_history.h" #ifdef DISPLAY_FILTERS #include "gdisplay_color_ui.h" diff --git a/app/core/gimp-edit.c b/app/core/gimp-edit.c index e4db428c9d..621443225f 100644 --- a/app/core/gimp-edit.c +++ b/app/core/gimp-edit.c @@ -351,7 +351,7 @@ edit_paste (GimpImage *gimage, * it seems like the correct behavior. */ if (! gimage_mask_is_empty (gimage) && !paste_into) - channel_clear (gimp_image_get_mask (gimage)); + gimp_channel_clear (gimp_image_get_mask (gimage)); /* if there's a drawable, add a new floating selection */ if (drawable != NULL) diff --git a/app/core/gimpchannel-combine.c b/app/core/gimpchannel-combine.c index 174b27dc3e..bb1567a548 100644 --- a/app/core/gimpchannel-combine.c +++ b/app/core/gimpchannel-combine.c @@ -50,13 +50,13 @@ #include "libgimp/gimpintl.h" -static void gimp_channel_class_init (GimpChannelClass *klass); -static void gimp_channel_init (GimpChannel *channel); -static void gimp_channel_destroy (GtkObject *object); +static void gimp_channel_class_init (GimpChannelClass *klass); +static void gimp_channel_init (GimpChannel *channel); +static void gimp_channel_destroy (GtkObject *object); -static TempBuf * channel_preview_private (Channel *channel, - gint width, - gint height); +static TempBuf * gimp_channel_preview_private (GimpChannel *channel, + gint width, + gint height); static GimpDrawableClass *parent_class = NULL; @@ -109,28 +109,28 @@ gimp_channel_init (GimpChannel *channel) /**************************/ static void -channel_validate (TileManager *tm, - Tile *tile) +gimp_channel_validate (TileManager *tm, + Tile *tile) { /* Set the contents of the tile to empty */ memset (tile_data_pointer (tile, 0, 0), TRANSPARENT_OPACITY, tile_size (tile)); } -Channel * -channel_new (GimpImage *gimage, - gint width, - gint height, - const gchar *name, - const GimpRGB *color) +GimpChannel * +gimp_channel_new (GimpImage *gimage, + gint width, + gint height, + const gchar *name, + const GimpRGB *color) { - Channel *channel; + GimpChannel *channel; g_return_val_if_fail (color != NULL, NULL); channel = gtk_type_new (GIMP_TYPE_CHANNEL); - gimp_drawable_configure (GIMP_DRAWABLE (channel), + gimp_drawable_configure (GIMP_DRAWABLE (channel), gimage, width, height, GRAY_GIMAGE, name); /* set the channel color and opacity */ @@ -154,11 +154,11 @@ channel_new (GimpImage *gimage, return channel; } -Channel * -channel_copy (const Channel *channel) +GimpChannel * +gimp_channel_copy (const GimpChannel *channel) { gchar *channel_name; - Channel *new_channel; + GimpChannel *new_channel; PixelRegion srcPR, destPR; gchar *ext; gint number; @@ -180,11 +180,11 @@ channel_copy (const Channel *channel) channel_name = g_strdup_printf (_("%s copy"), name); /* allocate a new channel object */ - new_channel = channel_new (GIMP_DRAWABLE (channel)->gimage, - GIMP_DRAWABLE (channel)->width, - GIMP_DRAWABLE (channel)->height, - channel_name, - &channel->color); + new_channel = gimp_channel_new (GIMP_DRAWABLE (channel)->gimage, + GIMP_DRAWABLE (channel)->width, + GIMP_DRAWABLE (channel)->height, + channel_name, + &channel->color); GIMP_DRAWABLE (new_channel)->visible = GIMP_DRAWABLE (channel)->visible; new_channel->show_masked = channel->show_masked; @@ -209,8 +209,8 @@ channel_copy (const Channel *channel) } void -channel_set_color (Channel *channel, - const GimpRGB *color) +gimp_channel_set_color (GimpChannel *channel, + const GimpRGB *color) { g_return_if_fail (channel != NULL); g_return_if_fail (GIMP_IS_CHANNEL (channel)); @@ -220,7 +220,7 @@ channel_set_color (Channel *channel, } const GimpRGB * -channel_get_color (const Channel *channel) +gimp_channel_get_color (const GimpChannel *channel) { g_return_val_if_fail (channel != NULL, NULL); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), NULL); @@ -229,7 +229,7 @@ channel_get_color (const Channel *channel) } gint -channel_get_opacity (const Channel *channel) +gimp_channel_get_opacity (const GimpChannel *channel) { g_return_val_if_fail (channel != NULL, 0); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), 0); @@ -238,8 +238,8 @@ channel_get_opacity (const Channel *channel) } void -channel_set_opacity (Channel *channel, - gint opacity) +gimp_channel_set_opacity (GimpChannel *channel, + gint opacity) { g_return_if_fail (channel != NULL); g_return_if_fail (GIMP_IS_CHANNEL (channel)); @@ -270,9 +270,9 @@ gimp_channel_destroy (GtkObject *object) } void -channel_scale (Channel *channel, - gint new_width, - gint new_height) +gimp_channel_scale (GimpChannel *channel, + gint new_width, + gint new_height) { PixelRegion srcPR, destPR; TileManager *new_tiles; @@ -318,11 +318,11 @@ channel_scale (Channel *channel, } void -channel_resize (Channel *channel, - gint new_width, - gint new_height, - gint offx, - gint offy) +gimp_channel_resize (GimpChannel *channel, + gint new_width, + gint new_height, + gint offx, + gint offy) { PixelRegion srcPR, destPR; TileManager *new_tiles; @@ -415,7 +415,7 @@ channel_resize (Channel *channel, } void -channel_update (Channel *channel) +gimp_channel_update (GimpChannel *channel) { drawable_update (GIMP_DRAWABLE (channel), 0, 0, @@ -429,7 +429,7 @@ channel_update (Channel *channel) /**********************/ gboolean -channel_toggle_visibility (Channel *channel) +gimp_channel_toggle_visibility (GimpChannel *channel) { GIMP_DRAWABLE (channel)->visible = !GIMP_DRAWABLE (channel)->visible; @@ -437,9 +437,9 @@ channel_toggle_visibility (Channel *channel) } TempBuf * -channel_preview (Channel *channel, - gint width, - gint height) +gimp_channel_preview (GimpChannel *channel, + gint width, + gint height) { /* Ok prime the cache with a large preview if the cache is invalid */ if (! GIMP_DRAWABLE (channel)->preview_valid && @@ -449,9 +449,9 @@ channel_preview (Channel *channel, GIMP_DRAWABLE (channel)->gimage->width > PREVIEW_CACHE_PRIME_WIDTH && GIMP_DRAWABLE (channel)->gimage->height > PREVIEW_CACHE_PRIME_HEIGHT) { - TempBuf * tb = channel_preview_private (channel, - PREVIEW_CACHE_PRIME_WIDTH, - PREVIEW_CACHE_PRIME_HEIGHT); + TempBuf * tb = gimp_channel_preview_private (channel, + PREVIEW_CACHE_PRIME_WIDTH, + PREVIEW_CACHE_PRIME_HEIGHT); /* Save the 2nd call */ if (width == PREVIEW_CACHE_PRIME_WIDTH && @@ -460,13 +460,13 @@ channel_preview (Channel *channel, } /* Second call - should NOT visit the tile cache... */ - return channel_preview_private (channel, width, height); + return gimp_channel_preview_private (channel, width, height); } static TempBuf * -channel_preview_private (Channel *channel, - gint width, - gint height) +gimp_channel_preview_private (GimpChannel *channel, + gint width, + gint height) { MaskBuf *preview_buf; PixelRegion srcPR; @@ -526,35 +526,35 @@ channel_preview_private (Channel *channel, /* selection mask functions */ /******************************/ -Channel * -channel_new_mask (GimpImage *gimage, - gint width, - gint height) +GimpChannel * +gimp_channel_new_mask (GimpImage *gimage, + gint width, + gint height) { - GimpRGB black = { 0.0, 0.0, 0.0, 0.5 }; - Channel *new_channel; + GimpRGB black = { 0.0, 0.0, 0.0, 0.5 }; + GimpChannel *new_channel; /* Create the new channel */ - new_channel = channel_new (gimage, width, height, - _("Selection Mask"), &black); + new_channel = gimp_channel_new (gimage, width, height, + _("Selection Mask"), &black); /* Set the validate procedure */ tile_manager_set_validate_proc (GIMP_DRAWABLE (new_channel)->tiles, - channel_validate); + gimp_channel_validate); return new_channel; } gboolean -channel_boundary (Channel *mask, - BoundSeg **segs_in, - BoundSeg **segs_out, - gint *num_segs_in, - gint *num_segs_out, - gint x1, - gint y1, - gint x2, - gint y2) +gimp_channel_boundary (GimpChannel *mask, + BoundSeg **segs_in, + BoundSeg **segs_out, + gint *num_segs_in, + gint *num_segs_out, + gint x1, + gint y1, + gint x2, + gint y2) { gint x3, y3, x4, y4; PixelRegion bPR; @@ -567,7 +567,7 @@ channel_boundary (Channel *mask, if (mask->segs_out) g_free (mask->segs_out); - if (channel_bounds (mask, &x3, &y3, &x4, &y4)) + if (gimp_channel_bounds (mask, &x3, &y3, &x4, &y4)) { pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x3, y3, (x4 - x3), (y4 - y3), FALSE); @@ -616,9 +616,9 @@ channel_boundary (Channel *mask, } gint -channel_value (Channel *mask, - gint x, - gint y) +gimp_channel_value (GimpChannel *mask, + gint x, + gint y) { Tile *tile; gint val; @@ -646,11 +646,11 @@ channel_value (Channel *mask, } gboolean -channel_bounds (Channel *mask, - gint *x1, - gint *y1, - gint *x2, - gint *y2) +gimp_channel_bounds (GimpChannel *mask, + gint *x1, + gint *y1, + gint *x2, + gint *y2) { PixelRegion maskPR; guchar *data, *data1; @@ -760,7 +760,7 @@ channel_bounds (Channel *mask, } gboolean -channel_is_empty (Channel *mask) +gimp_channel_is_empty (GimpChannel *mask) { PixelRegion maskPR; guchar *data; @@ -811,11 +811,11 @@ channel_is_empty (Channel *mask) } void -channel_add_segment (Channel *mask, - gint x, - gint y, - gint width, - gint value) +gimp_channel_add_segment (GimpChannel *mask, + gint x, + gint y, + gint width, + gint value) { PixelRegion maskPR; guchar *data; @@ -854,11 +854,11 @@ channel_add_segment (Channel *mask, } void -channel_sub_segment (Channel *mask, - gint x, - gint y, - gint width, - gint value) +gimp_channel_sub_segment (GimpChannel *mask, + gint x, + gint y, + gint width, + gint value) { PixelRegion maskPR; guchar *data; @@ -896,12 +896,12 @@ channel_sub_segment (Channel *mask, } void -channel_combine_rect (Channel *mask, - ChannelOps op, - gint x, - gint y, - gint w, - gint h) +gimp_channel_combine_rect (GimpChannel *mask, + ChannelOps op, + gint x, + gint y, + gint w, + gint h) { gint x2, y2; PixelRegion maskPR; @@ -956,13 +956,13 @@ channel_combine_rect (Channel *mask, } void -channel_combine_ellipse (Channel *mask, - ChannelOps op, - gint x, - gint y, - gint w, - gint h, - gboolean antialias) +gimp_channel_combine_ellipse (GimpChannel *mask, + ChannelOps op, + gint x, + gint y, + gint w, + gint h, + gboolean antialias) { gint i, j; gint x0, x1, x2; @@ -1002,10 +1002,10 @@ channel_combine_ellipse (Channel *mask, { case CHANNEL_OP_ADD: case CHANNEL_OP_REPLACE: - channel_add_segment (mask, x1, i, (x2 - x1), 255); + gimp_channel_add_segment (mask, x1, i, (x2 - x1), 255); break; case CHANNEL_OP_SUB: - channel_sub_segment (mask, x1, i, (x2 - x1), 255); + gimp_channel_sub_segment (mask, x1, i, (x2 - x1), 255); break; default: g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); @@ -1046,10 +1046,10 @@ channel_combine_ellipse (Channel *mask, { case CHANNEL_OP_ADD: case CHANNEL_OP_REPLACE: - channel_add_segment (mask, x0, i, j - x0, last); + gimp_channel_add_segment (mask, x0, i, j - x0, last); break; case CHANNEL_OP_SUB: - channel_sub_segment (mask, x0, i, j - x0, last); + gimp_channel_sub_segment (mask, x0, i, j - x0, last); break; default: g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); @@ -1071,9 +1071,9 @@ channel_combine_ellipse (Channel *mask, if (last) { if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE) - channel_add_segment (mask, x0, i, j - x0, last); + gimp_channel_add_segment (mask, x0, i, j - x0, last); else if (op == CHANNEL_OP_SUB) - channel_sub_segment (mask, x0, i, j - x0, last); + gimp_channel_sub_segment (mask, x0, i, j - x0, last); else g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); } @@ -1112,9 +1112,9 @@ channel_combine_ellipse (Channel *mask, } static void -channel_combine_sub_region_add (void *unused, - PixelRegion *srcPR, - PixelRegion *destPR) +gimp_channel_combine_sub_region_add (void *unused, + PixelRegion *srcPR, + PixelRegion *destPR) { guchar *src, *dest; gint x, y, val; @@ -1138,9 +1138,9 @@ channel_combine_sub_region_add (void *unused, } static void -channel_combine_sub_region_sub (void *unused, - PixelRegion *srcPR, - PixelRegion *destPR) +gimp_channel_combine_sub_region_sub (void *unused, + PixelRegion *srcPR, + PixelRegion *destPR) { guchar *src, *dest; gint x, y; @@ -1163,9 +1163,9 @@ channel_combine_sub_region_sub (void *unused, } static void -channel_combine_sub_region_intersect (void *unused, - PixelRegion *srcPR, - PixelRegion *destPR) +gimp_channel_combine_sub_region_intersect (void *unused, + PixelRegion *srcPR, + PixelRegion *destPR) { guchar *src, *dest; gint x, y; @@ -1185,11 +1185,11 @@ channel_combine_sub_region_intersect (void *unused, } void -channel_combine_mask (Channel *mask, - Channel *add_on, - ChannelOps op, - gint off_x, - gint off_y) +gimp_channel_combine_mask (GimpChannel *mask, + GimpChannel *add_on, + ChannelOps op, + gint off_x, + gint off_y) { PixelRegion srcPR, destPR; gint x1, y1, x2, y2; @@ -1213,35 +1213,38 @@ channel_combine_mask (Channel *mask, { case CHANNEL_OP_ADD: case CHANNEL_OP_REPLACE: - pixel_regions_process_parallel ((p_func) channel_combine_sub_region_add, + pixel_regions_process_parallel ((p_func) + gimp_channel_combine_sub_region_add, NULL, 2, &srcPR, &destPR); break; case CHANNEL_OP_SUB: - pixel_regions_process_parallel ((p_func) channel_combine_sub_region_sub, + pixel_regions_process_parallel ((p_func) + gimp_channel_combine_sub_region_sub, NULL, 2, &srcPR, &destPR); break; case CHANNEL_OP_INTERSECT: pixel_regions_process_parallel ((p_func) - channel_combine_sub_region_intersect, + gimp_channel_combine_sub_region_intersect, NULL, 2, &srcPR, &destPR); break; default: g_message ("Error: unknown opperation type in channel_combine_mask\n"); break; } + mask->bounds_known = FALSE; } void -channel_feather (Channel *input, - Channel *output, - gdouble radius_x, - gdouble radius_y, - ChannelOps op, - gint off_x, - gint off_y) +gimp_channel_feather (GimpChannel *input, + GimpChannel *output, + gdouble radius_x, + gdouble radius_y, + ChannelOps op, + gint off_x, + gint off_y) { - gint x1, y1, x2, y2; + gint x1, y1, x2, y2; PixelRegion srcPR; x1 = CLAMP (off_x, 0, GIMP_DRAWABLE (output)->width); @@ -1256,22 +1259,22 @@ channel_feather (Channel *input, gaussian_blur_region (&srcPR, radius_x, radius_y); if (input != output) - channel_combine_mask (output, input, op, 0, 0); + gimp_channel_combine_mask (output, input, op, 0, 0); output->bounds_known = FALSE; } void -channel_push_undo (Channel *mask) +gimp_channel_push_undo (GimpChannel *mask) { - gint x1, y1, x2, y2; - MaskUndo *mask_undo; + gint x1, y1, x2, y2; + MaskUndo *mask_undo; TileManager *undo_tiles; - PixelRegion srcPR, destPR; - GImage *gimage; + PixelRegion srcPR, destPR; + GImage *gimage; mask_undo = g_new (MaskUndo, 1); - if (channel_bounds (mask, &x1, &y1, &x2, &y2)) + if (gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) { undo_tiles = tile_manager_new ((x2 - x1), (y2 - y1), 1); pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles, @@ -1296,13 +1299,13 @@ channel_push_undo (Channel *mask) } void -channel_clear (Channel *mask) +gimp_channel_clear (GimpChannel *mask) { PixelRegion maskPR; - guchar bg = 0; + guchar bg = 0; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); if (mask->bounds_known && !mask->empty) { @@ -1331,13 +1334,13 @@ channel_clear (Channel *mask) } void -channel_invert (Channel *mask) +gimp_channel_invert (GimpChannel *mask) { PixelRegion maskPR; GimpLut *lut; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, 0, 0, @@ -1353,13 +1356,13 @@ channel_invert (Channel *mask) } void -channel_sharpen (Channel *mask) +gimp_channel_sharpen (GimpChannel *mask) { PixelRegion maskPR; GimpLut *lut; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, 0, 0, @@ -1373,13 +1376,13 @@ channel_sharpen (Channel *mask) } void -channel_all (Channel *mask) +gimp_channel_all (GimpChannel *mask) { PixelRegion maskPR; guchar bg = 255; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); /* clear the mask */ pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, @@ -1398,9 +1401,9 @@ channel_all (Channel *mask) } void -channel_border (Channel *mask, - gint radius_x, - gint radius_y) +gimp_channel_border (GimpChannel *mask, + gint radius_x, + gint radius_y) { PixelRegion bPR; gint x1, y1, x2, y2; @@ -1408,9 +1411,9 @@ channel_border (Channel *mask, if (radius_x < 0 || radius_y < 0) return; - if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) + if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) return; - if (channel_is_empty (mask)) + if (gimp_channel_is_empty (mask)) return; if (x1 - radius_x < 0) @@ -1430,8 +1433,9 @@ channel_border (Channel *mask, y2 = GIMP_DRAWABLE (mask)->height; else y2 += radius_y; + /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2-x1), (y2-y1), TRUE); @@ -1442,9 +1446,9 @@ channel_border (Channel *mask, } void -channel_grow (Channel *mask, - gint radius_x, - gint radius_y) +gimp_channel_grow (GimpChannel *mask, + gint radius_x, + gint radius_y) { PixelRegion bPR; gint x1, y1, x2, y2; @@ -1454,16 +1458,16 @@ channel_grow (Channel *mask, if (radius_x <= 0 && radius_y <= 0) { - channel_shrink (mask, -radius_x, -radius_y, FALSE); + gimp_channel_shrink (mask, -radius_x, -radius_y, FALSE); return; } if (radius_x < 0 || radius_y < 0) return; - if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) + if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) return; - if (channel_is_empty (mask)) + if (gimp_channel_is_empty (mask)) return; if (x1 - radius_x > 0) @@ -1484,7 +1488,7 @@ channel_grow (Channel *mask, y2 = GIMP_DRAWABLE (mask)->height; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); /* need full extents for grow, not! */ pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1), @@ -1496,10 +1500,10 @@ channel_grow (Channel *mask, } void -channel_shrink (Channel *mask, - gint radius_x, - gint radius_y, - gboolean edge_lock) +gimp_channel_shrink (GimpChannel *mask, + gint radius_x, + gint radius_y, + gboolean edge_lock) { PixelRegion bPR; gint x1, y1, x2, y2; @@ -1509,16 +1513,16 @@ channel_shrink (Channel *mask, if (radius_x <= 0 && radius_y <= 0) { - channel_grow (mask, -radius_x, -radius_y); + gimp_channel_grow (mask, -radius_x, -radius_y); return; } if (radius_x < 0 || radius_y < 0) return; - if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) + if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) return; - if (channel_is_empty (mask)) + if (gimp_channel_is_empty (mask)) return; if (x1 > 0) @@ -1531,7 +1535,7 @@ channel_shrink (Channel *mask, y2++; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1), (y2 - y1), TRUE); @@ -1542,12 +1546,12 @@ channel_shrink (Channel *mask, } void -channel_translate (Channel *mask, - gint off_x, - gint off_y) +gimp_channel_translate (GimpChannel *mask, + gint off_x, + gint off_y) { gint width, height; - Channel *tmp_mask; + GimpChannel *tmp_mask; PixelRegion srcPR, destPR; guchar empty = 0; gint x1, y1, x2, y2; @@ -1555,9 +1559,9 @@ channel_translate (Channel *mask, tmp_mask = NULL; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); - channel_bounds (mask, &x1, &y1, &x2, &y2); + gimp_channel_bounds (mask, &x1, &y1, &x2, &y2); x1 = CLAMP ((x1 + off_x), 0, GIMP_DRAWABLE (mask)->width); y1 = CLAMP ((y1 + off_y), 0, GIMP_DRAWABLE (mask)->height); x2 = CLAMP ((x2 + off_x), 0, GIMP_DRAWABLE (mask)->width); @@ -1572,7 +1576,8 @@ channel_translate (Channel *mask, /* copy the portion of the mask we will keep to a * temporary buffer */ - tmp_mask = channel_new_mask (GIMP_DRAWABLE (mask)->gimage, width, height); + tmp_mask = gimp_channel_new_mask (GIMP_DRAWABLE (mask)->gimage, + width, height); pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles, x1 - off_x, y1 - off_y, width, height, FALSE); @@ -1619,13 +1624,13 @@ channel_translate (Channel *mask, } void -channel_load (Channel *mask, - Channel *channel) +gimp_channel_load (GimpChannel *mask, + GimpChannel *channel) { PixelRegion srcPR, destPR; /* push the current mask onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); /* copy the channel to the mask */ pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles, @@ -1642,15 +1647,15 @@ channel_load (Channel *mask, } void -channel_layer_alpha (Channel *mask, - GimpLayer *layer) +gimp_channel_layer_alpha (GimpChannel *mask, + GimpLayer *layer) { PixelRegion srcPR, destPR; guchar empty = 0; gint x1, y1, x2, y2; /* push the current mask onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); /* clear the mask */ pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles, @@ -1678,15 +1683,15 @@ channel_layer_alpha (Channel *mask, } void -channel_layer_mask (Channel *mask, - GimpLayer *layer) +gimp_channel_layer_mask (GimpChannel *mask, + GimpLayer *layer) { PixelRegion srcPR, destPR; guchar empty = 0; gint x1, y1, x2, y2; /* push the current mask onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); /* clear the mask */ pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles, @@ -1717,7 +1722,7 @@ channel_layer_mask (Channel *mask, } void -channel_invalidate_bounds (Channel *channel) +gimp_channel_invalidate_bounds (GimpChannel *channel) { channel->bounds_known = FALSE; } diff --git a/app/core/gimpchannel-combine.h b/app/core/gimpchannel-combine.h index 9bd6a4b739..158b7c09c5 100644 --- a/app/core/gimpchannel-combine.h +++ b/app/core/gimpchannel-combine.h @@ -16,8 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __CHANNEL_H__ -#define __CHANNEL_H__ +#ifndef __GIMP_CHANNEL_H__ +#define __GIMP_CHANNEL_H__ #include "gimpdrawable.h" @@ -26,7 +26,6 @@ /* Half way point where a region is no longer visible in a selection */ #define HALF_WAY 127 -/* structure declarations */ #define GIMP_TYPE_CHANNEL (gimp_channel_get_type ()) #define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel)) @@ -63,21 +62,18 @@ struct _GimpChannelClass }; +/* Special undo types */ -/* Special undo type */ typedef struct _ChannelUndo ChannelUndo; +typedef struct _MaskUndo MaskUndo; struct _ChannelUndo { - Channel *channel; /* the actual channel */ - gint prev_position; /* former position in list */ - Channel *prev_channel; /* previous active channel */ + GimpChannel *channel; /* the actual channel */ + gint prev_position; /* former position in list */ + GimpChannel *prev_channel; /* previous active channel */ }; - -/* Special undo type */ -typedef struct _MaskUndo MaskUndo; - struct _MaskUndo { TileManager *tiles; /* the actual mask */ @@ -87,128 +83,128 @@ struct _MaskUndo /* function declarations */ -GtkType gimp_channel_get_type (void); +GtkType gimp_channel_get_type (void); -Channel * channel_new (GimpImage *gimage, - gint width, - gint height, - const gchar *name, - const GimpRGB *color); -Channel * channel_copy (const Channel *channel); +GimpChannel * gimp_channel_new (GimpImage *gimage, + gint width, + gint height, + const gchar *name, + const GimpRGB *color); +GimpChannel * gimp_channel_copy (const GimpChannel *channel); -gint channel_get_opacity (const Channel *channel); -void channel_set_opacity (Channel *channel, - gint opacity); +gint gimp_channel_get_opacity (const GimpChannel *channel); +void gimp_channel_set_opacity (GimpChannel *channel, + gint opacity); -const GimpRGB * channel_get_color (const Channel *channel); -void channel_set_color (Channel *channel, - const GimpRGB *color); +const GimpRGB * gimp_channel_get_color (const GimpChannel *channel); +void gimp_channel_set_color (GimpChannel *channel, + const GimpRGB *color); -void channel_scale (Channel *channel, - gint new_width, - gint new_height); -void channel_resize (Channel *channel, - gint new_width, - gint new_height, - gint offx, - gint offy); -void channel_update (Channel *channel); +void gimp_channel_scale (GimpChannel *channel, + gint new_width, + gint new_height); +void gimp_channel_resize (GimpChannel *channel, + gint new_width, + gint new_height, + gint offx, + gint offy); +void gimp_channel_update (GimpChannel *channel); /* access functions */ -gboolean channel_toggle_visibility (Channel *channel); -TempBuf * channel_preview (Channel *channel, - gint width, - gint height); +gboolean gimp_channel_toggle_visibility (GimpChannel *channel); +TempBuf * gimp_channel_preview (GimpChannel *channel, + gint width, + gint height); /* selection mask functions */ -Channel * channel_new_mask (GimpImage *gimage, - gint width, - gint height); -gboolean channel_boundary (Channel *mask, - BoundSeg **segs_in, - BoundSeg **segs_out, - gint *num_segs_in, - gint *num_segs_out, - gint x1, - gint y1, - gint x2, - gint y2); -gboolean channel_bounds (Channel *mask, - gint *x1, - gint *y1, - gint *x2, - gint *y2); -gint channel_value (Channel *mask, - gint x, - gint y); -gboolean channel_is_empty (Channel *mask); -void channel_add_segment (Channel *mask, - gint x, - gint y, - gint width, - gint value); -void channel_sub_segment (Channel *mask, - gint x, - gint y, - gint width, - gint value); -void channel_combine_rect (Channel *mask, - ChannelOps op, - gint x, - gint y, - gint w, - gint h); -void channel_combine_ellipse (Channel *mask, - ChannelOps op, - gint x, - gint y, - gint w, - gint h, - gboolean antialias); -void channel_combine_mask (Channel *mask, - Channel *add_on, - ChannelOps op, - gint off_x, - gint off_y); -void channel_feather (Channel *input, - Channel *output, - gdouble radius_x, - gdouble radius_y, - ChannelOps op, - gint off_x, - gint off_y); +GimpChannel * gimp_channel_new_mask (GimpImage *gimage, + gint width, + gint height); +gboolean gimp_channel_boundary (GimpChannel *mask, + BoundSeg **segs_in, + BoundSeg **segs_out, + gint *num_segs_in, + gint *num_segs_out, + gint x1, + gint y1, + gint x2, + gint y2); +gboolean gimp_channel_bounds (GimpChannel *mask, + gint *x1, + gint *y1, + gint *x2, + gint *y2); +gint gimp_channel_value (GimpChannel *mask, + gint x, + gint y); +gboolean gimp_channel_is_empty (GimpChannel *mask); +void gimp_channel_add_segment (GimpChannel *mask, + gint x, + gint y, + gint width, + gint value); +void gimp_channel_sub_segment (GimpChannel *mask, + gint x, + gint y, + gint width, + gint value); +void gimp_channel_combine_rect (GimpChannel *mask, + ChannelOps op, + gint x, + gint y, + gint w, + gint h); +void gimp_channel_combine_ellipse (GimpChannel *mask, + ChannelOps op, + gint x, + gint y, + gint w, + gint h, + gboolean antialias); +void gimp_channel_combine_mask (GimpChannel *mask, + GimpChannel *add_on, + ChannelOps op, + gint off_x, + gint off_y); +void gimp_channel_feather (GimpChannel *input, + GimpChannel *output, + gdouble radius_x, + gdouble radius_y, + ChannelOps op, + gint off_x, + gint off_y); -void channel_push_undo (Channel *mask); -void channel_clear (Channel *mask); -void channel_invert (Channel *mask); -void channel_sharpen (Channel *mask); -void channel_all (Channel *mask); +void gimp_channel_push_undo (GimpChannel *mask); +void gimp_channel_clear (GimpChannel *mask); +void gimp_channel_invert (GimpChannel *mask); +void gimp_channel_sharpen (GimpChannel *mask); +void gimp_channel_all (GimpChannel *mask); -void channel_border (Channel *mask, - gint radius_x, - gint radius_y); -void channel_grow (Channel *mask, - gint radius_x, - gint radius_y); -void channel_shrink (Channel *mask, - gint radius_x, - gint radius_y, - gboolean edge_lock); +void gimp_channel_border (GimpChannel *mask, + gint radius_x, + gint radius_y); +void gimp_channel_grow (GimpChannel *mask, + gint radius_x, + gint radius_y); +void gimp_channel_shrink (GimpChannel *mask, + gint radius_x, + gint radius_y, + gboolean edge_lock); -void channel_translate (Channel *mask, - gint off_x, - gint off_y); -void channel_load (Channel *mask, - Channel *channel); +void gimp_channel_translate (GimpChannel *mask, + gint off_x, + gint off_y); +void gimp_channel_load (GimpChannel *mask, + GimpChannel *channel); -void channel_layer_alpha (Channel *mask, - GimpLayer *layer); -void channel_layer_mask (Channel *mask, - GimpLayer *layer); +void gimp_channel_layer_alpha (GimpChannel *mask, + GimpLayer *layer); +void gimp_channel_layer_mask (GimpChannel *mask, + GimpLayer *layer); -void channel_invalidate_bounds (Channel *channel); +void gimp_channel_invalidate_bounds (GimpChannel *channel); -#endif /* __CHANNEL_H__ */ +#endif /* __GIMP_CHANNEL_H__ */ diff --git a/app/core/gimpchannel.c b/app/core/gimpchannel.c index 174b27dc3e..bb1567a548 100644 --- a/app/core/gimpchannel.c +++ b/app/core/gimpchannel.c @@ -50,13 +50,13 @@ #include "libgimp/gimpintl.h" -static void gimp_channel_class_init (GimpChannelClass *klass); -static void gimp_channel_init (GimpChannel *channel); -static void gimp_channel_destroy (GtkObject *object); +static void gimp_channel_class_init (GimpChannelClass *klass); +static void gimp_channel_init (GimpChannel *channel); +static void gimp_channel_destroy (GtkObject *object); -static TempBuf * channel_preview_private (Channel *channel, - gint width, - gint height); +static TempBuf * gimp_channel_preview_private (GimpChannel *channel, + gint width, + gint height); static GimpDrawableClass *parent_class = NULL; @@ -109,28 +109,28 @@ gimp_channel_init (GimpChannel *channel) /**************************/ static void -channel_validate (TileManager *tm, - Tile *tile) +gimp_channel_validate (TileManager *tm, + Tile *tile) { /* Set the contents of the tile to empty */ memset (tile_data_pointer (tile, 0, 0), TRANSPARENT_OPACITY, tile_size (tile)); } -Channel * -channel_new (GimpImage *gimage, - gint width, - gint height, - const gchar *name, - const GimpRGB *color) +GimpChannel * +gimp_channel_new (GimpImage *gimage, + gint width, + gint height, + const gchar *name, + const GimpRGB *color) { - Channel *channel; + GimpChannel *channel; g_return_val_if_fail (color != NULL, NULL); channel = gtk_type_new (GIMP_TYPE_CHANNEL); - gimp_drawable_configure (GIMP_DRAWABLE (channel), + gimp_drawable_configure (GIMP_DRAWABLE (channel), gimage, width, height, GRAY_GIMAGE, name); /* set the channel color and opacity */ @@ -154,11 +154,11 @@ channel_new (GimpImage *gimage, return channel; } -Channel * -channel_copy (const Channel *channel) +GimpChannel * +gimp_channel_copy (const GimpChannel *channel) { gchar *channel_name; - Channel *new_channel; + GimpChannel *new_channel; PixelRegion srcPR, destPR; gchar *ext; gint number; @@ -180,11 +180,11 @@ channel_copy (const Channel *channel) channel_name = g_strdup_printf (_("%s copy"), name); /* allocate a new channel object */ - new_channel = channel_new (GIMP_DRAWABLE (channel)->gimage, - GIMP_DRAWABLE (channel)->width, - GIMP_DRAWABLE (channel)->height, - channel_name, - &channel->color); + new_channel = gimp_channel_new (GIMP_DRAWABLE (channel)->gimage, + GIMP_DRAWABLE (channel)->width, + GIMP_DRAWABLE (channel)->height, + channel_name, + &channel->color); GIMP_DRAWABLE (new_channel)->visible = GIMP_DRAWABLE (channel)->visible; new_channel->show_masked = channel->show_masked; @@ -209,8 +209,8 @@ channel_copy (const Channel *channel) } void -channel_set_color (Channel *channel, - const GimpRGB *color) +gimp_channel_set_color (GimpChannel *channel, + const GimpRGB *color) { g_return_if_fail (channel != NULL); g_return_if_fail (GIMP_IS_CHANNEL (channel)); @@ -220,7 +220,7 @@ channel_set_color (Channel *channel, } const GimpRGB * -channel_get_color (const Channel *channel) +gimp_channel_get_color (const GimpChannel *channel) { g_return_val_if_fail (channel != NULL, NULL); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), NULL); @@ -229,7 +229,7 @@ channel_get_color (const Channel *channel) } gint -channel_get_opacity (const Channel *channel) +gimp_channel_get_opacity (const GimpChannel *channel) { g_return_val_if_fail (channel != NULL, 0); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), 0); @@ -238,8 +238,8 @@ channel_get_opacity (const Channel *channel) } void -channel_set_opacity (Channel *channel, - gint opacity) +gimp_channel_set_opacity (GimpChannel *channel, + gint opacity) { g_return_if_fail (channel != NULL); g_return_if_fail (GIMP_IS_CHANNEL (channel)); @@ -270,9 +270,9 @@ gimp_channel_destroy (GtkObject *object) } void -channel_scale (Channel *channel, - gint new_width, - gint new_height) +gimp_channel_scale (GimpChannel *channel, + gint new_width, + gint new_height) { PixelRegion srcPR, destPR; TileManager *new_tiles; @@ -318,11 +318,11 @@ channel_scale (Channel *channel, } void -channel_resize (Channel *channel, - gint new_width, - gint new_height, - gint offx, - gint offy) +gimp_channel_resize (GimpChannel *channel, + gint new_width, + gint new_height, + gint offx, + gint offy) { PixelRegion srcPR, destPR; TileManager *new_tiles; @@ -415,7 +415,7 @@ channel_resize (Channel *channel, } void -channel_update (Channel *channel) +gimp_channel_update (GimpChannel *channel) { drawable_update (GIMP_DRAWABLE (channel), 0, 0, @@ -429,7 +429,7 @@ channel_update (Channel *channel) /**********************/ gboolean -channel_toggle_visibility (Channel *channel) +gimp_channel_toggle_visibility (GimpChannel *channel) { GIMP_DRAWABLE (channel)->visible = !GIMP_DRAWABLE (channel)->visible; @@ -437,9 +437,9 @@ channel_toggle_visibility (Channel *channel) } TempBuf * -channel_preview (Channel *channel, - gint width, - gint height) +gimp_channel_preview (GimpChannel *channel, + gint width, + gint height) { /* Ok prime the cache with a large preview if the cache is invalid */ if (! GIMP_DRAWABLE (channel)->preview_valid && @@ -449,9 +449,9 @@ channel_preview (Channel *channel, GIMP_DRAWABLE (channel)->gimage->width > PREVIEW_CACHE_PRIME_WIDTH && GIMP_DRAWABLE (channel)->gimage->height > PREVIEW_CACHE_PRIME_HEIGHT) { - TempBuf * tb = channel_preview_private (channel, - PREVIEW_CACHE_PRIME_WIDTH, - PREVIEW_CACHE_PRIME_HEIGHT); + TempBuf * tb = gimp_channel_preview_private (channel, + PREVIEW_CACHE_PRIME_WIDTH, + PREVIEW_CACHE_PRIME_HEIGHT); /* Save the 2nd call */ if (width == PREVIEW_CACHE_PRIME_WIDTH && @@ -460,13 +460,13 @@ channel_preview (Channel *channel, } /* Second call - should NOT visit the tile cache... */ - return channel_preview_private (channel, width, height); + return gimp_channel_preview_private (channel, width, height); } static TempBuf * -channel_preview_private (Channel *channel, - gint width, - gint height) +gimp_channel_preview_private (GimpChannel *channel, + gint width, + gint height) { MaskBuf *preview_buf; PixelRegion srcPR; @@ -526,35 +526,35 @@ channel_preview_private (Channel *channel, /* selection mask functions */ /******************************/ -Channel * -channel_new_mask (GimpImage *gimage, - gint width, - gint height) +GimpChannel * +gimp_channel_new_mask (GimpImage *gimage, + gint width, + gint height) { - GimpRGB black = { 0.0, 0.0, 0.0, 0.5 }; - Channel *new_channel; + GimpRGB black = { 0.0, 0.0, 0.0, 0.5 }; + GimpChannel *new_channel; /* Create the new channel */ - new_channel = channel_new (gimage, width, height, - _("Selection Mask"), &black); + new_channel = gimp_channel_new (gimage, width, height, + _("Selection Mask"), &black); /* Set the validate procedure */ tile_manager_set_validate_proc (GIMP_DRAWABLE (new_channel)->tiles, - channel_validate); + gimp_channel_validate); return new_channel; } gboolean -channel_boundary (Channel *mask, - BoundSeg **segs_in, - BoundSeg **segs_out, - gint *num_segs_in, - gint *num_segs_out, - gint x1, - gint y1, - gint x2, - gint y2) +gimp_channel_boundary (GimpChannel *mask, + BoundSeg **segs_in, + BoundSeg **segs_out, + gint *num_segs_in, + gint *num_segs_out, + gint x1, + gint y1, + gint x2, + gint y2) { gint x3, y3, x4, y4; PixelRegion bPR; @@ -567,7 +567,7 @@ channel_boundary (Channel *mask, if (mask->segs_out) g_free (mask->segs_out); - if (channel_bounds (mask, &x3, &y3, &x4, &y4)) + if (gimp_channel_bounds (mask, &x3, &y3, &x4, &y4)) { pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x3, y3, (x4 - x3), (y4 - y3), FALSE); @@ -616,9 +616,9 @@ channel_boundary (Channel *mask, } gint -channel_value (Channel *mask, - gint x, - gint y) +gimp_channel_value (GimpChannel *mask, + gint x, + gint y) { Tile *tile; gint val; @@ -646,11 +646,11 @@ channel_value (Channel *mask, } gboolean -channel_bounds (Channel *mask, - gint *x1, - gint *y1, - gint *x2, - gint *y2) +gimp_channel_bounds (GimpChannel *mask, + gint *x1, + gint *y1, + gint *x2, + gint *y2) { PixelRegion maskPR; guchar *data, *data1; @@ -760,7 +760,7 @@ channel_bounds (Channel *mask, } gboolean -channel_is_empty (Channel *mask) +gimp_channel_is_empty (GimpChannel *mask) { PixelRegion maskPR; guchar *data; @@ -811,11 +811,11 @@ channel_is_empty (Channel *mask) } void -channel_add_segment (Channel *mask, - gint x, - gint y, - gint width, - gint value) +gimp_channel_add_segment (GimpChannel *mask, + gint x, + gint y, + gint width, + gint value) { PixelRegion maskPR; guchar *data; @@ -854,11 +854,11 @@ channel_add_segment (Channel *mask, } void -channel_sub_segment (Channel *mask, - gint x, - gint y, - gint width, - gint value) +gimp_channel_sub_segment (GimpChannel *mask, + gint x, + gint y, + gint width, + gint value) { PixelRegion maskPR; guchar *data; @@ -896,12 +896,12 @@ channel_sub_segment (Channel *mask, } void -channel_combine_rect (Channel *mask, - ChannelOps op, - gint x, - gint y, - gint w, - gint h) +gimp_channel_combine_rect (GimpChannel *mask, + ChannelOps op, + gint x, + gint y, + gint w, + gint h) { gint x2, y2; PixelRegion maskPR; @@ -956,13 +956,13 @@ channel_combine_rect (Channel *mask, } void -channel_combine_ellipse (Channel *mask, - ChannelOps op, - gint x, - gint y, - gint w, - gint h, - gboolean antialias) +gimp_channel_combine_ellipse (GimpChannel *mask, + ChannelOps op, + gint x, + gint y, + gint w, + gint h, + gboolean antialias) { gint i, j; gint x0, x1, x2; @@ -1002,10 +1002,10 @@ channel_combine_ellipse (Channel *mask, { case CHANNEL_OP_ADD: case CHANNEL_OP_REPLACE: - channel_add_segment (mask, x1, i, (x2 - x1), 255); + gimp_channel_add_segment (mask, x1, i, (x2 - x1), 255); break; case CHANNEL_OP_SUB: - channel_sub_segment (mask, x1, i, (x2 - x1), 255); + gimp_channel_sub_segment (mask, x1, i, (x2 - x1), 255); break; default: g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); @@ -1046,10 +1046,10 @@ channel_combine_ellipse (Channel *mask, { case CHANNEL_OP_ADD: case CHANNEL_OP_REPLACE: - channel_add_segment (mask, x0, i, j - x0, last); + gimp_channel_add_segment (mask, x0, i, j - x0, last); break; case CHANNEL_OP_SUB: - channel_sub_segment (mask, x0, i, j - x0, last); + gimp_channel_sub_segment (mask, x0, i, j - x0, last); break; default: g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); @@ -1071,9 +1071,9 @@ channel_combine_ellipse (Channel *mask, if (last) { if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE) - channel_add_segment (mask, x0, i, j - x0, last); + gimp_channel_add_segment (mask, x0, i, j - x0, last); else if (op == CHANNEL_OP_SUB) - channel_sub_segment (mask, x0, i, j - x0, last); + gimp_channel_sub_segment (mask, x0, i, j - x0, last); else g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); } @@ -1112,9 +1112,9 @@ channel_combine_ellipse (Channel *mask, } static void -channel_combine_sub_region_add (void *unused, - PixelRegion *srcPR, - PixelRegion *destPR) +gimp_channel_combine_sub_region_add (void *unused, + PixelRegion *srcPR, + PixelRegion *destPR) { guchar *src, *dest; gint x, y, val; @@ -1138,9 +1138,9 @@ channel_combine_sub_region_add (void *unused, } static void -channel_combine_sub_region_sub (void *unused, - PixelRegion *srcPR, - PixelRegion *destPR) +gimp_channel_combine_sub_region_sub (void *unused, + PixelRegion *srcPR, + PixelRegion *destPR) { guchar *src, *dest; gint x, y; @@ -1163,9 +1163,9 @@ channel_combine_sub_region_sub (void *unused, } static void -channel_combine_sub_region_intersect (void *unused, - PixelRegion *srcPR, - PixelRegion *destPR) +gimp_channel_combine_sub_region_intersect (void *unused, + PixelRegion *srcPR, + PixelRegion *destPR) { guchar *src, *dest; gint x, y; @@ -1185,11 +1185,11 @@ channel_combine_sub_region_intersect (void *unused, } void -channel_combine_mask (Channel *mask, - Channel *add_on, - ChannelOps op, - gint off_x, - gint off_y) +gimp_channel_combine_mask (GimpChannel *mask, + GimpChannel *add_on, + ChannelOps op, + gint off_x, + gint off_y) { PixelRegion srcPR, destPR; gint x1, y1, x2, y2; @@ -1213,35 +1213,38 @@ channel_combine_mask (Channel *mask, { case CHANNEL_OP_ADD: case CHANNEL_OP_REPLACE: - pixel_regions_process_parallel ((p_func) channel_combine_sub_region_add, + pixel_regions_process_parallel ((p_func) + gimp_channel_combine_sub_region_add, NULL, 2, &srcPR, &destPR); break; case CHANNEL_OP_SUB: - pixel_regions_process_parallel ((p_func) channel_combine_sub_region_sub, + pixel_regions_process_parallel ((p_func) + gimp_channel_combine_sub_region_sub, NULL, 2, &srcPR, &destPR); break; case CHANNEL_OP_INTERSECT: pixel_regions_process_parallel ((p_func) - channel_combine_sub_region_intersect, + gimp_channel_combine_sub_region_intersect, NULL, 2, &srcPR, &destPR); break; default: g_message ("Error: unknown opperation type in channel_combine_mask\n"); break; } + mask->bounds_known = FALSE; } void -channel_feather (Channel *input, - Channel *output, - gdouble radius_x, - gdouble radius_y, - ChannelOps op, - gint off_x, - gint off_y) +gimp_channel_feather (GimpChannel *input, + GimpChannel *output, + gdouble radius_x, + gdouble radius_y, + ChannelOps op, + gint off_x, + gint off_y) { - gint x1, y1, x2, y2; + gint x1, y1, x2, y2; PixelRegion srcPR; x1 = CLAMP (off_x, 0, GIMP_DRAWABLE (output)->width); @@ -1256,22 +1259,22 @@ channel_feather (Channel *input, gaussian_blur_region (&srcPR, radius_x, radius_y); if (input != output) - channel_combine_mask (output, input, op, 0, 0); + gimp_channel_combine_mask (output, input, op, 0, 0); output->bounds_known = FALSE; } void -channel_push_undo (Channel *mask) +gimp_channel_push_undo (GimpChannel *mask) { - gint x1, y1, x2, y2; - MaskUndo *mask_undo; + gint x1, y1, x2, y2; + MaskUndo *mask_undo; TileManager *undo_tiles; - PixelRegion srcPR, destPR; - GImage *gimage; + PixelRegion srcPR, destPR; + GImage *gimage; mask_undo = g_new (MaskUndo, 1); - if (channel_bounds (mask, &x1, &y1, &x2, &y2)) + if (gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) { undo_tiles = tile_manager_new ((x2 - x1), (y2 - y1), 1); pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles, @@ -1296,13 +1299,13 @@ channel_push_undo (Channel *mask) } void -channel_clear (Channel *mask) +gimp_channel_clear (GimpChannel *mask) { PixelRegion maskPR; - guchar bg = 0; + guchar bg = 0; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); if (mask->bounds_known && !mask->empty) { @@ -1331,13 +1334,13 @@ channel_clear (Channel *mask) } void -channel_invert (Channel *mask) +gimp_channel_invert (GimpChannel *mask) { PixelRegion maskPR; GimpLut *lut; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, 0, 0, @@ -1353,13 +1356,13 @@ channel_invert (Channel *mask) } void -channel_sharpen (Channel *mask) +gimp_channel_sharpen (GimpChannel *mask) { PixelRegion maskPR; GimpLut *lut; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, 0, 0, @@ -1373,13 +1376,13 @@ channel_sharpen (Channel *mask) } void -channel_all (Channel *mask) +gimp_channel_all (GimpChannel *mask) { PixelRegion maskPR; guchar bg = 255; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); /* clear the mask */ pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, @@ -1398,9 +1401,9 @@ channel_all (Channel *mask) } void -channel_border (Channel *mask, - gint radius_x, - gint radius_y) +gimp_channel_border (GimpChannel *mask, + gint radius_x, + gint radius_y) { PixelRegion bPR; gint x1, y1, x2, y2; @@ -1408,9 +1411,9 @@ channel_border (Channel *mask, if (radius_x < 0 || radius_y < 0) return; - if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) + if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) return; - if (channel_is_empty (mask)) + if (gimp_channel_is_empty (mask)) return; if (x1 - radius_x < 0) @@ -1430,8 +1433,9 @@ channel_border (Channel *mask, y2 = GIMP_DRAWABLE (mask)->height; else y2 += radius_y; + /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2-x1), (y2-y1), TRUE); @@ -1442,9 +1446,9 @@ channel_border (Channel *mask, } void -channel_grow (Channel *mask, - gint radius_x, - gint radius_y) +gimp_channel_grow (GimpChannel *mask, + gint radius_x, + gint radius_y) { PixelRegion bPR; gint x1, y1, x2, y2; @@ -1454,16 +1458,16 @@ channel_grow (Channel *mask, if (radius_x <= 0 && radius_y <= 0) { - channel_shrink (mask, -radius_x, -radius_y, FALSE); + gimp_channel_shrink (mask, -radius_x, -radius_y, FALSE); return; } if (radius_x < 0 || radius_y < 0) return; - if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) + if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) return; - if (channel_is_empty (mask)) + if (gimp_channel_is_empty (mask)) return; if (x1 - radius_x > 0) @@ -1484,7 +1488,7 @@ channel_grow (Channel *mask, y2 = GIMP_DRAWABLE (mask)->height; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); /* need full extents for grow, not! */ pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1), @@ -1496,10 +1500,10 @@ channel_grow (Channel *mask, } void -channel_shrink (Channel *mask, - gint radius_x, - gint radius_y, - gboolean edge_lock) +gimp_channel_shrink (GimpChannel *mask, + gint radius_x, + gint radius_y, + gboolean edge_lock) { PixelRegion bPR; gint x1, y1, x2, y2; @@ -1509,16 +1513,16 @@ channel_shrink (Channel *mask, if (radius_x <= 0 && radius_y <= 0) { - channel_grow (mask, -radius_x, -radius_y); + gimp_channel_grow (mask, -radius_x, -radius_y); return; } if (radius_x < 0 || radius_y < 0) return; - if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) + if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) return; - if (channel_is_empty (mask)) + if (gimp_channel_is_empty (mask)) return; if (x1 > 0) @@ -1531,7 +1535,7 @@ channel_shrink (Channel *mask, y2++; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1), (y2 - y1), TRUE); @@ -1542,12 +1546,12 @@ channel_shrink (Channel *mask, } void -channel_translate (Channel *mask, - gint off_x, - gint off_y) +gimp_channel_translate (GimpChannel *mask, + gint off_x, + gint off_y) { gint width, height; - Channel *tmp_mask; + GimpChannel *tmp_mask; PixelRegion srcPR, destPR; guchar empty = 0; gint x1, y1, x2, y2; @@ -1555,9 +1559,9 @@ channel_translate (Channel *mask, tmp_mask = NULL; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); - channel_bounds (mask, &x1, &y1, &x2, &y2); + gimp_channel_bounds (mask, &x1, &y1, &x2, &y2); x1 = CLAMP ((x1 + off_x), 0, GIMP_DRAWABLE (mask)->width); y1 = CLAMP ((y1 + off_y), 0, GIMP_DRAWABLE (mask)->height); x2 = CLAMP ((x2 + off_x), 0, GIMP_DRAWABLE (mask)->width); @@ -1572,7 +1576,8 @@ channel_translate (Channel *mask, /* copy the portion of the mask we will keep to a * temporary buffer */ - tmp_mask = channel_new_mask (GIMP_DRAWABLE (mask)->gimage, width, height); + tmp_mask = gimp_channel_new_mask (GIMP_DRAWABLE (mask)->gimage, + width, height); pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles, x1 - off_x, y1 - off_y, width, height, FALSE); @@ -1619,13 +1624,13 @@ channel_translate (Channel *mask, } void -channel_load (Channel *mask, - Channel *channel) +gimp_channel_load (GimpChannel *mask, + GimpChannel *channel) { PixelRegion srcPR, destPR; /* push the current mask onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); /* copy the channel to the mask */ pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles, @@ -1642,15 +1647,15 @@ channel_load (Channel *mask, } void -channel_layer_alpha (Channel *mask, - GimpLayer *layer) +gimp_channel_layer_alpha (GimpChannel *mask, + GimpLayer *layer) { PixelRegion srcPR, destPR; guchar empty = 0; gint x1, y1, x2, y2; /* push the current mask onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); /* clear the mask */ pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles, @@ -1678,15 +1683,15 @@ channel_layer_alpha (Channel *mask, } void -channel_layer_mask (Channel *mask, - GimpLayer *layer) +gimp_channel_layer_mask (GimpChannel *mask, + GimpLayer *layer) { PixelRegion srcPR, destPR; guchar empty = 0; gint x1, y1, x2, y2; /* push the current mask onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); /* clear the mask */ pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles, @@ -1717,7 +1722,7 @@ channel_layer_mask (Channel *mask, } void -channel_invalidate_bounds (Channel *channel) +gimp_channel_invalidate_bounds (GimpChannel *channel) { channel->bounds_known = FALSE; } diff --git a/app/core/gimpchannel.h b/app/core/gimpchannel.h index 9bd6a4b739..158b7c09c5 100644 --- a/app/core/gimpchannel.h +++ b/app/core/gimpchannel.h @@ -16,8 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __CHANNEL_H__ -#define __CHANNEL_H__ +#ifndef __GIMP_CHANNEL_H__ +#define __GIMP_CHANNEL_H__ #include "gimpdrawable.h" @@ -26,7 +26,6 @@ /* Half way point where a region is no longer visible in a selection */ #define HALF_WAY 127 -/* structure declarations */ #define GIMP_TYPE_CHANNEL (gimp_channel_get_type ()) #define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel)) @@ -63,21 +62,18 @@ struct _GimpChannelClass }; +/* Special undo types */ -/* Special undo type */ typedef struct _ChannelUndo ChannelUndo; +typedef struct _MaskUndo MaskUndo; struct _ChannelUndo { - Channel *channel; /* the actual channel */ - gint prev_position; /* former position in list */ - Channel *prev_channel; /* previous active channel */ + GimpChannel *channel; /* the actual channel */ + gint prev_position; /* former position in list */ + GimpChannel *prev_channel; /* previous active channel */ }; - -/* Special undo type */ -typedef struct _MaskUndo MaskUndo; - struct _MaskUndo { TileManager *tiles; /* the actual mask */ @@ -87,128 +83,128 @@ struct _MaskUndo /* function declarations */ -GtkType gimp_channel_get_type (void); +GtkType gimp_channel_get_type (void); -Channel * channel_new (GimpImage *gimage, - gint width, - gint height, - const gchar *name, - const GimpRGB *color); -Channel * channel_copy (const Channel *channel); +GimpChannel * gimp_channel_new (GimpImage *gimage, + gint width, + gint height, + const gchar *name, + const GimpRGB *color); +GimpChannel * gimp_channel_copy (const GimpChannel *channel); -gint channel_get_opacity (const Channel *channel); -void channel_set_opacity (Channel *channel, - gint opacity); +gint gimp_channel_get_opacity (const GimpChannel *channel); +void gimp_channel_set_opacity (GimpChannel *channel, + gint opacity); -const GimpRGB * channel_get_color (const Channel *channel); -void channel_set_color (Channel *channel, - const GimpRGB *color); +const GimpRGB * gimp_channel_get_color (const GimpChannel *channel); +void gimp_channel_set_color (GimpChannel *channel, + const GimpRGB *color); -void channel_scale (Channel *channel, - gint new_width, - gint new_height); -void channel_resize (Channel *channel, - gint new_width, - gint new_height, - gint offx, - gint offy); -void channel_update (Channel *channel); +void gimp_channel_scale (GimpChannel *channel, + gint new_width, + gint new_height); +void gimp_channel_resize (GimpChannel *channel, + gint new_width, + gint new_height, + gint offx, + gint offy); +void gimp_channel_update (GimpChannel *channel); /* access functions */ -gboolean channel_toggle_visibility (Channel *channel); -TempBuf * channel_preview (Channel *channel, - gint width, - gint height); +gboolean gimp_channel_toggle_visibility (GimpChannel *channel); +TempBuf * gimp_channel_preview (GimpChannel *channel, + gint width, + gint height); /* selection mask functions */ -Channel * channel_new_mask (GimpImage *gimage, - gint width, - gint height); -gboolean channel_boundary (Channel *mask, - BoundSeg **segs_in, - BoundSeg **segs_out, - gint *num_segs_in, - gint *num_segs_out, - gint x1, - gint y1, - gint x2, - gint y2); -gboolean channel_bounds (Channel *mask, - gint *x1, - gint *y1, - gint *x2, - gint *y2); -gint channel_value (Channel *mask, - gint x, - gint y); -gboolean channel_is_empty (Channel *mask); -void channel_add_segment (Channel *mask, - gint x, - gint y, - gint width, - gint value); -void channel_sub_segment (Channel *mask, - gint x, - gint y, - gint width, - gint value); -void channel_combine_rect (Channel *mask, - ChannelOps op, - gint x, - gint y, - gint w, - gint h); -void channel_combine_ellipse (Channel *mask, - ChannelOps op, - gint x, - gint y, - gint w, - gint h, - gboolean antialias); -void channel_combine_mask (Channel *mask, - Channel *add_on, - ChannelOps op, - gint off_x, - gint off_y); -void channel_feather (Channel *input, - Channel *output, - gdouble radius_x, - gdouble radius_y, - ChannelOps op, - gint off_x, - gint off_y); +GimpChannel * gimp_channel_new_mask (GimpImage *gimage, + gint width, + gint height); +gboolean gimp_channel_boundary (GimpChannel *mask, + BoundSeg **segs_in, + BoundSeg **segs_out, + gint *num_segs_in, + gint *num_segs_out, + gint x1, + gint y1, + gint x2, + gint y2); +gboolean gimp_channel_bounds (GimpChannel *mask, + gint *x1, + gint *y1, + gint *x2, + gint *y2); +gint gimp_channel_value (GimpChannel *mask, + gint x, + gint y); +gboolean gimp_channel_is_empty (GimpChannel *mask); +void gimp_channel_add_segment (GimpChannel *mask, + gint x, + gint y, + gint width, + gint value); +void gimp_channel_sub_segment (GimpChannel *mask, + gint x, + gint y, + gint width, + gint value); +void gimp_channel_combine_rect (GimpChannel *mask, + ChannelOps op, + gint x, + gint y, + gint w, + gint h); +void gimp_channel_combine_ellipse (GimpChannel *mask, + ChannelOps op, + gint x, + gint y, + gint w, + gint h, + gboolean antialias); +void gimp_channel_combine_mask (GimpChannel *mask, + GimpChannel *add_on, + ChannelOps op, + gint off_x, + gint off_y); +void gimp_channel_feather (GimpChannel *input, + GimpChannel *output, + gdouble radius_x, + gdouble radius_y, + ChannelOps op, + gint off_x, + gint off_y); -void channel_push_undo (Channel *mask); -void channel_clear (Channel *mask); -void channel_invert (Channel *mask); -void channel_sharpen (Channel *mask); -void channel_all (Channel *mask); +void gimp_channel_push_undo (GimpChannel *mask); +void gimp_channel_clear (GimpChannel *mask); +void gimp_channel_invert (GimpChannel *mask); +void gimp_channel_sharpen (GimpChannel *mask); +void gimp_channel_all (GimpChannel *mask); -void channel_border (Channel *mask, - gint radius_x, - gint radius_y); -void channel_grow (Channel *mask, - gint radius_x, - gint radius_y); -void channel_shrink (Channel *mask, - gint radius_x, - gint radius_y, - gboolean edge_lock); +void gimp_channel_border (GimpChannel *mask, + gint radius_x, + gint radius_y); +void gimp_channel_grow (GimpChannel *mask, + gint radius_x, + gint radius_y); +void gimp_channel_shrink (GimpChannel *mask, + gint radius_x, + gint radius_y, + gboolean edge_lock); -void channel_translate (Channel *mask, - gint off_x, - gint off_y); -void channel_load (Channel *mask, - Channel *channel); +void gimp_channel_translate (GimpChannel *mask, + gint off_x, + gint off_y); +void gimp_channel_load (GimpChannel *mask, + GimpChannel *channel); -void channel_layer_alpha (Channel *mask, - GimpLayer *layer); -void channel_layer_mask (Channel *mask, - GimpLayer *layer); +void gimp_channel_layer_alpha (GimpChannel *mask, + GimpLayer *layer); +void gimp_channel_layer_mask (GimpChannel *mask, + GimpLayer *layer); -void channel_invalidate_bounds (Channel *channel); +void gimp_channel_invalidate_bounds (GimpChannel *channel); -#endif /* __CHANNEL_H__ */ +#endif /* __GIMP_CHANNEL_H__ */ diff --git a/app/core/gimpdrawable-blend.c b/app/core/gimpdrawable-blend.c index 8ddd08f91f..b55f36cdb6 100644 --- a/app/core/gimpdrawable-blend.c +++ b/app/core/gimpdrawable-blend.c @@ -1221,7 +1221,7 @@ gradient_precalc_shapeburst (GImage *gimage, PixelRegion *PR, gdouble dist) { - Channel *mask; + GimpChannel *mask; PixelRegion tempR; gfloat max_iteration; gfloat *distp; diff --git a/app/core/gimpdrawable-offset.c b/app/core/gimpdrawable-offset.c index b61378c299..6b693844cc 100644 --- a/app/core/gimpdrawable-offset.c +++ b/app/core/gimpdrawable-offset.c @@ -569,12 +569,12 @@ duplicate (GimpImage *gimage) GimpImage *new_gimage; GimpLayer *layer, *new_layer; GimpLayer *floating_layer; - Channel *channel, *new_channel; + GimpChannel *channel, *new_channel; GSList *list; GList *glist; Guide *guide = NULL; GimpLayer *active_layer = NULL; - Channel *active_channel = NULL; + GimpChannel *active_channel = NULL; GimpDrawable *new_floating_sel_drawable = NULL; GimpDrawable *floating_sel_drawable = NULL; ParasiteList *parasites; @@ -645,12 +645,12 @@ duplicate (GimpImage *gimage) count = 0; while (list) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; list = g_slist_next (list); - new_channel = channel_copy (channel); + new_channel = gimp_channel_copy (channel); - gimp_drawable_set_gimage(GIMP_DRAWABLE(new_channel), new_gimage); + gimp_drawable_set_gimage (GIMP_DRAWABLE (new_channel), new_gimage); /* Make sure the copied channel doesn't say: " copy" */ gimp_object_set_name (GIMP_OBJECT (new_channel), diff --git a/app/core/gimpedit.c b/app/core/gimpedit.c index e4db428c9d..621443225f 100644 --- a/app/core/gimpedit.c +++ b/app/core/gimpedit.c @@ -351,7 +351,7 @@ edit_paste (GimpImage *gimage, * it seems like the correct behavior. */ if (! gimage_mask_is_empty (gimage) && !paste_into) - channel_clear (gimp_image_get_mask (gimage)); + gimp_channel_clear (gimp_image_get_mask (gimage)); /* if there's a drawable, add a new floating selection */ if (drawable != NULL) diff --git a/app/core/gimpimage-duplicate.c b/app/core/gimpimage-duplicate.c index b61378c299..6b693844cc 100644 --- a/app/core/gimpimage-duplicate.c +++ b/app/core/gimpimage-duplicate.c @@ -569,12 +569,12 @@ duplicate (GimpImage *gimage) GimpImage *new_gimage; GimpLayer *layer, *new_layer; GimpLayer *floating_layer; - Channel *channel, *new_channel; + GimpChannel *channel, *new_channel; GSList *list; GList *glist; Guide *guide = NULL; GimpLayer *active_layer = NULL; - Channel *active_channel = NULL; + GimpChannel *active_channel = NULL; GimpDrawable *new_floating_sel_drawable = NULL; GimpDrawable *floating_sel_drawable = NULL; ParasiteList *parasites; @@ -645,12 +645,12 @@ duplicate (GimpImage *gimage) count = 0; while (list) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; list = g_slist_next (list); - new_channel = channel_copy (channel); + new_channel = gimp_channel_copy (channel); - gimp_drawable_set_gimage(GIMP_DRAWABLE(new_channel), new_gimage); + gimp_drawable_set_gimage (GIMP_DRAWABLE (new_channel), new_gimage); /* Make sure the copied channel doesn't say: " copy" */ gimp_object_set_name (GIMP_OBJECT (new_channel), diff --git a/app/core/gimpimage-guides.c b/app/core/gimpimage-guides.c index a733e7d312..7de7193350 100644 --- a/app/core/gimpimage-guides.c +++ b/app/core/gimpimage-guides.c @@ -113,7 +113,7 @@ static void project_indexed_alpha (GimpImage *gimage, PixelRegion *dest, PixelRegion *mask); static void project_channel (GimpImage *gimage, - Channel *layer, + GimpChannel *channel, PixelRegion *src, PixelRegion *src2); @@ -437,8 +437,9 @@ gimp_image_new (gint width, } /* create the selection mask */ - gimage->selection_mask = channel_new_mask (gimage, - gimage->width, gimage->height); + gimage->selection_mask = gimp_channel_new_mask (gimage, + gimage->width, + gimage->height); return gimage; @@ -552,11 +553,11 @@ gimp_image_resize (GimpImage *gimage, gint offset_x, gint offset_y) { - Channel *channel; - GimpLayer *layer; - GimpLayer *floating_layer; - GSList *list; - GList *guide_list; + GimpChannel *channel; + GimpLayer *layer; + GimpLayer *floating_layer; + GSList *list; + GList *guide_list; gimp_add_busy_cursors (); @@ -581,9 +582,9 @@ gimp_image_resize (GimpImage *gimage, /* Resize all channels */ for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; - channel_resize (channel, new_width, new_height, offset_x, offset_y); + gimp_channel_resize (channel, new_width, new_height, offset_x, offset_y); } /* Reposition or remove any guides */ @@ -617,8 +618,8 @@ gimp_image_resize (GimpImage *gimage, } /* Don't forget the selection mask! */ - channel_resize (gimage->selection_mask, - new_width, new_height, offset_x, offset_y); + gimp_channel_resize (gimage->selection_mask, + new_width, new_height, offset_x, offset_y); gimage_mask_invalidate (gimage); /* Reposition all layers */ @@ -646,17 +647,17 @@ gimp_image_scale (GimpImage *gimage, gint new_width, gint new_height) { - Channel *channel; - GimpLayer *layer; - GimpLayer *floating_layer; - GSList *list; - GSList *remove = NULL; - GList *glist; - Guide *guide; - gint old_width; - gint old_height; - gdouble img_scale_w = 1.0; - gdouble img_scale_h = 1.0; + GimpChannel *channel; + GimpLayer *layer; + GimpLayer *floating_layer; + GSList *list; + GSList *remove = NULL; + GList *glist; + Guide *guide; + gint old_width; + gint old_height; + gdouble img_scale_w = 1.0; + gdouble img_scale_h = 1.0; if ((new_width == 0) || (new_height == 0)) { @@ -690,17 +691,18 @@ gimp_image_scale (GimpImage *gimage, /* Scale all channels */ for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; - channel_scale (channel, new_width, new_height); + channel = (GimpChannel *) list->data; + + gimp_channel_scale (channel, new_width, new_height); } /* Don't forget the selection mask! */ /* if (channel_is_empty(gimage->selection_mask)) - channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) + gimp_channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) else */ - channel_scale (gimage->selection_mask, new_width, new_height); + gimp_channel_scale (gimage->selection_mask, new_width, new_height); gimage_mask_invalidate (gimage); /* Scale all layers */ @@ -827,7 +829,7 @@ gimp_image_apply_image (GimpImage *gimage, gint x, gint y) { - Channel *mask; + GimpChannel *mask; gint x1, y1, x2, y2; gint offset_x, offset_y; PixelRegion src1PR, destPR, maskPR; @@ -932,7 +934,7 @@ gimp_image_replace_image (GimpImage *gimage, gint x, gint y) { - Channel *mask; + GimpChannel *mask; gint x1, y1, x2, y2; gint offset_x, offset_y; PixelRegion src1PR, destPR; @@ -1374,14 +1376,14 @@ gboolean gimp_image_set_tattoo_state (GimpImage *gimage, Tattoo val) { - GimpLayer *layer; - GSList *layers; - gboolean retval = TRUE; - Channel *channel; - GSList *channels; - Tattoo maxval = 0; - Path *pptr = NULL; - PathList *plist; + GimpLayer *layer; + GSList *layers; + gboolean retval = TRUE; + GimpChannel *channel; + GSList *channels; + Tattoo maxval = 0; + Path *pptr = NULL; + PathList *plist; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); @@ -1411,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, channels = g_slist_next (channels)) { Tattoo ctattoo; - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); if (ctattoo > maxval) @@ -1544,7 +1546,7 @@ project_indexed_alpha (GimpImage *gimage, static void project_channel (GimpImage *gimage, - Channel *channel, + GimpChannel *channel, PixelRegion *src, PixelRegion *src2) { @@ -1598,12 +1600,12 @@ gimp_image_free_layers (GimpImage *gimage) static void gimp_image_free_channels (GimpImage *gimage) { - GSList *list; - Channel *channel; + GSList *list; + GimpChannel *channel; for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; gtk_object_unref (GTK_OBJECT (channel)); } @@ -1760,7 +1762,7 @@ gimp_image_construct_channels (GimpImage *gimage, gint w, gint h) { - Channel *channel; + GimpChannel *channel; PixelRegion src1PR; PixelRegion src2PR; GSList *list; @@ -1772,7 +1774,7 @@ gimp_image_construct_channels (GimpImage *gimage, while (reverse_list) { - channel = (Channel *) reverse_list->data; + channel = (GimpChannel *) reverse_list->data; if (gimp_drawable_visible (GIMP_DRAWABLE (channel))) { @@ -2121,15 +2123,15 @@ gimp_image_invalidate_layer_previews (GimpImage *gimage) void gimp_image_invalidate_channel_previews (GimpImage *gimage) { - GSList *tmp; - Channel *channel; + GSList *tmp; + GimpChannel *channel; g_return_if_fail (gimage != NULL); g_return_if_fail (GIMP_IS_IMAGE (gimage)); for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp)) { - channel = (Channel *) tmp->data; + channel = (GimpChannel *) tmp->data; gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE); } @@ -2173,12 +2175,12 @@ gimp_image_get_layer_by_index (const GimpImage *gimage, } gint -gimp_image_get_channel_index (const GimpImage *gimage, - const Channel *channel_arg) +gimp_image_get_channel_index (const GimpImage *gimage, + const GimpChannel *channel_arg) { - Channel *channel; - GSList *channels; - gint index; + GimpChannel *channel; + GSList *channels; + gint index; g_return_val_if_fail (gimage != NULL, -1); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), -1); @@ -2187,7 +2189,7 @@ gimp_image_get_channel_index (const GimpImage *gimage, channels; channels = g_slist_next (channels), index++) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (channel == channel_arg) return index; @@ -2205,7 +2207,7 @@ gimp_image_get_active_layer (const GimpImage *gimage) return gimage->active_layer; } -Channel * +GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2235,12 +2237,12 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, Tattoo tattoo) { - Channel *channel; - GSList *channels; + GimpChannel *channel; + GSList *channels; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2248,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, channels; channels = g_slist_next (channels)) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) return channel; @@ -2257,12 +2259,12 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, const gchar *name) { - Channel *channel; - GSList *channels; + GimpChannel *channel; + GSList *channels; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2270,7 +2272,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage, channels; channels = g_slist_next (channels)) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name)) return channel; } @@ -2278,7 +2280,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_mask (const GimpImage *gimage) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2380,9 +2382,9 @@ gimp_image_set_active_layer (GimpImage *gimage, return layer; } -Channel * -gimp_image_set_active_channel (GimpImage *gimage, - Channel *channel) +GimpChannel * +gimp_image_set_active_channel (GimpImage *gimage, + GimpChannel *channel) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2400,7 +2402,7 @@ gimp_image_set_active_channel (GimpImage *gimage, gimage->active_channel = NULL; return NULL; } - channel = (Channel *) gimage->channels->data; + channel = (GimpChannel *) gimage->channels->data; } /* Set the active channel */ @@ -2410,10 +2412,10 @@ gimp_image_set_active_channel (GimpImage *gimage, return channel; } -Channel * +GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage) { - Channel *channel; + GimpChannel *channel; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3308,7 +3310,7 @@ gimp_image_add_layer_mask (GimpImage *gimage, return mask; } -Channel * +GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage, GimpLayer *layer, MaskApplyMode mode) @@ -3362,15 +3364,15 @@ gimp_image_remove_layer_mask (GimpImage *gimage, return NULL; } -Channel * -gimp_image_raise_channel (GimpImage *gimage, - Channel *channel_arg) +GimpChannel * +gimp_image_raise_channel (GimpImage *gimage, + GimpChannel *channel_arg) { - Channel *channel; - Channel *prev_channel; - GSList *list; - GSList *prev; - gint index = -1; + GimpChannel *channel; + GimpChannel *prev_channel; + GSList *list; + GSList *prev; + gint index = -1; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3380,9 +3382,9 @@ gimp_image_raise_channel (GimpImage *gimage, while (list) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; if (prev) - prev_channel = (Channel *) prev->data; + prev_channel = (GimpChannel *) prev->data; if (channel == channel_arg) { @@ -3411,15 +3413,15 @@ gimp_image_raise_channel (GimpImage *gimage, return NULL; } -Channel * -gimp_image_lower_channel (GimpImage *gimage, - Channel *channel_arg) +GimpChannel * +gimp_image_lower_channel (GimpImage *gimage, + GimpChannel *channel_arg) { - Channel *channel; - Channel *next_channel; - GSList *list; - GSList *next; - gint index = 0; + GimpChannel *channel; + GimpChannel *next_channel; + GSList *list; + GSList *next; + gint index = 0; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3428,11 +3430,11 @@ gimp_image_lower_channel (GimpImage *gimage, while (list) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; next = g_slist_next (list); if (next) - next_channel = (Channel *) next->data; + next_channel = (GimpChannel *) next->data; index++; if (channel == channel_arg) @@ -3460,16 +3462,16 @@ gimp_image_lower_channel (GimpImage *gimage, return NULL; } -Channel * -gimp_image_position_channel (GimpImage *gimage, - Channel *channel_arg, - gint new_index) +GimpChannel * +gimp_image_position_channel (GimpImage *gimage, + GimpChannel *channel_arg, + gint new_index) { - Channel *channel; - GSList *list; - GSList *next; - gint index; - gint list_length; + GimpChannel *channel; + GSList *list; + GSList *next; + gint index; + gint list_length; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3481,7 +3483,7 @@ gimp_image_position_channel (GimpImage *gimage, list; list = g_slist_next (list), index++) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; if (channel == channel_arg) { break; @@ -3513,10 +3515,10 @@ gimp_image_position_channel (GimpImage *gimage, return channel; } -Channel * -gimp_image_add_channel (GimpImage *gimage, - Channel *channel, - gint position) +GimpChannel * +gimp_image_add_channel (GimpImage *gimage, + GimpChannel *channel, + gint position) { ChannelUndo *cu; GSList *cc; @@ -3564,9 +3566,9 @@ gimp_image_add_channel (GimpImage *gimage, return channel; } -Channel * -gimp_image_remove_channel (GimpImage *gimage, - Channel *channel) +GimpChannel * +gimp_image_remove_channel (GimpImage *gimage, + GimpChannel *channel) { ChannelUndo *cu; @@ -3584,7 +3586,7 @@ gimp_image_remove_channel (GimpImage *gimage, if (gimage->active_channel == channel) { if (gimage->channels) - gimage->active_channel = (((Channel *) gimage->channels->data)); + gimage->active_channel = (((GimpChannel *) gimage->channels->data)); else gimage->active_channel = NULL; } diff --git a/app/core/gimpimage-guides.h b/app/core/gimpimage-guides.h index 356c35f17c..a71abc7029 100644 --- a/app/core/gimpimage-guides.h +++ b/app/core/gimpimage-guides.h @@ -86,9 +86,9 @@ struct _GimpImage GSList *layer_stack; /* the layers in MRU order */ GimpLayer *active_layer; /* ID of active layer */ - Channel *active_channel; /* ID of active channel */ + GimpChannel *active_channel; /* ID of active channel */ GimpLayer *floating_sel; /* ID of fs layer */ - Channel *selection_mask; /* selection mask channel */ + GimpChannel *selection_mask; /* selection mask channel */ ParasiteList *parasites; /* Plug-in parasite data */ @@ -282,91 +282,91 @@ void gimp_image_colormap_changed (const GimpImage *image, /* layer/channel functions */ -gint gimp_image_get_layer_index (const GimpImage *gimage, - const GimpLayer *layer_arg); -GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, - gint layer_index); -gint gimp_image_get_channel_index (const GimpImage *gimage, - const Channel *channel_arg); -GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); -Channel * gimp_image_get_active_channel (const GimpImage *gimage); -GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); -Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); -Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, - const gchar *name); -Channel * gimp_image_get_mask (const GimpImage *gimage); -gboolean gimp_image_get_component_active (const GimpImage *gimage, - ChannelType type); -gboolean gimp_image_get_component_visible (const GimpImage *gimage, - ChannelType type); -gboolean gimp_image_layer_boundary (const GimpImage *gimage, - BoundSeg **segs, - gint *n_segs); -GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, - GimpLayer *layer); -Channel * gimp_image_set_active_channel (GimpImage *gimage, - Channel *channel); -Channel * gimp_image_unset_active_channel (GimpImage *gimage); -void gimp_image_set_component_active (GimpImage *gimage, - ChannelType type, - gboolean active); -void gimp_image_set_component_visible (GimpImage *gimage, - ChannelType type, - gboolean visible); -GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage, - gint x, - gint y); -GimpLayer * gimp_image_raise_layer (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_lower_layer (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_position_layer (GimpImage *gimage, - GimpLayer *layer_arg, - gint new_index, - gboolean push_undo); -GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage, - MergeType merge_type); -GimpLayer * gimp_image_merge_down (GimpImage *gimage, - GimpLayer *current_layer, - MergeType merge_type); -GimpLayer * gimp_image_flatten (GimpImage *gimage); -GimpLayer * gimp_image_merge_layers (GimpImage *gimage, - GSList *merge_list, - MergeType merge_type); -GimpLayer * gimp_image_add_layer (GimpImage *gimage, - GimpLayer *float_layer, - gint position); -GimpLayer * gimp_image_remove_layer (GimpImage *gimage, - GimpLayer *layer); -GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, - GimpLayer *layer, - GimpLayerMask *mask); -Channel * gimp_image_remove_layer_mask (GimpImage *gimage, - GimpLayer *layer, - MaskApplyMode mode); -Channel * gimp_image_raise_channel (GimpImage *gimage, - Channel *channel_arg); -Channel * gimp_image_lower_channel (GimpImage *gimage, - Channel *channel_arg); -Channel * gimp_image_position_channel (GimpImage *gimage, - Channel *channel_arg, - gint position); -Channel * gimp_image_add_channel (GimpImage *gimage, - Channel *channel, - gint position); -Channel * gimp_image_remove_channel (GimpImage *gimage, - Channel *channel); -void gimp_image_construct (GimpImage *gimage, - gint x, - gint y, - gint w, - gint h); +gint gimp_image_get_layer_index (const GimpImage *gimage, + const GimpLayer *layer_arg); +GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, + gint layer_index); +gint gimp_image_get_channel_index (const GimpImage *gimage, + const GimpChannel *channel_arg); +GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); +GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage); +GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, + Tattoo tatoo); +GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, + Tattoo tatoo); +GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, + const gchar *name); +GimpChannel * gimp_image_get_mask (const GimpImage *gimage); +gboolean gimp_image_get_component_active (const GimpImage *gimage, + ChannelType type); +gboolean gimp_image_get_component_visible (const GimpImage *gimage, + ChannelType type); +gboolean gimp_image_layer_boundary (const GimpImage *gimage, + BoundSeg **segs, + gint *n_segs); +GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, + GimpLayer *layer); +GimpChannel * gimp_image_set_active_channel (GimpImage *gimage, + GimpChannel *channel); +GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage); +void gimp_image_set_component_active (GimpImage *gimage, + ChannelType type, + gboolean active); +void gimp_image_set_component_visible (GimpImage *gimage, + ChannelType type, + gboolean visible); +GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage, + gint x, + gint y); +GimpLayer * gimp_image_raise_layer (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_lower_layer (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_position_layer (GimpImage *gimage, + GimpLayer *layer_arg, + gint new_index, + gboolean push_undo); +GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage, + MergeType merge_type); +GimpLayer * gimp_image_merge_down (GimpImage *gimage, + GimpLayer *current_layer, + MergeType merge_type); +GimpLayer * gimp_image_flatten (GimpImage *gimage); +GimpLayer * gimp_image_merge_layers (GimpImage *gimage, + GSList *merge_list, + MergeType merge_type); +GimpLayer * gimp_image_add_layer (GimpImage *gimage, + GimpLayer *float_layer, + gint position); +GimpLayer * gimp_image_remove_layer (GimpImage *gimage, + GimpLayer *layer); +GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, + GimpLayer *layer, + GimpLayerMask *mask); +GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage, + GimpLayer *layer, + MaskApplyMode mode); +GimpChannel * gimp_image_raise_channel (GimpImage *gimage, + GimpChannel *channel_arg); +GimpChannel * gimp_image_lower_channel (GimpImage *gimage, + GimpChannel *channel_arg); +GimpChannel * gimp_image_position_channel (GimpImage *gimage, + GimpChannel *channel_arg, + gint position); +GimpChannel * gimp_image_add_channel (GimpImage *gimage, + GimpChannel *channel, + gint position); +GimpChannel * gimp_image_remove_channel (GimpImage *gimage, + GimpChannel *channel); +void gimp_image_construct (GimpImage *gimage, + gint x, + gint y, + gint w, + gint h); void gimp_image_invalidate_without_render (GimpImage *gimage, diff --git a/app/core/gimpimage-mask.c b/app/core/gimpimage-mask.c index 0c6a244c78..171345d562 100644 --- a/app/core/gimpimage-mask.c +++ b/app/core/gimpimage-mask.c @@ -75,10 +75,10 @@ gimage_mask_boundary (GImage *gimage, */ /* Find the selection mask boundary */ - channel_boundary (gimp_image_get_mask (gimage), - segs_in, segs_out, - num_segs_in, num_segs_out, - 0, 0, 0, 0); + gimp_channel_boundary (gimp_image_get_mask (gimage), + segs_in, segs_out, + num_segs_in, num_segs_out, + 0, 0, 0, 0); /* Find the floating selection boundary */ *segs_in = floating_sel_boundary (layer, num_segs_in); @@ -89,10 +89,10 @@ gimage_mask_boundary (GImage *gimage, else if ((d = gimp_image_active_drawable (gimage)) && GIMP_IS_CHANNEL (d)) { - return channel_boundary (gimp_image_get_mask (gimage), - segs_in, segs_out, - num_segs_in, num_segs_out, - 0, 0, gimage->width, gimage->height); + return gimp_channel_boundary (gimp_image_get_mask (gimage), + segs_in, segs_out, + num_segs_in, num_segs_out, + 0, 0, gimage->width, gimage->height); } /* if a layer is active, we return multiple boundaries based on the extents */ else if ((layer = gimp_image_get_active_layer (gimage))) @@ -107,10 +107,10 @@ gimage_mask_boundary (GImage *gimage, y2 = CLAMP (off_y + gimp_drawable_height (GIMP_DRAWABLE(layer)), 0, gimage->height); - return channel_boundary (gimp_image_get_mask (gimage), - segs_in, segs_out, - num_segs_in, num_segs_out, - x1, y1, x2, y2); + return gimp_channel_boundary (gimp_image_get_mask (gimage), + segs_in, segs_out, + num_segs_in, num_segs_out, + x1, y1, x2, y2); } else { @@ -130,15 +130,15 @@ gimage_mask_bounds (GImage *gimage, gint *x2, gint *y2) { - return channel_bounds (gimp_image_get_mask (gimage), x1, y1, x2, y2); + return gimp_channel_bounds (gimp_image_get_mask (gimage), x1, y1, x2, y2); } void gimage_mask_invalidate (GImage *gimage) { - GimpLayer *layer; - Channel *mask; + GimpLayer *layer; + GimpChannel *mask; /* Turn the current selection off */ gdisplays_selection_visibility (gimage, SelectionOff); @@ -163,7 +163,7 @@ gimage_mask_value (GImage *gimage, int x, int y) { - return channel_value (gimp_image_get_mask (gimage), x, y); + return gimp_channel_value (gimp_image_get_mask (gimage), x, y); } @@ -177,7 +177,7 @@ gimage_mask_is_empty (GImage *gimage) if (gimage_mask_stroking) return TRUE; else - return channel_is_empty (gimp_image_get_mask (gimage)); + return gimp_channel_is_empty (gimp_image_get_mask (gimage)); } @@ -186,7 +186,7 @@ gimage_mask_translate (GImage *gimage, gint off_x, gint off_y) { - channel_translate (gimp_image_get_mask (gimage), off_x, off_y); + gimp_channel_translate (gimp_image_get_mask (gimage), off_x, off_y); } @@ -197,15 +197,15 @@ gimage_mask_extract (GImage *gimage, gboolean keep_indexed, gboolean add_alpha) { - TileManager * tiles; - Channel * sel_mask; - PixelRegion srcPR, destPR, maskPR; - guchar bg[MAX_CHANNELS]; - gint bytes, type; - gint x1, y1; - gint x2, y2; - gint off_x, off_y; - gboolean non_empty; + TileManager *tiles; + GimpChannel *sel_mask; + PixelRegion srcPR, destPR, maskPR; + guchar bg[MAX_CHANNELS]; + gint bytes, type; + gint x1, y1; + gint x2, y2; + gint off_x, off_y; + gboolean non_empty; if (!drawable) return NULL; @@ -293,7 +293,7 @@ gimage_mask_extract (GImage *gimage, if (cut_gimage) { /* Clear the region */ - channel_clear (gimp_image_get_mask (gimage)); + gimp_channel_clear (gimp_image_get_mask (gimage)); /* Update the region */ gdisplays_update_area (gimage, @@ -350,7 +350,7 @@ gimage_mask_float (GImage *gimage, gint off_y) { GimpLayer *layer; - Channel *mask = gimp_image_get_mask (gimage); + GimpChannel *mask = gimp_image_get_mask (gimage); TileManager *tiles; gboolean non_empty; gint x1, y1; @@ -401,21 +401,21 @@ gimage_mask_float (GImage *gimage, void gimage_mask_clear (GImage *gimage) { - channel_clear (gimp_image_get_mask (gimage)); + gimp_channel_clear (gimp_image_get_mask (gimage)); } void gimage_mask_undo (GImage *gimage) { - channel_push_undo (gimp_image_get_mask (gimage)); + gimp_channel_push_undo (gimp_image_get_mask (gimage)); } void gimage_mask_invert (GImage *gimage) { - channel_invert (gimp_image_get_mask (gimage)); + gimp_channel_invert (gimp_image_get_mask (gimage)); } @@ -425,21 +425,21 @@ gimage_mask_sharpen (GImage *gimage) /* No need to play with the selection visibility * because sharpen will not change the outline */ - channel_sharpen (gimp_image_get_mask (gimage)); + gimp_channel_sharpen (gimp_image_get_mask (gimage)); } void gimage_mask_all (GImage *gimage) { - channel_all (gimp_image_get_mask (gimage)); + gimp_channel_all (gimp_image_get_mask (gimage)); } void gimage_mask_none (GImage *gimage) { - channel_clear (gimp_image_get_mask (gimage)); + gimp_channel_clear (gimp_image_get_mask (gimage)); } @@ -449,16 +449,16 @@ gimage_mask_feather (GImage *gimage, gdouble feather_radius_y) { /* push the current mask onto the undo stack--need to do this here because - * channel_feather doesn't do it + * gimp_channel_feather doesn't do it */ - channel_push_undo (gimp_image_get_mask (gimage)); + gimp_channel_push_undo (gimp_image_get_mask (gimage)); /* feather the region */ - channel_feather (gimp_image_get_mask (gimage), - gimp_image_get_mask (gimage), - feather_radius_x, - feather_radius_y, - CHANNEL_OP_REPLACE, 0, 0); + gimp_channel_feather (gimp_image_get_mask (gimage), + gimp_image_get_mask (gimage), + feather_radius_x, + feather_radius_y, + CHANNEL_OP_REPLACE, 0, 0); } @@ -468,9 +468,9 @@ gimage_mask_border (GImage *gimage, gint border_radius_y) { /* feather the region */ - channel_border (gimp_image_get_mask (gimage), - border_radius_x, - border_radius_y); + gimp_channel_border (gimp_image_get_mask (gimage), + border_radius_x, + border_radius_y); } @@ -480,9 +480,9 @@ gimage_mask_grow (GImage *gimage, int grow_pixels_y) { /* feather the region */ - channel_grow (gimp_image_get_mask (gimage), - grow_pixels_x, - grow_pixels_y); + gimp_channel_grow (gimp_image_get_mask (gimage), + grow_pixels_x, + grow_pixels_y); } @@ -493,10 +493,10 @@ gimage_mask_shrink (GImage *gimage, gboolean edge_lock) { /* feather the region */ - channel_shrink (gimp_image_get_mask (gimage), - shrink_pixels_x, - shrink_pixels_y, - edge_lock); + gimp_channel_shrink (gimp_image_get_mask (gimage), + shrink_pixels_x, + shrink_pixels_y, + edge_lock); } @@ -508,7 +508,7 @@ gimage_mask_layer_alpha (GimpImage *gimage, if (gimp_drawable_has_alpha (GIMP_DRAWABLE (layer))) { /* load the mask with the given layer's alpha channel */ - channel_layer_alpha (gimp_image_get_mask (gimage), layer); + gimp_channel_layer_alpha (gimp_image_get_mask (gimage), layer); } else { @@ -527,7 +527,7 @@ gimage_mask_layer_mask (GimpImage *gimage, if (gimp_layer_get_mask (layer)) { /* load the mask with the given layer's alpha channel */ - channel_layer_mask (gimp_image_get_mask (gimage), layer); + gimp_channel_layer_mask (gimp_image_get_mask (gimage), layer); } else { @@ -539,20 +539,20 @@ gimage_mask_layer_mask (GimpImage *gimage, void -gimage_mask_load (GImage *gimage, - Channel *channel) +gimage_mask_load (GImage *gimage, + GimpChannel *channel) { /* Load the specified channel to the gimage mask */ - channel_load (gimp_image_get_mask (gimage), (channel)); + gimp_channel_load (gimp_image_get_mask (gimage), (channel)); } -Channel * +GimpChannel * gimage_mask_save (GImage *gimage) { - Channel *new_channel; + GimpChannel *new_channel; - new_channel = channel_copy (gimp_image_get_mask (gimage)); + new_channel = gimp_channel_copy (gimp_image_get_mask (gimage)); /* saved selections are not visible by default */ GIMP_DRAWABLE(new_channel)->visible = FALSE; diff --git a/app/core/gimpimage-mask.h b/app/core/gimpimage-mask.h index 4679381671..dde2348994 100644 --- a/app/core/gimpimage-mask.h +++ b/app/core/gimpimage-mask.h @@ -86,9 +86,9 @@ void gimage_mask_layer_mask (GImage *gimage, GimpLayer *layer); void gimage_mask_load (GImage *gimage, - Channel *channel); + GimpChannel *channel); -Channel * gimage_mask_save (GImage *gimage); +GimpChannel * gimage_mask_save (GImage *gimage); gboolean gimage_mask_stroke (GImage *gimage, GimpDrawable *drawable); diff --git a/app/core/gimpimage-merge.c b/app/core/gimpimage-merge.c index a733e7d312..7de7193350 100644 --- a/app/core/gimpimage-merge.c +++ b/app/core/gimpimage-merge.c @@ -113,7 +113,7 @@ static void project_indexed_alpha (GimpImage *gimage, PixelRegion *dest, PixelRegion *mask); static void project_channel (GimpImage *gimage, - Channel *layer, + GimpChannel *channel, PixelRegion *src, PixelRegion *src2); @@ -437,8 +437,9 @@ gimp_image_new (gint width, } /* create the selection mask */ - gimage->selection_mask = channel_new_mask (gimage, - gimage->width, gimage->height); + gimage->selection_mask = gimp_channel_new_mask (gimage, + gimage->width, + gimage->height); return gimage; @@ -552,11 +553,11 @@ gimp_image_resize (GimpImage *gimage, gint offset_x, gint offset_y) { - Channel *channel; - GimpLayer *layer; - GimpLayer *floating_layer; - GSList *list; - GList *guide_list; + GimpChannel *channel; + GimpLayer *layer; + GimpLayer *floating_layer; + GSList *list; + GList *guide_list; gimp_add_busy_cursors (); @@ -581,9 +582,9 @@ gimp_image_resize (GimpImage *gimage, /* Resize all channels */ for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; - channel_resize (channel, new_width, new_height, offset_x, offset_y); + gimp_channel_resize (channel, new_width, new_height, offset_x, offset_y); } /* Reposition or remove any guides */ @@ -617,8 +618,8 @@ gimp_image_resize (GimpImage *gimage, } /* Don't forget the selection mask! */ - channel_resize (gimage->selection_mask, - new_width, new_height, offset_x, offset_y); + gimp_channel_resize (gimage->selection_mask, + new_width, new_height, offset_x, offset_y); gimage_mask_invalidate (gimage); /* Reposition all layers */ @@ -646,17 +647,17 @@ gimp_image_scale (GimpImage *gimage, gint new_width, gint new_height) { - Channel *channel; - GimpLayer *layer; - GimpLayer *floating_layer; - GSList *list; - GSList *remove = NULL; - GList *glist; - Guide *guide; - gint old_width; - gint old_height; - gdouble img_scale_w = 1.0; - gdouble img_scale_h = 1.0; + GimpChannel *channel; + GimpLayer *layer; + GimpLayer *floating_layer; + GSList *list; + GSList *remove = NULL; + GList *glist; + Guide *guide; + gint old_width; + gint old_height; + gdouble img_scale_w = 1.0; + gdouble img_scale_h = 1.0; if ((new_width == 0) || (new_height == 0)) { @@ -690,17 +691,18 @@ gimp_image_scale (GimpImage *gimage, /* Scale all channels */ for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; - channel_scale (channel, new_width, new_height); + channel = (GimpChannel *) list->data; + + gimp_channel_scale (channel, new_width, new_height); } /* Don't forget the selection mask! */ /* if (channel_is_empty(gimage->selection_mask)) - channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) + gimp_channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) else */ - channel_scale (gimage->selection_mask, new_width, new_height); + gimp_channel_scale (gimage->selection_mask, new_width, new_height); gimage_mask_invalidate (gimage); /* Scale all layers */ @@ -827,7 +829,7 @@ gimp_image_apply_image (GimpImage *gimage, gint x, gint y) { - Channel *mask; + GimpChannel *mask; gint x1, y1, x2, y2; gint offset_x, offset_y; PixelRegion src1PR, destPR, maskPR; @@ -932,7 +934,7 @@ gimp_image_replace_image (GimpImage *gimage, gint x, gint y) { - Channel *mask; + GimpChannel *mask; gint x1, y1, x2, y2; gint offset_x, offset_y; PixelRegion src1PR, destPR; @@ -1374,14 +1376,14 @@ gboolean gimp_image_set_tattoo_state (GimpImage *gimage, Tattoo val) { - GimpLayer *layer; - GSList *layers; - gboolean retval = TRUE; - Channel *channel; - GSList *channels; - Tattoo maxval = 0; - Path *pptr = NULL; - PathList *plist; + GimpLayer *layer; + GSList *layers; + gboolean retval = TRUE; + GimpChannel *channel; + GSList *channels; + Tattoo maxval = 0; + Path *pptr = NULL; + PathList *plist; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); @@ -1411,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, channels = g_slist_next (channels)) { Tattoo ctattoo; - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); if (ctattoo > maxval) @@ -1544,7 +1546,7 @@ project_indexed_alpha (GimpImage *gimage, static void project_channel (GimpImage *gimage, - Channel *channel, + GimpChannel *channel, PixelRegion *src, PixelRegion *src2) { @@ -1598,12 +1600,12 @@ gimp_image_free_layers (GimpImage *gimage) static void gimp_image_free_channels (GimpImage *gimage) { - GSList *list; - Channel *channel; + GSList *list; + GimpChannel *channel; for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; gtk_object_unref (GTK_OBJECT (channel)); } @@ -1760,7 +1762,7 @@ gimp_image_construct_channels (GimpImage *gimage, gint w, gint h) { - Channel *channel; + GimpChannel *channel; PixelRegion src1PR; PixelRegion src2PR; GSList *list; @@ -1772,7 +1774,7 @@ gimp_image_construct_channels (GimpImage *gimage, while (reverse_list) { - channel = (Channel *) reverse_list->data; + channel = (GimpChannel *) reverse_list->data; if (gimp_drawable_visible (GIMP_DRAWABLE (channel))) { @@ -2121,15 +2123,15 @@ gimp_image_invalidate_layer_previews (GimpImage *gimage) void gimp_image_invalidate_channel_previews (GimpImage *gimage) { - GSList *tmp; - Channel *channel; + GSList *tmp; + GimpChannel *channel; g_return_if_fail (gimage != NULL); g_return_if_fail (GIMP_IS_IMAGE (gimage)); for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp)) { - channel = (Channel *) tmp->data; + channel = (GimpChannel *) tmp->data; gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE); } @@ -2173,12 +2175,12 @@ gimp_image_get_layer_by_index (const GimpImage *gimage, } gint -gimp_image_get_channel_index (const GimpImage *gimage, - const Channel *channel_arg) +gimp_image_get_channel_index (const GimpImage *gimage, + const GimpChannel *channel_arg) { - Channel *channel; - GSList *channels; - gint index; + GimpChannel *channel; + GSList *channels; + gint index; g_return_val_if_fail (gimage != NULL, -1); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), -1); @@ -2187,7 +2189,7 @@ gimp_image_get_channel_index (const GimpImage *gimage, channels; channels = g_slist_next (channels), index++) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (channel == channel_arg) return index; @@ -2205,7 +2207,7 @@ gimp_image_get_active_layer (const GimpImage *gimage) return gimage->active_layer; } -Channel * +GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2235,12 +2237,12 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, Tattoo tattoo) { - Channel *channel; - GSList *channels; + GimpChannel *channel; + GSList *channels; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2248,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, channels; channels = g_slist_next (channels)) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) return channel; @@ -2257,12 +2259,12 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, const gchar *name) { - Channel *channel; - GSList *channels; + GimpChannel *channel; + GSList *channels; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2270,7 +2272,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage, channels; channels = g_slist_next (channels)) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name)) return channel; } @@ -2278,7 +2280,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_mask (const GimpImage *gimage) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2380,9 +2382,9 @@ gimp_image_set_active_layer (GimpImage *gimage, return layer; } -Channel * -gimp_image_set_active_channel (GimpImage *gimage, - Channel *channel) +GimpChannel * +gimp_image_set_active_channel (GimpImage *gimage, + GimpChannel *channel) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2400,7 +2402,7 @@ gimp_image_set_active_channel (GimpImage *gimage, gimage->active_channel = NULL; return NULL; } - channel = (Channel *) gimage->channels->data; + channel = (GimpChannel *) gimage->channels->data; } /* Set the active channel */ @@ -2410,10 +2412,10 @@ gimp_image_set_active_channel (GimpImage *gimage, return channel; } -Channel * +GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage) { - Channel *channel; + GimpChannel *channel; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3308,7 +3310,7 @@ gimp_image_add_layer_mask (GimpImage *gimage, return mask; } -Channel * +GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage, GimpLayer *layer, MaskApplyMode mode) @@ -3362,15 +3364,15 @@ gimp_image_remove_layer_mask (GimpImage *gimage, return NULL; } -Channel * -gimp_image_raise_channel (GimpImage *gimage, - Channel *channel_arg) +GimpChannel * +gimp_image_raise_channel (GimpImage *gimage, + GimpChannel *channel_arg) { - Channel *channel; - Channel *prev_channel; - GSList *list; - GSList *prev; - gint index = -1; + GimpChannel *channel; + GimpChannel *prev_channel; + GSList *list; + GSList *prev; + gint index = -1; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3380,9 +3382,9 @@ gimp_image_raise_channel (GimpImage *gimage, while (list) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; if (prev) - prev_channel = (Channel *) prev->data; + prev_channel = (GimpChannel *) prev->data; if (channel == channel_arg) { @@ -3411,15 +3413,15 @@ gimp_image_raise_channel (GimpImage *gimage, return NULL; } -Channel * -gimp_image_lower_channel (GimpImage *gimage, - Channel *channel_arg) +GimpChannel * +gimp_image_lower_channel (GimpImage *gimage, + GimpChannel *channel_arg) { - Channel *channel; - Channel *next_channel; - GSList *list; - GSList *next; - gint index = 0; + GimpChannel *channel; + GimpChannel *next_channel; + GSList *list; + GSList *next; + gint index = 0; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3428,11 +3430,11 @@ gimp_image_lower_channel (GimpImage *gimage, while (list) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; next = g_slist_next (list); if (next) - next_channel = (Channel *) next->data; + next_channel = (GimpChannel *) next->data; index++; if (channel == channel_arg) @@ -3460,16 +3462,16 @@ gimp_image_lower_channel (GimpImage *gimage, return NULL; } -Channel * -gimp_image_position_channel (GimpImage *gimage, - Channel *channel_arg, - gint new_index) +GimpChannel * +gimp_image_position_channel (GimpImage *gimage, + GimpChannel *channel_arg, + gint new_index) { - Channel *channel; - GSList *list; - GSList *next; - gint index; - gint list_length; + GimpChannel *channel; + GSList *list; + GSList *next; + gint index; + gint list_length; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3481,7 +3483,7 @@ gimp_image_position_channel (GimpImage *gimage, list; list = g_slist_next (list), index++) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; if (channel == channel_arg) { break; @@ -3513,10 +3515,10 @@ gimp_image_position_channel (GimpImage *gimage, return channel; } -Channel * -gimp_image_add_channel (GimpImage *gimage, - Channel *channel, - gint position) +GimpChannel * +gimp_image_add_channel (GimpImage *gimage, + GimpChannel *channel, + gint position) { ChannelUndo *cu; GSList *cc; @@ -3564,9 +3566,9 @@ gimp_image_add_channel (GimpImage *gimage, return channel; } -Channel * -gimp_image_remove_channel (GimpImage *gimage, - Channel *channel) +GimpChannel * +gimp_image_remove_channel (GimpImage *gimage, + GimpChannel *channel) { ChannelUndo *cu; @@ -3584,7 +3586,7 @@ gimp_image_remove_channel (GimpImage *gimage, if (gimage->active_channel == channel) { if (gimage->channels) - gimage->active_channel = (((Channel *) gimage->channels->data)); + gimage->active_channel = (((GimpChannel *) gimage->channels->data)); else gimage->active_channel = NULL; } diff --git a/app/core/gimpimage-merge.h b/app/core/gimpimage-merge.h index 356c35f17c..a71abc7029 100644 --- a/app/core/gimpimage-merge.h +++ b/app/core/gimpimage-merge.h @@ -86,9 +86,9 @@ struct _GimpImage GSList *layer_stack; /* the layers in MRU order */ GimpLayer *active_layer; /* ID of active layer */ - Channel *active_channel; /* ID of active channel */ + GimpChannel *active_channel; /* ID of active channel */ GimpLayer *floating_sel; /* ID of fs layer */ - Channel *selection_mask; /* selection mask channel */ + GimpChannel *selection_mask; /* selection mask channel */ ParasiteList *parasites; /* Plug-in parasite data */ @@ -282,91 +282,91 @@ void gimp_image_colormap_changed (const GimpImage *image, /* layer/channel functions */ -gint gimp_image_get_layer_index (const GimpImage *gimage, - const GimpLayer *layer_arg); -GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, - gint layer_index); -gint gimp_image_get_channel_index (const GimpImage *gimage, - const Channel *channel_arg); -GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); -Channel * gimp_image_get_active_channel (const GimpImage *gimage); -GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); -Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); -Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, - const gchar *name); -Channel * gimp_image_get_mask (const GimpImage *gimage); -gboolean gimp_image_get_component_active (const GimpImage *gimage, - ChannelType type); -gboolean gimp_image_get_component_visible (const GimpImage *gimage, - ChannelType type); -gboolean gimp_image_layer_boundary (const GimpImage *gimage, - BoundSeg **segs, - gint *n_segs); -GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, - GimpLayer *layer); -Channel * gimp_image_set_active_channel (GimpImage *gimage, - Channel *channel); -Channel * gimp_image_unset_active_channel (GimpImage *gimage); -void gimp_image_set_component_active (GimpImage *gimage, - ChannelType type, - gboolean active); -void gimp_image_set_component_visible (GimpImage *gimage, - ChannelType type, - gboolean visible); -GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage, - gint x, - gint y); -GimpLayer * gimp_image_raise_layer (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_lower_layer (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_position_layer (GimpImage *gimage, - GimpLayer *layer_arg, - gint new_index, - gboolean push_undo); -GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage, - MergeType merge_type); -GimpLayer * gimp_image_merge_down (GimpImage *gimage, - GimpLayer *current_layer, - MergeType merge_type); -GimpLayer * gimp_image_flatten (GimpImage *gimage); -GimpLayer * gimp_image_merge_layers (GimpImage *gimage, - GSList *merge_list, - MergeType merge_type); -GimpLayer * gimp_image_add_layer (GimpImage *gimage, - GimpLayer *float_layer, - gint position); -GimpLayer * gimp_image_remove_layer (GimpImage *gimage, - GimpLayer *layer); -GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, - GimpLayer *layer, - GimpLayerMask *mask); -Channel * gimp_image_remove_layer_mask (GimpImage *gimage, - GimpLayer *layer, - MaskApplyMode mode); -Channel * gimp_image_raise_channel (GimpImage *gimage, - Channel *channel_arg); -Channel * gimp_image_lower_channel (GimpImage *gimage, - Channel *channel_arg); -Channel * gimp_image_position_channel (GimpImage *gimage, - Channel *channel_arg, - gint position); -Channel * gimp_image_add_channel (GimpImage *gimage, - Channel *channel, - gint position); -Channel * gimp_image_remove_channel (GimpImage *gimage, - Channel *channel); -void gimp_image_construct (GimpImage *gimage, - gint x, - gint y, - gint w, - gint h); +gint gimp_image_get_layer_index (const GimpImage *gimage, + const GimpLayer *layer_arg); +GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, + gint layer_index); +gint gimp_image_get_channel_index (const GimpImage *gimage, + const GimpChannel *channel_arg); +GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); +GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage); +GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, + Tattoo tatoo); +GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, + Tattoo tatoo); +GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, + const gchar *name); +GimpChannel * gimp_image_get_mask (const GimpImage *gimage); +gboolean gimp_image_get_component_active (const GimpImage *gimage, + ChannelType type); +gboolean gimp_image_get_component_visible (const GimpImage *gimage, + ChannelType type); +gboolean gimp_image_layer_boundary (const GimpImage *gimage, + BoundSeg **segs, + gint *n_segs); +GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, + GimpLayer *layer); +GimpChannel * gimp_image_set_active_channel (GimpImage *gimage, + GimpChannel *channel); +GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage); +void gimp_image_set_component_active (GimpImage *gimage, + ChannelType type, + gboolean active); +void gimp_image_set_component_visible (GimpImage *gimage, + ChannelType type, + gboolean visible); +GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage, + gint x, + gint y); +GimpLayer * gimp_image_raise_layer (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_lower_layer (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_position_layer (GimpImage *gimage, + GimpLayer *layer_arg, + gint new_index, + gboolean push_undo); +GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage, + MergeType merge_type); +GimpLayer * gimp_image_merge_down (GimpImage *gimage, + GimpLayer *current_layer, + MergeType merge_type); +GimpLayer * gimp_image_flatten (GimpImage *gimage); +GimpLayer * gimp_image_merge_layers (GimpImage *gimage, + GSList *merge_list, + MergeType merge_type); +GimpLayer * gimp_image_add_layer (GimpImage *gimage, + GimpLayer *float_layer, + gint position); +GimpLayer * gimp_image_remove_layer (GimpImage *gimage, + GimpLayer *layer); +GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, + GimpLayer *layer, + GimpLayerMask *mask); +GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage, + GimpLayer *layer, + MaskApplyMode mode); +GimpChannel * gimp_image_raise_channel (GimpImage *gimage, + GimpChannel *channel_arg); +GimpChannel * gimp_image_lower_channel (GimpImage *gimage, + GimpChannel *channel_arg); +GimpChannel * gimp_image_position_channel (GimpImage *gimage, + GimpChannel *channel_arg, + gint position); +GimpChannel * gimp_image_add_channel (GimpImage *gimage, + GimpChannel *channel, + gint position); +GimpChannel * gimp_image_remove_channel (GimpImage *gimage, + GimpChannel *channel); +void gimp_image_construct (GimpImage *gimage, + gint x, + gint y, + gint w, + gint h); void gimp_image_invalidate_without_render (GimpImage *gimage, diff --git a/app/core/gimpimage-projection.c b/app/core/gimpimage-projection.c index a733e7d312..7de7193350 100644 --- a/app/core/gimpimage-projection.c +++ b/app/core/gimpimage-projection.c @@ -113,7 +113,7 @@ static void project_indexed_alpha (GimpImage *gimage, PixelRegion *dest, PixelRegion *mask); static void project_channel (GimpImage *gimage, - Channel *layer, + GimpChannel *channel, PixelRegion *src, PixelRegion *src2); @@ -437,8 +437,9 @@ gimp_image_new (gint width, } /* create the selection mask */ - gimage->selection_mask = channel_new_mask (gimage, - gimage->width, gimage->height); + gimage->selection_mask = gimp_channel_new_mask (gimage, + gimage->width, + gimage->height); return gimage; @@ -552,11 +553,11 @@ gimp_image_resize (GimpImage *gimage, gint offset_x, gint offset_y) { - Channel *channel; - GimpLayer *layer; - GimpLayer *floating_layer; - GSList *list; - GList *guide_list; + GimpChannel *channel; + GimpLayer *layer; + GimpLayer *floating_layer; + GSList *list; + GList *guide_list; gimp_add_busy_cursors (); @@ -581,9 +582,9 @@ gimp_image_resize (GimpImage *gimage, /* Resize all channels */ for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; - channel_resize (channel, new_width, new_height, offset_x, offset_y); + gimp_channel_resize (channel, new_width, new_height, offset_x, offset_y); } /* Reposition or remove any guides */ @@ -617,8 +618,8 @@ gimp_image_resize (GimpImage *gimage, } /* Don't forget the selection mask! */ - channel_resize (gimage->selection_mask, - new_width, new_height, offset_x, offset_y); + gimp_channel_resize (gimage->selection_mask, + new_width, new_height, offset_x, offset_y); gimage_mask_invalidate (gimage); /* Reposition all layers */ @@ -646,17 +647,17 @@ gimp_image_scale (GimpImage *gimage, gint new_width, gint new_height) { - Channel *channel; - GimpLayer *layer; - GimpLayer *floating_layer; - GSList *list; - GSList *remove = NULL; - GList *glist; - Guide *guide; - gint old_width; - gint old_height; - gdouble img_scale_w = 1.0; - gdouble img_scale_h = 1.0; + GimpChannel *channel; + GimpLayer *layer; + GimpLayer *floating_layer; + GSList *list; + GSList *remove = NULL; + GList *glist; + Guide *guide; + gint old_width; + gint old_height; + gdouble img_scale_w = 1.0; + gdouble img_scale_h = 1.0; if ((new_width == 0) || (new_height == 0)) { @@ -690,17 +691,18 @@ gimp_image_scale (GimpImage *gimage, /* Scale all channels */ for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; - channel_scale (channel, new_width, new_height); + channel = (GimpChannel *) list->data; + + gimp_channel_scale (channel, new_width, new_height); } /* Don't forget the selection mask! */ /* if (channel_is_empty(gimage->selection_mask)) - channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) + gimp_channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) else */ - channel_scale (gimage->selection_mask, new_width, new_height); + gimp_channel_scale (gimage->selection_mask, new_width, new_height); gimage_mask_invalidate (gimage); /* Scale all layers */ @@ -827,7 +829,7 @@ gimp_image_apply_image (GimpImage *gimage, gint x, gint y) { - Channel *mask; + GimpChannel *mask; gint x1, y1, x2, y2; gint offset_x, offset_y; PixelRegion src1PR, destPR, maskPR; @@ -932,7 +934,7 @@ gimp_image_replace_image (GimpImage *gimage, gint x, gint y) { - Channel *mask; + GimpChannel *mask; gint x1, y1, x2, y2; gint offset_x, offset_y; PixelRegion src1PR, destPR; @@ -1374,14 +1376,14 @@ gboolean gimp_image_set_tattoo_state (GimpImage *gimage, Tattoo val) { - GimpLayer *layer; - GSList *layers; - gboolean retval = TRUE; - Channel *channel; - GSList *channels; - Tattoo maxval = 0; - Path *pptr = NULL; - PathList *plist; + GimpLayer *layer; + GSList *layers; + gboolean retval = TRUE; + GimpChannel *channel; + GSList *channels; + Tattoo maxval = 0; + Path *pptr = NULL; + PathList *plist; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); @@ -1411,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, channels = g_slist_next (channels)) { Tattoo ctattoo; - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); if (ctattoo > maxval) @@ -1544,7 +1546,7 @@ project_indexed_alpha (GimpImage *gimage, static void project_channel (GimpImage *gimage, - Channel *channel, + GimpChannel *channel, PixelRegion *src, PixelRegion *src2) { @@ -1598,12 +1600,12 @@ gimp_image_free_layers (GimpImage *gimage) static void gimp_image_free_channels (GimpImage *gimage) { - GSList *list; - Channel *channel; + GSList *list; + GimpChannel *channel; for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; gtk_object_unref (GTK_OBJECT (channel)); } @@ -1760,7 +1762,7 @@ gimp_image_construct_channels (GimpImage *gimage, gint w, gint h) { - Channel *channel; + GimpChannel *channel; PixelRegion src1PR; PixelRegion src2PR; GSList *list; @@ -1772,7 +1774,7 @@ gimp_image_construct_channels (GimpImage *gimage, while (reverse_list) { - channel = (Channel *) reverse_list->data; + channel = (GimpChannel *) reverse_list->data; if (gimp_drawable_visible (GIMP_DRAWABLE (channel))) { @@ -2121,15 +2123,15 @@ gimp_image_invalidate_layer_previews (GimpImage *gimage) void gimp_image_invalidate_channel_previews (GimpImage *gimage) { - GSList *tmp; - Channel *channel; + GSList *tmp; + GimpChannel *channel; g_return_if_fail (gimage != NULL); g_return_if_fail (GIMP_IS_IMAGE (gimage)); for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp)) { - channel = (Channel *) tmp->data; + channel = (GimpChannel *) tmp->data; gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE); } @@ -2173,12 +2175,12 @@ gimp_image_get_layer_by_index (const GimpImage *gimage, } gint -gimp_image_get_channel_index (const GimpImage *gimage, - const Channel *channel_arg) +gimp_image_get_channel_index (const GimpImage *gimage, + const GimpChannel *channel_arg) { - Channel *channel; - GSList *channels; - gint index; + GimpChannel *channel; + GSList *channels; + gint index; g_return_val_if_fail (gimage != NULL, -1); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), -1); @@ -2187,7 +2189,7 @@ gimp_image_get_channel_index (const GimpImage *gimage, channels; channels = g_slist_next (channels), index++) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (channel == channel_arg) return index; @@ -2205,7 +2207,7 @@ gimp_image_get_active_layer (const GimpImage *gimage) return gimage->active_layer; } -Channel * +GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2235,12 +2237,12 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, Tattoo tattoo) { - Channel *channel; - GSList *channels; + GimpChannel *channel; + GSList *channels; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2248,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, channels; channels = g_slist_next (channels)) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) return channel; @@ -2257,12 +2259,12 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, const gchar *name) { - Channel *channel; - GSList *channels; + GimpChannel *channel; + GSList *channels; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2270,7 +2272,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage, channels; channels = g_slist_next (channels)) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name)) return channel; } @@ -2278,7 +2280,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_mask (const GimpImage *gimage) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2380,9 +2382,9 @@ gimp_image_set_active_layer (GimpImage *gimage, return layer; } -Channel * -gimp_image_set_active_channel (GimpImage *gimage, - Channel *channel) +GimpChannel * +gimp_image_set_active_channel (GimpImage *gimage, + GimpChannel *channel) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2400,7 +2402,7 @@ gimp_image_set_active_channel (GimpImage *gimage, gimage->active_channel = NULL; return NULL; } - channel = (Channel *) gimage->channels->data; + channel = (GimpChannel *) gimage->channels->data; } /* Set the active channel */ @@ -2410,10 +2412,10 @@ gimp_image_set_active_channel (GimpImage *gimage, return channel; } -Channel * +GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage) { - Channel *channel; + GimpChannel *channel; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3308,7 +3310,7 @@ gimp_image_add_layer_mask (GimpImage *gimage, return mask; } -Channel * +GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage, GimpLayer *layer, MaskApplyMode mode) @@ -3362,15 +3364,15 @@ gimp_image_remove_layer_mask (GimpImage *gimage, return NULL; } -Channel * -gimp_image_raise_channel (GimpImage *gimage, - Channel *channel_arg) +GimpChannel * +gimp_image_raise_channel (GimpImage *gimage, + GimpChannel *channel_arg) { - Channel *channel; - Channel *prev_channel; - GSList *list; - GSList *prev; - gint index = -1; + GimpChannel *channel; + GimpChannel *prev_channel; + GSList *list; + GSList *prev; + gint index = -1; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3380,9 +3382,9 @@ gimp_image_raise_channel (GimpImage *gimage, while (list) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; if (prev) - prev_channel = (Channel *) prev->data; + prev_channel = (GimpChannel *) prev->data; if (channel == channel_arg) { @@ -3411,15 +3413,15 @@ gimp_image_raise_channel (GimpImage *gimage, return NULL; } -Channel * -gimp_image_lower_channel (GimpImage *gimage, - Channel *channel_arg) +GimpChannel * +gimp_image_lower_channel (GimpImage *gimage, + GimpChannel *channel_arg) { - Channel *channel; - Channel *next_channel; - GSList *list; - GSList *next; - gint index = 0; + GimpChannel *channel; + GimpChannel *next_channel; + GSList *list; + GSList *next; + gint index = 0; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3428,11 +3430,11 @@ gimp_image_lower_channel (GimpImage *gimage, while (list) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; next = g_slist_next (list); if (next) - next_channel = (Channel *) next->data; + next_channel = (GimpChannel *) next->data; index++; if (channel == channel_arg) @@ -3460,16 +3462,16 @@ gimp_image_lower_channel (GimpImage *gimage, return NULL; } -Channel * -gimp_image_position_channel (GimpImage *gimage, - Channel *channel_arg, - gint new_index) +GimpChannel * +gimp_image_position_channel (GimpImage *gimage, + GimpChannel *channel_arg, + gint new_index) { - Channel *channel; - GSList *list; - GSList *next; - gint index; - gint list_length; + GimpChannel *channel; + GSList *list; + GSList *next; + gint index; + gint list_length; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3481,7 +3483,7 @@ gimp_image_position_channel (GimpImage *gimage, list; list = g_slist_next (list), index++) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; if (channel == channel_arg) { break; @@ -3513,10 +3515,10 @@ gimp_image_position_channel (GimpImage *gimage, return channel; } -Channel * -gimp_image_add_channel (GimpImage *gimage, - Channel *channel, - gint position) +GimpChannel * +gimp_image_add_channel (GimpImage *gimage, + GimpChannel *channel, + gint position) { ChannelUndo *cu; GSList *cc; @@ -3564,9 +3566,9 @@ gimp_image_add_channel (GimpImage *gimage, return channel; } -Channel * -gimp_image_remove_channel (GimpImage *gimage, - Channel *channel) +GimpChannel * +gimp_image_remove_channel (GimpImage *gimage, + GimpChannel *channel) { ChannelUndo *cu; @@ -3584,7 +3586,7 @@ gimp_image_remove_channel (GimpImage *gimage, if (gimage->active_channel == channel) { if (gimage->channels) - gimage->active_channel = (((Channel *) gimage->channels->data)); + gimage->active_channel = (((GimpChannel *) gimage->channels->data)); else gimage->active_channel = NULL; } diff --git a/app/core/gimpimage-projection.h b/app/core/gimpimage-projection.h index 356c35f17c..a71abc7029 100644 --- a/app/core/gimpimage-projection.h +++ b/app/core/gimpimage-projection.h @@ -86,9 +86,9 @@ struct _GimpImage GSList *layer_stack; /* the layers in MRU order */ GimpLayer *active_layer; /* ID of active layer */ - Channel *active_channel; /* ID of active channel */ + GimpChannel *active_channel; /* ID of active channel */ GimpLayer *floating_sel; /* ID of fs layer */ - Channel *selection_mask; /* selection mask channel */ + GimpChannel *selection_mask; /* selection mask channel */ ParasiteList *parasites; /* Plug-in parasite data */ @@ -282,91 +282,91 @@ void gimp_image_colormap_changed (const GimpImage *image, /* layer/channel functions */ -gint gimp_image_get_layer_index (const GimpImage *gimage, - const GimpLayer *layer_arg); -GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, - gint layer_index); -gint gimp_image_get_channel_index (const GimpImage *gimage, - const Channel *channel_arg); -GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); -Channel * gimp_image_get_active_channel (const GimpImage *gimage); -GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); -Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); -Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, - const gchar *name); -Channel * gimp_image_get_mask (const GimpImage *gimage); -gboolean gimp_image_get_component_active (const GimpImage *gimage, - ChannelType type); -gboolean gimp_image_get_component_visible (const GimpImage *gimage, - ChannelType type); -gboolean gimp_image_layer_boundary (const GimpImage *gimage, - BoundSeg **segs, - gint *n_segs); -GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, - GimpLayer *layer); -Channel * gimp_image_set_active_channel (GimpImage *gimage, - Channel *channel); -Channel * gimp_image_unset_active_channel (GimpImage *gimage); -void gimp_image_set_component_active (GimpImage *gimage, - ChannelType type, - gboolean active); -void gimp_image_set_component_visible (GimpImage *gimage, - ChannelType type, - gboolean visible); -GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage, - gint x, - gint y); -GimpLayer * gimp_image_raise_layer (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_lower_layer (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_position_layer (GimpImage *gimage, - GimpLayer *layer_arg, - gint new_index, - gboolean push_undo); -GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage, - MergeType merge_type); -GimpLayer * gimp_image_merge_down (GimpImage *gimage, - GimpLayer *current_layer, - MergeType merge_type); -GimpLayer * gimp_image_flatten (GimpImage *gimage); -GimpLayer * gimp_image_merge_layers (GimpImage *gimage, - GSList *merge_list, - MergeType merge_type); -GimpLayer * gimp_image_add_layer (GimpImage *gimage, - GimpLayer *float_layer, - gint position); -GimpLayer * gimp_image_remove_layer (GimpImage *gimage, - GimpLayer *layer); -GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, - GimpLayer *layer, - GimpLayerMask *mask); -Channel * gimp_image_remove_layer_mask (GimpImage *gimage, - GimpLayer *layer, - MaskApplyMode mode); -Channel * gimp_image_raise_channel (GimpImage *gimage, - Channel *channel_arg); -Channel * gimp_image_lower_channel (GimpImage *gimage, - Channel *channel_arg); -Channel * gimp_image_position_channel (GimpImage *gimage, - Channel *channel_arg, - gint position); -Channel * gimp_image_add_channel (GimpImage *gimage, - Channel *channel, - gint position); -Channel * gimp_image_remove_channel (GimpImage *gimage, - Channel *channel); -void gimp_image_construct (GimpImage *gimage, - gint x, - gint y, - gint w, - gint h); +gint gimp_image_get_layer_index (const GimpImage *gimage, + const GimpLayer *layer_arg); +GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, + gint layer_index); +gint gimp_image_get_channel_index (const GimpImage *gimage, + const GimpChannel *channel_arg); +GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); +GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage); +GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, + Tattoo tatoo); +GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, + Tattoo tatoo); +GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, + const gchar *name); +GimpChannel * gimp_image_get_mask (const GimpImage *gimage); +gboolean gimp_image_get_component_active (const GimpImage *gimage, + ChannelType type); +gboolean gimp_image_get_component_visible (const GimpImage *gimage, + ChannelType type); +gboolean gimp_image_layer_boundary (const GimpImage *gimage, + BoundSeg **segs, + gint *n_segs); +GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, + GimpLayer *layer); +GimpChannel * gimp_image_set_active_channel (GimpImage *gimage, + GimpChannel *channel); +GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage); +void gimp_image_set_component_active (GimpImage *gimage, + ChannelType type, + gboolean active); +void gimp_image_set_component_visible (GimpImage *gimage, + ChannelType type, + gboolean visible); +GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage, + gint x, + gint y); +GimpLayer * gimp_image_raise_layer (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_lower_layer (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_position_layer (GimpImage *gimage, + GimpLayer *layer_arg, + gint new_index, + gboolean push_undo); +GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage, + MergeType merge_type); +GimpLayer * gimp_image_merge_down (GimpImage *gimage, + GimpLayer *current_layer, + MergeType merge_type); +GimpLayer * gimp_image_flatten (GimpImage *gimage); +GimpLayer * gimp_image_merge_layers (GimpImage *gimage, + GSList *merge_list, + MergeType merge_type); +GimpLayer * gimp_image_add_layer (GimpImage *gimage, + GimpLayer *float_layer, + gint position); +GimpLayer * gimp_image_remove_layer (GimpImage *gimage, + GimpLayer *layer); +GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, + GimpLayer *layer, + GimpLayerMask *mask); +GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage, + GimpLayer *layer, + MaskApplyMode mode); +GimpChannel * gimp_image_raise_channel (GimpImage *gimage, + GimpChannel *channel_arg); +GimpChannel * gimp_image_lower_channel (GimpImage *gimage, + GimpChannel *channel_arg); +GimpChannel * gimp_image_position_channel (GimpImage *gimage, + GimpChannel *channel_arg, + gint position); +GimpChannel * gimp_image_add_channel (GimpImage *gimage, + GimpChannel *channel, + gint position); +GimpChannel * gimp_image_remove_channel (GimpImage *gimage, + GimpChannel *channel); +void gimp_image_construct (GimpImage *gimage, + gint x, + gint y, + gint w, + gint h); void gimp_image_invalidate_without_render (GimpImage *gimage, diff --git a/app/core/gimpimage-qmask.c b/app/core/gimpimage-qmask.c index a7c594e558..3d078909c9 100644 --- a/app/core/gimpimage-qmask.c +++ b/app/core/gimpimage-qmask.c @@ -232,11 +232,11 @@ qmask_activate (GtkWidget *widget, floating_sel_to_layer (layer); } - gmask = channel_new (gimg, - gimg->width, - gimg->height, - "Qmask", - &color); + gmask = gimp_channel_new (gimg, + gimg->width, + gimg->height, + "Qmask", + &color); gimp_image_add_channel (gimg, gmask, 0); drawable_fill (GIMP_DRAWABLE (gmask), TRANSPARENT_FILL); } @@ -244,9 +244,9 @@ qmask_activate (GtkWidget *widget, { /* if selection */ - gmask = channel_copy (gimp_image_get_mask (gimg)); + gmask = gimp_channel_copy (gimp_image_get_mask (gimg)); gimp_image_add_channel (gimg, gmask, 0); - channel_set_color (gmask, &color); + gimp_channel_set_color (gmask, &color); gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask"); gimage_mask_none (gimg); /* Clear the selection */ } @@ -349,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget, gpointer data) { EditQmaskOptions *options; - Channel *channel; + GimpChannel *channel; GimpRGB color; options = (EditQmaskOptions *) data; @@ -364,7 +364,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget, if (gimp_rgba_distance (&color, &channel->color) > 0.0001) { channel->color = color; - channel_update (channel); + gimp_channel_update (channel); } } diff --git a/app/core/gimpimage-quick-mask.c b/app/core/gimpimage-quick-mask.c index a7c594e558..3d078909c9 100644 --- a/app/core/gimpimage-quick-mask.c +++ b/app/core/gimpimage-quick-mask.c @@ -232,11 +232,11 @@ qmask_activate (GtkWidget *widget, floating_sel_to_layer (layer); } - gmask = channel_new (gimg, - gimg->width, - gimg->height, - "Qmask", - &color); + gmask = gimp_channel_new (gimg, + gimg->width, + gimg->height, + "Qmask", + &color); gimp_image_add_channel (gimg, gmask, 0); drawable_fill (GIMP_DRAWABLE (gmask), TRANSPARENT_FILL); } @@ -244,9 +244,9 @@ qmask_activate (GtkWidget *widget, { /* if selection */ - gmask = channel_copy (gimp_image_get_mask (gimg)); + gmask = gimp_channel_copy (gimp_image_get_mask (gimg)); gimp_image_add_channel (gimg, gmask, 0); - channel_set_color (gmask, &color); + gimp_channel_set_color (gmask, &color); gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask"); gimage_mask_none (gimg); /* Clear the selection */ } @@ -349,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget, gpointer data) { EditQmaskOptions *options; - Channel *channel; + GimpChannel *channel; GimpRGB color; options = (EditQmaskOptions *) data; @@ -364,7 +364,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget, if (gimp_rgba_distance (&color, &channel->color) > 0.0001) { channel->color = color; - channel_update (channel); + gimp_channel_update (channel); } } diff --git a/app/core/gimpimage-resize.c b/app/core/gimpimage-resize.c index a733e7d312..7de7193350 100644 --- a/app/core/gimpimage-resize.c +++ b/app/core/gimpimage-resize.c @@ -113,7 +113,7 @@ static void project_indexed_alpha (GimpImage *gimage, PixelRegion *dest, PixelRegion *mask); static void project_channel (GimpImage *gimage, - Channel *layer, + GimpChannel *channel, PixelRegion *src, PixelRegion *src2); @@ -437,8 +437,9 @@ gimp_image_new (gint width, } /* create the selection mask */ - gimage->selection_mask = channel_new_mask (gimage, - gimage->width, gimage->height); + gimage->selection_mask = gimp_channel_new_mask (gimage, + gimage->width, + gimage->height); return gimage; @@ -552,11 +553,11 @@ gimp_image_resize (GimpImage *gimage, gint offset_x, gint offset_y) { - Channel *channel; - GimpLayer *layer; - GimpLayer *floating_layer; - GSList *list; - GList *guide_list; + GimpChannel *channel; + GimpLayer *layer; + GimpLayer *floating_layer; + GSList *list; + GList *guide_list; gimp_add_busy_cursors (); @@ -581,9 +582,9 @@ gimp_image_resize (GimpImage *gimage, /* Resize all channels */ for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; - channel_resize (channel, new_width, new_height, offset_x, offset_y); + gimp_channel_resize (channel, new_width, new_height, offset_x, offset_y); } /* Reposition or remove any guides */ @@ -617,8 +618,8 @@ gimp_image_resize (GimpImage *gimage, } /* Don't forget the selection mask! */ - channel_resize (gimage->selection_mask, - new_width, new_height, offset_x, offset_y); + gimp_channel_resize (gimage->selection_mask, + new_width, new_height, offset_x, offset_y); gimage_mask_invalidate (gimage); /* Reposition all layers */ @@ -646,17 +647,17 @@ gimp_image_scale (GimpImage *gimage, gint new_width, gint new_height) { - Channel *channel; - GimpLayer *layer; - GimpLayer *floating_layer; - GSList *list; - GSList *remove = NULL; - GList *glist; - Guide *guide; - gint old_width; - gint old_height; - gdouble img_scale_w = 1.0; - gdouble img_scale_h = 1.0; + GimpChannel *channel; + GimpLayer *layer; + GimpLayer *floating_layer; + GSList *list; + GSList *remove = NULL; + GList *glist; + Guide *guide; + gint old_width; + gint old_height; + gdouble img_scale_w = 1.0; + gdouble img_scale_h = 1.0; if ((new_width == 0) || (new_height == 0)) { @@ -690,17 +691,18 @@ gimp_image_scale (GimpImage *gimage, /* Scale all channels */ for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; - channel_scale (channel, new_width, new_height); + channel = (GimpChannel *) list->data; + + gimp_channel_scale (channel, new_width, new_height); } /* Don't forget the selection mask! */ /* if (channel_is_empty(gimage->selection_mask)) - channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) + gimp_channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) else */ - channel_scale (gimage->selection_mask, new_width, new_height); + gimp_channel_scale (gimage->selection_mask, new_width, new_height); gimage_mask_invalidate (gimage); /* Scale all layers */ @@ -827,7 +829,7 @@ gimp_image_apply_image (GimpImage *gimage, gint x, gint y) { - Channel *mask; + GimpChannel *mask; gint x1, y1, x2, y2; gint offset_x, offset_y; PixelRegion src1PR, destPR, maskPR; @@ -932,7 +934,7 @@ gimp_image_replace_image (GimpImage *gimage, gint x, gint y) { - Channel *mask; + GimpChannel *mask; gint x1, y1, x2, y2; gint offset_x, offset_y; PixelRegion src1PR, destPR; @@ -1374,14 +1376,14 @@ gboolean gimp_image_set_tattoo_state (GimpImage *gimage, Tattoo val) { - GimpLayer *layer; - GSList *layers; - gboolean retval = TRUE; - Channel *channel; - GSList *channels; - Tattoo maxval = 0; - Path *pptr = NULL; - PathList *plist; + GimpLayer *layer; + GSList *layers; + gboolean retval = TRUE; + GimpChannel *channel; + GSList *channels; + Tattoo maxval = 0; + Path *pptr = NULL; + PathList *plist; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); @@ -1411,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, channels = g_slist_next (channels)) { Tattoo ctattoo; - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); if (ctattoo > maxval) @@ -1544,7 +1546,7 @@ project_indexed_alpha (GimpImage *gimage, static void project_channel (GimpImage *gimage, - Channel *channel, + GimpChannel *channel, PixelRegion *src, PixelRegion *src2) { @@ -1598,12 +1600,12 @@ gimp_image_free_layers (GimpImage *gimage) static void gimp_image_free_channels (GimpImage *gimage) { - GSList *list; - Channel *channel; + GSList *list; + GimpChannel *channel; for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; gtk_object_unref (GTK_OBJECT (channel)); } @@ -1760,7 +1762,7 @@ gimp_image_construct_channels (GimpImage *gimage, gint w, gint h) { - Channel *channel; + GimpChannel *channel; PixelRegion src1PR; PixelRegion src2PR; GSList *list; @@ -1772,7 +1774,7 @@ gimp_image_construct_channels (GimpImage *gimage, while (reverse_list) { - channel = (Channel *) reverse_list->data; + channel = (GimpChannel *) reverse_list->data; if (gimp_drawable_visible (GIMP_DRAWABLE (channel))) { @@ -2121,15 +2123,15 @@ gimp_image_invalidate_layer_previews (GimpImage *gimage) void gimp_image_invalidate_channel_previews (GimpImage *gimage) { - GSList *tmp; - Channel *channel; + GSList *tmp; + GimpChannel *channel; g_return_if_fail (gimage != NULL); g_return_if_fail (GIMP_IS_IMAGE (gimage)); for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp)) { - channel = (Channel *) tmp->data; + channel = (GimpChannel *) tmp->data; gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE); } @@ -2173,12 +2175,12 @@ gimp_image_get_layer_by_index (const GimpImage *gimage, } gint -gimp_image_get_channel_index (const GimpImage *gimage, - const Channel *channel_arg) +gimp_image_get_channel_index (const GimpImage *gimage, + const GimpChannel *channel_arg) { - Channel *channel; - GSList *channels; - gint index; + GimpChannel *channel; + GSList *channels; + gint index; g_return_val_if_fail (gimage != NULL, -1); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), -1); @@ -2187,7 +2189,7 @@ gimp_image_get_channel_index (const GimpImage *gimage, channels; channels = g_slist_next (channels), index++) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (channel == channel_arg) return index; @@ -2205,7 +2207,7 @@ gimp_image_get_active_layer (const GimpImage *gimage) return gimage->active_layer; } -Channel * +GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2235,12 +2237,12 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, Tattoo tattoo) { - Channel *channel; - GSList *channels; + GimpChannel *channel; + GSList *channels; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2248,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, channels; channels = g_slist_next (channels)) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) return channel; @@ -2257,12 +2259,12 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, const gchar *name) { - Channel *channel; - GSList *channels; + GimpChannel *channel; + GSList *channels; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2270,7 +2272,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage, channels; channels = g_slist_next (channels)) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name)) return channel; } @@ -2278,7 +2280,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_mask (const GimpImage *gimage) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2380,9 +2382,9 @@ gimp_image_set_active_layer (GimpImage *gimage, return layer; } -Channel * -gimp_image_set_active_channel (GimpImage *gimage, - Channel *channel) +GimpChannel * +gimp_image_set_active_channel (GimpImage *gimage, + GimpChannel *channel) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2400,7 +2402,7 @@ gimp_image_set_active_channel (GimpImage *gimage, gimage->active_channel = NULL; return NULL; } - channel = (Channel *) gimage->channels->data; + channel = (GimpChannel *) gimage->channels->data; } /* Set the active channel */ @@ -2410,10 +2412,10 @@ gimp_image_set_active_channel (GimpImage *gimage, return channel; } -Channel * +GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage) { - Channel *channel; + GimpChannel *channel; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3308,7 +3310,7 @@ gimp_image_add_layer_mask (GimpImage *gimage, return mask; } -Channel * +GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage, GimpLayer *layer, MaskApplyMode mode) @@ -3362,15 +3364,15 @@ gimp_image_remove_layer_mask (GimpImage *gimage, return NULL; } -Channel * -gimp_image_raise_channel (GimpImage *gimage, - Channel *channel_arg) +GimpChannel * +gimp_image_raise_channel (GimpImage *gimage, + GimpChannel *channel_arg) { - Channel *channel; - Channel *prev_channel; - GSList *list; - GSList *prev; - gint index = -1; + GimpChannel *channel; + GimpChannel *prev_channel; + GSList *list; + GSList *prev; + gint index = -1; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3380,9 +3382,9 @@ gimp_image_raise_channel (GimpImage *gimage, while (list) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; if (prev) - prev_channel = (Channel *) prev->data; + prev_channel = (GimpChannel *) prev->data; if (channel == channel_arg) { @@ -3411,15 +3413,15 @@ gimp_image_raise_channel (GimpImage *gimage, return NULL; } -Channel * -gimp_image_lower_channel (GimpImage *gimage, - Channel *channel_arg) +GimpChannel * +gimp_image_lower_channel (GimpImage *gimage, + GimpChannel *channel_arg) { - Channel *channel; - Channel *next_channel; - GSList *list; - GSList *next; - gint index = 0; + GimpChannel *channel; + GimpChannel *next_channel; + GSList *list; + GSList *next; + gint index = 0; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3428,11 +3430,11 @@ gimp_image_lower_channel (GimpImage *gimage, while (list) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; next = g_slist_next (list); if (next) - next_channel = (Channel *) next->data; + next_channel = (GimpChannel *) next->data; index++; if (channel == channel_arg) @@ -3460,16 +3462,16 @@ gimp_image_lower_channel (GimpImage *gimage, return NULL; } -Channel * -gimp_image_position_channel (GimpImage *gimage, - Channel *channel_arg, - gint new_index) +GimpChannel * +gimp_image_position_channel (GimpImage *gimage, + GimpChannel *channel_arg, + gint new_index) { - Channel *channel; - GSList *list; - GSList *next; - gint index; - gint list_length; + GimpChannel *channel; + GSList *list; + GSList *next; + gint index; + gint list_length; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3481,7 +3483,7 @@ gimp_image_position_channel (GimpImage *gimage, list; list = g_slist_next (list), index++) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; if (channel == channel_arg) { break; @@ -3513,10 +3515,10 @@ gimp_image_position_channel (GimpImage *gimage, return channel; } -Channel * -gimp_image_add_channel (GimpImage *gimage, - Channel *channel, - gint position) +GimpChannel * +gimp_image_add_channel (GimpImage *gimage, + GimpChannel *channel, + gint position) { ChannelUndo *cu; GSList *cc; @@ -3564,9 +3566,9 @@ gimp_image_add_channel (GimpImage *gimage, return channel; } -Channel * -gimp_image_remove_channel (GimpImage *gimage, - Channel *channel) +GimpChannel * +gimp_image_remove_channel (GimpImage *gimage, + GimpChannel *channel) { ChannelUndo *cu; @@ -3584,7 +3586,7 @@ gimp_image_remove_channel (GimpImage *gimage, if (gimage->active_channel == channel) { if (gimage->channels) - gimage->active_channel = (((Channel *) gimage->channels->data)); + gimage->active_channel = (((GimpChannel *) gimage->channels->data)); else gimage->active_channel = NULL; } diff --git a/app/core/gimpimage-resize.h b/app/core/gimpimage-resize.h index 356c35f17c..a71abc7029 100644 --- a/app/core/gimpimage-resize.h +++ b/app/core/gimpimage-resize.h @@ -86,9 +86,9 @@ struct _GimpImage GSList *layer_stack; /* the layers in MRU order */ GimpLayer *active_layer; /* ID of active layer */ - Channel *active_channel; /* ID of active channel */ + GimpChannel *active_channel; /* ID of active channel */ GimpLayer *floating_sel; /* ID of fs layer */ - Channel *selection_mask; /* selection mask channel */ + GimpChannel *selection_mask; /* selection mask channel */ ParasiteList *parasites; /* Plug-in parasite data */ @@ -282,91 +282,91 @@ void gimp_image_colormap_changed (const GimpImage *image, /* layer/channel functions */ -gint gimp_image_get_layer_index (const GimpImage *gimage, - const GimpLayer *layer_arg); -GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, - gint layer_index); -gint gimp_image_get_channel_index (const GimpImage *gimage, - const Channel *channel_arg); -GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); -Channel * gimp_image_get_active_channel (const GimpImage *gimage); -GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); -Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); -Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, - const gchar *name); -Channel * gimp_image_get_mask (const GimpImage *gimage); -gboolean gimp_image_get_component_active (const GimpImage *gimage, - ChannelType type); -gboolean gimp_image_get_component_visible (const GimpImage *gimage, - ChannelType type); -gboolean gimp_image_layer_boundary (const GimpImage *gimage, - BoundSeg **segs, - gint *n_segs); -GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, - GimpLayer *layer); -Channel * gimp_image_set_active_channel (GimpImage *gimage, - Channel *channel); -Channel * gimp_image_unset_active_channel (GimpImage *gimage); -void gimp_image_set_component_active (GimpImage *gimage, - ChannelType type, - gboolean active); -void gimp_image_set_component_visible (GimpImage *gimage, - ChannelType type, - gboolean visible); -GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage, - gint x, - gint y); -GimpLayer * gimp_image_raise_layer (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_lower_layer (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_position_layer (GimpImage *gimage, - GimpLayer *layer_arg, - gint new_index, - gboolean push_undo); -GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage, - MergeType merge_type); -GimpLayer * gimp_image_merge_down (GimpImage *gimage, - GimpLayer *current_layer, - MergeType merge_type); -GimpLayer * gimp_image_flatten (GimpImage *gimage); -GimpLayer * gimp_image_merge_layers (GimpImage *gimage, - GSList *merge_list, - MergeType merge_type); -GimpLayer * gimp_image_add_layer (GimpImage *gimage, - GimpLayer *float_layer, - gint position); -GimpLayer * gimp_image_remove_layer (GimpImage *gimage, - GimpLayer *layer); -GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, - GimpLayer *layer, - GimpLayerMask *mask); -Channel * gimp_image_remove_layer_mask (GimpImage *gimage, - GimpLayer *layer, - MaskApplyMode mode); -Channel * gimp_image_raise_channel (GimpImage *gimage, - Channel *channel_arg); -Channel * gimp_image_lower_channel (GimpImage *gimage, - Channel *channel_arg); -Channel * gimp_image_position_channel (GimpImage *gimage, - Channel *channel_arg, - gint position); -Channel * gimp_image_add_channel (GimpImage *gimage, - Channel *channel, - gint position); -Channel * gimp_image_remove_channel (GimpImage *gimage, - Channel *channel); -void gimp_image_construct (GimpImage *gimage, - gint x, - gint y, - gint w, - gint h); +gint gimp_image_get_layer_index (const GimpImage *gimage, + const GimpLayer *layer_arg); +GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, + gint layer_index); +gint gimp_image_get_channel_index (const GimpImage *gimage, + const GimpChannel *channel_arg); +GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); +GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage); +GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, + Tattoo tatoo); +GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, + Tattoo tatoo); +GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, + const gchar *name); +GimpChannel * gimp_image_get_mask (const GimpImage *gimage); +gboolean gimp_image_get_component_active (const GimpImage *gimage, + ChannelType type); +gboolean gimp_image_get_component_visible (const GimpImage *gimage, + ChannelType type); +gboolean gimp_image_layer_boundary (const GimpImage *gimage, + BoundSeg **segs, + gint *n_segs); +GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, + GimpLayer *layer); +GimpChannel * gimp_image_set_active_channel (GimpImage *gimage, + GimpChannel *channel); +GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage); +void gimp_image_set_component_active (GimpImage *gimage, + ChannelType type, + gboolean active); +void gimp_image_set_component_visible (GimpImage *gimage, + ChannelType type, + gboolean visible); +GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage, + gint x, + gint y); +GimpLayer * gimp_image_raise_layer (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_lower_layer (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_position_layer (GimpImage *gimage, + GimpLayer *layer_arg, + gint new_index, + gboolean push_undo); +GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage, + MergeType merge_type); +GimpLayer * gimp_image_merge_down (GimpImage *gimage, + GimpLayer *current_layer, + MergeType merge_type); +GimpLayer * gimp_image_flatten (GimpImage *gimage); +GimpLayer * gimp_image_merge_layers (GimpImage *gimage, + GSList *merge_list, + MergeType merge_type); +GimpLayer * gimp_image_add_layer (GimpImage *gimage, + GimpLayer *float_layer, + gint position); +GimpLayer * gimp_image_remove_layer (GimpImage *gimage, + GimpLayer *layer); +GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, + GimpLayer *layer, + GimpLayerMask *mask); +GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage, + GimpLayer *layer, + MaskApplyMode mode); +GimpChannel * gimp_image_raise_channel (GimpImage *gimage, + GimpChannel *channel_arg); +GimpChannel * gimp_image_lower_channel (GimpImage *gimage, + GimpChannel *channel_arg); +GimpChannel * gimp_image_position_channel (GimpImage *gimage, + GimpChannel *channel_arg, + gint position); +GimpChannel * gimp_image_add_channel (GimpImage *gimage, + GimpChannel *channel, + gint position); +GimpChannel * gimp_image_remove_channel (GimpImage *gimage, + GimpChannel *channel); +void gimp_image_construct (GimpImage *gimage, + gint x, + gint y, + gint w, + gint h); void gimp_image_invalidate_without_render (GimpImage *gimage, diff --git a/app/core/gimpimage-scale.c b/app/core/gimpimage-scale.c index a733e7d312..7de7193350 100644 --- a/app/core/gimpimage-scale.c +++ b/app/core/gimpimage-scale.c @@ -113,7 +113,7 @@ static void project_indexed_alpha (GimpImage *gimage, PixelRegion *dest, PixelRegion *mask); static void project_channel (GimpImage *gimage, - Channel *layer, + GimpChannel *channel, PixelRegion *src, PixelRegion *src2); @@ -437,8 +437,9 @@ gimp_image_new (gint width, } /* create the selection mask */ - gimage->selection_mask = channel_new_mask (gimage, - gimage->width, gimage->height); + gimage->selection_mask = gimp_channel_new_mask (gimage, + gimage->width, + gimage->height); return gimage; @@ -552,11 +553,11 @@ gimp_image_resize (GimpImage *gimage, gint offset_x, gint offset_y) { - Channel *channel; - GimpLayer *layer; - GimpLayer *floating_layer; - GSList *list; - GList *guide_list; + GimpChannel *channel; + GimpLayer *layer; + GimpLayer *floating_layer; + GSList *list; + GList *guide_list; gimp_add_busy_cursors (); @@ -581,9 +582,9 @@ gimp_image_resize (GimpImage *gimage, /* Resize all channels */ for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; - channel_resize (channel, new_width, new_height, offset_x, offset_y); + gimp_channel_resize (channel, new_width, new_height, offset_x, offset_y); } /* Reposition or remove any guides */ @@ -617,8 +618,8 @@ gimp_image_resize (GimpImage *gimage, } /* Don't forget the selection mask! */ - channel_resize (gimage->selection_mask, - new_width, new_height, offset_x, offset_y); + gimp_channel_resize (gimage->selection_mask, + new_width, new_height, offset_x, offset_y); gimage_mask_invalidate (gimage); /* Reposition all layers */ @@ -646,17 +647,17 @@ gimp_image_scale (GimpImage *gimage, gint new_width, gint new_height) { - Channel *channel; - GimpLayer *layer; - GimpLayer *floating_layer; - GSList *list; - GSList *remove = NULL; - GList *glist; - Guide *guide; - gint old_width; - gint old_height; - gdouble img_scale_w = 1.0; - gdouble img_scale_h = 1.0; + GimpChannel *channel; + GimpLayer *layer; + GimpLayer *floating_layer; + GSList *list; + GSList *remove = NULL; + GList *glist; + Guide *guide; + gint old_width; + gint old_height; + gdouble img_scale_w = 1.0; + gdouble img_scale_h = 1.0; if ((new_width == 0) || (new_height == 0)) { @@ -690,17 +691,18 @@ gimp_image_scale (GimpImage *gimage, /* Scale all channels */ for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; - channel_scale (channel, new_width, new_height); + channel = (GimpChannel *) list->data; + + gimp_channel_scale (channel, new_width, new_height); } /* Don't forget the selection mask! */ /* if (channel_is_empty(gimage->selection_mask)) - channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) + gimp_channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) else */ - channel_scale (gimage->selection_mask, new_width, new_height); + gimp_channel_scale (gimage->selection_mask, new_width, new_height); gimage_mask_invalidate (gimage); /* Scale all layers */ @@ -827,7 +829,7 @@ gimp_image_apply_image (GimpImage *gimage, gint x, gint y) { - Channel *mask; + GimpChannel *mask; gint x1, y1, x2, y2; gint offset_x, offset_y; PixelRegion src1PR, destPR, maskPR; @@ -932,7 +934,7 @@ gimp_image_replace_image (GimpImage *gimage, gint x, gint y) { - Channel *mask; + GimpChannel *mask; gint x1, y1, x2, y2; gint offset_x, offset_y; PixelRegion src1PR, destPR; @@ -1374,14 +1376,14 @@ gboolean gimp_image_set_tattoo_state (GimpImage *gimage, Tattoo val) { - GimpLayer *layer; - GSList *layers; - gboolean retval = TRUE; - Channel *channel; - GSList *channels; - Tattoo maxval = 0; - Path *pptr = NULL; - PathList *plist; + GimpLayer *layer; + GSList *layers; + gboolean retval = TRUE; + GimpChannel *channel; + GSList *channels; + Tattoo maxval = 0; + Path *pptr = NULL; + PathList *plist; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); @@ -1411,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, channels = g_slist_next (channels)) { Tattoo ctattoo; - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); if (ctattoo > maxval) @@ -1544,7 +1546,7 @@ project_indexed_alpha (GimpImage *gimage, static void project_channel (GimpImage *gimage, - Channel *channel, + GimpChannel *channel, PixelRegion *src, PixelRegion *src2) { @@ -1598,12 +1600,12 @@ gimp_image_free_layers (GimpImage *gimage) static void gimp_image_free_channels (GimpImage *gimage) { - GSList *list; - Channel *channel; + GSList *list; + GimpChannel *channel; for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; gtk_object_unref (GTK_OBJECT (channel)); } @@ -1760,7 +1762,7 @@ gimp_image_construct_channels (GimpImage *gimage, gint w, gint h) { - Channel *channel; + GimpChannel *channel; PixelRegion src1PR; PixelRegion src2PR; GSList *list; @@ -1772,7 +1774,7 @@ gimp_image_construct_channels (GimpImage *gimage, while (reverse_list) { - channel = (Channel *) reverse_list->data; + channel = (GimpChannel *) reverse_list->data; if (gimp_drawable_visible (GIMP_DRAWABLE (channel))) { @@ -2121,15 +2123,15 @@ gimp_image_invalidate_layer_previews (GimpImage *gimage) void gimp_image_invalidate_channel_previews (GimpImage *gimage) { - GSList *tmp; - Channel *channel; + GSList *tmp; + GimpChannel *channel; g_return_if_fail (gimage != NULL); g_return_if_fail (GIMP_IS_IMAGE (gimage)); for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp)) { - channel = (Channel *) tmp->data; + channel = (GimpChannel *) tmp->data; gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE); } @@ -2173,12 +2175,12 @@ gimp_image_get_layer_by_index (const GimpImage *gimage, } gint -gimp_image_get_channel_index (const GimpImage *gimage, - const Channel *channel_arg) +gimp_image_get_channel_index (const GimpImage *gimage, + const GimpChannel *channel_arg) { - Channel *channel; - GSList *channels; - gint index; + GimpChannel *channel; + GSList *channels; + gint index; g_return_val_if_fail (gimage != NULL, -1); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), -1); @@ -2187,7 +2189,7 @@ gimp_image_get_channel_index (const GimpImage *gimage, channels; channels = g_slist_next (channels), index++) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (channel == channel_arg) return index; @@ -2205,7 +2207,7 @@ gimp_image_get_active_layer (const GimpImage *gimage) return gimage->active_layer; } -Channel * +GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2235,12 +2237,12 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, Tattoo tattoo) { - Channel *channel; - GSList *channels; + GimpChannel *channel; + GSList *channels; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2248,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, channels; channels = g_slist_next (channels)) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) return channel; @@ -2257,12 +2259,12 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, const gchar *name) { - Channel *channel; - GSList *channels; + GimpChannel *channel; + GSList *channels; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2270,7 +2272,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage, channels; channels = g_slist_next (channels)) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name)) return channel; } @@ -2278,7 +2280,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_mask (const GimpImage *gimage) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2380,9 +2382,9 @@ gimp_image_set_active_layer (GimpImage *gimage, return layer; } -Channel * -gimp_image_set_active_channel (GimpImage *gimage, - Channel *channel) +GimpChannel * +gimp_image_set_active_channel (GimpImage *gimage, + GimpChannel *channel) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2400,7 +2402,7 @@ gimp_image_set_active_channel (GimpImage *gimage, gimage->active_channel = NULL; return NULL; } - channel = (Channel *) gimage->channels->data; + channel = (GimpChannel *) gimage->channels->data; } /* Set the active channel */ @@ -2410,10 +2412,10 @@ gimp_image_set_active_channel (GimpImage *gimage, return channel; } -Channel * +GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage) { - Channel *channel; + GimpChannel *channel; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3308,7 +3310,7 @@ gimp_image_add_layer_mask (GimpImage *gimage, return mask; } -Channel * +GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage, GimpLayer *layer, MaskApplyMode mode) @@ -3362,15 +3364,15 @@ gimp_image_remove_layer_mask (GimpImage *gimage, return NULL; } -Channel * -gimp_image_raise_channel (GimpImage *gimage, - Channel *channel_arg) +GimpChannel * +gimp_image_raise_channel (GimpImage *gimage, + GimpChannel *channel_arg) { - Channel *channel; - Channel *prev_channel; - GSList *list; - GSList *prev; - gint index = -1; + GimpChannel *channel; + GimpChannel *prev_channel; + GSList *list; + GSList *prev; + gint index = -1; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3380,9 +3382,9 @@ gimp_image_raise_channel (GimpImage *gimage, while (list) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; if (prev) - prev_channel = (Channel *) prev->data; + prev_channel = (GimpChannel *) prev->data; if (channel == channel_arg) { @@ -3411,15 +3413,15 @@ gimp_image_raise_channel (GimpImage *gimage, return NULL; } -Channel * -gimp_image_lower_channel (GimpImage *gimage, - Channel *channel_arg) +GimpChannel * +gimp_image_lower_channel (GimpImage *gimage, + GimpChannel *channel_arg) { - Channel *channel; - Channel *next_channel; - GSList *list; - GSList *next; - gint index = 0; + GimpChannel *channel; + GimpChannel *next_channel; + GSList *list; + GSList *next; + gint index = 0; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3428,11 +3430,11 @@ gimp_image_lower_channel (GimpImage *gimage, while (list) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; next = g_slist_next (list); if (next) - next_channel = (Channel *) next->data; + next_channel = (GimpChannel *) next->data; index++; if (channel == channel_arg) @@ -3460,16 +3462,16 @@ gimp_image_lower_channel (GimpImage *gimage, return NULL; } -Channel * -gimp_image_position_channel (GimpImage *gimage, - Channel *channel_arg, - gint new_index) +GimpChannel * +gimp_image_position_channel (GimpImage *gimage, + GimpChannel *channel_arg, + gint new_index) { - Channel *channel; - GSList *list; - GSList *next; - gint index; - gint list_length; + GimpChannel *channel; + GSList *list; + GSList *next; + gint index; + gint list_length; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3481,7 +3483,7 @@ gimp_image_position_channel (GimpImage *gimage, list; list = g_slist_next (list), index++) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; if (channel == channel_arg) { break; @@ -3513,10 +3515,10 @@ gimp_image_position_channel (GimpImage *gimage, return channel; } -Channel * -gimp_image_add_channel (GimpImage *gimage, - Channel *channel, - gint position) +GimpChannel * +gimp_image_add_channel (GimpImage *gimage, + GimpChannel *channel, + gint position) { ChannelUndo *cu; GSList *cc; @@ -3564,9 +3566,9 @@ gimp_image_add_channel (GimpImage *gimage, return channel; } -Channel * -gimp_image_remove_channel (GimpImage *gimage, - Channel *channel) +GimpChannel * +gimp_image_remove_channel (GimpImage *gimage, + GimpChannel *channel) { ChannelUndo *cu; @@ -3584,7 +3586,7 @@ gimp_image_remove_channel (GimpImage *gimage, if (gimage->active_channel == channel) { if (gimage->channels) - gimage->active_channel = (((Channel *) gimage->channels->data)); + gimage->active_channel = (((GimpChannel *) gimage->channels->data)); else gimage->active_channel = NULL; } diff --git a/app/core/gimpimage-scale.h b/app/core/gimpimage-scale.h index 356c35f17c..a71abc7029 100644 --- a/app/core/gimpimage-scale.h +++ b/app/core/gimpimage-scale.h @@ -86,9 +86,9 @@ struct _GimpImage GSList *layer_stack; /* the layers in MRU order */ GimpLayer *active_layer; /* ID of active layer */ - Channel *active_channel; /* ID of active channel */ + GimpChannel *active_channel; /* ID of active channel */ GimpLayer *floating_sel; /* ID of fs layer */ - Channel *selection_mask; /* selection mask channel */ + GimpChannel *selection_mask; /* selection mask channel */ ParasiteList *parasites; /* Plug-in parasite data */ @@ -282,91 +282,91 @@ void gimp_image_colormap_changed (const GimpImage *image, /* layer/channel functions */ -gint gimp_image_get_layer_index (const GimpImage *gimage, - const GimpLayer *layer_arg); -GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, - gint layer_index); -gint gimp_image_get_channel_index (const GimpImage *gimage, - const Channel *channel_arg); -GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); -Channel * gimp_image_get_active_channel (const GimpImage *gimage); -GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); -Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); -Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, - const gchar *name); -Channel * gimp_image_get_mask (const GimpImage *gimage); -gboolean gimp_image_get_component_active (const GimpImage *gimage, - ChannelType type); -gboolean gimp_image_get_component_visible (const GimpImage *gimage, - ChannelType type); -gboolean gimp_image_layer_boundary (const GimpImage *gimage, - BoundSeg **segs, - gint *n_segs); -GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, - GimpLayer *layer); -Channel * gimp_image_set_active_channel (GimpImage *gimage, - Channel *channel); -Channel * gimp_image_unset_active_channel (GimpImage *gimage); -void gimp_image_set_component_active (GimpImage *gimage, - ChannelType type, - gboolean active); -void gimp_image_set_component_visible (GimpImage *gimage, - ChannelType type, - gboolean visible); -GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage, - gint x, - gint y); -GimpLayer * gimp_image_raise_layer (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_lower_layer (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_position_layer (GimpImage *gimage, - GimpLayer *layer_arg, - gint new_index, - gboolean push_undo); -GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage, - MergeType merge_type); -GimpLayer * gimp_image_merge_down (GimpImage *gimage, - GimpLayer *current_layer, - MergeType merge_type); -GimpLayer * gimp_image_flatten (GimpImage *gimage); -GimpLayer * gimp_image_merge_layers (GimpImage *gimage, - GSList *merge_list, - MergeType merge_type); -GimpLayer * gimp_image_add_layer (GimpImage *gimage, - GimpLayer *float_layer, - gint position); -GimpLayer * gimp_image_remove_layer (GimpImage *gimage, - GimpLayer *layer); -GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, - GimpLayer *layer, - GimpLayerMask *mask); -Channel * gimp_image_remove_layer_mask (GimpImage *gimage, - GimpLayer *layer, - MaskApplyMode mode); -Channel * gimp_image_raise_channel (GimpImage *gimage, - Channel *channel_arg); -Channel * gimp_image_lower_channel (GimpImage *gimage, - Channel *channel_arg); -Channel * gimp_image_position_channel (GimpImage *gimage, - Channel *channel_arg, - gint position); -Channel * gimp_image_add_channel (GimpImage *gimage, - Channel *channel, - gint position); -Channel * gimp_image_remove_channel (GimpImage *gimage, - Channel *channel); -void gimp_image_construct (GimpImage *gimage, - gint x, - gint y, - gint w, - gint h); +gint gimp_image_get_layer_index (const GimpImage *gimage, + const GimpLayer *layer_arg); +GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, + gint layer_index); +gint gimp_image_get_channel_index (const GimpImage *gimage, + const GimpChannel *channel_arg); +GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); +GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage); +GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, + Tattoo tatoo); +GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, + Tattoo tatoo); +GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, + const gchar *name); +GimpChannel * gimp_image_get_mask (const GimpImage *gimage); +gboolean gimp_image_get_component_active (const GimpImage *gimage, + ChannelType type); +gboolean gimp_image_get_component_visible (const GimpImage *gimage, + ChannelType type); +gboolean gimp_image_layer_boundary (const GimpImage *gimage, + BoundSeg **segs, + gint *n_segs); +GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, + GimpLayer *layer); +GimpChannel * gimp_image_set_active_channel (GimpImage *gimage, + GimpChannel *channel); +GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage); +void gimp_image_set_component_active (GimpImage *gimage, + ChannelType type, + gboolean active); +void gimp_image_set_component_visible (GimpImage *gimage, + ChannelType type, + gboolean visible); +GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage, + gint x, + gint y); +GimpLayer * gimp_image_raise_layer (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_lower_layer (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_position_layer (GimpImage *gimage, + GimpLayer *layer_arg, + gint new_index, + gboolean push_undo); +GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage, + MergeType merge_type); +GimpLayer * gimp_image_merge_down (GimpImage *gimage, + GimpLayer *current_layer, + MergeType merge_type); +GimpLayer * gimp_image_flatten (GimpImage *gimage); +GimpLayer * gimp_image_merge_layers (GimpImage *gimage, + GSList *merge_list, + MergeType merge_type); +GimpLayer * gimp_image_add_layer (GimpImage *gimage, + GimpLayer *float_layer, + gint position); +GimpLayer * gimp_image_remove_layer (GimpImage *gimage, + GimpLayer *layer); +GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, + GimpLayer *layer, + GimpLayerMask *mask); +GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage, + GimpLayer *layer, + MaskApplyMode mode); +GimpChannel * gimp_image_raise_channel (GimpImage *gimage, + GimpChannel *channel_arg); +GimpChannel * gimp_image_lower_channel (GimpImage *gimage, + GimpChannel *channel_arg); +GimpChannel * gimp_image_position_channel (GimpImage *gimage, + GimpChannel *channel_arg, + gint position); +GimpChannel * gimp_image_add_channel (GimpImage *gimage, + GimpChannel *channel, + gint position); +GimpChannel * gimp_image_remove_channel (GimpImage *gimage, + GimpChannel *channel); +void gimp_image_construct (GimpImage *gimage, + gint x, + gint y, + gint w, + gint h); void gimp_image_invalidate_without_render (GimpImage *gimage, diff --git a/app/core/gimpimage-undo-push.c b/app/core/gimpimage-undo-push.c index 9e0c7f9556..98d2614696 100644 --- a/app/core/gimpimage-undo-push.c +++ b/app/core/gimpimage-undo-push.c @@ -162,14 +162,14 @@ static void undo_free_cantundo (UndoState, UndoType, gpointer); /* Sizing functions */ -static gint layer_size (GimpLayer *layer); -static gint channel_size (Channel *channel); +static gint layer_size (GimpLayer *layer); +static gint channel_size (GimpChannel *channel); -static const gchar * undo_type_to_name (UndoType undo_type); +static const gchar * undo_type_to_name (UndoType undo_type); -static Undo * undo_new (UndoType undo_type, - glong size, - gboolean dirties_image); +static Undo * undo_new (UndoType undo_type, + glong size, + gboolean dirties_image); static gboolean shrink_wrap = FALSE; @@ -194,12 +194,12 @@ layer_size (GimpLayer *layer) static gint -channel_size (Channel *channel) +channel_size (GimpChannel *channel) { gint size; size = - sizeof (Channel) + + sizeof (GimpChannel) + GIMP_DRAWABLE (channel)->width * GIMP_DRAWABLE (channel)->height + strlen (GIMP_OBJECT (channel)->name); @@ -1027,7 +1027,7 @@ undo_pop_mask (GimpImage *gimage, { MaskUndo *mask_undo; TileManager *new_tiles; - Channel *sel_mask; + GimpChannel *sel_mask; PixelRegion srcPR, destPR; gint selection; gint x1, y1, x2, y2; @@ -1040,7 +1040,7 @@ undo_pop_mask (GimpImage *gimage, /* save current selection mask */ sel_mask = gimp_image_get_mask (gimage); - selection = channel_bounds (sel_mask, &x1, &y1, &x2, &y2); + selection = gimp_channel_bounds (sel_mask, &x1, &y1, &x2, &y2); pixel_region_init (&srcPR, GIMP_DRAWABLE (sel_mask)->tiles, x1, y1, (x2 - x1), (y2 - y1), FALSE); @@ -1886,13 +1886,13 @@ gboolean undo_push_channel_mod (GimpImage *gimage, gpointer channel_ptr) { - Channel *channel; + GimpChannel *channel; TileManager *tiles; Undo *new; gpointer *data; gint size; - channel = (Channel *) channel_ptr; + channel = (GimpChannel *) channel_ptr; tiles = GIMP_DRAWABLE (channel)->tiles; size = GIMP_DRAWABLE (channel)->width * GIMP_DRAWABLE (channel)->height + @@ -1927,10 +1927,10 @@ undo_pop_channel_mod (GimpImage *gimage, gpointer *data; TileManager *tiles; TileManager *temp; - Channel *channel; + GimpChannel *channel; data = (gpointer *) data_ptr; - channel = (Channel *) data[0]; + channel = (GimpChannel *) data[0]; tiles = (TileManager *) data[1]; diff --git a/app/core/gimpimage-undo-push.h b/app/core/gimpimage-undo-push.h index b92893c8c0..12791b251a 100644 --- a/app/core/gimpimage-undo-push.h +++ b/app/core/gimpimage-undo-push.h @@ -111,12 +111,6 @@ void undo_map_over_redo_stack (GImage *gimage, UndoType undo_get_undo_top_type (GImage *gimage); -/* Not really appropriate here, since undo_history_new is not defined - * in undo.c, but it saves on having a full header file for just one - * function prototype. */ -GtkWidget *undo_history_new (GImage *gimage); - - /* Argument to undo_event signal emitted by gimages: */ typedef enum { diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c index a733e7d312..7de7193350 100644 --- a/app/core/gimpimage.c +++ b/app/core/gimpimage.c @@ -113,7 +113,7 @@ static void project_indexed_alpha (GimpImage *gimage, PixelRegion *dest, PixelRegion *mask); static void project_channel (GimpImage *gimage, - Channel *layer, + GimpChannel *channel, PixelRegion *src, PixelRegion *src2); @@ -437,8 +437,9 @@ gimp_image_new (gint width, } /* create the selection mask */ - gimage->selection_mask = channel_new_mask (gimage, - gimage->width, gimage->height); + gimage->selection_mask = gimp_channel_new_mask (gimage, + gimage->width, + gimage->height); return gimage; @@ -552,11 +553,11 @@ gimp_image_resize (GimpImage *gimage, gint offset_x, gint offset_y) { - Channel *channel; - GimpLayer *layer; - GimpLayer *floating_layer; - GSList *list; - GList *guide_list; + GimpChannel *channel; + GimpLayer *layer; + GimpLayer *floating_layer; + GSList *list; + GList *guide_list; gimp_add_busy_cursors (); @@ -581,9 +582,9 @@ gimp_image_resize (GimpImage *gimage, /* Resize all channels */ for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; - channel_resize (channel, new_width, new_height, offset_x, offset_y); + gimp_channel_resize (channel, new_width, new_height, offset_x, offset_y); } /* Reposition or remove any guides */ @@ -617,8 +618,8 @@ gimp_image_resize (GimpImage *gimage, } /* Don't forget the selection mask! */ - channel_resize (gimage->selection_mask, - new_width, new_height, offset_x, offset_y); + gimp_channel_resize (gimage->selection_mask, + new_width, new_height, offset_x, offset_y); gimage_mask_invalidate (gimage); /* Reposition all layers */ @@ -646,17 +647,17 @@ gimp_image_scale (GimpImage *gimage, gint new_width, gint new_height) { - Channel *channel; - GimpLayer *layer; - GimpLayer *floating_layer; - GSList *list; - GSList *remove = NULL; - GList *glist; - Guide *guide; - gint old_width; - gint old_height; - gdouble img_scale_w = 1.0; - gdouble img_scale_h = 1.0; + GimpChannel *channel; + GimpLayer *layer; + GimpLayer *floating_layer; + GSList *list; + GSList *remove = NULL; + GList *glist; + Guide *guide; + gint old_width; + gint old_height; + gdouble img_scale_w = 1.0; + gdouble img_scale_h = 1.0; if ((new_width == 0) || (new_height == 0)) { @@ -690,17 +691,18 @@ gimp_image_scale (GimpImage *gimage, /* Scale all channels */ for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; - channel_scale (channel, new_width, new_height); + channel = (GimpChannel *) list->data; + + gimp_channel_scale (channel, new_width, new_height); } /* Don't forget the selection mask! */ /* if (channel_is_empty(gimage->selection_mask)) - channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) + gimp_channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) else */ - channel_scale (gimage->selection_mask, new_width, new_height); + gimp_channel_scale (gimage->selection_mask, new_width, new_height); gimage_mask_invalidate (gimage); /* Scale all layers */ @@ -827,7 +829,7 @@ gimp_image_apply_image (GimpImage *gimage, gint x, gint y) { - Channel *mask; + GimpChannel *mask; gint x1, y1, x2, y2; gint offset_x, offset_y; PixelRegion src1PR, destPR, maskPR; @@ -932,7 +934,7 @@ gimp_image_replace_image (GimpImage *gimage, gint x, gint y) { - Channel *mask; + GimpChannel *mask; gint x1, y1, x2, y2; gint offset_x, offset_y; PixelRegion src1PR, destPR; @@ -1374,14 +1376,14 @@ gboolean gimp_image_set_tattoo_state (GimpImage *gimage, Tattoo val) { - GimpLayer *layer; - GSList *layers; - gboolean retval = TRUE; - Channel *channel; - GSList *channels; - Tattoo maxval = 0; - Path *pptr = NULL; - PathList *plist; + GimpLayer *layer; + GSList *layers; + gboolean retval = TRUE; + GimpChannel *channel; + GSList *channels; + Tattoo maxval = 0; + Path *pptr = NULL; + PathList *plist; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); @@ -1411,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, channels = g_slist_next (channels)) { Tattoo ctattoo; - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); if (ctattoo > maxval) @@ -1544,7 +1546,7 @@ project_indexed_alpha (GimpImage *gimage, static void project_channel (GimpImage *gimage, - Channel *channel, + GimpChannel *channel, PixelRegion *src, PixelRegion *src2) { @@ -1598,12 +1600,12 @@ gimp_image_free_layers (GimpImage *gimage) static void gimp_image_free_channels (GimpImage *gimage) { - GSList *list; - Channel *channel; + GSList *list; + GimpChannel *channel; for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; gtk_object_unref (GTK_OBJECT (channel)); } @@ -1760,7 +1762,7 @@ gimp_image_construct_channels (GimpImage *gimage, gint w, gint h) { - Channel *channel; + GimpChannel *channel; PixelRegion src1PR; PixelRegion src2PR; GSList *list; @@ -1772,7 +1774,7 @@ gimp_image_construct_channels (GimpImage *gimage, while (reverse_list) { - channel = (Channel *) reverse_list->data; + channel = (GimpChannel *) reverse_list->data; if (gimp_drawable_visible (GIMP_DRAWABLE (channel))) { @@ -2121,15 +2123,15 @@ gimp_image_invalidate_layer_previews (GimpImage *gimage) void gimp_image_invalidate_channel_previews (GimpImage *gimage) { - GSList *tmp; - Channel *channel; + GSList *tmp; + GimpChannel *channel; g_return_if_fail (gimage != NULL); g_return_if_fail (GIMP_IS_IMAGE (gimage)); for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp)) { - channel = (Channel *) tmp->data; + channel = (GimpChannel *) tmp->data; gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE); } @@ -2173,12 +2175,12 @@ gimp_image_get_layer_by_index (const GimpImage *gimage, } gint -gimp_image_get_channel_index (const GimpImage *gimage, - const Channel *channel_arg) +gimp_image_get_channel_index (const GimpImage *gimage, + const GimpChannel *channel_arg) { - Channel *channel; - GSList *channels; - gint index; + GimpChannel *channel; + GSList *channels; + gint index; g_return_val_if_fail (gimage != NULL, -1); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), -1); @@ -2187,7 +2189,7 @@ gimp_image_get_channel_index (const GimpImage *gimage, channels; channels = g_slist_next (channels), index++) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (channel == channel_arg) return index; @@ -2205,7 +2207,7 @@ gimp_image_get_active_layer (const GimpImage *gimage) return gimage->active_layer; } -Channel * +GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2235,12 +2237,12 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, Tattoo tattoo) { - Channel *channel; - GSList *channels; + GimpChannel *channel; + GSList *channels; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2248,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, channels; channels = g_slist_next (channels)) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) return channel; @@ -2257,12 +2259,12 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, const gchar *name) { - Channel *channel; - GSList *channels; + GimpChannel *channel; + GSList *channels; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2270,7 +2272,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage, channels; channels = g_slist_next (channels)) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name)) return channel; } @@ -2278,7 +2280,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_mask (const GimpImage *gimage) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2380,9 +2382,9 @@ gimp_image_set_active_layer (GimpImage *gimage, return layer; } -Channel * -gimp_image_set_active_channel (GimpImage *gimage, - Channel *channel) +GimpChannel * +gimp_image_set_active_channel (GimpImage *gimage, + GimpChannel *channel) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2400,7 +2402,7 @@ gimp_image_set_active_channel (GimpImage *gimage, gimage->active_channel = NULL; return NULL; } - channel = (Channel *) gimage->channels->data; + channel = (GimpChannel *) gimage->channels->data; } /* Set the active channel */ @@ -2410,10 +2412,10 @@ gimp_image_set_active_channel (GimpImage *gimage, return channel; } -Channel * +GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage) { - Channel *channel; + GimpChannel *channel; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3308,7 +3310,7 @@ gimp_image_add_layer_mask (GimpImage *gimage, return mask; } -Channel * +GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage, GimpLayer *layer, MaskApplyMode mode) @@ -3362,15 +3364,15 @@ gimp_image_remove_layer_mask (GimpImage *gimage, return NULL; } -Channel * -gimp_image_raise_channel (GimpImage *gimage, - Channel *channel_arg) +GimpChannel * +gimp_image_raise_channel (GimpImage *gimage, + GimpChannel *channel_arg) { - Channel *channel; - Channel *prev_channel; - GSList *list; - GSList *prev; - gint index = -1; + GimpChannel *channel; + GimpChannel *prev_channel; + GSList *list; + GSList *prev; + gint index = -1; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3380,9 +3382,9 @@ gimp_image_raise_channel (GimpImage *gimage, while (list) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; if (prev) - prev_channel = (Channel *) prev->data; + prev_channel = (GimpChannel *) prev->data; if (channel == channel_arg) { @@ -3411,15 +3413,15 @@ gimp_image_raise_channel (GimpImage *gimage, return NULL; } -Channel * -gimp_image_lower_channel (GimpImage *gimage, - Channel *channel_arg) +GimpChannel * +gimp_image_lower_channel (GimpImage *gimage, + GimpChannel *channel_arg) { - Channel *channel; - Channel *next_channel; - GSList *list; - GSList *next; - gint index = 0; + GimpChannel *channel; + GimpChannel *next_channel; + GSList *list; + GSList *next; + gint index = 0; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3428,11 +3430,11 @@ gimp_image_lower_channel (GimpImage *gimage, while (list) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; next = g_slist_next (list); if (next) - next_channel = (Channel *) next->data; + next_channel = (GimpChannel *) next->data; index++; if (channel == channel_arg) @@ -3460,16 +3462,16 @@ gimp_image_lower_channel (GimpImage *gimage, return NULL; } -Channel * -gimp_image_position_channel (GimpImage *gimage, - Channel *channel_arg, - gint new_index) +GimpChannel * +gimp_image_position_channel (GimpImage *gimage, + GimpChannel *channel_arg, + gint new_index) { - Channel *channel; - GSList *list; - GSList *next; - gint index; - gint list_length; + GimpChannel *channel; + GSList *list; + GSList *next; + gint index; + gint list_length; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3481,7 +3483,7 @@ gimp_image_position_channel (GimpImage *gimage, list; list = g_slist_next (list), index++) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; if (channel == channel_arg) { break; @@ -3513,10 +3515,10 @@ gimp_image_position_channel (GimpImage *gimage, return channel; } -Channel * -gimp_image_add_channel (GimpImage *gimage, - Channel *channel, - gint position) +GimpChannel * +gimp_image_add_channel (GimpImage *gimage, + GimpChannel *channel, + gint position) { ChannelUndo *cu; GSList *cc; @@ -3564,9 +3566,9 @@ gimp_image_add_channel (GimpImage *gimage, return channel; } -Channel * -gimp_image_remove_channel (GimpImage *gimage, - Channel *channel) +GimpChannel * +gimp_image_remove_channel (GimpImage *gimage, + GimpChannel *channel) { ChannelUndo *cu; @@ -3584,7 +3586,7 @@ gimp_image_remove_channel (GimpImage *gimage, if (gimage->active_channel == channel) { if (gimage->channels) - gimage->active_channel = (((Channel *) gimage->channels->data)); + gimage->active_channel = (((GimpChannel *) gimage->channels->data)); else gimage->active_channel = NULL; } diff --git a/app/core/gimpimage.h b/app/core/gimpimage.h index 356c35f17c..a71abc7029 100644 --- a/app/core/gimpimage.h +++ b/app/core/gimpimage.h @@ -86,9 +86,9 @@ struct _GimpImage GSList *layer_stack; /* the layers in MRU order */ GimpLayer *active_layer; /* ID of active layer */ - Channel *active_channel; /* ID of active channel */ + GimpChannel *active_channel; /* ID of active channel */ GimpLayer *floating_sel; /* ID of fs layer */ - Channel *selection_mask; /* selection mask channel */ + GimpChannel *selection_mask; /* selection mask channel */ ParasiteList *parasites; /* Plug-in parasite data */ @@ -282,91 +282,91 @@ void gimp_image_colormap_changed (const GimpImage *image, /* layer/channel functions */ -gint gimp_image_get_layer_index (const GimpImage *gimage, - const GimpLayer *layer_arg); -GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, - gint layer_index); -gint gimp_image_get_channel_index (const GimpImage *gimage, - const Channel *channel_arg); -GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); -Channel * gimp_image_get_active_channel (const GimpImage *gimage); -GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); -Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); -Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, - const gchar *name); -Channel * gimp_image_get_mask (const GimpImage *gimage); -gboolean gimp_image_get_component_active (const GimpImage *gimage, - ChannelType type); -gboolean gimp_image_get_component_visible (const GimpImage *gimage, - ChannelType type); -gboolean gimp_image_layer_boundary (const GimpImage *gimage, - BoundSeg **segs, - gint *n_segs); -GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, - GimpLayer *layer); -Channel * gimp_image_set_active_channel (GimpImage *gimage, - Channel *channel); -Channel * gimp_image_unset_active_channel (GimpImage *gimage); -void gimp_image_set_component_active (GimpImage *gimage, - ChannelType type, - gboolean active); -void gimp_image_set_component_visible (GimpImage *gimage, - ChannelType type, - gboolean visible); -GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage, - gint x, - gint y); -GimpLayer * gimp_image_raise_layer (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_lower_layer (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_position_layer (GimpImage *gimage, - GimpLayer *layer_arg, - gint new_index, - gboolean push_undo); -GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage, - MergeType merge_type); -GimpLayer * gimp_image_merge_down (GimpImage *gimage, - GimpLayer *current_layer, - MergeType merge_type); -GimpLayer * gimp_image_flatten (GimpImage *gimage); -GimpLayer * gimp_image_merge_layers (GimpImage *gimage, - GSList *merge_list, - MergeType merge_type); -GimpLayer * gimp_image_add_layer (GimpImage *gimage, - GimpLayer *float_layer, - gint position); -GimpLayer * gimp_image_remove_layer (GimpImage *gimage, - GimpLayer *layer); -GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, - GimpLayer *layer, - GimpLayerMask *mask); -Channel * gimp_image_remove_layer_mask (GimpImage *gimage, - GimpLayer *layer, - MaskApplyMode mode); -Channel * gimp_image_raise_channel (GimpImage *gimage, - Channel *channel_arg); -Channel * gimp_image_lower_channel (GimpImage *gimage, - Channel *channel_arg); -Channel * gimp_image_position_channel (GimpImage *gimage, - Channel *channel_arg, - gint position); -Channel * gimp_image_add_channel (GimpImage *gimage, - Channel *channel, - gint position); -Channel * gimp_image_remove_channel (GimpImage *gimage, - Channel *channel); -void gimp_image_construct (GimpImage *gimage, - gint x, - gint y, - gint w, - gint h); +gint gimp_image_get_layer_index (const GimpImage *gimage, + const GimpLayer *layer_arg); +GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, + gint layer_index); +gint gimp_image_get_channel_index (const GimpImage *gimage, + const GimpChannel *channel_arg); +GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); +GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage); +GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, + Tattoo tatoo); +GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, + Tattoo tatoo); +GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, + const gchar *name); +GimpChannel * gimp_image_get_mask (const GimpImage *gimage); +gboolean gimp_image_get_component_active (const GimpImage *gimage, + ChannelType type); +gboolean gimp_image_get_component_visible (const GimpImage *gimage, + ChannelType type); +gboolean gimp_image_layer_boundary (const GimpImage *gimage, + BoundSeg **segs, + gint *n_segs); +GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, + GimpLayer *layer); +GimpChannel * gimp_image_set_active_channel (GimpImage *gimage, + GimpChannel *channel); +GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage); +void gimp_image_set_component_active (GimpImage *gimage, + ChannelType type, + gboolean active); +void gimp_image_set_component_visible (GimpImage *gimage, + ChannelType type, + gboolean visible); +GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage, + gint x, + gint y); +GimpLayer * gimp_image_raise_layer (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_lower_layer (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_position_layer (GimpImage *gimage, + GimpLayer *layer_arg, + gint new_index, + gboolean push_undo); +GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage, + MergeType merge_type); +GimpLayer * gimp_image_merge_down (GimpImage *gimage, + GimpLayer *current_layer, + MergeType merge_type); +GimpLayer * gimp_image_flatten (GimpImage *gimage); +GimpLayer * gimp_image_merge_layers (GimpImage *gimage, + GSList *merge_list, + MergeType merge_type); +GimpLayer * gimp_image_add_layer (GimpImage *gimage, + GimpLayer *float_layer, + gint position); +GimpLayer * gimp_image_remove_layer (GimpImage *gimage, + GimpLayer *layer); +GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, + GimpLayer *layer, + GimpLayerMask *mask); +GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage, + GimpLayer *layer, + MaskApplyMode mode); +GimpChannel * gimp_image_raise_channel (GimpImage *gimage, + GimpChannel *channel_arg); +GimpChannel * gimp_image_lower_channel (GimpImage *gimage, + GimpChannel *channel_arg); +GimpChannel * gimp_image_position_channel (GimpImage *gimage, + GimpChannel *channel_arg, + gint position); +GimpChannel * gimp_image_add_channel (GimpImage *gimage, + GimpChannel *channel, + gint position); +GimpChannel * gimp_image_remove_channel (GimpImage *gimage, + GimpChannel *channel); +void gimp_image_construct (GimpImage *gimage, + gint x, + gint y, + gint w, + gint h); void gimp_image_invalidate_without_render (GimpImage *gimage, diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c index b8d09c1881..06fdf11ace 100644 --- a/app/core/gimplayer.c +++ b/app/core/gimplayer.c @@ -742,7 +742,7 @@ gimp_layer_scale_lowlevel (GimpLayer *layer, { GIMP_DRAWABLE (layer->mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x; GIMP_DRAWABLE (layer->mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y; - channel_scale (GIMP_CHANNEL (layer->mask), new_width, new_height); + gimp_channel_scale (GIMP_CHANNEL (layer->mask), new_width, new_height); } /* Make sure we're not caching any old selection info */ @@ -1016,8 +1016,8 @@ gimp_layer_resize (GimpLayer *layer, { GIMP_DRAWABLE (layer->mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x; GIMP_DRAWABLE (layer->mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y; - channel_resize (GIMP_CHANNEL (layer->mask), - new_width, new_height, offx, offy); + gimp_channel_resize (GIMP_CHANNEL (layer->mask), + new_width, new_height, offx, offy); } /* Make sure we're not caching any old selection info */ @@ -1114,8 +1114,8 @@ gimp_layer_boundary (GimpLayer *layer, void gimp_layer_invalidate_boundary (GimpLayer *layer) { - GimpImage *gimage; - Channel *mask; + GimpImage *gimage; + GimpChannel *mask; /* first get the selection mask channel */ if (! (gimage = gimp_drawable_gimage (GIMP_DRAWABLE (layer)))) @@ -1130,7 +1130,7 @@ gimp_layer_invalidate_boundary (GimpLayer *layer) mask = gimp_image_get_mask (gimage); /* Only bother with the bounds if there is a selection */ - if (! channel_is_empty (mask)) + if (! gimp_channel_is_empty (mask)) { mask->bounds_known = FALSE; mask->boundary_known = FALSE; diff --git a/app/core/gimpprojection-construct.c b/app/core/gimpprojection-construct.c index a733e7d312..7de7193350 100644 --- a/app/core/gimpprojection-construct.c +++ b/app/core/gimpprojection-construct.c @@ -113,7 +113,7 @@ static void project_indexed_alpha (GimpImage *gimage, PixelRegion *dest, PixelRegion *mask); static void project_channel (GimpImage *gimage, - Channel *layer, + GimpChannel *channel, PixelRegion *src, PixelRegion *src2); @@ -437,8 +437,9 @@ gimp_image_new (gint width, } /* create the selection mask */ - gimage->selection_mask = channel_new_mask (gimage, - gimage->width, gimage->height); + gimage->selection_mask = gimp_channel_new_mask (gimage, + gimage->width, + gimage->height); return gimage; @@ -552,11 +553,11 @@ gimp_image_resize (GimpImage *gimage, gint offset_x, gint offset_y) { - Channel *channel; - GimpLayer *layer; - GimpLayer *floating_layer; - GSList *list; - GList *guide_list; + GimpChannel *channel; + GimpLayer *layer; + GimpLayer *floating_layer; + GSList *list; + GList *guide_list; gimp_add_busy_cursors (); @@ -581,9 +582,9 @@ gimp_image_resize (GimpImage *gimage, /* Resize all channels */ for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; - channel_resize (channel, new_width, new_height, offset_x, offset_y); + gimp_channel_resize (channel, new_width, new_height, offset_x, offset_y); } /* Reposition or remove any guides */ @@ -617,8 +618,8 @@ gimp_image_resize (GimpImage *gimage, } /* Don't forget the selection mask! */ - channel_resize (gimage->selection_mask, - new_width, new_height, offset_x, offset_y); + gimp_channel_resize (gimage->selection_mask, + new_width, new_height, offset_x, offset_y); gimage_mask_invalidate (gimage); /* Reposition all layers */ @@ -646,17 +647,17 @@ gimp_image_scale (GimpImage *gimage, gint new_width, gint new_height) { - Channel *channel; - GimpLayer *layer; - GimpLayer *floating_layer; - GSList *list; - GSList *remove = NULL; - GList *glist; - Guide *guide; - gint old_width; - gint old_height; - gdouble img_scale_w = 1.0; - gdouble img_scale_h = 1.0; + GimpChannel *channel; + GimpLayer *layer; + GimpLayer *floating_layer; + GSList *list; + GSList *remove = NULL; + GList *glist; + Guide *guide; + gint old_width; + gint old_height; + gdouble img_scale_w = 1.0; + gdouble img_scale_h = 1.0; if ((new_width == 0) || (new_height == 0)) { @@ -690,17 +691,18 @@ gimp_image_scale (GimpImage *gimage, /* Scale all channels */ for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; - channel_scale (channel, new_width, new_height); + channel = (GimpChannel *) list->data; + + gimp_channel_scale (channel, new_width, new_height); } /* Don't forget the selection mask! */ /* if (channel_is_empty(gimage->selection_mask)) - channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) + gimp_channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) else */ - channel_scale (gimage->selection_mask, new_width, new_height); + gimp_channel_scale (gimage->selection_mask, new_width, new_height); gimage_mask_invalidate (gimage); /* Scale all layers */ @@ -827,7 +829,7 @@ gimp_image_apply_image (GimpImage *gimage, gint x, gint y) { - Channel *mask; + GimpChannel *mask; gint x1, y1, x2, y2; gint offset_x, offset_y; PixelRegion src1PR, destPR, maskPR; @@ -932,7 +934,7 @@ gimp_image_replace_image (GimpImage *gimage, gint x, gint y) { - Channel *mask; + GimpChannel *mask; gint x1, y1, x2, y2; gint offset_x, offset_y; PixelRegion src1PR, destPR; @@ -1374,14 +1376,14 @@ gboolean gimp_image_set_tattoo_state (GimpImage *gimage, Tattoo val) { - GimpLayer *layer; - GSList *layers; - gboolean retval = TRUE; - Channel *channel; - GSList *channels; - Tattoo maxval = 0; - Path *pptr = NULL; - PathList *plist; + GimpLayer *layer; + GSList *layers; + gboolean retval = TRUE; + GimpChannel *channel; + GSList *channels; + Tattoo maxval = 0; + Path *pptr = NULL; + PathList *plist; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); @@ -1411,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, channels = g_slist_next (channels)) { Tattoo ctattoo; - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); if (ctattoo > maxval) @@ -1544,7 +1546,7 @@ project_indexed_alpha (GimpImage *gimage, static void project_channel (GimpImage *gimage, - Channel *channel, + GimpChannel *channel, PixelRegion *src, PixelRegion *src2) { @@ -1598,12 +1600,12 @@ gimp_image_free_layers (GimpImage *gimage) static void gimp_image_free_channels (GimpImage *gimage) { - GSList *list; - Channel *channel; + GSList *list; + GimpChannel *channel; for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; gtk_object_unref (GTK_OBJECT (channel)); } @@ -1760,7 +1762,7 @@ gimp_image_construct_channels (GimpImage *gimage, gint w, gint h) { - Channel *channel; + GimpChannel *channel; PixelRegion src1PR; PixelRegion src2PR; GSList *list; @@ -1772,7 +1774,7 @@ gimp_image_construct_channels (GimpImage *gimage, while (reverse_list) { - channel = (Channel *) reverse_list->data; + channel = (GimpChannel *) reverse_list->data; if (gimp_drawable_visible (GIMP_DRAWABLE (channel))) { @@ -2121,15 +2123,15 @@ gimp_image_invalidate_layer_previews (GimpImage *gimage) void gimp_image_invalidate_channel_previews (GimpImage *gimage) { - GSList *tmp; - Channel *channel; + GSList *tmp; + GimpChannel *channel; g_return_if_fail (gimage != NULL); g_return_if_fail (GIMP_IS_IMAGE (gimage)); for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp)) { - channel = (Channel *) tmp->data; + channel = (GimpChannel *) tmp->data; gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE); } @@ -2173,12 +2175,12 @@ gimp_image_get_layer_by_index (const GimpImage *gimage, } gint -gimp_image_get_channel_index (const GimpImage *gimage, - const Channel *channel_arg) +gimp_image_get_channel_index (const GimpImage *gimage, + const GimpChannel *channel_arg) { - Channel *channel; - GSList *channels; - gint index; + GimpChannel *channel; + GSList *channels; + gint index; g_return_val_if_fail (gimage != NULL, -1); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), -1); @@ -2187,7 +2189,7 @@ gimp_image_get_channel_index (const GimpImage *gimage, channels; channels = g_slist_next (channels), index++) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (channel == channel_arg) return index; @@ -2205,7 +2207,7 @@ gimp_image_get_active_layer (const GimpImage *gimage) return gimage->active_layer; } -Channel * +GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2235,12 +2237,12 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, Tattoo tattoo) { - Channel *channel; - GSList *channels; + GimpChannel *channel; + GSList *channels; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2248,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, channels; channels = g_slist_next (channels)) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) return channel; @@ -2257,12 +2259,12 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, const gchar *name) { - Channel *channel; - GSList *channels; + GimpChannel *channel; + GSList *channels; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2270,7 +2272,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage, channels; channels = g_slist_next (channels)) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name)) return channel; } @@ -2278,7 +2280,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_mask (const GimpImage *gimage) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2380,9 +2382,9 @@ gimp_image_set_active_layer (GimpImage *gimage, return layer; } -Channel * -gimp_image_set_active_channel (GimpImage *gimage, - Channel *channel) +GimpChannel * +gimp_image_set_active_channel (GimpImage *gimage, + GimpChannel *channel) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2400,7 +2402,7 @@ gimp_image_set_active_channel (GimpImage *gimage, gimage->active_channel = NULL; return NULL; } - channel = (Channel *) gimage->channels->data; + channel = (GimpChannel *) gimage->channels->data; } /* Set the active channel */ @@ -2410,10 +2412,10 @@ gimp_image_set_active_channel (GimpImage *gimage, return channel; } -Channel * +GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage) { - Channel *channel; + GimpChannel *channel; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3308,7 +3310,7 @@ gimp_image_add_layer_mask (GimpImage *gimage, return mask; } -Channel * +GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage, GimpLayer *layer, MaskApplyMode mode) @@ -3362,15 +3364,15 @@ gimp_image_remove_layer_mask (GimpImage *gimage, return NULL; } -Channel * -gimp_image_raise_channel (GimpImage *gimage, - Channel *channel_arg) +GimpChannel * +gimp_image_raise_channel (GimpImage *gimage, + GimpChannel *channel_arg) { - Channel *channel; - Channel *prev_channel; - GSList *list; - GSList *prev; - gint index = -1; + GimpChannel *channel; + GimpChannel *prev_channel; + GSList *list; + GSList *prev; + gint index = -1; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3380,9 +3382,9 @@ gimp_image_raise_channel (GimpImage *gimage, while (list) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; if (prev) - prev_channel = (Channel *) prev->data; + prev_channel = (GimpChannel *) prev->data; if (channel == channel_arg) { @@ -3411,15 +3413,15 @@ gimp_image_raise_channel (GimpImage *gimage, return NULL; } -Channel * -gimp_image_lower_channel (GimpImage *gimage, - Channel *channel_arg) +GimpChannel * +gimp_image_lower_channel (GimpImage *gimage, + GimpChannel *channel_arg) { - Channel *channel; - Channel *next_channel; - GSList *list; - GSList *next; - gint index = 0; + GimpChannel *channel; + GimpChannel *next_channel; + GSList *list; + GSList *next; + gint index = 0; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3428,11 +3430,11 @@ gimp_image_lower_channel (GimpImage *gimage, while (list) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; next = g_slist_next (list); if (next) - next_channel = (Channel *) next->data; + next_channel = (GimpChannel *) next->data; index++; if (channel == channel_arg) @@ -3460,16 +3462,16 @@ gimp_image_lower_channel (GimpImage *gimage, return NULL; } -Channel * -gimp_image_position_channel (GimpImage *gimage, - Channel *channel_arg, - gint new_index) +GimpChannel * +gimp_image_position_channel (GimpImage *gimage, + GimpChannel *channel_arg, + gint new_index) { - Channel *channel; - GSList *list; - GSList *next; - gint index; - gint list_length; + GimpChannel *channel; + GSList *list; + GSList *next; + gint index; + gint list_length; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3481,7 +3483,7 @@ gimp_image_position_channel (GimpImage *gimage, list; list = g_slist_next (list), index++) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; if (channel == channel_arg) { break; @@ -3513,10 +3515,10 @@ gimp_image_position_channel (GimpImage *gimage, return channel; } -Channel * -gimp_image_add_channel (GimpImage *gimage, - Channel *channel, - gint position) +GimpChannel * +gimp_image_add_channel (GimpImage *gimage, + GimpChannel *channel, + gint position) { ChannelUndo *cu; GSList *cc; @@ -3564,9 +3566,9 @@ gimp_image_add_channel (GimpImage *gimage, return channel; } -Channel * -gimp_image_remove_channel (GimpImage *gimage, - Channel *channel) +GimpChannel * +gimp_image_remove_channel (GimpImage *gimage, + GimpChannel *channel) { ChannelUndo *cu; @@ -3584,7 +3586,7 @@ gimp_image_remove_channel (GimpImage *gimage, if (gimage->active_channel == channel) { if (gimage->channels) - gimage->active_channel = (((Channel *) gimage->channels->data)); + gimage->active_channel = (((GimpChannel *) gimage->channels->data)); else gimage->active_channel = NULL; } diff --git a/app/core/gimpprojection-construct.h b/app/core/gimpprojection-construct.h index 356c35f17c..a71abc7029 100644 --- a/app/core/gimpprojection-construct.h +++ b/app/core/gimpprojection-construct.h @@ -86,9 +86,9 @@ struct _GimpImage GSList *layer_stack; /* the layers in MRU order */ GimpLayer *active_layer; /* ID of active layer */ - Channel *active_channel; /* ID of active channel */ + GimpChannel *active_channel; /* ID of active channel */ GimpLayer *floating_sel; /* ID of fs layer */ - Channel *selection_mask; /* selection mask channel */ + GimpChannel *selection_mask; /* selection mask channel */ ParasiteList *parasites; /* Plug-in parasite data */ @@ -282,91 +282,91 @@ void gimp_image_colormap_changed (const GimpImage *image, /* layer/channel functions */ -gint gimp_image_get_layer_index (const GimpImage *gimage, - const GimpLayer *layer_arg); -GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, - gint layer_index); -gint gimp_image_get_channel_index (const GimpImage *gimage, - const Channel *channel_arg); -GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); -Channel * gimp_image_get_active_channel (const GimpImage *gimage); -GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); -Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); -Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, - const gchar *name); -Channel * gimp_image_get_mask (const GimpImage *gimage); -gboolean gimp_image_get_component_active (const GimpImage *gimage, - ChannelType type); -gboolean gimp_image_get_component_visible (const GimpImage *gimage, - ChannelType type); -gboolean gimp_image_layer_boundary (const GimpImage *gimage, - BoundSeg **segs, - gint *n_segs); -GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, - GimpLayer *layer); -Channel * gimp_image_set_active_channel (GimpImage *gimage, - Channel *channel); -Channel * gimp_image_unset_active_channel (GimpImage *gimage); -void gimp_image_set_component_active (GimpImage *gimage, - ChannelType type, - gboolean active); -void gimp_image_set_component_visible (GimpImage *gimage, - ChannelType type, - gboolean visible); -GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage, - gint x, - gint y); -GimpLayer * gimp_image_raise_layer (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_lower_layer (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_position_layer (GimpImage *gimage, - GimpLayer *layer_arg, - gint new_index, - gboolean push_undo); -GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage, - MergeType merge_type); -GimpLayer * gimp_image_merge_down (GimpImage *gimage, - GimpLayer *current_layer, - MergeType merge_type); -GimpLayer * gimp_image_flatten (GimpImage *gimage); -GimpLayer * gimp_image_merge_layers (GimpImage *gimage, - GSList *merge_list, - MergeType merge_type); -GimpLayer * gimp_image_add_layer (GimpImage *gimage, - GimpLayer *float_layer, - gint position); -GimpLayer * gimp_image_remove_layer (GimpImage *gimage, - GimpLayer *layer); -GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, - GimpLayer *layer, - GimpLayerMask *mask); -Channel * gimp_image_remove_layer_mask (GimpImage *gimage, - GimpLayer *layer, - MaskApplyMode mode); -Channel * gimp_image_raise_channel (GimpImage *gimage, - Channel *channel_arg); -Channel * gimp_image_lower_channel (GimpImage *gimage, - Channel *channel_arg); -Channel * gimp_image_position_channel (GimpImage *gimage, - Channel *channel_arg, - gint position); -Channel * gimp_image_add_channel (GimpImage *gimage, - Channel *channel, - gint position); -Channel * gimp_image_remove_channel (GimpImage *gimage, - Channel *channel); -void gimp_image_construct (GimpImage *gimage, - gint x, - gint y, - gint w, - gint h); +gint gimp_image_get_layer_index (const GimpImage *gimage, + const GimpLayer *layer_arg); +GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, + gint layer_index); +gint gimp_image_get_channel_index (const GimpImage *gimage, + const GimpChannel *channel_arg); +GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); +GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage); +GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, + Tattoo tatoo); +GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, + Tattoo tatoo); +GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, + const gchar *name); +GimpChannel * gimp_image_get_mask (const GimpImage *gimage); +gboolean gimp_image_get_component_active (const GimpImage *gimage, + ChannelType type); +gboolean gimp_image_get_component_visible (const GimpImage *gimage, + ChannelType type); +gboolean gimp_image_layer_boundary (const GimpImage *gimage, + BoundSeg **segs, + gint *n_segs); +GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, + GimpLayer *layer); +GimpChannel * gimp_image_set_active_channel (GimpImage *gimage, + GimpChannel *channel); +GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage); +void gimp_image_set_component_active (GimpImage *gimage, + ChannelType type, + gboolean active); +void gimp_image_set_component_visible (GimpImage *gimage, + ChannelType type, + gboolean visible); +GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage, + gint x, + gint y); +GimpLayer * gimp_image_raise_layer (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_lower_layer (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_position_layer (GimpImage *gimage, + GimpLayer *layer_arg, + gint new_index, + gboolean push_undo); +GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage, + MergeType merge_type); +GimpLayer * gimp_image_merge_down (GimpImage *gimage, + GimpLayer *current_layer, + MergeType merge_type); +GimpLayer * gimp_image_flatten (GimpImage *gimage); +GimpLayer * gimp_image_merge_layers (GimpImage *gimage, + GSList *merge_list, + MergeType merge_type); +GimpLayer * gimp_image_add_layer (GimpImage *gimage, + GimpLayer *float_layer, + gint position); +GimpLayer * gimp_image_remove_layer (GimpImage *gimage, + GimpLayer *layer); +GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, + GimpLayer *layer, + GimpLayerMask *mask); +GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage, + GimpLayer *layer, + MaskApplyMode mode); +GimpChannel * gimp_image_raise_channel (GimpImage *gimage, + GimpChannel *channel_arg); +GimpChannel * gimp_image_lower_channel (GimpImage *gimage, + GimpChannel *channel_arg); +GimpChannel * gimp_image_position_channel (GimpImage *gimage, + GimpChannel *channel_arg, + gint position); +GimpChannel * gimp_image_add_channel (GimpImage *gimage, + GimpChannel *channel, + gint position); +GimpChannel * gimp_image_remove_channel (GimpImage *gimage, + GimpChannel *channel); +void gimp_image_construct (GimpImage *gimage, + gint x, + gint y, + gint w, + gint h); void gimp_image_invalidate_without_render (GimpImage *gimage, diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c index accb369588..d4b7944a43 100644 --- a/app/core/gimpprojection.c +++ b/app/core/gimpprojection.c @@ -1448,7 +1448,8 @@ gdisplay_mask_bounds (GDisplay *gdisp, { gimp_drawable_offsets (GIMP_DRAWABLE(layer), &off_x, &off_y); - if (! channel_bounds (gimp_image_get_mask (gdisp->gimage), x1, y1, x2, y2)) + if (! gimp_channel_bounds (gimp_image_get_mask (gdisp->gimage), + x1, y1, x2, y2)) { *x1 = off_x; *y1 = off_y; @@ -1463,7 +1464,8 @@ gdisplay_mask_bounds (GDisplay *gdisp, *y2 = MAX (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)), *y2); } } - else if (! channel_bounds (gimp_image_get_mask (gdisp->gimage), x1, y1, x2, y2)) + else if (! gimp_channel_bounds (gimp_image_get_mask (gdisp->gimage), + x1, y1, x2, y2)) return FALSE; gdisplay_transform_coords (gdisp, *x1, *y1, x1, y1, 0); diff --git a/app/core/gimpscanconvert.c b/app/core/gimpscanconvert.c index 32c0fab9b0..dead5cfe53 100644 --- a/app/core/gimpscanconvert.c +++ b/app/core/gimpscanconvert.c @@ -235,11 +235,11 @@ scan_converter_add_points (ScanConverter *sc, * according to the even-odd rule. The polygon is closed by * joining the final point to the initial point. */ -Channel * +GimpChannel * scan_converter_to_channel (ScanConverter *sc, GimpImage *gimage) { - Channel *mask; + GimpChannel *mask; GSList *list; PixelRegion maskPR; guint widtha; @@ -267,7 +267,7 @@ scan_converter_to_channel (ScanConverter *sc, (int) sc->first.y * antialias); } - mask = channel_new_mask (gimage, sc->width, sc->height); + mask = gimp_channel_new_mask (gimage, sc->width, sc->height); buf = g_new0 (guchar, sc->width); widtha = sc->width * antialias; @@ -320,7 +320,7 @@ scan_converter_to_channel (ScanConverter *sc, { if (antialias == 1) { - channel_add_segment (mask, x, i, w, 255); + gimp_channel_add_segment (mask, x, i, w, 255); } else { diff --git a/app/core/gimpscanconvert.h b/app/core/gimpscanconvert.h index df691179cd..f1bf8ac925 100644 --- a/app/core/gimpscanconvert.h +++ b/app/core/gimpscanconvert.h @@ -53,7 +53,7 @@ void scan_converter_add_points (ScanConverter *scan_converter, * according to the even-odd rule. The polygon is closed by * joining the final point to the initial point. */ -Channel * scan_converter_to_channel (ScanConverter *scan_converter, +GimpChannel * scan_converter_to_channel (ScanConverter *scan_converter, GimpImage *gimage); diff --git a/app/disp_callbacks.c b/app/disp_callbacks.c index f6226099e7..e145df5a39 100644 --- a/app/disp_callbacks.c +++ b/app/disp_callbacks.c @@ -753,15 +753,15 @@ gdisplay_drag_drop (GtkWidget *widget, { GimpDrawable *drawable = NULL; GimpLayer *layer = NULL; - Channel *channel = NULL; + GimpChannel *channel = NULL; GimpLayerMask *layer_mask = NULL; GimpImage *component = NULL; ChannelType component_type = -1; layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget), "gimp_layer"); - channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget), - "gimp_channel"); + channel = (GimpChannel *) gtk_object_get_data (GTK_OBJECT (src_widget), + "gimp_channel"); layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget), "gimp_layer_mask"); component = (GimpImage *) gtk_object_get_data (GTK_OBJECT (src_widget), diff --git a/app/display/gimpdisplay-callbacks.c b/app/display/gimpdisplay-callbacks.c index f6226099e7..e145df5a39 100644 --- a/app/display/gimpdisplay-callbacks.c +++ b/app/display/gimpdisplay-callbacks.c @@ -753,15 +753,15 @@ gdisplay_drag_drop (GtkWidget *widget, { GimpDrawable *drawable = NULL; GimpLayer *layer = NULL; - Channel *channel = NULL; + GimpChannel *channel = NULL; GimpLayerMask *layer_mask = NULL; GimpImage *component = NULL; ChannelType component_type = -1; layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget), "gimp_layer"); - channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget), - "gimp_channel"); + channel = (GimpChannel *) gtk_object_get_data (GTK_OBJECT (src_widget), + "gimp_channel"); layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget), "gimp_layer_mask"); component = (GimpImage *) gtk_object_get_data (GTK_OBJECT (src_widget), diff --git a/app/display/gimpdisplay.c b/app/display/gimpdisplay.c index accb369588..d4b7944a43 100644 --- a/app/display/gimpdisplay.c +++ b/app/display/gimpdisplay.c @@ -1448,7 +1448,8 @@ gdisplay_mask_bounds (GDisplay *gdisp, { gimp_drawable_offsets (GIMP_DRAWABLE(layer), &off_x, &off_y); - if (! channel_bounds (gimp_image_get_mask (gdisp->gimage), x1, y1, x2, y2)) + if (! gimp_channel_bounds (gimp_image_get_mask (gdisp->gimage), + x1, y1, x2, y2)) { *x1 = off_x; *y1 = off_y; @@ -1463,7 +1464,8 @@ gdisplay_mask_bounds (GDisplay *gdisp, *y2 = MAX (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)), *y2); } } - else if (! channel_bounds (gimp_image_get_mask (gdisp->gimage), x1, y1, x2, y2)) + else if (! gimp_channel_bounds (gimp_image_get_mask (gdisp->gimage), + x1, y1, x2, y2)) return FALSE; gdisplay_transform_coords (gdisp, *x1, *y1, x1, y1, 0); diff --git a/app/display/gimpdisplayshell-callbacks.c b/app/display/gimpdisplayshell-callbacks.c index f6226099e7..e145df5a39 100644 --- a/app/display/gimpdisplayshell-callbacks.c +++ b/app/display/gimpdisplayshell-callbacks.c @@ -753,15 +753,15 @@ gdisplay_drag_drop (GtkWidget *widget, { GimpDrawable *drawable = NULL; GimpLayer *layer = NULL; - Channel *channel = NULL; + GimpChannel *channel = NULL; GimpLayerMask *layer_mask = NULL; GimpImage *component = NULL; ChannelType component_type = -1; layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget), "gimp_layer"); - channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget), - "gimp_channel"); + channel = (GimpChannel *) gtk_object_get_data (GTK_OBJECT (src_widget), + "gimp_channel"); layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget), "gimp_layer_mask"); component = (GimpImage *) gtk_object_get_data (GTK_OBJECT (src_widget), diff --git a/app/display/gimpdisplayshell-qmask.c b/app/display/gimpdisplayshell-qmask.c index a7c594e558..3d078909c9 100644 --- a/app/display/gimpdisplayshell-qmask.c +++ b/app/display/gimpdisplayshell-qmask.c @@ -232,11 +232,11 @@ qmask_activate (GtkWidget *widget, floating_sel_to_layer (layer); } - gmask = channel_new (gimg, - gimg->width, - gimg->height, - "Qmask", - &color); + gmask = gimp_channel_new (gimg, + gimg->width, + gimg->height, + "Qmask", + &color); gimp_image_add_channel (gimg, gmask, 0); drawable_fill (GIMP_DRAWABLE (gmask), TRANSPARENT_FILL); } @@ -244,9 +244,9 @@ qmask_activate (GtkWidget *widget, { /* if selection */ - gmask = channel_copy (gimp_image_get_mask (gimg)); + gmask = gimp_channel_copy (gimp_image_get_mask (gimg)); gimp_image_add_channel (gimg, gmask, 0); - channel_set_color (gmask, &color); + gimp_channel_set_color (gmask, &color); gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask"); gimage_mask_none (gimg); /* Clear the selection */ } @@ -349,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget, gpointer data) { EditQmaskOptions *options; - Channel *channel; + GimpChannel *channel; GimpRGB color; options = (EditQmaskOptions *) data; @@ -364,7 +364,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget, if (gimp_rgba_distance (&color, &channel->color) > 0.0001) { channel->color = color; - channel_update (channel); + gimp_channel_update (channel); } } diff --git a/app/gdisplay.c b/app/gdisplay.c index accb369588..d4b7944a43 100644 --- a/app/gdisplay.c +++ b/app/gdisplay.c @@ -1448,7 +1448,8 @@ gdisplay_mask_bounds (GDisplay *gdisp, { gimp_drawable_offsets (GIMP_DRAWABLE(layer), &off_x, &off_y); - if (! channel_bounds (gimp_image_get_mask (gdisp->gimage), x1, y1, x2, y2)) + if (! gimp_channel_bounds (gimp_image_get_mask (gdisp->gimage), + x1, y1, x2, y2)) { *x1 = off_x; *y1 = off_y; @@ -1463,7 +1464,8 @@ gdisplay_mask_bounds (GDisplay *gdisp, *y2 = MAX (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)), *y2); } } - else if (! channel_bounds (gimp_image_get_mask (gdisp->gimage), x1, y1, x2, y2)) + else if (! gimp_channel_bounds (gimp_image_get_mask (gdisp->gimage), + x1, y1, x2, y2)) return FALSE; gdisplay_transform_coords (gdisp, *x1, *y1, x1, y1, 0); diff --git a/app/gimage_mask.c b/app/gimage_mask.c index 0c6a244c78..171345d562 100644 --- a/app/gimage_mask.c +++ b/app/gimage_mask.c @@ -75,10 +75,10 @@ gimage_mask_boundary (GImage *gimage, */ /* Find the selection mask boundary */ - channel_boundary (gimp_image_get_mask (gimage), - segs_in, segs_out, - num_segs_in, num_segs_out, - 0, 0, 0, 0); + gimp_channel_boundary (gimp_image_get_mask (gimage), + segs_in, segs_out, + num_segs_in, num_segs_out, + 0, 0, 0, 0); /* Find the floating selection boundary */ *segs_in = floating_sel_boundary (layer, num_segs_in); @@ -89,10 +89,10 @@ gimage_mask_boundary (GImage *gimage, else if ((d = gimp_image_active_drawable (gimage)) && GIMP_IS_CHANNEL (d)) { - return channel_boundary (gimp_image_get_mask (gimage), - segs_in, segs_out, - num_segs_in, num_segs_out, - 0, 0, gimage->width, gimage->height); + return gimp_channel_boundary (gimp_image_get_mask (gimage), + segs_in, segs_out, + num_segs_in, num_segs_out, + 0, 0, gimage->width, gimage->height); } /* if a layer is active, we return multiple boundaries based on the extents */ else if ((layer = gimp_image_get_active_layer (gimage))) @@ -107,10 +107,10 @@ gimage_mask_boundary (GImage *gimage, y2 = CLAMP (off_y + gimp_drawable_height (GIMP_DRAWABLE(layer)), 0, gimage->height); - return channel_boundary (gimp_image_get_mask (gimage), - segs_in, segs_out, - num_segs_in, num_segs_out, - x1, y1, x2, y2); + return gimp_channel_boundary (gimp_image_get_mask (gimage), + segs_in, segs_out, + num_segs_in, num_segs_out, + x1, y1, x2, y2); } else { @@ -130,15 +130,15 @@ gimage_mask_bounds (GImage *gimage, gint *x2, gint *y2) { - return channel_bounds (gimp_image_get_mask (gimage), x1, y1, x2, y2); + return gimp_channel_bounds (gimp_image_get_mask (gimage), x1, y1, x2, y2); } void gimage_mask_invalidate (GImage *gimage) { - GimpLayer *layer; - Channel *mask; + GimpLayer *layer; + GimpChannel *mask; /* Turn the current selection off */ gdisplays_selection_visibility (gimage, SelectionOff); @@ -163,7 +163,7 @@ gimage_mask_value (GImage *gimage, int x, int y) { - return channel_value (gimp_image_get_mask (gimage), x, y); + return gimp_channel_value (gimp_image_get_mask (gimage), x, y); } @@ -177,7 +177,7 @@ gimage_mask_is_empty (GImage *gimage) if (gimage_mask_stroking) return TRUE; else - return channel_is_empty (gimp_image_get_mask (gimage)); + return gimp_channel_is_empty (gimp_image_get_mask (gimage)); } @@ -186,7 +186,7 @@ gimage_mask_translate (GImage *gimage, gint off_x, gint off_y) { - channel_translate (gimp_image_get_mask (gimage), off_x, off_y); + gimp_channel_translate (gimp_image_get_mask (gimage), off_x, off_y); } @@ -197,15 +197,15 @@ gimage_mask_extract (GImage *gimage, gboolean keep_indexed, gboolean add_alpha) { - TileManager * tiles; - Channel * sel_mask; - PixelRegion srcPR, destPR, maskPR; - guchar bg[MAX_CHANNELS]; - gint bytes, type; - gint x1, y1; - gint x2, y2; - gint off_x, off_y; - gboolean non_empty; + TileManager *tiles; + GimpChannel *sel_mask; + PixelRegion srcPR, destPR, maskPR; + guchar bg[MAX_CHANNELS]; + gint bytes, type; + gint x1, y1; + gint x2, y2; + gint off_x, off_y; + gboolean non_empty; if (!drawable) return NULL; @@ -293,7 +293,7 @@ gimage_mask_extract (GImage *gimage, if (cut_gimage) { /* Clear the region */ - channel_clear (gimp_image_get_mask (gimage)); + gimp_channel_clear (gimp_image_get_mask (gimage)); /* Update the region */ gdisplays_update_area (gimage, @@ -350,7 +350,7 @@ gimage_mask_float (GImage *gimage, gint off_y) { GimpLayer *layer; - Channel *mask = gimp_image_get_mask (gimage); + GimpChannel *mask = gimp_image_get_mask (gimage); TileManager *tiles; gboolean non_empty; gint x1, y1; @@ -401,21 +401,21 @@ gimage_mask_float (GImage *gimage, void gimage_mask_clear (GImage *gimage) { - channel_clear (gimp_image_get_mask (gimage)); + gimp_channel_clear (gimp_image_get_mask (gimage)); } void gimage_mask_undo (GImage *gimage) { - channel_push_undo (gimp_image_get_mask (gimage)); + gimp_channel_push_undo (gimp_image_get_mask (gimage)); } void gimage_mask_invert (GImage *gimage) { - channel_invert (gimp_image_get_mask (gimage)); + gimp_channel_invert (gimp_image_get_mask (gimage)); } @@ -425,21 +425,21 @@ gimage_mask_sharpen (GImage *gimage) /* No need to play with the selection visibility * because sharpen will not change the outline */ - channel_sharpen (gimp_image_get_mask (gimage)); + gimp_channel_sharpen (gimp_image_get_mask (gimage)); } void gimage_mask_all (GImage *gimage) { - channel_all (gimp_image_get_mask (gimage)); + gimp_channel_all (gimp_image_get_mask (gimage)); } void gimage_mask_none (GImage *gimage) { - channel_clear (gimp_image_get_mask (gimage)); + gimp_channel_clear (gimp_image_get_mask (gimage)); } @@ -449,16 +449,16 @@ gimage_mask_feather (GImage *gimage, gdouble feather_radius_y) { /* push the current mask onto the undo stack--need to do this here because - * channel_feather doesn't do it + * gimp_channel_feather doesn't do it */ - channel_push_undo (gimp_image_get_mask (gimage)); + gimp_channel_push_undo (gimp_image_get_mask (gimage)); /* feather the region */ - channel_feather (gimp_image_get_mask (gimage), - gimp_image_get_mask (gimage), - feather_radius_x, - feather_radius_y, - CHANNEL_OP_REPLACE, 0, 0); + gimp_channel_feather (gimp_image_get_mask (gimage), + gimp_image_get_mask (gimage), + feather_radius_x, + feather_radius_y, + CHANNEL_OP_REPLACE, 0, 0); } @@ -468,9 +468,9 @@ gimage_mask_border (GImage *gimage, gint border_radius_y) { /* feather the region */ - channel_border (gimp_image_get_mask (gimage), - border_radius_x, - border_radius_y); + gimp_channel_border (gimp_image_get_mask (gimage), + border_radius_x, + border_radius_y); } @@ -480,9 +480,9 @@ gimage_mask_grow (GImage *gimage, int grow_pixels_y) { /* feather the region */ - channel_grow (gimp_image_get_mask (gimage), - grow_pixels_x, - grow_pixels_y); + gimp_channel_grow (gimp_image_get_mask (gimage), + grow_pixels_x, + grow_pixels_y); } @@ -493,10 +493,10 @@ gimage_mask_shrink (GImage *gimage, gboolean edge_lock) { /* feather the region */ - channel_shrink (gimp_image_get_mask (gimage), - shrink_pixels_x, - shrink_pixels_y, - edge_lock); + gimp_channel_shrink (gimp_image_get_mask (gimage), + shrink_pixels_x, + shrink_pixels_y, + edge_lock); } @@ -508,7 +508,7 @@ gimage_mask_layer_alpha (GimpImage *gimage, if (gimp_drawable_has_alpha (GIMP_DRAWABLE (layer))) { /* load the mask with the given layer's alpha channel */ - channel_layer_alpha (gimp_image_get_mask (gimage), layer); + gimp_channel_layer_alpha (gimp_image_get_mask (gimage), layer); } else { @@ -527,7 +527,7 @@ gimage_mask_layer_mask (GimpImage *gimage, if (gimp_layer_get_mask (layer)) { /* load the mask with the given layer's alpha channel */ - channel_layer_mask (gimp_image_get_mask (gimage), layer); + gimp_channel_layer_mask (gimp_image_get_mask (gimage), layer); } else { @@ -539,20 +539,20 @@ gimage_mask_layer_mask (GimpImage *gimage, void -gimage_mask_load (GImage *gimage, - Channel *channel) +gimage_mask_load (GImage *gimage, + GimpChannel *channel) { /* Load the specified channel to the gimage mask */ - channel_load (gimp_image_get_mask (gimage), (channel)); + gimp_channel_load (gimp_image_get_mask (gimage), (channel)); } -Channel * +GimpChannel * gimage_mask_save (GImage *gimage) { - Channel *new_channel; + GimpChannel *new_channel; - new_channel = channel_copy (gimp_image_get_mask (gimage)); + new_channel = gimp_channel_copy (gimp_image_get_mask (gimage)); /* saved selections are not visible by default */ GIMP_DRAWABLE(new_channel)->visible = FALSE; diff --git a/app/gimage_mask.h b/app/gimage_mask.h index 4679381671..dde2348994 100644 --- a/app/gimage_mask.h +++ b/app/gimage_mask.h @@ -86,9 +86,9 @@ void gimage_mask_layer_mask (GImage *gimage, GimpLayer *layer); void gimage_mask_load (GImage *gimage, - Channel *channel); + GimpChannel *channel); -Channel * gimage_mask_save (GImage *gimage); +GimpChannel * gimage_mask_save (GImage *gimage); gboolean gimage_mask_stroke (GImage *gimage, GimpDrawable *drawable); diff --git a/app/gimpchannel.c b/app/gimpchannel.c index 174b27dc3e..bb1567a548 100644 --- a/app/gimpchannel.c +++ b/app/gimpchannel.c @@ -50,13 +50,13 @@ #include "libgimp/gimpintl.h" -static void gimp_channel_class_init (GimpChannelClass *klass); -static void gimp_channel_init (GimpChannel *channel); -static void gimp_channel_destroy (GtkObject *object); +static void gimp_channel_class_init (GimpChannelClass *klass); +static void gimp_channel_init (GimpChannel *channel); +static void gimp_channel_destroy (GtkObject *object); -static TempBuf * channel_preview_private (Channel *channel, - gint width, - gint height); +static TempBuf * gimp_channel_preview_private (GimpChannel *channel, + gint width, + gint height); static GimpDrawableClass *parent_class = NULL; @@ -109,28 +109,28 @@ gimp_channel_init (GimpChannel *channel) /**************************/ static void -channel_validate (TileManager *tm, - Tile *tile) +gimp_channel_validate (TileManager *tm, + Tile *tile) { /* Set the contents of the tile to empty */ memset (tile_data_pointer (tile, 0, 0), TRANSPARENT_OPACITY, tile_size (tile)); } -Channel * -channel_new (GimpImage *gimage, - gint width, - gint height, - const gchar *name, - const GimpRGB *color) +GimpChannel * +gimp_channel_new (GimpImage *gimage, + gint width, + gint height, + const gchar *name, + const GimpRGB *color) { - Channel *channel; + GimpChannel *channel; g_return_val_if_fail (color != NULL, NULL); channel = gtk_type_new (GIMP_TYPE_CHANNEL); - gimp_drawable_configure (GIMP_DRAWABLE (channel), + gimp_drawable_configure (GIMP_DRAWABLE (channel), gimage, width, height, GRAY_GIMAGE, name); /* set the channel color and opacity */ @@ -154,11 +154,11 @@ channel_new (GimpImage *gimage, return channel; } -Channel * -channel_copy (const Channel *channel) +GimpChannel * +gimp_channel_copy (const GimpChannel *channel) { gchar *channel_name; - Channel *new_channel; + GimpChannel *new_channel; PixelRegion srcPR, destPR; gchar *ext; gint number; @@ -180,11 +180,11 @@ channel_copy (const Channel *channel) channel_name = g_strdup_printf (_("%s copy"), name); /* allocate a new channel object */ - new_channel = channel_new (GIMP_DRAWABLE (channel)->gimage, - GIMP_DRAWABLE (channel)->width, - GIMP_DRAWABLE (channel)->height, - channel_name, - &channel->color); + new_channel = gimp_channel_new (GIMP_DRAWABLE (channel)->gimage, + GIMP_DRAWABLE (channel)->width, + GIMP_DRAWABLE (channel)->height, + channel_name, + &channel->color); GIMP_DRAWABLE (new_channel)->visible = GIMP_DRAWABLE (channel)->visible; new_channel->show_masked = channel->show_masked; @@ -209,8 +209,8 @@ channel_copy (const Channel *channel) } void -channel_set_color (Channel *channel, - const GimpRGB *color) +gimp_channel_set_color (GimpChannel *channel, + const GimpRGB *color) { g_return_if_fail (channel != NULL); g_return_if_fail (GIMP_IS_CHANNEL (channel)); @@ -220,7 +220,7 @@ channel_set_color (Channel *channel, } const GimpRGB * -channel_get_color (const Channel *channel) +gimp_channel_get_color (const GimpChannel *channel) { g_return_val_if_fail (channel != NULL, NULL); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), NULL); @@ -229,7 +229,7 @@ channel_get_color (const Channel *channel) } gint -channel_get_opacity (const Channel *channel) +gimp_channel_get_opacity (const GimpChannel *channel) { g_return_val_if_fail (channel != NULL, 0); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), 0); @@ -238,8 +238,8 @@ channel_get_opacity (const Channel *channel) } void -channel_set_opacity (Channel *channel, - gint opacity) +gimp_channel_set_opacity (GimpChannel *channel, + gint opacity) { g_return_if_fail (channel != NULL); g_return_if_fail (GIMP_IS_CHANNEL (channel)); @@ -270,9 +270,9 @@ gimp_channel_destroy (GtkObject *object) } void -channel_scale (Channel *channel, - gint new_width, - gint new_height) +gimp_channel_scale (GimpChannel *channel, + gint new_width, + gint new_height) { PixelRegion srcPR, destPR; TileManager *new_tiles; @@ -318,11 +318,11 @@ channel_scale (Channel *channel, } void -channel_resize (Channel *channel, - gint new_width, - gint new_height, - gint offx, - gint offy) +gimp_channel_resize (GimpChannel *channel, + gint new_width, + gint new_height, + gint offx, + gint offy) { PixelRegion srcPR, destPR; TileManager *new_tiles; @@ -415,7 +415,7 @@ channel_resize (Channel *channel, } void -channel_update (Channel *channel) +gimp_channel_update (GimpChannel *channel) { drawable_update (GIMP_DRAWABLE (channel), 0, 0, @@ -429,7 +429,7 @@ channel_update (Channel *channel) /**********************/ gboolean -channel_toggle_visibility (Channel *channel) +gimp_channel_toggle_visibility (GimpChannel *channel) { GIMP_DRAWABLE (channel)->visible = !GIMP_DRAWABLE (channel)->visible; @@ -437,9 +437,9 @@ channel_toggle_visibility (Channel *channel) } TempBuf * -channel_preview (Channel *channel, - gint width, - gint height) +gimp_channel_preview (GimpChannel *channel, + gint width, + gint height) { /* Ok prime the cache with a large preview if the cache is invalid */ if (! GIMP_DRAWABLE (channel)->preview_valid && @@ -449,9 +449,9 @@ channel_preview (Channel *channel, GIMP_DRAWABLE (channel)->gimage->width > PREVIEW_CACHE_PRIME_WIDTH && GIMP_DRAWABLE (channel)->gimage->height > PREVIEW_CACHE_PRIME_HEIGHT) { - TempBuf * tb = channel_preview_private (channel, - PREVIEW_CACHE_PRIME_WIDTH, - PREVIEW_CACHE_PRIME_HEIGHT); + TempBuf * tb = gimp_channel_preview_private (channel, + PREVIEW_CACHE_PRIME_WIDTH, + PREVIEW_CACHE_PRIME_HEIGHT); /* Save the 2nd call */ if (width == PREVIEW_CACHE_PRIME_WIDTH && @@ -460,13 +460,13 @@ channel_preview (Channel *channel, } /* Second call - should NOT visit the tile cache... */ - return channel_preview_private (channel, width, height); + return gimp_channel_preview_private (channel, width, height); } static TempBuf * -channel_preview_private (Channel *channel, - gint width, - gint height) +gimp_channel_preview_private (GimpChannel *channel, + gint width, + gint height) { MaskBuf *preview_buf; PixelRegion srcPR; @@ -526,35 +526,35 @@ channel_preview_private (Channel *channel, /* selection mask functions */ /******************************/ -Channel * -channel_new_mask (GimpImage *gimage, - gint width, - gint height) +GimpChannel * +gimp_channel_new_mask (GimpImage *gimage, + gint width, + gint height) { - GimpRGB black = { 0.0, 0.0, 0.0, 0.5 }; - Channel *new_channel; + GimpRGB black = { 0.0, 0.0, 0.0, 0.5 }; + GimpChannel *new_channel; /* Create the new channel */ - new_channel = channel_new (gimage, width, height, - _("Selection Mask"), &black); + new_channel = gimp_channel_new (gimage, width, height, + _("Selection Mask"), &black); /* Set the validate procedure */ tile_manager_set_validate_proc (GIMP_DRAWABLE (new_channel)->tiles, - channel_validate); + gimp_channel_validate); return new_channel; } gboolean -channel_boundary (Channel *mask, - BoundSeg **segs_in, - BoundSeg **segs_out, - gint *num_segs_in, - gint *num_segs_out, - gint x1, - gint y1, - gint x2, - gint y2) +gimp_channel_boundary (GimpChannel *mask, + BoundSeg **segs_in, + BoundSeg **segs_out, + gint *num_segs_in, + gint *num_segs_out, + gint x1, + gint y1, + gint x2, + gint y2) { gint x3, y3, x4, y4; PixelRegion bPR; @@ -567,7 +567,7 @@ channel_boundary (Channel *mask, if (mask->segs_out) g_free (mask->segs_out); - if (channel_bounds (mask, &x3, &y3, &x4, &y4)) + if (gimp_channel_bounds (mask, &x3, &y3, &x4, &y4)) { pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x3, y3, (x4 - x3), (y4 - y3), FALSE); @@ -616,9 +616,9 @@ channel_boundary (Channel *mask, } gint -channel_value (Channel *mask, - gint x, - gint y) +gimp_channel_value (GimpChannel *mask, + gint x, + gint y) { Tile *tile; gint val; @@ -646,11 +646,11 @@ channel_value (Channel *mask, } gboolean -channel_bounds (Channel *mask, - gint *x1, - gint *y1, - gint *x2, - gint *y2) +gimp_channel_bounds (GimpChannel *mask, + gint *x1, + gint *y1, + gint *x2, + gint *y2) { PixelRegion maskPR; guchar *data, *data1; @@ -760,7 +760,7 @@ channel_bounds (Channel *mask, } gboolean -channel_is_empty (Channel *mask) +gimp_channel_is_empty (GimpChannel *mask) { PixelRegion maskPR; guchar *data; @@ -811,11 +811,11 @@ channel_is_empty (Channel *mask) } void -channel_add_segment (Channel *mask, - gint x, - gint y, - gint width, - gint value) +gimp_channel_add_segment (GimpChannel *mask, + gint x, + gint y, + gint width, + gint value) { PixelRegion maskPR; guchar *data; @@ -854,11 +854,11 @@ channel_add_segment (Channel *mask, } void -channel_sub_segment (Channel *mask, - gint x, - gint y, - gint width, - gint value) +gimp_channel_sub_segment (GimpChannel *mask, + gint x, + gint y, + gint width, + gint value) { PixelRegion maskPR; guchar *data; @@ -896,12 +896,12 @@ channel_sub_segment (Channel *mask, } void -channel_combine_rect (Channel *mask, - ChannelOps op, - gint x, - gint y, - gint w, - gint h) +gimp_channel_combine_rect (GimpChannel *mask, + ChannelOps op, + gint x, + gint y, + gint w, + gint h) { gint x2, y2; PixelRegion maskPR; @@ -956,13 +956,13 @@ channel_combine_rect (Channel *mask, } void -channel_combine_ellipse (Channel *mask, - ChannelOps op, - gint x, - gint y, - gint w, - gint h, - gboolean antialias) +gimp_channel_combine_ellipse (GimpChannel *mask, + ChannelOps op, + gint x, + gint y, + gint w, + gint h, + gboolean antialias) { gint i, j; gint x0, x1, x2; @@ -1002,10 +1002,10 @@ channel_combine_ellipse (Channel *mask, { case CHANNEL_OP_ADD: case CHANNEL_OP_REPLACE: - channel_add_segment (mask, x1, i, (x2 - x1), 255); + gimp_channel_add_segment (mask, x1, i, (x2 - x1), 255); break; case CHANNEL_OP_SUB: - channel_sub_segment (mask, x1, i, (x2 - x1), 255); + gimp_channel_sub_segment (mask, x1, i, (x2 - x1), 255); break; default: g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); @@ -1046,10 +1046,10 @@ channel_combine_ellipse (Channel *mask, { case CHANNEL_OP_ADD: case CHANNEL_OP_REPLACE: - channel_add_segment (mask, x0, i, j - x0, last); + gimp_channel_add_segment (mask, x0, i, j - x0, last); break; case CHANNEL_OP_SUB: - channel_sub_segment (mask, x0, i, j - x0, last); + gimp_channel_sub_segment (mask, x0, i, j - x0, last); break; default: g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); @@ -1071,9 +1071,9 @@ channel_combine_ellipse (Channel *mask, if (last) { if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE) - channel_add_segment (mask, x0, i, j - x0, last); + gimp_channel_add_segment (mask, x0, i, j - x0, last); else if (op == CHANNEL_OP_SUB) - channel_sub_segment (mask, x0, i, j - x0, last); + gimp_channel_sub_segment (mask, x0, i, j - x0, last); else g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!"); } @@ -1112,9 +1112,9 @@ channel_combine_ellipse (Channel *mask, } static void -channel_combine_sub_region_add (void *unused, - PixelRegion *srcPR, - PixelRegion *destPR) +gimp_channel_combine_sub_region_add (void *unused, + PixelRegion *srcPR, + PixelRegion *destPR) { guchar *src, *dest; gint x, y, val; @@ -1138,9 +1138,9 @@ channel_combine_sub_region_add (void *unused, } static void -channel_combine_sub_region_sub (void *unused, - PixelRegion *srcPR, - PixelRegion *destPR) +gimp_channel_combine_sub_region_sub (void *unused, + PixelRegion *srcPR, + PixelRegion *destPR) { guchar *src, *dest; gint x, y; @@ -1163,9 +1163,9 @@ channel_combine_sub_region_sub (void *unused, } static void -channel_combine_sub_region_intersect (void *unused, - PixelRegion *srcPR, - PixelRegion *destPR) +gimp_channel_combine_sub_region_intersect (void *unused, + PixelRegion *srcPR, + PixelRegion *destPR) { guchar *src, *dest; gint x, y; @@ -1185,11 +1185,11 @@ channel_combine_sub_region_intersect (void *unused, } void -channel_combine_mask (Channel *mask, - Channel *add_on, - ChannelOps op, - gint off_x, - gint off_y) +gimp_channel_combine_mask (GimpChannel *mask, + GimpChannel *add_on, + ChannelOps op, + gint off_x, + gint off_y) { PixelRegion srcPR, destPR; gint x1, y1, x2, y2; @@ -1213,35 +1213,38 @@ channel_combine_mask (Channel *mask, { case CHANNEL_OP_ADD: case CHANNEL_OP_REPLACE: - pixel_regions_process_parallel ((p_func) channel_combine_sub_region_add, + pixel_regions_process_parallel ((p_func) + gimp_channel_combine_sub_region_add, NULL, 2, &srcPR, &destPR); break; case CHANNEL_OP_SUB: - pixel_regions_process_parallel ((p_func) channel_combine_sub_region_sub, + pixel_regions_process_parallel ((p_func) + gimp_channel_combine_sub_region_sub, NULL, 2, &srcPR, &destPR); break; case CHANNEL_OP_INTERSECT: pixel_regions_process_parallel ((p_func) - channel_combine_sub_region_intersect, + gimp_channel_combine_sub_region_intersect, NULL, 2, &srcPR, &destPR); break; default: g_message ("Error: unknown opperation type in channel_combine_mask\n"); break; } + mask->bounds_known = FALSE; } void -channel_feather (Channel *input, - Channel *output, - gdouble radius_x, - gdouble radius_y, - ChannelOps op, - gint off_x, - gint off_y) +gimp_channel_feather (GimpChannel *input, + GimpChannel *output, + gdouble radius_x, + gdouble radius_y, + ChannelOps op, + gint off_x, + gint off_y) { - gint x1, y1, x2, y2; + gint x1, y1, x2, y2; PixelRegion srcPR; x1 = CLAMP (off_x, 0, GIMP_DRAWABLE (output)->width); @@ -1256,22 +1259,22 @@ channel_feather (Channel *input, gaussian_blur_region (&srcPR, radius_x, radius_y); if (input != output) - channel_combine_mask (output, input, op, 0, 0); + gimp_channel_combine_mask (output, input, op, 0, 0); output->bounds_known = FALSE; } void -channel_push_undo (Channel *mask) +gimp_channel_push_undo (GimpChannel *mask) { - gint x1, y1, x2, y2; - MaskUndo *mask_undo; + gint x1, y1, x2, y2; + MaskUndo *mask_undo; TileManager *undo_tiles; - PixelRegion srcPR, destPR; - GImage *gimage; + PixelRegion srcPR, destPR; + GImage *gimage; mask_undo = g_new (MaskUndo, 1); - if (channel_bounds (mask, &x1, &y1, &x2, &y2)) + if (gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) { undo_tiles = tile_manager_new ((x2 - x1), (y2 - y1), 1); pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles, @@ -1296,13 +1299,13 @@ channel_push_undo (Channel *mask) } void -channel_clear (Channel *mask) +gimp_channel_clear (GimpChannel *mask) { PixelRegion maskPR; - guchar bg = 0; + guchar bg = 0; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); if (mask->bounds_known && !mask->empty) { @@ -1331,13 +1334,13 @@ channel_clear (Channel *mask) } void -channel_invert (Channel *mask) +gimp_channel_invert (GimpChannel *mask) { PixelRegion maskPR; GimpLut *lut; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, 0, 0, @@ -1353,13 +1356,13 @@ channel_invert (Channel *mask) } void -channel_sharpen (Channel *mask) +gimp_channel_sharpen (GimpChannel *mask) { PixelRegion maskPR; GimpLut *lut; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, 0, 0, @@ -1373,13 +1376,13 @@ channel_sharpen (Channel *mask) } void -channel_all (Channel *mask) +gimp_channel_all (GimpChannel *mask) { PixelRegion maskPR; guchar bg = 255; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); /* clear the mask */ pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles, @@ -1398,9 +1401,9 @@ channel_all (Channel *mask) } void -channel_border (Channel *mask, - gint radius_x, - gint radius_y) +gimp_channel_border (GimpChannel *mask, + gint radius_x, + gint radius_y) { PixelRegion bPR; gint x1, y1, x2, y2; @@ -1408,9 +1411,9 @@ channel_border (Channel *mask, if (radius_x < 0 || radius_y < 0) return; - if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) + if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) return; - if (channel_is_empty (mask)) + if (gimp_channel_is_empty (mask)) return; if (x1 - radius_x < 0) @@ -1430,8 +1433,9 @@ channel_border (Channel *mask, y2 = GIMP_DRAWABLE (mask)->height; else y2 += radius_y; + /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2-x1), (y2-y1), TRUE); @@ -1442,9 +1446,9 @@ channel_border (Channel *mask, } void -channel_grow (Channel *mask, - gint radius_x, - gint radius_y) +gimp_channel_grow (GimpChannel *mask, + gint radius_x, + gint radius_y) { PixelRegion bPR; gint x1, y1, x2, y2; @@ -1454,16 +1458,16 @@ channel_grow (Channel *mask, if (radius_x <= 0 && radius_y <= 0) { - channel_shrink (mask, -radius_x, -radius_y, FALSE); + gimp_channel_shrink (mask, -radius_x, -radius_y, FALSE); return; } if (radius_x < 0 || radius_y < 0) return; - if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) + if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) return; - if (channel_is_empty (mask)) + if (gimp_channel_is_empty (mask)) return; if (x1 - radius_x > 0) @@ -1484,7 +1488,7 @@ channel_grow (Channel *mask, y2 = GIMP_DRAWABLE (mask)->height; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); /* need full extents for grow, not! */ pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1), @@ -1496,10 +1500,10 @@ channel_grow (Channel *mask, } void -channel_shrink (Channel *mask, - gint radius_x, - gint radius_y, - gboolean edge_lock) +gimp_channel_shrink (GimpChannel *mask, + gint radius_x, + gint radius_y, + gboolean edge_lock) { PixelRegion bPR; gint x1, y1, x2, y2; @@ -1509,16 +1513,16 @@ channel_shrink (Channel *mask, if (radius_x <= 0 && radius_y <= 0) { - channel_grow (mask, -radius_x, -radius_y); + gimp_channel_grow (mask, -radius_x, -radius_y); return; } if (radius_x < 0 || radius_y < 0) return; - if (! channel_bounds (mask, &x1, &y1, &x2, &y2)) + if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) return; - if (channel_is_empty (mask)) + if (gimp_channel_is_empty (mask)) return; if (x1 > 0) @@ -1531,7 +1535,7 @@ channel_shrink (Channel *mask, y2++; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1), (y2 - y1), TRUE); @@ -1542,12 +1546,12 @@ channel_shrink (Channel *mask, } void -channel_translate (Channel *mask, - gint off_x, - gint off_y) +gimp_channel_translate (GimpChannel *mask, + gint off_x, + gint off_y) { gint width, height; - Channel *tmp_mask; + GimpChannel *tmp_mask; PixelRegion srcPR, destPR; guchar empty = 0; gint x1, y1, x2, y2; @@ -1555,9 +1559,9 @@ channel_translate (Channel *mask, tmp_mask = NULL; /* push the current channel onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); - channel_bounds (mask, &x1, &y1, &x2, &y2); + gimp_channel_bounds (mask, &x1, &y1, &x2, &y2); x1 = CLAMP ((x1 + off_x), 0, GIMP_DRAWABLE (mask)->width); y1 = CLAMP ((y1 + off_y), 0, GIMP_DRAWABLE (mask)->height); x2 = CLAMP ((x2 + off_x), 0, GIMP_DRAWABLE (mask)->width); @@ -1572,7 +1576,8 @@ channel_translate (Channel *mask, /* copy the portion of the mask we will keep to a * temporary buffer */ - tmp_mask = channel_new_mask (GIMP_DRAWABLE (mask)->gimage, width, height); + tmp_mask = gimp_channel_new_mask (GIMP_DRAWABLE (mask)->gimage, + width, height); pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles, x1 - off_x, y1 - off_y, width, height, FALSE); @@ -1619,13 +1624,13 @@ channel_translate (Channel *mask, } void -channel_load (Channel *mask, - Channel *channel) +gimp_channel_load (GimpChannel *mask, + GimpChannel *channel) { PixelRegion srcPR, destPR; /* push the current mask onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); /* copy the channel to the mask */ pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles, @@ -1642,15 +1647,15 @@ channel_load (Channel *mask, } void -channel_layer_alpha (Channel *mask, - GimpLayer *layer) +gimp_channel_layer_alpha (GimpChannel *mask, + GimpLayer *layer) { PixelRegion srcPR, destPR; guchar empty = 0; gint x1, y1, x2, y2; /* push the current mask onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); /* clear the mask */ pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles, @@ -1678,15 +1683,15 @@ channel_layer_alpha (Channel *mask, } void -channel_layer_mask (Channel *mask, - GimpLayer *layer) +gimp_channel_layer_mask (GimpChannel *mask, + GimpLayer *layer) { PixelRegion srcPR, destPR; guchar empty = 0; gint x1, y1, x2, y2; /* push the current mask onto the undo stack */ - channel_push_undo (mask); + gimp_channel_push_undo (mask); /* clear the mask */ pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles, @@ -1717,7 +1722,7 @@ channel_layer_mask (Channel *mask, } void -channel_invalidate_bounds (Channel *channel) +gimp_channel_invalidate_bounds (GimpChannel *channel) { channel->bounds_known = FALSE; } diff --git a/app/gimpchannel.h b/app/gimpchannel.h index 9bd6a4b739..158b7c09c5 100644 --- a/app/gimpchannel.h +++ b/app/gimpchannel.h @@ -16,8 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __CHANNEL_H__ -#define __CHANNEL_H__ +#ifndef __GIMP_CHANNEL_H__ +#define __GIMP_CHANNEL_H__ #include "gimpdrawable.h" @@ -26,7 +26,6 @@ /* Half way point where a region is no longer visible in a selection */ #define HALF_WAY 127 -/* structure declarations */ #define GIMP_TYPE_CHANNEL (gimp_channel_get_type ()) #define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel)) @@ -63,21 +62,18 @@ struct _GimpChannelClass }; +/* Special undo types */ -/* Special undo type */ typedef struct _ChannelUndo ChannelUndo; +typedef struct _MaskUndo MaskUndo; struct _ChannelUndo { - Channel *channel; /* the actual channel */ - gint prev_position; /* former position in list */ - Channel *prev_channel; /* previous active channel */ + GimpChannel *channel; /* the actual channel */ + gint prev_position; /* former position in list */ + GimpChannel *prev_channel; /* previous active channel */ }; - -/* Special undo type */ -typedef struct _MaskUndo MaskUndo; - struct _MaskUndo { TileManager *tiles; /* the actual mask */ @@ -87,128 +83,128 @@ struct _MaskUndo /* function declarations */ -GtkType gimp_channel_get_type (void); +GtkType gimp_channel_get_type (void); -Channel * channel_new (GimpImage *gimage, - gint width, - gint height, - const gchar *name, - const GimpRGB *color); -Channel * channel_copy (const Channel *channel); +GimpChannel * gimp_channel_new (GimpImage *gimage, + gint width, + gint height, + const gchar *name, + const GimpRGB *color); +GimpChannel * gimp_channel_copy (const GimpChannel *channel); -gint channel_get_opacity (const Channel *channel); -void channel_set_opacity (Channel *channel, - gint opacity); +gint gimp_channel_get_opacity (const GimpChannel *channel); +void gimp_channel_set_opacity (GimpChannel *channel, + gint opacity); -const GimpRGB * channel_get_color (const Channel *channel); -void channel_set_color (Channel *channel, - const GimpRGB *color); +const GimpRGB * gimp_channel_get_color (const GimpChannel *channel); +void gimp_channel_set_color (GimpChannel *channel, + const GimpRGB *color); -void channel_scale (Channel *channel, - gint new_width, - gint new_height); -void channel_resize (Channel *channel, - gint new_width, - gint new_height, - gint offx, - gint offy); -void channel_update (Channel *channel); +void gimp_channel_scale (GimpChannel *channel, + gint new_width, + gint new_height); +void gimp_channel_resize (GimpChannel *channel, + gint new_width, + gint new_height, + gint offx, + gint offy); +void gimp_channel_update (GimpChannel *channel); /* access functions */ -gboolean channel_toggle_visibility (Channel *channel); -TempBuf * channel_preview (Channel *channel, - gint width, - gint height); +gboolean gimp_channel_toggle_visibility (GimpChannel *channel); +TempBuf * gimp_channel_preview (GimpChannel *channel, + gint width, + gint height); /* selection mask functions */ -Channel * channel_new_mask (GimpImage *gimage, - gint width, - gint height); -gboolean channel_boundary (Channel *mask, - BoundSeg **segs_in, - BoundSeg **segs_out, - gint *num_segs_in, - gint *num_segs_out, - gint x1, - gint y1, - gint x2, - gint y2); -gboolean channel_bounds (Channel *mask, - gint *x1, - gint *y1, - gint *x2, - gint *y2); -gint channel_value (Channel *mask, - gint x, - gint y); -gboolean channel_is_empty (Channel *mask); -void channel_add_segment (Channel *mask, - gint x, - gint y, - gint width, - gint value); -void channel_sub_segment (Channel *mask, - gint x, - gint y, - gint width, - gint value); -void channel_combine_rect (Channel *mask, - ChannelOps op, - gint x, - gint y, - gint w, - gint h); -void channel_combine_ellipse (Channel *mask, - ChannelOps op, - gint x, - gint y, - gint w, - gint h, - gboolean antialias); -void channel_combine_mask (Channel *mask, - Channel *add_on, - ChannelOps op, - gint off_x, - gint off_y); -void channel_feather (Channel *input, - Channel *output, - gdouble radius_x, - gdouble radius_y, - ChannelOps op, - gint off_x, - gint off_y); +GimpChannel * gimp_channel_new_mask (GimpImage *gimage, + gint width, + gint height); +gboolean gimp_channel_boundary (GimpChannel *mask, + BoundSeg **segs_in, + BoundSeg **segs_out, + gint *num_segs_in, + gint *num_segs_out, + gint x1, + gint y1, + gint x2, + gint y2); +gboolean gimp_channel_bounds (GimpChannel *mask, + gint *x1, + gint *y1, + gint *x2, + gint *y2); +gint gimp_channel_value (GimpChannel *mask, + gint x, + gint y); +gboolean gimp_channel_is_empty (GimpChannel *mask); +void gimp_channel_add_segment (GimpChannel *mask, + gint x, + gint y, + gint width, + gint value); +void gimp_channel_sub_segment (GimpChannel *mask, + gint x, + gint y, + gint width, + gint value); +void gimp_channel_combine_rect (GimpChannel *mask, + ChannelOps op, + gint x, + gint y, + gint w, + gint h); +void gimp_channel_combine_ellipse (GimpChannel *mask, + ChannelOps op, + gint x, + gint y, + gint w, + gint h, + gboolean antialias); +void gimp_channel_combine_mask (GimpChannel *mask, + GimpChannel *add_on, + ChannelOps op, + gint off_x, + gint off_y); +void gimp_channel_feather (GimpChannel *input, + GimpChannel *output, + gdouble radius_x, + gdouble radius_y, + ChannelOps op, + gint off_x, + gint off_y); -void channel_push_undo (Channel *mask); -void channel_clear (Channel *mask); -void channel_invert (Channel *mask); -void channel_sharpen (Channel *mask); -void channel_all (Channel *mask); +void gimp_channel_push_undo (GimpChannel *mask); +void gimp_channel_clear (GimpChannel *mask); +void gimp_channel_invert (GimpChannel *mask); +void gimp_channel_sharpen (GimpChannel *mask); +void gimp_channel_all (GimpChannel *mask); -void channel_border (Channel *mask, - gint radius_x, - gint radius_y); -void channel_grow (Channel *mask, - gint radius_x, - gint radius_y); -void channel_shrink (Channel *mask, - gint radius_x, - gint radius_y, - gboolean edge_lock); +void gimp_channel_border (GimpChannel *mask, + gint radius_x, + gint radius_y); +void gimp_channel_grow (GimpChannel *mask, + gint radius_x, + gint radius_y); +void gimp_channel_shrink (GimpChannel *mask, + gint radius_x, + gint radius_y, + gboolean edge_lock); -void channel_translate (Channel *mask, - gint off_x, - gint off_y); -void channel_load (Channel *mask, - Channel *channel); +void gimp_channel_translate (GimpChannel *mask, + gint off_x, + gint off_y); +void gimp_channel_load (GimpChannel *mask, + GimpChannel *channel); -void channel_layer_alpha (Channel *mask, - GimpLayer *layer); -void channel_layer_mask (Channel *mask, - GimpLayer *layer); +void gimp_channel_layer_alpha (GimpChannel *mask, + GimpLayer *layer); +void gimp_channel_layer_mask (GimpChannel *mask, + GimpLayer *layer); -void channel_invalidate_bounds (Channel *channel); +void gimp_channel_invalidate_bounds (GimpChannel *channel); -#endif /* __CHANNEL_H__ */ +#endif /* __GIMP_CHANNEL_H__ */ diff --git a/app/gimpdnd.c b/app/gimpdnd.c index 81350743d9..081a1eda5d 100644 --- a/app/gimpdnd.c +++ b/app/gimpdnd.c @@ -1097,7 +1097,7 @@ gimp_dnd_set_drawable_preview_icon (GtkWidget *widget, } else if (GIMP_IS_CHANNEL (drawable)) { - tmpbuf = channel_preview (GIMP_CHANNEL (drawable), width, height); + tmpbuf = gimp_channel_preview (GIMP_CHANNEL (drawable), width, height); } else { diff --git a/app/gimpdrawable-offset.c b/app/gimpdrawable-offset.c index b61378c299..6b693844cc 100644 --- a/app/gimpdrawable-offset.c +++ b/app/gimpdrawable-offset.c @@ -569,12 +569,12 @@ duplicate (GimpImage *gimage) GimpImage *new_gimage; GimpLayer *layer, *new_layer; GimpLayer *floating_layer; - Channel *channel, *new_channel; + GimpChannel *channel, *new_channel; GSList *list; GList *glist; Guide *guide = NULL; GimpLayer *active_layer = NULL; - Channel *active_channel = NULL; + GimpChannel *active_channel = NULL; GimpDrawable *new_floating_sel_drawable = NULL; GimpDrawable *floating_sel_drawable = NULL; ParasiteList *parasites; @@ -645,12 +645,12 @@ duplicate (GimpImage *gimage) count = 0; while (list) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; list = g_slist_next (list); - new_channel = channel_copy (channel); + new_channel = gimp_channel_copy (channel); - gimp_drawable_set_gimage(GIMP_DRAWABLE(new_channel), new_gimage); + gimp_drawable_set_gimage (GIMP_DRAWABLE (new_channel), new_gimage); /* Make sure the copied channel doesn't say: " copy" */ gimp_object_set_name (GIMP_OBJECT (new_channel), diff --git a/app/gimphistogram.c b/app/gimphistogram.c index 539357a44f..ad78e67b29 100644 --- a/app/gimphistogram.c +++ b/app/gimphistogram.c @@ -365,8 +365,8 @@ gimp_histogram_calculate_drawable (GimpHistogram *histogram, if (!no_mask) { - Channel *sel_mask; - GimpImage *gimage; + GimpChannel *sel_mask; + GimpImage *gimage; gimage = gimp_drawable_gimage (drawable); sel_mask = gimp_image_get_mask (gimage); diff --git a/app/gimpimage-duplicate.c b/app/gimpimage-duplicate.c index b61378c299..6b693844cc 100644 --- a/app/gimpimage-duplicate.c +++ b/app/gimpimage-duplicate.c @@ -569,12 +569,12 @@ duplicate (GimpImage *gimage) GimpImage *new_gimage; GimpLayer *layer, *new_layer; GimpLayer *floating_layer; - Channel *channel, *new_channel; + GimpChannel *channel, *new_channel; GSList *list; GList *glist; Guide *guide = NULL; GimpLayer *active_layer = NULL; - Channel *active_channel = NULL; + GimpChannel *active_channel = NULL; GimpDrawable *new_floating_sel_drawable = NULL; GimpDrawable *floating_sel_drawable = NULL; ParasiteList *parasites; @@ -645,12 +645,12 @@ duplicate (GimpImage *gimage) count = 0; while (list) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; list = g_slist_next (list); - new_channel = channel_copy (channel); + new_channel = gimp_channel_copy (channel); - gimp_drawable_set_gimage(GIMP_DRAWABLE(new_channel), new_gimage); + gimp_drawable_set_gimage (GIMP_DRAWABLE (new_channel), new_gimage); /* Make sure the copied channel doesn't say: " copy" */ gimp_object_set_name (GIMP_OBJECT (new_channel), diff --git a/app/gimpimage.c b/app/gimpimage.c index a733e7d312..7de7193350 100644 --- a/app/gimpimage.c +++ b/app/gimpimage.c @@ -113,7 +113,7 @@ static void project_indexed_alpha (GimpImage *gimage, PixelRegion *dest, PixelRegion *mask); static void project_channel (GimpImage *gimage, - Channel *layer, + GimpChannel *channel, PixelRegion *src, PixelRegion *src2); @@ -437,8 +437,9 @@ gimp_image_new (gint width, } /* create the selection mask */ - gimage->selection_mask = channel_new_mask (gimage, - gimage->width, gimage->height); + gimage->selection_mask = gimp_channel_new_mask (gimage, + gimage->width, + gimage->height); return gimage; @@ -552,11 +553,11 @@ gimp_image_resize (GimpImage *gimage, gint offset_x, gint offset_y) { - Channel *channel; - GimpLayer *layer; - GimpLayer *floating_layer; - GSList *list; - GList *guide_list; + GimpChannel *channel; + GimpLayer *layer; + GimpLayer *floating_layer; + GSList *list; + GList *guide_list; gimp_add_busy_cursors (); @@ -581,9 +582,9 @@ gimp_image_resize (GimpImage *gimage, /* Resize all channels */ for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; - channel_resize (channel, new_width, new_height, offset_x, offset_y); + gimp_channel_resize (channel, new_width, new_height, offset_x, offset_y); } /* Reposition or remove any guides */ @@ -617,8 +618,8 @@ gimp_image_resize (GimpImage *gimage, } /* Don't forget the selection mask! */ - channel_resize (gimage->selection_mask, - new_width, new_height, offset_x, offset_y); + gimp_channel_resize (gimage->selection_mask, + new_width, new_height, offset_x, offset_y); gimage_mask_invalidate (gimage); /* Reposition all layers */ @@ -646,17 +647,17 @@ gimp_image_scale (GimpImage *gimage, gint new_width, gint new_height) { - Channel *channel; - GimpLayer *layer; - GimpLayer *floating_layer; - GSList *list; - GSList *remove = NULL; - GList *glist; - Guide *guide; - gint old_width; - gint old_height; - gdouble img_scale_w = 1.0; - gdouble img_scale_h = 1.0; + GimpChannel *channel; + GimpLayer *layer; + GimpLayer *floating_layer; + GSList *list; + GSList *remove = NULL; + GList *glist; + Guide *guide; + gint old_width; + gint old_height; + gdouble img_scale_w = 1.0; + gdouble img_scale_h = 1.0; if ((new_width == 0) || (new_height == 0)) { @@ -690,17 +691,18 @@ gimp_image_scale (GimpImage *gimage, /* Scale all channels */ for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; - channel_scale (channel, new_width, new_height); + channel = (GimpChannel *) list->data; + + gimp_channel_scale (channel, new_width, new_height); } /* Don't forget the selection mask! */ /* if (channel_is_empty(gimage->selection_mask)) - channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) + gimp_channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) else */ - channel_scale (gimage->selection_mask, new_width, new_height); + gimp_channel_scale (gimage->selection_mask, new_width, new_height); gimage_mask_invalidate (gimage); /* Scale all layers */ @@ -827,7 +829,7 @@ gimp_image_apply_image (GimpImage *gimage, gint x, gint y) { - Channel *mask; + GimpChannel *mask; gint x1, y1, x2, y2; gint offset_x, offset_y; PixelRegion src1PR, destPR, maskPR; @@ -932,7 +934,7 @@ gimp_image_replace_image (GimpImage *gimage, gint x, gint y) { - Channel *mask; + GimpChannel *mask; gint x1, y1, x2, y2; gint offset_x, offset_y; PixelRegion src1PR, destPR; @@ -1374,14 +1376,14 @@ gboolean gimp_image_set_tattoo_state (GimpImage *gimage, Tattoo val) { - GimpLayer *layer; - GSList *layers; - gboolean retval = TRUE; - Channel *channel; - GSList *channels; - Tattoo maxval = 0; - Path *pptr = NULL; - PathList *plist; + GimpLayer *layer; + GSList *layers; + gboolean retval = TRUE; + GimpChannel *channel; + GSList *channels; + Tattoo maxval = 0; + Path *pptr = NULL; + PathList *plist; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); @@ -1411,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, channels = g_slist_next (channels)) { Tattoo ctattoo; - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); if (ctattoo > maxval) @@ -1544,7 +1546,7 @@ project_indexed_alpha (GimpImage *gimage, static void project_channel (GimpImage *gimage, - Channel *channel, + GimpChannel *channel, PixelRegion *src, PixelRegion *src2) { @@ -1598,12 +1600,12 @@ gimp_image_free_layers (GimpImage *gimage) static void gimp_image_free_channels (GimpImage *gimage) { - GSList *list; - Channel *channel; + GSList *list; + GimpChannel *channel; for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; gtk_object_unref (GTK_OBJECT (channel)); } @@ -1760,7 +1762,7 @@ gimp_image_construct_channels (GimpImage *gimage, gint w, gint h) { - Channel *channel; + GimpChannel *channel; PixelRegion src1PR; PixelRegion src2PR; GSList *list; @@ -1772,7 +1774,7 @@ gimp_image_construct_channels (GimpImage *gimage, while (reverse_list) { - channel = (Channel *) reverse_list->data; + channel = (GimpChannel *) reverse_list->data; if (gimp_drawable_visible (GIMP_DRAWABLE (channel))) { @@ -2121,15 +2123,15 @@ gimp_image_invalidate_layer_previews (GimpImage *gimage) void gimp_image_invalidate_channel_previews (GimpImage *gimage) { - GSList *tmp; - Channel *channel; + GSList *tmp; + GimpChannel *channel; g_return_if_fail (gimage != NULL); g_return_if_fail (GIMP_IS_IMAGE (gimage)); for (tmp = gimage->channels; tmp; tmp = g_slist_next (tmp)) { - channel = (Channel *) tmp->data; + channel = (GimpChannel *) tmp->data; gimp_drawable_invalidate_preview (GIMP_DRAWABLE (channel), TRUE); } @@ -2173,12 +2175,12 @@ gimp_image_get_layer_by_index (const GimpImage *gimage, } gint -gimp_image_get_channel_index (const GimpImage *gimage, - const Channel *channel_arg) +gimp_image_get_channel_index (const GimpImage *gimage, + const GimpChannel *channel_arg) { - Channel *channel; - GSList *channels; - gint index; + GimpChannel *channel; + GSList *channels; + gint index; g_return_val_if_fail (gimage != NULL, -1); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), -1); @@ -2187,7 +2189,7 @@ gimp_image_get_channel_index (const GimpImage *gimage, channels; channels = g_slist_next (channels), index++) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (channel == channel_arg) return index; @@ -2205,7 +2207,7 @@ gimp_image_get_active_layer (const GimpImage *gimage) return gimage->active_layer; } -Channel * +GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2235,12 +2237,12 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, Tattoo tattoo) { - Channel *channel; - GSList *channels; + GimpChannel *channel; + GSList *channels; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2248,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, channels; channels = g_slist_next (channels)) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) return channel; @@ -2257,12 +2259,12 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, const gchar *name) { - Channel *channel; - GSList *channels; + GimpChannel *channel; + GSList *channels; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2270,7 +2272,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage, channels; channels = g_slist_next (channels)) { - channel = (Channel *) channels->data; + channel = (GimpChannel *) channels->data; if (! strcmp (gimp_object_get_name (GIMP_OBJECT (channel)), name)) return channel; } @@ -2278,7 +2280,7 @@ gimp_image_get_channel_by_name (const GimpImage *gimage, return NULL; } -Channel * +GimpChannel * gimp_image_get_mask (const GimpImage *gimage) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2380,9 +2382,9 @@ gimp_image_set_active_layer (GimpImage *gimage, return layer; } -Channel * -gimp_image_set_active_channel (GimpImage *gimage, - Channel *channel) +GimpChannel * +gimp_image_set_active_channel (GimpImage *gimage, + GimpChannel *channel) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2400,7 +2402,7 @@ gimp_image_set_active_channel (GimpImage *gimage, gimage->active_channel = NULL; return NULL; } - channel = (Channel *) gimage->channels->data; + channel = (GimpChannel *) gimage->channels->data; } /* Set the active channel */ @@ -2410,10 +2412,10 @@ gimp_image_set_active_channel (GimpImage *gimage, return channel; } -Channel * +GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage) { - Channel *channel; + GimpChannel *channel; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3308,7 +3310,7 @@ gimp_image_add_layer_mask (GimpImage *gimage, return mask; } -Channel * +GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage, GimpLayer *layer, MaskApplyMode mode) @@ -3362,15 +3364,15 @@ gimp_image_remove_layer_mask (GimpImage *gimage, return NULL; } -Channel * -gimp_image_raise_channel (GimpImage *gimage, - Channel *channel_arg) +GimpChannel * +gimp_image_raise_channel (GimpImage *gimage, + GimpChannel *channel_arg) { - Channel *channel; - Channel *prev_channel; - GSList *list; - GSList *prev; - gint index = -1; + GimpChannel *channel; + GimpChannel *prev_channel; + GSList *list; + GSList *prev; + gint index = -1; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3380,9 +3382,9 @@ gimp_image_raise_channel (GimpImage *gimage, while (list) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; if (prev) - prev_channel = (Channel *) prev->data; + prev_channel = (GimpChannel *) prev->data; if (channel == channel_arg) { @@ -3411,15 +3413,15 @@ gimp_image_raise_channel (GimpImage *gimage, return NULL; } -Channel * -gimp_image_lower_channel (GimpImage *gimage, - Channel *channel_arg) +GimpChannel * +gimp_image_lower_channel (GimpImage *gimage, + GimpChannel *channel_arg) { - Channel *channel; - Channel *next_channel; - GSList *list; - GSList *next; - gint index = 0; + GimpChannel *channel; + GimpChannel *next_channel; + GSList *list; + GSList *next; + gint index = 0; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3428,11 +3430,11 @@ gimp_image_lower_channel (GimpImage *gimage, while (list) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; next = g_slist_next (list); if (next) - next_channel = (Channel *) next->data; + next_channel = (GimpChannel *) next->data; index++; if (channel == channel_arg) @@ -3460,16 +3462,16 @@ gimp_image_lower_channel (GimpImage *gimage, return NULL; } -Channel * -gimp_image_position_channel (GimpImage *gimage, - Channel *channel_arg, - gint new_index) +GimpChannel * +gimp_image_position_channel (GimpImage *gimage, + GimpChannel *channel_arg, + gint new_index) { - Channel *channel; - GSList *list; - GSList *next; - gint index; - gint list_length; + GimpChannel *channel; + GSList *list; + GSList *next; + gint index; + gint list_length; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -3481,7 +3483,7 @@ gimp_image_position_channel (GimpImage *gimage, list; list = g_slist_next (list), index++) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; if (channel == channel_arg) { break; @@ -3513,10 +3515,10 @@ gimp_image_position_channel (GimpImage *gimage, return channel; } -Channel * -gimp_image_add_channel (GimpImage *gimage, - Channel *channel, - gint position) +GimpChannel * +gimp_image_add_channel (GimpImage *gimage, + GimpChannel *channel, + gint position) { ChannelUndo *cu; GSList *cc; @@ -3564,9 +3566,9 @@ gimp_image_add_channel (GimpImage *gimage, return channel; } -Channel * -gimp_image_remove_channel (GimpImage *gimage, - Channel *channel) +GimpChannel * +gimp_image_remove_channel (GimpImage *gimage, + GimpChannel *channel) { ChannelUndo *cu; @@ -3584,7 +3586,7 @@ gimp_image_remove_channel (GimpImage *gimage, if (gimage->active_channel == channel) { if (gimage->channels) - gimage->active_channel = (((Channel *) gimage->channels->data)); + gimage->active_channel = (((GimpChannel *) gimage->channels->data)); else gimage->active_channel = NULL; } diff --git a/app/gimpimage.h b/app/gimpimage.h index 356c35f17c..a71abc7029 100644 --- a/app/gimpimage.h +++ b/app/gimpimage.h @@ -86,9 +86,9 @@ struct _GimpImage GSList *layer_stack; /* the layers in MRU order */ GimpLayer *active_layer; /* ID of active layer */ - Channel *active_channel; /* ID of active channel */ + GimpChannel *active_channel; /* ID of active channel */ GimpLayer *floating_sel; /* ID of fs layer */ - Channel *selection_mask; /* selection mask channel */ + GimpChannel *selection_mask; /* selection mask channel */ ParasiteList *parasites; /* Plug-in parasite data */ @@ -282,91 +282,91 @@ void gimp_image_colormap_changed (const GimpImage *image, /* layer/channel functions */ -gint gimp_image_get_layer_index (const GimpImage *gimage, - const GimpLayer *layer_arg); -GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, - gint layer_index); -gint gimp_image_get_channel_index (const GimpImage *gimage, - const Channel *channel_arg); -GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); -Channel * gimp_image_get_active_channel (const GimpImage *gimage); -GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); -Channel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); -Channel * gimp_image_get_channel_by_name (const GimpImage *gimage, - const gchar *name); -Channel * gimp_image_get_mask (const GimpImage *gimage); -gboolean gimp_image_get_component_active (const GimpImage *gimage, - ChannelType type); -gboolean gimp_image_get_component_visible (const GimpImage *gimage, - ChannelType type); -gboolean gimp_image_layer_boundary (const GimpImage *gimage, - BoundSeg **segs, - gint *n_segs); -GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, - GimpLayer *layer); -Channel * gimp_image_set_active_channel (GimpImage *gimage, - Channel *channel); -Channel * gimp_image_unset_active_channel (GimpImage *gimage); -void gimp_image_set_component_active (GimpImage *gimage, - ChannelType type, - gboolean active); -void gimp_image_set_component_visible (GimpImage *gimage, - ChannelType type, - gboolean visible); -GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage, - gint x, - gint y); -GimpLayer * gimp_image_raise_layer (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_lower_layer (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, - GimpLayer *layer_arg); -GimpLayer * gimp_image_position_layer (GimpImage *gimage, - GimpLayer *layer_arg, - gint new_index, - gboolean push_undo); -GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage, - MergeType merge_type); -GimpLayer * gimp_image_merge_down (GimpImage *gimage, - GimpLayer *current_layer, - MergeType merge_type); -GimpLayer * gimp_image_flatten (GimpImage *gimage); -GimpLayer * gimp_image_merge_layers (GimpImage *gimage, - GSList *merge_list, - MergeType merge_type); -GimpLayer * gimp_image_add_layer (GimpImage *gimage, - GimpLayer *float_layer, - gint position); -GimpLayer * gimp_image_remove_layer (GimpImage *gimage, - GimpLayer *layer); -GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, - GimpLayer *layer, - GimpLayerMask *mask); -Channel * gimp_image_remove_layer_mask (GimpImage *gimage, - GimpLayer *layer, - MaskApplyMode mode); -Channel * gimp_image_raise_channel (GimpImage *gimage, - Channel *channel_arg); -Channel * gimp_image_lower_channel (GimpImage *gimage, - Channel *channel_arg); -Channel * gimp_image_position_channel (GimpImage *gimage, - Channel *channel_arg, - gint position); -Channel * gimp_image_add_channel (GimpImage *gimage, - Channel *channel, - gint position); -Channel * gimp_image_remove_channel (GimpImage *gimage, - Channel *channel); -void gimp_image_construct (GimpImage *gimage, - gint x, - gint y, - gint w, - gint h); +gint gimp_image_get_layer_index (const GimpImage *gimage, + const GimpLayer *layer_arg); +GimpLayer * gimp_image_get_layer_by_index (const GimpImage *gimage, + gint layer_index); +gint gimp_image_get_channel_index (const GimpImage *gimage, + const GimpChannel *channel_arg); +GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); +GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage); +GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, + Tattoo tatoo); +GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, + Tattoo tatoo); +GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, + const gchar *name); +GimpChannel * gimp_image_get_mask (const GimpImage *gimage); +gboolean gimp_image_get_component_active (const GimpImage *gimage, + ChannelType type); +gboolean gimp_image_get_component_visible (const GimpImage *gimage, + ChannelType type); +gboolean gimp_image_layer_boundary (const GimpImage *gimage, + BoundSeg **segs, + gint *n_segs); +GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, + GimpLayer *layer); +GimpChannel * gimp_image_set_active_channel (GimpImage *gimage, + GimpChannel *channel); +GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage); +void gimp_image_set_component_active (GimpImage *gimage, + ChannelType type, + gboolean active); +void gimp_image_set_component_visible (GimpImage *gimage, + ChannelType type, + gboolean visible); +GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage, + gint x, + gint y); +GimpLayer * gimp_image_raise_layer (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_lower_layer (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_raise_layer_to_top (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_lower_layer_to_bottom (GimpImage *gimage, + GimpLayer *layer_arg); +GimpLayer * gimp_image_position_layer (GimpImage *gimage, + GimpLayer *layer_arg, + gint new_index, + gboolean push_undo); +GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage, + MergeType merge_type); +GimpLayer * gimp_image_merge_down (GimpImage *gimage, + GimpLayer *current_layer, + MergeType merge_type); +GimpLayer * gimp_image_flatten (GimpImage *gimage); +GimpLayer * gimp_image_merge_layers (GimpImage *gimage, + GSList *merge_list, + MergeType merge_type); +GimpLayer * gimp_image_add_layer (GimpImage *gimage, + GimpLayer *float_layer, + gint position); +GimpLayer * gimp_image_remove_layer (GimpImage *gimage, + GimpLayer *layer); +GimpLayerMask * gimp_image_add_layer_mask (GimpImage *gimage, + GimpLayer *layer, + GimpLayerMask *mask); +GimpChannel * gimp_image_remove_layer_mask (GimpImage *gimage, + GimpLayer *layer, + MaskApplyMode mode); +GimpChannel * gimp_image_raise_channel (GimpImage *gimage, + GimpChannel *channel_arg); +GimpChannel * gimp_image_lower_channel (GimpImage *gimage, + GimpChannel *channel_arg); +GimpChannel * gimp_image_position_channel (GimpImage *gimage, + GimpChannel *channel_arg, + gint position); +GimpChannel * gimp_image_add_channel (GimpImage *gimage, + GimpChannel *channel, + gint position); +GimpChannel * gimp_image_remove_channel (GimpImage *gimage, + GimpChannel *channel); +void gimp_image_construct (GimpImage *gimage, + gint x, + gint y, + gint w, + gint h); void gimp_image_invalidate_without_render (GimpImage *gimage, diff --git a/app/gimplayer.c b/app/gimplayer.c index b8d09c1881..06fdf11ace 100644 --- a/app/gimplayer.c +++ b/app/gimplayer.c @@ -742,7 +742,7 @@ gimp_layer_scale_lowlevel (GimpLayer *layer, { GIMP_DRAWABLE (layer->mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x; GIMP_DRAWABLE (layer->mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y; - channel_scale (GIMP_CHANNEL (layer->mask), new_width, new_height); + gimp_channel_scale (GIMP_CHANNEL (layer->mask), new_width, new_height); } /* Make sure we're not caching any old selection info */ @@ -1016,8 +1016,8 @@ gimp_layer_resize (GimpLayer *layer, { GIMP_DRAWABLE (layer->mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x; GIMP_DRAWABLE (layer->mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y; - channel_resize (GIMP_CHANNEL (layer->mask), - new_width, new_height, offx, offy); + gimp_channel_resize (GIMP_CHANNEL (layer->mask), + new_width, new_height, offx, offy); } /* Make sure we're not caching any old selection info */ @@ -1114,8 +1114,8 @@ gimp_layer_boundary (GimpLayer *layer, void gimp_layer_invalidate_boundary (GimpLayer *layer) { - GimpImage *gimage; - Channel *mask; + GimpImage *gimage; + GimpChannel *mask; /* first get the selection mask channel */ if (! (gimage = gimp_drawable_gimage (GIMP_DRAWABLE (layer)))) @@ -1130,7 +1130,7 @@ gimp_layer_invalidate_boundary (GimpLayer *layer) mask = gimp_image_get_mask (gimage); /* Only bother with the bounds if there is a selection */ - if (! channel_is_empty (mask)) + if (! gimp_channel_is_empty (mask)) { mask->bounds_known = FALSE; mask->boundary_known = FALSE; diff --git a/app/global_edit.c b/app/global_edit.c index e4db428c9d..621443225f 100644 --- a/app/global_edit.c +++ b/app/global_edit.c @@ -351,7 +351,7 @@ edit_paste (GimpImage *gimage, * it seems like the correct behavior. */ if (! gimage_mask_is_empty (gimage) && !paste_into) - channel_clear (gimp_image_get_mask (gimage)); + gimp_channel_clear (gimp_image_get_mask (gimage)); /* if there's a drawable, add a new floating selection */ if (drawable != NULL) diff --git a/app/gui/channels-dialog.c b/app/gui/channels-dialog.c index 45a3d4c5d8..3bcae08688 100644 --- a/app/gui/channels-dialog.c +++ b/app/gui/channels-dialog.c @@ -81,7 +81,7 @@ struct _ChannelsDialog gint base_type; ChannelType components[3]; - Channel *active_channel; + GimpChannel *active_channel; GimpLayer *floating_sel; GSList *channel_widgets; }; @@ -100,7 +100,7 @@ struct _ChannelWidget /* state information */ GimpImage *gimage; - Channel *channel; + GimpChannel *channel; gint width, height; ChannelType type; @@ -115,9 +115,9 @@ static void channels_dialog_preview_extents (void); static void channels_dialog_set_menu_sensitivity (void); static void channels_dialog_set_channel (ChannelWidget *cw); static void channels_dialog_unset_channel (ChannelWidget *cw); -static void channels_dialog_position_channel (Channel *channel, +static void channels_dialog_position_channel (GimpChannel *channel, gint position); -static void channels_dialog_add_channel (Channel *channel); +static void channels_dialog_add_channel (GimpChannel *channel); static void channels_dialog_remove_channel (ChannelWidget *cw); static gint channel_list_events (GtkWidget *widget, @@ -156,9 +156,9 @@ static gboolean channels_dialog_drag_delete_channel_callback guint time); /* channel widget function prototypes */ -static ChannelWidget * channel_widget_get_ID (Channel *channel); +static ChannelWidget * channel_widget_get_ID (GimpChannel *channel); static ChannelWidget * channel_widget_create (GimpImage *gimage, - Channel *channel, + GimpChannel *channel, ChannelType channel_type); static gboolean channel_widget_drag_motion_callback @@ -410,7 +410,7 @@ void channels_dialog_free (void) { ChannelWidget *cw; - GSList *list; + GSList *list; if (!channelsD) return; @@ -441,7 +441,7 @@ channels_dialog_free (void) void channels_dialog_update (GimpImage* gimage) { - Channel *channel; + GimpChannel *channel; ChannelWidget *cw; GSList *list; GList *item_list; @@ -517,9 +517,11 @@ channels_dialog_update (GimpImage* gimage) for (list = gimage->channels; list; list = g_slist_next (list)) { /* create a channel list item */ - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; + cw = channel_widget_create (gimage, channel, AUXILLARY_CHANNEL); - channelsD->channel_widgets = g_slist_append (channelsD->channel_widgets, cw); + channelsD->channel_widgets = + g_slist_append (channelsD->channel_widgets, cw); item_list = g_list_append (item_list, cw->list_item); } @@ -532,7 +534,7 @@ void channels_dialog_flush (void) { GimpImage *gimage; - Channel *channel; + GimpChannel *channel; ChannelWidget *cw; GSList *list; gint pos; @@ -560,7 +562,7 @@ channels_dialog_flush (void) /* Add any missing channels */ for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; cw = channel_widget_get_ID (channel); /* If the channel isn't in the channel widget list, add it */ @@ -590,7 +592,7 @@ channels_dialog_flush (void) pos = 0; for (list = gimage->channels; list; list = g_slist_next (list)) { - channel = (Channel *) list->data; + channel = (GimpChannel *) list->data; channels_dialog_position_channel (channel, pos++); } @@ -659,8 +661,8 @@ static void channels_dialog_set_menu_sensitivity (void) { ChannelWidget *cw; - gint fs_sens; - gint aux_sens; + gint fs_sens; + gint aux_sens; cw = channel_widget_get_ID (channelsD->active_channel); fs_sens = (channelsD->floating_sel != NULL); @@ -843,11 +845,11 @@ channels_dialog_unset_channel (ChannelWidget *channel_widget) } static void -channels_dialog_position_channel (Channel *channel, - gint new_index) +channels_dialog_position_channel (GimpChannel *channel, + gint new_index) { ChannelWidget *channel_widget; - GList *list = NULL; + GList *list = NULL; channel_widget = channel_widget_get_ID (channel); if (!channelsD || !channel_widget) @@ -881,12 +883,12 @@ channels_dialog_position_channel (Channel *channel, } static void -channels_dialog_add_channel (Channel *channel) +channels_dialog_add_channel (GimpChannel *channel) { ChannelWidget *channel_widget; - GimpImage *gimage; - GList *item_list; - gint position; + GimpImage *gimage; + GList *item_list; + gint position; if (!channelsD || !channel || !(gimage = channelsD->gimage)) return; @@ -1042,16 +1044,16 @@ void channels_dialog_duplicate_channel_callback (GtkWidget *widget, gpointer data) { - GimpImage *gimage; - Channel *active_channel; - Channel *new_channel; + GimpImage *gimage; + GimpChannel *active_channel; + GimpChannel *new_channel; if (!channelsD || !(gimage = channelsD->gimage)) return; if ((active_channel = gimp_image_get_active_channel (gimage))) { - new_channel = channel_copy (active_channel); + new_channel = gimp_channel_copy (active_channel); gimp_image_add_channel (gimage, new_channel, -1); gdisplays_flush (); } @@ -1093,20 +1095,20 @@ void channels_dialog_add_channel_to_sel_callback (GtkWidget *widget, gpointer data) { - GimpImage *gimage; - Channel *active_channel; - Channel *new_channel; + GimpImage *gimage; + GimpChannel *active_channel; + GimpChannel *new_channel; if (!channelsD || !(gimage = channelsD->gimage)) return; if ((active_channel = gimp_image_get_active_channel (gimage))) { - new_channel = channel_copy (gimp_image_get_mask (gimage)); - channel_combine_mask (new_channel, - active_channel, - CHANNEL_OP_ADD, - 0, 0); /* off x/y */ + new_channel = gimp_channel_copy (gimp_image_get_mask (gimage)); + gimp_channel_combine_mask (new_channel, + active_channel, + CHANNEL_OP_ADD, + 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); gtk_object_unref (GTK_OBJECT (new_channel)); gdisplays_flush (); @@ -1117,20 +1119,20 @@ void channels_dialog_sub_channel_from_sel_callback (GtkWidget *widget, gpointer data) { - GimpImage *gimage; - Channel *active_channel; - Channel *new_channel; + GimpImage *gimage; + GimpChannel *active_channel; + GimpChannel *new_channel; if (!channelsD || !(gimage = channelsD->gimage)) return; if ((active_channel = gimp_image_get_active_channel (gimage))) { - new_channel = channel_copy (gimp_image_get_mask (gimage)); - channel_combine_mask (new_channel, - active_channel, - CHANNEL_OP_SUB, - 0, 0); /* off x/y */ + new_channel = gimp_channel_copy (gimp_image_get_mask (gimage)); + gimp_channel_combine_mask (new_channel, + active_channel, + CHANNEL_OP_SUB, + 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); gtk_object_unref (GTK_OBJECT (new_channel)); gdisplays_flush (); @@ -1141,20 +1143,20 @@ void channels_dialog_intersect_channel_with_sel_callback (GtkWidget *widget, gpointer data) { - GimpImage *gimage; - Channel *active_channel; - Channel *new_channel; + GimpImage *gimage; + GimpChannel *active_channel; + GimpChannel *new_channel; if (!channelsD || !(gimage = channelsD->gimage)) return; if ((active_channel = gimp_image_get_active_channel (gimage))) { - new_channel = channel_copy (gimp_image_get_mask (gimage)); - channel_combine_mask (new_channel, - active_channel, - CHANNEL_OP_INTERSECT, - 0, 0); /* off x/y */ + new_channel = gimp_channel_copy (gimp_image_get_mask (gimage)); + gimp_channel_combine_mask (new_channel, + active_channel, + CHANNEL_OP_INTERSECT, + 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); gtk_object_unref (GTK_OBJECT (new_channel)); gdisplays_flush (); @@ -1199,10 +1201,10 @@ channels_dialog_drag_new_channel_callback (GtkWidget *widget, if (src && src->channel == channelsD->active_channel) { - Channel *channel; - GimpImage *gimage; - gint width, height; - gint off_x, off_y; + GimpChannel *channel; + GimpImage *gimage; + gint width, height; + gint off_x, off_y; gimage = channelsD->gimage; @@ -1213,13 +1215,13 @@ channels_dialog_drag_new_channel_callback (GtkWidget *widget, /* Start a group undo */ undo_push_group_start (gimage, EDIT_PASTE_UNDO); - channel = channel_new (gimage, width, height, - _("Empty Channel Copy"), - &src->channel->color); + channel = gimp_channel_new (gimage, width, height, + _("Empty Channel Copy"), + &src->channel->color); if (channel) { drawable_fill (GIMP_DRAWABLE (channel), TRANSPARENT_FILL); - channel_translate (channel, off_x, off_y); + gimp_channel_translate (channel, off_x, off_y); gimp_image_add_channel (gimage, channel, -1); /* End the group undo */ @@ -1340,10 +1342,10 @@ channels_dialog_drag_delete_channel_callback (GtkWidget *widget, /******************************/ static ChannelWidget * -channel_widget_get_ID (Channel *channel) +channel_widget_get_ID (GimpChannel *channel) { ChannelWidget *lw; - GSList *list; + GSList *list; if (!channelsD) return NULL; @@ -1361,14 +1363,14 @@ channel_widget_get_ID (Channel *channel) static ChannelWidget * channel_widget_create (GimpImage *gimage, - Channel *channel, + GimpChannel *channel, ChannelType type) { ChannelWidget *channel_widget; - GtkWidget *list_item; - GtkWidget *hbox; - GtkWidget *vbox; - GtkWidget *alignment; + GtkWidget *list_item; + GtkWidget *hbox; + GtkWidget *vbox; + GtkWidget *alignment; list_item = gtk_list_item_new (); @@ -1632,9 +1634,9 @@ channel_widget_drag_begin_callback (GtkWidget *widget, typedef struct { - GimpImage *gimage; - Channel *channel; - gint dest_index; + GimpImage *gimage; + GimpChannel *channel; + gint dest_index; } ChannelDrop; static gint @@ -1760,7 +1762,7 @@ channel_widget_drop_color (GtkWidget *widget, gpointer data) { ChannelWidget *channel_widget; - Channel *channel; + GimpChannel *channel; channel_widget = (ChannelWidget *) data; channel = channel_widget->channel; @@ -2102,18 +2104,18 @@ channel_widget_preview_redraw (ChannelWidget *channel_widget) if (channelsD->ratio > 1.0) /* Preview is scaling up! */ { - preview_buf = channel_preview (channel_widget->channel, - channelsD->gimage_width, - channelsD->gimage_height); + preview_buf = gimp_channel_preview (channel_widget->channel, + channelsD->gimage_width, + channelsD->gimage_height); preview_buf = gimp_preview_scale (preview_buf, channel_widget->width, channel_widget->height); } else { - preview_buf = channel_preview (channel_widget->channel, - channel_widget->width, - channel_widget->height); + preview_buf = gimp_channel_preview (channel_widget->channel, + channel_widget->width, + channel_widget->height); } break; @@ -2382,7 +2384,7 @@ channel_widget_channel_flush (GtkWidget *widget, gpointer data) { ChannelWidget *channel_widget; - gboolean update_preview = FALSE; + gboolean update_preview = FALSE; channel_widget = (ChannelWidget *) gtk_object_get_user_data (GTK_OBJECT (widget)); @@ -2507,7 +2509,7 @@ new_channel_query_ok_callback (GtkWidget *widget, gpointer data) { NewChannelOptions *options; - Channel *new_channel; + GimpChannel *new_channel; GimpImage *gimage; options = (NewChannelOptions *) data; @@ -2520,9 +2522,9 @@ new_channel_query_ok_callback (GtkWidget *widget, { gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel), &channel_color); - new_channel = channel_new (gimage, gimage->width, gimage->height, - channel_name, - &channel_color); + new_channel = gimp_channel_new (gimage, gimage->width, gimage->height, + channel_name, + &channel_color); drawable_fill (GIMP_DRAWABLE (new_channel), TRANSPARENT_FILL); @@ -2654,7 +2656,7 @@ edit_channel_query_ok_callback (GtkWidget *widget, gpointer data) { EditChannelOptions *options; - Channel *channel; + GimpChannel *channel; GimpRGB color; options = (EditChannelOptions *) data; diff --git a/app/gui/commands.c b/app/gui/commands.c index f156662c7c..38474c3c47 100644 --- a/app/gui/commands.c +++ b/app/gui/commands.c @@ -73,6 +73,7 @@ #include "selection.h" #include "tips_dialog.h" #include "undo.h" +#include "undo_history.h" #ifdef DISPLAY_FILTERS #include "gdisplay_color_ui.h" diff --git a/app/gui/help-commands.c b/app/gui/help-commands.c index f156662c7c..38474c3c47 100644 --- a/app/gui/help-commands.c +++ b/app/gui/help-commands.c @@ -73,6 +73,7 @@ #include "selection.h" #include "tips_dialog.h" #include "undo.h" +#include "undo_history.h" #ifdef DISPLAY_FILTERS #include "gdisplay_color_ui.h" diff --git a/app/gui/layers-dialog.c b/app/gui/layers-dialog.c index 5f0dad2732..315683b424 100644 --- a/app/gui/layers-dialog.c +++ b/app/gui/layers-dialog.c @@ -88,15 +88,15 @@ struct _LayersDialog GtkWidget *layer_preview; /* state information */ - GimpImage *gimage; - gint image_width, image_height; - gint gimage_width, gimage_height; - gdouble ratio; + GimpImage *gimage; + gint image_width, image_height; + gint gimage_width, gimage_height; + gdouble ratio; - GimpLayer *active_layer; - Channel *active_channel; - GimpLayer *floating_sel; - GSList *layer_widgets; + GimpLayer *active_layer; + GimpChannel *active_channel; + GimpLayer *floating_sel; + GSList *layer_widgets; }; typedef struct _LayerWidget LayerWidget; diff --git a/app/gui/qmask-commands.c b/app/gui/qmask-commands.c index a7c594e558..3d078909c9 100644 --- a/app/gui/qmask-commands.c +++ b/app/gui/qmask-commands.c @@ -232,11 +232,11 @@ qmask_activate (GtkWidget *widget, floating_sel_to_layer (layer); } - gmask = channel_new (gimg, - gimg->width, - gimg->height, - "Qmask", - &color); + gmask = gimp_channel_new (gimg, + gimg->width, + gimg->height, + "Qmask", + &color); gimp_image_add_channel (gimg, gmask, 0); drawable_fill (GIMP_DRAWABLE (gmask), TRANSPARENT_FILL); } @@ -244,9 +244,9 @@ qmask_activate (GtkWidget *widget, { /* if selection */ - gmask = channel_copy (gimp_image_get_mask (gimg)); + gmask = gimp_channel_copy (gimp_image_get_mask (gimg)); gimp_image_add_channel (gimg, gmask, 0); - channel_set_color (gmask, &color); + gimp_channel_set_color (gmask, &color); gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask"); gimage_mask_none (gimg); /* Clear the selection */ } @@ -349,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget, gpointer data) { EditQmaskOptions *options; - Channel *channel; + GimpChannel *channel; GimpRGB color; options = (EditQmaskOptions *) data; @@ -364,7 +364,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget, if (gimp_rgba_distance (&color, &channel->color) > 0.0001) { channel->color = color; - channel_update (channel); + gimp_channel_update (channel); } } diff --git a/app/gui/toolbox.c b/app/gui/toolbox.c index 9e8a971de6..4b55896d6b 100644 --- a/app/gui/toolbox.c +++ b/app/gui/toolbox.c @@ -659,15 +659,15 @@ toolbox_drag_drop (GtkWidget *widget, { GimpDrawable *drawable = NULL; GimpLayer *layer = NULL; - Channel *channel = NULL; + GimpChannel *channel = NULL; GimpLayerMask *layer_mask = NULL; GimpImage *component = NULL; ChannelType component_type = -1; layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget), "gimp_layer"); - channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget), - "gimp_channel"); + channel = (GimpChannel *) gtk_object_get_data (GTK_OBJECT (src_widget), + "gimp_channel"); layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget), "gimp_layer_mask"); component = (GImage *) gtk_object_get_data (GTK_OBJECT (src_widget), diff --git a/app/layer.c b/app/layer.c index b8d09c1881..06fdf11ace 100644 --- a/app/layer.c +++ b/app/layer.c @@ -742,7 +742,7 @@ gimp_layer_scale_lowlevel (GimpLayer *layer, { GIMP_DRAWABLE (layer->mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x; GIMP_DRAWABLE (layer->mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y; - channel_scale (GIMP_CHANNEL (layer->mask), new_width, new_height); + gimp_channel_scale (GIMP_CHANNEL (layer->mask), new_width, new_height); } /* Make sure we're not caching any old selection info */ @@ -1016,8 +1016,8 @@ gimp_layer_resize (GimpLayer *layer, { GIMP_DRAWABLE (layer->mask)->offset_x = GIMP_DRAWABLE (layer)->offset_x; GIMP_DRAWABLE (layer->mask)->offset_y = GIMP_DRAWABLE (layer)->offset_y; - channel_resize (GIMP_CHANNEL (layer->mask), - new_width, new_height, offx, offy); + gimp_channel_resize (GIMP_CHANNEL (layer->mask), + new_width, new_height, offx, offy); } /* Make sure we're not caching any old selection info */ @@ -1114,8 +1114,8 @@ gimp_layer_boundary (GimpLayer *layer, void gimp_layer_invalidate_boundary (GimpLayer *layer) { - GimpImage *gimage; - Channel *mask; + GimpImage *gimage; + GimpChannel *mask; /* first get the selection mask channel */ if (! (gimage = gimp_drawable_gimage (GIMP_DRAWABLE (layer)))) @@ -1130,7 +1130,7 @@ gimp_layer_invalidate_boundary (GimpLayer *layer) mask = gimp_image_get_mask (gimage); /* Only bother with the bounds if there is a selection */ - if (! channel_is_empty (mask)) + if (! gimp_channel_is_empty (mask)) { mask->bounds_known = FALSE; mask->boundary_known = FALSE; diff --git a/app/layers_dialog.c b/app/layers_dialog.c index 5f0dad2732..315683b424 100644 --- a/app/layers_dialog.c +++ b/app/layers_dialog.c @@ -88,15 +88,15 @@ struct _LayersDialog GtkWidget *layer_preview; /* state information */ - GimpImage *gimage; - gint image_width, image_height; - gint gimage_width, gimage_height; - gdouble ratio; + GimpImage *gimage; + gint image_width, image_height; + gint gimage_width, gimage_height; + gdouble ratio; - GimpLayer *active_layer; - Channel *active_channel; - GimpLayer *floating_sel; - GSList *layer_widgets; + GimpLayer *active_layer; + GimpChannel *active_channel; + GimpLayer *floating_sel; + GSList *layer_widgets; }; typedef struct _LayerWidget LayerWidget; diff --git a/app/pdb/channel_cmds.c b/app/pdb/channel_cmds.c index 213311ce2d..f031e4d25e 100644 --- a/app/pdb/channel_cmds.c +++ b/app/pdb/channel_cmds.c @@ -82,7 +82,7 @@ channel_new_invoker (Argument *args) gchar *name; gdouble opacity; GimpRGB color; - Channel *channel = NULL; + GimpChannel *channel = NULL; gimage = pdb_id_to_image (args[0].value.pdb_int); if (gimage == NULL) @@ -111,7 +111,7 @@ channel_new_invoker (Argument *args) GimpRGB rgb_color = color; rgb_color.a = opacity / 100.0; - channel = channel_new (gimage, width, height, name, &rgb_color); + channel = gimp_channel_new (gimage, width, height, name, &rgb_color); success = channel != NULL; } @@ -187,15 +187,15 @@ channel_copy_invoker (Argument *args) { gboolean success = TRUE; Argument *return_args; - Channel *channel; - Channel *copy = NULL; + GimpChannel *channel; + GimpChannel *copy = NULL; channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); if (channel == NULL) success = FALSE; if (success) - success = (copy = channel_copy (channel)) != NULL; + success = (copy = gimp_channel_copy (channel)) != NULL; return_args = procedural_db_return_args (&channel_copy_proc, success); @@ -243,7 +243,7 @@ static Argument * channel_delete_invoker (Argument *args) { gboolean success = TRUE; - Channel *channel; + GimpChannel *channel; channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); if (channel == NULL) @@ -284,8 +284,8 @@ static Argument * channel_combine_masks_invoker (Argument *args) { gboolean success = TRUE; - Channel *channel1; - Channel *channel2; + GimpChannel *channel1; + GimpChannel *channel2; gint32 operation; gint32 offx; gint32 offy; @@ -308,7 +308,7 @@ channel_combine_masks_invoker (Argument *args) if (success) { - channel_combine_mask (channel1, channel2, operation, offx, offy); + gimp_channel_combine_mask (channel1, channel2, operation, offx, offy); } return procedural_db_return_args (&channel_combine_masks_proc, success); @@ -364,7 +364,7 @@ channel_get_name_invoker (Argument *args) { gboolean success = TRUE; Argument *return_args; - Channel *channel; + GimpChannel *channel; channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); if (channel == NULL) @@ -373,7 +373,7 @@ channel_get_name_invoker (Argument *args) return_args = procedural_db_return_args (&channel_get_name_proc, success); if (success) - return_args[1].value.pdb_pointer = g_strdup (channel_get_name (channel)); + return_args[1].value.pdb_pointer = g_strdup (gimp_channel_get_name (channel)); return return_args; } @@ -416,7 +416,7 @@ static Argument * channel_set_name_invoker (Argument *args) { gboolean success = TRUE; - Channel *channel; + GimpChannel *channel; gchar *name; channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); @@ -428,7 +428,7 @@ channel_set_name_invoker (Argument *args) success = FALSE; if (success) - channel_set_name (channel, name); + gimp_channel_set_name (channel, name); return procedural_db_return_args (&channel_set_name_proc, success); } @@ -468,7 +468,7 @@ channel_get_visible_invoker (Argument *args) { gboolean success = TRUE; Argument *return_args; - Channel *channel; + GimpChannel *channel; channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); if (channel == NULL) @@ -520,7 +520,7 @@ static Argument * channel_set_visible_invoker (Argument *args) { gboolean success = TRUE; - Channel *channel; + GimpChannel *channel; gboolean visible; channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); @@ -570,7 +570,7 @@ channel_get_show_masked_invoker (Argument *args) { gboolean success = TRUE; Argument *return_args; - Channel *channel; + GimpChannel *channel; channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); if (channel == NULL) @@ -622,7 +622,7 @@ static Argument * channel_set_show_masked_invoker (Argument *args) { gboolean success = TRUE; - Channel *channel; + GimpChannel *channel; gboolean show_masked; channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); @@ -672,7 +672,7 @@ channel_get_opacity_invoker (Argument *args) { gboolean success = TRUE; Argument *return_args; - Channel *channel; + GimpChannel *channel; channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); if (channel == NULL) @@ -724,7 +724,7 @@ static Argument * channel_set_opacity_invoker (Argument *args) { gboolean success = TRUE; - Channel *channel; + GimpChannel *channel; gdouble opacity; channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); @@ -776,7 +776,7 @@ channel_get_color_invoker (Argument *args) { gboolean success = TRUE; Argument *return_args; - Channel *channel; + GimpChannel *channel; GimpRGB color; channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); @@ -834,7 +834,7 @@ static Argument * channel_set_color_invoker (Argument *args) { gboolean success = TRUE; - Channel *channel; + GimpChannel *channel; GimpRGB color; channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); @@ -848,7 +848,7 @@ channel_set_color_invoker (Argument *args) GimpRGB rgb_color = color; rgb_color.a = channel->color.a; - channel_set_color(channel, &rgb_color); + gimp_channel_set_color(channel, &rgb_color); } return procedural_db_return_args (&channel_set_color_proc, success); @@ -889,7 +889,7 @@ channel_get_tattoo_invoker (Argument *args) { gboolean success = TRUE; Argument *return_args; - Channel *channel; + GimpChannel *channel; channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); if (channel == NULL) @@ -898,7 +898,7 @@ channel_get_tattoo_invoker (Argument *args) return_args = procedural_db_return_args (&channel_get_tattoo_proc, success); if (success) - return_args[1].value.pdb_int = channel_get_tattoo (channel); + return_args[1].value.pdb_int = gimp_channel_get_tattoo (channel); return return_args; } @@ -941,7 +941,7 @@ static Argument * channel_set_tattoo_invoker (Argument *args) { gboolean success = TRUE; - Channel *channel; + GimpChannel *channel; gint32 tattoo; channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); @@ -953,7 +953,7 @@ channel_set_tattoo_invoker (Argument *args) success = FALSE; if (success) - channel_set_tattoo (channel, tattoo); + gimp_channel_set_tattoo (channel, tattoo); return procedural_db_return_args (&channel_set_tattoo_proc, success); } diff --git a/app/pdb/color_cmds.c b/app/pdb/color_cmds.c index 168802a6c5..99c9a12572 100644 --- a/app/pdb/color_cmds.c +++ b/app/pdb/color_cmds.c @@ -914,7 +914,7 @@ histogram_invoker (Argument *args) HistogramToolDialog htd; int off_x, off_y; gboolean no_mask; - Channel *mask; + GimpChannel *mask; drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); if (drawable == NULL) diff --git a/app/pdb/drawable_cmds.c b/app/pdb/drawable_cmds.c index 3c9cbcae41..091efa7d3b 100644 --- a/app/pdb/drawable_cmds.c +++ b/app/pdb/drawable_cmds.c @@ -1409,7 +1409,7 @@ drawable_thumbnail_invoker (Argument *args) if (GIMP_IS_LAYER (drawable)) buf = gimp_layer_preview (GIMP_LAYER (drawable), req_width, req_height); else - buf = channel_preview (GIMP_CHANNEL (drawable), req_width, req_height); + buf = gimp_channel_preview (GIMP_CHANNEL (drawable), req_width, req_height); num_pixels = buf->height * buf->width * buf->bytes; thumbnail_data = g_new (guint8, num_pixels); diff --git a/app/pdb/image_cmds.c b/app/pdb/image_cmds.c index f526871301..d37097994d 100644 --- a/app/pdb/image_cmds.c +++ b/app/pdb/image_cmds.c @@ -1459,7 +1459,7 @@ image_raise_channel_invoker (Argument *args) { gboolean success = TRUE; GimpImage *gimage; - Channel *channel; + GimpChannel *channel; gimage = pdb_id_to_image (args[0].value.pdb_int); if (gimage == NULL) @@ -1561,7 +1561,7 @@ image_add_channel_invoker (Argument *args) { gboolean success = TRUE; GimpImage *gimage; - Channel *channel; + GimpChannel *channel; gint32 position; gimage = pdb_id_to_image (args[0].value.pdb_int); @@ -1620,7 +1620,7 @@ image_remove_channel_invoker (Argument *args) { gboolean success = TRUE; GimpImage *gimage; - Channel *channel; + GimpChannel *channel; gimage = pdb_id_to_image (args[0].value.pdb_int); if (gimage == NULL) @@ -2831,7 +2831,7 @@ image_get_active_channel_invoker (Argument *args) gboolean success = TRUE; Argument *return_args; GimpImage *gimage; - Channel *active_channel = NULL; + GimpChannel *active_channel = NULL; gimage = pdb_id_to_image (args[0].value.pdb_int); if (gimage == NULL) @@ -2887,7 +2887,7 @@ image_set_active_channel_invoker (Argument *args) { gboolean success = TRUE; GimpImage *gimage; - Channel *active_channel; + GimpChannel *active_channel; gimage = pdb_id_to_image (args[0].value.pdb_int); if (gimage == NULL) @@ -2939,7 +2939,7 @@ image_get_selection_invoker (Argument *args) gboolean success = TRUE; Argument *return_args; GimpImage *gimage; - Channel *selection = NULL; + GimpChannel *selection = NULL; gimage = pdb_id_to_image (args[0].value.pdb_int); if (gimage == NULL) @@ -3692,7 +3692,7 @@ image_get_channel_by_tattoo_invoker (Argument *args) Argument *return_args; GimpImage *gimage; gint32 tattoo; - Channel *channel = NULL; + GimpChannel *channel = NULL; gimage = pdb_id_to_image (args[0].value.pdb_int); if (gimage == NULL) diff --git a/app/pdb/pdb_glue.h b/app/pdb/pdb_glue.h index 9ede3995b9..8ac3c4fa4b 100644 --- a/app/pdb/pdb_glue.h +++ b/app/pdb/pdb_glue.h @@ -29,10 +29,10 @@ #define gimp_layer_set_tattoo(l,t) gimp_drawable_set_tattoo(GIMP_DRAWABLE(l),(t)) #define gimp_layer_get_tattoo(l) gimp_drawable_get_tattoo(GIMP_DRAWABLE(l)) -#define channel_set_name(c,n) gimp_object_set_name(GIMP_OBJECT(c),(n)) -#define channel_get_name(c) gimp_object_get_name(GIMP_OBJECT(c)) -#define channel_set_tattoo(c,t) gimp_drawable_set_tattoo(GIMP_DRAWABLE(c),(t)) -#define channel_get_tattoo(c) gimp_drawable_get_tattoo(GIMP_DRAWABLE(c)) +#define gimp_channel_set_name(c,n) gimp_object_set_name(GIMP_OBJECT(c),(n)) +#define gimp_channel_get_name(c) gimp_object_get_name(GIMP_OBJECT(c)) +#define gimp_channel_set_tattoo(c,t) gimp_drawable_set_tattoo(GIMP_DRAWABLE(c),(t)) +#define gimp_channel_get_tattoo(c) gimp_drawable_get_tattoo(GIMP_DRAWABLE(c)) #endif /* __PDB_GLUE_H__ */ diff --git a/app/pdb/selection_cmds.c b/app/pdb/selection_cmds.c index 368c4a1da5..cc3d278499 100644 --- a/app/pdb/selection_cmds.c +++ b/app/pdb/selection_cmds.c @@ -876,7 +876,7 @@ static Argument * selection_load_invoker (Argument *args) { gboolean success = TRUE; - Channel *channel; + GimpChannel *channel; GimpImage *gimage; channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); @@ -928,7 +928,7 @@ selection_save_invoker (Argument *args) gboolean success = TRUE; Argument *return_args; GimpImage *gimage; - Channel *channel = NULL; + GimpChannel *channel = NULL; gimage = pdb_id_to_image (args[0].value.pdb_int); if (gimage == NULL) @@ -983,10 +983,10 @@ static Argument * selection_combine_invoker (Argument *args) { gboolean success = TRUE; - Channel *channel; + GimpChannel *channel; gint32 operation; GimpImage *gimage; - Channel *new_channel; + GimpChannel *new_channel; channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); if (channel == NULL) @@ -1003,11 +1003,11 @@ selection_combine_invoker (Argument *args) if (gimp_drawable_width (GIMP_DRAWABLE (channel)) == gimage->width && gimp_drawable_height (GIMP_DRAWABLE (channel)) == gimage->height) { - new_channel = channel_copy (gimp_image_get_mask (gimage)); - channel_combine_mask (new_channel, - channel, - operation, - 0, 0); /* off x/y */ + new_channel = gimp_channel_copy (gimp_image_get_mask (gimage)); + gimp_channel_combine_mask (new_channel, + channel, + operation, + 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); gtk_object_unref (GTK_OBJECT (new_channel)); } diff --git a/app/pdb/tools_cmds.c b/app/pdb/tools_cmds.c index 4b8bf9e0fc..d5ce94507c 100644 --- a/app/pdb/tools_cmds.c +++ b/app/pdb/tools_cmds.c @@ -1782,7 +1782,7 @@ fuzzy_select_invoker (Argument *args) gdouble feather_radius; gboolean sample_merged; GimpImage *gimage; - Channel *new, *old_fuzzy_mask; + GimpChannel *new, *old_fuzzy_mask; drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); if (drawable == NULL) diff --git a/app/qmask.c b/app/qmask.c index a7c594e558..3d078909c9 100644 --- a/app/qmask.c +++ b/app/qmask.c @@ -232,11 +232,11 @@ qmask_activate (GtkWidget *widget, floating_sel_to_layer (layer); } - gmask = channel_new (gimg, - gimg->width, - gimg->height, - "Qmask", - &color); + gmask = gimp_channel_new (gimg, + gimg->width, + gimg->height, + "Qmask", + &color); gimp_image_add_channel (gimg, gmask, 0); drawable_fill (GIMP_DRAWABLE (gmask), TRANSPARENT_FILL); } @@ -244,9 +244,9 @@ qmask_activate (GtkWidget *widget, { /* if selection */ - gmask = channel_copy (gimp_image_get_mask (gimg)); + gmask = gimp_channel_copy (gimp_image_get_mask (gimg)); gimp_image_add_channel (gimg, gmask, 0); - channel_set_color (gmask, &color); + gimp_channel_set_color (gmask, &color); gimp_object_set_name (GIMP_OBJECT (gmask), "Qmask"); gimage_mask_none (gimg); /* Clear the selection */ } @@ -349,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget, gpointer data) { EditQmaskOptions *options; - Channel *channel; + GimpChannel *channel; GimpRGB color; options = (EditQmaskOptions *) data; @@ -364,7 +364,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget, if (gimp_rgba_distance (&color, &channel->color) > 0.0001) { channel->color = color; - channel_update (channel); + gimp_channel_update (channel); } } diff --git a/app/scan_convert.c b/app/scan_convert.c index 32c0fab9b0..dead5cfe53 100644 --- a/app/scan_convert.c +++ b/app/scan_convert.c @@ -235,11 +235,11 @@ scan_converter_add_points (ScanConverter *sc, * according to the even-odd rule. The polygon is closed by * joining the final point to the initial point. */ -Channel * +GimpChannel * scan_converter_to_channel (ScanConverter *sc, GimpImage *gimage) { - Channel *mask; + GimpChannel *mask; GSList *list; PixelRegion maskPR; guint widtha; @@ -267,7 +267,7 @@ scan_converter_to_channel (ScanConverter *sc, (int) sc->first.y * antialias); } - mask = channel_new_mask (gimage, sc->width, sc->height); + mask = gimp_channel_new_mask (gimage, sc->width, sc->height); buf = g_new0 (guchar, sc->width); widtha = sc->width * antialias; @@ -320,7 +320,7 @@ scan_converter_to_channel (ScanConverter *sc, { if (antialias == 1) { - channel_add_segment (mask, x, i, w, 255); + gimp_channel_add_segment (mask, x, i, w, 255); } else { diff --git a/app/scan_convert.h b/app/scan_convert.h index df691179cd..f1bf8ac925 100644 --- a/app/scan_convert.h +++ b/app/scan_convert.h @@ -53,7 +53,7 @@ void scan_converter_add_points (ScanConverter *scan_converter, * according to the even-odd rule. The polygon is closed by * joining the final point to the initial point. */ -Channel * scan_converter_to_channel (ScanConverter *scan_converter, +GimpChannel * scan_converter_to_channel (ScanConverter *scan_converter, GimpImage *gimage); diff --git a/app/toolbox.c b/app/toolbox.c index 9e8a971de6..4b55896d6b 100644 --- a/app/toolbox.c +++ b/app/toolbox.c @@ -659,15 +659,15 @@ toolbox_drag_drop (GtkWidget *widget, { GimpDrawable *drawable = NULL; GimpLayer *layer = NULL; - Channel *channel = NULL; + GimpChannel *channel = NULL; GimpLayerMask *layer_mask = NULL; GimpImage *component = NULL; ChannelType component_type = -1; layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget), "gimp_layer"); - channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget), - "gimp_channel"); + channel = (GimpChannel *) gtk_object_get_data (GTK_OBJECT (src_widget), + "gimp_channel"); layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget), "gimp_layer_mask"); component = (GImage *) gtk_object_get_data (GTK_OBJECT (src_widget), diff --git a/app/tools/bezier_select.c b/app/tools/bezier_select.c index 3a09996bfa..6378507fc7 100644 --- a/app/tools/bezier_select.c +++ b/app/tools/bezier_select.c @@ -1239,7 +1239,7 @@ bezier_select_button_press (Tool *tool, } } - if (!grab_pointer && channel_value (bezier_sel->mask, x, y)) + if (!grab_pointer && gimp_channel_value (bezier_sel->mask, x, y)) { gboolean replace = FALSE; @@ -1744,7 +1744,7 @@ bezier_select_cursor_update (Tool *tool, on_curve = bezier_point_on_curve (gdisp, bezier_sel, x, y, halfwidth); if (bezier_sel->mask && bezier_sel->closed && - channel_value(bezier_sel->mask, x, y) && + gimp_channel_value (bezier_sel->mask, x, y) && !on_control_pnt && (!on_curve || ModeEdit != EXTEND_ADD)) { @@ -2472,9 +2472,9 @@ bezier_convert (BezierSelect *bezier_sel, } /* create a new mask */ - bezier_sel->mask = channel_new_mask (gdisp->gimage, - gdisp->gimage->width, - gdisp->gimage->height); + bezier_sel->mask = gimp_channel_new_mask (gdisp->gimage, + gdisp->gimage->width, + gdisp->gimage->height); gtk_object_ref (GTK_OBJECT (bezier_sel->mask)); gtk_object_sink (GTK_OBJECT (bezier_sel->mask)); @@ -2537,7 +2537,7 @@ bezier_convert (BezierSelect *bezier_sel, w = x2 - x; if (!antialias) - channel_add_segment (bezier_sel->mask, x, i, w, 255); + gimp_channel_add_segment (bezier_sel->mask, x, i, w, 255); else for (j = 0; j < w; j++) vals[j + x] += 255; @@ -2576,7 +2576,7 @@ bezier_convert (BezierSelect *bezier_sel, g_free (bezier_sel->scanlines); bezier_sel->scanlines = NULL; - channel_invalidate_bounds (bezier_sel->mask); + gimp_channel_invalidate_bounds (bezier_sel->mask); } static void @@ -2879,14 +2879,14 @@ bezier_to_sel_internal (BezierSelect *bezier_sel, gimage_mask_undo (gdisp->gimage); if (bezier_options->feather) - channel_feather (bezier_sel->mask, - gimp_image_get_mask (gdisp->gimage), - bezier_options->feather_radius, - bezier_options->feather_radius, - op, 0, 0); + gimp_channel_feather (bezier_sel->mask, + gimp_image_get_mask (gdisp->gimage), + bezier_options->feather_radius, + bezier_options->feather_radius, + op, 0, 0); else - channel_combine_mask (gimp_image_get_mask (gdisp->gimage), - bezier_sel->mask, op, 0, 0); + gimp_channel_combine_mask (gimp_image_get_mask (gdisp->gimage), + bezier_sel->mask, op, 0, 0); /* show selection on all views */ gdisplays_flush (); diff --git a/app/tools/bezier_selectP.h b/app/tools/bezier_selectP.h index 87b76aec96..1e87e88c31 100644 --- a/app/tools/bezier_selectP.h +++ b/app/tools/bezier_selectP.h @@ -62,7 +62,7 @@ struct _BezierSelect BezierPoint *cur_control; /* the current active control point */ BezierPoint *last_point; /* the last point on the curve */ gint num_points; /* number of points in the curve */ - Channel *mask; /* null if the curve is open */ + GimpChannel *mask; /* null if the curve is open */ GSList **scanlines; /* used in converting a curve */ }; diff --git a/app/tools/blend.c b/app/tools/blend.c index 8ddd08f91f..b55f36cdb6 100644 --- a/app/tools/blend.c +++ b/app/tools/blend.c @@ -1221,7 +1221,7 @@ gradient_precalc_shapeburst (GImage *gimage, PixelRegion *PR, gdouble dist) { - Channel *mask; + GimpChannel *mask; PixelRegion tempR; gfloat max_iteration; gfloat *distp; diff --git a/app/tools/bucket_fill.c b/app/tools/bucket_fill.c index cca7337c6a..c231eb1e07 100644 --- a/app/tools/bucket_fill.c +++ b/app/tools/bucket_fill.c @@ -370,7 +370,7 @@ bucket_fill (GimpImage *gimage, { TileManager *buf_tiles; PixelRegion bufPR, maskPR; - Channel *mask = NULL; + GimpChannel *mask = NULL; gint bytes; gboolean has_alpha; gint x1, y1, x2, y2; @@ -442,7 +442,7 @@ bucket_fill (GimpImage *gimage, mask = find_contiguous_region (gimage, drawable, TRUE, (int) threshold, (int) x, (int) y, sample_merged); - channel_bounds (mask, &x1, &y1, &x2, &y2); + gimp_channel_bounds (mask, &x1, &y1, &x2, &y2); /* make sure we handle the mask correctly if it was sample-merged */ if (sample_merged) diff --git a/app/tools/by_color_select.c b/app/tools/by_color_select.c index 658c730212..08f8529eaf 100644 --- a/app/tools/by_color_select.c +++ b/app/tools/by_color_select.c @@ -155,7 +155,7 @@ static gint is_pixel_sufficiently_different (guchar *, gint , gint , gint ); -static Channel * by_color_select_color (GImage *, +static GimpChannel * by_color_select_color (GImage *, GimpDrawable *, guchar *, gint , @@ -214,7 +214,7 @@ is_pixel_sufficiently_different (guchar *col1, } } -static Channel * +static GimpChannel * by_color_select_color (GImage *gimage, GimpDrawable *drawable, guchar *color, @@ -227,7 +227,7 @@ by_color_select_color (GImage *gimage, * use the same antialiasing scheme as in fuzzy_select. Modify the gimage's * mask to reflect the additional selection */ - Channel *mask; + GimpChannel *mask; PixelRegion imagePR, maskPR; guchar *image_data; guchar *mask_data; @@ -279,7 +279,7 @@ by_color_select_color (GImage *gimage, } alpha = bytes - 1; - mask = channel_new_mask (gimage, width, height); + mask = gimp_channel_new_mask (gimage, width, height); pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE (mask)), 0, 0, width, height, TRUE); @@ -334,8 +334,8 @@ by_color_select (GImage *gimage, gdouble feather_radius, gboolean sample_merged) { - Channel *new_mask; - gint off_x, off_y; + GimpChannel *new_mask; + gint off_x, off_y; if (!drawable) return; @@ -359,13 +359,13 @@ by_color_select (GImage *gimage, } if (feather) - channel_feather (new_mask, gimp_image_get_mask (gimage), - feather_radius, - feather_radius, - op, off_x, off_y); + gimp_channel_feather (new_mask, gimp_image_get_mask (gimage), + feather_radius, + feather_radius, + op, off_x, off_y); else - channel_combine_mask (gimp_image_get_mask (gimage), - new_mask, op, off_x, off_y); + gimp_channel_combine_mask (gimp_image_get_mask (gimage), + new_mask, op, off_x, off_y); gtk_object_unref (GTK_OBJECT (new_mask)); } @@ -901,16 +901,16 @@ static void by_color_select_render (ByColorDialog *bcd, GImage *gimage) { - Channel * mask; - MaskBuf * scaled_buf = NULL; - guchar *buf; - PixelRegion srcPR, destPR; - guchar *src; - gint subsample; - gint width, height; - gint srcwidth; - gint i; - gint scale; + GimpChannel *mask; + MaskBuf *scaled_buf = NULL; + guchar *buf; + PixelRegion srcPR, destPR; + guchar *src; + gint subsample; + gint width, height; + gint srcwidth; + gint i; + gint scale; mask = gimp_image_get_mask (gimage); if ((gimp_drawable_width (GIMP_DRAWABLE(mask)) > PREVIEW_WIDTH) || diff --git a/app/tools/crop.c b/app/tools/crop.c index 0e56f1807f..42712eb5f6 100644 --- a/app/tools/crop.c +++ b/app/tools/crop.c @@ -874,15 +874,15 @@ crop_image (GImage *gimage, gboolean layer_only, gboolean crop_layers) { - GimpLayer *layer; - GimpLayer *floating_layer; - Channel *channel; - GList *guide_list_ptr; - GSList *list; - gint width, height; - gint lx1, ly1, lx2, ly2; - gint off_x, off_y; - gint doff_x, doff_y; + GimpLayer *layer; + GimpLayer *floating_layer; + GimpChannel *channel; + GList *guide_list_ptr; + GSList *list; + gint width, height; + gint lx1, ly1, lx2, ly2; + gint off_x, off_y; + gint doff_x, doff_y; width = x2 - x1; height = y2 - y1; @@ -934,13 +934,13 @@ crop_image (GImage *gimage, list = gimage->channels; while (list) { - channel = (Channel *) list->data; - channel_resize (channel, width, height, -x1, -y1); + channel = (GimpChannel *) list->data; + gimp_channel_resize (channel, width, height, -x1, -y1); list = g_slist_next (list); } /* Don't forget the selection mask! */ - channel_resize (gimage->selection_mask, width, height, -x1, -y1); + gimp_channel_resize (gimage->selection_mask, width, height, -x1, -y1); gimage_mask_invalidate (gimage); /* crop all layers */ diff --git a/app/tools/ellipse_select.c b/app/tools/ellipse_select.c index c51d602404..635955841d 100644 --- a/app/tools/ellipse_select.c +++ b/app/tools/ellipse_select.c @@ -57,7 +57,7 @@ ellipse_select (GimpImage *gimage, gboolean feather, gdouble feather_radius) { - Channel *new_mask; + GimpChannel *new_mask; /* if applicable, replace the current selection */ if (op == SELECTION_REPLACE) @@ -70,24 +70,29 @@ ellipse_select (GimpImage *gimage, */ if (feather) { - new_mask = channel_new_mask (gimage, gimage->width, gimage->height); - channel_combine_ellipse (new_mask, CHANNEL_OP_ADD, x, y, w, h, antialias); - channel_feather (new_mask, gimp_image_get_mask (gimage), - feather_radius, - feather_radius, - op, 0, 0); + new_mask = gimp_channel_new_mask (gimage, gimage->width, gimage->height); + gimp_channel_combine_ellipse (new_mask, CHANNEL_OP_ADD, + x, y, w, h, antialias); + gimp_channel_feather (new_mask, gimp_image_get_mask (gimage), + feather_radius, + feather_radius, + op, 0, 0); gtk_object_unref (GTK_OBJECT (new_mask)); } else if (op == SELECTION_INTERSECT) { - new_mask = channel_new_mask (gimage, gimage->width, gimage->height); - channel_combine_ellipse (new_mask, CHANNEL_OP_ADD, x, y, w, h, antialias); - channel_combine_mask (gimp_image_get_mask (gimage), new_mask, op, 0, 0); + new_mask = gimp_channel_new_mask (gimage, gimage->width, gimage->height); + gimp_channel_combine_ellipse (new_mask, CHANNEL_OP_ADD, + x, y, w, h, antialias); + gimp_channel_combine_mask (gimp_image_get_mask (gimage), new_mask, + op, 0, 0); gtk_object_unref (GTK_OBJECT (new_mask)); } else - channel_combine_ellipse (gimp_image_get_mask (gimage), op, - x, y, w, h, antialias); + { + gimp_channel_combine_ellipse (gimp_image_get_mask (gimage), op, + x, y, w, h, antialias); + } } void diff --git a/app/tools/free_select.c b/app/tools/free_select.c index d8f2808b91..4761c486d6 100644 --- a/app/tools/free_select.c +++ b/app/tools/free_select.c @@ -111,7 +111,7 @@ add_point (gint num_pts, } -static Channel * +static GimpChannel * scan_convert (GimpImage *gimage, gint num_pts, ScanConvertPoint *pts, @@ -119,7 +119,7 @@ scan_convert (GimpImage *gimage, gint height, gboolean antialias) { - Channel *mask; + GimpChannel *mask; ScanConverter *sc; sc = scan_converter_new (width, height, antialias ? SUPERSAMPLE : 1); @@ -144,7 +144,7 @@ free_select (GImage *gimage, gboolean feather, gdouble feather_radius) { - Channel *mask; + GimpChannel *mask; /* if applicable, replace the current selection */ /* or insure that a floating selection is anchored down... */ @@ -159,13 +159,13 @@ free_select (GImage *gimage, if (mask) { if (feather) - channel_feather (mask, gimp_image_get_mask (gimage), - feather_radius, - feather_radius, - op, 0, 0); + gimp_channel_feather (mask, gimp_image_get_mask (gimage), + feather_radius, + feather_radius, + op, 0, 0); else - channel_combine_mask (gimp_image_get_mask (gimage), - mask, op, 0, 0); + gimp_channel_combine_mask (gimp_image_get_mask (gimage), + mask, op, 0, 0); gtk_object_unref (GTK_OBJECT (mask)); } diff --git a/app/tools/fuzzy_select.c b/app/tools/fuzzy_select.c index e64ef681e1..646cdf333a 100644 --- a/app/tools/fuzzy_select.c +++ b/app/tools/fuzzy_select.c @@ -98,7 +98,7 @@ static SelectionOptions *fuzzy_options = NULL; static GdkSegment *segs = NULL; static gint num_segs = 0; -Channel * fuzzy_mask = NULL; +GimpChannel * fuzzy_mask = NULL; /*************************************/ @@ -298,7 +298,7 @@ find_contiguous_region_helper (PixelRegion *mask, } } -Channel * +GimpChannel * find_contiguous_region (GImage *gimage, GimpDrawable *drawable, gboolean antialias, @@ -307,14 +307,14 @@ find_contiguous_region (GImage *gimage, gint y, gboolean sample_merged) { - PixelRegion srcPR, maskPR; - Channel *mask; - guchar *start; - gboolean has_alpha; - gboolean indexed; - gint type; - gint bytes; - Tile *tile; + PixelRegion srcPR, maskPR; + GimpChannel *mask; + guchar *start; + gboolean has_alpha; + gboolean indexed; + gint type; + gint bytes; + Tile *tile; if (sample_merged) { @@ -341,7 +341,7 @@ find_contiguous_region (GImage *gimage, { bytes = has_alpha ? 4 : 3; } - mask = channel_new_mask (gimage, srcPR.w, srcPR.h); + mask = gimp_channel_new_mask (gimage, srcPR.w, srcPR.h); pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE(mask)), 0, 0, gimp_drawable_width (GIMP_DRAWABLE(mask)), @@ -383,13 +383,13 @@ fuzzy_select (GImage *gimage, off_x = off_y = 0; if (feather) - channel_feather (fuzzy_mask, gimp_image_get_mask (gimage), - feather_radius, - feather_radius, - op, off_x, off_y); + gimp_channel_feather (fuzzy_mask, gimp_image_get_mask (gimage), + feather_radius, + feather_radius, + op, off_x, off_y); else - channel_combine_mask (gimp_image_get_mask (gimage), - fuzzy_mask, op, off_x, off_y); + gimp_channel_combine_mask (gimp_image_get_mask (gimage), + fuzzy_mask, op, off_x, off_y); gtk_object_unref (GTK_OBJECT (fuzzy_mask)); fuzzy_mask = NULL; @@ -534,7 +534,7 @@ fuzzy_select_calculate (Tool *tool, { PixelRegion maskPR; FuzzySelect *fuzzy_sel; - Channel *new; + GimpChannel *new; GdkSegment *segs; BoundSeg *bsegs; GimpDrawable *drawable; diff --git a/app/tools/fuzzy_select.h b/app/tools/fuzzy_select.h index 42533a19db..049dba3205 100644 --- a/app/tools/fuzzy_select.h +++ b/app/tools/fuzzy_select.h @@ -20,24 +20,24 @@ #define __FUZZY_SELECT_H__ -Channel * find_contiguous_region (GimpImage *gimage, - GimpDrawable *drawable, - gboolean antialias, - gint threshold, - gint x, - gint y, - gboolean sample_merged); -void fuzzy_select (GimpImage *gimage, - GimpDrawable *drawable, - gint op, - gboolean feather, - gdouble feather_radius); +GimpChannel * find_contiguous_region (GimpImage *gimage, + GimpDrawable *drawable, + gboolean antialias, + gint threshold, + gint x, + gint y, + gboolean sample_merged); +void fuzzy_select (GimpImage *gimage, + GimpDrawable *drawable, + gint op, + gboolean feather, + gdouble feather_radius); -Tool * tools_new_fuzzy_select (void); -void tools_free_fuzzy_select (Tool *tool); +Tool * tools_new_fuzzy_select (void); +void tools_free_fuzzy_select (Tool *tool); -extern Channel *fuzzy_mask; +extern GimpChannel *fuzzy_mask; #endif /* __FUZZY_SELECT_H__ */ diff --git a/app/tools/gimpblendtool.c b/app/tools/gimpblendtool.c index 8ddd08f91f..b55f36cdb6 100644 --- a/app/tools/gimpblendtool.c +++ b/app/tools/gimpblendtool.c @@ -1221,7 +1221,7 @@ gradient_precalc_shapeburst (GImage *gimage, PixelRegion *PR, gdouble dist) { - Channel *mask; + GimpChannel *mask; PixelRegion tempR; gfloat max_iteration; gfloat *distp; diff --git a/app/tools/gimpbucketfilltool.c b/app/tools/gimpbucketfilltool.c index cca7337c6a..c231eb1e07 100644 --- a/app/tools/gimpbucketfilltool.c +++ b/app/tools/gimpbucketfilltool.c @@ -370,7 +370,7 @@ bucket_fill (GimpImage *gimage, { TileManager *buf_tiles; PixelRegion bufPR, maskPR; - Channel *mask = NULL; + GimpChannel *mask = NULL; gint bytes; gboolean has_alpha; gint x1, y1, x2, y2; @@ -442,7 +442,7 @@ bucket_fill (GimpImage *gimage, mask = find_contiguous_region (gimage, drawable, TRUE, (int) threshold, (int) x, (int) y, sample_merged); - channel_bounds (mask, &x1, &y1, &x2, &y2); + gimp_channel_bounds (mask, &x1, &y1, &x2, &y2); /* make sure we handle the mask correctly if it was sample-merged */ if (sample_merged) diff --git a/app/tools/gimpbycolorselecttool.c b/app/tools/gimpbycolorselecttool.c index 658c730212..08f8529eaf 100644 --- a/app/tools/gimpbycolorselecttool.c +++ b/app/tools/gimpbycolorselecttool.c @@ -155,7 +155,7 @@ static gint is_pixel_sufficiently_different (guchar *, gint , gint , gint ); -static Channel * by_color_select_color (GImage *, +static GimpChannel * by_color_select_color (GImage *, GimpDrawable *, guchar *, gint , @@ -214,7 +214,7 @@ is_pixel_sufficiently_different (guchar *col1, } } -static Channel * +static GimpChannel * by_color_select_color (GImage *gimage, GimpDrawable *drawable, guchar *color, @@ -227,7 +227,7 @@ by_color_select_color (GImage *gimage, * use the same antialiasing scheme as in fuzzy_select. Modify the gimage's * mask to reflect the additional selection */ - Channel *mask; + GimpChannel *mask; PixelRegion imagePR, maskPR; guchar *image_data; guchar *mask_data; @@ -279,7 +279,7 @@ by_color_select_color (GImage *gimage, } alpha = bytes - 1; - mask = channel_new_mask (gimage, width, height); + mask = gimp_channel_new_mask (gimage, width, height); pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE (mask)), 0, 0, width, height, TRUE); @@ -334,8 +334,8 @@ by_color_select (GImage *gimage, gdouble feather_radius, gboolean sample_merged) { - Channel *new_mask; - gint off_x, off_y; + GimpChannel *new_mask; + gint off_x, off_y; if (!drawable) return; @@ -359,13 +359,13 @@ by_color_select (GImage *gimage, } if (feather) - channel_feather (new_mask, gimp_image_get_mask (gimage), - feather_radius, - feather_radius, - op, off_x, off_y); + gimp_channel_feather (new_mask, gimp_image_get_mask (gimage), + feather_radius, + feather_radius, + op, off_x, off_y); else - channel_combine_mask (gimp_image_get_mask (gimage), - new_mask, op, off_x, off_y); + gimp_channel_combine_mask (gimp_image_get_mask (gimage), + new_mask, op, off_x, off_y); gtk_object_unref (GTK_OBJECT (new_mask)); } @@ -901,16 +901,16 @@ static void by_color_select_render (ByColorDialog *bcd, GImage *gimage) { - Channel * mask; - MaskBuf * scaled_buf = NULL; - guchar *buf; - PixelRegion srcPR, destPR; - guchar *src; - gint subsample; - gint width, height; - gint srcwidth; - gint i; - gint scale; + GimpChannel *mask; + MaskBuf *scaled_buf = NULL; + guchar *buf; + PixelRegion srcPR, destPR; + guchar *src; + gint subsample; + gint width, height; + gint srcwidth; + gint i; + gint scale; mask = gimp_image_get_mask (gimage); if ((gimp_drawable_width (GIMP_DRAWABLE(mask)) > PREVIEW_WIDTH) || diff --git a/app/tools/gimpcroptool.c b/app/tools/gimpcroptool.c index 0e56f1807f..42712eb5f6 100644 --- a/app/tools/gimpcroptool.c +++ b/app/tools/gimpcroptool.c @@ -874,15 +874,15 @@ crop_image (GImage *gimage, gboolean layer_only, gboolean crop_layers) { - GimpLayer *layer; - GimpLayer *floating_layer; - Channel *channel; - GList *guide_list_ptr; - GSList *list; - gint width, height; - gint lx1, ly1, lx2, ly2; - gint off_x, off_y; - gint doff_x, doff_y; + GimpLayer *layer; + GimpLayer *floating_layer; + GimpChannel *channel; + GList *guide_list_ptr; + GSList *list; + gint width, height; + gint lx1, ly1, lx2, ly2; + gint off_x, off_y; + gint doff_x, doff_y; width = x2 - x1; height = y2 - y1; @@ -934,13 +934,13 @@ crop_image (GImage *gimage, list = gimage->channels; while (list) { - channel = (Channel *) list->data; - channel_resize (channel, width, height, -x1, -y1); + channel = (GimpChannel *) list->data; + gimp_channel_resize (channel, width, height, -x1, -y1); list = g_slist_next (list); } /* Don't forget the selection mask! */ - channel_resize (gimage->selection_mask, width, height, -x1, -y1); + gimp_channel_resize (gimage->selection_mask, width, height, -x1, -y1); gimage_mask_invalidate (gimage); /* crop all layers */ diff --git a/app/tools/gimpellipseselecttool.c b/app/tools/gimpellipseselecttool.c index c51d602404..635955841d 100644 --- a/app/tools/gimpellipseselecttool.c +++ b/app/tools/gimpellipseselecttool.c @@ -57,7 +57,7 @@ ellipse_select (GimpImage *gimage, gboolean feather, gdouble feather_radius) { - Channel *new_mask; + GimpChannel *new_mask; /* if applicable, replace the current selection */ if (op == SELECTION_REPLACE) @@ -70,24 +70,29 @@ ellipse_select (GimpImage *gimage, */ if (feather) { - new_mask = channel_new_mask (gimage, gimage->width, gimage->height); - channel_combine_ellipse (new_mask, CHANNEL_OP_ADD, x, y, w, h, antialias); - channel_feather (new_mask, gimp_image_get_mask (gimage), - feather_radius, - feather_radius, - op, 0, 0); + new_mask = gimp_channel_new_mask (gimage, gimage->width, gimage->height); + gimp_channel_combine_ellipse (new_mask, CHANNEL_OP_ADD, + x, y, w, h, antialias); + gimp_channel_feather (new_mask, gimp_image_get_mask (gimage), + feather_radius, + feather_radius, + op, 0, 0); gtk_object_unref (GTK_OBJECT (new_mask)); } else if (op == SELECTION_INTERSECT) { - new_mask = channel_new_mask (gimage, gimage->width, gimage->height); - channel_combine_ellipse (new_mask, CHANNEL_OP_ADD, x, y, w, h, antialias); - channel_combine_mask (gimp_image_get_mask (gimage), new_mask, op, 0, 0); + new_mask = gimp_channel_new_mask (gimage, gimage->width, gimage->height); + gimp_channel_combine_ellipse (new_mask, CHANNEL_OP_ADD, + x, y, w, h, antialias); + gimp_channel_combine_mask (gimp_image_get_mask (gimage), new_mask, + op, 0, 0); gtk_object_unref (GTK_OBJECT (new_mask)); } else - channel_combine_ellipse (gimp_image_get_mask (gimage), op, - x, y, w, h, antialias); + { + gimp_channel_combine_ellipse (gimp_image_get_mask (gimage), op, + x, y, w, h, antialias); + } } void diff --git a/app/tools/gimpfreeselecttool.c b/app/tools/gimpfreeselecttool.c index d8f2808b91..4761c486d6 100644 --- a/app/tools/gimpfreeselecttool.c +++ b/app/tools/gimpfreeselecttool.c @@ -111,7 +111,7 @@ add_point (gint num_pts, } -static Channel * +static GimpChannel * scan_convert (GimpImage *gimage, gint num_pts, ScanConvertPoint *pts, @@ -119,7 +119,7 @@ scan_convert (GimpImage *gimage, gint height, gboolean antialias) { - Channel *mask; + GimpChannel *mask; ScanConverter *sc; sc = scan_converter_new (width, height, antialias ? SUPERSAMPLE : 1); @@ -144,7 +144,7 @@ free_select (GImage *gimage, gboolean feather, gdouble feather_radius) { - Channel *mask; + GimpChannel *mask; /* if applicable, replace the current selection */ /* or insure that a floating selection is anchored down... */ @@ -159,13 +159,13 @@ free_select (GImage *gimage, if (mask) { if (feather) - channel_feather (mask, gimp_image_get_mask (gimage), - feather_radius, - feather_radius, - op, 0, 0); + gimp_channel_feather (mask, gimp_image_get_mask (gimage), + feather_radius, + feather_radius, + op, 0, 0); else - channel_combine_mask (gimp_image_get_mask (gimage), - mask, op, 0, 0); + gimp_channel_combine_mask (gimp_image_get_mask (gimage), + mask, op, 0, 0); gtk_object_unref (GTK_OBJECT (mask)); } diff --git a/app/tools/gimpfuzzyselecttool.c b/app/tools/gimpfuzzyselecttool.c index e64ef681e1..646cdf333a 100644 --- a/app/tools/gimpfuzzyselecttool.c +++ b/app/tools/gimpfuzzyselecttool.c @@ -98,7 +98,7 @@ static SelectionOptions *fuzzy_options = NULL; static GdkSegment *segs = NULL; static gint num_segs = 0; -Channel * fuzzy_mask = NULL; +GimpChannel * fuzzy_mask = NULL; /*************************************/ @@ -298,7 +298,7 @@ find_contiguous_region_helper (PixelRegion *mask, } } -Channel * +GimpChannel * find_contiguous_region (GImage *gimage, GimpDrawable *drawable, gboolean antialias, @@ -307,14 +307,14 @@ find_contiguous_region (GImage *gimage, gint y, gboolean sample_merged) { - PixelRegion srcPR, maskPR; - Channel *mask; - guchar *start; - gboolean has_alpha; - gboolean indexed; - gint type; - gint bytes; - Tile *tile; + PixelRegion srcPR, maskPR; + GimpChannel *mask; + guchar *start; + gboolean has_alpha; + gboolean indexed; + gint type; + gint bytes; + Tile *tile; if (sample_merged) { @@ -341,7 +341,7 @@ find_contiguous_region (GImage *gimage, { bytes = has_alpha ? 4 : 3; } - mask = channel_new_mask (gimage, srcPR.w, srcPR.h); + mask = gimp_channel_new_mask (gimage, srcPR.w, srcPR.h); pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE(mask)), 0, 0, gimp_drawable_width (GIMP_DRAWABLE(mask)), @@ -383,13 +383,13 @@ fuzzy_select (GImage *gimage, off_x = off_y = 0; if (feather) - channel_feather (fuzzy_mask, gimp_image_get_mask (gimage), - feather_radius, - feather_radius, - op, off_x, off_y); + gimp_channel_feather (fuzzy_mask, gimp_image_get_mask (gimage), + feather_radius, + feather_radius, + op, off_x, off_y); else - channel_combine_mask (gimp_image_get_mask (gimage), - fuzzy_mask, op, off_x, off_y); + gimp_channel_combine_mask (gimp_image_get_mask (gimage), + fuzzy_mask, op, off_x, off_y); gtk_object_unref (GTK_OBJECT (fuzzy_mask)); fuzzy_mask = NULL; @@ -534,7 +534,7 @@ fuzzy_select_calculate (Tool *tool, { PixelRegion maskPR; FuzzySelect *fuzzy_sel; - Channel *new; + GimpChannel *new; GdkSegment *segs; BoundSeg *bsegs; GimpDrawable *drawable; diff --git a/app/tools/gimpfuzzyselecttool.h b/app/tools/gimpfuzzyselecttool.h index 42533a19db..049dba3205 100644 --- a/app/tools/gimpfuzzyselecttool.h +++ b/app/tools/gimpfuzzyselecttool.h @@ -20,24 +20,24 @@ #define __FUZZY_SELECT_H__ -Channel * find_contiguous_region (GimpImage *gimage, - GimpDrawable *drawable, - gboolean antialias, - gint threshold, - gint x, - gint y, - gboolean sample_merged); -void fuzzy_select (GimpImage *gimage, - GimpDrawable *drawable, - gint op, - gboolean feather, - gdouble feather_radius); +GimpChannel * find_contiguous_region (GimpImage *gimage, + GimpDrawable *drawable, + gboolean antialias, + gint threshold, + gint x, + gint y, + gboolean sample_merged); +void fuzzy_select (GimpImage *gimage, + GimpDrawable *drawable, + gint op, + gboolean feather, + gdouble feather_radius); -Tool * tools_new_fuzzy_select (void); -void tools_free_fuzzy_select (Tool *tool); +Tool * tools_new_fuzzy_select (void); +void tools_free_fuzzy_select (Tool *tool); -extern Channel *fuzzy_mask; +extern GimpChannel *fuzzy_mask; #endif /* __FUZZY_SELECT_H__ */ diff --git a/app/tools/gimpiscissorstool.c b/app/tools/gimpiscissorstool.c index 70a99eb133..73e5744f8f 100644 --- a/app/tools/gimpiscissorstool.c +++ b/app/tools/gimpiscissorstool.c @@ -126,7 +126,7 @@ struct _iscissors Iscissors_draw draw; /* items to draw on a draw request */ /* XXX might be useful */ - Channel *mask; /* selection mask */ + GimpChannel *mask; /* selection mask */ TileManager *gradient_map; /* lazily filled gradient map */ }; @@ -460,7 +460,7 @@ iscissors_button_press (Tool *tool, } /* If the iscissors is connected, check if the click was inside */ else if (iscissors->connected && iscissors->mask && - channel_value (iscissors->mask, iscissors->x, iscissors->y)) + gimp_channel_value (iscissors->mask, iscissors->x, iscissors->y)) { /* Undraw the curve */ tool->state = INACTIVE; @@ -473,14 +473,14 @@ iscissors_button_press (Tool *tool, gimage_mask_undo (gdisp->gimage); if (((SelectionOptions *) iscissors_options)->feather) - channel_feather (iscissors->mask, - gimp_image_get_mask (gdisp->gimage), - ((SelectionOptions *) iscissors_options)->feather_radius, - ((SelectionOptions *) iscissors_options)->feather_radius, - iscissors->op, 0, 0); + gimp_channel_feather (iscissors->mask, + gimp_image_get_mask (gdisp->gimage), + ((SelectionOptions *) iscissors_options)->feather_radius, + ((SelectionOptions *) iscissors_options)->feather_radius, + iscissors->op, 0, 0); else - channel_combine_mask (gimp_image_get_mask (gdisp->gimage), - iscissors->mask, iscissors->op, 0, 0); + gimp_channel_combine_mask (gimp_image_get_mask (gdisp->gimage), + iscissors->mask, iscissors->op, 0, 0); iscissors_reset (iscissors); @@ -554,10 +554,9 @@ iscissors_convert (Iscissors *iscissors, iscissors->mask = scan_converter_to_channel (sc, gdisp->gimage); scan_converter_free (sc); - channel_invalidate_bounds (iscissors->mask); + gimp_channel_invalidate_bounds (iscissors->mask); } - static void iscissors_button_release (Tool *tool, GdkEventButton *bevent, @@ -932,7 +931,7 @@ iscissors_oper_update (Tool *tool, iscissors->op = SELECTION_MOVE; /* abused */ } else if (iscissors->connected && iscissors->mask && - channel_value (iscissors->mask, x, y)) + gimp_channel_value (iscissors->mask, x, y)) { if (mevent->state & GDK_SHIFT_MASK && mevent->state & GDK_CONTROL_MASK) diff --git a/app/tools/gimprectselecttool.c b/app/tools/gimprectselecttool.c index 5b459841c2..a83faa2882 100644 --- a/app/tools/gimprectselecttool.c +++ b/app/tools/gimprectselecttool.c @@ -85,7 +85,7 @@ rect_select (GimpImage *gimage, gboolean feather, gdouble feather_radius) { - Channel *new_mask; + GimpChannel *new_mask; /* if applicable, replace the current selection */ if (op == SELECTION_REPLACE) @@ -98,23 +98,26 @@ rect_select (GimpImage *gimage, */ if (feather) { - new_mask = channel_new_mask (gimage, gimage->width, gimage->height); - channel_combine_rect (new_mask, CHANNEL_OP_ADD, x, y, w, h); - channel_feather (new_mask, gimp_image_get_mask (gimage), - feather_radius, - feather_radius, - op, 0, 0); + new_mask = gimp_channel_new_mask (gimage, gimage->width, gimage->height); + gimp_channel_combine_rect (new_mask, CHANNEL_OP_ADD, x, y, w, h); + gimp_channel_feather (new_mask, gimp_image_get_mask (gimage), + feather_radius, + feather_radius, + op, 0, 0); gtk_object_unref (GTK_OBJECT (new_mask)); } else if (op == SELECTION_INTERSECT) { - new_mask = channel_new_mask (gimage, gimage->width, gimage->height); - channel_combine_rect (new_mask, CHANNEL_OP_ADD, x, y, w, h); - channel_combine_mask (gimp_image_get_mask (gimage), new_mask, op, 0, 0); + new_mask = gimp_channel_new_mask (gimage, gimage->width, gimage->height); + gimp_channel_combine_rect (new_mask, CHANNEL_OP_ADD, x, y, w, h); + gimp_channel_combine_mask (gimp_image_get_mask (gimage), new_mask, + op, 0, 0); gtk_object_unref (GTK_OBJECT (new_mask)); } else - channel_combine_rect (gimp_image_get_mask (gimage), op, x, y, w, h); + { + gimp_channel_combine_rect (gimp_image_get_mask (gimage), op, x, y, w, h); + } } void diff --git a/app/tools/gimpregionselecttool.c b/app/tools/gimpregionselecttool.c index e64ef681e1..646cdf333a 100644 --- a/app/tools/gimpregionselecttool.c +++ b/app/tools/gimpregionselecttool.c @@ -98,7 +98,7 @@ static SelectionOptions *fuzzy_options = NULL; static GdkSegment *segs = NULL; static gint num_segs = 0; -Channel * fuzzy_mask = NULL; +GimpChannel * fuzzy_mask = NULL; /*************************************/ @@ -298,7 +298,7 @@ find_contiguous_region_helper (PixelRegion *mask, } } -Channel * +GimpChannel * find_contiguous_region (GImage *gimage, GimpDrawable *drawable, gboolean antialias, @@ -307,14 +307,14 @@ find_contiguous_region (GImage *gimage, gint y, gboolean sample_merged) { - PixelRegion srcPR, maskPR; - Channel *mask; - guchar *start; - gboolean has_alpha; - gboolean indexed; - gint type; - gint bytes; - Tile *tile; + PixelRegion srcPR, maskPR; + GimpChannel *mask; + guchar *start; + gboolean has_alpha; + gboolean indexed; + gint type; + gint bytes; + Tile *tile; if (sample_merged) { @@ -341,7 +341,7 @@ find_contiguous_region (GImage *gimage, { bytes = has_alpha ? 4 : 3; } - mask = channel_new_mask (gimage, srcPR.w, srcPR.h); + mask = gimp_channel_new_mask (gimage, srcPR.w, srcPR.h); pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE(mask)), 0, 0, gimp_drawable_width (GIMP_DRAWABLE(mask)), @@ -383,13 +383,13 @@ fuzzy_select (GImage *gimage, off_x = off_y = 0; if (feather) - channel_feather (fuzzy_mask, gimp_image_get_mask (gimage), - feather_radius, - feather_radius, - op, off_x, off_y); + gimp_channel_feather (fuzzy_mask, gimp_image_get_mask (gimage), + feather_radius, + feather_radius, + op, off_x, off_y); else - channel_combine_mask (gimp_image_get_mask (gimage), - fuzzy_mask, op, off_x, off_y); + gimp_channel_combine_mask (gimp_image_get_mask (gimage), + fuzzy_mask, op, off_x, off_y); gtk_object_unref (GTK_OBJECT (fuzzy_mask)); fuzzy_mask = NULL; @@ -534,7 +534,7 @@ fuzzy_select_calculate (Tool *tool, { PixelRegion maskPR; FuzzySelect *fuzzy_sel; - Channel *new; + GimpChannel *new; GdkSegment *segs; BoundSeg *bsegs; GimpDrawable *drawable; diff --git a/app/tools/gimpregionselecttool.h b/app/tools/gimpregionselecttool.h index 42533a19db..049dba3205 100644 --- a/app/tools/gimpregionselecttool.h +++ b/app/tools/gimpregionselecttool.h @@ -20,24 +20,24 @@ #define __FUZZY_SELECT_H__ -Channel * find_contiguous_region (GimpImage *gimage, - GimpDrawable *drawable, - gboolean antialias, - gint threshold, - gint x, - gint y, - gboolean sample_merged); -void fuzzy_select (GimpImage *gimage, - GimpDrawable *drawable, - gint op, - gboolean feather, - gdouble feather_radius); +GimpChannel * find_contiguous_region (GimpImage *gimage, + GimpDrawable *drawable, + gboolean antialias, + gint threshold, + gint x, + gint y, + gboolean sample_merged); +void fuzzy_select (GimpImage *gimage, + GimpDrawable *drawable, + gint op, + gboolean feather, + gdouble feather_radius); -Tool * tools_new_fuzzy_select (void); -void tools_free_fuzzy_select (Tool *tool); +Tool * tools_new_fuzzy_select (void); +void tools_free_fuzzy_select (Tool *tool); -extern Channel *fuzzy_mask; +extern GimpChannel *fuzzy_mask; #endif /* __FUZZY_SELECT_H__ */ diff --git a/app/tools/gimptexttool.c b/app/tools/gimptexttool.c index ce8dd33596..fc1b6c8150 100644 --- a/app/tools/gimptexttool.c +++ b/app/tools/gimptexttool.c @@ -802,7 +802,7 @@ text_render (GimpImage *gimage, * it seems like the correct behavior. */ if (! gimage_mask_is_empty (gimage)) - channel_clear (gimp_image_get_mask (gimage)); + gimp_channel_clear (gimp_image_get_mask (gimage)); /* If the drawable id is invalid, create a new layer */ if (drawable == NULL) diff --git a/app/tools/iscissors.c b/app/tools/iscissors.c index 70a99eb133..73e5744f8f 100644 --- a/app/tools/iscissors.c +++ b/app/tools/iscissors.c @@ -126,7 +126,7 @@ struct _iscissors Iscissors_draw draw; /* items to draw on a draw request */ /* XXX might be useful */ - Channel *mask; /* selection mask */ + GimpChannel *mask; /* selection mask */ TileManager *gradient_map; /* lazily filled gradient map */ }; @@ -460,7 +460,7 @@ iscissors_button_press (Tool *tool, } /* If the iscissors is connected, check if the click was inside */ else if (iscissors->connected && iscissors->mask && - channel_value (iscissors->mask, iscissors->x, iscissors->y)) + gimp_channel_value (iscissors->mask, iscissors->x, iscissors->y)) { /* Undraw the curve */ tool->state = INACTIVE; @@ -473,14 +473,14 @@ iscissors_button_press (Tool *tool, gimage_mask_undo (gdisp->gimage); if (((SelectionOptions *) iscissors_options)->feather) - channel_feather (iscissors->mask, - gimp_image_get_mask (gdisp->gimage), - ((SelectionOptions *) iscissors_options)->feather_radius, - ((SelectionOptions *) iscissors_options)->feather_radius, - iscissors->op, 0, 0); + gimp_channel_feather (iscissors->mask, + gimp_image_get_mask (gdisp->gimage), + ((SelectionOptions *) iscissors_options)->feather_radius, + ((SelectionOptions *) iscissors_options)->feather_radius, + iscissors->op, 0, 0); else - channel_combine_mask (gimp_image_get_mask (gdisp->gimage), - iscissors->mask, iscissors->op, 0, 0); + gimp_channel_combine_mask (gimp_image_get_mask (gdisp->gimage), + iscissors->mask, iscissors->op, 0, 0); iscissors_reset (iscissors); @@ -554,10 +554,9 @@ iscissors_convert (Iscissors *iscissors, iscissors->mask = scan_converter_to_channel (sc, gdisp->gimage); scan_converter_free (sc); - channel_invalidate_bounds (iscissors->mask); + gimp_channel_invalidate_bounds (iscissors->mask); } - static void iscissors_button_release (Tool *tool, GdkEventButton *bevent, @@ -932,7 +931,7 @@ iscissors_oper_update (Tool *tool, iscissors->op = SELECTION_MOVE; /* abused */ } else if (iscissors->connected && iscissors->mask && - channel_value (iscissors->mask, x, y)) + gimp_channel_value (iscissors->mask, x, y)) { if (mevent->state & GDK_SHIFT_MASK && mevent->state & GDK_CONTROL_MASK) diff --git a/app/tools/rect_select.c b/app/tools/rect_select.c index 5b459841c2..a83faa2882 100644 --- a/app/tools/rect_select.c +++ b/app/tools/rect_select.c @@ -85,7 +85,7 @@ rect_select (GimpImage *gimage, gboolean feather, gdouble feather_radius) { - Channel *new_mask; + GimpChannel *new_mask; /* if applicable, replace the current selection */ if (op == SELECTION_REPLACE) @@ -98,23 +98,26 @@ rect_select (GimpImage *gimage, */ if (feather) { - new_mask = channel_new_mask (gimage, gimage->width, gimage->height); - channel_combine_rect (new_mask, CHANNEL_OP_ADD, x, y, w, h); - channel_feather (new_mask, gimp_image_get_mask (gimage), - feather_radius, - feather_radius, - op, 0, 0); + new_mask = gimp_channel_new_mask (gimage, gimage->width, gimage->height); + gimp_channel_combine_rect (new_mask, CHANNEL_OP_ADD, x, y, w, h); + gimp_channel_feather (new_mask, gimp_image_get_mask (gimage), + feather_radius, + feather_radius, + op, 0, 0); gtk_object_unref (GTK_OBJECT (new_mask)); } else if (op == SELECTION_INTERSECT) { - new_mask = channel_new_mask (gimage, gimage->width, gimage->height); - channel_combine_rect (new_mask, CHANNEL_OP_ADD, x, y, w, h); - channel_combine_mask (gimp_image_get_mask (gimage), new_mask, op, 0, 0); + new_mask = gimp_channel_new_mask (gimage, gimage->width, gimage->height); + gimp_channel_combine_rect (new_mask, CHANNEL_OP_ADD, x, y, w, h); + gimp_channel_combine_mask (gimp_image_get_mask (gimage), new_mask, + op, 0, 0); gtk_object_unref (GTK_OBJECT (new_mask)); } else - channel_combine_rect (gimp_image_get_mask (gimage), op, x, y, w, h); + { + gimp_channel_combine_rect (gimp_image_get_mask (gimage), op, x, y, w, h); + } } void diff --git a/app/tools/text_tool.c b/app/tools/text_tool.c index ce8dd33596..fc1b6c8150 100644 --- a/app/tools/text_tool.c +++ b/app/tools/text_tool.c @@ -802,7 +802,7 @@ text_render (GimpImage *gimage, * it seems like the correct behavior. */ if (! gimage_mask_is_empty (gimage)) - channel_clear (gimp_image_get_mask (gimage)); + gimp_channel_clear (gimp_image_get_mask (gimage)); /* If the drawable id is invalid, create a new layer */ if (drawable == NULL) diff --git a/app/tools/transform_core.c b/app/tools/transform_core.c index 557b385f17..12d6888378 100644 --- a/app/tools/transform_core.c +++ b/app/tools/transform_core.c @@ -1605,9 +1605,9 @@ transform_core_paste (GImage *gimage, TileManager *tiles, gboolean new_layer) { - GimpLayer *layer = NULL; - Channel *channel = NULL; - GimpLayer *floating_layer; + GimpLayer *layer = NULL; + GimpChannel *channel = NULL; + GimpLayer *floating_layer; if (new_layer) { diff --git a/app/undo.c b/app/undo.c index 9e0c7f9556..98d2614696 100644 --- a/app/undo.c +++ b/app/undo.c @@ -162,14 +162,14 @@ static void undo_free_cantundo (UndoState, UndoType, gpointer); /* Sizing functions */ -static gint layer_size (GimpLayer *layer); -static gint channel_size (Channel *channel); +static gint layer_size (GimpLayer *layer); +static gint channel_size (GimpChannel *channel); -static const gchar * undo_type_to_name (UndoType undo_type); +static const gchar * undo_type_to_name (UndoType undo_type); -static Undo * undo_new (UndoType undo_type, - glong size, - gboolean dirties_image); +static Undo * undo_new (UndoType undo_type, + glong size, + gboolean dirties_image); static gboolean shrink_wrap = FALSE; @@ -194,12 +194,12 @@ layer_size (GimpLayer *layer) static gint -channel_size (Channel *channel) +channel_size (GimpChannel *channel) { gint size; size = - sizeof (Channel) + + sizeof (GimpChannel) + GIMP_DRAWABLE (channel)->width * GIMP_DRAWABLE (channel)->height + strlen (GIMP_OBJECT (channel)->name); @@ -1027,7 +1027,7 @@ undo_pop_mask (GimpImage *gimage, { MaskUndo *mask_undo; TileManager *new_tiles; - Channel *sel_mask; + GimpChannel *sel_mask; PixelRegion srcPR, destPR; gint selection; gint x1, y1, x2, y2; @@ -1040,7 +1040,7 @@ undo_pop_mask (GimpImage *gimage, /* save current selection mask */ sel_mask = gimp_image_get_mask (gimage); - selection = channel_bounds (sel_mask, &x1, &y1, &x2, &y2); + selection = gimp_channel_bounds (sel_mask, &x1, &y1, &x2, &y2); pixel_region_init (&srcPR, GIMP_DRAWABLE (sel_mask)->tiles, x1, y1, (x2 - x1), (y2 - y1), FALSE); @@ -1886,13 +1886,13 @@ gboolean undo_push_channel_mod (GimpImage *gimage, gpointer channel_ptr) { - Channel *channel; + GimpChannel *channel; TileManager *tiles; Undo *new; gpointer *data; gint size; - channel = (Channel *) channel_ptr; + channel = (GimpChannel *) channel_ptr; tiles = GIMP_DRAWABLE (channel)->tiles; size = GIMP_DRAWABLE (channel)->width * GIMP_DRAWABLE (channel)->height + @@ -1927,10 +1927,10 @@ undo_pop_channel_mod (GimpImage *gimage, gpointer *data; TileManager *tiles; TileManager *temp; - Channel *channel; + GimpChannel *channel; data = (gpointer *) data_ptr; - channel = (Channel *) data[0]; + channel = (GimpChannel *) data[0]; tiles = (TileManager *) data[1]; diff --git a/app/undo.h b/app/undo.h index b92893c8c0..12791b251a 100644 --- a/app/undo.h +++ b/app/undo.h @@ -111,12 +111,6 @@ void undo_map_over_redo_stack (GImage *gimage, UndoType undo_get_undo_top_type (GImage *gimage); -/* Not really appropriate here, since undo_history_new is not defined - * in undo.c, but it saves on having a full header file for just one - * function prototype. */ -GtkWidget *undo_history_new (GImage *gimage); - - /* Argument to undo_event signal emitted by gimages: */ typedef enum { diff --git a/app/undo_history.c b/app/undo_history.c index 65611288ce..7ebb2e58c9 100644 --- a/app/undo_history.c +++ b/app/undo_history.c @@ -156,12 +156,12 @@ mask_render_preview (GImage *gimage, gint *pwidth, gint *pheight) { - Channel * mask; - MaskBuf * scaled_buf = NULL; - PixelRegion srcPR, destPR; - gint subsample; - gint width, height; - gint scale; + GimpChannel *mask; + MaskBuf *scaled_buf = NULL; + PixelRegion srcPR, destPR; + gint subsample; + gint width, height; + gint scale; mask = gimp_image_get_mask (gimage); if ((gimp_drawable_width (GIMP_DRAWABLE(mask)) > *pwidth) || diff --git a/app/undo_history.h b/app/undo_history.h new file mode 100644 index 0000000000..ac82b0aaeb --- /dev/null +++ b/app/undo_history.h @@ -0,0 +1,26 @@ +/* The GIMP -- an image manipulation program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __UNDO_HISTORY_H__ +#define __UNDO_HISTORY_H__ + + +GtkWidget * undo_history_new (GimpImage *gimage); + + +#endif /* __UNDO_HISTORY_H__ */ diff --git a/app/widgets/gimpdnd.c b/app/widgets/gimpdnd.c index 81350743d9..081a1eda5d 100644 --- a/app/widgets/gimpdnd.c +++ b/app/widgets/gimpdnd.c @@ -1097,7 +1097,7 @@ gimp_dnd_set_drawable_preview_icon (GtkWidget *widget, } else if (GIMP_IS_CHANNEL (drawable)) { - tmpbuf = channel_preview (GIMP_CHANNEL (drawable), width, height); + tmpbuf = gimp_channel_preview (GIMP_CHANNEL (drawable), width, height); } else { diff --git a/app/widgets/gimptoolbox.c b/app/widgets/gimptoolbox.c index 9e8a971de6..4b55896d6b 100644 --- a/app/widgets/gimptoolbox.c +++ b/app/widgets/gimptoolbox.c @@ -659,15 +659,15 @@ toolbox_drag_drop (GtkWidget *widget, { GimpDrawable *drawable = NULL; GimpLayer *layer = NULL; - Channel *channel = NULL; + GimpChannel *channel = NULL; GimpLayerMask *layer_mask = NULL; GimpImage *component = NULL; ChannelType component_type = -1; layer = (GimpLayer *) gtk_object_get_data (GTK_OBJECT (src_widget), "gimp_layer"); - channel = (Channel *) gtk_object_get_data (GTK_OBJECT (src_widget), - "gimp_channel"); + channel = (GimpChannel *) gtk_object_get_data (GTK_OBJECT (src_widget), + "gimp_channel"); layer_mask = (GimpLayerMask *) gtk_object_get_data (GTK_OBJECT (src_widget), "gimp_layer_mask"); component = (GImage *) gtk_object_get_data (GTK_OBJECT (src_widget), diff --git a/app/xcf.c b/app/xcf.c index 0e6c158882..bea61b985d 100644 --- a/app/xcf.c +++ b/app/xcf.c @@ -117,7 +117,7 @@ static void xcf_save_layer_props (XcfInfo *info, GimpLayer *layer); static void xcf_save_channel_props (XcfInfo *info, GImage *gimage, - Channel *channel); + GimpChannel *channel); static void xcf_save_prop (XcfInfo *info, PropType prop_type, ...); @@ -126,7 +126,7 @@ static void xcf_save_layer (XcfInfo *info, GimpLayer *layer); static void xcf_save_channel (XcfInfo *info, GImage *gimage, - Channel *channel); + GimpChannel *channel); static void xcf_save_hierarchy (XcfInfo *info, TileManager *tiles); static void xcf_save_level (XcfInfo *info, @@ -145,13 +145,13 @@ static gboolean xcf_load_layer_props (XcfInfo *info, GimpLayer *layer); static gboolean xcf_load_channel_props (XcfInfo *info, GImage *gimage, - Channel *channel); + GimpChannel *channel); static gboolean xcf_load_prop (XcfInfo *info, PropType *prop_type, guint32 *prop_size); static GimpLayer * xcf_load_layer (XcfInfo *info, GImage *gimage); -static Channel * xcf_load_channel (XcfInfo *info, +static GimpChannel * xcf_load_channel (XcfInfo *info, GImage *gimage); static GimpLayerMask * xcf_load_layer_mask (XcfInfo *info, GImage *gimage); @@ -461,17 +461,17 @@ static gint xcf_save_image (XcfInfo *info, GImage *gimage) { - GimpLayer *layer; - GimpLayer *floating_layer; - Channel *channel; - guint32 saved_pos; - guint32 offset; - guint nlayers; - guint nchannels; - GSList *list; - gboolean have_selection; - gint t1, t2, t3, t4; - gchar version_tag[14]; + GimpLayer *layer; + GimpLayer *floating_layer; + GimpChannel *channel; + guint32 saved_pos; + guint32 offset; + guint nlayers; + guint nchannels; + GSList *list; + gboolean have_selection; + gint t1, t2, t3, t4; + gchar version_tag[14]; floating_layer = gimp_image_floating_sel (gimage); if (floating_layer) @@ -672,9 +672,9 @@ xcf_save_layer_props (XcfInfo *info, } static void -xcf_save_channel_props (XcfInfo *info, - GImage *gimage, - Channel *channel) +xcf_save_channel_props (XcfInfo *info, + GImage *gimage, + GimpChannel *channel) { if (channel == gimage->active_channel) xcf_save_prop (info, PROP_ACTIVE_CHANNEL); @@ -1349,9 +1349,9 @@ xcf_save_layer (XcfInfo *info, } static void -xcf_save_channel (XcfInfo *info, - GImage *gimage, - Channel *channel) +xcf_save_channel (XcfInfo *info, + GImage *gimage, + GimpChannel *channel) { guint32 saved_pos; guint32 offset; @@ -1689,15 +1689,15 @@ xcf_save_tile_rle (XcfInfo *info, static GimpImage * xcf_load_image (XcfInfo *info) { - GImage *gimage; - GimpLayer *layer; - Channel *channel; - guint32 saved_pos; - guint32 offset; - gint width; - gint height; - gint image_type; - gint num_successful_elements = 0; + GImage *gimage; + GimpLayer *layer; + GimpChannel *channel; + guint32 saved_pos; + guint32 offset; + gint width; + gint height; + gint image_type; + gint num_successful_elements = 0; /* read in the image width, height and type */ info->cp += xcf_read_int32 (info->fp, (guint32 *) &width, 1); @@ -2128,9 +2128,9 @@ xcf_load_layer_props (XcfInfo *info, } static gboolean -xcf_load_channel_props (XcfInfo *info, - GImage *gimage, - Channel *channel) +xcf_load_channel_props (XcfInfo *info, + GImage *gimage, + GimpChannel *channel) { PropType prop_type; guint32 prop_size; @@ -2314,17 +2314,17 @@ error: return NULL; } -static Channel* +static GimpChannel * xcf_load_channel (XcfInfo *info, GImage *gimage) { - Channel *channel; - guint32 hierarchy_offset; - gint width; - gint height; - gint add_floating_sel; - gchar *name; - GimpRGB color = { 0.0, 0.0, 0.0, 1.0 }; + GimpChannel *channel; + guint32 hierarchy_offset; + gint width; + gint height; + gint add_floating_sel; + gchar *name; + GimpRGB color = { 0.0, 0.0, 0.0, 1.0 }; /* check and see if this is the drawable the floating selection * is attached to. if it is then we'll do the attachment at @@ -2338,7 +2338,7 @@ xcf_load_channel (XcfInfo *info, info->cp += xcf_read_string (info->fp, &name, 1); /* create a new channel */ - channel = channel_new (gimage, width, height, name, &color); + channel = gimp_channel_new (gimage, width, height, name, &color); g_free (name); if (!channel) return NULL; diff --git a/app/xcf.h b/app/xcf.h index 0fef1c885f..40d6537617 100644 --- a/app/xcf.h +++ b/app/xcf.h @@ -28,7 +28,7 @@ struct _XcfInfo guint cp; gchar *filename; GimpLayer *active_layer; - Channel *active_channel; + GimpChannel *active_channel; GimpDrawable *floating_sel_drawable; GimpLayer *floating_sel; guint floating_sel_offset; diff --git a/app/xcf/xcf.c b/app/xcf/xcf.c index 0e6c158882..bea61b985d 100644 --- a/app/xcf/xcf.c +++ b/app/xcf/xcf.c @@ -117,7 +117,7 @@ static void xcf_save_layer_props (XcfInfo *info, GimpLayer *layer); static void xcf_save_channel_props (XcfInfo *info, GImage *gimage, - Channel *channel); + GimpChannel *channel); static void xcf_save_prop (XcfInfo *info, PropType prop_type, ...); @@ -126,7 +126,7 @@ static void xcf_save_layer (XcfInfo *info, GimpLayer *layer); static void xcf_save_channel (XcfInfo *info, GImage *gimage, - Channel *channel); + GimpChannel *channel); static void xcf_save_hierarchy (XcfInfo *info, TileManager *tiles); static void xcf_save_level (XcfInfo *info, @@ -145,13 +145,13 @@ static gboolean xcf_load_layer_props (XcfInfo *info, GimpLayer *layer); static gboolean xcf_load_channel_props (XcfInfo *info, GImage *gimage, - Channel *channel); + GimpChannel *channel); static gboolean xcf_load_prop (XcfInfo *info, PropType *prop_type, guint32 *prop_size); static GimpLayer * xcf_load_layer (XcfInfo *info, GImage *gimage); -static Channel * xcf_load_channel (XcfInfo *info, +static GimpChannel * xcf_load_channel (XcfInfo *info, GImage *gimage); static GimpLayerMask * xcf_load_layer_mask (XcfInfo *info, GImage *gimage); @@ -461,17 +461,17 @@ static gint xcf_save_image (XcfInfo *info, GImage *gimage) { - GimpLayer *layer; - GimpLayer *floating_layer; - Channel *channel; - guint32 saved_pos; - guint32 offset; - guint nlayers; - guint nchannels; - GSList *list; - gboolean have_selection; - gint t1, t2, t3, t4; - gchar version_tag[14]; + GimpLayer *layer; + GimpLayer *floating_layer; + GimpChannel *channel; + guint32 saved_pos; + guint32 offset; + guint nlayers; + guint nchannels; + GSList *list; + gboolean have_selection; + gint t1, t2, t3, t4; + gchar version_tag[14]; floating_layer = gimp_image_floating_sel (gimage); if (floating_layer) @@ -672,9 +672,9 @@ xcf_save_layer_props (XcfInfo *info, } static void -xcf_save_channel_props (XcfInfo *info, - GImage *gimage, - Channel *channel) +xcf_save_channel_props (XcfInfo *info, + GImage *gimage, + GimpChannel *channel) { if (channel == gimage->active_channel) xcf_save_prop (info, PROP_ACTIVE_CHANNEL); @@ -1349,9 +1349,9 @@ xcf_save_layer (XcfInfo *info, } static void -xcf_save_channel (XcfInfo *info, - GImage *gimage, - Channel *channel) +xcf_save_channel (XcfInfo *info, + GImage *gimage, + GimpChannel *channel) { guint32 saved_pos; guint32 offset; @@ -1689,15 +1689,15 @@ xcf_save_tile_rle (XcfInfo *info, static GimpImage * xcf_load_image (XcfInfo *info) { - GImage *gimage; - GimpLayer *layer; - Channel *channel; - guint32 saved_pos; - guint32 offset; - gint width; - gint height; - gint image_type; - gint num_successful_elements = 0; + GImage *gimage; + GimpLayer *layer; + GimpChannel *channel; + guint32 saved_pos; + guint32 offset; + gint width; + gint height; + gint image_type; + gint num_successful_elements = 0; /* read in the image width, height and type */ info->cp += xcf_read_int32 (info->fp, (guint32 *) &width, 1); @@ -2128,9 +2128,9 @@ xcf_load_layer_props (XcfInfo *info, } static gboolean -xcf_load_channel_props (XcfInfo *info, - GImage *gimage, - Channel *channel) +xcf_load_channel_props (XcfInfo *info, + GImage *gimage, + GimpChannel *channel) { PropType prop_type; guint32 prop_size; @@ -2314,17 +2314,17 @@ error: return NULL; } -static Channel* +static GimpChannel * xcf_load_channel (XcfInfo *info, GImage *gimage) { - Channel *channel; - guint32 hierarchy_offset; - gint width; - gint height; - gint add_floating_sel; - gchar *name; - GimpRGB color = { 0.0, 0.0, 0.0, 1.0 }; + GimpChannel *channel; + guint32 hierarchy_offset; + gint width; + gint height; + gint add_floating_sel; + gchar *name; + GimpRGB color = { 0.0, 0.0, 0.0, 1.0 }; /* check and see if this is the drawable the floating selection * is attached to. if it is then we'll do the attachment at @@ -2338,7 +2338,7 @@ xcf_load_channel (XcfInfo *info, info->cp += xcf_read_string (info->fp, &name, 1); /* create a new channel */ - channel = channel_new (gimage, width, height, name, &color); + channel = gimp_channel_new (gimage, width, height, name, &color); g_free (name); if (!channel) return NULL; diff --git a/app/xcf/xcf.h b/app/xcf/xcf.h index 0fef1c885f..40d6537617 100644 --- a/app/xcf/xcf.h +++ b/app/xcf/xcf.h @@ -28,7 +28,7 @@ struct _XcfInfo guint cp; gchar *filename; GimpLayer *active_layer; - Channel *active_channel; + GimpChannel *active_channel; GimpDrawable *floating_sel_drawable; GimpLayer *floating_sel; guint floating_sel_offset; diff --git a/tools/pdbgen/pdb.pl b/tools/pdbgen/pdb.pl index b61a1d9aa1..6b0d8d7bb8 100644 --- a/tools/pdbgen/pdb.pl +++ b/tools/pdbgen/pdb.pl @@ -51,7 +51,7 @@ package Gimp::CodeGen::pdb; id_func => '(GimpLayer *) gimp_drawable_get_by_ID', id_ret_func => 'gimp_drawable_get_ID (GIMP_DRAWABLE ($var))' }, channel => { name => 'CHANNEL', - type => 'Channel *', + type => 'GimpChannel *', headers => [ qw("drawable.h" "channel.h") ], id_func => '(GimpChannel *) gimp_drawable_get_by_ID', id_ret_func => 'gimp_drawable_get_ID (GIMP_DRAWABLE ($var))' }, @@ -61,7 +61,7 @@ package Gimp::CodeGen::pdb; id_func => 'gimp_drawable_get_by_ID', id_ret_func => 'gimp_drawable_get_ID (GIMP_DRAWABLE ($var))' }, selection => { name => 'SELECTION', - type => 'Channel *', + type => 'GimpChannel *', headers => [ qw("drawable.h" "channel.h") ], id_func => '(GimpChannel *) gimp_drawable_get_by_ID', id_ret_func => 'gimp_drawable_get_ID (GIMP_DRAWABLE ($var))' }, diff --git a/tools/pdbgen/pdb/channel.pdb b/tools/pdbgen/pdb/channel.pdb index 59259b825a..f1047e6225 100644 --- a/tools/pdbgen/pdb/channel.pdb +++ b/tools/pdbgen/pdb/channel.pdb @@ -45,7 +45,7 @@ sub channel_get_prop_proc { desc => "The channel $desc", no_declare => 1 } ); - my $alias = $func ? "channel_get_$prop (channel)" : "channel->$prop"; + my $alias = $func ? "gimp_channel_get_$prop (channel)" : "channel->$prop"; $alias = "g_strdup ($alias)" if $type eq 'string'; $outargs[0]->{alias} .= "$alias"; @@ -82,7 +82,7 @@ sub channel_set_prop_proc { $inargs[1]->{desc} .= ' (%%desc%%)'; } - $invoke{code} = $func ? "channel_set_$prop (channel, $prop);" + $invoke{code} = $func ? "gimp_channel_set_$prop (channel, $prop);" : "channel->$prop = $prop;"; if ($type eq 'color') { @@ -92,7 +92,7 @@ sub channel_set_prop_proc { GimpRGB rgb_color = color; rgb_color.a = channel->color.a; - channel_set_color(channel, &rgb_color); + gimp_channel_set_color(channel, &rgb_color); } CODE ); @@ -167,7 +167,7 @@ HELP GimpRGB rgb_color = color; rgb_color.a = opacity / 100.0; - channel = channel_new (gimage, width, height, name, &rgb_color); + channel = gimp_channel_new (gimage, width, height, name, &rgb_color); success = channel != NULL; } CODE @@ -191,7 +191,7 @@ HELP desc => 'The newly copied channel', alias => 'copy' } ); - %invoke = ( code => 'success = (copy = channel_copy (channel)) != NULL;' ); + %invoke = ( code => 'success = (copy = gimp_channel_copy (channel)) != NULL;' ); } sub channel_delete { @@ -237,7 +237,7 @@ HELP %invoke = ( code => <<'CODE' ); { - channel_combine_mask (channel1, channel2, operation, offx, offy); + gimp_channel_combine_mask (channel1, channel2, operation, offx, offy); } CODE } diff --git a/tools/pdbgen/pdb/color.pdb b/tools/pdbgen/pdb/color.pdb index 8f478de05c..b22fbf3544 100644 --- a/tools/pdbgen/pdb/color.pdb +++ b/tools/pdbgen/pdb/color.pdb @@ -591,7 +591,7 @@ HELP headers => [ qw("tools/histogram_tool.h" "gimpimage.h") ], vars => [ 'PixelRegion srcPR, maskPR', 'int x1, y1, x2, y2', 'HistogramToolDialog htd', 'int off_x, off_y', - 'gboolean no_mask', 'Channel *mask' ], + 'gboolean no_mask', 'GimpChannel *mask' ], code => <<'CODE' { if (gimp_drawable_is_indexed (drawable) || diff --git a/tools/pdbgen/pdb/drawable.pdb b/tools/pdbgen/pdb/drawable.pdb index 4a0363ea96..91684912a8 100644 --- a/tools/pdbgen/pdb/drawable.pdb +++ b/tools/pdbgen/pdb/drawable.pdb @@ -485,7 +485,7 @@ HELP if (GIMP_IS_LAYER (drawable)) buf = gimp_layer_preview (GIMP_LAYER (drawable), req_width, req_height); else - buf = channel_preview (GIMP_CHANNEL (drawable), req_width, req_height); + buf = gimp_channel_preview (GIMP_CHANNEL (drawable), req_width, req_height); num_pixels = buf->height * buf->width * buf->bytes; thumbnail_data = g_new (guint8, num_pixels); diff --git a/tools/pdbgen/pdb/misc_tools.pdb b/tools/pdbgen/pdb/misc_tools.pdb index e7330bdd5b..486facb489 100644 --- a/tools/pdbgen/pdb/misc_tools.pdb +++ b/tools/pdbgen/pdb/misc_tools.pdb @@ -815,7 +815,7 @@ HELP %invoke = ( headers => [ qw("tools/fuzzy_select.h") ], - vars => [ 'GimpImage *gimage', 'Channel *new, *old_fuzzy_mask' ], + vars => [ 'GimpImage *gimage', 'GimpChannel *new, *old_fuzzy_mask' ], code => <<'CODE' { gimage = gimp_drawable_gimage (GIMP_DRAWABLE (drawable)); diff --git a/tools/pdbgen/pdb/paint_tools.pdb b/tools/pdbgen/pdb/paint_tools.pdb index e7330bdd5b..486facb489 100644 --- a/tools/pdbgen/pdb/paint_tools.pdb +++ b/tools/pdbgen/pdb/paint_tools.pdb @@ -815,7 +815,7 @@ HELP %invoke = ( headers => [ qw("tools/fuzzy_select.h") ], - vars => [ 'GimpImage *gimage', 'Channel *new, *old_fuzzy_mask' ], + vars => [ 'GimpImage *gimage', 'GimpChannel *new, *old_fuzzy_mask' ], code => <<'CODE' { gimage = gimp_drawable_gimage (GIMP_DRAWABLE (drawable)); diff --git a/tools/pdbgen/pdb/selection.pdb b/tools/pdbgen/pdb/selection.pdb index 8467302fbd..89f8d233fc 100644 --- a/tools/pdbgen/pdb/selection.pdb +++ b/tools/pdbgen/pdb/selection.pdb @@ -358,7 +358,7 @@ HELP @inargs = ( &channel_arg, &operation_arg ); %invoke = ( - vars => [ 'GimpImage *gimage', 'Channel *new_channel' ], + vars => [ 'GimpImage *gimage', 'GimpChannel *new_channel' ], code => <<'CODE' { gimage = gimp_drawable_gimage (GIMP_DRAWABLE (channel)); @@ -366,11 +366,11 @@ HELP if (gimp_drawable_width (GIMP_DRAWABLE (channel)) == gimage->width && gimp_drawable_height (GIMP_DRAWABLE (channel)) == gimage->height) { - new_channel = channel_copy (gimp_image_get_mask (gimage)); - channel_combine_mask (new_channel, - channel, - operation, - 0, 0); /* off x/y */ + new_channel = gimp_channel_copy (gimp_image_get_mask (gimage)); + gimp_channel_combine_mask (new_channel, + channel, + operation, + 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); gtk_object_unref (GTK_OBJECT (new_channel)); } diff --git a/tools/pdbgen/pdb/tools.pdb b/tools/pdbgen/pdb/tools.pdb index e7330bdd5b..486facb489 100644 --- a/tools/pdbgen/pdb/tools.pdb +++ b/tools/pdbgen/pdb/tools.pdb @@ -815,7 +815,7 @@ HELP %invoke = ( headers => [ qw("tools/fuzzy_select.h") ], - vars => [ 'GimpImage *gimage', 'Channel *new, *old_fuzzy_mask' ], + vars => [ 'GimpImage *gimage', 'GimpChannel *new, *old_fuzzy_mask' ], code => <<'CODE' { gimage = gimp_drawable_gimage (GIMP_DRAWABLE (drawable)); diff --git a/tools/pdbgen/pdb/transform_tools.pdb b/tools/pdbgen/pdb/transform_tools.pdb index e7330bdd5b..486facb489 100644 --- a/tools/pdbgen/pdb/transform_tools.pdb +++ b/tools/pdbgen/pdb/transform_tools.pdb @@ -815,7 +815,7 @@ HELP %invoke = ( headers => [ qw("tools/fuzzy_select.h") ], - vars => [ 'GimpImage *gimage', 'Channel *new, *old_fuzzy_mask' ], + vars => [ 'GimpImage *gimage', 'GimpChannel *new, *old_fuzzy_mask' ], code => <<'CODE' { gimage = gimp_drawable_gimage (GIMP_DRAWABLE (drawable));