wxMaxima
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
Style Class Referencefinal

#include <TextStyle.h>

Collaboration diagram for Style:
Collaboration graph
[legend]

Public Types

using did_change = bool
 

Public Member Functions

 Style (const Style &)
 
 Style (AFontSize fontSize)
 
Styleoperator= (const Style &)
 
bool operator== (const Style &o) const =delete
 
StyleRead (wxConfigBase *config, const wxString &where)
 
void Write (wxConfigBase *config, const wxString &where) const
 Write this style to a config source.
 
wxFontFamily GetFamily () const
 
wxFontEncoding GetEncoding () const
 
wxFontWeight GetWeight () const
 
bool IsBold () const
 
bool IsLight () const
 
wxFontStyle GetFontStyle () const
 
bool IsItalic () const
 
bool IsSlant () const
 
bool IsUnderlined () const
 
bool IsStrikethrough () const
 
AFontName GetFontName () const
 
const wxString & GetNameStr () const
 
AFontSize GetFontSize () const
 The size of this style's font, asserted to be valid.
 
uint32_t GetRGBColor () const
 
wxColor GetColor () const
 
did_change SetFamily (wxFontFamily family)
 
did_change SetEncoding (wxFontEncoding encoding)
 
did_change SetWeight (wxFontWeight weight)
 
did_change SetBold (bool bold=true)
 
did_change SetLight (bool light=true)
 
did_change SetFontStyle (wxFontStyle style)
 
did_change SetItalic (bool italic=true)
 
did_change SetSlant (bool slant=true)
 
did_change SetUnderlined (bool underlined=true)
 
did_change SetStrikethrough (bool strikethrough=true)
 
did_change SetFontName (AFontName fontName)
 
did_change SetFontSize (AFontSize fontSize)
 
did_change SetRGBColor (uint32_t rgb)
 
did_change SetColor (const wxColor &color)
 
did_change SetColor (wxSystemColour sysColour)
 
did_change ResolveToFont ()
 Resolves the style to the parameters of the font it represents.
 
StyleFamily (wxFontFamily family)
 
StyleEncoding (wxFontEncoding encoding)
 
StyleWeight (wxFontWeight weight)
 
StyleFontStyle (wxFontStyle style)
 
StyleBold (bool bold=true)
 
StyleLight (bool light=true)
 
StyleItalic (bool italic=true)
 
StyleSlant (bool slant=true)
 
StyleUnderlined (bool underlined=true)
 
StyleStrikethrough (bool strikethrough=true)
 
StyleFontName (class AFontName fontName)
 
StyleFontSize (float size)
 
StyleFontSize (AFontSize fontSize)
 
StyleRGBColor (uint32_t rgb)
 
StyleColor (const wxColor &color)
 
StyleColor (uint8_t r, uint8_t g, uint8_t b)
 
StyleColor (wxSystemColour sysColour)
 
StyleChangeLightness (int alpha)
 
wxFontInfo GetAsFontInfo () const
 
bool IsFontLessThan (const Style &o) const
 
bool IsFontEqualTo (const Style &) const
 
bool IsStyleEqualTo (const Style &o) const
 
bool IsFontOk () const
 
bool HasFontCached () const
 
const wxFont & GetFont () const
 
did_change SetFromFont (const wxFont &)
 Sets all font-related properties based on another font.
 
did_change SetFontFrom (const Style &)
 Sets all font-related properties based on another style, including size, font style and weight.
 
did_change SetFontFaceFrom (const Style &)
 Sets font-face-only properties based on another style.
 
did_change SetFontFaceAndSizeFrom (const Style &)
 Sets font-face and size only properties based on another style (not attributes like bold, etc.)
 
wxString GetDump () const
 

Static Public Member Functions

static const StyleFromFont (const wxFont &font)
 Gets a style that represents a given font. The font gets cached.
 
static const StyleFromStockFont (wxStockGDI::Item font)
 Gets a style that represents a stock font. The font is pre-cached.
 
static AFontName Default_FontName ()
 
static const wxColor & Default_Color ()
 
constexpr static bool IsFractionalFontSizeSupported ()
 
static AFontSize GetFontSize (const wxFont &)
 
static void SetFontSize (wxFont &, AFontSize fontSize)
 

Static Public Attributes

constexpr static wxFontFamily Default_Family {wxFONTFAMILY_DEFAULT}
 
constexpr static wxFontEncoding Default_Encoding {wxFONTENCODING_DEFAULT}
 
constexpr static wxFontWeight Default_Weight {wxFONTWEIGHT_NORMAL}
 
constexpr static wxFontStyle Default_FontStyle {wxFONTSTYLE_NORMAL}
 
constexpr static bool Default_Underlined {false}
 
constexpr static bool Default_Strikethrough {false}
 
constexpr static AFontSize Default_FontSize {10.0f}
 
constexpr static uint32_t Default_ColorRGB {MAKE_RGB(0, 0, 0)}
 

Friends

struct StyleFontHasher
 
class FontCache
 

Detailed Description

Text Style Definition

It is a well-performing replacement for wxFontInfo, with additional color attribute.

The text styles are also used as keys into the FontCache. They are designed to be small, quick to compare for equality and order (less-than), and quick to copy.

Member Function Documentation

◆ Read()

Style & Style::Read ( wxConfigBase *  config,
const wxString &  where 
)

Read this style from a config source. Only touches the attributes that were successfully read. Remaining attributes are unchanged.


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