Ignore:
Timestamp:
2006-05-10T17:34:46Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
13cc96c
Parents:
67b6766
Message:

Moved everything to the BitlBee event handling API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/events_glib.c

    r67b6766 rba9edaa  
    4747
    4848typedef struct _GaimIOClosure {
    49         GaimInputFunction function;
     49        b_event_handler function;
    5050        guint result;
    5151        gpointer data;
    5252} GaimIOClosure;
    5353
     54static GMainLoop *loop;
     55
     56void b_main_init()
     57{
     58        loop = g_main_new( FALSE );
     59}
     60
     61void b_main_run()
     62{
     63        g_main_run( loop );
     64}
     65
     66void b_main_quit()
     67{
     68        g_main_quit( loop );
     69}
     70
    5471static gboolean gaim_io_invoke(GIOChannel *source, GIOCondition condition, gpointer data)
    5572{
    5673        GaimIOClosure *closure = data;
    57         GaimInputCondition gaim_cond = 0;
     74        b_input_condition gaim_cond = 0;
    5875
    5976        if (condition & GAIM_READ_COND)
     
    6279                gaim_cond |= GAIM_INPUT_WRITE;
    6380
    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);
    6782}
    6883
     
    7287}
    7388
    74 gint gaim_input_add(gint source, GaimInputCondition condition, GaimInputFunction function, gpointer data)
     89gint b_input_add(gint source, b_input_condition condition, b_event_handler function, gpointer data)
    7590{
    7691        GaimIOClosure *closure = g_new0(GaimIOClosure, 1);
     
    94109}
    95110
    96 void gaim_input_remove(gint tag)
     111gint b_timeout_add(gint timeout, b_event_handler func, gpointer data)
     112{
     113        return g_timeout_add(timeout, func, data);
     114}
     115
     116void b_event_remove(gint tag)
    97117{
    98118        if (tag > 0)
    99119                g_source_remove(tag);
    100120}
     121
     122gboolean 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.