source: trunk/poppler/mypoppler/poppler/ArthurOutputDev.h @ 257

Last change on this file since 257 was 257, checked in by Eugene Romanenko, 13 years ago

PDF plugin: Poppler library updated to version 0.10.0

File size: 4.8 KB
Line 
1//========================================================================
2//
3// ArthurOutputDev.h
4//
5// Copyright 2003 Glyph & Cog, LLC
6//
7//========================================================================
8
9//========================================================================
10//
11// Modified under the Poppler project - http://poppler.freedesktop.org
12//
13// All changes made under the Poppler project to this file are licensed
14// under GPL version 2 or later
15//
16// Copyright (C) 2005 Brad Hards <bradh@frogmouth.net>
17// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org>
18//
19// To see a description of the changes please see the Changelog file that
20// came with your tarball or type make ChangeLog if you are building from git
21//
22//========================================================================
23
24#ifndef ARTHUROUTPUTDEV_H
25#define ARTHUROUTPUTDEV_H
26
27#ifdef USE_GCC_PRAGMAS
28#pragma interface
29#endif
30
31#include "goo/gtypes.h"
32#include "OutputDev.h"
33#include "GfxState.h"
34
35#include <QtGui/QPainter>
36
37class GfxState;
38class GfxPath;
39class Gfx8BitFont;
40struct GfxRGB;
41
42class SplashFont;
43class SplashFontEngine;
44class SplashGlyphBitmap;
45
46//------------------------------------------------------------------------
47// ArthurOutputDev - Qt 4 QPainter renderer
48//------------------------------------------------------------------------
49
50class ArthurOutputDev: public OutputDev {
51public:
52
53  // Constructor.
54  ArthurOutputDev(QPainter *painter );
55
56  // Destructor.
57  virtual ~ArthurOutputDev();
58
59  //----- get info about output device
60
61  // Does this device use upside-down coordinates?
62  // (Upside-down means (0,0) is the top left corner of the page.)
63  virtual GBool upsideDown() { return gTrue; }
64
65  // Does this device use drawChar() or drawString()?
66  virtual GBool useDrawChar() { return gTrue; }
67
68  // Does this device use beginType3Char/endType3Char?  Otherwise,
69  // text in Type 3 fonts will be drawn with drawChar/drawString.
70  virtual GBool interpretType3Chars() { return gTrue; }
71
72  //----- initialization and control
73
74  // Start a page.
75  virtual void startPage(int pageNum, GfxState *state);
76
77  // End a page.
78  virtual void endPage();
79
80  //----- link borders
81  virtual void drawLink(Link *link, Catalog *catalog);
82
83  //----- save/restore graphics state
84  virtual void saveState(GfxState *state);
85  virtual void restoreState(GfxState *state);
86
87  //----- update graphics state
88  virtual void updateAll(GfxState *state);
89  virtual void updateCTM(GfxState *state, double m11, double m12,
90                         double m21, double m22, double m31, double m32);
91  virtual void updateLineDash(GfxState *state);
92  virtual void updateFlatness(GfxState *state);
93  virtual void updateLineJoin(GfxState *state);
94  virtual void updateLineCap(GfxState *state);
95  virtual void updateMiterLimit(GfxState *state);
96  virtual void updateLineWidth(GfxState *state);
97  virtual void updateFillColor(GfxState *state);
98  virtual void updateStrokeColor(GfxState *state);
99  virtual void updateFillOpacity(GfxState *state);
100  virtual void updateStrokeOpacity(GfxState *state);
101
102  //----- update text state
103  virtual void updateFont(GfxState *state);
104
105  //----- path painting
106  virtual void stroke(GfxState *state);
107  virtual void fill(GfxState *state);
108  virtual void eoFill(GfxState *state);
109
110  //----- path clipping
111  virtual void clip(GfxState *state);
112  virtual void eoClip(GfxState *state);
113
114  //----- text drawing
115  //   virtual void drawString(GfxState *state, GooString *s);
116  virtual void drawChar(GfxState *state, double x, double y,
117                        double dx, double dy,
118                        double originX, double originY,
119                        CharCode code, int nBytes, Unicode *u, int uLen);
120  virtual GBool beginType3Char(GfxState *state, double x, double y,
121                               double dx, double dy,
122                               CharCode code, Unicode *u, int uLen);
123  virtual void endType3Char(GfxState *state);
124  virtual void endTextObject(GfxState *state);
125
126  //----- image drawing
127  virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
128                             int width, int height, GBool invert,
129                             GBool inlineImg);
130  virtual void drawImage(GfxState *state, Object *ref, Stream *str,
131                         int width, int height, GfxImageColorMap *colorMap,
132                         int *maskColors, GBool inlineImg);
133
134  //----- Type 3 font operators
135  virtual void type3D0(GfxState *state, double wx, double wy);
136  virtual void type3D1(GfxState *state, double wx, double wy,
137                       double llx, double lly, double urx, double ury);
138
139  //----- special access
140
141  // Called to indicate that a new PDF document has been loaded.
142  void startDoc(XRef *xrefA);
143 
144  GBool isReverseVideo() { return gFalse; }
145 
146private:
147  QPainter *m_painter;
148  QFont m_currentFont;
149  QPen m_currentPen;
150  QBrush m_currentBrush;
151  GBool m_needFontUpdate;               // set when the font needs to be updated
152  QImage *m_image;
153  SplashFontEngine *m_fontEngine;
154  SplashFont *m_font;           // current font
155  XRef *xref;                   // xref table for current document
156};
157
158#endif
Note: See TracBrowser for help on using the repository browser.