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 //! If a flat border is drawn on the outside, ignored for all ReliefType
39 //! values except ReliefType::Flat
41 //! The type of gradient to fill the texture with (if any)
42 GradientType _gradient;
43 //! If interlace lines should be drawn over the texture
46 //! The base color for the texture, the only color when the texture is solid.
47 //! This must always be defined
48 const RenderColor *_color;
49 //! The shadow color for the bevel. This must be defined if
50 //! RenderTexture::relief is not RenderTexture::ReliefType::Flat
51 const RenderColor *_bevel_dark_color;
52 //! The light color for the bevel. This must be defined if
53 //! RenderTexture::relief is not RenderTexture::ReliefType::Flat
54 const RenderColor *_bevel_light_color;
55 //! The color for the flat border if RenderTexture::border is true. This must
56 //! be defined if it is true
57 const RenderColor *_border_color;
60 RenderTexture(bool parent_relative, ReliefType relief, bool border,
61 GradientType gradient, bool interlaced,
62 const RenderColor *color, const RenderColor *bevel_dark_color,
63 const RenderColor *bevel_light_color,
64 const RenderColor *border_color)
65 : _parent_relative(parent_relative),
69 _interlaced(interlaced),
71 _bevel_dark_color(bevel_dark_color),
72 _bevel_light_color(bevel_light_color),
73 _border_color(border_color)
75 assert(_relief == Flat || (_bevel_dark_color && _bevel_light_color));
76 assert(!_border || _border_color);
80 //! If true, the texture is not rendered at all, so all options are ignored
81 inline bool parentRelative() const { return _parent_relative; }
82 //! The relief type of the texture
83 inline ReliefType relief() const { return _relief; }
84 //! If a flat border is drawn on the outside, ignored for all ReliefType
85 //! values except ReliefType::Flat
86 inline bool border() const { return _border; }
87 //! The type of gradient to fill the texture with (if any)
88 inline GradientType gradient() const { return _gradient; }
89 //! If interlace lines should be drawn over the texture
90 inline bool interlaced() const { return _interlaced; }
92 //! The base color for the texture, the only color when the texture is solid.
93 //! This must always be defined
94 inline const RenderColor& color() const { return *_color; }
95 //! The shadow color for the bevel. This must be defined if
96 //! RenderTexture::relief is not RenderTexture::ReliefType::Flat
97 inline const RenderColor& bevelDarkColor() const
98 { return *_bevel_dark_color; }
99 //! The light color for the bevel. This must be defined if
100 //! RenderTexture::relief is not RenderTexture::ReliefType::Flat
101 inline const RenderColor& bevelLightColor() const
102 { return *_bevel_light_color; }
103 //! The color for the flat border if RenderTexture::border is true. This must
104 //! be defined if it is true
105 inline const RenderColor& borderColor() const { return *_border_color; }
110 #endif // __rendertexture_hh