![]() |
![]() |
![]() |
libinftext-0.3 Reference Manual | ![]() |
---|---|---|---|---|
enum InfTextSessionError; InfTextSession; InfTextSession* inf_text_session_new (InfCommunicationManager *manager, InfTextBuffer *buffer, InfIo *io, InfCommunicationGroup *sync_group, InfXmlConnection *sync_connection); InfTextSession* inf_text_session_new_with_user_table (InfCommunicationManager *manager, InfTextBuffer *buffer, InfIo *io, InfUserTable *user_table, InfCommunicationGroup *sync_group, InfXmlConnection *sync_connection); void inf_text_session_set_user_color (InfTextSession *session, InfTextUser *user, gdouble hue); void inf_text_session_flush_requests_for_user (InfTextSession *session, InfTextUser *user);
typedef enum _InfTextSessionError { INF_TEXT_SESSION_ERROR_INVALID_HUE, INF_TEXT_SESSION_ERROR_FAILED } InfTextSessionError;
InfTextSession* inf_text_session_new (InfCommunicationManager *manager, InfTextBuffer *buffer, InfIo *io, InfCommunicationGroup *sync_group, InfXmlConnection *sync_connection);
Creates a new InfTextSession. The communication manager is used to send
and receive requests from subscription and synchronization. buffer
will be
set to be initially empty if the session is initially synchronized
(see below). io
is required to trigger timeouts.
If sync_group
is not NULL
, the session will initially be sychronized,
meaning the initial content is retrieved from sync_connection
. If you are
subscribed to the session, set the subscription group via
inf_session_set_subscription_group()
.
|
A InfCommunicationManager. |
|
An initial InfTextBuffer. |
|
A InfIo object. |
|
A group in which the session is synchronized, or NULL .
|
|
A connection to synchronize the session from. Ignored if
sync_group is NULL .
|
Returns : |
A new InfTextSession. |
InfTextSession* inf_text_session_new_with_user_table (InfCommunicationManager *manager, InfTextBuffer *buffer, InfIo *io, InfUserTable *user_table, InfCommunicationGroup *sync_group, InfXmlConnection *sync_connection);
Creates a new InfTextSession. The connection manager is used to send and
receive requests from subscription and synchronization. buffer
will be
set to be initially empty if the session is initially synchronized
(see below). io
is required to trigger timeouts.
If sync_group
is not NULL
, the session will initially be sychronized,
meaning the initial content is retrieved from sync_connection
. If you are
subscribed to the session, set the subscription group via
inf_session_set_subscription_group()
.
user_table
is used as an initial user table. The user table should only
contain unavailable users, if any, that may rejoin during the session. If
there was an available user in the user table, it would probably belong
to another session, but different sessions cannot share the same user
object.
|
A InfCommunicationManager. |
|
An initial InfTextBuffer. |
|
A InfIo object. |
|
A InfUserTable. |
|
A group in which the session is synchronized, or NULL .
|
|
A connection to synchronize the session from. Ignored if
sync_group is NULL .
|
Returns : |
A new InfTextSession. |
void inf_text_session_set_user_color (InfTextSession *session, InfTextUser *user, gdouble hue);
Changes the user color of user
. user
must have the INF_USER_LOCAL
flag
set.
|
A InfTextSession. |
|
A local InfTextUser from session 's user table.
|
|
New hue value for user 's color. Ranges from 0.0 (red) to 1.0 (red).
|
void inf_text_session_flush_requests_for_user (InfTextSession *session, InfTextUser *user);
This function sends all pending requests for user
immediately. Requests
that modify the buffer are not queued normally, but cursor movement
requests are delayed in case are issued frequently, to save bandwidth.
The main purpose of this function is to send all pending requests before changing a user's status to inactive or unavailable since inactive users are automatically activated as soon as they issue a request.
TODO: We should probably detect this automatically, without requiring people to call this function.
user
must have the INF_USER_LOCAL
flag set.
|
A InfTextSession. |
|
The InfTextUser for which to flush messages. |
"caret-update-interval"
property"caret-update-interval" guint : Read / Write / Construct
Minimum number of milliseconds between caret update broadcasts.
Default value: 500