gtksource.gutter_renderer

Module for [GutterRenderer] class

Types 3

Gutter cell renderer.

A gtksource.gutter_renderer.GutterRenderer represents a column in a gtksource.gutter.Gutter. The column contains one cell for each visible line of the gtk.text_buffer.TextBuffer. Due to text wrapping, a cell can thus span multiple lines of the gtk.text_view.TextView. In this case, gtksource.types.GutterRendererAlignmentMode controls the alignment of the cell.

The gutter renderer is a gtk.widget.Widget and is measured using the normal widget measurement facilities. The width of the gutter will be determined by the measurements of the gutter renderers.

The width of a gutter renderer generally takes into account the entire text buffer. For instance, to display the line numbers, if the buffer contains 100 lines, the gutter renderer will always set its width such as three digits can be printed, even if only the first 20 lines are shown. Another strategy is to take into account only the visible lines. In this case, only two digits are necessary to display the line numbers of the first 20 lines. To take another example, the gutter renderer for gtksource.mark.Marks doesn't need to take into account the text buffer to announce its width. It only depends on the icons size displayed in the gutter column.

When the available size to render a cell is greater than the required size to render the cell contents, the cell contents can be aligned horizontally and vertically with gtksource.gutter_renderer.GutterRenderer.setAlignmentMode.

The cells rendering occurs using vfunc@Gtk.Widget.snapshot. Implementations should use gtk_source_gutter_renderer_get_lines() to retrieve information about the lines to be rendered. To help with aligning content which takes into account the padding and alignment of a cell, implementations may call gtksource.gutter_renderer.GutterRenderer.alignCell for a given line number with the width and height measurement of the content they width to render.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
GutterRenderer self() nothrowReturns `this`, for use in `with` statements.
GutterRendererGidBuilder builder() static nothrowGet builder for [gtksource.gutter_renderer.GutterRenderer] Returns: New builder object
gtksource.types.GutterRendererAlignmentMode alignmentMode() @property nothrowGet `alignmentMode` property. Returns: The alignment mode of the renderer.
void alignmentMode(gtksource.types.GutterRendererAlignmentMode propval) @property nothrowSet `alignmentMode` property. Params: propval = The alignment mode of the renderer.
gtksource.gutter_lines.GutterLines lines() @property nothrowGet `lines` property. Returns: Contains information about the lines to be rendered.
gtk.text_view.TextView view() @property nothrowGet `view` property. Returns: The view on which the renderer is placed.
float xalign() @property nothrowGet `xalign` property. Returns: The horizontal alignment of the renderer.
void xalign(float propval) @property nothrowSet `xalign` property. Params: propval = The horizontal alignment of the renderer.
int xpad() @property nothrowGet `xpad` property. Returns: The left and right padding of the renderer.
void xpad(int propval) @property nothrowSet `xpad` property. Params: propval = The left and right padding of the renderer.
float yalign() @property nothrowGet `yalign` property. Returns: The vertical alignment of the renderer.
void yalign(float propval) @property nothrowSet `yalign` property. Params: propval = The vertical alignment of the renderer.
int ypad() @property nothrowGet `ypad` property. Returns: The top and bottom padding of the renderer.
void ypad(int propval) @property nothrowSet `ypad` property. Params: propval = The top and bottom padding of the renderer.
void activate(gtk.text_iter.TextIter iter, gdk.rectangle.Rectangle area, uint button, gdk.types.ModifierType state, int nPresses) nothrowEmits the [gtksource.gutter_renderer.GutterRenderer.activate] signal of the renderer. This is called from [gtksource.gutter.Gutter] and should never have to be called manually.
void alignCell(uint line, float width, float height, out float x, out float y) nothrowLocates where to render content that is width x height based on the renderers alignment and padding.
gtksource.buffer.Buffer getBuffer() nothrowGets the [gtksource.buffer.Buffer] for which the gutter renderer is drawing. Returns: a #GtkTextBuffer or null
gtksource.view.View getView() nothrowGet the view associated to the gutter renderer Returns: a #GtkSourceView
float getXalign() nothrowGets the `xalign` property.
int getXpad() nothrowGets the `xpad` property.
float getYalign() nothrowGets the `yalign` property.
int getYpad() nothrowGets the `ypad` property.
bool queryActivatable(gtk.text_iter.TextIter iter, gdk.rectangle.Rectangle area) nothrowGet whether the renderer is activatable at the location provided. This is called from [gtksource.gutter.Gutter] to determine whether a renderer is activatable using the mouse pointer.
void setAlignmentMode(gtksource.types.GutterRendererAlignmentMode mode) nothrowSet the alignment mode. The alignment mode describes the manner in which the renderer is aligned (see [gtksource.gutter_renderer.GutterRenderer.xalign] and [gtksource.gutter_renderer.GutterRenderer...
void setXalign(float xalign) nothrowAdjusts the `xalign` property.
void setXpad(int xpad) nothrowAdjusts the `xpad` property.
void setYalign(float yalign) nothrowAdjusts the `yalign` property.
void setYpad(int ypad) nothrowAdjusts the `ypad` property.
gulong connectActivate(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == gtk.text_iter.TextIter))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == gdk.rectangle.Rectangle))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] == uint))) && (Parameters!T.length < 4 || (ParameterStorageClassTuple!T[3] == ParameterStorageClass.none && is(Parameters!T[3] == gdk.types.ModifierType))) && (Parameters!T.length < 5 || (ParameterStorageClassTuple!T[4] == ParameterStorageClass.none && is(Parameters!T[4] == int))) && (Parameters!T.length < 6 || (ParameterStorageClassTuple!T[5] == ParameterStorageClass.none && is(Parameters!T[5] : gtksource.gutter_renderer.GutterRenderer))) && Parameters!T.length < 7) nothrowConnect to `Activate` signal.
gulong connectQueryActivatable(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == bool) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == gtk.text_iter.TextIter))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == gdk.rectangle.Rectangle))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : gtksource.gutter_renderer.GutterRenderer))) && Parameters!T.length < 4) nothrowConnect to `QueryActivatable` signal.
gulong connectQueryData(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gobject.object.ObjectWrap))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == uint))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : gtksource.gutter_renderer.GutterRenderer))) && Parameters!T.length < 4) nothrowConnect to `QueryData` signal.
Constructors
this(void * ptr, Flag!"Take" take)

Fluent builder implementation template for gtksource.gutter_renderer.GutterRenderer

Methods
T alignmentMode(gtksource.types.GutterRendererAlignmentMode propval) nothrowSet `alignmentMode` property. Params: propval = The alignment mode of the renderer.
T xalign(float propval) nothrowSet `xalign` property. Params: propval = The horizontal alignment of the renderer.
T xpad(int propval) nothrowSet `xpad` property. Params: propval = The left and right padding of the renderer. Returns: Builder instance for fluent chaining
T yalign(float propval) nothrowSet `yalign` property. Params: propval = The vertical alignment of the renderer.
T ypad(int propval) nothrowSet `ypad` property. Params: propval = The top and bottom padding of the renderer. Returns: Builder instance for fluent chaining
Methods
GutterRenderer build() nothrowCreate object from builder. Returns: New object