clan::StyleCascade Class Reference

Style value resolver. More...

#include <style_cascade.h>

Public Member Functions

 StyleCascade ()
 
 StyleCascade (std::vector< Style * > cascade, const StyleCascade *parent=nullptr)
 
int array_size (PropertyHash hash) const
 Value array size for the property.
 
StyleGetValue cascade_value (PropertyHash hash) const
 Find the first declared value in the cascade for the specified property.
 
StyleGetValue compute_angle (const StyleGetValue &angle) const
 Convert angle into radians.
 
StyleGetValue compute_frequency (const StyleGetValue &frequency) const
 Convert frequency to Hz.
 
StyleGetValue compute_length (const StyleGetValue &length) const
 Convert length into px (device independent pixel) units.
 
StyleGetValue compute_resolution (const StyleGetValue &resolution) const
 Convert resolution to dots per px unit (pixel ratio scale)
 
StyleGetValue compute_time (const StyleGetValue &time) const
 Convert time to seconds.
 
StyleGetValue computed_value (PropertyHash hash) const
 
Font font (Canvas &canvas) const
 Font used by this style cascade.
 
void render_background (Canvas &canvas, const ViewGeometry &geometry) const
 Render styled background.
 
void render_border (Canvas &canvas, const ViewGeometry &geometry) const
 Render styled border.
 
StyleGetValue specified_value (PropertyHash hash) const
 Resolve any inheritance or initial values for the cascade value.
 

Public Attributes

std::vector< Style * > cascade
 Property sets to be examined.
 
const StyleCascadeparent = nullptr
 Parent cascade used for inheritance.
 

Detailed Description

Style value resolver.

Constructor & Destructor Documentation

◆ StyleCascade() [1/2]

clan::StyleCascade::StyleCascade ( )
inline

Referenced by StyleCascade().

◆ StyleCascade() [2/2]

clan::StyleCascade::StyleCascade ( std::vector< Style * > cascade,
const StyleCascade * parent = nullptr )
inline

Member Function Documentation

◆ array_size()

int clan::StyleCascade::array_size ( PropertyHash hash) const

Value array size for the property.

References clan::hash.

◆ cascade_value()

StyleGetValue clan::StyleCascade::cascade_value ( PropertyHash hash) const

Find the first declared value in the cascade for the specified property.

References clan::hash.

◆ compute_angle()

StyleGetValue clan::StyleCascade::compute_angle ( const StyleGetValue & angle) const

Convert angle into radians.

References clan::angle.

◆ compute_frequency()

StyleGetValue clan::StyleCascade::compute_frequency ( const StyleGetValue & frequency) const

Convert frequency to Hz.

References clan::frequency.

◆ compute_length()

StyleGetValue clan::StyleCascade::compute_length ( const StyleGetValue & length) const

Convert length into px (device independent pixel) units.

References clan::length.

◆ compute_resolution()

StyleGetValue clan::StyleCascade::compute_resolution ( const StyleGetValue & resolution) const

Convert resolution to dots per px unit (pixel ratio scale)

References clan::resolution.

◆ compute_time()

StyleGetValue clan::StyleCascade::compute_time ( const StyleGetValue & time) const

Convert time to seconds.

References clan::time.

◆ computed_value()

StyleGetValue clan::StyleCascade::computed_value ( PropertyHash hash) const

Find the computed value for the specified value

The computed value is a simplified value for the property. Lengths are resolved to device independent pixels and so on.

References clan::hash.

◆ font()

Font clan::StyleCascade::font ( Canvas & canvas) const

Font used by this style cascade.

◆ render_background()

void clan::StyleCascade::render_background ( Canvas & canvas,
const ViewGeometry & geometry ) const

Render styled background.

References clan::geometry.

◆ render_border()

void clan::StyleCascade::render_border ( Canvas & canvas,
const ViewGeometry & geometry ) const

Render styled border.

References clan::geometry.

◆ specified_value()

StyleGetValue clan::StyleCascade::specified_value ( PropertyHash hash) const

Resolve any inheritance or initial values for the cascade value.

References clan::hash.

Member Data Documentation

◆ cascade

std::vector<Style *> clan::StyleCascade::cascade

Property sets to be examined.

Referenced by StyleCascade().

◆ parent

const StyleCascade* clan::StyleCascade::parent = nullptr

Parent cascade used for inheritance.

Referenced by StyleCascade().


The documentation for this class was generated from the following file: