GtkSource.StyleScheme

g GObject.Object GObject.Object GtkSource.StyleScheme GtkSource.StyleScheme GObject.Object->GtkSource.StyleScheme

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_authors ()

get_description ()

get_filename ()

get_id ()

get_metadata (name)

get_name ()

get_style (style_id)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

description

str

r

Style scheme description

filename

str

r

Style scheme filename

id

str

r/w/co

Style scheme id

name

str

r

Style scheme name

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class GtkSource.StyleScheme(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

GtkSource.StyleSchemeClass

Controls the appearance of [class`View`].

GtkSource.StyleScheme contains all the text styles to be used in [class`View`] and [class`Buffer`]. For instance, it contains text styles for syntax highlighting, it may contain foreground and background color for non-highlighted text, color for the line numbers, current line highlighting, bracket matching, etc.

Style schemes are stored in XML files. The format of a scheme file is documented in the style scheme reference.

The two style schemes with IDs “classic” and “tango” follow more closely the GTK theme (for example for the background color).

get_authors()
Returns:

a None-terminated array containing the self authors or None if no author is specified by the style scheme.

Return type:

[str] or None

get_description()
Returns:

self description (if defined), or None.

Return type:

str or None

get_filename()
Returns:

self file name if the scheme was created parsing a style scheme file or None in the other cases.

Return type:

str or None

get_id()
Returns:

self id.

Return type:

str

get_metadata(name)
Parameters:

name (str) – metadata property name.

Returns:

value of property name stored in the metadata of self or None if self does not contain the specified metadata property.

Return type:

str or None

Gets a metadata property from the style scheme.

New in version 5.4.

get_name()
Returns:

self name.

Return type:

str

get_style(style_id)
Parameters:

style_id (str) – id of the style to retrieve.

Returns:

style which corresponds to style_id in the self, or None when no style with this name found. It is owned by self and may not be unref’ed.

Return type:

GtkSource.Style or None

Property Details

GtkSource.StyleScheme.props.description
Name:

description

Type:

str

Default Value:

None

Flags:

READABLE

Style scheme description, a translatable string to present to the user.

GtkSource.StyleScheme.props.filename
Name:

filename

Type:

str

Default Value:

None

Flags:

READABLE

Style scheme filename or None.

GtkSource.StyleScheme.props.id
Name:

id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Style scheme id, a unique string used to identify the style scheme in [class`StyleSchemeManager`].

GtkSource.StyleScheme.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE

Style scheme name, a translatable string to present to the user.