Changeset ba9edaa for protocols/events_glib.c
- Timestamp:
- 2006-05-10T17:34:46Z (19 years ago)
- Branches:
- master
- Children:
- 13cc96c
- Parents:
- 67b6766
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/events_glib.c
r67b6766 rba9edaa 47 47 48 48 typedef struct _GaimIOClosure { 49 GaimInputFunctionfunction;49 b_event_handler function; 50 50 guint result; 51 51 gpointer data; 52 52 } GaimIOClosure; 53 53 54 static GMainLoop *loop; 55 56 void b_main_init() 57 { 58 loop = g_main_new( FALSE ); 59 } 60 61 void b_main_run() 62 { 63 g_main_run( loop ); 64 } 65 66 void b_main_quit() 67 { 68 g_main_quit( loop ); 69 } 70 54 71 static gboolean gaim_io_invoke(GIOChannel *source, GIOCondition condition, gpointer data) 55 72 { 56 73 GaimIOClosure *closure = data; 57 GaimInputCondition gaim_cond = 0;74 b_input_condition gaim_cond = 0; 58 75 59 76 if (condition & GAIM_READ_COND) … … 62 79 gaim_cond |= GAIM_INPUT_WRITE; 63 80 64 closure->function(closure->data, g_io_channel_unix_get_fd(source), gaim_cond); 65 66 return TRUE; 81 return closure->function(closure->data, g_io_channel_unix_get_fd(source), gaim_cond); 67 82 } 68 83 … … 72 87 } 73 88 74 gint gaim_input_add(gint source, GaimInputCondition condition, GaimInputFunctionfunction, gpointer data)89 gint b_input_add(gint source, b_input_condition condition, b_event_handler function, gpointer data) 75 90 { 76 91 GaimIOClosure *closure = g_new0(GaimIOClosure, 1); … … 94 109 } 95 110 96 void gaim_input_remove(gint tag) 111 gint b_timeout_add(gint timeout, b_event_handler func, gpointer data) 112 { 113 return g_timeout_add(timeout, func, data); 114 } 115 116 void b_event_remove(gint tag) 97 117 { 98 118 if (tag > 0) 99 119 g_source_remove(tag); 100 120 } 121 122 gboolean b_event_remove_by_data(gpointer data) 123 { 124 return g_source_remove_by_user_data(data); 125 }
Note: See TracChangeset
for help on using the changeset viewer.