Commit 6f29b766 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/gui/brushes-menu.[ch] app/gui/buffers-menu.[ch]

2003-01-13  Michael Natterer  <mitch@gimp.org>

	* app/gui/brushes-menu.[ch]
	* app/gui/buffers-menu.[ch]
	* app/gui/channels-menu.[ch]
	* app/gui/colormap-editor-menu.[ch]
	* app/gui/dialogs-menu.[ch]
	* app/gui/documents-menu.[ch]
	* app/gui/file-open-menu.[ch]
	* app/gui/file-save-menu.[ch]
	* app/gui/gradient-editor-menu.[ch]
	* app/gui/gradients-menu.[ch]
	* app/gui/image-menu.[ch]
	* app/gui/images-menu.[ch]
	* app/gui/layers-menu.[ch]
	* app/gui/palette-editor-menu.[ch]
	* app/gui/palettes-menu.[ch]
	* app/gui/patterns-menu.[ch]
	* app/gui/qmask-menu.[ch]
	* app/gui/toolbox-menu.[ch]
	* app/gui/vectors-menu.[ch]: new files, one per GimpItemFactory,
	containing the menu entries and their setup and update funcs.

	* app/gui/brushes-commands.[ch]
	* app/gui/patterns-commands.[ch]: removed because they contained
	only update funcs.

	* app/gui/Makefile.am: changed accordingly. Split the huge
	SOURCES list in smaller ones for menus and dialogs.

	* app/gui/menus.[ch]: removed the menu entries and setup funcs.
	Added MENU_SEPARATOR() and MENU_BRANCH() macros to the header.
	Made some utility functions public.

	* app/display/gimpdisplayshell.[ch]
	* app/gui/buffers-commands.[ch]
	* app/gui/channels-commands.[ch]
	* app/gui/colormap-editor-commands.[ch]
	* app/gui/dialogs-commands.[ch]
	* app/gui/documents-commands.[ch]
	* app/gui/gradient-editor-commands.[ch]
	* app/gui/gradients-commands.[ch]
	* app/gui/images-commands.[ch]
	* app/gui/layers-commands.[ch]
	* app/gui/palette-editor-commands.[ch]
	* app/gui/palettes-commands.[ch]
	* app/gui/qmask-commands.[ch]
	* app/gui/vectors-commands.[ch]: removed the update funcs.

	* app/gui/plug-in-menus.[ch]: renamed plug_in_set_menu_sensitivity()
	to plug_in_menus_update(). Cleanup.

	* app/gui/paths-dialog.[ch]: added the <Paths> entries here
	so they will go away together with these files.

	* app/gui/dialogs-constructors.c
	* app/gui/drawable-commands.c: removed useless #includes.
parent 2e591534
2003-01-13 Michael Natterer <mitch@gimp.org>
* app/gui/brushes-menu.[ch]
* app/gui/buffers-menu.[ch]
* app/gui/channels-menu.[ch]
* app/gui/colormap-editor-menu.[ch]
* app/gui/dialogs-menu.[ch]
* app/gui/documents-menu.[ch]
* app/gui/file-open-menu.[ch]
* app/gui/file-save-menu.[ch]
* app/gui/gradient-editor-menu.[ch]
* app/gui/gradients-menu.[ch]
* app/gui/image-menu.[ch]
* app/gui/images-menu.[ch]
* app/gui/layers-menu.[ch]
* app/gui/palette-editor-menu.[ch]
* app/gui/palettes-menu.[ch]
* app/gui/patterns-menu.[ch]
* app/gui/qmask-menu.[ch]
* app/gui/toolbox-menu.[ch]
* app/gui/vectors-menu.[ch]: new files, one per GimpItemFactory,
containing the menu entries and their setup and update funcs.
* app/gui/brushes-commands.[ch]
* app/gui/patterns-commands.[ch]: removed because they contained
only update funcs.
* app/gui/Makefile.am: changed accordingly. Split the huge
SOURCES list in smaller ones for menus and dialogs.
* app/gui/menus.[ch]: removed the menu entries and setup funcs.
Added MENU_SEPARATOR() and MENU_BRANCH() macros to the header.
Made some utility functions public.
* app/display/gimpdisplayshell.[ch]
* app/gui/buffers-commands.[ch]
* app/gui/channels-commands.[ch]
* app/gui/colormap-editor-commands.[ch]
* app/gui/dialogs-commands.[ch]
* app/gui/documents-commands.[ch]
* app/gui/gradient-editor-commands.[ch]
* app/gui/gradients-commands.[ch]
* app/gui/images-commands.[ch]
* app/gui/layers-commands.[ch]
* app/gui/palette-editor-commands.[ch]
* app/gui/palettes-commands.[ch]
* app/gui/qmask-commands.[ch]
* app/gui/vectors-commands.[ch]: removed the update funcs.
* app/gui/plug-in-menus.[ch]: renamed plug_in_set_menu_sensitivity()
to plug_in_menus_update(). Cleanup.
* app/gui/paths-dialog.[ch]: added the <Paths> entries here
so they will go away together with these files.
* app/gui/dialogs-constructors.c
* app/gui/drawable-commands.c: removed useless #includes.
2003-01-13 Sven Neumann <sven@gimp.org> 2003-01-13 Sven Neumann <sven@gimp.org>
Changed my mind again and decided that gimpconfig-dump should Changed my mind again and decided that gimpconfig-dump should
......
...@@ -20,18 +20,9 @@ ...@@ -20,18 +20,9 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h" #include "gui-types.h"
#include "core/gimpbuffer.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "widgets/gimpbufferview.h" #include "widgets/gimpbufferview.h"
#include "widgets/gimpcontainerlistview.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimplistitem.h"
#include "buffers-commands.h" #include "buffers-commands.h"
...@@ -83,25 +74,3 @@ buffers_delete_buffer_cmd_callback (GtkWidget *widget, ...@@ -83,25 +74,3 @@ buffers_delete_buffer_cmd_callback (GtkWidget *widget,
gtk_button_clicked (GTK_BUTTON (view->delete_button)); gtk_button_clicked (GTK_BUTTON (view->delete_button));
} }
void
buffers_menu_update (GtkItemFactory *factory,
gpointer data)
{
GimpContainerEditor *editor;
GimpBuffer *buffer;
editor = GIMP_CONTAINER_EDITOR (data);
buffer = gimp_context_get_buffer (editor->view->context);
#define SET_SENSITIVE(menu,condition) \
gimp_item_factory_set_sensitive (factory, menu, (condition) != 0)
SET_SENSITIVE ("/Paste Buffer", buffer);
SET_SENSITIVE ("/Paste Buffer Into", buffer);
SET_SENSITIVE ("/Paste Buffer as New", buffer);
SET_SENSITIVE ("/Delete Buffer", buffer);
#undef SET_SENSITIVE
}
...@@ -29,8 +29,5 @@ void buffers_paste_buffer_as_new_cmd_callback (GtkWidget *widget, ...@@ -29,8 +29,5 @@ void buffers_paste_buffer_as_new_cmd_callback (GtkWidget *widget,
void buffers_delete_buffer_cmd_callback (GtkWidget *widget, void buffers_delete_buffer_cmd_callback (GtkWidget *widget,
gpointer data); gpointer data);
void buffers_menu_update (GtkItemFactory *factory,
gpointer data);
#endif /* __BUFFERS_COMMANDS_H__ */ #endif /* __BUFFERS_COMMANDS_H__ */
...@@ -33,10 +33,8 @@ ...@@ -33,10 +33,8 @@
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "core/gimpimage-mask.h" #include "core/gimpimage-mask.h"
#include "core/gimpimage-mask-select.h" #include "core/gimpimage-mask-select.h"
#include "core/gimplist.h"
#include "widgets/gimpcolorpanel.h" #include "widgets/gimpcolorpanel.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpitemlistview.h" #include "widgets/gimpitemlistview.h"
#include "widgets/gimpviewabledialog.h" #include "widgets/gimpviewabledialog.h"
...@@ -539,52 +537,6 @@ channels_edit_channel_query (GimpChannel *channel) ...@@ -539,52 +537,6 @@ channels_edit_channel_query (GimpChannel *channel)
gtk_widget_show (options->query_box); gtk_widget_show (options->query_box);
} }
void
channels_menu_update (GtkItemFactory *factory,
gpointer data)
{
GimpImage *gimage;
GimpChannel *channel;
gboolean fs;
GList *list;
GList *next = NULL;
GList *prev = NULL;
gimage = GIMP_ITEM_LIST_VIEW (data)->gimage;
channel = gimp_image_get_active_channel (gimage);
fs = (gimp_image_floating_sel (gimage) != NULL);
for (list = GIMP_LIST (gimage->channels)->list;
list;
list = g_list_next (list))
{
if (channel == (GimpChannel *) list->data)
{
prev = g_list_previous (list);
next = g_list_next (list);
break;
}
}
#define SET_SENSITIVE(menu,condition) \
gimp_item_factory_set_sensitive (factory, menu, (condition) != 0)
SET_SENSITIVE ("/New Channel...", !fs);
SET_SENSITIVE ("/Raise Channel", !fs && channel && prev);
SET_SENSITIVE ("/Lower Channel", !fs && channel && next);
SET_SENSITIVE ("/Duplicate Channel", !fs && channel);
SET_SENSITIVE ("/Channel to Selection", !fs && channel);
SET_SENSITIVE ("/Add to Selection", !fs && channel);
SET_SENSITIVE ("/Subtract from Selection", !fs && channel);
SET_SENSITIVE ("/Intersect with Selection", !fs && channel);
SET_SENSITIVE ("/Delete Channel", !fs && channel);
SET_SENSITIVE ("/Edit Channel Attributes...", !fs && channel);
#undef SET_SENSITIVE
}
/* private functions */ /* private functions */
......
...@@ -46,8 +46,5 @@ void channels_new_channel_query (GimpImage *gimage, ...@@ -46,8 +46,5 @@ void channels_new_channel_query (GimpImage *gimage,
gboolean interactive); gboolean interactive);
void channels_edit_channel_query (GimpChannel *channel); void channels_edit_channel_query (GimpChannel *channel);
void channels_menu_update (GtkItemFactory *factory,
gpointer data);
#endif /* __CHANNELS_COMMANDS_H__ */ #endif /* __CHANNELS_COMMANDS_H__ */
...@@ -27,11 +27,9 @@ ...@@ -27,11 +27,9 @@
#include "gui-types.h" #include "gui-types.h"
#include "core/gimp.h"
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "widgets/gimpcolormapeditor.h" #include "widgets/gimpcolormapeditor.h"
#include "widgets/gimpitemfactory.h"
#include "color-notebook.h" #include "color-notebook.h"
#include "colormap-editor-commands.h" #include "colormap-editor-commands.h"
...@@ -115,32 +113,6 @@ colormap_editor_edit_color_cmd_callback (GtkWidget *widget, ...@@ -115,32 +113,6 @@ colormap_editor_edit_color_cmd_callback (GtkWidget *widget,
} }
} }
void
colormap_editor_menu_update (GtkItemFactory *factory,
gpointer data)
{
GimpColormapEditor *editor;
GimpImage *gimage;
gint num_colors = 0;
editor = GIMP_COLORMAP_EDITOR (data);
gimage = editor->gimage;
if (gimage)
{
num_colors = gimage->num_cols;
}
#define SET_SENSITIVE(menu,condition) \
gimp_item_factory_set_sensitive (factory, menu, (condition) != 0)
SET_SENSITIVE ("/Add Color", gimage && num_colors < 256);
SET_SENSITIVE ("/Edit Color...", gimage);
#undef SET_SENSITIVE
}
/* private functions */ /* private functions */
......
...@@ -27,8 +27,5 @@ void colormap_editor_edit_color_cmd_callback (GtkWidget *widget, ...@@ -27,8 +27,5 @@ void colormap_editor_edit_color_cmd_callback (GtkWidget *widget,
gpointer data, gpointer data,
guint action); guint action);
void colormap_editor_menu_update (GtkItemFactory *factory,
gpointer data);
#endif /* __COLORMAP_EDITOR_COMMANDS_H__ */ #endif /* __COLORMAP_EDITOR_COMMANDS_H__ */
...@@ -27,11 +27,9 @@ ...@@ -27,11 +27,9 @@
#include "gui-types.h" #include "gui-types.h"
#include "core/gimp.h"
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "widgets/gimpcolormapeditor.h" #include "widgets/gimpcolormapeditor.h"
#include "widgets/gimpitemfactory.h"
#include "color-notebook.h" #include "color-notebook.h"
#include "colormap-editor-commands.h" #include "colormap-editor-commands.h"
...@@ -115,32 +113,6 @@ colormap_editor_edit_color_cmd_callback (GtkWidget *widget, ...@@ -115,32 +113,6 @@ colormap_editor_edit_color_cmd_callback (GtkWidget *widget,
} }
} }
void
colormap_editor_menu_update (GtkItemFactory *factory,
gpointer data)
{
GimpColormapEditor *editor;
GimpImage *gimage;
gint num_colors = 0;
editor = GIMP_COLORMAP_EDITOR (data);
gimage = editor->gimage;
if (gimage)
{
num_colors = gimage->num_cols;
}
#define SET_SENSITIVE(menu,condition) \
gimp_item_factory_set_sensitive (factory, menu, (condition) != 0)
SET_SENSITIVE ("/Add Color", gimage && num_colors < 256);
SET_SENSITIVE ("/Edit Color...", gimage);
#undef SET_SENSITIVE
}
/* private functions */ /* private functions */
......
...@@ -27,8 +27,5 @@ void colormap_editor_edit_color_cmd_callback (GtkWidget *widget, ...@@ -27,8 +27,5 @@ void colormap_editor_edit_color_cmd_callback (GtkWidget *widget,
gpointer data, gpointer data,
guint action); guint action);
void colormap_editor_menu_update (GtkItemFactory *factory,
gpointer data);
#endif /* __COLORMAP_EDITOR_COMMANDS_H__ */ #endif /* __COLORMAP_EDITOR_COMMANDS_H__ */
...@@ -24,15 +24,12 @@ ...@@ -24,15 +24,12 @@
#include "gui-types.h" #include "gui-types.h"
#include "core/gimpcontext.h"
#include "widgets/gimpcontainerview.h" #include "widgets/gimpcontainerview.h"
#include "widgets/gimpcontainerview-utils.h" #include "widgets/gimpcontainerview-utils.h"
#include "widgets/gimpdialogfactory.h" #include "widgets/gimpdialogfactory.h"
#include "widgets/gimpdockable.h" #include "widgets/gimpdockable.h"
#include "widgets/gimpdockbook.h" #include "widgets/gimpdockbook.h"
#include "widgets/gimpimagedock.h" #include "widgets/gimpimagedock.h"
#include "widgets/gimpitemfactory.h"
#include "dialogs.h" #include "dialogs.h"
#include "dialogs-commands.h" #include "dialogs-commands.h"
...@@ -398,151 +395,3 @@ dialogs_show_toolbox (void) ...@@ -398,151 +395,3 @@ dialogs_show_toolbox (void)
} }
} }
} }
void
dialogs_menu_update (GtkItemFactory *factory,
gpointer data)
{
GimpDockbook *dockbook;
dockbook = GIMP_DOCKBOOK (data);
if (dockbook)
{
GimpDockable *dockable;
gint page_num;
GimpDialogFactoryEntry *entry;
GimpContainerView *view;
GimpViewType view_type = -1;
gboolean other_view_type = FALSE;
GimpPreviewSize preview_size = GIMP_PREVIEW_SIZE_NONE;
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (dockbook));
dockable = (GimpDockable *)
gtk_notebook_get_nth_page (GTK_NOTEBOOK (dockbook), page_num);
entry = g_object_get_data (G_OBJECT (dockable),
"gimp-dialog-factory-entry");
if (entry)
{
gchar *identifier;
gchar *substring = NULL;
identifier = g_strdup (entry->identifier);
if ((substring = strstr (identifier, "grid")))
view_type = GIMP_VIEW_TYPE_GRID;
else if ((substring = strstr (identifier, "list")))
view_type = GIMP_VIEW_TYPE_LIST;
if (substring)
{
if (view_type == GIMP_VIEW_TYPE_GRID)
memcpy (substring, "list", 4);
else if (view_type == GIMP_VIEW_TYPE_LIST)
memcpy (substring, "grid", 4);
if (gimp_dialog_factory_find_entry (dockbook->dock->dialog_factory,
identifier))
other_view_type = TRUE;
}
g_free (identifier);
}
view = gimp_container_view_get_by_dockable (dockable);
if (view)
preview_size = view->preview_size;
#define SET_ACTIVE(path,active) \
gimp_item_factory_set_active (factory, (path), (active))
#define SET_VISIBLE(path,active) \
gimp_item_factory_set_visible (factory, (path), (active))
#define SET_SENSITIVE(path,sensitive) \
gimp_item_factory_set_sensitive (factory, (path), (sensitive))
SET_VISIBLE ("/view-type-separator",
preview_size != GIMP_PREVIEW_SIZE_NONE || view_type != -1);
SET_VISIBLE ("/Preview Size", preview_size != GIMP_PREVIEW_SIZE_NONE);
if (preview_size != GIMP_PREVIEW_SIZE_NONE)
{
if (preview_size >= GIMP_PREVIEW_SIZE_GIGANTIC)
{
SET_ACTIVE ("/Preview Size/Gigantic", TRUE);
}
else if (preview_size >= GIMP_PREVIEW_SIZE_ENORMOUS)
{
SET_ACTIVE ("/Preview Size/Enormous", TRUE);
}
else if (preview_size >= GIMP_PREVIEW_SIZE_HUGE)
{
SET_ACTIVE ("/Preview Size/Huge", TRUE);
}
else if (preview_size >= GIMP_PREVIEW_SIZE_EXTRA_LARGE)
{
SET_ACTIVE ("/Preview Size/Extra Large", TRUE);
}
else if (preview_size >= GIMP_PREVIEW_SIZE_LARGE)
{
SET_ACTIVE ("/Preview Size/Large", TRUE);
}
else if (preview_size >= GIMP_PREVIEW_SIZE_MEDIUM)
{
SET_ACTIVE ("/Preview Size/Medium", TRUE);
}
else if (preview_size >= GIMP_PREVIEW_SIZE_SMALL)
{
SET_ACTIVE ("/Preview Size/Small", TRUE);
}
else if (preview_size >= GIMP_PREVIEW_SIZE_EXTRA_SMALL)
{
SET_ACTIVE ("/Preview Size/Extra Small", TRUE);
}
else if (preview_size >= GIMP_PREVIEW_SIZE_TINY)
{
SET_ACTIVE ("/Preview Size/Tiny", TRUE);
}
}
SET_VISIBLE ("/View as Grid", view_type != -1);
SET_VISIBLE ("/View as List", view_type != -1);
if (view_type != -1)
{
if (view_type == GIMP_VIEW_TYPE_LIST)
SET_ACTIVE ("/View as List", TRUE);
else
SET_ACTIVE ("/View as Grid", TRUE);
SET_SENSITIVE ("/View as Grid", other_view_type);
SET_SENSITIVE ("/View as List", other_view_type);
}
if (GIMP_IS_IMAGE_DOCK (dockbook->dock))
{
SET_VISIBLE ("/image-menu-separator", TRUE);
SET_VISIBLE ("/Show Image Menu", TRUE);
SET_VISIBLE ("/Auto Follow Active Image", TRUE);
SET_ACTIVE ("/Show Image Menu",
GIMP_IMAGE_DOCK (dockbook->dock)->show_image_menu);
SET_ACTIVE ("/Auto Follow Active Image",
GIMP_IMAGE_DOCK (dockbook->dock)->auto_follow_active);
}
else
{
SET_VISIBLE ("/image-menu-separator", FALSE);
SET_VISIBLE ("/Show Image Menu", FALSE);
SET_VISIBLE ("/Auto Follow Active Image", FALSE);
}
#undef SET_ACTIVE
#undef SET_VISIBLE
#undef SET_SENSITIVE
}
}
...@@ -60,8 +60,5 @@ void dialogs_create_stuff_cmd_callback (GtkWidget *widget, ...@@ -60,8 +60,5 @@ void dialogs_create_stuff_cmd_callback (GtkWidget *widget,
void dialogs_show_toolbox (void); void dialogs_show_toolbox (void);
void dialogs_menu_update (GtkItemFactory *factory,
gpointer data);
#endif /* __DIALOGS_COMMANDS_H__ */ #endif /* __DIALOGS_COMMANDS_H__ */
...@@ -24,18 +24,10 @@ ...@@ -24,18 +24,10 @@
#include "gui-types.h" #include "gui-types.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpimagefile.h"
#include "widgets/gimpcontainerlistview.h"
#include "widgets/gimpdocumentview.h" #include "widgets/gimpdocumentview.h"
#include "widgets/gimpitemfactory.h"
#include "documents-commands.h" #include "documents-commands.h"
#include "libgimp/gimpintl.h"
/* public functionss */ /* public functionss */
...@@ -120,28 +112,3 @@ documents_delete_dangling_documents_cmd_callback (GtkWidget *widget, ...@@ -120,28 +112,3 @@ documents_delete_dangling_documents_cmd_callback (GtkWidget *widget,
gimp_button_extended_clicked (GIMP_BUTTON (view->refresh_button), gimp_button_extended_clicked (GIMP_BUTTON (view->refresh_button),
GDK_CONTROL_MASK); GDK_CONTROL_MASK);
} }
void
documents_menu_update (GtkItemFactory *factory,
gpointer data)
{
GimpContainerEditor *editor;
GimpImagefile *imagefile;
editor = GIMP_CONTAINER_EDITOR (data);
imagefile = gimp_context_get_imagefile (editor->view->context);
#define SET_SENSITIVE(menu,condition) \
gimp_item_factory_set_sensitive (factory, menu, (condition) != 0)
SET_SENSITIVE ("/Open Image", imagefile);
SET_SENSITIVE ("/Raise or Open Image", imagefile);
SET_SENSITIVE ("/File Open Dialog...", TRUE);
SET_SENSITIVE ("/Remove Entry", imagefile);
SET_SENSITIVE ("/Recreate Preview", imagefile);
SET_SENSITIVE ("/Reload all Previews", imagefile);
SET_SENSITIVE ("/Remove Dangling Entries", imagefile);
#undef SET_SENSITIVE
}
...@@ -35,8 +35,5 @@ void documents_reload_previews_cmd_callback (GtkWidget *widget, ...@@ -35,8 +35,5 @@ void documents_reload_previews_cmd_callback (GtkWidget *widget,
void documents_delete_dangling_documents_cmd_callback (GtkWidget *widget, void documents_delete_dangling_documents_cmd_callback (GtkWidget *widget,
gpointer data); gpointer data);
void documents_menu_update (GtkItemFactory *factory,
gpointer data);
#endif /* __DOCUMENTS_COMMANDS_H__ */ #endif /* __DOCUMENTS_COMMANDS_H__ */
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "core/gimpdrawable-invert.h" #include "core/gimpdrawable-invert.h"
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpitemlistview.h" #include "widgets/gimpitemlistview.h"
#include "display/gimpdisplay.h" #include "display/gimpdisplay.h"
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "core/gimpgradient.h" #include "core/gimpgradient.h"
#include "widgets/gimpgradienteditor.h" #include "widgets/gimpgradienteditor.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpviewabledialog.h" #include "widgets/gimpviewabledialog.h"
#include "color-notebook.h" #include "color-notebook.h"
...@@ -908,227 +907,8 @@ gradient_editor_blend_opacity_cmd_callback (GtkWidget *widget, ...@@ -908,227 +907,8 @@ gradient_editor_blend_opacity_cmd_callback (GtkWidget *widget,
gimp_gradient_editor_update (editor, GRAD_UPDATE_GRADIENT); gimp_gradient_editor_update (editor, GRAD_UPDATE_GRADIENT);
} }
void
gradient_editor_menu_update (GtkItemFactory *factory,
gpointer data)
{
GimpGradientEditor *editor;
GimpContext *user_context;
GimpGradientSegment *left_seg;
GimpGradientSegment *right_seg;
GimpRGB fg;
GimpRGB bg;
gboolean blending_equal = TRUE;
gboolean coloring_equal = TRUE;
gboolean selection;
gboolean delete;
editor = GIMP_GRADIENT_EDITOR (data);
user_context = gimp_get_user_context (GIMP_DATA_EDITOR (editor)->gimp);
if (editor->control_sel_l->prev)
left_seg = editor->control_sel_l->prev;
else
left_seg = gimp_gradient_segment_get_last (editor->control_sel_l);
if (editor->control_sel_r->next)
right_seg = editor->control_sel_r->next;
else
right_seg = gimp_gradient_segment_get_first (editor->control_sel_r);
gimp_context_get_foreground (user_context, &fg);
gimp_context_get_background (user_context, &bg);
{
GimpGradientSegmentType type;
GimpGradientSegmentColor color;
GimpGradientSegment *seg, *aseg;
type = editor->control_sel_l->type;
color = editor->control_sel_l->color;
seg = editor->control_sel_l;
do
{
blending_equal = blending_equal && (seg->type == type);