1
//========================================================================
5
// Copyright 2003 Glyph & Cog, LLC
7
//========================================================================
9
//========================================================================
11
// Modified under the Poppler project - http://poppler.freedesktop.org
13
// All changes made under the Poppler project to this file are licensed
14
// under GPL version 2 or later
16
// Copyright (C) 2005 Brad Hards <bradh@frogmouth.net>
17
// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org>
18
// Copyright (C) 2009 Carlos Garcia Campos <carlosgc@gnome.org>
19
// Copyright (C) 2010, 2010 Pino Toscano <pino@kde.org>
21
// To see a description of the changes please see the Changelog file that
22
// came with your tarball or type make ChangeLog if you are building from git
24
//========================================================================
26
#ifndef ARTHUROUTPUTDEV_H
27
#define ARTHUROUTPUTDEV_H
29
#ifdef USE_GCC_PRAGMAS
33
#include "goo/gtypes.h"
34
#include "OutputDev.h"
37
#include <QtGui/QPainter>
45
class SplashFontEngine;
46
struct SplashGlyphBitmap;
48
//------------------------------------------------------------------------
49
// ArthurOutputDev - Qt 4 QPainter renderer
50
//------------------------------------------------------------------------
52
class ArthurOutputDev: public OutputDev {
56
ArthurOutputDev(QPainter *painter );
59
virtual ~ArthurOutputDev();
61
//----- get info about output device
63
// Does this device use upside-down coordinates?
64
// (Upside-down means (0,0) is the top left corner of the page.)
65
virtual GBool upsideDown() { return gTrue; }
67
// Does this device use drawChar() or drawString()?
68
virtual GBool useDrawChar() { return gTrue; }
70
// Does this device use beginType3Char/endType3Char? Otherwise,
71
// text in Type 3 fonts will be drawn with drawChar/drawString.
72
virtual GBool interpretType3Chars() { return gTrue; }
74
//----- initialization and control
77
virtual void startPage(int pageNum, GfxState *state);
80
virtual void endPage();
83
virtual void drawLink(Link *link, Catalog *catalog);
85
//----- save/restore graphics state
86
virtual void saveState(GfxState *state);
87
virtual void restoreState(GfxState *state);
89
//----- update graphics state
90
virtual void updateAll(GfxState *state);
91
virtual void updateCTM(GfxState *state, double m11, double m12,
92
double m21, double m22, double m31, double m32);
93
virtual void updateLineDash(GfxState *state);
94
virtual void updateFlatness(GfxState *state);
95
virtual void updateLineJoin(GfxState *state);
96
virtual void updateLineCap(GfxState *state);
97
virtual void updateMiterLimit(GfxState *state);
98
virtual void updateLineWidth(GfxState *state);
99
virtual void updateFillColor(GfxState *state);
100
virtual void updateStrokeColor(GfxState *state);
101
virtual void updateFillOpacity(GfxState *state);
102
virtual void updateStrokeOpacity(GfxState *state);
104
//----- update text state
105
virtual void updateFont(GfxState *state);
107
//----- path painting
108
virtual void stroke(GfxState *state);
109
virtual void fill(GfxState *state);
110
virtual void eoFill(GfxState *state);
112
//----- path clipping
113
virtual void clip(GfxState *state);
114
virtual void eoClip(GfxState *state);
117
// virtual void drawString(GfxState *state, GooString *s);
118
virtual void drawChar(GfxState *state, double x, double y,
119
double dx, double dy,
120
double originX, double originY,
121
CharCode code, int nBytes, Unicode *u, int uLen);
122
virtual GBool beginType3Char(GfxState *state, double x, double y,
123
double dx, double dy,
124
CharCode code, Unicode *u, int uLen);
125
virtual void endType3Char(GfxState *state);
126
virtual void endTextObject(GfxState *state);
128
//----- image drawing
129
virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
130
int width, int height, GBool invert,
131
GBool interpolate, GBool inlineImg);
132
virtual void drawImage(GfxState *state, Object *ref, Stream *str,
133
int width, int height, GfxImageColorMap *colorMap,
134
GBool interpolate, int *maskColors, GBool inlineImg);
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);
141
//----- special access
143
// Called to indicate that a new PDF document has been loaded.
144
void startDoc(XRef *xrefA);
146
GBool isReverseVideo() { return gFalse; }
152
QBrush m_currentBrush;
153
GBool m_needFontUpdate; // set when the font needs to be updated
154
SplashFontEngine *m_fontEngine;
155
SplashFont *m_font; // current font
156
XRef *xref; // xref table for current document