Redid the whole internal progress stuff: don't pass around

2004-08-10  Michael Natterer  <mitch@gimp.org>

	Redid the whole internal progress stuff: don't pass around
	progress_callback and progress_data; instead, provide a
	pointer to a GimpProgressInterface which can be implemented
	by a variety of backends.

	Addresses (but not yet fixes) bugs #6010, #97266 and #135185.

	* app/display/Makefile.am
	* app/display/gimpprogress.[ch]: removed the old progress hack.

	* app/core/Makefile.am
	* app/core/core-types.h
	* app/core/gimpprogress.[ch]: implement GimpProgressInterface.

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h
	* app/widgets/gimpprogressdialog.[ch]: the standalone progress
	dialog as widget implementing GimpProgressInterface.

	* app/display/gimpdisplay.c
	* app/display/gimpstatusbar.[ch]
	* app/widgets/gimpfiledialog.[ch]
	* app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface
	implementation to these classes.

	* app/core/gimp-gui.[ch]
	* app/gui/gui-vtable.c: replaced the old progress vtable entries
	by two new to create and destroy a GimpProgressDialog in case
	no other progress is available.

	* app/pdb/procedural_db.[ch]
	* app/plug-in/plug-in-run.[ch]
	* tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and
	all plug-ins.

	* app/plug-in/plug-in.[ch]
	* app/plug-in/plug-ins.c
	* app/plug-in/plug-in-message.c
	* app/plug-in/plug-in-progress.c: handle the case there the
	plug-in was crated with a progress as well as the case where it
	wasn't.

	* app/app_procs.c
	* app/batch.c
	* app/xcf/xcf.c
	* app/file/file-open.[ch]
	* app/file/file-save.[ch]
	* app/widgets/gimphelp.c
	* app/widgets/gimpbrushselect.c
	* app/widgets/gimpfontselect.c
	* app/widgets/gimpgradientselect.c
	* app/widgets/gimppaletteselect.c
	* app/widgets/gimppatternselect.c: changed accordingly.

	* app/core/gimpimagefile.[ch]
	* app/display/gimpdisplayshell-dnd.c
	* app/gui/file-open-dialog.c
	* app/gui/file-open-location-dialog.c
	* app/gui/file-save-dialog.c
	* app/widgets/gimplayertreeview.c
	* app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file
	related functions. Embed the progress in the file dialog where
	possible.

	* app/core/gimpdrawable-blend.[ch]
	* app/core/gimpdrawable-transform.[ch]
	* app/core/gimpimage-convert.[ch]
	* app/core/gimpimage-flip.[ch]
	* app/core/gimpimage-resize.[ch]
	* app/core/gimpimage-rotate.[ch]
	* app/core/gimpimage-scale.[ch]
	* app/core/gimpitem-linked.[ch]
	* app/core/gimpitem.[ch]
	* app/core/gimpchannel.c
	* app/core/gimpdrawable.c
	* app/core/gimplayer.c
	* app/core/gimpselection.c
	* app/vectors/gimpvectors.c: replaced callback/data by GimpProgress.

	* app/tools/gimpblendtool.c
	* app/tools/gimptransformtool.c
	* app/gui/convert-dialog.c
	* app/actions/documents-commands.c
	* app/actions/file-commands.c
	* app/actions/image-commands.c
	* app/actions/layers-commands.c
	* app/actions/plug-in-commands.c
	* app/actions/vectors-commands.c
	* tools/pdbgen/pdb/convert.pdb
	* tools/pdbgen/pdb/edit.pdb
	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/layer.pdb: changed callers accordingly.

	* app/pdb/*_cmds.c: regenerated.
This commit is contained in:
Michael Natterer 2004-08-10 18:47:21 +00:00 committed by Michael Natterer
parent 059f92634c
commit 02d2b990f5
147 changed files with 3609 additions and 2517 deletions

View File

@ -1,3 +1,100 @@
2004-08-10 Michael Natterer <mitch@gimp.org>
Redid the whole internal progress stuff: don't pass around
progress_callback and progress_data; instead, provide a
pointer to a GimpProgressInterface which can be implemented
by a variety of backends.
Addresses (but not yet fixes) bugs #6010, #97266 and #135185.
* app/display/Makefile.am
* app/display/gimpprogress.[ch]: removed the old progress hack.
* app/core/Makefile.am
* app/core/core-types.h
* app/core/gimpprogress.[ch]: implement GimpProgressInterface.
* app/widgets/Makefile.am
* app/widgets/widgets-types.h
* app/widgets/gimpprogressdialog.[ch]: the standalone progress
dialog as widget implementing GimpProgressInterface.
* app/display/gimpdisplay.c
* app/display/gimpstatusbar.[ch]
* app/widgets/gimpfiledialog.[ch]
* app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface
implementation to these classes.
* app/core/gimp-gui.[ch]
* app/gui/gui-vtable.c: replaced the old progress vtable entries
by two new to create and destroy a GimpProgressDialog in case
no other progress is available.
* app/pdb/procedural_db.[ch]
* app/plug-in/plug-in-run.[ch]
* tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and
all plug-ins.
* app/plug-in/plug-in.[ch]
* app/plug-in/plug-ins.c
* app/plug-in/plug-in-message.c
* app/plug-in/plug-in-progress.c: handle the case there the
plug-in was crated with a progress as well as the case where it
wasn't.
* app/app_procs.c
* app/batch.c
* app/xcf/xcf.c
* app/file/file-open.[ch]
* app/file/file-save.[ch]
* app/widgets/gimphelp.c
* app/widgets/gimpbrushselect.c
* app/widgets/gimpfontselect.c
* app/widgets/gimpgradientselect.c
* app/widgets/gimppaletteselect.c
* app/widgets/gimppatternselect.c: changed accordingly.
* app/core/gimpimagefile.[ch]
* app/display/gimpdisplayshell-dnd.c
* app/gui/file-open-dialog.c
* app/gui/file-open-location-dialog.c
* app/gui/file-save-dialog.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file
related functions. Embed the progress in the file dialog where
possible.
* app/core/gimpdrawable-blend.[ch]
* app/core/gimpdrawable-transform.[ch]
* app/core/gimpimage-convert.[ch]
* app/core/gimpimage-flip.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-rotate.[ch]
* app/core/gimpimage-scale.[ch]
* app/core/gimpitem-linked.[ch]
* app/core/gimpitem.[ch]
* app/core/gimpchannel.c
* app/core/gimpdrawable.c
* app/core/gimplayer.c
* app/core/gimpselection.c
* app/vectors/gimpvectors.c: replaced callback/data by GimpProgress.
* app/tools/gimpblendtool.c
* app/tools/gimptransformtool.c
* app/gui/convert-dialog.c
* app/actions/documents-commands.c
* app/actions/file-commands.c
* app/actions/image-commands.c
* app/actions/layers-commands.c
* app/actions/plug-in-commands.c
* app/actions/vectors-commands.c
* tools/pdbgen/pdb/convert.pdb
* tools/pdbgen/pdb/edit.pdb
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: changed callers accordingly.
* app/pdb/*_cmds.c: regenerated.
2004-08-10 DindinX <david@dindinx.org> 2004-08-10 DindinX <david@dindinx.org>
* plug-ins/common/blinds.c: GimpPreviewArea-ified. * plug-ins/common/blinds.c: GimpPreviewArea-ified.

View File

@ -196,7 +196,7 @@ documents_recreate_preview_cmd_callback (GtkAction *action,
preview_size = gimp_container_view_get_preview_size (editor->view, NULL); preview_size = gimp_container_view_get_preview_size (editor->view, NULL);
gimp_imagefile_create_thumbnail (imagefile, context, preview_size); gimp_imagefile_create_thumbnail (imagefile, context, NULL, preview_size);
} }
} }
@ -253,7 +253,7 @@ documents_open_image (GimpContext *context,
uri = gimp_object_get_name (GIMP_OBJECT (imagefile)); uri = gimp_object_get_name (GIMP_OBJECT (imagefile));
gimage = file_open_with_display (context->gimp, context, gimage = file_open_with_display (context->gimp, context, NULL,
uri, &status, &error); uri, &status, &error);
if (! gimage && status != GIMP_PDB_CANCEL) if (! gimage && status != GIMP_PDB_CANCEL)

View File

@ -32,6 +32,7 @@
#include "core/gimpcontainer.h" #include "core/gimpcontainer.h"
#include "core/gimpcontext.h" #include "core/gimpcontext.h"
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "core/gimpprogress.h"
#include "core/gimptemplate.h" #include "core/gimptemplate.h"
#include "file/file-open.h" #include "file/file-open.h"
@ -131,6 +132,7 @@ file_last_opened_cmd_callback (GtkAction *action,
GError *error = NULL; GError *error = NULL;
gimage = file_open_with_display (gimp, action_data_get_context (data), gimage = file_open_with_display (gimp, action_data_get_context (data),
NULL,
GIMP_OBJECT (imagefile)->name, GIMP_OBJECT (imagefile)->name,
&status, &error); &status, &error);
@ -177,6 +179,7 @@ file_save_cmd_callback (GtkAction *action,
GError *error = NULL; GError *error = NULL;
status = file_save (gdisp->gimage, action_data_get_context (data), status = file_save (gdisp->gimage, action_data_get_context (data),
GIMP_PROGRESS (gdisp),
GIMP_RUN_WITH_LAST_VALS, &error); GIMP_RUN_WITH_LAST_VALS, &error);
if (status != GIMP_PDB_SUCCESS && if (status != GIMP_PDB_SUCCESS &&
@ -278,10 +281,9 @@ file_revert_cmd_callback (GtkAction *action,
GIMP_STOCK_QUESTION, GIMP_STOCK_QUESTION,
text, text,
GTK_STOCK_YES, GTK_STOCK_NO, GTK_STOCK_YES, GTK_STOCK_NO,
G_OBJECT (gdisp->gimage), G_OBJECT (gdisp), "disconnect",
"disconnect",
file_revert_confirm_callback, file_revert_confirm_callback,
gdisp->gimage); gdisp);
g_free (text); g_free (text);
@ -340,7 +342,8 @@ file_revert_confirm_callback (GtkWidget *widget,
gboolean revert, gboolean revert,
gpointer data) gpointer data)
{ {
GimpImage *old_gimage = GIMP_IMAGE (data); GimpDisplay *gdisp = GIMP_DISPLAY (data);
GimpImage *old_gimage = gdisp->gimage;
g_object_set_data (G_OBJECT (old_gimage), REVERT_DATA_KEY, NULL); g_object_set_data (G_OBJECT (old_gimage), REVERT_DATA_KEY, NULL);
@ -357,6 +360,7 @@ file_revert_confirm_callback (GtkWidget *widget,
uri = gimp_object_get_name (GIMP_OBJECT (old_gimage)); uri = gimp_object_get_name (GIMP_OBJECT (old_gimage));
new_gimage = file_open_image (gimp, gimp_get_user_context (gimp), new_gimage = file_open_image (gimp, gimp_get_user_context (gimp),
GIMP_PROGRESS (gdisp),
uri, uri, NULL, uri, uri, NULL,
GIMP_RUN_INTERACTIVE, GIMP_RUN_INTERACTIVE,
&status, NULL, &error); &status, NULL, &error);

View File

@ -41,6 +41,7 @@
#include "core/gimpimage-rotate.h" #include "core/gimpimage-rotate.h"
#include "core/gimpimage-scale.h" #include "core/gimpimage-scale.h"
#include "core/gimpimage-undo.h" #include "core/gimpimage-undo.h"
#include "core/gimpprogress.h"
#include "widgets/gimpdialogfactory.h" #include "widgets/gimpdialogfactory.h"
#include "widgets/gimpdock.h" #include "widgets/gimpdock.h"
@ -49,7 +50,6 @@
#include "display/gimpdisplay.h" #include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h" #include "display/gimpdisplayshell.h"
#include "display/gimpprogress.h"
#include "gui/convert-dialog.h" #include "gui/convert-dialog.h"
#include "gui/dialogs.h" #include "gui/dialogs.h"
@ -160,7 +160,7 @@ image_convert_cmd_callback (GtkAction *action,
case GIMP_RGB: case GIMP_RGB:
case GIMP_GRAY: case GIMP_GRAY:
gimp_image_convert (gimage, (GimpImageBaseType) value, gimp_image_convert (gimage, (GimpImageBaseType) value,
0, 0, FALSE, FALSE, 0, NULL, NULL, NULL); 0, 0, FALSE, FALSE, 0, NULL, NULL);
gimp_image_flush (gimage); gimp_image_flush (gimage);
break; break;
@ -259,13 +259,14 @@ image_flip_cmd_callback (GtkAction *action,
GimpProgress *progress; GimpProgress *progress;
return_if_no_display (gdisp, data); return_if_no_display (gdisp, data);
progress = gimp_progress_start (gdisp, _("Flipping..."), TRUE, NULL, NULL); progress = gimp_progress_start (GIMP_PROGRESS (gdisp),
_("Flipping..."), FALSE);
gimp_image_flip (gdisp->gimage, action_data_get_context (data), gimp_image_flip (gdisp->gimage, action_data_get_context (data),
(GimpOrientationType) value, (GimpOrientationType) value, progress);
gimp_progress_update_and_flush, progress);
gimp_progress_end (progress); if (progress)
gimp_progress_end (progress);
gimp_image_flush (gdisp->gimage); gimp_image_flush (gdisp->gimage);
} }
@ -279,13 +280,14 @@ image_rotate_cmd_callback (GtkAction *action,
GimpProgress *progress; GimpProgress *progress;
return_if_no_display (gdisp, data); return_if_no_display (gdisp, data);
progress = gimp_progress_start (gdisp, _("Rotating..."), TRUE, NULL, NULL); progress = gimp_progress_start (GIMP_PROGRESS (gdisp),
_("Rotating..."), FALSE);
gimp_image_rotate (gdisp->gimage, action_data_get_context (data), gimp_image_rotate (gdisp->gimage, action_data_get_context (data),
(GimpRotationType) value, (GimpRotationType) value, progress);
gimp_progress_update_and_flush, progress);
gimp_progress_end (progress); if (progress)
gimp_progress_end (progress);
gimp_image_flush (gdisp->gimage); gimp_image_flush (gdisp->gimage);
} }
@ -449,9 +451,8 @@ image_resize_callback (GtkWidget *widget,
{ {
GimpProgress *progress; GimpProgress *progress;
progress = gimp_progress_start (options->gdisp, progress = gimp_progress_start (GIMP_PROGRESS (options->gdisp),
_("Resizing..."), _("Resizing..."), FALSE);
TRUE, NULL, NULL);
gimp_image_resize (options->gimage, gimp_image_resize (options->gimage,
options->context, options->context,
@ -459,9 +460,10 @@ image_resize_callback (GtkWidget *widget,
options->dialog->height, options->dialog->height,
options->dialog->offset_x, options->dialog->offset_x,
options->dialog->offset_y, options->dialog->offset_y,
gimp_progress_update_and_flush, progress); progress);
gimp_progress_end (progress); if (progress)
gimp_progress_end (progress);
gimp_image_flush (options->gimage); gimp_image_flush (options->gimage);
} }
@ -605,17 +607,17 @@ image_scale_implement (ImageResizeOptions *options)
{ {
GimpProgress *progress; GimpProgress *progress;
progress = gimp_progress_start (options->gdisp, progress = gimp_progress_start (GIMP_PROGRESS (options->gdisp),
_("Scaling..."), _("Scaling..."), FALSE);
TRUE, NULL, NULL);
gimp_image_scale (gimage, gimp_image_scale (gimage,
options->dialog->width, options->dialog->width,
options->dialog->height, options->dialog->height,
options->dialog->interpolation, options->dialog->interpolation,
gimp_progress_update_and_flush, progress); progress);
gimp_progress_end (progress); if (progress)
gimp_progress_end (progress);
} }
else else
{ {

View File

@ -41,6 +41,7 @@
#include "core/gimplist.h" #include "core/gimplist.h"
#include "core/gimptoolinfo.h" #include "core/gimptoolinfo.h"
#include "core/gimpundostack.h" #include "core/gimpundostack.h"
#include "core/gimpprogress.h"
#include "text/gimptext.h" #include "text/gimptext.h"
#include "text/gimptextlayer.h" #include "text/gimptextlayer.h"
@ -56,7 +57,6 @@
#include "display/gimpdisplay.h" #include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h" #include "display/gimpdisplayshell.h"
#include "display/gimpprogress.h"
#include "tools/gimptexttool.h" #include "tools/gimptexttool.h"
#include "tools/tool_manager.h" #include "tools/tool_manager.h"
@ -1087,18 +1087,18 @@ scale_layer_query_ok_callback (GtkWidget *widget,
gtk_widget_set_sensitive (options->dialog->shell, FALSE); gtk_widget_set_sensitive (options->dialog->shell, FALSE);
progress = gimp_progress_start (options->gdisp, progress = gimp_progress_start (GIMP_PROGRESS (options->gdisp),
_("Scaling..."), _("Scaling..."), FALSE);
TRUE, NULL, NULL);
gimp_item_scale_by_origin (GIMP_ITEM (layer), gimp_item_scale_by_origin (GIMP_ITEM (layer),
options->dialog->width, options->dialog->width,
options->dialog->height, options->dialog->height,
options->dialog->interpolation, options->dialog->interpolation,
gimp_progress_update_and_flush, progress, progress,
TRUE); TRUE);
gimp_progress_end (progress); if (progress)
gimp_progress_end (progress);
gimp_image_flush (gimage); gimp_image_flush (gimage);

View File

@ -28,6 +28,7 @@
#include "core/gimpdrawable.h" #include "core/gimpdrawable.h"
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "core/gimpitem.h" #include "core/gimpitem.h"
#include "core/gimpprogress.h"
#include "pdb/procedural_db.h" #include "pdb/procedural_db.h"
@ -61,6 +62,7 @@ plug_in_run_cmd_callback (GtkAction *action,
Gimp *gimp; Gimp *gimp;
ProcRecord *proc_rec; ProcRecord *proc_rec;
Argument *args; Argument *args;
GimpDisplay *gdisp = NULL;
gint gdisp_ID = -1; gint gdisp_ID = -1;
gint i; gint i;
gint argc; gint argc;
@ -93,13 +95,13 @@ plug_in_run_cmd_callback (GtkAction *action,
if (proc_rec->num_args >= 2 && if (proc_rec->num_args >= 2 &&
proc_rec->args[1].arg_type == GIMP_PDB_IMAGE) proc_rec->args[1].arg_type == GIMP_PDB_IMAGE)
{ {
GimpDisplay *gdisplay = action_data_get_display (data); gdisp = action_data_get_display (data);
if (gdisplay) if (gdisp)
{ {
gdisp_ID = gimp_display_get_ID (gdisplay); gdisp_ID = gimp_display_get_ID (gdisp);
args[1].value.pdb_int = gimp_image_get_ID (gdisplay->gimage); args[1].value.pdb_int = gimp_image_get_ID (gdisp->gimage);
argc++; argc++;
if (proc_rec->num_args >= 2 && if (proc_rec->num_args >= 2 &&
@ -107,7 +109,7 @@ plug_in_run_cmd_callback (GtkAction *action,
{ {
GimpDrawable *drawable; GimpDrawable *drawable;
drawable = gimp_image_active_drawable (gdisplay->gimage); drawable = gimp_image_active_drawable (gdisp->gimage);
if (drawable) if (drawable)
{ {
@ -136,6 +138,7 @@ plug_in_run_cmd_callback (GtkAction *action,
/* run the plug-in procedure */ /* run the plug-in procedure */
plug_in_run (gimp, gimp_get_user_context (gimp), plug_in_run (gimp, gimp_get_user_context (gimp),
gdisp ? GIMP_PROGRESS (gdisp) : NULL,
proc_rec, args, argc, FALSE, TRUE, gdisp_ID); proc_rec, args, argc, FALSE, TRUE, gdisp_ID);
/* remember only "standard" plug-ins */ /* remember only "standard" plug-ins */
@ -171,6 +174,7 @@ plug_in_repeat_cmd_callback (GtkAction *action,
plug_in_repeat (gdisp->gimage->gimp, plug_in_repeat (gdisp->gimage->gimp,
gimp_get_user_context (gdisp->gimage->gimp), gimp_get_user_context (gdisp->gimage->gimp),
GIMP_PROGRESS (gdisp),
gimp_display_get_ID (gdisp), gimp_display_get_ID (gdisp),
gimp_image_get_ID (gdisp->gimage), gimp_image_get_ID (gdisp->gimage),
gimp_item_get_ID (GIMP_ITEM (drawable)), gimp_item_get_ID (GIMP_ITEM (drawable)),

View File

@ -33,6 +33,7 @@
#include "core/gimpcontext.h" #include "core/gimpcontext.h"
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "core/gimpimage-merge.h" #include "core/gimpimage-merge.h"
#include "core/gimpprogress.h"
#include "core/gimptoolinfo.h" #include "core/gimptoolinfo.h"
#include "pdb/procedural_db.h" #include "pdb/procedural_db.h"
@ -255,6 +256,7 @@ vectors_selection_to_vectors_cmd_callback (GtkAction *action,
args[2].value.pdb_int = -1; /* unused */ args[2].value.pdb_int = -1; /* unused */
plug_in_run (gimage->gimp, action_data_get_context (data), plug_in_run (gimage->gimp, action_data_get_context (data),
gdisp ? GIMP_PROGRESS (gdisp) : NULL,
proc_rec, args, 3, FALSE, TRUE, proc_rec, args, 3, FALSE, TRUE,
gdisp ? gdisp->ID : 0); gdisp ? gdisp->ID : 0);

View File

@ -334,6 +334,7 @@ app_run (const gchar *full_prog_name,
gimage = file_open_with_display (gimp, gimage = file_open_with_display (gimp,
gimp_get_user_context (gimp), gimp_get_user_context (gimp),
NULL,
uri, uri,
&status, &error); &status, &error);

View File

@ -132,7 +132,7 @@ batch_run_cmd (Gimp *gimp,
args[0].value.pdb_int = GIMP_RUN_NONINTERACTIVE; args[0].value.pdb_int = GIMP_RUN_NONINTERACTIVE;
args[1].value.pdb_pointer = (gpointer) cmd; args[1].value.pdb_pointer = (gpointer) cmd;
vals = procedural_db_execute (gimp, gimp_get_user_context (gimp), vals = procedural_db_execute (gimp, gimp_get_user_context (gimp), NULL,
"plug_in_script_fu_eval", args); "plug_in_script_fu_eval", args);
switch (vals[0].value.pdb_int) switch (vals[0].value.pdb_int)
@ -184,7 +184,7 @@ batch_perl_server (Gimp *gimp,
args[1].value.pdb_int = flags; args[1].value.pdb_int = flags;
args[2].value.pdb_int = extra; args[2].value.pdb_int = extra;
vals = procedural_db_execute (gimp, gimp_get_user_context (gimp), vals = procedural_db_execute (gimp, gimp_get_user_context (gimp), NULL,
"extension_perl_server", args); "extension_perl_server", args);
switch (vals[0].value.pdb_int) switch (vals[0].value.pdb_int)

View File

@ -188,6 +188,8 @@ libappcore_a_sources = \
gimppickable.h \ gimppickable.h \
gimppreviewcache.c \ gimppreviewcache.c \
gimppreviewcache.h \ gimppreviewcache.h \
gimpprogress.c \
gimpprogress.h \
gimpprojection.c \ gimpprojection.c \
gimpprojection.h \ gimpprojection.h \
gimpprojection-construct.c \ gimpprojection-construct.c \

View File

@ -121,6 +121,7 @@ typedef struct _GimpProjection GimpProjection;
/* interfaces */ /* interfaces */
typedef struct _GimpPickable GimpPickable; /* dummy typedef */ typedef struct _GimpPickable GimpPickable; /* dummy typedef */
typedef struct _GimpProgress GimpProgress; /* dummy typedef */
/* non-object types */ /* non-object types */
@ -129,7 +130,6 @@ typedef struct _GimpArea GimpArea;
typedef struct _GimpCoords GimpCoords; typedef struct _GimpCoords GimpCoords;
typedef struct _GimpGradientSegment GimpGradientSegment; typedef struct _GimpGradientSegment GimpGradientSegment;
typedef struct _GimpGuide GimpGuide; typedef struct _GimpGuide GimpGuide;
typedef struct _GimpProgress GimpProgress;
typedef guint32 GimpTattoo; typedef guint32 GimpTattoo;
typedef struct _GimpPaletteEntry GimpPaletteEntry; typedef struct _GimpPaletteEntry GimpPaletteEntry;
typedef struct _GimpPlugInDebug GimpPlugInDebug; typedef struct _GimpPlugInDebug GimpPlugInDebug;

View File

@ -27,6 +27,7 @@
#include "gimpcontainer.h" #include "gimpcontainer.h"
#include "gimpcontext.h" #include "gimpcontext.h"
#include "gimpimage.h" #include "gimpimage.h"
#include "gimpprogress.h"
#include "gimp-intl.h" #include "gimp-intl.h"
@ -53,10 +54,8 @@ gimp_gui_init (Gimp *gimp)
gimp->gui.menus_init = NULL; gimp->gui.menus_init = NULL;
gimp->gui.menus_create = NULL; gimp->gui.menus_create = NULL;
gimp->gui.menus_delete = NULL; gimp->gui.menus_delete = NULL;
gimp->gui.progress_start = NULL; gimp->gui.progress_new = NULL;
gimp->gui.progress_restart = NULL; gimp->gui.progress_free = NULL;
gimp->gui.progress_update = NULL;
gimp->gui.progress_end = NULL;
gimp->gui.pdb_dialog_set = NULL; gimp->gui.pdb_dialog_set = NULL;
gimp->gui.pdb_dialog_close = NULL; gimp->gui.pdb_dialog_close = NULL;
gimp->gui.pdb_dialogs_check = NULL; gimp->gui.pdb_dialogs_check = NULL;
@ -320,59 +319,25 @@ gimp_menus_delete_entry (Gimp *gimp,
} }
GimpProgress * GimpProgress *
gimp_start_progress (Gimp *gimp, gimp_new_progress (Gimp *gimp)
gint gdisp_ID,
const gchar *message,
GCallback cancel_cb,
gpointer cancel_data)
{ {
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
if (gimp->gui.progress_start) if (gimp->gui.progress_new)
return gimp->gui.progress_start (gimp, gdisp_ID, message, return gimp->gui.progress_new (gimp);
cancel_cb, cancel_data);
return NULL;
}
GimpProgress *
gimp_restart_progress (Gimp *gimp,
GimpProgress *progress,
const gchar *message,
GCallback cancel_cb,
gpointer cancel_data)
{
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (progress != NULL, NULL);
if (gimp->gui.progress_restart)
return gimp->gui.progress_restart (gimp, progress, message,
cancel_cb, cancel_data);
return NULL; return NULL;
} }
void void
gimp_update_progress (Gimp *gimp, gimp_free_progress (Gimp *gimp,
GimpProgress *progress, GimpProgress *progress)
gdouble percentage)
{ {
g_return_if_fail (GIMP_IS_GIMP (gimp)); g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (progress != NULL); g_return_if_fail (GIMP_IS_PROGRESS (progress));
if (gimp->gui.progress_update) if (gimp->gui.progress_free)
gimp->gui.progress_update (gimp, progress, percentage); gimp->gui.progress_free (gimp, progress);
}
void
gimp_end_progress (Gimp *gimp,
GimpProgress *progress)
{
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (progress != NULL);
if (gimp->gui.progress_end)
gimp->gui.progress_end (gimp, progress);
} }
gboolean gboolean

View File

@ -62,20 +62,8 @@ struct _GimpGui
void (* menus_delete) (Gimp *gimp, void (* menus_delete) (Gimp *gimp,
PlugInProcDef *proc_def); PlugInProcDef *proc_def);
GimpProgress * (* progress_start) (Gimp *gimp, GimpProgress * (* progress_new) (Gimp *gimp);
gint gdisp_ID, void (* progress_free) (Gimp *gimp,
const gchar *message,
GCallback cancel_cb,
gpointer cancel_data);
GimpProgress * (* progress_restart) (Gimp *gimp,
GimpProgress *progress,
const gchar *message,
GCallback cancel_cb,
gpointer cancel_data);
void (* progress_update) (Gimp *gimp,
GimpProgress *progress,
gdouble percentage);
void (* progress_end) (Gimp *gimp,
GimpProgress *progress); GimpProgress *progress);
gboolean (* pdb_dialog_new) (Gimp *gimp, gboolean (* pdb_dialog_new) (Gimp *gimp,
@ -135,20 +123,8 @@ void gimp_menus_create_entry (Gimp *gimp,
void gimp_menus_delete_entry (Gimp *gimp, void gimp_menus_delete_entry (Gimp *gimp,
PlugInProcDef *proc_def); PlugInProcDef *proc_def);
GimpProgress * gimp_start_progress (Gimp *gimp, GimpProgress * gimp_new_progress (Gimp *gimp);
gint gdisp_ID, void gimp_free_progress (Gimp *gimp,
const gchar *message,
GCallback cancel_cb,
gpointer cancel_data);
GimpProgress * gimp_restart_progress (Gimp *gimp,
GimpProgress *progress,
const gchar *message,
GCallback cancel_cb,
gpointer cancel_data);
void gimp_update_progress (Gimp *gimp,
GimpProgress *progress,
gdouble percentage);
void gimp_end_progress (Gimp *gimp,
GimpProgress *progress); GimpProgress *progress);
const gchar * gimp_get_program_class (Gimp *gimp); const gchar * gimp_get_program_class (Gimp *gimp);

View File

@ -44,6 +44,7 @@
#include "gimpimage-undo-push.h" #include "gimpimage-undo-push.h"
#include "gimplayer.h" #include "gimplayer.h"
#include "gimplayer-floating-sel.h" #include "gimplayer-floating-sel.h"
#include "gimpprogress.h"
#include "gimpselection.h" #include "gimpselection.h"
#include "gimp-intl.h" #include "gimp-intl.h"
@ -110,8 +111,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
gboolean supersample, gboolean supersample,
gint recursion_level, gint recursion_level,
gboolean clip_result, gboolean clip_result,
GimpProgressFunc progress_callback, GimpProgress *progress)
gpointer progress_data)
{ {
GimpImage *gimage; GimpImage *gimage;
PixelRegion destPR; PixelRegion destPR;
@ -148,6 +148,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (orig_tiles != NULL, NULL); g_return_val_if_fail (orig_tiles != NULL, NULL);
g_return_val_if_fail (matrix != NULL, NULL); g_return_val_if_fail (matrix != NULL, NULL);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
gimage = gimp_item_get_image (GIMP_ITEM (drawable)); gimage = gimp_item_get_image (GIMP_ITEM (drawable));
@ -302,8 +303,10 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
for (y = y1; y < y2; y++) for (y = y1; y < y2; y++)
{ {
if (progress_callback && !(y & 0xf)) if (progress && !(y & 0xf))
(* progress_callback) (y1, y2, y, progress_data); gimp_progress_set_value (progress,
(gdouble) (y - y1) /
(gdouble) (y2 - y1));
/* set up inverse transform steps */ /* set up inverse transform steps */
tu[0] = uinc * x1 + m.coeff[0][1] * y + m.coeff[0][2]; tu[0] = uinc * x1 + m.coeff[0][1] * y + m.coeff[0][2];
@ -887,7 +890,7 @@ gimp_drawable_transform_affine (GimpDrawable *drawable,
supersample, supersample,
recursion_level, recursion_level,
FALSE, FALSE,
NULL, NULL); NULL);
/* Free the cut/copied buffer */ /* Free the cut/copied buffer */
tile_manager_unref (orig_tiles); tile_manager_unref (orig_tiles);

View File

@ -85,8 +85,7 @@ static void gimp_channel_scale (GimpItem *item,
gint new_offset_x, gint new_offset_x,
gint new_offset_y, gint new_offset_y,
GimpInterpolationType interp_type, GimpInterpolationType interp_type,
GimpProgressFunc progress_callback, GimpProgress *progress);
gpointer progress_data);
static void gimp_channel_resize (GimpItem *item, static void gimp_channel_resize (GimpItem *item,
GimpContext *context, GimpContext *context,
gint new_width, gint new_width,
@ -112,8 +111,7 @@ static void gimp_channel_transform (GimpItem *item,
gboolean supersample, gboolean supersample,
gint recursion_level, gint recursion_level,
gboolean clip_result, gboolean clip_result,
GimpProgressFunc progress_callback, GimpProgress *progress);
gpointer progress_data);
static gboolean gimp_channel_stroke (GimpItem *item, static gboolean gimp_channel_stroke (GimpItem *item,
GimpDrawable *drawable, GimpDrawable *drawable,
GimpContext *context, GimpContext *context,
@ -510,8 +508,7 @@ gimp_channel_scale (GimpItem *item,
gint new_offset_x, gint new_offset_x,
gint new_offset_y, gint new_offset_y,
GimpInterpolationType interpolation_type, GimpInterpolationType interpolation_type,
GimpProgressFunc progress_callback, GimpProgress *progress)
gpointer progress_data)
{ {
if (G_TYPE_FROM_INSTANCE (item) == GIMP_TYPE_CHANNEL) if (G_TYPE_FROM_INSTANCE (item) == GIMP_TYPE_CHANNEL)
{ {
@ -521,8 +518,7 @@ gimp_channel_scale (GimpItem *item,
GIMP_ITEM_CLASS (parent_class)->scale (item, new_width, new_height, GIMP_ITEM_CLASS (parent_class)->scale (item, new_width, new_height,
new_offset_x, new_offset_y, new_offset_x, new_offset_y,
interpolation_type, interpolation_type, progress);
progress_callback, progress_data);
} }
static void static void
@ -581,8 +577,7 @@ gimp_channel_transform (GimpItem *item,
gboolean supersample, gboolean supersample,
gint recursion_level, gint recursion_level,
gboolean clip_result, gboolean clip_result,
GimpProgressFunc progress_callback, GimpProgress *progress)
gpointer progress_data)
{ {
if (G_TYPE_FROM_INSTANCE (item) == GIMP_TYPE_CHANNEL) if (G_TYPE_FROM_INSTANCE (item) == GIMP_TYPE_CHANNEL)
clip_result = TRUE; clip_result = TRUE;
@ -590,8 +585,7 @@ gimp_channel_transform (GimpItem *item,
GIMP_ITEM_CLASS (parent_class)->transform (item, context, matrix, direction, GIMP_ITEM_CLASS (parent_class)->transform (item, context, matrix, direction,
interpolation_type, interpolation_type,
supersample, recursion_level, supersample, recursion_level,
clip_result, clip_result, progress);
progress_callback, progress_data);
} }
static gboolean static gboolean

View File

@ -40,6 +40,7 @@
#include "gimpdrawable-blend.h" #include "gimpdrawable-blend.h"
#include "gimpgradient.h" #include "gimpgradient.h"
#include "gimpimage.h" #include "gimpimage.h"
#include "gimpprogress.h"
#include "gimp-intl.h" #include "gimp-intl.h"
@ -117,8 +118,7 @@ static void gradient_precalc_shapeburst (GimpImage *gimage,
GimpDrawable *drawable, GimpDrawable *drawable,
PixelRegion *PR, PixelRegion *PR,
gdouble dist, gdouble dist,
GimpProgressFunc progress_callback, GimpProgress *progress);
gpointer progress_data);
static void gradient_render_pixel (gdouble x, static void gradient_render_pixel (gdouble x,
gdouble y, gdouble y,
@ -148,8 +148,7 @@ static void gradient_fill_region (GimpImage *gimage,
gdouble sy, gdouble sy,
gdouble ex, gdouble ex,
gdouble ey, gdouble ey,
GimpProgressFunc progress_callback, GimpProgress *progress);
gpointer progress_data);
/* variables for the shapeburst algs */ /* variables for the shapeburst algs */
@ -186,8 +185,7 @@ gimp_drawable_blend (GimpDrawable *drawable,
gdouble starty, gdouble starty,
gdouble endx, gdouble endx,
gdouble endy, gdouble endy,
GimpProgressFunc progress_callback, GimpProgress *progress)
gpointer progress_data)
{ {
GimpImage *gimage; GimpImage *gimage;
TileManager *buf_tiles; TileManager *buf_tiles;
@ -197,6 +195,7 @@ gimp_drawable_blend (GimpDrawable *drawable,
g_return_if_fail (GIMP_IS_DRAWABLE (drawable)); g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (GIMP_IS_CONTEXT (context)); g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
gimage = gimp_item_get_image (GIMP_ITEM (drawable)); gimage = gimp_item_get_image (GIMP_ITEM (drawable));
@ -223,7 +222,7 @@ gimp_drawable_blend (GimpDrawable *drawable,
supersample, max_depth, threshold, dither, supersample, max_depth, threshold, dither,
(startx - x1), (starty - y1), (startx - x1), (starty - y1),
(endx - x1), (endy - y1), (endx - x1), (endy - y1),
progress_callback, progress_data); progress);
if (distR.tiles) if (distR.tiles)
{ {
@ -572,12 +571,11 @@ gradient_calc_shapeburst_dimpled_factor (gdouble x,
} }
static void static void
gradient_precalc_shapeburst (GimpImage *gimage, gradient_precalc_shapeburst (GimpImage *gimage,
GimpDrawable *drawable, GimpDrawable *drawable,
PixelRegion *PR, PixelRegion *PR,
gdouble dist, gdouble dist,
GimpProgressFunc progress_callback, GimpProgress *progress)
gpointer progress_data)
{ {
GimpChannel *mask; GimpChannel *mask;
PixelRegion tempR; PixelRegion tempR;
@ -634,7 +632,10 @@ gradient_precalc_shapeburst (GimpImage *gimage,
pixel_region_init (&tempR, tempR.tiles, 0, 0, PR->w, PR->h, TRUE); pixel_region_init (&tempR, tempR.tiles, 0, 0, PR->w, PR->h, TRUE);
pixel_region_init (&distR, distR.tiles, 0, 0, PR->w, PR->h, TRUE); pixel_region_init (&distR, distR.tiles, 0, 0, PR->w, PR->h, TRUE);
max_iteration = shapeburst_region (&tempR, &distR, progress_callback, progress_data); max_iteration = shapeburst_region (&tempR, &distR,
progress ?
gimp_progress_update_and_flush : NULL,
progress);
/* normalize the shapeburst with the max iteration */ /* normalize the shapeburst with the max iteration */
if (max_iteration > 0) if (max_iteration > 0)
@ -903,8 +904,7 @@ gradient_fill_region (GimpImage *gimage,
gdouble sy, gdouble sy,
gdouble ex, gdouble ex,
gdouble ey, gdouble ey,
GimpProgressFunc progress_callback, GimpProgress *progress)
gpointer progress_data)
{ {
RenderBlendData rbd; RenderBlendData rbd;
gint x, y; gint x, y;
@ -986,8 +986,7 @@ gradient_fill_region (GimpImage *gimage,
case GIMP_GRADIENT_SHAPEBURST_SPHERICAL: case GIMP_GRADIENT_SHAPEBURST_SPHERICAL:
case GIMP_GRADIENT_SHAPEBURST_DIMPLED: case GIMP_GRADIENT_SHAPEBURST_DIMPLED:
rbd.dist = sqrt (SQR (ex - sx) + SQR (ey - sy)); rbd.dist = sqrt (SQR (ex - sx) + SQR (ey - sy));
gradient_precalc_shapeburst (gimage, drawable, PR, rbd.dist, gradient_precalc_shapeburst (gimage, drawable, PR, rbd.dist, progress);
progress_callback, progress_data);
break; break;
default: default:
@ -1024,14 +1023,15 @@ gradient_fill_region (GimpImage *gimage,
max_depth, threshold, max_depth, threshold,
gradient_render_pixel, &rbd, gradient_render_pixel, &rbd,
gradient_put_pixel, &ppd, gradient_put_pixel, &ppd,
progress_callback, progress_data); gimp_progress_update_and_flush,
progress);
g_free (ppd.row_data); g_free (ppd.row_data);
} }
else else
{ {
gint max_progress = PR->w * PR->h; gint max_progress = PR->w * PR->h;
gint progress = 0; gint curr_progress = 0;
for (pr = pixel_regions_register (1, PR); for (pr = pixel_regions_register (1, PR);
pr != NULL; pr != NULL;
@ -1129,10 +1129,12 @@ gradient_fill_region (GimpImage *gimage,
} }
} }
if (progress_callback) if (progress)
{ {
progress += PR->w * PR->h; curr_progress += PR->w * PR->h;
(* progress_callback) (0, max_progress, progress, progress_data);
gimp_progress_update_and_flush (0, max_progress, curr_progress,
progress);
} }
} }
} }

View File

@ -37,8 +37,7 @@ void gimp_drawable_blend (GimpDrawable *drawable,
gdouble starty, gdouble starty,
gdouble endx, gdouble endx,
gdouble endy, gdouble endy,
GimpProgressFunc progress_callback, GimpProgress *progress);
gpointer progress_data);
#endif /* __GIMP_DRAWABLE_BLEND_H__ */ #endif /* __GIMP_DRAWABLE_BLEND_H__ */

View File

@ -44,6 +44,7 @@
#include "gimpimage-undo-push.h" #include "gimpimage-undo-push.h"
#include "gimplayer.h" #include "gimplayer.h"
#include "gimplayer-floating-sel.h" #include "gimplayer-floating-sel.h"
#include "gimpprogress.h"
#include "gimpselection.h" #include "gimpselection.h"
#include "gimp-intl.h" #include "gimp-intl.h"
@ -110,8 +111,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
gboolean supersample, gboolean supersample,
gint recursion_level, gint recursion_level,
gboolean clip_result, gboolean clip_result,
GimpProgressFunc progress_callback, GimpProgress *progress)
gpointer progress_data)
{ {
GimpImage *gimage; GimpImage *gimage;
PixelRegion destPR; PixelRegion destPR;
@ -148,6 +148,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (orig_tiles != NULL, NULL); g_return_val_if_fail (orig_tiles != NULL, NULL);
g_return_val_if_fail (matrix != NULL, NULL); g_return_val_if_fail (matrix != NULL, NULL);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
gimage = gimp_item_get_image (GIMP_ITEM (drawable)); gimage = gimp_item_get_image (GIMP_ITEM (drawable));
@ -302,8 +303,10 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
for (y = y1; y < y2; y++) for (y = y1; y < y2; y++)
{ {
if (progress_callback && !(y & 0xf)) if (progress && !(y & 0xf))
(* progress_callback) (y1, y2, y, progress_data); gimp_progress_set_value (progress,
(gdouble) (y - y1) /
(gdouble) (y2 - y1));
/* set up inverse transform steps */ /* set up inverse transform steps */
tu[0] = uinc * x1 + m.coeff[0][1] * y + m.coeff[0][2]; tu[0] = uinc * x1 + m.coeff[0][1] * y + m.coeff[0][2];
@ -887,7 +890,7 @@ gimp_drawable_transform_affine (GimpDrawable *drawable,
supersample, supersample,
recursion_level, recursion_level,
FALSE, FALSE,
NULL, NULL); NULL);
/* Free the cut/copied buffer */ /* Free the cut/copied buffer */
tile_manager_unref (orig_tiles); tile_manager_unref (orig_tiles);

View File

@ -42,8 +42,7 @@ TileManager * gimp_drawable_transform_tiles_affine (GimpDrawable *draw
gboolean supersample, gboolean supersample,
gint recursion_level, gint recursion_level,
gboolean clip_result, gboolean clip_result,
GimpProgressFunc progress_callback, GimpProgress *progress);
gpointer progress_data);
TileManager * gimp_drawable_transform_tiles_flip (GimpDrawable *drawable, TileManager * gimp_drawable_transform_tiles_flip (GimpDrawable *drawable,
GimpContext *context, GimpContext *context,
TileManager *orig_tiles, TileManager *orig_tiles,

View File

@ -46,6 +46,7 @@
#include "gimppattern.h" #include "gimppattern.h"
#include "gimppickable.h" #include "gimppickable.h"
#include "gimppreviewcache.h" #include "gimppreviewcache.h"
#include "gimpprogress.h"
#include "gimp-intl.h" #include "gimp-intl.h"
@ -84,8 +85,7 @@ static void gimp_drawable_scale (GimpItem *item,
gint new_offset_x, gint new_offset_x,
gint new_offset_y, gint new_offset_y,
GimpInterpolationType interp_type, GimpInterpolationType interp_type,
GimpProgressFunc progress_callback, GimpProgress *progress);
gpointer progress_data);
static void gimp_drawable_resize (GimpItem *item, static void gimp_drawable_resize (GimpItem *item,
GimpContext *context, GimpContext *context,
gint new_width, gint new_width,
@ -111,8 +111,7 @@ static void gimp_drawable_transform (GimpItem *item,
gboolean supersample, gboolean supersample,
gint recursion_level, gint recursion_level,
gboolean clip_result, gboolean clip_result,
GimpProgressFunc progress_callback, GimpProgress *progress);
gpointer progress_data);
static guchar * gimp_drawable_get_color_at (GimpPickable *pickable, static guchar * gimp_drawable_get_color_at (GimpPickable *pickable,
gint x, gint x,
@ -401,8 +400,7 @@ gimp_drawable_scale (GimpItem *item,
gint new_offset_x, gint new_offset_x,
gint new_offset_y, gint new_offset_y,
GimpInterpolationType interpolation_type, GimpInterpolationType interpolation_type,
GimpProgressFunc progress_callback, GimpProgress *progress)
gpointer progress_data)
{ {
GimpDrawable *drawable = GIMP_DRAWABLE (item); GimpDrawable *drawable = GIMP_DRAWABLE (item);
PixelRegion srcPR, destPR; PixelRegion srcPR, destPR;
@ -425,7 +423,8 @@ gimp_drawable_scale (GimpItem *item,
scale_region (&srcPR, &destPR, scale_region (&srcPR, &destPR,
gimp_drawable_is_indexed (drawable) ? gimp_drawable_is_indexed (drawable) ?
GIMP_INTERPOLATION_NONE : interpolation_type, GIMP_INTERPOLATION_NONE : interpolation_type,
progress_callback, progress_data); progress ? gimp_progress_update_and_flush : NULL,
progress);
gimp_drawable_set_tiles_full (drawable, TRUE, NULL, gimp_drawable_set_tiles_full (drawable, TRUE, NULL,
new_tiles, gimp_drawable_type (drawable), new_tiles, gimp_drawable_type (drawable),
@ -573,8 +572,7 @@ gimp_drawable_transform (GimpItem *item,
gboolean supersample, gboolean supersample,
gint recursion_level, gint recursion_level,
gboolean clip_result, gboolean clip_result,
GimpProgressFunc progress_callback, GimpProgress *progress)
gpointer progress_data)
{ {
GimpDrawable *drawable = GIMP_DRAWABLE (item); GimpDrawable *drawable = GIMP_DRAWABLE (item);
TileManager *tiles; TileManager *tiles;
@ -592,8 +590,7 @@ gimp_drawable_transform (GimpItem *item,
interpolation_type, interpolation_type,
supersample, recursion_level, supersample, recursion_level,
clip_result, clip_result,
progress_callback, progress);
progress_data);
tile_manager_set_offsets (drawable->tiles, old_off_x, old_off_y); tile_manager_set_offsets (drawable->tiles, old_off_x, old_off_y);

View File

@ -144,6 +144,7 @@
#include "gimplist.h" #include "gimplist.h"
#include "gimplayer.h" #include "gimplayer.h"
#include "gimppalette.h" #include "gimppalette.h"
#include "gimpprogress.h"
#include "cpercep.h" #include "cpercep.h"
#include "gimpimage-convert-fsdither.h" #include "gimpimage-convert-fsdither.h"
@ -478,11 +479,9 @@ struct _QuantizeObj
gboolean want_alpha_dither; gboolean want_alpha_dither;
int error_freedom; /* 0=much bleed, 1=controlled bleed */ int error_freedom; /* 0=much bleed, 1=controlled bleed */
GimpImageConvertProgressCallback progress_callback; GimpProgress *progress;
gpointer progress_data; gint nth_layer;
gint n_layers;
gint nth_layer;
gint n_layers;
}; };
typedef struct typedef struct
@ -518,35 +517,30 @@ typedef struct
static void zero_histogram_gray (CFHistogram histogram); static void zero_histogram_gray (CFHistogram histogram);
static void zero_histogram_rgb (CFHistogram histogram); static void zero_histogram_rgb (CFHistogram histogram);
static void generate_histogram_gray (CFHistogram hostogram, static void generate_histogram_gray (CFHistogram hostogram,
GimpLayer *layer, GimpLayer *layer,
gboolean alpha_dither); gboolean alpha_dither);
static void generate_histogram_rgb (CFHistogram histogram, static void generate_histogram_rgb (CFHistogram histogram,
GimpLayer *layer, GimpLayer *layer,
gint col_limit, gint col_limit,
gboolean alpha_dither, gboolean alpha_dither,
GimpImageConvertProgressCallback GimpProgress *progress,
progress_callback, gint nth_layer,
gpointer progress_data, gint n_layers);
gint nth_layer,
gint n_layers);
static QuantizeObj* initialize_median_cut (GimpImageBaseType old_type, static QuantizeObj * initialize_median_cut (GimpImageBaseType old_type,
gint num_cols, gint num_cols,
GimpConvertDitherType dither_type, GimpConvertDitherType dither_type,
GimpConvertPaletteType palette_type, GimpConvertPaletteType palette_type,
gboolean alpha_dither, gboolean alpha_dither,
GimpImageConvertProgressCallback GimpProgress *progress);
progress_callback,
gpointer progress_data);
static void static void compute_color_lin8 (QuantizeObj *quantobj,
compute_color_lin8 (QuantizeObj *quantobj, CFHistogram histogram,
CFHistogram histogram, boxptr boxp,
boxptr boxp, const int icolor);
const int icolor);
static guchar found_cols[MAXNUMCOLORS][3]; static guchar found_cols[MAXNUMCOLORS][3];
@ -759,8 +753,7 @@ gimp_image_convert (GimpImage *gimage,
gboolean remove_dups, gboolean remove_dups,
GimpConvertPaletteType palette_type, GimpConvertPaletteType palette_type,
GimpPalette *custom_palette, GimpPalette *custom_palette,
GimpImageConvertProgressCallback progress_callback, GimpProgress *progress)
gpointer progress_data)
{ {
QuantizeObj *quantobj = NULL; QuantizeObj *quantobj = NULL;
GimpLayer *layer; GimpLayer *layer;
@ -773,6 +766,7 @@ gimp_image_convert (GimpImage *gimage,
g_return_if_fail (GIMP_IS_IMAGE (gimage)); g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_return_if_fail (new_type != gimp_image_base_type (gimage)); g_return_if_fail (new_type != gimp_image_base_type (gimage));
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
theCustomPalette = custom_palette; theCustomPalette = custom_palette;
@ -829,9 +823,8 @@ gimp_image_convert (GimpImage *gimage,
} }
quantobj = initialize_median_cut (old_type, num_cols, dither, quantobj = initialize_median_cut (old_type, num_cols, dither,
palette_type, alpha_dither, palette_type, alpha_dither,
progress_callback, progress);
progress_data);
if (palette_type == GIMP_MAKE_PALETTE) if (palette_type == GIMP_MAKE_PALETTE)
{ {
@ -860,9 +853,7 @@ gimp_image_convert (GimpImage *gimage,
else else
generate_histogram_rgb (quantobj->histogram, generate_histogram_rgb (quantobj->histogram,
layer, num_cols, alpha_dither, layer, num_cols, alpha_dither,
progress_callback, progress, nth_layer, n_layers);
progress_data,
nth_layer, n_layers);
/* /*
* Note: generate_histogram_rgb may set needs_quantize if * Note: generate_histogram_rgb may set needs_quantize if
* the image contains more colours than the limit specified * the image contains more colours than the limit specified
@ -871,6 +862,10 @@ gimp_image_convert (GimpImage *gimage,
} }
} }
if (progress)
gimp_progress_set_text (progress,
_("Converting to indexed (stage 2)..."));
if (old_type == GIMP_RGB && if (old_type == GIMP_RGB &&
! needs_quantize && ! needs_quantize &&
palette_type == GIMP_MAKE_PALETTE) palette_type == GIMP_MAKE_PALETTE)
@ -890,8 +885,7 @@ gimp_image_convert (GimpImage *gimage,
GIMP_NODESTRUCT_DITHER, GIMP_NODESTRUCT_DITHER,
palette_type, palette_type,
alpha_dither, alpha_dither,
progress_callback, progress);
progress_data);
/* We can skip the first pass (palette creation) */ /* We can skip the first pass (palette creation) */
quantobj->actual_number_of_colors = num_found_cols; quantobj->actual_number_of_colors = num_found_cols;
@ -912,6 +906,10 @@ gimp_image_convert (GimpImage *gimage,
color_quicksort); color_quicksort);
} }
if (progress)
gimp_progress_set_text (progress,
_("Converting to indexed (stage 3)..."));
/* Initialise data which must persist across indexed layer iterations */ /* Initialise data which must persist across indexed layer iterations */
switch (new_type) switch (new_type)
{ {
@ -1301,14 +1299,13 @@ generate_histogram_gray (CFHistogram histogram,
static void static void
generate_histogram_rgb (CFHistogram histogram, generate_histogram_rgb (CFHistogram histogram,
GimpLayer *layer, GimpLayer *layer,
gint col_limit, gint col_limit,
gboolean alpha_dither, gboolean alpha_dither,
GimpImageConvertProgressCallback progress_callback, GimpProgress *progress,
gpointer progress_data, gint nth_layer,
gint nth_layer, gint n_layers)
gint n_layers)
{ {
PixelRegion srcPR; PixelRegion srcPR;
guchar *data; guchar *data;
@ -1335,8 +1332,8 @@ generate_histogram_rgb (CFHistogram histogram,
layer_size = GIMP_ITEM (layer)->width * GIMP_ITEM (layer)->height; layer_size = GIMP_ITEM (layer)->width * GIMP_ITEM (layer)->height;
if (progress_callback) if (progress)
progress_callback (1, 0.0, progress_data); gimp_progress_set_value (progress, 0.0);
for (pr = pixel_regions_register (1, &srcPR); for (pr = pixel_regions_register (1, &srcPR);
pr != NULL; pr != NULL;
@ -1483,11 +1480,10 @@ generate_histogram_rgb (CFHistogram histogram,
} }
} }
if (progress_callback) if (progress)
progress_callback (1, gimp_progress_set_value (progress,
(nth_layer + ((gdouble) total_size)/ (nth_layer + ((gdouble) total_size)/
layer_size) / (gdouble) n_layers, layer_size) / (gdouble) n_layers);
progress_data);
} }
/* g_print ("O: col_limit = %d, nfc = %d\n", col_limit, num_found_cols);*/ /* g_print ("O: col_limit = %d, nfc = %d\n", col_limit, num_found_cols);*/
@ -1496,10 +1492,10 @@ generate_histogram_rgb (CFHistogram histogram,
static boxptr static boxptr
find_split_candidate (const boxptr boxlist, find_split_candidate (const boxptr boxlist,
const int numboxes, const int numboxes,
axisType *which_axis, axisType *which_axis,
const int desired_colors) const int desired_colors)
{ {
boxptr boxp; boxptr boxp;
int i; int i;
@ -2123,16 +2119,15 @@ median_cut_gray (CFHistogram histogram,
} }
static int static int
median_cut_rgb (CFHistogram histogram, median_cut_rgb (CFHistogram histogram,
boxptr boxlist, boxptr boxlist,
int numboxes, int numboxes,
int desired_colors, int desired_colors,
GimpImageConvertProgressCallback progress_callback, GimpProgress *progress)
gpointer progress_data)
/* Repeatedly select and split the largest box until we have enough boxes */ /* Repeatedly select and split the largest box until we have enough boxes */
{ {
int lb; int lb;
boxptr b1,b2; boxptr b1, b2;
axisType which_axis; axisType which_axis;
while (numboxes < desired_colors) while (numboxes < desired_colors)
@ -2180,9 +2175,8 @@ median_cut_rgb (CFHistogram histogram,
/* Update stats for boxes */ /* Update stats for boxes */
numboxes++; numboxes++;
if (progress_callback) if (progress)
progress_callback (2, ((gdouble) numboxes) / desired_colors, gimp_progress_set_value (progress, (gdouble) numboxes / desired_colors);
progress_data);
update_box_rgb (histogram, b1, desired_colors - numboxes); update_box_rgb (histogram, b1, desired_colors - numboxes);
update_box_rgb (histogram, b2, desired_colors - numboxes); update_box_rgb (histogram, b2, desired_colors - numboxes);
@ -2413,8 +2407,7 @@ select_colors_rgb (QuantizeObj *quantobj,
update_box_rgb (histogram, &boxlist[0], quantobj->desired_number_of_colors); update_box_rgb (histogram, &boxlist[0], quantobj->desired_number_of_colors);
/* Perform median-cut to produce final box list */ /* Perform median-cut to produce final box list */
numboxes = median_cut_rgb (histogram, boxlist, numboxes, desired, numboxes = median_cut_rgb (histogram, boxlist, numboxes, desired,
quantobj->progress_callback, quantobj->progress);
quantobj->progress_data);
quantobj->actual_number_of_colors = numboxes; quantobj->actual_number_of_colors = numboxes;
/* Compute the representative color for each box, fill colormap */ /* Compute the representative color for each box, fill colormap */
@ -3154,11 +3147,10 @@ median_cut_pass2_no_dither_rgb (QuantizeObj *quantobj,
} }
} }
if (quantobj->progress_callback) if (quantobj->progress)
quantobj->progress_callback (3, gimp_progress_set_value (quantobj->progress,
(nth_layer + ((gdouble) total_size)/ (nth_layer + ((gdouble) total_size)/
layer_size) / (gdouble) n_layers, layer_size) / (gdouble) n_layers);
quantobj->progress_data);
} }
} }
@ -3289,11 +3281,10 @@ median_cut_pass2_fixed_dither_rgb (QuantizeObj *quantobj,
} }
} }
if (quantobj->progress_callback) if (quantobj->progress)
quantobj->progress_callback (3, gimp_progress_set_value (quantobj->progress,
(nth_layer + ((gdouble) total_size)/ (nth_layer + ((gdouble) total_size)/
layer_size) / (gdouble) n_layers, layer_size) / (gdouble) n_layers);
quantobj->progress_data);
} }
} }
@ -4029,11 +4020,10 @@ median_cut_pass2_fs_dither_rgb (QuantizeObj *quantobj,
pixel_region_set_row (&destPR, 0, row, width, dest_buf); pixel_region_set_row (&destPR, 0, row, width, dest_buf);
if (quantobj->progress_callback) if (quantobj->progress)
quantobj->progress_callback (3, gimp_progress_set_value (quantobj->progress,
(nth_layer + ((gdouble) row) / (nth_layer + ((gdouble) row) /
height) / (gdouble) n_layers, height) / (gdouble) n_layers);
quantobj->progress_data);
} }
g_free (error_limiter - 255); g_free (error_limiter - 255);
@ -4063,9 +4053,7 @@ initialize_median_cut (GimpImageBaseType type,
GimpConvertDitherType dither_type, GimpConvertDitherType dither_type,
GimpConvertPaletteType palette_type, GimpConvertPaletteType palette_type,
gboolean want_alpha_dither, gboolean want_alpha_dither,
GimpImageConvertProgressCallback progress_callback, GimpProgress *progress)
gpointer progress_data
)
{ {
QuantizeObj * quantobj; QuantizeObj * quantobj;
@ -4082,9 +4070,7 @@ initialize_median_cut (GimpImageBaseType type,
quantobj->desired_number_of_colors = num_colors; quantobj->desired_number_of_colors = num_colors;
quantobj->want_alpha_dither = want_alpha_dither; quantobj->want_alpha_dither = want_alpha_dither;
quantobj->progress = progress;
quantobj->progress_callback = progress_callback;
quantobj->progress_data = progress_data;
switch (type) switch (type)
{ {

View File

@ -22,10 +22,6 @@
#define MAXNUMCOLORS 256 #define MAXNUMCOLORS 256
typedef void (* GimpImageConvertProgressCallback) (gint stage,
gdouble progress,
gpointer data);
void gimp_image_convert (GimpImage *gimage, void gimp_image_convert (GimpImage *gimage,
GimpImageBaseType new_type, GimpImageBaseType new_type,
@ -38,8 +34,7 @@ void gimp_image_convert (GimpImage *gimage,
gboolean remove_dups, gboolean remove_dups,
GimpConvertPaletteType palette_type, GimpConvertPaletteType palette_type,
GimpPalette *custom_palette, GimpPalette *custom_palette,
GimpImageConvertProgressCallback progress_callback, GimpProgress *progress);
gpointer progress_data);
void gimp_drawable_convert_rgb (GimpDrawable *drawable, void gimp_drawable_convert_rgb (GimpDrawable *drawable,
TileManager *new_tiles, TileManager *new_tiles,

View File

@ -31,23 +31,24 @@
#include "gimpimage-undo-push.h" #include "gimpimage-undo-push.h"
#include "gimpitem.h" #include "gimpitem.h"
#include "gimplist.h" #include "gimplist.h"
#include "gimpprogress.h"
void void
gimp_image_flip (GimpImage *gimage, gimp_image_flip (GimpImage *gimage,
GimpContext *context, GimpContext *context,
GimpOrientationType flip_type, GimpOrientationType flip_type,
GimpProgressFunc progress_func, GimpProgress *progress)
gpointer progress_data)
{ {
GimpItem *item; GimpItem *item;
GList *list; GList *list;
gdouble axis; gdouble axis;
gint progress_max; gdouble progress_max;
gint progress_current = 1; gdouble progress_current = 1.0;
g_return_if_fail (GIMP_IS_IMAGE (gimage)); g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_return_if_fail (GIMP_IS_CONTEXT (context)); g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
gimp_set_busy (gimage->gimp); gimp_set_busy (gimage->gimp);
@ -82,8 +83,8 @@ gimp_image_flip (GimpImage *gimage,
gimp_item_flip (item, context, flip_type, axis, TRUE); gimp_item_flip (item, context, flip_type, axis, TRUE);
if (progress_func) if (progress)
(* progress_func) (0, progress_max, progress_current++, progress_data); gimp_progress_set_value (progress, progress_current++ / progress_max);
} }
/* Flip all vectors */ /* Flip all vectors */
@ -95,16 +96,16 @@ gimp_image_flip (GimpImage *gimage,
gimp_item_flip (item, context, flip_type, axis, FALSE); gimp_item_flip (item, context, flip_type, axis, FALSE);
if (progress_func) if (progress)
(* progress_func) (0, progress_max, progress_current++, progress_data); gimp_progress_set_value (progress, progress_current++ / progress_max);
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
gimp_item_flip (GIMP_ITEM (gimp_image_get_mask (gimage)), context, gimp_item_flip (GIMP_ITEM (gimp_image_get_mask (gimage)), context,
flip_type, axis, TRUE); flip_type, axis, TRUE);
if (progress_func) if (progress)
(* progress_func) (0, progress_max, progress_current++, progress_data); gimp_progress_set_value (progress, progress_current++ / progress_max);
/* Flip all layers */ /* Flip all layers */
for (list = GIMP_LIST (gimage->layers)->list; for (list = GIMP_LIST (gimage->layers)->list;
@ -115,8 +116,8 @@ gimp_image_flip (GimpImage *gimage,
gimp_item_flip (item, context, flip_type, axis, FALSE); gimp_item_flip (item, context, flip_type, axis, FALSE);
if (progress_func) if (progress)
(* progress_func) (0, progress_max, progress_current++, progress_data); gimp_progress_set_value (progress, progress_current++ / progress_max);
} }
/* Flip all Guides */ /* Flip all Guides */

View File

@ -23,8 +23,7 @@
void gimp_image_flip (GimpImage *gimage, void gimp_image_flip (GimpImage *gimage,
GimpContext *context, GimpContext *context,
GimpOrientationType flip_type, GimpOrientationType flip_type,
GimpProgressFunc progress_func, GimpProgress *progress);
gpointer progress_data);
#endif /* __GIMP_IMAGE_FLIP_H__ */ #endif /* __GIMP_IMAGE_FLIP_H__ */

View File

@ -31,27 +31,28 @@
#include "gimpimage-undo-push.h" #include "gimpimage-undo-push.h"
#include "gimplayer.h" #include "gimplayer.h"
#include "gimplist.h" #include "gimplist.h"
#include "gimpprogress.h"
#include "gimp-intl.h" #include "gimp-intl.h"
void void
gimp_image_resize (GimpImage *gimage, gimp_image_resize (GimpImage *gimage,
GimpContext *context, GimpContext *context,
gint new_width, gint new_width,
gint new_height, gint new_height,
gint offset_x, gint offset_x,
gint offset_y, gint offset_y,
GimpProgressFunc progress_func, GimpProgress *progress)
gpointer progress_data)
{ {
GList *list; GList *list;
gint progress_max; gdouble progress_max;
gint progress_current = 1; gdouble progress_current = 1.0;
g_return_if_fail (GIMP_IS_IMAGE (gimage)); g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_return_if_fail (GIMP_IS_CONTEXT (context)); g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (new_width > 0 && new_height > 0); g_return_if_fail (new_width > 0 && new_height > 0);
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
gimp_set_busy (gimage->gimp); gimp_set_busy (gimage->gimp);
@ -84,8 +85,8 @@ gimp_image_resize (GimpImage *gimage,
gimp_item_resize (item, context, gimp_item_resize (item, context,
new_width, new_height, offset_x, offset_y); new_width, new_height, offset_x, offset_y);
if (progress_func) if (progress)
(* progress_func) (0, progress_max, progress_current++, progress_data); gimp_progress_set_value (progress, progress_current++ / progress_max);
} }
/* Resize all vectors */ /* Resize all vectors */
@ -98,16 +99,16 @@ gimp_image_resize (GimpImage *gimage,
gimp_item_resize (item, context, gimp_item_resize (item, context,
new_width, new_height, offset_x, offset_y); new_width, new_height, offset_x, offset_y);
if (progress_func) if (progress)
(* progress_func) (0, progress_max, progress_current++, progress_data); gimp_progress_set_value (progress, progress_current++ / progress_max);
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
gimp_item_resize (GIMP_ITEM (gimp_image_get_mask (gimage)), context, gimp_item_resize (GIMP_ITEM (gimp_image_get_mask (gimage)), context,
new_width, new_height, offset_x, offset_y); new_width, new_height, offset_x, offset_y);
if (progress_func) if (progress)
(* progress_func) (0, progress_max, progress_current++, progress_data); gimp_progress_set_value (progress, progress_current++ / progress_max);
/* Reposition all layers */ /* Reposition all layers */
for (list = GIMP_LIST (gimage->layers)->list; for (list = GIMP_LIST (gimage->layers)->list;
@ -118,8 +119,8 @@ gimp_image_resize (GimpImage *gimage,
gimp_item_translate (item, offset_x, offset_y, TRUE); gimp_item_translate (item, offset_x, offset_y, TRUE);
if (progress_func) if (progress)
(* progress_func) (0, progress_max, progress_current++, progress_data); gimp_progress_set_value (progress, progress_current++ / progress_max);
} }
/* Reposition or remove all guides */ /* Reposition or remove all guides */

View File

@ -20,14 +20,13 @@
#define __GIMP_IMAGE_RESIZE_H__ #define __GIMP_IMAGE_RESIZE_H__
void gimp_image_resize (GimpImage *gimage, void gimp_image_resize (GimpImage *gimage,
GimpContext *context, GimpContext *context,
gint new_width, gint new_width,
gint new_height, gint new_height,
gint offset_x, gint offset_x,
gint offset_y, gint offset_y,
GimpProgressFunc progress_func, GimpProgress *progress);
gpointer progress_data);
#endif /* __GIMP_IMAGE_RESIZE_H__ */ #endif /* __GIMP_IMAGE_RESIZE_H__ */

View File

@ -31,6 +31,7 @@
#include "gimpimage-undo-push.h" #include "gimpimage-undo-push.h"
#include "gimpitem.h" #include "gimpitem.h"
#include "gimplist.h" #include "gimplist.h"
#include "gimpprogress.h"
static void gimp_image_rotate_item_offset (GimpImage *gimage, static void gimp_image_rotate_item_offset (GimpImage *gimage,
@ -46,21 +47,21 @@ void
gimp_image_rotate (GimpImage *gimage, gimp_image_rotate (GimpImage *gimage,
GimpContext *context, GimpContext *context,
GimpRotationType rotate_type, GimpRotationType rotate_type,
GimpProgressFunc progress_func, GimpProgress *progress)
gpointer progress_data)
{ {
GimpItem *item; GimpItem *item;
GList *list; GList *list;
gdouble center_x; gdouble center_x;
gdouble center_y; gdouble center_y;
gint progress_max; gdouble progress_max;
gint progress_current = 1; gdouble progress_current = 1.0;
gint new_image_width; gint new_image_width;
gint new_image_height; gint new_image_height;
gboolean size_changed; gboolean size_changed;
g_return_if_fail (GIMP_IS_IMAGE (gimage)); g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_return_if_fail (GIMP_IS_CONTEXT (context)); g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
gimp_set_busy (gimage->gimp); gimp_set_busy (gimage->gimp);
@ -109,8 +110,8 @@ gimp_image_rotate (GimpImage *gimage,
item->offset_x = 0; item->offset_x = 0;
item->offset_y = 0; item->offset_y = 0;
if (progress_func) if (progress)
(* progress_func) (0, progress_max, progress_current++, progress_data); gimp_progress_set_value (progress, progress_current++ / progress_max);
} }
/* Rotate all vectors */ /* Rotate all vectors */
@ -132,8 +133,8 @@ gimp_image_rotate (GimpImage *gimage,
(new_image_height - gimage->height) / 2, (new_image_height - gimage->height) / 2,
FALSE); FALSE);
if (progress_func) if (progress)
(* progress_func) (0, progress_max, progress_current++, progress_data); gimp_progress_set_value (progress, progress_current++ / progress_max);
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
@ -143,8 +144,8 @@ gimp_image_rotate (GimpImage *gimage,
GIMP_ITEM (gimage->selection_mask)->offset_x = 0; GIMP_ITEM (gimage->selection_mask)->offset_x = 0;
GIMP_ITEM (gimage->selection_mask)->offset_y = 0; GIMP_ITEM (gimage->selection_mask)->offset_y = 0;
if (progress_func) if (progress)
(* progress_func) (0, progress_max, progress_current++, progress_data); gimp_progress_set_value (progress, progress_current++ / progress_max);
/* Rotate all layers */ /* Rotate all layers */
for (list = GIMP_LIST (gimage->layers)->list; for (list = GIMP_LIST (gimage->layers)->list;
@ -161,8 +162,8 @@ gimp_image_rotate (GimpImage *gimage,
gimp_image_rotate_item_offset (gimage, rotate_type, item, off_x, off_y); gimp_image_rotate_item_offset (gimage, rotate_type, item, off_x, off_y);
if (progress_func) if (progress)
(* progress_func) (0, progress_max, progress_current++, progress_data); gimp_progress_set_value (progress, progress_current++ / progress_max);
} }
/* Rotate all Guides */ /* Rotate all Guides */

View File

@ -23,8 +23,7 @@
void gimp_image_rotate (GimpImage *gimage, void gimp_image_rotate (GimpImage *gimage,
GimpContext *context, GimpContext *context,
GimpRotationType rotate_type, GimpRotationType rotate_type,
GimpProgressFunc progress_func, GimpProgress *progress);
gpointer progress_data);
#endif /* __GIMP_IMAGE_ROTATE_H__ */ #endif /* __GIMP_IMAGE_ROTATE_H__ */

View File

@ -32,6 +32,7 @@
#include "gimpimage-undo-push.h" #include "gimpimage-undo-push.h"
#include "gimplayer.h" #include "gimplayer.h"
#include "gimplist.h" #include "gimplist.h"
#include "gimpprogress.h"
#include "gimp-intl.h" #include "gimp-intl.h"
@ -41,8 +42,7 @@ gimp_image_scale (GimpImage *gimage,
gint new_width, gint new_width,
gint new_height, gint new_height,
GimpInterpolationType interpolation_type, GimpInterpolationType interpolation_type,
GimpProgressFunc progress_func, GimpProgress *progress)
gpointer progress_data)
{ {
GimpItem *item; GimpItem *item;
GList *list; GList *list;
@ -51,11 +51,12 @@ gimp_image_scale (GimpImage *gimage,
gint old_height; gint old_height;
gdouble img_scale_w = 1.0; gdouble img_scale_w = 1.0;
gdouble img_scale_h = 1.0; gdouble img_scale_h = 1.0;
gint progress_max; gdouble progress_max;
gint progress_current = 1; gdouble progress_current = 1.0;
g_return_if_fail (GIMP_IS_IMAGE (gimage)); g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_return_if_fail (new_width > 0 && new_height > 0); g_return_if_fail (new_width > 0 && new_height > 0);
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
gimp_set_busy (gimage->gimp); gimp_set_busy (gimage->gimp);
@ -92,10 +93,10 @@ gimp_image_scale (GimpImage *gimage,
gimp_item_scale (item, gimp_item_scale (item,
new_width, new_height, 0, 0, new_width, new_height, 0, 0,
interpolation_type, NULL, NULL); interpolation_type, NULL);
if (progress_func) if (progress)
(* progress_func) (0, progress_max, progress_current++, progress_data); gimp_progress_set_value (progress, progress_current++ / progress_max);
} }
/* Scale all vectors */ /* Scale all vectors */
@ -107,19 +108,19 @@ gimp_image_scale (GimpImage *gimage,
gimp_item_scale (item, gimp_item_scale (item,
new_width, new_height, 0, 0, new_width, new_height, 0, 0,
interpolation_type, NULL, NULL); interpolation_type, NULL);
if (progress_func) if (progress)
(* progress_func) (0, progress_max, progress_current++, progress_data); gimp_progress_set_value (progress, progress_current++ / progress_max);
} }
/* Don't forget the selection mask! */ /* Don't forget the selection mask! */
gimp_item_scale (GIMP_ITEM (gimp_image_get_mask (gimage)), gimp_item_scale (GIMP_ITEM (gimp_image_get_mask (gimage)),
new_width, new_height, 0, 0, new_width, new_height, 0, 0,
interpolation_type, NULL, NULL); interpolation_type, NULL);
if (progress_func) if (progress)
(* progress_func) (0, progress_max, progress_current++, progress_data); gimp_progress_set_value (progress, progress_current++ / progress_max);
/* Scale all layers */ /* Scale all layers */
for (list = GIMP_LIST (gimage->layers)->list; for (list = GIMP_LIST (gimage->layers)->list;
@ -130,7 +131,7 @@ gimp_image_scale (GimpImage *gimage,
if (! gimp_item_scale_by_factors (item, if (! gimp_item_scale_by_factors (item,
img_scale_w, img_scale_h, img_scale_w, img_scale_h,
interpolation_type, NULL, NULL)) interpolation_type, NULL))
{ {
/* Since 0 < img_scale_w, img_scale_h, failure due to one or more /* Since 0 < img_scale_w, img_scale_h, failure due to one or more
* vanishing scaled layer dimensions. Implicit delete implemented * vanishing scaled layer dimensions. Implicit delete implemented
@ -140,8 +141,8 @@ gimp_image_scale (GimpImage *gimage,
remove = g_list_prepend (remove, item); remove = g_list_prepend (remove, item);
} }
if (progress_func) if (progress)
(* progress_func) (0, progress_max, progress_current++, progress_data); gimp_progress_set_value (progress, progress_current++ / progress_max);
} }
/* We defer removing layers lost to scaling until now so as not to mix /* We defer removing layers lost to scaling until now so as not to mix

View File

@ -24,8 +24,7 @@ void gimp_image_scale (GimpImage *gimage,
gint new_width, gint new_width,
gint new_height, gint new_height,
GimpInterpolationType interpolation_type, GimpInterpolationType interpolation_type,
GimpProgressFunc progress_func, GimpProgress *progress);
gpointer progress_data);
GimpImageScaleCheckType GimpImageScaleCheckType
gimp_image_scale_check (const GimpImage *gimage, gimp_image_scale_check (const GimpImage *gimage,

View File

@ -42,6 +42,7 @@
#include "gimpimage.h" #include "gimpimage.h"
#include "gimpimagefile.h" #include "gimpimagefile.h"
#include "gimpmarshal.h" #include "gimpmarshal.h"
#include "gimpprogress.h"
#include "file/file-open.h" #include "file/file-open.h"
#include "file/file-utils.h" #include "file/file-utils.h"
@ -55,6 +56,7 @@ enum
LAST_SIGNAL LAST_SIGNAL
}; };
static void gimp_imagefile_class_init (GimpImagefileClass *klass); static void gimp_imagefile_class_init (GimpImagefileClass *klass);
static void gimp_imagefile_init (GimpImagefile *imagefile); static void gimp_imagefile_init (GimpImagefile *imagefile);
static void gimp_imagefile_finalize (GObject *object); static void gimp_imagefile_finalize (GObject *object);
@ -233,12 +235,14 @@ gimp_imagefile_update (GimpImagefile *imagefile)
void void
gimp_imagefile_create_thumbnail (GimpImagefile *imagefile, gimp_imagefile_create_thumbnail (GimpImagefile *imagefile,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
gint size) gint size)
{ {
GimpThumbnail *thumbnail; GimpThumbnail *thumbnail;
g_return_if_fail (GIMP_IS_IMAGEFILE (imagefile)); g_return_if_fail (GIMP_IS_IMAGEFILE (imagefile));
g_return_if_fail (GIMP_IS_CONTEXT (context)); g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
if (! imagefile->gimp->config->layer_previews) if (! imagefile->gimp->config->layer_previews)
return; return;
@ -259,8 +263,7 @@ gimp_imagefile_create_thumbnail (GimpImagefile *imagefile,
const gchar *mime_type = NULL; const gchar *mime_type = NULL;
GError *error = NULL; GError *error = NULL;
gimage = file_open_image (imagefile->gimp, gimage = file_open_image (imagefile->gimp, context, progress,
context,
thumbnail->image_uri, thumbnail->image_uri,
thumbnail->image_uri, thumbnail->image_uri,
NULL, NULL,

View File

@ -66,6 +66,7 @@ GimpImagefile * gimp_imagefile_new (Gimp *gimp,
void gimp_imagefile_update (GimpImagefile *imagefile); void gimp_imagefile_update (GimpImagefile *imagefile);
void gimp_imagefile_create_thumbnail (GimpImagefile *imagefile, void gimp_imagefile_create_thumbnail (GimpImagefile *imagefile,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
gint thumb_size); gint thumb_size);
gboolean gimp_imagefile_save_thumbnail (GimpImagefile *imagefile, gboolean gimp_imagefile_save_thumbnail (GimpImagefile *imagefile,
GimpImage *gimage); GimpImage *gimage);

View File

@ -27,6 +27,7 @@
#include "gimpitem.h" #include "gimpitem.h"
#include "gimpitem-linked.h" #include "gimpitem-linked.h"
#include "gimplist.h" #include "gimplist.h"
#include "gimpprogress.h"
/* public functions */ /* public functions */
@ -134,8 +135,7 @@ gimp_item_linked_transform (GimpItem *item,
gboolean supersample, gboolean supersample,
gint recursion_level, gint recursion_level,
gboolean clip_result, gboolean clip_result,
GimpProgressFunc progress_callback, GimpProgress *progress)
gpointer progress_data)
{ {
GimpImage *gimage; GimpImage *gimage;
GList *linked_list; GList *linked_list;
@ -144,6 +144,7 @@ gimp_item_linked_transform (GimpItem *item,
g_return_if_fail (GIMP_IS_ITEM (item)); g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (GIMP_IS_CONTEXT (context)); g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (gimp_item_get_linked (item) == TRUE); g_return_if_fail (gimp_item_get_linked (item) == TRUE);
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
gimage = gimp_item_get_image (item); gimage = gimp_item_get_image (item);
@ -156,8 +157,7 @@ gimp_item_linked_transform (GimpItem *item,
matrix, direction, matrix, direction,
interpolation_type, interpolation_type,
supersample, recursion_level, supersample, recursion_level,
clip_result, clip_result, progress);
progress_callback, progress_data);
g_list_free (linked_list); g_list_free (linked_list);
} }

View File

@ -55,8 +55,7 @@ void gimp_item_linked_transform (GimpItem *item,
gboolean supersample, gboolean supersample,
gint recursion_level, gint recursion_level,
gboolean clip_result, gboolean clip_result,
GimpProgressFunc progress_callback, GimpProgress *progress);
gpointer progress_data);
GList * gimp_item_linked_get_list (GimpImage *gimage, GList * gimp_item_linked_get_list (GimpImage *gimage,
GimpItem *item, GimpItem *item,

View File

@ -39,6 +39,7 @@
#include "gimpmarshal.h" #include "gimpmarshal.h"
#include "gimppaintinfo.h" #include "gimppaintinfo.h"
#include "gimpparasitelist.h" #include "gimpparasitelist.h"
#include "gimpprogress.h"
#include "gimpstrokeoptions.h" #include "gimpstrokeoptions.h"
#include "gimp-intl.h" #include "gimp-intl.h"
@ -83,8 +84,7 @@ static void gimp_item_real_scale (GimpItem *item,
gint new_offset_x, gint new_offset_x,
gint new_offset_y, gint new_offset_y,
GimpInterpolationType interpolation, GimpInterpolationType interpolation,
GimpProgressFunc progress_callback, GimpProgress *progress);
gpointer progress_data);
static void gimp_item_real_resize (GimpItem *item, static void gimp_item_real_resize (GimpItem *item,
GimpContext *context, GimpContext *context,
gint new_width, gint new_width,
@ -345,8 +345,7 @@ gimp_item_real_scale (GimpItem *item,
gint new_offset_x, gint new_offset_x,
gint new_offset_y, gint new_offset_y,
GimpInterpolationType interpolation, GimpInterpolationType interpolation,
GimpProgressFunc progress_callback, GimpProgress *progress)
gpointer progress_data)
{ {
item->width = new_width; item->width = new_width;
item->height = new_height; item->height = new_height;
@ -700,13 +699,13 @@ gimp_item_scale (GimpItem *item,
gint new_offset_x, gint new_offset_x,
gint new_offset_y, gint new_offset_y,
GimpInterpolationType interpolation, GimpInterpolationType interpolation,
GimpProgressFunc progress_callback, GimpProgress *progress)
gpointer progress_data)
{ {
GimpItemClass *item_class; GimpItemClass *item_class;
GimpImage *gimage; GimpImage *gimage;
g_return_if_fail (GIMP_IS_ITEM (item)); g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
if (new_width < 1 || new_height < 1) if (new_width < 1 || new_height < 1)
return; return;
@ -718,7 +717,7 @@ gimp_item_scale (GimpItem *item,
item_class->scale_desc); item_class->scale_desc);
item_class->scale (item, new_width, new_height, new_offset_x, new_offset_y, item_class->scale (item, new_width, new_height, new_offset_x, new_offset_y,
interpolation, progress_callback, progress_data); interpolation, progress);
gimp_image_undo_group_end (gimage); gimp_image_undo_group_end (gimage);
} }
@ -729,8 +728,7 @@ gimp_item_scale (GimpItem *item,
* @w_factor: scale factor to apply to width and horizontal offset * @w_factor: scale factor to apply to width and horizontal offset
* @h_factor: scale factor to apply to height and vertical offset * @h_factor: scale factor to apply to height and vertical offset
* @interpolation: * @interpolation:
* @progress_callback: * @progress:
* @progress_data:
* *
* Scales item dimensions and offsets by uniform width and * Scales item dimensions and offsets by uniform width and
* height factors. * height factors.
@ -759,13 +757,13 @@ gimp_item_scale_by_factors (GimpItem *item,
gdouble w_factor, gdouble w_factor,
gdouble h_factor, gdouble h_factor,
GimpInterpolationType interpolation, GimpInterpolationType interpolation,
GimpProgressFunc progress_callback, GimpProgress *progress)
gpointer progress_data)
{ {
gint new_width, new_height; gint new_width, new_height;
gint new_offset_x, new_offset_y; gint new_offset_x, new_offset_y;
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE); g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), FALSE);
if (w_factor == 0.0 || h_factor == 0.0) if (w_factor == 0.0 || h_factor == 0.0)
{ {
@ -783,7 +781,7 @@ gimp_item_scale_by_factors (GimpItem *item,
gimp_item_scale (item, gimp_item_scale (item,
new_width, new_height, new_width, new_height,
new_offset_x, new_offset_y, new_offset_x, new_offset_y,
interpolation, progress_callback, progress_data); interpolation, progress);
return TRUE; return TRUE;
} }
@ -796,8 +794,7 @@ gimp_item_scale_by_factors (GimpItem *item,
* @new_width: The width that item will acquire * @new_width: The width that item will acquire
* @new_height: The height that the item will acquire * @new_height: The height that the item will acquire
* @interpolation: * @interpolation:
* @progress_callback: * @progress:
* @progress_data:
* @local_origin: sets fixed point of the scaling transform. See below. * @local_origin: sets fixed point of the scaling transform. See below.
* *
* Sets item dimensions to new_width and * Sets item dimensions to new_width and
@ -824,13 +821,13 @@ gimp_item_scale_by_origin (GimpItem *item,
gint new_width, gint new_width,
gint new_height, gint new_height,
GimpInterpolationType interpolation, GimpInterpolationType interpolation,
GimpProgressFunc progress_callback, GimpProgress *progress,
gpointer progress_data,
gboolean local_origin) gboolean local_origin)
{ {
gint new_offset_x, new_offset_y; gint new_offset_x, new_offset_y;
g_return_if_fail (GIMP_IS_ITEM (item)); g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
if (new_width == 0 || new_height == 0) if (new_width == 0 || new_height == 0)
{ {
@ -857,7 +854,7 @@ gimp_item_scale_by_origin (GimpItem *item,
gimp_item_scale (item, gimp_item_scale (item,
new_width, new_height, new_width, new_height,
new_offset_x, new_offset_y, new_offset_x, new_offset_y,
interpolation, progress_callback, progress_data); interpolation, progress);
} }
void void
@ -947,14 +944,15 @@ gimp_item_transform (GimpItem *item,
gboolean supersample, gboolean supersample,
gint recursion_level, gint recursion_level,
gboolean clip_result, gboolean clip_result,
GimpProgressFunc progress_callback, GimpProgress *progress)
gpointer progress_data)
{ {
GimpItemClass *item_class; GimpItemClass *item_class;
GimpImage *gimage; GimpImage *gimage;
g_return_if_fail (GIMP_IS_ITEM (item)); g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (GIMP_IS_CONTEXT (context)); g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (matrix != NULL);
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
item_class = GIMP_ITEM_GET_CLASS (item); item_class = GIMP_ITEM_GET_CLASS (item);
gimage = gimp_item_get_image (item); gimage = gimp_item_get_image (item);
@ -964,8 +962,7 @@ gimp_item_transform (GimpItem *item,
item_class->transform (item, context, matrix, direction, interpolation, item_class->transform (item, context, matrix, direction, interpolation,
supersample, recursion_level, supersample, recursion_level,
clip_result, clip_result, progress);
progress_callback, progress_data);
gimp_image_undo_group_end (gimage); gimp_image_undo_group_end (gimage);
} }

View File

@ -85,8 +85,7 @@ struct _GimpItemClass
gint new_offset_x, gint new_offset_x,
gint new_offset_y, gint new_offset_y,
GimpInterpolationType interpolation_type, GimpInterpolationType interpolation_type,
GimpProgressFunc progress_callback, GimpProgress *progress);
gpointer progress_data);
void (* resize) (GimpItem *item, void (* resize) (GimpItem *item,
GimpContext *context, GimpContext *context,
gint new_width, gint new_width,
@ -112,8 +111,7 @@ struct _GimpItemClass
gboolean supersample, gboolean supersample,
gint recursion_level, gint recursion_level,
gboolean clip_result, gboolean clip_result,
GimpProgressFunc progress_callback, GimpProgress *progress);
gpointer progress_data);
gboolean (* stroke) (GimpItem *item, gboolean (* stroke) (GimpItem *item,
GimpDrawable *drawable, GimpDrawable *drawable,
GimpContext *context, GimpContext *context,
@ -180,21 +178,18 @@ void gimp_item_scale (GimpItem *item,
gint new_offset_x, gint new_offset_x,
gint new_offset_y, gint new_offset_y,
GimpInterpolationType interpolation, GimpInterpolationType interpolation,
GimpProgressFunc progress_callback, GimpProgress *progress);
gpointer progress_data);
gboolean gimp_item_scale_by_factors (GimpItem *item, gboolean gimp_item_scale_by_factors (GimpItem *item,
gdouble w_factor, gdouble w_factor,
gdouble h_factor, gdouble h_factor,
GimpInterpolationType interpolation, GimpInterpolationType interpolation,
GimpProgressFunc progress_callback, GimpProgress *progress);
gpointer progress_data);
void gimp_item_scale_by_origin (GimpItem *item, void gimp_item_scale_by_origin (GimpItem *item,
gint new_width, gint new_width,
gint new_height, gint new_height,
GimpInterpolationType interpolation, GimpInterpolationType interpolation,
GimpProgressFunc progress_callback, GimpProgress *progress,
gpointer progress_data, gboolean local_origin);
gboolean local_origin);
void gimp_item_resize (GimpItem *item, void gimp_item_resize (GimpItem *item,
GimpContext *context, GimpContext *context,
gint new_width, gint new_width,
@ -222,8 +217,7 @@ void gimp_item_transform (GimpItem *item,
gboolean supersample, gboolean supersample,
gint recursion_level, gint recursion_level,
gboolean clip_result, gboolean clip_result,
GimpProgressFunc progress_callback, GimpProgress *progress);
gpointer progress_data);
gboolean gimp_item_stroke (GimpItem *item, gboolean gimp_item_stroke (GimpItem *item,
GimpDrawable *drawable, GimpDrawable *drawable,

View File

@ -94,8 +94,7 @@ static void gimp_layer_scale (GimpItem *item,
gint new_offset_x, gint new_offset_x,
gint new_offset_y, gint new_offset_y,
GimpInterpolationType interp_type, GimpInterpolationType interp_type,
GimpProgressFunc progress_callback, GimpProgress *progress);
gpointer progress_data);
static void gimp_layer_resize (GimpItem *item, static void gimp_layer_resize (GimpItem *item,
GimpContext *context, GimpContext *context,
gint new_width, gint new_width,
@ -121,9 +120,7 @@ static void gimp_layer_transform (GimpItem *item,
gboolean supersample, gboolean supersample,
gint recursion_level, gint recursion_level,
gboolean clip_result, gboolean clip_result,
GimpProgressFunc progress_callback, GimpProgress *progress);
gpointer progress_data);
static void gimp_layer_invalidate_boundary (GimpDrawable *drawable); static void gimp_layer_invalidate_boundary (GimpDrawable *drawable);
static void gimp_layer_get_active_components (const GimpDrawable *drawable, static void gimp_layer_get_active_components (const GimpDrawable *drawable,
gboolean *active); gboolean *active);
@ -649,21 +646,19 @@ gimp_layer_scale (GimpItem *item,
gint new_offset_x, gint new_offset_x,
gint new_offset_y, gint new_offset_y,
GimpInterpolationType interpolation_type, GimpInterpolationType interpolation_type,
GimpProgressFunc progress_callback, GimpProgress *progress)
gpointer progress_data)
{ {
GimpLayer *layer = GIMP_LAYER (item); GimpLayer *layer = GIMP_LAYER (item);
GIMP_ITEM_CLASS (parent_class)->scale (item, new_width, new_height, GIMP_ITEM_CLASS (parent_class)->scale (item, new_width, new_height,
new_offset_x, new_offset_y, new_offset_x, new_offset_y,
interpolation_type, interpolation_type, progress);
progress_callback, progress_data);
if (layer->mask) if (layer->mask)
gimp_item_scale (GIMP_ITEM (layer->mask), gimp_item_scale (GIMP_ITEM (layer->mask),
new_width, new_height, new_width, new_height,
new_offset_x, new_offset_y, new_offset_x, new_offset_y,
interpolation_type, NULL, NULL); interpolation_type, progress);
} }
static void static void
@ -729,24 +724,21 @@ gimp_layer_transform (GimpItem *item,
gboolean supersample, gboolean supersample,
gint recursion_level, gint recursion_level,
gboolean clip_result, gboolean clip_result,
GimpProgressFunc progress_callback, GimpProgress *progress)
gpointer progress_data)
{ {
GimpLayer *layer = GIMP_LAYER (item); GimpLayer *layer = GIMP_LAYER (item);
GIMP_ITEM_CLASS (parent_class)->transform (item, context, matrix, direction, GIMP_ITEM_CLASS (parent_class)->transform (item, context, matrix, direction,
interpolation_type, interpolation_type,
supersample, recursion_level, supersample, recursion_level,
clip_result, clip_result, progress);
progress_callback, progress_data);
if (layer->mask) if (layer->mask)
gimp_item_transform (GIMP_ITEM (layer->mask), context, gimp_item_transform (GIMP_ITEM (layer->mask), context,
matrix, direction, matrix, direction,
interpolation_type, interpolation_type,
supersample, recursion_level, supersample, recursion_level,
clip_result, clip_result, progress);
progress_callback, progress_data);
} }
static void static void

196
app/core/gimpprogress.c Normal file
View File

@ -0,0 +1,196 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpprogress.c
* Copyright (C) 2004 Michael Natterer <mitch@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <glib-object.h>
#include "core-types.h"
#include "gimpmarshal.h"
#include "gimpprogress.h"
#include "gimp-intl.h"
enum
{
CANCEL,
LAST_SIGNAL
};
/* local function prototypes */
static void gimp_progress_iface_base_init (GimpProgressInterface *progress_iface);
static guint progress_signals[LAST_SIGNAL] = { 0 };
GType
gimp_progress_interface_get_type (void)
{
static GType progress_iface_type = 0;
if (! progress_iface_type)
{
static const GTypeInfo progress_iface_info =
{
sizeof (GimpProgressInterface),
(GBaseInitFunc) gimp_progress_iface_base_init,
(GBaseFinalizeFunc) NULL,
};
progress_iface_type = g_type_register_static (G_TYPE_INTERFACE,
"GimpProgressInterface",
&progress_iface_info,
0);
g_type_interface_add_prerequisite (progress_iface_type, G_TYPE_OBJECT);
}
return progress_iface_type;
}
static void
gimp_progress_iface_base_init (GimpProgressInterface *progress_iface)
{
static gboolean initialized = FALSE;
if (! initialized)
{
progress_signals[CANCEL] =
g_signal_new ("cancel",
G_TYPE_FROM_INTERFACE (progress_iface),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpProgressInterface, cancel),
NULL, NULL,
gimp_marshal_VOID__VOID,
G_TYPE_NONE, 0);
initialized = TRUE;
}
}
GimpProgress *
gimp_progress_start (GimpProgress *progress,
const gchar *message,
gboolean cancelable)
{
GimpProgressInterface *progress_iface;
g_return_val_if_fail (GIMP_IS_PROGRESS (progress), NULL);
if (! message || ! strlen (message))
message = _("Please wait...");
progress_iface = GIMP_PROGRESS_GET_INTERFACE (progress);
if (progress_iface->start)
return progress_iface->start (progress, message, cancelable);
return NULL;
}
void
gimp_progress_end (GimpProgress *progress)
{
GimpProgressInterface *progress_iface;
g_return_if_fail (GIMP_IS_PROGRESS (progress));
progress_iface = GIMP_PROGRESS_GET_INTERFACE (progress);
if (progress_iface->end)
progress_iface->end (progress);
}
void
gimp_progress_set_text (GimpProgress *progress,
const gchar *message)
{
GimpProgressInterface *progress_iface;
g_return_if_fail (GIMP_IS_PROGRESS (progress));
if (! message || ! strlen (message))
message = _("Please wait...");
progress_iface = GIMP_PROGRESS_GET_INTERFACE (progress);
if (progress_iface->set_text)
progress_iface->set_text (progress, message);
}
void
gimp_progress_set_value (GimpProgress *progress,
gdouble percentage)
{
GimpProgressInterface *progress_iface;
g_return_if_fail (GIMP_IS_PROGRESS (progress));
percentage = CLAMP (percentage, 0.0, 1.0);
progress_iface = GIMP_PROGRESS_GET_INTERFACE (progress);
if (progress_iface->set_value)
progress_iface->set_value (progress, percentage);
}
gdouble
gimp_progress_get_value (GimpProgress *progress)
{
GimpProgressInterface *progress_iface;
g_return_val_if_fail (GIMP_IS_PROGRESS (progress), 0.0);
progress_iface = GIMP_PROGRESS_GET_INTERFACE (progress);
if (progress_iface->get_value)
return progress_iface->get_value (progress);
return 0.0;
}
void
gimp_progress_cancel (GimpProgress *progress)
{
g_return_if_fail (GIMP_IS_PROGRESS (progress));
g_signal_emit (progress, progress_signals[CANCEL], 0);
}
void
gimp_progress_update_and_flush (gint min,
gint max,
gint current,
gpointer data)
{
gimp_progress_set_value (GIMP_PROGRESS (data),
(gfloat) (current - min) / (gfloat) (max - min));
while (g_main_context_pending (NULL))
g_main_context_iteration (NULL, TRUE);
}

76
app/core/gimpprogress.h Normal file
View File

@ -0,0 +1,76 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpprogress.h
* Copyright (C) 2004 Michael Natterer <mitch@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_PROGRESS_H__
#define __GIMP_PROGRESS_H__
#define GIMP_TYPE_PROGRESS (gimp_progress_interface_get_type ())
#define GIMP_IS_PROGRESS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_PROGRESS))
#define GIMP_PROGRESS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PROGRESS, GimpProgress))
#define GIMP_PROGRESS_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GIMP_TYPE_PROGRESS, GimpProgressInterface))
typedef struct _GimpProgressInterface GimpProgressInterface;
struct _GimpProgressInterface
{
GTypeInterface base_iface;
/* virtual functions */
GimpProgress * (* start) (GimpProgress *progress,
const gchar *message,
gboolean cancelable);
void (* end) (GimpProgress *progress);
void (* set_text) (GimpProgress *progress,
const gchar *message);
void (* set_value) (GimpProgress *progress,
gdouble percentage);
gdouble (* get_value) (GimpProgress *progress);
/* signals */
void (* cancel) (GimpProgress *progress);
};
GType gimp_progress_interface_get_type (void) G_GNUC_CONST;
GimpProgress * gimp_progress_start (GimpProgress *progress,
const gchar *message,
gboolean cancelable);
void gimp_progress_end (GimpProgress *progress);
void gimp_progress_set_text (GimpProgress *progress,
const gchar *message);
void gimp_progress_set_value (GimpProgress *progress,
gdouble percentage);
gdouble gimp_progress_get_value (GimpProgress *progress);
void gimp_progress_cancel (GimpProgress *progress);
void gimp_progress_update_and_flush (gint min,
gint max,
gint current,
gpointer data);
#endif /* __GIMP_PROGRESS_H__ */

View File

@ -56,8 +56,7 @@ static void gimp_selection_scale (GimpItem *item,
gint new_offset_x, gint new_offset_x,
gint new_offset_y, gint new_offset_y,
GimpInterpolationType interp_type, GimpInterpolationType interp_type,
GimpProgressFunc progress_callback, GimpProgress *progress);
gpointer progress_data);
static void gimp_selection_resize (GimpItem *item, static void gimp_selection_resize (GimpItem *item,
GimpContext *context, GimpContext *context,
gint new_width, gint new_width,
@ -240,13 +239,11 @@ gimp_selection_scale (GimpItem *item,
gint new_offset_x, gint new_offset_x,
gint new_offset_y, gint new_offset_y,
GimpInterpolationType interp_type, GimpInterpolationType interp_type,
GimpProgressFunc progress_callback, GimpProgress *progress)
gpointer progress_data)
{ {
GIMP_ITEM_CLASS (parent_class)->scale (item, new_width, new_height, GIMP_ITEM_CLASS (parent_class)->scale (item, new_width, new_height,
new_offset_x, new_offset_y, new_offset_x, new_offset_y,
interp_type, interp_type, progress);
progress_callback, progress_data);
item->offset_x = 0; item->offset_x = 0;
item->offset_y = 0; item->offset_y = 0;

View File

@ -30,18 +30,18 @@
#include "core/gimpimage-convert.h" #include "core/gimpimage-convert.h"
#include "core/gimplist.h" #include "core/gimplist.h"
#include "core/gimppalette.h" #include "core/gimppalette.h"
#include "core/gimpprogress.h"
#include "widgets/gimpenumwidgets.h" #include "widgets/gimpenumwidgets.h"
#include "widgets/gimphelp-ids.h" #include "widgets/gimphelp-ids.h"
#include "widgets/gimppaletteselect.h" #include "widgets/gimppaletteselect.h"
#include "widgets/gimpviewabledialog.h" #include "widgets/gimpviewabledialog.h"
#include "display/gimpprogress.h"
#include "menus/menus.h" #include "menus/menus.h"
#include "gimp-intl.h" #include "gimp-intl.h"
typedef struct typedef struct
{ {
GtkWidget *shell; GtkWidget *shell;
@ -55,8 +55,6 @@ typedef struct
gint palette; gint palette;
GimpConvertPaletteType palette_type; GimpConvertPaletteType palette_type;
GimpDisplay *gdisp; GimpDisplay *gdisp;
GimpProgress *progress;
gint current_stage;
} IndexedDialog; } IndexedDialog;
@ -412,28 +410,6 @@ build_palette_button (Gimp *gimp)
return gtk_button_new_with_label (GIMP_OBJECT (theCustomPalette)->name); return gtk_button_new_with_label (GIMP_OBJECT (theCustomPalette)->name);
} }
static void
progress_callback (gint stage,
gdouble percentage,
gpointer data)
{
IndexedDialog *dialog = data;
if (stage != dialog->current_stage)
{
gchar buffer[1024];
g_snprintf (buffer, sizeof (buffer), _("Stage %d"), stage);
dialog->current_stage = stage;
dialog->progress = gimp_progress_restart (dialog->progress,
buffer, NULL, NULL);
}
gimp_progress_update (dialog->progress, percentage);
}
static void static void
indexed_response (GtkWidget *widget, indexed_response (GtkWidget *widget,
gint response_id, gint response_id,
@ -441,9 +417,11 @@ indexed_response (GtkWidget *widget,
{ {
if (response_id == GTK_RESPONSE_OK) if (response_id == GTK_RESPONSE_OK)
{ {
dialog->current_stage = 1; GimpProgress *progress;
dialog->progress = gimp_progress_start (dialog->gdisp, _("Stage 1"),
FALSE, NULL, NULL); progress = gimp_progress_start (GIMP_PROGRESS (dialog->gdisp),
_("Converting to indexed..."), FALSE);
/* Convert the image to indexed color */ /* Convert the image to indexed color */
gimp_image_convert (dialog->gimage, gimp_image_convert (dialog->gimage,
GIMP_INDEXED, GIMP_INDEXED,
@ -453,10 +431,11 @@ indexed_response (GtkWidget *widget,
dialog->remove_dups, dialog->remove_dups,
dialog->palette_type, dialog->palette_type,
theCustomPalette, theCustomPalette,
progress_callback, progress);
dialog);
if (progress)
gimp_progress_end (progress);
gimp_progress_end (dialog->progress);
gimp_image_flush (dialog->gimage); gimp_image_flush (dialog->gimage);
/* Save defaults for next time */ /* Save defaults for next time */

View File

@ -29,6 +29,7 @@
#include "core/gimp.h" #include "core/gimp.h"
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "core/gimpprogress.h"
#include "file/file-open.h" #include "file/file-open.h"
#include "file/file-utils.h" #include "file/file-utils.h"
@ -118,6 +119,7 @@ file_open_dialog_response (GtkWidget *open_dialog,
{ {
GSList *uris; GSList *uris;
GSList *list; GSList *list;
gboolean success = FALSE;
if (response_id != GTK_RESPONSE_OK) if (response_id != GTK_RESPONSE_OK)
{ {
@ -141,13 +143,18 @@ file_open_dialog_response (GtkWidget *open_dialog,
list->data, list->data,
GIMP_FILE_DIALOG (open_dialog)->file_proc)) GIMP_FILE_DIALOG (open_dialog)->file_proc))
{ {
gtk_widget_hide (open_dialog); success = TRUE;
gdk_window_raise (open_dialog->window);
} }
} }
g_free (filename); g_free (filename);
} }
if (success)
gtk_widget_hide (open_dialog);
gtk_widget_set_sensitive (open_dialog, TRUE); gtk_widget_set_sensitive (open_dialog, TRUE);
g_slist_foreach (uris, (GFunc) g_free, NULL); g_slist_foreach (uris, (GFunc) g_free, NULL);
@ -167,6 +174,7 @@ file_open_dialog_open_image (GtkWidget *open_dialog,
gimage = file_open_with_proc_and_display (gimp, gimage = file_open_with_proc_and_display (gimp,
gimp_get_user_context (gimp), gimp_get_user_context (gimp),
GIMP_PROGRESS (open_dialog),
uri, uri,
entered_filename, entered_filename,
load_proc, load_proc,

View File

@ -157,9 +157,12 @@ file_open_location_response (GtkWidget *dialog,
{ {
uri = file_utils_filename_to_uri (gimp->load_procs, text, NULL); uri = file_utils_filename_to_uri (gimp->load_procs, text, NULL);
} }
#ifdef __GNUC__
#warning FIXME: add progress bar to open location dialog
#endif
image = file_open_with_proc_and_display (gimp, image = file_open_with_proc_and_display (gimp,
gimp_get_user_context (gimp), gimp_get_user_context (gimp),
NULL,
uri, text, NULL, uri, text, NULL,
&status, &error); &status, &error);

View File

@ -29,6 +29,7 @@
#include "core/gimp.h" #include "core/gimp.h"
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "core/gimpprogress.h"
#include "file/file-save.h" #include "file/file-save.h"
#include "file/file-utils.h" #include "file/file-utils.h"
@ -300,6 +301,7 @@ file_save_dialog_save_image (GtkWidget *save_dialog,
status = file_save_as (gimage, status = file_save_as (gimage,
gimp_get_user_context (gimage->gimp), gimp_get_user_context (gimage->gimp),
GIMP_PROGRESS (save_dialog),
uri, uri,
raw_filename, raw_filename,
save_proc, save_proc,

View File

@ -64,8 +64,6 @@ libappdisplay_a_sources = \
gimpdisplayshell-transform.h \ gimpdisplayshell-transform.h \
gimpnavigationview.c \ gimpnavigationview.c \
gimpnavigationview.h \ gimpnavigationview.h \
gimpprogress.c \
gimpprogress.h \
gimpscalecombobox.c \ gimpscalecombobox.c \
gimpscalecombobox.h \ gimpscalecombobox.h \
gimpstatusbar.c \ gimpstatusbar.c \

View File

@ -27,6 +27,7 @@
#include "core/gimparea.h" #include "core/gimparea.h"
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "core/gimplist.h" #include "core/gimplist.h"
#include "core/gimpprogress.h"
#include "tools/gimptool.h" #include "tools/gimptool.h"
#include "tools/tool_manager.h" #include "tools/tool_manager.h"
@ -50,25 +51,39 @@ enum
/* local function prototypes */ /* local function prototypes */
static void gimp_display_class_init (GimpDisplayClass *klass); static void gimp_display_class_init (GimpDisplayClass *klass);
static void gimp_display_init (GimpDisplay *gdisp); static void gimp_display_init (GimpDisplay *gdisp);
static void gimp_display_progress_iface_init (GimpProgressInterface *progress_iface);
static void gimp_display_set_property (GObject *object, static void gimp_display_set_property (GObject *object,
guint property_id, guint property_id,
const GValue *value, const GValue *value,
GParamSpec *pspec); GParamSpec *pspec);
static void gimp_display_get_property (GObject *object, static void gimp_display_get_property (GObject *object,
guint property_id, guint property_id,
GValue *value, GValue *value,
GParamSpec *pspec); GParamSpec *pspec);
static void gimp_display_flush_whenever (GimpDisplay *gdisp, static GimpProgress *
gboolean now); gimp_display_progress_start (GimpProgress *progress,
static void gimp_display_paint_area (GimpDisplay *gdisp, const gchar *message,
gint x, gboolean cancelable);
gint y, static void gimp_display_progress_end (GimpProgress *progress);
gint w, static void gimp_display_progress_set_text (GimpProgress *progress,
gint h); const gchar *message);
static void gimp_display_progress_set_value (GimpProgress *progress,
gdouble percentage);
static gdouble gimp_display_progress_get_value (GimpProgress *progress);
static void gimp_display_progress_canceled (GimpProgress *progress,
GimpDisplay *display);
static void gimp_display_flush_whenever (GimpDisplay *gdisp,
gboolean now);
static void gimp_display_paint_area (GimpDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
static GimpObjectClass *parent_class = NULL; static GimpObjectClass *parent_class = NULL;
@ -94,9 +109,19 @@ gimp_display_get_type (void)
(GInstanceInitFunc) gimp_display_init, (GInstanceInitFunc) gimp_display_init,
}; };
static const GInterfaceInfo progress_iface_info =
{
(GInterfaceInitFunc) gimp_display_progress_iface_init,
NULL, /* iface_finalize */
NULL /* iface_data */
};
display_type = g_type_register_static (GIMP_TYPE_OBJECT, display_type = g_type_register_static (GIMP_TYPE_OBJECT,
"GimpDisplay", "GimpDisplay",
&display_info, 0); &display_info, 0);
g_type_add_interface_static (display_type, GIMP_TYPE_PROGRESS,
&progress_iface_info);
} }
return display_type; return display_type;
@ -139,6 +164,16 @@ gimp_display_init (GimpDisplay *gdisp)
gdisp->update_areas = NULL; gdisp->update_areas = NULL;
} }
static void
gimp_display_progress_iface_init (GimpProgressInterface *progress_iface)
{
progress_iface->start = gimp_display_progress_start;
progress_iface->end = gimp_display_progress_end;
progress_iface->set_text = gimp_display_progress_set_text;
progress_iface->set_value = gimp_display_progress_set_value;
progress_iface->get_value = gimp_display_progress_get_value;
}
static void static void
gimp_display_set_property (GObject *object, gimp_display_set_property (GObject *object,
guint property_id, guint property_id,
@ -183,6 +218,61 @@ gimp_display_get_property (GObject *object,
} }
} }
static GimpProgress *
gimp_display_progress_start (GimpProgress *progress,
const gchar *message,
gboolean cancelable)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (GIMP_DISPLAY (progress)->shell);
return gimp_progress_start (GIMP_PROGRESS (shell->statusbar),
message, cancelable);
}
static void
gimp_display_progress_end (GimpProgress *progress)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (GIMP_DISPLAY (progress)->shell);
gimp_progress_end (GIMP_PROGRESS (shell->statusbar));
}
static void
gimp_display_progress_set_text (GimpProgress *progress,
const gchar *message)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (GIMP_DISPLAY (progress)->shell);
gimp_progress_set_text (GIMP_PROGRESS (shell->statusbar), message);
}
static void
gimp_display_progress_set_value (GimpProgress *progress,
gdouble percentage)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (GIMP_DISPLAY (progress)->shell);
gimp_progress_set_value (GIMP_PROGRESS (shell->statusbar), percentage);
}
static gdouble
gimp_display_progress_get_value (GimpProgress *progress)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (GIMP_DISPLAY (progress)->shell);
return gimp_progress_get_value (GIMP_PROGRESS (shell->statusbar));
}
static void
gimp_display_progress_canceled (GimpProgress *progress,
GimpDisplay *display)
{
gimp_progress_cancel (GIMP_PROGRESS (display));
}
/* public functions */
GimpDisplay * GimpDisplay *
gimp_display_new (GimpImage *gimage, gimp_display_new (GimpImage *gimage,
GimpUnit unit, GimpUnit unit,
@ -208,9 +298,12 @@ gimp_display_new (GimpImage *gimage,
/* create the shell for the image */ /* create the shell for the image */
gdisp->shell = gimp_display_shell_new (gdisp, unit, scale, gdisp->shell = gimp_display_shell_new (gdisp, unit, scale,
menu_factory, popup_manager); menu_factory, popup_manager);
gtk_widget_show (gdisp->shell); gtk_widget_show (gdisp->shell);
g_signal_connect (GIMP_DISPLAY_SHELL (gdisp->shell)->statusbar, "cancel",
G_CALLBACK (gimp_display_progress_canceled),
gdisp);
return gdisp; return gdisp;
} }

View File

@ -34,6 +34,7 @@
#include "core/gimpimage-undo.h" #include "core/gimpimage-undo.h"
#include "core/gimplayer.h" #include "core/gimplayer.h"
#include "core/gimppattern.h" #include "core/gimppattern.h"
#include "core/gimpprogress.h"
#include "file/file-open.h" #include "file/file-open.h"
#include "file/file-utils.h" #include "file/file-utils.h"
@ -300,7 +301,9 @@ gimp_display_shell_drop_uri_list (GtkWidget *widget,
GimpPDBStatusType status; GimpPDBStatusType status;
GError *error = NULL; GError *error = NULL;
new_layer = file_open_layer (gimage->gimp, context, gimage, uri, new_layer = file_open_layer (gimage->gimp, context,
GIMP_PROGRESS (shell->statusbar),
gimage, uri,
&status, &error); &status, &error);
if (new_layer) if (new_layer)

View File

@ -1,455 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "display-types.h"
#include "gimpdisplay.h"
#include "gimpdisplayshell.h"
#include "gimpstatusbar.h"
#include "gimpprogress.h"
#include "gimp-intl.h"
struct _GimpProgress
{
GimpDisplay *gdisp; /* gdisp in use, or NULL*/
/* next four fields are only valid if gdisp is NULL */
GtkWidget *dialog; /* progress dialog, NULL if using gdisp */
GtkWidget *dialog_label;
GtkWidget *progressbar;
GtkWidget *cancelbutton;
GCallback cancel_callback; /* callback to remove, or NULL */
gpointer cancel_data;
};
/* local function prototypes */
static void gimp_progress_signal_setup (GimpProgress *progress,
GCallback cancel_callback,
gpointer cancel_data);
static void gimp_progress_response (GtkWidget *dialog,
gint response_id,
GimpProgress *progress);
/**
* gimp_progress_start:
* @gdisp: The #GimpDisplay to show the progress in.
* @message: The message.
* @important: Setting this to #FALSE will cause the progress
* to silently fail if the display's statusbar
* is hidden.
* @cancel_callback: The callback to call if the "Cancel" button is clicked.
* @cancel_data: The %cancel_callback's "user_data".
*
* Start a progress bar on %gdisp with reason %message. If %gdisp
* is #NULL, the progress bar is presented in a new dialog box. If
* %message is #NULL, then no message is used.
*
* If %cancel_callback is not %NULL, it is attached to the progress
* bar cancel button's "clicked" signal, with data %cancel_data. The
* cancel button is only made sensitive if the callback is set.
*
* It is an error to gimp_progress_start() a bar on a %gdisp for which
* there is already a progress bar active.
*
* Progress bars with %important set to #TRUE will be shown to the
* user in any possible way. Unimportant progress bars will not be
* shown to the user if it would mean creating a new window.
*
* Return value: The new #GimpProgress.
**/
GimpProgress *
gimp_progress_start (GimpDisplay *gdisp,
const gchar *message,
gboolean important,
GCallback cancel_callback,
gpointer cancel_data)
{
GimpDisplayShell *shell = NULL;
GimpProgress *progress;
GtkWidget *vbox;
g_return_val_if_fail (gdisp == NULL || GIMP_IS_DISPLAY (gdisp), NULL);
if (gdisp)
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
progress = g_new0 (GimpProgress, 1);
/* do we have a useful gdisplay and statusarea? */
if (gdisp && GTK_WIDGET_VISIBLE (shell->statusbar))
{
progress->gdisp = gdisp;
if (message)
{
gimp_statusbar_push (GIMP_STATUSBAR (shell->statusbar),
"progress",
message);
}
/* really need image locking to stop multiple people going at
* the image
*/
if (GIMP_STATUSBAR (shell->statusbar)->progressid)
{
g_warning ("%s: %d progress bars already active for display %p",
G_STRFUNC, GIMP_STATUSBAR (shell->statusbar)->progressid,
gdisp);
}
GIMP_STATUSBAR (shell->statusbar)->progressid++;
}
else
{
/* unimporant progress indications are occasionally failed */
if (! important)
{
g_free (progress);
return NULL;
}
progress->dialog = gimp_dialog_new (_("Progress"), "progress",
NULL, 0,
NULL, NULL,
NULL);
progress->cancelbutton =
gtk_dialog_add_button (GTK_DIALOG (progress->dialog),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
gtk_window_set_resizable (GTK_WINDOW (progress->dialog), FALSE);
vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (progress->dialog)->vbox),
vbox);
gtk_widget_show (vbox);
progress->dialog_label = gtk_label_new (message ? message :
_("Please wait..."));
gtk_misc_set_alignment (GTK_MISC (progress->dialog_label), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (vbox), progress->dialog_label,
FALSE, FALSE, 0);
gtk_widget_show (progress->dialog_label);
progress->progressbar = gtk_progress_bar_new ();
gtk_widget_set_size_request (progress->progressbar, 150, 20);
gtk_box_pack_start (GTK_BOX (vbox), progress->progressbar,
FALSE, FALSE, 0);
gtk_widget_show (progress->progressbar);
gtk_widget_show (progress->dialog);
}
gimp_progress_signal_setup (progress, cancel_callback, cancel_data);
return progress;
}
/**
* gimp_progress_restart:
* @progress: The #GimpProgress to restart.
* @message: The new message.
* @cancel_callback: The new cancel_callback
* @cancel_data: The new cancel_data
*
* Update the message and/or the callbacks for a progress and reset
* the bar to zero, with the minimum of disturbance to the user.
*
* Return value: The same #GimpProgress as passed in as %progress.
**/
GimpProgress *
gimp_progress_restart (GimpProgress *progress,
const char *message,
GCallback cancel_callback,
gpointer cancel_data)
{
GtkWidget *bar;
g_return_val_if_fail (progress != NULL, NULL);
/* change the message */
if (progress->gdisp)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
gimp_statusbar_pop (GIMP_STATUSBAR (shell->statusbar), "progress");
if (message)
gimp_statusbar_push (GIMP_STATUSBAR (shell->statusbar),
"progress",
message);
bar = GIMP_STATUSBAR (shell->statusbar)->progressbar;
}
else
{
gtk_label_set_text (GTK_LABEL (progress->dialog_label),
message ? message : _("Please wait..."));
bar = progress->progressbar;
}
/* reset the progress bar */
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (bar), 0.0);
/* do we need to change the callbacks? */
gimp_progress_signal_setup (progress, cancel_callback, cancel_data);
return progress;
}
void
gimp_progress_update (GimpProgress *progress,
gdouble percentage)
{
GtkWidget *bar;
g_return_if_fail (progress != NULL);
if (percentage < 0.0 || percentage > 1.0)
return;
/* do we have a dialog box, or are we using the statusbar? */
if (progress->gdisp)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
bar = GIMP_STATUSBAR (shell->statusbar)->progressbar;
}
else
{
bar = progress->progressbar;
}
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (bar), percentage);
/* force updates so there's feedback even when the main loop is busy */
if (GTK_WIDGET_DRAWABLE (bar))
gdk_window_process_updates (bar->window, TRUE);
}
/**
* gimp_progress_step:
* @progress: The #GimpProgress.
*
* Step the progress bar by one percent, wrapping at 100%
**/
void
gimp_progress_step (GimpProgress *progress)
{
GtkWidget *bar;
gdouble val;
g_return_if_fail (progress != NULL);
if (progress->gdisp)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
bar = GIMP_STATUSBAR (shell->statusbar)->progressbar;
}
else
{
bar = progress->progressbar;
}
val = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (bar)) + 0.01;
if (val > 1.0)
val = 0.0;
gimp_progress_update (progress, val);
}
/**
* gimp_progress_end:
* @progress: The #GimpProgress.
*
* Finish using the progress bar.
**/
void
gimp_progress_end (GimpProgress *progress)
{
g_return_if_fail (progress != NULL);
/* We might get called from gimp_exit() and at that time
* the display shell has been destroyed already.
*/
if (progress->gdisp && !progress->gdisp->shell)
return;
/* remove all callbacks so they don't get called while we're
* destroying widgets
*/
gimp_progress_signal_setup (progress, NULL, NULL);
if (progress->gdisp)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
GtkProgressBar *bar;
gimp_statusbar_pop (GIMP_STATUSBAR (shell->statusbar), "progress");
bar = GTK_PROGRESS_BAR (GIMP_STATUSBAR (shell->statusbar)->progressbar);
gtk_progress_bar_set_fraction (bar, 0.0);
if (GIMP_STATUSBAR (shell->statusbar)->progressid > 0)
GIMP_STATUSBAR (shell->statusbar)->progressid--;
}
else
{
gtk_widget_destroy (progress->dialog);
}
g_free (progress);
}
/* This function's prototype is conveniently
* the same as progress_func_t
*/
/**
* gimp_progress_update_and_flush:
* @min: The minimum, ...
* @max: ... the maximum, ...
* @current: ... and the current progress of your operation.
* @data: The #GimpProgress you want to update.
*
* This function's prototype is conveniently
* the same as #GimpProgressFunc from libgimpcolor.
**/
void
gimp_progress_update_and_flush (gint min,
gint max,
gint current,
gpointer data)
{
gimp_progress_update ((GimpProgress *) data,
(gfloat) (current - min) / (gfloat) (max - min));
while (gtk_events_pending ())
gtk_main_iteration ();
}
/* private functions */
/* Helper function to add or remove signals */
static void
gimp_progress_signal_setup (GimpProgress *progress,
GCallback cancel_callback,
gpointer cancel_data)
{
GtkWidget *button;
GtkWidget *dialog;
if (progress->cancel_callback == cancel_callback &&
progress->cancel_data == cancel_data)
return;
/* are we using the statusbar or a freestanding dialog? */
if (progress->gdisp)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
dialog = NULL;
button = GIMP_STATUSBAR (shell->statusbar)->cancelbutton;
}
else
{
dialog = progress->dialog;
button = progress->cancelbutton;
}
/* remove any existing signal handlers */
if (progress->cancel_callback)
{
if (dialog)
g_signal_handlers_disconnect_by_func (dialog,
progress->cancel_callback,
progress->cancel_data);
else
g_signal_handlers_disconnect_by_func (button,
progress->cancel_callback,
progress->cancel_data);
}
/* add the new handlers */
if (cancel_callback)
{
if (dialog)
g_signal_connect (dialog, "response",
G_CALLBACK (gimp_progress_response),
progress);
else
g_signal_connect (button, "clicked",
G_CALLBACK (cancel_callback),
cancel_data);
}
gtk_widget_set_sensitive (GTK_WIDGET (button),
cancel_callback ? TRUE : FALSE);
progress->cancel_callback = cancel_callback;
progress->cancel_data = cancel_data;
}
static void
gimp_progress_response (GtkWidget *dialog,
gint response_id,
GimpProgress *progress)
{
typedef void (* cb) (GtkWidget*, gpointer);
GtkWidget *button;
cb callback;
callback = (cb) progress->cancel_callback;
if (progress->gdisp)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
button = GIMP_STATUSBAR (shell->statusbar)->cancelbutton;
}
else
{
button = progress->cancelbutton;
}
callback (button, progress->cancel_data);
}

View File

@ -1,43 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_PROGRESS_H__
#define __GIMP_PROGRESS_H__
GimpProgress * gimp_progress_start (GimpDisplay *gdisp,
const gchar *message,
gboolean important,
GCallback cancel_callback,
gpointer cancel_data);
GimpProgress * gimp_progress_restart (GimpProgress *progress,
const gchar *message,
GCallback cancel_callback,
gpointer cancel_data);
void gimp_progress_update (GimpProgress *progress,
gdouble percentage);
void gimp_progress_step (GimpProgress *progress);
void gimp_progress_end (GimpProgress *progress);
void gimp_progress_update_and_flush (gint min,
gint max,
gint current,
gpointer data);
#endif /* __GIMP_PROGRESS_H__ */

View File

@ -27,6 +27,7 @@
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "core/gimpunit.h" #include "core/gimpunit.h"
#include "core/gimpmarshal.h" #include "core/gimpmarshal.h"
#include "core/gimpprogress.h"
#include "widgets/gimpunitstore.h" #include "widgets/gimpunitstore.h"
#include "widgets/gimpunitcombobox.h" #include "widgets/gimpunitcombobox.h"
@ -54,20 +55,34 @@ struct _GimpStatusbarMsg
#define CURSOR_LEN 256 #define CURSOR_LEN 256
static void gimp_statusbar_class_init (GimpStatusbarClass *klass); static void gimp_statusbar_class_init (GimpStatusbarClass *klass);
static void gimp_statusbar_init (GimpStatusbar *statusbar); static void gimp_statusbar_init (GimpStatusbar *statusbar);
static void gimp_statusbar_progress_iface_init (GimpProgressInterface *progress_iface);
static void gimp_statusbar_destroy (GtkObject *object); static void gimp_statusbar_destroy (GtkObject *object);
static void gimp_statusbar_update (GimpStatusbar *statusbar); static GimpProgress *
static void gimp_statusbar_unit_changed (GimpUnitComboBox *combo, gimp_statusbar_progress_start (GimpProgress *progress,
GimpStatusbar *statusbar); const gchar *message,
static void gimp_statusbar_scale_changed (GimpScaleComboBox *combo, gboolean cancelable);
GimpStatusbar *statusbar); static void gimp_statusbar_progress_end (GimpProgress *progress);
static void gimp_statusbar_shell_scaled (GimpDisplayShell *shell, static void gimp_statusbar_progress_set_text (GimpProgress *progress,
GimpStatusbar *statusbar); const gchar *message);
static guint gimp_statusbar_get_context_id (GimpStatusbar *statusbar, static void gimp_statusbar_progress_set_value (GimpProgress *progress,
const gchar *context); gdouble percentage);
static gdouble gimp_statusbar_progress_get_value (GimpProgress *progress);
static void gimp_statusbar_progress_canceled (GtkWidget *button,
GimpStatusbar *statusbar);
static void gimp_statusbar_update (GimpStatusbar *statusbar);
static void gimp_statusbar_unit_changed (GimpUnitComboBox *combo,
GimpStatusbar *statusbar);
static void gimp_statusbar_scale_changed (GimpScaleComboBox *combo,
GimpStatusbar *statusbar);
static void gimp_statusbar_shell_scaled (GimpDisplayShell *shell,
GimpStatusbar *statusbar);
static guint gimp_statusbar_get_context_id (GimpStatusbar *statusbar,
const gchar *context);
static GtkHBoxClass *parent_class = NULL; static GtkHBoxClass *parent_class = NULL;
@ -93,9 +108,19 @@ gimp_statusbar_get_type (void)
(GInstanceInitFunc) gimp_statusbar_init, (GInstanceInitFunc) gimp_statusbar_init,
}; };
static const GInterfaceInfo progress_iface_info =
{
(GInterfaceInitFunc) gimp_statusbar_progress_iface_init,
NULL, /* iface_finalize */
NULL /* iface_data */
};
statusbar_type = g_type_register_static (GTK_TYPE_HBOX, statusbar_type = g_type_register_static (GTK_TYPE_HBOX,
"GimpStatusbar", "GimpStatusbar",
&statusbar_info, 0); &statusbar_info, 0);
g_type_add_interface_static (statusbar_type, GIMP_TYPE_PROGRESS,
&progress_iface_info);
} }
return statusbar_type; return statusbar_type;
@ -134,7 +159,7 @@ gimp_statusbar_init (GimpStatusbar *statusbar)
statusbar->shell = NULL; statusbar->shell = NULL;
statusbar->cursor_format_str[0] = '\0'; statusbar->cursor_format_str[0] = '\0';
statusbar->progressid = 0; statusbar->progress_active = FALSE;
gtk_box_set_spacing (box, 1); gtk_box_set_spacing (box, 1);
@ -188,10 +213,14 @@ gimp_statusbar_init (GimpStatusbar *statusbar)
GTK_PROGRESS_BAR (statusbar->progressbar)->progress.x_align = 0.0; GTK_PROGRESS_BAR (statusbar->progressbar)->progress.x_align = 0.0;
GTK_PROGRESS_BAR (statusbar->progressbar)->progress.y_align = 0.5; GTK_PROGRESS_BAR (statusbar->progressbar)->progress.y_align = 0.5;
statusbar->cancelbutton = gtk_button_new_with_label (_("Cancel")); statusbar->cancel_button = gtk_button_new_with_label (_("Cancel"));
gtk_widget_set_sensitive (statusbar->cancelbutton, FALSE); gtk_widget_set_sensitive (statusbar->cancel_button, FALSE);
gtk_box_pack_start (box, statusbar->cancelbutton, FALSE, FALSE, 0); gtk_box_pack_start (box, statusbar->cancel_button, FALSE, FALSE, 0);
gtk_widget_show (statusbar->cancelbutton); gtk_widget_show (statusbar->cancel_button);
g_signal_connect (statusbar->cancel_button, "clicked",
G_CALLBACK (gimp_statusbar_progress_canceled),
statusbar);
/* Update the statusbar once to work around a canvas size problem: /* Update the statusbar once to work around a canvas size problem:
* *
@ -210,6 +239,16 @@ gimp_statusbar_init (GimpStatusbar *statusbar)
statusbar->keys = NULL; statusbar->keys = NULL;
} }
static void
gimp_statusbar_progress_iface_init (GimpProgressInterface *progress_iface)
{
progress_iface->start = gimp_statusbar_progress_start;
progress_iface->end = gimp_statusbar_progress_end;
progress_iface->set_text = gimp_statusbar_progress_set_text;
progress_iface->set_value = gimp_statusbar_progress_set_value;
progress_iface->get_value = gimp_statusbar_progress_get_value;
}
static void static void
gimp_statusbar_destroy (GtkObject *object) gimp_statusbar_destroy (GtkObject *object)
{ {
@ -236,6 +275,101 @@ gimp_statusbar_destroy (GtkObject *object)
GTK_OBJECT_CLASS (parent_class)->destroy (object); GTK_OBJECT_CLASS (parent_class)->destroy (object);
} }
static GimpProgress *
gimp_statusbar_progress_start (GimpProgress *progress,
const gchar *message,
gboolean cancelable)
{
GimpStatusbar *statusbar = GIMP_STATUSBAR (progress);
if (! statusbar->progress_active)
{
GtkWidget *bar = statusbar->progressbar;
gimp_statusbar_push (statusbar, "progress", message);
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (bar), 0.0);
gtk_widget_set_sensitive (statusbar->cancel_button, cancelable);
statusbar->progress_active = TRUE;
return progress;
}
g_warning ("%s: progress bar already active for statusbar %p",
G_STRFUNC, statusbar);
return NULL;
}
static void
gimp_statusbar_progress_end (GimpProgress *progress)
{
GimpStatusbar *statusbar = GIMP_STATUSBAR (progress);
if (statusbar->progress_active)
{
GtkWidget *bar = statusbar->progressbar;
gimp_statusbar_pop (statusbar, "progress");
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (bar), 0.0);
gtk_widget_set_sensitive (statusbar->cancel_button, FALSE);
statusbar->progress_active = FALSE;
}
}
static void
gimp_statusbar_progress_set_text (GimpProgress *progress,
const gchar *message)
{
GimpStatusbar *statusbar = GIMP_STATUSBAR (progress);
if (statusbar->progress_active)
{
gimp_statusbar_replace (statusbar, "progress", message);
}
}
static void
gimp_statusbar_progress_set_value (GimpProgress *progress,
gdouble percentage)
{
GimpStatusbar *statusbar = GIMP_STATUSBAR (progress);
if (statusbar->progress_active)
{
GtkWidget *bar = statusbar->progressbar;
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (bar), percentage);
if (GTK_WIDGET_DRAWABLE (bar))
gdk_window_process_updates (bar->window, TRUE);
}
}
static gdouble
gimp_statusbar_progress_get_value (GimpProgress *progress)
{
GimpStatusbar *statusbar = GIMP_STATUSBAR (progress);
if (statusbar->progress_active)
{
GtkWidget *bar = statusbar->progressbar;
return gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (bar));
}
return 0.0;
}
static void
gimp_statusbar_progress_canceled (GtkWidget *button,
GimpStatusbar *statusbar)
{
if (statusbar->progress_active)
gimp_progress_cancel (GIMP_PROGRESS (statusbar));
}
static void static void
gimp_statusbar_update (GimpStatusbar *statusbar) gimp_statusbar_update (GimpStatusbar *statusbar)
{ {

View File

@ -53,8 +53,8 @@ struct _GimpStatusbar
GtkWidget *scale_combo; GtkWidget *scale_combo;
GtkWidget *progressbar; GtkWidget *progressbar;
guint progressid; GtkWidget *cancel_button;
GtkWidget *cancelbutton; gboolean progress_active;
}; };
struct _GimpStatusbarClass struct _GimpStatusbarClass

View File

@ -48,6 +48,7 @@
#include "core/gimpimage-undo.h" #include "core/gimpimage-undo.h"
#include "core/gimpimagefile.h" #include "core/gimpimagefile.h"
#include "core/gimplayer.h" #include "core/gimplayer.h"
#include "core/gimpprogress.h"
#include "pdb/procedural_db.h" #include "pdb/procedural_db.h"
@ -65,6 +66,7 @@
GimpImage * GimpImage *
file_open_image (Gimp *gimp, file_open_image (Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
const gchar *uri, const gchar *uri,
const gchar *entered_filename, const gchar *entered_filename,
PlugInProcDef *file_proc, PlugInProcDef *file_proc,
@ -82,6 +84,7 @@ file_open_image (Gimp *gimp,
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
g_return_val_if_fail (status != NULL, NULL); g_return_val_if_fail (status != NULL, NULL);
g_return_val_if_fail (mime_type == NULL || *mime_type == NULL, NULL); g_return_val_if_fail (mime_type == NULL || *mime_type == NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL);
@ -134,7 +137,8 @@ file_open_image (Gimp *gimp,
args[1].value.pdb_pointer = filename ? filename : (gchar *) uri; args[1].value.pdb_pointer = filename ? filename : (gchar *) uri;
args[2].value.pdb_pointer = (gchar *) entered_filename; args[2].value.pdb_pointer = (gchar *) entered_filename;
return_vals = procedural_db_execute (gimp, context, proc->name, args); return_vals = procedural_db_execute (gimp, context, progress,
proc->name, args);
if (filename) if (filename)
g_free (filename); g_free (filename);
@ -190,17 +194,19 @@ file_open_image (Gimp *gimp,
GimpImage * GimpImage *
file_open_with_display (Gimp *gimp, file_open_with_display (Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
const gchar *uri, const gchar *uri,
GimpPDBStatusType *status, GimpPDBStatusType *status,
GError **error) GError **error)
{ {
return file_open_with_proc_and_display (gimp, context, return file_open_with_proc_and_display (gimp, context, progress,
uri, uri, NULL, status, error); uri, uri, NULL, status, error);
} }
GimpImage * GimpImage *
file_open_with_proc_and_display (Gimp *gimp, file_open_with_proc_and_display (Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
const gchar *uri, const gchar *uri,
const gchar *entered_filename, const gchar *entered_filename,
PlugInProcDef *file_proc, PlugInProcDef *file_proc,
@ -212,9 +218,10 @@ file_open_with_proc_and_display (Gimp *gimp,
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
g_return_val_if_fail (status != NULL, NULL); g_return_val_if_fail (status != NULL, NULL);
gimage = file_open_image (gimp, context, gimage = file_open_image (gimp, context, progress,
uri, uri,
entered_filename, entered_filename,
file_proc, file_proc,
@ -251,6 +258,7 @@ file_open_with_proc_and_display (Gimp *gimp,
GimpLayer * GimpLayer *
file_open_layer (Gimp *gimp, file_open_layer (Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
GimpImage *dest_image, GimpImage *dest_image,
const gchar *uri, const gchar *uri,
GimpPDBStatusType *status, GimpPDBStatusType *status,
@ -261,12 +269,13 @@ file_open_layer (Gimp *gimp,
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
g_return_val_if_fail (GIMP_IS_IMAGE (dest_image), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (dest_image), NULL);
g_return_val_if_fail (uri != NULL, NULL); g_return_val_if_fail (uri != NULL, NULL);
g_return_val_if_fail (status != NULL, NULL); g_return_val_if_fail (status != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL);
new_image = file_open_image (gimp, context, uri, uri, new_image = file_open_image (gimp, context, progress, uri, uri,
NULL, GIMP_RUN_NONINTERACTIVE, NULL, GIMP_RUN_NONINTERACTIVE,
status, NULL, error); status, NULL, error);

View File

@ -22,6 +22,7 @@
GimpImage * file_open_image (Gimp *gimp, GimpImage * file_open_image (Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
const gchar *uri, const gchar *uri,
const gchar *entered_filename, const gchar *entered_filename,
PlugInProcDef *file_proc, PlugInProcDef *file_proc,
@ -32,12 +33,14 @@ GimpImage * file_open_image (Gimp *gimp,
GimpImage * file_open_with_display (Gimp *gimp, GimpImage * file_open_with_display (Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
const gchar *uri, const gchar *uri,
GimpPDBStatusType *status, GimpPDBStatusType *status,
GError **error); GError **error);
GimpImage * file_open_with_proc_and_display (Gimp *gimp, GimpImage * file_open_with_proc_and_display (Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
const gchar *uri, const gchar *uri,
const gchar *entered_filename, const gchar *entered_filename,
PlugInProcDef *file_proc, PlugInProcDef *file_proc,
@ -46,6 +49,7 @@ GimpImage * file_open_with_proc_and_display (Gimp *gimp,
GimpLayer * file_open_layer (Gimp *gimp, GimpLayer * file_open_layer (Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
GimpImage *dest_image, GimpImage *dest_image,
const gchar *uri, const gchar *uri,
GimpPDBStatusType *status, GimpPDBStatusType *status,

View File

@ -48,6 +48,7 @@
#include "core/gimpdrawable.h" #include "core/gimpdrawable.h"
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "core/gimpimagefile.h" #include "core/gimpimagefile.h"
#include "core/gimpprogress.h"
#include "pdb/procedural_db.h" #include "pdb/procedural_db.h"
@ -65,6 +66,7 @@
GimpPDBStatusType GimpPDBStatusType
file_save (GimpImage *gimage, file_save (GimpImage *gimage,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
GimpRunMode run_mode, GimpRunMode run_mode,
GError **error) GError **error)
{ {
@ -73,6 +75,8 @@ file_save (GimpImage *gimage,
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), GIMP_PDB_CALLING_ERROR); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), GIMP_PDB_CALLING_ERROR);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), GIMP_PDB_CALLING_ERROR); g_return_val_if_fail (GIMP_IS_CONTEXT (context), GIMP_PDB_CALLING_ERROR);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress),
GIMP_PDB_CALLING_ERROR);
g_return_val_if_fail (error == NULL || *error == NULL, g_return_val_if_fail (error == NULL || *error == NULL,
GIMP_PDB_CALLING_ERROR); GIMP_PDB_CALLING_ERROR);
@ -82,13 +86,15 @@ file_save (GimpImage *gimage,
file_proc = gimp_image_get_save_proc (gimage); file_proc = gimp_image_get_save_proc (gimage);
return file_save_as (gimage, context, uri, uri, file_proc, run_mode, return file_save_as (gimage, context, progress,
uri, uri, file_proc, run_mode,
FALSE, TRUE, error); FALSE, TRUE, error);
} }
GimpPDBStatusType GimpPDBStatusType
file_save_as (GimpImage *gimage, file_save_as (GimpImage *gimage,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
const gchar *uri, const gchar *uri,
const gchar *raw_filename, const gchar *raw_filename,
PlugInProcDef *file_proc, PlugInProcDef *file_proc,
@ -106,6 +112,8 @@ file_save_as (GimpImage *gimage,
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), GIMP_PDB_CALLING_ERROR); g_return_val_if_fail (GIMP_IS_IMAGE (gimage), GIMP_PDB_CALLING_ERROR);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), GIMP_PDB_CALLING_ERROR); g_return_val_if_fail (GIMP_IS_CONTEXT (context), GIMP_PDB_CALLING_ERROR);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress),
GIMP_PDB_CALLING_ERROR);
g_return_val_if_fail (uri != NULL, GIMP_PDB_CALLING_ERROR); g_return_val_if_fail (uri != NULL, GIMP_PDB_CALLING_ERROR);
g_return_val_if_fail (raw_filename != NULL, GIMP_PDB_CALLING_ERROR); g_return_val_if_fail (raw_filename != NULL, GIMP_PDB_CALLING_ERROR);
g_return_val_if_fail (error == NULL || *error == NULL, g_return_val_if_fail (error == NULL || *error == NULL,
@ -165,7 +173,8 @@ file_save_as (GimpImage *gimage,
args[3].value.pdb_pointer = (gpointer) (filename ? filename : uri); args[3].value.pdb_pointer = (gpointer) (filename ? filename : uri);
args[4].value.pdb_pointer = (gpointer) raw_filename; args[4].value.pdb_pointer = (gpointer) raw_filename;
return_vals = procedural_db_execute (gimage->gimp, context, proc->name, args); return_vals = procedural_db_execute (gimage->gimp, context, progress,
proc->name, args);
if (filename) if (filename)
g_free (filename); g_free (filename);

View File

@ -22,10 +22,12 @@
GimpPDBStatusType file_save (GimpImage *gimage, GimpPDBStatusType file_save (GimpImage *gimage,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
GimpRunMode run_mode, GimpRunMode run_mode,
GError **error); GError **error);
GimpPDBStatusType file_save_as (GimpImage *gimage, GimpPDBStatusType file_save_as (GimpImage *gimage,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
const gchar *uri, const gchar *uri,
const gchar *raw_filename, const gchar *raw_filename,
PlugInProcDef *file_proc, PlugInProcDef *file_proc,

View File

@ -30,18 +30,18 @@
#include "core/gimpimage-convert.h" #include "core/gimpimage-convert.h"
#include "core/gimplist.h" #include "core/gimplist.h"
#include "core/gimppalette.h" #include "core/gimppalette.h"
#include "core/gimpprogress.h"
#include "widgets/gimpenumwidgets.h" #include "widgets/gimpenumwidgets.h"
#include "widgets/gimphelp-ids.h" #include "widgets/gimphelp-ids.h"
#include "widgets/gimppaletteselect.h" #include "widgets/gimppaletteselect.h"
#include "widgets/gimpviewabledialog.h" #include "widgets/gimpviewabledialog.h"
#include "display/gimpprogress.h"
#include "menus/menus.h" #include "menus/menus.h"
#include "gimp-intl.h" #include "gimp-intl.h"
typedef struct typedef struct
{ {
GtkWidget *shell; GtkWidget *shell;
@ -55,8 +55,6 @@ typedef struct
gint palette; gint palette;
GimpConvertPaletteType palette_type; GimpConvertPaletteType palette_type;
GimpDisplay *gdisp; GimpDisplay *gdisp;
GimpProgress *progress;
gint current_stage;
} IndexedDialog; } IndexedDialog;
@ -412,28 +410,6 @@ build_palette_button (Gimp *gimp)
return gtk_button_new_with_label (GIMP_OBJECT (theCustomPalette)->name); return gtk_button_new_with_label (GIMP_OBJECT (theCustomPalette)->name);
} }
static void
progress_callback (gint stage,
gdouble percentage,
gpointer data)
{
IndexedDialog *dialog = data;
if (stage != dialog->current_stage)
{
gchar buffer[1024];
g_snprintf (buffer, sizeof (buffer), _("Stage %d"), stage);
dialog->current_stage = stage;
dialog->progress = gimp_progress_restart (dialog->progress,
buffer, NULL, NULL);
}
gimp_progress_update (dialog->progress, percentage);
}
static void static void
indexed_response (GtkWidget *widget, indexed_response (GtkWidget *widget,
gint response_id, gint response_id,
@ -441,9 +417,11 @@ indexed_response (GtkWidget *widget,
{ {
if (response_id == GTK_RESPONSE_OK) if (response_id == GTK_RESPONSE_OK)
{ {
dialog->current_stage = 1; GimpProgress *progress;
dialog->progress = gimp_progress_start (dialog->gdisp, _("Stage 1"),
FALSE, NULL, NULL); progress = gimp_progress_start (GIMP_PROGRESS (dialog->gdisp),
_("Converting to indexed..."), FALSE);
/* Convert the image to indexed color */ /* Convert the image to indexed color */
gimp_image_convert (dialog->gimage, gimp_image_convert (dialog->gimage,
GIMP_INDEXED, GIMP_INDEXED,
@ -453,10 +431,11 @@ indexed_response (GtkWidget *widget,
dialog->remove_dups, dialog->remove_dups,
dialog->palette_type, dialog->palette_type,
theCustomPalette, theCustomPalette,
progress_callback, progress);
dialog);
if (progress)
gimp_progress_end (progress);
gimp_progress_end (dialog->progress);
gimp_image_flush (dialog->gimage); gimp_image_flush (dialog->gimage);
/* Save defaults for next time */ /* Save defaults for next time */

View File

@ -29,6 +29,7 @@
#include "core/gimp.h" #include "core/gimp.h"
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "core/gimpprogress.h"
#include "file/file-open.h" #include "file/file-open.h"
#include "file/file-utils.h" #include "file/file-utils.h"
@ -118,6 +119,7 @@ file_open_dialog_response (GtkWidget *open_dialog,
{ {
GSList *uris; GSList *uris;
GSList *list; GSList *list;
gboolean success = FALSE;
if (response_id != GTK_RESPONSE_OK) if (response_id != GTK_RESPONSE_OK)
{ {
@ -141,13 +143,18 @@ file_open_dialog_response (GtkWidget *open_dialog,
list->data, list->data,
GIMP_FILE_DIALOG (open_dialog)->file_proc)) GIMP_FILE_DIALOG (open_dialog)->file_proc))
{ {
gtk_widget_hide (open_dialog); success = TRUE;
gdk_window_raise (open_dialog->window);
} }
} }
g_free (filename); g_free (filename);
} }
if (success)
gtk_widget_hide (open_dialog);
gtk_widget_set_sensitive (open_dialog, TRUE); gtk_widget_set_sensitive (open_dialog, TRUE);
g_slist_foreach (uris, (GFunc) g_free, NULL); g_slist_foreach (uris, (GFunc) g_free, NULL);
@ -167,6 +174,7 @@ file_open_dialog_open_image (GtkWidget *open_dialog,
gimage = file_open_with_proc_and_display (gimp, gimage = file_open_with_proc_and_display (gimp,
gimp_get_user_context (gimp), gimp_get_user_context (gimp),
GIMP_PROGRESS (open_dialog),
uri, uri,
entered_filename, entered_filename,
load_proc, load_proc,

View File

@ -157,9 +157,12 @@ file_open_location_response (GtkWidget *dialog,
{ {
uri = file_utils_filename_to_uri (gimp->load_procs, text, NULL); uri = file_utils_filename_to_uri (gimp->load_procs, text, NULL);
} }
#ifdef __GNUC__
#warning FIXME: add progress bar to open location dialog
#endif
image = file_open_with_proc_and_display (gimp, image = file_open_with_proc_and_display (gimp,
gimp_get_user_context (gimp), gimp_get_user_context (gimp),
NULL,
uri, text, NULL, uri, text, NULL,
&status, &error); &status, &error);

View File

@ -29,6 +29,7 @@
#include "core/gimp.h" #include "core/gimp.h"
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "core/gimpprogress.h"
#include "file/file-save.h" #include "file/file-save.h"
#include "file/file-utils.h" #include "file/file-utils.h"
@ -300,6 +301,7 @@ file_save_dialog_save_image (GtkWidget *save_dialog,
status = file_save_as (gimage, status = file_save_as (gimage,
gimp_get_user_context (gimage->gimp), gimp_get_user_context (gimage->gimp),
GIMP_PROGRESS (save_dialog),
uri, uri,
raw_filename, raw_filename,
save_proc, save_proc,

View File

@ -37,6 +37,7 @@
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "core/gimppalette.h" #include "core/gimppalette.h"
#include "core/gimppattern.h" #include "core/gimppattern.h"
#include "core/gimpprogress.h"
#include "text/gimpfont.h" #include "text/gimpfont.h"
@ -54,13 +55,13 @@
#include "widgets/gimpmenufactory.h" #include "widgets/gimpmenufactory.h"
#include "widgets/gimppaletteselect.h" #include "widgets/gimppaletteselect.h"
#include "widgets/gimppatternselect.h" #include "widgets/gimppatternselect.h"
#include "widgets/gimpprogressdialog.h"
#include "widgets/gimpuimanager.h" #include "widgets/gimpuimanager.h"
#include "widgets/gimpwidgets-utils.h" #include "widgets/gimpwidgets-utils.h"
#include "display/gimpdisplay.h" #include "display/gimpdisplay.h"
#include "display/gimpdisplay-foreach.h" #include "display/gimpdisplay-foreach.h"
#include "display/gimpdisplayshell.h" #include "display/gimpdisplayshell.h"
#include "display/gimpprogress.h"
#include "actions/plug-in-actions.h" #include "actions/plug-in-actions.h"
@ -106,20 +107,8 @@ static void gui_menus_create_entry (Gimp *gimp,
PlugInProcDef *proc_def); PlugInProcDef *proc_def);
static void gui_menus_delete_entry (Gimp *gimp, static void gui_menus_delete_entry (Gimp *gimp,
PlugInProcDef *proc_def); PlugInProcDef *proc_def);
static GimpProgress * gui_start_progress (Gimp *gimp, static GimpProgress * gui_new_progress (Gimp *gimp);
gint gdisp_ID, static void gui_free_progress (Gimp *gimp,
const gchar *message,
GCallback cancel_cb,
gpointer cancel_data);
static GimpProgress * gui_restart_progress (Gimp *gimp,
GimpProgress *progress,
const gchar *message,
GCallback cancel_cb,
gpointer cancel_data);
static void gui_update_progress (Gimp *gimp,
GimpProgress *progress,
gdouble percentage);
static void gui_end_progress (Gimp *gimp,
GimpProgress *progress); GimpProgress *progress);
static gboolean gui_pdb_dialog_new (Gimp *gimp, static gboolean gui_pdb_dialog_new (Gimp *gimp,
GimpContext *context, GimpContext *context,
@ -163,10 +152,8 @@ gui_vtable_init (Gimp *gimp)
gimp->gui.menus_init = gui_menus_init; gimp->gui.menus_init = gui_menus_init;
gimp->gui.menus_create = gui_menus_create_entry; gimp->gui.menus_create = gui_menus_create_entry;
gimp->gui.menus_delete = gui_menus_delete_entry; gimp->gui.menus_delete = gui_menus_delete_entry;
gimp->gui.progress_start = gui_start_progress; gimp->gui.progress_new = gui_new_progress;
gimp->gui.progress_restart = gui_restart_progress; gimp->gui.progress_free = gui_free_progress;
gimp->gui.progress_update = gui_update_progress;
gimp->gui.progress_end = gui_end_progress;
gimp->gui.pdb_dialog_new = gui_pdb_dialog_new; gimp->gui.pdb_dialog_new = gui_pdb_dialog_new;
gimp->gui.pdb_dialog_set = gui_pdb_dialog_set; gimp->gui.pdb_dialog_set = gui_pdb_dialog_set;
gimp->gui.pdb_dialog_close = gui_pdb_dialog_close; gimp->gui.pdb_dialog_close = gui_pdb_dialog_close;
@ -410,43 +397,18 @@ gui_menus_delete_entry (Gimp *gimp,
} }
static GimpProgress * static GimpProgress *
gui_start_progress (Gimp *gimp, gui_new_progress (Gimp *gimp)
gint gdisp_ID,
const gchar *message,
GCallback cancel_cb,
gpointer cancel_data)
{ {
GimpDisplay *gdisp = NULL; return GIMP_PROGRESS (gimp_progress_dialog_new ());
if (gdisp_ID > 0)
gdisp = gimp_display_get_by_ID (gimp, gdisp_ID);
return gimp_progress_start (gdisp, message, TRUE, cancel_cb, cancel_data);
}
static GimpProgress *
gui_restart_progress (Gimp *gimp,
GimpProgress *progress,
const gchar *message,
GCallback cancel_cb,
gpointer cancel_data)
{
return gimp_progress_restart (progress, message, cancel_cb, cancel_data);
} }
static void static void
gui_update_progress (Gimp *gimp, gui_free_progress (Gimp *gimp,
GimpProgress *progress, GimpProgress *progress)
gdouble percentage)
{ {
gimp_progress_update (progress, percentage); g_return_if_fail (GIMP_IS_PROGRESS_DIALOG (progress));
}
static void gtk_widget_destroy (GTK_WIDGET (progress));
gui_end_progress (Gimp *gimp,
GimpProgress *progress)
{
gimp_progress_end (progress);
} }
static gboolean static gboolean

View File

@ -42,9 +42,10 @@ register_brush_select_procs (Gimp *gimp)
} }
static Argument * static Argument *
brushes_popup_invoker (Gimp *gimp, brushes_popup_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *brush_callback; gchar *brush_callback;
@ -145,9 +146,10 @@ static ProcRecord brushes_popup_proc =
}; };
static Argument * static Argument *
brushes_close_popup_invoker (Gimp *gimp, brushes_close_popup_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *brush_callback; gchar *brush_callback;
@ -194,9 +196,10 @@ static ProcRecord brushes_close_popup_proc =
}; };
static Argument * static Argument *
brushes_set_popup_invoker (Gimp *gimp, brushes_set_popup_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *brush_callback; gchar *brush_callback;

View File

@ -64,9 +64,10 @@ register_brushes_procs (Gimp *gimp)
} }
static Argument * static Argument *
brushes_refresh_invoker (Gimp *gimp, brushes_refresh_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gimp_data_factory_data_save (gimp->brush_factory); gimp_data_factory_data_save (gimp->brush_factory);
gimp_data_factory_data_init (gimp->brush_factory, FALSE); gimp_data_factory_data_init (gimp->brush_factory, FALSE);
@ -90,9 +91,10 @@ static ProcRecord brushes_refresh_proc =
}; };
static Argument * static Argument *
brushes_get_list_invoker (Gimp *gimp, brushes_get_list_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -158,9 +160,10 @@ static ProcRecord brushes_get_list_proc =
}; };
static Argument * static Argument *
brushes_get_brush_invoker (Gimp *gimp, brushes_get_brush_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -222,9 +225,10 @@ static ProcRecord brushes_get_brush_proc =
}; };
static Argument * static Argument *
brushes_set_brush_invoker (Gimp *gimp, brushes_set_brush_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
@ -274,9 +278,10 @@ static ProcRecord brushes_set_brush_proc =
}; };
static Argument * static Argument *
brushes_get_opacity_invoker (Gimp *gimp, brushes_get_opacity_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
Argument *return_args; Argument *return_args;
@ -312,9 +317,10 @@ static ProcRecord brushes_get_opacity_proc =
}; };
static Argument * static Argument *
brushes_set_opacity_invoker (Gimp *gimp, brushes_set_opacity_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gdouble opacity; gdouble opacity;
@ -355,9 +361,10 @@ static ProcRecord brushes_set_opacity_proc =
}; };
static Argument * static Argument *
brushes_get_spacing_invoker (Gimp *gimp, brushes_get_spacing_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
Argument *return_args; Argument *return_args;
@ -393,9 +400,10 @@ static ProcRecord brushes_get_spacing_proc =
}; };
static Argument * static Argument *
brushes_set_spacing_invoker (Gimp *gimp, brushes_set_spacing_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gint32 spacing; gint32 spacing;
@ -436,9 +444,10 @@ static ProcRecord brushes_set_spacing_proc =
}; };
static Argument * static Argument *
brushes_get_paint_mode_invoker (Gimp *gimp, brushes_get_paint_mode_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
Argument *return_args; Argument *return_args;
@ -474,9 +483,10 @@ static ProcRecord brushes_get_paint_mode_proc =
}; };
static Argument * static Argument *
brushes_set_paint_mode_invoker (Gimp *gimp, brushes_set_paint_mode_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gint32 paint_mode; gint32 paint_mode;
@ -517,9 +527,10 @@ static ProcRecord brushes_set_paint_mode_proc =
}; };
static Argument * static Argument *
brushes_get_brush_data_invoker (Gimp *gimp, brushes_get_brush_data_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;

View File

@ -57,9 +57,10 @@ register_channel_procs (Gimp *gimp)
} }
static Argument * static Argument *
channel_new_invoker (Gimp *gimp, channel_new_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -170,9 +171,10 @@ static ProcRecord channel_new_proc =
}; };
static Argument * static Argument *
channel_copy_invoker (Gimp *gimp, channel_copy_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -233,9 +235,10 @@ static ProcRecord channel_copy_proc =
}; };
static Argument * static Argument *
channel_combine_masks_invoker (Gimp *gimp, channel_combine_masks_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpChannel *channel1; GimpChannel *channel1;
@ -314,9 +317,10 @@ static ProcRecord channel_combine_masks_proc =
}; };
static Argument * static Argument *
channel_get_show_masked_invoker (Gimp *gimp, channel_get_show_masked_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -369,9 +373,10 @@ static ProcRecord channel_get_show_masked_proc =
}; };
static Argument * static Argument *
channel_set_show_masked_invoker (Gimp *gimp, channel_set_show_masked_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpChannel *channel; GimpChannel *channel;
@ -420,9 +425,10 @@ static ProcRecord channel_set_show_masked_proc =
}; };
static Argument * static Argument *
channel_get_opacity_invoker (Gimp *gimp, channel_get_opacity_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -475,9 +481,10 @@ static ProcRecord channel_get_opacity_proc =
}; };
static Argument * static Argument *
channel_set_opacity_invoker (Gimp *gimp, channel_set_opacity_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpChannel *channel; GimpChannel *channel;
@ -528,9 +535,10 @@ static ProcRecord channel_set_opacity_proc =
}; };
static Argument * static Argument *
channel_get_color_invoker (Gimp *gimp, channel_get_color_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -587,9 +595,10 @@ static ProcRecord channel_get_color_proc =
}; };
static Argument * static Argument *
channel_set_color_invoker (Gimp *gimp, channel_set_color_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpChannel *channel; GimpChannel *channel;

View File

@ -79,9 +79,10 @@ register_color_procs (Gimp *gimp)
} }
static Argument * static Argument *
brightness_contrast_invoker (Gimp *gimp, brightness_contrast_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -174,9 +175,10 @@ static ProcRecord brightness_contrast_proc =
}; };
static Argument * static Argument *
levels_invoker (Gimp *gimp, levels_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -327,9 +329,10 @@ static ProcRecord levels_proc =
}; };
static Argument * static Argument *
levels_auto_invoker (Gimp *gimp, levels_auto_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -416,9 +419,10 @@ static ProcRecord levels_auto_proc =
}; };
static Argument * static Argument *
posterize_invoker (Gimp *gimp, posterize_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -499,9 +503,10 @@ static ProcRecord posterize_proc =
}; };
static Argument * static Argument *
desaturate_invoker (Gimp *gimp, desaturate_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -547,9 +552,10 @@ static ProcRecord desaturate_proc =
}; };
static Argument * static Argument *
equalize_invoker (Gimp *gimp, equalize_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -603,9 +609,10 @@ static ProcRecord equalize_proc =
}; };
static Argument * static Argument *
invert_invoker (Gimp *gimp, invert_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -651,9 +658,10 @@ static ProcRecord invert_proc =
}; };
static Argument * static Argument *
curves_spline_invoker (Gimp *gimp, curves_spline_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -774,9 +782,10 @@ static ProcRecord curves_spline_proc =
}; };
static Argument * static Argument *
curves_explicit_invoker (Gimp *gimp, curves_explicit_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -892,9 +901,10 @@ static ProcRecord curves_explicit_proc =
}; };
static Argument * static Argument *
color_balance_invoker (Gimp *gimp, color_balance_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -1021,9 +1031,10 @@ static ProcRecord color_balance_proc =
}; };
static Argument * static Argument *
histogram_invoker (Gimp *gimp, histogram_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1176,9 +1187,10 @@ static ProcRecord histogram_proc =
}; };
static Argument * static Argument *
hue_saturation_invoker (Gimp *gimp, hue_saturation_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -1296,9 +1308,10 @@ static ProcRecord hue_saturation_proc =
}; };
static Argument * static Argument *
threshold_invoker (Gimp *gimp, threshold_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;

View File

@ -46,9 +46,10 @@ register_convert_procs (Gimp *gimp)
} }
static Argument * static Argument *
image_convert_rgb_invoker (Gimp *gimp, image_convert_rgb_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -60,7 +61,7 @@ image_convert_rgb_invoker (Gimp *gimp,
if (success) if (success)
{ {
if (gimp_image_base_type (gimage) != GIMP_RGB) if (gimp_image_base_type (gimage) != GIMP_RGB)
gimp_image_convert (gimage, GIMP_RGB, 0, 0, FALSE, FALSE, 0, NULL, NULL, NULL); gimp_image_convert (gimage, GIMP_RGB, 0, 0, FALSE, FALSE, 0, NULL, NULL);
else else
success = FALSE; success = FALSE;
} }
@ -94,9 +95,10 @@ static ProcRecord image_convert_rgb_proc =
}; };
static Argument * static Argument *
image_convert_grayscale_invoker (Gimp *gimp, image_convert_grayscale_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -108,7 +110,7 @@ image_convert_grayscale_invoker (Gimp *gimp,
if (success) if (success)
{ {
if (gimp_image_base_type (gimage) != GIMP_GRAY) if (gimp_image_base_type (gimage) != GIMP_GRAY)
gimp_image_convert (gimage, GIMP_GRAY, 0, 0, FALSE, FALSE, 0, NULL, NULL, NULL); gimp_image_convert (gimage, GIMP_GRAY, 0, 0, FALSE, FALSE, 0, NULL, NULL);
else else
success = FALSE; success = FALSE;
} }
@ -142,9 +144,10 @@ static ProcRecord image_convert_grayscale_proc =
}; };
static Argument * static Argument *
image_convert_indexed_invoker (Gimp *gimp, image_convert_indexed_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -214,7 +217,8 @@ image_convert_indexed_invoker (Gimp *gimp,
if (success) if (success)
gimp_image_convert (gimage, GIMP_INDEXED, num_cols, dither_type, gimp_image_convert (gimage, GIMP_INDEXED, num_cols, dither_type,
alpha_dither, remove_unused, palette_type, palette, NULL, NULL); alpha_dither, remove_unused, palette_type, palette,
NULL);
} }
return procedural_db_return_args (&image_convert_indexed_proc, success); return procedural_db_return_args (&image_convert_indexed_proc, success);

View File

@ -45,9 +45,10 @@ register_display_procs (Gimp *gimp)
} }
static Argument * static Argument *
display_new_invoker (Gimp *gimp, display_new_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -112,9 +113,10 @@ static ProcRecord display_new_proc =
}; };
static Argument * static Argument *
display_delete_invoker (Gimp *gimp, display_delete_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpObject *display; GimpObject *display;
@ -155,9 +157,10 @@ static ProcRecord display_delete_proc =
}; };
static Argument * static Argument *
displays_flush_invoker (Gimp *gimp, displays_flush_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gimp_container_foreach (gimp->images, (GFunc) gimp_image_flush, NULL); gimp_container_foreach (gimp->images, (GFunc) gimp_image_flush, NULL);
return procedural_db_return_args (&displays_flush_proc, TRUE); return procedural_db_return_args (&displays_flush_proc, TRUE);
@ -180,9 +183,10 @@ static ProcRecord displays_flush_proc =
}; };
static Argument * static Argument *
displays_reconnect_invoker (Gimp *gimp, displays_reconnect_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *old_image; GimpImage *old_image;

View File

@ -110,9 +110,10 @@ register_drawable_procs (Gimp *gimp)
} }
static Argument * static Argument *
drawable_delete_invoker (Gimp *gimp, drawable_delete_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -158,9 +159,10 @@ static ProcRecord drawable_delete_proc =
}; };
static Argument * static Argument *
drawable_is_layer_invoker (Gimp *gimp, drawable_is_layer_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -213,9 +215,10 @@ static ProcRecord drawable_is_layer_proc =
}; };
static Argument * static Argument *
drawable_is_layer_mask_invoker (Gimp *gimp, drawable_is_layer_mask_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -268,9 +271,10 @@ static ProcRecord drawable_is_layer_mask_proc =
}; };
static Argument * static Argument *
drawable_is_channel_invoker (Gimp *gimp, drawable_is_channel_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -323,9 +327,10 @@ static ProcRecord drawable_is_channel_proc =
}; };
static Argument * static Argument *
drawable_type_invoker (Gimp *gimp, drawable_type_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -378,9 +383,10 @@ static ProcRecord drawable_type_proc =
}; };
static Argument * static Argument *
drawable_type_with_alpha_invoker (Gimp *gimp, drawable_type_with_alpha_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -433,9 +439,10 @@ static ProcRecord drawable_type_with_alpha_proc =
}; };
static Argument * static Argument *
drawable_has_alpha_invoker (Gimp *gimp, drawable_has_alpha_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -488,9 +495,10 @@ static ProcRecord drawable_has_alpha_proc =
}; };
static Argument * static Argument *
drawable_is_rgb_invoker (Gimp *gimp, drawable_is_rgb_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -543,9 +551,10 @@ static ProcRecord drawable_is_rgb_proc =
}; };
static Argument * static Argument *
drawable_is_gray_invoker (Gimp *gimp, drawable_is_gray_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -598,9 +607,10 @@ static ProcRecord drawable_is_gray_proc =
}; };
static Argument * static Argument *
drawable_is_indexed_invoker (Gimp *gimp, drawable_is_indexed_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -653,9 +663,10 @@ static ProcRecord drawable_is_indexed_proc =
}; };
static Argument * static Argument *
drawable_bpp_invoker (Gimp *gimp, drawable_bpp_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -708,9 +719,10 @@ static ProcRecord drawable_bpp_proc =
}; };
static Argument * static Argument *
drawable_width_invoker (Gimp *gimp, drawable_width_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -763,9 +775,10 @@ static ProcRecord drawable_width_proc =
}; };
static Argument * static Argument *
drawable_height_invoker (Gimp *gimp, drawable_height_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -818,9 +831,10 @@ static ProcRecord drawable_height_proc =
}; };
static Argument * static Argument *
drawable_offsets_invoker (Gimp *gimp, drawable_offsets_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -886,9 +900,10 @@ static ProcRecord drawable_offsets_proc =
}; };
static Argument * static Argument *
drawable_get_image_invoker (Gimp *gimp, drawable_get_image_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -945,9 +960,10 @@ static ProcRecord drawable_get_image_proc =
}; };
static Argument * static Argument *
drawable_set_image_invoker (Gimp *gimp, drawable_set_image_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -998,9 +1014,10 @@ static ProcRecord drawable_set_image_proc =
}; };
static Argument * static Argument *
drawable_get_name_invoker (Gimp *gimp, drawable_get_name_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1053,9 +1070,10 @@ static ProcRecord drawable_get_name_proc =
}; };
static Argument * static Argument *
drawable_set_name_invoker (Gimp *gimp, drawable_set_name_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -1106,9 +1124,10 @@ static ProcRecord drawable_set_name_proc =
}; };
static Argument * static Argument *
drawable_get_visible_invoker (Gimp *gimp, drawable_get_visible_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1161,9 +1180,10 @@ static ProcRecord drawable_get_visible_proc =
}; };
static Argument * static Argument *
drawable_set_visible_invoker (Gimp *gimp, drawable_set_visible_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -1212,9 +1232,10 @@ static ProcRecord drawable_set_visible_proc =
}; };
static Argument * static Argument *
drawable_get_linked_invoker (Gimp *gimp, drawable_get_linked_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1267,9 +1288,10 @@ static ProcRecord drawable_get_linked_proc =
}; };
static Argument * static Argument *
drawable_set_linked_invoker (Gimp *gimp, drawable_set_linked_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -1318,9 +1340,10 @@ static ProcRecord drawable_set_linked_proc =
}; };
static Argument * static Argument *
drawable_get_tattoo_invoker (Gimp *gimp, drawable_get_tattoo_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1373,9 +1396,10 @@ static ProcRecord drawable_get_tattoo_proc =
}; };
static Argument * static Argument *
drawable_set_tattoo_invoker (Gimp *gimp, drawable_set_tattoo_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -1426,9 +1450,10 @@ static ProcRecord drawable_set_tattoo_proc =
}; };
static Argument * static Argument *
drawable_mask_bounds_invoker (Gimp *gimp, drawable_mask_bounds_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1515,9 +1540,10 @@ static ProcRecord drawable_mask_bounds_proc =
}; };
static Argument * static Argument *
drawable_merge_shadow_invoker (Gimp *gimp, drawable_merge_shadow_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -1577,9 +1603,10 @@ static ProcRecord drawable_merge_shadow_proc =
}; };
static Argument * static Argument *
drawable_update_invoker (Gimp *gimp, drawable_update_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -1652,9 +1679,10 @@ static ProcRecord drawable_update_proc =
}; };
static Argument * static Argument *
drawable_get_pixel_invoker (Gimp *gimp, drawable_get_pixel_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1764,9 +1792,10 @@ static ProcRecord drawable_get_pixel_proc =
}; };
static Argument * static Argument *
drawable_set_pixel_invoker (Gimp *gimp, drawable_set_pixel_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -1865,9 +1894,10 @@ static ProcRecord drawable_set_pixel_proc =
}; };
static Argument * static Argument *
drawable_fill_invoker (Gimp *gimp, drawable_fill_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -1918,9 +1948,10 @@ static ProcRecord drawable_fill_proc =
}; };
static Argument * static Argument *
drawable_offset_invoker (Gimp *gimp, drawable_offset_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -1998,9 +2029,10 @@ static ProcRecord drawable_offset_proc =
}; };
static Argument * static Argument *
drawable_thumbnail_invoker (Gimp *gimp, drawable_thumbnail_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;

View File

@ -60,9 +60,10 @@ register_edit_procs (Gimp *gimp)
} }
static Argument * static Argument *
edit_cut_invoker (Gimp *gimp, edit_cut_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -123,9 +124,10 @@ static ProcRecord edit_cut_proc =
}; };
static Argument * static Argument *
edit_copy_invoker (Gimp *gimp, edit_copy_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -186,9 +188,10 @@ static ProcRecord edit_copy_proc =
}; };
static Argument * static Argument *
edit_paste_invoker (Gimp *gimp, edit_paste_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -265,9 +268,10 @@ static ProcRecord edit_paste_proc =
}; };
static Argument * static Argument *
edit_clear_invoker (Gimp *gimp, edit_clear_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -312,9 +316,10 @@ static ProcRecord edit_clear_proc =
}; };
static Argument * static Argument *
edit_fill_invoker (Gimp *gimp, edit_fill_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -369,9 +374,10 @@ static ProcRecord edit_fill_proc =
}; };
static Argument * static Argument *
edit_bucket_fill_invoker (Gimp *gimp, edit_bucket_fill_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -495,9 +501,10 @@ static ProcRecord edit_bucket_fill_proc =
}; };
static Argument * static Argument *
edit_blend_invoker (Gimp *gimp, edit_blend_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -585,7 +592,7 @@ edit_blend_invoker (Gimp *gimp,
supersample, max_depth, supersample, max_depth,
threshold, dither, threshold, dither,
x1, y1, x2, y2, x1, y1, x2, y2,
NULL, NULL); NULL);
} }
} }
@ -693,9 +700,10 @@ static ProcRecord edit_blend_proc =
}; };
static Argument * static Argument *
edit_stroke_invoker (Gimp *gimp, edit_stroke_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;

View File

@ -79,9 +79,10 @@ register_fileops_procs (Gimp *gimp)
} }
static Argument * static Argument *
file_load_invoker (Gimp *gimp, file_load_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
Argument *new_args; Argument *new_args;
Argument *return_vals; Argument *return_vals;
@ -114,7 +115,7 @@ file_load_invoker (Gimp *gimp,
new_args[i].value.pdb_pointer = g_strdup (""); new_args[i].value.pdb_pointer = g_strdup ("");
} }
return_vals = procedural_db_execute (gimp, context, proc->name, new_args); return_vals = procedural_db_execute (gimp, context, progress, proc->name, new_args);
g_free (new_args); g_free (new_args);
return return_vals; return return_vals;
@ -165,9 +166,10 @@ static ProcRecord file_load_proc =
}; };
static Argument * static Argument *
file_save_invoker (Gimp *gimp, file_save_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
Argument *new_args; Argument *new_args;
Argument *return_vals; Argument *return_vals;
@ -200,7 +202,7 @@ file_save_invoker (Gimp *gimp,
new_args[i].value.pdb_pointer = g_strdup (""); new_args[i].value.pdb_pointer = g_strdup ("");
} }
return_vals = procedural_db_execute (gimp, context, proc->name, new_args); return_vals = procedural_db_execute (gimp, context, progress, proc->name, new_args);
g_free (new_args); g_free (new_args);
return return_vals; return return_vals;
@ -252,9 +254,10 @@ static ProcRecord file_save_proc =
}; };
static Argument * static Argument *
file_load_thumbnail_invoker (Gimp *gimp, file_load_thumbnail_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -383,9 +386,10 @@ static ProcRecord file_load_thumbnail_proc =
}; };
static Argument * static Argument *
file_save_thumbnail_invoker (Gimp *gimp, file_save_thumbnail_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -465,9 +469,10 @@ static ProcRecord file_save_thumbnail_proc =
}; };
static Argument * static Argument *
temp_name_invoker (Gimp *gimp, temp_name_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -542,9 +547,10 @@ static ProcRecord temp_name_proc =
}; };
static Argument * static Argument *
register_magic_load_handler_invoker (Gimp *gimp, register_magic_load_handler_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
@ -644,9 +650,10 @@ static ProcRecord register_magic_load_handler_proc =
}; };
static Argument * static Argument *
register_load_handler_invoker (Gimp *gimp, register_load_handler_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
int i; int i;
Argument argv[4]; Argument argv[4];
@ -657,7 +664,7 @@ register_load_handler_invoker (Gimp *gimp,
argv[3].arg_type = GIMP_PDB_STRING; argv[3].arg_type = GIMP_PDB_STRING;
argv[3].value.pdb_pointer = NULL; argv[3].value.pdb_pointer = NULL;
return register_magic_load_handler_invoker (gimp, context, argv); return register_magic_load_handler_invoker (gimp, context, progress, argv);
} }
static ProcArg register_load_handler_inargs[] = static ProcArg register_load_handler_inargs[] =
@ -696,9 +703,10 @@ static ProcRecord register_load_handler_proc =
}; };
static Argument * static Argument *
register_save_handler_invoker (Gimp *gimp, register_save_handler_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
@ -790,9 +798,10 @@ static ProcRecord register_save_handler_proc =
}; };
static Argument * static Argument *
register_file_handler_mime_invoker (Gimp *gimp, register_file_handler_mime_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;

View File

@ -49,9 +49,10 @@ register_floating_sel_procs (Gimp *gimp)
} }
static Argument * static Argument *
floating_sel_remove_invoker (Gimp *gimp, floating_sel_remove_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpLayer *floating_sel; GimpLayer *floating_sel;
@ -97,9 +98,10 @@ static ProcRecord floating_sel_remove_proc =
}; };
static Argument * static Argument *
floating_sel_anchor_invoker (Gimp *gimp, floating_sel_anchor_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpLayer *floating_sel; GimpLayer *floating_sel;
@ -145,9 +147,10 @@ static ProcRecord floating_sel_anchor_proc =
}; };
static Argument * static Argument *
floating_sel_to_layer_invoker (Gimp *gimp, floating_sel_to_layer_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpLayer *floating_sel; GimpLayer *floating_sel;
@ -193,9 +196,10 @@ static ProcRecord floating_sel_to_layer_proc =
}; };
static Argument * static Argument *
floating_sel_attach_invoker (Gimp *gimp, floating_sel_attach_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpLayer *layer; GimpLayer *layer;
@ -251,9 +255,10 @@ static ProcRecord floating_sel_attach_proc =
}; };
static Argument * static Argument *
floating_sel_rigor_invoker (Gimp *gimp, floating_sel_rigor_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpLayer *floating_sel; GimpLayer *floating_sel;
@ -307,9 +312,10 @@ static ProcRecord floating_sel_rigor_proc =
}; };
static Argument * static Argument *
floating_sel_relax_invoker (Gimp *gimp, floating_sel_relax_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpLayer *floating_sel; GimpLayer *floating_sel;

View File

@ -41,9 +41,10 @@ register_font_select_procs (Gimp *gimp)
} }
static Argument * static Argument *
fonts_popup_invoker (Gimp *gimp, fonts_popup_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *font_callback; gchar *font_callback;
@ -111,9 +112,10 @@ static ProcRecord fonts_popup_proc =
}; };
static Argument * static Argument *
fonts_close_popup_invoker (Gimp *gimp, fonts_close_popup_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *font_callback; gchar *font_callback;
@ -159,9 +161,10 @@ static ProcRecord fonts_close_popup_proc =
}; };
static Argument * static Argument *
fonts_set_popup_invoker (Gimp *gimp, fonts_set_popup_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *font_callback; gchar *font_callback;

View File

@ -42,9 +42,10 @@ register_fonts_procs (Gimp *gimp)
} }
static Argument * static Argument *
fonts_refresh_invoker (Gimp *gimp, fonts_refresh_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gimp_fonts_load (gimp); gimp_fonts_load (gimp);
return procedural_db_return_args (&fonts_refresh_proc, TRUE); return procedural_db_return_args (&fonts_refresh_proc, TRUE);
@ -67,9 +68,10 @@ static ProcRecord fonts_refresh_proc =
}; };
static Argument * static Argument *
fonts_get_list_invoker (Gimp *gimp, fonts_get_list_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;

View File

@ -30,6 +30,7 @@
#include "core/gimp.h" #include "core/gimp.h"
#include "core/gimpcontext.h" #include "core/gimpcontext.h"
#include "core/gimpprogress.h"
#include "plug-in/plug-in-run.h" #include "plug-in/plug-in-run.h"
@ -214,16 +215,18 @@ procedural_db_lookup (Gimp *gimp,
} }
Argument * Argument *
procedural_db_execute (Gimp *gimp, procedural_db_execute (Gimp *gimp,
GimpContext *context, GimpContext *context,
const gchar *name, GimpProgress *progress,
Argument *args) const gchar *name,
Argument *args)
{ {
Argument *return_args = NULL; Argument *return_args = NULL;
GList *list; GList *list;
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (name != NULL, NULL);
list = g_hash_table_lookup (gimp->procedural_ht, name); list = g_hash_table_lookup (gimp->procedural_ht, name);
@ -288,13 +291,14 @@ procedural_db_execute (Gimp *gimp,
case GIMP_INTERNAL: case GIMP_INTERNAL:
return_args = return_args =
(* procedure->exec_method.internal.marshal_func) (gimp, context, (* procedure->exec_method.internal.marshal_func) (gimp, context,
progress,
args); args);
break; break;
case GIMP_PLUGIN: case GIMP_PLUGIN:
case GIMP_EXTENSION: case GIMP_EXTENSION:
case GIMP_TEMPORARY: case GIMP_TEMPORARY:
return_args = plug_in_run (gimp, context, procedure, return_args = plug_in_run (gimp, context, progress, procedure,
args, procedure->num_args, args, procedure->num_args,
TRUE, FALSE, -1); TRUE, FALSE, -1);
break; break;
@ -336,10 +340,11 @@ procedural_db_execute (Gimp *gimp,
} }
Argument * Argument *
procedural_db_run_proc (Gimp *gimp, procedural_db_run_proc (Gimp *gimp,
GimpContext *context, GimpContext *context,
const gchar *name, GimpProgress *progress,
gint *nreturn_vals, const gchar *name,
gint *nreturn_vals,
...) ...)
{ {
ProcRecord *proc; ProcRecord *proc;
@ -350,6 +355,7 @@ procedural_db_run_proc (Gimp *gimp,
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (nreturn_vals != NULL, NULL); g_return_val_if_fail (nreturn_vals != NULL, NULL);
@ -441,7 +447,7 @@ procedural_db_run_proc (Gimp *gimp,
*nreturn_vals = proc->num_values; *nreturn_vals = proc->num_values;
return_vals = procedural_db_execute (gimp, context, name, params); return_vals = procedural_db_execute (gimp, context, progress, name, params);
g_free (params); g_free (params);

View File

@ -35,9 +35,10 @@ struct _Argument
/* Argument marshalling procedures */ /* Argument marshalling procedures */
typedef Argument * (* ArgMarshal) (Gimp *gimp, typedef Argument * (* ArgMarshal) (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args); GimpProgress *progress,
Argument *args);
/* Execution types */ /* Execution types */
@ -136,10 +137,12 @@ ProcRecord * procedural_db_lookup (Gimp *gimp,
Argument * procedural_db_execute (Gimp *gimp, Argument * procedural_db_execute (Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
const gchar *name, const gchar *name,
Argument *args); Argument *args);
Argument * procedural_db_run_proc (Gimp *gimp, Argument * procedural_db_run_proc (Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
const gchar *name, const gchar *name,
gint *nreturn_vals, gint *nreturn_vals,
...); ...);

View File

@ -30,6 +30,7 @@
#include "core/gimp.h" #include "core/gimp.h"
#include "core/gimpcontext.h" #include "core/gimpcontext.h"
#include "core/gimpprogress.h"
#include "plug-in/plug-in-run.h" #include "plug-in/plug-in-run.h"
@ -214,16 +215,18 @@ procedural_db_lookup (Gimp *gimp,
} }
Argument * Argument *
procedural_db_execute (Gimp *gimp, procedural_db_execute (Gimp *gimp,
GimpContext *context, GimpContext *context,
const gchar *name, GimpProgress *progress,
Argument *args) const gchar *name,
Argument *args)
{ {
Argument *return_args = NULL; Argument *return_args = NULL;
GList *list; GList *list;
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (name != NULL, NULL);
list = g_hash_table_lookup (gimp->procedural_ht, name); list = g_hash_table_lookup (gimp->procedural_ht, name);
@ -288,13 +291,14 @@ procedural_db_execute (Gimp *gimp,
case GIMP_INTERNAL: case GIMP_INTERNAL:
return_args = return_args =
(* procedure->exec_method.internal.marshal_func) (gimp, context, (* procedure->exec_method.internal.marshal_func) (gimp, context,
progress,
args); args);
break; break;
case GIMP_PLUGIN: case GIMP_PLUGIN:
case GIMP_EXTENSION: case GIMP_EXTENSION:
case GIMP_TEMPORARY: case GIMP_TEMPORARY:
return_args = plug_in_run (gimp, context, procedure, return_args = plug_in_run (gimp, context, progress, procedure,
args, procedure->num_args, args, procedure->num_args,
TRUE, FALSE, -1); TRUE, FALSE, -1);
break; break;
@ -336,10 +340,11 @@ procedural_db_execute (Gimp *gimp,
} }
Argument * Argument *
procedural_db_run_proc (Gimp *gimp, procedural_db_run_proc (Gimp *gimp,
GimpContext *context, GimpContext *context,
const gchar *name, GimpProgress *progress,
gint *nreturn_vals, const gchar *name,
gint *nreturn_vals,
...) ...)
{ {
ProcRecord *proc; ProcRecord *proc;
@ -350,6 +355,7 @@ procedural_db_run_proc (Gimp *gimp,
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (nreturn_vals != NULL, NULL); g_return_val_if_fail (nreturn_vals != NULL, NULL);
@ -441,7 +447,7 @@ procedural_db_run_proc (Gimp *gimp,
*nreturn_vals = proc->num_values; *nreturn_vals = proc->num_values;
return_vals = procedural_db_execute (gimp, context, name, params); return_vals = procedural_db_execute (gimp, context, progress, name, params);
g_free (params); g_free (params);

View File

@ -35,9 +35,10 @@ struct _Argument
/* Argument marshalling procedures */ /* Argument marshalling procedures */
typedef Argument * (* ArgMarshal) (Gimp *gimp, typedef Argument * (* ArgMarshal) (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args); GimpProgress *progress,
Argument *args);
/* Execution types */ /* Execution types */
@ -136,10 +137,12 @@ ProcRecord * procedural_db_lookup (Gimp *gimp,
Argument * procedural_db_execute (Gimp *gimp, Argument * procedural_db_execute (Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
const gchar *name, const gchar *name,
Argument *args); Argument *args);
Argument * procedural_db_run_proc (Gimp *gimp, Argument * procedural_db_run_proc (Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
const gchar *name, const gchar *name,
gint *nreturn_vals, gint *nreturn_vals,
...); ...);

View File

@ -30,6 +30,7 @@
#include "core/gimp.h" #include "core/gimp.h"
#include "core/gimpcontext.h" #include "core/gimpcontext.h"
#include "core/gimpprogress.h"
#include "plug-in/plug-in-run.h" #include "plug-in/plug-in-run.h"
@ -214,16 +215,18 @@ procedural_db_lookup (Gimp *gimp,
} }
Argument * Argument *
procedural_db_execute (Gimp *gimp, procedural_db_execute (Gimp *gimp,
GimpContext *context, GimpContext *context,
const gchar *name, GimpProgress *progress,
Argument *args) const gchar *name,
Argument *args)
{ {
Argument *return_args = NULL; Argument *return_args = NULL;
GList *list; GList *list;
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (name != NULL, NULL);
list = g_hash_table_lookup (gimp->procedural_ht, name); list = g_hash_table_lookup (gimp->procedural_ht, name);
@ -288,13 +291,14 @@ procedural_db_execute (Gimp *gimp,
case GIMP_INTERNAL: case GIMP_INTERNAL:
return_args = return_args =
(* procedure->exec_method.internal.marshal_func) (gimp, context, (* procedure->exec_method.internal.marshal_func) (gimp, context,
progress,
args); args);
break; break;
case GIMP_PLUGIN: case GIMP_PLUGIN:
case GIMP_EXTENSION: case GIMP_EXTENSION:
case GIMP_TEMPORARY: case GIMP_TEMPORARY:
return_args = plug_in_run (gimp, context, procedure, return_args = plug_in_run (gimp, context, progress, procedure,
args, procedure->num_args, args, procedure->num_args,
TRUE, FALSE, -1); TRUE, FALSE, -1);
break; break;
@ -336,10 +340,11 @@ procedural_db_execute (Gimp *gimp,
} }
Argument * Argument *
procedural_db_run_proc (Gimp *gimp, procedural_db_run_proc (Gimp *gimp,
GimpContext *context, GimpContext *context,
const gchar *name, GimpProgress *progress,
gint *nreturn_vals, const gchar *name,
gint *nreturn_vals,
...) ...)
{ {
ProcRecord *proc; ProcRecord *proc;
@ -350,6 +355,7 @@ procedural_db_run_proc (Gimp *gimp,
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (nreturn_vals != NULL, NULL); g_return_val_if_fail (nreturn_vals != NULL, NULL);
@ -441,7 +447,7 @@ procedural_db_run_proc (Gimp *gimp,
*nreturn_vals = proc->num_values; *nreturn_vals = proc->num_values;
return_vals = procedural_db_execute (gimp, context, name, params); return_vals = procedural_db_execute (gimp, context, progress, name, params);
g_free (params); g_free (params);

View File

@ -35,9 +35,10 @@ struct _Argument
/* Argument marshalling procedures */ /* Argument marshalling procedures */
typedef Argument * (* ArgMarshal) (Gimp *gimp, typedef Argument * (* ArgMarshal) (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args); GimpProgress *progress,
Argument *args);
/* Execution types */ /* Execution types */
@ -136,10 +137,12 @@ ProcRecord * procedural_db_lookup (Gimp *gimp,
Argument * procedural_db_execute (Gimp *gimp, Argument * procedural_db_execute (Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
const gchar *name, const gchar *name,
Argument *args); Argument *args);
Argument * procedural_db_run_proc (Gimp *gimp, Argument * procedural_db_run_proc (Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
const gchar *name, const gchar *name,
gint *nreturn_vals, gint *nreturn_vals,
...); ...);

View File

@ -54,9 +54,10 @@ register_gimprc_procs (Gimp *gimp)
} }
static Argument * static Argument *
gimprc_query_invoker (Gimp *gimp, gimprc_query_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -119,9 +120,10 @@ static ProcRecord gimprc_query_proc =
}; };
static Argument * static Argument *
gimprc_set_invoker (Gimp *gimp, gimprc_set_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *token; gchar *token;
@ -175,9 +177,10 @@ static ProcRecord gimprc_set_proc =
}; };
static Argument * static Argument *
get_default_comment_invoker (Gimp *gimp, get_default_comment_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
Argument *return_args; Argument *return_args;
gchar *comment; gchar *comment;
@ -216,9 +219,10 @@ static ProcRecord get_default_comment_proc =
}; };
static Argument * static Argument *
get_monitor_resolution_invoker (Gimp *gimp, get_monitor_resolution_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
Argument *return_args; Argument *return_args;
gdouble xres; gdouble xres;
@ -266,9 +270,10 @@ static ProcRecord get_monitor_resolution_proc =
}; };
static Argument * static Argument *
get_theme_dir_invoker (Gimp *gimp, get_theme_dir_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
Argument *return_args; Argument *return_args;
gchar *theme_dir; gchar *theme_dir;
@ -307,9 +312,10 @@ static ProcRecord get_theme_dir_proc =
}; };
static Argument * static Argument *
get_module_load_inhibit_invoker (Gimp *gimp, get_module_load_inhibit_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
Argument *return_args; Argument *return_args;
gchar *load_inhibit; gchar *load_inhibit;

View File

@ -89,9 +89,10 @@ register_gradient_edit_procs (Gimp *gimp)
} }
static Argument * static Argument *
gradient_segment_get_left_color_invoker (Gimp *gimp, gradient_segment_get_left_color_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -196,9 +197,10 @@ static ProcRecord gradient_segment_get_left_color_proc =
}; };
static Argument * static Argument *
gradient_segment_set_left_color_invoker (Gimp *gimp, gradient_segment_set_left_color_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
@ -296,9 +298,10 @@ static ProcRecord gradient_segment_set_left_color_proc =
}; };
static Argument * static Argument *
gradient_segment_get_right_color_invoker (Gimp *gimp, gradient_segment_get_right_color_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -403,9 +406,10 @@ static ProcRecord gradient_segment_get_right_color_proc =
}; };
static Argument * static Argument *
gradient_segment_set_right_color_invoker (Gimp *gimp, gradient_segment_set_right_color_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
@ -503,9 +507,10 @@ static ProcRecord gradient_segment_set_right_color_proc =
}; };
static Argument * static Argument *
gradient_segment_get_left_pos_invoker (Gimp *gimp, gradient_segment_get_left_pos_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -600,9 +605,10 @@ static ProcRecord gradient_segment_get_left_pos_proc =
}; };
static Argument * static Argument *
gradient_segment_set_left_pos_invoker (Gimp *gimp, gradient_segment_set_left_pos_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -708,9 +714,10 @@ static ProcRecord gradient_segment_set_left_pos_proc =
}; };
static Argument * static Argument *
gradient_segment_get_middle_pos_invoker (Gimp *gimp, gradient_segment_get_middle_pos_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -805,9 +812,10 @@ static ProcRecord gradient_segment_get_middle_pos_proc =
}; };
static Argument * static Argument *
gradient_segment_set_middle_pos_invoker (Gimp *gimp, gradient_segment_set_middle_pos_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -913,9 +921,10 @@ static ProcRecord gradient_segment_set_middle_pos_proc =
}; };
static Argument * static Argument *
gradient_segment_get_right_pos_invoker (Gimp *gimp, gradient_segment_get_right_pos_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1010,9 +1019,10 @@ static ProcRecord gradient_segment_get_right_pos_proc =
}; };
static Argument * static Argument *
gradient_segment_set_right_pos_invoker (Gimp *gimp, gradient_segment_set_right_pos_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1118,9 +1128,10 @@ static ProcRecord gradient_segment_set_right_pos_proc =
}; };
static Argument * static Argument *
gradient_segment_get_blending_function_invoker (Gimp *gimp, gradient_segment_get_blending_function_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1216,9 +1227,10 @@ static ProcRecord gradient_segment_get_blending_function_proc =
}; };
static Argument * static Argument *
gradient_segment_get_coloring_type_invoker (Gimp *gimp, gradient_segment_get_coloring_type_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1314,9 +1326,10 @@ static ProcRecord gradient_segment_get_coloring_type_proc =
}; };
static Argument * static Argument *
gradient_segment_range_set_blending_function_invoker (Gimp *gimp, gradient_segment_range_set_blending_function_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
@ -1435,9 +1448,10 @@ static ProcRecord gradient_segment_range_set_blending_function_proc =
}; };
static Argument * static Argument *
gradient_segment_range_set_coloring_type_invoker (Gimp *gimp, gradient_segment_range_set_coloring_type_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
@ -1556,9 +1570,10 @@ static ProcRecord gradient_segment_range_set_coloring_type_proc =
}; };
static Argument * static Argument *
gradient_segment_range_flip_invoker (Gimp *gimp, gradient_segment_range_flip_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
@ -1667,9 +1682,10 @@ static ProcRecord gradient_segment_range_flip_proc =
}; };
static Argument * static Argument *
gradient_segment_range_replicate_invoker (Gimp *gimp, gradient_segment_range_replicate_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
@ -1789,9 +1805,10 @@ static ProcRecord gradient_segment_range_replicate_proc =
}; };
static Argument * static Argument *
gradient_segment_range_split_midpoint_invoker (Gimp *gimp, gradient_segment_range_split_midpoint_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
@ -1900,9 +1917,10 @@ static ProcRecord gradient_segment_range_split_midpoint_proc =
}; };
static Argument * static Argument *
gradient_segment_range_split_uniform_invoker (Gimp *gimp, gradient_segment_range_split_uniform_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
@ -2022,9 +2040,10 @@ static ProcRecord gradient_segment_range_split_uniform_proc =
}; };
static Argument * static Argument *
gradient_segment_range_delete_invoker (Gimp *gimp, gradient_segment_range_delete_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
@ -2133,9 +2152,10 @@ static ProcRecord gradient_segment_range_delete_proc =
}; };
static Argument * static Argument *
gradient_segment_range_redistribute_handles_invoker (Gimp *gimp, gradient_segment_range_redistribute_handles_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
@ -2243,9 +2263,10 @@ static ProcRecord gradient_segment_range_redistribute_handles_proc =
}; };
static Argument * static Argument *
gradient_segment_range_blend_colors_invoker (Gimp *gimp, gradient_segment_range_blend_colors_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
@ -2355,9 +2376,10 @@ static ProcRecord gradient_segment_range_blend_colors_proc =
}; };
static Argument * static Argument *
gradient_segment_range_blend_opacity_invoker (Gimp *gimp, gradient_segment_range_blend_opacity_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
@ -2467,9 +2489,10 @@ static ProcRecord gradient_segment_range_blend_opacity_proc =
}; };
static Argument * static Argument *
gradient_segment_range_move_invoker (Gimp *gimp, gradient_segment_range_move_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;

View File

@ -43,9 +43,10 @@ register_gradient_select_procs (Gimp *gimp)
} }
static Argument * static Argument *
gradients_popup_invoker (Gimp *gimp, gradients_popup_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *gradient_callback; gchar *gradient_callback;
@ -124,9 +125,10 @@ static ProcRecord gradients_popup_proc =
}; };
static Argument * static Argument *
gradients_close_popup_invoker (Gimp *gimp, gradients_close_popup_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *gradient_callback; gchar *gradient_callback;
@ -173,9 +175,10 @@ static ProcRecord gradients_close_popup_proc =
}; };
static Argument * static Argument *
gradients_set_popup_invoker (Gimp *gimp, gradients_set_popup_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *gradient_callback; gchar *gradient_callback;

View File

@ -63,9 +63,10 @@ register_gradients_procs (Gimp *gimp)
} }
static Argument * static Argument *
gradients_refresh_invoker (Gimp *gimp, gradients_refresh_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gimp_data_factory_data_save (gimp->gradient_factory); gimp_data_factory_data_save (gimp->gradient_factory);
gimp_data_factory_data_init (gimp->gradient_factory, FALSE); gimp_data_factory_data_init (gimp->gradient_factory, FALSE);
@ -89,9 +90,10 @@ static ProcRecord gradients_refresh_proc =
}; };
static Argument * static Argument *
gradients_get_list_invoker (Gimp *gimp, gradients_get_list_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -157,9 +159,10 @@ static ProcRecord gradients_get_list_proc =
}; };
static Argument * static Argument *
gradients_get_gradient_invoker (Gimp *gimp, gradients_get_gradient_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -200,9 +203,10 @@ static ProcRecord gradients_get_gradient_proc =
}; };
static Argument * static Argument *
gradients_set_gradient_invoker (Gimp *gimp, gradients_set_gradient_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
@ -252,9 +256,10 @@ static ProcRecord gradients_set_gradient_proc =
}; };
static Argument * static Argument *
gradients_sample_uniform_invoker (Gimp *gimp, gradients_sample_uniform_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -353,9 +358,10 @@ static ProcRecord gradients_sample_uniform_proc =
}; };
static Argument * static Argument *
gradients_sample_custom_invoker (Gimp *gimp, gradients_sample_custom_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -458,9 +464,10 @@ static ProcRecord gradients_sample_custom_proc =
}; };
static Argument * static Argument *
gradients_get_gradient_data_invoker (Gimp *gimp, gradients_get_gradient_data_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -589,9 +596,10 @@ static ProcRecord gradients_get_gradient_data_proc =
}; };
static Argument * static Argument *
gradients_new_invoker (Gimp *gimp, gradients_new_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -651,9 +659,10 @@ static ProcRecord gradients_new_proc =
}; };
static Argument * static Argument *
gradients_duplicate_invoker (Gimp *gimp, gradients_duplicate_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -735,9 +744,10 @@ static ProcRecord gradients_duplicate_proc =
}; };
static Argument * static Argument *
gradients_delete_invoker (Gimp *gimp, gradients_delete_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
@ -807,9 +817,10 @@ static ProcRecord gradients_delete_proc =
}; };
static Argument * static Argument *
gradients_rename_invoker (Gimp *gimp, gradients_rename_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;

View File

@ -49,9 +49,10 @@ register_guides_procs (Gimp *gimp)
} }
static Argument * static Argument *
image_add_hguide_invoker (Gimp *gimp, image_add_hguide_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -127,9 +128,10 @@ static ProcRecord image_add_hguide_proc =
}; };
static Argument * static Argument *
image_add_vguide_invoker (Gimp *gimp, image_add_vguide_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -205,9 +207,10 @@ static ProcRecord image_add_vguide_proc =
}; };
static Argument * static Argument *
image_delete_guide_invoker (Gimp *gimp, image_delete_guide_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -271,9 +274,10 @@ static ProcRecord image_delete_guide_proc =
}; };
static Argument * static Argument *
image_find_next_guide_invoker (Gimp *gimp, image_find_next_guide_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -376,9 +380,10 @@ static ProcRecord image_find_next_guide_proc =
}; };
static Argument * static Argument *
image_get_guide_orientation_invoker (Gimp *gimp, image_get_guide_orientation_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -459,9 +464,10 @@ static ProcRecord image_get_guide_orientation_proc =
}; };
static Argument * static Argument *
image_get_guide_position_invoker (Gimp *gimp, image_get_guide_position_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;

View File

@ -39,9 +39,10 @@ register_help_procs (Gimp *gimp)
} }
static Argument * static Argument *
help_invoker (Gimp *gimp, help_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *help_domain; gchar *help_domain;

View File

@ -190,9 +190,10 @@ register_image_procs (Gimp *gimp)
#endif #endif
static Argument * static Argument *
image_list_invoker (Gimp *gimp, image_list_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
Argument *return_args; Argument *return_args;
gint32 num_images = 0; gint32 num_images = 0;
@ -249,9 +250,10 @@ static ProcRecord image_list_proc =
}; };
static Argument * static Argument *
image_new_invoker (Gimp *gimp, image_new_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -331,9 +333,10 @@ static ProcRecord image_new_proc =
}; };
static Argument * static Argument *
image_duplicate_invoker (Gimp *gimp, image_duplicate_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -390,9 +393,10 @@ static ProcRecord image_duplicate_proc =
}; };
static Argument * static Argument *
image_delete_invoker (Gimp *gimp, image_delete_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -438,9 +442,10 @@ static ProcRecord image_delete_proc =
}; };
static Argument * static Argument *
image_base_type_invoker (Gimp *gimp, image_base_type_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -497,9 +502,10 @@ static ProcRecord image_base_type_proc =
}; };
static Argument * static Argument *
image_width_invoker (Gimp *gimp, image_width_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -552,9 +558,10 @@ static ProcRecord image_width_proc =
}; };
static Argument * static Argument *
image_height_invoker (Gimp *gimp, image_height_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -607,9 +614,10 @@ static ProcRecord image_height_proc =
}; };
static Argument * static Argument *
image_free_shadow_invoker (Gimp *gimp, image_free_shadow_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -650,9 +658,10 @@ static ProcRecord image_free_shadow_proc =
}; };
static Argument * static Argument *
image_resize_invoker (Gimp *gimp, image_resize_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -680,7 +689,7 @@ image_resize_invoker (Gimp *gimp,
if (success) if (success)
{ {
gimp_image_resize (gimage, context, gimp_image_resize (gimage, context,
new_width, new_height, offx, offy, NULL, NULL); new_width, new_height, offx, offy, NULL);
} }
return procedural_db_return_args (&image_resize_proc, success); return procedural_db_return_args (&image_resize_proc, success);
@ -732,9 +741,10 @@ static ProcRecord image_resize_proc =
}; };
static Argument * static Argument *
image_scale_invoker (Gimp *gimp, image_scale_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -757,7 +767,7 @@ image_scale_invoker (Gimp *gimp,
{ {
gimp_image_scale (gimage, new_width, new_height, gimp_image_scale (gimage, new_width, new_height,
gimp->config->interpolation_type, gimp->config->interpolation_type,
NULL, NULL); NULL);
} }
return procedural_db_return_args (&image_scale_proc, success); return procedural_db_return_args (&image_scale_proc, success);
@ -799,9 +809,10 @@ static ProcRecord image_scale_proc =
}; };
static Argument * static Argument *
image_crop_invoker (Gimp *gimp, image_crop_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -892,9 +903,10 @@ static ProcRecord image_crop_proc =
}; };
static Argument * static Argument *
image_flip_invoker (Gimp *gimp, image_flip_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -910,7 +922,7 @@ image_flip_invoker (Gimp *gimp,
if (success) if (success)
{ {
gimp_image_flip (gimage, context, flip_type, NULL, NULL); gimp_image_flip (gimage, context, flip_type, NULL);
} }
return procedural_db_return_args (&image_flip_proc, success); return procedural_db_return_args (&image_flip_proc, success);
@ -947,9 +959,10 @@ static ProcRecord image_flip_proc =
}; };
static Argument * static Argument *
image_rotate_invoker (Gimp *gimp, image_rotate_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -965,7 +978,7 @@ image_rotate_invoker (Gimp *gimp,
if (success) if (success)
{ {
gimp_image_rotate (gimage, context, rotate_type, NULL, NULL); gimp_image_rotate (gimage, context, rotate_type, NULL);
} }
return procedural_db_return_args (&image_rotate_proc, success); return procedural_db_return_args (&image_rotate_proc, success);
@ -1002,9 +1015,10 @@ static ProcRecord image_rotate_proc =
}; };
static Argument * static Argument *
image_get_layers_invoker (Gimp *gimp, image_get_layers_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1082,9 +1096,10 @@ static ProcRecord image_get_layers_proc =
}; };
static Argument * static Argument *
image_get_channels_invoker (Gimp *gimp, image_get_channels_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1162,9 +1177,10 @@ static ProcRecord image_get_channels_proc =
}; };
static Argument * static Argument *
image_get_active_drawable_invoker (Gimp *gimp, image_get_active_drawable_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1221,9 +1237,10 @@ static ProcRecord image_get_active_drawable_proc =
}; };
static Argument * static Argument *
image_unset_active_channel_invoker (Gimp *gimp, image_unset_active_channel_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -1264,9 +1281,10 @@ static ProcRecord image_unset_active_channel_proc =
}; };
static Argument * static Argument *
image_get_floating_sel_invoker (Gimp *gimp, image_get_floating_sel_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1323,9 +1341,10 @@ static ProcRecord image_get_floating_sel_proc =
}; };
static Argument * static Argument *
image_floating_sel_attached_to_invoker (Gimp *gimp, image_floating_sel_attached_to_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1390,9 +1409,10 @@ static ProcRecord image_floating_sel_attached_to_proc =
}; };
static Argument * static Argument *
image_pick_color_invoker (Gimp *gimp, image_pick_color_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1514,9 +1534,10 @@ static ProcRecord image_pick_color_proc =
}; };
static Argument * static Argument *
image_pick_correlate_layer_invoker (Gimp *gimp, image_pick_correlate_layer_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1589,9 +1610,10 @@ static ProcRecord image_pick_correlate_layer_proc =
}; };
static Argument * static Argument *
image_add_layer_invoker (Gimp *gimp, image_add_layer_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -1660,9 +1682,10 @@ static ProcRecord image_add_layer_proc =
}; };
static Argument * static Argument *
image_remove_layer_invoker (Gimp *gimp, image_remove_layer_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -1713,9 +1736,10 @@ static ProcRecord image_remove_layer_proc =
}; };
static Argument * static Argument *
image_raise_layer_invoker (Gimp *gimp, image_raise_layer_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -1766,9 +1790,10 @@ static ProcRecord image_raise_layer_proc =
}; };
static Argument * static Argument *
image_lower_layer_invoker (Gimp *gimp, image_lower_layer_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -1819,9 +1844,10 @@ static ProcRecord image_lower_layer_proc =
}; };
static Argument * static Argument *
image_raise_layer_to_top_invoker (Gimp *gimp, image_raise_layer_to_top_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -1872,9 +1898,10 @@ static ProcRecord image_raise_layer_to_top_proc =
}; };
static Argument * static Argument *
image_lower_layer_to_bottom_invoker (Gimp *gimp, image_lower_layer_to_bottom_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -1925,9 +1952,10 @@ static ProcRecord image_lower_layer_to_bottom_proc =
}; };
static Argument * static Argument *
image_add_channel_invoker (Gimp *gimp, image_add_channel_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -1986,9 +2014,10 @@ static ProcRecord image_add_channel_proc =
}; };
static Argument * static Argument *
image_remove_channel_invoker (Gimp *gimp, image_remove_channel_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -2039,9 +2068,10 @@ static ProcRecord image_remove_channel_proc =
}; };
static Argument * static Argument *
image_raise_channel_invoker (Gimp *gimp, image_raise_channel_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -2092,9 +2122,10 @@ static ProcRecord image_raise_channel_proc =
}; };
static Argument * static Argument *
image_lower_channel_invoker (Gimp *gimp, image_lower_channel_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -2145,9 +2176,10 @@ static ProcRecord image_lower_channel_proc =
}; };
static Argument * static Argument *
image_flatten_invoker (Gimp *gimp, image_flatten_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -2204,9 +2236,10 @@ static ProcRecord image_flatten_proc =
}; };
static Argument * static Argument *
image_merge_visible_layers_invoker (Gimp *gimp, image_merge_visible_layers_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -2276,9 +2309,10 @@ static ProcRecord image_merge_visible_layers_proc =
}; };
static Argument * static Argument *
image_merge_down_invoker (Gimp *gimp, image_merge_down_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -2358,9 +2392,10 @@ static ProcRecord image_merge_down_proc =
}; };
static Argument * static Argument *
image_add_layer_mask_invoker (Gimp *gimp, image_add_layer_mask_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -2423,9 +2458,10 @@ static ProcRecord image_add_layer_mask_proc =
}; };
static Argument * static Argument *
image_remove_layer_mask_invoker (Gimp *gimp, image_remove_layer_mask_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -2486,9 +2522,10 @@ static ProcRecord image_remove_layer_mask_proc =
}; };
static Argument * static Argument *
image_get_cmap_invoker (Gimp *gimp, image_get_cmap_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -2557,9 +2594,10 @@ static ProcRecord image_get_cmap_proc =
}; };
static Argument * static Argument *
image_set_cmap_invoker (Gimp *gimp, image_set_cmap_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -2618,9 +2656,10 @@ static ProcRecord image_set_cmap_proc =
}; };
static Argument * static Argument *
image_clean_all_invoker (Gimp *gimp, image_clean_all_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -2661,9 +2700,10 @@ static ProcRecord image_clean_all_proc =
}; };
static Argument * static Argument *
image_is_dirty_invoker (Gimp *gimp, image_is_dirty_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -2720,9 +2760,10 @@ static ProcRecord image_is_dirty_proc =
}; };
static Argument * static Argument *
image_thumbnail_invoker (Gimp *gimp, image_thumbnail_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -2867,9 +2908,10 @@ static ProcRecord image_thumbnail_proc =
}; };
static Argument * static Argument *
image_get_active_layer_invoker (Gimp *gimp, image_get_active_layer_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -2926,9 +2968,10 @@ static ProcRecord image_get_active_layer_proc =
}; };
static Argument * static Argument *
image_set_active_layer_invoker (Gimp *gimp, image_set_active_layer_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -2979,9 +3022,10 @@ static ProcRecord image_set_active_layer_proc =
}; };
static Argument * static Argument *
image_get_active_channel_invoker (Gimp *gimp, image_get_active_channel_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -3038,9 +3082,10 @@ static ProcRecord image_get_active_channel_proc =
}; };
static Argument * static Argument *
image_set_active_channel_invoker (Gimp *gimp, image_set_active_channel_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -3091,9 +3136,10 @@ static ProcRecord image_set_active_channel_proc =
}; };
static Argument * static Argument *
image_get_selection_invoker (Gimp *gimp, image_get_selection_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -3150,9 +3196,10 @@ static ProcRecord image_get_selection_proc =
}; };
static Argument * static Argument *
image_get_component_active_invoker (Gimp *gimp, image_get_component_active_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -3225,9 +3272,10 @@ static ProcRecord image_get_component_active_proc =
}; };
static Argument * static Argument *
image_set_component_active_invoker (Gimp *gimp, image_set_component_active_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -3296,9 +3344,10 @@ static ProcRecord image_set_component_active_proc =
}; };
static Argument * static Argument *
image_get_component_visible_invoker (Gimp *gimp, image_get_component_visible_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -3371,9 +3420,10 @@ static ProcRecord image_get_component_visible_proc =
}; };
static Argument * static Argument *
image_set_component_visible_invoker (Gimp *gimp, image_set_component_visible_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -3442,9 +3492,10 @@ static ProcRecord image_set_component_visible_proc =
}; };
static Argument * static Argument *
image_get_filename_invoker (Gimp *gimp, image_get_filename_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -3497,9 +3548,10 @@ static ProcRecord image_get_filename_proc =
}; };
static Argument * static Argument *
image_set_filename_invoker (Gimp *gimp, image_set_filename_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -3550,9 +3602,10 @@ static ProcRecord image_set_filename_proc =
}; };
static Argument * static Argument *
image_get_name_invoker (Gimp *gimp, image_get_name_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -3622,9 +3675,10 @@ static ProcRecord image_get_name_proc =
}; };
static Argument * static Argument *
image_get_resolution_invoker (Gimp *gimp, image_get_resolution_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -3685,9 +3739,10 @@ static ProcRecord image_get_resolution_proc =
}; };
static Argument * static Argument *
image_set_resolution_invoker (Gimp *gimp, image_set_resolution_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -3758,9 +3813,10 @@ static ProcRecord image_set_resolution_proc =
}; };
static Argument * static Argument *
image_get_unit_invoker (Gimp *gimp, image_get_unit_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -3813,9 +3869,10 @@ static ProcRecord image_get_unit_proc =
}; };
static Argument * static Argument *
image_set_unit_invoker (Gimp *gimp, image_set_unit_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -3866,9 +3923,10 @@ static ProcRecord image_set_unit_proc =
}; };
static Argument * static Argument *
image_get_tattoo_state_invoker (Gimp *gimp, image_get_tattoo_state_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -3921,9 +3979,10 @@ static ProcRecord image_get_tattoo_state_proc =
}; };
static Argument * static Argument *
image_set_tattoo_state_invoker (Gimp *gimp, image_set_tattoo_state_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -3972,9 +4031,10 @@ static ProcRecord image_set_tattoo_state_proc =
}; };
static Argument * static Argument *
image_get_layer_by_tattoo_invoker (Gimp *gimp, image_get_layer_by_tattoo_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -4044,9 +4104,10 @@ static ProcRecord image_get_layer_by_tattoo_proc =
}; };
static Argument * static Argument *
image_get_channel_by_tattoo_invoker (Gimp *gimp, image_get_channel_by_tattoo_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;

View File

@ -96,9 +96,10 @@ register_layer_procs (Gimp *gimp)
} }
static Argument * static Argument *
layer_new_invoker (Gimp *gimp, layer_new_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -222,9 +223,10 @@ static ProcRecord layer_new_proc =
}; };
static Argument * static Argument *
layer_new_from_drawable_invoker (Gimp *gimp, layer_new_from_drawable_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -309,9 +311,10 @@ static ProcRecord layer_new_from_drawable_proc =
}; };
static Argument * static Argument *
layer_copy_invoker (Gimp *gimp, layer_copy_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -376,9 +379,10 @@ static ProcRecord layer_copy_proc =
}; };
static Argument * static Argument *
layer_add_alpha_invoker (Gimp *gimp, layer_add_alpha_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpLayer *layer; GimpLayer *layer;
@ -419,9 +423,10 @@ static ProcRecord layer_add_alpha_proc =
}; };
static Argument * static Argument *
layer_scale_invoker (Gimp *gimp, layer_scale_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpLayer *layer; GimpLayer *layer;
@ -444,7 +449,7 @@ layer_scale_invoker (Gimp *gimp,
local_origin = args[3].value.pdb_int ? TRUE : FALSE; local_origin = args[3].value.pdb_int ? TRUE : FALSE;
if (success) if (success)
gimp_item_scale_by_origin (GIMP_ITEM (layer), new_width, new_height, gimp->config->interpolation_type, NULL, NULL, local_origin); gimp_item_scale_by_origin (GIMP_ITEM (layer), new_width, new_height, gimp->config->interpolation_type, NULL, local_origin);
return procedural_db_return_args (&layer_scale_proc, success); return procedural_db_return_args (&layer_scale_proc, success);
} }
@ -490,9 +495,10 @@ static ProcRecord layer_scale_proc =
}; };
static Argument * static Argument *
layer_resize_invoker (Gimp *gimp, layer_resize_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpLayer *layer; GimpLayer *layer;
@ -569,9 +575,10 @@ static ProcRecord layer_resize_proc =
}; };
static Argument * static Argument *
layer_resize_to_image_size_invoker (Gimp *gimp, layer_resize_to_image_size_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpLayer *layer; GimpLayer *layer;
@ -617,9 +624,10 @@ static ProcRecord layer_resize_to_image_size_proc =
}; };
static Argument * static Argument *
layer_translate_invoker (Gimp *gimp, layer_translate_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpLayer *layer; GimpLayer *layer;
@ -694,9 +702,10 @@ static ProcRecord layer_translate_proc =
}; };
static Argument * static Argument *
layer_set_offsets_invoker (Gimp *gimp, layer_set_offsets_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpLayer *layer; GimpLayer *layer;
@ -771,9 +780,10 @@ static ProcRecord layer_set_offsets_proc =
}; };
static Argument * static Argument *
layer_create_mask_invoker (Gimp *gimp, layer_create_mask_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -840,9 +850,10 @@ static ProcRecord layer_create_mask_proc =
}; };
static Argument * static Argument *
layer_get_mask_invoker (Gimp *gimp, layer_get_mask_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -895,9 +906,10 @@ static ProcRecord layer_get_mask_proc =
}; };
static Argument * static Argument *
layer_add_mask_invoker (Gimp *gimp, layer_add_mask_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpLayer *layer; GimpLayer *layer;
@ -950,9 +962,10 @@ static ProcRecord layer_add_mask_proc =
}; };
static Argument * static Argument *
layer_remove_mask_invoker (Gimp *gimp, layer_remove_mask_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpLayer *layer; GimpLayer *layer;
@ -1003,9 +1016,10 @@ static ProcRecord layer_remove_mask_proc =
}; };
static Argument * static Argument *
layer_is_floating_sel_invoker (Gimp *gimp, layer_is_floating_sel_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1058,9 +1072,10 @@ static ProcRecord layer_is_floating_sel_proc =
}; };
static Argument * static Argument *
layer_get_preserve_trans_invoker (Gimp *gimp, layer_get_preserve_trans_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1113,9 +1128,10 @@ static ProcRecord layer_get_preserve_trans_proc =
}; };
static Argument * static Argument *
layer_set_preserve_trans_invoker (Gimp *gimp, layer_set_preserve_trans_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpLayer *layer; GimpLayer *layer;
@ -1164,9 +1180,10 @@ static ProcRecord layer_set_preserve_trans_proc =
}; };
static Argument * static Argument *
layer_get_apply_mask_invoker (Gimp *gimp, layer_get_apply_mask_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1219,9 +1236,10 @@ static ProcRecord layer_get_apply_mask_proc =
}; };
static Argument * static Argument *
layer_set_apply_mask_invoker (Gimp *gimp, layer_set_apply_mask_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpLayer *layer; GimpLayer *layer;
@ -1270,9 +1288,10 @@ static ProcRecord layer_set_apply_mask_proc =
}; };
static Argument * static Argument *
layer_get_show_mask_invoker (Gimp *gimp, layer_get_show_mask_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1325,9 +1344,10 @@ static ProcRecord layer_get_show_mask_proc =
}; };
static Argument * static Argument *
layer_set_show_mask_invoker (Gimp *gimp, layer_set_show_mask_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpLayer *layer; GimpLayer *layer;
@ -1376,9 +1396,10 @@ static ProcRecord layer_set_show_mask_proc =
}; };
static Argument * static Argument *
layer_get_edit_mask_invoker (Gimp *gimp, layer_get_edit_mask_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1431,9 +1452,10 @@ static ProcRecord layer_get_edit_mask_proc =
}; };
static Argument * static Argument *
layer_set_edit_mask_invoker (Gimp *gimp, layer_set_edit_mask_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpLayer *layer; GimpLayer *layer;
@ -1482,9 +1504,10 @@ static ProcRecord layer_set_edit_mask_proc =
}; };
static Argument * static Argument *
layer_get_opacity_invoker (Gimp *gimp, layer_get_opacity_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1537,9 +1560,10 @@ static ProcRecord layer_get_opacity_proc =
}; };
static Argument * static Argument *
layer_set_opacity_invoker (Gimp *gimp, layer_set_opacity_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpLayer *layer; GimpLayer *layer;
@ -1590,9 +1614,10 @@ static ProcRecord layer_set_opacity_proc =
}; };
static Argument * static Argument *
layer_get_mode_invoker (Gimp *gimp, layer_get_mode_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1645,9 +1670,10 @@ static ProcRecord layer_get_mode_proc =
}; };
static Argument * static Argument *
layer_set_mode_invoker (Gimp *gimp, layer_set_mode_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpLayer *layer; GimpLayer *layer;

View File

@ -44,9 +44,10 @@ register_message_procs (Gimp *gimp)
} }
static Argument * static Argument *
message_invoker (Gimp *gimp, message_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *message; gchar *message;
@ -96,9 +97,10 @@ static ProcRecord message_proc =
}; };
static Argument * static Argument *
message_get_handler_invoker (Gimp *gimp, message_get_handler_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
Argument *return_args; Argument *return_args;
@ -134,9 +136,10 @@ static ProcRecord message_get_handler_proc =
}; };
static Argument * static Argument *
message_set_handler_invoker (Gimp *gimp, message_set_handler_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gint32 handler; gint32 handler;

View File

@ -41,9 +41,10 @@ register_misc_procs (Gimp *gimp)
} }
static Argument * static Argument *
version_invoker (Gimp *gimp, version_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
Argument *return_args; Argument *return_args;
@ -79,9 +80,10 @@ static ProcRecord version_proc =
}; };
static Argument * static Argument *
quit_invoker (Gimp *gimp, quit_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean force; gboolean force;

View File

@ -132,9 +132,10 @@ paint_tools_stroke (Gimp *gimp,
} }
static Argument * static Argument *
airbrush_invoker (Gimp *gimp, airbrush_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -216,9 +217,10 @@ static ProcRecord airbrush_proc =
}; };
static Argument * static Argument *
airbrush_default_invoker (Gimp *gimp, airbrush_default_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -288,9 +290,10 @@ static ProcRecord airbrush_default_proc =
}; };
static Argument * static Argument *
clone_invoker (Gimp *gimp, clone_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -409,9 +412,10 @@ static ProcRecord clone_proc =
}; };
static Argument * static Argument *
clone_default_invoker (Gimp *gimp, clone_default_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -481,9 +485,10 @@ static ProcRecord clone_default_proc =
}; };
static Argument * static Argument *
convolve_invoker (Gimp *gimp, convolve_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -578,9 +583,10 @@ static ProcRecord convolve_proc =
}; };
static Argument * static Argument *
convolve_default_invoker (Gimp *gimp, convolve_default_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -650,9 +656,10 @@ static ProcRecord convolve_default_proc =
}; };
static Argument * static Argument *
dodgeburn_invoker (Gimp *gimp, dodgeburn_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -758,9 +765,10 @@ static ProcRecord dodgeburn_proc =
}; };
static Argument * static Argument *
dodgeburn_default_invoker (Gimp *gimp, dodgeburn_default_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -830,9 +838,10 @@ static ProcRecord dodgeburn_default_proc =
}; };
static Argument * static Argument *
eraser_invoker (Gimp *gimp, eraser_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -927,9 +936,10 @@ static ProcRecord eraser_proc =
}; };
static Argument * static Argument *
eraser_default_invoker (Gimp *gimp, eraser_default_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -999,9 +1009,10 @@ static ProcRecord eraser_default_proc =
}; };
static Argument * static Argument *
paintbrush_invoker (Gimp *gimp, paintbrush_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -1109,9 +1120,10 @@ static ProcRecord paintbrush_proc =
}; };
static Argument * static Argument *
paintbrush_default_invoker (Gimp *gimp, paintbrush_default_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -1181,9 +1193,10 @@ static ProcRecord paintbrush_default_proc =
}; };
static Argument * static Argument *
pencil_invoker (Gimp *gimp, pencil_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -1253,9 +1266,10 @@ static ProcRecord pencil_proc =
}; };
static Argument * static Argument *
smudge_invoker (Gimp *gimp, smudge_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -1339,9 +1353,10 @@ static ProcRecord smudge_proc =
}; };
static Argument * static Argument *
smudge_default_invoker (Gimp *gimp, smudge_default_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;

View File

@ -50,9 +50,10 @@ register_palette_procs (Gimp *gimp)
} }
static Argument * static Argument *
palette_get_foreground_invoker (Gimp *gimp, palette_get_foreground_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
Argument *return_args; Argument *return_args;
GimpRGB color; GimpRGB color;
@ -91,9 +92,10 @@ static ProcRecord palette_get_foreground_proc =
}; };
static Argument * static Argument *
palette_get_background_invoker (Gimp *gimp, palette_get_background_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
Argument *return_args; Argument *return_args;
GimpRGB color; GimpRGB color;
@ -132,9 +134,10 @@ static ProcRecord palette_get_background_proc =
}; };
static Argument * static Argument *
palette_set_foreground_invoker (Gimp *gimp, palette_set_foreground_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
GimpRGB color; GimpRGB color;
@ -172,9 +175,10 @@ static ProcRecord palette_set_foreground_proc =
}; };
static Argument * static Argument *
palette_set_background_invoker (Gimp *gimp, palette_set_background_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
GimpRGB color; GimpRGB color;
@ -212,9 +216,10 @@ static ProcRecord palette_set_background_proc =
}; };
static Argument * static Argument *
palette_set_default_colors_invoker (Gimp *gimp, palette_set_default_colors_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gimp_context_set_default_colors (context); gimp_context_set_default_colors (context);
return procedural_db_return_args (&palette_set_default_colors_proc, TRUE); return procedural_db_return_args (&palette_set_default_colors_proc, TRUE);
@ -237,9 +242,10 @@ static ProcRecord palette_set_default_colors_proc =
}; };
static Argument * static Argument *
palette_swap_colors_invoker (Gimp *gimp, palette_swap_colors_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gimp_context_swap_colors (context); gimp_context_swap_colors (context);
return procedural_db_return_args (&palette_swap_colors_proc, TRUE); return procedural_db_return_args (&palette_swap_colors_proc, TRUE);

View File

@ -42,9 +42,10 @@ register_palette_select_procs (Gimp *gimp)
} }
static Argument * static Argument *
palettes_popup_invoker (Gimp *gimp, palettes_popup_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *palette_callback; gchar *palette_callback;
@ -112,9 +113,10 @@ static ProcRecord palettes_popup_proc =
}; };
static Argument * static Argument *
palettes_close_popup_invoker (Gimp *gimp, palettes_close_popup_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *palette_callback; gchar *palette_callback;
@ -161,9 +163,10 @@ static ProcRecord palettes_close_popup_proc =
}; };
static Argument * static Argument *
palettes_set_popup_invoker (Gimp *gimp, palettes_set_popup_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *palette_callback; gchar *palette_callback;

View File

@ -53,9 +53,10 @@ register_palettes_procs (Gimp *gimp)
} }
static Argument * static Argument *
palettes_refresh_invoker (Gimp *gimp, palettes_refresh_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gimp_data_factory_data_save (gimp->palette_factory); gimp_data_factory_data_save (gimp->palette_factory);
gimp_data_factory_data_init (gimp->palette_factory, FALSE); gimp_data_factory_data_init (gimp->palette_factory, FALSE);
@ -79,9 +80,10 @@ static ProcRecord palettes_refresh_proc =
}; };
static Argument * static Argument *
palettes_get_list_invoker (Gimp *gimp, palettes_get_list_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -147,9 +149,10 @@ static ProcRecord palettes_get_list_proc =
}; };
static Argument * static Argument *
palettes_get_palette_invoker (Gimp *gimp, palettes_get_palette_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -199,9 +202,10 @@ static ProcRecord palettes_get_palette_proc =
}; };
static Argument * static Argument *
palettes_set_palette_invoker (Gimp *gimp, palettes_set_palette_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
@ -251,9 +255,10 @@ static ProcRecord palettes_set_palette_proc =
}; };
static Argument * static Argument *
palettes_get_palette_entry_invoker (Gimp *gimp, palettes_get_palette_entry_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;

View File

@ -63,9 +63,10 @@ register_parasite_procs (Gimp *gimp)
} }
static Argument * static Argument *
parasite_find_invoker (Gimp *gimp, parasite_find_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -125,9 +126,10 @@ static ProcRecord parasite_find_proc =
}; };
static Argument * static Argument *
parasite_attach_invoker (Gimp *gimp, parasite_attach_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpParasite *parasite; GimpParasite *parasite;
@ -168,9 +170,10 @@ static ProcRecord parasite_attach_proc =
}; };
static Argument * static Argument *
parasite_detach_invoker (Gimp *gimp, parasite_detach_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
@ -211,9 +214,10 @@ static ProcRecord parasite_detach_proc =
}; };
static Argument * static Argument *
parasite_list_invoker (Gimp *gimp, parasite_list_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
Argument *return_args; Argument *return_args;
gint32 num_parasites; gint32 num_parasites;
@ -260,9 +264,10 @@ static ProcRecord parasite_list_proc =
}; };
static Argument * static Argument *
drawable_parasite_find_invoker (Gimp *gimp, drawable_parasite_find_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -332,9 +337,10 @@ static ProcRecord drawable_parasite_find_proc =
}; };
static Argument * static Argument *
drawable_parasite_attach_invoker (Gimp *gimp, drawable_parasite_attach_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -385,9 +391,10 @@ static ProcRecord drawable_parasite_attach_proc =
}; };
static Argument * static Argument *
drawable_parasite_detach_invoker (Gimp *gimp, drawable_parasite_detach_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
@ -438,9 +445,10 @@ static ProcRecord drawable_parasite_detach_proc =
}; };
static Argument * static Argument *
drawable_parasite_list_invoker (Gimp *gimp, drawable_parasite_list_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -506,9 +514,10 @@ static ProcRecord drawable_parasite_list_proc =
}; };
static Argument * static Argument *
image_parasite_find_invoker (Gimp *gimp, image_parasite_find_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -578,9 +587,10 @@ static ProcRecord image_parasite_find_proc =
}; };
static Argument * static Argument *
image_parasite_attach_invoker (Gimp *gimp, image_parasite_attach_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -631,9 +641,10 @@ static ProcRecord image_parasite_attach_proc =
}; };
static Argument * static Argument *
image_parasite_detach_invoker (Gimp *gimp, image_parasite_detach_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -684,9 +695,10 @@ static ProcRecord image_parasite_detach_proc =
}; };
static Argument * static Argument *
image_parasite_list_invoker (Gimp *gimp, image_parasite_list_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;

View File

@ -77,9 +77,10 @@ register_paths_procs (Gimp *gimp)
} }
static Argument * static Argument *
path_list_invoker (Gimp *gimp, path_list_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -145,9 +146,10 @@ static ProcRecord path_list_proc =
}; };
static Argument * static Argument *
path_get_current_invoker (Gimp *gimp, path_get_current_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -212,9 +214,10 @@ static ProcRecord path_get_current_proc =
}; };
static Argument * static Argument *
path_set_current_invoker (Gimp *gimp, path_set_current_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -273,9 +276,10 @@ static ProcRecord path_set_current_proc =
}; };
static Argument * static Argument *
path_delete_invoker (Gimp *gimp, path_delete_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -334,9 +338,10 @@ static ProcRecord path_delete_proc =
}; };
static Argument * static Argument *
path_get_points_invoker (Gimp *gimp, path_get_points_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -465,9 +470,10 @@ static ProcRecord path_get_points_proc =
}; };
static Argument * static Argument *
path_set_points_invoker (Gimp *gimp, path_set_points_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -582,9 +588,10 @@ static ProcRecord path_set_points_proc =
}; };
static Argument * static Argument *
path_stroke_current_invoker (Gimp *gimp, path_stroke_current_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -641,9 +648,10 @@ static ProcRecord path_stroke_current_proc =
}; };
static Argument * static Argument *
path_get_point_at_dist_invoker (Gimp *gimp, path_get_point_at_dist_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -773,9 +781,10 @@ static ProcRecord path_get_point_at_dist_proc =
}; };
static Argument * static Argument *
path_get_tattoo_invoker (Gimp *gimp, path_get_tattoo_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -850,9 +859,10 @@ static ProcRecord path_get_tattoo_proc =
}; };
static Argument * static Argument *
path_set_tattoo_invoker (Gimp *gimp, path_set_tattoo_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -919,9 +929,10 @@ static ProcRecord path_set_tattoo_proc =
}; };
static Argument * static Argument *
get_path_by_tattoo_invoker (Gimp *gimp, get_path_by_tattoo_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -994,9 +1005,10 @@ static ProcRecord get_path_by_tattoo_proc =
}; };
static Argument * static Argument *
path_get_locked_invoker (Gimp *gimp, path_get_locked_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1071,9 +1083,10 @@ static ProcRecord path_get_locked_proc =
}; };
static Argument * static Argument *
path_set_locked_invoker (Gimp *gimp, path_set_locked_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -1140,9 +1153,10 @@ static ProcRecord path_set_locked_proc =
}; };
static Argument * static Argument *
path_to_selection_invoker (Gimp *gimp, path_to_selection_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;
@ -1250,9 +1264,10 @@ static ProcRecord path_to_selection_proc =
}; };
static Argument * static Argument *
path_import_invoker (Gimp *gimp, path_import_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *gimage;

View File

@ -42,9 +42,10 @@ register_pattern_select_procs (Gimp *gimp)
} }
static Argument * static Argument *
patterns_popup_invoker (Gimp *gimp, patterns_popup_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *pattern_callback; gchar *pattern_callback;
@ -112,9 +113,10 @@ static ProcRecord patterns_popup_proc =
}; };
static Argument * static Argument *
patterns_close_popup_invoker (Gimp *gimp, patterns_close_popup_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *pattern_callback; gchar *pattern_callback;
@ -161,9 +163,10 @@ static ProcRecord patterns_close_popup_proc =
}; };
static Argument * static Argument *
patterns_set_popup_invoker (Gimp *gimp, patterns_set_popup_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *pattern_callback; gchar *pattern_callback;

View File

@ -52,9 +52,10 @@ register_patterns_procs (Gimp *gimp)
} }
static Argument * static Argument *
patterns_refresh_invoker (Gimp *gimp, patterns_refresh_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gimp_data_factory_data_save (gimp->pattern_factory); gimp_data_factory_data_save (gimp->pattern_factory);
gimp_data_factory_data_init (gimp->pattern_factory, FALSE); gimp_data_factory_data_init (gimp->pattern_factory, FALSE);
@ -78,9 +79,10 @@ static ProcRecord patterns_refresh_proc =
}; };
static Argument * static Argument *
patterns_get_list_invoker (Gimp *gimp, patterns_get_list_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -146,9 +148,10 @@ static ProcRecord patterns_get_list_proc =
}; };
static Argument * static Argument *
patterns_get_pattern_invoker (Gimp *gimp, patterns_get_pattern_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -204,9 +207,10 @@ static ProcRecord patterns_get_pattern_proc =
}; };
static Argument * static Argument *
patterns_set_pattern_invoker (Gimp *gimp, patterns_set_pattern_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *name; gchar *name;
@ -256,9 +260,10 @@ static ProcRecord patterns_set_pattern_proc =
}; };
static Argument * static Argument *
patterns_get_pattern_data_invoker (Gimp *gimp, patterns_get_pattern_data_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;

View File

@ -73,9 +73,10 @@ match_strings (regex_t *preg,
} }
static Argument * static Argument *
progress_init_invoker (Gimp *gimp, progress_init_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *message; gchar *message;
@ -132,9 +133,10 @@ static ProcRecord progress_init_proc =
}; };
static Argument * static Argument *
progress_update_invoker (Gimp *gimp, progress_update_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gdouble percentage; gdouble percentage;
@ -178,9 +180,10 @@ static ProcRecord progress_update_proc =
}; };
static Argument * static Argument *
plugins_query_invoker (Gimp *gimp, plugins_query_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
Argument *return_args; Argument *return_args;
gchar *search_str; gchar *search_str;
@ -393,9 +396,10 @@ static ProcRecord plugins_query_proc =
}; };
static Argument * static Argument *
plugin_domain_register_invoker (Gimp *gimp, plugin_domain_register_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *domain_name; gchar *domain_name;
@ -454,9 +458,10 @@ static ProcRecord plugin_domain_register_proc =
}; };
static Argument * static Argument *
plugin_help_register_invoker (Gimp *gimp, plugin_help_register_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *domain_name; gchar *domain_name;
@ -517,9 +522,10 @@ static ProcRecord plugin_help_register_proc =
}; };
static Argument * static Argument *
plugin_menu_register_invoker (Gimp *gimp, plugin_menu_register_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *procedure_name; gchar *procedure_name;
@ -633,9 +639,10 @@ static ProcRecord plugin_menu_register_proc =
}; };
static Argument * static Argument *
plugin_icon_register_invoker (Gimp *gimp, plugin_icon_register_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *procedure_name; gchar *procedure_name;

View File

@ -30,6 +30,7 @@
#include "core/gimp.h" #include "core/gimp.h"
#include "core/gimpcontext.h" #include "core/gimpcontext.h"
#include "core/gimpprogress.h"
#include "plug-in/plug-in-run.h" #include "plug-in/plug-in-run.h"
@ -214,16 +215,18 @@ procedural_db_lookup (Gimp *gimp,
} }
Argument * Argument *
procedural_db_execute (Gimp *gimp, procedural_db_execute (Gimp *gimp,
GimpContext *context, GimpContext *context,
const gchar *name, GimpProgress *progress,
Argument *args) const gchar *name,
Argument *args)
{ {
Argument *return_args = NULL; Argument *return_args = NULL;
GList *list; GList *list;
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (name != NULL, NULL);
list = g_hash_table_lookup (gimp->procedural_ht, name); list = g_hash_table_lookup (gimp->procedural_ht, name);
@ -288,13 +291,14 @@ procedural_db_execute (Gimp *gimp,
case GIMP_INTERNAL: case GIMP_INTERNAL:
return_args = return_args =
(* procedure->exec_method.internal.marshal_func) (gimp, context, (* procedure->exec_method.internal.marshal_func) (gimp, context,
progress,
args); args);
break; break;
case GIMP_PLUGIN: case GIMP_PLUGIN:
case GIMP_EXTENSION: case GIMP_EXTENSION:
case GIMP_TEMPORARY: case GIMP_TEMPORARY:
return_args = plug_in_run (gimp, context, procedure, return_args = plug_in_run (gimp, context, progress, procedure,
args, procedure->num_args, args, procedure->num_args,
TRUE, FALSE, -1); TRUE, FALSE, -1);
break; break;
@ -336,10 +340,11 @@ procedural_db_execute (Gimp *gimp,
} }
Argument * Argument *
procedural_db_run_proc (Gimp *gimp, procedural_db_run_proc (Gimp *gimp,
GimpContext *context, GimpContext *context,
const gchar *name, GimpProgress *progress,
gint *nreturn_vals, const gchar *name,
gint *nreturn_vals,
...) ...)
{ {
ProcRecord *proc; ProcRecord *proc;
@ -350,6 +355,7 @@ procedural_db_run_proc (Gimp *gimp,
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (nreturn_vals != NULL, NULL); g_return_val_if_fail (nreturn_vals != NULL, NULL);
@ -441,7 +447,7 @@ procedural_db_run_proc (Gimp *gimp,
*nreturn_vals = proc->num_values; *nreturn_vals = proc->num_values;
return_vals = procedural_db_execute (gimp, context, name, params); return_vals = procedural_db_execute (gimp, context, progress, name, params);
g_free (params); g_free (params);

View File

@ -35,9 +35,10 @@ struct _Argument
/* Argument marshalling procedures */ /* Argument marshalling procedures */
typedef Argument * (* ArgMarshal) (Gimp *gimp, typedef Argument * (* ArgMarshal) (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args); GimpProgress *progress,
Argument *args);
/* Execution types */ /* Execution types */
@ -136,10 +137,12 @@ ProcRecord * procedural_db_lookup (Gimp *gimp,
Argument * procedural_db_execute (Gimp *gimp, Argument * procedural_db_execute (Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
const gchar *name, const gchar *name,
Argument *args); Argument *args);
Argument * procedural_db_run_proc (Gimp *gimp, Argument * procedural_db_run_proc (Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress,
const gchar *name, const gchar *name,
gint *nreturn_vals, gint *nreturn_vals,
...); ...);

View File

@ -333,9 +333,10 @@ pdb_type_name (gint type)
} }
static Argument * static Argument *
procedural_db_temp_name_invoker (Gimp *gimp, procedural_db_temp_name_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
Argument *return_args; Argument *return_args;
gchar *temp_name; gchar *temp_name;
@ -375,9 +376,10 @@ static ProcRecord procedural_db_temp_name_proc =
}; };
static Argument * static Argument *
procedural_db_dump_invoker (Gimp *gimp, procedural_db_dump_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *filename; gchar *filename;
@ -428,9 +430,10 @@ static ProcRecord procedural_db_dump_proc =
}; };
static Argument * static Argument *
procedural_db_query_invoker (Gimp *gimp, procedural_db_query_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -584,9 +587,10 @@ static ProcRecord procedural_db_query_proc =
}; };
static Argument * static Argument *
procedural_db_proc_info_invoker (Gimp *gimp, procedural_db_proc_info_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -711,9 +715,10 @@ static ProcRecord procedural_db_proc_info_proc =
}; };
static Argument * static Argument *
procedural_db_proc_arg_invoker (Gimp *gimp, procedural_db_proc_arg_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -810,9 +815,10 @@ static ProcRecord procedural_db_proc_arg_proc =
}; };
static Argument * static Argument *
procedural_db_proc_val_invoker (Gimp *gimp, procedural_db_proc_val_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -909,9 +915,10 @@ static ProcRecord procedural_db_proc_val_proc =
}; };
static Argument * static Argument *
procedural_db_get_data_invoker (Gimp *gimp, procedural_db_get_data_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -984,9 +991,10 @@ static ProcRecord procedural_db_get_data_proc =
}; };
static Argument * static Argument *
procedural_db_get_data_size_invoker (Gimp *gimp, procedural_db_get_data_size_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
@ -1047,9 +1055,10 @@ static ProcRecord procedural_db_get_data_size_proc =
}; };
static Argument * static Argument *
procedural_db_set_data_invoker (Gimp *gimp, procedural_db_set_data_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
Argument *args) GimpProgress *progress,
Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gchar *identifier; gchar *identifier;

Some files were not shown because too many files have changed in this diff Show More