mirror of https://github.com/GNOME/gimp.git
Use the newly added get_parent() APIs
Get rid of tons of local "parent" variables and inline the get_parent() calls. They were on separate lines only to make them readable at all.
This commit is contained in:
parent
e0224cdbfb
commit
82f8cee292
|
@ -267,7 +267,7 @@ channels_duplicate_cmd_callback (GtkAction *action,
|
||||||
* the latter would add a duplicated group inside itself instead of
|
* the latter would add a duplicated group inside itself instead of
|
||||||
* above it
|
* above it
|
||||||
*/
|
*/
|
||||||
parent = GIMP_CHANNEL (gimp_viewable_get_parent (GIMP_VIEWABLE (channel)));
|
parent = gimp_channel_get_parent (channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_image_add_channel (image, new_channel, parent, -1, TRUE);
|
gimp_image_add_channel (image, new_channel, parent, -1, TRUE);
|
||||||
|
|
|
@ -462,7 +462,6 @@ layers_duplicate_cmd_callback (GtkAction *action,
|
||||||
GimpImage *image;
|
GimpImage *image;
|
||||||
GimpLayer *layer;
|
GimpLayer *layer;
|
||||||
GimpLayer *new_layer;
|
GimpLayer *new_layer;
|
||||||
GimpLayer *parent;
|
|
||||||
return_if_no_layer (image, layer, data);
|
return_if_no_layer (image, layer, data);
|
||||||
|
|
||||||
new_layer = GIMP_LAYER (gimp_item_duplicate (GIMP_ITEM (layer),
|
new_layer = GIMP_LAYER (gimp_item_duplicate (GIMP_ITEM (layer),
|
||||||
|
@ -472,9 +471,9 @@ layers_duplicate_cmd_callback (GtkAction *action,
|
||||||
* the latter would add a duplicated group inside itself instead of
|
* the latter would add a duplicated group inside itself instead of
|
||||||
* above it
|
* above it
|
||||||
*/
|
*/
|
||||||
parent = GIMP_LAYER (gimp_viewable_get_parent (GIMP_VIEWABLE (layer)));
|
gimp_image_add_layer (image, new_layer,
|
||||||
|
gimp_layer_get_parent (layer), -1,
|
||||||
gimp_image_add_layer (image, new_layer, parent, -1, TRUE);
|
TRUE);
|
||||||
|
|
||||||
gimp_image_flush (image);
|
gimp_image_flush (image);
|
||||||
}
|
}
|
||||||
|
|
|
@ -248,7 +248,6 @@ vectors_duplicate_cmd_callback (GtkAction *action,
|
||||||
GimpImage *image;
|
GimpImage *image;
|
||||||
GimpVectors *vectors;
|
GimpVectors *vectors;
|
||||||
GimpVectors *new_vectors;
|
GimpVectors *new_vectors;
|
||||||
GimpVectors *parent;
|
|
||||||
return_if_no_vectors (image, vectors, data);
|
return_if_no_vectors (image, vectors, data);
|
||||||
|
|
||||||
new_vectors = GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (vectors),
|
new_vectors = GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (vectors),
|
||||||
|
@ -258,9 +257,9 @@ vectors_duplicate_cmd_callback (GtkAction *action,
|
||||||
* the latter would add a duplicated group inside itself instead of
|
* the latter would add a duplicated group inside itself instead of
|
||||||
* above it
|
* above it
|
||||||
*/
|
*/
|
||||||
parent = GIMP_VECTORS (gimp_viewable_get_parent (GIMP_VIEWABLE (vectors)));
|
gimp_image_add_vectors (image, new_vectors,
|
||||||
|
gimp_vectors_get_parent (vectors), -1,
|
||||||
gimp_image_add_vectors (image, new_vectors, parent, -1, TRUE);
|
TRUE);
|
||||||
|
|
||||||
gimp_image_flush (image);
|
gimp_image_flush (image);
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,9 +204,7 @@ gimp_channel_undo_pop (GimpUndo *undo,
|
||||||
/* remove channel */
|
/* remove channel */
|
||||||
|
|
||||||
/* record the current parent and position */
|
/* record the current parent and position */
|
||||||
channel_undo->prev_parent =
|
channel_undo->prev_parent = gimp_channel_get_parent (channel);
|
||||||
GIMP_CHANNEL (gimp_viewable_get_parent (GIMP_VIEWABLE (channel)));
|
|
||||||
|
|
||||||
channel_undo->prev_position = gimp_item_get_index (GIMP_ITEM (channel));
|
channel_undo->prev_position = gimp_item_get_index (GIMP_ITEM (channel));
|
||||||
|
|
||||||
gimp_image_remove_channel (undo->image, channel, FALSE,
|
gimp_image_remove_channel (undo->image, channel, FALSE,
|
||||||
|
|
|
@ -276,7 +276,7 @@ gimp_image_merge_group_layer (GimpImage *image,
|
||||||
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_LAYERS_MERGE,
|
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_LAYERS_MERGE,
|
||||||
_("Merge Layer Group"));
|
_("Merge Layer Group"));
|
||||||
|
|
||||||
parent = GIMP_LAYER (gimp_viewable_get_parent (GIMP_VIEWABLE (group)));
|
parent = gimp_layer_get_parent (GIMP_LAYER (group));
|
||||||
index = gimp_item_get_index (GIMP_ITEM (group));
|
index = gimp_item_get_index (GIMP_ITEM (group));
|
||||||
|
|
||||||
layer = GIMP_LAYER (gimp_item_duplicate (GIMP_ITEM (group),
|
layer = GIMP_LAYER (gimp_item_duplicate (GIMP_ITEM (group),
|
||||||
|
@ -412,7 +412,7 @@ gimp_image_merge_layers (GimpImage *image,
|
||||||
x2 = y2 = 0;
|
x2 = y2 = 0;
|
||||||
bottom_layer = NULL;
|
bottom_layer = NULL;
|
||||||
|
|
||||||
parent = GIMP_LAYER (gimp_viewable_get_parent (merge_list->data));
|
parent = gimp_layer_get_parent (merge_list->data);
|
||||||
|
|
||||||
/* Get the layer extents */
|
/* Get the layer extents */
|
||||||
count = 0;
|
count = 0;
|
||||||
|
|
|
@ -3264,7 +3264,7 @@ gimp_image_get_insert_pos (GimpItem *parent,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
parent = GIMP_ITEM (gimp_viewable_get_parent (GIMP_VIEWABLE (active_item)));
|
parent = gimp_item_get_parent (active_item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3381,7 +3381,6 @@ gimp_image_remove_layer (GimpImage *image,
|
||||||
GimpLayer *new_active)
|
GimpLayer *new_active)
|
||||||
{
|
{
|
||||||
GimpImagePrivate *private;
|
GimpImagePrivate *private;
|
||||||
GimpLayer *parent;
|
|
||||||
GimpLayer *active_layer;
|
GimpLayer *active_layer;
|
||||||
gboolean old_has_alpha;
|
gboolean old_has_alpha;
|
||||||
gboolean undo_group = FALSE;
|
gboolean undo_group = FALSE;
|
||||||
|
@ -3412,8 +3411,6 @@ gimp_image_remove_layer (GimpImage *image,
|
||||||
TRUE, NULL);
|
TRUE, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
parent = GIMP_LAYER (gimp_viewable_get_parent (GIMP_VIEWABLE (layer)));
|
|
||||||
|
|
||||||
active_layer = gimp_image_get_active_layer (image);
|
active_layer = gimp_image_get_active_layer (image);
|
||||||
|
|
||||||
old_has_alpha = gimp_image_has_alpha (image);
|
old_has_alpha = gimp_image_has_alpha (image);
|
||||||
|
@ -3432,7 +3429,7 @@ gimp_image_remove_layer (GimpImage *image,
|
||||||
|
|
||||||
if (push_undo)
|
if (push_undo)
|
||||||
gimp_image_undo_push_layer_remove (image, undo_desc, layer,
|
gimp_image_undo_push_layer_remove (image, undo_desc, layer,
|
||||||
parent,
|
gimp_layer_get_parent (layer),
|
||||||
gimp_item_get_index (GIMP_ITEM (layer)),
|
gimp_item_get_index (GIMP_ITEM (layer)),
|
||||||
active_layer);
|
active_layer);
|
||||||
|
|
||||||
|
@ -3581,8 +3578,7 @@ gimp_image_raise_layer (GimpImage *image,
|
||||||
GimpLayer *layer,
|
GimpLayer *layer,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
GimpLayer *parent;
|
gint index;
|
||||||
gint index;
|
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
||||||
g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE);
|
g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE);
|
||||||
|
@ -3597,10 +3593,8 @@ gimp_image_raise_layer (GimpImage *image,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
parent = GIMP_LAYER (gimp_viewable_get_parent (GIMP_VIEWABLE (layer)));
|
|
||||||
|
|
||||||
return gimp_image_reorder_layer (image, layer,
|
return gimp_image_reorder_layer (image, layer,
|
||||||
parent, index - 1,
|
gimp_layer_get_parent (layer), index - 1,
|
||||||
TRUE, _("Raise Layer"));
|
TRUE, _("Raise Layer"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3608,15 +3602,11 @@ gboolean
|
||||||
gimp_image_raise_layer_to_top (GimpImage *image,
|
gimp_image_raise_layer_to_top (GimpImage *image,
|
||||||
GimpLayer *layer)
|
GimpLayer *layer)
|
||||||
{
|
{
|
||||||
GimpLayer *parent;
|
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
||||||
g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE);
|
g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE);
|
||||||
|
|
||||||
parent = GIMP_LAYER (gimp_viewable_get_parent (GIMP_VIEWABLE (layer)));
|
|
||||||
|
|
||||||
return gimp_image_reorder_layer (image, layer,
|
return gimp_image_reorder_layer (image, layer,
|
||||||
parent, 0,
|
gimp_layer_get_parent (layer), 0,
|
||||||
TRUE, _("Raise Layer to Top"));
|
TRUE, _("Raise Layer to Top"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3626,7 +3616,6 @@ gimp_image_lower_layer (GimpImage *image,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
GimpContainer *container;
|
GimpContainer *container;
|
||||||
GimpLayer *parent;
|
|
||||||
gint index;
|
gint index;
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
||||||
|
@ -3644,10 +3633,8 @@ gimp_image_lower_layer (GimpImage *image,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
parent = GIMP_LAYER (gimp_viewable_get_parent (GIMP_VIEWABLE (layer)));
|
|
||||||
|
|
||||||
return gimp_image_reorder_layer (image, layer,
|
return gimp_image_reorder_layer (image, layer,
|
||||||
parent, index + 1,
|
gimp_layer_get_parent (layer), index + 1,
|
||||||
TRUE, _("Lower Layer"));
|
TRUE, _("Lower Layer"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3656,7 +3643,6 @@ gimp_image_lower_layer_to_bottom (GimpImage *image,
|
||||||
GimpLayer *layer)
|
GimpLayer *layer)
|
||||||
{
|
{
|
||||||
GimpContainer *container;
|
GimpContainer *container;
|
||||||
GimpLayer *parent;
|
|
||||||
gint length;
|
gint length;
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
||||||
|
@ -3666,10 +3652,8 @@ gimp_image_lower_layer_to_bottom (GimpImage *image,
|
||||||
|
|
||||||
length = gimp_container_get_n_children (container);
|
length = gimp_container_get_n_children (container);
|
||||||
|
|
||||||
parent = GIMP_LAYER (gimp_viewable_get_parent (GIMP_VIEWABLE (layer)));
|
|
||||||
|
|
||||||
return gimp_image_reorder_layer (image, layer,
|
return gimp_image_reorder_layer (image, layer,
|
||||||
parent, length - 1,
|
gimp_layer_get_parent (layer), length - 1,
|
||||||
TRUE, _("Lower Layer to Bottom"));
|
TRUE, _("Lower Layer to Bottom"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3753,7 +3737,6 @@ gimp_image_remove_channel (GimpImage *image,
|
||||||
GimpChannel *new_active)
|
GimpChannel *new_active)
|
||||||
{
|
{
|
||||||
GimpImagePrivate *private;
|
GimpImagePrivate *private;
|
||||||
GimpChannel *parent;
|
|
||||||
GimpChannel *active_channel;
|
GimpChannel *active_channel;
|
||||||
gboolean undo_group = FALSE;
|
gboolean undo_group = FALSE;
|
||||||
|
|
||||||
|
@ -3782,13 +3765,11 @@ gimp_image_remove_channel (GimpImage *image,
|
||||||
|
|
||||||
private = GIMP_IMAGE_GET_PRIVATE (image);
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
||||||
|
|
||||||
parent = GIMP_CHANNEL (gimp_viewable_get_parent (GIMP_VIEWABLE (channel)));
|
|
||||||
|
|
||||||
active_channel = gimp_image_get_active_channel (image);
|
active_channel = gimp_image_get_active_channel (image);
|
||||||
|
|
||||||
if (push_undo)
|
if (push_undo)
|
||||||
gimp_image_undo_push_channel_remove (image, _("Remove Channel"), channel,
|
gimp_image_undo_push_channel_remove (image, _("Remove Channel"), channel,
|
||||||
parent,
|
gimp_channel_get_parent (channel),
|
||||||
gimp_item_get_index (GIMP_ITEM (channel)),
|
gimp_item_get_index (GIMP_ITEM (channel)),
|
||||||
active_channel);
|
active_channel);
|
||||||
|
|
||||||
|
@ -3815,8 +3796,7 @@ gimp_image_raise_channel (GimpImage *image,
|
||||||
GimpChannel *channel,
|
GimpChannel *channel,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
GimpChannel *parent;
|
gint index;
|
||||||
gint index;
|
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
||||||
g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE);
|
g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE);
|
||||||
|
@ -3831,10 +3811,8 @@ gimp_image_raise_channel (GimpImage *image,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
parent = GIMP_CHANNEL (gimp_viewable_get_parent (GIMP_VIEWABLE (channel)));
|
|
||||||
|
|
||||||
return gimp_image_reorder_channel (image, channel,
|
return gimp_image_reorder_channel (image, channel,
|
||||||
parent, index - 1,
|
gimp_channel_get_parent (channel), index - 1,
|
||||||
TRUE, _("Raise Channel"));
|
TRUE, _("Raise Channel"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3842,15 +3820,11 @@ gboolean
|
||||||
gimp_image_raise_channel_to_top (GimpImage *image,
|
gimp_image_raise_channel_to_top (GimpImage *image,
|
||||||
GimpChannel *channel)
|
GimpChannel *channel)
|
||||||
{
|
{
|
||||||
GimpChannel *parent;
|
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
||||||
g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE);
|
g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE);
|
||||||
|
|
||||||
parent = GIMP_CHANNEL (gimp_viewable_get_parent (GIMP_VIEWABLE (channel)));
|
|
||||||
|
|
||||||
return gimp_image_reorder_channel (image, channel,
|
return gimp_image_reorder_channel (image, channel,
|
||||||
parent, 0,
|
gimp_channel_get_parent (channel), 0,
|
||||||
TRUE, _("Raise Channel to Top"));
|
TRUE, _("Raise Channel to Top"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3861,7 +3835,6 @@ gimp_image_lower_channel (GimpImage *image,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
GimpContainer *container;
|
GimpContainer *container;
|
||||||
GimpChannel *parent;
|
|
||||||
gint index;
|
gint index;
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
||||||
|
@ -3879,10 +3852,8 @@ gimp_image_lower_channel (GimpImage *image,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
parent = GIMP_CHANNEL (gimp_viewable_get_parent (GIMP_VIEWABLE (channel)));
|
|
||||||
|
|
||||||
return gimp_image_reorder_channel (image, channel,
|
return gimp_image_reorder_channel (image, channel,
|
||||||
parent, index + 1,
|
gimp_channel_get_parent (channel), index + 1,
|
||||||
TRUE, _("Lower Channel"));
|
TRUE, _("Lower Channel"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3891,7 +3862,6 @@ gimp_image_lower_channel_to_bottom (GimpImage *image,
|
||||||
GimpChannel *channel)
|
GimpChannel *channel)
|
||||||
{
|
{
|
||||||
GimpContainer *container;
|
GimpContainer *container;
|
||||||
GimpChannel *parent;
|
|
||||||
gint length;
|
gint length;
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
||||||
|
@ -3901,10 +3871,8 @@ gimp_image_lower_channel_to_bottom (GimpImage *image,
|
||||||
|
|
||||||
length = gimp_container_get_n_children (container);
|
length = gimp_container_get_n_children (container);
|
||||||
|
|
||||||
parent = GIMP_CHANNEL (gimp_viewable_get_parent (GIMP_VIEWABLE (channel)));
|
|
||||||
|
|
||||||
return gimp_image_reorder_channel (image, channel,
|
return gimp_image_reorder_channel (image, channel,
|
||||||
parent, length - 1,
|
gimp_channel_get_parent (channel), length - 1,
|
||||||
TRUE, _("Lower Channel to Bottom"));
|
TRUE, _("Lower Channel to Bottom"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3988,7 +3956,6 @@ gimp_image_remove_vectors (GimpImage *image,
|
||||||
GimpVectors *new_active)
|
GimpVectors *new_active)
|
||||||
{
|
{
|
||||||
GimpImagePrivate *private;
|
GimpImagePrivate *private;
|
||||||
GimpVectors *parent;
|
|
||||||
GimpVectors *active_vectors;
|
GimpVectors *active_vectors;
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_IMAGE (image));
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
||||||
|
@ -3998,13 +3965,11 @@ gimp_image_remove_vectors (GimpImage *image,
|
||||||
|
|
||||||
private = GIMP_IMAGE_GET_PRIVATE (image);
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
||||||
|
|
||||||
parent = GIMP_VECTORS (gimp_viewable_get_parent (GIMP_VIEWABLE (vectors)));
|
|
||||||
|
|
||||||
active_vectors = gimp_image_get_active_vectors (image);
|
active_vectors = gimp_image_get_active_vectors (image);
|
||||||
|
|
||||||
if (push_undo)
|
if (push_undo)
|
||||||
gimp_image_undo_push_vectors_remove (image, _("Remove Path"), vectors,
|
gimp_image_undo_push_vectors_remove (image, _("Remove Path"), vectors,
|
||||||
parent,
|
gimp_vectors_get_parent (vectors),
|
||||||
gimp_item_get_index (GIMP_ITEM (vectors)),
|
gimp_item_get_index (GIMP_ITEM (vectors)),
|
||||||
active_vectors);
|
active_vectors);
|
||||||
|
|
||||||
|
@ -4023,8 +3988,7 @@ gimp_image_raise_vectors (GimpImage *image,
|
||||||
GimpVectors *vectors,
|
GimpVectors *vectors,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
GimpVectors *parent;
|
gint index;
|
||||||
gint index;
|
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
||||||
g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE);
|
g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE);
|
||||||
|
@ -4039,10 +4003,8 @@ gimp_image_raise_vectors (GimpImage *image,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
parent = GIMP_VECTORS (gimp_viewable_get_parent (GIMP_VIEWABLE (vectors)));
|
|
||||||
|
|
||||||
return gimp_image_reorder_vectors (image, vectors,
|
return gimp_image_reorder_vectors (image, vectors,
|
||||||
parent, index - 1,
|
gimp_vectors_get_parent (vectors), index - 1,
|
||||||
TRUE, _("Raise Path"));
|
TRUE, _("Raise Path"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4050,15 +4012,11 @@ gboolean
|
||||||
gimp_image_raise_vectors_to_top (GimpImage *image,
|
gimp_image_raise_vectors_to_top (GimpImage *image,
|
||||||
GimpVectors *vectors)
|
GimpVectors *vectors)
|
||||||
{
|
{
|
||||||
GimpVectors *parent;
|
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
||||||
g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE);
|
g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE);
|
||||||
|
|
||||||
parent = GIMP_VECTORS (gimp_viewable_get_parent (GIMP_VIEWABLE (vectors)));
|
|
||||||
|
|
||||||
return gimp_image_reorder_vectors (image, vectors,
|
return gimp_image_reorder_vectors (image, vectors,
|
||||||
parent, 0,
|
gimp_vectors_get_parent (vectors), 0,
|
||||||
TRUE, _("Raise Path to Top"));
|
TRUE, _("Raise Path to Top"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4068,7 +4026,6 @@ gimp_image_lower_vectors (GimpImage *image,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
GimpContainer *container;
|
GimpContainer *container;
|
||||||
GimpVectors *parent;
|
|
||||||
gint index;
|
gint index;
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
||||||
|
@ -4086,10 +4043,8 @@ gimp_image_lower_vectors (GimpImage *image,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
parent = GIMP_VECTORS (gimp_viewable_get_parent (GIMP_VIEWABLE (vectors)));
|
|
||||||
|
|
||||||
return gimp_image_reorder_vectors (image, vectors,
|
return gimp_image_reorder_vectors (image, vectors,
|
||||||
parent, index + 1,
|
gimp_vectors_get_parent (vectors), index + 1,
|
||||||
TRUE, _("Lower Path"));
|
TRUE, _("Lower Path"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4098,7 +4053,6 @@ gimp_image_lower_vectors_to_bottom (GimpImage *image,
|
||||||
GimpVectors *vectors)
|
GimpVectors *vectors)
|
||||||
{
|
{
|
||||||
GimpContainer *container;
|
GimpContainer *container;
|
||||||
GimpVectors *parent;
|
|
||||||
gint length;
|
gint length;
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
||||||
|
@ -4108,10 +4062,8 @@ gimp_image_lower_vectors_to_bottom (GimpImage *image,
|
||||||
|
|
||||||
length = gimp_container_get_n_children (container);
|
length = gimp_container_get_n_children (container);
|
||||||
|
|
||||||
parent = GIMP_VECTORS (gimp_viewable_get_parent (GIMP_VIEWABLE (vectors)));
|
|
||||||
|
|
||||||
return gimp_image_reorder_vectors (image, vectors,
|
return gimp_image_reorder_vectors (image, vectors,
|
||||||
parent, length - 1,
|
gimp_vectors_get_parent (vectors), length - 1,
|
||||||
TRUE, _("Lower Path to Bottom"));
|
TRUE, _("Lower Path to Bottom"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -389,9 +389,9 @@ gimp_item_real_visibility_changed (GimpItem *item)
|
||||||
static gboolean
|
static gboolean
|
||||||
gimp_item_real_is_content_locked (const GimpItem *item)
|
gimp_item_real_is_content_locked (const GimpItem *item)
|
||||||
{
|
{
|
||||||
GimpViewable *parent = gimp_viewable_get_parent (GIMP_VIEWABLE (item));
|
GimpItem *parent = gimp_item_get_parent (item);
|
||||||
|
|
||||||
if (parent && gimp_item_is_content_locked (GIMP_ITEM (parent)))
|
if (parent && gimp_item_is_content_locked (parent))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
return item->lock_content;
|
return item->lock_content;
|
||||||
|
@ -677,20 +677,20 @@ gimp_item_configure (GimpItem *item,
|
||||||
gboolean
|
gboolean
|
||||||
gimp_item_is_attached (const GimpItem *item)
|
gimp_item_is_attached (const GimpItem *item)
|
||||||
{
|
{
|
||||||
GimpViewable *parent;
|
GimpItem *parent;
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
|
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
|
||||||
|
|
||||||
parent = gimp_viewable_get_parent (GIMP_VIEWABLE (item));
|
parent = gimp_item_get_parent (item);
|
||||||
|
|
||||||
if (parent)
|
if (parent)
|
||||||
return gimp_item_is_attached (GIMP_ITEM (parent));
|
return gimp_item_is_attached (parent);
|
||||||
|
|
||||||
return GIMP_ITEM_GET_CLASS (item)->is_attached (item);
|
return GIMP_ITEM_GET_CLASS (item)->is_attached (item);
|
||||||
}
|
}
|
||||||
|
|
||||||
GimpItem *
|
GimpItem *
|
||||||
gimp_item_get_parent (GimpItem *item)
|
gimp_item_get_parent (const GimpItem *item)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
|
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
|
||||||
|
|
||||||
|
@ -711,12 +711,12 @@ gimp_item_get_tree (GimpItem *item)
|
||||||
GimpContainer *
|
GimpContainer *
|
||||||
gimp_item_get_container (GimpItem *item)
|
gimp_item_get_container (GimpItem *item)
|
||||||
{
|
{
|
||||||
GimpViewable *parent;
|
GimpItem *parent;
|
||||||
GimpItemTree *tree;
|
GimpItemTree *tree;
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
|
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
|
||||||
|
|
||||||
parent = gimp_viewable_get_parent (GIMP_VIEWABLE (item));
|
parent = gimp_item_get_parent (item);
|
||||||
|
|
||||||
if (parent)
|
if (parent)
|
||||||
return gimp_viewable_get_children (GIMP_VIEWABLE (parent));
|
return gimp_viewable_get_children (GIMP_VIEWABLE (parent));
|
||||||
|
@ -777,7 +777,7 @@ gimp_item_get_path (GimpItem *item)
|
||||||
|
|
||||||
path = g_list_prepend (path, GUINT_TO_POINTER (index));
|
path = g_list_prepend (path, GUINT_TO_POINTER (index));
|
||||||
|
|
||||||
item = GIMP_ITEM (gimp_viewable_get_parent (GIMP_VIEWABLE (item)));
|
item = gimp_item_get_parent (item);
|
||||||
|
|
||||||
if (item)
|
if (item)
|
||||||
container = gimp_item_get_container (item);
|
container = gimp_item_get_container (item);
|
||||||
|
|
|
@ -143,7 +143,7 @@ gboolean gimp_item_is_removed (const GimpItem *item);
|
||||||
|
|
||||||
gboolean gimp_item_is_attached (const GimpItem *item);
|
gboolean gimp_item_is_attached (const GimpItem *item);
|
||||||
|
|
||||||
GimpItem * gimp_item_get_parent (GimpItem *item);
|
GimpItem * gimp_item_get_parent (const GimpItem *item);
|
||||||
|
|
||||||
GimpItemTree * gimp_item_get_tree (GimpItem *item);
|
GimpItemTree * gimp_item_get_tree (GimpItem *item);
|
||||||
GimpContainer * gimp_item_get_container (GimpItem *item);
|
GimpContainer * gimp_item_get_container (GimpItem *item);
|
||||||
|
|
|
@ -111,7 +111,7 @@ gimp_item_prop_undo_constructor (GType type,
|
||||||
switch (GIMP_UNDO (object)->undo_type)
|
switch (GIMP_UNDO (object)->undo_type)
|
||||||
{
|
{
|
||||||
case GIMP_UNDO_ITEM_REORDER:
|
case GIMP_UNDO_ITEM_REORDER:
|
||||||
item_prop_undo->parent = GIMP_ITEM (gimp_viewable_get_parent (GIMP_VIEWABLE (item)));
|
item_prop_undo->parent = gimp_item_get_parent (item);
|
||||||
item_prop_undo->position = gimp_item_get_index (item);
|
item_prop_undo->position = gimp_item_get_index (item);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ gimp_item_prop_undo_pop (GimpUndo *undo,
|
||||||
GimpItem *parent;
|
GimpItem *parent;
|
||||||
gint position;
|
gint position;
|
||||||
|
|
||||||
parent = GIMP_ITEM (gimp_viewable_get_parent (GIMP_VIEWABLE (item)));
|
parent = gimp_item_get_parent (item);
|
||||||
position = gimp_item_get_index (item);
|
position = gimp_item_get_index (item);
|
||||||
|
|
||||||
gimp_item_tree_reorder_item (gimp_item_get_tree (item), item,
|
gimp_item_tree_reorder_item (gimp_item_get_tree (item), item,
|
||||||
|
|
|
@ -286,7 +286,7 @@ gimp_item_tree_remove_item (GimpItemTree *tree,
|
||||||
g_return_val_if_fail (GIMP_IS_ITEM_TREE (tree), NULL);
|
g_return_val_if_fail (GIMP_IS_ITEM_TREE (tree), NULL);
|
||||||
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
|
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
|
||||||
|
|
||||||
parent = GIMP_ITEM (gimp_viewable_get_parent (GIMP_VIEWABLE (item)));
|
parent = gimp_item_get_parent (item);
|
||||||
container = gimp_item_get_container (item);
|
container = gimp_item_get_container (item);
|
||||||
index = gimp_item_get_index (item);
|
index = gimp_item_get_index (item);
|
||||||
|
|
||||||
|
|
|
@ -202,9 +202,7 @@ gimp_layer_undo_pop (GimpUndo *undo,
|
||||||
/* remove layer */
|
/* remove layer */
|
||||||
|
|
||||||
/* record the current parent and position */
|
/* record the current parent and position */
|
||||||
layer_undo->prev_parent =
|
layer_undo->prev_parent = gimp_layer_get_parent (layer);
|
||||||
GIMP_LAYER (gimp_viewable_get_parent (GIMP_VIEWABLE (layer)));
|
|
||||||
|
|
||||||
layer_undo->prev_position = gimp_item_get_index (GIMP_ITEM (layer));
|
layer_undo->prev_position = gimp_item_get_index (GIMP_ITEM (layer));
|
||||||
|
|
||||||
gimp_image_remove_layer (undo->image, layer, FALSE,
|
gimp_image_remove_layer (undo->image, layer, FALSE,
|
||||||
|
|
|
@ -203,9 +203,7 @@ gimp_vectors_undo_pop (GimpUndo *undo,
|
||||||
/* remove vectors */
|
/* remove vectors */
|
||||||
|
|
||||||
/* record the current parent and position */
|
/* record the current parent and position */
|
||||||
vectors_undo->prev_parent =
|
vectors_undo->prev_parent = gimp_vectors_get_parent (vectors);
|
||||||
GIMP_VECTORS (gimp_viewable_get_parent (GIMP_VIEWABLE (vectors)));
|
|
||||||
|
|
||||||
vectors_undo->prev_position = gimp_item_get_index (GIMP_ITEM (vectors));
|
vectors_undo->prev_position = gimp_item_get_index (GIMP_ITEM (vectors));
|
||||||
|
|
||||||
gimp_image_remove_vectors (undo->image, vectors, FALSE,
|
gimp_image_remove_vectors (undo->image, vectors, FALSE,
|
||||||
|
|
Loading…
Reference in New Issue