3
Copyright (c) 2003-2004, AXE, Inc. All rights reserved.
5
Permission is hereby granted, free of charge, to any person obtaining
6
a copy of this software and associated documentation files (the
7
"Software"), to deal in the Software without restriction, including
8
without limitation the rights to use, copy, modify, merge, publish,
9
distribute, sublicense, and/or sell copies of the Software, and to
10
permit persons to whom the Software is furnished to do so, subject to
11
the following conditions:
13
The above copyright notice and this permission notice shall be included
14
in all copies or substantial portions of the Software.
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
/* $Id: opvp_0_2_0.h 85 2007-02-15 08:48:56Z sho-otani $ */
26
/* opvp_common.h ver.1.00 rel.1.0 26 Nov 2004 */
27
/* OpenPrinting Vector Printer Driver Glue Code */
29
#ifndef _FSGPD_0_2_0_H
30
#define _FSGPD_0_2_0_H
32
#define _PDAPI_VERSION_MAJOR_ 0
33
#define _PDAPI_VERSION_MINOR_ 2
36
#define OPVP_OK 0 /* error is -1 */
39
#define OPVP_FATALERROR -101 /* unrecoverable error occurred within the */
41
#define OPVP_BADREQUEST -102 /* invalid function parameters */
42
#define OPVP_BADCONTEXT -103 /* bad parameter precontext */
43
#define OPVP_NOTSUPPORTED -104 /* printer or driver request not supported */
44
#define OPVP_JOBCANCELED -105 /* job cancelled */
45
#define OPVP_PARAMERROR -106 /* illegal parameter combination */
48
#define OPVP_INFO_PREFIX "updf:"
51
#define OPVP_FIX_FRACT_WIDTH 8
52
#define OPVP_FIX_FRACT_DENOM (1<<OPVP_FIX_FRACT_WIDTH)
53
#define OPVP_FIX_FLOOR_WIDTH (sizeof(int)*8-OPVP_FIX_FRACT_WIDTH)
56
unsigned int fract : OPVP_FIX_FRACT_WIDTH;
57
signed int floor : OPVP_FIX_FLOOR_WIDTH;
59
#define OPVP_i2Fix(i,fix) (fix.fract=0,fix.floor=i)
60
#define OPVP_Fix2f(fix,f) (f=(double)fix.floor\
61
+(double)(fix.fract)/OPVP_FIX_FRACT_DENOM)
62
#define OPVP_f2Fix(f,fix) (fix.fract=(f-floor(f))*OPVP_FIX_FRACT_DENOM,\
66
#define OPVP_i2Fix(i,fix) (fix=(i)<<8)
67
#define OPVP_f2Fix(f,fix) (fix=((int)floor(f)<<8)\
68
|((int)(((f)-floor(f))*OPVP_FIX_FRACT_DENOM)\
73
typedef struct _OPVP_Point {
78
typedef struct _OPVP_Rectangle {
79
OPVP_Point p0; /* start point */
80
OPVP_Point p1; /* end point */
83
typedef struct _OPVP_RoundRectangle {
84
OPVP_Point p0; /* start point */
85
OPVP_Point p1; /* end point */
88
} OPVP_RoundRectangle;
91
typedef enum _OPVP_ImageFormat {
98
/* Color Presentation */
99
typedef enum _OPVP_ColorMapping {
104
typedef enum _OPVP_ColorSpace {
106
OPVP_cspaceDeviceGray = 1,
107
OPVP_cspaceDeviceCMY = 2,
108
OPVP_cspaceDeviceCMYK = 3,
109
OPVP_cspaceDeviceRGB = 4,
110
OPVP_cspaceStandardRGB = 5,
111
OPVP_cspaceStandardRGB64 = 6
114
/* Raster Operation modes */
115
typedef enum _OPVP_ROP {
123
/* Fill, Paint, Clip */
124
typedef enum _OPVP_FillMode {
125
OPVP_fillModeEvenOdd = 0,
126
OPVP_fillModeWinding = 1
129
typedef enum _OPVP_PaintMode {
130
OPVP_paintModeOpaque = 0,
131
OPVP_paintModeTransparent = 1
134
typedef enum _OPVP_ClipRule {
135
OPVP_clipRuleEvenOdd = 0,
136
OPVP_clipRuleWinding = 1
140
typedef enum _OPVP_LineStyle {
141
OPVP_lineStyleSolid = 0,
142
OPVP_lineStyleDash = 1
145
typedef enum _OPVP_LineCap {
146
OPVP_lineCapButt = 0,
147
OPVP_lineCapRound = 1,
148
OPVP_lineCapSquare = 2
151
typedef enum _OPVP_LineJoin {
152
OPVP_lineJoinMiter = 0,
153
OPVP_lineJoinRound = 1,
154
OPVP_lineJoinBevel = 2
158
typedef enum _OPVP_BrushDataType {
159
OPVP_bdtypeNormal = 0
160
} OPVP_BrushDataType;
162
typedef struct _OPVP_BrushData {
163
OPVP_BrushDataType type;
167
#if (_PDAPI_VERSION_MAJOR_ == 0 && _PDAPI_VERSION_MINOR_ < 2)
168
void *data; /* pointer to actual data */
174
typedef struct _OPVP_Brush {
175
OPVP_ColorSpace colorSpace;
176
int color[4]; /* aRGB quadruplet */
177
#if (_PDAPI_VERSION_MAJOR_ == 0 && _PDAPI_VERSION_MINOR_ < 2)
178
OPVP_BrushData *pbrush; /* pointer to brush data */
179
/* solid brush used, if null */
180
int xorg; /* brush origin */
181
int yorg; /* ignored for SetBgColor */
183
int xorg; /* brush origin */
184
int yorg; /* ignored for SetBgColor */
185
OPVP_BrushData *pbrush; /* pointer to brush data */
186
/* solid brush used, if null */
191
#define OPVP_Arc 0 /* circular arc */
192
#define OPVP_Chord 1 /* arch */
193
#define OPVP_Pie 2 /* pie section */
194
#define OPVP_Clockwise 0 /* clockwise */
195
#define OPVP_Counterclockwise 1 /* counter-clockwise */
196
#define OPVP_PathClose 0 /* Close path when using LinePath */
197
#define OPVP_PathOpen 1 /* Do not close path when using LinePath */
200
typedef struct _OPVP_CTM {
209
/* Vector Driver API Proc. Entries */
210
typedef struct _OPVP_api_procs {
211
int (*OpenPrinter)(int,char *,int *,struct _OPVP_api_procs **);
212
int (*ClosePrinter)(int);
213
int (*StartJob)(int,char *);
215
int (*StartDoc)(int,char *);
217
int (*StartPage)(int,char *);
219
#if (_PDAPI_VERSION_MAJOR_ > 0 || _PDAPI_VERSION_MINOR_ >= 2)
220
int (*QueryDeviceCapability)(int,int,int,char *);
221
int (*QueryDeviceInfo)(int,int,int,char *);
223
int (*ResetCTM)(int);
224
int (*SetCTM)(int,OPVP_CTM *);
225
int (*GetCTM)(int,OPVP_CTM *);
228
int (*RestoreGS)(int);
229
int (*QueryColorSpace)(int,OPVP_ColorSpace *,int *);
230
int (*SetColorSpace)(int,OPVP_ColorSpace);
231
int (*GetColorSpace)(int,OPVP_ColorSpace *);
232
int (*QueryROP)(int,int *,int *);
233
int (*SetROP)(int,int);
234
int (*GetROP)(int,int *);
235
int (*SetFillMode)(int,OPVP_FillMode);
236
int (*GetFillMode)(int,OPVP_FillMode *);
237
int (*SetAlphaConstant)(int,float);
238
int (*GetAlphaConstant)(int,float *);
239
int (*SetLineWidth)(int,OPVP_Fix);
240
int (*GetLineWidth)(int,OPVP_Fix *);
241
int (*SetLineDash)(int,OPVP_Fix *,int);
242
int (*GetLineDash)(int,OPVP_Fix *,int *);
243
int (*SetLineDashOffset)(int,OPVP_Fix);
244
int (*GetLineDashOffset)(int,OPVP_Fix *);
245
int (*SetLineStyle)(int,OPVP_LineStyle);
246
int (*GetLineStyle)(int,OPVP_LineStyle *);
247
int (*SetLineCap)(int,OPVP_LineCap);
248
int (*GetLineCap)(int,OPVP_LineCap *);
249
int (*SetLineJoin)(int,OPVP_LineJoin);
250
int (*GetLineJoin)(int,OPVP_LineJoin *);
251
int (*SetMiterLimit)(int,OPVP_Fix);
252
int (*GetMiterLimit)(int,OPVP_Fix *);
253
int (*SetPaintMode)(int,OPVP_PaintMode);
254
int (*GetPaintMode)(int,OPVP_PaintMode *);
255
int (*SetStrokeColor)(int,OPVP_Brush *);
256
int (*SetFillColor)(int,OPVP_Brush *);
257
int (*SetBgColor)(int,OPVP_Brush *);
260
int (*StrokePath)(int);
261
int (*FillPath)(int);
262
int (*StrokeFillPath)(int);
263
int (*SetClipPath)(int,OPVP_ClipRule);
264
#if (_PDAPI_VERSION_MAJOR_ > 0 || _PDAPI_VERSION_MINOR_ >= 2)
265
int (*ResetClipPath)(int);
267
int (*SetCurrentPoint)(int,OPVP_Fix,OPVP_Fix);
268
int (*LinePath)(int,int,int,OPVP_Point *);
269
int (*PolygonPath)(int,int,int *,OPVP_Point *);
270
int (*RectanglePath)(int,int,OPVP_Rectangle *);
271
int (*RoundRectanglePath)(int,int,OPVP_RoundRectangle *);
272
#if (_PDAPI_VERSION_MAJOR_ == 0 && _PDAPI_VERSION_MINOR_ < 2)
273
int (*BezierPath)(int,int *,OPVP_Point *);
275
int (*BezierPath)(int,int,OPVP_Point *);
277
int (*ArcPath)(int,int,int,OPVP_Fix,OPVP_Fix,OPVP_Fix,OPVP_Fix,
278
OPVP_Fix,OPVP_Fix,OPVP_Fix,OPVP_Fix);
279
int (*DrawBitmapText)(int,int,int,int,void *);
280
int (*DrawImage)(int,int,int,int,
281
OPVP_ImageFormat,OPVP_Rectangle,int,void *);
282
int (*StartDrawImage)(int,int,int,int,
283
OPVP_ImageFormat,OPVP_Rectangle);
284
int (*TransferDrawImage)(int,int,void *);
285
int (*EndDrawImage)(int);
286
int (*StartScanline)(int,int);
287
int (*Scanline)(int,int,int *);
288
int (*EndScanline)(int);
289
int (*StartRaster)(int,int);
290
int (*TransferRasterData)(int,int,unsigned char *);
291
int (*SkipRaster)(int,int);
292
int (*EndRaster)(int);
293
int (*StartStream)(int);
294
int (*TransferStreamData)(int,int,void *);
295
int (*EndStream)(int);
298
#endif /* _OPVP_COMMON_H_ */