Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals

Ars::Painter Class Reference

Painter objects take care of all the actual drawing functions needed to draw to an SDL surface. More...

#include <arspaint.h>

Inheritance diagram for Ars::Painter:

Inheritance graph
[legend]
Collaboration diagram for Ars::Painter:

Collaboration graph
[legend]

Public Member Functions

 Painter (void)
virtual ~Painter (void)
 Standard deconstructor.

virtual void Init (icstring &aStr)
void SetTextAlign (const int vAlign, const int hAlign=-1)
virtual const unsigned long GetStates (void) const

Detailed Description

Painter objects take care of all the actual drawing functions needed to draw to an SDL surface.

Definition at line 177 of file arspaint.h.


Constructor & Destructor Documentation

Ars::Painter::Painter void   ) 
 

Construct a new Painter object

Parameters:
pSurface A pointer to the SDL surface to draw to
ePaintMode The painting mode to use, defaults to PAINT_NORMAL

Definition at line 575 of file arspaint.cpp.

00576 {
00577 }

virtual Ars::Painter::~Painter void   )  [inline, virtual]
 

Standard deconstructor.

Definition at line 186 of file arspaint.h.

00186 { }


Member Function Documentation

virtual const unsigned long Ars::Painter::GetStates void   )  const [inline, virtual]
 

Reimplemented from Ars::Thing.

Definition at line 207 of file arspaint.h.

Referenced by Ars::XLabel::AdjustColors(), Ars::XGroupBox::Draw(), Ars::XCheckBox::Draw(), Ars::XButtonImage::Draw(), Ars::XBox::Draw(), Ars::Window::DrawBG(), Ars::XButton::evMouseButtonDown(), Ars::Window::evMouseButtonDown(), Ars::XButton::evMouseButtonUp(), Ars::Window::evMouseButtonUp(), Ars::XCheckBox::evMouseLClick(), and Ars::XLabel::RestoreColors().

00207 {       return Thing::GetStates();      }

void Ars::Painter::Init icstring aStr  )  [virtual]
 

Initialize the thing object via a string the CAR identifiers used are: fontid: font identifier of the font.cfg file (default is 0) fonth: font height in pixels (default is 12)

Reimplemented from Ars::Thing.

Reimplemented in Ars::Window, Ars::XButtonImage, Ars::XDropDown, Ars::XImage, Ars::XListBox, Ars::XMPEG, Ars::XProgress, Ars::XScrollBar, and Ars::XTextBox.

Definition at line 579 of file arspaint.cpp.

References Cfg::GetCfg(), Cfg::Handler::GetCfgFile(), Cfg::Handler::GetCfgString(), Ars::FontEngine::GetFontFilename(), icstring, and Ars::HPaint::m_pFontEngine.

00580 {
00581         Cfg::Handler &h = Cfg::GetCfg();
00582 
00583         //      Font Id and Font height...
00584         icstring tmp = Rsrc::FindCrdOf( aStr , "fontid" );
00585         int     fid = Rsrc::GetInt( tmp );
00586         tmp     = Rsrc::FindCrdOf( aStr , "fonth" );
00587         int     fh = Rsrc::GetInt( tmp );
00588 
00589         if( fid >= 0 || fh >= 0 )
00590         {
00591                 string  fntName = m_pFontEngine->GetFontFilename();
00592 
00593                 if( fid >= 0 )
00594                 {
00595                         char    tmp[20];
00596                         sprintf( tmp , "Font%d" , fid );
00597                         Cfg::Handler    &fnt = Cfg::GetCfg( h.GetCfgString( "Paths" , "Fonts" ) );
00598                         fntName = fnt.GetCfgFile( "" , tmp );
00599                 }
00600 
00601                 if( fh < 0 )
00602                         m_pFontEngine = ArsApplication::GetInstance()->GetFontEngine( fntName );
00603                 else
00604                         m_pFontEngine = ArsApplication::GetInstance()->GetFontEngine( fntName , fh );
00605         }
00606 
00607         Thing::Init( aStr );
00608 }

void Ars::Painter::SetTextAlign const int  vAlign,
const int  hAlign = -1
[inline]
 

Reimplemented from Ars::HPaint.

Definition at line 194 of file arspaint.h.

References HALIGN_MASK, Ars::Thing::ResetState(), Ars::Thing::SetState(), and VALIGN_MASK.

00195         {       
00196                 if( vAlign != -1 )
00197                 {
00198                         ResetState( VALIGN_MASK );
00199                         SetState( vAlign );
00200                 }
00201                 if( hAlign != -1 )
00202                 {
00203                         ResetState( HALIGN_MASK );
00204                         SetState( hAlign );
00205                 }
00206         }


The documentation for this class was generated from the following files:
Generated on Fri Dec 5 04:06:47 2003 for Borqueror by doxygen 1.3.3