aedApp Class Reference

The application class. More...

#include <aedApp.h>

Collaboration diagram for aedApp:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 aedApp ()
 The default constructor.
 ~aedApp ()
aedFontrequestFont (std::string name, Uint8 size, int style=AED_FONT_STYLE_NORMAL)
 Search global font cache for the specified font.
void addFontPath (std::string path)
 Add font path to the list of paths which will be used for searching fonts.
void addMemoryFont (std::string name, unsigned char *data, unsigned long int size)
 Register a memory font for use by aedGUI.
void dumpFontPaths ()
 Dump all font paths to std::cerr.
void setDefaultFontName (std::string name)
 Set the default font name.
std::string getDefaultFontName () const
 Return the default font name.
void setRoot (aedWidget *w)
 Set the application's root widget.
aedWidgetgetRoot () const
 Get the root widget.
aedLoggetLog () const
aedThemeloadTheme (std::string file)
 Load a theme plugin.
void unloadTheme (aedTheme *theme)
 Unload the theme and free all resources allocated to it.
aedThemegetDefaultTheme () const
 Return a pointer to the default theme.
aedWidgetgetFocusWidget () const
 Return a pointer to the widget that has focus.
void setFocusWidget (aedWidget *win)
 Set focus.
void setOkayButton (aedButton *button)
 Handle okay and cancel buttons.
void setCancelButton (aedButton *button)
aedButtongetOkayButton ()
aedButtongetCancelButton ()
void clickOkayButton ()
void clickCancelButton ()
void setUTF8 (bool enable)
 Enable or disable UTF8 text rendering.
bool getUTF8 () const

Private Member Functions

std::string tryFontPath (std::string path, std::string name)

Private Attributes

std::vector< aedFontEntrym_Fonts
std::vector< aedMemFontEntrym_MemFonts
std::vector< std::string > m_FontPaths
std::vector< aedThemeEntrym_Themes
std::string m_DefaultFontName
aedWidgetm_Root
aedWidgetm_FocusWidget
aedButtonm_okayButton
aedButtonm_cancelButton
bool m_UTF8

Detailed Description

The application class.

The aedApp class enables you to load custom themes and use memory fonts, set the application's root widget, modify aedGUI's logging behaviour etc. You have to create only one object of this class and it must happen before any widgets are created.


Constructor & Destructor Documentation

aedApp::aedApp (  ) 

The default constructor.

aedApp::~aedApp (  ) 


Member Function Documentation

void aedApp::addFontPath ( std::string  path  ) 

Add font path to the list of paths which will be used for searching fonts.

Parameters:
path path to the font files
See also:
requestFont

void aedApp::addMemoryFont ( std::string  name,
unsigned char *  data,
unsigned long int  size 
)

Register a memory font for use by aedGUI.

Parameters:
name name under which the font will be known
data pointer to the font data
size size of the font data

void aedApp::clickCancelButton (  ) 

void aedApp::clickOkayButton (  ) 

void aedApp::dumpFontPaths (  ) 

Dump all font paths to std::cerr.

aedButton* aedApp::getCancelButton (  )  [inline]

std::string aedApp::getDefaultFontName (  )  const [inline]

Return the default font name.

aedTheme* aedApp::getDefaultTheme (  )  const

Return a pointer to the default theme.

aedWidget* aedApp::getFocusWidget (  )  const [inline]

Return a pointer to the widget that has focus.

aedLog* aedApp::getLog (  )  const

aedButton* aedApp::getOkayButton (  )  [inline]

aedWidget* aedApp::getRoot (  )  const [inline]

Get the root widget.

bool aedApp::getUTF8 (  )  const [inline]

aedTheme* aedApp::loadTheme ( std::string  file  ) 

Load a theme plugin.

Parameters:
file filename of the theme plugin
Returns:
pointer to the loaded theme or NULL if the theme couldn't be loaded

aedFont* aedApp::requestFont ( std::string  name,
Uint8  size,
int  style = AED_FONT_STYLE_NORMAL 
)

Search global font cache for the specified font.

If the font isn't present in the cache or in the list of memory fonts, disk is searched.

Parameters:
name font name
size font size
style font style
Returns:
pointer to the requested font or NULL if the font was not found

void aedApp::setCancelButton ( aedButton button  )  [inline]

void aedApp::setDefaultFontName ( std::string  name  )  [inline]

Set the default font name.

Parameters:
name font name

void aedApp::setFocusWidget ( aedWidget win  ) 

Set focus.

void aedApp::setOkayButton ( aedButton button  )  [inline]

Handle okay and cancel buttons.

void aedApp::setRoot ( aedWidget w  )  [inline]

Set the application's root widget.

void aedApp::setUTF8 ( bool  enable  )  [inline]

Enable or disable UTF8 text rendering.

Rendering UTF8 text is disabled by default.

std::string aedApp::tryFontPath ( std::string  path,
std::string  name 
) [private]

void aedApp::unloadTheme ( aedTheme theme  ) 

Unload the theme and free all resources allocated to it.

Parameters:
theme pointer to a theme returned previously by loadTheme()


Member Data Documentation

aedButton* aedApp::m_cancelButton [private]

std::string aedApp::m_DefaultFontName [private]

aedWidget* aedApp::m_FocusWidget [private]

std::vector< std::string > aedApp::m_FontPaths [private]

std::vector< aedFontEntry > aedApp::m_Fonts [private]

std::vector< aedMemFontEntry > aedApp::m_MemFonts [private]

aedButton* aedApp::m_okayButton [private]

aedWidget* aedApp::m_Root [private]

std::vector< aedThemeEntry > aedApp::m_Themes [private]

bool aedApp::m_UTF8 [private]


The documentation for this class was generated from the following file:
Generated on Sun Mar 11 15:33:25 2007 for MetalWarriors by  doxygen 1.4.7