00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef QOUTPUTDEV_H
00011 #define QOUTPUTDEV_H
00012
00013 #ifdef __GNUC__
00014 #pragma interface
00015 #endif
00016
00017 #include "aconf.h"
00018 #include <stddef.h>
00019
00020 #include <qscrollview.h>
00021
00022 class Object;
00023
00024 #include "config.h"
00025 #include "CharTypes.h"
00026 #include "GlobalParams.h"
00027 #include "OutputDev.h"
00028
00029 class GString;
00030 class GList;
00031 struct GfxRGB;
00032 class GfxFont;
00033 class GfxSubpath;
00034 class TextPage;
00035 class XOutputFontCache;
00036 class Link;
00037 class Catalog;
00038 class DisplayFontParam;
00039 class UnicodeMap;
00040 class CharCodeToUnicode;
00041
00042
00043 class QPainter;
00044 class QPixmap;
00045 class QPointArray;
00046
00047
00048 typedef fouble fp_t;
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 class QOutputDev : public QScrollView, public OutputDev {
00065 Q_OBJECT
00066
00067 public:
00068
00069
00070 QOutputDev( QWidget *parent = 0, const char *name = 0, int flags = 0 );
00071
00072
00073 virtual ~QOutputDev();
00074
00075
00076
00077
00078
00079 virtual GBool upsideDown() { return gTrue; }
00080
00081
00082 virtual GBool useDrawChar() { return gTrue; }
00083
00084
00085
00086 virtual GBool interpretType3Chars() { return gFalse; }
00087
00088
00089 virtual GBool needNonText() { return gFalse; }
00090
00091
00092
00093
00094 virtual void startPage(int pageNum, GfxState *state);
00095
00096
00097 virtual void endPage();
00098
00099
00100 virtual void drawLink(Link *link, Catalog *catalog);
00101
00102
00103 virtual void saveState(GfxState *state);
00104 virtual void restoreState(GfxState *state);
00105
00106
00107 virtual void updateAll(GfxState *state);
00108 virtual void updateCTM(GfxState *state, fp_t m11, fp_t m12,
00109 fp_t m21, fp_t m22, fp_t m31, fp_t m32);
00110 virtual void updateLineDash(GfxState *state);
00111 virtual void updateFlatness(GfxState *state);
00112 virtual void updateLineJoin(GfxState *state);
00113 virtual void updateLineCap(GfxState *state);
00114 virtual void updateMiterLimit(GfxState *state);
00115 virtual void updateLineWidth(GfxState *state);
00116 virtual void updateFillColor(GfxState *state);
00117 virtual void updateStrokeColor(GfxState *state);
00118
00119
00120 virtual void updateFont(GfxState *state);
00121
00122
00123 virtual void stroke(GfxState *state);
00124 virtual void fill(GfxState *state);
00125 virtual void eoFill(GfxState *state);
00126
00127
00128 virtual void clip(GfxState *state);
00129 virtual void eoClip(GfxState *state);
00130
00131
00132 virtual void beginString(GfxState *state, GString *s);
00133 virtual void endString(GfxState *state);
00134 virtual void drawChar(GfxState *state, fp_t x, fp_t y,
00135 fp_t dx, fp_t dy,
00136 fp_t originX, fp_t originY,
00137 CharCode code, Unicode *u, int uLen);
00138
00139
00140 virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
00141 int width, int height, GBool invert,
00142 GBool inlineImg);
00143 virtual void drawImage(GfxState *state, Object *ref, Stream *str,
00144 int width, int height, GfxImageColorMap *colorMap,
00145 int *maskColors, GBool inlineImg);
00146
00147
00148
00149
00150
00151
00152 GBool findText ( Unicode *s, int len, GBool top, GBool bottom, int *xMin, int *yMin, int *xMax, int *yMax );
00153
00154
00155
00156 bool findText ( const QString &str, int &l, int &t, int &w, int &h, bool top = 0, bool bottom = 0 );
00157 bool findText ( const QString &str, QRect &r, bool top = 0, bool bottom = 0 );
00158
00159
00160 QString getText ( int left, int top, int width, int height );
00161 QString getText ( const QRect &r );
00162
00163 protected:
00164 virtual void drawContents ( QPainter *p, int, int, int, int );
00165
00166 private:
00167 QPixmap *m_pixmap;
00168 QPainter *m_painter;
00169
00170 TextPage *m_text;
00171
00172 private:
00173 QFont matchFont ( GfxFont *, fp_t m11, fp_t m12, fp_t m21, fp_t m22 );
00174
00175 void updateLineAttrs ( GfxState *state, GBool updateDash );
00176 void doFill ( GfxState *state, bool winding );
00177 void doClip ( GfxState *state, bool winding );
00178 int convertPath ( GfxState *state, QPointArray &points, QArray<int> &lengths );
00179 int convertSubpath ( GfxState *state, GfxSubpath *subpath, QPointArray &points );
00180 };
00181
00182 #endif