mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-22 04:22:29 +00:00
f1c3e79a4b
2006-04-29 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/gimppluginmanager.[ch]: new object which keeps all plug-in related stuff that was kept in the Gimp instance. Has "menu-branch-added" and "last-plug-in-changed" signals. * app/plug-in/plug-ins.[ch]: removed, all its functions are in GimpPlugInManager now. * app/core/gimpmarshal.list: new marshaller for the new object. * app/core/gimp.[ch]: removed all plug-in related stuff and keep a GimpPlugInManager around. * app/plug-in/plug-in-data.[ch] * app/plug-in/plug-in-file.[ch] * app/plug-in/plug-in-help-domain.[ch] * app/plug-in/plug-in-locale-domain.[ch] * app/plug-in/plug-in-menu-branch.[ch] * app/plug-in/plug-ins-query.[ch]: removed... * app/plug-in/gimppluginmanager-data.[ch] * app/plug-in/gimppluginmanager-file.[ch] * app/plug-in/gimppluginmanager-help-domain.[ch] * app/plug-in/gimppluginmanager-locale-domain.[ch] * app/plug-in/gimppluginmanager-menu-branch.[ch] * app/plug-in/gimppluginmanager-query.[ch]: ...and added as methods of GimpPlugInManager. * app/plug-in/plug-in-debug.[ch] * app/plug-in/plug-in-shm.[ch]: removed... * app/plug-in/gimpplugindebug.[ch] * app/plug-in/gimppluginshm.[ch]: ...and added as properly namespeced structs with constructors and destructors. * app/core/Makefile.am * app/core/gimpenvirontable.[ch] * app/core/gimpinterpreterdb.[ch]: removed... * app/plug-in/gimpenvirontable.[ch] * app/plug-in/gimpinterpreterdb.[ch]: ...and added here unchanged. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: remove gimp_menus_create_branch() and all related stuff. * app/actions/plug-in-actions.[ch]: connect to the plug-in-manager's "menu-path-added" signal and create menu branch actions accordingly. * app/plug-in/plug-in-context.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-run.[ch] * app/plug-in/plug-in.[ch] * app/app_procs.c * app/actions/file-commands.c * app/actions/plug-in-commands.c * app/core/gimpimage.c * app/dialogs/file-open-location-dialog.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/gui/gui.c * app/menus/plug-in-menus.c * app/pdb/gimppluginprocedure.c * app/pdb/gimptemporaryprocedure.c * app/widgets/gimpdnd-xds.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimphelp.c * app/widgets/gimpthumbbox.c * app/xcf/xcf.c * tools/pdbgen/pdb/context.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/message.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/pdb/procedural_db.pdb * tools/pdbgen/pdb/progress.pdb * tools/pdbgen/pdb/undo.pdb: follow above refactoring. * app/pdb/context_cmds.c * app/pdb/drawable_cmds.c * app/pdb/fileops_cmds.c * app/pdb/help_cmds.c * app/pdb/message_cmds.c * app/pdb/plug_in_cmds.c * app/pdb/procedural_db_cmds.c * app/pdb/progress_cmds.c * app/pdb/undo_cmds.c: regenerated.
143 lines
4.8 KiB
C
143 lines
4.8 KiB
C
/* The GIMP -- an image manipulation program
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
*
|
|
* gimptemporaryprocedure.c
|
|
*
|
|
* 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 <glib-object.h>
|
|
|
|
#include "pdb-types.h"
|
|
|
|
#include "core/gimp.h"
|
|
|
|
#include "plug-in/plug-in.h"
|
|
#define __YES_I_NEED_PLUG_IN_RUN__
|
|
#include "plug-in/plug-in-run.h"
|
|
|
|
#include "gimptemporaryprocedure.h"
|
|
|
|
#include "gimp-intl.h"
|
|
|
|
|
|
static void gimp_temporary_procedure_finalize (GObject *object);
|
|
|
|
static GValueArray * gimp_temporary_procedure_execute (GimpProcedure *procedure,
|
|
Gimp *gimp,
|
|
GimpContext *context,
|
|
GimpProgress *progress,
|
|
GValueArray *args);
|
|
static void gimp_temporary_procedure_execute_async (GimpProcedure *procedure,
|
|
Gimp *gimp,
|
|
GimpContext *context,
|
|
GimpProgress *progress,
|
|
GValueArray *args,
|
|
gint32 display_ID);
|
|
|
|
const gchar * gimp_temporary_procedure_get_progname (const GimpPlugInProcedure *procedure);
|
|
|
|
|
|
G_DEFINE_TYPE (GimpTemporaryProcedure, gimp_temporary_procedure,
|
|
GIMP_TYPE_PLUG_IN_PROCEDURE);
|
|
|
|
#define parent_class gimp_temporary_procedure_parent_class
|
|
|
|
|
|
static void
|
|
gimp_temporary_procedure_class_init (GimpTemporaryProcedureClass *klass)
|
|
{
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
GimpProcedureClass *proc_class = GIMP_PROCEDURE_CLASS (klass);
|
|
GimpPlugInProcedureClass *plug_class = GIMP_PLUG_IN_PROCEDURE_CLASS (klass);
|
|
|
|
object_class->finalize = gimp_temporary_procedure_finalize;
|
|
|
|
proc_class->execute = gimp_temporary_procedure_execute;
|
|
proc_class->execute_async = gimp_temporary_procedure_execute_async;
|
|
|
|
plug_class->get_progname = gimp_temporary_procedure_get_progname;
|
|
}
|
|
|
|
static void
|
|
gimp_temporary_procedure_init (GimpTemporaryProcedure *proc)
|
|
{
|
|
GIMP_PROCEDURE (proc)->proc_type = GIMP_TEMPORARY;
|
|
}
|
|
|
|
static void
|
|
gimp_temporary_procedure_finalize (GObject *object)
|
|
{
|
|
/* GimpTemporaryProcedure *proc = GIMP_TEMPORARY_PROCEDURE (object); */
|
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
|
}
|
|
|
|
static GValueArray *
|
|
gimp_temporary_procedure_execute (GimpProcedure *procedure,
|
|
Gimp *gimp,
|
|
GimpContext *context,
|
|
GimpProgress *progress,
|
|
GValueArray *args)
|
|
{
|
|
return plug_in_run_temp (gimp->plug_in_manager, context, progress,
|
|
GIMP_TEMPORARY_PROCEDURE (procedure),
|
|
args);
|
|
}
|
|
|
|
static void
|
|
gimp_temporary_procedure_execute_async (GimpProcedure *procedure,
|
|
Gimp *gimp,
|
|
GimpContext *context,
|
|
GimpProgress *progress,
|
|
GValueArray *args,
|
|
gint32 display_ID)
|
|
{
|
|
GValueArray *return_vals;
|
|
|
|
return_vals = plug_in_run_temp (gimp->plug_in_manager, context, progress,
|
|
GIMP_TEMPORARY_PROCEDURE (procedure),
|
|
args);
|
|
|
|
g_value_array_free (return_vals);
|
|
}
|
|
|
|
const gchar *
|
|
gimp_temporary_procedure_get_progname (const GimpPlugInProcedure *procedure)
|
|
{
|
|
return GIMP_TEMPORARY_PROCEDURE (procedure)->plug_in->prog;
|
|
}
|
|
|
|
|
|
/* public functions */
|
|
|
|
GimpProcedure *
|
|
gimp_temporary_procedure_new (PlugIn *plug_in)
|
|
{
|
|
GimpTemporaryProcedure *proc;
|
|
|
|
g_return_val_if_fail (plug_in != NULL, NULL);
|
|
|
|
proc = g_object_new (GIMP_TYPE_TEMPORARY_PROCEDURE, NULL);
|
|
|
|
proc->plug_in = plug_in;
|
|
|
|
GIMP_PLUG_IN_PROCEDURE (proc)->prog = g_strdup ("none");
|
|
|
|
return GIMP_PROCEDURE (proc);
|
|
}
|