wex v24.10.0
|
Collection of all lexers. More...
#include <wex/syntax/lexers.h>
Public Types | |
typedef std::unordered_map< std::string, std::string > | name_values_t |
Name values type for macros. | |
Public Member Functions | |
void | apply (factory::stc *stc) const |
Applies containers (except global styles) to specified component. | |
void | apply_default_style (const std::function< void(const std::string &)> &back, const std::function< void(const std::string &)> &fore=nullptr) const |
Applies default style to functions for back and foreground colours. | |
void | apply_global_styles (factory::stc *stc) |
Sets global styles (and colours and indicators) for current theme for specified component. | |
const std::string | apply_macro (const std::string &text, const std::string &lexer="global") const |
Applies macro to text: if text is referring to a macro, text is replaced by the macro value. | |
void | apply_margin_text_style (factory::stc *stc, const blame *info) const |
Applies margin text style to stc line. | |
void | clear_theme () |
Clears the theme. | |
const lexer & | find (const std::string &name) const |
Finds a lexer specified by the (display scintilla) name. | |
const lexer & | find_by_filename (const std::string &fullname) const |
Finds a lexer specified by a filename (fullname). | |
const lexer & | find_by_text (const std::string &text) const |
Finds a lexer if text starts with some special tokens. | |
const style & | get_default_style () const |
Returns the default style. | |
const indicator & | get_indicator (const indicator &indicator) const |
Returns indicator from loaded indicators, based on the no of specified indicator. | |
const auto & | get_lexers () const |
Returns the lexers. | |
const name_values_t & | get_macros (const std::string &lexer) const |
Returns the macros for specified lexer. | |
const marker & | get_marker (const marker &marker) const |
Returns marker from loaded markers, based on the no of specified marker. | |
auto | get_themes_size () const |
Returns number of themes (should at least contain empty theme). | |
bool | indicator_is_loaded (const indicator &indic) const |
Returns true if specified indicator is available. | |
const std::string & | keywords (const std::string &set) const |
Returns the keywords for the specified named set of keywords. | |
bool | load_document () |
Loads all lexers from document. | |
bool | marker_is_loaded (const marker &marker) const |
Returns true if specified marker is available. | |
const auto & | path () const |
Returns the path. | |
const auto & | properties () const |
Returns global properties. | |
void | restore_theme () |
Restores the theme from previous theme. | |
bool | show_theme_dialog (wxWindow *parent) |
Shows a dialog with all themes, allowing you to choose one. | |
const auto & | theme () const |
Returns the current theme. | |
const name_values_t & | theme_macros () const |
Returns the theme macros for the current theme. | |
Static Public Member Functions | |
static lexers * | get (bool createOnDemand=true) |
Returns the lexers object. | |
static lexers * | set (lexers *lexers) |
Sets the object as the current one, returns the pointer to the previous current object (both the parameter and returned value may be nullptr). | |
Collection of all lexers.
The lexers are loaded from wex-lexers.xml, this is done automatically during the first get call.
void wex::lexers::apply_margin_text_style | ( | factory::stc * | stc, |
const blame * | info ) const |
Applies margin text style to stc line.
If text is supplied also sets margin text.
stc | stc component |
info | blame info to use |
|
static |
Returns the lexers object.
If this is the first invocation, and createOnDemand is true, it also invokes load_document.
const std::string & wex::lexers::keywords | ( | const std::string & | set | ) | const |
Returns the keywords for the specified named set of keywords.
Returns empty string if set does not exist.
bool wex::lexers::load_document | ( | ) |
Loads all lexers from document.
Returns true if the document is loaded.
bool wex::lexers::show_theme_dialog | ( | wxWindow * | parent | ) |
Shows a dialog with all themes, allowing you to choose one.
Returns true and sets current theme if you select one.