Commit 65235b91 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

new function gimp_drawable_set_visible(). Renamed gimp_drawable_visible()

2001-03-04  Michael Natterer  <mitch@gimp.org>

	* app/gimpdrawable.[ch]: new function gimp_drawable_set_visible().
	Renamed gimp_drawable_visible() to gimp_drawable_get_visible().
	Added a "visibility_changed" signal.

	* app/gimplistitem.[ch]: new virtual function "set_viewable"
	which allows subclasses to connect to the viewable's signals.

	* app/gimpdrawablelistitem.[ch]: added an eye button. Implement
	"set_viewable" to connect to the "visibility_changed" signal.

	* app/gimpchannel.[ch]: removed unused function
	gimp_channel_toggle_visibility().

	* app/channels_dialog.c
	* app/floating_sel.c
	* app/gimage_mask.c
	* app/gimpimage.c
	* app/gimplayer.c
	* app/layers_dialog.c
	* app/xcf.c
	* app/pdb/channel_cmds.c
	* app/pdb/layer_cmds.c
	* app/pdb/pdb_glue.h
	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/layer.pdb: removed direct access of
	drawable->visible and use the functions instead. Also makes PDB
	code generation nicer.

	* pixmaps/eye.xpm: cropped it a bit.
parent 5d0edd70
2001-03-04 Michael Natterer <mitch@gimp.org>
* app/gimpdrawable.[ch]: new function gimp_drawable_set_visible().
Renamed gimp_drawable_visible() to gimp_drawable_get_visible().
Added a "visibility_changed" signal.
* app/gimpdrawablelistitem.[ch]
* app/gimplistitem.[ch]
* app/gimpchannel.[ch]: removed unused function
gimp_channel_toggle_visibility().
* app/channels_dialog.c
* app/floating_sel.c
* app/gimage_mask.c
* app/gimpimage.c
* app/gimplayer.c
* app/layers_dialog.c
* app/xcf.c
* app/pdb/channel_cmds.c
* app/pdb/layer_cmds.c
* app/pdb/pdb_glue.h
* tools/pdbgen/pdb/channel.pdb
* tools/pdbgen/pdb/layer.pdb: removed direct access of
drawable->visible and use the functions instead. Also makes PDB
code generation nicer.
* pixmaps/eye.xpm: cropped it a bit.
2001-03-04 Zbigniew Chyla <cyba@gnome.pl>
* app/commands.c (image_scale_callback),
......
......@@ -1898,6 +1898,7 @@ channel_widget_button_events (GtkWidget *widget,
gpointer data)
{
ChannelWidget *channel_widget;
GimpChannel *channel;
GtkWidget *event_widget;
GdkEventButton *bevent;
gint return_val;
......@@ -1913,10 +1914,12 @@ channel_widget_button_events (GtkWidget *widget,
(ChannelWidget *) gtk_object_get_user_data (GTK_OBJECT (widget));
return_val = FALSE;
channel = channel_widget->channel;
switch (channel_widget->type)
{
case AUXILLARY_CHANNEL:
visible = GIMP_DRAWABLE (channel_widget->channel)->visible;
visible = gimp_drawable_get_visible (GIMP_DRAWABLE (channel));
width = GIMP_DRAWABLE (channel_widget->channel)->width;
height = GIMP_DRAWABLE (channel_widget->channel)->height;
break;
......@@ -1965,7 +1968,7 @@ channel_widget_button_events (GtkWidget *widget,
{
exclusive = FALSE;
if (channel_widget->type == AUXILLARY_CHANNEL)
GIMP_DRAWABLE (channel_widget->channel)->visible = !visible;
gimp_drawable_set_visible (GIMP_DRAWABLE (channel), ! visible);
else
gimp_image_set_component_visible (channel_widget->gimage,
channel_widget->type,
......@@ -2014,7 +2017,8 @@ channel_widget_button_events (GtkWidget *widget,
else
{
if (channel_widget->type == AUXILLARY_CHANNEL)
GIMP_DRAWABLE (channel_widget->channel)->visible = !visible;
gimp_drawable_set_visible (GIMP_DRAWABLE (channel),
! visible);
else
gimp_image_set_component_visible (channel_widget->gimage,
channel_widget->type,
......@@ -2306,7 +2310,8 @@ channel_widget_eye_redraw (ChannelWidget *channel_widget)
switch (channel_widget->type)
{
case AUXILLARY_CHANNEL:
visible = GIMP_DRAWABLE (channel_widget->channel)->visible;
visible =
gimp_drawable_get_visible (GIMP_DRAWABLE (channel_widget->channel));
break;
default:
visible = gimp_image_get_component_visible (channel_widget->gimage,
......@@ -2375,7 +2380,7 @@ channel_widget_exclusive_visible (ChannelWidget *channel_widget)
switch (cw->type)
{
case AUXILLARY_CHANNEL:
visible |= GIMP_DRAWABLE (cw->channel)->visible;
visible |= gimp_drawable_get_visible (GIMP_DRAWABLE (cw->channel));
break;
default:
visible |= gimp_image_get_component_visible (cw->gimage, cw->type);
......@@ -2393,7 +2398,7 @@ channel_widget_exclusive_visible (ChannelWidget *channel_widget)
switch (cw->type)
{
case AUXILLARY_CHANNEL:
GIMP_DRAWABLE (cw->channel)->visible = !visible;
gimp_drawable_set_visible (GIMP_DRAWABLE (cw->channel), ! visible);
break;
default:
gimp_image_set_component_visible (cw->gimage, cw->type, !visible);
......@@ -2403,7 +2408,7 @@ channel_widget_exclusive_visible (ChannelWidget *channel_widget)
switch (cw->type)
{
case AUXILLARY_CHANNEL:
GIMP_DRAWABLE (cw->channel)->visible = TRUE;
gimp_drawable_set_visible (GIMP_DRAWABLE (cw->channel), TRUE);
break;
default:
gimp_image_set_component_visible (cw->gimage, cw->type, TRUE);
......
......@@ -204,7 +204,9 @@ gimp_channel_copy (const GimpChannel *channel)
GIMP_DRAWABLE (channel)->height,
channel_name,
&channel->color);
GIMP_DRAWABLE (new_channel)->visible = GIMP_DRAWABLE (channel)->visible;
new_channel->show_masked = channel->show_masked;
/* copy the contents across channels */
......@@ -413,14 +415,6 @@ gimp_channel_resize (GimpChannel *channel,
GIMP_DRAWABLE (channel)->height);
}
gboolean
gimp_channel_toggle_visibility (GimpChannel *channel)
{
GIMP_DRAWABLE (channel)->visible = !GIMP_DRAWABLE (channel)->visible;
return GIMP_DRAWABLE (channel)->visible;
}
/******************************/
/* selection mask functions */
......
......@@ -109,7 +109,6 @@ void gimp_channel_resize (GimpChannel *channel,
gint offx,
gint offy);
gboolean gimp_channel_toggle_visibility (GimpChannel *channel);
/* selection mask functions */
......
......@@ -204,7 +204,9 @@ gimp_channel_copy (const GimpChannel *channel)
GIMP_DRAWABLE (channel)->height,
channel_name,
&channel->color);
GIMP_DRAWABLE (new_channel)->visible = GIMP_DRAWABLE (channel)->visible;
new_channel->show_masked = channel->show_masked;
/* copy the contents across channels */
......@@ -413,14 +415,6 @@ gimp_channel_resize (GimpChannel *channel,
GIMP_DRAWABLE (channel)->height);
}
gboolean
gimp_channel_toggle_visibility (GimpChannel *channel)
{
GIMP_DRAWABLE (channel)->visible = !GIMP_DRAWABLE (channel)->visible;
return GIMP_DRAWABLE (channel)->visible;
}
/******************************/
/* selection mask functions */
......
......@@ -109,7 +109,6 @@ void gimp_channel_resize (GimpChannel *channel,
gint offx,
gint offy);
gboolean gimp_channel_toggle_visibility (GimpChannel *channel);
/* selection mask functions */
......
......@@ -52,6 +52,7 @@
enum
{
VISIBILITY_CHANGED,
REMOVED,
LAST_SIGNAL
};
......@@ -112,6 +113,15 @@ gimp_drawable_class_init (GimpDrawableClass *klass)
parent_class = gtk_type_class (GIMP_TYPE_VIEWABLE);
gimp_drawable_signals[VISIBILITY_CHANGED] =
gtk_signal_new ("visibility_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpDrawableClass,
visibility_changed),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gimp_drawable_signals[REMOVED] =
gtk_signal_new ("removed",
GTK_RUN_FIRST,
......@@ -346,8 +356,9 @@ gimp_drawable_configure (GimpDrawable *drawable,
if (drawable->tiles)
tile_manager_destroy (drawable->tiles);
drawable->tiles = tile_manager_new (width, height, bpp);
drawable->visible = TRUE;
drawable->tiles = tile_manager_new (width, height, bpp);
gimp_drawable_set_visible (drawable, TRUE);
if (gimage)
gimp_drawable_set_gimage (drawable, gimage);
......@@ -594,13 +605,32 @@ gimp_drawable_type_with_alpha (const GimpDrawable *drawable)
}
gboolean
gimp_drawable_visible (const GimpDrawable *drawable)
gimp_drawable_get_visible (const GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
return drawable->visible;
}
void
gimp_drawable_set_visible (GimpDrawable *drawable,
gboolean visible)
{
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
visible = visible ? TRUE : FALSE;
if (drawable->visible != visible)
{
drawable->visible = visible;
gtk_signal_emit (GTK_OBJECT (drawable),
gimp_drawable_signals[VISIBILITY_CHANGED]);
}
}
guchar *
gimp_drawable_get_color_at (GimpDrawable *drawable,
gint x,
......
......@@ -59,7 +59,8 @@ struct _GimpDrawableClass
{
GimpViewableClass parent_class;
void (* removed) (GimpDrawable *drawable);
void (* visibility_changed) (GimpDrawable *drawable);
void (* removed) (GimpDrawable *drawable);
};
......@@ -105,7 +106,9 @@ TileManager * gimp_drawable_shadow (GimpDrawable *drawable);
gint gimp_drawable_bytes (const GimpDrawable *drawable);
gint gimp_drawable_width (const GimpDrawable *drawable);
gint gimp_drawable_height (const GimpDrawable *drawable);
gboolean gimp_drawable_visible (const GimpDrawable *drawable);
gboolean gimp_drawable_get_visible (const GimpDrawable *drawable);
void gimp_drawable_set_visible (GimpDrawable *drawable,
gboolean visible);
void gimp_drawable_offsets (const GimpDrawable *drawable,
gint *offset_x,
gint *offset_y);
......
......@@ -1695,8 +1695,10 @@ gimp_image_construct_layers (GimpImage *gimage,
/* only add layers that are visible and not floating selections
to the list */
if (! gimp_layer_is_floating_sel (layer) &&
gimp_drawable_visible (GIMP_DRAWABLE (layer)))
reverse_list = g_slist_prepend (reverse_list, layer);
gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
{
reverse_list = g_slist_prepend (reverse_list, layer);
}
}
while (reverse_list)
......@@ -1801,7 +1803,7 @@ gimp_image_construct_channels (GimpImage *gimage,
{
channel = (GimpChannel *) reverse_list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (channel)))
{
/* configure the pixel regions */
pixel_region_init (&src1PR,
......@@ -1852,7 +1854,7 @@ gimp_image_initialize_projection (GimpImage *gimage,
layer = (GimpLayer *) list->data;
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)) &&
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)) &&
! gimp_layer_has_alpha (layer) &&
(off_x <= x) &&
(off_y <= y) &&
......@@ -1931,7 +1933,7 @@ gimp_image_construct (GimpImage *gimage,
(! g_slist_next (gimage->layers)) && /* It's the only layer. */
(gimp_layer_has_alpha ((GimpLayer *) (gimage->layers->data))) && /* It's !flat. */
/* It's visible. */
(gimp_drawable_visible (GIMP_DRAWABLE (gimage->layers->data))) &&
(gimp_drawable_get_visible (GIMP_DRAWABLE (gimage->layers->data))) &&
(gimp_drawable_width (GIMP_DRAWABLE (gimage->layers->data)) ==
gimage->width) &&
(gimp_drawable_height (GIMP_DRAWABLE (gimage->layers->data)) ==
......@@ -2730,7 +2732,7 @@ gimp_image_merge_visible_layers (GimpImage *gimage,
{
layer = (GimpLayer *) list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
merge_list = g_slist_append (merge_list, layer);
}
......@@ -2781,7 +2783,7 @@ gimp_image_flatten (GimpImage *gimage)
{
layer = (GimpLayer *) list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
merge_list = g_slist_append (merge_list, layer);
}
......@@ -2821,7 +2823,7 @@ gimp_image_merge_down (GimpImage *gimage,
{
layer = (GimpLayer *) layer_list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
merge_list = g_slist_append (NULL, layer);
}
......@@ -3137,7 +3139,7 @@ gimp_image_merge_layers (GimpImage *gimage,
undo_push_group_end (gimage);
/* Update the gimage */
GIMP_DRAWABLE (merge_layer)->visible = TRUE;
gimp_drawable_set_visible (GIMP_DRAWABLE (merge_layer), TRUE);
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RESTRUCTURE]);
......@@ -3540,7 +3542,7 @@ gimp_image_add_channel (GimpImage *gimage,
gimp_image_set_active_channel (gimage, channel);
/* if channel is visible, update the image */
if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (channel)))
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
gimp_drawable_width (GIMP_DRAWABLE (channel)),
......@@ -3977,7 +3979,7 @@ gimp_image_get_new_preview (GimpViewable *viewable,
layer = (GimpLayer *) list->data;
/* only add layers that are visible to the list */
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
{
/* floating selections are added right above the layer
they are attached to */
......
......@@ -557,7 +557,8 @@ gimage_mask_save (GImage *gimage)
new_channel = gimp_channel_copy (gimp_image_get_mask (gimage));
/* saved selections are not visible by default */
GIMP_DRAWABLE(new_channel)->visible = FALSE;
gimp_drawable_set_visible (GIMP_DRAWABLE (new_channel), FALSE);
gimp_image_add_channel (gimage, new_channel, -1);
return new_channel;
......
......@@ -1695,8 +1695,10 @@ gimp_image_construct_layers (GimpImage *gimage,
/* only add layers that are visible and not floating selections
to the list */
if (! gimp_layer_is_floating_sel (layer) &&
gimp_drawable_visible (GIMP_DRAWABLE (layer)))
reverse_list = g_slist_prepend (reverse_list, layer);
gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
{
reverse_list = g_slist_prepend (reverse_list, layer);
}
}
while (reverse_list)
......@@ -1801,7 +1803,7 @@ gimp_image_construct_channels (GimpImage *gimage,
{
channel = (GimpChannel *) reverse_list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (channel)))
{
/* configure the pixel regions */
pixel_region_init (&src1PR,
......@@ -1852,7 +1854,7 @@ gimp_image_initialize_projection (GimpImage *gimage,
layer = (GimpLayer *) list->data;
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)) &&
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)) &&
! gimp_layer_has_alpha (layer) &&
(off_x <= x) &&
(off_y <= y) &&
......@@ -1931,7 +1933,7 @@ gimp_image_construct (GimpImage *gimage,
(! g_slist_next (gimage->layers)) && /* It's the only layer. */
(gimp_layer_has_alpha ((GimpLayer *) (gimage->layers->data))) && /* It's !flat. */
/* It's visible. */
(gimp_drawable_visible (GIMP_DRAWABLE (gimage->layers->data))) &&
(gimp_drawable_get_visible (GIMP_DRAWABLE (gimage->layers->data))) &&
(gimp_drawable_width (GIMP_DRAWABLE (gimage->layers->data)) ==
gimage->width) &&
(gimp_drawable_height (GIMP_DRAWABLE (gimage->layers->data)) ==
......@@ -2730,7 +2732,7 @@ gimp_image_merge_visible_layers (GimpImage *gimage,
{
layer = (GimpLayer *) list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
merge_list = g_slist_append (merge_list, layer);
}
......@@ -2781,7 +2783,7 @@ gimp_image_flatten (GimpImage *gimage)
{
layer = (GimpLayer *) list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
merge_list = g_slist_append (merge_list, layer);
}
......@@ -2821,7 +2823,7 @@ gimp_image_merge_down (GimpImage *gimage,
{
layer = (GimpLayer *) layer_list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
merge_list = g_slist_append (NULL, layer);
}
......@@ -3137,7 +3139,7 @@ gimp_image_merge_layers (GimpImage *gimage,
undo_push_group_end (gimage);
/* Update the gimage */
GIMP_DRAWABLE (merge_layer)->visible = TRUE;
gimp_drawable_set_visible (GIMP_DRAWABLE (merge_layer), TRUE);
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RESTRUCTURE]);
......@@ -3540,7 +3542,7 @@ gimp_image_add_channel (GimpImage *gimage,
gimp_image_set_active_channel (gimage, channel);
/* if channel is visible, update the image */
if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (channel)))
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
gimp_drawable_width (GIMP_DRAWABLE (channel)),
......@@ -3977,7 +3979,7 @@ gimp_image_get_new_preview (GimpViewable *viewable,
layer = (GimpLayer *) list->data;
/* only add layers that are visible to the list */
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
{
/* floating selections are added right above the layer
they are attached to */
......
......@@ -1695,8 +1695,10 @@ gimp_image_construct_layers (GimpImage *gimage,
/* only add layers that are visible and not floating selections
to the list */
if (! gimp_layer_is_floating_sel (layer) &&
gimp_drawable_visible (GIMP_DRAWABLE (layer)))
reverse_list = g_slist_prepend (reverse_list, layer);
gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
{
reverse_list = g_slist_prepend (reverse_list, layer);
}
}
while (reverse_list)
......@@ -1801,7 +1803,7 @@ gimp_image_construct_channels (GimpImage *gimage,
{
channel = (GimpChannel *) reverse_list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (channel)))
{
/* configure the pixel regions */
pixel_region_init (&src1PR,
......@@ -1852,7 +1854,7 @@ gimp_image_initialize_projection (GimpImage *gimage,
layer = (GimpLayer *) list->data;
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)) &&
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)) &&
! gimp_layer_has_alpha (layer) &&
(off_x <= x) &&
(off_y <= y) &&
......@@ -1931,7 +1933,7 @@ gimp_image_construct (GimpImage *gimage,
(! g_slist_next (gimage->layers)) && /* It's the only layer. */
(gimp_layer_has_alpha ((GimpLayer *) (gimage->layers->data))) && /* It's !flat. */
/* It's visible. */
(gimp_drawable_visible (GIMP_DRAWABLE (gimage->layers->data))) &&
(gimp_drawable_get_visible (GIMP_DRAWABLE (gimage->layers->data))) &&
(gimp_drawable_width (GIMP_DRAWABLE (gimage->layers->data)) ==
gimage->width) &&
(gimp_drawable_height (GIMP_DRAWABLE (gimage->layers->data)) ==
......@@ -2730,7 +2732,7 @@ gimp_image_merge_visible_layers (GimpImage *gimage,
{
layer = (GimpLayer *) list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
merge_list = g_slist_append (merge_list, layer);
}
......@@ -2781,7 +2783,7 @@ gimp_image_flatten (GimpImage *gimage)
{
layer = (GimpLayer *) list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
merge_list = g_slist_append (merge_list, layer);
}
......@@ -2821,7 +2823,7 @@ gimp_image_merge_down (GimpImage *gimage,
{
layer = (GimpLayer *) layer_list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
merge_list = g_slist_append (NULL, layer);
}
......@@ -3137,7 +3139,7 @@ gimp_image_merge_layers (GimpImage *gimage,
undo_push_group_end (gimage);
/* Update the gimage */
GIMP_DRAWABLE (merge_layer)->visible = TRUE;
gimp_drawable_set_visible (GIMP_DRAWABLE (merge_layer), TRUE);
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RESTRUCTURE]);
......@@ -3540,7 +3542,7 @@ gimp_image_add_channel (GimpImage *gimage,
gimp_image_set_active_channel (gimage, channel);
/* if channel is visible, update the image */
if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (channel)))
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
gimp_drawable_width (GIMP_DRAWABLE (channel)),
......@@ -3977,7 +3979,7 @@ gimp_image_get_new_preview (GimpViewable *viewable,
layer = (GimpLayer *) list->data;
/* only add layers that are visible to the list */
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
{
/* floating selections are added right above the layer
they are attached to */
......
......@@ -1695,8 +1695,10 @@ gimp_image_construct_layers (GimpImage *gimage,
/* only add layers that are visible and not floating selections
to the list */
if (! gimp_layer_is_floating_sel (layer) &&
gimp_drawable_visible (GIMP_DRAWABLE (layer)))
reverse_list = g_slist_prepend (reverse_list, layer);
gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
{
reverse_list = g_slist_prepend (reverse_list, layer);
}
}
while (reverse_list)
......@@ -1801,7 +1803,7 @@ gimp_image_construct_channels (GimpImage *gimage,
{
channel = (GimpChannel *) reverse_list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (channel)))
{
/* configure the pixel regions */
pixel_region_init (&src1PR,
......@@ -1852,7 +1854,7 @@ gimp_image_initialize_projection (GimpImage *gimage,
layer = (GimpLayer *) list->data;
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)) &&
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)) &&
! gimp_layer_has_alpha (layer) &&
(off_x <= x) &&
(off_y <= y) &&
......@@ -1931,7 +1933,7 @@ gimp_image_construct (GimpImage *gimage,
(! g_slist_next (gimage->layers)) && /* It's the only layer. */
(gimp_layer_has_alpha ((GimpLayer *) (gimage->layers->data))) && /* It's !flat. */
/* It's visible. */
(gimp_drawable_visible (GIMP_DRAWABLE (gimage->layers->data))) &&
(gimp_drawable_get_visible (GIMP_DRAWABLE (gimage->layers->data))) &&
(gimp_drawable_width (GIMP_DRAWABLE (gimage->layers->data)) ==
gimage->width) &&
(gimp_drawable_height (GIMP_DRAWABLE (gimage->layers->data)) ==
......@@ -2730,7 +2732,7 @@ gimp_image_merge_visible_layers (GimpImage *gimage,
{
layer = (GimpLayer *) list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
merge_list = g_slist_append (merge_list, layer);
}
......@@ -2781,7 +2783,7 @@ gimp_image_flatten (GimpImage *gimage)
{
layer = (GimpLayer *) list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
merge_list = g_slist_append (merge_list, layer);
}
......@@ -2821,7 +2823,7 @@ gimp_image_merge_down (GimpImage *gimage,
{
layer = (GimpLayer *) layer_list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
merge_list = g_slist_append (NULL, layer);
}
......@@ -3137,7 +3139,7 @@ gimp_image_merge_layers (GimpImage *gimage,
undo_push_group_end (gimage);
/* Update the gimage */
GIMP_DRAWABLE (merge_layer)->visible = TRUE;
gimp_drawable_set_visible (GIMP_DRAWABLE (merge_layer), TRUE);
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RESTRUCTURE]);
......@@ -3540,7 +3542,7 @@ gimp_image_add_channel (GimpImage *gimage,
gimp_image_set_active_channel (gimage, channel);
/* if channel is visible, update the image */
if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (channel)))
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
gimp_drawable_width (GIMP_DRAWABLE (channel)),
......@@ -3977,7 +3979,7 @@ gimp_image_get_new_preview (GimpViewable *viewable,
layer = (GimpLayer *) list->data;
/* only add layers that are visible to the list */
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
{
/* floating selections are added right above the layer
they are attached to */
......
......@@ -1695,8 +1695,10 @@ gimp_image_construct_layers (GimpImage *gimage,
/* only add layers that are visible and not floating selections
to the list */
if (! gimp_layer_is_floating_sel (layer) &&
gimp_drawable_visible (GIMP_DRAWABLE (layer)))
reverse_list = g_slist_prepend (reverse_list, layer);
gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
{
reverse_list = g_slist_prepend (reverse_list, layer);
}
}
while (reverse_list)
......@@ -1801,7 +1803,7 @@ gimp_image_construct_channels (GimpImage *gimage,
{
channel = (GimpChannel *) reverse_list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (channel)))
{
/* configure the pixel regions */
pixel_region_init (&src1PR,
......@@ -1852,7 +1854,7 @@ gimp_image_initialize_projection (GimpImage *gimage,
layer = (GimpLayer *) list->data;
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)) &&
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)) &&
! gimp_layer_has_alpha (layer) &&
(off_x <= x) &&
(off_y <= y) &&
......@@ -1931,7 +1933,7 @@ gimp_image_construct (GimpImage *gimage,
(! g_slist_next (gimage->layers)) && /* It's the only layer. */
(gimp_layer_has_alpha ((GimpLayer *) (gimage->layers->data))) && /* It's !flat. */
/* It's visible. */
(gimp_drawable_visible (GIMP_DRAWABLE (gimage->layers->data))) &&
(gimp_drawable_get_visible (GIMP_DRAWABLE (gimage->layers->data))) &&
(gimp_drawable_width (GIMP_DRAWABLE (gimage->layers->data)) ==
gimage->width) &&
(gimp_drawable_height (GIMP_DRAWABLE (gimage->layers->data)) ==
......@@ -2730,7 +2732,7 @@ gimp_image_merge_visible_layers (GimpImage *gimage,
{
layer = (GimpLayer *) list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
merge_list = g_slist_append (merge_list, layer);
}
......@@ -2781,7 +2783,7 @@ gimp_image_flatten (GimpImage *gimage)
{
layer = (GimpLayer *) list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
merge_list = g_slist_append (merge_list, layer);
}
......@@ -2821,7 +2823,7 @@ gimp_image_merge_down (GimpImage *gimage,
{
layer = (GimpLayer *) layer_list->data;
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
merge_list = g_slist_append (NULL, layer);
}
......@@ -3137,7 +3139,7 @@ gimp_image_merge_layers (GimpImage *gimage,
undo_push_group_end (gimage);
/* Update the gimage */
GIMP_DRAWABLE (merge_layer)->visible = TRUE;
gimp_drawable_set_visible (GIMP_DRAWABLE (merge_layer), TRUE);
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RESTRUCTURE]);
......@@ -3540,7 +3542,7 @@ gimp_image_add_channel (GimpImage *gimage,
gimp_image_set_active_channel (gimage, channel);
/* if channel is visible, update the image */
if (gimp_drawable_visible (GIMP_DRAWABLE (channel)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (channel)))
drawable_update (GIMP_DRAWABLE (channel),
0, 0,
gimp_drawable_width (GIMP_DRAWABLE (channel)),
......@@ -3977,7 +3979,7 @@ gimp_image_get_new_preview (GimpViewable *viewable,
layer = (GimpLayer *) list->data;
/* only add layers that are visible to the list */
if (gimp_drawable_visible (GIMP_DRAWABLE (layer)))
if (gimp_drawable_get_visible (GIMP_DRAWABLE (layer)))
{