GtkSource.Language¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r |
Whether the language should be hidden from the user |
||
r |
Language id |
||
r |
Language name |
||
r |
Language section |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class GtkSource.Language(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Represents a syntax highlighted language.
A
GtkSourceLanguagerepresents a programming or markup language, affecting syntax highlighting and context classes.Use [class`LanguageManager`] to obtain a
GtkSourceLanguageinstance, and [method`Buffer`.set_language] to apply it to a [class`Buffer`].- get_globs()¶
- Returns:
a newly-allocated
Noneterminated array containing the globs orNoneif no globs are found. The returned array must be freed withGLib.strfreev().- Return type:
Returns the globs associated to this language.
This is just an utility wrapper around [method`Language`.get_metadata] to retrieve the “globs” metadata property and split it into an array.
-
Returns whether the language should be hidden from the user.
- get_id()¶
- Returns:
the ID of self.
- Return type:
Returns the ID of the language.
The ID is not locale-dependent.The returned string is owned by self and should not be freed or modified.
- get_metadata(name)¶
- get_mime_types()¶
- Returns:
a newly-allocated
Noneterminated array containing the mime types orNoneif no mime types are found. The returned array must be freed withGLib.strfreev().- Return type:
Returns the mime types associated to this language.
This is just an utility wrapper around [method`Language`.get_metadata] to retrieve the “mimetypes” metadata property and split it into an array.
- get_name()¶
- Returns:
the name of self.
- Return type:
Returns the localized name of the language.
The returned string is owned by self and should not be freed or modified.
- get_section()¶
- Returns:
the section of self.
- Return type:
Returns the localized section of the language.
Each language belong to a section (ex. HTML belongs to the Markup section). The returned string is owned by self and should not be freed or modified.
- get_style_fallback(style_id)¶
- Parameters:
style_id (
str) – a style ID.- Returns:
the ID of the style to use if the specified style_id is not present in the current style scheme or
Noneif the style has no fallback defined. The returned string is owned by the self and must not be modified.- Return type:
Returns the ID of the style to use if the specified style_id is not present in the current style scheme.
- get_style_ids()¶
- Returns:
a newly-allocated
Noneterminated array containing ids of the styles defined by this self orNoneif no style is defined. The returned array must be freed withGLib.strfreev().- Return type:
Returns the ids of the styles defined by this self.
- get_style_name(style_id)¶
- Parameters:
style_id (
str) – a style ID.- Returns:
the name of the style with ID style_id defined by this self or
Noneif the style has no name or there is no style with ID style_id defined by this self. The returned string is owned by the self and must not be modified.- Return type:
Returns the name of the style with ID style_id defined by this self.
Property Details¶
-
Whether the language should be hidden from the user
- GtkSource.Language.props.name¶
-
Language name