Got rid of the word "editor" were it was good for nothing but exposing an

2006-11-17  Michael Natterer  <mitch@gimp.org>

	Got rid of the word "editor" were it was good for nothing but
	exposing an implementation detail in public API and installed
	files.  Fixes bug #345251:

	* app/actions/colormap-editor-actions.[ch]
	* app/actions/colormap-editor-commands.[ch]
	* app/actions/sample-point-editor-actions.[ch]
	* app/actions/sample-point-editor-commands.[ch]
	* menus/colormap-editor-menu.xml
	* menus/sample-point-editor-menu.xml
	* menus/selection-editor-menu.xml
	* menus/undo-editor-menu.xml: removed.

	* app/actions/colormap-actions.[ch]
	* app/actions/colormap-commands.[ch]
	* app/actions/sample-points-actions.[ch]
	* app/actions/sample-points-commands.[ch]
	* menus/colormap-menu.xml
	* menus/sample-points-menu.xml
	* menus/selection-menu.xml
	* menus/undo-menu.xml: added.

	* app/actions/Makefile.am
	* menus/Makefile.am
	* app/actions/actions.c
	* app/menus/menus.c
	* app/menus/plug-in-menus.c
	* app/plug-in/gimppluginprocedure.c
	* app/widgets/gimpcolormapeditor.c
	* app/widgets/gimpsamplepointeditor.c
	* app/widgets/gimpselectioneditor.c
	* app/widgets/gimpundoeditor.c
	* plug-ins/common/colormap-remap.c: changed accordingly.
This commit is contained in:
Michael Natterer 2006-11-17 22:07:07 +00:00 committed by Michael Natterer
parent 4ce3fda9e7
commit 02de3076c9
36 changed files with 183 additions and 721 deletions

View File

@ -1,3 +1,39 @@
2006-11-17 Michael Natterer <mitch@gimp.org>
Got rid of the word "editor" were it was good for nothing but
exposing an implementation detail in public API and installed
files. Fixes bug #345251:
* app/actions/colormap-editor-actions.[ch]
* app/actions/colormap-editor-commands.[ch]
* app/actions/sample-point-editor-actions.[ch]
* app/actions/sample-point-editor-commands.[ch]
* menus/colormap-editor-menu.xml
* menus/sample-point-editor-menu.xml
* menus/selection-editor-menu.xml
* menus/undo-editor-menu.xml: removed.
* app/actions/colormap-actions.[ch]
* app/actions/colormap-commands.[ch]
* app/actions/sample-points-actions.[ch]
* app/actions/sample-points-commands.[ch]
* menus/colormap-menu.xml
* menus/sample-points-menu.xml
* menus/selection-menu.xml
* menus/undo-menu.xml: added.
* app/actions/Makefile.am
* menus/Makefile.am
* app/actions/actions.c
* app/menus/menus.c
* app/menus/plug-in-menus.c
* app/plug-in/gimppluginprocedure.c
* app/widgets/gimpcolormapeditor.c
* app/widgets/gimpsamplepointeditor.c
* app/widgets/gimpselectioneditor.c
* app/widgets/gimpundoeditor.c
* plug-ins/common/colormap-remap.c: changed accordingly.
2006-11-17 Michael Natterer <mitch@gimp.org>
* app/file/file-open.c (file_open_profile_apply_rgb): don't pass

View File

@ -19,10 +19,10 @@ libappactions_a_SOURCES = \
channels-actions.h \
channels-commands.c \
channels-commands.h \
colormap-editor-actions.c \
colormap-editor-actions.h \
colormap-editor-commands.c \
colormap-editor-commands.h \
colormap-actions.c \
colormap-actions.h \
colormap-commands.c \
colormap-commands.h \
context-actions.c \
context-actions.h \
context-commands.c \
@ -117,10 +117,10 @@ libappactions_a_SOURCES = \
quick-mask-actions.h \
quick-mask-commands.c \
quick-mask-commands.h \
sample-point-editor-actions.c \
sample-point-editor-actions.h \
sample-point-editor-commands.c \
sample-point-editor-commands.h \
sample-points-actions.c \
sample-points-actions.h \
sample-points-commands.c \
sample-points-commands.h \
select-actions.c \
select-actions.h \
select-commands.c \

View File

@ -51,7 +51,7 @@
#include "brushes-actions.h"
#include "buffers-actions.h"
#include "channels-actions.h"
#include "colormap-editor-actions.h"
#include "colormap-actions.h"
#include "context-actions.h"
#include "cursor-info-actions.h"
#include "debug-actions.h"
@ -75,7 +75,7 @@
#include "patterns-actions.h"
#include "plug-in-actions.h"
#include "quick-mask-actions.h"
#include "sample-point-editor-actions.h"
#include "sample-points-actions.h"
#include "select-actions.h"
#include "templates-actions.h"
#include "text-editor-actions.h"
@ -108,9 +108,9 @@ static GimpActionFactoryEntry action_groups[] =
{ "channels", N_("Channels"), GIMP_STOCK_CHANNEL,
channels_actions_setup,
channels_actions_update },
{ "colormap-editor", N_("Colormap Editor"), GIMP_STOCK_COLORMAP,
colormap_editor_actions_setup,
colormap_editor_actions_update },
{ "colormap", N_("Colormap"), GIMP_STOCK_COLORMAP,
colormap_actions_setup,
colormap_actions_update },
{ "context", N_("Context"), NULL,
context_actions_setup,
context_actions_update },
@ -180,9 +180,9 @@ static GimpActionFactoryEntry action_groups[] =
{ "quick-mask", N_("Quick Mask"), GIMP_STOCK_QUICK_MASK_ON,
quick_mask_actions_setup,
quick_mask_actions_update },
{ "sample-point-editor", N_("Sample Points"), GIMP_STOCK_SAMPLE_POINT,
sample_point_editor_actions_setup,
sample_point_editor_actions_update },
{ "sample-points", N_("Sample Points"), GIMP_STOCK_SAMPLE_POINT,
sample_points_actions_setup,
sample_points_actions_update },
{ "select", N_("Select"), GIMP_STOCK_SELECTION,
select_actions_setup,
select_actions_update },

View File

@ -31,34 +31,34 @@
#include "widgets/gimphelp-ids.h"
#include "actions.h"
#include "colormap-editor-actions.h"
#include "colormap-editor-commands.h"
#include "colormap-actions.h"
#include "colormap-commands.h"
#include "gimp-intl.h"
static const GimpActionEntry colormap_editor_actions[] =
static const GimpActionEntry colormap_actions[] =
{
{ "colormap-editor-popup", GIMP_STOCK_COLORMAP,
{ "colormap-popup", GIMP_STOCK_COLORMAP,
N_("Colormap Menu"), NULL, NULL, NULL,
GIMP_HELP_INDEXED_PALETTE_DIALOG },
{ "colormap-editor-edit-color", GTK_STOCK_EDIT,
{ "colormap-edit-color", GTK_STOCK_EDIT,
N_("_Edit Color..."), NULL,
N_("Edit color"),
G_CALLBACK (colormap_editor_edit_color_cmd_callback),
G_CALLBACK (colormap_edit_color_cmd_callback),
GIMP_HELP_INDEXED_PALETTE_EDIT }
};
static const GimpEnumActionEntry colormap_editor_add_color_actions[] =
static const GimpEnumActionEntry colormap_add_color_actions[] =
{
{ "colormap-editor-add-color-from-fg", GTK_STOCK_ADD,
{ "colormap-add-color-from-fg", GTK_STOCK_ADD,
N_("_Add Color from FG"), "",
N_("Add current foreground color"),
FALSE, FALSE,
GIMP_HELP_INDEXED_PALETTE_ADD },
{ "colormap-editor-add-color-from-bg", GTK_STOCK_ADD,
{ "colormap-add-color-from-bg", GTK_STOCK_ADD,
N_("_Add Color from BG"), "",
N_("Add current background color"),
TRUE, FALSE,
@ -67,23 +67,23 @@ static const GimpEnumActionEntry colormap_editor_add_color_actions[] =
void
colormap_editor_actions_setup (GimpActionGroup *group)
colormap_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
colormap_editor_actions,
G_N_ELEMENTS (colormap_editor_actions));
colormap_actions,
G_N_ELEMENTS (colormap_actions));
gimp_action_group_add_enum_actions (group,
colormap_editor_add_color_actions,
G_N_ELEMENTS (colormap_editor_add_color_actions),
G_CALLBACK (colormap_editor_add_color_cmd_callback));
colormap_add_color_actions,
G_N_ELEMENTS (colormap_add_color_actions),
G_CALLBACK (colormap_add_color_cmd_callback));
}
void
colormap_editor_actions_update (GimpActionGroup *group,
gpointer data)
colormap_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpImage *image = action_data_get_image (data);
GimpImage *image = action_data_get_image (data);
GimpContext *context = action_data_get_context (data);
gboolean indexed = FALSE;
gint num_colors = 0;
@ -107,15 +107,15 @@ colormap_editor_actions_update (GimpActionGroup *group,
#define SET_COLOR(action,color) \
gimp_action_group_set_action_color (group, action, color, FALSE);
SET_SENSITIVE ("colormap-editor-edit-color",
SET_SENSITIVE ("colormap-edit-color",
image && indexed);
SET_SENSITIVE ("colormap-editor-add-color-from-fg",
SET_SENSITIVE ("colormap-add-color-from-fg",
image && indexed && num_colors < 256);
SET_SENSITIVE ("colormap-editor-add-color-from-bg",
SET_SENSITIVE ("colormap-add-color-from-bg",
image && indexed && num_colors < 256);
SET_COLOR ("colormap-editor-add-color-from-fg", context ? &fg : NULL);
SET_COLOR ("colormap-editor-add-color-from-bg", context ? &bg : NULL);
SET_COLOR ("colormap-add-color-from-fg", context ? &fg : NULL);
SET_COLOR ("colormap-add-color-from-bg", context ? &bg : NULL);
#undef SET_SENSITIVE
#undef SET_COLOR

View File

@ -16,13 +16,13 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __COLORMAP_EDITOR_ACTIONS_H__
#define __COLORMAP_EDITOR_ACTIONS_H__
#ifndef __COLORMAP_ACTIONS_H__
#define __COLORMAP_ACTIONS_H__
void colormap_editor_actions_setup (GimpActionGroup *group);
void colormap_editor_actions_update (GimpActionGroup *group,
gpointer data);
void colormap_actions_setup (GimpActionGroup *group);
void colormap_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __COLORMAP_EDITOR_ACTIONS_H__ */
#endif /* __COLORMAP_ACTIONS_H__ */

View File

@ -34,24 +34,24 @@
#include "widgets/gimpdialogfactory.h"
#include "actions.h"
#include "colormap-editor-commands.h"
#include "colormap-commands.h"
#include "gimp-intl.h"
/* local function prototypes */
static void colormap_editor_edit_color_update (GimpColorDialog *dialog,
const GimpRGB *color,
GimpColorDialogState state,
GimpColormapEditor *editor);
static void colormap_edit_color_update (GimpColorDialog *dialog,
const GimpRGB *color,
GimpColorDialogState state,
GimpColormapEditor *editor);
/* public functions */
void
colormap_editor_edit_color_cmd_callback (GtkAction *action,
gpointer data)
colormap_edit_color_cmd_callback (GtkAction *action,
gpointer data)
{
GimpColormapEditor *editor;
GimpImage *image;
@ -88,7 +88,7 @@ colormap_editor_edit_color_cmd_callback (GtkAction *action,
&editor->color_dialog);
g_signal_connect (editor->color_dialog, "update",
G_CALLBACK (colormap_editor_edit_color_update),
G_CALLBACK (colormap_edit_color_update),
editor);
}
else
@ -107,9 +107,9 @@ colormap_editor_edit_color_cmd_callback (GtkAction *action,
}
void
colormap_editor_add_color_cmd_callback (GtkAction *action,
gint value,
gpointer data)
colormap_add_color_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpImage *image;
@ -134,10 +134,10 @@ colormap_editor_add_color_cmd_callback (GtkAction *action,
/* private functions */
static void
colormap_editor_edit_color_update (GimpColorDialog *dialog,
const GimpRGB *color,
GimpColorDialogState state,
GimpColormapEditor *editor)
colormap_edit_color_update (GimpColorDialog *dialog,
const GimpRGB *color,
GimpColorDialogState state,
GimpColormapEditor *editor)
{
GimpImage *image = GIMP_IMAGE_EDITOR (editor)->image;

View File

@ -16,15 +16,15 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __COLORMAP_EDITOR_COMMANDS_H__
#define __COLORMAP_EDITOR_COMMANDS_H__
#ifndef __COLORMAP_COMMANDS_H__
#define __COLORMAP_COMMANDS_H__
void colormap_editor_edit_color_cmd_callback (GtkAction *action,
gpointer data);
void colormap_editor_add_color_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void colormap_edit_color_cmd_callback (GtkAction *action,
gpointer data);
void colormap_add_color_cmd_callback (GtkAction *action,
gint value,
gpointer data);
#endif /* __COLORMAP_EDITOR_COMMANDS_H__ */
#endif /* __COLORMAP_COMMANDS_H__ */

View File

@ -1,122 +0,0 @@
/* 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/gimpcontext.h"
#include "core/gimpimage.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
#include "actions.h"
#include "colormap-editor-actions.h"
#include "colormap-editor-commands.h"
#include "gimp-intl.h"
static const GimpActionEntry colormap_editor_actions[] =
{
{ "colormap-editor-popup", GIMP_STOCK_COLORMAP,
N_("Colormap Menu"), NULL, NULL, NULL,
GIMP_HELP_INDEXED_PALETTE_DIALOG },
{ "colormap-editor-edit-color", GTK_STOCK_EDIT,
N_("_Edit Color..."), NULL,
N_("Edit color"),
G_CALLBACK (colormap_editor_edit_color_cmd_callback),
GIMP_HELP_INDEXED_PALETTE_EDIT }
};
static const GimpEnumActionEntry colormap_editor_add_color_actions[] =
{
{ "colormap-editor-add-color-from-fg", GTK_STOCK_ADD,
N_("_Add Color from FG"), "",
N_("Add current foreground color"),
FALSE, FALSE,
GIMP_HELP_INDEXED_PALETTE_ADD },
{ "colormap-editor-add-color-from-bg", GTK_STOCK_ADD,
N_("_Add Color from BG"), "",
N_("Add current background color"),
TRUE, FALSE,
GIMP_HELP_INDEXED_PALETTE_ADD }
};
void
colormap_editor_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
colormap_editor_actions,
G_N_ELEMENTS (colormap_editor_actions));
gimp_action_group_add_enum_actions (group,
colormap_editor_add_color_actions,
G_N_ELEMENTS (colormap_editor_add_color_actions),
G_CALLBACK (colormap_editor_add_color_cmd_callback));
}
void
colormap_editor_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpImage *image = action_data_get_image (data);
GimpContext *context = action_data_get_context (data);
gboolean indexed = FALSE;
gint num_colors = 0;
GimpRGB fg;
GimpRGB bg;
if (image)
{
indexed = gimp_image_base_type (image) == GIMP_INDEXED;
num_colors = image->num_cols;
}
if (context)
{
gimp_context_get_foreground (context, &fg);
gimp_context_get_background (context, &bg);
}
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
#define SET_COLOR(action,color) \
gimp_action_group_set_action_color (group, action, color, FALSE);
SET_SENSITIVE ("colormap-editor-edit-color",
image && indexed);
SET_SENSITIVE ("colormap-editor-add-color-from-fg",
image && indexed && num_colors < 256);
SET_SENSITIVE ("colormap-editor-add-color-from-bg",
image && indexed && num_colors < 256);
SET_COLOR ("colormap-editor-add-color-from-fg", context ? &fg : NULL);
SET_COLOR ("colormap-editor-add-color-from-bg", context ? &bg : NULL);
#undef SET_SENSITIVE
#undef SET_COLOR
}

View File

@ -1,28 +0,0 @@
/* 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.
*/
#ifndef __COLORMAP_EDITOR_ACTIONS_H__
#define __COLORMAP_EDITOR_ACTIONS_H__
void colormap_editor_actions_setup (GimpActionGroup *group);
void colormap_editor_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __COLORMAP_EDITOR_ACTIONS_H__ */

View File

@ -1,158 +0,0 @@
/* 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 "libgimpcolor/gimpcolor.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimpimage-colormap.h"
#include "widgets/gimpcolordialog.h"
#include "widgets/gimpcolormapeditor.h"
#include "widgets/gimpdialogfactory.h"
#include "actions.h"
#include "colormap-editor-commands.h"
#include "gimp-intl.h"
/* local function prototypes */
static void colormap_editor_edit_color_update (GimpColorDialog *dialog,
const GimpRGB *color,
GimpColorDialogState state,
GimpColormapEditor *editor);
/* public functions */
void
colormap_editor_edit_color_cmd_callback (GtkAction *action,
gpointer data)
{
GimpColormapEditor *editor;
GimpImage *image;
GimpRGB color;
gchar *desc;
return_if_no_image (image, data);
editor = GIMP_COLORMAP_EDITOR (data);
gimp_rgba_set_uchar (&color,
image->cmap[editor->col_index * 3],
image->cmap[editor->col_index * 3 + 1],
image->cmap[editor->col_index * 3 + 2],
OPAQUE_OPACITY);
desc = g_strdup_printf (_("Edit colormap entry #%d"), editor->col_index);
if (! editor->color_dialog)
{
editor->color_dialog =
gimp_color_dialog_new (GIMP_VIEWABLE (image),
action_data_get_context (data),
_("Edit Colormap Entry"),
GIMP_STOCK_COLORMAP,
desc,
GTK_WIDGET (editor),
gimp_dialog_factory_from_name ("toplevel"),
"gimp-colormap-editor-color-dialog",
(const GimpRGB *) &color,
FALSE, FALSE);
g_signal_connect (editor->color_dialog, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&editor->color_dialog);
g_signal_connect (editor->color_dialog, "update",
G_CALLBACK (colormap_editor_edit_color_update),
editor);
}
else
{
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (editor->color_dialog),
GIMP_VIEWABLE (image),
action_data_get_context (data));
g_object_set (editor->color_dialog, "description", desc, NULL);
gimp_color_dialog_set_color (GIMP_COLOR_DIALOG (editor->color_dialog),
&color);
}
g_free (desc);
gtk_window_present (GTK_WINDOW (editor->color_dialog));
}
void
colormap_editor_add_color_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpImage *image;
return_if_no_context (context, data);
return_if_no_image (image, data);
if (image->num_cols < 256)
{
GimpRGB color;
if (value)
gimp_context_get_background (context, &color);
else
gimp_context_get_foreground (context, &color);
gimp_image_add_colormap_entry (image, &color);
gimp_image_flush (image);
}
}
/* private functions */
static void
colormap_editor_edit_color_update (GimpColorDialog *dialog,
const GimpRGB *color,
GimpColorDialogState state,
GimpColormapEditor *editor)
{
GimpImage *image = GIMP_IMAGE_EDITOR (editor)->image;
switch (state)
{
case GIMP_COLOR_DIALOG_UPDATE:
break;
case GIMP_COLOR_DIALOG_OK:
gimp_image_set_colormap_entry (image, editor->col_index, color, TRUE);
gimp_image_flush (image);
/* Fall through */
case GIMP_COLOR_DIALOG_CANCEL:
gtk_widget_hide (editor->color_dialog);
break;
}
}

View File

@ -1,30 +0,0 @@
/* 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.
*/
#ifndef __COLORMAP_EDITOR_COMMANDS_H__
#define __COLORMAP_EDITOR_COMMANDS_H__
void colormap_editor_edit_color_cmd_callback (GtkAction *action,
gpointer data);
void colormap_editor_add_color_cmd_callback (GtkAction *action,
gint value,
gpointer data);
#endif /* __COLORMAP_EDITOR_COMMANDS_H__ */

View File

@ -1,80 +0,0 @@
/* 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 "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpsamplepointeditor.h"
#include "sample-point-editor-actions.h"
#include "sample-point-editor-commands.h"
#include "gimp-intl.h"
static const GimpActionEntry sample_point_editor_actions[] =
{
{ "sample-point-editor-popup", GIMP_STOCK_SAMPLE_POINT,
N_("Sample Point Menu"), NULL, NULL, NULL,
GIMP_HELP_SAMPLE_POINT_DIALOG }
};
static const GimpToggleActionEntry sample_point_editor_toggle_actions[] =
{
{ "sample-point-editor-sample-merged", NULL,
N_("_Sample Merged"), "",
N_("Sample Merged"),
G_CALLBACK (sample_point_editor_sample_merged_cmd_callback),
TRUE,
GIMP_HELP_SAMPLE_POINT_SAMPLE_MERGED }
};
void
sample_point_editor_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
sample_point_editor_actions,
G_N_ELEMENTS (sample_point_editor_actions));
gimp_action_group_add_toggle_actions (group,
sample_point_editor_toggle_actions,
G_N_ELEMENTS (sample_point_editor_toggle_actions));
}
void
sample_point_editor_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpSamplePointEditor *editor = GIMP_SAMPLE_POINT_EDITOR (data);
#define SET_ACTIVE(action,condition) \
gimp_action_group_set_action_active (group, action, (condition) != 0)
SET_ACTIVE ("sample-point-editor-sample-merged",
gimp_sample_point_editor_get_sample_merged (editor));
#undef SET_ACTIVE
}

View File

@ -1,28 +0,0 @@
/* 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.
*/
#ifndef __SAMPLE_POINT_EDITOR_ACIONS_H__
#define __SAMPLE_POINT_EDITOR_ACIONS_H__
void sample_point_editor_actions_setup (GimpActionGroup *group);
void sample_point_editor_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __SAMPLE_POINT_EDITOR_ACTIONS_H__ */

View File

@ -1,48 +0,0 @@
/* 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 "actions-types.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpsamplepointeditor.h"
#include "sample-point-editor-commands.h"
#include "gimp-intl.h"
/* public functions */
void
sample_point_editor_sample_merged_cmd_callback (GtkAction *action,
gpointer data)
{
GimpSamplePointEditor *editor = GIMP_SAMPLE_POINT_EDITOR (data);
gboolean active;
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
gimp_sample_point_editor_set_sample_merged (editor, active);
}

View File

@ -1,27 +0,0 @@
/* 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.
*/
#ifndef __SAMPLE_POINT_EDITOR_COMMANDS_H__
#define __SAMPLE_POINT_EDITOR_COMMANDS_H__
void sample_point_editor_sample_merged_cmd_callback (GtkAction *action,
gpointer data);
#endif /* __SAMPLE_POINT_EDITOR_COMMANDS_H__ */

View File

@ -28,52 +28,52 @@
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpsamplepointeditor.h"
#include "sample-point-editor-actions.h"
#include "sample-point-editor-commands.h"
#include "sample-points-actions.h"
#include "sample-points-commands.h"
#include "gimp-intl.h"
static const GimpActionEntry sample_point_editor_actions[] =
static const GimpActionEntry sample_points_actions[] =
{
{ "sample-point-editor-popup", GIMP_STOCK_SAMPLE_POINT,
{ "sample-points-popup", GIMP_STOCK_SAMPLE_POINT,
N_("Sample Point Menu"), NULL, NULL, NULL,
GIMP_HELP_SAMPLE_POINT_DIALOG }
};
static const GimpToggleActionEntry sample_point_editor_toggle_actions[] =
static const GimpToggleActionEntry sample_points_toggle_actions[] =
{
{ "sample-point-editor-sample-merged", NULL,
{ "sample-points-sample-merged", NULL,
N_("_Sample Merged"), "",
N_("Sample Merged"),
G_CALLBACK (sample_point_editor_sample_merged_cmd_callback),
G_CALLBACK (sample_points_sample_merged_cmd_callback),
TRUE,
GIMP_HELP_SAMPLE_POINT_SAMPLE_MERGED }
};
void
sample_point_editor_actions_setup (GimpActionGroup *group)
sample_points_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
sample_point_editor_actions,
G_N_ELEMENTS (sample_point_editor_actions));
sample_points_actions,
G_N_ELEMENTS (sample_points_actions));
gimp_action_group_add_toggle_actions (group,
sample_point_editor_toggle_actions,
G_N_ELEMENTS (sample_point_editor_toggle_actions));
sample_points_toggle_actions,
G_N_ELEMENTS (sample_points_toggle_actions));
}
void
sample_point_editor_actions_update (GimpActionGroup *group,
gpointer data)
sample_points_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpSamplePointEditor *editor = GIMP_SAMPLE_POINT_EDITOR (data);
#define SET_ACTIVE(action,condition) \
gimp_action_group_set_action_active (group, action, (condition) != 0)
SET_ACTIVE ("sample-point-editor-sample-merged",
SET_ACTIVE ("sample-points-sample-merged",
gimp_sample_point_editor_get_sample_merged (editor));
#undef SET_ACTIVE

View File

@ -16,13 +16,13 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __SAMPLE_POINT_EDITOR_ACIONS_H__
#define __SAMPLE_POINT_EDITOR_ACIONS_H__
#ifndef __SAMPLE_POINTS_ACIONS_H__
#define __SAMPLE_POINTS_ACIONS_H__
void sample_point_editor_actions_setup (GimpActionGroup *group);
void sample_point_editor_actions_update (GimpActionGroup *group,
gpointer data);
void sample_points_actions_setup (GimpActionGroup *group);
void sample_points_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __SAMPLE_POINT_EDITOR_ACTIONS_H__ */
#endif /* __SAMPLE_POINTS_ACTIONS_H__ */

View File

@ -28,7 +28,7 @@
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpsamplepointeditor.h"
#include "sample-point-editor-commands.h"
#include "sample-points-commands.h"
#include "gimp-intl.h"
@ -36,8 +36,8 @@
/* public functions */
void
sample_point_editor_sample_merged_cmd_callback (GtkAction *action,
gpointer data)
sample_points_sample_merged_cmd_callback (GtkAction *action,
gpointer data)
{
GimpSamplePointEditor *editor = GIMP_SAMPLE_POINT_EDITOR (data);
gboolean active;

View File

@ -16,12 +16,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __SAMPLE_POINT_EDITOR_COMMANDS_H__
#define __SAMPLE_POINT_EDITOR_COMMANDS_H__
#ifndef __SAMPLE_POINTS_COMMANDS_H__
#define __SAMPLE_POINTS_COMMANDS_H__
void sample_point_editor_sample_merged_cmd_callback (GtkAction *action,
gpointer data);
void sample_points_sample_merged_cmd_callback (GtkAction *action,
gpointer data);
#endif /* __SAMPLE_POINT_EDITOR_COMMANDS_H__ */
#endif /* __SAMPLE_POINTS_COMMANDS_H__ */

View File

@ -179,6 +179,14 @@ menus_init (Gimp *gimp,
"vectors-menu.xml", plug_in_menus_setup,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Colormap>",
"colormap",
"plug-in",
NULL,
"/colormap-popup",
"colormap-menu.xml", plug_in_menus_setup,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Dockable>",
"dockable",
"dock",
@ -284,20 +292,12 @@ menus_init (Gimp *gimp,
"palette-editor-menu.xml", NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<ColormapEditor>",
"colormap-editor",
"plug-in",
NULL,
"/colormap-editor-popup",
"colormap-editor-menu.xml", plug_in_menus_setup,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<SelectionEditor>",
gimp_menu_factory_manager_register (global_menu_factory, "<Selection>",
"select",
"vectors",
NULL,
"/selection-editor-popup",
"selection-editor-menu.xml", NULL,
"/selection-popup",
"selection-menu.xml", NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<NavigationEditor>",
@ -305,11 +305,11 @@ menus_init (Gimp *gimp,
NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<UndoEditor>",
gimp_menu_factory_manager_register (global_menu_factory, "<Undo>",
"edit",
NULL,
"/undo-editor-popup",
"undo-editor-menu.xml", NULL,
"/undo-popup",
"undo-menu.xml", NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<ErrorConsole>",
@ -343,11 +343,11 @@ menus_init (Gimp *gimp,
NULL,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<SamplePointEditor>",
"sample-point-editor",
gimp_menu_factory_manager_register (global_menu_factory, "<SamplePoints>",
"sample-points",
NULL,
"/sample-point-editor-popup",
"sample-point-editor-menu.xml",
"/sample-points-popup",
"sample-points-menu.xml",
NULL,
NULL);
}

View File

@ -315,9 +315,9 @@ plug_in_menus_menu_path_added (GimpPlugInProcedure *plug_in_proc,
plug_in_menus_add_proc (manager, "/vectors-popup",
plug_in_proc, menu_path);
}
else if (! strcmp (manager->name, "<ColormapEditor>"))
else if (! strcmp (manager->name, "<Colormap>"))
{
plug_in_menus_add_proc (manager, "/colormap-editor-popup",
plug_in_menus_add_proc (manager, "/colormap-popup",
plug_in_proc, menu_path);
}
else if (! strcmp (manager->name, "<Brushes>"))

View File

@ -370,7 +370,7 @@ gimp_plug_in_procedure_add_menu_path (GimpPlugInProcedure *proc,
goto failure;
}
}
else if (g_str_has_prefix (menu_path, "<ColormapEditor>"))
else if (g_str_has_prefix (menu_path, "<Colormap>"))
{
if ((procedure->num_args < 2) ||
! GIMP_IS_PARAM_SPEC_INT32 (procedure->args[0]) ||
@ -435,7 +435,7 @@ gimp_plug_in_procedure_add_menu_path (GimpPlugInProcedure *proc,
"in the invalid menu location \"%s\".\n"
"Use either \"<Toolbox>\", \"<Image>\", "
"\"<Layers>\", \"<Channels>\", \"<Vectors>\", "
"\"<ColormapEditor>\", \"<Load>\", \"<Save>\", "
"\"<Colormap>\", \"<Load>\", \"<Save>\", "
"\"<Brushes>\", \"<Gradients>\", \"<Palettes>\", "
"\"<Patterns>\" or \"<Buffers>\".",
basename, gimp_filename_to_utf8 (proc->prog),

View File

@ -233,14 +233,14 @@ gimp_colormap_editor_constructor (GType type,
editor = GIMP_COLORMAP_EDITOR (object);
editor->edit_button =
gimp_editor_add_action_button (GIMP_EDITOR (editor), "colormap-editor",
"colormap-editor-edit-color",
gimp_editor_add_action_button (GIMP_EDITOR (editor), "colormap",
"colormap-edit-color",
NULL);
editor->add_button =
gimp_editor_add_action_button (GIMP_EDITOR (editor), "colormap-editor",
"colormap-editor-add-color-from-fg",
"colormap-editor-add-color-from-bg",
gimp_editor_add_action_button (GIMP_EDITOR (editor), "colormap",
"colormap-add-color-from-fg",
"colormap-add-color-from-bg",
GDK_CONTROL_MASK,
NULL);
@ -338,8 +338,8 @@ gimp_colormap_editor_new (GimpMenuFactory *menu_factory)
return g_object_new (GIMP_TYPE_COLORMAP_EDITOR,
"menu-factory", menu_factory,
"menu-identifier", "<ColormapEditor>",
"ui-path", "/colormap-editor-popup",
"menu-identifier", "<Colormap>",
"ui-path", "/colormap-popup",
NULL);
}
@ -719,8 +719,8 @@ gimp_colormap_preview_button_press (GtkWidget *widget,
GtkAction *action;
action = gimp_ui_manager_find_action (GIMP_EDITOR (editor)->ui_manager,
"colormap-editor",
"colormap-editor-edit-color");
"colormap",
"colormap-edit-color");
if (action)
gtk_action_activate (action);

View File

@ -305,8 +305,8 @@ gimp_sample_point_editor_new (GimpMenuFactory *menu_factory)
return g_object_new (GIMP_TYPE_SAMPLE_POINT_EDITOR,
"menu-factory", menu_factory,
"menu-identifier", "<SamplePointEditor>",
"ui-path", "/sample-point-editor-popup",
"menu-identifier", "<SamplePoints>",
"ui-path", "/sample-points-popup",
NULL);
}

View File

@ -241,8 +241,8 @@ gimp_selection_editor_new (GimpMenuFactory *menu_factory)
return g_object_new (GIMP_TYPE_SELECTION_EDITOR,
"menu-factory", menu_factory,
"menu-identifier", "<SelectionEditor>",
"ui-path", "/selection-editor-popup",
"menu-identifier", "<Selection>",
"ui-path", "/selection-popup",
NULL);
}

View File

@ -242,8 +242,8 @@ gimp_undo_editor_new (GimpCoreConfig *config,
return g_object_new (GIMP_TYPE_UNDO_EDITOR,
"menu-factory", menu_factory,
"menu-identifier", "<UndoEditor>",
"ui-path", "/undo-editor-popup",
"menu-identifier", "<Undo>",
"ui-path", "/undo-popup",
"view-size", config->undo_preview_size,
NULL);
}

View File

@ -15,7 +15,7 @@ menudata_DATA = \
brushes-menu.xml \
buffers-menu.xml \
channels-menu.xml \
colormap-editor-menu.xml \
colormap-menu.xml \
cursor-info-menu.xml \
documents-menu.xml \
error-console-menu.xml \
@ -28,13 +28,13 @@ menudata_DATA = \
palettes-menu.xml \
patterns-menu.xml \
quick-mask-menu.xml \
sample-point-editor-menu.xml \
selection-editor-menu.xml \
sample-points-menu.xml \
selection-menu.xml \
templates-menu.xml \
text-editor-toolbar.xml \
tool-options-menu.xml \
tools-menu.xml \
undo-editor-menu.xml \
undo-menu.xml \
vectors-menu.xml
EXTRA_DIST = \

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE ui SYSTEM "gtkuimanager.dtd">
<ui>
<popup action="colormap-editor-popup">
<menuitem action="colormap-editor-edit-color" />
<menuitem action="colormap-editor-add-color-from-fg" />
<menuitem action="colormap-editor-add-color-from-bg" />
<separator />
</popup>
</ui>

View File

@ -2,10 +2,10 @@
<!DOCTYPE ui SYSTEM "gtkuimanager.dtd">
<ui>
<popup action="colormap-editor-popup">
<menuitem action="colormap-editor-edit-color" />
<menuitem action="colormap-editor-add-color-from-fg" />
<menuitem action="colormap-editor-add-color-from-bg" />
<popup action="colormap-popup">
<menuitem action="colormap-edit-color" />
<menuitem action="colormap-add-color-from-fg" />
<menuitem action="colormap-add-color-from-bg" />
<separator />
</popup>
</ui>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE ui SYSTEM "gtkuimanager.dtd">
<ui>
<popup action="sample-point-editor-popup">
<menuitem action="sample-point-editor-sample-merged" />
</popup>
</ui>

View File

@ -2,7 +2,7 @@
<!DOCTYPE ui SYSTEM "gtkuimanager.dtd">
<ui>
<popup action="sample-point-editor-popup">
<menuitem action="sample-point-editor-sample-merged" />
<popup action="sample-points-popup">
<menuitem action="sample-points-sample-merged" />
</popup>
</ui>

View File

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE ui SYSTEM "gtkuimanager.dtd">
<ui>
<popup action="selection-editor-popup">
<menuitem action="select-all" />
<menuitem action="select-none" />
<menuitem action="select-invert" />
<menuitem action="vectors-selection-from-vectors" />
<menuitem action="select-float" />
<separator />
<placeholder name="Outline">
<menuitem action="select-feather" />
<menuitem action="select-sharpen" />
<menuitem action="select-shrink" />
<menuitem action="select-grow" />
<menuitem action="select-border" />
</placeholder>
<separator />
<menuitem action="select-save" />
<menuitem action="vectors-selection-to-vectors-short" />
<menuitem action="select-stroke" />
</popup>
</ui>

View File

@ -2,7 +2,7 @@
<!DOCTYPE ui SYSTEM "gtkuimanager.dtd">
<ui>
<popup action="selection-editor-popup">
<popup action="selection-popup">
<menuitem action="select-all" />
<menuitem action="select-none" />
<menuitem action="select-invert" />

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE ui SYSTEM "gtkuimanager.dtd">
<ui>
<popup action="undo-editor-popup">
<menuitem action="edit-undo" />
<menuitem action="edit-redo" />
<menuitem action="edit-undo-clear" />
</popup>
</ui>

View File

@ -2,7 +2,7 @@
<!DOCTYPE ui SYSTEM "gtkuimanager.dtd">
<ui>
<popup action="undo-editor-popup">
<popup action="undo-popup">
<menuitem action="edit-undo" />
<menuitem action="edit-redo" />
<menuitem action="edit-undo-clear" />

View File

@ -108,7 +108,7 @@ query (void)
remap_args, NULL);
gimp_plugin_menu_register (PLUG_IN_PROC_REMAP, "<Image>/Colors/Map/Colormap");
gimp_plugin_menu_register (PLUG_IN_PROC_REMAP, "<ColormapEditor>");
gimp_plugin_menu_register (PLUG_IN_PROC_REMAP, "<Colormap>");
gimp_plugin_icon_register (PLUG_IN_PROC_REMAP, GIMP_ICON_TYPE_STOCK_ID,
(const guint8 *) GIMP_STOCK_COLORMAP);