1
/* GIMP - The GNU Image Manipulation Program
2
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
#ifndef __GIMP_PLUG_IN_H__
22
#define __GIMP_PLUG_IN_H__
25
#include "core/gimpobject.h"
26
#include "gimppluginprocframe.h"
29
#define WRITE_BUFFER_SIZE 512
32
#define GIMP_TYPE_PLUG_IN (gimp_plug_in_get_type ())
33
#define GIMP_PLUG_IN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PLUG_IN, GimpPlugIn))
34
#define GIMP_PLUG_IN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PLUG_IN, GimpPlugInClass))
35
#define GIMP_IS_PLUG_IN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_PLUG_IN))
36
#define GIMP_IS_PLUG_IN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PLUG_IN))
39
typedef struct _GimpPlugInClass GimpPlugInClass;
43
GimpObject parent_instance;
45
GimpPlugInManager *manager;
46
gchar *prog; /* Plug-in's full path name */
48
GimpPlugInCallMode call_mode; /* QUERY, INIT or RUN */
49
guint open : 1; /* Is the plug-in open? */
50
GPid pid; /* Plug-in's process id */
52
GIOChannel *my_read; /* App's read and write channels */
54
GIOChannel *his_read; /* Plug-in's read and write channels */
55
GIOChannel *his_write;
57
guint input_id; /* Id of input proc */
59
gchar write_buffer[WRITE_BUFFER_SIZE]; /* Buffer for writing */
60
gint write_buffer_index; /* Buffer index */
62
GSList *temp_procedures; /* Temporary procedures */
64
GMainLoop *ext_main_loop; /* for waiting for extension_ack */
66
GimpPlugInProcFrame main_proc_frame;
68
GList *temp_proc_frames;
70
GimpPlugInDef *plug_in_def; /* Valid during query() and init() */
73
struct _GimpPlugInClass
75
GimpObjectClass parent_class;
79
GType gimp_plug_in_get_type (void) G_GNUC_CONST;
81
GimpPlugIn * gimp_plug_in_new (GimpPlugInManager *manager,
83
GimpProgress *progress,
84
GimpPlugInProcedure *procedure,
87
gboolean gimp_plug_in_open (GimpPlugIn *plug_in,
88
GimpPlugInCallMode call_mode,
89
gboolean synchronous);
90
void gimp_plug_in_close (GimpPlugIn *plug_in,
94
gimp_plug_in_get_proc_frame (GimpPlugIn *plug_in);
97
gimp_plug_in_proc_frame_push (GimpPlugIn *plug_in,
99
GimpProgress *progress,
100
GimpTemporaryProcedure *procedure);
101
void gimp_plug_in_proc_frame_pop (GimpPlugIn *plug_in);
103
void gimp_plug_in_main_loop (GimpPlugIn *plug_in);
104
void gimp_plug_in_main_loop_quit (GimpPlugIn *plug_in);
106
const gchar * gimp_plug_in_get_undo_desc (GimpPlugIn *plug_in);
108
gboolean gimp_plug_in_menu_register (GimpPlugIn *plug_in,
109
const gchar *proc_name,
110
const gchar *menu_path);
112
void gimp_plug_in_add_temp_proc (GimpPlugIn *plug_in,
113
GimpTemporaryProcedure *procedure);
114
void gimp_plug_in_remove_temp_proc (GimpPlugIn *plug_in,
115
GimpTemporaryProcedure *procedure);
118
#endif /* __GIMP_PLUG_IN_H__ */