added some utility functions to get a Gimp, GimpImage, GimpDisplay and

2004-05-03  Michael Natterer  <mitch@gimp.org>

	* app/actions/actions.[ch]: added some utility functions to get a
	Gimp, GimpImage, GimpDisplay and GtkWidget from the "data" pointer
	passed to action callbacks.

	* app/actions/channels-actions.c
	* app/actions/channels-commands.c
	* app/actions/drawable-actions.c
	* app/actions/drawable-commands.c
	* app/actions/edit-actions.c
	* app/actions/edit-commands.c
	* app/actions/file-actions.c
	* app/actions/file-commands.c
	* app/actions/help-commands.c
	* app/actions/image-actions.c
	* app/actions/image-commands.c
	* app/actions/layers-actions.c
	* app/actions/layers-commands.c
	* app/actions/plug-in-actions.c
	* app/actions/plug-in-commands.c
	* app/actions/qmask-actions.c
	* app/actions/qmask-commands.c
	* app/actions/select-actions.c
	* app/actions/select-commands.c
	* app/actions/tools-commands.c
	* app/actions/vectors-actions.c
	* app/actions/vectors-commands.c
	* app/actions/view-commands.c: use the new functions instead of
	duplicating insane macros and if() constructs over and over again.
This commit is contained in:
Michael Natterer
2004-05-03 14:03:51 +00:00
committed by Michael Natterer
parent 3c38214c27
commit d745841e4d
28 changed files with 267 additions and 531 deletions

View File

@ -30,11 +30,8 @@
#include "widgets/gimpactiongroup.h"
#include "widgets/gimpcomponenteditor.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemtreeview.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#include "actions.h"
#include "channels-actions.h"
#include "channels-commands.h"
@ -128,7 +125,7 @@ void
channels_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpImage *gimage = NULL;
GimpImage *gimage;
GimpChannel *channel = NULL;
gboolean fs = FALSE;
gboolean component = FALSE;
@ -147,12 +144,7 @@ channels_actions_update (GimpActionGroup *group,
}
else
{
if (GIMP_IS_ITEM_TREE_VIEW (data))
gimage = GIMP_ITEM_TREE_VIEW (data)->gimage;
else if (GIMP_IS_DISPLAY_SHELL (data))
gimage = GIMP_DISPLAY_SHELL (data)->gdisp->gimage;
else if (GIMP_IS_DISPLAY (data))
gimage = GIMP_DISPLAY (data)->gimage;
gimage = action_data_get_image (data);
if (gimage)
{