gui2::tcanvas Class Reference

Base class for the canvas which allows drawing, a later version may implement a cache which allows the same scripts with the same input to store their output surface. More...

#include <canvas.hpp>

Collaboration diagram for gui2::tcanvas:

Collaboration graph
[legend]

List of all members.

Public Types

typedef boost::intrusive_ptr
< tshape
tshape_ptr
typedef boost::intrusive_ptr
< const tshape
const_tshape_ptr

Public Member Functions

 tcanvas ()
 tcanvas (const config &cfg)
void draw (const config &cfg)
void draw (const bool force=false)
void set_width (const unsigned width)
unsigned get_width () const
void set_height (const unsigned height)
unsigned get_height () const
surfacesurf ()
void set_cfg (const config &cfg)
void set_variable (const std::string &key, const variant &value)

Private Member Functions

void set_dirty (const bool dirty=true)
void parse_cfg (const config &cfg)

Private Attributes

std::vector< tshape_ptrshapes_
unsigned w_
unsigned h_
surface canvas_
 The canvas we draw all items on.
game_logic::map_formula_callable variables_
bool dirty_

Classes

class  tshape
 Base class for all other shapes. More...


Detailed Description

Base class for the canvas which allows drawing, a later version may implement a cache which allows the same scripts with the same input to store their output surface.

But that will be looked into later. The copy constructor does a shallow copy of the shapes to draw. a clone() will be implemented if really needed.

Definition at line 44 of file canvas.hpp.


Member Typedef Documentation

typedef boost::intrusive_ptr<tshape> gui2::tcanvas::tshape_ptr

Definition at line 67 of file canvas.hpp.

typedef boost::intrusive_ptr<const tshape> gui2::tcanvas::const_tshape_ptr

Definition at line 68 of file canvas.hpp.


Constructor & Destructor Documentation

gui2::tcanvas::tcanvas (  ) 

Definition at line 678 of file canvas.cpp.

gui2::tcanvas::tcanvas ( const config cfg  ) 

Definition at line 688 of file canvas.cpp.

References parse_cfg().


Member Function Documentation

void gui2::tcanvas::draw ( const config cfg  ) 

Definition at line 699 of file canvas.cpp.

References parse_cfg().

void gui2::tcanvas::draw ( const bool  force = false  ) 

void gui2::tcanvas::set_width ( const unsigned  width  )  [inline]

Definition at line 76 of file canvas.hpp.

References set_dirty(), and w_.

Referenced by gui2::tcontrol::set_size().

unsigned gui2::tcanvas::get_width (  )  const [inline]

Definition at line 77 of file canvas.hpp.

References w_.

void gui2::tcanvas::set_height ( const unsigned  height  )  [inline]

Definition at line 79 of file canvas.hpp.

References h_, and set_dirty().

Referenced by gui2::tcontrol::set_size().

unsigned gui2::tcanvas::get_height (  )  const [inline]

Definition at line 80 of file canvas.hpp.

References h_.

surface& gui2::tcanvas::surf (  )  [inline]

Definition at line 82 of file canvas.hpp.

References canvas_.

void gui2::tcanvas::set_cfg ( const config cfg  )  [inline]

Definition at line 84 of file canvas.hpp.

References parse_cfg().

Referenced by gui2::tstate_definition::tstate_definition().

void gui2::tcanvas::set_variable ( const std::string &  key,
const variant value 
) [inline]

void gui2::tcanvas::set_dirty ( const bool  dirty = true  )  [inline, private]

Definition at line 90 of file canvas.hpp.

References dirty_.

Referenced by set_height(), and set_width().

void gui2::tcanvas::parse_cfg ( const config cfg  )  [private]


Member Data Documentation

std::vector<tshape_ptr> gui2::tcanvas::shapes_ [private]

Definition at line 94 of file canvas.hpp.

Referenced by draw(), and parse_cfg().

unsigned gui2::tcanvas::w_ [private]

Definition at line 96 of file canvas.hpp.

Referenced by draw(), get_width(), and set_width().

unsigned gui2::tcanvas::h_ [private]

Definition at line 97 of file canvas.hpp.

Referenced by draw(), get_height(), and set_height().

The canvas we draw all items on.

Definition at line 100 of file canvas.hpp.

Referenced by draw(), and surf().

Definition at line 102 of file canvas.hpp.

Referenced by draw(), and set_variable().

bool gui2::tcanvas::dirty_ [private]

Definition at line 104 of file canvas.hpp.

Referenced by draw(), and set_dirty().


The documentation for this class was generated from the following files:

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs