32 #include "../../Display/2D/color.h"
33 #include "style_value_type.h"
34 #include "style_dimension.h"
71 return _value.float_value.number;
87 return _value.float_value.dimension;
97 return Colorf(_value.color[0], _value.color[1], _value.color[2], _value.color[3]);
bool is_number() const
Check if value is a number.
Definition: style_get_value.h:129
bool is_resolution() const
Check if value is a resolution.
Definition: style_get_value.h:123
StyleDimension dimension
Definition: style_get_value.h:182
@ s
turns (1 in a full circle)
bool is_string() const
Check if value is a string.
Definition: style_get_value.h:132
StyleValueType type() const
Variant type.
Definition: style_get_value.h:43
StyleDimension
Unit of a style value.
Definition: style_dimension.h:35
bool is_undefined() const
Check if value is undefined.
Definition: style_get_value.h:103
@ percentage
value is a length
float color[4]
Definition: style_get_value.h:184
@ rad
gradians/gons/grades (400 in a full circle)
bool is_url() const
Check if value is an url.
Definition: style_get_value.h:135
Floating point color description class (for float).
Definition: color.h:661
const char * text
Definition: style_get_value.h:178
bool is_angle() const
Check if value is an angle.
Definition: style_get_value.h:114
bool is_percentage() const
Check if value is a percentage.
Definition: style_get_value.h:126
bool is_time() const
Check if value is a time.
Definition: style_get_value.h:117
static StyleGetValue from_percentage(float percentage)
Create style value from a percentage.
Definition: style_get_value.h:162
static StyleGetValue from_time(float t, StyleDimension dimension=StyleDimension::s)
Create style value from a time.
Definition: style_get_value.h:153
StyleValueType
Style value type.
Definition: style_value_type.h:35
Style value returned by style classes.
Definition: style_get_value.h:40
static StyleGetValue from_number(float number)
Create style value from a number.
Definition: style_get_value.h:165
float number
Definition: style_get_value.h:181
static StyleGetValue from_color(const Colorf &color)
Create style value from a color.
Definition: style_get_value.h:171
bool is_length() const
Check if value is a length.
Definition: style_get_value.h:111
static StyleGetValue from_length(float length, StyleDimension dimension=StyleDimension::px)
Create style value from a length.
Definition: style_get_value.h:147
bool is_color() const
Check if value is a color.
Definition: style_get_value.h:138
@ url
value is a text string
@ length
value is a keyword
static StyleGetValue from_keyword(const char *keyword)
Create style value from a keyword.
Definition: style_get_value.h:141
struct clan::StyleGetValue::@27::@28 float_value
@ resolution
value is a frequency
bool is_frequency() const
Check if value is a frequency.
Definition: style_get_value.h:120
bool is_keyword(const std::string &keyword) const
Definition: style_get_value.h:108
Colorf color() const
Value color.
Definition: style_get_value.h:94
static StyleGetValue from_frequency(float freq, StyleDimension dimension=StyleDimension::hz)
Create style value from a frequency.
Definition: style_get_value.h:156
static StyleGetValue from_string(const char *text)
Create style value from a string.
Definition: style_get_value.h:144
bool is_keyword() const
Check if value is a keyword.
Definition: style_get_value.h:106
static StyleGetValue from_url(const char *url)
Create style value from an url.
Definition: style_get_value.h:168
static StyleGetValue from_resolution(float resolution, StyleDimension dimension=StyleDimension::dppx)
Create style value from a resolution.
Definition: style_get_value.h:159
StyleDimension dimension() const
Dimension used by value.
Definition: style_get_value.h:78
bool is_keyword(const char *keyword) const
Definition: style_get_value.h:107
float number() const
Value number.
Definition: style_get_value.h:60
const char * text() const
Text when the type is a text string.
Definition: style_get_value.h:46
@ frequency
value is a time
@ number
value is a percentage number
@ string
value is a number
static StyleGetValue from_angle(float angle, StyleDimension dimension=StyleDimension::rad)
Create style value from an angle.
Definition: style_get_value.h:150