Commit 88dedcc4 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and

2006-06-16  Michael Natterer  <mitch@gimp.org>

	Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and
	<ColormapEditor>:

	* app/pdb/gimppluginprocedure.c
	(gimp_plug_in_procedure_add_menu_path): added the argument type
	checks for the new locations. Factored out duplicated code.

	* app/menus/menus.c (menus_init): add the "plug-in" action
	group to the resp. UI managers.

	* app/menus/plug-in-menus.c (plug_in_menus_menu_path_added):
	support them here too.

	* app/widgets/gimpimageeditor.[ch]
	* app/widgets/gimpitemtreeview.[ch]: added get_image() functions.

	* app/actions/plug-in-commands.c: added new utility functions
	which collect plug-in arguments from GimpImageEditor and
	GimpItemTreeView widgets.

	* menus/channels-menu.xml
	* menus/colormap-editor-menu.xml
	* menus/layers-menu.xml
	* menus/vectors-menu.xml: added separators.

	* menus/image-menu.xml.in: added a "Colormap" placeholder in
	Colors/Map

	* plug-ins/common/colormap-remap.c (query): register a menu
	entry in <ColormapEditor> and moved the existing one to the
	"Colormap" placeholder. Also register an icon to make this
	menu item clearly distinct from the others in that menu.

	Unrelated:

	* plug-ins/common/colormap-remap.c (run): cleaned up quite a
	bit. Fixed last-vals code and simplified map handling.

	(remap_swap): removed, folded into run().

	(remap_dialog): use the passed map to initialize the dialog so it
	starts with the last-vals. Tweaked layout to have 16 columns
	and simplified cell renderer creation.
parent f548b653
2006-06-16 Michael Natterer <mitch@gimp.org>
Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and
<ColormapEditor>:
* app/pdb/gimppluginprocedure.c
(gimp_plug_in_procedure_add_menu_path): added the argument type
checks for the new locations. Factored out duplicated code.
* app/menus/menus.c (menus_init): add the "plug-in" action
group to the resp. UI managers.
* app/menus/plug-in-menus.c (plug_in_menus_menu_path_added):
support them here too.
* app/widgets/gimpimageeditor.[ch]
* app/widgets/gimpitemtreeview.[ch]: added get_image() functions.
* app/actions/plug-in-commands.c: added new utility functions
which collect plug-in arguments from GimpImageEditor and
GimpItemTreeView widgets.
* menus/channels-menu.xml
* menus/colormap-editor-menu.xml
* menus/layers-menu.xml
* menus/vectors-menu.xml: added separators.
* menus/image-menu.xml.in: added a "Colormap" placeholder in
Colors/Map
* plug-ins/common/colormap-remap.c (query): register a menu
entry in <ColormapEditor> and moved the existing one to the
"Colormap" placeholder. Also register an icon to make this
menu item clearly distinct from the others in that menu.
Unrelated:
* plug-ins/common/colormap-remap.c (run): cleaned up quite a
bit. Fixed last-vals code and simplified map handling.
(remap_swap): removed, folded into run().
(remap_dialog): use the passed map to initialize the dialog so it
starts with the last-vals. Tweaked layout to have 16 columns
and simplified cell renderer creation.
2006-06-16 Manish Singh <yosh@gimp.org>
* app/errors.c
......
......@@ -46,6 +46,8 @@
#include "widgets/gimpdatafactoryview.h"
#include "widgets/gimpfontview.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpimageeditor.h"
#include "widgets/gimpitemtreeview.h"
#include "widgets/gimpmessagebox.h"
#include "widgets/gimpmessagedialog.h"
......@@ -59,17 +61,26 @@
/* local function prototypes */
static gint plug_in_collect_data_args (GtkAction *action,
GimpObject *object,
GValueArray *args,
gint n_args);
static gint plug_in_collect_image_args (GtkAction *action,
GimpDisplay *display,
GValueArray *args,
gint n_args);
static void plug_in_reset_all_response (GtkWidget *dialog,
gint response_id,
Gimp *gimp);
static gint plug_in_collect_data_args (GtkAction *action,
GimpObject *object,
GValueArray *args,
gint n_args);
static gint plug_in_collect_image_args (GtkAction *action,
GimpImage *image,
GValueArray *args,
gint n_args);
static gint plug_in_collect_item_args (GtkAction *action,
GimpImage *image,
GimpItem *item,
GValueArray *args,
gint n_args);
static gint plug_in_collect_drawable_args (GtkAction *action,
GimpImage *image,
GValueArray *args,
gint n_args);
static void plug_in_reset_all_response (GtkWidget *dialog,
gint response_id,
Gimp *gimp);
/* public functions */
......@@ -117,12 +128,45 @@ plug_in_run_cmd_callback (GtkAction *action,
n_args = plug_in_collect_data_args (action, object,
args, n_args);
}
else if (GIMP_IS_IMAGE_EDITOR (data))
{
GimpImageEditor *editor = GIMP_IMAGE_EDITOR (data);
GimpImage *image;
image = gimp_image_editor_get_image (editor);
n_args = plug_in_collect_image_args (action, image,
args, n_args);
}
else if (GIMP_IS_ITEM_TREE_VIEW (data))
{
GimpItemTreeView *view = GIMP_ITEM_TREE_VIEW (data);
GimpImage *image;
GimpItem *item;
image = gimp_item_tree_view_get_image (view);
if (image)
item = GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (image);
else
item = NULL;
n_args = plug_in_collect_item_args (action, image, item,
args, n_args);
}
else
{
GimpImage *image;
display = action_data_get_display (data);
n_args = plug_in_collect_image_args (action, display,
args, n_args);
if (display)
image = display->image;
else
image = NULL;
n_args = plug_in_collect_drawable_args (action, image,
args, n_args);
}
break;
......@@ -261,24 +305,81 @@ plug_in_collect_data_args (GtkAction *action,
static gint
plug_in_collect_image_args (GtkAction *action,
GimpDisplay *display,
GimpImage *image,
GValueArray *args,
gint n_args)
{
if (args->n_values > n_args &&
GIMP_VALUE_HOLDS_IMAGE_ID (&args->values[n_args]))
{
if (display)
if (image)
{
gimp_value_set_image (&args->values[n_args], image);
n_args++;
}
else
{
g_warning ("Uh-oh, no active image for the plug-in!");
return -1;
}
}
return n_args;
}
static gint
plug_in_collect_item_args (GtkAction *action,
GimpImage *image,
GimpItem *item,
GValueArray *args,
gint n_args)
{
if (args->n_values > n_args &&
GIMP_VALUE_HOLDS_IMAGE_ID (&args->values[n_args]))
{
if (image)
{
gimp_value_set_image (&args->values[n_args], display->image);
gimp_value_set_image (&args->values[n_args], image);
n_args++;
if (args->n_values > n_args &&
GIMP_VALUE_HOLDS_DRAWABLE_ID (&args->values[n_args]))
GIMP_VALUE_HOLDS_ITEM_ID (&args->values[n_args]))
{
GimpDrawable *drawable;
if (item)
{
gimp_value_set_item (&args->values[n_args], item);
n_args++;
}
else
{
g_warning ("Uh-oh, no active item for the plug-in!");
return -1;
}
}
}
}
drawable = gimp_image_active_drawable (display->image);
return n_args;
}
static gint
plug_in_collect_drawable_args (GtkAction *action,
GimpImage *image,
GValueArray *args,
gint n_args)
{
if (args->n_values > n_args &&
GIMP_VALUE_HOLDS_IMAGE_ID (&args->values[n_args]))
{
if (image)
{
gimp_value_set_image (&args->values[n_args], image);
n_args++;
if (args->n_values > n_args &&
GIMP_VALUE_HOLDS_DRAWABLE_ID (&args->values[n_args]))
{
GimpDrawable *drawable = gimp_image_active_drawable (image);
if (drawable)
{
......
......@@ -157,23 +157,26 @@ menus_init (Gimp *gimp,
gimp_menu_factory_manager_register (global_menu_factory, "<Layers>",
"layers",
"plug-in",
NULL,
"/layers-popup",
"layers-menu.xml", NULL,
"layers-menu.xml", plug_in_menus_setup,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Channels>",
"channels",
"plug-in",
NULL,
"/channels-popup",
"channels-menu.xml", NULL,
"channels-menu.xml", plug_in_menus_setup,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Vectors>",
"vectors",
"plug-in",
NULL,
"/vectors-popup",
"vectors-menu.xml", NULL,
"vectors-menu.xml", plug_in_menus_setup,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Dockable>",
......@@ -283,9 +286,10 @@ menus_init (Gimp *gimp,
gimp_menu_factory_manager_register (global_menu_factory, "<ColormapEditor>",
"colormap-editor",
"plug-in",
NULL,
"/colormap-editor-popup",
"colormap-editor-menu.xml", NULL,
"colormap-editor-menu.xml", plug_in_menus_setup,
NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<SelectionEditor>",
......
......@@ -304,6 +304,26 @@ plug_in_menus_menu_path_added (GimpPlugInProcedure *plug_in_proc,
plug_in_menus_add_proc (manager, "/toolbox-menubar",
plug_in_proc, menu_path);
}
else if (! strcmp (manager->name, "<Layers>"))
{
plug_in_menus_add_proc (manager, "/layers-popup",
plug_in_proc, menu_path);
}
else if (! strcmp (manager->name, "<Channels>"))
{
plug_in_menus_add_proc (manager, "/channels-popup",
plug_in_proc, menu_path);
}
else if (! strcmp (manager->name, "<Vectors>"))
{
plug_in_menus_add_proc (manager, "/vectors-popup",
plug_in_proc, menu_path);
}
else if (! strcmp (manager->name, "<ColormapEditor>"))
{
plug_in_menus_add_proc (manager, "/colormap-editor-popup",
plug_in_proc, menu_path);
}
else if (! strcmp (manager->name, "<Brushes>"))
{
plug_in_menus_add_proc (manager, "/brushes-popup",
......
......@@ -297,6 +297,7 @@ gimp_plug_in_procedure_add_menu_path (GimpPlugInProcedure *proc,
GimpProcedure *procedure;
gchar *basename = NULL;
gchar *prefix;
const gchar *required = NULL;
gchar *p;
g_return_val_if_fail (GIMP_IS_PLUG_IN_PROCEDURE (proc), FALSE);
......@@ -317,16 +318,40 @@ gimp_plug_in_procedure_add_menu_path (GimpPlugInProcedure *proc,
if ((procedure->num_args < 1) ||
! GIMP_IS_PARAM_SPEC_INT32 (procedure->args[0]))
{
basename = g_filename_display_basename (proc->prog);
g_set_error (error, 0, 0,
"Plug-In \"%s\"\n(%s)\n\n"
"attempted to install %s procedure \"%s\" "
"which does not take the standard %s Plug-In "
"arguments.\n"
"(INT32)",
basename, gimp_filename_to_utf8 (proc->prog),
prefix, GIMP_OBJECT (proc)->name, prefix);
required = "INT32";
goto failure;
}
}
else if (strcmp (prefix, "<Layers>") == 0 ||
strcmp (prefix, "<Channels>") == 0)
{
if ((procedure->num_args < 3) ||
! GIMP_IS_PARAM_SPEC_INT32 (procedure->args[0]) ||
! GIMP_IS_PARAM_SPEC_IMAGE_ID (procedure->args[1]) ||
! GIMP_IS_PARAM_SPEC_DRAWABLE_ID (procedure->args[2]))
{
required = "INT32, IMAGE, DRAWABLE";
goto failure;
}
}
else if (strcmp (prefix, "<Vectors>") == 0)
{
if ((procedure->num_args < 3) ||
! GIMP_IS_PARAM_SPEC_INT32 (procedure->args[0]) ||
! GIMP_IS_PARAM_SPEC_IMAGE_ID (procedure->args[1]) ||
! GIMP_IS_PARAM_SPEC_VECTORS_ID (procedure->args[2]))
{
required = "INT32, IMAGE, VECTORS";
goto failure;
}
}
else if (strcmp (prefix, "<ColormapEditor>") == 0)
{
if ((procedure->num_args < 2) ||
! GIMP_IS_PARAM_SPEC_INT32 (procedure->args[0]) ||
! GIMP_IS_PARAM_SPEC_IMAGE_ID (procedure->args[1]))
{
required = "INT32, IMAGE";
goto failure;
}
}
......@@ -337,32 +362,14 @@ gimp_plug_in_procedure_add_menu_path (GimpPlugInProcedure *proc,
! G_IS_PARAM_SPEC_STRING (procedure->args[1]) ||
! G_IS_PARAM_SPEC_STRING (procedure->args[2]))
{
basename = g_filename_display_basename (proc->prog);
g_set_error (error, 0, 0,
"Plug-In \"%s\"\n(%s)\n\n"
"attempted to install <Load> procedure \"%s\" "
"which does not take the standard <Load> Plug-In "
"arguments.\n"
"(INT32, STRING, STRING)",
basename, gimp_filename_to_utf8 (proc->prog),
GIMP_OBJECT (proc)->name);
required = "INT32, STRING, STRING";
goto failure;
}
if ((procedure->num_values < 1) ||
! GIMP_IS_PARAM_SPEC_IMAGE_ID (procedure->values[0]))
{
basename = g_filename_display_basename (proc->prog);
g_set_error (error, 0, 0,
"Plug-In \"%s\"\n(%s)\n\n"
"attempted to install <Load> procedure \"%s\" "
"which does not return the standard <Load> Plug-In "
"values.\n"
"(IMAGE)",
basename, gimp_filename_to_utf8 (proc->prog),
GIMP_OBJECT (proc)->name);
required = "IMAGE";
goto failure;
}
}
......@@ -375,16 +382,7 @@ gimp_plug_in_procedure_add_menu_path (GimpPlugInProcedure *proc,
! G_IS_PARAM_SPEC_STRING (procedure->args[3]) ||
! G_IS_PARAM_SPEC_STRING (procedure->args[4]))
{
basename = g_filename_display_basename (proc->prog);
g_set_error (error, 0, 0,
"Plug-In \"%s\"\n(%s)\n\n"
"attempted to install <Save> procedure \"%s\" "
"which does not take the standard <Save> Plug-In "
"arguments.\n"
"(INT32, IMAGE, DRAWABLE, STRING, STRING)",
basename, gimp_filename_to_utf8 (proc->prog),
GIMP_OBJECT (proc)->name);
required = "INT32, IMAGE, DRAWABLE, STRING, STRING";
goto failure;
}
}
......@@ -398,16 +396,7 @@ gimp_plug_in_procedure_add_menu_path (GimpPlugInProcedure *proc,
if ((procedure->num_args < 1) ||
! GIMP_IS_PARAM_SPEC_INT32 (procedure->args[0]))
{
basename = g_filename_display_basename (proc->prog);
g_set_error (error, 0, 0,
"Plug-In \"%s\"\n(%s)\n\n"
"attempted to install %s procedure \"%s\" "
"which does not take the standard %s Plug-In "
"arguments.\n"
"(INT32)",
basename, gimp_filename_to_utf8 (proc->prog),
prefix, GIMP_OBJECT (proc)->name, prefix);
required = "INT32";
goto failure;
}
}
......@@ -420,9 +409,10 @@ gimp_plug_in_procedure_add_menu_path (GimpPlugInProcedure *proc,
"attempted to install procedure \"%s\" "
"in the invalid menu location \"%s\".\n"
"Use either \"<Toolbox>\", \"<Image>\", "
"\"<Load>\", \"<Save>\", \"<Brushes>\", "
"\"<Gradients>\", \"<Palettes>\", \"<Patterns>\" or "
"\"<Buffers>\".",
"\"<Layers>\", \"<Channels>\", \"<Vectors>\", "
"\"<ColormapEditor>\", \"<Load>\", \"<Save>\", "
"\"<Brushes>\", \"<Gradients>\", \"<Palettes>\", "
"\"<Patterns>\" or \"<Buffers>\".",
basename, gimp_filename_to_utf8 (proc->prog),
GIMP_OBJECT (proc)->name,
menu_path);
......@@ -458,6 +448,21 @@ gimp_plug_in_procedure_add_menu_path (GimpPlugInProcedure *proc,
return TRUE;
failure:
if (required)
{
basename = g_filename_display_basename (proc->prog);
g_set_error (error, 0, 0,
"Plug-In \"%s\"\n(%s)\n\n"
"attempted to install %s procedure \"%s\" "
"which does not take the standard %s Plug-In "
"arguments.\n"
"(%s)",
basename, gimp_filename_to_utf8 (proc->prog),
prefix, GIMP_OBJECT (proc)->name, prefix,
required);
}
g_free (prefix);
g_free (basename);
......
......@@ -297,6 +297,7 @@ gimp_plug_in_procedure_add_menu_path (GimpPlugInProcedure *proc,
GimpProcedure *procedure;
gchar *basename = NULL;
gchar *prefix;
const gchar *required = NULL;
gchar *p;
g_return_val_if_fail (GIMP_IS_PLUG_IN_PROCEDURE (proc), FALSE);
......@@ -317,16 +318,40 @@ gimp_plug_in_procedure_add_menu_path (GimpPlugInProcedure *proc,
if ((procedure->num_args < 1) ||
! GIMP_IS_PARAM_SPEC_INT32 (procedure->args[0]))
{
basename = g_filename_display_basename (proc->prog);
g_set_error (error, 0, 0,
"Plug-In \"%s\"\n(%s)\n\n"
"attempted to install %s procedure \"%s\" "
"which does not take the standard %s Plug-In "
"arguments.\n"
"(INT32)",
basename, gimp_filename_to_utf8 (proc->prog),
prefix, GIMP_OBJECT (proc)->name, prefix);
required = "INT32";
goto failure;
}
}
else if (strcmp (prefix, "<Layers>") == 0 ||
strcmp (prefix, "<Channels>") == 0)
{
if ((procedure->num_args < 3) ||
! GIMP_IS_PARAM_SPEC_INT32 (procedure->args[0]) ||
! GIMP_IS_PARAM_SPEC_IMAGE_ID (procedure->args[1]) ||
! GIMP_IS_PARAM_SPEC_DRAWABLE_ID (procedure->args[2]))
{
required = "INT32, IMAGE, DRAWABLE";
goto failure;
}
}
else if (strcmp (prefix, "<Vectors>") == 0)
{
if ((procedure->num_args < 3) ||
! GIMP_IS_PARAM_SPEC_INT32 (procedure->args[0]) ||
! GIMP_IS_PARAM_SPEC_IMAGE_ID (procedure->args[1]) ||
! GIMP_IS_PARAM_SPEC_VECTORS_ID (procedure->args[2]))
{
required = "INT32, IMAGE, VECTORS";
goto failure;
}
}
else if (strcmp (prefix, "<ColormapEditor>") == 0)
{
if ((procedure->num_args < 2) ||
! GIMP_IS_PARAM_SPEC_INT32 (procedure->args[0]) ||
! GIMP_IS_PARAM_SPEC_IMAGE_ID (procedure->args[1]))
{
required = "INT32, IMAGE";
goto failure;
}
}
......@@ -337,32 +362,14 @@ gimp_plug_in_procedure_add_menu_path (GimpPlugInProcedure *proc,
! G_IS_PARAM_SPEC_STRING (procedure->args[1]) ||
! G_IS_PARAM_SPEC_STRING (procedure->args[2]))
{
basename = g_filename_display_basename (proc->prog);
g_set_error (error, 0, 0,
"Plug-In \"%s\"\n(%s)\n\n"
"attempted to install <Load> procedure \"%s\" "
"which does not take the standard <Load> Plug-In "
"arguments.\n"
"(INT32, STRING, STRING)",
basename, gimp_filename_to_utf8 (proc->prog),
GIMP_OBJECT (proc)->name);
required = "INT32, STRING, STRING";
goto failure;
}
if ((procedure->num_values < 1) ||
! GIMP_IS_PARAM_SPEC_IMAGE_ID (procedure->values[0]))
{
basename = g_filename_display_basename (proc->prog);
g_set_error (error, 0, 0,
"Plug-In \"%s\"\n(%s)\n\n"
"attempted to install <Load> procedure \"%s\" "
"which does not return the standard <Load> Plug-In "
"values.\n"
"(IMAGE)",
basename, gimp_filename_to_utf8 (proc->prog),
GIMP_OBJECT (proc)->name);
required = "IMAGE";
goto failure;
}
}
......@@ -375,16 +382,7 @@ gimp_plug_in_procedure_add_menu_path (GimpPlugInProcedure *proc,
! G_IS_PARAM_SPEC_STRING (procedure->args[3]) ||
! G_IS_PARAM_SPEC_STRING (procedure->args[4]))
{
basename = g_filename_display_basename (proc->prog);
g_set_error (error, 0, 0,
"Plug-In \"%s\"\n(%s)\n\n"
"attempted to install <Save> procedure \"%s\" "
"which does not take the standard <Save> Plug-In "
"arguments.\n"
"(INT32, IMAGE, DRAWABLE, STRING, STRING)",
basename, gimp_filename_to_utf8 (proc->prog),
GIMP_OBJECT (proc)->name);
required = "INT32, IMAGE, DRAWABLE, STRING, STRING";
goto failure;
}
}
......@@ -398,16 +396,7 @@ gimp_plug_in_procedure_add_menu_path (GimpPlugInProcedure *proc,
if ((procedure->num_args < 1) ||
! GIMP_IS_PARAM_SPEC_INT32 (procedure->args[0]))
{
basename = g_filename_display_basename (proc->prog);
g_set_error (error, 0, 0,
"Plug-In \"%s\"\n(%s)\n\n"
"attempted to install %s procedure \"%s\" "
"which does not take the standard %s Plug-In "
"arguments.\n"
"(INT32)",
basename, gimp_filename_to_utf8 (proc->prog),
prefix, GIMP_OBJECT (proc)->name, prefix);
required = "INT32";
goto failure;
}
}
......@@ -420,9 +409,10 @@ gimp_plug_in_procedure_add_menu_path (GimpPlugInProcedure *proc,
"attempted to install procedure \"%s\" "
"in the invalid menu location \"%s\".\n"
"Use either \"<Toolbox>\", \"<Image>\", "
"\"<Load>\", \"<Save>\", \"<Brushes>\", "
"\"<Gradients>\", \"<Palettes>\", \"<Patterns>\" or "
"\"<Buffers>\".",
"\"<Layers>\", \"<Channels>\", \"<Vectors>\", "
"\"<ColormapEditor>\", \"<Load>\", \"<Save>\", "
"\"<Brushes>\", \"<Gradients>\", \"<Palettes>\", "
"\"<Patterns>\" or \"<Buffers>\".",
basename, gimp_filename_to_utf8 (proc->prog),
GIMP_OBJECT (proc)->name,
menu_path);
......@@ -458,6 +448,21 @@ gimp_plug_in_procedure_add_menu_path (GimpPlugInProcedure *proc,
return TRUE;
failure:
if (required)
{
basename = g_filename_display_basename (proc->prog);
g_set_error (error, 0, 0,
"Plug-In \"%s\"\n(%s)\n\n"
"attempted to install %s procedure \"%s\" "
"which does not take the standard %s Plug-In "
"arguments.\n"
"(%s)",
basename, gimp_filename_to_utf8 (proc->prog),
prefix, GIMP_OBJECT (proc)->name, prefix,
required);
}
g_free (prefix);
g_free (basename);
......
......@@ -148,6 +148,14 @@ gimp_image_editor_set_image (GimpImageEditor *editor,
}
}
GimpImage *
gimp_image_editor_get_image (GimpImageEditor *editor)
{
g_return_val_if_fail (GIMP_IS_IMAGE_EDITOR (editor), NULL);
return editor->image;
}
/* private functions */
......
......@@ -51,10 +51,11 @@ struct _GimpImageEditorClass
};
GType gimp_image_editor_get_type (void) G_GNUC_CONST;
GType gimp_image_editor_get_type (void) G_GNUC_CONST;
void gimp_image_editor_set_image (GimpImageEditor *editor,
GimpImage *image);
void gimp_image_editor_set_image (GimpImageEditor *editor,
GimpImage *image);
GimpImage * gimp_image_editor_get_image (GimpImageEditor *editor);
#endif /* __GIMP_IMAGE_EDITOR_H__ */
......@@ -477,6 +477,14 @@ gimp_item_tree_view_set_image (GimpItemTreeView *view,
gimp_ui_manager_update (GIMP_EDITOR (view)->ui_manager, view);
}
GimpImage *
gimp_item_tree_view_get_image (GimpItemTreeView *view)
{
g_return_val_if_fail (GIMP_IS_ITEM_TREE_VIEW (view), NULL);
return view->image;
}
static void
gimp_item_tree_view_real_set_image (GimpItemTreeView *view,
GimpImage *image)
......
......@@ -115,18 +115,19 @@ struct _GimpItemTreeViewClass
};
GType gimp_item_tree_view_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_item_tree_view_new (GType view_type,
gint view_size,
gint view_border_width,
GimpImage *image,
GimpMenuFactory *menu_facotry,
const gchar *menu_identifier,
const gchar *ui_identifier);
void gimp_item_tree_view_set_image (GimpItemTreeView *view,
GimpImage *image);
GType gimp_item_tree_view_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_item_tree_view_new (GType view_type,
gint view_size,
gint view_border_width,
GimpImage *image,
GimpMenuFactory *menu_facotry,
const gchar *menu_identifier,
const gchar *ui_identifier);
void gimp_item_tree_view_set_image (GimpItemTreeView *view,
GimpImage *image);
GimpImage * gimp_item_tree_view_get_image (GimpItemTreeView *view);
#endif /* __GIMP_ITEM_TREE_VIEW_H__ */
......@@ -15,5 +15,6 @@
<menuitem action="channels-selection-add" />
<menuitem action="channels-selection-subtract" />
<menuitem action="channels-selection-intersect" />
<separator />
</popup>
</ui>
......@@ -6,5 +6,6 @@
<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>
......@@ -6,5 +6,6 @@
<menuitem action="colormap-editor-edit-color" />
<menuitem action="colormap-editor-add-color-from-fg" />
<menuitem action="colormap-editor-add-color-from-bg" />
<separator />