1 //========================================================================
5 // Copyright 2003 Glyph & Cog, LLC
6 // Copyright 2004 Red Hat, INC
8 //========================================================================
10 #ifndef CAIROOUTPUTDEV_H
11 #define CAIROOUTPUTDEV_H
13 #ifdef USE_GCC_PRAGMAS
17 #include "goo/gtypes.h"
18 #include "OutputDev.h"
21 #include <QtGui/QPainter>
29 class SplashFontEngine
;
30 class SplashGlyphBitmap
;
32 //------------------------------------------------------------------------
33 // ArthurOutputDev - Qt 4 QPainter renderer
34 //------------------------------------------------------------------------
36 class ArthurOutputDev
: public OutputDev
{
40 ArthurOutputDev(QPainter
*painter
);
43 virtual ~ArthurOutputDev();
45 //----- get info about output device
47 // Does this device use upside-down coordinates?
48 // (Upside-down means (0,0) is the top left corner of the page.)
49 virtual GBool
upsideDown() { return gTrue
; }
51 // Does this device use drawChar() or drawString()?
52 virtual GBool
useDrawChar() { return gTrue
; }
54 // Does this device use beginType3Char/endType3Char? Otherwise,
55 // text in Type 3 fonts will be drawn with drawChar/drawString.
56 virtual GBool
interpretType3Chars() { return gTrue
; }
58 //----- initialization and control
61 virtual void startPage(int pageNum
, GfxState
*state
);
64 virtual void endPage();
67 virtual void drawLink(Link
*link
, Catalog
*catalog
);
69 //----- save/restore graphics state
70 virtual void saveState(GfxState
*state
);
71 virtual void restoreState(GfxState
*state
);
73 //----- update graphics state
74 virtual void updateAll(GfxState
*state
);
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
);
88 //----- update text state
89 virtual void updateFont(GfxState
*state
);
92 virtual void stroke(GfxState
*state
);
93 virtual void fill(GfxState
*state
);
94 virtual void eoFill(GfxState
*state
);
97 virtual void clip(GfxState
*state
);
98 virtual void eoClip(GfxState
*state
);
101 // virtual void drawString(GfxState *state, GooString *s);
102 virtual void drawChar(GfxState
*state
, double x
, double y
,
103 double dx
, double dy
,
104 double originX
, double originY
,
105 CharCode code
, int nBytes
, Unicode
*u
, int uLen
);
106 virtual GBool
beginType3Char(GfxState
*state
, double x
, double y
,
107 double dx
, double dy
,
108 CharCode code
, Unicode
*u
, int uLen
);
109 virtual void endType3Char(GfxState
*state
);
110 virtual void endTextObject(GfxState
*state
);
112 //----- image drawing
113 virtual void drawImageMask(GfxState
*state
, Object
*ref
, Stream
*str
,
114 int width
, int height
, GBool invert
,
116 virtual void drawImage(GfxState
*state
, Object
*ref
, Stream
*str
,
117 int width
, int height
, GfxImageColorMap
*colorMap
,
118 int *maskColors
, GBool inlineImg
);
120 //----- Type 3 font operators
121 virtual void type3D0(GfxState
*state
, double wx
, double wy
);
122 virtual void type3D1(GfxState
*state
, double wx
, double wy
,
123 double llx
, double lly
, double urx
, double ury
);
125 //----- special access
127 // Called to indicate that a new PDF document has been loaded.
128 void startDoc(XRef
*xrefA
);
130 GBool
isReverseVideo() { return gFalse
; }
136 QBrush m_currentBrush
;
137 GBool m_needFontUpdate
; // set when the font needs to be updated
139 SplashFontEngine
*m_fontEngine
;
140 SplashFont
*m_font
; // current font
141 XRef
*xref
; // xref table for current document