Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

otk::RenderTexture Class Reference

#include <rendertexture.hh>

Collaboration diagram for otk::RenderTexture:

Collaboration graph
[legend]
List of all members.

Detailed Description

Superclass for all the Textures.

Definition at line 10 of file rendertexture.hh.

Public Types

enum  ReliefType { Flat, Raised, Sunken }
enum  BevelType { Bevel1, Bevel2 }
enum  GradientType {
  Solid, Horizontal, Vertical, Diagonal,
  CrossDiagonal, PipeCross, Rectangle, Pyramid,
  Elliptic
}

Public Methods

 RenderTexture (int screen, bool parent_relative, ReliefType relief, BevelType bevel, bool border, GradientType gradient, bool interlaced, const RGB &color, const RGB &secondary_color, const RGB &border_color, const RGB &interlace_color)
virtual ~RenderTexture ()
bool parentRelative () const
 If true, the texture is not rendered at all, so all options are ignored.

ReliefType relief () const
 The relief type of the texture.

BevelType bevel () const
 The way the bevel should be drawn.

bool border () const
 If a flat border is drawn on the outside, ignored for all ReliefType values except ReliefType::Flat.

GradientType gradient () const
 The type of gradient to fill the texture with (if any).

bool interlaced () const
 If interlace lines should be drawn over the texture.

const RenderColorcolor () const
 The base color for the texture, the only color when the texture is solid. This must always be defined.

const RenderColorsecondary_color () const
 The secondary color for gradient textures. This is only defined for gradients.

const RenderColorbevelDarkColor () const
 The shadow color for the bevel. This must be defined if RenderTexture::_relief is not RenderTexture::ReliefType::Flat.

const RenderColorbevelLightColor () const
 The light color for the bevel. This must be defined if RenderTexture::)relief is not RenderTexture::ReliefType::Flat.

const RenderColorborderColor () const
 The color for the flat border if RenderTexture::_border is true. This must be defined if it is true.

const RenderColorinterlaceColor () const
 The color for the interlace lines if RenderTexture. This must be defined if it is true.


Private Attributes

int _screen
bool _parent_relative
 If true, the texture is not rendered at all, so all options are ignored.

ReliefType _relief
 The relief type of the texture.

BevelType _bevel
 The way the bevel should be drawn.

bool _border
 If a flat border is drawn on the outside, ignored for all ReliefType values except ReliefType::Flat.

GradientType _gradient
 The type of gradient to fill the texture with (if any).

bool _interlaced
 If interlace lines should be drawn over the texture.

const RenderColor_color
 The base color for the texture, the only color when the texture is solid. This must always be defined.

const RenderColor_secondary_color
 The secondary color for a gradient texture. This is only defined for gradients.

const RenderColor_bevel_dark_color
 The shadow color for the bevel. This must be defined if RenderTexture::_relief is not RenderTexture::ReliefType::Flat.

const RenderColor_bevel_light_color
 The light color for the bevel. This must be defined if RenderTexture::_relief is not RenderTexture::ReliefType::Flat.

const RenderColor_border_color
 The color for the flat border if RenderTexture::_border is true. This must be defined if it is true.

const RenderColor_interlace_color
 The color for the interlace lines if RenderTexture. This must be defined if it is true.


Member Enumeration Documentation

enum otk::RenderTexture::BevelType
 

Enumeration values:
Bevel1 
Bevel2 

Definition at line 17 of file rendertexture.hh.

Referenced by bevel().

00017                  {
00018     Bevel1,
00019     Bevel2
00020   };

enum otk::RenderTexture::GradientType
 

Enumeration values:
Solid 
Horizontal 
Vertical 
Diagonal 
CrossDiagonal 
PipeCross 
Rectangle 
Pyramid 
Elliptic 

Definition at line 21 of file rendertexture.hh.

Referenced by gradient().

00021                     {
00022     Solid,
00023     Horizontal,
00024     Vertical,
00025     Diagonal,
00026     CrossDiagonal,
00027     PipeCross,
00028     Rectangle,
00029     Pyramid,
00030     Elliptic
00031   };

enum otk::RenderTexture::ReliefType
 

Enumeration values:
Flat 
Raised 
Sunken 

Definition at line 12 of file rendertexture.hh.

Referenced by relief().

00012                   {
00013     Flat,
00014     Raised,
00015     Sunken
00016   };


Constructor & Destructor Documentation

otk::RenderTexture::RenderTexture int    screen,
bool    parent_relative,
ReliefType    relief,
BevelType    bevel,
bool    border,
GradientType    gradient,
bool    interlaced,
const RGB   color,
const RGB   secondary_color,
const RGB   border_color,
const RGB   interlace_color
[inline]
 

Definition at line 70 of file rendertexture.hh.

References otk::RenderColor::blue(), Flat, otk::RenderColor::green(), and otk::RenderColor::red().

00077     : _screen(screen),
00078       _parent_relative(parent_relative),
00079       _relief(relief),
00080       _bevel(bevel),
00081       _border(border),
00082       _gradient(gradient),
00083       _interlaced(interlaced),
00084       _color(new RenderColor(screen, color)),
00085       _secondary_color(new RenderColor(screen, secondary_color)),
00086       _bevel_dark_color(0),
00087       _bevel_light_color(0),
00088       _border_color(new RenderColor(screen, border_color)),
00089       _interlace_color(new RenderColor(screen, interlace_color))
00090   {
00091     if (_relief != Flat) {
00092       unsigned char r, g, b;
00093 
00094       // calculate the light bevel color
00095       r = _color->red() + _color->red() / 2;
00096       g = _color->green() + _color->green() / 2;
00097       b = _color->blue() + _color->blue() / 2;
00098       // watch for wraparound
00099       if (r < _color->red()) r = 0xff;
00100       if (g < _color->green()) g = 0xff;
00101       if (b < _color->blue()) b = 0xff;
00102       _bevel_dark_color = new RenderColor(screen, r, g, b);
00103       
00104       // calculate the dark bevel color
00105       r = _color->red() / 4 + _color->red() / 2;
00106       g = _color->green() / 4 + _color->green() / 2;
00107       b = _color->blue() / 4 + _color->blue() / 2;
00108       _bevel_light_color = new RenderColor(screen, r, g, b);
00109     }
00110     
00111     assert(_relief == Flat || (_bevel_dark_color && _bevel_light_color));
00112     //assert(!_border || _border_color);
00113     //assert(!_interlaced || _interlace_color);
00114     assert(_color);
00115     assert(_secondary_color);
00116     assert(_border_color);
00117     assert(_interlace_color);
00118   }

virtual otk::RenderTexture::~RenderTexture   [inline, virtual]
 

Definition at line 120 of file rendertexture.hh.

00120                            {
00121     delete _color;
00122     delete _secondary_color;
00123     if (_bevel_dark_color) delete _bevel_dark_color;
00124     if (_bevel_dark_color) delete _bevel_light_color;
00125     delete _border_color;
00126     delete _interlace_color;
00127   }


Member Function Documentation

BevelType otk::RenderTexture::bevel   const [inline]
 

The way the bevel should be drawn.

Definition at line 134 of file rendertexture.hh.

References BevelType.

Referenced by otk::TrueRenderControl::drawGradientBackground(), and otk::RenderControl::drawSolidBackground().

00134 { return _bevel; }

const RenderColor& otk::RenderTexture::bevelDarkColor   const [inline]
 

The shadow color for the bevel. This must be defined if RenderTexture::_relief is not RenderTexture::ReliefType::Flat.

Definition at line 152 of file rendertexture.hh.

Referenced by otk::RenderControl::drawSolidBackground().

00153     { return *_bevel_dark_color; }

const RenderColor& otk::RenderTexture::bevelLightColor   const [inline]
 

The light color for the bevel. This must be defined if RenderTexture::)relief is not RenderTexture::ReliefType::Flat.

Definition at line 156 of file rendertexture.hh.

Referenced by otk::RenderControl::drawSolidBackground().

00157     { return *_bevel_light_color; }

bool otk::RenderTexture::border   const [inline]
 

If a flat border is drawn on the outside, ignored for all ReliefType values except ReliefType::Flat.

Definition at line 137 of file rendertexture.hh.

Referenced by otk::TrueRenderControl::drawGradientBackground(), and otk::RenderControl::drawSolidBackground().

00137 { return _border; }

const RenderColor& otk::RenderTexture::borderColor   const [inline]
 

The color for the flat border if RenderTexture::_border is true. This must be defined if it is true.

Definition at line 160 of file rendertexture.hh.

Referenced by otk::TrueRenderControl::drawGradientBackground(), and otk::RenderControl::drawSolidBackground().

00160 { return *_border_color; }

const RenderColor& otk::RenderTexture::color   const [inline]
 

The base color for the texture, the only color when the texture is solid. This must always be defined.

Definition at line 145 of file rendertexture.hh.

Referenced by otk::TrueRenderControl::crossDiagonalGradient(), otk::TrueRenderControl::diagonalGradient(), otk::TrueRenderControl::drawBackground(), otk::PseudoRenderControl::drawBackground(), otk::RenderControl::drawSolidBackground(), and otk::TrueRenderControl::verticalGradient().

00145 { return *_color; }

GradientType otk::RenderTexture::gradient   const [inline]
 

The type of gradient to fill the texture with (if any).

Definition at line 139 of file rendertexture.hh.

References GradientType.

Referenced by otk::TrueRenderControl::drawBackground(), and otk::TrueRenderControl::drawGradientBackground().

00139 { return _gradient; }

const RenderColor& otk::RenderTexture::interlaceColor   const [inline]
 

The color for the interlace lines if RenderTexture. This must be defined if it is true.

Definition at line 163 of file rendertexture.hh.

Referenced by otk::RenderControl::drawSolidBackground().

00164     { return *_interlace_color; }

bool otk::RenderTexture::interlaced   const [inline]
 

If interlace lines should be drawn over the texture.

Definition at line 141 of file rendertexture.hh.

Referenced by otk::RenderControl::drawSolidBackground().

00141 { return _interlaced; }

bool otk::RenderTexture::parentRelative   const [inline]
 

If true, the texture is not rendered at all, so all options are ignored.

Definition at line 130 of file rendertexture.hh.

Referenced by otk::RenderControl::drawSolidBackground().

00130 { return _parent_relative; }

ReliefType otk::RenderTexture::relief   const [inline]
 

The relief type of the texture.

Definition at line 132 of file rendertexture.hh.

References ReliefType.

Referenced by otk::TrueRenderControl::drawGradientBackground(), and otk::RenderControl::drawSolidBackground().

00132 { return _relief; }

const RenderColor& otk::RenderTexture::secondary_color   const [inline]
 

The secondary color for gradient textures. This is only defined for gradients.

Definition at line 148 of file rendertexture.hh.

Referenced by otk::TrueRenderControl::crossDiagonalGradient(), otk::TrueRenderControl::diagonalGradient(), and otk::TrueRenderControl::verticalGradient().

00149     { return *_secondary_color; }


Member Data Documentation

BevelType otk::RenderTexture::_bevel [private]
 

The way the bevel should be drawn.

Definition at line 41 of file rendertexture.hh.

const RenderColor* otk::RenderTexture::_bevel_dark_color [private]
 

The shadow color for the bevel. This must be defined if RenderTexture::_relief is not RenderTexture::ReliefType::Flat.

Definition at line 58 of file rendertexture.hh.

const RenderColor* otk::RenderTexture::_bevel_light_color [private]
 

The light color for the bevel. This must be defined if RenderTexture::_relief is not RenderTexture::ReliefType::Flat.

Definition at line 61 of file rendertexture.hh.

bool otk::RenderTexture::_border [private]
 

If a flat border is drawn on the outside, ignored for all ReliefType values except ReliefType::Flat.

Definition at line 44 of file rendertexture.hh.

const RenderColor* otk::RenderTexture::_border_color [private]
 

The color for the flat border if RenderTexture::_border is true. This must be defined if it is true.

Definition at line 64 of file rendertexture.hh.

const RenderColor* otk::RenderTexture::_color [private]
 

The base color for the texture, the only color when the texture is solid. This must always be defined.

Definition at line 52 of file rendertexture.hh.

GradientType otk::RenderTexture::_gradient [private]
 

The type of gradient to fill the texture with (if any).

Definition at line 46 of file rendertexture.hh.

const RenderColor* otk::RenderTexture::_interlace_color [private]
 

The color for the interlace lines if RenderTexture. This must be defined if it is true.

Definition at line 67 of file rendertexture.hh.

bool otk::RenderTexture::_interlaced [private]
 

If interlace lines should be drawn over the texture.

Definition at line 48 of file rendertexture.hh.

bool otk::RenderTexture::_parent_relative [private]
 

If true, the texture is not rendered at all, so all options are ignored.

Definition at line 37 of file rendertexture.hh.

ReliefType otk::RenderTexture::_relief [private]
 

The relief type of the texture.

Definition at line 39 of file rendertexture.hh.

int otk::RenderTexture::_screen [private]
 

Definition at line 34 of file rendertexture.hh.

const RenderColor* otk::RenderTexture::_secondary_color [private]
 

The secondary color for a gradient texture. This is only defined for gradients.

Definition at line 55 of file rendertexture.hh.


The documentation for this class was generated from the following file:
Generated on Tue Feb 4 23:00:29 2003 for Openbox by doxygen1.3-rc2