Class: GtkSource::Region

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

Instance Method Summary collapse

Constructor Details

#initialize(buffer) ⇒ GtkSource::Region

Returns a new Gtk::SourceRegion object for buffer.

Parameters:

Instance Method Details

#add_region(region_to_add) ⇒ nil

Adds region_to_add to region.

region_to_add is not modified.

Parameters:

  • region_to_add (GtkSource::Region)

    the Gtk::SourceRegion to add to region, or nil.

Returns:

  • (nil)

#add_subregion(_start, _end) ⇒ nil

Adds the subregion delimited by _start and _end to region.

Parameters:

  • _start (Gtk::TextIter)

    the start of the subregion.

  • _end (Gtk::TextIter)

    the end of the subregion.

Returns:

  • (nil)

#bufferGtk::TextBuffer

The [classGtk.TextBuffer]. The Gtk::SourceRegion has a weak reference to the buffer.

Returns:

#buffer=(buffer) ⇒ Gtk::TextBuffer

The [classGtk.TextBuffer]. The Gtk::SourceRegion has a weak reference to the buffer.

Parameters:

Returns:

#get_bounds(start, end) ⇒ Boolean

Gets the start and end bounds of the region.

Parameters:

  • start (Gtk::TextIter)

    iterator to initialize with the start of region, or nil.

  • end (Gtk::TextIter)

    iterator to initialize with the end of region, or nil.

Returns:

  • (Boolean)

    true if start and end have been set successfully (if non-nil), or false if the region is empty.

#get_start_region_iter(iter) ⇒ nil

Initializes a [structRegionIter] to the first subregion of region.

If region is empty, iter will be initialized to the end iterator.

Parameters:

  • iter (GtkSource::RegionIter)

    iterator to initialize to the first subregion.

Returns:

  • (nil)

#intersect_region(region2) ⇒ GtkSource::Region

Returns the intersection between region1 and region2.

region1 and region2 are not modified.

Parameters:

Returns:

#intersect_subregion(_start, _end) ⇒ GtkSource::Region

Returns the intersection between region and the subregion delimited by _start and _end.

region is not modified.

Parameters:

  • _start (Gtk::TextIter)

    the start of the subregion.

  • _end (Gtk::TextIter)

    the end of the subregion.

Returns:

#is_emptyBoolean

Returns whether the region is empty.

A nil region is considered empty.

Returns:

  • (Boolean)

    whether the region is empty.

#subtract_region(region_to_subtract) ⇒ nil

Subtracts region_to_subtract from region.

region_to_subtract is not modified.

Parameters:

  • region_to_subtract (GtkSource::Region)

    the Gtk::SourceRegion to subtract from region, or nil.

Returns:

  • (nil)

#subtract_subregion(_start, _end) ⇒ nil

Subtracts the subregion delimited by _start and _end from region.

Parameters:

  • _start (Gtk::TextIter)

    the start of the subregion.

  • _end (Gtk::TextIter)

    the end of the subregion.

Returns:

  • (nil)

#to_stringString

Gets a string represention of region, for debugging purposes.

The returned string contains the character offsets of the subregions. It doesn't include a newline character at the end of the string.

Returns:

  • (String)

    a string represention of region. Free with g_free() when no longer needed.