]> www.fi.muni.cz Git - evince.git/blob - pdf/xpdf/OutputDev.h
Imported Xpdf 2.03 and fixed build.
[evince.git] / pdf / xpdf / OutputDev.h
1 //========================================================================
2 //
3 // OutputDev.h
4 //
5 // Copyright 1996-2003 Glyph & Cog, LLC
6 //
7 //========================================================================
8
9 #ifndef OUTPUTDEV_H
10 #define OUTPUTDEV_H
11
12 #include <aconf.h>
13
14 #ifdef USE_GCC_PRAGMAS
15 #pragma interface
16 #endif
17
18 #include "gtypes.h"
19 #include "CharTypes.h"
20
21 class GString;
22 class Object;
23 class GfxState;
24 class GfxColorSpace;
25 class GfxImageColorMap;
26 class Stream;
27 class Link;
28 class Catalog;
29
30 //------------------------------------------------------------------------
31 // OutputDev
32 //------------------------------------------------------------------------
33
34 class OutputDev {
35 public:
36
37   // Constructor.
38   OutputDev() {}
39
40   // Destructor.
41   virtual ~OutputDev() {}
42
43   //----- get info about output device
44
45   // Does this device use upside-down coordinates?
46   // (Upside-down means (0,0) is the top left corner of the page.)
47   virtual GBool upsideDown() = 0;
48
49   // Does this device use drawChar() or drawString()?
50   virtual GBool useDrawChar() = 0;
51
52   // Does this device use beginType3Char/endType3Char?  Otherwise,
53   // text in Type 3 fonts will be drawn with drawChar/drawString.
54   virtual GBool interpretType3Chars() = 0;
55
56   // Does this device need non-text content?
57   virtual GBool needNonText() { return gTrue; }
58
59   //----- initialization and control
60
61   // Set default transform matrix.
62   virtual void setDefaultCTM(double *ctm);
63
64   // Start a page.
65   virtual void startPage(int pageNum, GfxState *state) {}
66
67   // End a page.
68   virtual void endPage() {}
69
70   // Dump page contents to display.
71   virtual void dump() {}
72
73   //----- coordinate conversion
74
75   // Convert between device and user coordinates.
76   virtual void cvtDevToUser(double dx, double dy, double *ux, double *uy);
77   virtual void cvtUserToDev(double ux, double uy, int *dx, int *dy);
78
79   //----- link borders
80   virtual void drawLink(Link *link, Catalog *catalog) {}
81
82   //----- save/restore graphics state
83   virtual void saveState(GfxState *state) {}
84   virtual void restoreState(GfxState *state) {}
85
86   //----- update graphics state
87   virtual void updateAll(GfxState *state);
88   virtual void updateCTM(GfxState *state, double m11, double m12,
89                          double m21, double m22, double m31, double m32) {}
90   virtual void updateLineDash(GfxState *state) {}
91   virtual void updateFlatness(GfxState *state) {}
92   virtual void updateLineJoin(GfxState *state) {}
93   virtual void updateLineCap(GfxState *state) {}
94   virtual void updateMiterLimit(GfxState *state) {}
95   virtual void updateLineWidth(GfxState *state) {}
96   virtual void updateFillColor(GfxState *state) {}
97   virtual void updateStrokeColor(GfxState *state) {}
98   virtual void updateFillOpacity(GfxState *state) {}
99   virtual void updateStrokeOpacity(GfxState *state) {}
100
101   //----- update text state
102   virtual void updateFont(GfxState *state) {}
103   virtual void updateTextMat(GfxState *state) {}
104   virtual void updateCharSpace(GfxState *state) {}
105   virtual void updateRender(GfxState *state) {}
106   virtual void updateRise(GfxState *state) {}
107   virtual void updateWordSpace(GfxState *state) {}
108   virtual void updateHorizScaling(GfxState *state) {}
109   virtual void updateTextPos(GfxState *state) {}
110   virtual void updateTextShift(GfxState *state, double shift) {}
111
112   //----- path painting
113   virtual void stroke(GfxState *state) {}
114   virtual void fill(GfxState *state) {}
115   virtual void eoFill(GfxState *state) {}
116
117   //----- path clipping
118   virtual void clip(GfxState *state) {}
119   virtual void eoClip(GfxState *state) {}
120
121   //----- text drawing
122   virtual void beginString(GfxState *state, GString *s) {}
123   virtual void endString(GfxState *state) {}
124   virtual void drawChar(GfxState *state, double x, double y,
125                         double dx, double dy,
126                         double originX, double originY,
127                         CharCode code, Unicode *u, int uLen) {}
128   virtual void drawString(GfxState *state, GString *s) {}
129   virtual GBool beginType3Char(GfxState *state,
130                                CharCode code, Unicode *u, int uLen);
131   virtual void endType3Char(GfxState *state) {}
132   virtual void endTextObject(GfxState *state) {}
133
134   //----- image drawing
135   virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
136                              int width, int height, GBool invert,
137                              GBool inlineImg);
138   virtual void drawImage(GfxState *state, Object *ref, Stream *str,
139                          int width, int height, GfxImageColorMap *colorMap,
140                          int *maskColors, GBool inlineImg);
141
142 #if OPI_SUPPORT
143   //----- OPI functions
144   virtual void opiBegin(GfxState *state, Dict *opiDict);
145   virtual void opiEnd(GfxState *state, Dict *opiDict);
146 #endif
147
148   //----- Type 3 font operators
149   virtual void type3D0(GfxState *state, double wx, double wy) {}
150   virtual void type3D1(GfxState *state, double wx, double wy,
151                        double llx, double lly, double urx, double ury) {}
152
153   //----- PostScript XObjects
154   virtual void psXObject(Stream *psStream, Stream *level1Stream) {}
155
156 private:
157
158   double defCTM[6];             // default coordinate transform matrix
159   double defICTM[6];            // inverse of default CTM
160 };
161
162 #endif