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
|
|
|
|
*
|
|
|
|
* 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
|
1998-04-13 13:44:11 +08:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-12-29 23:22:01 +08:00
|
|
|
|
2006-03-31 17:15:08 +08:00
|
|
|
#ifndef __GIMP_PROCEDURE_H__
|
|
|
|
#define __GIMP_PROCEDURE_H__
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
|
2006-04-05 05:11:45 +08:00
|
|
|
#include "core/gimpobject.h"
|
|
|
|
|
|
|
|
|
2007-12-03 02:05:54 +08:00
|
|
|
typedef GValueArray * (* GimpMarshalFunc) (GimpProcedure *procedure,
|
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GValueArray *args,
|
|
|
|
GError **error);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
|
2006-04-05 05:11:45 +08:00
|
|
|
#define GIMP_TYPE_PROCEDURE (gimp_procedure_get_type ())
|
|
|
|
#define GIMP_PROCEDURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PROCEDURE, GimpProcedure))
|
|
|
|
#define GIMP_PROCEDURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PROCEDURE, GimpProcedureClass))
|
|
|
|
#define GIMP_IS_PROCEDURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_PROCEDURE))
|
|
|
|
#define GIMP_IS_PROCEDURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PROCEDURE))
|
|
|
|
#define GIMP_PROCEDURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_PROCEDURE, GimpProcedureClass))
|
|
|
|
|
2006-04-01 01:42:13 +08:00
|
|
|
|
2006-04-05 05:11:45 +08:00
|
|
|
typedef struct _GimpProcedureClass GimpProcedureClass;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2006-04-01 01:42:13 +08:00
|
|
|
struct _GimpProcedure
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2006-04-06 18:01:30 +08:00
|
|
|
GimpObject parent_instance;
|
|
|
|
|
|
|
|
GimpPDBProcType proc_type; /* Type of procedure */
|
|
|
|
|
|
|
|
gboolean static_strings; /* Are the strings allocated? */
|
|
|
|
|
|
|
|
gchar *original_name; /* Uncanonicalized procedure name */
|
|
|
|
gchar *blurb; /* Short procedure description */
|
|
|
|
gchar *help; /* Detailed help instructions */
|
|
|
|
gchar *author; /* Author field */
|
|
|
|
gchar *copyright; /* Copyright field */
|
|
|
|
gchar *date; /* Date field */
|
|
|
|
gchar *deprecated; /* Replacement if deprecated */
|
|
|
|
|
|
|
|
gint32 num_args; /* Number of procedure arguments */
|
|
|
|
GParamSpec **args; /* Array of procedure arguments */
|
|
|
|
|
|
|
|
gint32 num_values; /* Number of return values */
|
|
|
|
GParamSpec **values; /* Array of return values */
|
|
|
|
|
|
|
|
GimpMarshalFunc marshal_func; /* Marshaller for internal procs */
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
2006-04-05 05:11:45 +08:00
|
|
|
struct _GimpProcedureClass
|
|
|
|
{
|
|
|
|
GimpObjectClass parent_class;
|
|
|
|
|
2007-12-03 02:05:54 +08:00
|
|
|
GValueArray * (* execute) (GimpProcedure *procedure,
|
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
GValueArray *args,
|
|
|
|
GError **error);
|
|
|
|
void (* execute_async) (GimpProcedure *procedure,
|
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
GValueArray *args,
|
|
|
|
GimpObject *display);
|
2006-04-05 05:11:45 +08:00
|
|
|
};
|
|
|
|
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
|
2006-04-05 05:11:45 +08:00
|
|
|
GType gimp_procedure_get_type (void) G_GNUC_CONST;
|
2006-04-01 00:17:07 +08:00
|
|
|
|
2006-04-06 18:01:30 +08:00
|
|
|
GimpProcedure * gimp_procedure_new (GimpMarshalFunc marshal_func);
|
2006-04-01 00:17:07 +08:00
|
|
|
|
2006-04-01 01:42:13 +08:00
|
|
|
void gimp_procedure_set_strings (GimpProcedure *procedure,
|
2007-07-19 01:23:51 +08:00
|
|
|
const gchar *original_name,
|
|
|
|
const gchar *blurb,
|
|
|
|
const gchar *help,
|
|
|
|
const gchar *author,
|
|
|
|
const gchar *copyright,
|
|
|
|
const gchar *date,
|
|
|
|
const gchar *deprecated);
|
2006-04-04 23:54:51 +08:00
|
|
|
void gimp_procedure_set_static_strings (GimpProcedure *procedure,
|
2006-04-01 00:17:07 +08:00
|
|
|
gchar *original_name,
|
|
|
|
gchar *blurb,
|
|
|
|
gchar *help,
|
|
|
|
gchar *author,
|
|
|
|
gchar *copyright,
|
|
|
|
gchar *date,
|
|
|
|
gchar *deprecated);
|
2006-04-04 23:54:51 +08:00
|
|
|
void gimp_procedure_take_strings (GimpProcedure *procedure,
|
2006-04-01 00:17:07 +08:00
|
|
|
gchar *original_name,
|
|
|
|
gchar *blurb,
|
|
|
|
gchar *help,
|
|
|
|
gchar *author,
|
|
|
|
gchar *copyright,
|
|
|
|
gchar *date,
|
|
|
|
gchar *deprecated);
|
|
|
|
|
2006-04-01 01:42:13 +08:00
|
|
|
void gimp_procedure_add_argument (GimpProcedure *procedure,
|
2006-04-01 00:17:07 +08:00
|
|
|
GParamSpec *pspec);
|
2006-04-01 01:42:13 +08:00
|
|
|
void gimp_procedure_add_return_value (GimpProcedure *procedure,
|
2006-04-01 00:17:07 +08:00
|
|
|
GParamSpec *pspec);
|
|
|
|
|
2006-04-04 18:30:58 +08:00
|
|
|
GValueArray * gimp_procedure_get_arguments (GimpProcedure *procedure);
|
|
|
|
GValueArray * gimp_procedure_get_return_values (GimpProcedure *procedure,
|
2006-04-01 00:17:07 +08:00
|
|
|
gboolean success);
|
|
|
|
|
2006-04-04 18:30:58 +08:00
|
|
|
GValueArray * gimp_procedure_execute (GimpProcedure *procedure,
|
2006-04-01 00:17:07 +08:00
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
2007-12-03 02:05:54 +08:00
|
|
|
GValueArray *args,
|
|
|
|
GError **error);
|
2006-04-08 02:23:20 +08:00
|
|
|
void gimp_procedure_execute_async (GimpProcedure *procedure,
|
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
GValueArray *args,
|
2007-12-03 02:05:54 +08:00
|
|
|
GimpObject *display,
|
|
|
|
GError **error);
|
2006-03-31 17:15:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* __GIMP_PROCEDURE_H__ */
|