Class: GtkSource::SpaceDrawer

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Constructor Details

#initializeGtkSource::SpaceDrawer

Creates a new Gtk::SourceSpaceDrawer object.

Useful for storing space drawing settings independently of a [classView].

Instance Method Details

#bind_matrix_setting(settings, key, flags) ⇒ nil

Binds the [propertySpaceDrawer:matrix] property to a [classGio.Settings] key.

The [classGio.Settings] key must be of the same type as the [propertySpaceDrawer:matrix] property, that is, "au".

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

Parameters:

  • settings (Gio::Settings)

    a #GSettings object.

  • key (String)

    the settings key to bind.

  • flags (Gio::SettingsBindFlags)

    flags for the binding.

Returns:

  • (nil)

#enable_matrixBoolean

Returns whether the Gtk::SourceSpaceDrawer:matrix property is enabled.

Returns:

  • (Boolean)

    whether the Gtk::SourceSpaceDrawer:matrix property is enabled.

#enable_matrix=(enable_matrix) ⇒ Boolean

Whether the [propertySpaceDrawer:matrix] property is enabled.

Parameters:

  • enable_matrix (Boolean)

Returns:

  • (Boolean)

    enable-matrix

  • (Boolean)

    enable-matrix

#enable_matrix?Boolean

Whether the [propertySpaceDrawer:matrix] property is enabled.

Returns:

  • (Boolean)

    enable-matrix

#get_types_for_locations(locations) ⇒ 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 [propertySpaceDrawer: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.

Parameters:

Returns:

#matrixGLib::Variant

The property is a [structGLib.Variant] property to specify where and what kind of white spaces to draw.

The [structGLib.Variant] is of type "au", an array of unsigned integers. Each integer is a combination of [flagsSpaceTypeFlags]. There is one integer for each [flagsSpaceLocationFlags], in the same order as they are defined in the enum (%GTK_SOURCE_SPACE_LOCATION_NONE and %GTK_SOURCE_SPACE_LOCATION_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 %GTK_SOURCE_SPACE_TYPE_NONE.

By default, %GTK_SOURCE_SPACE_TYPE_ALL is set for all locations.4

Returns:

  • (GLib::Variant)

    matrix

#matrix=(matrix) ⇒ GLib::Variant

The property is a [structGLib.Variant] property to specify where and what kind of white spaces to draw.

The [structGLib.Variant] is of type "au", an array of unsigned integers. Each integer is a combination of [flagsSpaceTypeFlags]. There is one integer for each [flagsSpaceLocationFlags], in the same order as they are defined in the enum (%GTK_SOURCE_SPACE_LOCATION_NONE and %GTK_SOURCE_SPACE_LOCATION_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 %GTK_SOURCE_SPACE_TYPE_NONE.

By default, %GTK_SOURCE_SPACE_TYPE_ALL is set for all locations.4

Parameters:

  • matrix (GLib::Variant)

Returns:

  • (GLib::Variant)

    matrix

  • (GLib::Variant)

    matrix

#set_types_for_locations(locations, types) ⇒ nil

Modifies the [propertySpaceDrawer:matrix] property at the specified locations.

Parameters:

Returns:

  • (nil)