pidgin 2.14.14dev
|
An abstraction of an application's mainloop; libpurple will use this to watch file descriptors and schedule timed callbacks. More...
#include <eventloop.h>
Data Fields | |
guint(* | timeout_add )(guint interval, GSourceFunc function, gpointer data) |
Should create a callback timer with an interval measured in milliseconds. | |
gboolean(* | timeout_remove )(guint handle) |
Should remove a callback timer. | |
guint(* | input_add )(int fd, PurpleInputCondition cond, PurpleInputFunction func, gpointer user_data) |
Should add an input handler. | |
gboolean(* | input_remove )(guint handle) |
Should remove an input handler. | |
int(* | input_get_error )(int fd, int *error) |
If implemented, should get the current error status for an input. | |
guint(* | timeout_add_seconds )(guint interval, GSourceFunc function, gpointer data) |
If implemented, should create a callback timer with an interval measured in seconds. | |
void(* | _purple_reserved2 )(void) |
void(* | _purple_reserved3 )(void) |
void(* | _purple_reserved4 )(void) |
An abstraction of an application's mainloop; libpurple will use this to watch file descriptors and schedule timed callbacks.
If your application uses the glib mainloop, there is an implementation of this struct in libpurple/example/nullclient.c
which you can use verbatim.
Definition at line 60 of file eventloop.h.
void(* _PurpleEventLoopUiOps::_purple_reserved2) (void) |
Definition at line 153 of file eventloop.h.
void(* _PurpleEventLoopUiOps::_purple_reserved3) (void) |
Definition at line 154 of file eventloop.h.
void(* _PurpleEventLoopUiOps::_purple_reserved4) (void) |
Definition at line 155 of file eventloop.h.
guint(* _PurpleEventLoopUiOps::input_add) (int fd, PurpleInputCondition cond, PurpleInputFunction func, gpointer user_data) |
Should add an input handler.
Analogous to g_io_add_watch_full in glib.
fd | a file descriptor to watch for events |
cond | a bitwise OR of events on fd for which func should be called. |
func | a callback to fire whenever a relevant event on fd occurs. |
user_data | arbitrary data to pass to fd. |
Definition at line 112 of file eventloop.h.
int(* _PurpleEventLoopUiOps::input_get_error) (int fd, int *error) |
If implemented, should get the current error status for an input.
Implementation of this UI op is optional. Implement it if the UI's sockets or event loop needs to customize determination of socket error status. If unimplemented, getsockopt(2)
will be used instead.
Definition at line 134 of file eventloop.h.
gboolean(* _PurpleEventLoopUiOps::input_remove) (guint handle) |
Should remove an input handler.
Analogous to g_source_remove in glib.
handle | an identifier, as returned by input_add. |
TRUE
if the input handler was found and removed. Definition at line 121 of file eventloop.h.
guint(* _PurpleEventLoopUiOps::timeout_add) (guint interval, GSourceFunc function, gpointer data) |
Should create a callback timer with an interval measured in milliseconds.
The supplied function should be called every interval seconds until it returns FALSE
, after which it should not be called again.
Analogous to g_timeout_add in glib.
Note: On Win32, this function may be called from a thread other than the libpurple thread. You should make sure to detect this situation and to only call "function" from the libpurple thread.
interval | the interval in milliseconds between calls to function. |
data | arbitrary data to be passed to function at each call. |
Definition at line 85 of file eventloop.h.
guint(* _PurpleEventLoopUiOps::timeout_add_seconds) (guint interval, GSourceFunc function, gpointer data) |
If implemented, should create a callback timer with an interval measured in seconds.
Analogous to g_timeout_add_seconds in glib.
This allows UIs to group timers for better power efficiency. For this reason, interval may be rounded by up to a second.
Implementation of this UI op is optional. If it's not implemented, calls to purple_timeout_add_seconds() will be serviced by timeout_add.
Definition at line 150 of file eventloop.h.
gboolean(* _PurpleEventLoopUiOps::timeout_remove) (guint handle) |
Should remove a callback timer.
Analogous to g_source_remove in glib.
handle | an identifier for a timeout, as returned by timeout_add. |
TRUE
if the timeout identified by handle was found and removed. Definition at line 95 of file eventloop.h.