new parameter addspacechars
[swftools.git] / lib / pdf / DummyOutputDev.cc
1 /* DummyOutputDev.h
2
3    Output Device which serves as "passthrough"
4    
5    Copyright (c) 2007 Matthias Kramm <kramm@quiss.org>
6
7    Swftools 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    Swftools 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 swftools; if not, write to the Free Software
19    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
20
21 #include <stdlib.h>
22 #include <stdio.h>
23 #include <memory.h>
24 #include "config.h"
25 #include "DummyOutputDev.h"
26 #include "GFXOutputDev.h"
27 #include "SplashBitmap.h"
28 #include "SplashPattern.h"
29 #include "Splash.h"
30 #include "../log.h"
31   
32 DummyOutputDev::DummyOutputDev(OutputDev*target)
33 {
34     this->rgbdev = target;
35 }
36 DummyOutputDev::~DummyOutputDev()
37 {
38     if(this->rgbdev) {
39         delete this->rgbdev;this->rgbdev= 0;
40     }
41 }
42 void DummyOutputDev::startPage(int pageNum, GfxState *state, double crop_x1, double crop_y1, double crop_x2, double crop_y2)
43 {
44     rgbdev->startPage(pageNum, state, crop_x1, crop_y1, crop_x2, crop_y2);
45 }
46
47 void DummyOutputDev::endPage()
48 {
49     rgbdev->endPage();
50 }
51
52 GBool DummyOutputDev::upsideDown()
53 {
54     return rgbdev->upsideDown();
55 }
56
57 GBool DummyOutputDev::useDrawChar()
58 {
59     return rgbdev->useDrawChar();
60 }
61
62 GBool DummyOutputDev::useTilingPatternFill()
63 {
64     return rgbdev->useTilingPatternFill();
65 }
66
67 GBool DummyOutputDev::useShadedFills()
68 {
69     return rgbdev->useShadedFills();
70 }
71
72 GBool DummyOutputDev::useDrawForm()
73 {
74     return rgbdev->useDrawForm();
75 }
76
77 GBool DummyOutputDev::interpretType3Chars()
78 {
79     return rgbdev->interpretType3Chars();
80 }
81
82 GBool DummyOutputDev::needNonText() 
83 {
84     return rgbdev->needNonText();
85 }
86 void DummyOutputDev::setDefaultCTM(double *ctm) 
87 {
88     rgbdev->setDefaultCTM(ctm);
89 }
90 void DummyOutputDev::saveState(GfxState *state) 
91 {
92     rgbdev->saveState(state);
93 }
94 void DummyOutputDev::restoreState(GfxState *state) 
95 {
96     rgbdev->restoreState(state);
97 }
98 void DummyOutputDev::updateAll(GfxState *state)
99 {
100     rgbdev->updateAll(state);
101 }
102 void DummyOutputDev::updateCTM(GfxState *state, double m11, double m12, double m21, double m22, double m31, double m32)
103 {
104     rgbdev->updateCTM(state,m11,m12,m21,m22,m31,m32);
105 }
106 void DummyOutputDev::updateLineDash(GfxState *state)
107 {
108     rgbdev->updateLineDash(state);
109 }
110 void DummyOutputDev::updateFlatness(GfxState *state)
111 {
112     rgbdev->updateFlatness(state);
113 }
114 void DummyOutputDev::updateLineJoin(GfxState *state)
115 {
116     rgbdev->updateLineJoin(state);
117 }
118 void DummyOutputDev::updateLineCap(GfxState *state)
119 {
120     rgbdev->updateLineCap(state);
121 }
122 void DummyOutputDev::updateMiterLimit(GfxState *state)
123 {
124     rgbdev->updateMiterLimit(state);
125 }
126 void DummyOutputDev::updateLineWidth(GfxState *state)
127 {
128     rgbdev->updateLineWidth(state);
129 }
130 void DummyOutputDev::updateStrokeAdjust(GfxState *state)
131 {
132     rgbdev->updateStrokeAdjust(state);
133 }
134 void DummyOutputDev::updateFillColorSpace(GfxState *state)
135 {
136     rgbdev->updateFillColorSpace(state);
137 }
138 void DummyOutputDev::updateStrokeColorSpace(GfxState *state)
139 {
140     rgbdev->updateStrokeColorSpace(state);
141 }
142 void DummyOutputDev::updateFillColor(GfxState *state)
143 {
144     rgbdev->updateFillColor(state);
145 }
146 void DummyOutputDev::updateStrokeColor(GfxState *state)
147 {
148     rgbdev->updateStrokeColor(state);
149 }
150 void DummyOutputDev::updateBlendMode(GfxState *state)
151 {
152     rgbdev->updateBlendMode(state);
153 }
154 void DummyOutputDev::updateFillOpacity(GfxState *state)
155 {
156     rgbdev->updateFillOpacity(state);
157 }
158 void DummyOutputDev::updateStrokeOpacity(GfxState *state)
159 {
160     rgbdev->updateStrokeOpacity(state);
161 }
162 void DummyOutputDev::updateFillOverprint(GfxState *state)
163 {
164     rgbdev->updateFillOverprint(state);
165 }
166 void DummyOutputDev::updateStrokeOverprint(GfxState *state)
167 {
168     rgbdev->updateStrokeOverprint(state);
169 }
170 void DummyOutputDev::updateTransfer(GfxState *state)
171 {
172     rgbdev->updateTransfer(state);
173 }
174 void DummyOutputDev::updateFont(GfxState *state)
175 {
176     rgbdev->updateFont(state);
177 }
178 void DummyOutputDev::updateTextMat(GfxState *state)
179 {
180     rgbdev->updateTextMat(state);
181 }
182 void DummyOutputDev::updateCharSpace(GfxState *state)
183 {
184     rgbdev->updateCharSpace(state);
185 }
186 void DummyOutputDev::updateRender(GfxState *state)
187 {
188     rgbdev->updateRender(state);
189 }
190 void DummyOutputDev::updateRise(GfxState *state)
191 {
192     rgbdev->updateRise(state);
193 }
194 void DummyOutputDev::updateWordSpace(GfxState *state)
195 {
196     rgbdev->updateWordSpace(state);
197 }
198 void DummyOutputDev::updateHorizScaling(GfxState *state)
199 {
200     rgbdev->updateHorizScaling(state);
201 }
202 void DummyOutputDev::updateTextPos(GfxState *state)
203 {
204     rgbdev->updateTextPos(state);
205 }
206 void DummyOutputDev::updateTextShift(GfxState *state, double shift)
207 {
208     rgbdev->updateTextShift(state, shift);
209 }
210 void DummyOutputDev::stroke(GfxState *state)
211 {
212     rgbdev->stroke(state);
213 }
214 void DummyOutputDev::fill(GfxState *state)
215 {
216     rgbdev->fill(state);
217 }
218 void DummyOutputDev::eoFill(GfxState *state)
219 {
220     rgbdev->eoFill(state);
221 }
222 #if (xpdfMajorVersion < 3) || (xpdfMinorVersion < 2) || (xpdfUpdateVersion < 7)
223 void DummyOutputDev::tilingPatternFill(GfxState *state, Object *str,
224                                int paintType, Dict *resDict,
225                                double *mat, double *bbox,
226                                int x0, int y0, int x1, int y1,
227                                double xStep, double yStep)
228 {
229     rgbdev->tilingPatternFill(state, str, paintType, resDict, mat, bbox, x0, y0, x1, y1, xStep, yStep);
230 }
231 #else
232 void DummyOutputDev::tilingPatternFill(GfxState *state, Gfx *gfx, Object *str,
233                                int paintType, Dict *resDict,
234                                double *mat, double *bbox,
235                                int x0, int y0, int x1, int y1,
236                                double xStep, double yStep) 
237 {
238     rgbdev->tilingPatternFill(state, gfx, str, paintType, resDict, mat, bbox, x0, y0, x1, y1, xStep, yStep);
239 }
240 #endif
241
242 GBool DummyOutputDev::functionShadedFill(GfxState *state, GfxFunctionShading *shading) 
243 {
244     return rgbdev->functionShadedFill(state, shading);
245 }
246 GBool DummyOutputDev::axialShadedFill(GfxState *state, GfxAxialShading *shading)
247 {
248     return rgbdev->axialShadedFill(state, shading);
249 }
250 GBool DummyOutputDev::radialShadedFill(GfxState *state, GfxRadialShading *shading)
251 {
252     return rgbdev->radialShadedFill(state, shading);
253 }
254
255 void DummyOutputDev::clip(GfxState *state)
256 {
257     rgbdev->clip(state);
258 }
259 void DummyOutputDev::eoClip(GfxState *state)
260 {
261     rgbdev->eoClip(state);
262 }
263 void DummyOutputDev::clipToStrokePath(GfxState *state)
264 {
265     rgbdev->clipToStrokePath(state);
266 }
267
268 void DummyOutputDev::beginStringOp(GfxState *state)
269 {
270     rgbdev->beginStringOp(state);
271 }
272 void DummyOutputDev::endStringOp(GfxState *state)
273 {
274     rgbdev->endStringOp(state);
275 }
276 void DummyOutputDev::beginString(GfxState *state, GString *s)
277 {
278     rgbdev->beginString(state, s);
279 }
280 void DummyOutputDev::endString(GfxState *state)
281 {
282     rgbdev->endString(state);
283 }
284 void DummyOutputDev::drawChar(GfxState *state, double x, double y,
285                       double dx, double dy,
286                       double originX, double originY,
287                       CharCode code, int nBytes, Unicode *u, int uLen)
288 {
289     rgbdev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen);
290 }
291 void DummyOutputDev::drawString(GfxState *state, GString *s)
292 {
293     rgbdev->drawString(state, s);
294 }
295 void DummyOutputDev::endTextObject(GfxState *state)
296 {
297     rgbdev->endTextObject(state);
298 }
299 GBool DummyOutputDev::beginType3Char(GfxState *state, double x, double y,
300                              double dx, double dy,
301                              CharCode code, Unicode *u, int uLen)
302 {
303     return rgbdev->beginType3Char(state, x, y, dx, dy, code, u, uLen);
304 }
305 void DummyOutputDev::type3D0(GfxState *state, double wx, double wy)
306 {
307     rgbdev->type3D0(state, wx, wy);
308 }
309 void DummyOutputDev::type3D1(GfxState *state, double wx, double wy, double llx, double lly, double urx, double ury)
310 {
311     rgbdev->type3D1(state, wx, wy, llx, lly, urx, ury);
312 }
313 void DummyOutputDev::endType3Char(GfxState *state)
314 {
315     rgbdev->endType3Char(state);
316 }
317 void DummyOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
318                            int width, int height, GBool invert,
319                            GBool inlineImg)
320 {
321     rgbdev->drawImageMask(state, ref, str, width, height, invert, inlineImg);
322 }
323 void DummyOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
324                        int width, int height, GfxImageColorMap *colorMap,
325                        int *maskColors, GBool inlineImg)
326 {
327     rgbdev->drawImage(state, ref, str, width, height, colorMap, maskColors, inlineImg);
328 }
329 void DummyOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str,
330                              int width, int height,
331                              GfxImageColorMap *colorMap,
332                              Stream *maskStr, int maskWidth, int maskHeight,
333                              GBool maskInvert)
334 {
335     rgbdev->drawMaskedImage(state, ref, str, width, height, colorMap, maskStr, maskWidth, maskHeight, maskInvert);
336 }
337 void DummyOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
338                                  int width, int height,
339                                  GfxImageColorMap *colorMap,
340                                  Stream *maskStr,
341                                  int maskWidth, int maskHeight,
342                                  GfxImageColorMap *maskColorMap)
343 {
344     rgbdev->drawSoftMaskedImage(state, ref, str, width, height, colorMap, maskStr, maskWidth, maskHeight, maskColorMap);
345 }
346 void DummyOutputDev::drawForm(Ref id)
347 {
348     rgbdev->drawForm(id);
349 }
350
351 void DummyOutputDev::processLink(Link *link, Catalog *catalog)
352 {
353 }
354
355 void DummyOutputDev::beginTransparencyGroup(GfxState *state, double *bbox,
356                                     GfxColorSpace *blendingColorSpace,
357                                     GBool isolated, GBool knockout,
358                                     GBool forSoftMask)
359 {
360     rgbdev->beginTransparencyGroup(state, bbox, blendingColorSpace, isolated, knockout, forSoftMask);
361 }
362 void DummyOutputDev::endTransparencyGroup(GfxState *state)
363 {
364     rgbdev->endTransparencyGroup(state);
365 }
366 void DummyOutputDev::paintTransparencyGroup(GfxState *state, double *bbox)
367 {
368     rgbdev->paintTransparencyGroup(state,bbox);
369 }
370 void DummyOutputDev::setSoftMask(GfxState *state, double *bbox, GBool alpha, Function *transferFunc, GfxColor *backdropColor)
371 {
372     rgbdev->setSoftMask(state, bbox, alpha, transferFunc, backdropColor);
373 }
374 void DummyOutputDev::clearSoftMask(GfxState *state)
375 {
376     rgbdev->clearSoftMask(state);
377 }