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
00050 typedef void (*PurpleInputFunction)(gpointer, gint, PurpleInputCondition);
00051
00053 typedef struct _PurpleEventLoopUiOps PurpleEventLoopUiOps;
00054
00060 struct _PurpleEventLoopUiOps
00061 {
00081 guint (*timeout_add)(guint interval, GSourceFunc function, gpointer data);
00082
00091 gboolean (*timeout_remove)(guint handle);
00092
00108 guint (*input_add)(int fd, PurpleInputCondition cond,
00109 PurpleInputFunction func, gpointer user_data);
00110
00117 gboolean (*input_remove)(guint handle);
00118
00119
00130 int (*input_get_error)(int fd, int *error);
00131
00146 guint (*timeout_add_seconds)(guint interval, GSourceFunc function,
00147 gpointer data);
00148
00149 void (*_purple_reserved2)(void);
00150 void (*_purple_reserved3)(void);
00151 void (*_purple_reserved4)(void);
00152 };
00153
00154
00156
00174 guint purple_timeout_add(guint interval, GSourceFunc function, gpointer data);
00175
00194 guint purple_timeout_add_seconds(guint interval, GSourceFunc function, gpointer data);
00195
00203 gboolean purple_timeout_remove(guint handle);
00204
00216 guint purple_input_add(int fd, PurpleInputCondition cond,
00217 PurpleInputFunction func, gpointer user_data);
00218
00225 gboolean purple_input_remove(guint handle);
00226
00241 int
00242 purple_input_get_error(int fd, int *error);
00243
00244
00248
00250
00257 void purple_eventloop_set_ui_ops(PurpleEventLoopUiOps *ops);
00258
00264 PurpleEventLoopUiOps *purple_eventloop_get_ui_ops(void);
00265
00268 #ifdef __cplusplus
00269 }
00270 #endif
00271
00272 #endif