Mercurial > pidgin.yaz
changeset 3466:7a3f16a375a5
[gaim-migrate @ 3516]
some patches from some people.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Thu, 29 Aug 2002 01:47:15 +0000 |
parents | ec437d73b2ee |
children | 79e0d2f8ad2b |
files | ChangeLog plugins/ticker/gtkticker.c plugins/ticker/ticker.c src/browser.c src/buddy.c src/buddy_chat.c src/conversation.c src/core.h src/dialogs.c src/gaim.h src/gtkimhtml.h src/list.c src/module.c src/multi.c src/plugins.c src/prefs.c src/protocols/gg/common.c src/protocols/gg/gg.c src/protocols/gg/libgg.h src/protocols/icq/gaim_icq.c src/protocols/irc/irc.c src/protocols/jabber/jabber.c src/protocols/msn/msn.c src/protocols/napster/napster.c src/protocols/oscar/aim.h src/protocols/oscar/oscar.c src/protocols/oscar/ssi.c src/protocols/toc/toc.c src/protocols/yahoo/yahoo.c src/protocols/zephyr/zephyr.c src/prpl.c src/prpl.h src/server.c src/util.c |
diffstat | 34 files changed, 218 insertions(+), 394 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Thu Aug 29 01:43:23 2002 +0000 +++ b/ChangeLog Thu Aug 29 01:47:15 2002 +0000 @@ -31,6 +31,7 @@ - Buddy Icons - IM Images - Alert Dialogs + - GtkIMHtml tooltips Pangonated * Notify.c plugin rewritten; check its configure dialog (Thanks, Etan Reisner) * TOC no longer compiles statically by default--use OSCAR @@ -51,11 +52,12 @@ circuitable in perl. (Thanks Ryan McCabe) * Improved MSN internationalization (Thanks A Lee) * Can get info for ICQ and Jabber users from the "Edit - Buddies" tab (Thanks click81) + Buddies" tab (Thanks Brian Bernas) * Option to log IMs and Chats seperately. (Thanks Etan Reisner) * Nice Oscar changes--mostly internal (Thanks Mark Doliner) * event_del_conversation for plugins (Thanks Bill Tompkins) + * Code cleanups and fixes (Thanks Federico Mena Quintero) version 0.59 (06/24/2002): * Hungarian translation added (Thanks, Sutto Zoltan)
--- a/plugins/ticker/gtkticker.c Thu Aug 29 01:43:23 2002 +0000 +++ b/plugins/ticker/gtkticker.c Thu Aug 29 01:47:15 2002 +0000 @@ -33,10 +33,6 @@ GtkRequisition *requisition); static void gtk_ticker_size_allocate (GtkWidget *widget, GtkAllocation *allocation); -static void gtk_ticker_paint (GtkWidget *widget, - GdkRectangle *area); -static void gtk_ticker_draw (GtkWidget *widget, - GdkRectangle *area); static gint gtk_ticker_expose (GtkWidget *widget, GdkEventExpose *event); static void gtk_ticker_add_real (GtkContainer *container, @@ -95,9 +91,6 @@ widget_class->realize = gtk_ticker_realize; widget_class->size_request = gtk_ticker_size_request; widget_class->size_allocate = gtk_ticker_size_allocate; -#if ! GTK_CHECK_VERSION(1,3,0) - widget_class->draw = gtk_ticker_draw; -#endif widget_class->expose_event = gtk_ticker_expose; container_class->add = gtk_ticker_add_real; @@ -450,45 +443,6 @@ } } -static void -gtk_ticker_paint (GtkWidget *widget, - GdkRectangle *area) -{ - g_return_if_fail (widget != NULL); - g_return_if_fail (GTK_IS_TICKER (widget)); - g_return_if_fail (area != NULL); - - if (GTK_WIDGET_DRAWABLE (widget)) - gdk_window_clear_area (widget->window, 0, 0, widget->allocation.width, - widget->allocation.height); -} - -static void -gtk_ticker_draw (GtkWidget *widget, - GdkRectangle *area) -{ - GtkTicker *ticker; - GtkTickerChild *child; - GList *children; - - g_return_if_fail (widget != NULL); - g_return_if_fail (GTK_IS_TICKER (widget)); - - if (GTK_WIDGET_DRAWABLE (widget)) - { - ticker = GTK_TICKER (widget); - gtk_ticker_paint (widget, area); - - children = ticker->children; - while (children) - { - child = children->data; - children = children->next; - gtk_widget_draw (child->widget, NULL); - } - } -} - static gint gtk_ticker_expose (GtkWidget *widget, GdkEventExpose *event) { @@ -523,6 +477,7 @@ return FALSE; } + void gtk_ticker_add(GtkTicker *ticker, GtkWidget *widget) {
--- a/plugins/ticker/ticker.c Thu Aug 29 01:43:23 2002 +0000 +++ b/plugins/ticker/ticker.c Thu Aug 29 01:47:15 2002 +0000 @@ -70,7 +70,8 @@ userclose = TRUE; } -static char *msg = "Welcome to Gaim " VERSION ", brought to you by Rob Flynn (maintainer), Eric Warmenhoven, Mark Spencer, Jeramey Crawford, Jim Duchek, Syd Logan, and Sean Egan"; +/* static char *msg = "Welcome to Gaim " VERSION ", brought to you by Rob Flynn (maintainer), Eric Warmenhoven, Mark Spencer, Jeramey Crawford, Jim Duchek, Syd Logan, and Sean Egan"; + */ void BuddyTickerCreateWindow() @@ -112,7 +113,7 @@ ButtonPressCallback( GtkWidget *widget, GdkEvent *event, gpointer callback_data ) { TickerData *p = (TickerData *) callback_data; - struct conversation *conv = new_conversation(p->buddy); + new_conversation(p->buddy); return TRUE; }
--- a/src/browser.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/browser.c Thu Aug 29 01:47:15 2002 +0000 @@ -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) {
--- a/src/buddy.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/buddy.c Thu Aug 29 01:47:15 2002 +0000 @@ -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();
--- a/src/buddy_chat.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/buddy_chat.c Thu Aug 29 01:47:15 2002 +0000 @@ -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");
--- a/src/conversation.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/conversation.c Thu Aug 29 01:47:15 2002 +0000 @@ -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 }
--- a/src/core.h Thu Aug 29 01:43:23 2002 +0000 +++ b/src/core.h Thu Aug 29 01:47:15 2002 +0000 @@ -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 *);
--- a/src/dialogs.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/dialogs.c Thu Aug 29 01:47:15 2002 +0000 @@ -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;
--- a/src/gaim.h Thu Aug 29 01:43:23 2002 +0000 +++ b/src/gaim.h Thu Aug 29 01:47:15 2002 +0000 @@ -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 *);
--- a/src/gtkimhtml.h Thu Aug 29 01:43:23 2002 +0000 +++ b/src/gtkimhtml.h Thu Aug 29 01:47:15 2002 +0000 @@ -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);
--- a/src/list.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/list.c Thu Aug 29 01:47:15 2002 +0000 @@ -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];
--- a/src/module.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/module.c Thu Aug 29 01:47:15 2002 +0000 @@ -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;
--- a/src/multi.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/multi.c Thu Aug 29 01:47:15 2002 +0000 @@ -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;
--- a/src/plugins.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/plugins.c Thu Aug 29 01:47:15 2002 +0000 @@ -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;
--- a/src/prefs.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/prefs.c Thu Aug 29 01:47:15 2002 +0000 @@ -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);
--- a/src/protocols/gg/common.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/protocols/gg/common.c Thu Aug 29 01:47:15 2002 +0000 @@ -1,4 +1,4 @@ -/* $Id: common.c 2859 2001-12-05 09:48:56Z warmenhoven $ */ +/* $Id: common.c 3516 2002-08-29 01:47:15Z seanegan $ */ /* * (C) Copyright 2001 Wojtek Kaniewski <wojtekka@irc.pl>, @@ -41,6 +41,7 @@ #endif #include "libgg.h" #include "config.h" +#include <glib.h> /* * gg_debug() @@ -255,21 +256,22 @@ * zwraca zaalokowany bufor, który wypadałoby kiedy¶ zwolnić albo NULL * w przypadku błędu. */ -char *gg_urlencode(char *str) +char *gg_urlencode(const char *str) { - char *p, *q, *buf, hex[] = "0123456789abcdef"; + const char *p, hex[] = "0123456789abcdef"; + char *q, *buf; + int size = 0; if (!str) - str = strdup(""); + str = ""; for (p = str; *p; p++, size++) { if (!((*p >= 'a' && *p <= 'z') || (*p >= 'A' && *p <= 'Z') || (*p >= '0' && *p <= '9'))) size += 2; } - if (!(buf = malloc(size + 1))) - return NULL; + buf = g_new(char, size + 1); for (p = str, q = buf; *p; p++, q++) { if ((*p >= 'a' && *p <= 'z') || (*p >= 'A' && *p <= 'Z') || (*p >= '0' && *p <= '9')) @@ -298,7 +300,7 @@ * manipulacjach własnego wpisu w katalogu publicznym. */ -int gg_http_hash(unsigned char *email, unsigned char *password) +int gg_http_hash(const unsigned char *email, const unsigned char *password) { unsigned int a, c; int b, i;
--- a/src/protocols/gg/gg.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/protocols/gg/gg.c Thu Aug 29 01:47:15 2002 +0000 @@ -1,6 +1,6 @@ /* * gaim - Gadu-Gadu Protocol Plugin - * $Id: gg.c 3453 2002-08-25 10:51:24Z seanegan $ + * $Id: gg.c 3516 2002-08-29 01:47:15Z seanegan $ * * Copyright (C) 2001 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL> * @@ -104,7 +104,7 @@ return "Gadu-Gadu"; } -static gchar *charset_convert(const gchar *locstr, char *encsrc, char *encdst) +static gchar *charset_convert(const gchar *locstr, const char *encsrc, const char *encdst) { #ifdef HAVE_ICONV gchar *result = NULL; @@ -114,7 +114,7 @@ return g_strdup(locstr); } -static gboolean invalid_uin(char *uin) +static gboolean invalid_uin(const char *uin) { unsigned long int res = strtol(uin, (char **)NULL, 10); if (res == LONG_MIN || res == LONG_MAX || res == 0) @@ -159,9 +159,9 @@ } } -static gchar *find_local_charset(void) +static const gchar *find_local_charset(void) { - gchar *gg_localenc = g_getenv("GG_CHARSET"); + const gchar *gg_localenc = g_getenv("GG_CHARSET"); if (gg_localenc == NULL) { #ifdef HAVE_LANGINFO_CODESET @@ -607,7 +607,7 @@ return 1; } -static void agg_add_buddy(struct gaim_connection *gc, char *who) +static void agg_add_buddy(struct gaim_connection *gc, const char *who) { struct agg_data *gd = (struct agg_data *)gc->proto_data; if (invalid_uin(who)) @@ -1066,9 +1066,9 @@ } } -static void agg_dir_search(struct gaim_connection *gc, char *first, char *middle, - char *last, char *maiden, char *city, char *state, - char *country, char *email) +static void agg_dir_search(struct gaim_connection *gc, const char *first, const char *middle, + const char *last, const char *maiden, const char *city, const char *state, + const char *country, const char *email) { struct agg_http *srch = g_new0(struct agg_http, 1); srch->gc = gc; @@ -1115,7 +1115,7 @@ } } -static void agg_change_passwd(struct gaim_connection *gc, char *old, char *new) +static void agg_change_passwd(struct gaim_connection *gc, const char *old, const char *new) { struct agg_http *hpass = g_new0(struct agg_http, 1); gchar *u = gg_urlencode(gc->username);
--- a/src/protocols/gg/libgg.h Thu Aug 29 01:43:23 2002 +0000 +++ b/src/protocols/gg/libgg.h Thu Aug 29 01:47:15 2002 +0000 @@ -1,4 +1,4 @@ -/* $Id: libgg.h 2897 2001-12-14 18:24:10Z warmenhoven $ */ +/* $Id: libgg.h 3516 2002-08-29 01:47:15Z seanegan $ */ /* * (C) Copyright 2001 Wojtek Kaniewski <wojtekka@irc.pl>, @@ -375,8 +375,8 @@ int gg_connect(void *addr, int port, int async); void gg_read_line(int sock, char *buf, int length); void gg_chomp(char *line); -char *gg_urlencode(char *str); -int gg_http_hash(unsigned char *email, unsigned char *password); +char *gg_urlencode(const char *str); +int gg_http_hash(const unsigned char *email, const unsigned char *password); #define GG_APPMSG_HOST "appmsg.gadu-gadu.pl" #define GG_APPMSG_PORT 80
--- a/src/protocols/icq/gaim_icq.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/protocols/icq/gaim_icq.c Thu Aug 29 01:47:15 2002 +0000 @@ -376,7 +376,7 @@ icq_KeepAlive(id->link); } -static void icq_add_buddy(struct gaim_connection *gc, char *who) { +static void icq_add_buddy(struct gaim_connection *gc, const char *who) { struct icq_data *id = (struct icq_data *)gc->proto_data; icq_ContactAdd(id->link, atol(who)); icq_ContactSetVis(id->link, atol(who), TRUE);
--- a/src/protocols/irc/irc.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/protocols/irc/irc.c Thu Aug 29 01:47:15 2002 +0000 @@ -710,7 +710,6 @@ static void handle_version(struct gaim_connection *gc, char *word[], char *word_eol[], int num) { struct irc_data *id = gc->proto_data; - char buf[IRC_BUF_LEN]; GString *str; id->liststr = g_string_new(""); @@ -1754,7 +1753,7 @@ return handle_command(gc, who, what); } -static void irc_chat_invite(struct gaim_connection *gc, int idn, char *message, char *name) { +static void irc_chat_invite(struct gaim_connection *gc, int idn, const char *message, const char *name) { char buf[IRC_BUF_LEN]; struct irc_data *id = gc->proto_data; struct conversation *c = irc_find_chat_by_id(gc, idn); @@ -1770,7 +1769,7 @@ } /* IRC doesn't have a buddy list, but we can still figure out who's online with ISON */ -static void irc_add_buddy(struct gaim_connection *gc, char *who) {} +static void irc_add_buddy(struct gaim_connection *gc, const char *who) {} static void irc_remove_buddy(struct gaim_connection *gc, char *who, char *group) {} static GList *irc_chat_info(struct gaim_connection *gc)
--- a/src/protocols/jabber/jabber.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/protocols/jabber/jabber.c Thu Aug 29 01:47:15 2002 +0000 @@ -380,7 +380,7 @@ * reponsible for freeing that via gaim_jid_free() when done * with it. */ -static gchar *get_realwho(gjconn gjc, char *who, int incl_resource, gaim_jid *gjid) +static gchar *get_realwho(gjconn gjc, const char *who, int incl_resource, gaim_jid *gjid) { gaim_jid my_gjid; gchar *my_who; @@ -927,7 +927,7 @@ /* * Remove a buddy from the (gaim) buddylist (if he's on it) */ -static void jabber_remove_gaim_buddy(struct gaim_connection *gc, char *buddyname) +static void jabber_remove_gaim_buddy(struct gaim_connection *gc, const char *buddyname) { struct buddy *b; @@ -941,7 +941,7 @@ } } -static void jabber_change_passwd(struct gaim_connection *gc, char *old, char *new) +static void jabber_change_passwd(struct gaim_connection *gc, const char *old, const char *new) { gjconn gjc = ((struct jabber_data *)gc->proto_data)->gjc; @@ -2395,7 +2395,7 @@ } } -static void jabber_add_buddy(struct gaim_connection *gc, char *name) +static void jabber_add_buddy(struct gaim_connection *gc, const char *name) { xmlnode x; char *realwho; @@ -2726,7 +2726,7 @@ g_free(realwho); } -static void jabber_chat_invite(struct gaim_connection *gc, int id, char *message, char *name) +static void jabber_chat_invite(struct gaim_connection *gc, int id, const char *message, const char *name) { xmlnode x, y; struct jabber_data *jd = gc->proto_data;
--- a/src/protocols/msn/msn.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/protocols/msn/msn.c Thu Aug 29 01:47:15 2002 +0000 @@ -1892,7 +1892,7 @@ return 0; } -static void msn_chat_invite(struct gaim_connection *gc, int id, char *msg, char *who) +static void msn_chat_invite(struct gaim_connection *gc, int id, const char *msg, const char *who) { struct msn_switchboard *ms = msn_find_switch_by_id(gc, id); char buf[MSN_BUF_LEN]; @@ -2062,7 +2062,7 @@ return m; } -static void msn_add_buddy(struct gaim_connection *gc, char *name) +static void msn_add_buddy(struct gaim_connection *gc, const char *name) { struct msn_data *md = gc->proto_data; char *who = msn_normalize(name); @@ -2114,7 +2114,7 @@ char buf[MSN_BUF_LEN]; char *alias; - if (!entry || *entry == NULL) + if (!entry || *entry == '\0') alias = g_strdup(""); else alias = str_to_utf8(entry);
--- a/src/protocols/napster/napster.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/protocols/napster/napster.c Thu Aug 29 01:47:15 2002 +0000 @@ -70,7 +70,7 @@ /* FIXME: Make this use va_arg stuff */ -static void nap_write_packet(struct gaim_connection *gc, unsigned short command, char *message) +static void nap_write_packet(struct gaim_connection *gc, unsigned short command, const char *message) { struct nap_data *ndata = (struct nap_data *)gc->proto_data; unsigned short size; @@ -514,7 +514,7 @@ return 0; } -static void nap_add_buddy(struct gaim_connection *gc, char *name) +static void nap_add_buddy(struct gaim_connection *gc, const char *name) { nap_write_packet(gc, 0xCF, name); }
--- a/src/protocols/oscar/aim.h Thu Aug 29 01:43:23 2002 +0000 +++ b/src/protocols/oscar/aim.h Thu Aug 29 01:47:15 2002 +0000 @@ -1065,22 +1065,22 @@ /* These handle the local variables */ faim_export struct aim_ssi_item *aim_ssi_itemlist_find(struct aim_ssi_item *list, fu16_t gid, fu16_t bid); -faim_export struct aim_ssi_item *aim_ssi_itemlist_finditem(struct aim_ssi_item *list, char *gn, char *sn, fu16_t type); +faim_export struct aim_ssi_item *aim_ssi_itemlist_finditem(struct aim_ssi_item *list, const char *gn, const char *sn, fu16_t type); faim_export struct aim_ssi_item *aim_ssi_itemlist_findparent(struct aim_ssi_item *list, char *sn); faim_export int aim_ssi_getpermdeny(struct aim_ssi_item *list); faim_export fu32_t aim_ssi_getpresence(struct aim_ssi_item *list); faim_export int aim_ssi_cleanlist(aim_session_t *sess, aim_conn_t *conn); -faim_export int aim_ssi_addbuddies(aim_session_t *sess, aim_conn_t *conn, char *gn, char **sn, unsigned int num); +faim_export int aim_ssi_addbuddies(aim_session_t *sess, aim_conn_t *conn, const char *gn, const char **sn, unsigned int num); faim_export int aim_ssi_addmastergroup(aim_session_t *sess, aim_conn_t *conn); faim_export int aim_ssi_addgroups(aim_session_t *sess, aim_conn_t *conn, char **gn, unsigned int num); -faim_export int aim_ssi_addpord(aim_session_t *sess, aim_conn_t *conn, char **sn, unsigned int num, fu16_t type); +faim_export int aim_ssi_addpord(aim_session_t *sess, aim_conn_t *conn, const char **sn, unsigned int num, fu16_t type); faim_export int aim_ssi_movebuddy(aim_session_t *sess, aim_conn_t *conn, char *oldgn, char *newgn, char *sn); faim_export int aim_ssi_rename_group(aim_session_t *sess, aim_conn_t *conn, char *oldgn, char *newgn); faim_export int aim_ssi_delbuddies(aim_session_t *sess, aim_conn_t *conn, char *gn, char **sn, unsigned int num); faim_export int aim_ssi_delmastergroup(aim_session_t *sess, aim_conn_t *conn); faim_export int aim_ssi_delgroups(aim_session_t *sess, aim_conn_t *conn, char **gn, unsigned int num); faim_export int aim_ssi_deletelist(aim_session_t *sess, aim_conn_t *conn); -faim_export int aim_ssi_delpord(aim_session_t *sess, aim_conn_t *conn, char **sn, unsigned int num, fu16_t type); +faim_export int aim_ssi_delpord(aim_session_t *sess, aim_conn_t *conn, const char **sn, unsigned int num, fu16_t type); faim_export int aim_ssi_setpermdeny(aim_session_t *sess, aim_conn_t *conn, fu8_t permdeny, fu32_t vismask); faim_export int aim_ssi_setpresence(aim_session_t *sess, aim_conn_t *conn, fu32_t presence);
--- a/src/protocols/oscar/oscar.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/protocols/oscar/oscar.c Thu Aug 29 01:47:15 2002 +0000 @@ -1818,7 +1818,7 @@ destn = va_arg(ap, char *); va_end(ap); - sprintf(buf, _("Your message to %s did not get sent: %s"), destn); + sprintf(buf, _("Your message to %s did not get sent:"), destn); do_error_dialog(buf, (reason < msgerrreasonlen) ? msgerrreason[reason] : _("No reason was given."), GAIM_ERROR); return 1; @@ -1835,7 +1835,7 @@ destn = va_arg(ap, char *); va_end(ap); - sprintf(buf, _("User information for %s unavailable: %s"), destn); + sprintf(buf, _("User information for %s unavailable:"), destn); do_error_dialog(buf, (reason < msgerrreasonlen) ? msgerrreason[reason] : _("No reason was given."), GAIM_ERROR); return 1; @@ -2843,8 +2843,8 @@ aim_getinfo(odata->sess, odata->conn, name, AIM_GETINFO_CAPABILITIES); } -static void oscar_set_dir(struct gaim_connection *g, char *first, char *middle, char *last, - char *maiden, char *city, char *state, char *country, int web) { +static void oscar_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) { /* FIXME : some of these things are wrong, but i'm lazy */ struct oscar_data *odata = (struct oscar_data *)g->proto_data; aim_setdirectoryinfo(odata->sess, odata->conn, first, middle, last, @@ -2975,14 +2975,14 @@ aim_send_warning(odata->sess, odata->conn, name, anon ? AIM_WARN_ANON : 0); } -static void oscar_dir_search(struct gaim_connection *g, char *first, char *middle, char *last, - char *maiden, char *city, char *state, char *country, char *email) { +static void oscar_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) { struct oscar_data *odata = (struct oscar_data *)g->proto_data; if (strlen(email)) aim_usersearch_address(odata->sess, odata->conn, email); } -static void oscar_add_buddy(struct gaim_connection *g, char *name) { +static void oscar_add_buddy(struct gaim_connection *g, const char *name) { struct oscar_data *odata = (struct oscar_data *)g->proto_data; if (odata->icq) { aim_add_buddy(odata->sess, odata->conn, name); @@ -3124,7 +3124,7 @@ struct oscar_data *odata = (struct oscar_data *)gc->proto_data; struct aim_ssi_item *curitem; int tmp; - char **sns; + const char **sns; debug_printf("ssi: syncing local list and server list\n"); @@ -3218,7 +3218,7 @@ if (!aim_ssi_itemlist_finditem(sess->ssi.items, NULL, ((struct buddy*)curbud->data)->name, 0x0000)) tmp++; if (tmp) { - sns = (char **)malloc(tmp*sizeof(char*)); + sns = malloc(tmp*sizeof(char*)); tmp = 0; for (curbud=((struct group*)cur->data)->members; curbud; curbud=curbud->next) if (!aim_ssi_itemlist_finditem(sess->ssi.items, NULL, ((struct buddy*)curbud->data)->name, 0x0000)) { @@ -3239,7 +3239,7 @@ if (!aim_ssi_itemlist_finditem(sess->ssi.items, NULL, cur->data, 0x0002)) tmp++; if (tmp) { - sns = (char **)malloc(tmp*sizeof(char*)); + sns = malloc(tmp*sizeof(char*)); tmp = 0; for (cur=gc->permit; cur; cur=cur->next) if (!aim_ssi_itemlist_finditem(sess->ssi.items, NULL, cur->data, 0x0002)) { @@ -3259,7 +3259,7 @@ if (!aim_ssi_itemlist_finditem(sess->ssi.items, NULL, cur->data, 0x0003)) tmp++; if (tmp) { - sns = (char **)malloc(tmp*sizeof(char*)); + sns = malloc(tmp*sizeof(char*)); tmp = 0; for (cur=gc->deny; cur; cur=cur->next) if (!aim_ssi_itemlist_finditem(sess->ssi.items, NULL, cur->data, 0x0003)) { @@ -3340,7 +3340,7 @@ } } -static void oscar_chat_invite(struct gaim_connection *g, int id, char *message, char *name) { +static void oscar_chat_invite(struct gaim_connection *g, int id, const char *message, const char *name) { struct oscar_data *odata = (struct oscar_data *)g->proto_data; struct chat_connection *ccon = find_oscar_chat(g, id); @@ -3809,7 +3809,7 @@ } else { debug_printf("ssi: About to add a permit\n"); if (od->sess->ssi.received_data) - aim_ssi_addpord(od->sess, od->conn, &who, 1, AIM_SSI_TYPE_PERMIT); + aim_ssi_addpord(od->sess, od->conn, (const char **) &who, 1, AIM_SSI_TYPE_PERMIT); } } @@ -3821,7 +3821,7 @@ } else { debug_printf("ssi: About to add a deny\n"); if (od->sess->ssi.received_data) - aim_ssi_addpord(od->sess, od->conn, &who, 1, AIM_SSI_TYPE_DENY); + aim_ssi_addpord(od->sess, od->conn, (const char **) &who, 1, AIM_SSI_TYPE_DENY); } } @@ -3946,7 +3946,7 @@ return m; } -static void oscar_change_passwd(struct gaim_connection *gc, char *old, char *new) +static void oscar_change_passwd(struct gaim_connection *gc, const char *old, const char *new) { struct oscar_data *od = gc->proto_data; if (!aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH)) {
--- a/src/protocols/oscar/ssi.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/protocols/oscar/ssi.c Thu Aug 29 01:47:15 2002 +0000 @@ -36,7 +36,7 @@ * @param type The type of the item, 0x0001 for a contact, 0x0002 for a group, etc. * @return The newly created item. */ -static struct aim_ssi_item *aim_ssi_itemlist_add(struct aim_ssi_item **list, struct aim_ssi_item *parent, char *name, fu16_t type) +static struct aim_ssi_item *aim_ssi_itemlist_add(struct aim_ssi_item **list, struct aim_ssi_item *parent, const char *name, fu16_t type) { int i; struct aim_ssi_item *cur, *newitem; @@ -192,7 +192,7 @@ * @param type The type of the desired item. * @return Return a pointer to the item if found, else return NULL; */ -faim_export struct aim_ssi_item *aim_ssi_itemlist_finditem(struct aim_ssi_item *list, char *gn, char *sn, fu16_t type) +faim_export struct aim_ssi_item *aim_ssi_itemlist_finditem(struct aim_ssi_item *list, const char *gn, const char *sn, fu16_t type) { struct aim_ssi_item *cur; if (!list) @@ -490,7 +490,7 @@ * @param num The number of screen names you are adding (size of the sn array). * @return Return 0 if no errors, otherwise return the error number. */ -faim_export int aim_ssi_addbuddies(aim_session_t *sess, aim_conn_t *conn, char *gn, char **sn, unsigned int num) +faim_export int aim_ssi_addbuddies(aim_session_t *sess, aim_conn_t *conn, const char *gn, const char **sn, unsigned int num) { struct aim_ssi_item *parentgroup, **newitems; fu16_t i; @@ -644,7 +644,7 @@ * #defines in aim.h. * @return Return 0 if no errors, otherwise return the error number. */ -faim_export int aim_ssi_addpord(aim_session_t *sess, aim_conn_t *conn, char **sn, unsigned int num, fu16_t type) +faim_export int aim_ssi_addpord(aim_session_t *sess, aim_conn_t *conn, const char **sn, unsigned int num, fu16_t type) { struct aim_ssi_item **newitems; fu16_t i; @@ -992,7 +992,7 @@ * @param num The number of items you are deleting (size of the sn array). * @return Return 0 if no errors, otherwise return the error number. */ -faim_export int aim_ssi_delpord(aim_session_t *sess, aim_conn_t *conn, char **sn, unsigned int num, fu16_t type) { +faim_export int aim_ssi_delpord(aim_session_t *sess, aim_conn_t *conn, const char **sn, unsigned int num, fu16_t type) { struct aim_ssi_item *cur, **delitems; int i;
--- a/src/protocols/toc/toc.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/protocols/toc/toc.c Thu Aug 29 01:47:15 2002 +0000 @@ -974,8 +974,8 @@ sflap_send(g, buf, -1, TYPE_DATA); } -static void toc_set_dir(struct gaim_connection *g, char *first, char *middle, char *last, - char *maiden, char *city, char *state, char *country, int web) +static void toc_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) { char buf2[BUF_LEN * 4], buf[BUF_LEN]; g_snprintf(buf2, sizeof(buf2), "%s:%s:%s:%s:%s:%s:%s:%s", first, @@ -985,8 +985,8 @@ sflap_send(g, buf, -1, TYPE_DATA); } -static void toc_dir_search(struct gaim_connection *g, char *first, char *middle, char *last, - char *maiden, char *city, char *state, char *country, char *email) +static void toc_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) { char buf[BUF_LONG]; g_snprintf(buf, sizeof(buf) / 2, "toc_dir_search %s:%s:%s:%s:%s:%s:%s:%s", first, middle, @@ -1023,14 +1023,14 @@ sflap_send(g, buf, -1, TYPE_DATA); } -static void toc_change_passwd(struct gaim_connection *g, char *orig, char *new) +static void toc_change_passwd(struct gaim_connection *g, const char *orig, const char *new) { char buf[BUF_LEN * 2]; g_snprintf(buf, BUF_LONG, "toc_change_passwd %s %s", orig, new); sflap_send(g, buf, strlen(buf), TYPE_DATA); } -static void toc_add_buddy(struct gaim_connection *g, char *name) +static void toc_add_buddy(struct gaim_connection *g, const char *name) { char buf[BUF_LEN * 2]; g_snprintf(buf, sizeof(buf), "toc_add_buddy %s", normalize(name)); @@ -1136,7 +1136,7 @@ sflap_send(g, buf, -1, TYPE_DATA); } -static void toc_chat_invite(struct gaim_connection *g, int id, char *message, char *name) +static void toc_chat_invite(struct gaim_connection *g, int id, const char *message, const char *name) { char buf[BUF_LONG]; g_snprintf(buf, sizeof(buf) / 2, "toc_chat_invite %d \"%s\" %s", id,
--- a/src/protocols/yahoo/yahoo.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/protocols/yahoo/yahoo.c Thu Aug 29 01:47:15 2002 +0000 @@ -188,7 +188,7 @@ return pkt; } -static void yahoo_packet_hash(struct yahoo_packet *pkt, int key, char *value) +static void yahoo_packet_hash(struct yahoo_packet *pkt, int key, const char *value) { struct yahoo_pair *pair = g_new0(struct yahoo_pair, 1); pair->key = key; @@ -1321,7 +1321,7 @@ yahoo_packet_free(pkt); } -static void yahoo_add_buddy(struct gaim_connection *gc, char *who) +static void yahoo_add_buddy(struct gaim_connection *gc, const char *who) { struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; struct yahoo_packet *pkt;
--- a/src/protocols/zephyr/zephyr.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/protocols/zephyr/zephyr.c Thu Aug 29 01:47:15 2002 +0000 @@ -732,7 +732,7 @@ z_call(ZClosePort()); } -static void zephyr_add_buddy(struct gaim_connection *gc, char *buddy) { } +static void zephyr_add_buddy(struct gaim_connection *gc, const char *buddy) { } static void zephyr_remove_buddy(struct gaim_connection *gc, char *buddy, char *group) { } static int zephyr_chat_send(struct gaim_connection *gc, int id, char *im)
--- a/src/prpl.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/prpl.c Thu Aug 29 01:47:15 2002 +0000 @@ -36,7 +36,7 @@ struct _prompt { GtkWidget *window; GtkWidget *entry; - void (*doit)(void *, char *); + void (*doit)(void *, const char *); void (*dont)(void *); void *data; };
--- a/src/prpl.h Thu Aug 29 01:43:23 2002 +0000 +++ b/src/prpl.h Thu Aug 29 01:47:15 2002 +0000 @@ -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);
--- a/src/server.c Thu Aug 29 01:43:23 2002 +0000 +++ b/src/server.c Thu Aug 29 01:47:15 2002 +0000 @@ -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);