eventloop.h

Go to the documentation of this file.
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 
00096     guint (*timeout_add_seconds)(guint interval, GSourceFunc function, gpointer data);
00097 
00098     void (*_purple_reserved2)(void);
00099     void (*_purple_reserved3)(void);
00100     void (*_purple_reserved4)(void);
00101 };
00102 
00103 /**************************************************************************/
00105 /**************************************************************************/
00123 guint purple_timeout_add(guint interval, GSourceFunc function, gpointer data);
00124 
00141 guint purple_timeout_add_seconds(guint interval, GSourceFunc function, gpointer data);
00142 
00150 gboolean purple_timeout_remove(guint handle);
00151 
00163 guint purple_input_add(int fd, PurpleInputCondition cond,
00164                      PurpleInputFunction func, gpointer user_data);
00165 
00172 gboolean purple_input_remove(guint handle);
00173 
00185 int
00186 purple_input_get_error(int fd, int *error);
00187 
00188 
00192 /**************************************************************************/
00194 /**************************************************************************/
00201 void purple_eventloop_set_ui_ops(PurpleEventLoopUiOps *ops);
00202 
00208 PurpleEventLoopUiOps *purple_eventloop_get_ui_ops(void);
00209 
00212 #ifdef __cplusplus
00213 }
00214 #endif
00215 
00216 #endif /* _PURPLE_EVENTLOOP_H_ */