Changeset 0da65d5 for protocols/nogaim.h


Ignore:
Timestamp:
2007-03-31T05:40:45Z (15 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
aef4828
Parents:
fa29d093
Message:

s/gaim_connection/im_connection/ and some other minor API changes. The rest
will come tomorrow. It compiles, I'll leave the real testing up to someone
else. ;-)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.h

    rfa29d093 r0da65d5  
    6262
    6363/* ok. now the fun begins. first we create a connection structure */
    64 struct gaim_connection
     64struct im_connection
    6565{
    6666        account_t *acc;
     
    9292        irc_t *irc;
    9393       
    94         struct conversation *conversations;
     94        struct groupchat *conversations;
    9595};
    9696
    9797/* struct buddy_chat went away and got merged with this. */
    98 struct conversation {
    99         struct gaim_connection *gc;
     98struct groupchat {
     99        struct im_connection *ic;
    100100
    101101        /* stuff used just for chat */
     
    104104       
    105105        /* BitlBee */
    106         struct conversation *next;
     106        struct groupchat *next;
    107107        char *channel;
    108108        char *title;
     
    121121        guint caps; /* woohoo! */
    122122        void *proto_data; /* what a hack */
    123         struct gaim_connection *gc; /* the connection it belongs to */
     123        struct im_connection *ic; /* the connection it belongs to */
    124124};
    125125
     
    128128        const char *name;
    129129
    130         void (* acc_init)       (account_t *);
     130        /* Added this one to be able to add per-account settings, don't think
     131           it should be used for anything else. */
     132        void (* init)           (account_t *);
     133        /* These should all be pretty obvious. */
    131134        void (* login)          (account_t *);
    132         void (* keepalive)      (struct gaim_connection *);
    133         void (* close)          (struct gaim_connection *);
    134        
    135         int  (* send_im)        (struct gaim_connection *, char *who, char *message, int len, int away);
    136         void (* set_away)       (struct gaim_connection *, char *state, char *message);
    137         void (* get_away)       (struct gaim_connection *, char *who);
    138         int  (* send_typing)    (struct gaim_connection *, char *who, int typing);
    139        
    140         void (* add_buddy)      (struct gaim_connection *, char *name);
    141         void (* group_buddy)    (struct gaim_connection *, char *who, char *old_group, char *new_group);
    142         void (* remove_buddy)   (struct gaim_connection *, char *name, char *group);
    143         void (* add_permit)     (struct gaim_connection *, char *name);
    144         void (* add_deny)       (struct gaim_connection *, char *name);
    145         void (* rem_permit)     (struct gaim_connection *, char *name);
    146         void (* rem_deny)       (struct gaim_connection *, char *name);
    147         void (* set_permit_deny)(struct gaim_connection *);
    148        
    149         void (* set_info)       (struct gaim_connection *, char *info);
    150         void (* get_info)       (struct gaim_connection *, char *who);
    151         void (* alias_buddy)    (struct gaim_connection *, char *who);  /* save/store buddy's alias on server list/roster */
     135        void (* keepalive)      (struct im_connection *);
     136        void (* logout)         (struct im_connection *);
     137       
     138        int  (* send_im)        (struct im_connection *, char *to, char *message, int flags);
     139        void (* set_away)       (struct im_connection *, char *state, char *message);
     140        void (* get_away)       (struct im_connection *, char *who);
     141        int  (* send_typing)    (struct im_connection *, char *who, int typing);
     142       
     143        /* For now BitlBee doesn't really handle groups, just set it to NULL. */
     144        void (* add_buddy)      (struct im_connection *, char *name, char *group);
     145        void (* remove_buddy)   (struct im_connection *, char *name, char *group);
     146       
     147        /* Block list stuff. */
     148        void (* add_permit)     (struct im_connection *, char *who);
     149        void (* add_deny)       (struct im_connection *, char *who);
     150        void (* rem_permit)     (struct im_connection *, char *who);
     151        void (* rem_deny)       (struct im_connection *, char *who);
     152        /* Doesn't actually have UI hooks. */
     153        void (* set_permit_deny)(struct im_connection *);
     154       
     155        /* Request profile info. Free-formatted stuff, the IM module gives back
     156           this info via imc_log(). */
     157        void (* get_info)       (struct im_connection *, char *who);
     158        void (* set_my_name)    (struct im_connection *, char *name);
     159        void (* set_name)       (struct im_connection *, char *who, char *name);
    152160       
    153161        /* Group chat stuff. */
    154         void (* chat_invite)    (struct conversation *, char *who, char *message);
    155         void (* chat_leave)     (struct conversation *);
    156         int  (* chat_send)      (struct conversation *, char *message);
    157         struct conversation *
    158              (* chat_open)      (struct gaim_connection *, char *who);
    159         struct conversation *
    160              (* chat_join)      (struct gaim_connection *, char *chat, char *nick, char *password);
     162        void (* chat_invite)    (struct groupchat *, char *who, char *message);
     163        void (* chat_leave)     (struct groupchat *);
     164        void (* chat_send)      (struct groupchat *, char *message, int flags);
     165        struct groupchat *
     166             (* chat_with)      (struct im_connection *, char *who);
     167        struct groupchat *
     168             (* chat_join)      (struct im_connection *, char *chat, char *nick, char *password);
    161169       
    162170        /* DIE! */
    163         char *(* get_status_string) (struct gaim_connection *gc, int stat);
    164        
    165         GList *(* away_states)(struct gaim_connection *gc);
     171        char *(* get_status_string) (struct im_connection *ic, int stat);
     172       
     173        GList *(* away_states)(struct im_connection *ic);
    166174       
    167175        /* Mainly for AOL, since they think "Bung hole" == "Bu ngho le". *sigh* */
     
    182190
    183191/* nogaim.c */
    184 int bim_set_away( struct gaim_connection *gc, char *away );
    185 int bim_buddy_msg( struct gaim_connection *gc, char *handle, char *msg, int flags );
    186 int bim_chat_msg( struct conversation *c, char *msg );
    187 
    188 void bim_add_allow( struct gaim_connection *gc, char *handle );
    189 void bim_rem_allow( struct gaim_connection *gc, char *handle );
    190 void bim_add_block( struct gaim_connection *gc, char *handle );
    191 void bim_rem_block( struct gaim_connection *gc, char *handle );
     192int bim_set_away( struct im_connection *ic, char *away );
     193int bim_buddy_msg( struct im_connection *ic, char *handle, char *msg, int flags );
     194int bim_chat_msg( struct groupchat *c, char *msg, int flags );
     195
     196void bim_add_allow( struct im_connection *ic, char *handle );
     197void bim_rem_allow( struct im_connection *ic, char *handle );
     198void bim_add_block( struct im_connection *ic, char *handle );
     199void bim_rem_block( struct im_connection *ic, char *handle );
    192200
    193201void nogaim_init();
     
    198206
    199207/* multi.c */
    200 G_MODULE_EXPORT struct gaim_connection *new_gaim_conn( account_t *acc );
    201 G_MODULE_EXPORT void destroy_gaim_conn( struct gaim_connection *gc );
    202 G_MODULE_EXPORT void set_login_progress( struct gaim_connection *gc, int step, char *msg );
    203 G_MODULE_EXPORT void hide_login_progress( struct gaim_connection *gc, char *msg );
    204 G_MODULE_EXPORT void hide_login_progress_error( struct gaim_connection *gc, char *msg );
    205 G_MODULE_EXPORT void serv_got_crap( struct gaim_connection *gc, char *format, ... ) G_GNUC_PRINTF( 2, 3 );
    206 G_MODULE_EXPORT void account_online( struct gaim_connection *gc );
    207 G_MODULE_EXPORT void signoff( struct gaim_connection *gc );
     208G_MODULE_EXPORT struct im_connection *new_gaim_conn( account_t *acc );
     209G_MODULE_EXPORT void destroy_gaim_conn( struct im_connection *ic );
     210G_MODULE_EXPORT void set_login_progress( struct im_connection *ic, int step, char *msg );
     211G_MODULE_EXPORT void hide_login_progress( struct im_connection *ic, char *msg );
     212G_MODULE_EXPORT void hide_login_progress_error( struct im_connection *ic, char *msg );
     213G_MODULE_EXPORT void serv_got_crap( struct im_connection *ic, char *format, ... ) G_GNUC_PRINTF( 2, 3 );
     214G_MODULE_EXPORT void account_online( struct im_connection *ic );
     215G_MODULE_EXPORT void signoff( struct im_connection *ic );
    208216
    209217/* dialogs.c */
    210 G_MODULE_EXPORT void do_error_dialog( struct gaim_connection *gc, char *msg, char *title );
    211 G_MODULE_EXPORT void do_ask_dialog( struct gaim_connection *gc, char *msg, void *data, void *doit, void *dont );
     218G_MODULE_EXPORT void do_error_dialog( struct im_connection *ic, char *msg, char *title );
     219G_MODULE_EXPORT void do_ask_dialog( struct im_connection *ic, char *msg, void *data, void *doit, void *dont );
    212220
    213221/* list.c */
    214 G_MODULE_EXPORT void add_buddy( struct gaim_connection *gc, char *group, char *handle, char *realname );
    215 G_MODULE_EXPORT struct buddy *find_buddy( struct gaim_connection *gc, char *handle );
    216 G_MODULE_EXPORT void signoff_blocked( struct gaim_connection *gc );
    217 
    218 G_MODULE_EXPORT void serv_buddy_rename( struct gaim_connection *gc, char *handle, char *realname );
     222G_MODULE_EXPORT void add_buddy( struct im_connection *ic, char *group, char *handle, char *realname );
     223G_MODULE_EXPORT struct buddy *find_buddy( struct im_connection *ic, char *handle );
     224G_MODULE_EXPORT void signoff_blocked( struct im_connection *ic );
     225
     226G_MODULE_EXPORT void serv_buddy_rename( struct im_connection *ic, char *handle, char *realname );
    219227
    220228/* buddy_chat.c */
    221 G_MODULE_EXPORT void add_chat_buddy( struct conversation *b, char *handle );
    222 G_MODULE_EXPORT void remove_chat_buddy( struct conversation *b, char *handle, char *reason );
     229G_MODULE_EXPORT void add_chat_buddy( struct groupchat *b, char *handle );
     230G_MODULE_EXPORT void remove_chat_buddy( struct groupchat *b, char *handle, char *reason );
    223231
    224232/* prpl.c */
    225 G_MODULE_EXPORT void show_got_added( struct gaim_connection *gc, char *handle, const char *realname );
     233G_MODULE_EXPORT void show_got_added( struct im_connection *ic, char *handle, const char *realname );
    226234
    227235/* server.c */
    228 G_MODULE_EXPORT void serv_got_update( struct gaim_connection *gc, char *handle, int loggedin, int evil, time_t signon, time_t idle, int type, guint caps );
    229 G_MODULE_EXPORT void serv_got_im( struct gaim_connection *gc, char *handle, char *msg, guint32 flags, time_t mtime, gint len );
    230 G_MODULE_EXPORT void serv_got_typing( struct gaim_connection *gc, char *handle, int timeout, int type );
    231 G_MODULE_EXPORT void serv_got_chat_invite( struct gaim_connection *gc, char *handle, char *who, char *msg, GList *data );
    232 G_MODULE_EXPORT struct conversation *serv_got_joined_chat( struct gaim_connection *gc, char *handle );
    233 G_MODULE_EXPORT void serv_got_chat_in( struct conversation *c, char *who, int whisper, char *msg, time_t mtime );
    234 G_MODULE_EXPORT void serv_got_chat_left( struct conversation *c );
    235 
    236 struct conversation *chat_by_channel( char *channel );
    237 struct conversation *chat_by_id( int id );
     236G_MODULE_EXPORT void serv_got_update( struct im_connection *ic, char *handle, int loggedin, int evil, time_t signon, time_t idle, int type, guint caps );
     237G_MODULE_EXPORT void serv_got_im( struct im_connection *ic, char *handle, char *msg, guint32 flags, time_t mtime, gint len );
     238G_MODULE_EXPORT void serv_got_typing( struct im_connection *ic, char *handle, int timeout, int type );
     239G_MODULE_EXPORT void serv_got_chat_invite( struct im_connection *ic, char *handle, char *who, char *msg, GList *data );
     240G_MODULE_EXPORT struct groupchat *serv_got_joined_chat( struct im_connection *ic, char *handle );
     241G_MODULE_EXPORT void serv_got_chat_in( struct groupchat *c, char *who, int whisper, char *msg, time_t mtime );
     242G_MODULE_EXPORT void serv_got_chat_left( struct groupchat *c );
     243
     244struct groupchat *chat_by_channel( char *channel );
     245struct groupchat *chat_by_id( int id );
    238246
    239247#endif
Note: See TracChangeset for help on using the changeset viewer.