root/middleware-offline/trunk/_src/eidmw/pteid-poppler/poppler/ArthurOutputDev.h @ 226

Revision 226, 5.4 KB (checked in by vsilva, 8 years ago)

Improve PDF native Signature

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