1
/* The GIMP -- an image manipulation program
2
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
#include "libgimpwidgets/gimpwidgets.h"
25
#include "actions-types.h"
27
#include "core/gimpcontext.h"
28
#include "core/gimpimage.h"
30
#include "widgets/gimpactiongroup.h"
31
#include "widgets/gimphelp-ids.h"
34
#include "images-actions.h"
35
#include "images-commands.h"
37
#include "gimp-intl.h"
40
static GimpActionEntry images_actions[] =
42
{ "images-popup", GIMP_STOCK_IMAGES,
43
N_("Images Menu"), NULL, NULL, NULL,
44
GIMP_HELP_IMAGE_DIALOG },
46
{ "images-raise-views", GTK_STOCK_GOTO_TOP,
47
N_("_Raise Views"), "",
48
N_("Raise this image's displays"),
49
G_CALLBACK (images_raise_views_cmd_callback),
52
{ "images-new-view", GTK_STOCK_NEW,
54
N_("Create a new display for this image"),
55
G_CALLBACK (images_new_view_cmd_callback),
58
{ "images-delete", GTK_STOCK_DELETE,
59
N_("_Delete Image"), "",
60
N_("Delete this image"),
61
G_CALLBACK (images_delete_image_cmd_callback),
67
images_actions_setup (GimpActionGroup *group)
69
gimp_action_group_add_actions (group,
71
G_N_ELEMENTS (images_actions));
75
images_actions_update (GimpActionGroup *group,
78
GimpContext *context = action_data_get_context (data);
79
GimpImage *image = NULL;
82
image = gimp_context_get_image (context);
84
#define SET_SENSITIVE(action,condition) \
85
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
87
SET_SENSITIVE ("images-raise-views", image);
88
SET_SENSITIVE ("images-new-view", image);
89
SET_SENSITIVE ("images-delete", image && image->disp_count == 0);