1997-11-24 22:05:25 +00:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2004-09-22 15:12:24 +00:00
|
|
|
* plug-in.h
|
|
|
|
*
|
1997-11-24 22:05:25 +00:00
|
|
|
* 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 05:44:11 +00:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-24 22:05:25 +00:00
|
|
|
*/
|
2000-12-16 21:37:03 +00:00
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
#ifndef __PLUG_IN_H__
|
|
|
|
#define __PLUG_IN_H__
|
|
|
|
|
Actually use the enum types GimpImageType, GimpImageBaseType,
* app/*.[ch]: Actually use the enum types GimpImageType,
GimpImageBaseType, LayerModeEffects, PaintApplicationMode,
BrushApplicationMode, GimpFillType and ConvertPaletteType, instead
of just int or gint. Hopefully I catched most of the places
where these should be used.
Add an enum ConvolutionType, suffix the too general constants
NORMAL, ABSOLUTE and NEGATIVE with _CONVOL. Use NORMAL_MODE
instead of NORMAL in some places (this was what was intended). Fix
some minor gccisms.
* app/apptypes.h: New file. This file contains the above
enumeration types, and some opaque struct typedefs. It was
necessary to collect these in one header that doesn't include
other headers, because when we started using the above mentioned
types in the headers, all hell broke loose because of the
spaghetti-like cross-inclusion mess between headers.
(An example: Header A includes header B, which includes header C
which includes A. B uses a type defined in A. This is not defined,
because A hasn't defined it yet at the point where it includes B,
and A included from B of course is skipped as we already are
reading A.)
1999-08-18 23:41:39 +00:00
|
|
|
|
2001-04-28 15:11:29 +00:00
|
|
|
#include <sys/types.h> /* pid_t */
|
|
|
|
|
2004-09-22 12:27:18 +00:00
|
|
|
#include "plug-in-proc-frame.h"
|
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2001-12-19 00:13:16 +00:00
|
|
|
#define WRITE_BUFFER_SIZE 512
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
struct _PlugIn
|
|
|
|
{
|
2002-03-20 17:46:13 +00:00
|
|
|
Gimp *gimp;
|
|
|
|
|
2003-02-03 13:21:31 +00:00
|
|
|
gint ref_count;
|
|
|
|
|
2003-01-20 12:17:32 +00:00
|
|
|
guint open : 1; /* Is the plug-in open? */
|
2002-03-20 17:46:13 +00:00
|
|
|
guint query : 1; /* Are we querying the plug-in? */
|
|
|
|
guint init : 1; /* Are we initialing the plug-in? */
|
|
|
|
guint synchronous : 1; /* Is the plug-in running synchronously? */
|
2004-03-08 18:29:56 +00:00
|
|
|
|
|
|
|
GPid pid; /* Plug-in's process id */
|
2003-02-11 01:21:21 +00:00
|
|
|
|
|
|
|
gchar *name; /* Plug-in's name */
|
|
|
|
gchar *prog; /* Plug-in's full path name */
|
2002-03-20 17:46:13 +00:00
|
|
|
|
|
|
|
GIOChannel *my_read; /* App's read and write channels */
|
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-21 17:41:02 +00:00
|
|
|
GIOChannel *my_write;
|
2002-03-20 17:46:13 +00:00
|
|
|
GIOChannel *his_read; /* Plug-in's read and write channels */
|
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-21 17:41:02 +00:00
|
|
|
GIOChannel *his_write;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2003-02-03 13:21:31 +00:00
|
|
|
guint input_id; /* Id of input proc */
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2002-03-20 17:46:13 +00:00
|
|
|
gchar write_buffer[WRITE_BUFFER_SIZE]; /* Buffer for writing */
|
|
|
|
gint write_buffer_index; /* Buffer index for writing */
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2002-03-20 17:46:13 +00:00
|
|
|
GSList *temp_proc_defs; /* Temporary procedures */
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2003-06-23 18:27:03 +00:00
|
|
|
GMainLoop *ext_main_loop; /* for waiting for extension_ack */
|
2004-01-20 00:54:43 +00:00
|
|
|
|
2004-09-21 23:56:40 +00:00
|
|
|
PlugInProcFrame main_proc_frame;
|
2003-06-23 18:27:03 +00:00
|
|
|
|
2004-09-21 23:56:40 +00:00
|
|
|
GList *temp_proc_frames;
|
2003-01-30 11:20:12 +00:00
|
|
|
|
2003-01-17 18:07:37 +00:00
|
|
|
PlugInDef *plug_in_def; /* Valid only during query() and init() */
|
1997-11-24 22:05:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2004-09-22 15:26:58 +00:00
|
|
|
void plug_in_init (Gimp *gimp);
|
|
|
|
void plug_in_exit (Gimp *gimp);
|
|
|
|
|
|
|
|
void plug_in_call_query (Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
PlugInDef *plug_in_def);
|
|
|
|
void plug_in_call_init (Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
PlugInDef *plug_in_def);
|
|
|
|
|
|
|
|
PlugIn * plug_in_new (Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
ProcRecord *proc_rec,
|
|
|
|
const gchar *prog);
|
|
|
|
|
|
|
|
void plug_in_ref (PlugIn *plug_in);
|
|
|
|
void plug_in_unref (PlugIn *plug_in);
|
|
|
|
|
|
|
|
gboolean plug_in_open (PlugIn *plug_in);
|
|
|
|
void plug_in_close (PlugIn *plug_in,
|
|
|
|
gboolean kill_it);
|
|
|
|
|
|
|
|
void plug_in_push (Gimp *gimp,
|
|
|
|
PlugIn *plug_in);
|
|
|
|
void plug_in_pop (Gimp *gimp);
|
|
|
|
|
|
|
|
PlugInProcFrame * plug_in_get_proc_frame (PlugIn *plug_in);
|
|
|
|
|
2004-12-14 22:42:00 +00:00
|
|
|
PlugInProcFrame * plug_in_proc_frame_push (PlugIn *plug_in,
|
2004-09-22 15:26:58 +00:00
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
ProcRecord *proc_rec);
|
|
|
|
void plug_in_proc_frame_pop (PlugIn *plug_in);
|
|
|
|
|
|
|
|
void plug_in_main_loop (PlugIn *plug_in);
|
|
|
|
void plug_in_main_loop_quit (PlugIn *plug_in);
|
|
|
|
|
|
|
|
gchar * plug_in_get_undo_desc (PlugIn *plug_in);
|
2003-02-18 14:08:14 +00:00
|
|
|
|
2000-12-29 15:22:01 +00:00
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
#endif /* __PLUG_IN_H__ */
|