Scribus
Open source desktop publishing at your fingertips
scimgdataloader_wpg.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_WPG_H
8 #define SCIMGDATALOADER_WPG_H
9 
10 #include "scimgdataloader.h"
11 
12 #include <QtGlobal>
13 #include <QObject>
14 #include <QString>
15 #include <QLinearGradient>
16 
17 #include <QList>
18 #include <QTransform>
19 #include <QMultiMap>
20 #include <QPainter>
21 #include <QPainterPath>
22 #include "third_party/wpg/libwpg.h"
23 
24 
26 {
27 public:
28  ScrPainterIm();
29 
30  void startGraphics(double imageWidth, double imageHeight);
31  void endGraphics();
32  void startLayer(unsigned int id);
33  void endLayer(unsigned int id);
34  void setPen(const libwpg::WPGPen& pen);
35  void setBrush(const libwpg::WPGBrush& brush);
36  void setFillRule(FillRule rule);
37  void drawRectangle(const libwpg::WPGRect& rect, double rx, double ry);
38  void drawEllipse(const libwpg::WPGPoint& center, double rx, double ry);
39  void drawPolygon(const libwpg::WPGPointArray& vertices, bool closed);
40  void drawPath(const libwpg::WPGPath& path);
41  void drawBitmap(const libwpg::WPGBitmap& bitmap, double hres, double vres);
42  void drawImageObject(const libwpg::WPGBinaryData& binaryData);
43 
44  QPainterPath Coords;
45  QPainter imagePainter;
46  QPen currentPen;
47  QBrush currentBrush;
48  bool fillrule;
49  double gradientAngle;
50  bool isGradient;
51  bool fillSet;
52  bool strokeSet;
53  QLinearGradient currentGradient;
54  QImage *image;
55 };
56 
58 {
59 protected:
60 
61  void initSupportedFormatList();
62 
63 public:
64  ScImgDataLoader_WPG(void);
65 
66  virtual bool preloadAlphaChannel(const QString& fn, int page, int res, bool& hasAlpha);
67  virtual void loadEmbeddedProfile(const QString& fn, int page = 0);
68  virtual bool loadPicture(const QString& fn, int page, int res, bool thumbnail);
69 };
70 #endif
Definition: scimgdataloader.h:19
Definition: WPGBitmap.h:37
Definition: WPGPoint.h:34
Definition: WPGPath.h:55
Definition: WPGBinaryData.h:39
Definition: WPGPaintInterface.h:41
Definition: scimgdataloader_wpg.h:57
Definition: WPGBrush.h:35
Definition: WPGPen.h:51
Definition: WPGPoint.h:51
Definition: WPGRect.h:34
Definition: scimgdataloader_wpg.h:25