pass the GimpItemListView as "data" to the item_factory callbacks, not

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

	* app/widgets/gimpitemlistview.c: pass the GimpItemListView as
	"data" to the item_factory callbacks, not just a "Gimp" pointer.

	* app/display/gimpdisplayshell.c: use
	gtk_window_add_accel_group(), not gimp_window_add_accel_group()
	because we now attach the menubar's accel group, which has the
	GimpDisplay as callback data.

	* app/display/gimpdisplayshell-callbacks.c: pass the GimpDisplay
	as "popup_data" to *_item_factory_popup_with_data().

	* app/gui/channels-commands.c
	* app/gui/drawable-commands.c
	* app/gui/layers-commands.c
	* app/gui/vectors-commands.c: changed accordingly.

	* app/widgets/gimpwidgets-utils.[ch]: removed
	gimp_window_[add|remove]_accel_group() and
	gimp_widget_get_callback_context() because they were evil hacks
	which are no longer needed now that all item_factories have proper
	callback data (no just Gimp pointers).
This commit is contained in:
Michael Natterer
2003-01-12 12:35:00 +00:00
committed by Michael Natterer
parent 6098d87148
commit f44500aa69
16 changed files with 139 additions and 260 deletions

View File

@ -42,8 +42,8 @@
#include "widgets/gimpenummenu.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpitemlistview.h"
#include "widgets/gimpviewabledialog.h"
#include "widgets/gimpwidgets-utils.h"
#include "display/gimpdisplay.h"
@ -65,13 +65,15 @@ static void layers_resize_layer_query (GimpImage *gimage,
#define return_if_no_image(gimage,data) \
gimage = (GimpImage *) gimp_widget_get_callback_context (widget); \
if (! GIMP_IS_IMAGE (gimage)) { \
if (GIMP_IS_DISPLAY (data)) \
gimage = ((GimpDisplay *) data)->gimage; \
else if (GIMP_IS_GIMP (data)) \
gimage = gimp_context_get_image (gimp_get_user_context (GIMP (data))); \
} \
if (GIMP_IS_DISPLAY (data)) \
gimage = ((GimpDisplay *) data)->gimage; \
else if (GIMP_IS_GIMP (data)) \
gimage = gimp_context_get_image (gimp_get_user_context (GIMP (data))); \
else if (GIMP_IS_ITEM_LIST_VIEW (data)) \
gimage = ((GimpItemListView *) data)->gimage; \
else \
gimage = NULL; \
\
if (! gimage) \
return
@ -1166,7 +1168,7 @@ layers_menu_update (GtkItemFactory *factory,
GList *next = NULL;
GList *prev = NULL;
gimage = GIMP_IMAGE (data);
gimage = GIMP_ITEM_LIST_VIEW (data)->gimage;
layer = gimp_image_get_active_layer (gimage);