From: Sean E. <sea...@us...> - 2002-08-29 01:47:18
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv15635/src Modified Files: browser.c buddy.c buddy_chat.c conversation.c core.h dialogs.c gaim.h gtkimhtml.h list.c module.c multi.c plugins.c prefs.c prpl.c prpl.h server.c util.c Log Message: some patches from some people. Index: browser.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/browser.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- browser.c 27 Aug 2002 22:22:55 -0000 1.28 +++ browser.c 29 Aug 2002 01:47:13 -0000 1.29 @@ -60,10 +60,10 @@ #define MOZILLA_COMMAND_PROP "_MOZILLA_COMMAND" #define MOZILLA_RESPONSE_PROP "_MOZILLA_RESPONSE" -static GdkAtom XA_MOZILLA_VERSION = 0; -static GdkAtom XA_MOZILLA_LOCK = 0; -static GdkAtom XA_MOZILLA_COMMAND = 0; -static GdkAtom XA_MOZILLA_RESPONSE = 0; +static GdkAtom GDKA_MOZILLA_VERSION = 0; +static GdkAtom GDKA_MOZILLA_LOCK = 0; +static GdkAtom GDKA_MOZILLA_COMMAND = 0; +static GdkAtom GDKA_MOZILLA_RESPONSE = 0; static int netscape_lock; @@ -188,14 +188,14 @@ static void mozilla_remote_init_atoms() { - if (!XA_MOZILLA_VERSION) - XA_MOZILLA_VERSION = gdk_atom_intern(MOZILLA_VERSION_PROP, 0); - if (!XA_MOZILLA_LOCK) - XA_MOZILLA_LOCK = gdk_atom_intern(MOZILLA_LOCK_PROP, 0); - if (!XA_MOZILLA_COMMAND) - XA_MOZILLA_COMMAND = gdk_atom_intern(MOZILLA_COMMAND_PROP, 0); - if (!XA_MOZILLA_RESPONSE) - XA_MOZILLA_RESPONSE = gdk_atom_intern(MOZILLA_RESPONSE_PROP, 0); + if (!GDKA_MOZILLA_VERSION) + GDKA_MOZILLA_VERSION = gdk_atom_intern(MOZILLA_VERSION_PROP, 0); + if (!GDKA_MOZILLA_LOCK) + GDKA_MOZILLA_LOCK = gdk_atom_intern(MOZILLA_LOCK_PROP, 0); + if (!GDKA_MOZILLA_COMMAND) + GDKA_MOZILLA_COMMAND = gdk_atom_intern(MOZILLA_COMMAND_PROP, 0); + if (!GDKA_MOZILLA_RESPONSE) + GDKA_MOZILLA_RESPONSE = gdk_atom_intern(MOZILLA_RESPONSE_PROP, 0); } static GdkWindow *mozilla_remote_find_window() @@ -228,7 +228,8 @@ unsigned long nitems, bytesafter; unsigned char *version = 0; Window w = GClientWindow(gdk_display, kids[i]); - int status = XGetWindowProperty(gdk_display, w, XA_MOZILLA_VERSION, + int status = XGetWindowProperty(gdk_display, w, + gdk_x11_atom_to_xatom(GDKA_MOZILLA_VERSION), 0, (65536 / sizeof(long)), False, XA_STRING, &type, &format, &nitems, &bytesafter, @@ -295,8 +296,8 @@ gint nitems; unsigned char *data = 0; - result = gdk_property_get(window, XA_MOZILLA_LOCK, - XA_STRING, 0, + result = gdk_property_get(window, GDKA_MOZILLA_LOCK, + gdk_x11_xatom_to_atom (XA_STRING), 0, (65536 / sizeof(long)), 0, &actual_type, &actual_format, &nitems, &data); if (result != Success || actual_type == None) { @@ -304,7 +305,8 @@ debug_printf("%s: (writing " MOZILLA_LOCK_PROP " \"%s\" to 0x%x)\n", progname, lock_data, (unsigned int)window); - gdk_property_change(window, XA_MOZILLA_LOCK, XA_STRING, + gdk_property_change(window, GDKA_MOZILLA_LOCK, + gdk_x11_xatom_to_atom (XA_STRING), 8, PropModeReplace, (unsigned char *)lock_data, strlen(lock_data)); locked = True; @@ -333,7 +335,8 @@ debug_printf("%s: (deleting " MOZILLA_LOCK_PROP " \"%s\" from 0x%x)\n", progname, lock_data, (unsigned int)window); - result = gdk_property_get(window, XA_MOZILLA_LOCK, XA_STRING, + result = gdk_property_get(window, GDKA_MOZILLA_LOCK, + gdk_x11_xatom_to_atom (XA_STRING), 0, (65536 / sizeof(long)), 1, &actual_type, &actual_format, &nitems, &data); if (result != Success) { @@ -378,8 +381,9 @@ debug_printf("%s: (writing " MOZILLA_COMMAND_PROP " \"%s\" to 0x%x)\n", progname, command, (unsigned int)window); - gdk_property_change(window, XA_MOZILLA_COMMAND, XA_STRING, 8, - GDK_PROP_MODE_REPLACE, (unsigned char *)command, strlen(command)); + gdk_property_change(window, GDKA_MOZILLA_COMMAND, + gdk_x11_xatom_to_atom (XA_STRING), + 8, GDK_PROP_MODE_REPLACE, (unsigned char *)command, strlen(command)); while (!done) { GdkEvent *event; @@ -403,13 +407,13 @@ } else if (event->type == GDK_PROPERTY_NOTIFY && event->property.state == GDK_PROPERTY_NEW_VALUE && event->property.window == window && - event->property.atom == XA_MOZILLA_RESPONSE) { + event->property.atom == GDKA_MOZILLA_RESPONSE) { GdkAtom actual_type; gint actual_format, nitems; unsigned char *data = 0; - result = gdk_property_get(window, XA_MOZILLA_RESPONSE, - XA_STRING, 0, + result = gdk_property_get(window, GDKA_MOZILLA_RESPONSE, + gdk_x11_xatom_to_atom (XA_STRING), 0, (65536 / sizeof(long)), 1, &actual_type, &actual_format, &nitems, &data); @@ -464,7 +468,7 @@ } else if (event->type == GDK_PROPERTY_NOTIFY && event->property.window == window && event->property.state == GDK_PROPERTY_DELETE && - event->property.atom == XA_MOZILLA_COMMAND) { + event->property.atom == GDKA_MOZILLA_COMMAND) { debug_printf("%s: (server 0x%x has accepted " MOZILLA_COMMAND_PROP ".)\n", progname, (unsigned int)window); } @@ -585,7 +589,7 @@ /* args will be allocated below but we don't bother * freeing it since we're just going to exec and * exit */ - char **args; + char **args=NULL; char command[1024]; if (web_browser == BROWSER_OPERA) { Index: buddy.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/buddy.c,v retrieving revision 1.323 retrieving revision 1.324 diff -u -d -r1.323 -r1.324 --- buddy.c 25 Aug 2002 10:51:22 -0000 1.323 +++ buddy.c 29 Aug 2002 01:47:13 -0000 1.324 @@ -1494,7 +1494,7 @@ GList *i; struct buddy_show *b = NULL; struct conversation *c; - i = GTK_TREE_SELECTION(tree); + i = GTK_TREE_SELECTION_OLD(tree); if (i) { b = gtk_object_get_user_data(GTK_OBJECT(i->data)); } @@ -1520,7 +1520,7 @@ { GList *i; struct buddy_show *b = NULL; - i = GTK_TREE_SELECTION(tree); + i = GTK_TREE_SELECTION_OLD(tree); if (i) { b = gtk_object_get_user_data(GTK_OBJECT(i->data)); } @@ -2017,23 +2017,15 @@ } void hide_buddy_list() { -#ifdef USE_APPLET - applet_destroy_buddy(NULL, NULL, NULL); -#else - XIconifyWindow(GDK_DISPLAY(), - GDK_WINDOW_XWINDOW(blist->window), - ((_XPrivDisplay)GDK_DISPLAY())->default_screen); -#endif + if (blist) + XIconifyWindow(GDK_DISPLAY(), + GDK_WINDOW_XWINDOW(blist->window), + ((_XPrivDisplay)GDK_DISPLAY())->default_screen); } void unhide_buddy_list() { -#ifdef USE_APPLET - if (!applet_buddy_show) { - applet_buddy_show = TRUE; - createOnlinePopup(); - } -#endif /* USE_APPLET */ - gdk_window_show(blist->window); + if (blist) + gdk_window_show(blist->window); } static gint log_timeout(struct buddy_show *b) @@ -2483,7 +2475,7 @@ gtk_container_add(GTK_CONTAINER(menuitem), label); gtk_widget_show(label); - gtk_widget_add_accelerator(menuitem, "activate-item", accel, str[0], + gtk_widget_add_accelerator(menuitem, "activate", accel, str[0], GDK_MOD1_MASK, GTK_ACCEL_LOCKED); gtk_widget_lock_accelerators(menuitem); @@ -2652,7 +2644,7 @@ gtk_window_set_policy(GTK_WINDOW(blist), TRUE, TRUE, TRUE); accel = gtk_accel_group_new(); - gtk_accel_group_attach(accel, GTK_OBJECT(blist)); + gtk_accel_group_attach(accel, G_OBJECT(blist)); menubar = gtk_menu_bar_new(); Index: buddy_chat.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/buddy_chat.c,v retrieving revision 1.156 retrieving revision 1.157 diff -u -d -r1.156 -r1.157 --- buddy_chat.c 27 Aug 2002 17:58:14 -0000 1.156 +++ buddy_chat.c 29 Aug 2002 01:47:13 -0000 1.157 @@ -316,8 +316,8 @@ static void do_invite(GtkWidget *w, struct conversation *b) { - char *buddy; - char *mess; + const char *buddy; + const char *mess; if (!b->is_chat) { debug_printf("do_invite: expecting chat, got IM\n"); Index: conversation.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/conversation.c,v retrieving revision 1.369 retrieving revision 1.370 diff -u -d -r1.369 -r1.370 --- conversation.c 28 Aug 2002 08:13:58 -0000 1.369 +++ conversation.c 29 Aug 2002 01:47:13 -0000 1.370 @@ -198,7 +198,7 @@ } -struct conversation *find_conversation(char *name) +struct conversation *find_conversation(const char *name) { char *cuser = g_malloc(1024); struct conversation *c; @@ -417,20 +417,17 @@ static void do_save_convo(GtkObject *obj, GtkWidget *wid) { struct conversation *c = gtk_object_get_user_data(obj); - char *filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(wid)); + const char *filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(wid)); FILE *f; if (file_is_dir(filename, wid)) return; - if ((!c->is_chat && g_list_find(conversations, c)) || - (c->is_chat && g_slist_find(connections, c->gc) && g_slist_find(c->gc->buddy_chats, c))) - filename = g_strdup(filename); - else - filename = NULL; + if (!((!c->is_chat && g_list_find(conversations, c)) || + (c->is_chat && g_slist_find(connections, c->gc) && g_slist_find(c->gc->buddy_chats, c)))) + filename = NULL; gtk_widget_destroy(wid); if (!filename) return; f = fopen(filename, "w+"); - g_free(filename); if (!f) return; fprintf(f, "%s", c->history->str); @@ -454,18 +451,16 @@ static void do_insert_image(GtkObject *obj, GtkWidget *wid) { struct conversation *c = gtk_object_get_user_data(obj); - char *name = gtk_file_selection_get_filename(GTK_FILE_SELECTION(wid)); - char *filename; + const char *name = gtk_file_selection_get_filename(GTK_FILE_SELECTION(wid)); + const char *filename; int pos; - char buf[512]; + char *buf; struct stat st; int id = g_slist_length(c->images) + 1; if (file_is_dir(name, wid)) return; - if ((!c->is_chat && g_list_find(conversations, c))) - name = g_strdup(name); - else + if (!(!c->is_chat && g_list_find(conversations, c))) name = NULL; gtk_widget_destroy(wid); if (!name) @@ -480,10 +475,8 @@ while (strchr(filename, '/')) filename = strchr(filename, '/') + 1; - g_snprintf(buf, sizeof(buf), - "<IMG SRC=\"file://%s\" ID=\"%d\" DATASIZE=\"%d\">", - filename, id, (int)st.st_size); - + buf = g_strdup_printf ("<IMG SRC=\"file://%s\" ID=\"%d\" DATASIZE=\"%d\">", + filename, id, (int)st.st_size); c->images = g_slist_append(c->images, g_strdup(name)); if (GTK_OLD_EDITABLE(c->entry)->has_selection) { @@ -495,7 +488,7 @@ gtk_editable_insert_text(GTK_EDITABLE(c->entry), buf, strlen(buf), &pos); } - g_free(name); + g_free(buf); } void insert_image(GtkWidget *save, struct conversation *c) @@ -3373,17 +3366,10 @@ { struct conversation *c = data; - GList *frames; - GdkPixbufFrame *frame; GdkPixbuf *buf; GdkPixbuf *scale; - GdkPixmap *src; GdkPixmap *pm; GdkBitmap *bm; -#if GTK_CHECK_VERSION(1,3,0) - GdkPixbufAnimationIter *iter; -#endif - GdkGC *gc; gint delay; if (!g_list_find(conversations, c)) { @@ -3391,7 +3377,6 @@ return FALSE; } -#if GTK_CHECK_VERSION(1,3,0) gdk_pixbuf_animation_iter_advance(c->iter, NULL); buf = gdk_pixbuf_animation_iter_get_pixbuf(c->iter); scale = gdk_pixbuf_scale_simple(buf, @@ -3408,75 +3393,6 @@ if (bm) gdk_bitmap_unref(bm); delay = gdk_pixbuf_animation_iter_get_delay_time(c->iter) / 10; -#else - frames = gdk_pixbuf_animation_get_frames(c->anim); - frame = g_list_nth_data(frames, c->frame); - switch (gdk_pixbuf_frame_get_action(frame)) { - case GDK_PIXBUF_FRAME_RETAIN: - buf = gdk_pixbuf_frame_get_pixbuf(frame); - scale = gdk_pixbuf_scale_simple(buf, - MAX(gdk_pixbuf_get_width(buf) * SCALE(c->anim) / - gdk_pixbuf_animation_get_width(c->anim), 1), - MAX(gdk_pixbuf_get_height(buf) * SCALE(c->anim) / - gdk_pixbuf_animation_get_height(c->anim), 1), - GDK_INTERP_NEAREST); - gdk_pixbuf_render_pixmap_and_mask(scale, &src, &bm, 100); - gdk_pixbuf_unref(scale); - gtk_pixmap_get(GTK_PIXMAP(c->icon), &pm, NULL); - gc = gdk_gc_new(pm); - gdk_gc_set_clip_mask(gc, bm); - - gdk_gc_set_clip_origin(gc, gdk_pixbuf_frame_get_x_offset(frame) * - SCALE(c->anim)/gdk_pixbuf_animation_get_width(c->anim), - gdk_pixbuf_frame_get_y_offset(frame) * - SCALE(c->anim)/gdk_pixbuf_animation_get_height(c->anim)); - gdk_draw_pixmap(pm, gc, src, 0, 0, gdk_pixbuf_frame_get_x_offset(frame)* - SCALE(c->anim)/gdk_pixbuf_animation_get_width(c->anim), - gdk_pixbuf_frame_get_y_offset(frame) * - SCALE(c->anim)/gdk_pixbuf_animation_get_height(c->anim),-1,-1); - - gdk_pixmap_unref(src); - if (bm) - gdk_bitmap_unref(bm); - gtk_widget_queue_draw(c->icon); - gdk_gc_unref(gc); - break; - case GDK_PIXBUF_FRAME_DISPOSE: - buf = gdk_pixbuf_frame_get_pixbuf(frame); - scale = gdk_pixbuf_scale_simple(buf, - MAX(gdk_pixbuf_get_width(buf) * SCALE(c->anim) / - gdk_pixbuf_animation_get_width(c->anim), 1), - MAX(gdk_pixbuf_get_height(buf) * SCALE(c->anim) / - gdk_pixbuf_animation_get_height(c->anim), 1), - GDK_INTERP_NEAREST); - gdk_pixbuf_render_pixmap_and_mask(scale, &pm, &bm, 100); - gdk_pixbuf_unref(scale); - gtk_pixmap_set(GTK_PIXMAP(c->icon), pm, bm); - gdk_pixmap_unref(pm); - if (bm) - gdk_bitmap_unref(bm); - break; - case GDK_PIXBUF_FRAME_REVERT: - frame = frames->data; - buf = gdk_pixbuf_frame_get_pixbuf(frame); - scale = gdk_pixbuf_scale_simple(buf, - MAX(gdk_pixbuf_get_width(buf) * SCALE(c->anim) / - gdk_pixbuf_animation_get_width(c->anim), 1), - MAX(gdk_pixbuf_get_height(buf) * SCALE(c->anim) / - gdk_pixbuf_animation_get_height(c->anim), 1), - GDK_INTERP_NEAREST); - gdk_pixbuf_render_pixmap_and_mask(scale, &pm, &bm, 100); - gdk_pixbuf_unref(scale); - gtk_pixmap_set(GTK_PIXMAP(c->icon), pm, bm); - gdk_pixmap_unref(pm); - if (bm) - gdk_bitmap_unref(bm); - break; - } - - c->frame = (c->frame + 1) % g_list_length(frames); - delay = MAX(gdk_pixbuf_frame_get_delay_time(frame), 13); -#endif c->icon_timer = gtk_timeout_add(delay * 10, redraw_icon, c); return FALSE; @@ -3491,16 +3407,8 @@ static void start_anim(GtkObject *obj, struct conversation *c) { - GList *frames; - GdkPixbufFrame *frame; int delay; -#if GTK_CHECK_VERSION(1,3,0) delay = gdk_pixbuf_animation_iter_get_delay_time(c->iter) / 10; -#else - frames = gdk_pixbuf_animation_get_frames(c->anim); - frame = g_list_nth_data(frames, c->frame); - delay = MAX(gdk_pixbuf_frame_get_delay_time(frame), 13); -#endif if (c->anim) c->icon_timer = gtk_timeout_add(delay * 10, redraw_icon, c); } @@ -3515,7 +3423,7 @@ static void do_save_icon(GtkObject *obj, struct conversation *c) { FILE *file; - char *f = gtk_file_selection_get_filename(GTK_FILE_SELECTION(c->save_icon)); + const char *f = gtk_file_selection_get_filename(GTK_FILE_SELECTION(c->save_icon)); if (file_is_dir(f, c->save_icon)) return; @@ -3666,16 +3574,13 @@ void update_icon(struct conversation *c) { -#if USE_PIXBUF || GTK_CHECK_VERSION(1,3,0) char filename[256]; FILE *file; -#if GTK_CHECK_VERSION(1,3,0) GError *err = NULL; -#endif + void *data; int len, delay; - GList *frames; GdkPixbuf *buf; GtkWidget *event; @@ -3709,22 +3614,17 @@ fwrite(data, 1, len, file); fclose(file); -#if GTK_CHECK_VERSION(1,3,0) c->anim = gdk_pixbuf_animation_new_from_file(filename, &err); if (err) { debug_printf("Buddy icon error: %s\n", err->message); g_error_free(err); } -#else - c->anim = gdk_pixbuf_animation_new_from_file(filename); -#endif /* make sure we remove the file as soon as possible */ unlink(filename); if (!c->anim) return; -#if GTK_CHECK_VERSION(1,3,0) if (gdk_pixbuf_animation_is_static_image(c->anim)) { c->iter = NULL; delay = 0; @@ -3743,23 +3643,6 @@ gdk_pixbuf_animation_get_height(c->anim), 1), GDK_INTERP_NEAREST); -#else - c->frame = 1; - frames = gdk_pixbuf_animation_get_frames(c->anim); - buf = gdk_pixbuf_frame_get_pixbuf(frames->data); - sf = SCALE(c->anim); - scale = gdk_pixbuf_scale_simple(buf, - MAX(gdk_pixbuf_get_width(buf) * sf / - gdk_pixbuf_animation_get_width(c->anim), 1), - MAX(gdk_pixbuf_get_height(buf) * sf / - gdk_pixbuf_animation_get_height(c->anim), 1), - GDK_INTERP_NEAREST); - if (gdk_pixbuf_animation_get_num_frames(c->anim) > 1) { - delay = MAX(gdk_pixbuf_frame_get_delay_time(frames->data), 13); - } else { - delay = 0; - } -#endif if (delay) c->icon_timer = gtk_timeout_add(delay * 10, redraw_icon, c); @@ -3786,7 +3669,6 @@ gdk_pixmap_unref(pm); if (bm) gdk_bitmap_unref(bm); -#endif } Index: core.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/core.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- core.h 28 Aug 2002 08:13:58 -0000 1.21 +++ core.h 29 Aug 2002 01:47:13 -0000 1.22 @@ -154,15 +154,15 @@ extern GList *callbacks; /* 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 struct buddy *find_buddy(struct gaim_connection *, const char *); +extern struct group *find_group(struct gaim_connection *, const char *); +extern struct group *find_group_by_buddy(struct gaim_connection *, const char *); +extern struct buddy *add_buddy(struct gaim_connection *, const char *, const char *, const char *); extern void remove_buddy(struct gaim_connection *, struct group *, struct buddy *); -extern struct group *add_group(struct gaim_connection *, char *); +extern struct group *add_group(struct gaim_connection *, const 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 void do_import(struct gaim_connection *, const char *); extern int bud_list_cache_exists(struct gaim_connection *); extern void toc_build_config(struct gaim_connection *, char *, int len, gboolean); extern void parse_toc_buddy_list(struct gaim_connection *, char *); @@ -194,7 +194,7 @@ /* Functions in plugins.c */ #ifdef GAIM_PLUGINS -extern struct gaim_plugin *load_plugin(char *); +extern struct gaim_plugin *load_plugin(const char *); extern void unload_plugin(struct gaim_plugin *); extern struct gaim_plugin *reload_plugin(struct gaim_plugin *); extern void gaim_signal_connect(GModule *, enum gaim_event, void *, void *); Index: dialogs.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/dialogs.c,v retrieving revision 1.329 retrieving revision 1.330 diff -u -d -r1.329 -r1.330 --- dialogs.c 25 Aug 2002 10:51:23 -0000 1.329 +++ dialogs.c 29 Aug 2002 01:47:13 -0000 1.330 @@ -551,11 +551,10 @@ /* The dialog for getting an error */ /*------------------------------------------------------------------------*/ -GtkWidget *do_error_dialog(char *primary, char *secondary, int type) +GtkWidget *do_error_dialog(const char *primary, const char *secondary, int type) { GtkWidget *d; GtkWidget *label; - GtkWidget *close; GtkWidget *img = NULL; GtkWidget *hbox; char labeltext[1024 * 2]; @@ -878,7 +877,7 @@ void do_add_buddy(GtkWidget *w, struct addbuddy *a) { - char *grp, *who, *whoalias; + const char *grp, *who, *whoalias; struct conversation *c; who = gtk_entry_get_text(GTK_ENTRY(a->entry)); @@ -901,7 +900,7 @@ void do_add_group(GtkWidget *w, struct addbuddy *a) { - char *grp; + const char *grp; grp = gtk_entry_get_text(GTK_ENTRY(a->entry)); @@ -1936,14 +1935,14 @@ void do_set_dir(GtkWidget *widget, struct set_dir_dlg *b) { - char *first = gtk_entry_get_text(GTK_ENTRY(b->first)); + const char *first = gtk_entry_get_text(GTK_ENTRY(b->first)); int web = GTK_TOGGLE_BUTTON(b->web)->active; - char *middle = gtk_entry_get_text(GTK_ENTRY(b->middle)); - char *last = gtk_entry_get_text(GTK_ENTRY(b->last)); - char *maiden = gtk_entry_get_text(GTK_ENTRY(b->maiden)); - char *city = gtk_entry_get_text(GTK_ENTRY(b->city)); - char *state = gtk_entry_get_text(GTK_ENTRY(b->state)); - char *country = gtk_entry_get_text(GTK_ENTRY(b->country)); + const char *middle = gtk_entry_get_text(GTK_ENTRY(b->middle)); + const char *last = gtk_entry_get_text(GTK_ENTRY(b->last)); + const char *maiden = gtk_entry_get_text(GTK_ENTRY(b->maiden)); + const char *city = gtk_entry_get_text(GTK_ENTRY(b->city)); + const char *state = gtk_entry_get_text(GTK_ENTRY(b->state)); + const char *country = gtk_entry_get_text(GTK_ENTRY(b->country)); serv_set_dir(b->gc, first, middle, last, maiden, city, state, country, web); @@ -2116,7 +2115,7 @@ void do_change_password(GtkWidget *widget, struct passwddlg *b) { - gchar *orig, *new1, *new2; + const gchar *orig, *new1, *new2; orig = gtk_entry_get_text(GTK_ENTRY(b->original)); new1 = gtk_entry_get_text(GTK_ENTRY(b->new1)); @@ -2420,7 +2419,7 @@ static void do_add_perm(GtkWidget *w, struct addperm *p) { - char *who; + const char *who; char *name; @@ -2575,7 +2574,7 @@ { struct log_conversation *l; char buf[128]; - char *file; + const char *file; char path[PATHSIZE]; if (!find_log_info(c->name)) { @@ -2632,13 +2631,13 @@ void do_find_info(GtkWidget *w, struct findbyinfo *b) { - char *first; - char *middle; - char *last; - char *maiden; - char *city; - char *state; - char *country; + const char *first; + const char *middle; + const char *last; + const char *maiden; + const char *city; + const char *state; + const char *country; first = gtk_entry_get_text(GTK_ENTRY(b->firstentry)); middle = gtk_entry_get_text(GTK_ENTRY(b->middleentry)); @@ -2654,7 +2653,7 @@ void do_find_email(GtkWidget *w, struct findbyemail *b) { - char *email; + const char *email; email = gtk_entry_get_text(GTK_ENTRY(b->emailentry)); @@ -2893,7 +2892,7 @@ void do_add_link(GtkWidget *widget, struct linkdlg *b) { char *open_tag; - char *urltext, *showtext; + const char *urltext, *showtext; open_tag = g_malloc(2048); @@ -3310,7 +3309,7 @@ static void do_import_dialog(GtkWidget *w, struct gaim_connection *gc) { - char *file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(importdialog)); + const char *file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(importdialog)); if (file_is_dir(file, importdialog)) { return; } @@ -3563,7 +3562,6 @@ gtk_widget_show(ca->text); -#if GTK_CHECK_VERSION(1,3,0) if (dummy) { struct away_message *amt; GtkTreeIter iter; @@ -3581,18 +3579,6 @@ strlen(amt->message), &pos); ca->mess = amt; } -#else - if (dummy && GTK_LIST(prefs_away_list)->selection) { - GtkWidget *item = GTK_LIST(prefs_away_list)->selection->data; - struct away_message *amt = gtk_object_get_user_data(GTK_OBJECT(item)); - int pos = 0; - gtk_entry_set_text(GTK_ENTRY(ca->entry), amt->name); - gtk_editable_insert_text(GTK_EDITABLE(ca->text), amt->message, - strlen(amt->message), &pos); - ca->mess = amt; - } -#endif - hbox = gtk_hbox_new(FALSE, 5); gtk_box_pack_start(GTK_BOX(tbox), hbox, FALSE, FALSE, 0); @@ -3813,7 +3799,7 @@ static void do_alias_bud(GtkWidget *w, struct buddy *b) { - char *al = gtk_entry_get_text(GTK_ENTRY(aliasname)); + const char *al = gtk_entry_get_text(GTK_ENTRY(aliasname)); g_snprintf(b->show, sizeof(b->show), "%s", (al && strlen(al)) ? al : b->name); handle_buddy_rename(b, b->name); serv_alias_buddy(b); @@ -4328,7 +4314,7 @@ static void do_rename_group(GtkObject *obj, GtkWidget *entry) { - char *new_name; + const char *new_name; struct group *g; struct group *orig; struct gaim_connection *gc; @@ -4428,7 +4414,7 @@ static void do_rename_buddy(GtkObject *obj, GtkWidget *entry) { - char *new_name; + const char *new_name; struct buddy *b; GSList *gr; Index: gaim.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/gaim.h,v retrieving revision 1.332 retrieving revision 1.333 diff -u -d -r1.332 -r1.333 --- gaim.h 28 Aug 2002 05:55:48 -0000 1.332 +++ gaim.h 29 Aug 2002 01:47:14 -0000 1.333 @@ -343,13 +343,13 @@ /* Functions in conversation.c */ extern void write_to_conv(struct conversation *, char *, int, char *, time_t, int); -extern struct conversation *find_conversation(char *); +extern struct conversation *find_conversation(const char *); extern void set_anim(); extern void set_blist_tab(); /* Functions in dialogs.c */ extern void g_show_info_text(struct gaim_connection *, char *, int, char *, ...); -extern GtkWidget *do_error_dialog(char *, char *, int type); +extern GtkWidget *do_error_dialog(const char *, const char *, int type); extern void show_change_passwd(struct gaim_connection *); extern void show_set_dir(struct gaim_connection *); extern void show_find_email(struct gaim_connection *); @@ -383,8 +383,8 @@ extern void serv_set_away(struct gaim_connection *, char *, char *); extern void serv_set_away_all(char *); extern int serv_send_typing(struct gaim_connection *, char *, int); -extern void serv_change_passwd(struct gaim_connection *, char *, char *); -extern void serv_add_buddy(struct gaim_connection *, char *); +extern void serv_change_passwd(struct gaim_connection *, const char *, const char *); +extern void serv_add_buddy(struct gaim_connection *, const char *); extern void serv_add_buddies(struct gaim_connection *, GList *); extern void serv_remove_buddy(struct gaim_connection *, char *, char *); extern void serv_remove_buddies(struct gaim_connection *, GList *, char *); @@ -394,10 +394,10 @@ extern void serv_rem_deny(struct gaim_connection *, char *); extern void serv_set_permit_deny(struct gaim_connection *); extern void serv_warn(struct gaim_connection *, char *, int); -extern void serv_set_dir(struct gaim_connection *, char *, char *, char *, char *, char *, char *, char *, int); -extern void serv_dir_search(struct gaim_connection *, char *, char *, char *, char *, char *, char *, char *, char *); +extern void serv_set_dir(struct gaim_connection *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, int); +extern void serv_dir_search(struct gaim_connection *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *); extern void serv_join_chat(struct gaim_connection *, GList *); -extern void serv_chat_invite(struct gaim_connection *, int, char *, char *); +extern void serv_chat_invite(struct gaim_connection *, int, const char *, const char *); extern void serv_chat_leave(struct gaim_connection *, int); extern void serv_chat_whisper(struct gaim_connection *, int, char *, char *); extern int serv_chat_send(struct gaim_connection *, int, char *); @@ -405,7 +405,7 @@ extern void serv_get_away(struct gaim_connection *, char *); extern void serv_alias_buddy(struct buddy *); extern void serv_move_buddy(struct buddy *, struct group *, struct group *); -extern void serv_rename_group(struct gaim_connection *, struct group *, char *); +extern void serv_rename_group(struct gaim_connection *, struct group *, const char *); /* Functions in util.c */ extern char *normalize(const char *); Index: gtkimhtml.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkimhtml.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- gtkimhtml.h 16 Aug 2002 01:25:03 -0000 1.16 +++ gtkimhtml.h 29 Aug 2002 01:47:14 -0000 1.17 @@ -46,6 +46,7 @@ GtkLayout layout; GdkFont *default_font; + // PangoFontDescription *default_font; GdkColor *default_fg_color; GdkColor *default_bg_color; GdkColor *default_hl_color; @@ -109,10 +110,11 @@ GtkAdjustment *hadj, GtkAdjustment *vadj); -void gtk_imhtml_set_defaults (GtkIMHtml *imhtml, - GdkFont *font, - GdkColor *fg_color, - GdkColor *bg_color); +void gtk_imhtml_set_defaults (GtkIMHtml *imhtml, + GdkFont *font, + //PangoFontDescription *font, + GdkColor *fg_color, + GdkColor *bg_color); void gtk_imhtml_set_img_handler (GtkIMHtml *imhtml, GtkIMHtmlImage handler); Index: list.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/list.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- list.c 16 Aug 2002 20:24:20 -0000 1.15 +++ list.c 29 Aug 2002 01:47:14 -0000 1.16 @@ -100,11 +100,11 @@ * mostly. remove_group is only called from one place, so we'll let it handle it. */ } -struct buddy *add_buddy(struct gaim_connection *gc, char *group, char *buddy, char *show) +struct buddy *add_buddy(struct gaim_connection *gc, const char *group, const char *buddy, const char *show) { struct buddy *b; struct group *g; - char *good; + const char *good; if (!g_slist_find(connections, gc)) return NULL; @@ -143,7 +143,7 @@ return b; } -struct group *add_group(struct gaim_connection *gc, char *group) +struct group *add_group(struct gaim_connection *gc, const char *group) { struct group *g = find_group(gc, group); if (g) @@ -165,7 +165,7 @@ return g; } -struct group *find_group(struct gaim_connection *gc, char *group) +struct group *find_group(struct gaim_connection *gc, const char *group) { struct group *g; GSList *grp; @@ -209,7 +209,7 @@ } } -struct group *find_group_by_buddy(struct gaim_connection *gc, char *who) +struct group *find_group_by_buddy(struct gaim_connection *gc, const char *who) { struct group *g; struct buddy *b; @@ -273,7 +273,7 @@ } } -struct buddy *find_buddy(struct gaim_connection *gc, char *who) +struct buddy *find_buddy(struct gaim_connection *gc, const char *who) { struct group *g; struct buddy *b; @@ -690,7 +690,7 @@ return ret; } -void do_import(struct gaim_connection *gc, char *filename) +void do_import(struct gaim_connection *gc, const char *filename) { GString *buf = NULL; char first[64]; Index: module.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/module.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- module.c 28 Aug 2002 08:13:58 -0000 1.18 +++ module.c 29 Aug 2002 01:47:14 -0000 1.19 @@ -57,7 +57,7 @@ /* --------------- Function Declarations --------------------- */ -struct gaim_plugin * load_plugin(char *); +struct gaim_plugin * load_plugin(const char *); void unload_plugin(struct gaim_plugin *p); struct gaim_plugin *reload_plugin(struct gaim_plugin *p); @@ -71,7 +71,7 @@ /* ------------------ Code Below ---------------------------- */ -struct gaim_plugin *load_plugin(char *filename) +struct gaim_plugin *load_plugin(const char *filename) { struct gaim_plugin *plug; GList *c = plugins; Index: multi.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/multi.c,v retrieving revision 1.124 retrieving revision 1.125 diff -u -d -r1.124 -r1.125 --- multi.c 28 Aug 2002 06:48:14 -0000 1.124 +++ multi.c 29 Aug 2002 01:47:14 -0000 1.125 @@ -429,7 +429,7 @@ static void set_icon(GtkWidget *w, struct mod_user *u) { GtkWidget *sel = u->icondlg; - char *file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(sel)); + const char *file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(sel)); if (file_is_dir(file, sel)) return; Index: plugins.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/plugins.c,v retrieving revision 1.88 retrieving revision 1.89 diff -u -d -r1.88 -r1.89 --- plugins.c 5 Aug 2002 07:33:09 -0000 1.88 +++ plugins.c 29 Aug 2002 01:47:14 -0000 1.89 @@ -144,7 +144,7 @@ static void load_which_plugin(GtkWidget *w, gpointer data) { - char *file; + const char *file; struct gaim_plugin *p; file = (char *)gtk_file_selection_get_filename(GTK_FILE_SELECTION(plugin_dialog)); @@ -539,8 +539,8 @@ static const gchar *plugin_makelistname(GModule *module) { static gchar filename[PATHSIZE]; - gchar *filepath = (char *)g_module_name(module); - char *cp; + const gchar *filepath = (char *)g_module_name(module); + const char *cp; if (filepath == NULL || strlen(filepath) == 0) return NULL; Index: prefs.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/prefs.c,v retrieving revision 1.242 retrieving revision 1.243 diff -u -d -r1.242 -r1.243 --- prefs.c 28 Aug 2002 05:55:48 -0000 1.242 +++ prefs.c 29 Aug 2002 01:47:14 -0000 1.243 @@ -271,7 +271,6 @@ /* These are the pages in the preferences notebook */ GtkWidget *interface_page() { GtkWidget *ret; - GtkWidget *frame; GtkWidget *vbox; ret = gtk_vbox_new(FALSE, 18); gtk_container_set_border_width (GTK_CONTAINER (ret), 12); Index: prpl.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/prpl.c,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- prpl.c 25 Aug 2002 10:51:23 -0000 1.57 +++ prpl.c 29 Aug 2002 01:47:14 -0000 1.58 @@ -36,7 +36,7 @@ struct _prompt { GtkWidget *window; GtkWidget *entry; - void (*doit)(void *, char *); + void (*doit)(void *, const char *); void (*dont)(void *); void *data; }; Index: prpl.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/prpl.h,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- prpl.h 7 Jul 2002 14:31:57 -0000 1.67 +++ prpl.h 29 Aug 2002 01:47:14 -0000 1.68 @@ -119,26 +119,26 @@ void (* get_info) (struct gaim_connection *, char *who); void (* set_away) (struct gaim_connection *, char *state, char *message); void (* get_away) (struct gaim_connection *, char *who); - void (* set_dir) (struct gaim_connection *, char *first, - char *middle, - char *last, - char *maiden, - char *city, - char *state, - char *country, + void (* set_dir) (struct gaim_connection *, const char *first, + const char *middle, + const char *last, + const char *maiden, + const char *city, + const char *state, + const char *country, int web); void (* get_dir) (struct gaim_connection *, char *who); - void (* dir_search) (struct gaim_connection *, char *first, - char *middle, - char *last, - char *maiden, - char *city, - char *state, - char *country, - char *email); + void (* dir_search) (struct gaim_connection *, const char *first, + const char *middle, + const char *last, + const char *maiden, + const char *city, + const char *state, + const char *country, + const char *email); void (* set_idle) (struct gaim_connection *, int idletime); - void (* change_passwd) (struct gaim_connection *, char *old, char *new); - void (* add_buddy) (struct gaim_connection *, char *name); + void (* change_passwd) (struct gaim_connection *, const char *old, const char *new); + void (* add_buddy) (struct gaim_connection *, const char *name); void (* add_buddies) (struct gaim_connection *, GList *buddies); void (* remove_buddy) (struct gaim_connection *, char *name, char *group); void (* remove_buddies) (struct gaim_connection *, GList *buddies, char *group); @@ -149,7 +149,7 @@ void (* set_permit_deny)(struct gaim_connection *); void (* warn) (struct gaim_connection *, char *who, int anonymous); void (* join_chat) (struct gaim_connection *, GList *data); - void (* chat_invite) (struct gaim_connection *, int id, char *who, char *message); + void (* chat_invite) (struct gaim_connection *, int id, const char *who, const char *message); void (* chat_leave) (struct gaim_connection *, int id); void (* chat_whisper) (struct gaim_connection *, int id, char *who, char *message); int (* chat_send) (struct gaim_connection *, int id, char *message); Index: server.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/server.c,v retrieving revision 1.231 retrieving revision 1.232 diff -u -d -r1.231 -r1.232 --- server.c 28 Aug 2002 05:55:48 -0000 1.231 +++ server.c 29 Aug 2002 01:47:14 -0000 1.232 @@ -179,15 +179,15 @@ g->prpl->get_dir(g, name); } -void serv_set_dir(struct gaim_connection *g, char *first, char *middle, char *last, char *maiden, - char *city, char *state, char *country, int web) +void serv_set_dir(struct gaim_connection *g, const char *first, const char *middle, const char *last, const char *maiden, + const char *city, const char *state, const char *country, int web) { if (g && g_slist_find(connections, g) && g->prpl && g->prpl->set_dir) g->prpl->set_dir(g, first, middle, last, maiden, city, state, country, web); } -void serv_dir_search(struct gaim_connection *g, char *first, char *middle, char *last, char *maiden, - char *city, char *state, char *country, char *email) +void serv_dir_search(struct gaim_connection *g, const char *first, const char *middle, const char *last, const char *maiden, + const char *city, const char *state, const char *country, const char *email) { if (g && g_slist_find(connections, g) && g->prpl && g->prpl->dir_search) g->prpl->dir_search(g, first, middle, last, maiden, city, state, country, email); @@ -238,13 +238,13 @@ } } -void serv_change_passwd(struct gaim_connection *g, char *orig, char *new) +void serv_change_passwd(struct gaim_connection *g, const char *orig, const char *new) { if (g && g_slist_find(connections, g) && g->prpl && g->prpl->change_passwd) g->prpl->change_passwd(g, orig, new); } -void serv_add_buddy(struct gaim_connection *g, char *name) +void serv_add_buddy(struct gaim_connection *g, const char *name) { if (g && g_slist_find(connections, g) && g->prpl && g->prpl->add_buddy) g->prpl->add_buddy(g, name); @@ -319,7 +319,7 @@ /* * Rename a group on server roster/list. */ -void serv_rename_group(struct gaim_connection *g, struct group *old_group, char *new_name) +void serv_rename_group(struct gaim_connection *g, struct group *old_group, const char *new_name) { if (g && g->prpl && old_group && new_name) { GList *tobemoved = NULL; @@ -393,7 +393,7 @@ g->prpl->join_chat(g, data); } -void serv_chat_invite(struct gaim_connection *g, int id, char *message, char *name) +void serv_chat_invite(struct gaim_connection *g, int id, const char *message, const char *name) { char *buffy = message && *message ? g_strdup(message) : NULL; plugin_event(event_chat_send_invite, g, (void *)id, name, &buffy); Index: util.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/util.c,v retrieving revision 1.129 retrieving revision 1.130 diff -u -d -r1.129 -r1.130 --- util.c 28 Aug 2002 05:55:48 -0000 1.129 +++ util.c 29 Aug 2002 01:47:14 -0000 1.130 @@ -1238,7 +1238,7 @@ FILE *gaim_mkstemp(gchar **fpath) { - gchar *tmpdir; + const gchar *tmpdir; int fd; FILE *fp = NULL; |