From: Eric W. <war...@us...> - 2001-10-03 09:48:36
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv25541/src Modified Files: applet.h convo.h gaim.h html.c multi.h proxy.h prpl.c prpl.h Added Files: core.h ui.h Log Message: boo-yah! --- NEW FILE: core.h --- /* * gaim * * Copyright (C) 1998-1999, Mark Spencer <mar...@ma...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef _CORE_H_ #define _CORE_H_ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <stdio.h> #include <time.h> #include <glib.h> #ifdef GAIM_PLUGINS #include <gmodule.h> #endif #include "multi.h" enum gaim_event { event_signon = 0, event_signoff, event_away, event_back, event_im_recv, event_im_send, event_buddy_signon, event_buddy_signoff, event_buddy_away, event_buddy_back, event_buddy_idle, event_buddy_unidle, event_blist_update, event_chat_invited, event_chat_join, event_chat_leave, event_chat_buddy_join, event_chat_buddy_leave, event_chat_recv, event_chat_send, event_warned, event_error, event_quit, event_new_conversation, event_set_info, event_draw_menu, event_im_displayed_sent, event_im_displayed_rcvd, event_chat_send_invite, /* any others? it's easy to add... */ }; #ifdef GAIM_PLUGINS struct gaim_plugin { GModule *handle; char *name; char *description; }; struct gaim_callback { GModule *handle; enum gaim_event event; void *function; void *data; }; extern GList *plugins; extern GList *callbacks; #endif struct buddy { int edittype; /* CUI: this is really a GUI function and we need to put this in ui.h */ char name[80]; char show[80]; int present; int evil; time_t signon; time_t idle; int uc; gushort caps; /* woohoo! */ void *proto_data; /* what a hack */ struct gaim_connection *gc; /* the connection it belongs to */ }; struct group { int edittype; /* CUI: this is really a GUI function and we need to put this in ui.h */ char name[80]; GSList *members; struct gaim_connection *gc; /* the connection it belongs to */ }; /* Functions in buddy.c */ extern struct buddy *find_buddy(struct gaim_connection *, char *); extern struct group *find_group(struct gaim_connection *, char *); extern struct group *find_group_by_buddy(struct gaim_connection *, char *); extern struct buddy *add_buddy(struct gaim_connection *, char *, char *, char *); extern void remove_buddy(struct gaim_connection *, struct group *, struct buddy *); extern struct group *add_group(struct gaim_connection *, char *); extern void remove_group(struct gaim_connection *, struct group *); extern void do_export(struct gaim_connection *); extern void do_import(struct gaim_connection *, char *); extern int bud_list_cache_exists(struct gaim_connection *); /* Functions in server.c */ extern void serv_got_update(struct gaim_connection *, char *, int, int, time_t, time_t, int, gushort); extern void serv_got_im(struct gaim_connection *, char *, char *, guint32, time_t); extern void serv_got_eviled(struct gaim_connection *, char *, int); extern void serv_got_chat_invite(struct gaim_connection *, char *, char *, char *, GList *); extern struct conversation *serv_got_joined_chat(struct gaim_connection *, int, char *); extern void serv_got_chat_left(struct gaim_connection *, int); extern void serv_got_chat_in(struct gaim_connection *, int, char *, int, char *, time_t); extern void serv_finish_login(); #endif /* _CORE_H_ */ --- NEW FILE: ui.h --- /* * gaim * * Copyright (C) 1998-1999, Mark Spencer <mar...@ma...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef _UI_H_ #define _UI_H_ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <gtk/gtk.h> #ifdef USE_APPLET #include <applet-widget.h> #endif /* USE_APPLET */ #ifdef USE_GNOME #include <gnome.h> #endif #if USE_PIXBUF #include <gdk-pixbuf/gdk-pixbuf.h> #endif #define FACE_ANGEL 0 #define FACE_BIGSMILE 1 #define FACE_BURP 2 #define FACE_CROSSEDLIPS 3 #define FACE_CRY 4 #define FACE_EMBARRASSED 5 #define FACE_KISS 6 #define FACE_MONEYMOUTH 7 #define FACE_SAD 8 #define FACE_SCREAM 9 #define FACE_SMILE 10 #define FACE_SMILE8 11 #define FACE_THINK 12 #define FACE_TONGUE 13 #define FACE_WINK 14 #define FACE_YELL 15 #define FACE_TOTAL 16 struct debug_window { GtkWidget *window; GtkWidget *entry; }; extern struct debug_window *dw; /* CUI: save_pos and window_size are used by gaimrc.c which is core. * Need to figure out options saving. Same goes for several global variables as well. */ struct save_pos { int x; int y; int width; int height; int xoff; int yoff; }; struct window_size { int width; int height; int entry_height; }; #define EDIT_GC 0 #define EDIT_GROUP 1 #define EDIT_BUDDY 2 /* Globals in applet.c */ #ifdef USE_APPLET extern GtkWidget *applet; #endif /* USE_APPLET */ /* Globals in buddy.c */ extern GtkWidget *buddies; extern GtkWidget *bpmenu; extern GtkWidget *blist; /* Globals in buddy_chat.c */ /* it is very important that you don't use this for anything. * its sole purpose is to allow all group chats to be in one * window. use struct gaim_connection's buddy_chats instead. */ extern GList *chats; /* these are ok to use */ extern GtkWidget *all_chats; extern GtkWidget *chat_notebook; extern GtkWidget *joinchat; /* Globals in dialog.c */ extern char fontface[64]; extern int fontsize; extern GdkColor bgcolor; extern GdkColor fgcolor; extern int smiley_array[FACE_TOTAL]; /* Globals in prpl.c */ extern GtkWidget *protomenu; /* Functions in about.c */ extern void show_about(GtkWidget *, void *); extern void gaim_help(GtkWidget *, void *); #endif /* _UI_H_ */ Index: applet.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/applet.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- applet.h 2001/04/07 07:57:14 1.3 +++ applet.h 2001/10/03 09:48:33 1.4 @@ -28,8 +28,8 @@ ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ** **************************************************************/ -#ifndef _GAIMGNOMEAPPLETMGR_H_ -#define _GAIMGNOMEAPPLETMGR_H_ +#ifndef _APPLET_H_ +#define _APPLET_H_ #ifdef USE_APPLET #include <gnome.h> @@ -84,4 +84,4 @@ extern gboolean applet_buddy_show; #endif /*USE_APPLET*/ -#endif /*_GAIMGNOMEAPPLETMGR_H_*/ +#endif /*_APPLET_H_*/ Index: convo.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/convo.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- convo.h 2001/09/28 12:15:54 1.11 +++ convo.h 2001/10/03 09:48:33 1.12 @@ -19,8 +19,8 @@ * */ -#ifndef _GAIMCONVO_H_ -#define _GAIMCONVO_H_ +#ifndef _CONVO_H_ +#define _CONVO_H_ #include <gtk/gtk.h> #include "gaim.h" @@ -74,4 +74,4 @@ extern gboolean meify(char *); -#endif +#endif /* _CONVO_H_ */ Index: gaim.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/gaim.h,v retrieving revision 1.275 retrieving revision 1.276 diff -u -d -r1.275 -r1.276 --- gaim.h 2001/10/03 07:49:38 1.275 +++ gaim.h 2001/10/03 09:48:33 1.276 @@ -19,23 +19,18 @@ * */ -#ifndef _GAIM_GAIM_H_ -#define _GAIM_GAIM_H_ +#ifndef _GAIM_H_ +#define _GAIM_H_ #ifdef HAVE_CONFIG_H #include <config.h> #endif -#include <gtk/gtk.h> -#include <time.h> -#include <stdio.h> -#ifdef USE_APPLET -#include <applet-widget.h> -#endif /* USE_APPLET */ -#ifdef USE_GNOME -#include <gnome.h> -#endif -#include "multi.h" +#include "core.h" +#include "ui.h" +/* CUI: when this is done being split, the only things below should be things + * both the core and the uis depend on e.g. the protocol definitions, etc, and + * it won't include core.h or ui.h (i.e. it'll mostly be #define's) */ #define BROWSER_NETSCAPE 0 @@ -74,28 +69,8 @@ #define AUTO_RESPONSE "<AUTO-REPLY> : " -#define PLUGIN_DIR ".gaim/plugins/" - #define WEBSITE "http://gaim.sourceforge.net/" -#define FACE_ANGEL 0 -#define FACE_BIGSMILE 1 -#define FACE_BURP 2 -#define FACE_CROSSEDLIPS 3 -#define FACE_CRY 4 -#define FACE_EMBARRASSED 5 -#define FACE_KISS 6 -#define FACE_MONEYMOUTH 7 -#define FACE_SAD 8 -#define FACE_SCREAM 9 -#define FACE_SMILE 10 -#define FACE_SMILE8 11 -#define FACE_THINK 12 -#define FACE_TONGUE 13 -#define FACE_WINK 14 -#define FACE_YELL 15 -#define FACE_TOTAL 16 - #ifndef USE_GNOME #ifdef ENABLE_NLS # include <libintl.h> @@ -111,8 +86,6 @@ #endif #endif -extern struct debug_window *dw; - struct aim_user { char username[64]; char password[32]; @@ -165,67 +138,6 @@ #define DEFAULT_INFO "Visit the GAIM website at <A HREF=\"http://gaim.sourceforge.net/\">http://gaim.sourceforge.net/</A>." -struct save_pos { - int x; - int y; - int width; - int height; - int xoff; - int yoff; -}; - - -struct window_size { - int width; - int height; - int entry_height; -}; - - -struct option_set { - int *options; - int option; -}; - -struct g_url { - char address[255]; - int port; - char page[255]; -}; - -enum gaim_event { - event_signon = 0, - event_signoff, - event_away, - event_back, - event_im_recv, - event_im_send, - event_buddy_signon, - event_buddy_signoff, - event_buddy_away, - event_buddy_back, - event_buddy_idle, - event_buddy_unidle, - event_blist_update, - event_chat_invited, - event_chat_join, - event_chat_leave, - event_chat_buddy_join, - event_chat_buddy_leave, - event_chat_recv, - event_chat_send, - event_warned, - event_error, - event_quit, - event_new_conversation, - event_set_info, - event_draw_menu, - event_im_displayed_sent, - event_im_displayed_rcvd, - event_chat_send_invite, - /* any others? it's easy to add... */ -}; - enum log_event { log_signon = 0, log_signoff, @@ -236,44 +148,6 @@ log_quit }; -#ifdef GAIM_PLUGINS -#include <gmodule.h> - -struct gaim_plugin { - GModule *handle; - char *name; - char *description; -}; - -struct gaim_callback { - GModule *handle; - enum gaim_event event; - void *function; - void *data; -}; - -extern GList *plugins; -extern GList *callbacks; -#endif - -#define EDIT_GC 0 -#define EDIT_GROUP 1 -#define EDIT_BUDDY 2 - -struct buddy { - int edittype; - char name[80]; - char show[80]; - int present; - int evil; - time_t signon; - time_t idle; - int uc; - gushort caps; /* woohoo! */ - void *proto_data; /* what a hack */ - struct gaim_connection *gc; /* the connection it belongs to */ -}; - struct log_conversation { char name[80]; char filename[512]; @@ -321,22 +195,6 @@ char message[2048]; }; -struct group { - int edittype; - char name[80]; - GSList *members; - struct gaim_connection *gc; /* the connection it belongs to */ -}; - -struct debug_window { - GtkWidget *window; - GtkWidget *entry; -}; - -#if USE_PIXBUF -#include <gdk-pixbuf/gdk-pixbuf.h> -#endif - /* struct buddy_chat went away and got merged with this. */ struct conversation { struct gaim_connection *gc; @@ -419,8 +277,6 @@ #define CONVERSATION_TITLE "%s - Gaim" #define LOG_CONVERSATION_TITLE "%s - Gaim (logged)" -#define AOL_SRCHSTR "/community/aimcheck.adp/url=" - /* These should all be runtime selectable */ #define MSG_LEN 2048 @@ -430,18 +286,6 @@ #define BUF_LEN MSG_LEN #define BUF_LONG BUF_LEN * 2 - -#ifdef USE_APPLET -extern GtkWidget *applet; -#endif /* USE_APPLET */ - -/* Globals in dialog.c */ -extern char fontface[64]; -extern int fontsize; -extern GdkColor bgcolor; -extern GdkColor fgcolor; -extern int smiley_array[FACE_TOTAL]; - /* Globals in aim.c */ extern GList *log_conversations; extern GList *buddy_pounces; @@ -452,16 +296,6 @@ extern char *opt_away_arg; extern char *opt_rcfile_arg; -/* Globals in buddy_chat.c */ -/* it is very important that you don't use this for anything. - * its sole purpose is to allow all group chats to be in one - * window. use struct gaim_connection's buddy_chats instead. */ -extern GList *chats; -extern GtkWidget *all_chats; -extern GtkWidget *chat_notebook; - -extern GtkWidget *joinchat; - /* Globals in away.c */ extern struct away_message *awaymessage; extern struct away_message *default_away; @@ -469,14 +303,6 @@ extern GtkWidget *awaymenu; extern GtkWidget *clistqueue; -/* Globals in prpl.c */ -extern GtkWidget *protomenu; - -/* Globals in buddy.c */ -extern GtkWidget *buddies; -extern GtkWidget *bpmenu; -extern GtkWidget *blist; - extern guint misc_options; #define OPT_MISC_DEBUG 0x00000001 #define OPT_MISC_BROWSER_POPUP 0x00000002 @@ -596,10 +422,6 @@ extern struct save_pos blist_pos; extern struct window_size conv_size, buddy_chat_size; -/* Functions in about.c */ -extern void show_about(GtkWidget *, void *); -extern void gaim_help(GtkWidget *, void *); - /* Functions in buddy_chat.c */ extern void join_chat(); extern void chat_write(struct conversation *, char *, int, char *, time_t); @@ -619,7 +441,6 @@ extern void chat_set_topic(struct conversation*, char*, char*); /* Functions in html.c */ -extern struct g_url parse_url(char *); extern void grab_url(char *, void (*callback)(gpointer, char *), gpointer); extern gchar *strip_html(gchar *); @@ -659,7 +480,6 @@ extern void serv_login(struct aim_user *); extern void serv_close(struct gaim_connection *); extern void serv_touch_idle(struct gaim_connection *); -extern void serv_finish_login(); extern int serv_send_im(struct gaim_connection *, char *, char *, int); extern void serv_get_info(struct gaim_connection *, char *); extern void serv_get_dir(struct gaim_connection *, char *); @@ -686,15 +506,6 @@ extern void serv_chat_whisper(struct gaim_connection *, int, char *, char *); extern int serv_chat_send(struct gaim_connection *, int, char *); -/* output from serv */ -extern void serv_got_update(struct gaim_connection *, char *, int, int, time_t, time_t, int, gushort); -extern void serv_got_im(struct gaim_connection *, char *, char *, guint32, time_t); -extern void serv_got_eviled(struct gaim_connection *, char *, int); -extern void serv_got_chat_invite(struct gaim_connection *, char *, char *, char *, GList *); -extern struct conversation *serv_got_joined_chat(struct gaim_connection *, int, char *); -extern void serv_got_chat_left(struct gaim_connection *, int); -extern void serv_got_chat_in(struct gaim_connection *, int, char *, int, char *, time_t); - /* Functions in conversation.c */ extern void gaim_setup_imhtml(GtkWidget *); extern void update_convo_add_button(struct conversation *); @@ -758,23 +569,13 @@ extern void signoff_all(gpointer, gpointer); extern void do_im_back(); extern void set_buddy(struct gaim_connection *, struct buddy *); -extern void add_category(char *); extern void build_edit_tree(); -extern void remove_person(struct group *, struct buddy *); -extern void remove_category(struct group *); extern void do_pounce(struct gaim_connection *, char *, int); extern void do_bp_menu(); -extern struct buddy *find_buddy(struct gaim_connection *, char *); -extern struct group *find_group(struct gaim_connection *, char *); -extern struct group *find_group_by_buddy(struct gaim_connection *, char *); -extern void remove_buddy(struct gaim_connection *, struct group *, struct buddy *); -extern void ui_remove_buddy(struct gaim_connection *, struct group *, struct buddy *); -extern struct buddy *add_buddy(struct gaim_connection *, char *, char *, char *); extern void ui_add_buddy(struct gaim_connection *, struct group *, struct buddy *); -extern void remove_group(struct gaim_connection *, struct group *); -extern void ui_remove_group(struct gaim_connection *, struct group *); -extern struct group *add_group(struct gaim_connection *, char *); +extern void ui_remove_buddy(struct gaim_connection *, struct group *, struct buddy *); extern void ui_add_group(struct gaim_connection *, struct group *); +extern void ui_remove_group(struct gaim_connection *, struct group *); extern void toggle_buddy_pixmaps(); extern void gaim_separator(GtkWidget *); extern void redo_buddy_list(); /* you really shouldn't call this function */ @@ -852,7 +653,6 @@ /* Functions in dialogs.c */ extern void alias_dialog_bud(struct buddy *); -extern void do_export(struct gaim_connection *); extern void show_warn_dialog(struct gaim_connection *, char *); extern GtkWidget *do_error_dialog(char *, char *); extern void show_im_dialog(); @@ -881,8 +681,6 @@ extern void show_ee_dialog(int); extern void show_add_link(GtkWidget *,struct conversation *); extern void show_change_passwd(struct gaim_connection *); -extern void do_import(struct gaim_connection *, char *); -extern int bud_list_cache_exists(struct gaim_connection *); extern void show_smiley_dialog(struct conversation *, GtkWidget *); extern void close_smiley_dialog(GtkWidget *widget, struct conversation *c); extern void set_smiley_array(GtkWidget *widget, int smiley_type); @@ -917,4 +715,4 @@ void BuddyTickerSetPixmap(char *, GdkPixmap *, GdkBitmap *); void BuddyTickerSignoff(); -#endif /* _GAIM_GAIM_H_ */ +#endif /* _GAIM_H_ */ Index: html.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/html.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- html.c 2001/09/27 19:17:10 1.20 +++ html.c 2001/10/03 09:48:33 1.21 @@ -36,6 +36,12 @@ #include <errno.h> #include "proxy.h" +struct g_url { + char address[255]; + int port; + char page[255]; +}; + gchar *strip_html(gchar *text) { int i, j, k; @@ -68,7 +74,7 @@ return text2; } -struct g_url parse_url(char *url) +static struct g_url parse_url(char *url) { struct g_url test; char scan_info[255]; Index: multi.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/multi.h,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- multi.h 2001/10/01 07:50:07 1.34 +++ multi.h 2001/10/03 09:48:33 1.35 @@ -19,10 +19,10 @@ * */ -#ifndef _GAIMMULTI_H_ -#define _GAIMMULTI_H_ +#ifndef _MULTI_H_ +#define _MULTI_H_ -#include "gaim.h" +#include "core.h" /* ok. now the fun begins. first we create a connection structure */ struct gaim_connection { @@ -107,4 +107,4 @@ void set_login_progress(struct gaim_connection *, float, char *); void hide_login_progress(struct gaim_connection *, char *); -#endif /* _GAIMMULTI_H_ */ +#endif /* _MULTI_H_ */ Index: proxy.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/proxy.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- proxy.h 2001/07/31 23:23:40 1.7 +++ proxy.h 2001/10/03 09:48:33 1.8 @@ -23,8 +23,8 @@ prototype-ing stuff and redefine some net function to mask them with some kind of transparent layer */ -#ifndef _INC_PROXY_H -#define _INC_PROXY_H +#ifndef _PROXY_H_ +#define _PROXY_H_ #include <sys/types.h> #include <sys/socket.h> @@ -54,4 +54,4 @@ extern int proxy_connect(char *host, int port, GaimInputFunction func, gpointer data); -#endif +#endif /* _PROXY_H_ */ Index: prpl.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/prpl.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- prpl.c 2001/10/01 14:54:37 1.36 +++ prpl.c 2001/10/03 09:48:33 1.37 @@ -19,6 +19,7 @@ * */ +#include "gaim.h" #include "prpl.h" #include <sys/types.h> #include <sys/stat.h> Index: prpl.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/prpl.h,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- prpl.h 2001/10/02 05:52:56 1.49 +++ prpl.h 2001/10/03 09:48:33 1.50 @@ -19,11 +19,15 @@ * */ -#ifndef _GAIMPRPL_H_ -#define _GAIMPRPL_H_ +/* this file should be all that prpls need to include. therefore, by including + * this file, they should get glib, proxy, gaim_connection, prpl, etc. */ + +#ifndef _PRPL_H_ +#define _PRPL_H_ +#include "core.h" +#include "proxy.h" #include "multi.h" -#include <stdio.h> #define PROTO_TOC 0 #define PROTO_OSCAR 1 @@ -90,6 +94,12 @@ GList *(* chat_info)(struct gaim_connection *); /* all the server-related functions */ + + /* a lot of these (like get_dir) are protocol-dependent and should be removed. ones like + * set_dir (which is also protocol-dependent) can stay though because there's a dialog + * (i.e. the prpl says you can set your dir info, the ui shows a dialog and needs to call + * set_dir in order to set it) */ + void (* login) (struct aim_user *); void (* close) (struct gaim_connection *); int (* send_im) (struct gaim_connection *, char *who, char *message, int away); @@ -132,6 +142,7 @@ int (* chat_send) (struct gaim_connection *, int id, char *message); void (* keepalive) (struct gaim_connection *); + /* this is really bad. */ void (* convo_closed) (struct gaim_connection *, char *who); char *(* normalize)(const char *); @@ -157,4 +168,4 @@ extern void set_icon_data(struct gaim_connection *, char *, void *, int); extern void *get_icon_data(struct gaim_connection *, char *, int *); -#endif +#endif /* _PRPL_H_ */ |