Commit 653f6999 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

app/widgets/Makefile.am put the whole generic stuff from gui/menus.[ch]

2001-11-27  Michael Natterer  <mitch@gimp.org>

	* app/widgets/Makefile.am
	* app/widgets/gimpitemfactory.[ch]: put the whole generic stuff
	from gui/menus.[ch] here (where generic == less_evil because it at
	least does not depend on particular menu entries).

	* app/gui/menus.[ch]: removed the stuff here. Only the global menu
	definitions and bad hacks to adjust them to our needs left.
	Removed all menus_get_foobar_factory() functions because we can
	use gtk_item_factory_from_path("<FooBar>") all over the place.

	* app/plug_in.c
	* app/display/gimpdisplayshell.c
	* app/gui/brushes-commands.c
	* app/gui/buffers-commands.c
	* app/gui/channels-commands.c
	* app/gui/dialogs.c
	* app/gui/documents-commands.c
	* app/gui/file-dialog-utils.c
	* app/gui/file-open-dialog.c
	* app/gui/file-save-dialog.c
	* app/gui/gradient-editor-commands.c
	* app/gui/gradients-commands.c
	* app/gui/gui.c
	* app/gui/layers-commands.c
	* app/gui/palettes-commands.c
	* app/gui/paths-dialog.c
	* app/gui/patterns-commands.c
	* app/gui/toolbox.c: changed accordingly. None of these files
	except gui/gui.c includes gui/menus.h any more.
parent 09a51f21
2001-11-27 Michael Natterer <mitch@gimp.org>
* app/widgets/Makefile.am
* app/widgets/gimpitemfactory.[ch]: put the whole generic stuff
from gui/menus.[ch] here (where generic == less_evil because it at
least does not depend on particular menu entries).
* app/gui/menus.[ch]: removed the stuff here. Only the global menu
definitions and bad hacks to adjust them to our needs left.
Removed all menus_get_foobar_factory() functions because we can
use gtk_item_factory_from_path("<FooBar>") all over the place.
* app/plug_in.c
* app/display/gimpdisplayshell.c
* app/gui/brushes-commands.c
* app/gui/buffers-commands.c
* app/gui/channels-commands.c
* app/gui/dialogs.c
* app/gui/documents-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-open-dialog.c
* app/gui/file-save-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/gradients-commands.c
* app/gui/gui.c
* app/gui/layers-commands.c
* app/gui/palettes-commands.c
* app/gui/paths-dialog.c
* app/gui/patterns-commands.c
* app/gui/toolbox.c: changed accordingly. None of these files
except gui/gui.c includes gui/menus.h any more.
2001-11-27 Michael Natterer <mitch@gimp.org>
* app/core/gimpcontainer.c: GType is a pointer now, not a guint.
......
......@@ -30,12 +30,12 @@
#include "widgets/gimpbufferview.h"
#include "widgets/gimpcontainerlistview.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimplistitem.h"
#include "widgets/gimppreview.h"
#include "widgets/gimpwidgets-utils.h"
#include "buffers-commands.h"
#include "menus.h"
#include "libgimp/gimpintl.h"
......@@ -110,7 +110,7 @@ buffers_show_context_menu (GimpContainerEditor *editor)
buffers_menu_set_sensitivity (editor);
item_factory = menus_get_buffers_factory ();
item_factory = gtk_item_factory_from_path ("<Buffers>");
gimp_item_factory_popup_with_data (item_factory, editor);
}
......@@ -126,7 +126,7 @@ buffers_menu_set_sensitivity (GimpContainerEditor *editor)
buffer = gimp_context_get_buffer (editor->view->context);
#define SET_SENSITIVE(menu,condition) \
menus_set_sensitive ("<Buffers>/" menu, (condition) != 0)
gimp_menu_item_set_sensitive ("<Buffers>/" menu, (condition) != 0)
SET_SENSITIVE ("Paste Buffer", buffer);
SET_SENSITIVE ("Paste Buffer Into", buffer);
......
......@@ -34,17 +34,21 @@
#include "display/gimpdisplay-foreach.h"
#include "widgets/gimpcolorpanel.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpwidgets-utils.h"
#include "channels-commands.h"
#include "menus.h"
#include "libgimp/gimpintl.h"
/* local function prototypes */
static void channels_menu_set_sensitivity (GimpImage *gimage);
/* public functions */
void
channels_new_channel_cmd_callback (GtkWidget *widget,
gpointer data)
......@@ -594,7 +598,7 @@ channels_show_context_menu (GimpImage *gimage)
channels_menu_set_sensitivity (gimage);
item_factory = menus_get_channels_factory ();
item_factory = gtk_item_factory_from_path ("<Channels>");
gimp_item_factory_popup_with_data (item_factory, gimage);
}
......@@ -629,7 +633,7 @@ channels_menu_set_sensitivity (GimpImage *gimage)
}
#define SET_SENSITIVE(menu,condition) \
menus_set_sensitive ("<Channels>/" menu, (condition) != 0)
gimp_menu_item_set_sensitive ("<Channels>/" menu, (condition) != 0)
SET_SENSITIVE ("New Channel...", !fs);
SET_SENSITIVE ("Raise Channel", !fs && channel && prev);
......
......@@ -30,10 +30,10 @@
#include "widgets/gimpcontainerlistview.h"
#include "widgets/gimpdocumentview.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpwidgets-utils.h"
#include "documents-commands.h"
#include "menus.h"
#include "libgimp/gimpintl.h"
......@@ -125,7 +125,7 @@ documents_show_context_menu (GimpContainerEditor *editor)
documents_menu_set_sensitivity (editor);
item_factory = menus_get_documents_factory ();
item_factory = gtk_item_factory_from_path ("<Documents>");
gimp_item_factory_popup_with_data (item_factory, editor);
}
......@@ -141,7 +141,7 @@ documents_menu_set_sensitivity (GimpContainerEditor *editor)
imagefile = gimp_context_get_imagefile (editor->view->context);
#define SET_SENSITIVE(menu,condition) \
menus_set_sensitive ("<Documents>/" menu, (condition) != 0)
gimp_menu_item_set_sensitive ("<Documents>/" menu, (condition) != 0)
SET_SENSITIVE ("Open Image", imagefile);
SET_SENSITIVE ("Raise or Open Image", imagefile);
......
......@@ -28,12 +28,12 @@
#include "core/gimpcontext.h"
#include "core/gimpgradient.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpwidgets-utils.h"
#include "color-notebook.h"
#include "gradient-editor.h"
#include "gradient-editor-commands.h"
#include "menus.h"
#include "libgimp/gimpintl.h"
......@@ -921,7 +921,7 @@ gradient_editor_show_context_menu (GradientEditor *editor)
gradient_editor_menu_set_sensitivity (editor);
item_factory = menus_get_gradient_editor_factory ();
item_factory = gtk_item_factory_from_path ("<GradientEditor>");
gimp_item_factory_popup_with_data (item_factory, editor);
}
......@@ -981,15 +981,15 @@ gradient_editor_menu_set_sensitivity (GradientEditor *editor)
delete = (editor->control_sel_l->prev || editor->control_sel_r->next);
#define SET_ACTIVE(menu,active) \
menus_set_active ("<GradientEditor>/" menu, (active))
gimp_menu_item_set_active ("<GradientEditor>/" menu, (active))
#define SET_COLOR(menu,color,set_label) \
menus_set_color ("<GradientEditor>/" menu, (color), (set_label))
gimp_menu_item_set_color ("<GradientEditor>/" menu, (color), (set_label))
#define SET_LABEL(menu,label) \
menus_set_label ("<GradientEditor>/" menu, (label))
gimp_menu_item_set_label ("<GradientEditor>/" menu, (label))
#define SET_SENSITIVE(menu,condition) \
menus_set_sensitive ("<GradientEditor>/" menu, (condition) != 0)
gimp_menu_item_set_sensitive ("<GradientEditor>/" menu, (condition) != 0)
#define SET_VISIBLE(menu,condition) \
menus_set_visible ("<GradientEditor>/" menu, (condition) != 0)
gimp_menu_item_set_visible ("<GradientEditor>/" menu, (condition) != 0)
SET_COLOR ("Left Endpoint's Color...",
&editor->control_sel_l->left_color, FALSE);
......
......@@ -31,10 +31,10 @@
#include "widgets/gimpcontainerview.h"
#include "widgets/gimpdatafactoryview.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpwidgets-utils.h"
#include "gradients-commands.h"
#include "menus.h"
#include "libgimp/gimpintl.h"
......@@ -70,7 +70,7 @@ gradients_show_context_menu (GimpContainerEditor *editor)
gradients_menu_set_sensitivity (editor);
item_factory = menus_get_gradients_factory ();
item_factory = gtk_item_factory_from_path ("<Gradients>");
gimp_item_factory_popup_with_data (item_factory, editor);
}
......@@ -86,7 +86,7 @@ gradients_menu_set_sensitivity (GimpContainerEditor *editor)
gradient = gimp_context_get_gradient (editor->view->context);
#define SET_SENSITIVE(menu,condition) \
menus_set_sensitive ("<Gradients>/" menu, (condition) != 0)
gimp_menu_item_set_sensitive ("<Gradients>/" menu, (condition) != 0)
SET_SENSITIVE ("Duplicate Gradient",
gradient && GIMP_DATA_GET_CLASS (gradient)->duplicate);
......
......@@ -39,10 +39,10 @@
#include "display/gimpdisplay-foreach.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpwidgets-utils.h"
#include "layers-commands.h"
#include "menus.h"
#include "resize-dialog.h"
#include "floating_sel.h"
......@@ -1224,7 +1224,7 @@ layers_show_context_menu (GimpImage *gimage)
layers_menu_set_sensitivity (gimage);
item_factory = menus_get_layers_factory ();
item_factory = gtk_item_factory_from_path ("<Layers>");
gimp_item_factory_popup_with_data (item_factory, gimage);
}
......@@ -1278,7 +1278,7 @@ layers_menu_set_sensitivity (GimpImage *gimage)
next_alpha = FALSE;
#define SET_SENSITIVE(menu,condition) \
menus_set_sensitive ("<Layers>/" menu, (condition) != 0)
gimp_menu_item_set_sensitive ("<Layers>/" menu, (condition) != 0)
SET_SENSITIVE ("New Layer...", gimage);
......
......@@ -30,13 +30,13 @@
#include "widgets/gimpcontainerlistview.h"
#include "widgets/gimpdatafactoryview.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimplistitem.h"
#include "widgets/gimppreview.h"
#include "widgets/gimpwidgets-utils.h"
#include "palette-import-dialog.h"
#include "palettes-commands.h"
#include "menus.h"
#include "libgimp/gimpintl.h"
......@@ -87,7 +87,7 @@ palettes_show_context_menu (GimpContainerEditor *editor)
palettes_menu_set_sensitivity (editor);
item_factory = menus_get_palettes_factory ();
item_factory = gtk_item_factory_from_path ("<Palettes>");
gimp_item_factory_popup_with_data (item_factory, editor);
}
......@@ -103,7 +103,7 @@ palettes_menu_set_sensitivity (GimpContainerEditor *editor)
palette = gimp_context_get_palette (editor->view->context);
#define SET_SENSITIVE(menu,condition) \
menus_set_sensitive ("<Palettes>/" menu, (condition) != 0)
gimp_menu_item_set_sensitive ("<Palettes>/" menu, (condition) != 0)
SET_SENSITIVE ("Duplicate Palette",
palette && GIMP_DATA_GET_CLASS (palette)->duplicate);
......
......@@ -96,11 +96,12 @@
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "widgets/gimpitemfactory.h"
#include "display/gimpdisplay.h"
#include "gui/brush-select.h"
#include "gui/gradient-select.h"
#include "gui/menus.h"
#include "gui/pattern-select.h"
#include "app_procs.h"
......@@ -1480,20 +1481,22 @@ plug_in_set_menu_sensitivity (GimpImageType type)
break;
}
menus_set_sensitive (proc_def->menu_path, sensitive);
gimp_menu_item_set_sensitive (proc_def->menu_path, sensitive);
if (last_plug_in && (last_plug_in == &(proc_def->db_info)))
{
menus_set_sensitive ("<Image>/Filters/Repeat Last", sensitive);
menus_set_sensitive ("<Image>/Filters/Re-Show Last", sensitive);
gimp_menu_item_set_sensitive ("<Image>/Filters/Repeat Last",
sensitive);
gimp_menu_item_set_sensitive ("<Image>/Filters/Re-Show Last",
sensitive);
}
}
}
if (!last_plug_in)
{
menus_set_sensitive ("<Image>/Filters/Repeat Last", FALSE);
menus_set_sensitive ("<Image>/Filters/Re-Show Last", FALSE);
gimp_menu_item_set_sensitive ("<Image>/Filters/Repeat Last", FALSE);
gimp_menu_item_set_sensitive ("<Image>/Filters/Re-Show Last", FALSE);
}
}
......@@ -2681,9 +2684,9 @@ plug_in_make_menu_entry (gpointer foo,
entry.help_page = lowercase_page;
entry.description = NULL;
menus_create_item_from_full_path (&entry,
menu_entry->domain,
&menu_entry->proc_def->db_info);
gimp_menu_item_create (&entry,
menu_entry->domain,
&menu_entry->proc_def->db_info);
g_free (menu_entry);
return FALSE;
......@@ -2960,7 +2963,9 @@ plug_in_proc_def_remove (PlugInProcDef *proc_def)
{
/* Destroy the menu item */
if (proc_def->menu_path)
menus_destroy (proc_def->menu_path);
{
gimp_menu_item_destroy (proc_def->menu_path);
}
}
/* Unregister the procedural database entry */
......
......@@ -29,7 +29,6 @@
#include "dialogs.h"
#include "dialogs-constructors.h"
#include "menus.h"
GimpDialogFactory *global_dialog_factory = NULL;
......@@ -101,7 +100,7 @@ dialogs_init (Gimp *gimp)
global_dock_factory = gimp_dialog_factory_new ("dock",
gimp_get_user_context (gimp),
menus_get_dialogs_factory (),
gtk_item_factory_from_path ("<Dialogs>"),
dialogs_dock_new);
for (i = 0; i < G_N_ELEMENTS (toplevel_entries); i++)
......
......@@ -25,7 +25,7 @@
#include "gui-types.h"
#include "menus.h"
#include "widgets/gimpitemfactory.h"
#include "plug_in.h"
......@@ -33,11 +33,11 @@
void
file_dialog_show (GtkWidget *filesel)
{
menus_set_sensitive ("<Toolbox>/File/Open...", FALSE);
menus_set_sensitive ("<Image>/File/Open...", FALSE);
menus_set_sensitive ("<Image>/File/Save", FALSE);
menus_set_sensitive ("<Image>/File/Save as...", FALSE);
menus_set_sensitive ("<Image>/File/Save a Copy as...", FALSE);
gimp_menu_item_set_sensitive ("<Toolbox>/File/Open...", FALSE);
gimp_menu_item_set_sensitive ("<Image>/File/Open...", FALSE);
gimp_menu_item_set_sensitive ("<Image>/File/Save", FALSE);
gimp_menu_item_set_sensitive ("<Image>/File/Save as...", FALSE);
gimp_menu_item_set_sensitive ("<Image>/File/Save a Copy as...", FALSE);
gtk_widget_grab_focus (GTK_FILE_SELECTION (filesel)->selection_entry);
gtk_widget_show (filesel);
......@@ -48,11 +48,11 @@ file_dialog_hide (GtkWidget *filesel)
{
gtk_widget_hide (filesel);
menus_set_sensitive ("<Toolbox>/File/Open...", TRUE);
menus_set_sensitive ("<Image>/File/Open...", TRUE);
menus_set_sensitive ("<Image>/File/Save", TRUE);
menus_set_sensitive ("<Image>/File/Save as...", TRUE);
menus_set_sensitive ("<Image>/File/Save a Copy as...", TRUE);
gimp_menu_item_set_sensitive ("<Toolbox>/File/Open...", TRUE);
gimp_menu_item_set_sensitive ("<Image>/File/Open...", TRUE);
gimp_menu_item_set_sensitive ("<Image>/File/Save", TRUE);
gimp_menu_item_set_sensitive ("<Image>/File/Save as...", TRUE);
gimp_menu_item_set_sensitive ("<Image>/File/Save a Copy as...", TRUE);
/* return TRUE because we are used as "delete_event" handler */
return TRUE;
......@@ -100,7 +100,9 @@ file_dialog_update_menus (GSList *procs,
procs = procs->next;
if (file_proc->db_info.proc_type != GIMP_EXTENSION)
menus_set_sensitive (file_proc->menu_path,
(file_proc->image_types_val & image_type));
{
gimp_menu_item_set_sensitive (file_proc->menu_path,
(file_proc->image_types_val & image_type));
}
}
}
......@@ -51,9 +51,10 @@
#include "file/file-open.h"
#include "file/file-utils.h"
#include "widgets/gimpitemfactory.h"
#include "file-dialog-utils.h"
#include "file-open-dialog.h"
#include "menus.h"
#include "plug_in.h"
#include "undo.h"
......@@ -137,7 +138,7 @@ file_open_dialog_menu_init (Gimp *gimp)
entry.help_page = help_page;
entry.description = NULL;
menus_create_item_from_full_path (&entry, NULL, file_proc);
gimp_menu_item_create (&entry, NULL, file_proc);
}
}
......@@ -241,7 +242,7 @@ file_open_dialog_create (Gimp *gimp)
gtk_box_pack_start (GTK_BOX (hbox), option_menu, FALSE, FALSE, 0);
gtk_widget_show (option_menu);
load_menu = menus_get_load_factory ()->widget;
load_menu = gtk_item_factory_from_path ("<Load>")->widget;
gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), load_menu);
gtk_widget_show (vbox);
......
......@@ -41,9 +41,10 @@
#include "file/file-save.h"
#include "file/file-utils.h"
#include "widgets/gimpitemfactory.h"
#include "file-dialog-utils.h"
#include "file-save-dialog.h"
#include "menus.h"
#include "gimprc.h"
#include "plug_in.h"
......@@ -130,7 +131,7 @@ file_save_dialog_menu_init (Gimp *gimp)
entry.help_page = lowercase_page;
entry.description = NULL;
menus_create_item_from_full_path (&entry, NULL, file_proc);
gimp_menu_item_create (&entry, NULL, file_proc);
}
}
......@@ -311,7 +312,7 @@ file_save_dialog_create (void)
gtk_box_pack_start (GTK_BOX (hbox), option_menu, TRUE, TRUE, 0);
gtk_widget_show (option_menu);
save_menu = menus_get_save_factory ()->widget;
save_menu = gtk_item_factory_from_path ("<Save>")->widget;
gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), save_menu);
gtk_widget_show (frame);
......
......@@ -31,6 +31,7 @@
#include "core/gimp.h"
#include "core/gimpbuffer.h"
#include "core/gimpcontext.h"
#include "core/gimpcontainer.h"
#include "core/gimpimage.h"
#include "core/gimpimage-mask.h"
......@@ -41,10 +42,10 @@
#include "widgets/gimpcolorpanel.h"
#include "widgets/gimpcursor.h"
#include "widgets/gimpdnd.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpwidgets-utils.h"
#include "gui/info-window.h"
#include "gui/menus.h"
#include "tools/tool_manager.h"
......@@ -413,7 +414,7 @@ gimp_display_shell_new (GimpDisplay *gdisp)
GDK_KEY_RELEASE_MASK));
/* the popup menu */
shell->ifactory = menus_get_image_factory ();
shell->ifactory = gtk_item_factory_from_path ("<Image>");
/* The accelerator table for images */
gimp_window_add_accel_group (GTK_WINDOW (shell),
......@@ -909,6 +910,8 @@ gimp_display_shell_set_menu_sensitivity (GimpDisplayShell *shell)
GimpImageType type = -1;
GimpDrawable *drawable = NULL;
GimpLayer *layer = NULL;
GimpRGB fg;
GimpRGB bg;
gboolean fs = FALSE;
gboolean aux = FALSE;
gboolean lm = FALSE;
......@@ -949,12 +952,20 @@ gimp_display_shell_set_menu_sensitivity (GimpDisplayShell *shell)
lnum = gimp_container_num_children (gimage->layers);
}
gimp_context_get_foreground (gimp_get_user_context (gdisp->gimage->gimp),
&fg);
gimp_context_get_background (gimp_get_user_context (gdisp->gimage->gimp),
&bg);
}
#define SET_SENSITIVE(menu,condition) \
menus_set_sensitive ("<Image>/" menu, (condition) != 0)
#define SET_ACTIVE(menu,condition) \
menus_set_active ("<Image>/" menu, (condition) != 0)
gimp_menu_item_set_active ("<Image>/" menu, (condition) != 0)
#define SET_COLOR(menu,color) \
gimp_menu_item_set_color ("<Image>/" menu, (color), FALSE)
#define SET_SENSITIVE(menu,condition) \
gimp_menu_item_set_sensitive ("<Image>/" menu, (condition) != 0)
SET_SENSITIVE ("File/Save", gdisp && drawable);
SET_SENSITIVE ("File/Save as...", gdisp && drawable);
......@@ -989,6 +1000,9 @@ gimp_display_shell_set_menu_sensitivity (GimpDisplayShell *shell)
SET_SENSITIVE ("Edit/Fill with FG Color", lp);
SET_SENSITIVE ("Edit/Fill with BG Color", lp);
SET_SENSITIVE ("Edit/Stroke", lp);
SET_COLOR ("Edit/Fill with FG Color", &fg);
SET_COLOR ("Edit/Fill with BG Color", &bg);
}
SET_SENSITIVE ("Select", gdisp && lp);
......@@ -1074,6 +1088,7 @@ gimp_display_shell_set_menu_sensitivity (GimpDisplayShell *shell)
SET_SENSITIVE ("Script-Fu", gdisp && lp);
#undef SET_ACTIVE
#undef SET_COLOR
#undef SET_SENSITIVE
plug_in_set_menu_sensitivity (type);
......
......@@ -31,6 +31,7 @@
#include "core/gimp.h"
#include "core/gimpbuffer.h"
#include "core/gimpcontext.h"
#include "core/gimpcontainer.h"
#include "core/gimpimage.h"
#include "core/gimpimage-mask.h"
......@@ -41,10 +42,10 @@
#include "widgets/gimpcolorpanel.h"
#include "widgets/gimpcursor.h"
#include "widgets/gimpdnd.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpwidgets-utils.h"
#include "gui/info-window.h"
#include "gui/menus.h"
#include "tools/tool_manager.h"
......@@ -413,7 +414,7 @@ gimp_display_shell_new (GimpDisplay *gdisp)
GDK_KEY_RELEASE_MASK));
/* the popup menu */
shell->ifactory = menus_get_image_factory ();
shell->ifactory = gtk_item_factory_from_path ("<Image>");
/* The accelerator table for images */
gimp_window_add_accel_group (GTK_WINDOW (shell),
......@@ -909,6 +910,8 @@ gimp_display_shell_set_menu_sensitivity (GimpDisplayShell *shell)
GimpImageType type = -1;
GimpDrawable *drawable = NULL;
GimpLayer *layer = NULL;
GimpRGB fg;
GimpRGB bg;
gboolean fs = FALSE;
gboolean aux = FALSE;
gboolean lm = FALSE;
......@@ -949,12 +952,20 @@ gimp_display_shell_set_menu_sensitivity (GimpDisplayShell *shell)
lnum = gimp_container_num_children (gimage->layers);
}
gimp_context_get_foreground (gimp_get_user_context (gdisp->gimage->gimp),
&fg);
gimp_context_get_background (gimp_get_user_context (gdisp->gimage->gimp),
&bg);
}
#define SET_SENSITIVE(menu,condition) \
menus_set_sensitive ("<Image>/" menu, (condition) != 0)
#define SET_ACTIVE(menu,condition) \
menus_set_active ("<Image>/" menu, (condition) != 0)
gimp_menu_item_set_active ("<Image>/" menu, (condition) != 0)
#define SET_COLOR(menu,color) \
gimp_menu_item_set_color ("<Image>/" menu, (color), FALSE)
#define SET_SENSITIVE(menu,condition) \
gimp_menu_item_set_sensitive ("<Image>/" menu, (condition) != 0)
SET_SENSITIVE ("File/Save", gdisp && drawable);
SET_SENSITIVE ("File/Save as...", gdisp && drawable);
......@@ -989,6 +1000,9 @@ gimp_display_shell_set_menu_sensitivity (GimpDisplayShell *shell)
SET_SENSITIVE ("Edit/Fill with FG Color", lp);
SET_SENSITIVE ("Edit/Fill with BG Color", lp);
SET_SENSITIVE ("Edit/Stroke", lp);
SET_COLOR ("Edit/Fill with FG Color", &fg);
SET_COLOR ("Edit/Fill with BG Color", &bg);
}