1 /*
2    SANE EPSON backend
3    Copyright (C) 2005 SEIKO EPSON Corporation
4 
5    This file is part of the `iscan' program.
6 
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11 
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16 
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21    As a special exception, the copyright holders give permission
22    to link the code of this program with the esmod library and
23    distribute linked combinations including the two.  You must obey
24    the GNU General Public License in all respects for all of the
25    code used other then esmod.
26 */
27 #ifndef GIMP_PLUGIN_H
28 #define GIMP_PLUGIN_H
29 
30 #ifdef HAVE_GIMP_2
31 /* Define these structures for using gimp-devel-2 */
32 
33 struct _GimpParamColor_1
34 {
35   guint8 red;
36   guint8 green;
37   guint8 blue;
38 };
39 typedef struct _GimpParamColor_1 GimpParamColor_1 ;
40 
41 union _GimpParamData_1
42 {
43   gint32            d_int32;
44   gint16            d_int16;
45   gint8             d_int8;
46   gdouble           d_float;
47   gchar            *d_string;
48   gint32           *d_int32array;
49   gint16           *d_int16array;
50   gint8            *d_int8array;
51   gdouble          *d_floatarray;
52   gchar           **d_stringarray;
53   GimpParamColor_1  d_color;
54   GimpParamRegion   d_region;
55   gint32            d_display;
56   gint32            d_image;
57   gint32            d_layer;
58   gint32            d_layer_mask;
59   gint32            d_channel;
60   gint32            d_drawable;
61   gint32            d_selection;
62   gint32            d_boundary;
63   gint32            d_path;
64   gint32            d_unit;
65   GimpParasite      d_parasite;
66   gint32            d_tattoo;
67   GimpPDBStatusType d_status;
68 };
69 typedef union _GimpParamData_1 GimpParamData_1 ;
70 
71 struct _GimpParam_1
72 {
73   GimpPDBArgType type;
74   GimpParamData_1  data;
75 };
76 typedef struct _GimpParam_1 GimpParam_1;
77 
78 typedef void (* GimpInitProc_1)  (void);
79 typedef void (* GimpQuitProc_1)  (void);
80 typedef void (* GimpQueryProc_1) (void);
81 typedef void (* GimpRunProc_1)   (gchar            *name,
82 				  gint              n_params,
83 				  GimpParam_1      *param,
84 				  gint             *n_return_vals,
85 				  GimpParam_1     **return_vals);
86 
87 struct _GimpPlugInInfo_1
88 {
89   /* called when the gimp application initially starts up */
90   GimpInitProc_1  init_proc;
91 
92   /* called when the gimp application exits */
93   GimpQuitProc_1  quit_proc;
94 
95   /* called by the gimp so that the plug-in can inform the
96    * gimp of what it does. (ie. installing a procedure database
97    * procedure).
98    */
99   GimpQueryProc_1 query_proc;
100 
101   /* called to run a procedure the plug-in installed in the
102    * procedure database.
103    */
104   GimpRunProc_1   run_proc;
105 };
106 typedef struct _GimpPlugInInfo_1 GimpPlugInInfo_1;
107 
108 #else
109 /* Define these structures for using gimp-devel-1 */
110 
111 struct _GimpRGB_2
112 {
113   gdouble r, g, b, a;
114 };
115 typedef struct _GimpRGB_2 GimpRGB_2;
116 
117 union _GimpParamData_2
118 {
119   gint32            d_int32;
120   gint16            d_int16;
121   gint8             d_int8;
122   gdouble           d_float;
123   gchar            *d_string;
124   gint32           *d_int32array;
125   gint16           *d_int16array;
126   gint8            *d_int8array;
127   gdouble          *d_floatarray;
128   gchar           **d_stringarray;
129   GimpRGB_2         d_color;
130   GimpParamRegion   d_region;
131   gint32            d_display;
132   gint32            d_image;
133   gint32            d_layer;
134   gint32            d_layer_mask;
135   gint32            d_channel;
136   gint32            d_drawable;
137   gint32            d_selection;
138   gint32            d_boundary;
139   gint32            d_path;
140   gint32            d_unit;
141   GimpParasite      d_parasite;
142   gint32            d_tattoo;
143   GimpPDBStatusType d_status;
144 };
145 typedef union _GimpParamData_2 GimpParamData_2 ;
146 
147 struct _GimpParam_2
148 {
149   GimpPDBArgType  type;
150   GimpParamData_2 data;
151 };
152 typedef struct _GimpParam_2 GimpParam_2;
153 
154 typedef void (* GimpInitProc_2)  (void);
155 typedef void (* GimpQuitProc_2)  (void);
156 typedef void (* GimpQueryProc_2) (void);
157 typedef void (* GimpRunProc_2)   (const gchar       *name,
158 				  gint               n_params,
159 				  const GimpParam_2 *param,
160 				  gint              *n_return_vals,
161 				  GimpParam_2      **return_vals);
162 
163 struct _GimpPlugInInfo_2
164 {
165   /* called when the gimp application initially starts up */
166   GimpInitProc_2  init_proc;
167 
168   /* called when the gimp application exits */
169   GimpQuitProc_2  quit_proc;
170 
171   /* called by the gimp so that the plug-in can inform the
172    * gimp of what it does. (ie. installing a procedure database
173    * procedure).
174    */
175   GimpQueryProc_2 query_proc;
176 
177   /* called to run a procedure the plug-in installed in the
178    * procedure database.
179    */
180   GimpRunProc_2   run_proc;
181 };
182 typedef struct _GimpPlugInInfo_2 GimpPlugInInfo_2;
183 
184 #endif // HAVE_GIMP_2
185 
186 #endif  /* GIMP_PLUGIN_H */
187