]>
Dogcows Code - chaz/openbox/blob - otk/rendertexture.hh
df38ddf679229415f2d5901876ccdd52a78dc87e
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2 #ifndef __rendertexture_hh
3 #define __rendertexture_hh
5 #include "rendercolor.hh"
9 //! Superclass for all the Textures
34 //! If true, the texture is not rendered at all, so all options are ignored
35 bool _parent_relative
;
36 //! The relief type of the texture
38 //! The way the bevel should be drawn
40 //! If a flat border is drawn on the outside, ignored for all ReliefType
41 //! values except ReliefType::Flat
43 //! The type of gradient to fill the texture with (if any)
44 GradientType _gradient
;
45 //! If interlace lines should be drawn over the texture
48 //! The base color for the texture, the only color when the texture is solid.
49 //! This must always be defined
50 const RenderColor
*_color
;
51 //! The secondary color for a gradient texture.
52 //! This is only defined for gradients
53 const RenderColor
*_secondary_color
;
54 //! The shadow color for the bevel. This must be defined if
55 //! RenderTexture::_relief is not RenderTexture::ReliefType::Flat
56 const RenderColor
*_bevel_dark_color
;
57 //! The light color for the bevel. This must be defined if
58 //! RenderTexture::_relief is not RenderTexture::ReliefType::Flat
59 const RenderColor
*_bevel_light_color
;
60 //! The color for the flat border if RenderTexture::_border is true. This
61 //! must be defined if it is true
62 const RenderColor
*_border_color
;
63 //! The color for the interlace lines if RenderTexture. This must be defined
65 const RenderColor
*_interlace_color
;
68 RenderTexture(bool parent_relative
, ReliefType relief
, BevelType bevel
,
69 bool border
, GradientType gradient
, bool interlaced
,
70 const RenderColor
*color
, const RenderColor
*secondary_color
,
71 const RenderColor
*bevel_dark_color
,
72 const RenderColor
*bevel_light_color
,
73 const RenderColor
*border_color
,
74 const RenderColor
*interlace_color
)
75 : _parent_relative(parent_relative
),
80 _interlaced(interlaced
),
82 _secondary_color(secondary_color
),
83 _bevel_dark_color(bevel_dark_color
),
84 _bevel_light_color(bevel_light_color
),
85 _border_color(border_color
),
86 _interlace_color(interlace_color
)
88 assert(_relief
== Flat
|| (_bevel_dark_color
&& _bevel_light_color
));
89 assert(!_border
|| _border_color
);
90 assert(!_interlaced
|| _interlace_color
);
94 //! If true, the texture is not rendered at all, so all options are ignored
95 inline bool parentRelative() const { return _parent_relative
; }
96 //! The relief type of the texture
97 inline ReliefType
relief() const { return _relief
; }
98 //! The way the bevel should be drawn
99 inline BevelType
bevel() const { return _bevel
; }
100 //! If a flat border is drawn on the outside, ignored for all ReliefType
101 //! values except ReliefType::Flat
102 inline bool border() const { return _border
; }
103 //! The type of gradient to fill the texture with (if any)
104 inline GradientType
gradient() const { return _gradient
; }
105 //! If interlace lines should be drawn over the texture
106 inline bool interlaced() const { return _interlaced
; }
108 //! The base color for the texture, the only color when the texture is solid.
109 //! This must always be defined
110 inline const RenderColor
& color() const { return *_color
; }
111 //! The secondary color for gradient textures.
112 //! This is only defined for gradients
113 inline const RenderColor
& secondary_color() const
114 { return *_secondary_color
; }
115 //! The shadow color for the bevel. This must be defined if
116 //! RenderTexture::_relief is not RenderTexture::ReliefType::Flat
117 inline const RenderColor
& bevelDarkColor() const
118 { return *_bevel_dark_color
; }
119 //! The light color for the bevel. This must be defined if
120 //! RenderTexture::)relief is not RenderTexture::ReliefType::Flat
121 inline const RenderColor
& bevelLightColor() const
122 { return *_bevel_light_color
; }
123 //! The color for the flat border if RenderTexture::_border is true. This
124 //! must be defined if it is true
125 inline const RenderColor
& borderColor() const { return *_border_color
; }
126 //! The color for the interlace lines if RenderTexture. This must be defined
128 inline const RenderColor
& interlaceColor() const
129 { return *_interlace_color
; }
134 #endif // __rendertexture_hh
This page took 0.039319 seconds and 3 git commands to generate.