[gimp] Add action and callback for adding a group layer (works but is not used yet)
- From: Michael Natterer <mitch src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp] Add action and callback for adding a group layer (works but is not used yet)
- Date: Thu, 6 Aug 2009 16:38:47 +0000 (UTC)
commit e8bd830f486cb3f76df6185157891ddabd1b6100
Author: Michael Natterer <mitch gimp org>
Date: Thu Aug 6 18:37:54 2009 +0200
Add action and callback for adding a group layer (works but is not used yet)
app/actions/layers-actions.c | 7 +++++++
app/actions/layers-commands.c | 18 +++++++++++++++++-
app/actions/layers-commands.h | 3 +++
3 files changed, 27 insertions(+), 1 deletions(-)
---
diff --git a/app/actions/layers-actions.c b/app/actions/layers-actions.c
index b60bc30..3064e81 100644
--- a/app/actions/layers-actions.c
+++ b/app/actions/layers-actions.c
@@ -97,6 +97,12 @@ static const GimpActionEntry layers_actions[] =
G_CALLBACK (layers_new_from_visible_cmd_callback),
GIMP_HELP_LAYER_NEW_FROM_VISIBLE },
+ { "layers-new-group", GTK_STOCK_DIRECTORY,
+ NC_("layers-action", "_New Group Layer..."), NULL,
+ NC_("layers-action", "Create a new group layer and add it to the image"),
+ G_CALLBACK (layers_new_group_cmd_callback),
+ GIMP_HELP_LAYER_NEW },
+
{ "layers-duplicate", GIMP_STOCK_DUPLICATE,
NC_("layers-action", "D_uplicate Layer"), "<control><shift>D",
NC_("layers-action",
@@ -544,6 +550,7 @@ layers_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("layers-new", image);
SET_SENSITIVE ("layers-new-last-values", image);
SET_SENSITIVE ("layers-new-from-visible", image);
+ SET_SENSITIVE ("layers-new-group", image);
SET_SENSITIVE ("layers-duplicate", layer && !fs && !ac);
SET_SENSITIVE ("layers-delete", layer && !ac);
diff --git a/app/actions/layers-commands.c b/app/actions/layers-commands.c
index 527d216..2499aac 100644
--- a/app/actions/layers-commands.c
+++ b/app/actions/layers-commands.c
@@ -33,12 +33,12 @@
#include "core/gimp.h"
#include "core/gimpchannel-select.h"
#include "core/gimpcontext.h"
+#include "core/gimpgrouplayer.h"
#include "core/gimpimage.h"
#include "core/gimpimage-merge.h"
#include "core/gimpimage-undo.h"
#include "core/gimpimage-undo-push.h"
#include "core/gimpitemundo.h"
-#include "core/gimplayer.h"
#include "core/gimplayer-floating-sel.h"
#include "core/gimplayermask.h"
#include "core/gimppickable.h"
@@ -361,6 +361,22 @@ layers_new_from_visible_cmd_callback (GtkAction *action,
}
void
+layers_new_group_cmd_callback (GtkAction *action,
+ gpointer data)
+{
+ GimpImage *image;
+ GimpLayer *layer;
+ return_if_no_image (image, data);
+
+ layer = gimp_group_layer_new (image);
+
+ gimp_image_add_layer (image, layer,
+ GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
+
+ gimp_image_flush (image);
+}
+
+void
layers_select_cmd_callback (GtkAction *action,
gint value,
gpointer data)
diff --git a/app/actions/layers-commands.h b/app/actions/layers-commands.h
index a458a0e..9c9a019 100644
--- a/app/actions/layers-commands.h
+++ b/app/actions/layers-commands.h
@@ -31,6 +31,9 @@ void layers_new_last_vals_cmd_callback (GtkAction *action,
void layers_new_from_visible_cmd_callback (GtkAction *action,
gpointer data);
+void layers_new_group_cmd_callback (GtkAction *action,
+ gpointer data);
+
void layers_select_cmd_callback (GtkAction *action,
gint value,
gpointer data);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]