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
|
|
|
|
*
|
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
|
2018-07-12 05:27:07 +08:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
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
|
|
|
|
|
|
|
|
2016-01-02 02:37:10 +08:00
|
|
|
#include "core/gimpviewable.h"
|
2006-04-05 05:11:45 +08:00
|
|
|
|
|
|
|
|
2012-05-04 06:50:23 +08:00
|
|
|
typedef GimpValueArray * (* GimpMarshalFunc) (GimpProcedure *procedure,
|
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GimpValueArray *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
|
|
|
{
|
2016-01-02 02:37:10 +08:00
|
|
|
GimpViewable parent_instance;
|
2006-04-06 18:01:30 +08:00
|
|
|
|
|
|
|
GimpPDBProcType proc_type; /* Type of procedure */
|
|
|
|
|
2019-09-09 05:40:34 +08:00
|
|
|
gboolean static_help; /* Are the strings allocated? */
|
2006-04-06 18:01:30 +08:00
|
|
|
gchar *blurb; /* Short procedure description */
|
|
|
|
gchar *help; /* Detailed help instructions */
|
2019-09-09 04:24:41 +08:00
|
|
|
gchar *help_id; /* Help ID */
|
2019-09-09 05:40:34 +08:00
|
|
|
|
|
|
|
gboolean static_attribution;
|
2019-08-02 07:39:09 +08:00
|
|
|
gchar *authors; /* Authors field */
|
2006-04-06 18:01:30 +08:00
|
|
|
gchar *copyright; /* Copyright field */
|
|
|
|
gchar *date; /* Date field */
|
2019-09-09 05:40:34 +08:00
|
|
|
|
2006-04-06 18:01:30 +08:00
|
|
|
gchar *deprecated; /* Replacement if deprecated */
|
|
|
|
|
2019-09-09 06:05:13 +08:00
|
|
|
gchar *label; /* Cached label string */
|
|
|
|
|
2006-04-06 18:01:30 +08:00
|
|
|
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
|
|
|
|
{
|
2016-01-02 02:37:10 +08:00
|
|
|
GimpViewableClass parent_class;
|
2006-04-05 05:11:45 +08:00
|
|
|
|
2016-01-02 05:41:42 +08:00
|
|
|
const gchar * (* get_label) (GimpProcedure *procedure);
|
|
|
|
const gchar * (* get_menu_label) (GimpProcedure *procedure);
|
|
|
|
const gchar * (* get_blurb) (GimpProcedure *procedure);
|
2016-01-18 00:15:27 +08:00
|
|
|
const gchar * (* get_help_id) (GimpProcedure *procedure);
|
2016-01-02 06:24:53 +08:00
|
|
|
gboolean (* get_sensitive) (GimpProcedure *procedure,
|
2018-06-22 19:29:52 +08:00
|
|
|
GimpObject *object,
|
2021-04-24 00:49:29 +08:00
|
|
|
const gchar **reason);
|
2016-01-02 05:41:42 +08:00
|
|
|
|
|
|
|
GimpValueArray * (* execute) (GimpProcedure *procedure,
|
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
GimpValueArray *args,
|
|
|
|
GError **error);
|
|
|
|
void (* execute_async) (GimpProcedure *procedure,
|
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
GimpValueArray *args,
|
2019-09-04 20:27:18 +08:00
|
|
|
GimpDisplay *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
|
|
|
|
2012-05-04 06:50:23 +08:00
|
|
|
GType gimp_procedure_get_type (void) G_GNUC_CONST;
|
|
|
|
|
|
|
|
GimpProcedure * gimp_procedure_new (GimpMarshalFunc marshal_func);
|
|
|
|
|
2019-09-09 05:40:34 +08:00
|
|
|
void gimp_procedure_set_help (GimpProcedure *procedure,
|
2012-05-04 06:50:23 +08:00
|
|
|
const gchar *blurb,
|
|
|
|
const gchar *help,
|
2019-09-09 05:40:34 +08:00
|
|
|
const gchar *help_id);
|
|
|
|
void gimp_procedure_set_static_help (GimpProcedure *procedure,
|
|
|
|
const gchar *blurb,
|
|
|
|
const gchar *help,
|
|
|
|
const gchar *help_id);
|
|
|
|
void gimp_procedure_take_help (GimpProcedure *procedure,
|
|
|
|
gchar *blurb,
|
|
|
|
gchar *help,
|
|
|
|
gchar *help_id);
|
|
|
|
|
|
|
|
void gimp_procedure_set_attribution (GimpProcedure *procedure,
|
2019-08-02 07:39:09 +08:00
|
|
|
const gchar *authors,
|
2012-05-04 06:50:23 +08:00
|
|
|
const gchar *copyright,
|
2019-09-09 05:23:32 +08:00
|
|
|
const gchar *date);
|
2019-09-09 05:40:34 +08:00
|
|
|
void gimp_procedure_set_static_attribution
|
|
|
|
(GimpProcedure *procedure,
|
2019-08-02 07:39:09 +08:00
|
|
|
const gchar *authors,
|
2012-05-04 06:50:23 +08:00
|
|
|
const gchar *copyright,
|
2019-09-09 05:23:32 +08:00
|
|
|
const gchar *date);
|
2019-09-09 05:40:34 +08:00
|
|
|
void gimp_procedure_take_attribution (GimpProcedure *procedure,
|
2019-08-02 07:39:09 +08:00
|
|
|
gchar *authors,
|
2012-05-04 06:50:23 +08:00
|
|
|
gchar *copyright,
|
2019-09-09 05:23:32 +08:00
|
|
|
gchar *date);
|
|
|
|
|
|
|
|
void gimp_procedure_set_deprecated (GimpProcedure *procedure,
|
|
|
|
const gchar *deprecated);
|
2012-05-04 06:50:23 +08:00
|
|
|
|
2016-01-02 03:52:45 +08:00
|
|
|
const gchar * gimp_procedure_get_label (GimpProcedure *procedure);
|
2016-01-02 05:41:42 +08:00
|
|
|
const gchar * gimp_procedure_get_menu_label (GimpProcedure *procedure);
|
2016-01-02 03:52:45 +08:00
|
|
|
const gchar * gimp_procedure_get_blurb (GimpProcedure *procedure);
|
2019-09-04 07:38:31 +08:00
|
|
|
const gchar * gimp_procedure_get_help (GimpProcedure *procedure);
|
2016-01-18 00:15:27 +08:00
|
|
|
const gchar * gimp_procedure_get_help_id (GimpProcedure *procedure);
|
2016-01-02 06:24:53 +08:00
|
|
|
gboolean gimp_procedure_get_sensitive (GimpProcedure *procedure,
|
2018-06-22 19:29:52 +08:00
|
|
|
GimpObject *object,
|
2021-04-24 00:49:29 +08:00
|
|
|
const gchar **reason);
|
2016-01-02 03:52:45 +08:00
|
|
|
|
2012-05-04 06:50:23 +08:00
|
|
|
void gimp_procedure_add_argument (GimpProcedure *procedure,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
void gimp_procedure_add_return_value (GimpProcedure *procedure,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
|
|
|
|
GimpValueArray * gimp_procedure_get_arguments (GimpProcedure *procedure);
|
|
|
|
GimpValueArray * gimp_procedure_get_return_values (GimpProcedure *procedure,
|
|
|
|
gboolean success,
|
|
|
|
const GError *error);
|
|
|
|
|
|
|
|
GimpProcedure * gimp_procedure_create_override (GimpProcedure *procedure,
|
|
|
|
GimpMarshalFunc new_marshal_func);
|
|
|
|
|
|
|
|
GimpValueArray * gimp_procedure_execute (GimpProcedure *procedure,
|
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
GimpValueArray *args,
|
|
|
|
GError **error);
|
|
|
|
void gimp_procedure_execute_async (GimpProcedure *procedure,
|
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
GimpValueArray *args,
|
2019-09-04 20:27:18 +08:00
|
|
|
GimpDisplay *display,
|
2012-05-04 06:50:23 +08:00
|
|
|
GError **error);
|
|
|
|
|
|
|
|
gint gimp_procedure_name_compare (GimpProcedure *proc1,
|
|
|
|
GimpProcedure *proc2);
|
2011-05-05 06:08:37 +08:00
|
|
|
|
|
|
|
|
2006-03-31 17:15:08 +08:00
|
|
|
|
|
|
|
#endif /* __GIMP_PROCEDURE_H__ */
|