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
|
|
|
|
*
|
2006-05-04 02:05:06 +08:00
|
|
|
* gimpplugin.h
|
2004-09-22 23:12:24 +08:00
|
|
|
*
|
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
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
#ifndef __GIMP_PLUG_IN_H__
|
|
|
|
#define __GIMP_PLUG_IN_H__
|
1997-11-25 06:05:25 +08:00
|
|
|
|
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-19 07:41:39 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
#include "core/gimpobject.h"
|
|
|
|
#include "gimppluginprocframe.h"
|
2004-09-22 20:27:18 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-12-19 08:13:16 +08:00
|
|
|
#define WRITE_BUFFER_SIZE 512
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
#define GIMP_TYPE_PLUG_IN (gimp_plug_in_get_type ())
|
|
|
|
#define GIMP_PLUG_IN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PLUG_IN, GimpPlugIn))
|
|
|
|
#define GIMP_PLUG_IN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PLUG_IN, GimpPlugInClass))
|
|
|
|
#define GIMP_IS_PLUG_IN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_PLUG_IN))
|
|
|
|
#define GIMP_IS_PLUG_IN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PLUG_IN))
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _GimpPlugInClass GimpPlugInClass;
|
|
|
|
|
|
|
|
struct _GimpPlugIn
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2006-05-04 02:05:06 +08:00
|
|
|
GimpObject parent_instance;
|
2002-03-21 01:46:13 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
GimpPlugInManager *manager;
|
2014-07-09 03:09:35 +08:00
|
|
|
GFile *file; /* Plug-in's full path name */
|
2003-02-03 21:21:31 +08:00
|
|
|
|
2006-05-04 19:58:10 +08:00
|
|
|
GimpPlugInCallMode call_mode; /* QUERY, INIT or RUN */
|
2006-05-04 02:05:06 +08:00
|
|
|
guint open : 1; /* Is the plug-in open? */
|
2007-07-31 00:24:14 +08:00
|
|
|
guint hup : 1; /* Did we receive a G_IO_HUP */
|
2012-04-25 03:45:35 +08:00
|
|
|
guint precision : 1; /* True drawable precision enabled */
|
2006-05-04 02:05:06 +08:00
|
|
|
GPid pid; /* Plug-in's process id */
|
2002-03-21 01:46:13 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
GIOChannel *my_read; /* App's read and write channels */
|
|
|
|
GIOChannel *my_write;
|
|
|
|
GIOChannel *his_read; /* Plug-in's read and write channels */
|
|
|
|
GIOChannel *his_write;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
guint input_id; /* Id of input proc */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
gchar write_buffer[WRITE_BUFFER_SIZE]; /* Buffer for writing */
|
|
|
|
gint write_buffer_index; /* Buffer index */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
GSList *temp_procedures; /* Temporary procedures */
|
2004-01-20 08:54:43 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
GMainLoop *ext_main_loop; /* for waiting for extension_ack */
|
2003-06-24 02:27:03 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
GimpPlugInProcFrame main_proc_frame;
|
2003-01-30 19:20:12 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
GList *temp_proc_frames;
|
|
|
|
|
2007-02-19 09:16:05 +08:00
|
|
|
GimpPlugInDef *plug_in_def; /* Valid during query() and init() */
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
struct _GimpPlugInClass
|
|
|
|
{
|
|
|
|
GimpObjectClass parent_class;
|
|
|
|
};
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2004-09-22 23:26:58 +08:00
|
|
|
|
2008-08-19 06:54:26 +08:00
|
|
|
GType gimp_plug_in_get_type (void) G_GNUC_CONST;
|
2004-09-22 23:26:58 +08:00
|
|
|
|
2008-08-19 06:54:26 +08:00
|
|
|
GimpPlugIn * gimp_plug_in_new (GimpPlugInManager *manager,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
GimpPlugInProcedure *procedure,
|
2014-07-09 03:09:35 +08:00
|
|
|
GFile *file);
|
2004-09-22 23:26:58 +08:00
|
|
|
|
2008-08-19 06:54:26 +08:00
|
|
|
gboolean gimp_plug_in_open (GimpPlugIn *plug_in,
|
|
|
|
GimpPlugInCallMode call_mode,
|
|
|
|
gboolean synchronous);
|
|
|
|
void gimp_plug_in_close (GimpPlugIn *plug_in,
|
|
|
|
gboolean kill_it);
|
2004-09-22 23:26:58 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
GimpPlugInProcFrame *
|
2008-08-19 06:54:26 +08:00
|
|
|
gimp_plug_in_get_proc_frame (GimpPlugIn *plug_in);
|
2004-09-22 23:26:58 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
GimpPlugInProcFrame *
|
2008-08-19 06:54:26 +08:00
|
|
|
gimp_plug_in_proc_frame_push (GimpPlugIn *plug_in,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
GimpTemporaryProcedure *procedure);
|
|
|
|
void gimp_plug_in_proc_frame_pop (GimpPlugIn *plug_in);
|
|
|
|
|
|
|
|
void gimp_plug_in_main_loop (GimpPlugIn *plug_in);
|
|
|
|
void gimp_plug_in_main_loop_quit (GimpPlugIn *plug_in);
|
|
|
|
|
|
|
|
const gchar * gimp_plug_in_get_undo_desc (GimpPlugIn *plug_in);
|
|
|
|
|
|
|
|
gboolean gimp_plug_in_menu_register (GimpPlugIn *plug_in,
|
|
|
|
const gchar *proc_name,
|
|
|
|
const gchar *menu_path);
|
|
|
|
|
|
|
|
void gimp_plug_in_add_temp_proc (GimpPlugIn *plug_in,
|
|
|
|
GimpTemporaryProcedure *procedure);
|
|
|
|
void gimp_plug_in_remove_temp_proc (GimpPlugIn *plug_in,
|
|
|
|
GimpTemporaryProcedure *procedure);
|
|
|
|
|
|
|
|
void gimp_plug_in_set_error_handler (GimpPlugIn *plug_in,
|
|
|
|
GimpPDBErrorHandler handler);
|
|
|
|
GimpPDBErrorHandler
|
|
|
|
gimp_plug_in_get_error_handler (GimpPlugIn *plug_in);
|
2006-01-12 03:41:25 +08:00
|
|
|
|
2012-04-25 03:45:35 +08:00
|
|
|
void gimp_plug_in_enable_precision (GimpPlugIn *plug_in);
|
|
|
|
gboolean gimp_plug_in_precision_enabled (GimpPlugIn *plug_in);
|
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
|
2006-05-04 02:05:06 +08:00
|
|
|
#endif /* __GIMP_PLUG_IN_H__ */
|