InfTextGtk.View

g GObject.Object GObject.Object InfTextGtk.View InfTextGtk.View GObject.Object->InfTextGtk.View

Subclasses:None

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
class new (io, view, user_table)
  get_active_user ()
  get_text_view ()
  get_user_table ()
  set_active_user (user)
  set_show_remote_current_lines (show)
  set_show_remote_cursors (show)
  set_show_remote_selections (show)

Virtual Methods

Inherited:GObject.Object (7)

Properties

Name Type Flags Short Description
active-user InfText.User r/w The user for which to show the view
io Infinity.Io r/w/co The IO object to schedule timeouts
show-remote-current-lines bool r/w Whether to highlight the line in which the cursor of non-local users is
show-remote-cursors bool r/w Whether to show cursors of non-local users
show-remote-selections bool r/w Whether to highlight text selected by non-local users
user-table Infinity.UserTable r/w/co The user table containing the users of the session shown in the view
view Gtk.TextView r/w/co The underlying Gtk.TextView

Signals

Inherited:GObject.Object (1)

Fields

Inherited:GObject.Object (1)
Name Type Access Description
parent GObject.Object r  

Class Details

class InfTextGtk.View(**kwargs)
Bases:GObject.Object
Abstract:No
Structure:InfTextGtk.ViewClass

InfTextGtk.View is an opaque data type. You should only access it via the public API functions.

classmethod new(io, view, user_table)
Parameters:
Returns:

A new InfTextGtk.View.

Return type:

InfTextGtk.View

Creates a new InfTextGtk.View for view. This draws remote user’s cursors and selections into the text view.

get_active_user()
Returns:The active user of self.
Return type:InfText.User or None

Returns the active user of self. See InfTextGtk.View.set_active_user().

get_text_view()
Returns:The InfTextGtk.View’s Gtk.TextView.
Return type:Gtk.TextView

Returns the underlying Gtk.TextView.

get_user_table()
Returns:The InfTextGtk.View’s Infinity.UserTable.
Return type:Infinity.UserTable

Returns the Infinity.UserTable containing the users of the session the InfTextGtk.View’s Gtk.TextView is displaying.

set_active_user(user)
Parameters:user (InfText.User or None) – A user from self’s user table, or None.

Sets the user for which perspective to draw the view. The selection and cursor position is not drawn for this user since it is assumed that the view’s buffer cursor position and selection match the active user ones (which is automatically the case if the buffer is managed by a InfTextGtk.Buffer).

set_show_remote_current_lines(show)
Parameters:show (bool) – Whether to highlight the current line of non-local users.

If show is True then all lines in which the cursor of a non-local user in Infinity.UserStatus.ACTIVE status is is highlighted with that user’s color, similar to GtkSourceView’s “highlight current line” functionality. If it is False then the current line of non-local users is not highlighted.

set_show_remote_cursors(show)
Parameters:show (bool) – Whether to show cursors of non-local users.

If show is True then self draws a cursor for each non-local user in Infinity.UserStatus.ACTIVE status in that user’s color into its underlying Gtk.TextView. If it is False then remote cursors are not drawn.

set_show_remote_selections(show)
Parameters:show (bool) – Whether to show selections of non-local users.

If show is True then self draws the selection ranges for each non-local user in Infinity.UserStatus.ACTIVE status. The selection range is drawn shaded in that user’s color on top of the author color which indicates who wrote the selected text. If more than one user has a given piece of text selected then an alternating stripe pattern with each of the user’s colors is drawn. If show is False then selection ranges of remote users are not drawn.

Property Details

InfTextGtk.View.props.active_user
Name:active-user
Type:InfText.User
Default Value:None
Flags:READABLE, WRITABLE

The user for which to show the view

InfTextGtk.View.props.io
Name:io
Type:Infinity.Io
Default Value:None
Flags:READABLE, WRITABLE, CONSTRUCT_ONLY

The IO object to schedule timeouts

InfTextGtk.View.props.show_remote_current_lines
Name:show-remote-current-lines
Type:bool
Default Value:True
Flags:READABLE, WRITABLE

Whether to highlight the line in which the cursor of non-local users is

InfTextGtk.View.props.show_remote_cursors
Name:show-remote-cursors
Type:bool
Default Value:True
Flags:READABLE, WRITABLE

Whether to show cursors of non-local users

InfTextGtk.View.props.show_remote_selections
Name:show-remote-selections
Type:bool
Default Value:True
Flags:READABLE, WRITABLE

Whether to highlight text selected by non-local users

InfTextGtk.View.props.user_table
Name:user-table
Type:Infinity.UserTable
Default Value:None
Flags:READABLE, WRITABLE, CONSTRUCT_ONLY

The user table containing the users of the session shown in the view

InfTextGtk.View.props.view
Name:view
Type:Gtk.TextView
Default Value:None
Flags:READABLE, WRITABLE, CONSTRUCT_ONLY

The underlying Gtk.TextView