Scribus
Open source desktop publishing at your fingertips
scimgdataloader_pict.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 #ifndef SCIMGDATALOADER_PICT_H
8 #define SCIMGDATALOADER_PICT_H
9 
10 #include "scimgdataloader.h"
11 #include <QList>
12 #include <QTransform>
13 #include <QMultiMap>
14 #include <QtGlobal>
15 #include <QObject>
16 #include <QString>
17 #include <QRect>
18 #include <QPainter>
19 #include <QPainterPath>
20 
22 {
23 protected:
24 
25  void initSupportedFormatList();
26 
27 public:
29 
30  virtual bool preloadAlphaChannel(const QString& fn, int page, int res, bool& hasAlpha);
31  virtual void loadEmbeddedProfile(const QString& fn, int page = 0);
32  virtual bool loadPicture(const QString& fn, int page, int res, bool thumbnail);
33 
34 private:
35  void parseHeader(QString fName, double &x, double &y, double &w, double &h);
36  void parsePict(QDataStream &ts);
37  void alignStreamToWord(QDataStream &ts, uint len);
38  void handleColor(QDataStream &ts, bool back);
39  void handleColorRGB(QDataStream &ts, bool back);
40  void handlePenPattern(QDataStream &ts);
41  void handlePolygon(QDataStream &ts, quint16 opCode);
42  void handleShape(QDataStream &ts, quint16 opCode);
43  void handleSameShape(QDataStream &ts, quint16 opCode);
44  void handleFontName(QDataStream &ts);
45  void handleTextSize(QDataStream &ts);
46  void handleTextFont(QDataStream &ts);
47  void handleTextStyle(QDataStream &ts);
48  void handleTextMode(QDataStream &ts);
49  void handleLongText(QDataStream &ts);
50  void handleDHText(QDataStream &ts);
51  void handleDVText(QDataStream &ts);
52  void handleDHVText(QDataStream &ts);
53  void createTextPath(QByteArray textString);
54  void handlePenMode(QDataStream &ts);
55  void handlePenSize(QDataStream &ts);
56  void handleOvalSize(QDataStream &ts);
57  void handleShortLine(QDataStream &ts);
58  void handleShortLineFrom(QDataStream &ts);
59  void handleLine(QDataStream &ts);
60  void handleLineFrom(QDataStream &ts);
61  void handlePixmap(QDataStream &ts, quint16 opCode);
62  void handleQuickTime(QDataStream &ts, quint16 opCode);
63  void handleComment(QDataStream &ts, bool longComment);
64  QRect readRect(QDataStream &ts);
65  QByteArray decodeRLE(QByteArray &in, quint16 bytesPerLine, int twoByte);
66  QBrush setFillPattern();
67 
68  int baseX, baseY;
69  int docWidth;
70  int docHeight;
71  double resX, resY;
72 
73  double LineW;
74  QColor backColor;
75  QColor foreColor;
76  bool patternMode;
77  QByteArray patternData;
78  QRect currRect;
79  QBrush currPatternBrush;
80  QRect lastImageRect;
81  QPoint ovalSize;
82  QMap<int, QString> fontMap;
83  int currentTextSize;
84  int currentFontID;
85  int currentFontStyle;
86  QByteArray imageData;
87 
88  QPainterPath Coords;
89  QPoint currentPoint;
90  QPoint currentPointT;
91  QPainter imagePainter;
92  bool postscriptMode;
93  bool textIsPostScript;
94  int pctVersion;
95  bool skipOpcode;
96 };
97 
98 #endif
Definition: scimgdataloader.h:19
Definition: scimgdataloader_pict.h:21