Colors component parts based on system colors.
Public Member Functions | |
DefaultTheme () | |
Color | get_color (component_type type, int part) const |
Font | get_font (int id) const |
int | get_font_height (int id) const |
const Bitmap & | get_image (THEME_IMAGE img) const |
int | get_inner_tab_padding () const |
int | get_text_width (int id, std::string str) const |
void | set_color (component_type type, int part, const Color &color) |
void | set_defaults () |
void | set_font (int id, const Font &font) |
void | set_image (THEME_IMAGE img, const Bitmap &bitmap) |
void | theme_changed () |
Protected Member Functions | |
int | calc_font_height (const Font &font) const |
int | calc_text_width (const Font &font, std::string str) const |
Private Types | |
typedef std::map< int, ColorMap > | ComponentColors |
typedef std::map< int, FontData > | Fonts |
typedef std::map< THEME_IMAGE, Bitmap > | ImageMap |
Private Attributes | |
ComponentColors | m_colors |
The part color database. | |
Fonts | m_fonts |
The Font database. | |
ImageMap | m_imageMap |
The image database. | |
Classes | |
class | FontData |
typedef std::map<int, ColorMap> ifm::DefaultTheme::ComponentColors [private] |
typedef std::map<int, FontData> ifm::DefaultTheme::Fonts [private] |
typedef std::map<THEME_IMAGE, Bitmap> ifm::DefaultTheme::ImageMap [private] |
ifm::DefaultTheme::DefaultTheme | ( | ) |
Constructs the default theme by setting default values.
int ifm::DefaultTheme::calc_font_height | ( | const Font & | font | ) | const [protected, virtual] |
int ifm::DefaultTheme::calc_text_width | ( | const Font & | font, | |
std::string | str | |||
) | const [protected] |
Color ifm::DefaultTheme::get_color | ( | component_type | type, | |
int | part | |||
) | const [virtual] |
Returns the color for the part for this component type. If the given part has no color defined for this component type, the color defined for ALL components will be returned.
Implements ifm::Theme.
Font ifm::DefaultTheme::get_font | ( | int | id | ) | const [virtual] |
Returns the Font to use for this font id.
Implements ifm::Theme.
int ifm::DefaultTheme::get_font_height | ( | int | id | ) | const [virtual] |
Returns the height of a space character when rendered in the Font for the given font id.
Implements ifm::Theme.
const Bitmap & ifm::DefaultTheme::get_image | ( | THEME_IMAGE | img | ) | const [virtual] |
Returns the bitmap to use to render the given THEME_IMAGE
Implements ifm::Theme.
int ifm::DefaultTheme::get_inner_tab_padding | ( | ) | const [virtual] |
Returns how much padding there should be between parts of a Tab (the text and the image).
Implements ifm::Theme.
int ifm::DefaultTheme::get_text_width | ( | int | id, | |
std::string | str | |||
) | const [virtual] |
Implements ifm::Theme.
void ifm::DefaultTheme::set_color | ( | component_type | type, | |
int | part, | |||
const Color & | color | |||
) | [virtual] |
Sets the color for the part for this component type. If you specify ALL as the component type, the default color for that part will be set, but any existing colors defined for this part already in components will not be changed.
Implements ifm::Theme.
void ifm::DefaultTheme::set_defaults | ( | ) | [virtual] |
void ifm::DefaultTheme::set_font | ( | int | id, | |
const Font & | font | |||
) | [virtual] |
Sets the Font to use for this font id.
Implements ifm::Theme.
void ifm::DefaultTheme::set_image | ( | THEME_IMAGE | img, | |
const Bitmap & | bitmap | |||
) | [virtual] |
Implements ifm::Theme.
void ifm::DefaultTheme::theme_changed | ( | ) | [virtual] |
Restores the default colors.
Implements ifm::Theme.
ComponentColors ifm::DefaultTheme::m_colors [mutable, private] |
The part color database.
Fonts ifm::DefaultTheme::m_fonts [private] |
The Font database.
ImageMap ifm::DefaultTheme::m_imageMap [private] |
The image database.