34 #include "style_get_value.h"
44 #if defined(MICROSOFT_FINALLY_IMPLEMENTED_CONSTEXPR_TEN_YEARS_AFTER_EVERYONE_ELSE)
45 class PropertyNameConst
49 template<std::
size_t Length>
50 constexpr PropertyNameConst(
const char(&text)[Length]) : text(text),
length(Length - 1) { }
52 constexpr
char operator[](std::size_t index)
const {
return index <
length ? text[index] :
throw std::out_of_range(
"PropertyNameConst operator[] out of bounds"); }
53 constexpr std::size_t size()
const {
return length; }
54 constexpr std::size_t
hash()
const {
return hash(2166136261U, 0); }
57 constexpr std::size_t
hash(std::size_t value, std::size_t index)
const {
return index ==
length ? value :
hash((value ^ (std::size_t)text[index]) * 16777619U, index + 1); }
59 const char *
const text;
StyleGetValue computed_value(const char *property_name) const
Font get_font(Canvas &canvas) const
Font used by this style cascade.
StyleCascade()
Definition: style_cascade.h:68
StyleGetValue compute_time(const StyleGetValue &time) const
Convert time to seconds.
void render_border(Canvas &canvas, const ViewGeometry &geometry) const
Render styled border.
StyleGetValue specified_value(const std::string &property_name) const
Definition: style_cascade.h:83
std::vector< Style * > cascade
Property sets to be examined.
Definition: style_cascade.h:72
StyleGetValue compute_angle(const StyleGetValue &angle) const
Convert angle into radians.
2D Graphics Canvas
Definition: canvas.h:73
StyleCascade * parent
Parent cascade used for inheritance.
Definition: style_cascade.h:75
Style value returned by style classes.
Definition: style_get_value.h:40
StyleGetValue compute_resolution(const StyleGetValue &resolution) const
Convert resolution to dots per px unit (pixel ratio scale)
StyleGetValue compute_length(const StyleGetValue &length) const
Convert length into px (device independent pixel) units.
Font class.
Definition: font.h:54
StyleGetValue compute_frequency(const StyleGetValue &frequency) const
Convert frequency to Hz.
@ length
value is a keyword
StyleGetValue computed_value(const std::string &property_name) const
Definition: style_cascade.h:89
int array_size(const std::string &property_name) const
Definition: style_cascade.h:108
Definition: view_geometry.h:39
StyleGetValue specified_value(const char *property_name) const
Resolve any inheritance or initial values for the cascade value.
int array_size(const char *property_name) const
Value array size for the property.
void render_background(Canvas &canvas, const ViewGeometry &geometry) const
Render styled background.
StyleGetValue cascade_value(const char *property_name) const
Find the first declared value in the cascade for the specified property.
Style value resolver.
Definition: style_cascade.h:66
StyleGetValue cascade_value(const std::string &property_name) const
Definition: style_cascade.h:79
StyleCascade(std::vector< Style * > cascade, StyleCascade *parent=nullptr)
Definition: style_cascade.h:69