2006-12-09 21:33:38 +00:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
1997-11-24 22:05:25 +00:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-17 22:28:01 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
1997-11-24 22:05:25 +00:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-17 22:28:01 +00:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
1997-11-24 22:05:25 +00:00
|
|
|
* (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
|
2018-07-11 23:27:07 +02:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
1997-11-24 22:05:25 +00:00
|
|
|
*/
|
2000-12-16 21:37:03 +00:00
|
|
|
|
2000-04-27 17:27:28 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2017-10-16 11:38:28 -04:00
|
|
|
#include <gegl.h>
|
2000-12-16 21:37:03 +00:00
|
|
|
#include <gtk/gtk.h>
|
1999-10-03 13:50:19 +00:00
|
|
|
|
2001-05-21 20:30:16 +00:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2001-01-24 22:36:18 +00:00
|
|
|
|
2004-05-06 07:41:53 +00:00
|
|
|
#include "menus-types.h"
|
2000-12-16 21:37:03 +00:00
|
|
|
|
2007-07-20 12:41:08 +00:00
|
|
|
#include "config/gimpconfig-file.h"
|
2002-11-18 20:50:31 +00:00
|
|
|
#include "config/gimpguiconfig.h"
|
|
|
|
|
2001-07-04 19:31:35 +00:00
|
|
|
#include "core/gimp.h"
|
2001-05-09 02:32:03 +00:00
|
|
|
|
2004-09-20 14:41:54 +00:00
|
|
|
#include "widgets/gimpactionfactory.h"
|
2018-04-02 16:24:09 -04:00
|
|
|
#include "widgets/gimpdashboard.h"
|
2003-01-10 17:55:53 +00:00
|
|
|
#include "widgets/gimpmenufactory.h"
|
|
|
|
|
2005-01-28 19:48:31 +00:00
|
|
|
#include "dockable-menu.h"
|
2003-01-13 14:08:10 +00:00
|
|
|
#include "image-menu.h"
|
2001-04-17 21:43:29 +00:00
|
|
|
#include "menus.h"
|
2005-09-26 10:36:07 +00:00
|
|
|
#include "plug-in-menus.h"
|
2003-09-29 20:26:09 +00:00
|
|
|
#include "tool-options-menu.h"
|
2001-04-17 21:43:29 +00:00
|
|
|
|
2004-07-21 16:11:31 +00:00
|
|
|
#include "gimp-intl.h"
|
|
|
|
|
2000-04-27 17:27:28 +00:00
|
|
|
|
2001-07-09 17:58:56 +00:00
|
|
|
/* local function prototypes */
|
|
|
|
|
2006-05-11 12:29:57 +00:00
|
|
|
static void menus_can_change_accels (GimpGuiConfig *config);
|
|
|
|
static void menus_remove_accels (gpointer data,
|
|
|
|
const gchar *accel_path,
|
|
|
|
guint accel_key,
|
|
|
|
GdkModifierType accel_mods,
|
|
|
|
gboolean changed);
|
2003-04-01 07:47:04 +00:00
|
|
|
|
2003-01-10 17:55:53 +00:00
|
|
|
|
2003-01-13 14:08:10 +00:00
|
|
|
/* global variables */
|
2003-01-10 17:55:53 +00:00
|
|
|
|
2004-07-21 16:11:31 +00:00
|
|
|
GimpMenuFactory * global_menu_factory = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
/* private variables */
|
|
|
|
|
|
|
|
static gboolean menurc_deleted = FALSE;
|
1999-06-06 17:26:51 +00:00
|
|
|
|
2003-01-10 17:55:53 +00:00
|
|
|
|
|
|
|
/* public functions */
|
2001-10-23 16:23:32 +00:00
|
|
|
|
2003-01-10 17:55:53 +00:00
|
|
|
void
|
2004-09-20 14:41:54 +00:00
|
|
|
menus_init (Gimp *gimp,
|
|
|
|
GimpActionFactory *action_factory)
|
2003-01-10 17:55:53 +00:00
|
|
|
{
|
2001-10-23 16:23:32 +00:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
2004-09-20 14:41:54 +00:00
|
|
|
g_return_if_fail (GIMP_IS_ACTION_FACTORY (action_factory));
|
2004-07-02 14:08:15 +00:00
|
|
|
g_return_if_fail (global_menu_factory == NULL);
|
2001-10-23 16:23:32 +00:00
|
|
|
|
2003-04-02 00:08:38 +00:00
|
|
|
/* We need to make sure the property is installed before using it */
|
|
|
|
g_type_class_ref (GTK_TYPE_MENU);
|
2003-04-01 07:47:04 +00:00
|
|
|
|
2006-04-27 09:23:14 +00:00
|
|
|
menus_can_change_accels (GIMP_GUI_CONFIG (gimp->config));
|
2003-04-01 07:47:04 +00:00
|
|
|
|
2003-04-02 00:08:38 +00:00
|
|
|
g_signal_connect (gimp->config, "notify::can-change-accels",
|
2006-04-27 09:23:14 +00:00
|
|
|
G_CALLBACK (menus_can_change_accels), NULL);
|
2003-04-02 00:08:38 +00:00
|
|
|
|
2004-09-20 14:41:54 +00:00
|
|
|
global_menu_factory = gimp_menu_factory_new (gimp, action_factory);
|
2001-10-23 16:23:32 +00:00
|
|
|
|
2004-04-21 10:55:45 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<Image>",
|
2004-04-21 16:33:17 +00:00
|
|
|
"file",
|
2004-06-15 15:42:50 +00:00
|
|
|
"context",
|
2008-03-21 17:55:32 +00:00
|
|
|
"debug",
|
2007-08-30 15:00:50 +00:00
|
|
|
"help",
|
2004-04-21 16:33:17 +00:00
|
|
|
"edit",
|
|
|
|
"select",
|
|
|
|
"view",
|
|
|
|
"image",
|
|
|
|
"drawable",
|
|
|
|
"layers",
|
2004-05-05 11:40:20 +00:00
|
|
|
"channels",
|
2004-04-21 16:33:17 +00:00
|
|
|
"vectors",
|
|
|
|
"tools",
|
|
|
|
"dialogs",
|
2008-05-10 16:21:37 +00:00
|
|
|
"windows",
|
2004-04-21 16:33:17 +00:00
|
|
|
"plug-in",
|
2012-03-26 22:56:53 +02:00
|
|
|
"filters",
|
2005-09-19 12:44:06 +00:00
|
|
|
"quick-mask",
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL,
|
2004-04-22 16:18:40 +00:00
|
|
|
"/image-menubar",
|
2004-04-29 12:52:29 +00:00
|
|
|
"image-menu.xml", image_menu_setup,
|
2004-05-17 13:38:03 +00:00
|
|
|
"/dummy-menubar",
|
2004-04-29 12:52:29 +00:00
|
|
|
"image-menu.xml", image_menu_setup,
|
2005-09-19 12:44:06 +00:00
|
|
|
"/quick-mask-popup",
|
|
|
|
"quick-mask-menu.xml", NULL,
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL);
|
2003-01-13 14:08:10 +00:00
|
|
|
|
2005-01-31 16:09:52 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<Toolbox>",
|
|
|
|
"file",
|
|
|
|
"context",
|
|
|
|
"help",
|
|
|
|
"edit",
|
|
|
|
"select",
|
2012-12-14 09:54:17 +01:00
|
|
|
"view",
|
2005-01-31 16:09:52 +00:00
|
|
|
"image",
|
|
|
|
"drawable",
|
|
|
|
"layers",
|
|
|
|
"channels",
|
|
|
|
"vectors",
|
|
|
|
"tools",
|
2008-05-10 16:21:37 +00:00
|
|
|
"windows",
|
2005-01-31 16:09:52 +00:00
|
|
|
"dialogs",
|
|
|
|
"plug-in",
|
2012-03-26 22:56:53 +02:00
|
|
|
"filters",
|
2005-09-19 12:44:06 +00:00
|
|
|
"quick-mask",
|
2005-01-31 16:09:52 +00:00
|
|
|
NULL,
|
|
|
|
NULL);
|
|
|
|
|
2004-05-04 21:16:40 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<Dock>",
|
|
|
|
"file",
|
2004-06-15 15:42:50 +00:00
|
|
|
"context",
|
2004-05-04 21:16:40 +00:00
|
|
|
"edit",
|
|
|
|
"select",
|
2012-12-14 09:54:17 +01:00
|
|
|
"view",
|
2004-05-04 21:16:40 +00:00
|
|
|
"image",
|
|
|
|
"drawable",
|
|
|
|
"layers",
|
2004-05-05 11:40:20 +00:00
|
|
|
"channels",
|
2004-05-04 21:16:40 +00:00
|
|
|
"vectors",
|
|
|
|
"tools",
|
2008-05-10 16:21:37 +00:00
|
|
|
"windows",
|
2004-05-04 21:16:40 +00:00
|
|
|
"dialogs",
|
|
|
|
"plug-in",
|
2005-09-19 12:44:06 +00:00
|
|
|
"quick-mask",
|
2005-01-23 23:00:21 +00:00
|
|
|
"dock",
|
2004-05-04 21:16:40 +00:00
|
|
|
NULL,
|
|
|
|
NULL);
|
|
|
|
|
2004-04-21 16:33:17 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<Layers>",
|
|
|
|
"layers",
|
2006-06-16 17:02:14 +00:00
|
|
|
"plug-in",
|
2012-03-26 22:56:53 +02:00
|
|
|
"filters",
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL,
|
2004-04-22 16:18:40 +00:00
|
|
|
"/layers-popup",
|
2006-06-16 17:02:14 +00:00
|
|
|
"layers-menu.xml", plug_in_menus_setup,
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL);
|
2003-01-13 14:08:10 +00:00
|
|
|
|
2004-04-21 16:33:17 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<Channels>",
|
|
|
|
"channels",
|
2006-06-16 17:02:14 +00:00
|
|
|
"plug-in",
|
2012-03-26 22:56:53 +02:00
|
|
|
"filters",
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL,
|
2004-04-22 16:18:40 +00:00
|
|
|
"/channels-popup",
|
2006-06-16 17:02:14 +00:00
|
|
|
"channels-menu.xml", plug_in_menus_setup,
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL);
|
2003-01-13 14:08:10 +00:00
|
|
|
|
2004-04-21 16:33:17 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<Vectors>",
|
|
|
|
"vectors",
|
2006-06-16 17:02:14 +00:00
|
|
|
"plug-in",
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL,
|
2004-04-22 16:18:40 +00:00
|
|
|
"/vectors-popup",
|
2006-06-16 17:02:14 +00:00
|
|
|
"vectors-menu.xml", plug_in_menus_setup,
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL);
|
2003-01-13 14:08:10 +00:00
|
|
|
|
2006-11-17 22:07:07 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<Colormap>",
|
|
|
|
"colormap",
|
|
|
|
"plug-in",
|
|
|
|
NULL,
|
|
|
|
"/colormap-popup",
|
|
|
|
"colormap-menu.xml", plug_in_menus_setup,
|
|
|
|
NULL);
|
|
|
|
|
2004-05-05 11:40:20 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<Dockable>",
|
2004-04-21 16:33:17 +00:00
|
|
|
"dockable",
|
2005-01-26 13:34:41 +00:00
|
|
|
"dock",
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL,
|
2004-04-22 16:18:40 +00:00
|
|
|
"/dockable-popup",
|
2005-01-28 19:48:31 +00:00
|
|
|
"dockable-menu.xml", dockable_menu_setup,
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL);
|
2003-01-13 14:08:10 +00:00
|
|
|
|
2004-04-21 16:33:17 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<Brushes>",
|
|
|
|
"brushes",
|
2005-09-26 10:36:07 +00:00
|
|
|
"plug-in",
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL,
|
2004-04-22 16:18:40 +00:00
|
|
|
"/brushes-popup",
|
2005-09-26 10:36:07 +00:00
|
|
|
"brushes-menu.xml", plug_in_menus_setup,
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL);
|
2003-01-13 14:08:10 +00:00
|
|
|
|
2009-10-09 20:25:07 +03:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<Dynamics>",
|
|
|
|
"dynamics",
|
|
|
|
"plug-in",
|
|
|
|
NULL,
|
|
|
|
"/dynamics-popup",
|
|
|
|
"dynamics-menu.xml", plug_in_menus_setup,
|
2015-12-20 23:48:40 +01:00
|
|
|
NULL);
|
|
|
|
|
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<MyPaintBrushes>",
|
|
|
|
"mypaint-brushes",
|
|
|
|
"plug-in",
|
|
|
|
NULL,
|
|
|
|
"/mypaint-brushes-popup",
|
|
|
|
"mypaint-brushes-menu.xml", plug_in_menus_setup,
|
2009-10-09 20:25:07 +03:00
|
|
|
NULL);
|
|
|
|
|
2004-04-21 16:33:17 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<Patterns>",
|
|
|
|
"patterns",
|
2005-09-26 10:36:07 +00:00
|
|
|
"plug-in",
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL,
|
2004-04-22 16:18:40 +00:00
|
|
|
"/patterns-popup",
|
2005-09-26 10:36:07 +00:00
|
|
|
"patterns-menu.xml", plug_in_menus_setup,
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL);
|
2003-01-13 14:08:10 +00:00
|
|
|
|
2004-04-21 16:33:17 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<Gradients>",
|
|
|
|
"gradients",
|
2005-09-26 10:36:07 +00:00
|
|
|
"plug-in",
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL,
|
2004-04-22 16:18:40 +00:00
|
|
|
"/gradients-popup",
|
2005-09-26 10:36:07 +00:00
|
|
|
"gradients-menu.xml", plug_in_menus_setup,
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL);
|
2003-01-13 14:08:10 +00:00
|
|
|
|
2004-04-21 16:33:17 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<Palettes>",
|
|
|
|
"palettes",
|
2005-09-26 10:36:07 +00:00
|
|
|
"plug-in",
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL,
|
2004-04-22 16:18:40 +00:00
|
|
|
"/palettes-popup",
|
2005-09-26 10:36:07 +00:00
|
|
|
"palettes-menu.xml", plug_in_menus_setup,
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL);
|
2003-01-13 14:08:10 +00:00
|
|
|
|
2010-04-03 18:25:31 +03:00
|
|
|
|
2011-10-09 21:55:58 +02:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<ToolPresets>",
|
|
|
|
"tool-presets",
|
2010-04-03 18:25:31 +03:00
|
|
|
"plug-in",
|
|
|
|
NULL,
|
2011-10-09 21:55:58 +02:00
|
|
|
"/tool-presets-popup",
|
|
|
|
"tool-presets-menu.xml", plug_in_menus_setup,
|
2010-04-03 18:25:31 +03:00
|
|
|
NULL);
|
|
|
|
|
2004-04-21 16:33:17 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<Fonts>",
|
|
|
|
"fonts",
|
2005-09-26 10:36:07 +00:00
|
|
|
"plug-in",
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL,
|
2004-04-22 16:18:40 +00:00
|
|
|
"/fonts-popup",
|
2005-09-26 10:36:07 +00:00
|
|
|
"fonts-menu.xml", plug_in_menus_setup,
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL);
|
2003-10-18 16:23:15 +00:00
|
|
|
|
2004-04-21 16:33:17 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<Buffers>",
|
|
|
|
"buffers",
|
2005-09-26 10:36:07 +00:00
|
|
|
"plug-in",
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL,
|
2004-04-22 16:18:40 +00:00
|
|
|
"/buffers-popup",
|
2005-09-26 10:36:07 +00:00
|
|
|
"buffers-menu.xml", plug_in_menus_setup,
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL);
|
2003-01-13 14:08:10 +00:00
|
|
|
|
2004-04-21 16:33:17 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<Documents>",
|
|
|
|
"documents",
|
|
|
|
NULL,
|
2004-04-22 16:18:40 +00:00
|
|
|
"/documents-popup",
|
2004-04-26 15:51:21 +00:00
|
|
|
"documents-menu.xml", NULL,
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL);
|
2003-01-13 14:08:10 +00:00
|
|
|
|
2004-04-21 16:33:17 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<Templates>",
|
|
|
|
"templates",
|
|
|
|
NULL,
|
2004-04-22 16:18:40 +00:00
|
|
|
"/templates-popup",
|
2004-04-26 15:51:21 +00:00
|
|
|
"templates-menu.xml", NULL,
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL);
|
2003-04-06 11:21:56 +00:00
|
|
|
|
2004-04-21 16:33:17 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<Images>",
|
|
|
|
"images",
|
|
|
|
NULL,
|
2004-04-22 16:18:40 +00:00
|
|
|
"/images-popup",
|
2004-04-26 15:51:21 +00:00
|
|
|
"images-menu.xml", NULL,
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL);
|
2003-01-13 14:08:10 +00:00
|
|
|
|
2005-10-25 21:38:00 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<BrushEditor>",
|
|
|
|
"brush-editor",
|
|
|
|
NULL,
|
|
|
|
"/brush-editor-popup",
|
|
|
|
"brush-editor-menu.xml", NULL,
|
|
|
|
NULL);
|
2009-10-09 20:25:07 +03:00
|
|
|
|
2009-07-28 16:52:53 -03:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<DynamicsEditor>",
|
|
|
|
"dynamics-editor",
|
|
|
|
NULL,
|
|
|
|
"/dynamics-editor-popup",
|
|
|
|
"dynamics-editor-menu.xml", NULL,
|
|
|
|
NULL);
|
2009-10-11 15:37:14 +02:00
|
|
|
|
2004-04-21 16:33:17 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<GradientEditor>",
|
|
|
|
"gradient-editor",
|
|
|
|
NULL,
|
|
|
|
"/gradient-editor-popup",
|
2004-04-26 15:51:21 +00:00
|
|
|
"gradient-editor-menu.xml", NULL,
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL);
|
2003-01-13 14:08:10 +00:00
|
|
|
|
2004-04-21 16:33:17 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<PaletteEditor>",
|
2004-04-22 16:18:40 +00:00
|
|
|
"palette-editor",
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL,
|
|
|
|
"/palette-editor-popup",
|
2004-04-26 15:51:21 +00:00
|
|
|
"palette-editor-menu.xml", NULL,
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL);
|
2003-01-13 14:08:10 +00:00
|
|
|
|
2010-04-11 13:40:28 +02:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<ToolPresetEditor>",
|
|
|
|
"tool-preset-editor",
|
|
|
|
NULL,
|
|
|
|
"/tool-preset-editor-popup",
|
|
|
|
"tool-preset-editor-menu.xml", NULL,
|
|
|
|
NULL);
|
|
|
|
|
2006-11-17 22:07:07 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<Selection>",
|
2004-05-12 18:36:33 +00:00
|
|
|
"select",
|
|
|
|
"vectors",
|
|
|
|
NULL,
|
2006-11-17 22:07:07 +00:00
|
|
|
"/selection-popup",
|
|
|
|
"selection-menu.xml", NULL,
|
2004-05-12 18:36:33 +00:00
|
|
|
NULL);
|
|
|
|
|
2004-09-26 15:21:44 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<NavigationEditor>",
|
|
|
|
"view",
|
|
|
|
NULL,
|
|
|
|
NULL);
|
|
|
|
|
2006-11-17 22:07:07 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<Undo>",
|
2004-05-12 18:36:33 +00:00
|
|
|
"edit",
|
|
|
|
NULL,
|
2006-11-17 22:07:07 +00:00
|
|
|
"/undo-popup",
|
|
|
|
"undo-menu.xml", NULL,
|
2004-05-12 18:36:33 +00:00
|
|
|
NULL);
|
|
|
|
|
2004-04-21 16:33:17 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<ErrorConsole>",
|
|
|
|
"error-console",
|
|
|
|
NULL,
|
|
|
|
"/error-console-popup",
|
2004-04-26 15:51:21 +00:00
|
|
|
"error-console-menu.xml", NULL,
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL);
|
2003-09-29 20:26:09 +00:00
|
|
|
|
2004-04-21 16:33:17 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<ToolOptions>",
|
|
|
|
"tool-options",
|
|
|
|
NULL,
|
|
|
|
"/tool-options-popup",
|
2004-04-30 15:29:11 +00:00
|
|
|
"tool-options-menu.xml",
|
|
|
|
tool_options_menu_setup,
|
2004-04-21 16:33:17 +00:00
|
|
|
NULL);
|
2004-11-04 14:24:32 +00:00
|
|
|
|
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<TextEditor>",
|
|
|
|
"text-editor",
|
|
|
|
NULL,
|
|
|
|
"/text-editor-toolbar",
|
|
|
|
"text-editor-toolbar.xml",
|
|
|
|
NULL,
|
|
|
|
NULL);
|
2005-07-08 22:54:46 +00:00
|
|
|
|
2008-10-26 17:39:55 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<TextTool>",
|
|
|
|
"text-tool",
|
|
|
|
NULL,
|
|
|
|
"/text-tool-popup",
|
|
|
|
"text-tool-menu.xml",
|
|
|
|
NULL,
|
|
|
|
NULL);
|
2009-10-09 20:25:07 +03:00
|
|
|
|
2005-07-08 22:54:46 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<CursorInfo>",
|
|
|
|
"cursor-info",
|
|
|
|
NULL,
|
|
|
|
"/cursor-info-popup",
|
|
|
|
"cursor-info-menu.xml",
|
|
|
|
NULL,
|
|
|
|
NULL);
|
2005-07-09 11:23:15 +00:00
|
|
|
|
2006-11-17 22:07:07 +00:00
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<SamplePoints>",
|
|
|
|
"sample-points",
|
2005-07-09 11:23:15 +00:00
|
|
|
NULL,
|
2006-11-17 22:07:07 +00:00
|
|
|
"/sample-points-popup",
|
|
|
|
"sample-points-menu.xml",
|
2005-07-09 11:23:15 +00:00
|
|
|
NULL,
|
|
|
|
NULL);
|
2017-12-18 18:54:17 -05:00
|
|
|
|
|
|
|
gimp_menu_factory_manager_register (global_menu_factory, "<Dashboard>",
|
|
|
|
"dashboard",
|
|
|
|
NULL,
|
|
|
|
"/dashboard-popup",
|
2018-04-02 16:24:09 -04:00
|
|
|
"dashboard-menu.xml", gimp_dashboard_menu_setup,
|
2017-12-18 18:54:17 -05:00
|
|
|
NULL);
|
2003-01-10 17:55:53 +00:00
|
|
|
}
|
2002-01-25 18:34:33 +00:00
|
|
|
|
2003-01-10 17:55:53 +00:00
|
|
|
void
|
|
|
|
menus_exit (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
2004-07-02 14:08:15 +00:00
|
|
|
g_return_if_fail (global_menu_factory != NULL);
|
|
|
|
|
2003-01-10 17:55:53 +00:00
|
|
|
g_object_unref (global_menu_factory);
|
|
|
|
global_menu_factory = NULL;
|
2003-04-01 07:47:04 +00:00
|
|
|
|
|
|
|
g_signal_handlers_disconnect_by_func (gimp->config,
|
2006-04-27 09:23:14 +00:00
|
|
|
menus_can_change_accels,
|
2003-04-01 07:47:04 +00:00
|
|
|
NULL);
|
2001-10-23 16:23:32 +00:00
|
|
|
}
|
|
|
|
|
2003-04-08 10:02:42 +00:00
|
|
|
void
|
|
|
|
menus_restore (Gimp *gimp)
|
|
|
|
{
|
2019-09-21 18:08:13 +02:00
|
|
|
GFile *file;
|
2003-09-22 15:31:54 +00:00
|
|
|
gchar *filename;
|
2003-04-08 10:02:42 +00:00
|
|
|
|
2003-09-22 15:31:54 +00:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
2003-04-08 10:02:42 +00:00
|
|
|
|
2019-09-21 18:08:13 +02:00
|
|
|
file = gimp_directory_file ("menurc", NULL);
|
2005-11-07 09:39:06 +00:00
|
|
|
|
|
|
|
if (gimp->be_verbose)
|
2019-09-21 18:08:13 +02:00
|
|
|
g_print ("Parsing '%s'\n", gimp_file_get_utf8_name (file));
|
2005-11-07 09:39:06 +00:00
|
|
|
|
2019-09-21 18:08:13 +02:00
|
|
|
filename = g_file_get_path (file);
|
2003-09-22 15:31:54 +00:00
|
|
|
gtk_accel_map_load (filename);
|
|
|
|
g_free (filename);
|
2019-09-21 18:08:13 +02:00
|
|
|
|
|
|
|
g_object_unref (file);
|
2003-04-08 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2004-07-21 16:11:31 +00:00
|
|
|
menus_save (Gimp *gimp,
|
|
|
|
gboolean always_save)
|
2003-04-08 10:02:42 +00:00
|
|
|
{
|
2019-09-21 18:08:13 +02:00
|
|
|
GFile *file;
|
2003-09-22 15:31:54 +00:00
|
|
|
gchar *filename;
|
2003-04-08 10:02:42 +00:00
|
|
|
|
2003-09-22 15:31:54 +00:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
2003-04-08 10:02:42 +00:00
|
|
|
|
2004-07-21 16:11:31 +00:00
|
|
|
if (menurc_deleted && ! always_save)
|
|
|
|
return;
|
|
|
|
|
2019-09-21 18:08:13 +02:00
|
|
|
file = gimp_directory_file ("menurc", NULL);
|
2005-11-07 09:39:06 +00:00
|
|
|
|
|
|
|
if (gimp->be_verbose)
|
2019-09-21 18:08:13 +02:00
|
|
|
g_print ("Writing '%s'\n", gimp_file_get_utf8_name (file));
|
2005-11-07 09:39:06 +00:00
|
|
|
|
2019-09-21 18:08:13 +02:00
|
|
|
filename = g_file_get_path (file);
|
2003-09-22 15:31:54 +00:00
|
|
|
gtk_accel_map_save (filename);
|
|
|
|
g_free (filename);
|
2004-07-21 16:11:31 +00:00
|
|
|
|
2019-09-21 18:08:13 +02:00
|
|
|
g_object_unref (file);
|
|
|
|
|
2004-07-21 16:11:31 +00:00
|
|
|
menurc_deleted = FALSE;
|
2003-04-08 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2004-07-21 16:11:31 +00:00
|
|
|
gboolean
|
|
|
|
menus_clear (Gimp *gimp,
|
|
|
|
GError **error)
|
2003-04-08 10:02:42 +00:00
|
|
|
{
|
2014-07-29 14:52:55 +02:00
|
|
|
GFile *file;
|
|
|
|
GFile *source;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
GError *my_error = NULL;
|
2004-07-21 16:11:31 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
|
|
|
|
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
|
|
|
|
2014-07-29 14:52:55 +02:00
|
|
|
file = gimp_directory_file ("menurc", NULL);
|
|
|
|
source = gimp_sysconf_directory_file ("menurc", NULL);
|
2004-07-21 16:11:31 +00:00
|
|
|
|
2014-07-29 14:52:55 +02:00
|
|
|
if (g_file_copy (source, file, G_FILE_COPY_OVERWRITE,
|
|
|
|
NULL, NULL, NULL, NULL))
|
2007-07-20 12:41:08 +00:00
|
|
|
{
|
|
|
|
menurc_deleted = TRUE;
|
|
|
|
}
|
2014-07-29 14:52:55 +02:00
|
|
|
else if (! g_file_delete (file, NULL, &my_error) &&
|
|
|
|
my_error->code != G_IO_ERROR_NOT_FOUND)
|
2004-07-21 16:11:31 +00:00
|
|
|
{
|
2014-07-29 14:52:55 +02:00
|
|
|
g_set_error (error, my_error->domain, my_error->code,
|
2016-11-20 00:40:07 +01:00
|
|
|
_("Deleting \"%s\" failed: %s"),
|
2014-07-29 14:52:55 +02:00
|
|
|
gimp_file_get_utf8_name (file), my_error->message);
|
2004-07-21 16:11:31 +00:00
|
|
|
success = FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
menurc_deleted = TRUE;
|
|
|
|
}
|
|
|
|
|
2014-07-29 14:52:55 +02:00
|
|
|
g_clear_error (&my_error);
|
|
|
|
g_object_unref (source);
|
|
|
|
g_object_unref (file);
|
2003-04-08 10:02:42 +00:00
|
|
|
|
2004-07-21 16:11:31 +00:00
|
|
|
return success;
|
2003-04-08 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2006-05-11 12:29:57 +00:00
|
|
|
void
|
|
|
|
menus_remove (Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
|
|
|
gtk_accel_map_foreach (gimp, menus_remove_accels);
|
|
|
|
}
|
|
|
|
|
2003-01-13 14:08:10 +00:00
|
|
|
|
|
|
|
/* private functions */
|
|
|
|
|
2003-04-01 07:47:04 +00:00
|
|
|
static void
|
2006-04-27 09:23:14 +00:00
|
|
|
menus_can_change_accels (GimpGuiConfig *config)
|
2003-04-01 07:47:04 +00:00
|
|
|
{
|
2003-11-01 20:06:01 +00:00
|
|
|
g_object_set (gtk_settings_get_for_screen (gdk_screen_get_default ()),
|
2003-04-02 00:08:38 +00:00
|
|
|
"gtk-can-change-accels", config->can_change_accels,
|
|
|
|
NULL);
|
2003-04-01 07:47:04 +00:00
|
|
|
}
|
2006-05-11 12:29:57 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
menus_remove_accels (gpointer data,
|
|
|
|
const gchar *accel_path,
|
|
|
|
guint accel_key,
|
|
|
|
GdkModifierType accel_mods,
|
|
|
|
gboolean changed)
|
|
|
|
{
|
|
|
|
gtk_accel_map_change_entry (accel_path, 0, 0, TRUE);
|
|
|
|
}
|