Top | ![]() |
![]() |
![]() |
![]() |
InfChatBufferMessage * | inf_chat_buffer_message_copy () |
void | inf_chat_buffer_message_free () |
InfChatBuffer * | inf_chat_buffer_new () |
void | inf_chat_buffer_add_message () |
void | inf_chat_buffer_add_emote_message () |
void | inf_chat_buffer_add_userjoin_message () |
void | inf_chat_buffer_add_userpart_message () |
const InfChatBufferMessage * | inf_chat_buffer_get_message () |
guint | inf_chat_buffer_get_n_messages () |
guint | inf_chat_buffer_get_size () |
enum | InfChatBufferMessageType |
enum | InfChatBufferMessageFlags |
struct | InfChatBufferMessage |
struct | InfChatBuffer |
struct | InfChatBufferClass |
GBoxed ╰── InfChatBufferMessage GEnum ╰── InfChatBufferMessageType GFlags ╰── InfChatBufferMessageFlags GObject ╰── InfChatBuffer
InfChatBufferMessage *
inf_chat_buffer_message_copy (const InfChatBufferMessage *message
);
Creates a copy of the given message.
A new InfChatBufferMessage. Free with
inf_chat_buffer_message_free()
when no longer needed.
[transfer full]
void
inf_chat_buffer_message_free (InfChatBufferMessage *message
);
Frees the given InfChatBufferMessage which must have been created with
inf_chat_buffer_message_copy()
.
InfChatBuffer *
inf_chat_buffer_new (guint size
);
Creates a new InfChatBuffer which contains no initial messages. size
specifies how many messages to store before dropping old messages.
[constructor]
void inf_chat_buffer_add_message (InfChatBuffer *buffer
,InfUser *by
,const gchar *message
,gsize length
,time_t time
,InfChatBufferMessageFlags flags
);
Adds a new message to the chat buffer. If the buffer is full (meaning the number of messages in the buffer equals its size), then an old message will get discarded. If the message to be added is older than all other messages in the buffer, then it will not be added at all.
buffer |
||
by |
A InfUser who wrote the message. |
|
message |
The message text. |
[array length=length] |
length |
The length of |
|
time |
The time at which the user has written the message. |
|
flags |
Flags to set for the message to add. |
void inf_chat_buffer_add_emote_message (InfChatBuffer *buffer
,InfUser *by
,const gchar *message
,gsize length
,time_t time
,InfChatBufferMessageFlags flags
);
Adds a new emote message to the chat buffer. If the buffer is full (meaning the number of messages in the buffer equals its size), then an old message will get discarded. If the message to be added is older than all other messages in the buffer, then it will not be added at all.
buffer |
||
by |
A InfUser who wrote the message. |
|
message |
The message text. |
[array length=length] |
length |
The length of |
|
time |
The time at which the user has written the message. |
|
flags |
Flags to set for the message to add. |
void inf_chat_buffer_add_userjoin_message (InfChatBuffer *buffer
,InfUser *user
,time_t time
,InfChatBufferMessageFlags flags
);
Adds a new userjoin message to the chat buffer. If the buffer is full (meaning the number of messages in the buffer equals its size), then an old message will get discarded. If the message to be added is older than all other messages in the buffer, then it will not be added at all.
buffer |
||
user |
A InfUser who wrote the message. |
|
time |
The time at which the user has written the message. |
|
flags |
Flags to set for the message to add. |
void inf_chat_buffer_add_userpart_message (InfChatBuffer *buffer
,InfUser *user
,time_t time
,InfChatBufferMessageFlags flags
);
Adds a new userpart message to the chat buffer. If the buffer is full (meaning the number of messages in the buffer equals its size), then an old message will get discarded. If the message to be added is older than all other messages in the buffer, then it will not be added at all.
buffer |
||
user |
A InfUser who wrote the message. |
|
time |
The time at which the user has written the message. |
|
flags |
Flags to set for the message to add. |
const InfChatBufferMessage * inf_chat_buffer_get_message (InfChatBuffer *buffer
,guint n
);
Returns the message with the given index from the buffer. The oldest
message in the buffer has index 0, and the most recent one has index
inf_chat_buffer_get_n_messages()
- 1.
guint
inf_chat_buffer_get_n_messages (InfChatBuffer *buffer
);
Returns the number of messages in the buffer.
guint
inf_chat_buffer_get_size (InfChatBuffer *buffer
);
Returns the size of the chat buffer, which is the maximum number of messages that can be stored in the buffer.
struct InfChatBufferMessage { InfChatBufferMessageType type; InfUser* user; gchar* text; gsize length; time_t time; InfChatBufferMessageFlags flags; };
Represents a chat message.
InfChatBufferMessageType |
The InfChatBufferMessageType of the message. |
|
InfUser * |
The InfUser that issued the message. |
|
The UTF-8 encoded text of the message. |
||
The length of the message, in bytes. |
||
The time at which the message was received. |
||
InfChatBufferMessageFlags |
Additional flags for the message, see InfChatBufferMessageFlags. |
struct InfChatBuffer;
InfChatBuffer is an opaque data type. You should only access it via the public API functions.
struct InfChatBufferClass { void (*add_message)(InfChatBuffer* buffer, const InfChatBufferMessage* message); };
This structure contains default signal handlers for InfChatBuffer.
“add-message”
signalvoid user_function (InfChatBuffer *buffer, InfChatBufferMessage *message, gpointer user_data)
This signal is emitted whenever a message has been added to buffer
.
buffer |
The InfChatBuffer that is receiving a message. |
|
message |
The InfChatBufferMessage that was received. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last