Geany dev
Data Structures | Typedefs | Functions
highlighting.h File Reference

Syntax highlighting for the different filetypes, using the Scintilla lexers. More...

Data Structures

struct  GeanyLexerStyle
 Fields representing the different attributes of a Scintilla lexer style. More...
 

Typedefs

typedef struct GeanyLexerStyle GeanyLexerStyle
 Fields representing the different attributes of a Scintilla lexer style. More...
 

Functions

const GeanyLexerStylehighlighting_get_style (gint ft_id, gint style_id)
 Retrieves a style style_id for the filetype ft_id. More...
 
gboolean highlighting_is_code_style (gint lexer, gint style)
 Checks whether the given style is normal code (not string, comment, preprocessor, etc). More...
 
gboolean highlighting_is_comment_style (gint lexer, gint style)
 Checks whether the given style is a comment for the given lexer. More...
 
gboolean highlighting_is_string_style (gint lexer, gint style)
 Checks whether the given style is a string for the given lexer. More...
 
void highlighting_set_styles (ScintillaObject *sci, GeanyFiletype *ft)
 Sets up highlighting and other visual settings. More...
 

Detailed Description

Syntax highlighting for the different filetypes, using the Scintilla lexers.

Typedef Documentation

◆ GeanyLexerStyle

Fields representing the different attributes of a Scintilla lexer style.

See also
Scintilla messages SCI_STYLEGETFORE, etc, for use with scintilla_send_message().

Function Documentation

◆ highlighting_get_style()

const GeanyLexerStyle * highlighting_get_style ( gint  ft_id,
gint  style_id 
)

Retrieves a style style_id for the filetype ft_id.

If the style was not already initialised (e.g. by by opening a file of this type), it will be initialised. The returned pointer is owned by Geany and must not be freed.

Parameters
ft_idFiletype ID, e.g. GEANY_FILETYPES_DIFF.
style_idA Scintilla lexer style, e.g. SCE_DIFF_ADDED. See scintilla/lexilla/include/SciLexer.h.
Returns
A pointer to the style struct.
See also
Scintilla messages SCI_STYLEGETFORE, etc, for use with scintilla_send_message().

◆ highlighting_is_code_style()

gboolean highlighting_is_code_style ( gint  lexer,
gint  style 
)

Checks whether the given style is normal code (not string, comment, preprocessor, etc).

Parameters
lexerScintilla lexer type (SCLEX_*).
styleScintilla style (SCE_*).
Returns
TRUE if the style is code, FALSE otherwise.

◆ highlighting_is_comment_style()

gboolean highlighting_is_comment_style ( gint  lexer,
gint  style 
)

Checks whether the given style is a comment for the given lexer.

Parameters
lexerScintilla lexer type (SCLEX_*).
styleScintilla style (SCE_*).
Returns
TRUE if the style is a comment, FALSE otherwise.

◆ highlighting_is_string_style()

gboolean highlighting_is_string_style ( gint  lexer,
gint  style 
)

Checks whether the given style is a string for the given lexer.

Parameters
lexerScintilla lexer type (SCLEX_*).
styleScintilla style (SCE_*).
Returns
TRUE if the style is a string, FALSE otherwise.

◆ highlighting_set_styles()

void highlighting_set_styles ( ScintillaObject *  sci,
GeanyFiletype ft 
)

Sets up highlighting and other visual settings.

Parameters
sciScintilla widget.
ftFiletype settings to use.