i hope the node casts are correct here.
[AROS-Contrib.git] / arospdf / xpdf / OutputDev.h
blob5e4d558ce92ae2e68668405e9c8087ef63d9b6bd
1 //========================================================================
2 //
3 // OutputDev.h
4 //
5 // Copyright 1996-2003 Glyph & Cog, LLC
6 //
7 //========================================================================
9 #ifndef OUTPUTDEV_H
10 #define OUTPUTDEV_H
12 #include <aconf.h>
14 #ifdef USE_GCC_PRAGMAS
15 #pragma interface
16 #endif
18 #include "gtypes.h"
19 #include "CharTypes.h"
21 class GString;
22 class GfxState;
23 struct GfxColor;
24 class GfxColorSpace;
25 class GfxImageColorMap;
26 class GfxFunctionShading;
27 class GfxAxialShading;
28 class GfxRadialShading;
29 class Stream;
30 class Links;
31 class Link;
32 class Catalog;
33 class Page;
34 class Function;
36 //------------------------------------------------------------------------
37 // OutputDev
38 //------------------------------------------------------------------------
40 class OutputDev {
41 public:
43 // Constructor.
44 OutputDev() {}
46 // Destructor.
47 virtual ~OutputDev() {}
49 //----- get info about output device
51 // Does this device use upside-down coordinates?
52 // (Upside-down means (0,0) is the top left corner of the page.)
53 virtual GBool upsideDown() = 0;
55 // Does this device use drawChar() or drawString()?
56 virtual GBool useDrawChar() = 0;
58 // Does this device use tilingPatternFill()? If this returns false,
59 // tiling pattern fills will be reduced to a series of other drawing
60 // operations.
61 virtual GBool useTilingPatternFill() { return gFalse; }
63 // Does this device use functionShadedFill(), axialShadedFill(), and
64 // radialShadedFill()? If this returns false, these shaded fills
65 // will be reduced to a series of other drawing operations.
66 virtual GBool useShadedFills() { return gFalse; }
68 // Does this device use drawForm()? If this returns false,
69 // form-type XObjects will be interpreted (i.e., unrolled).
70 virtual GBool useDrawForm() { return gFalse; }
72 // Does this device use beginType3Char/endType3Char? Otherwise,
73 // text in Type 3 fonts will be drawn with drawChar/drawString.
74 virtual GBool interpretType3Chars() = 0;
76 // Does this device need non-text content?
77 virtual GBool needNonText() { return gTrue; }
79 //----- initialization and control
81 // Set default transform matrix.
82 virtual void setDefaultCTM(double *ctm);
84 // Check to see if a page slice should be displayed. If this
85 // returns false, the page display is aborted. Typically, an
86 // OutputDev will use some alternate means to display the page
87 // before returning false.
88 virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI,
89 int rotate, GBool useMediaBox, GBool crop,
90 int sliceX, int sliceY, int sliceW, int sliceH,
91 GBool printing, Catalog *catalog,
92 GBool (*abortCheckCbk)(void *data) = NULL,
93 void *abortCheckCbkData = NULL)
94 { return gTrue; }
96 // Start a page.
97 virtual void startPage(int pageNum, GfxState *state) {}
99 // End a page.
100 virtual void endPage() {}
102 // Dump page contents to display.
103 virtual void dump() {}
105 //----- coordinate conversion
107 // Convert between device and user coordinates.
108 virtual void cvtDevToUser(double dx, double dy, double *ux, double *uy);
109 virtual void cvtUserToDev(double ux, double uy, int *dx, int *dy);
111 double *getDefCTM() { return defCTM; }
112 double *getDefICTM() { return defICTM; }
114 //----- save/restore graphics state
115 virtual void saveState(GfxState *state) {}
116 virtual void restoreState(GfxState *state) {}
118 //----- update graphics state
119 virtual void updateAll(GfxState *state);
120 virtual void updateCTM(GfxState *state, double m11, double m12,
121 double m21, double m22, double m31, double m32) {}
122 virtual void updateLineDash(GfxState *state) {}
123 virtual void updateFlatness(GfxState *state) {}
124 virtual void updateLineJoin(GfxState *state) {}
125 virtual void updateLineCap(GfxState *state) {}
126 virtual void updateMiterLimit(GfxState *state) {}
127 virtual void updateLineWidth(GfxState *state) {}
128 virtual void updateStrokeAdjust(GfxState *state) {}
129 virtual void updateFillColorSpace(GfxState *state) {}
130 virtual void updateStrokeColorSpace(GfxState *state) {}
131 virtual void updateFillColor(GfxState *state) {}
132 virtual void updateStrokeColor(GfxState *state) {}
133 virtual void updateBlendMode(GfxState *state) {}
134 virtual void updateFillOpacity(GfxState *state) {}
135 virtual void updateStrokeOpacity(GfxState *state) {}
136 virtual void updateFillOverprint(GfxState *state) {}
137 virtual void updateStrokeOverprint(GfxState *state) {}
138 virtual void updateTransfer(GfxState *state) {}
140 //----- update text state
141 virtual void updateFont(GfxState *state) {}
142 virtual void updateTextMat(GfxState *state) {}
143 virtual void updateCharSpace(GfxState *state) {}
144 virtual void updateRender(GfxState *state) {}
145 virtual void updateRise(GfxState *state) {}
146 virtual void updateWordSpace(GfxState *state) {}
147 virtual void updateHorizScaling(GfxState *state) {}
148 virtual void updateTextPos(GfxState *state) {}
149 virtual void updateTextShift(GfxState *state, double shift) {}
151 //----- path painting
152 virtual void stroke(GfxState *state) {}
153 virtual void fill(GfxState *state) {}
154 virtual void eoFill(GfxState *state) {}
155 virtual void tilingPatternFill(GfxState *state, xObject *str,
156 int paintType, Dict *resDict,
157 double *mat, double *bbox,
158 int x0, int y0, int x1, int y1,
159 double xStep, double yStep) {}
160 virtual GBool functionShadedFill(GfxState *state,
161 GfxFunctionShading *shading)
162 { return gFalse; }
163 virtual GBool axialShadedFill(GfxState *state, GfxAxialShading *shading)
164 { return gFalse; }
165 virtual GBool radialShadedFill(GfxState *state, GfxRadialShading *shading)
166 { return gFalse; }
168 //----- path clipping
169 virtual void clip(GfxState *state) {}
170 virtual void eoClip(GfxState *state) {}
171 virtual void clipToStrokePath(GfxState *state) {}
173 //----- text drawing
174 virtual void beginStringOp(GfxState *state) {}
175 virtual void endStringOp(GfxState *state) {}
176 virtual void beginString(GfxState *state, GString *s) {}
177 virtual void endString(GfxState *state) {}
178 virtual void drawChar(GfxState *state, double x, double y,
179 double dx, double dy,
180 double originX, double originY,
181 CharCode code, int nBytes, Unicode *u, int uLen) {}
182 virtual void drawString(GfxState *state, GString *s) {}
183 virtual GBool beginType3Char(GfxState *state, double x, double y,
184 double dx, double dy,
185 CharCode code, Unicode *u, int uLen);
186 virtual void endType3Char(GfxState *state) {}
187 virtual void endTextObject(GfxState *state) {}
189 //----- image drawing
190 virtual void drawImageMask(GfxState *state, xObject *ref, Stream *str,
191 int width, int height, GBool invert,
192 GBool inlineImg);
193 virtual void drawImage(GfxState *state, xObject *ref, Stream *str,
194 int width, int height, GfxImageColorMap *colorMap,
195 int *maskColors, GBool inlineImg);
196 virtual void drawMaskedImage(GfxState *state, xObject *ref, Stream *str,
197 int width, int height,
198 GfxImageColorMap *colorMap,
199 Stream *maskStr, int maskWidth, int maskHeight,
200 GBool maskInvert);
201 virtual void drawSoftMaskedImage(GfxState *state, xObject *ref, Stream *str,
202 int width, int height,
203 GfxImageColorMap *colorMap,
204 Stream *maskStr,
205 int maskWidth, int maskHeight,
206 GfxImageColorMap *maskColorMap);
208 #if OPI_SUPPORT
209 //----- OPI functions
210 virtual void opiBegin(GfxState *state, Dict *opiDict);
211 virtual void opiEnd(GfxState *state, Dict *opiDict);
212 #endif
214 //----- Type 3 font operators
215 virtual void type3D0(GfxState *state, double wx, double wy) {}
216 virtual void type3D1(GfxState *state, double wx, double wy,
217 double llx, double lly, double urx, double ury) {}
219 //----- form XObjects
220 virtual void drawForm(Ref id) {}
222 //----- PostScript XObjects
223 virtual void psXObject(Stream *psStream, Stream *level1Stream) {}
225 //----- transparency groups and soft masks
226 virtual void beginTransparencyGroup(GfxState *state, double *bbox,
227 GfxColorSpace *blendingColorSpace,
228 GBool isolated, GBool knockout,
229 GBool forSoftMask) {}
230 virtual void endTransparencyGroup(GfxState *state) {}
231 virtual void paintTransparencyGroup(GfxState *state, double *bbox) {}
232 virtual void setSoftMask(GfxState *state, double *bbox, GBool alpha,
233 Function *transferFunc, GfxColor *backdropColor) {}
234 virtual void clearSoftMask(GfxState *state) {}
236 //----- links
237 virtual void processLink(Link *link, Catalog *catalog) {}
239 #if 1 //~tmp: turn off anti-aliasing temporarily
240 virtual GBool getVectorAntialias() { return gFalse; }
241 virtual void setVectorAntialias(GBool vaa) {}
242 #endif
244 private:
246 double defCTM[6]; // default coordinate transform matrix
247 double defICTM[6]; // inverse of default CTM
250 #endif