![]() |
![]() |
![]() |
libinftext-0.5 Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
enum InfTextSessionError; InfTextSession; InfTextSession * inf_text_session_new (InfCommunicationManager *manager
,InfTextBuffer *buffer
,InfIo *io
,InfSessionStatus status
,InfCommunicationGroup *sync_group
,InfXmlConnection *sync_connection
); InfTextSession * inf_text_session_new_with_user_table (InfCommunicationManager *manager
,InfTextBuffer *buffer
,InfIo *io
,InfUserTable *user_table
,InfSessionStatus status
,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
,InfSessionStatus status
,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 status
is INF_SESSION_PRESYNC
or INF_SESSION_SYNCHRONIZING
, then 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. |
|
The initial status of the session. |
|
A group in which the session is synchronized. Ignored if
status is INF_SESSION_RUNNING . |
|
A connection to synchronize the session from. Ignored if
status is INF_SESSION_RUNNING . |
Returns : |
A new InfTextSession. |
InfTextSession * inf_text_session_new_with_user_table (InfCommunicationManager *manager
,InfTextBuffer *buffer
,InfIo *io
,InfUserTable *user_table
,InfSessionStatus status
,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 status
is INF_SESSION_PRESYNC
or INF_SESSION_SYNCHRONIZING
, then 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. |
|
The initial status for the session. |
|
A group in which the session is synchronized. Ignored if
status is INF_SESSION_RUNNING . |
|
A connection to synchronize the session from. Ignored if
status is INF_SESSION_RUNNING . |
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, i.e. flush requests for local users just before they become inactive.
user
must have the INF_USER_LOCAL
flag set.
|
A InfTextSession. |
|
The InfTextUser for which to flush messages. |