Commit 7cf4eb46 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

removed "visible" and all its API...

2003-09-11  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable.[ch]: removed "visible" and all its API...

	* app/core/gimpitem.[ch]: ...and added it here.

	* app/core/core-enums.[ch]
	* app/core/gimpimage-undo-push.[ch]: changed the drawable
	visibility undo to be an item visibility undo.

	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c: save it in PROP_VECTORS and changed channel
	and layer loading/saving accordingly.

	* app/core/gimpimage-merge.c
	* app/core/gimpimage-preview.c
	* app/core/gimpimage-projection.c
	* app/core/gimpimage.c
	* app/core/gimplayer-floating-sel.c
	* app/core/gimplayer.c
	* app/core/gimpselection.c
	* app/text/gimptextlayer.c
	* app/gui/channels-commands.c
	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/layer.pdb: changed accordingly.

	* app/pdb/channel_cmds.c
	* app/pdb/layer_cmds.c: regenerated.

	* app/widgets/gimpdrawabletreeview.[ch]: removed the eye icon...

	* app/widgets/gimpitemtreeview.[ch]: ...and added it here.
parent 53d4915c
2003-09-11 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.[ch]: removed "visible" and all its API...
* app/core/gimpitem.[ch]: ...and added it here.
* app/core/core-enums.[ch]
* app/core/gimpimage-undo-push.[ch]: changed the drawable
visibility undo to be an item visibility undo.
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c: save it in PROP_VECTORS and changed channel
and layer loading/saving accordingly.
* app/core/gimpimage-merge.c
* app/core/gimpimage-preview.c
* app/core/gimpimage-projection.c
* app/core/gimpimage.c
* app/core/gimplayer-floating-sel.c
* app/core/gimplayer.c
* app/core/gimpselection.c
* app/text/gimptextlayer.c
* app/gui/channels-commands.c
* tools/pdbgen/pdb/channel.pdb
* tools/pdbgen/pdb/layer.pdb: changed accordingly.
* app/pdb/channel_cmds.c
* app/pdb/layer_cmds.c: regenerated.
* app/widgets/gimpdrawabletreeview.[ch]: removed the eye icon...
* app/widgets/gimpitemtreeview.[ch]: ...and added it here.
2003-09-11 Jakub Steiner <jimmac@ximian.com>
* themes/Default/images/preferences/folders-fonts.png:
......@@ -137,7 +137,7 @@ channels_duplicate_cmd_callback (GtkWidget *widget,
enum_class = g_type_class_ref (GIMP_TYPE_CHANNEL_TYPE);
enum_value = g_enum_get_value (enum_class, component);
g_type_class_unref (enum_class);
name = g_strdup_printf (_("%s Channel Copy"),
gettext (enum_value->value_name));
......@@ -147,7 +147,7 @@ channels_duplicate_cmd_callback (GtkWidget *widget,
/* copied components are invisible by default so subsequent copies
* of components don't affect each other
*/
gimp_drawable_set_visible (GIMP_DRAWABLE (new_channel), FALSE, FALSE);
gimp_item_set_visible (GIMP_ITEM (new_channel), FALSE, FALSE);
g_free (name);
}
......@@ -336,7 +336,7 @@ channels_new_channel_query (GimpImage *gimage,
48, 64);
gimp_color_panel_set_context (GIMP_COLOR_PANEL (options->color_panel),
gimp_get_user_context (gimage->gimp));
/* The dialog */
options->query_box =
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
......@@ -561,7 +561,7 @@ channels_edit_channel_query (GimpChannel *channel)
g_signal_connect (options->color_panel, "color_changed",
G_CALLBACK (channels_color_changed),
opacity_scale_data);
opacity_scale_data);
gtk_widget_show (table);
gtk_widget_show (vbox);
......
......@@ -502,8 +502,8 @@ static const GEnumValue gimp_undo_type_enum_values[] =
{ GIMP_UNDO_GROUP_MASK, N_("Selection Mask"), "group-mask" },
{ GIMP_UNDO_GROUP_ITEM_PROPERTIES, N_("Item Properties"), "group-item-properties" },
{ GIMP_UNDO_GROUP_ITEM_DISPLACE, N_("Move Item"), "group-item-displace" },
{ GIMP_UNDO_GROUP_ITEM_VISIBILITY, N_("Item Visibility"), "group-item-visibility" },
{ GIMP_UNDO_GROUP_ITEM_LINKED, N_("Linked Item"), "group-item-linked" },
{ GIMP_UNDO_GROUP_DRAWABLE_VISIBILITY, N_("Drawable Visibility"), "group-drawable-visibility" },
{ GIMP_UNDO_GROUP_LAYER_SCALE, N_("Scale Layer"), "group-layer-scale" },
{ GIMP_UNDO_GROUP_LAYER_RESIZE, N_("Resize Layer"), "group-layer-resize" },
{ GIMP_UNDO_GROUP_LAYER_APPLY_MASK, N_("Apply Layer Mask"), "group-layer-apply-mask" },
......@@ -531,8 +531,8 @@ static const GEnumValue gimp_undo_type_enum_values[] =
{ GIMP_UNDO_MASK, N_("Selection Mask"), "mask" },
{ GIMP_UNDO_ITEM_RENAME, N_("Rename Item"), "item-rename" },
{ GIMP_UNDO_ITEM_DISPLACE, N_("Move Item"), "item-displace" },
{ GIMP_UNDO_ITEM_VISIBILITY, N_("Item Visibility"), "item-visibility" },
{ GIMP_UNDO_ITEM_LINKED, N_("Set Item Linked"), "item-linked" },
{ GIMP_UNDO_DRAWABLE_VISIBILITY, N_("Drawable Visibility"), "drawable-visibility" },
{ GIMP_UNDO_LAYER_ADD, N_("New Layer"), "layer-add" },
{ GIMP_UNDO_LAYER_REMOVE, N_("Delete Layer"), "layer-remove" },
{ GIMP_UNDO_LAYER_MOD, N_("Layer Mod"), "layer-mod" },
......
......@@ -365,8 +365,8 @@ typedef enum /*< pdb-skip >*/
GIMP_UNDO_GROUP_MASK, /*< desc="Selection Mask" >*/
GIMP_UNDO_GROUP_ITEM_PROPERTIES, /*< desc="Item Properties" >*/
GIMP_UNDO_GROUP_ITEM_DISPLACE, /*< desc="Move Item" >*/
GIMP_UNDO_GROUP_ITEM_VISIBILITY, /*< desc="Item Visibility" >*/
GIMP_UNDO_GROUP_ITEM_LINKED, /*< desc="Linked Item" >*/
GIMP_UNDO_GROUP_DRAWABLE_VISIBILITY,/*< desc="Drawable Visibility" >*/
GIMP_UNDO_GROUP_LAYER_SCALE, /*< desc="Scale Layer" >*/
GIMP_UNDO_GROUP_LAYER_RESIZE, /*< desc="Resize Layer" >*/
GIMP_UNDO_GROUP_LAYER_APPLY_MASK, /*< desc="Apply Layer Mask" >*/
......@@ -399,8 +399,8 @@ typedef enum /*< pdb-skip >*/
GIMP_UNDO_MASK, /*< desc="Selection Mask" >*/
GIMP_UNDO_ITEM_RENAME, /*< desc="Rename Item" >*/
GIMP_UNDO_ITEM_DISPLACE, /*< desc="Move Item" >*/
GIMP_UNDO_ITEM_VISIBILITY, /*< desc="Item Visibility" >*/
GIMP_UNDO_ITEM_LINKED, /*< desc="Set Item Linked" >*/
GIMP_UNDO_DRAWABLE_VISIBILITY, /*< desc="Drawable Visibility" >*/
GIMP_UNDO_LAYER_ADD, /*< desc="New Layer" >*/
GIMP_UNDO_LAYER_REMOVE, /*< desc="Delete Layer" >*/
GIMP_UNDO_LAYER_MOD, /*< desc="Layer Mod" >*/
......
......@@ -57,7 +57,6 @@
enum
{
UPDATE,
VISIBILITY_CHANGED,
ALPHA_CHANGED,
LAST_SIGNAL
};
......@@ -176,15 +175,6 @@ gimp_drawable_class_init (GimpDrawableClass *klass)
G_TYPE_INT,
G_TYPE_INT);
gimp_drawable_signals[VISIBILITY_CHANGED] =
g_signal_new ("visibility_changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpDrawableClass, visibility_changed),
NULL, NULL,
gimp_marshal_VOID__VOID,
G_TYPE_NONE, 0);
gimp_drawable_signals[ALPHA_CHANGED] =
g_signal_new ("alpha_changed",
G_TYPE_FROM_CLASS (klass),
......@@ -211,7 +201,6 @@ gimp_drawable_class_init (GimpDrawableClass *klass)
item_class->transform = gimp_drawable_transform;
klass->update = gimp_drawable_real_update;
klass->visibility_changed = NULL;
klass->alpha_changed = NULL;
klass->invalidate_boundary = NULL;
}
......@@ -220,7 +209,6 @@ static void
gimp_drawable_init (GimpDrawable *drawable)
{
drawable->tiles = NULL;
drawable->visible = FALSE;
drawable->bytes = 0;
drawable->type = -1;
drawable->has_alpha = FALSE;
......@@ -317,8 +305,6 @@ gimp_drawable_duplicate (GimpItem *item,
new_image_type,
GIMP_OBJECT (new_drawable)->name);
new_drawable->visible = drawable->visible;
pixel_region_init (&srcPR, drawable->tiles,
0, 0,
item->width,
......@@ -609,7 +595,7 @@ gimp_drawable_configure (GimpDrawable *drawable,
drawable->tiles = tile_manager_new (width, height, drawable->bytes);
drawable->visible = TRUE;
GIMP_ITEM (drawable)->visible = TRUE;
/* preview variables */
drawable->preview_cache = NULL;
......@@ -927,39 +913,6 @@ gimp_drawable_bytes_with_alpha (const GimpDrawable *drawable)
return GIMP_IMAGE_TYPE_BYTES (type);
}
gboolean
gimp_drawable_get_visible (const GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
return drawable->visible;
}
void
gimp_drawable_set_visible (GimpDrawable *drawable,
gboolean visible,
gboolean push_undo)
{
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (drawable->visible != visible)
{
GimpItem *item = GIMP_ITEM (drawable);
if (push_undo)
{
GimpImage *gimage = gimp_item_get_image (item);
if (gimage)
gimp_image_undo_push_drawable_visibility (gimage, NULL, drawable);
}
drawable->visible = visible ? TRUE : FALSE;
g_signal_emit (drawable, gimp_drawable_signals[VISIBILITY_CHANGED], 0);
}
}
void
gimp_drawable_alpha_changed (GimpDrawable *drawable)
{
......
......@@ -38,7 +38,6 @@ struct _GimpDrawable
GimpItem parent_instance;
TileManager *tiles; /* tiles for drawable data */
gboolean visible; /* controls visibility */
gint bytes; /* bytes per pixel */
GimpImageType type; /* type of drawable */
......@@ -59,7 +58,6 @@ struct _GimpDrawableClass
gint y,
gint width,
gint height);
void (* visibility_changed) (GimpDrawable *drawable);
void (* alpha_changed) (GimpDrawable *drawable);
/* virtual functions */
......@@ -91,7 +89,7 @@ void gimp_drawable_push_undo (GimpDrawable *drawable,
gint x1,
gint y1,
gint x2,
gint y2,
gint y2,
TileManager *tiles,
gboolean sparse);
......@@ -122,11 +120,6 @@ TileManager * gimp_drawable_shadow (GimpDrawable *drawable);
gint gimp_drawable_bytes (const GimpDrawable *drawable);
gint gimp_drawable_bytes_with_alpha (const GimpDrawable *drawable);
gboolean gimp_drawable_get_visible (const GimpDrawable *drawable);
void gimp_drawable_set_visible (GimpDrawable *drawable,
gboolean visible,
gboolean push_undo);
void gimp_drawable_alpha_changed (GimpDrawable *drawable);
void gimp_drawable_invalidate_boundary (GimpDrawable *drawable);
......
......@@ -75,7 +75,7 @@ gimp_image_merge_visible_layers (GimpImage *gimage,
{
layer = (GimpLayer *) list->data;
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
if (gimp_item_get_visible (GIMP_ITEM (layer)))
merge_list = g_slist_append (merge_list, layer);
}
......@@ -128,7 +128,7 @@ gimp_image_flatten (GimpImage *gimage)
{
layer = (GimpLayer *) list->data;
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
if (gimp_item_get_visible (GIMP_ITEM (layer)))
merge_list = g_slist_append (merge_list, layer);
}
......@@ -171,7 +171,7 @@ gimp_image_merge_down (GimpImage *gimage,
{
layer = (GimpLayer *) layer_list->data;
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
if (gimp_item_get_visible (GIMP_ITEM (layer)))
merge_list = g_slist_append (NULL, layer);
}
......@@ -489,7 +489,7 @@ gimp_image_merge_layers (GimpImage *gimage,
gimp_object_set_name (GIMP_OBJECT (merge_layer), name);
g_free (name);
gimp_drawable_set_visible (GIMP_DRAWABLE (merge_layer), TRUE, TRUE);
gimp_item_set_visible (GIMP_ITEM (merge_layer), TRUE, TRUE);
/* End the merge undo group */
gimp_image_undo_group_end (gimage);
......
......@@ -114,7 +114,7 @@ gimp_image_get_popup_size (GimpViewable *viewable,
TempBuf *
gimp_image_get_preview (GimpViewable *viewable,
gint width,
gint width,
gint height)
{
GimpImage *gimage;
......@@ -152,7 +152,7 @@ gimp_image_get_preview (GimpViewable *viewable,
TempBuf *
gimp_image_get_new_preview (GimpViewable *viewable,
gint width,
gint width,
gint height)
{
GimpImage *gimage;
......@@ -201,16 +201,16 @@ gimp_image_get_new_preview (GimpViewable *viewable,
floating_sel = NULL;
for (list = GIMP_LIST (gimage->layers)->list;
list;
for (list = GIMP_LIST (gimage->layers)->list;
list;
list = g_list_next (list))
{
layer = (GimpLayer *) list->data;
/* only add layers that are visible to the list */
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
if (gimp_item_get_visible (GIMP_ITEM (layer)))
{
/* floating selections are added right above the layer
/* floating selections are added right above the layer
* they are attached to
*/
if (gimp_layer_is_floating_sel (layer))
......@@ -266,12 +266,12 @@ gimp_image_get_new_preview (GimpViewable *viewable,
g_assert (layer_buf->bytes <= comp->bytes);
src2PR.bytes = layer_buf->bytes;
src2PR.x = src1PR.x;
src2PR.x = src1PR.x;
src2PR.y = src1PR.y;
src2PR.w = src1PR.w;
src2PR.w = src1PR.w;
src2PR.h = src1PR.h;
src2PR.rowstride = layer_buf->width * src2PR.bytes;
src2PR.data = (temp_buf_data (layer_buf) +
src2PR.data = (temp_buf_data (layer_buf) +
(y1 - y) * src2PR.rowstride +
(x1 - x) * src2PR.bytes);
......@@ -280,9 +280,9 @@ gimp_image_get_new_preview (GimpViewable *viewable,
mask_buf = gimp_viewable_get_preview (GIMP_VIEWABLE (layer->mask),
w, h);
maskPR.bytes = mask_buf->bytes;
maskPR.x = src1PR.x;
maskPR.x = src1PR.x;
maskPR.y = src1PR.y;
maskPR.w = src1PR.w;
maskPR.w = src1PR.w;
maskPR.h = src1PR.h;
maskPR.rowstride = mask_buf->width * mask_buf->bytes;
maskPR.data = (mask_buf_data (mask_buf) +
......@@ -305,14 +305,14 @@ gimp_image_get_new_preview (GimpViewable *viewable,
if (gimp_drawable_has_alpha (GIMP_DRAWABLE (layer)))
{
if (! construct_flag)
initial_region (&src2PR, &src1PR,
initial_region (&src2PR, &src1PR,
mask, NULL,
layer->opacity * 255.999,
layer->mode,
visible_components,
INITIAL_INTENSITY_ALPHA);
else
combine_regions (&src1PR, &src2PR, &src1PR,
combine_regions (&src1PR, &src2PR, &src1PR,
mask, NULL,
layer->opacity * 255.999,
layer->mode,
......@@ -322,14 +322,14 @@ gimp_image_get_new_preview (GimpViewable *viewable,
else
{
if (! construct_flag)
initial_region (&src2PR, &src1PR,
initial_region (&src2PR, &src1PR,
mask, NULL,
layer->opacity * 255.999,
layer->mode,
visible_components,
INITIAL_INTENSITY);
else
combine_regions (&src1PR, &src2PR, &src1PR,
combine_regions (&src1PR, &src2PR, &src1PR,
mask, NULL,
layer->opacity * 255.999,
layer->mode,
......
......@@ -78,9 +78,9 @@ static void project_indexed (GimpImage *gimage,
GimpLayer *layer,
PixelRegion *src,
PixelRegion *dest);
static void project_indexed_alpha (GimpImage *gimage,
static void project_indexed_alpha (GimpImage *gimage,
GimpLayer *layer,
PixelRegion *src,
PixelRegion *src,
PixelRegion *dest,
PixelRegion *mask);
static void project_channel (GimpImage *gimage,
......@@ -147,7 +147,7 @@ gimp_image_projection (GimpImage *gimage)
{
gimp_image_projection_allocate (gimage);
}
return gimage->projection;
}
......@@ -176,8 +176,8 @@ gimp_image_projection_opacity (const GimpImage *gimage)
}
guchar *
gimp_image_projection_get_color_at (GimpImage *gimage,
gint x,
gimp_image_projection_get_color_at (GimpImage *gimage,
gint x,
gint y)
{
Tile *tile;
......@@ -188,7 +188,7 @@ gimp_image_projection_get_color_at (GimpImage *gimage,
if (x < 0 || y < 0 || x >= gimage->width || y >= gimage->height)
return NULL;
dest = g_new (guchar, 5);
tile = tile_manager_get_tile (gimp_image_projection (gimage), x, y,
TRUE, FALSE);
......@@ -207,7 +207,7 @@ gimp_image_projection_get_color_at (GimpImage *gimage,
}
void
gimp_image_invalidate (GimpImage *gimage,
gimp_image_invalidate (GimpImage *gimage,
gint x,
gint y,
gint w,
......@@ -267,25 +267,25 @@ gimp_image_invalidate (GimpImage *gimage,
{
tilex = j - (j % TILE_WIDTH);
tiley = i - (i % TILE_HEIGHT);
startx = MIN (startx, tilex);
endx = MAX (endx, tilex + tile_ewidth (tile));
starty = MIN (starty, tiley);
endy = MAX (endy, tiley + tile_eheight (tile));
tile_mark_valid (tile); /* hmmmmmmm..... */
}
}
}
if ((endx - startx) > 0 && (endy - starty) > 0)
gimp_image_construct (gimage,
startx, starty,
gimp_image_construct (gimage,
startx, starty,
(endx - startx), (endy - starty));
}
void
gimp_image_invalidate_without_render (GimpImage *gimage,
gimp_image_invalidate_without_render (GimpImage *gimage,
gint x,
gint y,
gint w,
......@@ -327,7 +327,7 @@ gimp_image_invalidate_without_render (GimpImage *gimage,
/* private functions */
static void
gimp_image_projection_validate_tile (TileManager *tm,
gimp_image_projection_validate_tile (TileManager *tm,
Tile *tile)
{
GimpImage *gimage;
......@@ -348,10 +348,10 @@ gimp_image_projection_validate_tile (TileManager *tm,
}
static void
gimp_image_construct_layers (GimpImage *gimage,
gint x,
gint y,
gint w,
gimp_image_construct_layers (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h)
{
GimpLayer *layer;
......@@ -370,17 +370,17 @@ gimp_image_construct_layers (GimpImage *gimage,
reverse_list = NULL;
for (list = GIMP_LIST (gimage->layers)->list;
list;
for (list = GIMP_LIST (gimage->layers)->list;
list;
list = g_list_next (list))
{
layer = (GimpLayer *) list->data;
/* only add layers that are visible and not floating selections
/* only add layers that are visible and not floating selections
* to the list
*/
if (! gimp_layer_is_floating_sel (layer) &&
gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
if (! gimp_layer_is_floating_sel (layer) &&
gimp_item_get_visible (GIMP_ITEM (layer)))
{
reverse_list = g_list_prepend (reverse_list, layer);
}
......@@ -398,14 +398,14 @@ gimp_image_construct_layers (GimpImage *gimage,
y2 = CLAMP (off_y + gimp_item_height (GIMP_ITEM (layer)), y, y + h);
/* configure the pixel regions */
pixel_region_init (&src1PR, gimp_image_projection (gimage),
x1, y1, (x2 - x1), (y2 - y1),
pixel_region_init (&src1PR, gimp_image_projection (gimage),
x1, y1, (x2 - x1), (y2 - y1),
TRUE);
/* If we're showing the layer mask instead of the layer... */
if (layer->mask && layer->mask->show_mask)
{
pixel_region_init (&src2PR,
pixel_region_init (&src2PR,
gimp_drawable_data (GIMP_DRAWABLE (layer->mask)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
......@@ -415,14 +415,14 @@ gimp_image_construct_layers (GimpImage *gimage,
/* Otherwise, normal */
else
{
pixel_region_init (&src2PR,
pixel_region_init (&src2PR,
gimp_drawable_data (GIMP_DRAWABLE (layer)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
if (layer->mask && layer->mask->apply_mask)
{
pixel_region_init (&maskPR,
pixel_region_init (&maskPR,
gimp_drawable_data (GIMP_DRAWABLE (layer->mask)),
(x1 - off_x), (y1 - off_y),
(x2 - x1), (y2 - y1), FALSE);
......@@ -466,10 +466,10 @@ gimp_image_construct_layers (GimpImage *gimage,
}
static void
gimp_image_construct_channels (GimpImage *gimage,
gint x,
gint y,
gint w,
gimp_image_construct_channels (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h)
{
GimpChannel *channel;
......@@ -479,8 +479,8 @@ gimp_image_construct_channels (GimpImage *gimage,
GList *reverse_list = NULL;
/* reverse the channel list */
for (list = GIMP_LIST (gimage->channels)->list;
list;
for (list = GIMP_LIST (gimage->channels)->list;
list;
list = g_list_next (list))
{
reverse_list = g_list_prepend (reverse_list, list->data);
......@@ -490,16 +490,16 @@ gimp_image_construct_channels (GimpImage *gimage,
{
channel = (GimpChannel *) list->data;
if (gimp_drawable_get_visible (GIMP_DRAWABLE (channel)))
if (gimp_item_get_visible (GIMP_ITEM (channel)))
{
/* configure the pixel regions */
pixel_region_init (&src1PR,
gimp_image_projection (gimage),
x, y, w, h,
gimp_image_projection (gimage),
x, y, w, h,
TRUE);
pixel_region_init (&src2PR,
gimp_drawable_data (GIMP_DRAWABLE (channel)),
x, y, w, h,
gimp_drawable_data (GIMP_DRAWABLE (channel)),
x, y, w, h,
FALSE);
project_channel (gimage, channel, &src1PR, &src2PR);
......@@ -512,10 +512,10 @@ gimp_image_construct_channels (GimpImage *gimage,
}
static void
gimp_image_initialize_projection (GimpImage *gimage,
gint x,
gint y,
gint w,
gimp_image_initialize_projection (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h)
{
......@@ -528,9 +528,9 @@ gimp_image_initialize_projection (GimpImage *gimage,
* provides complete coverage over the image. If not,
* the projection is initialized to transparent
*/
for (list = GIMP_LIST (gimage->layers)->list;
list;
for (list = GIMP_LIST (gimage->layers)->list;
list;
list = g_list_next (list))
{
GimpItem *item;
......@@ -540,11 +540,11 @@ gimp_image_initialize_projection (GimpImage *gimage,
gimp_item_offsets (item, &off_x, &off_y);
if (gimp_drawable_get_visible (GIMP_DRAWABLE (item)) &&
if (gimp_item_get_visible (GIMP_ITEM (item)) &&
! gimp_drawable_has_alpha (GIMP_DRAWABLE (item)) &&
(off_x <= x) &&
(off_y <= y) &&
(off_x + gimp_item_width (item) >= x + w) &&
(off_x <= x) &&
(off_y <= y) &&
(off_x + gimp_item_width (item) >= x + w) &&
(off_y + gimp_item_height (item) >= y + h))
{
coverage = 1;
......@@ -554,14 +554,14 @@ gimp_image_initialize_projection (GimpImage *gimage,
if (!coverage)
{
pixel_region_init (&PR, gimp_image_projection (gimage),
pixel_region_init (&PR, gimp_image_projection (gimage),
x, y, w, h, TRUE);
color_region (&PR, clear);
}
}
static void
gimp_image_construct (GimpImage *gimage,
gimp_image_construct (GimpImage *gimage,
gint x,
gint y,
gint w,
......@@ -572,7 +572,7 @@ gimp_image_construct (GimpImage *gimage,
#if 0
gint xoff;
gint yoff;
/* set the construct flag, used to determine if anything
* has been written to the gimage raw image yet.
*/
......@@ -584,10 +584,10 @@ gimp_image_construct (GimpImage *gimage,
}
if ((gimage->layers) && /* There's a layer. */
(! g_slist_next (gimage->layers)) && /* It's the only layer. */
(! g_slist_next (gimage->layers)) && /* It's the only layer. */
(gimp_drawable_has_alpha (GIMP_DRAWABLE (gimage->layers->data))) &&
/* It's !flat. */
(gimp_drawable_get_visible (GIMP_DRAWABLE (gimage->layers->data))) &&
(gimp_item_get_visible (GIMP_ITEM (gimage->layers->data))) &&
/* It's visible. */
(gimp_item_width (GIMP_ITEM (gimage->layers->data)) ==
gimage->width) &&
......@@ -596,7 +596,7 @@ gimp_image_construct (GimpImage *gimage,
(!gimp_drawable_is_indexed (GIMP_DRAWABLE (gimage->layers->data))) &&
/* Not indexed. */
(((GimpLayer *)(gimage->layers->data))->opacity == GIMP_OPACITY_OPAQUE)
/* Opaque */
/* Opaque */
)
{
gint xoff;
......@@ -608,7 +608,7 @@ gimp_image_construct (GimpImage *gimage,
{
PixelRegion srcPR, destPR;
gpointer pr;
g_warning("Can use cow-projection hack. Yay!");
pixel_region_init (&srcPR, gimp_drawable_data
......@@ -635,14 +635,14 @@ gimp_image_construct (GimpImage *gimage,
#else
gimage->construct_flag = FALSE;
#endif
/* First, determine if the projection image needs to be
* initialized--this is the case when there are no visible
* layers that cover the entire canvas--either because layers
* are offset or only a floating selection is visible
*/
gimp_image_initialize_projection (gimage, x, y, w, h);
/* call functions which process the list of layers and
* the list of channels
*/
......@@ -651,10 +651,10 @@ gimp_image_construct (GimpImage *gimage,
}
static void
project_intensity (GimpImage *gimage,
project_intensity (GimpImage *gimage,
GimpLayer *layer,
PixelRegion *src,
PixelRegion *dest,
PixelRegion *src,
PixelRegion *dest,
PixelRegion *mask)
{
if (! gimage->construct_flag)
......@@ -672,7 +672,7 @@ project_intensity (GimpImage *gimage,
}
static void
project_intensity_alpha (GimpImage *gimage,
project_intensity_alpha (GimpImage *gimage,
GimpLayer *layer,
PixelRegion *src,
PixelRegion *dest,
......@@ -693,9 +693,9 @@ project_intensity_alpha (GimpImage *gimage,
}
static void
project_indexed (GimpImage *gimage,
project_indexed (GimpImage *gimage,
GimpLayer *layer,
PixelRegion *src,
PixelRegion *src,
PixelRegion *dest)
{
if (! gimage->construct_flag)
......@@ -709,9 +709,9 @@ project_indexed (GimpImage *gimage,
}
static void
project_indexed_alpha (GimpImage *gimage,
project_indexed_alpha (GimpImage *gimage,
GimpLayer *layer,
PixelRegion *src,