Commit 05e15eb1 authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

Cleanup weekend...

2001-10-29  Michael Natterer  <mitch@gimp.org>

	Cleanup weekend...

	* app/app_procs.c: pass "no_interface" to gimp_new().

	* app/core/gimp.[ch]: added "gboolean no_interface" and the
	load_procs and save_procs GSLists.

	* app/core/gimptoolinfo.[ch]: added a "Gimp" pointer to the
	GimpToolInfo object so more functions find their context without
	accessing the global "the_gimp" variable.

	* app/display/display-types.h: removed the GDisplay -> GimpDisplay
	typedef.

	* app/display/gimpdisplay.c: look at gimp->no_interface, don't
	include "appenv.h".

	* app/file/file-open.[ch]
	* app/file/file-save.[ch]: don't use "the_gimp" any more. Instead,
	pass around lots of "Gimp" pointers. Removed the global load_procs
	and save_procs variables here. Use access() to find out whether a
	file is readable/writable, removed the manual voodoo and it's
	Win32 wrappers. Added an optional (can be NULL) "PlunInProcDef"
	parameter to file_save(), removed file_save_with_proc().

	* app/gui/menus.c: Use the unused "gpointer data" parameter of the
	GtkItemFactory callbacks to pass a "Gimp" pointer to all of them.
	This reduces the usage of the global "the_gimp" hack to zero
	in app/gui/... yeah.

	* app/gui/channels-commands.c
	* app/gui/edit-commands.c
	* app/gui/file-commands.c
	* app/gui/image-commands.c
	* app/gui/layers-commands.c
	* app/gui/palettes-commands.c
	* app/gui/select-commands.c
	* app/gui/test-commands.c
	* app/gui/tools-commands.c
	* app/gui/view-commands.c: use the passed "Gimp" pointer.

	* app/gui/color-area.[ch]
	* app/gui/convert-dialog.c
	* app/gui/dialogs-constructors.c
	* app/gui/file-new-dialog.[ch]
	* app/gui/file-open-dialog.[ch]
	* app/gui/file-save-dialog.[ch]
	* app/gui/gui.c
	* app/gui/info-window.[ch]
	* app/gui/module-browser.[ch]
	* app/gui/palette-editor.c
	* app/gui/palette-import-dialog.[ch]
	* app/gui/paths-dialog.c
	* app/gui/preferences-dialog.[ch]
	* app/gui/resize-dialog.[ch]
	* app/gui/tool-options-dialog.[ch]
	* app/gui/toolbox.c: pass around lots more "Gimp" and
	"GimpContext" pointers and don't use "the_gimp" any more.

	* app/tools/gimptool.h: added a pointer to the corresponding
	GimpToolInfo object (which in turn has a pointer to a Gimp).

	* app/tools/tool_manager.[ch]: set the pointer after creating the
	tool object. Removed tool_manager_get_info_by_tool() as there is a
	tool->tool_info pointer now.

	* app/tools/gimpbezierselecttool.c
	* app/tools/gimpblendtool.c
	* app/tools/gimpbrightnesscontrasttool.c
	* app/tools/gimpclonetool.c
	* app/tools/gimpcolorbalancetool.c
	* app/tools/gimpcolorpickertool.c
	* app/tools/gimpconvolvetool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimpdodgeburntool.c
	* app/tools/gimpdrawtool.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpellipseselecttool.c
	* app/tools/gimperasertool.c
	* app/tools/gimpfliptool.c
	* app/tools/gimphistogramtool.c
	* app/tools/gimphuesaturationtool.c
	* app/tools/gimpinktool.c
	* app/tools/gimplevelstool.c
	* app/tools/gimpmagnifytool.c
	* app/tools/gimpmeasuretool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimppainttool.c
	* app/tools/gimppathtool.c
	* app/tools/gimpperspectivetool.c
	* app/tools/gimpposterizetool.c
	* app/tools/gimprectselecttool.c
	* app/tools/gimprotatetool.c
	* app/tools/gimpscaletool.c
	* app/tools/gimpsheartool.c
	* app/tools/gimptexttool.c
	* app/tools/gimpthresholdtool.c
	* app/tools/path_tool.c
	* app/tools/xinput_airbrush.c: s/GDisplay/GimpDisplay/g.
	Use tool->tool_info and tool_info->gimp in some places to get
	rid of using "the_gimp".

	Removing the remaining ones involves changing the tool options
	system and is scheduled next...

	* app/widgets/gimpdnd.c
	* app/widgets/gimpdocumentview.c: pass a "Gimp" pointer to all
	file_open_*() functions.

	* app/gdisplay_color.[ch]
	* app/gdisplay_color_ui.[ch]
	* app/image_map.[ch]
	* app/nav_window.[ch]
	* app/path.c
	* app/path_bezier.c
	* app/path_transform.h
	* app/qmask.[ch]: s/GDisplay/GimpDisplay/g

	* tools/pdbgen/pdb/fileops.pdb: load_procs and save_procs are
	members of the "Gimp" object now.

	* tools/pdbgen/pdb/plug_in.pdb: use gimp->no_interface, don't
	include "appenv.h".

	* app/pdb/fileops_cmds.c
	* app/pdb/plug_in_cmds.c: regenerated.
parent 5e9fc1d8
2001-10-29 Michael Natterer <mitch@gimp.org>
Cleanup weekend...
* app/app_procs.c: pass "no_interface" to gimp_new().
* app/core/gimp.[ch]: added "gboolean no_interface" and the
load_procs and save_procs GSLists.
* app/core/gimptoolinfo.[ch]: added a "Gimp" pointer to the
GimpToolInfo object so more functions find their context without
accessing the global "the_gimp" variable.
* app/display/display-types.h: removed the GDisplay -> GimpDisplay
typedef.
* app/display/gimpdisplay.c: look at gimp->no_interface, don't
include "appenv.h".
* app/file/file-open.[ch]
* app/file/file-save.[ch]: don't use "the_gimp" any more. Instead,
pass around lots of "Gimp" pointers. Removed the global load_procs
and save_procs variables here. Use access() to find out whether a
file is readable/writable, removed the manual voodoo and it's
Win32 wrappers. Added an optional (can be NULL) "PlunInProcDef"
parameter to file_save(), removed file_save_with_proc().
* app/gui/menus.c: Use the unused "gpointer data" parameter of the
GtkItemFactory callbacks to pass a "Gimp" pointer to all of them.
This reduces the usage of the global "the_gimp" hack to zero
in app/gui/... yeah.
* app/gui/channels-commands.c
* app/gui/edit-commands.c
* app/gui/file-commands.c
* app/gui/image-commands.c
* app/gui/layers-commands.c
* app/gui/palettes-commands.c
* app/gui/select-commands.c
* app/gui/test-commands.c
* app/gui/tools-commands.c
* app/gui/view-commands.c: use the passed "Gimp" pointer.
* app/gui/color-area.[ch]
* app/gui/convert-dialog.c
* app/gui/dialogs-constructors.c
* app/gui/file-new-dialog.[ch]
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.[ch]
* app/gui/gui.c
* app/gui/info-window.[ch]
* app/gui/module-browser.[ch]
* app/gui/palette-editor.c
* app/gui/palette-import-dialog.[ch]
* app/gui/paths-dialog.c
* app/gui/preferences-dialog.[ch]
* app/gui/resize-dialog.[ch]
* app/gui/tool-options-dialog.[ch]
* app/gui/toolbox.c: pass around lots more "Gimp" and
"GimpContext" pointers and don't use "the_gimp" any more.
* app/tools/gimptool.h: added a pointer to the corresponding
GimpToolInfo object (which in turn has a pointer to a Gimp).
* app/tools/tool_manager.[ch]: set the pointer after creating the
tool object. Removed tool_manager_get_info_by_tool() as there is a
tool->tool_info pointer now.
* app/tools/gimpbezierselecttool.c
* app/tools/gimpblendtool.c
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpclonetool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpconvolvetool.c
* app/tools/gimpcroptool.c
* app/tools/gimpcurvestool.c
* app/tools/gimpdodgeburntool.c
* app/tools/gimpdrawtool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpellipseselecttool.c
* app/tools/gimperasertool.c
* app/tools/gimpfliptool.c
* app/tools/gimphistogramtool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimpinktool.c
* app/tools/gimplevelstool.c
* app/tools/gimpmagnifytool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/tools/gimppainttool.c
* app/tools/gimppathtool.c
* app/tools/gimpperspectivetool.c
* app/tools/gimpposterizetool.c
* app/tools/gimprectselecttool.c
* app/tools/gimprotatetool.c
* app/tools/gimpscaletool.c
* app/tools/gimpsheartool.c
* app/tools/gimptexttool.c
* app/tools/gimpthresholdtool.c
* app/tools/path_tool.c
* app/tools/xinput_airbrush.c: s/GDisplay/GimpDisplay/g.
Use tool->tool_info and tool_info->gimp in some places to get
rid of using "the_gimp".
Removing the remaining ones involves changing the tool options
system and is scheduled next...
* app/widgets/gimpdnd.c
* app/widgets/gimpdocumentview.c: pass a "Gimp" pointer to all
file_open_*() functions.
* app/gdisplay_color.[ch]
* app/gdisplay_color_ui.[ch]
* app/image_map.[ch]
* app/nav_window.[ch]
* app/path.c
* app/path_bezier.c
* app/path_transform.h
* app/qmask.[ch]: s/GDisplay/GimpDisplay/g
* tools/pdbgen/pdb/fileops.pdb: load_procs and save_procs are
members of the "Gimp" object now.
* tools/pdbgen/pdb/plug_in.pdb: use gimp->no_interface, don't
include "appenv.h".
* app/pdb/fileops_cmds.c
* app/pdb/plug_in_cmds.c: regenerated.
2001-10-29 Sven Neumann <sven@gimp.org>
* plug-ins/webbrowser/web-browser.scm: updated links
......
......@@ -39,8 +39,6 @@
#include "channels-commands.h"
#include "menus.h"
#include "app_procs.h"
#include "libgimp/gimpintl.h"
......@@ -317,7 +315,7 @@ new_channel_query_ok_callback (GtkWidget *widget,
&channel_color);
gimp_drawable_fill_by_type (GIMP_DRAWABLE (new_channel),
gimp_get_user_context (the_gimp),
gimp_get_user_context (gimage->gimp),
TRANSPARENT_FILL);
gimp_image_add_channel (gimage, new_channel, -1);
......
......@@ -43,15 +43,20 @@
#include "dialogs.h"
#include "edit-commands.h"
#include "app_procs.h"
#include "undo.h"
#include "libgimp/gimpintl.h"
#define return_if_no_display(gdisp) \
gdisp = gimp_context_get_display (gimp_get_user_context (the_gimp)); \
if (!gdisp) return
#define return_if_no_display(gdisp,data) \
gdisp = gimp_context_get_display (gimp_get_user_context (GIMP (data))); \
if (! gdisp) \
return
#define return_if_no_image(gimage,data) \
gimage = gimp_context_get_image (gimp_get_user_context (GIMP (data))); \
if (! gimage) \
return
/* local function prototypes */
......@@ -70,28 +75,28 @@ void
edit_undo_cmd_callback (GtkWidget *widget,
gpointer data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
GimpImage *gimage;
return_if_no_image (gimage, data);
undo_pop (gdisp->gimage);
undo_pop (gimage);
}
void
edit_redo_cmd_callback (GtkWidget *widget,
gpointer data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
GimpImage *gimage;
return_if_no_image (gimage, data);
undo_redo (gdisp->gimage);
undo_redo (gimage);
}
void
edit_cut_cmd_callback (GtkWidget *widget,
gpointer data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
/* stop any active tool */
tool_manager_control_active (gdisp->gimage->gimp, HALT, gdisp);
......@@ -107,19 +112,18 @@ void
edit_copy_cmd_callback (GtkWidget *widget,
gpointer data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
GimpImage *gimage;
return_if_no_image (gimage, data);
gimp_edit_copy (gdisp->gimage,
gimp_image_active_drawable (gdisp->gimage));
gimp_edit_copy (gimage, gimp_image_active_drawable (gimage));
}
void
edit_paste_cmd_callback (GtkWidget *widget,
gpointer data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
if (gdisp->gimage->gimp->global_buffer)
{
......@@ -141,8 +145,8 @@ void
edit_paste_into_cmd_callback (GtkWidget *widget,
gpointer data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
if (gdisp->gimage->gimp->global_buffer)
{
......@@ -164,8 +168,8 @@ void
edit_paste_as_new_cmd_callback (GtkWidget *widget,
gpointer data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
if (gdisp->gimage->gimp->global_buffer)
{
......@@ -182,10 +186,9 @@ void
edit_named_cut_cmd_callback (GtkWidget *widget,
gpointer data)
{
GDisplay *gdisp;
GtkWidget *qbox;
return_if_no_display (gdisp);
GimpDisplay *gdisp;
GtkWidget *qbox;
return_if_no_display (gdisp, data);
/* stop any active tool */
tool_manager_control_active (gdisp->gimage->gimp, HALT, gdisp);
......@@ -204,18 +207,17 @@ void
edit_named_copy_cmd_callback (GtkWidget *widget,
gpointer data)
{
GDisplay *gdisp;
GimpImage *gimage;
GtkWidget *qbox;
return_if_no_display (gdisp);
return_if_no_image (gimage, data);
qbox = gimp_query_string_box (_("Copy Named"),
gimp_standard_help_func,
"dialogs/copy_named.html",
_("Enter a name for this buffer"),
NULL,
G_OBJECT (gdisp->gimage), "disconnect",
copy_named_buffer_callback, gdisp->gimage);
G_OBJECT (gimage), "disconnect",
copy_named_buffer_callback, gimage);
gtk_widget_show (qbox);
}
......@@ -223,9 +225,6 @@ void
edit_named_paste_cmd_callback (GtkWidget *widget,
gpointer data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
gimp_dialog_factory_dialog_raise (global_dock_factory, "gimp:buffer-list");
}
......@@ -233,10 +232,10 @@ void
edit_clear_cmd_callback (GtkWidget *widget,
gpointer data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
GimpImage *gimage;
return_if_no_image (gimage, data);
gimp_edit_clear (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage));
gimp_edit_clear (gimage, gimp_image_active_drawable (gimage));
gdisplays_flush ();
}
......@@ -245,15 +244,14 @@ edit_fill_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpImage *gimage;
GimpFillType fill_type;
GDisplay *gdisp;
return_if_no_display (gdisp);
return_if_no_image (gimage, data);
fill_type = (GimpFillType) action;
gimp_edit_fill (gdisp->gimage,
gimp_image_active_drawable (gdisp->gimage),
gimp_edit_fill (gimage,
gimp_image_active_drawable (gimage),
fill_type);
gdisplays_flush ();
......@@ -263,12 +261,12 @@ void
edit_stroke_cmd_callback (GtkWidget *widget,
gpointer data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
GimpImage *gimage;
return_if_no_image (gimage, data);
gimage_mask_stroke (gdisp->gimage,
gimp_image_active_drawable (gdisp->gimage),
gimp_get_current_context (gdisp->gimage->gimp));
gimage_mask_stroke (gimage,
gimp_image_active_drawable (gimage),
gimp_get_current_context (gimage->gimp));
gdisplays_flush ();
}
......
......@@ -51,9 +51,9 @@
#define REVERT_DATA_KEY "revert-confirm-dialog"
#define return_if_no_display(gdisp) \
gdisp = gimp_context_get_display (gimp_get_user_context (the_gimp)); \
if (!gdisp) return
#define return_if_no_display(gdisp,data) \
gdisp = gimp_context_get_display (gimp_get_user_context (GIMP (data))); \
if (!gdisp) return
/* local function prototypes */
......@@ -70,21 +70,18 @@ file_new_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDisplay *gdisp;
GimpImage *gimage = NULL;
Gimp *gimp;
GimpImage *gimage = NULL;
gimp = GIMP (data);
/* Before we try to determine the responsible gdisplay,
* make sure this wasn't called from the toolbox
*/
/* if called from the image menu */
if (action)
{
gdisp = gimp_context_get_display (gimp_get_user_context (the_gimp));
if (gdisp)
gimage = gdisp->gimage;
gimage = gimp_context_get_image (gimp_get_user_context (gimp));
}
file_new_dialog_create (gimage);
file_new_dialog_create (gimp, gimage);
}
void
......@@ -98,7 +95,7 @@ void
file_open_cmd_callback (GtkWidget *widget,
gpointer data)
{
file_open_dialog_show ();
file_open_dialog_show (GIMP (data));
}
void
......@@ -106,21 +103,25 @@ file_last_opened_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
Gimp *gimp;
GimpImagefile *imagefile;
guint num_entries;
gint status;
num_entries = gimp_container_num_children (the_gimp->documents);
gimp = GIMP (data);
num_entries = gimp_container_num_children (gimp->documents);
if (action >= num_entries)
return;
imagefile = (GimpImagefile *)
gimp_container_get_child_by_index (the_gimp->documents, action);
gimp_container_get_child_by_index (gimp->documents, action);
if (imagefile)
{
status = file_open_with_display (GIMP_OBJECT (imagefile)->name);
status = file_open_with_display (gimp,
GIMP_OBJECT (imagefile)->name);
if (status != GIMP_PDB_SUCCESS &&
status != GIMP_PDB_CANCEL)
......@@ -143,7 +144,7 @@ file_save_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp);
return_if_no_display (gdisp, data);
if (! gimp_image_active_drawable (gdisp->gimage))
return;
......@@ -169,6 +170,7 @@ file_save_cmd_callback (GtkWidget *widget,
status = file_save (gdisp->gimage,
filename,
basename,
NULL,
RUN_WITH_LAST_VALS,
TRUE);
......@@ -190,7 +192,7 @@ file_save_as_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp);
return_if_no_display (gdisp, data);
file_save_dialog_show (gdisp->gimage);
}
......@@ -200,7 +202,7 @@ file_save_a_copy_as_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp);
return_if_no_display (gdisp, data);
file_save_a_copy_dialog_show (gdisp->gimage);
}
......@@ -213,7 +215,7 @@ file_revert_cmd_callback (GtkWidget *widget,
GtkWidget *query_box;
const gchar *filename;
return_if_no_display (gdisp);
return_if_no_display (gdisp, data);
filename = gimp_object_get_name (GIMP_OBJECT (gdisp->gimage));
......@@ -268,7 +270,7 @@ file_close_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp);
return_if_no_display (gdisp, data);
gdisplay_close_window (gdisp, FALSE);
}
......@@ -296,14 +298,15 @@ file_revert_confirm_callback (GtkWidget *widget,
if (revert)
{
GimpImage *new_gimage;
const gchar *filename;
gint status;
GimpImage *new_gimage;
const gchar *filename;
GimpPDBStatusType status;
filename = gimp_object_get_name (GIMP_OBJECT (old_gimage));
new_gimage = file_open_image (old_gimage->gimp,
filename, filename,
filename,
filename,
_("Revert"),
NULL,
RUN_INTERACTIVE,
......
......@@ -37,7 +37,6 @@
#include "display/gimpdisplay.h"
#include "display/gimpdisplay-foreach.h"
#include "app_procs.h"
#include "convert-dialog.h"
#include "offset-dialog.h"
#include "resize-dialog.h"
......@@ -47,9 +46,15 @@
#include "libgimp/gimpintl.h"
#define return_if_no_display(gdisp) \
gdisp = gimp_context_get_display (gimp_get_user_context (the_gimp)); \
if (!gdisp) return
#define return_if_no_display(gdisp,data) \
gdisp = gimp_context_get_display (gimp_get_user_context (GIMP (data))); \
if (! gdisp) \
return
#define return_if_no_image(gimage,data) \
gimage = gimp_context_get_image (gimp_get_user_context (GIMP (data))); \
if (! gimage) \
return
/* local functions */
......@@ -70,42 +75,41 @@ void
image_convert_rgb_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp);
GimpImage *gimage;
return_if_no_image (gimage, data);
convert_to_rgb (gdisp->gimage);
convert_to_rgb (gimage);
}
void
image_convert_grayscale_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp);
GimpImage *gimage;
return_if_no_image (gimage, data);
convert_to_grayscale (gdisp->gimage);
convert_to_grayscale (gimage);
}
void
image_convert_indexed_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp);
GimpImage *gimage;
return_if_no_image (gimage, data);
convert_to_indexed (gdisp->gimage);
convert_to_indexed (gimage);
}
void
image_desaturate_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpImage *gimage;
GimpDrawable *drawable;
return_if_no_image (gimage, data);
return_if_no_display (gdisp);
drawable = gimp_image_active_drawable (gdisp->gimage);
drawable = gimp_image_active_drawable (gimage);
if (! gimp_drawable_is_rgb (drawable))
{
......@@ -122,14 +126,13 @@ void
image_invert_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpImage *gimage;
GimpDrawable *drawable;
Argument *return_vals;
gint nreturn_vals;
return_if_no_image (gimage, data);
return_if_no_display (gdisp);
drawable = gimp_image_active_drawable (gdisp->gimage);
drawable = gimp_image_active_drawable (gimage);
if (gimp_drawable_is_indexed (drawable))
{
......@@ -138,7 +141,7 @@ image_invert_cmd_callback (GtkWidget *widget,
}
return_vals =
procedural_db_run_proc (gdisp->gimage->gimp,
procedural_db_run_proc (gimage->gimp,
"gimp_invert",
&nreturn_vals,
GIMP_PDB_DRAWABLE, gimp_drawable_get_ID (drawable),
......@@ -156,12 +159,11 @@ void
image_equalize_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpImage *gimage;
GimpDrawable *drawable;
return_if_no_image (gimage, data);
return_if_no_display (gdisp);
drawable = gimp_image_active_drawable (gdisp->gimage);
drawable = gimp_image_active_drawable (gimage);
if (gimp_drawable_is_indexed (drawable))
{
......@@ -178,10 +180,10 @@ void
image_offset_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp);
GimpImage *gimage;
return_if_no_image (gimage, data);
offset_dialog_create (gdisp->gimage);
offset_dialog_create (gimage);
}
void
......@@ -191,15 +193,15 @@ image_resize_cmd_callback (GtkWidget *widget,
GimpDisplay *gdisp;
GimpImage *gimage;
ImageResize *image_resize;
return_if_no_display (gdisp);
return_if_no_display (gdisp, data);
gimage = gdisp->gimage;
image_resize = g_new0 (ImageResize, 1);
image_resize->gimage = gimage;
image_resize->resize = resize_widget_new (ResizeWidget,
image_resize->resize = resize_widget_new (gimage,
ResizeWidget,
ResizeImage,
G_OBJECT (gimage),
"destroy",
......@@ -227,15 +229,15 @@ image_scale_cmd_callback (GtkWidget *widget,
GimpDisplay *gdisp;
GimpImage *gimage;
ImageResize *image_scale;
return_if_no_display (gdisp);
return_if_no_display (gdisp, data);
gimage = gdisp->gimage;
image_scale = g_new0 (ImageResize, 1);
image_scale->gimage = gimage;
image_scale->resize = resize_widget_new (ScaleWidget,
image_scale->resize = resize_widget_new (gimage,
ScaleWidget,
ResizeImage,
G_OBJECT (gimage),
"destroy",
......@@ -260,14 +262,13 @@ void
image_duplicate_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpImage *gimage;
return_if_no_display (gdisp);
GimpImage *gimage;