mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-22 12:32:37 +00:00
2c601c7dc3
2004-04-21 Michael Natterer <mitch@gimp.org> * app/actions/actions.c: forgot to register the "patterns" actions. * app/actions/*-actions.c: added actions representing the toplevel menus (popups and menubars). Fixed some typos. * menus/*-menu.xml: added action="foo" attributes to all toplevel menus. Fixed typos here too. * menus/gtkuimanager.dtd: fixed possible attributes.
196 lines
4.9 KiB
C
196 lines
4.9 KiB
C
/* The GIMP -- an image manipulation program
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
#include "config.h"
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
#include "actions-types.h"
|
|
|
|
#include "core/gimp.h"
|
|
|
|
#include "widgets/gimpactionfactory.h"
|
|
|
|
#include "brushes-actions.h"
|
|
#include "buffers-actions.h"
|
|
#include "channels-actions.h"
|
|
#include "colormap-editor-actions.h"
|
|
#include "debug-actions.h"
|
|
#include "dialogs-actions.h"
|
|
#include "dockable-actions.h"
|
|
#include "documents-actions.h"
|
|
#include "drawable-actions.h"
|
|
#include "edit-actions.h"
|
|
#include "error-console-actions.h"
|
|
#include "file-actions.h"
|
|
#include "fonts-actions.h"
|
|
#include "gradient-editor-actions.h"
|
|
#include "gradients-actions.h"
|
|
#include "help-actions.h"
|
|
#include "image-actions.h"
|
|
#include "images-actions.h"
|
|
#include "layers-actions.h"
|
|
#include "palette-editor-actions.h"
|
|
#include "palettes-actions.h"
|
|
#include "patterns-actions.h"
|
|
#include "plug-in-actions.h"
|
|
#include "qmask-actions.h"
|
|
#include "select-actions.h"
|
|
#include "templates-actions.h"
|
|
#include "tool-options-actions.h"
|
|
#include "tools-actions.h"
|
|
#include "vectors-actions.h"
|
|
#include "view-actions.h"
|
|
|
|
|
|
/* global variables */
|
|
|
|
GimpActionFactory *global_action_factory = NULL;
|
|
|
|
|
|
/* private variables */
|
|
|
|
static GimpActionFactoryEntry action_groups[] =
|
|
{
|
|
{ "brushes",
|
|
brushes_actions_setup,
|
|
brushes_actions_update },
|
|
{ "buffers",
|
|
buffers_actions_setup,
|
|
buffers_actions_update },
|
|
{ "channels",
|
|
channels_actions_setup,
|
|
channels_actions_update },
|
|
{ "colormap-editor",
|
|
colormap_editor_actions_setup,
|
|
colormap_editor_actions_update },
|
|
{ "debug",
|
|
debug_actions_setup,
|
|
debug_actions_update },
|
|
{ "dialogs",
|
|
dialogs_actions_setup,
|
|
dialogs_actions_update },
|
|
{ "dockable",
|
|
dockable_actions_setup,
|
|
dockable_actions_update },
|
|
{ "documents",
|
|
documents_actions_setup,
|
|
documents_actions_update },
|
|
{ "drawable",
|
|
drawable_actions_setup,
|
|
drawable_actions_update },
|
|
{ "edit",
|
|
edit_actions_setup,
|
|
edit_actions_update },
|
|
{ "error-console",
|
|
error_console_actions_setup,
|
|
error_console_actions_update },
|
|
{ "file",
|
|
file_actions_setup,
|
|
file_actions_update },
|
|
{ "fonts",
|
|
fonts_actions_setup,
|
|
fonts_actions_update },
|
|
{ "gradient-editor",
|
|
gradient_editor_actions_setup,
|
|
gradient_editor_actions_update },
|
|
{ "gradients",
|
|
gradients_actions_setup,
|
|
gradients_actions_update },
|
|
{ "help",
|
|
help_actions_setup,
|
|
help_actions_update },
|
|
{ "image",
|
|
image_actions_setup,
|
|
image_actions_update },
|
|
{ "images",
|
|
images_actions_setup,
|
|
images_actions_update },
|
|
{ "layers",
|
|
layers_actions_setup,
|
|
layers_actions_update },
|
|
{ "palette-editor",
|
|
palette_editor_actions_setup,
|
|
palette_editor_actions_update },
|
|
{ "palettes",
|
|
palettes_actions_setup,
|
|
palettes_actions_update },
|
|
{ "patterns",
|
|
patterns_actions_setup,
|
|
patterns_actions_update },
|
|
{ "plug-in",
|
|
plug_in_actions_setup,
|
|
plug_in_actions_update },
|
|
{ "qmask",
|
|
qmask_actions_setup,
|
|
qmask_actions_update },
|
|
{ "select",
|
|
select_actions_setup,
|
|
select_actions_update },
|
|
{ "templates",
|
|
templates_actions_setup,
|
|
templates_actions_update },
|
|
{ "tool-options",
|
|
tool_options_actions_setup,
|
|
tool_options_actions_update },
|
|
{ "tools",
|
|
tools_actions_setup,
|
|
tools_actions_update },
|
|
{ "vectors",
|
|
vectors_actions_setup,
|
|
vectors_actions_update },
|
|
{ "view",
|
|
view_actions_setup,
|
|
view_actions_update }
|
|
};
|
|
|
|
static gboolean actions_initialized = FALSE;
|
|
|
|
|
|
/* public functions */
|
|
|
|
void
|
|
actions_init (Gimp *gimp)
|
|
{
|
|
gint i;
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
g_return_if_fail (actions_initialized == FALSE);
|
|
|
|
actions_initialized = TRUE;
|
|
|
|
global_action_factory = gimp_action_factory_new (gimp);
|
|
|
|
for (i = 0; i < G_N_ELEMENTS (action_groups); i++)
|
|
gimp_action_factory_group_register (global_action_factory,
|
|
action_groups[i].identifier,
|
|
action_groups[i].setup_func,
|
|
action_groups[i].update_func);
|
|
}
|
|
|
|
void
|
|
actions_exit (Gimp *gimp)
|
|
{
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
g_object_unref (global_action_factory);
|
|
global_action_factory = NULL;
|
|
}
|