Commit a2ae989f authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

removed the "Layer" typedef.

2001-01-29  Michael Natterer  <mitch@gimp.org>

	* app/apptypes.h: removed the "Layer" typedef.

	* app/layer.[ch]: removed the defines of the old function names.

	Don't implement methods of the parent class (get_name, get_tattoo, ...)
	but define them as macros. They will go to a separate "pdb_glue.h"
	header because they are used only by the PDB to simplify code
	generation (no application file should say gimp_layer_get_tattoo()
	but always gimp_drawable_get_tatoo()).

	* app/channel.h
	* app/channel_ops.c
	* app/channels_dialog.c
	* app/commands.c
	* app/convert.c
	* app/disp_callbacks.c
	* app/floating_sel.[ch]
	* app/gdisplay.c
	* app/gimage.c
	* app/gimage_mask.c
	* app/gimage_mask.h
	* app/gimpdnd.c
	* app/gimpdrawable.h
	* app/gimpimage.[ch]
	* app/gimplayermask.h
	* app/global_edit.c
	* app/image_new.c
	* app/layer_select.c
	* app/layers_dialog.c
	* app/resize.c
	* app/undo.c
	* app/xcf.[ch]
	* app/pdb/drawable_cmds.c
	* app/pdb/floating_sel_cmds.c
	* app/pdb/image_cmds.c
	* app/pdb/layer_cmds.c
	* app/tools/bucket_fill.c
	* app/tools/by_color_select.c
	* app/tools/clone.c
	* app/tools/crop.c
	* app/tools/edit_selection.c
	* app/tools/ink.c
	* app/tools/move.c
	* app/tools/paint_core.c
	* app/tools/rect_select.c
	* app/tools/text_tool.c
	* app/tools/transform_core.c
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/floating_sel.pdb
	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/layer.pdb: changed accordingly, cleanup.
parent 8ddebdf7
2001-01-29 Michael Natterer <mitch@gimp.org>
* app/apptypes.h: removed the "Layer" typedef.
* app/layer.[ch]: removed the defines of the old function names.
Don't implement methods of the parent class (get_name, get_tattoo, ...)
but define them as macros. They will go to a separate "pdb_glue.h"
header because they are used only by the PDB to simplify code
generation (no application file should say gimp_layer_get_tattoo()
but always gimp_drawable_get_tatoo()).
* app/channel.h
* app/channel_ops.c
* app/channels_dialog.c
* app/commands.c
* app/convert.c
* app/disp_callbacks.c
* app/floating_sel.[ch]
* app/gdisplay.c
* app/gimage.c
* app/gimage_mask.c
* app/gimage_mask.h
* app/gimpdnd.c
* app/gimpdrawable.h
* app/gimpimage.[ch]
* app/gimplayermask.h
* app/global_edit.c
* app/image_new.c
* app/layer_select.c
* app/layers_dialog.c
* app/resize.c
* app/undo.c
* app/xcf.[ch]
* app/pdb/drawable_cmds.c
* app/pdb/floating_sel_cmds.c
* app/pdb/image_cmds.c
* app/pdb/layer_cmds.c
* app/tools/bucket_fill.c
* app/tools/by_color_select.c
* app/tools/clone.c
* app/tools/crop.c
* app/tools/edit_selection.c
* app/tools/ink.c
* app/tools/move.c
* app/tools/paint_core.c
* app/tools/rect_select.c
* app/tools/text_tool.c
* app/tools/transform_core.c
* tools/pdbgen/pdb/drawable.pdb
* tools/pdbgen/pdb/floating_sel.pdb
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: changed accordingly, cleanup.
2001-01-28 Michael Natterer <mitch@gimp.org>
* app/Makefile.am
......
......@@ -917,9 +917,9 @@ void
layers_previous_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
Layer *new_layer;
gint current_layer;
GDisplay *gdisp;
GimpLayer *new_layer;
gint current_layer;
return_if_no_display (gdisp);
......@@ -940,9 +940,9 @@ void
layers_next_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
Layer *new_layer;
gint current_layer;
GDisplay *gdisp;
GimpLayer *new_layer;
gint current_layer;
return_if_no_display (gdisp);
......@@ -1053,7 +1053,7 @@ layers_add_alpha_channel_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
layer_add_alpha ( gdisp->gimage->active_layer);
gimp_layer_add_alpha ( gdisp->gimage->active_layer);
gdisplays_flush ();
}
......@@ -1075,7 +1075,7 @@ layers_resize_to_image_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
layer_resize_to_image (gdisp->gimage->active_layer);
gimp_layer_resize_to_image (gdisp->gimage->active_layer);
gdisplays_flush ();
}
......
......@@ -49,8 +49,6 @@ typedef GimpChannel Channel; /* convenience */
typedef struct _GimpLayer GimpLayer;
typedef struct _GimpLayerMask GimpLayerMask;
typedef GimpLayer Layer; /* convenience */
typedef struct _GimpImage GimpImage;
typedef GimpImage GImage;
......
......@@ -23,8 +23,6 @@
#include "gimpdrawable.h"
/* OPERATIONS */
/* Half way point where a region is no longer visible in a selection */
#define HALF_WAY 127
......@@ -71,18 +69,19 @@ typedef struct _ChannelUndo ChannelUndo;
struct _ChannelUndo
{
Channel *channel; /* the actual channel */
gint prev_position; /* former position in list */
Channel *prev_channel; /* previous active channel */
Channel *channel; /* the actual channel */
gint prev_position; /* former position in list */
Channel *prev_channel; /* previous active channel */
};
/* Special undo type */
typedef struct _MaskUndo MaskUndo;
struct _MaskUndo
{
TileManager *tiles; /* the actual mask */
gint x, y; /* offsets */
TileManager *tiles; /* the actual mask */
gint x, y; /* offsets */
};
......@@ -221,7 +220,4 @@ void channel_layer_mask (Channel *mask,
void channel_invalidate_bounds (Channel *channel);
#define gimp_drawable_channel GIMP_IS_CHANNEL
#endif /* __CHANNEL_H__ */
......@@ -567,13 +567,13 @@ duplicate (GimpImage *gimage)
{
PixelRegion srcPR, destPR;
GimpImage *new_gimage;
Layer *layer, *new_layer;
Layer *floating_layer;
GimpLayer *layer, *new_layer;
GimpLayer *floating_layer;
Channel *channel, *new_channel;
GSList *list;
GList *glist;
Guide *guide = NULL;
Layer *active_layer = NULL;
GimpLayer *active_layer = NULL;
Channel *active_channel = NULL;
GimpDrawable *new_floating_sel_drawable = NULL;
GimpDrawable *floating_sel_drawable = NULL;
......@@ -608,16 +608,16 @@ duplicate (GimpImage *gimage)
layer = NULL;
while (list)
{
layer = (Layer *) list->data;
layer = (GimpLayer *) list->data;
list = g_slist_next (list);
new_layer = layer_copy (layer, FALSE);
new_layer = gimp_layer_copy (layer, FALSE);
gimp_drawable_set_gimage(GIMP_DRAWABLE(new_layer), new_gimage);
gimp_drawable_set_gimage (GIMP_DRAWABLE (new_layer), new_gimage);
/* Make sure the copied layer doesn't say: "<old layer> copy" */
layer_set_name(GIMP_LAYER(new_layer),
layer_get_name(GIMP_LAYER(layer)));
gimp_object_set_name (GIMP_OBJECT (new_layer),
gimp_object_get_name (GIMP_OBJECT (layer)));
/* Make sure if the layer has a layer mask, it's name isn't screwed up */
if (new_layer->mask)
......
......@@ -82,7 +82,7 @@ struct _ChannelsDialog
ChannelType components[3];
Channel *active_channel;
Layer *floating_sel;
GimpLayer *floating_sel;
GSList *channel_widgets;
};
......
......@@ -917,9 +917,9 @@ void
layers_previous_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
Layer *new_layer;
gint current_layer;
GDisplay *gdisp;
GimpLayer *new_layer;
gint current_layer;
return_if_no_display (gdisp);
......@@ -940,9 +940,9 @@ void
layers_next_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
Layer *new_layer;
gint current_layer;
GDisplay *gdisp;
GimpLayer *new_layer;
gint current_layer;
return_if_no_display (gdisp);
......@@ -1053,7 +1053,7 @@ layers_add_alpha_channel_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
layer_add_alpha ( gdisp->gimage->active_layer);
gimp_layer_add_alpha ( gdisp->gimage->active_layer);
gdisplays_flush ();
}
......@@ -1075,7 +1075,7 @@ layers_resize_to_image_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
layer_resize_to_image (gdisp->gimage->active_layer);
gimp_layer_resize_to_image (gdisp->gimage->active_layer);
gdisplays_flush ();
}
......
......@@ -329,7 +329,7 @@ typedef struct _Color Color;
typedef struct _QuantizeObj QuantizeObj;
typedef void (* Pass1_Func) (QuantizeObj *);
typedef void (* Pass2i_Func) (QuantizeObj *);
typedef void (* Pass2_Func) (QuantizeObj *, Layer *, TileManager *);
typedef void (* Pass2_Func) (QuantizeObj *, GimpLayer *, TileManager *);
typedef void (* Cleanup_Func) (QuantizeObj *);
typedef unsigned long ColorFreq;
typedef ColorFreq *CFHistogram;
......@@ -416,13 +416,13 @@ static void indexed_cancel_callback (GtkWidget *, gpointer);
static void indexed_custom_palette_button_callback (GtkWidget *widget, gpointer data);
static void indexed_palette_select_destroy_callback (GtkWidget *widget, gpointer data);
static void rgb_converter (Layer *, TileManager *, int);
static void grayscale_converter (Layer *, TileManager *, int);
static void rgb_converter (GimpLayer *, TileManager *, int);
static void grayscale_converter (GimpLayer *, TileManager *, int);
static void zero_histogram_gray (CFHistogram);
static void zero_histogram_rgb (CFHistogram);
static void generate_histogram_gray (CFHistogram, Layer *, int alpha_dither);
static void generate_histogram_rgb (CFHistogram, Layer *, int col_limit, int alpha_dither);
static void generate_histogram_gray (CFHistogram, GimpLayer *, int alpha_dither);
static void generate_histogram_rgb (CFHistogram, GimpLayer *, int col_limit, int alpha_dither);
static QuantizeObj* initialize_median_cut (int, int, ConvertDitherType,
ConvertPaletteType, int);
......@@ -552,14 +552,9 @@ convert_to_indexed (GimpImage *gimage)
if (dialog->num_cols == 256)
{
if ((!gimp_image_is_empty (gimage))
&&
(
gimage->layers->next
||
layer_has_alpha ((Layer *) gimage->layers->data)
)
)
if ((! gimp_image_is_empty (gimage)) &&
(gimage->layers->next ||
gimp_layer_has_alpha ((GimpLayer *) gimage->layers->data)))
{
dialog->num_cols = 255;
}
......@@ -756,14 +751,9 @@ convert_to_indexed (GimpImage *gimage)
/* if the image isn't non-alpha/layered, set the default number of
colours to one less than max, to leave room for a transparent index
for transparent/animated GIFs */
if ((!gimp_image_is_empty (gimage))
&&
(
gimage->layers->next
||
layer_has_alpha ((Layer *) gimage->layers->data)
)
)
if ((! gimp_image_is_empty (gimage)) &&
(gimage->layers->next ||
gimp_layer_has_alpha ((GimpLayer *) gimage->layers->data)))
{
frame = gtk_frame_new (_("[ Warning ]"));
gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0);
......@@ -1146,7 +1136,7 @@ make_remap_table (const unsigned char old_palette[],
}
static void
remap_indexed_layer (Layer *layer,
remap_indexed_layer (GimpLayer *layer,
unsigned char *remap_table,
int num_entries)
{
......@@ -1157,7 +1147,7 @@ remap_indexed_layer (Layer *layer,
unsigned char* src;
unsigned char* dest;
has_alpha = layer_has_alpha (layer) ? 1 : 0;
has_alpha = gimp_layer_has_alpha (layer) ? 1 : 0;
pixel_region_init (&srcPR,
GIMP_DRAWABLE(layer)->tiles, 0, 0,
GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height,
......@@ -1201,8 +1191,8 @@ convert_image (GImage *gimage,
ConvertPaletteType palette_type)
{
QuantizeObj *quantobj;
Layer *layer;
Layer *floating_layer;
GimpLayer *layer;
GimpLayer *floating_layer;
GimpImageBaseType old_type;
GSList *list;
GimpImageType new_layer_type;
......@@ -1262,7 +1252,7 @@ convert_image (GImage *gimage,
list = gimage->layers;
while (list)
{
layer = (Layer *) list->data;
layer = (GimpLayer *) list->data;
list = g_slist_next (list);
if (old_type == GRAY)
generate_histogram_gray (quantobj->histogram, layer, alpha_dither);
......@@ -1328,10 +1318,10 @@ convert_image (GImage *gimage,
list = gimage->layers;
while (list)
{
layer = (Layer *) list->data;
layer = (GimpLayer *) list->data;
list = g_slist_next (list);
has_alpha = layer_has_alpha (layer);
has_alpha = gimp_layer_has_alpha (layer);
switch (new_type)
{
case RGB:
......@@ -1412,7 +1402,7 @@ convert_image (GImage *gimage,
list = gimage->layers;
while (list)
{
layer = (Layer *) list->data;
layer = (GimpLayer *) list->data;
list = g_slist_next (list);
remap_indexed_layer (layer, remap_table, num_entries);
......@@ -1468,7 +1458,7 @@ convert_image (GImage *gimage,
}
static void
rgb_converter (Layer *layer,
rgb_converter (GimpLayer *layer,
TileManager *new_tiles,
int old_type)
{
......@@ -1481,7 +1471,7 @@ rgb_converter (Layer *layer,
unsigned char *cmap;
void *pr;
has_alpha = layer_has_alpha (layer);
has_alpha = gimp_layer_has_alpha (layer);
pixel_region_init (&srcPR, GIMP_DRAWABLE(layer)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, FALSE);
pixel_region_init (&destPR, new_tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, TRUE);
......@@ -1542,7 +1532,7 @@ rgb_converter (Layer *layer,
}
static void
grayscale_converter (Layer *layer,
grayscale_converter (GimpLayer *layer,
TileManager *new_tiles,
int old_type)
{
......@@ -1555,7 +1545,7 @@ grayscale_converter (Layer *layer,
unsigned char *cmap;
void *pr;
has_alpha = layer_has_alpha (layer);
has_alpha = gimp_layer_has_alpha (layer);
pixel_region_init (&srcPR, GIMP_DRAWABLE(layer)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, FALSE);
pixel_region_init (&destPR, new_tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, TRUE);
......@@ -1638,7 +1628,7 @@ zero_histogram_rgb (CFHistogram histogram)
static void
generate_histogram_gray (CFHistogram histogram,
Layer *layer,
GimpLayer *layer,
int alpha_dither)
{
PixelRegion srcPR;
......@@ -1647,7 +1637,7 @@ generate_histogram_gray (CFHistogram histogram,
void *pr;
gboolean has_alpha;
has_alpha = (gboolean) layer_has_alpha(layer);
has_alpha = gimp_layer_has_alpha (layer);
pixel_region_init (&srcPR, GIMP_DRAWABLE(layer)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, FALSE);
for (pr = pixel_regions_register (1, &srcPR);
......@@ -1667,7 +1657,7 @@ generate_histogram_gray (CFHistogram histogram,
static void
generate_histogram_rgb (CFHistogram histogram,
Layer *layer,
GimpLayer *layer,
int col_limit,
int alpha_dither)
{
......@@ -1681,7 +1671,7 @@ generate_histogram_rgb (CFHistogram histogram,
int row, col, coledge;
int offsetx, offsety;
has_alpha = (gboolean) layer_has_alpha(layer);
has_alpha = gimp_layer_has_alpha (layer);
gimp_drawable_offsets (GIMP_DRAWABLE(layer), &offsetx, &offsety);
......@@ -2991,7 +2981,7 @@ custompal_pass1 (QuantizeObj *quantobj)
static void
median_cut_pass2_no_dither_gray (QuantizeObj *quantobj,
Layer *layer,
GimpLayer *layer,
TileManager *new_tiles)
{
PixelRegion srcPR, destPR;
......@@ -3008,7 +2998,7 @@ median_cut_pass2_no_dither_gray (QuantizeObj *quantobj,
gimp_drawable_offsets (GIMP_DRAWABLE(layer), &offsetx, &offsety);
has_alpha = layer_has_alpha (layer);
has_alpha = gimp_layer_has_alpha (layer);
pixel_region_init (&srcPR, GIMP_DRAWABLE(layer)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, FALSE);
pixel_region_init (&destPR, new_tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, TRUE);
for (pr = pixel_regions_register (2, &srcPR, &destPR); pr != NULL; pr = pixel_regions_process (pr))
......@@ -3052,7 +3042,7 @@ median_cut_pass2_no_dither_gray (QuantizeObj *quantobj,
static void
median_cut_pass2_fixed_dither_gray (QuantizeObj *quantobj,
Layer *layer,
GimpLayer *layer,
TileManager *new_tiles)
{
PixelRegion srcPR, destPR;
......@@ -3071,7 +3061,7 @@ median_cut_pass2_fixed_dither_gray (QuantizeObj *quantobj,
gimp_drawable_offsets (GIMP_DRAWABLE(layer), &offsetx, &offsety);
has_alpha = layer_has_alpha (layer);
has_alpha = gimp_layer_has_alpha (layer);
pixel_region_init (&srcPR, GIMP_DRAWABLE(layer)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, FALSE);
pixel_region_init (&destPR, new_tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, TRUE);
for (pr = pixel_regions_register (2, &srcPR, &destPR); pr != NULL; pr = pixel_regions_process (pr))
......@@ -3129,7 +3119,7 @@ median_cut_pass2_fixed_dither_gray (QuantizeObj *quantobj,
static void
median_cut_pass2_no_dither_rgb (QuantizeObj *quantobj,
Layer *layer,
GimpLayer *layer,
TileManager *new_tiles)
{
PixelRegion srcPR, destPR;
......@@ -3156,7 +3146,7 @@ median_cut_pass2_no_dither_rgb (QuantizeObj *quantobj,
if (gimp_drawable_is_gray (GIMP_DRAWABLE(layer)))
red_pix = green_pix = blue_pix = GRAY_PIX;
has_alpha = layer_has_alpha (layer);
has_alpha = gimp_layer_has_alpha (layer);
pixel_region_init (&srcPR, GIMP_DRAWABLE(layer)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, FALSE);
pixel_region_init (&destPR, new_tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, TRUE);
for (pr = pixel_regions_register (2, &srcPR, &destPR); pr != NULL; pr = pixel_regions_process (pr))
......@@ -3204,7 +3194,7 @@ median_cut_pass2_no_dither_rgb (QuantizeObj *quantobj,
static void
median_cut_pass2_fixed_dither_rgb (QuantizeObj *quantobj,
Layer *layer,
GimpLayer *layer,
TileManager *new_tiles)
{
PixelRegion srcPR, destPR;
......@@ -3233,7 +3223,7 @@ median_cut_pass2_fixed_dither_rgb (QuantizeObj *quantobj,
if (gimp_drawable_is_gray (GIMP_DRAWABLE (layer)))
red_pix = green_pix = blue_pix = GRAY_PIX;
has_alpha = layer_has_alpha (layer);
has_alpha = gimp_layer_has_alpha (layer);
pixel_region_init (&srcPR, GIMP_DRAWABLE(layer)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, FALSE);
pixel_region_init (&destPR, new_tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, TRUE);
for (pr = pixel_regions_register (2, &srcPR, &destPR); pr != NULL; pr = pixel_regions_process (pr))
......@@ -3310,7 +3300,7 @@ median_cut_pass2_fixed_dither_rgb (QuantizeObj *quantobj,
static void
median_cut_pass2_nodestruct_dither_rgb (QuantizeObj *quantobj,
Layer *layer,
GimpLayer *layer,
TileManager *new_tiles)
{
PixelRegion srcPR, destPR;
......@@ -3332,7 +3322,7 @@ median_cut_pass2_nodestruct_dither_rgb (QuantizeObj *quantobj,
gimp_drawable_offsets (GIMP_DRAWABLE(layer), &offsetx, &offsety);
has_alpha = layer_has_alpha (layer);
has_alpha = gimp_layer_has_alpha (layer);
pixel_region_init (&srcPR, GIMP_DRAWABLE(layer)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, FALSE);
pixel_region_init (&destPR, new_tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, TRUE);
for (pr = pixel_regions_register (2, &srcPR, &destPR); pr != NULL; pr = pixel_regions_process (pr))
......@@ -3485,7 +3475,7 @@ init_error_limit (const int error_freedom)
static void
median_cut_pass2_fs_dither_gray (QuantizeObj *quantobj,
Layer *layer,
GimpLayer *layer,
TileManager *new_tiles)
{
PixelRegion srcPR, destPR;
......@@ -3516,7 +3506,7 @@ median_cut_pass2_fs_dither_gray (QuantizeObj *quantobj,
gimp_drawable_offsets (GIMP_DRAWABLE(layer), &offsetx, &offsety);
has_alpha = layer_has_alpha (layer);
has_alpha = gimp_layer_has_alpha (layer);
pixel_region_init (&srcPR, GIMP_DRAWABLE(layer)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, FALSE);
pixel_region_init (&destPR, new_tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, TRUE);
src_bytes = GIMP_DRAWABLE(layer)->bytes;
......@@ -3681,7 +3671,7 @@ median_cut_pass2_gray_init (QuantizeObj *quantobj)
static void
median_cut_pass2_fs_dither_rgb (QuantizeObj *quantobj,
Layer *layer,
GimpLayer *layer,
TileManager *new_tiles)
{
PixelRegion srcPR, destPR;
......@@ -3726,7 +3716,7 @@ median_cut_pass2_fs_dither_rgb (QuantizeObj *quantobj,
if (gimp_drawable_is_gray (GIMP_DRAWABLE(layer)))
red_pix = green_pix = blue_pix = GRAY_PIX;
has_alpha = layer_has_alpha (layer);
has_alpha = gimp_layer_has_alpha (layer);
pixel_region_init (&srcPR, GIMP_DRAWABLE(layer)->tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, FALSE);
pixel_region_init (&destPR, new_tiles, 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height, TRUE);
src_bytes = GIMP_DRAWABLE(layer)->bytes;
......
......@@ -196,7 +196,7 @@ crop_buffer (TileManager *tiles,
}
TileManager *
edit_cut (GImage *gimage,
edit_cut (GimpImage *gimage,
GimpDrawable *drawable)
{
TileManager *cut;
......@@ -250,7 +250,7 @@ edit_cut (GImage *gimage,
}
TileManager *
edit_copy (GImage *gimage,
edit_copy (GimpImage *gimage,
GimpDrawable *drawable)
{
TileManager *copy;
......@@ -298,31 +298,31 @@ edit_copy (GImage *gimage,
}
GimpLayer *
edit_paste (GImage *gimage,
edit_paste (GimpImage *gimage,
GimpDrawable *drawable,
TileManager *paste,
gboolean paste_into)
{
Layer *layer;
gint x1, y1, x2, y2;
gint cx, cy;
GimpLayer *layer;
gint x1, y1, x2, y2;
gint cx, cy;
/* Make a new layer: iff drawable == NULL,
* user is pasting into an empty display.
*/
if (drawable != NULL)
layer = layer_new_from_tiles (gimage,
gimp_drawable_type_with_alpha (drawable),
paste,
_("Pasted Layer"),
OPAQUE_OPACITY, NORMAL_MODE);
layer = gimp_layer_new_from_tiles (gimage,
gimp_drawable_type_with_alpha (drawable),
paste,
_("Pasted Layer"),
OPAQUE_OPACITY, NORMAL_MODE);
else
layer = layer_new_from_tiles (gimage,
gimp_image_base_type_with_alpha (gimage),
paste,
_("Pasted Layer"),
OPAQUE_OPACITY, NORMAL_MODE);
layer = gimp_layer_new_from_tiles (gimage,
gimp_image_base_type_with_alpha (gimage),
paste,
_("Pasted Layer"),
OPAQUE_OPACITY, NORMAL_MODE);
if (layer)
{
......@@ -374,12 +374,12 @@ edit_paste (GImage *gimage,
}
gboolean
edit_paste_as_new (GImage *invoke,
edit_paste_as_new (GimpImage *invoke,
TileManager *paste)
{
GImage *gimage;
Layer *layer;
GDisplay *gdisp;
GimpImage *gimage;
GimpLayer *layer;
GDisplay *gdisp;
if (!global_buf)
return FALSE;
......@@ -392,11 +392,11 @@ edit_paste_as_new (GImage *invoke,
gimp_image_set_resolution (gimage, invoke->xresolution, invoke->yresolution);
gimp_image_set_unit (gimage, invoke->unit);
layer = layer_new_from_tiles (gimage,
gimp_image_base_type_with_alpha (gimage),
paste,
_("Pasted Layer"),
OPAQUE_OPACITY, NORMAL_MODE);
layer = gimp_layer_new_from_tiles (gimage,
gimp_image_base_type_with_alpha (gimage),
paste,
_("Pasted Layer"),
OPAQUE_OPACITY, NORMAL_MODE);
if (layer)
{
......@@ -416,7 +416,7 @@ edit_paste_as_new (GImage *invoke,
}
gboolean
edit_clear (GImage *gimage,
edit_clear (GimpImage *gimage,
GimpDrawable *drawable)
{
TileManager *buf_tiles;
......@@ -455,7 +455,7 @@ edit_clear (GImage *gimage,
}
gboolean
edit_fill (GImage *gimage,
edit_fill (GimpImage *gimage,
GimpDrawable *drawable,
GimpFillType fill_type)
{
......
......@@ -23,8 +23,6 @@
#include "gimpdrawable.h"
/* OPERATIONS */
/* Half way point where a region is no longer visible in a selection */
#define HALF_WAY 127
......@@ -71,18 +69,19 @@ typedef struct _ChannelUndo ChannelUndo;
struct _ChannelUndo
{
Channel *channel; /* the actual channel */
gint prev_position; /* former position in list */
Channel *prev_channel; /* previous active channel */
Channel *channel; /* the actual channel */
gint prev_position; /* former position in list */
Channel *prev_channel; /* previous active channel */
};
/* Special undo type */
typedef struct _MaskUndo MaskUndo;
struct _MaskUndo
{
TileManager *tiles; /* the actual mask */
gint x, y; /* offsets */
TileManager *tiles; /* the actual mask */
gint x, y; /* offsets */
};
......@@ -221,7 +220,4 @@ void channel_layer_mask (Channel *mask,
void channel_invalidate_bounds (Channel *channel);
#define gimp_drawable_channel GIMP_IS_CHANNEL