InfTextGtkViewport

InfTextGtkViewport — Drawing position of remote users into the scrollbar

Stability Level

Unstable, unless otherwise indicated

Synopsis

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

                    InfTextGtkViewport;
struct              InfTextGtkViewportClass;
InfTextGtkViewport * inf_text_gtk_viewport_new          (GtkScrolledWindow *scroll,
                                                         InfUserTable *user_table);
GtkScrolledWindow * inf_text_gtk_viewport_get_scrolled_window
                                                        (InfTextGtkViewport *viewport);
InfUserTable *      inf_text_gtk_viewport_get_user_table
                                                        (InfTextGtkViewport *viewport);
void                inf_text_gtk_viewport_set_active_user
                                                        (InfTextGtkViewport *viewport,
                                                         InfTextUser *user);
InfTextUser *       inf_text_gtk_viewport_get_active_user
                                                        (InfTextGtkViewport *viewport);
void                inf_text_gtk_viewport_set_show_user_markers
                                                        (InfTextGtkViewport *viewport,
                                                         gboolean show);

Object Hierarchy

  GObject
   +----InfTextGtkViewport

Properties

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

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.

Details

InfTextGtkViewport

typedef struct _InfTextGtkViewport 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.


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.

scroll :

A GtkScrolledWindow.

user_table :

The InfUserTable for the text session displayed in viewport.

Returns :

A new InfTextGtkViewport.

inf_text_gtk_viewport_get_scrolled_window ()

GtkScrolledWindow * inf_text_gtk_viewport_get_scrolled_window
                                                        (InfTextGtkViewport *viewport);

Returns the underlying GtkScrolledWindow.

viewport :

A InfTextGtkViewport.

Returns :

The InfTextGtkViewport's GtkScrolledWindow.

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.

viewport :

A InfTextGtkViewport.

Returns :

The InfTextGtkViewport's InfUserTable.

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.

viewport :

A InfTextGtkViewport.

user :

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

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().

viewport :

A InfTextGtkViewport.

Returns :

The active user of viewport.

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.

viewport :

A InfTextGtkViewport.

show :

Whether to show the position of non-local users.

Property Details

The "active-user" property

  "active-user"              InfTextUser*          : Read / Write

The user for which to show the viewport.


The "scrolled-window" property

  "scrolled-window"          GtkScrolledWindow*    : Read / Write / Construct Only

The underlying GtkScrolledWindow.


The "show-user-markers" property

  "show-user-markers"        gboolean              : Read / Write

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

Default value: TRUE


The "user-table" property

  "user-table"               InfUserTable*         : Read / Write / Construct Only

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

See Also

InfTextGtkView