#include <Pt/Forms/Style.h>
Stores renderer facets for the active theme. More...
Inherited by PlatinumStyle.
Classes | |
| class | Facet |
| Represents a type-tagged, reference-counted object stored by Style. More... | |
Public Member Functions | |
| Style () | |
| Constructor. | |
| Style (const Style &style) | |
| Copies style. | |
| virtual | ~Style () |
| Destructor. | |
| Style & | operator= (const Style &style) |
| Replaces the contents with a copy of style. | |
| void | assign (const Style &style) |
| Replaces all facets with those from style. | |
| void | set (Facet *facet) |
| Adds or replaces a facet. | |
| void | reset (const StyleOptions &options) |
| Resets all registered facets with options. | |
| std::size_t | generation () const |
| Returns the current style generation. | |
| template<typename FacetT> | |
| FacetT * | get () const |
| Returns the facet of type FacetT, or 0. | |
A Style stores one renderer facet per dynamic type. Use set() to register or replace a facet. Use get() to retrieve it. Use reset() to apply StyleOptions to every registered facet. generation() changes when the set of facets changes.
Facets are reference counted. set() takes a reference. Pass a facet with a reference count of 0. Use Renderer::create() to allocate such an instance.
Use Application::setStyle() to install a complete style. The application starts with PlatinumStyle. Derive Renderer, or another Facet, to add drawing for a control family.
Shared facets receive global options only through reset(). Look- specific metrics stay in the derived renderer, not on Style.
| void set | ( | Facet * | facet | ) |
Takes a reference to facet. Pass a facet with a reference count of 0.
| std::size_t generation | ( | ) | const |
The generation changes when the set of facets changes.