GtkSource.SpaceDrawer

g GObject.Object GObject.Object GtkSource.SpaceDrawer GtkSource.SpaceDrawer GObject.Object->GtkSource.SpaceDrawer

Subclasses:None

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
class new ()
  bind_matrix_setting (settings, key, flags)
  get_enable_matrix ()
  get_matrix ()
  get_types_for_locations (locations)
  set_enable_matrix (enable_matrix)
  set_matrix (matrix)
  set_types_for_locations (locations, types)

Virtual Methods

Inherited:GObject.Object (7)

Properties

Name Type Flags Short Description
enable-matrix bool r/w/c  
matrix GLib.Variant r/w/c  

Signals

Inherited:GObject.Object (1)

Fields

Inherited:GObject.Object (1)
Name Type Access Description
parent GObject.Object r  

Class Details

class GtkSource.SpaceDrawer(**kwargs)
Bases:GObject.Object
Abstract:No
Structure:GtkSource.SpaceDrawerClass
classmethod new()
Returns:a new GtkSource.SpaceDrawer.
Return type:GtkSource.SpaceDrawer

Creates a new GtkSource.SpaceDrawer object. Useful for storing space drawing settings independently of a GtkSource.View.

New in version 3.24.

bind_matrix_setting(settings, key, flags)
Parameters:

Binds the GtkSource.SpaceDrawer :matrix property to a Gio.Settings key.

The Gio.Settings key must be of the same type as the GtkSource.SpaceDrawer :matrix property, that is, "au".

The Gio.Settings.bind() function cannot be used, because the default GIO mapping functions don’t support GLib.Variant properties (maybe it will be supported by a future GIO version, in which case this function can be deprecated).

New in version 3.24.

get_enable_matrix()
Returns:whether the GtkSource.SpaceDrawer :matrix property is enabled.
Return type:bool

New in version 3.24.

get_matrix()
Returns:the GtkSource.SpaceDrawer :matrix value as a new floating GLib.Variant instance.
Return type:GLib.Variant

Gets the value of the GtkSource.SpaceDrawer :matrix property, as a GLib.Variant. An empty array can be returned in case the matrix is a zero matrix.

The GtkSource.SpaceDrawer.get_types_for_locations() function may be more convenient to use.

New in version 3.24.

get_types_for_locations(locations)
Parameters:locations (GtkSource.SpaceLocationFlags) – one or several GtkSource.SpaceLocationFlags.
Returns:a combination of GtkSource.SpaceTypeFlags.
Return type:GtkSource.SpaceTypeFlags

If only one location is specified, this function returns what kind of white spaces are drawn at that location. The value is retrieved from the GtkSource.SpaceDrawer :matrix property.

If several locations are specified, this function returns the logical AND for those locations. Which means that if a certain kind of white space is present in the return value, then that kind of white space is drawn at all the specified locations.

New in version 3.24.

set_enable_matrix(enable_matrix)
Parameters:enable_matrix (bool) – the new value.

Sets whether the GtkSource.SpaceDrawer :matrix property is enabled.

New in version 3.24.

set_matrix(matrix)
Parameters:matrix (GLib.Variant or None) – the new matrix value, or None.

Sets a new value to the GtkSource.SpaceDrawer :matrix property, as a GLib.Variant. If matrix is None, then an empty array is set.

If matrix is floating, it is consumed.

The GtkSource.SpaceDrawer.set_types_for_locations() function may be more convenient to use.

New in version 3.24.

set_types_for_locations(locations, types)
Parameters:

Modifies the GtkSource.SpaceDrawer :matrix property at the specified locations.

New in version 3.24.

Property Details

GtkSource.SpaceDrawer.props.enable_matrix
Name:enable-matrix
Type:bool
Default Value:False
Flags:READABLE, WRITABLE, CONSTRUCT

Whether the GtkSource.SpaceDrawer :matrix property is enabled.

New in version 3.24.

GtkSource.SpaceDrawer.props.matrix
Name:matrix
Type:GLib.Variant
Default Value:GLib.Variant('au', [15, 15, 15])
Flags:READABLE, WRITABLE, CONSTRUCT

The :matrix property is a GLib.Variant property to specify where and what kind of white spaces to draw.

The GLib.Variant is of type "au", an array of unsigned integers. Each integer is a combination of GtkSource.SpaceTypeFlags. There is one integer for each GtkSource.SpaceLocationFlags, in the same order as they are defined in the enum (GtkSource.SpaceLocationFlags.NONE and GtkSource.SpaceLocationFlags.ALL are not taken into account).

If the array is shorter than the number of locations, then the value for the missing locations will be GtkSource.SpaceTypeFlags.NONE.

By default, GtkSource.SpaceTypeFlags.ALL is set for all locations.

New in version 3.24.