# HG changeset patch # User Yoshiki Yazawa # Date 1182405856 0 # Node ID 708198aadad869a82eed7de3584e32b30b3fcd16 # Parent 37af7de814305ae96319bc0c33467da68e800957# Parent af7b944374baddd0ddb8746a74393bc54109c70c propagate from branch 'im.pidgin.pidgin' (head c09099530cc12734d4420f3fcc37e18347a16d5e) to branch 'im.pidgin.pidgin.yaz' (head 021ad3c9ed763e5e5f5678b9a081af148b43d064) diff -r 37af7de81430 -r 708198aadad8 finch/finch.c --- a/finch/finch.c Wed Jun 20 04:56:08 2007 +0000 +++ b/finch/finch.c Thu Jun 21 06:04:16 2007 +0000 @@ -19,6 +19,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "finch.h" + #include "account.h" #include "conversation.h" #include "core.h" @@ -37,7 +39,6 @@ #include "whiteboard.h" #include "gntdebug.h" -#include "finch.h" #include "gntprefs.h" #include "gntui.h" #include "gntidle.h" diff -r 37af7de81430 -r 708198aadad8 finch/gntaccount.c --- a/finch/gntaccount.c Wed Jun 20 04:56:08 2007 +0000 +++ b/finch/gntaccount.c Thu Jun 21 06:04:16 2007 +0000 @@ -33,6 +33,8 @@ #include #include +#include "finch.h" + #include #include #include @@ -42,7 +44,6 @@ #include "gntaccount.h" #include "gntblist.h" -#include "finch.h" #include diff -r 37af7de81430 -r 708198aadad8 finch/gntblist.c --- a/finch/gntblist.c Wed Jun 20 04:56:08 2007 +0000 +++ b/finch/gntblist.c Thu Jun 21 06:04:16 2007 +0000 @@ -22,6 +22,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "finch.h" + #include #include #include @@ -33,7 +35,6 @@ #include #include "debug.h" -#include "finch.h" #include "gntbox.h" #include "gntcombobox.h" #include "gntentry.h" diff -r 37af7de81430 -r 708198aadad8 finch/gntconn.c --- a/finch/gntconn.c Wed Jun 20 04:56:08 2007 +0000 +++ b/finch/gntconn.c Thu Jun 21 06:04:16 2007 +0000 @@ -22,6 +22,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "finch.h" + #include "account.h" #include "core.h" #include "connection.h" @@ -29,7 +31,6 @@ #include "request.h" #include "gntconn.h" -#include "finch.h" #define INITIAL_RECON_DELAY_MIN 8000 #define INITIAL_RECON_DELAY_MAX 60000 diff -r 37af7de81430 -r 708198aadad8 finch/gntconv.c --- a/finch/gntconv.c Wed Jun 20 04:56:08 2007 +0000 +++ b/finch/gntconv.c Thu Jun 21 06:04:16 2007 +0000 @@ -24,12 +24,13 @@ */ #include +#include "finch.h" + #include #include #include #include -#include "finch.h" #include "gntaccount.h" #include "gntblist.h" #include "gntconv.h" diff -r 37af7de81430 -r 708198aadad8 finch/gntnotify.c --- a/finch/gntnotify.c Wed Jun 20 04:56:08 2007 +0000 +++ b/finch/gntnotify.c Thu Jun 21 06:04:16 2007 +0000 @@ -29,10 +29,11 @@ #include #include +#include "finch.h" + #include #include "gntnotify.h" -#include "finch.h" static struct { diff -r 37af7de81430 -r 708198aadad8 finch/gntplugin.c --- a/finch/gntplugin.c Wed Jun 20 04:56:08 2007 +0000 +++ b/finch/gntplugin.c Thu Jun 21 06:04:16 2007 +0000 @@ -29,10 +29,11 @@ #include #include +#include "finch.h" + #include "notify.h" #include "request.h" -#include "finch.h" #include "gntplugin.h" #include "gntrequest.h" diff -r 37af7de81430 -r 708198aadad8 finch/gntprefs.c --- a/finch/gntprefs.c Wed Jun 20 04:56:08 2007 +0000 +++ b/finch/gntprefs.c Thu Jun 21 06:04:16 2007 +0000 @@ -22,10 +22,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "finch.h" + #include #include -#include "finch.h" #include "gntprefs.h" #include "gntrequest.h" diff -r 37af7de81430 -r 708198aadad8 finch/gntstatus.c --- a/finch/gntstatus.c Wed Jun 20 04:56:08 2007 +0000 +++ b/finch/gntstatus.c Thu Jun 21 06:04:16 2007 +0000 @@ -31,10 +31,11 @@ #include #include +#include "finch.h" + #include #include -#include "finch.h" #include "gntstatus.h" static struct diff -r 37af7de81430 -r 708198aadad8 finch/gntui.c --- a/finch/gntui.c Wed Jun 20 04:56:08 2007 +0000 +++ b/finch/gntui.c Thu Jun 21 06:04:16 2007 +0000 @@ -19,6 +19,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "gntui.h" #include "gntaccount.h" @@ -33,7 +35,6 @@ #include "gntprefs.h" #include "gntrequest.h" #include "gntstatus.h" -#include "internal.h" #include diff -r 37af7de81430 -r 708198aadad8 finch/libgnt/gntwm.c --- a/finch/libgnt/gntwm.c Wed Jun 20 04:56:08 2007 +0000 +++ b/finch/libgnt/gntwm.c Thu Jun 21 06:04:16 2007 +0000 @@ -1464,12 +1464,39 @@ return FALSE; } +#if !GLIB_CHECK_VERSION(2,4,0) +typedef struct +{ + GntWM *wm; + GntWS *ret; + gchar *title; +} title_search; + +static void match_title_search(gpointer key, gpointer value, gpointer search) +{ + title_search *s = search; + if (s->ret) + return; + if (match_title(key, NULL, s->title)) + s->ret = g_hash_table_lookup(s->wm->title_places, key); +} +#endif + static GntWS * new_widget_find_workspace(GntWM *wm, GntWidget *widget, gchar *wid_title) { GntWS *ret; const gchar *name; +#if GLIB_CHECK_VERSION(2,4,0) ret = g_hash_table_find(wm->title_places, match_title, wid_title); +#else + title_search *s = NULL; + s = g_new0(title_search, 1); + s->wm = wm; + s->title = wid_title; + g_hash_table_foreach(wm->title_places, match_title_search, s); + ret = s->ret; +#endif if (ret) return ret; name = gnt_widget_get_name(widget); diff -r 37af7de81430 -r 708198aadad8 finch/libgnt/wms/s.c --- a/finch/libgnt/wms/s.c Wed Jun 20 04:56:08 2007 +0000 +++ b/finch/libgnt/wms/s.c Thu Jun 21 06:04:16 2007 +0000 @@ -1,6 +1,8 @@ #include #include +#include "internal.h" + #include "gnt.h" #include "gntbox.h" #include "gntmenu.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/example/nullclient.c --- a/libpurple/example/nullclient.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/example/nullclient.c Thu Jun 21 06:04:16 2007 +0000 @@ -20,6 +20,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ + +/* XXX: we probably shouldn't include internal.h in examples */ +#include "internal.h" + #include "account.h" #include "conversation.h" #include "core.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/imgstore.h --- a/libpurple/imgstore.h Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/imgstore.h Thu Jun 21 06:04:16 2007 +0000 @@ -28,7 +28,6 @@ #include -struct _PurpleStoredImage; typedef struct _PurpleStoredImage PurpleStoredImage; #ifdef __cplusplus diff -r 37af7de81430 -r 708198aadad8 libpurple/plugins/perl/perl-common.h --- a/libpurple/plugins/perl/perl-common.h Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/plugins/perl/perl-common.h Thu Jun 21 06:04:16 2007 +0000 @@ -9,6 +9,9 @@ #include #include +/* XXX: perl defines it's own _ but I think it's safe to undef it */ +#undef _ +#include "internal.h" #include "plugin.h" #include "value.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/gg/gg.h --- a/libpurple/protocols/gg/gg.h Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/gg/gg.h Thu Jun 21 06:04:16 2007 +0000 @@ -25,6 +25,7 @@ #define _PURPLE_GG_H #include +#include "internal.h" #include "search.h" #include "connection.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/jabber/libxmpp.c --- a/libpurple/protocols/jabber/libxmpp.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/jabber/libxmpp.c Thu Jun 21 06:04:16 2007 +0000 @@ -25,8 +25,9 @@ * share code. */ +#include "internal.h" + #include "accountopt.h" -#include "internal.h" #include "version.h" #include "iq.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/jabber/si.c --- a/libpurple/protocols/jabber/si.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/jabber/si.c Thu Jun 21 06:04:16 2007 +0000 @@ -20,9 +20,9 @@ * */ -#include "blist.h" +#include "internal.h" -#include "internal.h" +#include "blist.h" #include "cipher.h" #include "debug.h" #include "ft.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/oscar/oscar.c --- a/libpurple/protocols/oscar/oscar.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/oscar/oscar.c Thu Jun 21 06:04:16 2007 +0000 @@ -5600,7 +5600,7 @@ status = purple_presence_get_active_status(presence); id = purple_status_get_id(status); - if (!purple_presence_is_online(presence)) + if ((od != NULL) && !purple_presence_is_online(presence)) { char *gname = aim_ssi_itemlist_findparentname(od->ssi.local, b->name); if (aim_ssi_waitingforauth(od->ssi.local, gname, b->name)) diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/Makefile.am --- a/libpurple/protocols/qq/Makefile.am Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/qq/Makefile.am Thu Jun 21 06:04:16 2007 +0000 @@ -34,8 +34,6 @@ group_info.h \ group_join.c \ group_join.h \ - group_misc.c \ - group_misc.h \ group_network.c \ group_network.h \ group_opt.c \ diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/buddy_list.c --- a/libpurple/protocols/qq/buddy_list.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/qq/buddy_list.c Thu Jun 21 06:04:16 2007 +0000 @@ -23,8 +23,10 @@ */ #include + +#include "qq.h" + #include "debug.h" - #include "notify.h" #include "utils.h" #include "packet_parse.h" @@ -35,9 +37,8 @@ #include "char_conv.h" #include "crypt.h" #include "header_info.h" -#include "keep_alive.h" +#include "keep_alive.h" #include "send_core.h" -#include "qq.h" #include "group.h" #include "group_find.h" #include "group_internal.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/buddy_status.c --- a/libpurple/protocols/qq/buddy_status.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/qq/buddy_status.c Thu Jun 21 06:04:16 2007 +0000 @@ -23,6 +23,7 @@ */ #include +#include "internal.h" #include "debug.h" #include "prefs.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/file_trans.c --- a/libpurple/protocols/qq/file_trans.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/qq/file_trans.c Thu Jun 21 06:04:16 2007 +0000 @@ -26,6 +26,8 @@ #define random rand #endif +#include "internal.h" + #include "debug.h" #include "ft.h" #include "cipher.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/group_conv.c --- a/libpurple/protocols/qq/group_conv.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/qq/group_conv.c Thu Jun 21 06:04:16 2007 +0000 @@ -23,11 +23,12 @@ */ #include +#include "qq.h" + #include "conversation.h" #include "buddy_status.h" #include "group_conv.h" -#include "qq.h" #include "utils.h" /* show group conversation window */ diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/group_find.c --- a/libpurple/protocols/qq/group_find.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/qq/group_find.c Thu Jun 21 06:04:16 2007 +0000 @@ -22,13 +22,14 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "qq.h" + #include "conversation.h" #include "debug.h" #include "util.h" #include "group_find.h" #include "group_network.h" -#include "qq.h" #include "utils.h" /* find the internal_group_id by the reply packet sequence diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/group_free.c --- a/libpurple/protocols/qq/group_free.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/qq/group_free.c Thu Jun 21 06:04:16 2007 +0000 @@ -22,6 +22,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "debug.h" #include "buddy_status.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/group_im.c --- a/libpurple/protocols/qq/group_im.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/qq/group_im.c Thu Jun 21 06:04:16 2007 +0000 @@ -22,6 +22,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "conversation.h" #include "debug.h" #include "notify.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/group_info.c --- a/libpurple/protocols/qq/group_info.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/qq/group_info.c Thu Jun 21 06:04:16 2007 +0000 @@ -22,6 +22,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "conversation.h" #include "debug.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/group_internal.c --- a/libpurple/protocols/qq/group_internal.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/qq/group_internal.c Thu Jun 21 06:04:16 2007 +0000 @@ -22,13 +22,13 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" #include "blist.h" #include "debug.h" #include "buddy_opt.h" #include "group_free.h" #include "group_internal.h" -#include "group_misc.h" #include "utils.h" static gchar *_qq_group_set_my_status_desc(qq_group *group) diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/group_join.c --- a/libpurple/protocols/qq/group_join.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/qq/group_join.c Thu Jun 21 06:04:16 2007 +0000 @@ -22,6 +22,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "debug.h" #include "notify.h" #include "request.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/group_misc.c --- a/libpurple/protocols/qq/group_misc.c Wed Jun 20 04:56:08 2007 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/** - * @file group_misc.c - * - * purple - * - * Purple is the legal property of its developers, whose names are too numerous - * to list here. Please refer to the COPYRIGHT file distributed with this - * source distribution. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "debug.h" - -#include "buddy_status.h" -#include "group_misc.h" -#include "utils.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/group_misc.h --- a/libpurple/protocols/qq/group_misc.h Wed Jun 20 04:56:08 2007 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/** - * @file group_misc.h - * - * purple - * - * Purple is the legal property of its developers, whose names are too numerous - * to list here. Please refer to the COPYRIGHT file distributed with this - * source distribution. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _QQ_GROUP_MISC_H_ -#define _QQ_GROUP_MISC_H_ - -#include -#include "group.h" - -#endif diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/group_network.c --- a/libpurple/protocols/qq/group_network.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/qq/group_network.c Thu Jun 21 06:04:16 2007 +0000 @@ -22,6 +22,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "debug.h" #include "notify.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/group_opt.c --- a/libpurple/protocols/qq/group_opt.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/qq/group_opt.c Thu Jun 21 06:04:16 2007 +0000 @@ -22,6 +22,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "qq.h" + #include "debug.h" #include "notify.h" #include "request.h" @@ -35,7 +37,6 @@ #include "group_network.h" #include "group_opt.h" #include "packet_parse.h" -#include "qq.h" #include "utils.h" /* TODO: can't we use qsort here? */ diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/group_search.c --- a/libpurple/protocols/qq/group_search.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/qq/group_search.c Thu Jun 21 06:04:16 2007 +0000 @@ -22,6 +22,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "debug.h" #include "char_conv.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/header_info.c --- a/libpurple/protocols/qq/header_info.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/qq/header_info.c Thu Jun 21 06:04:16 2007 +0000 @@ -22,6 +22,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "header_info.h" #define QQ_CLIENT_062E 0x062e /* GB QQ2000c build 0630 */ diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/im.c --- a/libpurple/protocols/qq/im.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/qq/im.c Thu Jun 21 06:04:16 2007 +0000 @@ -22,6 +22,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "conversation.h" #include "debug.h" #include "internal.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/keep_alive.c --- a/libpurple/protocols/qq/keep_alive.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/qq/keep_alive.c Thu Jun 21 06:04:16 2007 +0000 @@ -28,6 +28,8 @@ * Puzzlebird, Nov-Dec 2002 */ +#include "internal.h" + #include "debug.h" #include "server.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/qq.h --- a/libpurple/protocols/qq/qq.h Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/qq/qq.h Thu Jun 21 06:04:16 2007 +0000 @@ -26,8 +26,8 @@ #define _QQ_QQ_H_ #include +#include "internal.h" #include "ft.h" -#include "internal.h" #include "proxy.h" #include "roomlist.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/send_file.c --- a/libpurple/protocols/qq/send_file.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/qq/send_file.c Thu Jun 21 06:04:16 2007 +0000 @@ -22,6 +22,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "qq.h" + #include "send_file.h" #include "debug.h" #include "network.h" @@ -34,7 +36,6 @@ #include "im.h" #include "keep_alive.h" #include "packet_parse.h" -#include "qq.h" #include "send_core.h" #include "utils.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/qq/sendqueue.c --- a/libpurple/protocols/qq/sendqueue.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/qq/sendqueue.c Thu Jun 21 06:04:16 2007 +0000 @@ -22,9 +22,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "connection.h" #include "debug.h" -#include "internal.h" #include "notify.h" #include "prefs.h" #include "request.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/yahoo/yahoo_auth.c --- a/libpurple/protocols/yahoo/yahoo_auth.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoo_auth.c Thu Jun 21 06:04:16 2007 +0000 @@ -7,6 +7,8 @@ * */ +#include "internal.h" + #include "yahoo.h" #include "yahoo_auth.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/yahoo/yahoo_filexfer.c --- a/libpurple/protocols/yahoo/yahoo_filexfer.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoo_filexfer.c Thu Jun 21 06:04:16 2007 +0000 @@ -20,8 +20,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "prpl.h" -#include "internal.h" #include "util.h" #include "debug.h" #include "notify.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/yahoo/yahoochat.c --- a/libpurple/protocols/yahoo/yahoochat.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoochat.c Thu Jun 21 06:04:16 2007 +0000 @@ -26,6 +26,8 @@ * */ +#include "internal.h" + #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -37,7 +39,6 @@ #include "conversation.h" #include "notify.h" #include "util.h" -#include "internal.h" #include "yahoo.h" #include "yahoo_packet.h" diff -r 37af7de81430 -r 708198aadad8 libpurple/protocols/zephyr/ZVariables.c --- a/libpurple/protocols/zephyr/ZVariables.c Wed Jun 20 04:56:08 2007 +0000 +++ b/libpurple/protocols/zephyr/ZVariables.c Thu Jun 21 06:04:16 2007 +0000 @@ -9,6 +9,7 @@ * "mit-copyright.h". */ +#include "libpurple/internal.h" #include "internal.h" #include "util.h" diff -r 37af7de81430 -r 708198aadad8 pidgin/gtkblist.c --- a/pidgin/gtkblist.c Wed Jun 20 04:56:08 2007 +0000 +++ b/pidgin/gtkblist.c Thu Jun 21 06:04:16 2007 +0000 @@ -151,11 +151,7 @@ if (!gtkblist) return "dim grey"; if (!dim_grey_string[0]) { - GtkStyle *style = gtk_widget_get_style(gtkblist->treeview); - snprintf(dim_grey_string, sizeof(dim_grey_string), "#%02x%02x%02x", - style->text_aa[GTK_STATE_NORMAL].red >> 8, - style->text_aa[GTK_STATE_NORMAL].green >> 8, - style->text_aa[GTK_STATE_NORMAL].blue >> 8); + snprintf(dim_grey_string, sizeof(dim_grey_string), "%s", pidgin_get_dim_grey_string(gtkblist->treeview)); } return dim_grey_string; } @@ -311,6 +307,7 @@ gtk_blist_join_chat(chat); } +#if GTK_CHECK_VERSION(2,6,0) static void gtk_blist_renderer_editing_cancelled_cb(GtkCellRenderer *renderer, PurpleBuddyList *list) { editing_blist = FALSE; @@ -355,6 +352,7 @@ } editing_blist = TRUE; } +#endif static void gtk_blist_renderer_edited_cb(GtkCellRendererText *text_rend, char *arg1, char *arg2, PurpleBuddyList *list) @@ -2092,51 +2090,6 @@ } } -static void -roundify(GdkPixbuf *pixbuf) { - int width, height, rowstride; - guchar *pixels; - - if (!gdk_pixbuf_get_has_alpha(pixbuf)) - return; - - width = gdk_pixbuf_get_width(pixbuf); - height = gdk_pixbuf_get_height(pixbuf); - rowstride = gdk_pixbuf_get_rowstride(pixbuf); - pixels = gdk_pixbuf_get_pixels(pixbuf); - - if (width < 6 || height < 6) - return; - - /* Top left */ - pixels[3] = 0; - pixels[7] = 0x80; - pixels[11] = 0xC0; - pixels[rowstride + 3] = 0x80; - pixels[rowstride * 2 + 3] = 0xC0; - - /* Top right */ - pixels[width * 4 - 1] = 0; - pixels[width * 4 - 5] = 0x80; - pixels[width * 4 - 9] = 0xC0; - pixels[rowstride + (width * 4) - 1] = 0x80; - pixels[(2 * rowstride) + (width * 4) - 1] = 0xC0; - - /* Bottom left */ - pixels[(height - 1) * rowstride + 3] = 0; - pixels[(height - 1) * rowstride + 7] = 0x80; - pixels[(height - 1) * rowstride + 11] = 0xC0; - pixels[(height - 2) * rowstride + 3] = 0x80; - pixels[(height - 3) * rowstride + 3] = 0xC0; - - /* Bottom right */ - pixels[height * rowstride - 1] = 0; - pixels[(height - 1) * rowstride - 1] = 0x80; - pixels[(height - 2) * rowstride - 1] = 0xC0; - pixels[height * rowstride - 5] = 0x80; - pixels[height * rowstride - 9] = 0xC0; -} - /* Altered from do_colorshift in gnome-panel */ static void do_alphashift (GdkPixbuf *dest, GdkPixbuf *src, int shift) @@ -2273,7 +2226,7 @@ gdk_pixbuf_fill(ret, 0x00000000); gdk_pixbuf_scale(buf, ret, (32-scale_width)/2, (32-scale_height)/2, scale_width, scale_height, (32-scale_width)/2, (32-scale_height)/2, (double)scale_width/(double)orig_width, (double)scale_height/(double)orig_height, GDK_INTERP_BILINEAR); if (pidgin_gdk_pixbuf_is_opaque(ret)) - roundify(ret); + pidgin_gdk_pixbuf_make_round(ret); } else { ret = gdk_pixbuf_scale_simple(buf,scale_width,scale_height, GDK_INTERP_BILINEAR); } @@ -3282,7 +3235,7 @@ return ret; } -gchar *pidgin_blist_get_name_markup(PurpleBuddy *b, gboolean selected) +gchar *pidgin_blist_get_name_markup(PurpleBuddy *b, gboolean selected, gboolean aliased) { const char *name; char *esc, *text = NULL; @@ -3307,15 +3260,19 @@ } /* XXX Good luck cleaning up this crap */ - - contact = (PurpleContact*)((PurpleBlistNode*)b)->parent; - if(contact) - gtkcontactnode = ((PurpleBlistNode*)contact)->ui_data; - - if(gtkcontactnode && !gtkcontactnode->contact_expanded && contact->alias) - name = contact->alias; - else - name = purple_buddy_get_alias(b); + if (aliased) { + contact = (PurpleContact*)((PurpleBlistNode*)b)->parent; + if(contact) + gtkcontactnode = ((PurpleBlistNode*)contact)->ui_data; + + if(gtkcontactnode && !gtkcontactnode->contact_expanded && contact->alias) + name = contact->alias; + else + name = purple_buddy_get_alias(b); + } else { + name = b->name; + } + esc = g_markup_escape_text(name, strlen(name)); presence = purple_buddy_get_presence(b); @@ -4463,8 +4420,10 @@ #endif "markup", NAME_COLUMN, NULL); +#if GTK_CHECK_VERSION(2,6,0) g_signal_connect(G_OBJECT(rend), "editing-started", G_CALLBACK(gtk_blist_renderer_editing_started_cb), NULL); g_signal_connect(G_OBJECT(rend), "editing-canceled", G_CALLBACK(gtk_blist_renderer_editing_cancelled_cb), list); +#endif g_signal_connect(G_OBJECT(rend), "edited", G_CALLBACK(gtk_blist_renderer_edited_cb), list); g_object_set(rend, "ypad", 0, "yalign", 0.5, NULL); #if GTK_CHECK_VERSION(2,6,0) @@ -4967,7 +4926,7 @@ } emblem = pidgin_blist_get_emblem((PurpleBlistNode*) buddy); - mark = pidgin_blist_get_name_markup(buddy, selected); + mark = pidgin_blist_get_name_markup(buddy, selected, TRUE); if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time") && purple_presence_is_idle(presence) && diff -r 37af7de81430 -r 708198aadad8 pidgin/gtkblist.h --- a/pidgin/gtkblist.h Wed Jun 20 04:56:08 2007 +0000 +++ b/pidgin/gtkblist.h Thu Jun 21 06:04:16 2007 +0000 @@ -365,8 +365,9 @@ * * @param buddy The buddy to return markup from * @param selected Whether this buddy is selected. If TRUE, the markup will not change the color. + * @param aliased TRUE to return the appropriate alias of this buddy, FALSE to return its screenname * @return The markup for this buddy */ -gchar *pidgin_blist_get_name_markup(PurpleBuddy *buddy, gboolean selected); +gchar *pidgin_blist_get_name_markup(PurpleBuddy *buddy, gboolean selected, gboolean aliased); #endif /* _PIDGINBLIST_H_ */ diff -r 37af7de81430 -r 708198aadad8 pidgin/gtkconv.c --- a/pidgin/gtkconv.c Wed Jun 20 04:56:08 2007 +0000 +++ b/pidgin/gtkconv.c Thu Jun 21 06:04:16 2007 +0000 @@ -2360,7 +2360,8 @@ gtk_image_set_from_pixbuf(GTK_IMAGE(gtkconv->icon), status); gtk_image_set_from_pixbuf(GTK_IMAGE(gtkconv->menu_icon), status); - gtk_list_store_set(gtkconv->infopane_model, &(gtkconv->infopane_iter), + gtk_list_store_set(GTK_LIST_STORE(gtkconv->infopane_model), + &(gtkconv->infopane_iter), ICON_COLUMN, status, -1); if (status != NULL) @@ -2418,12 +2419,22 @@ gdk_pixbuf_animation_iter_advance(gtkconv->u.im->iter, NULL); buf = gdk_pixbuf_animation_iter_get_pixbuf(gtkconv->u.im->iter); - pidgin_buddy_icon_get_scale_size(buf, &prpl_info->icon_spec, - PURPLE_ICON_SCALE_DISPLAY, &scale_width, &scale_height); - - /* this code is ugly, and scares me */ - scale = gdk_pixbuf_scale_simple(buf, 32, 32, + scale_width = gdk_pixbuf_get_width(buf); + scale_height = gdk_pixbuf_get_height(buf); + if (scale_width == scale_height) { + scale_width = scale_height = 32; + } else if (scale_height > scale_width) { + scale_width = 32 * scale_width / scale_height; + scale_height = 32; + } else { + scale_height = 32 * scale_height / scale_width; + scale_width = 32; + } + + scale = gdk_pixbuf_scale_simple(buf, scale_width, scale_height, GDK_INTERP_BILINEAR); + if (pidgin_gdk_pixbuf_is_opaque(scale)) + pidgin_gdk_pixbuf_make_round(scale); gtk_image_set_from_pixbuf(GTK_IMAGE(gtkconv->u.im->icon), scale); g_object_unref(G_OBJECT(scale)); @@ -4295,11 +4306,9 @@ hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); - gtk_widget_show(hbox); label = gtk_label_new(_("Topic:")); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); - gtk_widget_show(label); gtkchat->topic_text = gtk_entry_new(); @@ -4311,7 +4320,6 @@ } gtk_box_pack_start(GTK_BOX(hbox), gtkchat->topic_text, TRUE, TRUE, 0); - gtk_widget_show(gtkchat->topic_text); g_signal_connect(G_OBJECT(gtkchat->topic_text), "key_press_event", G_CALLBACK(entry_key_press_cb), gtkconv); } @@ -4433,7 +4441,8 @@ gtkconv->infopane = gtk_cell_view_new(); gtkconv->infopane_model = gtk_list_store_new(NUM_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING); - gtk_cell_view_set_model(GTK_CELL_VIEW(gtkconv->infopane), gtkconv->infopane_model); + gtk_cell_view_set_model(GTK_CELL_VIEW(gtkconv->infopane), + GTK_TREE_MODEL(gtkconv->infopane_model)); gtk_list_store_append(gtkconv->infopane_model, &(gtkconv->infopane_iter)); gtk_box_pack_start(GTK_BOX(gtkconv->infopane_hbox), gtkconv->infopane, TRUE, TRUE, 0); path = gtk_tree_path_new_from_string("0"); @@ -6182,13 +6191,13 @@ pidgin_themes_smiley_themeize(PIDGIN_CONVERSATION(conv)->imhtml); if ((fields & PIDGIN_CONV_COLORIZE_TITLE) || - (fields & PIDGIN_CONV_SET_TITLE)) + (fields & PIDGIN_CONV_SET_TITLE) || + (fields & PIDGIN_CONV_TOPIC)) { char *title, *title_tmp; PurpleConvIm *im = NULL; PurpleAccount *account = purple_conversation_get_account(conv); - PurpleBuddy *buddy; - char *markup; + char *markup = NULL; AtkObject *accessibility_obj; gboolean ellipsis = FALSE; /* I think this is a little longer than it needs to be but I'm lazy. */ @@ -6205,11 +6214,19 @@ else title = g_strdup(purple_conversation_get_title(conv)); - buddy = purple_find_buddy(account, conv->name); - if (buddy) - markup = pidgin_blist_get_name_markup(buddy, FALSE); - else - markup = title; + if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) { + PurpleBuddy *buddy = purple_find_buddy(account, conv->name); + if (buddy) + markup = pidgin_blist_get_name_markup(buddy, FALSE, FALSE); + else + markup = title; + } else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) { + PurpleConvChat *chat = PURPLE_CONV_CHAT(conv); + markup = g_strdup_printf("%s\n%s", + purple_conversation_get_title(conv), + pidgin_get_dim_grey_string(gtkconv->infopane), + purple_conv_chat_get_topic(chat)); + } gtk_list_store_set(gtkconv->infopane_model, &(gtkconv->infopane_iter), TEXT_COLUMN, markup, -1); @@ -6485,19 +6502,36 @@ } if (gdk_pixbuf_animation_is_static_image(gtkconv->u.im->anim)) { + GdkPixbuf *stat; gtkconv->u.im->iter = NULL; - buf = gdk_pixbuf_animation_get_static_image(gtkconv->u.im->anim); + stat = gdk_pixbuf_animation_get_static_image(gtkconv->u.im->anim); + buf = gdk_pixbuf_add_alpha(stat, FALSE, 0, 0, 0); } else { + GdkPixbuf *stat; gtkconv->u.im->iter = gdk_pixbuf_animation_get_iter(gtkconv->u.im->anim, NULL); /* LEAK */ - buf = gdk_pixbuf_animation_iter_get_pixbuf(gtkconv->u.im->iter); + stat = gdk_pixbuf_animation_iter_get_pixbuf(gtkconv->u.im->iter); + buf = gdk_pixbuf_add_alpha(stat, FALSE, 0, 0, 0); if (gtkconv->u.im->animate) start_anim(NULL, gtkconv); } - scale = gdk_pixbuf_scale_simple(buf, 32, 32, + scale_width = gdk_pixbuf_get_width(buf); + scale_height = gdk_pixbuf_get_height(buf); + if (scale_width == scale_height) { + scale_width = scale_height = 32; + } else if (scale_height > scale_width) { + scale_width = 32 * scale_width / scale_height; + scale_height = 32; + } else { + scale_height = 32 * scale_height / scale_width; + scale_width = 32; + } + scale = gdk_pixbuf_scale_simple(buf, scale_width, scale_height, GDK_INTERP_BILINEAR); - + g_object_unref(buf); + if (pidgin_gdk_pixbuf_is_opaque(scale)) + pidgin_gdk_pixbuf_make_round(scale); gtkconv->u.im->icon_container = gtk_vbox_new(FALSE, 0); event = gtk_event_box_new(); @@ -6508,8 +6542,6 @@ gtkconv->u.im->icon = gtk_image_new_from_pixbuf(scale); gtkconv->auto_resize = TRUE; - /* Reset the size request to allow the buddy icon to resize */ - g_idle_add(reset_auto_resize_cb, gtkconv); gtk_container_add(GTK_CONTAINER(event), gtkconv->u.im->icon); gtk_widget_show(gtkconv->u.im->icon); diff -r 37af7de81430 -r 708198aadad8 pidgin/gtkconv.h --- a/pidgin/gtkconv.h Wed Jun 20 04:56:08 2007 +0000 +++ b/pidgin/gtkconv.h Thu Jun 21 06:04:16 2007 +0000 @@ -160,7 +160,7 @@ time_t newday; GtkWidget *infopane_hbox; GtkWidget *infopane; - GtkTreeModel *infopane_model; + GtkListStore *infopane_model; GtkTreeIter infopane_iter; }; diff -r 37af7de81430 -r 708198aadad8 pidgin/gtkimhtml.c --- a/pidgin/gtkimhtml.c Wed Jun 20 04:56:08 2007 +0000 +++ b/pidgin/gtkimhtml.c Thu Jun 21 06:04:16 2007 +0000 @@ -29,6 +29,7 @@ #endif #include "pidgin.h" +#include "internal.h" #include "debug.h" #include "util.h" diff -r 37af7de81430 -r 708198aadad8 pidgin/gtksavedstatuses.c --- a/pidgin/gtksavedstatuses.c Wed Jun 20 04:56:08 2007 +0000 +++ b/pidgin/gtksavedstatuses.c Thu Jun 21 06:04:16 2007 +0000 @@ -23,8 +23,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" + #include "account.h" -#include "internal.h" #include "notify.h" #include "request.h" #include "savedstatuses.h" diff -r 37af7de81430 -r 708198aadad8 pidgin/gtkstatusbox.c --- a/pidgin/gtkstatusbox.c Wed Jun 20 04:56:08 2007 +0000 +++ b/pidgin/gtkstatusbox.c Thu Jun 21 06:04:16 2007 +0000 @@ -41,10 +41,11 @@ #include +#include "internal.h" + #include "account.h" #include "buddyicon.h" #include "core.h" -#include "internal.h" #include "imgstore.h" #include "network.h" #include "request.h" diff -r 37af7de81430 -r 708198aadad8 pidgin/gtkutils.c --- a/pidgin/gtkutils.c Wed Jun 20 04:56:08 2007 +0000 +++ b/pidgin/gtkutils.c Thu Jun 21 06:04:16 2007 +0000 @@ -3066,6 +3066,65 @@ return TRUE; } +void pidgin_gdk_pixbuf_make_round(GdkPixbuf *pixbuf) { + int width, height, rowstride; + guchar *pixels; + if (!gdk_pixbuf_get_has_alpha(pixbuf)) + return; + width = gdk_pixbuf_get_width(pixbuf); + height = gdk_pixbuf_get_height(pixbuf); + rowstride = gdk_pixbuf_get_rowstride(pixbuf); + pixels = gdk_pixbuf_get_pixels(pixbuf); + + if (width < 6 || height < 6) + return; + /* Top left */ + pixels[3] = 0; + pixels[7] = 0x80; + pixels[11] = 0xC0; + pixels[rowstride + 3] = 0x80; + pixels[rowstride * 2 + 3] = 0xC0; + + /* Top right */ + pixels[width * 4 - 1] = 0; + pixels[width * 4 - 5] = 0x80; + pixels[width * 4 - 9] = 0xC0; + pixels[rowstride + (width * 4) - 1] = 0x80; + pixels[(2 * rowstride) + (width * 4) - 1] = 0xC0; + + /* Bottom left */ + pixels[(height - 1) * rowstride + 3] = 0; + pixels[(height - 1) * rowstride + 7] = 0x80; + pixels[(height - 1) * rowstride + 11] = 0xC0; + pixels[(height - 2) * rowstride + 3] = 0x80; + pixels[(height - 3) * rowstride + 3] = 0xC0; + + /* Bottom right */ + pixels[height * rowstride - 1] = 0; + pixels[(height - 1) * rowstride - 1] = 0x80; + pixels[(height - 2) * rowstride - 1] = 0xC0; + pixels[height * rowstride - 5] = 0x80; + pixels[height * rowstride - 9] = 0xC0; +} + +const char *pidgin_get_dim_grey_string(GtkWidget *widget) { + static char dim_grey_string[8] = ""; + GtkStyle *style; + + if (!widget) + return "dim grey"; + + style = gtk_widget_get_style(widget); + if (!style) + return "dim grey"; + + snprintf(dim_grey_string, sizeof(dim_grey_string), "#%02x%02x%02x", + style->text_aa[GTK_STATE_NORMAL].red >> 8, + style->text_aa[GTK_STATE_NORMAL].green >> 8, + style->text_aa[GTK_STATE_NORMAL].blue >> 8); + return dim_grey_string; +} + #if !GTK_CHECK_VERSION(2,2,0) GtkTreePath * gtk_tree_path_new_from_indices (gint first_index, ...) diff -r 37af7de81430 -r 708198aadad8 pidgin/gtkutils.h --- a/pidgin/gtkutils.h Wed Jun 20 04:56:08 2007 +0000 +++ b/pidgin/gtkutils.h Thu Jun 21 06:04:16 2007 +0000 @@ -565,6 +565,22 @@ */ gboolean pidgin_gdk_pixbuf_is_opaque(GdkPixbuf *pixbuf); +/** + * Rounds the corners of a 32x32 GdkPixbuf in place + * + * @param pixbuf The buddy icon to transform + */ +void pidgin_gdk_pixbuf_make_round(GdkPixbuf *pixbuf); + +/** + * Returns an HTML-style color string for use as a dim grey + * string + * + * @param widget The widget to return dim grey for + * @return The dim grey string + */ +const char *pidgin_get_dim_grey_string(GtkWidget *widget); + #if !GTK_CHECK_VERSION(2,2,0) /** * This is copied from Gtk to support Gtk 2.0