Commit d3439fc3 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

configure.in app/Makefile.am app/menus/.cvsignore app/menus/Makefile.am

2004-05-06  Michael Natterer  <mitch@gimp.org>

	* configure.in
	* app/Makefile.am
	* app/menus/.cvsignore
	* app/menus/Makefile.am
	* app/menus/menus-types.h
	* app/menus/menus.[ch]
	* app/menus/file-open-menu.[ch]
	* app/menus/file-save-menu.[ch]
	* app/menus/image-menu.[ch]
	* app/menus/plug-in-menus.[ch]
	* app/menus/tool-options-menu.[ch]
	* app/menus/toolbox-menu.[ch]: moved all menus files to their
	own directory.

	* app/gui/Makefile.am
	* app/gui/menus.[ch]
	* app/gui/file-open-menu.[ch]
	* app/gui/file-save-menu.[ch]
	* app/gui/image-menu.[ch]
	* app/gui/plug-in-menus.[ch]
	* app/gui/tool-options-menu.[ch]
	* app/gui/toolbox-menu.[ch]: removed them here.

	* app/actions/debug-commands.c
	* app/actions/file-commands.c
	* app/gui/brush-select.c
	* app/gui/dialogs.c
	* app/gui/font-select.c
	* app/gui/gradient-select.c
	* app/gui/gui-vtable.c
	* app/gui/gui.c
	* app/gui/palette-select.c
	* app/gui/pattern-select.c
	* app/gui/preferences-dialog.c: changed #includes accordingly.
parent 98f6cfa9
2004-05-06 Michael Natterer <mitch@gimp.org>
* configure.in
* app/Makefile.am
* app/menus/.cvsignore
* app/menus/Makefile.am
* app/menus/menus-types.h
* app/menus/menus.[ch]
* app/menus/file-open-menu.[ch]
* app/menus/file-save-menu.[ch]
* app/menus/image-menu.[ch]
* app/menus/plug-in-menus.[ch]
* app/menus/tool-options-menu.[ch]
* app/menus/toolbox-menu.[ch]: moved all menus files to their
own directory.
* app/gui/Makefile.am
* app/gui/menus.[ch]
* app/gui/file-open-menu.[ch]
* app/gui/file-save-menu.[ch]
* app/gui/image-menu.[ch]
* app/gui/plug-in-menus.[ch]
* app/gui/tool-options-menu.[ch]
* app/gui/toolbox-menu.[ch]: removed them here.
* app/actions/debug-commands.c
* app/actions/file-commands.c
* app/gui/brush-select.c
* app/gui/dialogs.c
* app/gui/font-select.c
* app/gui/gradient-select.c
* app/gui/gui-vtable.c
* app/gui/gui.c
* app/gui/palette-select.c
* app/gui/pattern-select.c
* app/gui/preferences-dialog.c: changed #includes accordingly.
2004-05-05 Sven Neumann <sven@gimp.org>
* app/gui/file-new-dialog.c: use a normal GimpDialog instead of a
......
......@@ -23,6 +23,7 @@ SUBDIRS = \
widgets \
display \
actions \
menus \
gui \
pdb
......@@ -96,6 +97,7 @@ gimp_2_1_LDFLAGS = \
gimp_2_1_LDADD = \
config/libappconfig.a \
gui/libappgui.a \
menus/libappmenus.a \
actions/libappactions.a \
display/libappdisplay.a \
tools/libapptools.a \
......
......@@ -31,8 +31,9 @@
#include "widgets/gimpmenufactory.h"
#include "widgets/gimpuimanager.h"
#include "menus/menus.h"
#include "debug-commands.h"
#include "gui/menus.h"
#ifdef ENABLE_DEBUG_MENU
......
......@@ -45,11 +45,12 @@
#include "display/gimpdisplay.h"
#include "display/gimpdisplay-foreach.h"
#include "menus/menus.h"
#include "gui/dialogs.h"
#include "gui/file-new-dialog.h"
#include "gui/file-open-dialog.h"
#include "gui/file-save-dialog.h"
#include "gui/menus.h"
#include "actions.h"
#include "file-commands.h"
......
......@@ -27,9 +27,10 @@
#include "widgets/gimpdialogfactory.h"
#include "menus/menus.h"
#include "dialogs.h"
#include "dialogs-constructors.h"
#include "menus.h"
GimpDialogFactory *global_dialog_factory = NULL;
......
......@@ -47,7 +47,8 @@
#include "widgets/gimptemplateeditor.h"
#include "widgets/gimpwidgets-utils.h"
#include "menus.h"
#include "menus/menus.h"
#include "resolution-calibrate-dialog.h"
#include "session.h"
#include "themes.h"
......
......@@ -58,25 +58,8 @@ dialogs_sources = \
user-install-dialog.c \
user-install-dialog.h
menus_sources = \
file-open-menu.c \
file-open-menu.h \
file-save-menu.c \
file-save-menu.h \
image-menu.c \
image-menu.h \
menus.c \
menus.h \
plug-in-menus.c \
plug-in-menus.h \
tool-options-menu.c \
tool-options-menu.h \
toolbox-menu.c \
toolbox-menu.h
libappgui_a_SOURCES = \
$(dialogs_sources) \
$(menus_sources) \
authors.h \
color-history.c \
color-history.h \
......
......@@ -41,9 +41,10 @@
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpwidgets-constructors.h"
#include "menus/menus.h"
#include "brush-select.h"
#include "dialogs-constructors.h"
#include "menus.h"
#include "gimp-intl.h"
......
......@@ -27,9 +27,10 @@
#include "widgets/gimpdialogfactory.h"
#include "menus/menus.h"
#include "dialogs.h"
#include "dialogs-constructors.h"
#include "menus.h"
GimpDialogFactory *global_dialog_factory = NULL;
......
/* 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 <string.h>
#include <gtk/gtk.h>
#include "gui-types.h"
#include "core/gimp.h"
#include "plug-in/plug-in-proc.h"
#include "widgets/gimpuimanager.h"
#include "file-open-menu.h"
void
file_open_menu_setup (GimpUIManager *manager,
const gchar *ui_path)
{
GSList *list;
guint merge_id;
merge_id = gtk_ui_manager_new_merge_id (GTK_UI_MANAGER (manager));
for (list = manager->gimp->load_procs; list; list = g_slist_next (list))
{
PlugInProcDef *file_proc = list->data;
gchar *path;
if (! strcmp (file_proc->db_info.name, "gimp_xcf_load"))
path = g_strdup_printf ("%s/%s", ui_path, "Internal");
else
path = g_strdup (ui_path);
gtk_ui_manager_add_ui (GTK_UI_MANAGER (manager), merge_id,
path,
file_proc->db_info.name,
file_proc->db_info.name,
GTK_UI_MANAGER_MENUITEM,
FALSE);
g_free (path);
}
}
/* The GIMP -- an open 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.
*/
#ifndef __FILE_OPEN_MENU_H__
#define __FILE_OPEN_MENU_H__
void file_open_menu_setup (GimpUIManager *manager,
const gchar *ui_path);
#endif /* __FILE_OPEN_MENU_H__ */
/* 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 <string.h>
#include <gtk/gtk.h>
#include "gui-types.h"
#include "core/gimp.h"
#include "plug-in/plug-in-proc.h"
#include "widgets/gimpuimanager.h"
#include "file-save-menu.h"
void
file_save_menu_setup (GimpUIManager *manager,
const gchar *ui_path)
{
GSList *list;
guint merge_id;
merge_id = gtk_ui_manager_new_merge_id (GTK_UI_MANAGER (manager));
for (list = manager->gimp->save_procs; list; list = g_slist_next (list))
{
PlugInProcDef *file_proc = list->data;
gchar *path;
if (! strcmp (file_proc->db_info.name, "gimp_xcf_save"))
path = g_strdup_printf ("%s/%s", ui_path, "Internal");
else
path = g_strdup (ui_path);
gtk_ui_manager_add_ui (GTK_UI_MANAGER (manager), merge_id,
path,
file_proc->db_info.name,
file_proc->db_info.name,
GTK_UI_MANAGER_MENUITEM,
FALSE);
g_free (path);
}
}
/* The GIMP -- an open 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.
*/
#ifndef __FILE_SAVE_MENU_H__
#define __FILE_SAVE_MENU_H__
void file_save_menu_setup (GimpUIManager *manager,
const gchar *ui_path);
#endif /* __FILE_SAVE_MENU_H__ */
......@@ -37,8 +37,9 @@
#include "widgets/gimpcontainertreeview.h"
#include "widgets/gimphelp-ids.h"
#include "menus/menus.h"
#include "dialogs-constructors.h"
#include "menus.h"
#include "font-select.h"
#include "gimp-intl.h"
......
......@@ -39,9 +39,10 @@
#include "widgets/gimpdatafactoryview.h"
#include "widgets/gimphelp-ids.h"
#include "menus/menus.h"
#include "dialogs-constructors.h"
#include "gradient-select.h"
#include "menus.h"
#include "gimp-intl.h"
......
......@@ -48,14 +48,15 @@
#include "actions/plug-in-actions.h"
#include "menus/menus.h"
#include "menus/plug-in-menus.h"
#include "brush-select.h"
#include "dialogs.h"
#include "font-select.h"
#include "gradient-select.h"
#include "menus.h"
#include "palette-select.h"
#include "pattern-select.h"
#include "plug-in-menus.h"
#include "themes.h"
......
......@@ -58,11 +58,12 @@
#include "actions/actions.h"
#include "actions/dialogs-commands.h"
#include "menus/menus.h"
#include "color-history.h"
#include "dialogs.h"
#include "gui.h"
#include "gui-vtable.h"
#include "menus.h"
#include "session.h"
#include "splash.h"
#include "themes.h"
......
/* 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 "gui-types.h"
#include "image-menu.h"
#include "menus.h"
#include "plug-in-menus.h"
void
image_menu_setup (GimpUIManager *manager,
const gchar *ui_path)
{
menus_open_recent_add (manager, ui_path);
plug_in_menus_setup (manager, ui_path);
}
/* 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 "libgimpbase/gimpbase.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "config/gimpguiconfig.h"
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "file/file-utils.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpmenufactory.h"
#include "widgets/gimpuimanager.h"
#include "actions/actions.h"
#include "file-open-menu.h"
#include "file-save-menu.h"
#include "image-menu.h"
#include "menus.h"
#include "tool-options-menu.h"
#include "toolbox-menu.h"
#include "gimp-intl.h"
/* local function prototypes */
static void menu_can_change_accels (GimpGuiConfig *config);
/* global variables */
GimpMenuFactory *global_menu_factory = NULL;
/* private variables */
static gboolean menus_initialized = FALSE;
/* public functions */
void
menus_init (Gimp *gimp)
{
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (menus_initialized == FALSE);
menus_initialized = TRUE;
/* We need to make sure the property is installed before using it */
g_type_class_ref (GTK_TYPE_MENU);
menu_can_change_accels (GIMP_GUI_CONFIG (gimp->config));
g_signal_connect (gimp->config, "notify::can-change-accels",
G_CALLBACK (menu_can_change_accels), NULL);
global_menu_factory = gimp_menu_factory_new (gimp, global_action_factory);
gimp_menu_factory_manager_register (global_menu_factory, "<Image>",
"file",
"debug",
"help",
"edit",
"select",
"view",
"image",
"drawable",
"layers",
"channels",
"vectors",
"tools",
"dialogs",
"plug-in",
"qmask",
NULL,
"/toolbox-menubar",
"toolbox-menu.xml", toolbox_menu_setup,
"/image-menubar",
"image-menu.xml", image_menu_setup,
"/image-popup",
"image-menu.xml", image_menu_setup,
"/qmask-popup",
"qmask-menu.xml", NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Dock>",
"file",
"edit",
"select",
"image",
"drawable",
"layers",
"channels",
"vectors",
"tools",
"dialogs",
"plug-in",
"qmask",
NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Load>",
"file-open",
NULL,
"/file-open-popup",
"file-open-menu.xml",
file_open_menu_setup,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Save>",
"file-save",
NULL,
"/file-save-popup",
"file-save-menu.xml",
file_save_menu_setup,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Layers>",
"layers",
NULL,
"/layers-popup",
"layers-menu.xml", NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Channels>",
"channels",
NULL,
"/channels-popup",
"channels-menu.xml", NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Vectors>",
"vectors",
NULL,
"/vectors-popup",
"vectors-menu.xml", NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Dockable>",
"dockable",
NULL,
"/dockable-popup",
"dockable-menu.xml", NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Brushes>",
"brushes",
NULL,
"/brushes-popup",
"brushes-menu.xml", NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Patterns>",
"patterns",
NULL,
"/patterns-popup",
"patterns-menu.xml", NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Gradients>",
"gradients",
NULL,
"/gradients-popup",
"gradients-menu.xml", NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Palettes>",
"palettes",
NULL,
"/palettes-popup",
"palettes-menu.xml", NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Fonts>",
"fonts",
NULL,
"/fonts-popup",
"fonts-menu.xml", NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Buffers>",
"buffers",
NULL,
"/buffers-popup",
"buffers-menu.xml", NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Documents>",
"documents",
NULL,
"/documents-popup",
"documents-menu.xml", NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Templates>",
"templates",
NULL,
"/templates-popup",
"templates-menu.xml", NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Images>",
"images",
NULL,
"/images-popup",
"images-menu.xml", NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<GradientEditor>",
"gradient-editor",
NULL,
"/gradient-editor-popup",
"gradient-editor-menu.xml", NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<PaletteEditor>",
"palette-editor",
NULL,
"/palette-editor-popup",
"palette-editor-menu.xml", NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<ColormapEditor>",
"colormap-editor",
NULL,
"/colormap-editor-popup",
"colormap-editor-menu.xml", NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<ErrorConsole>",
"error-console",
NULL,
"/error-console-popup",
"error-console-menu.xml", NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<ToolOptions>",
"tool-options",
NULL,
"/tool-options-popup",
"tool-options-menu.xml",
tool_options_menu_setup,
NULL);
}
void
menus_exit (Gimp *gimp)
{
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_object_unref (global_menu_factory);
global_menu_factory = NULL;
g_signal_handlers_disconnect_by_func (gimp->config,
menu_can_change_accels,
NULL);
}
void
menus_restore (Gimp *gimp)
{
gchar *filename;
g_return_if_fail (GIMP_IS_GIMP (gimp));
filename = gimp_personal_rc_file ("menurc");
gtk_accel_map_load (filename);
g_free (filename);
}
void
menus_save (Gimp *gimp)
{
gchar *filename;
g_return_if_fail (GIMP_IS_GIMP (gimp));
filename = gimp_personal_rc_file ("menurc");
gtk_accel_map_save (filename);
g_free (filename);
}
void
menus_clear (Gimp *gimp)
{
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_print ("TODO: implement menus_clear()\n");
}