00001
00025 #ifndef _PURPLE_EVENTLOOP_H_
00026 #define _PURPLE_EVENTLOOP_H_
00027
00028 #include <glib.h>
00029
00030 #ifdef __cplusplus
00031 extern "C" {
00032 #endif
00033
00037 typedef enum
00038 {
00039 PURPLE_INPUT_READ = 1 << 0,
00040 PURPLE_INPUT_WRITE = 1 << 1
00042 } PurpleInputCondition;
00043
00044 typedef void (*PurpleInputFunction)(gpointer, gint, PurpleInputCondition);
00045
00046 typedef struct _PurpleEventLoopUiOps PurpleEventLoopUiOps;
00047
00048 struct _PurpleEventLoopUiOps
00049 {
00054 guint (*timeout_add)(guint interval, GSourceFunc function, gpointer data);
00055
00060 gboolean (*timeout_remove)(guint handle);
00061
00066 guint (*input_add)(int fd, PurpleInputCondition cond,
00067 PurpleInputFunction func, gpointer user_data);
00068
00073 gboolean (*input_remove)(guint handle);
00074
00075
00082 int (*input_get_error)(int fd, int *error);
00083
00084 void (*_purple_reserved1)(void);
00085 void (*_purple_reserved2)(void);
00086 void (*_purple_reserved3)(void);
00087 void (*_purple_reserved4)(void);
00088 };
00089
00090
00092
00105 guint purple_timeout_add(guint interval, GSourceFunc function, gpointer data);
00106
00114 gboolean purple_timeout_remove(guint handle);
00115
00127 guint purple_input_add(int fd, PurpleInputCondition cond,
00128 PurpleInputFunction func, gpointer user_data);
00129
00136 gboolean purple_input_remove(guint handle);
00137
00149 int
00150 purple_input_get_error(int fd, int *error);
00151
00152
00156
00158
00165 void purple_eventloop_set_ui_ops(PurpleEventLoopUiOps *ops);
00166
00172 PurpleEventLoopUiOps *purple_eventloop_get_ui_ops(void);
00173
00176 #ifdef __cplusplus
00177 }
00178 #endif
00179
00180 #endif