#include <StyleSpec.h>
Public Types | |
enum | Property { TEXTCOLOR , BGCOLOR , BGCOLOR_HOVERED , BGCOLOR_PRESSED , NOCLIP , BORDER , BGIMG , BGIMG_HOVERED , BGIMG_MIDDLE , BGIMG_PRESSED , FGIMG , FGIMG_HOVERED , FGIMG_MIDDLE , FGIMG_PRESSED , ALPHA , CONTENT_OFFSET , PADDING , FONT , FONT_SIZE , COLORS , BORDERCOLORS , BORDERWIDTHS , SOUND , SPACING , SIZE , NUM_PROPERTIES , NONE } |
enum | State : u8 { STATE_DEFAULT = 0 , STATE_FOCUSED = 1 << 0 , STATE_HOVERED = 1 << 1 , STATE_PRESSED = 1 << 2 , NUM_STATES = 1 << 3 , STATE_INVALID = 1 << 4 } |
Public Member Functions | |
std::string | get (Property prop, std::string def) const |
void | set (Property prop, const std::string &value) |
State | getState () const |
Gets the state that this style is intended for. | |
void | addState (State state) |
Set the given state on this style. | |
video::SColor | getColor (Property prop, video::SColor def) const |
video::SColor | getColor (Property prop) const |
std::array< video::SColor, 4 > | getColorArray (Property prop, std::array< video::SColor, 4 > def) const |
std::array< s32, 4 > | getIntArray (Property prop, std::array< s32, 4 > def) const |
irr::core::rect< s32 > | getRect (Property prop, irr::core::rect< s32 > def) const |
irr::core::rect< s32 > | getRect (Property prop) const |
v2f32 | getVector2f (Property prop, v2f32 def) const |
v2s32 | getVector2i (Property prop, v2s32 def) const |
v2s32 | getVector2i (Property prop) const |
gui::IGUIFont * | getFont () const |
video::ITexture * | getTexture (Property prop, ISimpleTextureSource *tsrc, video::ITexture *def) const |
video::ITexture * | getTexture (Property prop, ISimpleTextureSource *tsrc) const |
bool | getBool (Property prop, bool def) const |
bool | isNotDefault (Property prop) const |
bool | hasProperty (Property prop) const |
StyleSpec & | operator|= (const StyleSpec &other) |
StyleSpec | operator| (const StyleSpec &other) const |
Static Public Member Functions | |
static Property | GetPropertyByName (const std::string &name) |
static State | getStateByName (const std::string &name) |
Parses a name and returns the corresponding state enum. | |
static StyleSpec | getStyleFromStatePropagation (const std::array< StyleSpec, NUM_STATES > &styles, State state) |
Using a list of styles mapped to state values, calculate the final. | |
Private Member Functions | |
bool | parseArray (const std::string &value, std::vector< std::string > &arr) const |
bool | parseRect (const std::string &value, irr::core::rect< s32 > *parsed_rect) const |
bool | parseVector2f (const std::string &value, v2f32 *parsed_vec) const |
Private Attributes | |
std::array< bool, NUM_PROPERTIES > | property_set {} |
std::array< std::string, NUM_PROPERTIES > | properties |
State | state_map = STATE_DEFAULT |
enum StyleSpec::Property |
enum StyleSpec::State : u8 |
|
inline |
Set the given state on this style.
References FATAL_ERROR_IF, NUM_STATES, and state_map.
Referenced by GUIFormSpecMenu::parseStyle().
|
inline |
References properties.
Referenced by operator|=(), and GUIFormSpecMenu::parseStyle().
|
inline |
References is_yes(), and properties.
Referenced by GUIButton::setFromStyle(), and GUIScene::setStyles().
|
inline |
References FATAL_ERROR_IF, parseColorString(), and properties.
|
inline |
References parseColorString(), and properties.
Referenced by GUIButton::setFromStyle(), and GUIScene::setStyles().
|
inline |
References parseArray(), parseColorString(), and properties.
|
inline |
References FontSpec::bold, FM_Mono, FM_Standard, FONT, FONT_SIZE, FONT_SIZE_UNSPECIFIED, g_fontengine, FontEngine::getFont(), FontEngine::getFontSize(), FontSpec::italic, FontSpec::mode, properties, FontSpec::size, split(), stof, and stoi.
Referenced by GUIButton::setFromStyle().
|
inline |
|
inlinestatic |
References ALPHA, BGCOLOR, BGCOLOR_HOVERED, BGCOLOR_PRESSED, BGIMG, BGIMG_HOVERED, BGIMG_MIDDLE, BGIMG_PRESSED, BORDER, BORDERCOLORS, BORDERWIDTHS, COLORS, CONTENT_OFFSET, FGIMG, FGIMG_HOVERED, FGIMG_MIDDLE, FGIMG_PRESSED, FONT, FONT_SIZE, NOCLIP, NONE, PADDING, SIZE, SOUND, SPACING, and TEXTCOLOR.
Referenced by GUIFormSpecMenu::parseStyle().
|
inline |
|
inline |
References parseRect(), and properties.
Referenced by GUIButton::setFromStyle(), and GUIButtonImage::setFromStyle().
|
inline |
Gets the state that this style is intended for.
References state_map.
Referenced by GUIButton::setFromStyle().
|
inlinestatic |
Parses a name and returns the corresponding state enum.
References STATE_DEFAULT, STATE_FOCUSED, STATE_HOVERED, STATE_INVALID, and STATE_PRESSED.
Referenced by GUIFormSpecMenu::parseStyle().
|
inlinestatic |
Using a list of styles mapped to state values, calculate the final.
References STATE_DEFAULT, and state_map.
Referenced by GUIButton::setFromState(), and GUIScene::setStyles().
|
inline |
References FATAL_ERROR_IF, ISimpleTextureSource::getTexture(), and properties.
|
inline |
References ISimpleTextureSource::getTexture(), and properties.
Referenced by GUIButton::setFromStyle(), and GUIButtonImage::setFromStyle().
References FATAL_ERROR_IF, parseVector2f(), and properties.
References parseVector2f(), and properties.
Referenced by GUIButton::setFromStyle().
|
inline |
References property_set.
Referenced by operator|=(), and GUIFormSpecMenu::parseStyle().
|
inline |
References properties.
Referenced by GUIButton::setFromStyle(), and GUIButtonImage::setFromStyle().
References get(), hasProperty(), NUM_PROPERTIES, and set().
|
inlineprivate |
References split(), and warningstream.
Referenced by getColorArray(), and getIntArray().
|
inlineprivate |
References split(), stoi, and warningstream.
Referenced by getRect(), and getRect().
|
inlineprivate |
References split(), stof, and warningstream.
Referenced by getVector2f(), getVector2i(), and getVector2i().
|
inline |
References properties, and property_set.
Referenced by operator|=(), and GUIFormSpecMenu::parseStyle().
|
private |
Referenced by get(), getBool(), getColor(), getColor(), getColorArray(), getFont(), getIntArray(), getRect(), getRect(), getTexture(), getTexture(), getVector2f(), getVector2i(), getVector2i(), isNotDefault(), and set().
|
private |
Referenced by hasProperty(), and set().
|
private |
Referenced by addState(), getState(), and getStyleFromStatePropagation().