1999-12-27 20:02:07 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
1998-01-25 18:26:47 +08:00
|
|
|
*
|
2000-05-31 21:24:14 +08:00
|
|
|
* gimp.h
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
1999-11-18 05:13:50 +08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1998-01-25 18:26:47 +08:00
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-18 06:28:01 +08:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
1999-12-27 20:02:07 +08:00
|
|
|
*
|
|
|
|
* This library 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
|
1999-12-26 15:54:39 +08:00
|
|
|
* Lesser General Public License for more details.
|
1998-01-25 18:26:47 +08:00
|
|
|
*
|
1999-11-18 05:13:50 +08:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2009-01-18 06:28:01 +08:00
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
1999-12-27 20:02:07 +08:00
|
|
|
*/
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#ifndef __GIMP_H__
|
|
|
|
#define __GIMP_H__
|
|
|
|
|
2004-07-27 02:14:48 +08:00
|
|
|
#include <glib-object.h>
|
2000-01-26 07:06:12 +08:00
|
|
|
|
2005-06-26 20:53:31 +08:00
|
|
|
#include <libgimpbase/gimpbase.h>
|
2001-01-24 02:49:44 +08:00
|
|
|
#include <libgimpcolor/gimpcolor.h>
|
2005-06-26 20:53:31 +08:00
|
|
|
#include <libgimpconfig/gimpconfig.h>
|
2001-01-24 07:56:18 +08:00
|
|
|
#include <libgimpmath/gimpmath.h>
|
2001-01-24 02:49:44 +08:00
|
|
|
|
2000-05-27 09:30:21 +08:00
|
|
|
#include <libgimp/gimpenums.h>
|
2000-05-31 14:15:06 +08:00
|
|
|
#include <libgimp/gimptypes.h>
|
|
|
|
|
2004-09-23 03:22:24 +08:00
|
|
|
#include <libgimp/gimpbrushes.h>
|
2003-07-01 23:06:06 +08:00
|
|
|
#include <libgimp/gimpbrushselect.h>
|
2000-06-02 01:34:56 +08:00
|
|
|
#include <libgimp/gimpchannel.h>
|
2000-05-31 21:24:14 +08:00
|
|
|
#include <libgimp/gimpdrawable.h>
|
2003-07-01 23:06:06 +08:00
|
|
|
#include <libgimp/gimpfontselect.h>
|
2005-06-26 20:53:31 +08:00
|
|
|
#include <libgimp/gimpgimprc.h>
|
2004-09-23 23:05:48 +08:00
|
|
|
#include <libgimp/gimpgradients.h>
|
2003-07-01 23:06:06 +08:00
|
|
|
#include <libgimp/gimpgradientselect.h>
|
2000-06-01 20:20:13 +08:00
|
|
|
#include <libgimp/gimpimage.h>
|
2000-06-01 22:59:22 +08:00
|
|
|
#include <libgimp/gimplayer.h>
|
2004-09-23 02:43:09 +08:00
|
|
|
#include <libgimp/gimppalette.h>
|
2004-09-23 23:05:48 +08:00
|
|
|
#include <libgimp/gimppalettes.h>
|
2004-07-27 23:15:58 +08:00
|
|
|
#include <libgimp/gimppaletteselect.h>
|
2004-09-23 23:05:48 +08:00
|
|
|
#include <libgimp/gimppatterns.h>
|
2003-07-01 23:06:06 +08:00
|
|
|
#include <libgimp/gimppatternselect.h>
|
2004-01-13 00:35:01 +08:00
|
|
|
#include <libgimp/gimppixelfetcher.h>
|
2000-05-31 14:15:06 +08:00
|
|
|
#include <libgimp/gimppixelrgn.h>
|
2004-05-19 06:54:41 +08:00
|
|
|
#include <libgimp/gimpplugin.h>
|
2000-06-02 01:34:56 +08:00
|
|
|
#include <libgimp/gimpproceduraldb.h>
|
2004-08-30 02:36:30 +08:00
|
|
|
#include <libgimp/gimpprogress.h>
|
2004-05-19 06:54:41 +08:00
|
|
|
#include <libgimp/gimpregioniterator.h>
|
2000-06-01 20:20:13 +08:00
|
|
|
#include <libgimp/gimpselection.h>
|
2000-05-31 14:15:06 +08:00
|
|
|
#include <libgimp/gimptile.h>
|
2000-05-27 09:30:21 +08:00
|
|
|
|
2000-05-31 21:24:14 +08:00
|
|
|
#include <libgimp/gimp_pdb.h>
|
2000-05-31 14:15:06 +08:00
|
|
|
|
1999-10-05 03:26:07 +08:00
|
|
|
#ifdef G_OS_WIN32
|
2006-11-28 19:57:05 +08:00
|
|
|
#include <stdlib.h> /* For __argc and __argv */
|
1999-03-07 20:56:03 +08:00
|
|
|
#endif
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2006-11-28 19:57:05 +08:00
|
|
|
|
2001-11-23 07:46:13 +08:00
|
|
|
G_BEGIN_DECLS
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2000-06-09 09:56:34 +08:00
|
|
|
#define gimp_get_data gimp_procedural_db_get_data
|
|
|
|
#define gimp_get_data_size gimp_procedural_db_get_data_size
|
|
|
|
#define gimp_set_data gimp_procedural_db_set_data
|
2000-06-01 05:16:11 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-05-31 14:15:06 +08:00
|
|
|
typedef void (* GimpInitProc) (void);
|
|
|
|
typedef void (* GimpQuitProc) (void);
|
|
|
|
typedef void (* GimpQueryProc) (void);
|
2003-07-02 02:11:18 +08:00
|
|
|
typedef void (* GimpRunProc) (const gchar *name,
|
2005-12-29 05:24:12 +08:00
|
|
|
gint n_params,
|
|
|
|
const GimpParam *param,
|
|
|
|
gint *n_return_vals,
|
|
|
|
GimpParam **return_vals);
|
2000-05-31 14:15:06 +08:00
|
|
|
|
|
|
|
|
|
|
|
struct _GimpPlugInInfo
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
/* called when the gimp application initially starts up */
|
2000-05-31 14:15:06 +08:00
|
|
|
GimpInitProc init_proc;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* called when the gimp application exits */
|
2000-05-31 14:15:06 +08:00
|
|
|
GimpQuitProc quit_proc;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2007-06-06 16:44:52 +08:00
|
|
|
/* called by gimp so that the plug-in can inform the
|
1997-11-25 06:05:25 +08:00
|
|
|
* gimp of what it does. (ie. installing a procedure database
|
|
|
|
* procedure).
|
|
|
|
*/
|
2000-05-31 14:15:06 +08:00
|
|
|
GimpQueryProc query_proc;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* called to run a procedure the plug-in installed in the
|
|
|
|
* procedure database.
|
|
|
|
*/
|
2000-05-31 14:15:06 +08:00
|
|
|
GimpRunProc run_proc;
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
2000-05-31 14:15:06 +08:00
|
|
|
struct _GimpParamDef
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-31 14:15:06 +08:00
|
|
|
GimpPDBArgType type;
|
|
|
|
gchar *name;
|
|
|
|
gchar *description;
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
2000-05-31 14:15:06 +08:00
|
|
|
struct _GimpParamRegion
|
1998-02-26 18:19:58 +08:00
|
|
|
{
|
|
|
|
gint32 x;
|
|
|
|
gint32 y;
|
|
|
|
gint32 width;
|
|
|
|
gint32 height;
|
|
|
|
};
|
|
|
|
|
2000-05-31 14:15:06 +08:00
|
|
|
union _GimpParamData
|
1998-02-13 02:16:21 +08:00
|
|
|
{
|
2000-05-31 14:15:06 +08:00
|
|
|
gint32 d_int32;
|
|
|
|
gint16 d_int16;
|
2006-06-26 07:30:15 +08:00
|
|
|
guint8 d_int8;
|
2000-05-31 14:15:06 +08:00
|
|
|
gdouble d_float;
|
|
|
|
gchar *d_string;
|
|
|
|
gint32 *d_int32array;
|
|
|
|
gint16 *d_int16array;
|
2006-06-26 07:30:15 +08:00
|
|
|
guint8 *d_int8array;
|
2000-05-31 14:15:06 +08:00
|
|
|
gdouble *d_floatarray;
|
|
|
|
gchar **d_stringarray;
|
2008-07-14 22:09:16 +08:00
|
|
|
GimpRGB *d_colorarray;
|
2001-01-25 09:20:05 +08:00
|
|
|
GimpRGB d_color;
|
2000-05-31 14:15:06 +08:00
|
|
|
GimpParamRegion d_region;
|
|
|
|
gint32 d_display;
|
|
|
|
gint32 d_image;
|
|
|
|
gint32 d_layer;
|
2000-06-01 05:16:11 +08:00
|
|
|
gint32 d_layer_mask;
|
2000-05-31 14:15:06 +08:00
|
|
|
gint32 d_channel;
|
|
|
|
gint32 d_drawable;
|
|
|
|
gint32 d_selection;
|
|
|
|
gint32 d_boundary;
|
2005-12-29 09:07:02 +08:00
|
|
|
gint32 d_path; /* deprecated */
|
2005-12-29 05:24:12 +08:00
|
|
|
gint32 d_vectors;
|
2000-06-01 20:20:13 +08:00
|
|
|
gint32 d_unit;
|
2000-05-31 14:15:06 +08:00
|
|
|
GimpParasite d_parasite;
|
2000-06-01 05:16:11 +08:00
|
|
|
gint32 d_tattoo;
|
2000-08-28 04:10:12 +08:00
|
|
|
GimpPDBStatusType d_status;
|
1998-02-13 02:16:21 +08:00
|
|
|
};
|
|
|
|
|
2000-05-31 14:15:06 +08:00
|
|
|
struct _GimpParam
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-31 14:15:06 +08:00
|
|
|
GimpPDBArgType type;
|
|
|
|
GimpParamData data;
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2000-07-19 05:49:50 +08:00
|
|
|
|
2002-12-18 01:30:34 +08:00
|
|
|
/**
|
|
|
|
* MAIN():
|
|
|
|
*
|
|
|
|
* A macro that expands to the appropriate main() function for the
|
|
|
|
* platform being compiled for.
|
|
|
|
*
|
|
|
|
* To use this macro, simply place a line that contains just the code
|
2003-12-05 23:55:15 +08:00
|
|
|
* MAIN() at the toplevel of your file. No semicolon should be used.
|
2002-12-18 01:30:34 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
1999-10-05 03:26:07 +08:00
|
|
|
#ifdef G_OS_WIN32
|
2000-07-19 05:49:50 +08:00
|
|
|
|
1999-07-03 10:27:32 +08:00
|
|
|
/* Define WinMain() because plug-ins are built as GUI applications. Also
|
1999-03-07 20:56:03 +08:00
|
|
|
* define a main() in case some plug-in still is built as a console
|
|
|
|
* application.
|
|
|
|
*/
|
1999-05-29 05:56:04 +08:00
|
|
|
# ifdef __GNUC__
|
2000-04-11 04:47:04 +08:00
|
|
|
# ifndef _stdcall
|
|
|
|
# define _stdcall __attribute__((stdcall))
|
|
|
|
# endif
|
1999-05-29 05:56:04 +08:00
|
|
|
# endif
|
|
|
|
|
2005-12-29 05:24:12 +08:00
|
|
|
# define MAIN() \
|
|
|
|
struct HINSTANCE__; \
|
2006-11-24 20:47:24 +08:00
|
|
|
\
|
|
|
|
int _stdcall \
|
|
|
|
WinMain (struct HINSTANCE__ *hInstance, \
|
|
|
|
struct HINSTANCE__ *hPrevInstance, \
|
|
|
|
char *lpszCmdLine, \
|
|
|
|
int nCmdShow); \
|
|
|
|
\
|
2005-12-29 05:24:12 +08:00
|
|
|
int _stdcall \
|
|
|
|
WinMain (struct HINSTANCE__ *hInstance, \
|
|
|
|
struct HINSTANCE__ *hPrevInstance, \
|
|
|
|
char *lpszCmdLine, \
|
|
|
|
int nCmdShow) \
|
|
|
|
{ \
|
|
|
|
return gimp_main (&PLUG_IN_INFO, __argc, __argv); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
int \
|
|
|
|
main (int argc, char *argv[]) \
|
|
|
|
{ \
|
2008-08-07 23:45:33 +08:00
|
|
|
/* Use __argc and __argv here, too, as they work \
|
|
|
|
* better with mingw-w64. \
|
|
|
|
*/ \
|
|
|
|
return gimp_main (&PLUG_IN_INFO, __argc, __argv); \
|
1999-03-07 20:56:03 +08:00
|
|
|
}
|
1999-04-24 17:36:39 +08:00
|
|
|
#else
|
2005-12-29 05:24:12 +08:00
|
|
|
# define MAIN() \
|
|
|
|
int \
|
|
|
|
main (int argc, char *argv[]) \
|
|
|
|
{ \
|
|
|
|
return gimp_main (&PLUG_IN_INFO, argc, argv); \
|
1999-04-24 17:36:39 +08:00
|
|
|
}
|
|
|
|
#endif
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
/* The main procedure that must be called with the PLUG_IN_INFO structure
|
2003-05-24 07:34:13 +08:00
|
|
|
* and the 'argc' and 'argv' that are passed to "main".
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2006-06-21 19:00:51 +08:00
|
|
|
gint gimp_main (const GimpPlugInInfo *info,
|
|
|
|
gint argc,
|
|
|
|
gchar *argv[]);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Forcefully causes the gimp library to exit and
|
|
|
|
* close down its connection to main gimp application.
|
|
|
|
*/
|
2006-06-21 19:00:51 +08:00
|
|
|
void gimp_quit (void) G_GNUC_NORETURN;
|
1999-05-17 04:22:33 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Install a procedure in the procedure database.
|
|
|
|
*/
|
2006-06-21 19:00:51 +08:00
|
|
|
void gimp_install_procedure (const gchar *name,
|
|
|
|
const gchar *blurb,
|
|
|
|
const gchar *help,
|
|
|
|
const gchar *author,
|
|
|
|
const gchar *copyright,
|
|
|
|
const gchar *date,
|
|
|
|
const gchar *menu_label,
|
|
|
|
const gchar *image_types,
|
|
|
|
GimpPDBProcType type,
|
|
|
|
gint n_params,
|
|
|
|
gint n_return_vals,
|
|
|
|
const GimpParamDef *params,
|
|
|
|
const GimpParamDef *return_vals);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Install a temporary procedure in the procedure database.
|
|
|
|
*/
|
2006-06-21 19:00:51 +08:00
|
|
|
void gimp_install_temp_proc (const gchar *name,
|
|
|
|
const gchar *blurb,
|
|
|
|
const gchar *help,
|
|
|
|
const gchar *author,
|
|
|
|
const gchar *copyright,
|
|
|
|
const gchar *date,
|
|
|
|
const gchar *menu_label,
|
|
|
|
const gchar *image_types,
|
|
|
|
GimpPDBProcType type,
|
|
|
|
gint n_params,
|
|
|
|
gint n_return_vals,
|
|
|
|
const GimpParamDef *params,
|
|
|
|
const GimpParamDef *return_vals,
|
|
|
|
GimpRunProc run_proc);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Uninstall a temporary procedure
|
|
|
|
*/
|
2006-06-21 19:00:51 +08:00
|
|
|
void gimp_uninstall_temp_proc (const gchar *name);
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
|
|
|
|
/* Notify the main GIMP application that the extension is ready to run
|
|
|
|
*/
|
2006-06-21 19:00:51 +08:00
|
|
|
void gimp_extension_ack (void);
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
|
|
|
|
/* Enable asynchronous processing of temp_procs
|
|
|
|
*/
|
2006-06-21 19:00:51 +08:00
|
|
|
void gimp_extension_enable (void);
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
|
|
|
|
/* Process one temp_proc and return
|
|
|
|
*/
|
2006-06-21 19:00:51 +08:00
|
|
|
void gimp_extension_process (guint timeout);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Run a procedure in the procedure database. The parameters are
|
|
|
|
* specified via the variable length argument list. The return
|
2000-05-31 14:15:06 +08:00
|
|
|
* values are returned in the 'GimpParam*' array.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2006-06-21 19:00:51 +08:00
|
|
|
GimpParam * gimp_run_procedure (const gchar *name,
|
|
|
|
gint *n_return_vals,
|
|
|
|
...);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Run a procedure in the procedure database. The parameters are
|
2000-05-31 14:15:06 +08:00
|
|
|
* specified as an array of GimpParam. The return
|
|
|
|
* values are returned in the 'GimpParam*' array.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2006-06-21 19:00:51 +08:00
|
|
|
GimpParam * gimp_run_procedure2 (const gchar *name,
|
|
|
|
gint *n_return_vals,
|
|
|
|
gint n_params,
|
|
|
|
const GimpParam *params);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Destroy the an array of parameters. This is useful for
|
|
|
|
* destroying the return values returned by a call to
|
|
|
|
* 'gimp_run_procedure'.
|
|
|
|
*/
|
2006-06-21 19:00:51 +08:00
|
|
|
void gimp_destroy_params (GimpParam *params,
|
|
|
|
gint n_params);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-05-31 14:15:06 +08:00
|
|
|
/* Destroy the an array of GimpParamDef's. This is useful for
|
1998-11-11 10:20:29 +08:00
|
|
|
* destroying the return values returned by a call to
|
2008-09-19 18:42:32 +08:00
|
|
|
* 'gimp_procedural_db_proc_info'.
|
1998-11-11 10:20:29 +08:00
|
|
|
*/
|
2006-06-21 19:00:51 +08:00
|
|
|
void gimp_destroy_paramdefs (GimpParamDef *paramdefs,
|
|
|
|
gint n_params);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2008-08-17 01:18:13 +08:00
|
|
|
/* Retrieve the error message for the last procedure call.
|
|
|
|
*/
|
|
|
|
const gchar * gimp_get_pdb_error (void);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
/* Return various constants given by the GIMP core at plug-in config time.
|
|
|
|
*/
|
2006-06-21 19:00:51 +08:00
|
|
|
guint gimp_tile_width (void) G_GNUC_CONST;
|
|
|
|
guint gimp_tile_height (void) G_GNUC_CONST;
|
|
|
|
gint gimp_shm_ID (void) G_GNUC_CONST;
|
2006-08-16 04:29:01 +08:00
|
|
|
guchar * gimp_shm_addr (void) G_GNUC_CONST;
|
2006-06-21 19:00:51 +08:00
|
|
|
gdouble gimp_gamma (void) G_GNUC_CONST;
|
|
|
|
gboolean gimp_install_cmap (void) G_GNUC_CONST;
|
|
|
|
gint gimp_min_colors (void) G_GNUC_CONST;
|
|
|
|
gboolean gimp_show_tool_tips (void) G_GNUC_CONST;
|
|
|
|
gboolean gimp_show_help_button (void) G_GNUC_CONST;
|
|
|
|
GimpCheckSize gimp_check_size (void) G_GNUC_CONST;
|
|
|
|
GimpCheckType gimp_check_type (void) G_GNUC_CONST;
|
|
|
|
gint32 gimp_default_display (void) G_GNUC_CONST;
|
|
|
|
const gchar * gimp_wm_class (void) G_GNUC_CONST;
|
|
|
|
const gchar * gimp_display_name (void) G_GNUC_CONST;
|
|
|
|
gint gimp_monitor_number (void) G_GNUC_CONST;
|
2008-03-28 00:30:29 +08:00
|
|
|
guint32 gimp_user_time (void) G_GNUC_CONST;
|
2006-06-21 19:00:51 +08:00
|
|
|
|
|
|
|
const gchar * gimp_get_progname (void) G_GNUC_CONST;
|
|
|
|
|
|
|
|
gboolean gimp_attach_new_parasite (const gchar *name,
|
|
|
|
gint flags,
|
|
|
|
gint size,
|
|
|
|
gconstpointer data);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
|
2001-11-23 07:46:13 +08:00
|
|
|
G_END_DECLS
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
#endif /* __GIMP_H__ */
|