11 #define TYPE(t) ((t)<<16)
12 #define SUBTYPE(t, s) (((t)<<16)|(s))
26 Polygon() : _brush(Qt::NoBrush
), _pen(Qt::NoPen
) {}
27 Polygon(const QBrush
&brush
, const QPen
&pen
= Qt::NoPen
)
30 _pen
= (pen
== Qt::NoPen
) ? QPen(_brush
, 0) : pen
;
32 Polygon(const QImage
&img
)
33 : _brush(Qt::NoBrush
), _pen(Qt::NoPen
), _img(img
.convertToFormat(
34 QImage::Format_ARGB32_Premultiplied
)) {}
36 const QPen
&pen() const {return _pen
;}
37 const QBrush
&brush() const {return _brush
;}
38 const QImage
&img() const {return _img
;}
48 Line() : _pen(Qt::NoPen
), _textFontSize(None
) {}
49 Line(const QPen
&pen
) : _pen(pen
), _textFontSize(None
) {}
50 Line(const QImage
&img
)
51 : _pen(Qt::NoPen
), _textFontSize(None
), _img(img
.convertToFormat(
52 QImage::Format_ARGB32_Premultiplied
)) {}
54 void setTextColor(const QColor
&color
) {_textColor
= color
;}
55 void setTextFontSize(FontSize size
) {_textFontSize
= size
;}
57 const QPen
&pen() const {return _pen
;}
58 const QColor
&textColor() const {return _textColor
;}
59 FontSize
textFontSize() const {return _textFontSize
;}
60 const QImage
&img() const {return _img
;}
65 FontSize _textFontSize
;
71 Point() : _textColor(Qt::black
), _textFontSize(Normal
) {}
72 Point(const QImage
&img
, FontSize fontSize
= Normal
)
73 : _textColor(Qt::black
), _textFontSize(fontSize
), _img(img
) {}
75 void setTextColor(const QColor
&color
) {_textColor
= color
;}
76 void setTextFontSize(FontSize size
) {_textFontSize
= size
;}
78 const QColor
&textColor() const {return _textColor
;}
79 FontSize
textFontSize() const {return _textFontSize
;}
80 const QImage
&img() const {return _img
;}
84 FontSize _textFontSize
;
90 const Line
&line(uint type
) const;
91 const Polygon
&polygon(uint type
) const;
92 const Point
&point(quint32 type
) const;
93 const QVector
<uint
> &drawOrder() const {return _drawOrder
;}
95 static bool isSounding(quint32 type
)
96 {return type
== TYPE(SOUNDG
);}
99 void defaultPolygonStyle();
100 void defaultLineStyle();
101 void defaultPointStyle();
103 QMap
<uint
, Line
> _lines
;
104 QMap
<uint
, Polygon
> _polygons
;
105 QMap
<uint
, Point
> _points
;
106 QVector
<uint
> _drawOrder
;
111 #endif // ENC_STYLE_H