gimp r27962 - in trunk: . app/core app/pdb app/xcf tools/pdbgen/pdb
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r27962 - in trunk: . app/core app/pdb app/xcf tools/pdbgen/pdb
- Date: Mon, 26 Jan 2009 22:47:16 +0000 (UTC)
Author: mitch
Date: Mon Jan 26 22:47:16 2009
New Revision: 27962
URL: http://svn.gnome.org/viewvc/gimp?rev=27962&view=rev
Log:
2009-01-26 Michael Natterer <mitch gimp org>
* app/core/gimplayer.[ch]: add new accessor
gimp_layer_get_floating_sel_drawable() which returns the drawable
the floating layer is attached to.
* app/core/gimpdrawable.c
* app/core/gimpfloatingselundo.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-quick-mask.c
* app/core/gimpimage.c
* app/core/gimplayer.c
* app/core/gimplayer-floating-sel.c
* app/xcf/xcf-save.c
* tools/pdbgen/pdb/image.pdb: use it instead of accessing
layer->fs.drawable directly.
* app/pdb/image-cmds.c: regenerated.
Modified:
trunk/ChangeLog
trunk/app/core/gimpdrawable.c
trunk/app/core/gimpfloatingselundo.c
trunk/app/core/gimpimage-duplicate.c
trunk/app/core/gimpimage-quick-mask.c
trunk/app/core/gimpimage.c
trunk/app/core/gimplayer-floating-sel.c
trunk/app/core/gimplayer.c
trunk/app/core/gimplayer.h
trunk/app/pdb/image-cmds.c
trunk/app/xcf/xcf-save.c
trunk/tools/pdbgen/pdb/image.pdb
Modified: trunk/app/core/gimpdrawable.c
==============================================================================
--- trunk/app/core/gimpdrawable.c (original)
+++ trunk/app/core/gimpdrawable.c Mon Jan 26 22:47:16 2009
@@ -1779,7 +1779,8 @@
floating_sel = gimp_image_get_floating_selection (image);
- return (floating_sel && floating_sel->fs.drawable == drawable);
+ return (floating_sel &&
+ gimp_layer_get_floating_sel_drawable (floating_sel) == drawable);
}
const guchar *
Modified: trunk/app/core/gimpfloatingselundo.c
==============================================================================
--- trunk/app/core/gimpfloatingselundo.c (original)
+++ trunk/app/core/gimpfloatingselundo.c Mon Jan 26 22:47:16 2009
@@ -79,7 +79,7 @@
switch (GIMP_UNDO (object)->undo_type)
{
case GIMP_UNDO_FS_TO_LAYER:
- floating_sel_undo->drawable = layer->fs.drawable;
+ floating_sel_undo->drawable = gimp_layer_get_floating_sel_drawable (layer);
break;
default:
@@ -115,12 +115,12 @@
/* clear the selection */
gimp_drawable_invalidate_boundary (GIMP_DRAWABLE (floating_layer));
- gimp_drawable_attach_floating_sel (floating_layer->fs.drawable,
+ gimp_drawable_attach_floating_sel (gimp_layer_get_floating_sel_drawable (floating_layer),
floating_layer);
}
else
{
- gimp_drawable_detach_floating_sel (floating_layer->fs.drawable,
+ gimp_drawable_detach_floating_sel (gimp_layer_get_floating_sel_drawable (floating_layer),
floating_layer);
/* clear the selection */
Modified: trunk/app/core/gimpimage-duplicate.c
==============================================================================
--- trunk/app/core/gimpimage-duplicate.c (original)
+++ trunk/app/core/gimpimage-duplicate.c Mon Jan 26 22:47:16 2009
@@ -216,7 +216,7 @@
if (floating_selection)
{
- *floating_sel_drawable = floating_selection->fs.drawable;
+ *floating_sel_drawable = gimp_layer_get_floating_sel_drawable (floating_selection);
}
for (list = gimp_image_get_layer_iter (image), count = 0;
Modified: trunk/app/core/gimpimage-quick-mask.c
==============================================================================
--- trunk/app/core/gimpimage-quick-mask.c (original)
+++ trunk/app/core/gimpimage-quick-mask.c Mon Jan 26 22:47:16 2009
@@ -133,7 +133,8 @@
if (image->quick_mask_inverted)
gimp_channel_invert (mask, TRUE);
- if (floating_sel && floating_sel->fs.drawable == GIMP_DRAWABLE (mask))
+ if (floating_sel &&
+ gimp_layer_get_floating_sel_drawable (floating_sel) == GIMP_DRAWABLE (mask))
floating_sel_anchor (floating_sel);
gimp_selection_load (GIMP_SELECTION (gimp_image_get_mask (image)),
Modified: trunk/app/core/gimpimage.c
==============================================================================
--- trunk/app/core/gimpimage.c (original)
+++ trunk/app/core/gimpimage.c Mon Jan 26 22:47:16 2009
@@ -2972,7 +2972,8 @@
{
gimp_image_set_floating_selection (image, layer);
- gimp_drawable_attach_floating_sel (layer->fs.drawable, layer);
+ gimp_drawable_attach_floating_sel (gimp_layer_get_floating_sel_drawable (layer),
+ layer);
}
if (old_has_alpha != gimp_image_has_alpha (image))
@@ -3027,7 +3028,8 @@
{
undo_desc = _("Remove Floating Selection");
- gimp_drawable_detach_floating_sel (layer->fs.drawable, layer);
+ gimp_drawable_detach_floating_sel (gimp_layer_get_floating_sel_drawable (layer),
+ layer);
}
else
{
Modified: trunk/app/core/gimplayer-floating-sel.c
==============================================================================
--- trunk/app/core/gimplayer-floating-sel.c (original)
+++ trunk/app/core/gimplayer-floating-sel.c Mon Jan 26 22:47:16 2009
@@ -125,7 +125,7 @@
image = gimp_item_get_image (item);
/* Check if the floating layer belongs to a channel... */
- if (GIMP_IS_CHANNEL (layer->fs.drawable))
+ if (GIMP_IS_CHANNEL (gimp_layer_get_floating_sel_drawable (layer)))
{
g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
_("Cannot create a new layer from the floating "
@@ -139,7 +139,8 @@
gimp_image_undo_push_fs_to_layer (image, NULL, layer);
- gimp_drawable_detach_floating_sel (layer->fs.drawable, layer);
+ gimp_drawable_detach_floating_sel (gimp_layer_get_floating_sel_drawable (layer),
+ layer);
/* Set pointers */
gimp_layer_set_floating_sel_drawable (layer, NULL);
@@ -163,27 +164,30 @@
void
floating_sel_activate_drawable (GimpLayer *layer)
{
- GimpImage *image;
+ GimpImage *image;
+ GimpDrawable *drawable;
g_return_if_fail (GIMP_IS_LAYER (layer));
g_return_if_fail (gimp_layer_is_floating_sel (layer));
image = gimp_item_get_image (GIMP_ITEM (layer));
+ drawable = gimp_layer_get_floating_sel_drawable (layer);
+
/* set the underlying drawable to active */
- if (GIMP_IS_LAYER_MASK (layer->fs.drawable))
+ if (GIMP_IS_LAYER_MASK (drawable))
{
- GimpLayerMask *mask = GIMP_LAYER_MASK (layer->fs.drawable);
+ GimpLayerMask *mask = GIMP_LAYER_MASK (drawable);
gimp_image_set_active_layer (image, gimp_layer_mask_get_layer (mask));
}
- else if (GIMP_IS_CHANNEL (layer->fs.drawable))
+ else if (GIMP_IS_CHANNEL (drawable))
{
- gimp_image_set_active_channel (image, GIMP_CHANNEL (layer->fs.drawable));
+ gimp_image_set_active_channel (image, GIMP_CHANNEL (drawable));
}
else
{
- gimp_image_set_active_layer (image, GIMP_LAYER (layer->fs.drawable));
+ gimp_image_set_active_layer (image, GIMP_LAYER (drawable));
}
}
@@ -275,7 +279,7 @@
g_return_if_fail (gimp_layer_is_floating_sel (layer));
/* Invalidate the attached-to drawable's preview */
- gimp_viewable_invalidate_preview (GIMP_VIEWABLE (layer->fs.drawable));
+ gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimp_layer_get_floating_sel_drawable (layer)));
/* Invalidate the boundary */
layer->fs.boundary_known = FALSE;
@@ -296,7 +300,7 @@
g_return_if_fail (GIMP_IS_LAYER (layer));
g_return_if_fail (gimp_layer_is_floating_sel (layer));
- drawable = layer->fs.drawable;
+ drawable = gimp_layer_get_floating_sel_drawable (layer);
gimp_item_get_offset (GIMP_ITEM (layer), &off_x, &off_y);
gimp_item_get_offset (GIMP_ITEM (drawable), &dr_off_x, &dr_off_y);
Modified: trunk/app/core/gimplayer.c
==============================================================================
--- trunk/app/core/gimplayer.c (original)
+++ trunk/app/core/gimplayer.c Mon Jan 26 22:47:16 2009
@@ -668,7 +668,7 @@
if (floating_sel)
{
- if (GIMP_IS_CHANNEL (layer->fs.drawable))
+ if (GIMP_IS_CHANNEL (gimp_layer_get_floating_sel_drawable (layer)))
{
g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
_("Cannot create a new layer from the floating "
@@ -1823,7 +1823,7 @@
/* if the layer is a floating selection */
if (gimp_layer_is_floating_sel (layer))
{
- if (GIMP_IS_CHANNEL (layer->fs.drawable))
+ if (GIMP_IS_CHANNEL (gimp_layer_get_floating_sel_drawable (layer)))
{
/* if the owner drawable is a channel, just return nothing */
@@ -1835,7 +1835,7 @@
{
/* otherwise, set the layer to the owner drawable */
- layer = GIMP_LAYER (layer->fs.drawable);
+ layer = GIMP_LAYER (gimp_layer_get_floating_sel_drawable (layer));
}
}
@@ -1880,6 +1880,14 @@
return layer->mask;
}
+GimpDrawable *
+gimp_layer_get_floating_sel_drawable (GimpLayer *layer)
+{
+ g_return_val_if_fail (GIMP_IS_LAYER (layer), NULL);
+
+ return layer->fs.drawable;
+}
+
void
gimp_layer_set_floating_sel_drawable (GimpLayer *layer,
GimpDrawable *drawable)
@@ -1907,7 +1915,7 @@
{
g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE);
- return (layer->fs.drawable != NULL);
+ return (gimp_layer_get_floating_sel_drawable (layer) != NULL);
}
void
Modified: trunk/app/core/gimplayer.h
==============================================================================
--- trunk/app/core/gimplayer.h (original)
+++ trunk/app/core/gimplayer.h Mon Jan 26 22:47:16 2009
@@ -117,8 +117,9 @@
GimpLayerMask * gimp_layer_get_mask (const GimpLayer *layer);
-void gimp_layer_set_floating_sel_drawable (GimpLayer *layer,
- GimpDrawable *drawable);
+GimpDrawable * gimp_layer_get_floating_sel_drawable (GimpLayer *layer);
+void gimp_layer_set_floating_sel_drawable (GimpLayer *layer,
+ GimpDrawable *drawable);
gboolean gimp_layer_is_floating_sel (const GimpLayer *layer);
void gimp_layer_set_opacity (GimpLayer *layer,
Modified: trunk/app/pdb/image-cmds.c
==============================================================================
--- trunk/app/pdb/image-cmds.c (original)
+++ trunk/app/pdb/image-cmds.c Mon Jan 26 22:47:16 2009
@@ -776,7 +776,7 @@
GimpLayer *floating_sel = gimp_image_get_floating_selection (image);
if (floating_sel)
- drawable = floating_sel->fs.drawable;
+ drawable = gimp_layer_get_floating_sel_drawable (floating_sel);
else
drawable = NULL;
}
Modified: trunk/app/xcf/xcf-save.c
==============================================================================
--- trunk/app/xcf/xcf-save.c (original)
+++ trunk/app/xcf/xcf-save.c Mon Jan 26 22:47:16 2009
@@ -466,7 +466,7 @@
if (layer == gimp_image_get_floating_selection (image))
{
- info->floating_sel_drawable = layer->fs.drawable;
+ info->floating_sel_drawable = gimp_layer_get_floating_sel_drawable (layer);
xcf_check_error (xcf_save_prop (info, image, PROP_FLOATING_SELECTION,
error));
}
Modified: trunk/tools/pdbgen/pdb/image.pdb
==============================================================================
--- trunk/tools/pdbgen/pdb/image.pdb (original)
+++ trunk/tools/pdbgen/pdb/image.pdb Mon Jan 26 22:47:16 2009
@@ -1710,7 +1710,7 @@
GimpLayer *floating_sel = gimp_image_get_floating_selection (image);
if (floating_sel)
- drawable = floating_sel->fs.drawable;
+ drawable = gimp_layer_get_floating_sel_drawable (floating_sel);
else
drawable = NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]