00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _PURPLE_EVENTLOOP_H_
00027 #define _PURPLE_EVENTLOOP_H_
00028
00029 #include <glib.h>
00030
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034
00038 typedef enum
00039 {
00040 PURPLE_INPUT_READ = 1 << 0,
00041 PURPLE_INPUT_WRITE = 1 << 1
00043 } PurpleInputCondition;
00044
00045 typedef void (*PurpleInputFunction)(gpointer, gint, PurpleInputCondition);
00046
00047 typedef struct _PurpleEventLoopUiOps PurpleEventLoopUiOps;
00048
00049 struct _PurpleEventLoopUiOps
00050 {
00055 guint (*timeout_add)(guint interval, GSourceFunc function, gpointer data);
00056
00061 gboolean (*timeout_remove)(guint handle);
00062
00067 guint (*input_add)(int fd, PurpleInputCondition cond,
00068 PurpleInputFunction func, gpointer user_data);
00069
00074 gboolean (*input_remove)(guint handle);
00075
00076
00083 int (*input_get_error)(int fd, int *error);
00084
00097 guint (*timeout_add_seconds)(guint interval, GSourceFunc function, gpointer data);
00098
00099 void (*_purple_reserved2)(void);
00100 void (*_purple_reserved3)(void);
00101 void (*_purple_reserved4)(void);
00102 };
00103
00104
00106
00124 guint purple_timeout_add(guint interval, GSourceFunc function, gpointer data);
00125
00142 guint purple_timeout_add_seconds(guint interval, GSourceFunc function, gpointer data);
00143
00151 gboolean purple_timeout_remove(guint handle);
00152
00164 guint purple_input_add(int fd, PurpleInputCondition cond,
00165 PurpleInputFunction func, gpointer user_data);
00166
00173 gboolean purple_input_remove(guint handle);
00174
00186 int
00187 purple_input_get_error(int fd, int *error);
00188
00189
00193
00195
00202 void purple_eventloop_set_ui_ops(PurpleEventLoopUiOps *ops);
00203
00209 PurpleEventLoopUiOps *purple_eventloop_get_ui_ops(void);
00210
00213 #ifdef __cplusplus
00214 }
00215 #endif
00216
00217 #endif