GtkSource.GutterRenderer¶
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/c |
The alignment mode |
||
r/w |
The background color |
||
r/w/c |
Whether the background color is set |
||
r/w/c |
The size |
||
r |
The view |
||
r/w/c |
Visible |
||
r |
The window type |
||
r/w/c |
The x-alignment |
||
r/w/c |
The x-padding |
||
r/w/c |
The y-alignment |
||
r/w/c |
The y-padding |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
The |
|
The |
|
The |
|
The |
|
The |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class GtkSource.GutterRenderer(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
- activate(iter, area, event)¶
- Parameters:
iter (
Gtk.TextIter
) – aGtk.TextIter
at the start of the line where the renderer is activatedarea (
Gdk.Rectangle
) – aGdk.Rectangle
of the cell area where the renderer is activatedevent (
Gdk.Event
) – the event that triggered the activation
Emits the
GtkSource.GutterRenderer
::activate
signal of the renderer. This is called fromGtkSource.Gutter
and should never have to be called manually.
- begin(cr, background_area, cell_area, start, end)¶
- Parameters:
cr (
cairo.Context
) – acairo.Context
background_area (
Gdk.Rectangle
) – aGdk.Rectangle
cell_area (
Gdk.Rectangle
) – aGdk.Rectangle
start (
Gtk.TextIter
) – aGtk.TextIter
end (
Gtk.TextIter
) – aGtk.TextIter
Called when drawing a region begins. The region to be drawn is indicated by start and end. The purpose is to allow the implementation to precompute some state before the draw method is called for each cell.
- draw(cr, background_area, cell_area, start, end, state)¶
- Parameters:
cr (
cairo.Context
) – the cairo render contextbackground_area (
Gdk.Rectangle
) – aGdk.Rectangle
indicating the total area to be drawncell_area (
Gdk.Rectangle
) – aGdk.Rectangle
indicating the area to draw contentstart (
Gtk.TextIter
) – aGtk.TextIter
end (
Gtk.TextIter
) – aGtk.TextIter
state (
GtkSource.GutterRendererState
) – aGtkSource.GutterRendererState
Main renderering method. Implementations should implement this method to draw onto the cairo context. The background_area indicates the total area of the cell to be drawn. The cell_area indicates the area where content can be drawn (text, images, etc).
The background_area is the cell_area plus the padding on each side (two times the
GtkSource.GutterRenderer
:xpad
horizontally and two times theGtkSource.GutterRenderer
:ypad
vertically, so that the cell_area is centered inside background_area).The state argument indicates the current state of the renderer and should be taken into account to properly draw the different possible states (cursor, prelit, selected) if appropriate.
- end()¶
Called when drawing a region of lines has ended.
- get_alignment()¶
- Returns:
- Return type:
Get the x-alignment and y-alignment of the gutter renderer.
- get_alignment_mode()¶
- Returns:
- Return type:
Get the alignment mode. The alignment mode describes the manner in which the renderer is aligned (see
:xalign
and:yalign
).
- get_background()¶
- Returns:
True
if the background color is set,False
otherwise- color:
return value for a
Gdk.RGBA
- Return type:
Get the background color of the renderer.
- get_padding()¶
- Returns:
- Return type:
Get the x-padding and y-padding of the gutter renderer.
- get_view()¶
- Returns:
- Return type:
Get the view associated to the gutter renderer
- get_visible()¶
-
Get whether the gutter renderer is visible.
- get_window_type()¶
- Returns:
- Return type:
Get the
Gtk.TextWindowType
associated with the gutter renderer.
- query_activatable(iter, area, event)¶
- Parameters:
iter (
Gtk.TextIter
) – aGtk.TextIter
at the start of the line to be activatedarea (
Gdk.Rectangle
) – aGdk.Rectangle
of the cell area to be activatedevent (
Gdk.Event
) – the event that triggered the query
- Returns:
- Return type:
Get whether the renderer is activatable at the location in event. This is called from
GtkSource.Gutter
to determine whether a renderer is activatable using the mouse pointer.
- query_data(start, end, state)¶
- Parameters:
start (
Gtk.TextIter
) – aGtk.TextIter
.end (
Gtk.TextIter
) – aGtk.TextIter
.state (
GtkSource.GutterRendererState
) – aGtkSource.GutterRendererState
.
Emit the
GtkSource.GutterRenderer
::query-data
signal. This function is called to query for data just before rendering a cell. This is called from theGtkSource.Gutter
. Implementations can override the default signal handler or can connect a signal handler externally to theGtkSource.GutterRenderer
::query-data
signal.
- query_tooltip(iter, area, x, y, tooltip)¶
- Parameters:
iter (
Gtk.TextIter
) – aGtk.TextIter
.area (
Gdk.Rectangle
) – aGdk.Rectangle
.x (
int
) – The x position of the tooltip.y (
int
) – The y position of the tooltip.tooltip (
Gtk.Tooltip
) – aGtk.Tooltip
.
- Returns:
- Return type:
Emits the
GtkSource.GutterRenderer
::query-tooltip
signal. This function is called fromGtkSource.Gutter
. Implementations can override the default signal handler or can connect to the signal externally.
- queue_draw()¶
Emits the
GtkSource.GutterRenderer
::queue-draw
signal of the renderer. Call this from an implementation to inform that the renderer has changed such that it needs to redraw.
- set_alignment(xalign, yalign)¶
-
Set the alignment of the gutter renderer. Both xalign and yalign can be -1, which means the values will not be changed (this allows changing only one of the values).
xalign is the horizontal alignment. Set to 0 for a left alignment. 1 for a right alignment. And 0.5 for centering the cells. yalign is the vertical alignment. Set to 0 for a top alignment. 1 for a bottom alignment.
- set_alignment_mode(mode)¶
- Parameters:
mode (
GtkSource.GutterRendererAlignmentMode
) – aGtkSource.GutterRendererAlignmentMode
Set the alignment mode. The alignment mode describes the manner in which the renderer is aligned (see
:xalign
and:yalign
).
- set_background(color)¶
-
Set the background color of the renderer. If color is set to
None
, the renderer will not have a background color.
- set_padding(xpad, ypad)¶
-
Set the padding of the gutter renderer. Both xpad and ypad can be -1, which means the values will not be changed (this allows changing only one of the values).
xpad is the left and right padding. ypad is the top and bottom padding.
- set_size(size)¶
- Parameters:
size (
int
) – the size
Sets the size of the renderer. A value of -1 specifies that the size is to be determined dynamically.
- set_visible(visible)¶
- Parameters:
visible (
bool
) – the visibility
Set whether the gutter renderer is visible.
- do_activate(iter, area, event) virtual¶
- Parameters:
iter (
Gtk.TextIter
) – aGtk.TextIter
at the start of the line where the renderer is activatedarea (
Gdk.Rectangle
) – aGdk.Rectangle
of the cell area where the renderer is activatedevent (
Gdk.Event
) – the event that triggered the activation
Emits the
GtkSource.GutterRenderer
::activate
signal of the renderer. This is called fromGtkSource.Gutter
and should never have to be called manually.
- do_begin(cr, background_area, cell_area, start, end) virtual¶
- Parameters:
cr (
cairo.Context
) – acairo.Context
background_area (
Gdk.Rectangle
) – aGdk.Rectangle
cell_area (
Gdk.Rectangle
) – aGdk.Rectangle
start (
Gtk.TextIter
) – aGtk.TextIter
end (
Gtk.TextIter
) – aGtk.TextIter
Called when drawing a region begins. The region to be drawn is indicated by start and end. The purpose is to allow the implementation to precompute some state before the draw method is called for each cell.
- do_change_buffer(old_buffer) virtual¶
- Parameters:
old_buffer (
Gtk.TextBuffer
orNone
) – the oldGtk.TextBuffer
.
This is called when the text buffer changes for renderer.
- do_change_view(old_view) virtual¶
- Parameters:
old_view (
Gtk.TextView
orNone
) – the oldGtk.TextView
.
This is called when the text view changes for renderer.
- do_draw(cr, background_area, cell_area, start, end, state) virtual¶
- Parameters:
cr (
cairo.Context
) – the cairo render contextbackground_area (
Gdk.Rectangle
) – aGdk.Rectangle
indicating the total area to be drawncell_area (
Gdk.Rectangle
) – aGdk.Rectangle
indicating the area to draw contentstart (
Gtk.TextIter
) – aGtk.TextIter
end (
Gtk.TextIter
) – aGtk.TextIter
state (
GtkSource.GutterRendererState
) – aGtkSource.GutterRendererState
Main renderering method. Implementations should implement this method to draw onto the cairo context. The background_area indicates the total area of the cell to be drawn. The cell_area indicates the area where content can be drawn (text, images, etc).
The background_area is the cell_area plus the padding on each side (two times the
GtkSource.GutterRenderer
:xpad
horizontally and two times theGtkSource.GutterRenderer
:ypad
vertically, so that the cell_area is centered inside background_area).The state argument indicates the current state of the renderer and should be taken into account to properly draw the different possible states (cursor, prelit, selected) if appropriate.
- do_end() virtual¶
Called when drawing a region of lines has ended.
- do_query_activatable(iter, area, event) virtual¶
- Parameters:
iter (
Gtk.TextIter
) – aGtk.TextIter
at the start of the line to be activatedarea (
Gdk.Rectangle
) – aGdk.Rectangle
of the cell area to be activatedevent (
Gdk.Event
) – the event that triggered the query
- Returns:
- Return type:
Get whether the renderer is activatable at the location in event. This is called from
GtkSource.Gutter
to determine whether a renderer is activatable using the mouse pointer.
- do_query_data(start, end, state) virtual¶
- Parameters:
start (
Gtk.TextIter
) – aGtk.TextIter
.end (
Gtk.TextIter
) – aGtk.TextIter
.state (
GtkSource.GutterRendererState
) – aGtkSource.GutterRendererState
.
Emit the
GtkSource.GutterRenderer
::query-data
signal. This function is called to query for data just before rendering a cell. This is called from theGtkSource.Gutter
. Implementations can override the default signal handler or can connect a signal handler externally to theGtkSource.GutterRenderer
::query-data
signal.
- do_query_tooltip(iter, area, x, y, tooltip) virtual¶
- Parameters:
iter (
Gtk.TextIter
) – aGtk.TextIter
.area (
Gdk.Rectangle
) – aGdk.Rectangle
.x (
int
) – The x position of the tooltip.y (
int
) – The y position of the tooltip.tooltip (
Gtk.Tooltip
) – aGtk.Tooltip
.
- Returns:
- Return type:
Emits the
GtkSource.GutterRenderer
::query-tooltip
signal. This function is called fromGtkSource.Gutter
. Implementations can override the default signal handler or can connect to the signal externally.
- do_queue_draw() virtual¶
Emits the
GtkSource.GutterRenderer
::queue-draw
signal of the renderer. Call this from an implementation to inform that the renderer has changed such that it needs to redraw.
Signal Details¶
- GtkSource.GutterRenderer.signals.activate(gutter_renderer, iter, area, event)¶
- Signal Name:
activate
- Flags:
- Parameters:
gutter_renderer (
GtkSource.GutterRenderer
) – The object which received the signaliter (
Gtk.TextIter
) – aGtk.TextIter
area (
Gdk.Rectangle
) – aGdk.Rectangle
event (
Gdk.Event
) – the event that caused the activation
The
::activate
signal is emitted when the renderer is activated.
- GtkSource.GutterRenderer.signals.query_activatable(gutter_renderer, iter, area, event)¶
- Signal Name:
query-activatable
- Flags:
- Parameters:
gutter_renderer (
GtkSource.GutterRenderer
) – The object which received the signaliter (
Gtk.TextIter
) – aGtk.TextIter
area (
Gdk.Rectangle
) – aGdk.Rectangle
event (
Gdk.Event
) – theGdk.Event
that is causing the activatable query
- Return type:
The
::query-activatable
signal is emitted when the renderer can possibly be activated.
- GtkSource.GutterRenderer.signals.query_data(gutter_renderer, start, end, state)¶
- Signal Name:
query-data
- Flags:
- Parameters:
gutter_renderer (
GtkSource.GutterRenderer
) – The object which received the signalstart (
Gtk.TextIter
) – aGtk.TextIter
end (
Gtk.TextIter
) – aGtk.TextIter
state (
GtkSource.GutterRendererState
) – the renderer state
The
::query-data
signal is emitted when the renderer needs to be filled with data just before a cell is drawn. This can be used by general renderer implementations to allow render data to be filled in externally.
- GtkSource.GutterRenderer.signals.query_tooltip(gutter_renderer, iter, area, x, y, tooltip)¶
- Signal Name:
query-tooltip
- Flags:
- Parameters:
gutter_renderer (
GtkSource.GutterRenderer
) – The object which received the signaliter (
Gtk.TextIter
) – aGtk.TextIter
area (
Gdk.Rectangle
) – aGdk.Rectangle
x (
int
) – the x position (in window coordinates)y (
int
) – the y position (in window coordinates)tooltip (
Gtk.Tooltip
) – aGtk.Tooltip
- Return type:
The
::query-tooltip
signal is emitted when the renderer can show a tooltip.
- GtkSource.GutterRenderer.signals.queue_draw(gutter_renderer)¶
- Signal Name:
queue-draw
- Flags:
- Parameters:
gutter_renderer (
GtkSource.GutterRenderer
) – The object which received the signal
The
::queue-draw
signal is emitted when the renderer needs to be redrawn. UseGtkSource.GutterRenderer.queue_draw
() to emit this signal from an implementation of theGtkSource.GutterRenderer
interface.
Property Details¶
- GtkSource.GutterRenderer.props.alignment_mode¶
- Name:
alignment-mode
- Type:
- Default Value:
- Flags:
The alignment mode of the renderer. This can be used to indicate that in the case a cell spans multiple lines (due to text wrapping) the alignment should work on either the full cell, the first line or the last line.
- GtkSource.GutterRenderer.props.background_rgba¶
-
The background color
- GtkSource.GutterRenderer.props.background_set¶
-
Whether the background color is set
- GtkSource.GutterRenderer.props.size¶
-
The size
- GtkSource.GutterRenderer.props.view¶
- Name:
view
- Type:
- Default Value:
- Flags:
The view on which the renderer is placed.
- GtkSource.GutterRenderer.props.visible¶
-
The visibility of the renderer.
- GtkSource.GutterRenderer.props.window_type¶
- Name:
window-type
- Type:
- Default Value:
- Flags:
The window type of the view on which the renderer is placed (left, or right).
- GtkSource.GutterRenderer.props.xalign¶
-
The horizontal alignment of the renderer. Set to 0 for a left alignment. 1 for a right alignment. And 0.5 for centering the cells. A value lower than 0 doesn’t modify the alignment.
- GtkSource.GutterRenderer.props.xpad¶
-
The left and right padding of the renderer.
- GtkSource.GutterRenderer.props.yalign¶
-
The vertical alignment of the renderer. Set to 0 for a top alignment. 1 for a bottom alignment. And 0.5 for centering the cells. A value lower than 0 doesn’t modify the alignment.