InfTextGtkBuffer

InfTextGtkBuffer

Synopsis

                    InfTextGtkBuffer;
InfTextGtkBuffer *  inf_text_gtk_buffer_new             (GtkTextBuffer *buffer,
                                                         InfUserTable *user_table);
GtkTextBuffer *     inf_text_gtk_buffer_get_text_buffer (InfTextGtkBuffer *buffer);
void                inf_text_gtk_buffer_set_active_user (InfTextGtkBuffer *buffer,
                                                         InfTextUser *user);
InfTextUser *       inf_text_gtk_buffer_get_active_user (InfTextGtkBuffer *buffer);
InfTextUser *       inf_text_gtk_buffer_get_author      (InfTextGtkBuffer *buffer,
                                                         GtkTextIter *location);
void                inf_text_gtk_buffer_set_wake_on_cursor_movement
                                                        (InfTextGtkBuffer *buffer,
                                                         gboolean wake);
gboolean            inf_text_gtk_buffer_get_wake_on_cursor_movement
                                                        (InfTextGtkBuffer *buffer);
void                inf_text_gtk_buffer_ensure_author_tags_priority
                                                        (InfTextGtkBuffer *buffer);
void                inf_text_gtk_buffer_set_saturation_value
                                                        (InfTextGtkBuffer *buffer,
                                                         gdouble saturation,
                                                         gdouble value);
gdouble             inf_text_gtk_buffer_get_saturation  (InfTextGtkBuffer *buffer);
gdouble             inf_text_gtk_buffer_get_value       (InfTextGtkBuffer *buffer);
void                inf_text_gtk_buffer_show_user_colors
                                                        (InfTextGtkBuffer *buffer,
                                                         gboolean show,
                                                         GtkTextIter *start,
                                                         GtkTextIter *end);

Object Hierarchy

  GObject
   +----InfTextGtkBuffer

Implemented Interfaces

InfTextGtkBuffer implements InfTextBuffer and InfBuffer.

Properties

  "active-user"              InfTextUser*          : Read / Write
  "buffer"                   GtkTextBuffer*        : Read / Write / Construct Only
  "saturation"               gdouble               : Read / Write
  "user-table"               InfUserTable*         : Read / Write / Construct Only
  "value"                    gdouble               : Read / Write
  "wake-on-cursor-movement"  gboolean              : Read / Write

Description

Details

InfTextGtkBuffer

typedef struct _InfTextGtkBuffer InfTextGtkBuffer;


inf_text_gtk_buffer_new ()

InfTextGtkBuffer *  inf_text_gtk_buffer_new             (GtkTextBuffer *buffer,
                                                         InfUserTable *user_table);

Creates a new InfTextGtkBuffer wrapping buffer. It implements the InfTextBuffer interface by using buffer to store the text. User colors are read from the users from user_table.

buffer :

The underlaying GtkTextBuffer.

user_table :

The InfUserTable containing the participating users.

Returns :

A InfTextGtkBuffer.

inf_text_gtk_buffer_get_text_buffer ()

GtkTextBuffer *     inf_text_gtk_buffer_get_text_buffer (InfTextGtkBuffer *buffer);

Returns the underlaying GtkTextBuffer.

buffer :

A InfTextGtkBuffer.

Returns :

A GtkTextBuffer.

inf_text_gtk_buffer_set_active_user ()

void                inf_text_gtk_buffer_set_active_user (InfTextGtkBuffer *buffer,
                                                         InfTextUser *user);

Sets the active user for buffer. The active user is the user by which edits not issued through the InfTextBuffer interface are performed (for example, edits by the user when the underlaying buffer is displayed in a GtkTextView).

Note that such modifications should not be performed when no active user is set. Note also the active user must be available and have the INF_USER_LOCAL flag set.

buffer :

A InfTextGtkBuffer.

user :

A InfTextUser, or NULL.

inf_text_gtk_buffer_get_active_user ()

InfTextUser *       inf_text_gtk_buffer_get_active_user (InfTextGtkBuffer *buffer);

Returns the current active user for buffer.

buffer :

A InfTextGtkBuffer.

Returns :

A InfTextUser.

inf_text_gtk_buffer_get_author ()

InfTextUser *       inf_text_gtk_buffer_get_author      (InfTextGtkBuffer *buffer,
                                                         GtkTextIter *location);

Returns the InfTextUser which wrote the character at location. If there is no such user, then NULL is returned.

buffer :

A InfTextGtkBuffer.

location :

A GtkTextIter which is not the end iterator.

Returns :

A InfTextUser, or NULL.

inf_text_gtk_buffer_set_wake_on_cursor_movement ()

void                inf_text_gtk_buffer_set_wake_on_cursor_movement
                                                        (InfTextGtkBuffer *buffer,
                                                         gboolean wake);

This function spcecifies whether movement of the insertion point or selection bound of the underlying text buffer causes the active user (see inf_text_gtk_buffer_set_active_user()) to become active when its status is INF_USER_STATUS_INACTIVE.

If wake is TRUE, then the user status changes to INF_USER_STATUS_ACTIVE in that case. If wake is FALSE, then the user status stays INF_USER_STATUS_INACTIVE, and its caret-position and selection-length properties will be no longer be synchronized to the buffer marks until the user is set active again.

buffer :

A InfTextGtkBuffer.

wake :

Whether to make inactive users active on cursor movement.

inf_text_gtk_buffer_get_wake_on_cursor_movement ()

gboolean            inf_text_gtk_buffer_get_wake_on_cursor_movement
                                                        (InfTextGtkBuffer *buffer);

Returns whether movement of the insertion point or selection bound of the underlying text buffer causes whether the active user (see inf_text_gtk_buffer_set_active_user()) to become active when its status is INF_USER_STATUS_INACTIVE. See also inf_text_gtk_buffer_set_wake_on_cursor_movement().

buffer :

A InfTextGtkBuffer.

Returns :

Whether to make inactive users active when the insertion mark is moved.

inf_text_gtk_buffer_ensure_author_tags_priority ()

void                inf_text_gtk_buffer_ensure_author_tags_priority
                                                        (InfTextGtkBuffer *buffer);

Ensures that all author tags have the lowest priority of all tags in the underlying GtkTextBuffer's tag table. Normally you do not need to use this function if you do not set the priority for your tags explicitely. However, if you do (or are forced to do, because you are using a library that does this, such as GtkSourceView), then you can call this function afterwards to make sure all the user tags have the lowest priority.

buffer :

A InfTextGtkBuffer.

inf_text_gtk_buffer_set_saturation_value ()

void                inf_text_gtk_buffer_set_saturation_value
                                                        (InfTextGtkBuffer *buffer,
                                                         gdouble saturation,
                                                         gdouble value);

Sets the saturation and value to use for user colors in a HSV color model. The hue is defined by each user's individual color. The reason why S and V are set locally the same for all users is that they can be adjusted depending on one's theme: Dark themes want dark user colors, bright themes want bright ones.

buffer :

A InfTextGtkBuffer.

saturation :

Saturation to use for user colors.

value :

Value to use for user colors.

inf_text_gtk_buffer_get_saturation ()

gdouble             inf_text_gtk_buffer_get_saturation  (InfTextGtkBuffer *buffer);

Returns the saturation part of the HSV user color.

buffer :

A InfTextGtkBuffer.

Returns :

The saturation used for user colors.

inf_text_gtk_buffer_get_value ()

gdouble             inf_text_gtk_buffer_get_value       (InfTextGtkBuffer *buffer);

Returns the value part of the HSV user color.

buffer :

A InfTextGtkBuffer.

Returns :

The value used for user colors.

inf_text_gtk_buffer_show_user_colors ()

void                inf_text_gtk_buffer_show_user_colors
                                                        (InfTextGtkBuffer *buffer,
                                                         gboolean show,
                                                         GtkTextIter *start,
                                                         GtkTextIter *end);

If show is FALSE, then don't show user colors (which user wrote what text) as the background of the text, in the range from start to end. If show is TRUE, show user colors if they have previously been hidden via a call to this function with show being FALSE.

buffer :

A InfTextGtkBuffer.

show :

Whether to show or hide user colors.

start :

Beginning of the range for which to show or hide user colors.

end :

End of the range for which to show or hide user colors.

Property Details

The "active-user" property

  "active-user"              InfTextUser*          : Read / Write

The user currently inserting text locally.


The "buffer" property

  "buffer"                   GtkTextBuffer*        : Read / Write / Construct Only

The underlaying GtkTextBuffer.


The "saturation" property

  "saturation"               gdouble               : Read / Write

Saturation of user colors in a HSV color model.

Allowed values: [0,1]

Default value: 0.35


The "user-table" property

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

A user table of the participating users.


The "value" property

  "value"                    gdouble               : Read / Write

Value of user colors in a HSV color model.

Allowed values: [0,1]

Default value: 1


The "wake-on-cursor-movement" property

  "wake-on-cursor-movement"  gboolean              : Read / Write

Whether to make inactive users active when the insertion mark in the TextBuffer moves.

Default value: FALSE