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 8 #ifndef SCREENPAINTER_H 9 #define SCREENPAINTER_H 10 11 #include <cairo.h> 12 13 #include "textlayoutpainter.h" 14 15 class ScPainter; 16 17 class ScreenPainter: public TextLayoutPainter 18 { 19 public: 20 ScreenPainter(ScPainter *p, PageItem *item); 21 22 ~ScreenPainter(); 23 24 void drawGlyph(const GlyphCluster& gc) override; 25 void drawGlyphOutline(const GlyphCluster& gc, bool fill) override; 26 void drawLine(QPointF start, QPointF end) override; 27 void drawRect(QRectF rect) override; 28 void drawObject(PageItem* embedded) override; 29 30 void clip(QRectF rect); 31 void saveState(); 32 void restoreState(); 33 34 private: 35 void setupState(bool rect); 36 37 ScPainter *m_painter; 38 PageItem *m_item; 39 TextLayoutColor m_fillColor; 40 TextLayoutColor m_strokeColor; 41 QColor m_fillQColor; 42 QColor m_fillStrokeQColor; 43 cairo_font_face_t *m_cairoFace; 44 QString m_fontPath; 45 int m_faceIndex; 46 }; 47 48 #endif // SCREENPAINTER_H 49