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

app/widgets/Makefile.am app/widgets/widgets-types.h new GtkAction subclass

2004-04-27  Michael Natterer  <mitch@gimp.org>

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h
	* app/widgets/gimppluginaction.[ch]: new GtkAction subclass which
	remembers the PlugInProcDef.

	* app/widgets/gimpactiongroup.[ch]: added "gpointer user_data" to
	the GimpActionGroup struct and to gimp_action_group_new(). Removed
	the user_data parameter from gimp_action_group_add_*_actions().

	* app/widgets/gimpactionfactory.[ch]: changed accordingly.

	* app/actions/*-actions.[ch]: removed user_data from all setup_funcs.

	* app/actions/plug-in-actions.c: use a GimpPlugInAction and
	finally use the right user_data for the callback so plug-in
	callbacks have a proper context.

	* app/gui/plug-in-menus.[ch]: renamed plug_in_menus_create2() to
	plug_in_menus_setup().

	* app/gui/image-menu.c
	* app/gui/toolbox-menu.c: changed accordingly.
parent a5130581
2004-04-27 Michael Natterer <mitch@gimp.org>
* app/widgets/Makefile.am
* app/widgets/widgets-types.h
* app/widgets/gimppluginaction.[ch]: new GtkAction subclass which
remembers the PlugInProcDef.
* app/widgets/gimpactiongroup.[ch]: added "gpointer user_data" to
the GimpActionGroup struct and to gimp_action_group_new(). Removed
the user_data parameter from gimp_action_group_add_*_actions().
* app/widgets/gimpactionfactory.[ch]: changed accordingly.
* app/actions/*-actions.[ch]: removed user_data from all setup_funcs.
* app/actions/plug-in-actions.c: use a GimpPlugInAction and
finally use the right user_data for the callback so plug-in
callbacks have a proper context.
* app/gui/plug-in-menus.[ch]: renamed plug_in_menus_create2() to
plug_in_menus_setup().
* app/gui/image-menu.c
* app/gui/toolbox-menu.c: changed accordingly.
2004-04-27 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpactiongroup.[ch]: removed "translation-domain"
......
......@@ -71,13 +71,11 @@ static GimpActionEntry brushes_actions[] =
void
brushes_actions_setup (GimpActionGroup *group,
gpointer data)
brushes_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
brushes_actions,
G_N_ELEMENTS (brushes_actions),
data);
G_N_ELEMENTS (brushes_actions));
}
void
......
......@@ -20,8 +20,7 @@
#define __BRUSHES_ACTIONS_H__
void brushes_actions_setup (GimpActionGroup *group,
gpointer data);
void brushes_actions_setup (GimpActionGroup *group);
void brushes_actions_update (GimpActionGroup *group,
gpointer data);
......
......@@ -64,13 +64,11 @@ static GimpActionEntry buffers_actions[] =
void
buffers_actions_setup (GimpActionGroup *group,
gpointer data)
buffers_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
buffers_actions,
G_N_ELEMENTS (buffers_actions),
data);
G_N_ELEMENTS (buffers_actions));
}
void
......
......@@ -20,8 +20,7 @@
#define __BUFFERS_ACTIONS_H__
void buffers_actions_setup (GimpActionGroup *group,
gpointer data);
void buffers_actions_setup (GimpActionGroup *group);
void buffers_actions_update (GimpActionGroup *group,
gpointer data);
......
......@@ -108,19 +108,16 @@ static GimpEnumActionEntry channels_to_selection_actions[] =
void
channels_actions_setup (GimpActionGroup *group,
gpointer data)
channels_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
channels_actions,
G_N_ELEMENTS (channels_actions),
data);
G_N_ELEMENTS (channels_actions));
gimp_action_group_add_enum_actions (group,
channels_to_selection_actions,
G_N_ELEMENTS (channels_to_selection_actions),
G_CALLBACK (channels_to_selection_cmd_callback),
data);
G_CALLBACK (channels_to_selection_cmd_callback));
}
void
......
......@@ -20,8 +20,7 @@
#define __CHANNELS_ACTIONS_H__
void channels_actions_setup (GimpActionGroup *group,
gpointer data);
void channels_actions_setup (GimpActionGroup *group);
void channels_actions_update (GimpActionGroup *group,
gpointer data);
......
......@@ -62,19 +62,16 @@ static GimpEnumActionEntry colormap_editor_add_color_actions[] =
void
colormap_editor_actions_setup (GimpActionGroup *group,
gpointer data)
colormap_editor_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
colormap_editor_actions,
G_N_ELEMENTS (colormap_editor_actions),
data);
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),
data);
G_CALLBACK (colormap_editor_add_color_cmd_callback));
}
void
......
......@@ -20,8 +20,7 @@
#define __COLORMAP_EDITOR_ACTIONS_H__
void colormap_editor_actions_setup (GimpActionGroup *group,
gpointer data);
void colormap_editor_actions_setup (GimpActionGroup *group);
void colormap_editor_actions_update (GimpActionGroup *group,
gpointer data);
......
......@@ -62,19 +62,16 @@ static GimpEnumActionEntry colormap_editor_add_color_actions[] =
void
colormap_editor_actions_setup (GimpActionGroup *group,
gpointer data)
colormap_editor_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
colormap_editor_actions,
G_N_ELEMENTS (colormap_editor_actions),
data);
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),
data);
G_CALLBACK (colormap_editor_add_color_cmd_callback));
}
void
......
......@@ -20,8 +20,7 @@
#define __COLORMAP_EDITOR_ACTIONS_H__
void colormap_editor_actions_setup (GimpActionGroup *group,
gpointer data);
void colormap_editor_actions_setup (GimpActionGroup *group);
void colormap_editor_actions_update (GimpActionGroup *group,
gpointer data);
......
......@@ -48,13 +48,11 @@ static GimpActionEntry debug_actions[] =
void
debug_actions_setup (GimpActionGroup *group,
gpointer data)
debug_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
debug_actions,
G_N_ELEMENTS (debug_actions),
data);
G_N_ELEMENTS (debug_actions));
}
void
......
......@@ -20,8 +20,7 @@
#define __DEBUG_ACTIONS_H__
void debug_actions_setup (GimpActionGroup *group,
gpointer data);
void debug_actions_setup (GimpActionGroup *group);
void debug_actions_update (GimpActionGroup *group,
gpointer data);
......
......@@ -202,25 +202,21 @@ static GimpStringActionEntry dialogs_toplevel_actions[] =
void
dialogs_actions_setup (GimpActionGroup *group,
gpointer data)
dialogs_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
dialogs_actions,
G_N_ELEMENTS (dialogs_actions),
data);
G_N_ELEMENTS (dialogs_actions));
gimp_action_group_add_string_actions (group,
dialogs_dockable_actions,
G_N_ELEMENTS (dialogs_dockable_actions),
G_CALLBACK (dialogs_create_dockable_cmd_callback),
data);
G_CALLBACK (dialogs_create_dockable_cmd_callback));
gimp_action_group_add_string_actions (group,
dialogs_toplevel_actions,
G_N_ELEMENTS (dialogs_toplevel_actions),
G_CALLBACK (dialogs_create_toplevel_cmd_callback),
data);
G_CALLBACK (dialogs_create_toplevel_cmd_callback));
}
void
......
......@@ -24,8 +24,7 @@ extern GimpStringActionEntry dialogs_dockable_actions[];
extern gint n_dialogs_dockable_actions;
void dialogs_actions_setup (GimpActionGroup *group,
gpointer data);
void dialogs_actions_setup (GimpActionGroup *group);
void dialogs_actions_update (GimpActionGroup *group,
gpointer data);
......
......@@ -133,45 +133,38 @@ static GimpRadioActionEntry dockable_view_type_actions[] =
void
dockable_actions_setup (GimpActionGroup *group,
gpointer data)
dockable_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
dockable_actions,
G_N_ELEMENTS (dockable_actions),
data);
G_N_ELEMENTS (dockable_actions));
gimp_action_group_add_toggle_actions (group,
dockable_toggle_actions,
G_N_ELEMENTS (dockable_toggle_actions),
data);
G_N_ELEMENTS (dockable_toggle_actions));
gimp_action_group_add_string_actions (group,
dialogs_dockable_actions,
n_dialogs_dockable_actions,
G_CALLBACK (dockable_add_tab_cmd_callback),
data);
G_CALLBACK (dockable_add_tab_cmd_callback));
gimp_action_group_add_radio_actions (group,
dockable_preview_size_actions,
G_N_ELEMENTS (dockable_preview_size_actions),
GIMP_PREVIEW_SIZE_MEDIUM,
G_CALLBACK (dockable_preview_size_cmd_callback),
data);
G_CALLBACK (dockable_preview_size_cmd_callback));
gimp_action_group_add_radio_actions (group,
dockable_tab_style_actions,
G_N_ELEMENTS (dockable_tab_style_actions),
GIMP_TAB_STYLE_PREVIEW,
G_CALLBACK (dockable_tab_style_cmd_callback),
data);
G_CALLBACK (dockable_tab_style_cmd_callback));
gimp_action_group_add_radio_actions (group,
dockable_view_type_actions,
G_N_ELEMENTS (dockable_view_type_actions),
GIMP_VIEW_TYPE_LIST,
G_CALLBACK (dockable_toggle_view_cmd_callback),
data);
G_CALLBACK (dockable_toggle_view_cmd_callback));
}
void
......
......@@ -20,8 +20,7 @@
#define __DOCKABLE_ACTIONS_H__
void dockable_actions_setup (GimpActionGroup *group,
gpointer data);
void dockable_actions_setup (GimpActionGroup *group);
void dockable_actions_update (GimpActionGroup *group,
gpointer data);
......
......@@ -79,13 +79,11 @@ static GimpActionEntry documents_actions[] =
void
documents_actions_setup (GimpActionGroup *group,
gpointer data)
documents_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
documents_actions,
G_N_ELEMENTS (documents_actions),
data);
G_N_ELEMENTS (documents_actions));
}
void
......
......@@ -20,8 +20,7 @@
#define __DOCUMENTS_ACTIONS_H__
void documents_actions_setup (GimpActionGroup *group,
gpointer data);
void documents_actions_setup (GimpActionGroup *group);
void documents_actions_update (GimpActionGroup *group,
gpointer data);
......
......@@ -98,25 +98,21 @@ static GimpEnumActionEntry drawable_rotate_actions[] =
void
drawable_actions_setup (GimpActionGroup *group,
gpointer data)
drawable_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
drawable_actions,
G_N_ELEMENTS (drawable_actions),
data);
G_N_ELEMENTS (drawable_actions));
gimp_action_group_add_enum_actions (group,
drawable_flip_actions,
G_N_ELEMENTS (drawable_flip_actions),
G_CALLBACK (drawable_flip_cmd_callback),
data);
G_CALLBACK (drawable_flip_cmd_callback));
gimp_action_group_add_enum_actions (group,
drawable_rotate_actions,
G_N_ELEMENTS (drawable_rotate_actions),
G_CALLBACK (drawable_rotate_cmd_callback),
data);
G_CALLBACK (drawable_rotate_cmd_callback));
}
void
......
......@@ -20,8 +20,7 @@
#define __DRAWABLE_ACTIONS_H__
void drawable_actions_setup (GimpActionGroup *group,
gpointer data);
void drawable_actions_setup (GimpActionGroup *group);
void drawable_actions_update (GimpActionGroup *group,
gpointer data);
......
......@@ -148,22 +148,19 @@ static GimpEnumActionEntry edit_fill_actions[] =
void
edit_actions_setup (GimpActionGroup *group,
gpointer data)
edit_actions_setup (GimpActionGroup *group)
{
GimpContext *user_context;
GimpRGB color;
gimp_action_group_add_actions (group,
edit_actions,
G_N_ELEMENTS (edit_actions),
data);
G_N_ELEMENTS (edit_actions));
gimp_action_group_add_enum_actions (group,
edit_fill_actions,
G_N_ELEMENTS (edit_fill_actions),
G_CALLBACK (edit_fill_cmd_callback),
data);
G_CALLBACK (edit_fill_cmd_callback));
g_signal_connect_object (group->gimp, "buffer_changed",
G_CALLBACK (edit_actions_buffer_changed),
......
......@@ -20,8 +20,7 @@
#define __EDIT_ACTIONS_H__
void edit_actions_setup (GimpActionGroup *group,
gpointer data);
void edit_actions_setup (GimpActionGroup *group);
void edit_actions_update (GimpActionGroup *group,
gpointer data);
......
......@@ -56,13 +56,11 @@ static GimpActionEntry error_console_actions[] =
void
error_console_actions_setup (GimpActionGroup *group,
gpointer data)
error_console_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
error_console_actions,
G_N_ELEMENTS (error_console_actions),
data);
G_N_ELEMENTS (error_console_actions));
}
void
......
......@@ -20,8 +20,7 @@
#define __ERROR_CONSOLE_ACIONS_H__
void error_console_actions_setup (GimpActionGroup *group,
gpointer data);
void error_console_actions_setup (GimpActionGroup *group);
void error_console_actions_update (GimpActionGroup *group,
gpointer data);
......
......@@ -109,8 +109,7 @@ static GimpActionEntry file_actions[] =
void
file_actions_setup (GimpActionGroup *group,
gpointer data)
file_actions_setup (GimpActionGroup *group)
{
GimpEnumActionEntry *entries;
gint n_entries;
......@@ -118,8 +117,7 @@ file_actions_setup (GimpActionGroup *group,
gimp_action_group_add_actions (group,
file_actions,
G_N_ELEMENTS (file_actions),
data);
G_N_ELEMENTS (file_actions));
n_entries = GIMP_GUI_CONFIG (group->gimp->config)->last_opened_size;
......@@ -143,8 +141,7 @@ file_actions_setup (GimpActionGroup *group,
}
gimp_action_group_add_enum_actions (group, entries, n_entries,
G_CALLBACK (file_last_opened_cmd_callback),
data);
G_CALLBACK (file_last_opened_cmd_callback));
for (i = 0; i < n_entries; i++)
{
......
......@@ -20,8 +20,7 @@
#define __FILE_ACTIONS_H__
void file_actions_setup (GimpActionGroup *group,
gpointer data);
void file_actions_setup (GimpActionGroup *group);
void file_actions_update (GimpActionGroup *group,
gpointer data);
......
......@@ -51,13 +51,11 @@ static GimpActionEntry fonts_actions[] =
void
fonts_actions_setup (GimpActionGroup *group,
gpointer data)
fonts_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
fonts_actions,
G_N_ELEMENTS (fonts_actions),
data);
G_N_ELEMENTS (fonts_actions));
}
void
......
......@@ -20,8 +20,7 @@
#define __FONTS_ACTIONS_H__
void fonts_actions_setup (GimpActionGroup *group,
gpointer data);
void fonts_actions_setup (GimpActionGroup *group);
void fonts_actions_update (GimpActionGroup *group,
gpointer data);
......
......@@ -300,52 +300,44 @@ static GimpRadioActionEntry gradient_editor_coloring_actions[] =
void
gradient_editor_actions_setup (GimpActionGroup *group,
gpointer data)
gradient_editor_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
gradient_editor_actions,
G_N_ELEMENTS (gradient_editor_actions),
data);
G_N_ELEMENTS (gradient_editor_actions));
gimp_action_group_add_enum_actions (group,
gradient_editor_load_left_actions,
G_N_ELEMENTS (gradient_editor_load_left_actions),
G_CALLBACK (gradient_editor_load_left_cmd_callback),
data);
G_CALLBACK (gradient_editor_load_left_cmd_callback));
gimp_action_group_add_enum_actions (group,
gradient_editor_save_left_actions,
G_N_ELEMENTS (gradient_editor_save_left_actions),
G_CALLBACK (gradient_editor_save_left_cmd_callback),
data);
G_CALLBACK (gradient_editor_save_left_cmd_callback));
gimp_action_group_add_enum_actions (group,
gradient_editor_load_right_actions,
G_N_ELEMENTS (gradient_editor_load_right_actions),
G_CALLBACK (gradient_editor_load_right_cmd_callback),
data);
G_CALLBACK (gradient_editor_load_right_cmd_callback));
gimp_action_group_add_enum_actions (group,
gradient_editor_save_right_actions,
G_N_ELEMENTS (gradient_editor_save_right_actions),
G_CALLBACK (gradient_editor_save_right_cmd_callback),
data);
G_CALLBACK (gradient_editor_save_right_cmd_callback));
gimp_action_group_add_radio_actions (group,
gradient_editor_blending_actions,
G_N_ELEMENTS (gradient_editor_blending_actions),
0,
G_CALLBACK (gradient_editor_blending_func_cmd_callback),
data);
G_CALLBACK (gradient_editor_blending_func_cmd_callback));
gimp_action_group_add_radio_actions (group,
gradient_editor_coloring_actions,
G_N_ELEMENTS (gradient_editor_coloring_actions),
0,
G_CALLBACK (gradient_editor_coloring_type_cmd_callback),
data);
G_CALLBACK (gradient_editor_coloring_type_cmd_callback));
}
void
......
......@@ -20,8 +20,7 @@
#define __GRADIENT_EDITOR_ACTIONS_H__
void gradient_editor_actions_setup (GimpActionGroup *group,
gpointer data);
void gradient_editor_actions_setup (GimpActionGroup *group);
void gradient_editor_actions_update (GimpActionGroup *group,
gpointer data);
......
......@@ -42,7 +42,7 @@
static GimpActionEntry gradients_actions[] =
{
{ "gradients-popup", NULL, N_("Gradients Menu") },
{ "gradients-popup", GIMP_STOCK_GRADIENT, N_("Gradients Menu") },
{ "gradients-edit", GIMP_STOCK_EDIT,
N_("_Edit Gradient..."), NULL, NULL,
......@@ -77,13 +77,11 @@ static GimpActionEntry gradients_actions[] =
void
gradients_actions_setup (GimpActionGroup *group,
gpointer data)
gradients_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
gradients_actions,
G_N_ELEMENTS (gradients_actions),
data);
G_N_ELEMENTS (gradients_actions));
}
void
......
......@@ -20,8 +20,7 @@
#define __GRADIENTS_ACTIONS_H__
void gradients_actions_setup (GimpActionGroup *group,
gpointer data);
void gradients_actions_setup (GimpActionGroup *group);
void gradients_actions_update (GimpActionGroup *group,
gpointer user_data);
......
......@@ -51,13 +51,11 @@ static GimpActionEntry help_actions[] =
void
help_actions_setup (GimpActionGroup *group,
gpointer data)
help_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
help_actions,
G_N_ELEMENTS (help_actions),
data);
G_N_ELEMENTS (help_actions));
}
void
......
......@@ -20,8 +20,7 @@
#define __HELP_ACTIONS_H__
void help_actions_setup (GimpActionGroup *group,
gpointer data);
void help_actions_setup (GimpActionGroup *group);
void help_actions_update (GimpActionGroup *group,
gpointer data);
......
......@@ -137,25 +137,21 @@ static GimpEnumActionEntry image_rotate_actions[] =
void
image_actions_setup (GimpActionGroup *group,
gpointer data)
image_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
image_actions,
G_N_ELEMENTS (image_actions),
data);
G_N_ELEMENTS (image_actions));
gimp_action_group_add_enum_actions (group,
image_flip_actions,
G_N_ELEMENTS (image_flip_actions),
G_CALLBACK (image_flip_cmd_callback),
data);
G_CALLBACK (image_flip_cmd_callback));
gimp_action_group_add_enum_actions (group,
image_rotate_actions,
G_N_ELEMENTS (image_rotate_actions),
G_CALLBACK (image_rotate_cmd_callback),
data);
G_CALLBACK (image_rotate_cmd_callback));
}
void
......
......@@ -20,8 +20,7 @@
#define __IMAGE_ACTIONS_H__
void image_actions_setup (GimpActionGroup *group,
gpointer data);
void image_actions_setup (GimpActionGroup *group);
void image_actions_update (GimpActionGroup *group,
gpointer data);
......
......@@ -59,13 +59,11 @@ static GimpActionEntry images_actions[] =
void
images_actions_setup (GimpActionGroup *group,
gpointer data)
images_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
images_actions,
G_N_ELEMENTS (images_actions),
data);
G_N_ELEMENTS (images_actions));
}