FoundryGtk.SourceView

g FoundryGtk.SourceView FoundryGtk.SourceView GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.AccessibleText Gtk.AccessibleText GObject.GInterface->Gtk.AccessibleText Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget Gtk.Scrollable Gtk.Scrollable GObject.GInterface->Gtk.Scrollable GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.TextView Gtk.TextView Gtk.AccessibleText->Gtk.TextView Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.Scrollable->Gtk.TextView GtkSource.View GtkSource.View Gtk.TextView->GtkSource.View Gtk.Widget->Gtk.TextView GtkSource.View->FoundryGtk.SourceView

Subclasses:

None

Methods

Inherited:

GtkSource.View (43), Gtk.TextView (74), Gtk.Widget (183), GObject.Object (37), Gtk.Accessible (18), Gtk.Buildable (1), Gtk.AccessibleText (3), Gtk.Scrollable (9)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new (document)

append_menu (menu)

dup_context ()

dup_document ()

dup_font ()

get_enable_completion ()

get_enable_vim ()

get_line_height ()

get_show_diagnostics ()

get_show_line_changes ()

get_show_line_changes_overview ()

get_vim_im_context ()

get_visual_position (line, line_column)

get_visual_position_range (line, line_column, range)

jump_to_iter (iter, within_margin, use_align, xalign, yalign)

remove_menu (menu)

rename (iter, new_name)

set_enable_completion (enable_completion)

set_enable_vim (enable_vim)

set_font (font)

set_line_height (line_height)

set_show_diagnostics (show_diagnostics)

set_show_line_changes (show_line_changes)

set_show_line_changes_overview (show_line_changes_overview)

Virtual Methods

Inherited:

GtkSource.View (5), Gtk.TextView (12), Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (7), Gtk.Buildable (9), Gtk.AccessibleText (10), Gtk.Scrollable (1)

Properties

Inherited:

GtkSource.View (18), Gtk.TextView (21), Gtk.Widget (35), Gtk.Accessible (1), Gtk.Scrollable (4)

Name

Type

Flags

Short Description

document

Foundry.TextDocument

r/w/co

enable-completion

bool

r/w/en

enable-vim

bool

r/w/en

font

Pango.FontDescription

r/w/en

line-height

float

r/w/en

show-diagnostics

bool

r/w/en

show-line-changes

bool

r/w/en

show-line-changes-overview

bool

r/w/en

vim-im-context

Gtk.IMContext

r

Signals

Inherited:

GtkSource.View (10), Gtk.TextView (15), Gtk.Widget (13), GObject.Object (1)

Fields

Inherited:

GtkSource.View (10), Gtk.TextView (15), Gtk.Widget (13), GObject.Object (1)

Class Details

class FoundryGtk.SourceView(**kwargs)
Bases:

GtkSource.View

Abstract:

No

Structure:

FoundryGtk.SourceViewClass

classmethod new(document)
Parameters:

document (Foundry.TextDocument) –

Return type:

Gtk.Widget

append_menu(menu)
Parameters:

menu (Gio.MenuModel) –

dup_context()
Returns:

the [class`Foundry`.Context] of the document

Return type:

Foundry.Context or None

dup_document()
Return type:

Foundry.TextDocument or None

dup_font()
Return type:

Pango.FontDescription

get_enable_completion()
Return type:

bool

get_enable_vim()
Return type:

bool

get_line_height()
Return type:

float

get_show_diagnostics()
Return type:

bool

get_show_line_changes()
Return type:

bool

get_show_line_changes_overview()
Return type:

bool

get_vim_im_context()
Return type:

Gtk.IMContext or None

This may return None when Vim emulation is not in use.

get_visual_position(line, line_column)
Parameters:
  • line (int) –

  • line_column (int) –

get_visual_position_range(line, line_column, range)
Parameters:
  • line (int) –

  • line_column (int) –

  • range (int) –

jump_to_iter(iter, within_margin, use_align, xalign, yalign)
Parameters:

The goal of this function is to be like Gtk.TextView.scroll_to_iter() but without any of the scrolling animation. We use it to move to a position when animations would cause additional distractions.

New in version 1.1.

remove_menu(menu)
Parameters:

menu (Gio.MenuModel) –

rename(iter, new_name)
Parameters:
  • iter (Gtk.TextIter) – the location of the semantic word to rename

  • new_name (str) – the name for the replacement

Returns:

a [class`Dex`.Future] that resolves to a [iface`Gio`.ListModel] of [class`Foundry`.TextEdit].

Return type:

Dex.Future

Uses the active [class`Foundry`.RenameProvider] to semantically rename the word found at iter with new_name.

set_enable_completion(enable_completion)
Parameters:

enable_completion (bool) –

set_enable_vim(enable_vim)
Parameters:

enable_vim (bool) –

set_font(font)
Parameters:

font (Pango.FontDescription) –

set_line_height(line_height)
Parameters:

line_height (float) –

set_show_diagnostics(show_diagnostics)
Parameters:

show_diagnostics (bool) –

set_show_line_changes(show_line_changes)
Parameters:

show_line_changes (bool) –

set_show_line_changes_overview(show_line_changes_overview)
Parameters:

show_line_changes_overview (bool) –

Property Details

FoundryGtk.SourceView.props.document
Name:

document

Type:

Foundry.TextDocument

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

FoundryGtk.SourceView.props.enable_completion
Name:

enable-completion

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

FoundryGtk.SourceView.props.enable_vim
Name:

enable-vim

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

FoundryGtk.SourceView.props.font
Name:

font

Type:

Pango.FontDescription

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

FoundryGtk.SourceView.props.line_height
Name:

line-height

Type:

float

Default Value:

1.0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Specify a non-default line height for text within the editor. Some applications use this for improved readability.

FoundryGtk.SourceView.props.show_diagnostics
Name:

show-diagnostics

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Shows the line changes on the left-hand side of the editor (when in LTR direction) for each line in the editor. If the line is changed or added, it will be drawn as a different color.

FoundryGtk.SourceView.props.show_line_changes
Name:

show-line-changes

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Shows the line changes on the left-hand side of the editor (when in LTR direction) for each line in the editor. If the line is changed or added, it will be drawn as a different color.

FoundryGtk.SourceView.props.show_line_changes_overview
Name:

show-line-changes-overview

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Shows the line changes on the right-hand side of the editor (when in LTR direction) but as an overview of the entire document. This can give some insight as to where in the document other changes are.

FoundryGtk.SourceView.props.vim_im_context
Name:

vim-im-context

Type:

Gtk.IMContext

Default Value:

None

Flags:

READABLE

Gets the IM context used for vim emulation.