diff --git a/app/actions/actions.h b/app/actions/actions.h index 86ae2b6ca7..0ba8f71d31 100644 --- a/app/actions/actions.h +++ b/app/actions/actions.h @@ -91,13 +91,6 @@ void action_message (GimpDisplay *display, if (! widget) \ return - -#define return_if_no_drawable(image,drawable,data) \ - return_if_no_image (image,data); \ - drawable = gimp_image_get_active_drawable (image); \ - if (! drawable) \ - return - #define return_if_no_drawables(image,drawables,data) \ return_if_no_image (image,data); \ drawables = gimp_image_get_selected_drawables (image); \ diff --git a/app/actions/drawable-commands.c b/app/actions/drawable-commands.c index ee69c28154..b82788e83b 100644 --- a/app/actions/drawable-commands.c +++ b/app/actions/drawable-commands.c @@ -67,6 +67,7 @@ drawable_equalize_cmd_callback (GimpAction *action, gimp_image_undo_group_end (image); gimp_image_flush (image); + g_list_free (drawables); } void @@ -108,6 +109,7 @@ drawable_levels_stretch_cmd_callback (GimpAction *action, gimp_image_undo_group_end (image); gimp_image_flush (image); + g_list_free (drawables); } void @@ -317,6 +319,7 @@ drawable_lock_position_cmd_callback (GimpAction *action, gimp_image_undo_group_end (image); gimp_image_flush (image); + g_list_free (drawables); } void @@ -372,6 +375,7 @@ drawable_flip_cmd_callback (GimpAction *action, gimp_image_undo_group_end (image); gimp_image_flush (image); + g_list_free (drawables); } void @@ -417,4 +421,5 @@ drawable_rotate_cmd_callback (GimpAction *action, gimp_image_undo_group_end (image); gimp_image_flush (image); + g_list_free (drawables); } diff --git a/app/actions/filters-commands.c b/app/actions/filters-commands.c index 1122b6974d..389048e3a1 100644 --- a/app/actions/filters-commands.c +++ b/app/actions/filters-commands.c @@ -65,12 +65,20 @@ filters_apply_cmd_callback (GimpAction *action, gpointer data) { GimpImage *image; - GimpDrawable *drawable; + GList *drawables; gchar *operation; GimpObject *settings; GimpProcedure *procedure; GVariant *variant; - return_if_no_drawable (image, drawable, data); + + return_if_no_drawables (image, drawables, data); + + if (g_list_length (drawables) != 1) + { + /* We only support running filters on single drawable for now. */ + g_list_free (drawables); + return; + } operation = filters_parse_operation (image->gimp, g_variant_get_string (value, NULL), @@ -99,6 +107,7 @@ filters_apply_cmd_callback (GimpAction *action, g_variant_unref (variant); g_object_unref (procedure); + g_list_free (drawables); } void @@ -107,10 +116,18 @@ filters_apply_interactive_cmd_callback (GimpAction *action, gpointer data) { GimpImage *image; - GimpDrawable *drawable; + GList *drawables; GimpProcedure *procedure; GVariant *variant; - return_if_no_drawable (image, drawable, data); + + return_if_no_drawables (image, drawables, data); + + if (g_list_length (drawables) != 1) + { + /* We only support running filters on single drawable for now. */ + g_list_free (drawables); + return; + } procedure = gimp_gegl_procedure_new (image->gimp, GIMP_RUN_INTERACTIVE, NULL, @@ -129,6 +146,7 @@ filters_apply_interactive_cmd_callback (GimpAction *action, g_variant_unref (variant); g_object_unref (procedure); + g_list_free (drawables); } void diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c index f22395f57a..d3722728d9 100644 --- a/app/core/gimpimage.c +++ b/app/core/gimpimage.c @@ -4680,41 +4680,6 @@ gimp_image_get_vectors_list (GimpImage *image) /* active drawable, layer, channel, vectors */ -GimpDrawable * -gimp_image_get_active_drawable (GimpImage *image) -{ - GimpImagePrivate *private; - GimpItem *active_channel; - GimpItem *active_layer; - - g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - - private = GIMP_IMAGE_GET_PRIVATE (image); - - active_channel = gimp_item_tree_get_active_item (private->channels); - active_layer = gimp_item_tree_get_active_item (private->layers); - - /* If there is an active channel (a saved selection, etc.), - * we ignore the active layer - */ - if (active_channel) - { - return GIMP_DRAWABLE (active_channel); - } - else if (active_layer) - { - GimpLayer *layer = GIMP_LAYER (active_layer); - GimpLayerMask *mask = gimp_layer_get_mask (layer); - - if (mask && gimp_layer_get_edit_mask (layer)) - return GIMP_DRAWABLE (mask); - else - return GIMP_DRAWABLE (layer); - } - - return NULL; -} - GimpLayer * gimp_image_get_active_layer (GimpImage *image) { diff --git a/app/core/gimpimage.h b/app/core/gimpimage.h index 1e132942d9..4bb95ed2a2 100644 --- a/app/core/gimpimage.h +++ b/app/core/gimpimage.h @@ -372,7 +372,6 @@ GList * gimp_image_get_layer_list (GimpImage *image); GList * gimp_image_get_channel_list (GimpImage *image); GList * gimp_image_get_vectors_list (GimpImage *image); -GimpDrawable * gimp_image_get_active_drawable (GimpImage *image); GimpLayer * gimp_image_get_active_layer (GimpImage *image); GimpChannel * gimp_image_get_active_channel (GimpImage *image); GimpVectors * gimp_image_get_active_vectors (GimpImage *image); diff --git a/app/gimpcore.def b/app/gimpcore.def index 09e9228598..234bd0d48a 100644 --- a/app/gimpcore.def +++ b/app/gimpcore.def @@ -878,8 +878,6 @@ tile_swap_exit gimp_image_parasite_attach gimp_image_parasite_detach -gimp_image_get_active_drawable - gimp_image_get_load_proc gimp_log