InfText.User

g GObject.Object GObject.Object Infinity.User Infinity.User GObject.Object->Infinity.User InfText.User InfText.User Infinity.AdoptedUser Infinity.AdoptedUser Infinity.AdoptedUser->InfText.User Infinity.User->Infinity.AdoptedUser

Subclasses:

None

Methods

Inherited:

Infinity.AdoptedUser (4), Infinity.User (7), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (id, name, vector, hue)

get_caret_position ()

get_hue ()

get_selection_length ()

set_selection (position, length, by_request)

Virtual Methods

Inherited:

Infinity.User (1), GObject.Object (7)

do_selection_changed (position, length, by_request)

Properties

Inherited:

Infinity.AdoptedUser (2), Infinity.User (5)

Name

Type

Flags

Short Description

caret-position

int

r/w/c

The position of this user’s caret

hue

float

r/w/c

The hue value of the user’s color. saturation and lightness are set by each client individually.

selection-length

int

r/w/c

The number of characters of this user’s selection

Signals

Inherited:

Infinity.User (1), GObject.Object (1)

Name

Short Description

selection-changed

Fields

Inherited:

Infinity.User (1), GObject.Object (1)

Name

Type

Access

Description

parent

Infinity.AdoptedUser

r

Class Details

class InfText.User(**kwargs)
Bases:

Infinity.AdoptedUser

Abstract:

No

Structure:

InfText.UserClass

classmethod new(id, name, vector, hue)
Parameters:
Returns:

A new InfText.User. Free with GObject.Object.unref() when no longer needed.

Return type:

InfText.User

Creates a new InfText.User. id should be unique for all users working together. Infinity.UserTable will refuse to add users with duplicate id. If vector is None, then the vector with all components zero is used.

get_caret_position()
Returns:

self's caret position.

Return type:

int

Returns the position of self's caret.

get_hue()
Returns:

The hue of the self's color.

Return type:

float

Returns the hue of the user’s color as a double ranging from 0 to 1. The other components (saturation and lightness) are not specific to the user and may be chosen indivudually to optimize the actual visual display.

get_selection_length()
Returns:

self's selection length in characters.

Return type:

int

Returns the number of characters this user has selected, starting from the caret position. Negative number mean selection towards the beginning of the buffer.

set_selection(position, length, by_request)
Parameters:
  • position (int) – The new position for the user’s caret.

  • length (int) – The number of characters to select. Negative numbers mean selection towards the beginning.

  • by_request (bool) – True if explicitly requested or False when just an effect of another operation.

Changes self's selection (i.e. caret position and selection length). The by_request parameter should be set to True if the selection change was requested explicitly, for example by the user actively moving the cursor using the mouse or the keyboard. If the cursor position changes only because another user inserted text at a position before the user’s cursor and this results in a change of the selection position, the by_request parameter should be set to False.

do_selection_changed(position, length, by_request) virtual
Parameters:
  • position (int) –

  • length (int) –

  • by_request (bool) –

Signal Details

InfText.User.signals.selection_changed(user, object, p0, p1)
Signal Name:

selection-changed

Flags:

RUN_LAST

Parameters:

Property Details

InfText.User.props.caret_position
Name:

caret-position

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT

The position of this user’s caret

InfText.User.props.hue
Name:

hue

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE, CONSTRUCT

The hue value of the user’s color. saturation and lightness are set by each client individually.

InfText.User.props.selection_length
Name:

selection-length

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT

The number of characters of this user’s selection