Commit d37193fe authored by Martin Nordholts's avatar Martin Nordholts

Use gimp_item_set/get_image() instead of accessing the instance

member directly.

* app/core/gimpchannel.c
* app/core/gimpdrawable-brightness-contrast.c
* app/core/gimpdrawable-color-balance.c
* app/core/gimpdrawable-colorize.c
* app/core/gimpdrawable-curves.c
* app/core/gimpdrawable-desaturate.c
* app/core/gimpdrawable-hue-saturation.c
* app/core/gimpdrawable-invert.c
* app/core/gimpdrawable-levels.c
* app/core/gimpdrawable-posterize.c
* app/core/gimpdrawable-threshold.c
* app/core/gimplayer.c
* app/core/gimplayermask.c
* app/core/gimpselection.c
* app/dialogs/layer-add-mask-dialog.c
* app/text/gimptextlayer-xcf.c
* app/tools/gimprectangletool.c
* app/tools/gimptexttool.c
* app/tools/gimpvectortool.c
* app/vectors/gimpvectors-preview.c
* app/vectors/gimpvectors.c
* tools/pdbgen/pdb/layer.pdb

* app/pdb/layer-cmds.c: Regenerated.

svn path=/trunk/; revision=27840
parent 19f72e44
......@@ -376,8 +376,8 @@ gimp_channel_get_description (GimpViewable *viewable,
static gboolean
gimp_channel_is_attached (GimpItem *item)
{
return (GIMP_IS_IMAGE (item->image) &&
gimp_container_have (item->image->channels, GIMP_OBJECT (item)));
return (GIMP_IS_IMAGE (gimp_item_get_image (item)) &&
gimp_container_have (gimp_item_get_image (item)->channels, GIMP_OBJECT (item)));
}
static GimpItem *
......
......@@ -58,7 +58,7 @@ gimp_drawable_brightness_contrast (GimpDrawable *drawable,
"contrast", contrast / 127.0,
NULL);
if (gimp_use_gegl (GIMP_ITEM (drawable)->image->gimp))
if (gimp_use_gegl (gimp_item_get_image (GIMP_ITEM (drawable))->gimp))
{
GeglNode *node;
......
......@@ -66,7 +66,7 @@ gimp_drawable_color_balance (GimpDrawable *drawable,
"yellow-blue", yellow_blue / 100.0,
NULL);
if (gimp_use_gegl (GIMP_ITEM (drawable)->image->gimp))
if (gimp_use_gegl (gimp_item_get_image (GIMP_ITEM (drawable))->gimp))
{
GeglNode *node;
......
......@@ -59,7 +59,7 @@ gimp_drawable_colorize (GimpDrawable *drawable,
"lightness", lightness / 100.0,
NULL);
if (gimp_use_gegl (GIMP_ITEM (drawable)->image->gimp))
if (gimp_use_gegl (gimp_item_get_image (GIMP_ITEM (drawable))->gimp))
{
GeglNode *node;
......
......@@ -151,7 +151,7 @@ gimp_drawable_curves (GimpDrawable *drawable,
GimpProgress *progress,
GimpCurvesConfig *config)
{
if (gimp_use_gegl (GIMP_ITEM (drawable)->image->gimp))
if (gimp_use_gegl (gimp_item_get_image (GIMP_ITEM (drawable))->gimp))
{
GeglNode *node;
......
......@@ -49,7 +49,7 @@ gimp_drawable_desaturate (GimpDrawable *drawable,
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));
if (gimp_use_gegl (GIMP_ITEM (drawable)->image->gimp))
if (gimp_use_gegl (gimp_item_get_image (GIMP_ITEM (drawable))->gimp))
{
GeglNode *desaturate;
GObject *config;
......
......@@ -64,7 +64,7 @@ gimp_drawable_hue_saturation (GimpDrawable *drawable,
"lightness", lightness / 100.0,
NULL);
if (gimp_use_gegl (GIMP_ITEM (drawable)->image->gimp))
if (gimp_use_gegl (gimp_item_get_image (GIMP_ITEM (drawable))->gimp))
{
GeglNode *node;
......
......@@ -46,7 +46,7 @@ gimp_drawable_invert (GimpDrawable *drawable,
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
if (gimp_use_gegl (GIMP_ITEM (drawable)->image->gimp))
if (gimp_use_gegl (gimp_item_get_image (GIMP_ITEM (drawable))->gimp))
{
GeglNode *invert;
......
......@@ -139,7 +139,7 @@ gimp_drawable_levels_internal (GimpDrawable *drawable,
GimpProgress *progress,
GimpLevelsConfig *config)
{
if (gimp_use_gegl (GIMP_ITEM (drawable)->image->gimp))
if (gimp_use_gegl (gimp_item_get_image (GIMP_ITEM (drawable))->gimp))
{
GeglNode *levels;
......
......@@ -56,7 +56,7 @@ gimp_drawable_posterize (GimpDrawable *drawable,
"levels", levels,
NULL);
if (gimp_use_gegl (GIMP_ITEM (drawable)->image->gimp))
if (gimp_use_gegl (gimp_item_get_image (GIMP_ITEM (drawable))->gimp))
{
GeglNode *node;
......
......@@ -57,7 +57,7 @@ gimp_drawable_threshold (GimpDrawable *drawable,
"high", high / 255.0,
NULL);
if (gimp_use_gegl (GIMP_ITEM (drawable)->image->gimp))
if (gimp_use_gegl (gimp_item_get_image (GIMP_ITEM (drawable))->gimp))
{
GeglNode *node;
......
......@@ -539,8 +539,8 @@ gimp_layer_removed (GimpItem *item)
static gboolean
gimp_layer_is_attached (GimpItem *item)
{
return (GIMP_IS_IMAGE (item->image) &&
gimp_container_have (item->image->layers, GIMP_OBJECT (item)));
return (GIMP_IS_IMAGE (gimp_item_get_image (item)) &&
gimp_container_have (gimp_item_get_image (item)->layers, GIMP_OBJECT (item)));
}
static GimpItem *
......
......@@ -121,9 +121,9 @@ gimp_layer_mask_is_attached (GimpItem *item)
GimpLayerMask *mask = GIMP_LAYER_MASK (item);
GimpLayer *layer = gimp_layer_mask_get_layer (mask);
return (GIMP_IS_IMAGE (item->image) &&
GIMP_IS_LAYER (layer) &&
gimp_layer_get_mask (layer) == mask &&
return (GIMP_IS_IMAGE (gimp_item_get_image (item)) &&
GIMP_IS_LAYER (layer) &&
gimp_layer_get_mask (layer) == mask &&
gimp_item_is_attached (GIMP_ITEM (layer)));
}
......@@ -233,7 +233,7 @@ gimp_layer_mask_set_apply (GimpLayerMask *layer_mask,
if (layer_mask->apply_mask != apply)
{
GimpImage *image = GIMP_ITEM (layer_mask)->image;
GimpImage *image = gimp_item_get_image (GIMP_ITEM (layer_mask));
if (push_undo)
gimp_image_undo_push_layer_mask_apply (image, _("Apply Layer Mask"),
......@@ -288,7 +288,7 @@ gimp_layer_mask_get_edit (const GimpLayerMask *layer_mask)
static void
gimp_layer_mask_real_edit_changed (GimpLayerMask *layer_mask)
{
gimp_image_selection_control (GIMP_ITEM (layer_mask)->image,
gimp_image_selection_control (gimp_item_get_image (GIMP_ITEM (layer_mask)),
GIMP_SELECTION_LAYER_ON);
}
......@@ -301,7 +301,7 @@ gimp_layer_mask_set_show (GimpLayerMask *layer_mask,
if (layer_mask->show_mask != show)
{
GimpImage *image = GIMP_ITEM (layer_mask)->image;
GimpImage *image = gimp_item_get_image (GIMP_ITEM (layer_mask));
if (push_undo)
gimp_image_undo_push_layer_mask_show (image, _("Show Layer Mask"),
......
......@@ -185,8 +185,8 @@ gimp_selection_init (GimpSelection *selection)
static gboolean
gimp_selection_is_attached (GimpItem *item)
{
return (GIMP_IS_IMAGE (item->image) &&
gimp_image_get_mask (item->image) == GIMP_CHANNEL (item));
return (GIMP_IS_IMAGE (gimp_item_get_image (item)) &&
gimp_image_get_mask (gimp_item_get_image (item)) == GIMP_CHANNEL (item));
}
static void
......
......@@ -118,7 +118,7 @@ layer_add_mask_dialog_new (GimpLayer *layer,
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
combo = gimp_container_combo_box_new (GIMP_ITEM (layer)->image->channels,
combo = gimp_container_combo_box_new (gimp_item_get_image (GIMP_ITEM (layer))->channels,
context,
GIMP_VIEW_SIZE_SMALL, 1);
gimp_enum_radio_frame_add (GTK_FRAME (frame), combo,
......@@ -129,10 +129,10 @@ layer_add_mask_dialog_new (GimpLayer *layer,
G_CALLBACK (layer_add_mask_dialog_channel_selected),
dialog);
channel = gimp_image_get_active_channel (GIMP_ITEM (layer)->image);
channel = gimp_image_get_active_channel (gimp_item_get_image (GIMP_ITEM (layer)));
if (! channel)
channel = GIMP_CHANNEL (gimp_container_get_first_child (GIMP_ITEM (layer)->image->channels));
channel = GIMP_CHANNEL (gimp_container_get_first_child (gimp_item_get_image (GIMP_ITEM (layer))->channels));
gimp_container_view_select_item (GIMP_CONTAINER_VIEW (combo),
GIMP_VIEWABLE (channel));
......
......@@ -510,7 +510,7 @@ layer_create_mask_invoker (GimpProcedure *procedure,
if (mask_type == GIMP_ADD_CHANNEL_MASK)
{
channel = gimp_image_get_active_channel (GIMP_ITEM (layer)->image);
channel = gimp_image_get_active_channel (gimp_item_get_image (GIMP_ITEM (layer)));
if (! channel)
success = FALSE;
......
......@@ -192,12 +192,15 @@ gimp_text_layer_from_layer (GimpLayer *layer,
gimp_object_get_name (GIMP_OBJECT (layer)));
item->ID = gimp_item_get_ID (GIMP_ITEM (layer));
item->image = gimp_item_get_image (GIMP_ITEM (layer));
/* Set image before tatoo so that the explicitly set tatoo overrides
* the one implicitly set when setting the image
*/
gimp_item_set_image (item, gimp_item_get_image (GIMP_ITEM (layer)));
gimp_item_set_tattoo (item, gimp_item_get_tattoo (GIMP_ITEM (layer)));
gimp_item_set_image (GIMP_ITEM (layer), NULL);
g_hash_table_replace (item->image->gimp->item_table,
g_hash_table_replace (gimp_item_get_image (item)->gimp->item_table,
GINT_TO_POINTER (gimp_item_get_ID (item)),
item);
......
......@@ -720,7 +720,7 @@ gimp_rectangle_tool_frame_item (GimpRectangleTool *rect_tool,
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (gimp_item_is_attached (item));
g_return_if_fail (display != NULL);
g_return_if_fail (display->image == item->image);
g_return_if_fail (display->image == gimp_item_get_image (item));
width = gimp_item_get_width (item);
height = gimp_item_get_height (item);
......
......@@ -2127,7 +2127,7 @@ gimp_text_tool_set_layer (GimpTextTool *text_tool,
context = gimp_get_user_context (tool->tool_info->gimp);
display = gimp_context_get_display (context);
if (! display || display->image != item->image)
if (! display || display->image != gimp_item_get_image (item))
{
GList *list;
......@@ -2139,7 +2139,7 @@ gimp_text_tool_set_layer (GimpTextTool *text_tool,
{
display = list->data;
if (display->image == item->image)
if (display->image == gimp_item_get_image (item))
{
gimp_context_set_display (context, display);
break;
......
......@@ -1552,7 +1552,7 @@ gimp_vector_tool_set_vectors (GimpVectorTool *vector_tool,
gimp_draw_tool_pause (draw_tool);
if (gimp_draw_tool_is_active (draw_tool) &&
(! vectors || draw_tool->display->image != item->image))
(! vectors || draw_tool->display->image != gimp_item_get_image (item)))
{
gimp_draw_tool_stop (draw_tool);
}
......@@ -1618,7 +1618,7 @@ gimp_vector_tool_set_vectors (GimpVectorTool *vector_tool,
g_object_ref (vectors);
g_signal_connect_object (item->image, "active-vectors-changed",
g_signal_connect_object (gimp_item_get_image (item), "active-vectors-changed",
G_CALLBACK (gimp_vector_tool_vectors_changed),
vector_tool, 0);
g_signal_connect_object (vectors, "removed",
......@@ -1655,7 +1655,7 @@ gimp_vector_tool_set_vectors (GimpVectorTool *vector_tool,
if (! gimp_draw_tool_is_active (draw_tool))
{
if (tool->display && tool->display->image == item->image)
if (tool->display && tool->display->image == gimp_item_get_image (item))
{
gimp_draw_tool_start (draw_tool, tool->display);
}
......@@ -1667,19 +1667,19 @@ gimp_vector_tool_set_vectors (GimpVectorTool *vector_tool,
context = gimp_get_user_context (tool->tool_info->gimp);
display = gimp_context_get_display (context);
if (! display || display->image != item->image)
if (! display || display->image != gimp_item_get_image (item))
{
GList *list;
display = NULL;
for (list = gimp_get_display_iter (item->image->gimp);
for (list = gimp_get_display_iter (gimp_item_get_image (item)->gimp);
list;
list = g_list_next (list))
{
display = list->data;
if (display->image == item->image)
if (display->image == gimp_item_get_image (item))
{
gimp_context_set_display (context, display);
break;
......@@ -1872,7 +1872,7 @@ gimp_vector_tool_undo_push (GimpVectorTool *vector_tool,
if (vector_tool->have_undo)
return;
gimp_image_undo_push_vectors_mod (GIMP_ITEM (vector_tool->vectors)->image,
gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vector_tool->vectors)),
desc, vector_tool->vectors);
vector_tool->have_undo = TRUE;
}
......
......@@ -54,8 +54,8 @@ gimp_vectors_get_new_preview (GimpViewable *viewable,
vectors = GIMP_VECTORS (viewable);
item = GIMP_ITEM (viewable);
xscale = ((gdouble) width) / gimp_image_get_width (item->image);
yscale = ((gdouble) height) / gimp_image_get_height (item->image);
xscale = ((gdouble) width) / gimp_image_get_width (gimp_item_get_image (item));
yscale = ((gdouble) height) / gimp_image_get_height (gimp_item_get_image (item));
temp_buf = temp_buf_new (width, height, 1, 0, 0, white);
data = temp_buf_get_data (temp_buf);
......
......@@ -266,8 +266,8 @@ gimp_vectors_get_memsize (GimpObject *object,
static gboolean
gimp_vectors_is_attached (GimpItem *item)
{
return (GIMP_IS_IMAGE (item->image) &&
gimp_container_have (item->image->vectors, GIMP_OBJECT (item)));
return (GIMP_IS_IMAGE (gimp_item_get_image (item)) &&
gimp_container_have (gimp_item_get_image (item)->vectors, GIMP_OBJECT (item)));
}
static GimpItem *
......
......@@ -236,7 +236,7 @@ HELP
if (mask_type == GIMP_ADD_CHANNEL_MASK)
{
channel = gimp_image_get_active_channel (GIMP_ITEM (layer)->image);
channel = gimp_image_get_active_channel (gimp_item_get_image (GIMP_ITEM (layer)));
if (! channel)
success = FALSE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment