A GUI theme part represents a pseudo element in CSS. More...
#include <gui_theme_part.h>
Public Member Functions | |
Construction | |
GUIThemePart () | |
Constructs a null instance. More... | |
GUIThemePart (GUIComponent *parent, const std::string &tag_name) | |
Creates a GUI component. More... | |
Attributes | |
bool | is_null () const |
Returns true if this object is invalid. More... | |
void | throw_if_null () const |
Throw an exception if this object is invalid. More... | |
const CSSComputedValues & | get_css_values () const |
Returns the standard W3C CSS properties active for this component. More... | |
Font | get_font () const |
Gets the font. More... | |
std::string | get_tag_name () const |
Returns the CSS tag name. More... | |
std::string | get_id () const |
Returns the CSS id attribute. More... | |
bool | get_class (const std::string &name) const |
Returns whether a CSS class is present or not. More... | |
std::vector< std::string > | get_classes () const |
Returns all classes currently present. More... | |
bool | get_pseudo_class (const std::string &name) const |
Returns whether a CSS pseudo class is present or not. More... | |
std::vector< std::string > | get_pseudo_classes () const |
Returns all pseudo classes currently present. More... | |
Size | get_css_size () const |
Returns the css size of a render box. More... | |
int | get_css_width () const |
Returns the css width of a render box. More... | |
int | get_css_height () const |
Returns the css height of a render box. More... | |
Rect | get_render_text_span_box (Canvas &canvas, const std::string &str, const Rect &content_rect) const |
Calculates the text size using the font defined for the current state for use with render_text_span() More... | |
Rect | get_render_text_box (Canvas &canvas, const std::string &str, const Rect &content_rect) const |
Calculates the text box using the font defined for the current state for use with render_text() More... | |
Size | get_render_text_size (Canvas &canvas, const std::string &str) const |
Calculates the text size using the font defined for the current state for use with render_text() More... | |
Rect | get_content_box (const Rect &render_box_rect) const |
Returns the position of the content box for a given render box. More... | |
Rect | get_content_shrink_box () const |
Returns the content shrink box of the theme part. More... | |
Rect | get_border_box (const Rect &content_box_rect) const |
Returns the position and size of a border box for a given content box. More... | |
std::string | get_property (const std::string &property, const std::string &default_value) const |
Returns the value of a property. More... | |
int | get_property_int (const std::string &property, const std::string &default_value) const |
Returns the value of a property as an integer. More... | |
Operations | |
void | render_box (Canvas &canvas, const Rect &border_box) |
Renders the component and its children. More... | |
void | set_tag_name (const std::string &name) |
Sets the CSS tag name. More... | |
bool | set_class (const std::string &name, bool enable) |
Controls the presence of a CSS class. More... | |
void | set_id (const std::string &name) |
Sets the CSS id. More... | |
bool | set_pseudo_class (const std::string &name, bool enable) |
Controls the presence of a CSS pseudo class. More... | |
Rect | render_text_span (Canvas &canvas, const std::string &text, const Rect &content_rect) |
Rect | render_text (Canvas &canvas, const std::string &text, const Rect &content_box) |
Rect | render_text (Canvas &canvas, const std::string &text, const Rect &content_box, int baseline) |
VerticalTextPosition | get_vertical_text_align (Canvas &canvas, const Rect &content_rect) |
Calculates the vertical text position for the current font. More... | |
Public Attributes | |
Implementation | |
std::shared_ptr < GUIThemePart_Impl > | impl |
A GUI theme part represents a pseudo element in CSS.