Change the translation of the "Help" menu item to "?", so that the menu can be displa...
[reactos.git] / rosapps / smartpdf / poppler / poppler / CairoOutputDev.h
1 //========================================================================
2 //
3 // CairoOutputDev.h
4 //
5 // Copyright 2003 Glyph & Cog, LLC
6 // Copyright 2004 Red Hat, INC
7 //
8 //========================================================================
9
10 #ifndef CAIROOUTPUTDEV_H
11 #define CAIROOUTPUTDEV_H
12
13 #ifdef USE_GCC_PRAGMAS
14 #pragma interface
15 #endif
16
17 #include "goo/gtypes.h"
18 #include <cairo-ft.h>
19 #include "OutputDev.h"
20 #include "GfxState.h"
21
22 class GfxState;
23 class GfxPath;
24 class Gfx8BitFont;
25 struct GfxRGB;
26 class CairoFontEngine;
27 class CairoFont;
28
29 //------------------------------------------------------------------------
30
31 //------------------------------------------------------------------------
32 // CairoOutputDev
33 //------------------------------------------------------------------------
34
35 class CairoOutputDev: public OutputDev {
36 public:
37
38 // Constructor.
39 CairoOutputDev();
40
41 // Destructor.
42 virtual ~CairoOutputDev();
43
44 //----- get info about output device
45
46 // Does this device use upside-down coordinates?
47 // (Upside-down means (0,0) is the top left corner of the page.)
48 virtual GBool upsideDown() { return gTrue; }
49
50 // Does this device use drawChar() or drawString()?
51 virtual GBool useDrawChar() { return gTrue; }
52
53 // Does this device use beginType3Char/endType3Char? Otherwise,
54 // text in Type 3 fonts will be drawn with drawChar/drawString.
55 virtual GBool interpretType3Chars() { return gTrue; }
56
57 //----- initialization and control
58
59 // Start a page.
60 virtual void startPage(int pageNum, GfxState *state) { }
61
62 // End a page.
63 virtual void endPage() { }
64
65 //----- link borders
66 virtual void drawLink(Link *link, Catalog *catalog);
67
68 //----- save/restore graphics state
69 virtual void saveState(GfxState *state);
70 virtual void restoreState(GfxState *state);
71
72 //----- update graphics state
73 virtual void updateAll(GfxState *state);
74 virtual void setDefaultCTM(double *ctm);
75 virtual void updateCTM(GfxState *state, double m11, double m12,
76 double m21, double m22, double m31, double m32);
77 virtual void updateLineDash(GfxState *state);
78 virtual void updateFlatness(GfxState *state);
79 virtual void updateLineJoin(GfxState *state);
80 virtual void updateLineCap(GfxState *state);
81 virtual void updateMiterLimit(GfxState *state);
82 virtual void updateLineWidth(GfxState *state);
83 virtual void updateFillColor(GfxState *state);
84 virtual void updateStrokeColor(GfxState *state);
85 virtual void updateFillOpacity(GfxState *state);
86 virtual void updateStrokeOpacity(GfxState *state);
87
88 //----- update text state
89 virtual void updateFont(GfxState *state);
90
91 //----- path painting
92 virtual void stroke(GfxState *state);
93 virtual void fill(GfxState *state);
94 virtual void eoFill(GfxState *state);
95
96 //----- path clipping
97 virtual void clip(GfxState *state);
98 virtual void eoClip(GfxState *state);
99
100 //----- text drawing
101 void beginString(GfxState *state, GooString *s);
102 void endString(GfxState *state);
103 void drawChar(GfxState *state, double x, double y,
104 double dx, double dy,
105 double originX, double originY,
106 CharCode code, int nBytes, Unicode *u, int uLen);
107
108 virtual GBool beginType3Char(GfxState *state, double x, double y,
109 double dx, double dy,
110 CharCode code, Unicode *u, int uLen);
111 virtual void endType3Char(GfxState *state);
112 virtual void endTextObject(GfxState *state);
113
114 //----- image drawing
115 virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
116 int width, int height, GBool invert,
117 GBool inlineImg);
118 virtual void drawImage(GfxState *state, Object *ref, Stream *str,
119 int width, int height, GfxImageColorMap *colorMap,
120 int *maskColors, GBool inlineImg);
121 virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
122 int width, int height,
123 GfxImageColorMap *colorMap,
124 Stream *maskStr,
125 int maskWidth, int maskHeight,
126 GfxImageColorMap *maskColorMap);
127
128 virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
129 int width, int height,
130 GfxImageColorMap *colorMap,
131 Stream *maskStr,
132 int maskWidth, int maskHeight,
133 GBool maskInvert);
134
135
136 //----- Type 3 font operators
137 virtual void type3D0(GfxState *state, double wx, double wy);
138 virtual void type3D1(GfxState *state, double wx, double wy,
139 double llx, double lly, double urx, double ury);
140
141 //----- special access
142
143 // Called to indicate that a new PDF document has been loaded.
144 void startDoc(XRef *xrefA);
145
146 GBool isReverseVideo() { return gFalse; }
147
148 void setCairo (cairo_t *cr);
149
150 protected:
151 void doPath(GfxState *state, GfxPath *path);
152
153 GfxRGB fill_color, stroke_color;
154 cairo_pattern_t *fill_pattern, *stroke_pattern;
155 double fill_opacity;
156 double stroke_opacity;
157 CairoFont *currentFont;
158
159 XRef *xref; // xref table for current document
160
161 FT_Library ft_lib;
162 CairoFontEngine *fontEngine;
163 cairo_t *cairo;
164 GBool needFontUpdate; // set when the font needs to be updated
165 cairo_surface_t *surface;
166 cairo_glyph_t *glyphs;
167 int glyphCount;
168 cairo_path_t *textClipPath;
169 };
170
171 #endif