gtksourceviewmm: Gsv::Gutter Class Reference

gtksourceviewmm 3.18.0

Public Member Functions | Static Public Member Functions | Related Symbols | List of all members
Gsv::Gutter Class Reference

Gutter object for View. More...

`#include <gtksourceviewmm/gutter.h>`

Inherits Glib::Object.

## Public Member Functions
| Gutter (Gutter&& src) noexcept
Gutter& | operator= (Gutter&& src) noexcept
| ~Gutter () noexcept override
GtkSourceGutter* | gobj ()
| Provides access to the underlying C GObject.
const GtkSourceGutter* | gobj () const
| Provides access to the underlying C GObject.
GtkSourceGutter* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::RefPtr< Gdk::Window > | get_window ()
| Get the Gdk::Window of the gutter.
Glib::RefPtr< const Gdk::Window > | get_window () const
| Get the Gdk::Window of the gutter.
void | insert (GutterRenderer* renderer, int position)
| Insert renderer into the gutter.
void | remove (GutterRenderer* renderer)
| Removes renderer from gutter.
void | reorder (GutterRenderer* renderer, int position)
| Reorders renderer in gutter to new position.
void | queue_draw ()
| Invalidates the drawable area of the gutter.
void | set_padding (int xpad, int ypad)
void | get_padding (int& xpad, int& ypad) const
GutterRenderer* | get_renderer_at_pos (int x, int y)
| Finds the Gtk::SourceGutterRenderer at (x, y).
const GutterRenderer* | get_renderer_at_pos (int x, int y) const
| Finds the Gtk::SourceGutterRenderer at (x, y).
Glib::PropertyProxy_ReadOnly< View* > | property_view () const
| The gutters' GtkSourceView.
Glib::PropertyProxy_ReadOnly< Gtk::TextWindowType > | property_window_type () const
| The gutters text window type.
Glib::PropertyProxy< int > | property_xpad ()
| The x-padding.
Glib::PropertyProxy_ReadOnly< int > | property_xpad () const
| The x-padding.
Glib::PropertyProxy< int > | property_ypad ()
| The y-padding.
Glib::PropertyProxy_ReadOnly< int > | property_ypad () const
| The y-padding.

## Static Public Member Functions
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system.

## Related Symbols
(Note that these are not member symbols.)
Glib::RefPtr< Gsv::Gutter > | wrap (GtkSourceGutter* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

Gutter object for View.

The Gutter object represents the left and right gutters of the text view. It is used by View to draw the line numbers and category marks that might be present on a line. By packing additional CellRenderer objects in the gutter, you can extend the gutter with your own custom drawings.

The gutter works very much the same way as cells rendered in a Gtk::TreeView. The concept is similar, with the exception that the gutter does not have an underlying Gtk::TreeModel. Instead, you should use set_cell_data_func() to set a callback to fill in any of the cell renderers properties, given the line for which the cell is to be rendered. Renderers are inserted into the gutter at a certain position. The builtin line number renderer is at position View::gutter_position_lines (-30) and the marks renderer is at View::gutter_position_marks (-20). You can use these values to position custom renderers accordingly. The width of a cell renderer can be specified as either fixed (using Gtk::CellRenderer::set_fixed_size()) or dynamic, in which case you must set set_cell_size_func(). This callback is used to set the properties of the renderer such that Gtk::CellRenderer::get_size() yields the maximum width of the cell.

Since gtksourceviewmm 2.10

## Constructor & Destructor Documentation

## ◆ Gutter()

Gsv::Gutter::Gutter | ( | Gutter&& | src | ) |
| noexcept

## ◆ ~Gutter()

Gsv::Gutter::~Gutter | ( |  | ) |
| overridenoexcept

## Member Function Documentation

## ◆ get_padding()

void Gsv::Gutter::get_padding | ( | int & | xpad,
|  | int & | ypad ) const

## ◆ get_renderer_at_pos() [1/2]

GutterRenderer* Gsv::Gutter::get_renderer_at_pos | ( | int | x,
|  | int | y )

Finds the Gtk::SourceGutterRenderer at (x, y).

Parameters

  x | The x position to get identified.
  y | The y position to get identified.

Returns
  The renderer at (x, y) or `nullptr`.

## ◆ get_renderer_at_pos() [2/2]

const GutterRenderer* Gsv::Gutter::get_renderer_at_pos | ( | int | x,
|  | int | y ) const

Finds the Gtk::SourceGutterRenderer at (x, y).

Parameters

  x | The x position to get identified.
  y | The y position to get identified.

Returns
  The renderer at (x, y) or `nullptr`.

## ◆ get_type()

static GType Gsv::Gutter::get_type | ( |  | ) |
| static

Get the GType for this class, for use with the underlying GObject type system.

## ◆ get_window() [1/2]

Glib::RefPtr< Gdk::Window > Gsv::Gutter::get_window | ( |  | ) |

Get the Gdk::Window of the gutter.

The window will only be available when the gutter has at least one, non-zero width, cell renderer packed.

Returns
  The Gdk::Window of the gutter, or empty Glib::RefPtr if the gutter has no window.

Since gtksourceviewmm 2.10

## ◆ get_window() [2/2]

Glib::RefPtr< const Gdk::Window > Gsv::Gutter::get_window | ( |  | ) | const

Get the Gdk::Window of the gutter.

The window will only be available when the gutter has at least one, non-zero width, cell renderer packed.

Returns
  The Gdk::Window of the gutter, or empty Glib::RefPtr if the gutter has no window.

Since gtksourceviewmm 2.10

## ◆ gobj() [1/2]

GtkSourceGutter * Gsv::Gutter::gobj | ( |  | ) |
| inline

Provides access to the underlying C GObject.

## ◆ gobj() [2/2]

const GtkSourceGutter * Gsv::Gutter::gobj | ( |  | ) | const
| inline

Provides access to the underlying C GObject.

## ◆ gobj_copy()

GtkSourceGutter * Gsv::Gutter::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

## ◆ insert()

void Gsv::Gutter::insert | ( | GutterRenderer* | renderer,
|  | int | position )

Insert renderer into the gutter.

If renderer is yet unowned then gutter claims its ownership. Otherwise just increases renderer's reference count. renderer cannot be already inserted to another gutter.

Since gtksourceviewmm 3.0

Parameters

  renderer | A gutter renderer (must inherit from Gtk::SourceGutterRenderer).
  position | The renderer position.

## ◆ operator=()

Gutter& Gsv::Gutter::operator= | ( | Gutter&& | src | ) |
| noexcept

## ◆ property_view()

Glib::PropertyProxy_ReadOnly< View* > Gsv::Gutter::property_view | ( |  | ) | const

The gutters' GtkSourceView.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ property_window_type()

Glib::PropertyProxy_ReadOnly< Gtk::TextWindowType > Gsv::Gutter::property_window_type | ( |  | ) | const

The gutters text window type.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ property_xpad() [1/2]

Glib::PropertyProxy< int > Gsv::Gutter::property_xpad | ( |  | ) |

The x-padding.

Deprecated
  Use GutterRenderer's xpad property instead.

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## ◆ property_xpad() [2/2]

Glib::PropertyProxy_ReadOnly< int > Gsv::Gutter::property_xpad | ( |  | ) | const

The x-padding.

Deprecated
  Use GutterRenderer's xpad property instead.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ property_ypad() [1/2]

Glib::PropertyProxy< int > Gsv::Gutter::property_ypad | ( |  | ) |

The y-padding.

Deprecated
  Use GutterRenderer's ypad property instead.

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## ◆ property_ypad() [2/2]

Glib::PropertyProxy_ReadOnly< int > Gsv::Gutter::property_ypad | ( |  | ) | const

The y-padding.

Deprecated
  Use GutterRenderer's ypad property instead.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ queue_draw()

void Gsv::Gutter::queue_draw | ( |  | ) |

Invalidates the drawable area of the gutter.

You can use this to force a redraw of the gutter if something has changed and needs to be redrawn.

Since gtksourceviewmm 2.8

## ◆ remove()

void Gsv::Gutter::remove | ( | GutterRenderer* | renderer | ) |

Removes renderer from gutter.

Since gtksourceviewmm 2.8

Parameters

  renderer | A Gtk::SourceGutterRenderer.

## ◆ reorder()

void Gsv::Gutter::reorder | ( | GutterRenderer* | renderer,
|  | int | position )

Reorders renderer in gutter to new position.

Since gtksourceviewmm 2.8

Parameters

  renderer | A Gtk::CellRenderer.
  position | The new renderer position.

## ◆ set_padding()

void Gsv::Gutter::set_padding | ( | int | xpad,
|  | int | ypad )

## Friends And Related Symbol Documentation

## ◆ wrap()

Glib::RefPtr< Gsv::Gutter > wrap | ( | GtkSourceGutter * | object,
|  | bool | take_copy = false )
| related

A Glib::wrap() method for this object.

Parameters

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns
  A C++ instance that wraps this C instance.