InfTextGtkViewport

InfTextGtkViewport — Drawing position of remote users into the scrollbar

Stability Level

Unstable, unless otherwise indicated

Functions

Properties

InfTextUser * active-user Read / Write
GtkScrolledWindow * scrolled-window Read / Write / Construct Only
gboolean show-user-markers Read / Write
InfUserTable * user-table Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── InfTextGtkViewport

Includes

#include <libinftextgtk/inf-text-gtk-viewport.h>

Description

InfTextGtkViewport is a helper object which, as long as it is alive, draws the location of the cursor of remote users into the scrollbar of a GtkScrolledWindow containing a GtkTextView.

The function inf_text_gtk_viewport_set_active_user() can be used to skip drawing the location of the user working locally on the document, if there is any.

See InfTextGtkView for drawing the cursor and selected region of remote users into a GtkTextView.

Functions

inf_text_gtk_viewport_new ()

InfTextGtkViewport *
inf_text_gtk_viewport_new (GtkScrolledWindow *scroll,
                           InfUserTable *user_table);

Creates a new InfTextGtkViewport for scroll . This draws the position of remote user's cursors into the scrollbars of scroll .

[constructor]

Parameters

scroll

A GtkScrolledWindow.

 

user_table

The InfUserTable for the text session displayed in viewport .

 

Returns

A new InfTextGtkViewport.

[transfer full]


inf_text_gtk_viewport_get_scrolled_window ()

GtkScrolledWindow *
inf_text_gtk_viewport_get_scrolled_window
                               (InfTextGtkViewport *viewport);

Returns the underlying GtkScrolledWindow.

Parameters

viewport

A InfTextGtkViewport.

 

Returns

The InfTextGtkViewport's GtkScrolledWindow.

[transfer none]


inf_text_gtk_viewport_get_user_table ()

InfUserTable *
inf_text_gtk_viewport_get_user_table (InfTextGtkViewport *viewport);

Returns the InfUserTable containing the users of the session the InfTextGtkViewport's GtkScrolledWindow is displaying.

Parameters

viewport

A InfTextGtkViewport.

 

Returns

The InfTextGtkViewport's InfUserTable.

[transfer none]


inf_text_gtk_viewport_set_active_user ()

void
inf_text_gtk_viewport_set_active_user (InfTextGtkViewport *viewport,
                                       InfTextUser *user);

Sets the user for which perspective to draw the viewport. The cursor position for teh active user is not draws since it is assumed that the viewport's "real" scrollbars match the active user's position.

Parameters

viewport

A InfTextGtkViewport.

 

user

A user from viewport 's user table, or NULL.

[allow-none]

inf_text_gtk_viewport_get_active_user ()

InfTextUser *
inf_text_gtk_viewport_get_active_user (InfTextGtkViewport *viewport);

Returns the active user of viewport . See inf_text_gtk_viewport_set_active_user().

Parameters

viewport

A InfTextGtkViewport.

 

Returns

The active user of viewport .

[transfer none][allow-none]


inf_text_gtk_viewport_set_show_user_markers ()

void
inf_text_gtk_viewport_set_show_user_markers
                               (InfTextGtkViewport *viewport,
                                gboolean show);

If show is TRUE then draw a marker indicating the cursor position of all non-local users with status INF_USER_ACTIVE in the scrollbar of the scrolled window. If show is FALSE then do not draw user markers into the scrollbar.

Parameters

viewport

A InfTextGtkViewport.

 

show

Whether to show the position of non-local users.

 

Types and Values

struct InfTextGtkViewport

struct InfTextGtkViewport;

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


struct InfTextGtkViewportClass

struct InfTextGtkViewportClass {
};

This structure does not contain any public fields.

Property Details

The “active-user” property

  “active-user”              InfTextUser *

The user for which to show the viewport.

Owner: InfTextGtkViewport

Flags: Read / Write


The “scrolled-window” property

  “scrolled-window”          GtkScrolledWindow *

The underlying GtkScrolledWindow.

Owner: InfTextGtkViewport

Flags: Read / Write / Construct Only


The “show-user-markers” property

  “show-user-markers”        gboolean

Whether to indicate the position of non-local user's cursors in the scrollbar.

Owner: InfTextGtkViewport

Flags: Read / Write

Default value: TRUE


The “user-table” property

  “user-table”               InfUserTable *

The user table containing the users of the session shown in the viewport.

Owner: InfTextGtkViewport

Flags: Read / Write / Construct Only

See Also

InfTextGtkView