1dfcba3c22e3db0df3c2c6f3424b7a2ac7332003
[platform/upstream/cups-filters.git] / filter / pdftoopvp / oprs / OPVPWrapper.h
1 /*
2   OPVPWrapper.h
3 */
4
5 #ifndef OPVPWRAPPER_H
6 #define OPVPWRAPPER_H
7
8 #include "opvp_common.h"
9
10 class OPVPWrapper {
11 public:
12     static OPVPWrapper *loadDriver(const char *driverName, int outputFD,
13       const char *printerModel);
14     static int unloadDriver(void *opvpHandleA);
15 private:
16     static char *allocString(char **destin, unsigned int size);
17     static char **genDynamicLibName(const char *name);
18 public:
19     OPVPWrapper() {};
20     OPVPWrapper(void *opvpHandleA, opvp_int_t *opvpErrorNoA,
21       opvp_api_procs_t *procsA, opvp_dc_t printerContextA);
22     virtual ~OPVPWrapper();
23
24     virtual opvp_int_t getErrorNo();
25
26     void getVersion(opvp_int_t versionA[2])
27     {
28         versionA[0] = version[0];
29         versionA[1] = version[1];
30     }
31
32     virtual opvp_result_t ClosePrinter();
33     virtual opvp_result_t StartJob(const opvp_char_t *jobInfo);
34     virtual opvp_result_t EndJob();
35     virtual opvp_result_t AbortJob();
36     virtual opvp_result_t StartDoc(const opvp_char_t *docInfo);
37     virtual opvp_result_t EndDoc();
38     virtual opvp_result_t StartPage(const opvp_char_t *pageInfo);
39     virtual opvp_result_t EndPage();
40     virtual opvp_result_t QueryDeviceCapability(opvp_flag_t queryflag,
41       opvp_int_t *buflen, opvp_byte_t *infoBuf);
42     virtual opvp_result_t QueryDeviceInfo(opvp_flag_t queryflag,
43       opvp_int_t *buflen, opvp_byte_t *infoBuf);
44     virtual opvp_result_t ResetCTM();
45     virtual opvp_result_t SetCTM(const opvp_ctm_t *pCTM);
46     virtual opvp_result_t GetCTM(opvp_ctm_t *pCTM);
47     virtual opvp_result_t InitGS();
48     virtual opvp_result_t SaveGS();
49     virtual opvp_result_t RestoreGS();
50     virtual opvp_result_t QueryColorSpace(opvp_int_t *pnum,
51       opvp_cspace_t *pcspace);
52     virtual opvp_result_t SetColorSpace(opvp_cspace_t cspace);
53     virtual opvp_result_t GetColorSpace(opvp_cspace_t *pcspace);
54     virtual opvp_result_t SetFillMode(opvp_fillmode_t fillmode);
55     virtual opvp_result_t GetFillMode(opvp_fillmode_t *pfillmode);
56     virtual opvp_result_t SetAlphaConstant(opvp_float_t alpha);
57     virtual opvp_result_t GetAlphaConstant(opvp_float_t *palpha);
58     virtual opvp_result_t SetLineWidth(opvp_fix_t width);
59     virtual opvp_result_t GetLineWidth(opvp_fix_t *pwidth);
60     virtual opvp_result_t SetLineDash(opvp_int_t num, const opvp_fix_t *pdash);
61     virtual opvp_result_t GetLineDash(opvp_int_t *pnum, opvp_fix_t *pdash);
62     virtual opvp_result_t SetLineDashOffset(opvp_fix_t offset);
63     virtual opvp_result_t GetLineDashOffset(opvp_fix_t *poffset);
64     virtual opvp_result_t SetLineStyle(opvp_linestyle_t linestyle);
65     virtual opvp_result_t GetLineStyle(opvp_linestyle_t *plinestyle);
66     virtual opvp_result_t SetLineCap(opvp_linecap_t linecap);
67     virtual opvp_result_t GetLineCap(opvp_linecap_t *plinecap);
68     virtual opvp_result_t SetLineJoin(opvp_linejoin_t linejoin);
69     virtual opvp_result_t GetLineJoin(opvp_linejoin_t *plinejoin);
70     virtual opvp_result_t SetMiterLimit(opvp_fix_t miterlimit);
71     virtual opvp_result_t GetMiterLimit(opvp_fix_t *pmiterlimit);
72     virtual opvp_result_t SetPaintMode(opvp_paintmode_t paintmode);
73     virtual opvp_result_t GetPaintMode(opvp_paintmode_t *ppaintmode);
74     virtual opvp_result_t SetStrokeColor(const opvp_brush_t *brush);
75     virtual opvp_result_t SetFillColor(const opvp_brush_t *brush);
76     virtual opvp_result_t SetBgColor(const opvp_brush_t *brush);
77     virtual opvp_result_t NewPath();
78     virtual opvp_result_t EndPath();
79     virtual opvp_result_t StrokePath();
80     virtual opvp_result_t FillPath();
81     virtual opvp_result_t StrokeFillPath();
82     virtual opvp_result_t SetClipPath(opvp_cliprule_t clipRule);
83     virtual opvp_result_t SetCurrentPoint(opvp_fix_t x, opvp_fix_t y);
84     virtual opvp_result_t LinePath(opvp_pathmode_t flag,
85       opvp_int_t npoints, const opvp_point_t *points);
86     virtual opvp_result_t PolygonPath(opvp_int_t npolygons,
87       const opvp_int_t *nvertexes, const opvp_point_t *points);
88     virtual opvp_result_t RectanglePath(opvp_int_t nrectangles,
89       const opvp_rectangle_t *reclangles);
90     virtual opvp_result_t RoundRectanglePath(opvp_int_t nrectangles,
91       const opvp_roundrectangle_t *reclangles);
92     virtual opvp_result_t BezierPath(opvp_int_t npoints,
93       const opvp_point_t *points);
94     virtual opvp_result_t ArcPath(opvp_arcmode_t kind,
95       opvp_arcdir_t dir, opvp_fix_t bbx0, opvp_fix_t bby0,
96       opvp_fix_t bbx1, opvp_fix_t bby1, opvp_fix_t x0,
97       opvp_fix_t y0, opvp_fix_t x1, opvp_fix_t y1);
98     virtual opvp_result_t DrawImage(opvp_int_t sourceWidth,
99       opvp_int_t sourceHeight, opvp_int_t sourcePitch,
100       opvp_imageformat_t imageFormat,
101       opvp_int_t destinationWidth, opvp_int_t destinationHeight,
102       const void *imageData);
103     virtual opvp_result_t StartDrawImage(opvp_int_t sourceWidth,
104       opvp_int_t sourceHeight, opvp_int_t sourcePitch,
105       opvp_imageformat_t imageFormat,
106       opvp_int_t destinationWidth, opvp_int_t destinationHeight);
107     virtual opvp_result_t TransferDrawImage(opvp_int_t count,
108       const void *imageData);
109     virtual opvp_result_t EndDrawImage();
110     virtual opvp_result_t StartScanline(opvp_int_t yposition);
111     virtual opvp_result_t Scanline(opvp_int_t nscanpairs,
112       const opvp_int_t *scanpairs);
113     virtual opvp_result_t EndScanline();
114     virtual opvp_result_t StartRaster(opvp_int_t rasterWidth);
115     virtual opvp_result_t TransferRasterData(opvp_int_t count,
116       const opvp_byte_t *data);
117     virtual opvp_result_t SkipRaster(opvp_int_t count);
118     virtual opvp_result_t EndRaster();
119     virtual opvp_result_t StartStream();
120     virtual opvp_result_t TransferStreamData(opvp_int_t count,
121       const void *data);
122     virtual opvp_result_t EndStream();
123     virtual opvp_result_t ResetClipPath();
124
125     bool supportClosePrinter;
126     bool supportStartJob;
127     bool supportEndJob;
128     bool supportAbortJob;
129     bool supportStartDoc;
130     bool supportEndDoc;
131     bool supportStartPage;
132     bool supportEndPage;
133     bool supportResetCTM;
134     bool supportSetCTM;
135     bool supportGetCTM;
136     bool supportInitGS;
137     bool supportSaveGS;
138     bool supportRestoreGS;
139     bool supportQueryColorSpace;
140     bool supportSetColorSpace;
141     bool supportGetColorSpace;
142     bool supportSetFillMode;
143     bool supportGetFillMode;
144     bool supportSetAlphaConstant;
145     bool supportGetAlphaConstant;
146     bool supportSetLineWidth;
147     bool supportGetLineWidth;
148     bool supportSetLineDash;
149     bool supportGetLineDash;
150     bool supportSetLineDashOffset;
151     bool supportGetLineDashOffset;
152     bool supportSetLineStyle;
153     bool supportGetLineStyle;
154     bool supportSetLineCap;
155     bool supportGetLineCap;
156     bool supportSetLineJoin;
157     bool supportGetLineJoin;
158     bool supportSetMiterLimit;
159     bool supportGetMiterLimit;
160     bool supportSetPaintMode;
161     bool supportGetPaintMode;
162     bool supportSetStrokeColor;
163     bool supportSetFillColor;
164     bool supportSetBgColor;
165     bool supportNewPath;
166     bool supportEndPath;
167     bool supportStrokePath;
168     bool supportFillPath;
169     bool supportStrokeFillPath;
170     bool supportSetClipPath;
171     bool supportSetCurrentPoint;
172     bool supportLinePath;
173     bool supportPolygonPath;
174     bool supportRectanglePath;
175     bool supportRoundRectanglePath;
176     bool supportBezierPath;
177     bool supportArcPath;
178     bool supportDrawImage;
179     bool supportStartDrawImage;
180     bool supportTransferDrawImage;
181     bool supportEndDrawImage;
182     bool supportStartScanline;
183     bool supportScanline;
184     bool supportEndScanline;
185     bool supportStartRaster;
186     bool supportTransferRasterData;
187     bool supportSkipRaster;
188     bool supportEndRaster;
189     bool supportStartStream;
190     bool supportTransferStreamData;
191     bool supportEndStream;
192     bool supportQueryDeviceCapability;
193     bool supportQueryDeviceInfo;
194     bool supportResetClipPath;
195
196 protected:
197     void *opvpHandle;
198     opvp_int_t version[2];
199 private:
200     opvp_api_procs_t *procs;
201     opvp_int_t *opvpErrorNo;
202     opvp_dc_t printerContext;
203 };
204
205 #endif