gtksourceviewmm: Gsv::Gutter Class Reference

gtksourceviewmm 3.17.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

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

Gutter object for View. More...

`#include <gtksourceviewmm/gutter.h>`

Inheritance diagram for Gsv::Gutter:
[legend]

## Public Member Functions
virtual | ~Gutter ()
GtkSourceGutter* | gobj ()
| Provides access to the underlying C GObject. More...
const GtkSourceGutter* | gobj () const
| Provides access to the underlying C GObject. More...
GtkSourceGutter* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
Glib::RefPtr< Gdk::Window > | get_window ()
| Get the Gdk::Window of the gutter. More...
Glib::RefPtr< const Gdk::Window > | get_window () const
| Get the Gdk::Window of the gutter. More...
void | insert (GutterRenderer* renderer, int position)
| Insert renderer into the gutter. More...
void | remove (GutterRenderer* renderer)
| Removes renderer from gutter. More...
void | reorder (GutterRenderer* renderer, int position)
| Reorders renderer in gutter to new position. More...
void | queue_draw ()
| Invalidates the drawable area of the gutter. More...
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). More...
const GutterRenderer* | get_renderer_at_pos (int x, int y) const
| Finds the Gtk::SourceGutterRenderer at (x, y). More...
Glib::PropertyProxy_ReadOnly< View* > | property_view () const
| The gutters' GtkSourceView. More...
Glib::PropertyProxy_ReadOnly< Gtk::TextWindowType > | property_window_type () const
| The gutters text window type. More...
Glib::PropertyProxy< int > | property_xpad ()
| The x-padding. More...
Glib::PropertyProxy_ReadOnly< int > | property_xpad () const
| The x-padding. More...
Glib::PropertyProxy< int > | property_ypad ()
| The y-padding. More...
Glib::PropertyProxy_ReadOnly< int > | property_ypad () const
| The y-padding. More...
Public Member Functions inherited from Glib::Object
void * | get_data (const QueryQuark &key)
void | set_data (const Quark &key, void *data)
void | set_data (const Quark &key, void *data, DestroyNotify notify)
void | remove_data (const QueryQuark &quark)
void * | steal_data (const QueryQuark &quark)
Glib::RefPtr< Glib::Object > | wrap (GObject *object, bool take_copy=false)
Public Member Functions inherited from Glib::ObjectBase
void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value)
void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const
void | set_property (const Glib::ustring &property_name, const PropertyType &value)
void | get_property (const Glib::ustring &property_name, PropertyType &value) const
void | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void > &slot)
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, const sigc::slot< void > &slot)
void | freeze_notify ()
void | thaw_notify ()
virtual void | reference () const
virtual void | unreference () const
GObject * | gobj ()
const GObject * | gobj () const
GObject * | gobj_copy () const
Public Member Functions inherited from sigc::trackable
| trackable ()
| trackable (const trackable &src)
| ~trackable ()
void | add_destroy_notify_callback (void *data, func_destroy_notify func) const
void | notify_callbacks ()
trackable & | operator= (const trackable &src)
void | remove_destroy_notify_callback (void *data) const

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

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

## Additional Inherited Members
Public Types inherited from Glib::Object
typedef void(* | DestroyNotify) (gpointer data)
Public Types inherited from sigc::trackable
typedef internal::func_destroy_notify | func_destroy_notify
Protected Member Functions inherited from Glib::Object
| Object ()
| Object (const Glib::ConstructParams &construct_params)
| Object (GObject *castitem)
virtual | ~Object ()
Protected Member Functions inherited from Glib::ObjectBase
| ObjectBase ()
| ObjectBase (const char *custom_type_name)
| ObjectBase (const std::type_info &custom_type_info)
virtual | ~ObjectBase ()=0
void | initialize (GObject *castitem)

## 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

virtual Gsv::Gutter::~Gutter | ( |  | ) |
| virtual

## Member Function Documentation

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

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 `0`.

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 `0`.

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

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

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:

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:

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

Provides access to the underlying C GObject.

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

Provides access to the underlying C GObject.

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.

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.

Returns
  `true` if operation succeeded. Otherwise `false`.

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.

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.

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.

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.

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.

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.

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:

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

Removes renderer from gutter.

Since gtksourceviewmm 2.8:

Parameters

  renderer | A Gtk::SourceGutterRenderer.

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.

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

## Friends And Related Function Documentation

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.