2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
1997-11-25 06:05:25 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2006-05-04 02:05:06 +08:00
|
|
|
* gimpplugin-progress.c
|
2004-09-22 23:12:24 +08:00
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
1997-11-25 06:05:25 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
1997-11-25 06:05:25 +08:00
|
|
|
* (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
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-07-16 20:49:04 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "config.h"
|
1999-03-07 20:56:03 +08:00
|
|
|
|
2013-10-15 07:58:39 +08:00
|
|
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
#include "plug-in-types.h"
|
2001-12-28 01:58:30 +08:00
|
|
|
|
2003-09-11 06:06:45 +08:00
|
|
|
#include "core/gimp.h"
|
2006-04-04 04:54:55 +08:00
|
|
|
#include "core/gimpparamspecs.h"
|
2004-08-30 02:36:30 +08:00
|
|
|
#include "core/gimppdbprogress.h"
|
2004-08-11 02:47:21 +08:00
|
|
|
#include "core/gimpprogress.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2006-04-26 17:13:47 +08:00
|
|
|
#include "pdb/gimppdb.h"
|
2008-08-16 21:57:57 +08:00
|
|
|
#include "pdb/gimppdberror.h"
|
2003-02-03 21:21:31 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
#include "gimpplugin.h"
|
|
|
|
#include "gimpplugin-progress.h"
|
2006-04-29 06:26:51 +08:00
|
|
|
#include "gimppluginmanager.h"
|
2006-08-06 05:21:01 +08:00
|
|
|
#include "gimptemporaryprocedure.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2008-08-16 21:57:57 +08:00
|
|
|
#include "gimp-intl.h"
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
/* local function prototypes */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
static void gimp_plug_in_progress_cancel_callback (GimpProgress *progress,
|
|
|
|
GimpPlugIn *plug_in);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
/* public functions */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2006-11-02 23:26:03 +08:00
|
|
|
gint
|
|
|
|
gimp_plug_in_progress_attach (GimpProgress *progress)
|
|
|
|
{
|
|
|
|
gint attach_count;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_PROGRESS (progress), 0);
|
|
|
|
|
|
|
|
attach_count =
|
|
|
|
GPOINTER_TO_INT (g_object_get_data (G_OBJECT (progress),
|
|
|
|
"plug-in-progress-attach-count"));
|
|
|
|
|
|
|
|
attach_count++;
|
|
|
|
|
|
|
|
g_object_set_data (G_OBJECT (progress), "plug-in-progress-attach-count",
|
2012-08-14 21:36:23 +08:00
|
|
|
GINT_TO_POINTER (attach_count));
|
2006-11-02 23:26:03 +08:00
|
|
|
|
|
|
|
return attach_count;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
gimp_plug_in_progress_detach (GimpProgress *progress)
|
|
|
|
{
|
|
|
|
gint attach_count;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_PROGRESS (progress), 0);
|
|
|
|
|
|
|
|
attach_count =
|
|
|
|
GPOINTER_TO_INT (g_object_get_data (G_OBJECT (progress),
|
|
|
|
"plug-in-progress-attach-count"));
|
|
|
|
|
|
|
|
attach_count--;
|
|
|
|
|
|
|
|
g_object_set_data (G_OBJECT (progress), "plug-in-progress-attach-count",
|
2012-08-14 21:36:23 +08:00
|
|
|
GINT_TO_POINTER (attach_count));
|
2006-11-02 23:26:03 +08:00
|
|
|
|
|
|
|
return attach_count;
|
|
|
|
}
|
|
|
|
|
1999-05-04 03:22:58 +08:00
|
|
|
void
|
2006-05-04 02:05:06 +08:00
|
|
|
gimp_plug_in_progress_start (GimpPlugIn *plug_in,
|
|
|
|
const gchar *message,
|
|
|
|
GimpObject *display)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2006-05-04 02:05:06 +08:00
|
|
|
GimpPlugInProcFrame *proc_frame;
|
2004-09-22 20:27:18 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
g_return_if_fail (GIMP_IS_PLUG_IN (plug_in));
|
2006-03-24 05:56:13 +08:00
|
|
|
g_return_if_fail (display == NULL || GIMP_IS_OBJECT (display));
|
2003-01-20 20:17:32 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
proc_frame = gimp_plug_in_get_proc_frame (plug_in);
|
2004-09-22 20:27:18 +08:00
|
|
|
|
|
|
|
if (! proc_frame->progress)
|
2004-08-11 02:47:21 +08:00
|
|
|
{
|
2006-04-29 06:26:51 +08:00
|
|
|
proc_frame->progress = gimp_new_progress (plug_in->manager->gimp,
|
|
|
|
display);
|
2004-08-11 02:47:21 +08:00
|
|
|
|
2004-09-22 20:27:18 +08:00
|
|
|
if (proc_frame->progress)
|
2004-08-17 16:21:30 +08:00
|
|
|
{
|
2004-09-22 20:27:18 +08:00
|
|
|
proc_frame->progress_created = TRUE;
|
2004-08-17 16:21:30 +08:00
|
|
|
|
2004-09-22 20:27:18 +08:00
|
|
|
g_object_ref (proc_frame->progress);
|
2006-11-02 23:26:03 +08:00
|
|
|
|
|
|
|
gimp_plug_in_progress_attach (proc_frame->progress);
|
2004-08-17 16:21:30 +08:00
|
|
|
}
|
2004-08-11 02:47:21 +08:00
|
|
|
}
|
|
|
|
|
2004-09-22 20:27:18 +08:00
|
|
|
if (proc_frame->progress)
|
2004-08-11 02:47:21 +08:00
|
|
|
{
|
2004-09-22 20:27:18 +08:00
|
|
|
if (! proc_frame->progress_cancel_id)
|
|
|
|
proc_frame->progress_cancel_id =
|
|
|
|
g_signal_connect (proc_frame->progress, "cancel",
|
2006-05-04 02:05:06 +08:00
|
|
|
G_CALLBACK (gimp_plug_in_progress_cancel_callback),
|
2004-08-11 18:29:56 +08:00
|
|
|
plug_in);
|
|
|
|
|
2004-09-22 20:27:18 +08:00
|
|
|
if (gimp_progress_is_active (proc_frame->progress))
|
2004-08-11 02:47:21 +08:00
|
|
|
{
|
2005-02-13 08:11:24 +08:00
|
|
|
if (message)
|
2014-07-13 05:45:20 +08:00
|
|
|
gimp_progress_set_text (proc_frame->progress, "%s", message);
|
2005-02-13 02:00:16 +08:00
|
|
|
|
|
|
|
if (gimp_progress_get_value (proc_frame->progress) > 0.0)
|
|
|
|
gimp_progress_set_value (proc_frame->progress, 0.0);
|
2004-08-11 08:34:34 +08:00
|
|
|
}
|
2004-08-11 18:29:56 +08:00
|
|
|
else
|
2004-08-11 08:34:34 +08:00
|
|
|
{
|
2014-07-13 05:45:20 +08:00
|
|
|
gimp_progress_start (proc_frame->progress, TRUE,
|
|
|
|
"%s", message ? message : "");
|
2004-08-11 02:47:21 +08:00
|
|
|
}
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-05-04 03:22:58 +08:00
|
|
|
void
|
2007-03-16 07:39:32 +08:00
|
|
|
gimp_plug_in_progress_end (GimpPlugIn *plug_in,
|
|
|
|
GimpPlugInProcFrame *proc_frame)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2006-05-04 02:05:06 +08:00
|
|
|
g_return_if_fail (GIMP_IS_PLUG_IN (plug_in));
|
2007-03-16 07:39:32 +08:00
|
|
|
g_return_if_fail (proc_frame != NULL);
|
2004-09-22 20:27:18 +08:00
|
|
|
|
2005-09-10 02:07:31 +08:00
|
|
|
if (proc_frame->progress)
|
2004-08-11 18:29:56 +08:00
|
|
|
{
|
2005-09-10 02:07:31 +08:00
|
|
|
if (proc_frame->progress_cancel_id)
|
|
|
|
{
|
|
|
|
g_signal_handler_disconnect (proc_frame->progress,
|
|
|
|
proc_frame->progress_cancel_id);
|
|
|
|
proc_frame->progress_cancel_id = 0;
|
|
|
|
}
|
|
|
|
|
2006-11-02 23:26:03 +08:00
|
|
|
if (gimp_plug_in_progress_detach (proc_frame->progress) < 1 &&
|
|
|
|
gimp_progress_is_active (proc_frame->progress))
|
2008-10-22 14:00:06 +08:00
|
|
|
{
|
|
|
|
gimp_progress_end (proc_frame->progress);
|
|
|
|
}
|
2005-09-10 02:07:31 +08:00
|
|
|
|
|
|
|
if (proc_frame->progress_created)
|
|
|
|
{
|
2006-04-29 06:26:51 +08:00
|
|
|
gimp_free_progress (plug_in->manager->gimp, proc_frame->progress);
|
2005-09-10 02:07:31 +08:00
|
|
|
g_object_unref (proc_frame->progress);
|
|
|
|
proc_frame->progress = NULL;
|
|
|
|
}
|
2004-08-11 18:29:56 +08:00
|
|
|
}
|
2005-09-10 02:07:31 +08:00
|
|
|
}
|
2002-02-22 23:08:47 +08:00
|
|
|
|
2005-09-10 02:07:31 +08:00
|
|
|
void
|
2006-05-04 02:05:06 +08:00
|
|
|
gimp_plug_in_progress_set_text (GimpPlugIn *plug_in,
|
|
|
|
const gchar *message)
|
2005-09-10 02:07:31 +08:00
|
|
|
{
|
2006-05-04 02:05:06 +08:00
|
|
|
GimpPlugInProcFrame *proc_frame;
|
2005-09-10 02:07:31 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
g_return_if_fail (GIMP_IS_PLUG_IN (plug_in));
|
2005-09-10 02:07:31 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
proc_frame = gimp_plug_in_get_proc_frame (plug_in);
|
2005-09-10 02:07:31 +08:00
|
|
|
|
|
|
|
if (proc_frame->progress)
|
2014-07-13 05:45:20 +08:00
|
|
|
gimp_progress_set_text (proc_frame->progress, "%s", message);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2001-05-17 02:09:45 +08:00
|
|
|
|
2005-02-12 22:18:12 +08:00
|
|
|
void
|
2006-05-04 02:05:06 +08:00
|
|
|
gimp_plug_in_progress_set_value (GimpPlugIn *plug_in,
|
|
|
|
gdouble percentage)
|
2005-02-12 22:18:12 +08:00
|
|
|
{
|
2006-05-04 02:05:06 +08:00
|
|
|
GimpPlugInProcFrame *proc_frame;
|
2005-02-12 22:18:12 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
g_return_if_fail (GIMP_IS_PLUG_IN (plug_in));
|
2005-02-12 22:18:12 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
proc_frame = gimp_plug_in_get_proc_frame (plug_in);
|
2005-02-12 22:18:12 +08:00
|
|
|
|
|
|
|
if (! proc_frame->progress ||
|
|
|
|
! gimp_progress_is_active (proc_frame->progress) ||
|
|
|
|
! proc_frame->progress_cancel_id)
|
|
|
|
{
|
2006-05-04 02:05:06 +08:00
|
|
|
gimp_plug_in_progress_start (plug_in, NULL, NULL);
|
2005-02-12 22:18:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (proc_frame->progress && gimp_progress_is_active (proc_frame->progress))
|
2005-09-10 02:07:31 +08:00
|
|
|
gimp_progress_set_value (proc_frame->progress, percentage);
|
2005-02-12 22:18:12 +08:00
|
|
|
}
|
|
|
|
|
2005-02-13 02:25:58 +08:00
|
|
|
void
|
2006-05-04 02:05:06 +08:00
|
|
|
gimp_plug_in_progress_pulse (GimpPlugIn *plug_in)
|
2005-02-13 02:25:58 +08:00
|
|
|
{
|
2006-05-04 02:05:06 +08:00
|
|
|
GimpPlugInProcFrame *proc_frame;
|
2005-02-13 02:25:58 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
g_return_if_fail (GIMP_IS_PLUG_IN (plug_in));
|
2005-02-13 02:25:58 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
proc_frame = gimp_plug_in_get_proc_frame (plug_in);
|
2005-02-13 02:25:58 +08:00
|
|
|
|
2005-09-10 02:07:31 +08:00
|
|
|
if (! proc_frame->progress ||
|
|
|
|
! gimp_progress_is_active (proc_frame->progress) ||
|
|
|
|
! proc_frame->progress_cancel_id)
|
|
|
|
{
|
2006-05-04 02:05:06 +08:00
|
|
|
gimp_plug_in_progress_start (plug_in, NULL, NULL);
|
2005-09-10 02:07:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (proc_frame->progress && gimp_progress_is_active (proc_frame->progress))
|
|
|
|
gimp_progress_pulse (proc_frame->progress);
|
2005-02-13 02:25:58 +08:00
|
|
|
}
|
|
|
|
|
2005-09-10 02:07:31 +08:00
|
|
|
guint32
|
2011-02-06 19:07:55 +08:00
|
|
|
gimp_plug_in_progress_get_window_id (GimpPlugIn *plug_in)
|
2001-05-17 02:09:45 +08:00
|
|
|
{
|
2006-05-04 02:05:06 +08:00
|
|
|
GimpPlugInProcFrame *proc_frame;
|
2004-09-22 20:27:18 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_PLUG_IN (plug_in), 0);
|
2003-01-20 20:17:32 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
proc_frame = gimp_plug_in_get_proc_frame (plug_in);
|
2004-09-22 20:27:18 +08:00
|
|
|
|
|
|
|
if (proc_frame->progress)
|
2011-02-06 19:07:55 +08:00
|
|
|
return gimp_progress_get_window_id (proc_frame->progress);
|
2004-08-11 18:29:56 +08:00
|
|
|
|
2005-09-10 02:07:31 +08:00
|
|
|
return 0;
|
2002-03-21 01:46:13 +08:00
|
|
|
}
|
2001-05-17 02:09:45 +08:00
|
|
|
|
2004-08-31 05:03:52 +08:00
|
|
|
gboolean
|
2006-05-04 02:05:06 +08:00
|
|
|
gimp_plug_in_progress_install (GimpPlugIn *plug_in,
|
|
|
|
const gchar *progress_callback)
|
2004-08-30 02:36:30 +08:00
|
|
|
{
|
2006-05-04 02:05:06 +08:00
|
|
|
GimpPlugInProcFrame *proc_frame;
|
|
|
|
GimpProcedure *procedure;
|
2004-08-31 05:03:52 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_PLUG_IN (plug_in), FALSE);
|
2004-08-31 05:03:52 +08:00
|
|
|
g_return_val_if_fail (progress_callback != NULL, FALSE);
|
|
|
|
|
2006-04-29 06:26:51 +08:00
|
|
|
procedure = gimp_pdb_lookup_procedure (plug_in->manager->gimp->pdb,
|
2006-04-26 17:13:47 +08:00
|
|
|
progress_callback);
|
2004-08-31 05:03:52 +08:00
|
|
|
|
2006-04-06 18:01:30 +08:00
|
|
|
if (! GIMP_IS_TEMPORARY_PROCEDURE (procedure) ||
|
|
|
|
GIMP_TEMPORARY_PROCEDURE (procedure)->plug_in != plug_in ||
|
|
|
|
procedure->num_args != 3 ||
|
|
|
|
! GIMP_IS_PARAM_SPEC_INT32 (procedure->args[0]) ||
|
|
|
|
! G_IS_PARAM_SPEC_STRING (procedure->args[1]) ||
|
2006-04-04 18:30:58 +08:00
|
|
|
! G_IS_PARAM_SPEC_DOUBLE (procedure->args[2]))
|
2004-08-31 05:03:52 +08:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
2004-08-30 02:36:30 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
proc_frame = gimp_plug_in_get_proc_frame (plug_in);
|
2004-09-22 08:32:00 +08:00
|
|
|
|
2004-09-22 20:27:18 +08:00
|
|
|
if (proc_frame->progress)
|
2004-08-30 02:36:30 +08:00
|
|
|
{
|
2007-03-16 07:39:32 +08:00
|
|
|
gimp_plug_in_progress_end (plug_in, proc_frame);
|
2004-08-30 02:36:30 +08:00
|
|
|
|
2004-09-22 20:27:18 +08:00
|
|
|
if (proc_frame->progress)
|
2004-08-30 22:57:24 +08:00
|
|
|
{
|
2004-09-22 20:27:18 +08:00
|
|
|
g_object_unref (proc_frame->progress);
|
|
|
|
proc_frame->progress = NULL;
|
2004-08-30 22:57:24 +08:00
|
|
|
}
|
2004-08-30 02:36:30 +08:00
|
|
|
}
|
|
|
|
|
2004-09-22 20:27:18 +08:00
|
|
|
proc_frame->progress = g_object_new (GIMP_TYPE_PDB_PROGRESS,
|
2006-04-29 06:26:51 +08:00
|
|
|
"pdb", plug_in->manager->gimp->pdb,
|
2004-09-23 00:22:43 +08:00
|
|
|
"context", proc_frame->main_context,
|
2004-09-22 20:27:18 +08:00
|
|
|
"callback-name", progress_callback,
|
|
|
|
NULL);
|
2004-08-31 05:03:52 +08:00
|
|
|
|
2006-11-02 23:26:03 +08:00
|
|
|
gimp_plug_in_progress_attach (proc_frame->progress);
|
|
|
|
|
2004-08-31 05:03:52 +08:00
|
|
|
return TRUE;
|
2004-08-30 02:36:30 +08:00
|
|
|
}
|
|
|
|
|
2004-08-31 05:03:52 +08:00
|
|
|
gboolean
|
2006-05-04 02:05:06 +08:00
|
|
|
gimp_plug_in_progress_uninstall (GimpPlugIn *plug_in,
|
|
|
|
const gchar *progress_callback)
|
2004-08-30 02:36:30 +08:00
|
|
|
{
|
2006-05-04 02:05:06 +08:00
|
|
|
GimpPlugInProcFrame *proc_frame;
|
2004-09-22 20:27:18 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_PLUG_IN (plug_in), FALSE);
|
2004-08-31 05:03:52 +08:00
|
|
|
g_return_val_if_fail (progress_callback != NULL, FALSE);
|
2004-08-30 02:36:30 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
proc_frame = gimp_plug_in_get_proc_frame (plug_in);
|
2004-09-22 20:27:18 +08:00
|
|
|
|
|
|
|
if (GIMP_IS_PDB_PROGRESS (proc_frame->progress))
|
2004-08-30 02:36:30 +08:00
|
|
|
{
|
2007-03-16 07:39:32 +08:00
|
|
|
gimp_plug_in_progress_end (plug_in, proc_frame);
|
2004-09-22 20:27:18 +08:00
|
|
|
g_object_unref (proc_frame->progress);
|
|
|
|
proc_frame->progress = NULL;
|
2004-08-31 05:03:52 +08:00
|
|
|
|
|
|
|
return TRUE;
|
2004-08-30 02:36:30 +08:00
|
|
|
}
|
2004-08-31 05:03:52 +08:00
|
|
|
|
|
|
|
return FALSE;
|
2004-08-30 02:36:30 +08:00
|
|
|
}
|
|
|
|
|
2004-08-31 05:03:52 +08:00
|
|
|
gboolean
|
2006-05-04 02:05:06 +08:00
|
|
|
gimp_plug_in_progress_cancel (GimpPlugIn *plug_in,
|
|
|
|
const gchar *progress_callback)
|
2004-08-30 02:36:30 +08:00
|
|
|
{
|
2006-05-04 02:05:06 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_PLUG_IN (plug_in), FALSE);
|
2004-08-31 05:03:52 +08:00
|
|
|
g_return_val_if_fail (progress_callback != NULL, FALSE);
|
|
|
|
|
|
|
|
return FALSE;
|
2004-08-30 02:36:30 +08:00
|
|
|
}
|
|
|
|
|
2001-05-17 02:09:45 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
/* private functions */
|
|
|
|
|
2012-05-04 06:50:23 +08:00
|
|
|
static GimpValueArray *
|
2008-08-17 19:00:41 +08:00
|
|
|
get_cancel_return_values (GimpProcedure *procedure)
|
|
|
|
{
|
2012-05-04 06:50:23 +08:00
|
|
|
GimpValueArray *return_vals;
|
|
|
|
GError *error;
|
2008-08-17 19:00:41 +08:00
|
|
|
|
2012-03-06 02:36:59 +08:00
|
|
|
error = g_error_new_literal (GIMP_PDB_ERROR, GIMP_PDB_ERROR_CANCELLED,
|
2008-08-17 19:00:41 +08:00
|
|
|
_("Cancelled"));
|
|
|
|
return_vals = gimp_procedure_get_return_values (procedure, FALSE, error);
|
|
|
|
g_error_free (error);
|
|
|
|
|
|
|
|
return return_vals;
|
|
|
|
}
|
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
static void
|
2006-05-04 02:05:06 +08:00
|
|
|
gimp_plug_in_progress_cancel_callback (GimpProgress *progress,
|
|
|
|
GimpPlugIn *plug_in)
|
2002-03-21 01:46:13 +08:00
|
|
|
{
|
2006-05-04 02:05:06 +08:00
|
|
|
GimpPlugInProcFrame *proc_frame = &plug_in->main_proc_frame;
|
|
|
|
GList *list;
|
2004-09-22 07:56:40 +08:00
|
|
|
|
|
|
|
if (proc_frame->main_loop)
|
|
|
|
{
|
2008-08-16 21:57:57 +08:00
|
|
|
proc_frame->return_vals =
|
2008-08-17 19:00:41 +08:00
|
|
|
get_cancel_return_values (proc_frame->procedure);
|
2004-09-22 07:56:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
for (list = plug_in->temp_proc_frames; list; list = g_list_next (list))
|
2003-02-03 21:21:31 +08:00
|
|
|
{
|
2004-09-22 07:56:40 +08:00
|
|
|
proc_frame = list->data;
|
|
|
|
|
|
|
|
if (proc_frame->main_loop)
|
|
|
|
{
|
2008-08-16 21:57:57 +08:00
|
|
|
proc_frame->return_vals =
|
2008-08-17 19:00:41 +08:00
|
|
|
get_cancel_return_values (proc_frame->procedure);
|
2004-09-22 07:56:40 +08:00
|
|
|
}
|
2003-02-03 21:21:31 +08:00
|
|
|
}
|
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
gimp_plug_in_close (plug_in, TRUE);
|
2001-05-17 02:09:45 +08:00
|
|
|
}
|