|
wxMaxima
|
Storage for the worksheet's per-TextStyle text styles. More...
#include <Styles.h>
Public Member Functions | |
| Style & | operator[] (int textStyle) |
| The style used for a given TextStyle. Indexed like the old raw array, so both TextStyle enumerators and the plain integer indices some callers use work unchanged. Indexing and iteration return the active set (light or dark), so all the display code reads the right palette without knowing which is in use. | |
| const Style & | operator[] (int textStyle) const |
| Style * | begin () |
| Style * | end () |
| const Style * | begin () const |
| const Style * | end () const |
| void | SetUseDark (bool dark) |
| Select which set indexing/iteration return. | |
| bool | UsingDark () const |
| void | ClearCaches () |
| Invalidate the font caches of every style in BOTH sets. | |
| void | SetDefaults () |
| Reset every style to wxMaxima's built-in (light) defaults. | |
| void | SetDarkDefaults () |
| Reset every style to wxMaxima's built-in dark-mode defaults (a curated palette for a dark background; same fonts/structure as SetDefaults()). | |
| void | Read (wxConfigBase *config) |
| Read every persisted style from config. | |
| void | Write (wxConfigBase *config) const |
| Write every persisted style to config. | |
| const std::vector< TextStyle > & | CodeStylesList () const |
| The styles that share the code-default font/attributes. | |
| const std::vector< TextStyle > & | MathStylesList () const |
| The styles that share the 2d-math font. | |
| const std::vector< TextStyle > & | ColorOnlyStylesList () const |
| The styles where only the color is configurable. | |
| bool | AffectsCode (TextStyle style) const |
| bool | AffectsMathOut (TextStyle style) const |
| bool | AffectsColorOnly (TextStyle style) const |
| void | MakeConsistent () |
| Propagate the code-default / math fonts to the styles that must share them. | |
Static Public Member Functions | |
| static const std::vector< std::pair< TextStyle, wxString > > & | ConfigKeys () |
| The single source of truth mapping each persisted text style to its config-key prefix. | |
| static const wxString & | Name (TextStyle textStyle) |
| The human-readable, translated name of a style (used by the config dialog). Returns an empty string for out-of-range / unnamed styles. | |
Storage for the worksheet's per-TextStyle text styles.
Extracted from Configuration so the (large) style subsystem – the array of styles plus its load/save logic – lives in one cohesive place. Configuration holds a Styles instance and forwards its public style accessors to it.
|
static |
The single source of truth mapping each persisted text style to its config-key prefix.
Read() and Write() both iterate this list, so a style can never be read and written under mismatched keys (which used to cause settings to silently fail to round-trip). Adding a persisted style is a one-line edit here.