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

Last change on this file since 461 was 461, checked in by Silvan Scherrer, 11 years ago

poppler update to 0.14.2

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