Bug 789764 - Please add Paste In Place feature

Add "In Place" variants for all sorts of pasting:

- extend the GimpPasteType enum with IN_PLACE values
- add the needed actions and menu items
- merge the action callbacks into one, taking an enum value as parameter
- refactor the pasting code in gimp-edit.c into smaller functions

We probably have too menu items in the "Edit" menu now, needs to be
sorted out.
This commit is contained in:
Michael Natterer
2017-11-12 18:41:05 +01:00
parent 79836aea34
commit f12d0d8c29
14 changed files with 421 additions and 280 deletions

View File

@ -42,6 +42,7 @@
#include "gimpview.h"
#include "gimpviewrendererbuffer.h"
#include "gimpuimanager.h"
#include "gimpwidgets-utils.h"
#include "gimp-intl.h"
@ -186,15 +187,24 @@ gimp_buffer_view_new (GimpViewType view_type,
buffer_view->paste_button =
gimp_editor_add_action_button (GIMP_EDITOR (editor->view), "buffers",
"buffers-paste", NULL);
"buffers-paste",
"buffers-paste-in-place",
gimp_get_extend_selection_mask (),
NULL);
buffer_view->paste_into_button =
gimp_editor_add_action_button (GIMP_EDITOR (editor->view), "buffers",
"buffers-paste-into", NULL);
"buffers-paste-into",
"buffers-paste-into-in-place",
gimp_get_extend_selection_mask (),
NULL);
buffer_view->paste_as_new_layer_button =
gimp_editor_add_action_button (GIMP_EDITOR (editor->view), "buffers",
"buffers-paste-as-new-layer", NULL);
"buffers-paste-as-new-layer",
"buffers-paste-as-new-layer-in-place",
gimp_get_extend_selection_mask (),
NULL);
buffer_view->paste_as_new_image_button =
gimp_editor_add_action_button (GIMP_EDITOR (editor->view), "buffers",