Re: ANNOUNCE: Gossip 0.13
Paul van Tilburg <[email protected]>
| Newsgroups | gmane.comp.gnome.gossip.devel |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Aug 03, 2006 at 09:49:56AM +0200, Richard Hult wrote: > [...] The next thing to do is to do a diff between 0.12.x and > 0.13 to see what changed. > > I will try to look into this tonight. It would really help if you could > try gossip from a date in the middle of 0.12 and 0.13, to see when it > happened (maybe even half it again once or twice). Or do you already > know when it started happening? I have performed a binary search on the period from the 0.12 (July 5) until the 0.13 release (July 31). The results: gossip-20060705 ok gossip-20060715 ok gossip-20060720 ok gossip-20060721 not ok gossip-20060722 not ok gossip-20060724 not ok I have attached a cleaned up diff of the changes between 2006-05-20 and 2006-07-21 to this mail. Unfortunately it was a day in which a lot was done on the Gossip tree so the diff is quite large. Regards, Paul -- Student @ Eindhoven | email: [email protected] University of Technology, The Netherlands | JID: [email protected] >>> Using the Power of Debian GNU/Linux <<< | GnuPG key ID: 0x50064181 _______________________________________________ Gossip-dev mailing list [email protected] http://lists.imendio.com/mailman/listinfo/gossip-dev
gossip-20060720--20060721.diff
(text/plain, 65 KB)
diff -Nabur gossip-20060720-ok/ChangeLog gossip-20060721-notok/ChangeLog --- gossip-20060720-ok/ChangeLog 2006-07-19 12:13:43.000000000 +0200 +++ gossip-20060721-notok/ChangeLog 2006-07-20 16:50:56.000000000 +0200 @@ -1,3 +1,106 @@ +2006-07-20 Richard Hult <[email protected]> + + * src/gossip-main.c: + * src/gossip-ui-utils.c: Move setting the window icon here. + +2006-07-20 Richard Hult <[email protected]> + + * protocols/jabber/Makefile.am: Remove unsed bits. + * protocols/jabber/gossip-jabber-ft.c: Add backend ifdefs. + + * src/gossip-add-contact-window.c: Fix build. + +2006-07-20 Richard Hult <[email protected]> + + * src/gossip-avatar-image.c: Add backend ifdefs. + +2006-07-20 Richard Hult <[email protected]> + + * src/gossip-image-chooser.c: Add backend ifdefs. + +2006-07-20 Richard Hult <[email protected]> + + * src/gossip-ui-utils.c: Add gossip_link_button_new(). + * src/gossip-subscription-dialog.c: + * src/gossip-contact-info-dialog.c: Use it here. + +2006-07-20 Richard Hult <[email protected]> + + * src/gossip-main.c: Only use gnome program when available. + + * src/gossip-transport-add-window.c: + * src/gossip-transport-accounts-window.c: + * src/gossip-accounts-dialog.c: Remove unused includes. + + * src/gossip-new-account-window.c: Protect with HAVE_GNOME until + we have GtkAssistant. Remove unused includes. + +2006-07-20 Richard Hult <[email protected]> + + * src/gossip-cell-renderer-text.c: Simplify a bit and try to get + the cell always show two lines... probably won't help. + +2006-07-20 Richard Hult <[email protected]> + + * src/gossip-contact-groups.c: Remove unused includes. + * src/gossip-throbber.c: Use G_DEFINE_TYPE, remove gnome includes. + * src/gossip-geometry.c: Tweak the positioning so that it won't + put windows outside the screen. + +2006-07-20 Richard Hult <[email protected]> + + * src/gossip-status-presets.c: Remove unused includes and clean up + a bit. + +2006-07-20 Richard Hult <[email protected]> + + * src/gossip-vcard-dialog.c: Only use the thumbnail stuff with + GNOME (should probably remove it completely...). Remove unused + includes. + + * src/gossip-about-dialog.c: Make the authors etc info static. + + * configure.ac: Fix the gnome backend checks. + * src/Makefile.am: Use backend flags. + * src/gossip-main.c: Work a bit better without dbus. + +2006-07-20 Richard Hult <[email protected]> + + * libgossip/gossip-utils.[ch]: Remove sha. + + * libgossip/gossip-account-manager.c: + * libgossip/gossip-chatroom-manager.c: Don't include gnome-vfs, + it's not used here. + +2006-07-20 Richard Hult <[email protected]> + + * configure.ac: Remove gcrypt check and fix the xss check. + +2006-07-20 Richard Hult <[email protected]> + + * configure.ac: Make the lack of xss non-fatal. + + * protocols/jabber/Makefile.am: + * protocols/jabber/gossip-jabber.c: (jabber_set_presence), + (jabber_contact_is_avatar_latest): Use gossip_sha. + + * src/gossip-idle.c: Use HAVE_XSS. + +2006-07-20 Richard Hult <[email protected]> + + * src/gossip-theme-manager.c: (theme_manager_apply_theme_clean): + Tweak the size of the lines for the header. + + * src/gossip-idle.c: Dummy implementation for xss-less systems. + + * src/gossip-sound.c: Protect with HAVE_GNOME for now. + +2006-07-20 Richard Hult <[email protected]> + + * src/gossip-log.c: Put escaping/unescaping in functions so that we + can easily change the implementation (I doubt that they are needed + actually). + 2006-07-19 Richard Hult <[email protected]> * src/gossip-ui-utils.c: Include the gnome includes when diff -Nabur gossip-20060720-ok/config.h.in gossip-20060721-notok/config.h.in --- gossip-20060720-ok/config.h.in 2006-08-03 11:15:06.000000000 +0200 +++ gossip-20060721-notok/config.h.in 2006-08-03 11:39:21.000000000 +0200 @@ -69,6 +69,9 @@ /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H +/* Define if we have xss */ +#undef HAVE_XSS + /* ISO codes prefix */ #undef ISO_CODES_PREFIX diff -Nabur gossip-20060720-ok/configure.ac gossip-20060721-notok/configure.ac --- gossip-20060720-ok/configure.ac 2006-07-18 20:20:36.000000000 +0200 +++ gossip-20060721-notok/configure.ac 2006-07-20 12:11:22.000000000 +0200 @@ -50,13 +50,25 @@ if test "x$ac_backend" = xgnome; then AC_DEFINE(HAVE_GNOME, 1, [whether to use the GNOME backend]) gconf_pkgconfig=gconf-2.0 + gnome_vfs_pkgconfig=gnome-vfs-2.0 + libgnomeui_pkgconfig=libgnomeui-2.0 + BACKEND_CFLAGS= + BACKEND_LDFLAGS= elif test "x$ac_backend" = xcocoa; then AC_DEFINE(HAVE_COCOA, 1, [whether to use the Cocoa backend]) gconf_pkgconfig= + gnome_vfs_pkgconfig= + libgnomeui_pkgconfig= + AM_CONDITIONAL(GCONF_SCHEMAS_INSTALL, false) + BACKEND_CFLAGS="-xobjective-c" + BACKEND_LDFLAGS="-framework AppKit -lobjc" else AC_MSG_ERROR([Incorrect backend]) fi +AC_SUBST(BACKEND_CFLAGS) +AC_SUBST(BACKEND_LDFLAGS) + AM_CONDITIONAL(HAVE_GNOME, test x$ac_backend = xgnome) AM_CONDITIONAL(HAVE_COCOA, test x$ac_backend = xcocoa) @@ -175,7 +187,6 @@ libxml-2.0 >= $LIBXML_REQUIRED glib-2.0 >= $GLIB_REQUIRED gobject-2.0 - gnome-vfs-2.0 >= $LIBGNOMEVFS_REQUIRED $gconf_pkgconfig ]) @@ -187,11 +198,12 @@ gtk+-2.0 >= $GTK_REQUIRED libglade-2.0 >= $LIBGLADE_REQUIRED loudmouth-1.0 >= $LOUDMOUTH_REQUIRED - libgnomeui-2.0 >= $LIBGNOME_REQUIRED $iso_codes_pkgconfig $dbus_pkgconfig $galago_pkgconfig $libnotify_pkgconfig + $libgnomeui_pkgconfig + $gnome_vfs_pkgconfig ]) PKG_CHECK_MODULES(GOSSIP_JABBER, @@ -199,8 +211,8 @@ glib-2.0 >= $GLIB_REQUIRED gobject-2.0 loudmouth-1.0 >= $LOUDMOUTH_REQUIRED - gnome-vfs-2.0 >= $LIBGNOMEVFS_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED + $gnome_vfs_pkgconfig ]) if test x$have_dbus = xyes -a x$have_galago = xyes; then @@ -234,28 +246,18 @@ PANEL_VER="-DUSE_OLDER_PANEL_APPLET") AC_SUBST(PANEL_VER) -dnl ----------------------------------------------------------- -dnl Check for libgcrypt -dnl ----------------------------------------------------------- -AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no) -if test x"$LIBGCRYPT_CONFIG" = xno; then - AC_MSG_ERROR([gcrypt not found on system]) -else - LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags` - LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs` - - GOSSIP_JABBER_CFLAGS="$GOSSIP_JABBER_CFLAGS $LIBGCRYPT_CFLAGS" - GOSSIP_JABBER_LDFLAGS="$GOSSIP_JABBER_LDFLAGS $LIBGCRYPT_LDFLAGS" -fi - dnl ----------------------------------------------------------- dnl Check for the XScreenSaver extension (used for autoaway) dnl ----------------------------------------------------------- -x_libs="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" have_xss="no" -AC_CHECK_FUNC(XScreenSaverQueryInfo, [ +# Only check for XSS under GNOME, it doesn't make sense to find it +# when we're not using X (like on OSX). +if test x$ac_backend = xgnome; then + x_libs="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" + + AC_CHECK_FUNC(XScreenSaverQueryInfo, [ have_xss="yes"], [ save_LIBS=$LIBS LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lXss -lXext -lX11" @@ -263,6 +265,7 @@ [ have_xss="yes" XSS_LIBS="$X_PRE_LIBS $X_LIBS -lXss -lXext -lX11" + AC_DEFINE(HAVE_XSS, 1, [Define if we have xss]) ], [ LIBS=$save_LIBS @@ -271,14 +274,12 @@ [ have_xss="yes" XSS_LIBS="$X_PRE_LIBS $X_LIBS -lXext -lX11"],[]) + AC_DEFINE(HAVE_XSS, 1, [Define if we have xss]) ]) LIBS=$save_LIBS ]) -AC_SUBST(XSS_LIBS) - -if test "x$have_xss" = "xno"; then - AC_MSG_ERROR([Couldn't find XScreenSaver extension.]) + AC_SUBST(XSS_LIBS) fi @@ -347,5 +348,6 @@ echo "Galago: $have_galago" echo "ASpell: $have_aspell" echo "Notify: $have_libnotify" +echo "XSS: $have_xss (only with GNOME)" echo "Peekaboo: $have_peekaboo (requires DBUS & Galago)" echo diff -Nabur gossip-20060720-ok/libgossip/Makefile.am gossip-20060721-notok/libgossip/Makefile.am --- gossip-20060720-ok/libgossip/Makefile.am 2006-07-18 19:15:24.000000000 +0200 +++ gossip-20060721-notok/libgossip/Makefile.am 2006-07-20 12:05:38.000000000 +0200 @@ -4,7 +4,7 @@ -DPROTOCOL_DIR=\""$(libdir)/gossip/protocols"\" \ -DDTDDIR=\"$(datadir)/gossip\" \ -I$(top_srcdir)/protocols/jabber \ - $(LIBGOSSIP_CFLAGS) $(WARN_CFLAGS) + $(LIBGOSSIP_CFLAGS) $(WARN_CFLAGS) $(BACKEND_CFLAGS) noinst_LTLIBRARIES = libgossip.la diff -Nabur gossip-20060720-ok/libgossip/gossip-account-manager.c gossip-20060721-notok/libgossip/gossip-account-manager.c --- gossip-20060720-ok/libgossip/gossip-account-manager.c 2006-07-05 21:48:34.000000000 +0200 +++ gossip-20060721-notok/libgossip/gossip-account-manager.c 2006-07-20 11:49:58.000000000 +0200 @@ -22,7 +22,6 @@ #include <string.h> #include <sys/types.h> #include <sys/stat.h> -#include <libgnomevfs/gnome-vfs.h> #include <libxml/parser.h> #include <libxml/tree.h> diff -Nabur gossip-20060720-ok/libgossip/gossip-chatroom-manager.c gossip-20060721-notok/libgossip/gossip-chatroom-manager.c --- gossip-20060720-ok/libgossip/gossip-chatroom-manager.c 2006-07-05 21:48:34.000000000 +0200 +++ gossip-20060721-notok/libgossip/gossip-chatroom-manager.c 2006-07-20 11:49:59.000000000 +0200 @@ -20,8 +20,8 @@ #include <config.h> #include <string.h> - -#include <libgnomevfs/gnome-vfs.h> +#include <sys/types.h> +#include <sys/stat.h> #include <libxml/parser.h> #include <libxml/tree.h> diff -Nabur gossip-20060720-ok/libgossip/gossip-utils.c gossip-20060721-notok/libgossip/gossip-utils.c --- gossip-20060720-ok/libgossip/gossip-utils.c 2006-07-18 20:12:07.000000000 +0200 +++ gossip-20060721-notok/libgossip/gossip-utils.c 2006-07-20 11:49:52.000000000 +0200 @@ -421,31 +421,3 @@ return rv; } - - -gchar * -gossip_sha1_string (const guchar *data, - gsize len) -{ -#if 0 - gchar *hash_string; - gchar *p; - guchar hash[20]; - gint i; - - if (data == NULL || len < 1) { - return g_strdup(""); - } - - gcry_md_hash_buffer (GCRY_MD_SHA1, hash, data, (size_t) len); - hash_string = g_malloc (sizeof (gchar) * 41); - p = hash_string; - - for (i = 0; i < 20; i++, p += 2) { - snprintf (p, 3, "%02x", hash[i]); - } - - return hash_string; -#endif - return g_strdup (""); -} diff -Nabur gossip-20060720-ok/libgossip/gossip-utils.h gossip-20060721-notok/libgossip/gossip-utils.h --- gossip-20060720-ok/libgossip/gossip-utils.h 2006-05-24 21:22:12.000000000 +0200 +++ gossip-20060721-notok/libgossip/gossip-utils.h 2006-07-20 11:49:58.000000000 +0200 @@ -23,7 +23,6 @@ #include <libxml/parser.h> #include <libxml/tree.h> -#include <gcrypt.h> #include "gossip-account.h" #include "gossip-presence.h" @@ -71,7 +70,5 @@ gsize *len); gchar * gossip_base64_encode (const guchar *data, gsize len); -gchar * gossip_sha1_string (const guchar *data, - gsize len); #endif /* __GOSSIP_UTILS_H__ */ diff -Nabur gossip-20060720-ok/protocols/jabber/Makefile.am gossip-20060721-notok/protocols/jabber/Makefile.am --- gossip-20060720-ok/protocols/jabber/Makefile.am 2006-02-26 18:41:04.000000000 +0100 +++ gossip-20060721-notok/protocols/jabber/Makefile.am 2006-07-20 16:42:55.000000000 +0200 @@ -26,12 +26,14 @@ gossip-jabber-utils.h \ gossip-jid.c \ gossip-jid.h \ - gossip-transport-accounts.c \ - gossip-transport-accounts.h \ - gossip-transport-discover.c \ - gossip-transport-discover.h \ - gossip-transport-protocol.c \ - gossip-transport-protocol.h \ - gossip-transport-register.c \ - gossip-transport-register.h + gossip-sha.c \ + gossip-sha.h +# gossip-transport-accounts.c \ +# gossip-transport-accounts.h \ +# gossip-transport-discover.c \ +# gossip-transport-discover.h \ +# gossip-transport-protocol.c \ +# gossip-transport-protocol.h \ +# gossip-transport-register.c \ +# gossip-transport-register.h diff -Nabur gossip-20060720-ok/protocols/jabber/gossip-jabber-ft.c gossip-20060721-notok/protocols/jabber/gossip-jabber-ft.c --- gossip-20060720-ok/protocols/jabber/gossip-jabber-ft.c 2006-06-17 15:52:55.000000000 +0200 +++ gossip-20060721-notok/protocols/jabber/gossip-jabber-ft.c 2006-07-20 16:42:55.000000000 +0200 @@ -19,12 +19,13 @@ */ #include <config.h> - #include <string.h> #include <stdlib.h> - #include <loudmouth/loudmouth.h> + +#ifdef HAVE_GNOME #include <libgnomevfs/gnome-vfs.h> +#endif #include "gossip-jabber-ft.h" #include "gossip-jabber-private.h" @@ -336,22 +337,16 @@ gchar **file_size, gchar **mime_type) { - GnomeVFSFileInfo file_info; +#ifdef HAVE_GNOME + GnomeVFSFileInfo *file_info; GnomeVFSResult result; - /* GnomeVFSURI *uri; */ DEBUG_MSG (("ProtocolFT: Getting file info for URI:'%s'", uri)); - /* uri = gnome_vfs_uri_new (file_name); */ - - /* if (!gnome_vfs_uri_exists (uri)) { */ - /* DEBUG_MSG (("ProtocolFT: URI:'%s' does not exist", file_name)); */ - /* gnome_vfs_uri_unref (uri); */ - /* return; */ - /* } */ + file_info = gnome_vfs_file_info_new (); result = gnome_vfs_get_file_info (uri, - &file_info, + file_info, GNOME_VFS_FILE_INFO_DEFAULT); if (result != GNOME_VFS_OK) { @@ -360,11 +355,11 @@ } if (file_name) { - *file_name = g_strdup (file_info.name); + *file_name = g_strdup (file_info->name); } if (file_size) { - *file_size = g_strdup_printf ("%d", (guint)file_info.size); + *file_size = g_strdup_printf ("%d", (guint) file_info->size); } if (mime_type) { @@ -378,9 +373,11 @@ } } - gnome_vfs_file_info_unref (&file_info); + gnome_vfs_file_info_unref (file_info); return TRUE; +#endif + return FALSE; } static gchar * diff -Nabur gossip-20060720-ok/protocols/jabber/gossip-jabber.c gossip-20060721-notok/protocols/jabber/gossip-jabber.c --- gossip-20060720-ok/protocols/jabber/gossip-jabber.c 2006-07-18 19:15:25.000000000 +0200 +++ gossip-20060721-notok/protocols/jabber/gossip-jabber.c 2006-07-20 11:25:27.000000000 +0200 @@ -19,7 +19,6 @@ */ #include <config.h> - #include <stdlib.h> #include <string.h> #include <glib/gi18n.h> @@ -29,7 +28,6 @@ #include <libgossip/gossip-contact.h> #include <libgossip/gossip-debug.h> #include <libgossip/gossip-vcard.h> -#include <libgossip/gossip-utils.h> #include <libgossip/gossip-chatroom-provider.h> #include <libgossip/gossip-ft-provider.h> @@ -41,6 +39,7 @@ #include "gossip-transport-accounts.h" #include "gossip-jabber.h" #include "gossip-jabber-private.h" +#include "gossip-sha.h" #define DEBUG_DOMAIN "Jabber" @@ -1508,7 +1507,7 @@ contact = gossip_jabber_get_own_contact (jabber); avatar = gossip_contact_get_avatar (contact, &avatar_size); - sha1 = gossip_sha1_string (avatar, avatar_size); + sha1 = gossip_sha_hash (avatar, avatar_size); gossip_debug (DEBUG_DOMAIN, "Setting presence to:'%s', status:'%s', " "priority:'%s' sha1:'%s' avatar_size:%" G_GSIZE_FORMAT " avatar:%p", @@ -1837,7 +1836,7 @@ } avatar = gossip_contact_get_avatar (contact, &avatar_size); - sha1 = gossip_sha1_string (avatar, avatar_size); + sha1 = gossip_sha_hash (avatar, avatar_size); same = g_ascii_strcasecmp (sha1, avatar_node->value) == 0; g_free (sha1); diff -Nabur gossip-20060720-ok/protocols/jabber/gossip-sha.c gossip-20060721-notok/protocols/jabber/gossip-sha.c --- gossip-20060720-ok/protocols/jabber/gossip-sha.c 1970-01-01 01:00:00.000000000 +0100 +++ gossip-20060721-notok/protocols/jabber/gossip-sha.c 2006-07-20 11:11:14.000000000 +0200 @@ -0,0 +1,625 @@ +/*- + * Copyright (c) 2001, 2002 Allan Saddi <[email protected]> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +/* + * Define WORDS_BIGENDIAN if compiling on a big-endian architecture. + * + * Define SHA1_TEST to test the implementation using the NIST's + * sample messages. The output should be: + * + * a9993e36 4706816a ba3e2571 7850c26c 9cd0d89d + * 84983e44 1c3bd26e baae4aa1 f95129e5 e54670f1 + * 34aa973c d4c4daa4 f61eeb2b dbad2731 6534016f + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif /* HAVE_CONFIG_H */ + +#include <string.h> +#include <stdio.h> +#include <glib.h> + +#include "gossip-sha.h" + +#define SHA1_HASH_SIZE 20 + +/* Hash size in 32-bit words */ +#define SHA1_HASH_WORDS 5 + +struct _SHA1Context { + guint64 totalLength; + guint32 hash[SHA1_HASH_WORDS]; + guint32 bufferLength; + union { + guint32 words[16]; + guint8 bytes[64]; + } buffer; +}; + +typedef struct _SHA1Context SHA1Context; + +#ifdef __cplusplus +extern "C" { +#endif + +void SHA1Init (SHA1Context *sc); +void SHA1Update (SHA1Context *sc, const void *udata, guint32 len); +void SHA1Final (SHA1Context *sc, guint8 hash[SHA1_HASH_SIZE]); + +#ifdef __cplusplus +} +#endif + +#ifndef lint +static const char rcsid[] = + "$Id: gossip-sha.c,v 1.1 2006/07/20 09:11:14 rhult Exp $"; +#endif /* !lint */ + +#define ROTL(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) +#define ROTR(x, n) (((x) >> (n)) | ((x) << (32 - (n)))) + +#define F_0_19(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) +#define F_20_39(x, y, z) ((x) ^ (y) ^ (z)) +#define F_40_59(x, y, z) (((x) & ((y) | (z))) | ((y) & (z))) +#define F_60_79(x, y, z) ((x) ^ (y) ^ (z)) + +#define DO_ROUND(F, K) { \ + temp = ROTL(a, 5) + F(b, c, d) + e + *(W++) + K; \ + e = d; \ + d = c; \ + c = ROTL(b, 30); \ + b = a; \ + a = temp; \ +} + +#define K_0_19 0x5a827999L +#define K_20_39 0x6ed9eba1L +#define K_40_59 0x8f1bbcdcL +#define K_60_79 0xca62c1d6L + +#ifndef RUNTIME_ENDIAN + +#ifdef WORDS_BIGENDIAN + +#define BYTESWAP(x) (x) +#define BYTESWAP64(x) (x) + +#else /* WORDS_BIGENDIAN */ + +#define BYTESWAP(x) ((ROTR((x), 8) & 0xff00ff00L) | \ + (ROTL((x), 8) & 0x00ff00ffL)) +#define BYTESWAP64(x) _byteswap64(x) + +static inline guint64 _byteswap64(guint64 x) +{ + guint32 a = x >> 32; + guint32 b = (guint32) x; + return ((guint64) BYTESWAP(b) << 32) | (guint64) BYTESWAP(a); +} + +#endif /* WORDS_BIGENDIAN */ + +#else /* !RUNTIME_ENDIAN */ + +static int littleEndian; + +#define BYTESWAP(x) _byteswap(x) +#define BYTESWAP64(x) _byteswap64(x) + +#define _BYTESWAP(x) ((ROTR((x), 8) & 0xff00ff00L) | \ + (ROTL((x), 8) & 0x00ff00ffL)) +#define _BYTESWAP64(x) __byteswap64(x) + +static inline guint64 __byteswap64(guint64 x) +{ + guint32 a = x >> 32; + guint32 b = (guint32) x; + return ((guint64) _BYTESWAP(b) << 32) | (guint64) _BYTESWAP(a); +} + +static inline guint32 _byteswap(guint32 x) +{ + if (!littleEndian) + return x; + else + return _BYTESWAP(x); +} + +static inline guint64 _byteswap64(guint64 x) +{ + if (!littleEndian) + return x; + else + return _BYTESWAP64(x); +} + +static inline void setEndian(void) +{ + union { + guint32 w; + guint8 b[4]; + } endian; + + endian.w = 1L; + littleEndian = endian.b[0] != 0; +} + +#endif /* !RUNTIME_ENDIAN */ + +static const guint8 padding[64] = { + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +void +SHA1Init (SHA1Context *sc) +{ +#ifdef RUNTIME_ENDIAN + setEndian (); +#endif /* RUNTIME_ENDIAN */ + +#ifdef G_OS_WIN32 + sc->totalLength = 0L; +#else + sc->totalLength = 0LL; +#endif + sc->hash[0] = 0x67452301L; + sc->hash[1] = 0xefcdab89L; + sc->hash[2] = 0x98badcfeL; + sc->hash[3] = 0x10325476L; + sc->hash[4] = 0xc3d2e1f0L; + sc->bufferLength = 0L; +} + +static void +burnStack (int size) +{ + char buf[128]; + + memset (buf, 0, sizeof (buf)); + size -= sizeof (buf); + if (size > 0) + burnStack (size); +} + +static void +SHA1Guts (SHA1Context *sc, const guint32 *cbuf) +{ + guint32 buf[80]; + guint32 *W, *W3, *W8, *W14, *W16; + guint32 a, b, c, d, e, temp; + int i; + + W = buf; + + for (i = 15; i >= 0; i--) { + *(W++) = BYTESWAP(*cbuf); + cbuf++; + } + + W16 = &buf[0]; + W14 = &buf[2]; + W8 = &buf[8]; + W3 = &buf[13]; + + for (i = 63; i >= 0; i--) { + *W = *(W3++) ^ *(W8++) ^ *(W14++) ^ *(W16++); + *W = ROTL(*W, 1); + W++; + } + + a = sc->hash[0]; + b = sc->hash[1]; + c = sc->hash[2]; + d = sc->hash[3]; + e = sc->hash[4]; + + W = buf; + +#ifndef SHA1_UNROLL +#define SHA1_UNROLL 20 +#endif /* !SHA1_UNROLL */ + +#if SHA1_UNROLL == 1 + for (i = 19; i >= 0; i--) + DO_ROUND(F_0_19, K_0_19); + + for (i = 19; i >= 0; i--) + DO_ROUND(F_20_39, K_20_39); + + for (i = 19; i >= 0; i--) + DO_ROUND(F_40_59, K_40_59); + + for (i = 19; i >= 0; i--) + DO_ROUND(F_60_79, K_60_79); +#elif SHA1_UNROLL == 2 + for (i = 9; i >= 0; i--) { + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + } + + for (i = 9; i >= 0; i--) { + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + } + + for (i = 9; i >= 0; i--) { + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + } + + for (i = 9; i >= 0; i--) { + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + } +#elif SHA1_UNROLL == 4 + for (i = 4; i >= 0; i--) { + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + } + + for (i = 4; i >= 0; i--) { + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + } + + for (i = 4; i >= 0; i--) { + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + } + + for (i = 4; i >= 0; i--) { + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + } +#elif SHA1_UNROLL == 5 + for (i = 3; i >= 0; i--) { + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + } + + for (i = 3; i >= 0; i--) { + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + } + + for (i = 3; i >= 0; i--) { + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + } + + for (i = 3; i >= 0; i--) { + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + } +#elif SHA1_UNROLL == 10 + for (i = 1; i >= 0; i--) { + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + } + + for (i = 1; i >= 0; i--) { + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + } + + for (i = 1; i >= 0; i--) { + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + } + + for (i = 1; i >= 0; i--) { + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + } +#elif SHA1_UNROLL == 20 + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + DO_ROUND(F_0_19, K_0_19); + + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + DO_ROUND(F_20_39, K_20_39); + + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + DO_ROUND(F_40_59, K_40_59); + + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); + DO_ROUND(F_60_79, K_60_79); +#else /* SHA1_UNROLL */ +#error SHA1_UNROLL must be 1, 2, 4, 5, 10 or 20! +#endif + + sc->hash[0] += a; + sc->hash[1] += b; + sc->hash[2] += c; + sc->hash[3] += d; + sc->hash[4] += e; +} + +void +SHA1Update (SHA1Context *sc, const void *udata, guint32 len) +{ + guint32 bufferBytesLeft; + guint32 bytesToCopy; + int needBurn = 0; + guint8 *data = (guint8 *)udata; + +#ifdef SHA1_FAST_COPY + if (sc->bufferLength) { + bufferBytesLeft = 64L - sc->bufferLength; + + bytesToCopy = bufferBytesLeft; + if (bytesToCopy > len) + bytesToCopy = len; + + memcpy (&sc->buffer.bytes[sc->bufferLength], data, bytesToCopy); + + sc->totalLength += bytesToCopy * 8L; + + sc->bufferLength += bytesToCopy; + data += bytesToCopy; + len -= bytesToCopy; + + if (sc->bufferLength == 64L) { + SHA1Guts (sc, sc->buffer.words); + needBurn = 1; + sc->bufferLength = 0L; + } + } + + while (len > 63) { + sc->totalLength += 512L; + + SHA1Guts (sc, data); + needBurn = 1; + + data += 64L; + len -= 64L; + } + + if (len) { + memcpy (&sc->buffer.bytes[sc->bufferLength], data, len); + + sc->totalLength += len * 8L; + + sc->bufferLength += len; + } +#else /* SHA1_FAST_COPY */ + while (len) { + bufferBytesLeft = 64L - sc->bufferLength; + + bytesToCopy = bufferBytesLeft; + if (bytesToCopy > len) + bytesToCopy = len; + + memcpy (&sc->buffer.bytes[sc->bufferLength], data, bytesToCopy); + + sc->totalLength += bytesToCopy * 8L; + + sc->bufferLength += bytesToCopy; + data += bytesToCopy; + len -= bytesToCopy; + + if (sc->bufferLength == 64L) { + SHA1Guts (sc, sc->buffer.words); + needBurn = 1; + sc->bufferLength = 0L; + } + } +#endif /* SHA1_FAST_COPY */ + + if (needBurn) + burnStack (sizeof (guint32[86]) + sizeof (guint32 *[5]) + sizeof (int)); +} + +void +SHA1Final (SHA1Context *sc, guint8 hash[SHA1_HASH_SIZE]) +{ + guint32 bytesToPad; + guint64 lengthPad; + int i; + + bytesToPad = 120L - sc->bufferLength; + if (bytesToPad > 64L) + bytesToPad -= 64L; + + lengthPad = BYTESWAP64(sc->totalLength); + + SHA1Update (sc, padding, bytesToPad); + SHA1Update (sc, &lengthPad, 8L); + + if (hash) { + for (i = 0; i < SHA1_HASH_WORDS; i++) { +#ifdef SHA1_FAST_COPY + *((guint32 *) hash) = BYTESWAP(sc->hash[i]); +#else /* SHA1_FAST_COPY */ + hash[0] = (guint8) (sc->hash[i] >> 24); + hash[1] = (guint8) (sc->hash[i] >> 16); + hash[2] = (guint8) (sc->hash[i] >> 8); + hash[3] = (guint8) sc->hash[i]; +#endif /* SHA1_FAST_COPY */ + hash += 4; + } + } +} + +#ifdef G_OS_WIN32 +#define snprintf _snprintf +#endif + +gchar * +gossip_sha_hash (const gchar *str, gsize len) +{ + static gchar ret_val[41]; + SHA1Context ctx; + guint8 hash[SHA1_HASH_SIZE]; + gchar *ch; + guint i; + + SHA1Init (&ctx); + SHA1Update (&ctx, str, len); + SHA1Final (&ctx, hash); + + ch = ret_val; + + for (i = 0; i < SHA1_HASH_SIZE; ++i) { + snprintf (ch, 3, "%02x", hash[i]); + ch += 2; + } + + return g_strdup (ret_val); +} diff -Nabur gossip-20060720-ok/protocols/jabber/gossip-sha.h gossip-20060721-notok/protocols/jabber/gossip-sha.h --- gossip-20060720-ok/protocols/jabber/gossip-sha.h 1970-01-01 01:00:00.000000000 +0100 +++ gossip-20060721-notok/protocols/jabber/gossip-sha.h 2006-07-20 11:11:14.000000000 +0200 @@ -0,0 +1,29 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Copyright (C) 2003 Imendio AB + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser 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 __GOSSIP_SHA_H__ +#define __GOSSIP_SHA_H__ + +#include <glib.h> + +gchar * gossip_sha_hash (const gchar *str, + gsize len); + +#endif /* __GOSSIP_SHA_H__ */ diff -Nabur gossip-20060720-ok/src/Makefile.am gossip-20060721-notok/src/Makefile.am --- gossip-20060720-ok/src/Makefile.am 2006-06-22 02:32:46.000000000 +0200 +++ gossip-20060721-notok/src/Makefile.am 2006-07-20 12:11:26.000000000 +0200 @@ -13,7 +13,7 @@ -DSTYLESHEETDIR=\"$(datadir)/gossip\" \ -DDTDDIR=\"$(datadir)/gossip\" \ -DDBUS_API_SUBJECT_TO_CHANGE \ - $(GOSSIP_CFLAGS) $(WARN_CFLAGS) + $(GOSSIP_CFLAGS) $(WARN_CFLAGS) $(BACKEND_CFLAGS) dbus_binding_sources = gossip-dbus.xml @@ -93,7 +93,7 @@ gossip_LDADD = $(GOSSIP_LIBS) $(XSS_LIBS) \ $(top_builddir)/libgossip/libgossip.la -gossip_LDFLAGS = -export-dynamic +gossip_LDFLAGS = -export-dynamic $(BACKEND_LDFLAGS) dtddir = $(datadir)/gossip dtd_DATA = \ diff -Nabur gossip-20060720-ok/src/gossip-about-dialog.c gossip-20060721-notok/src/gossip-about-dialog.c --- gossip-20060720-ok/src/gossip-about-dialog.c 2006-07-19 11:59:27.000000000 +0200 +++ gossip-20060721-notok/src/gossip-about-dialog.c 2006-07-20 12:55:40.000000000 +0200 @@ -31,7 +31,7 @@ const gchar *link, gpointer data); -const char *authors[] = { +static const char *authors[] = { "Mikael Hallendal", "Richard Hult", "Martyn Russell", @@ -40,19 +40,19 @@ NULL }; -const char *documenters[] = { +static const char *documenters[] = { "Daniel Taylor", "Keywan Najafi Tonekaboni", "Brian Pepple", NULL }; -const char *artists[] = { +static const char *artists[] = { "Daniel Taylor", NULL }; -const char *license[] = { +static const char *license[] = { N_("Gossip 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 " diff -Nabur gossip-20060720-ok/src/gossip-accounts-dialog.c gossip-20060721-notok/src/gossip-accounts-dialog.c --- gossip-20060720-ok/src/gossip-accounts-dialog.c 2006-07-05 21:48:35.000000000 +0200 +++ gossip-20060721-notok/src/gossip-accounts-dialog.c 2006-07-20 15:47:08.000000000 +0200 @@ -22,13 +22,10 @@ #include <ctype.h> #include <string.h> #include <stdlib.h> - #include <gtk/gtk.h> #include <glade/glade.h> #include <glib/gi18n.h> -#include <loudmouth/loudmouth.h> - #include <libgossip/gossip-account.h> #include <libgossip/gossip-protocol.h> #include <libgossip/gossip-utils.h> diff -Nabur gossip-20060720-ok/src/gossip-add-contact-window.c gossip-20060721-notok/src/gossip-add-contact-window.c --- gossip-20060720-ok/src/gossip-add-contact-window.c 2006-06-14 22:12:10.000000000 +0200 +++ gossip-20060721-notok/src/gossip-add-contact-window.c 2006-07-20 16:44:27.000000000 +0200 @@ -21,9 +21,12 @@ #include <config.h> #include <string.h> #include <gtk/gtk.h> -#include <libgnomeui/gnome-druid.h> #include <glib/gi18n.h> +#ifdef HAVE_GNOME +#include <libgnomeui/gnome-druid.h> +#endif + #include <libgossip/gossip-utils.h> #include "gossip-account-chooser.h" @@ -82,6 +85,8 @@ COL_SYS_COUNT }; +#ifdef HAVE_GNOME + static void add_contact_window_setup_systems (GList *accounts, GossipAddContact *window); static gboolean add_contact_window_complete_group_idle (GossipAddContact *window); @@ -692,3 +697,14 @@ gtk_widget_show (window->window); } + +#else + +void +gossip_add_contact_window_show (GtkWindow *parent, + GossipContact *contact) +{ +} + +#endif + diff -Nabur gossip-20060720-ok/src/gossip-avatar-image.c gossip-20060721-notok/src/gossip-avatar-image.c --- gossip-20060720-ok/src/gossip-avatar-image.c 2006-06-20 19:49:32.000000000 +0200 +++ gossip-20060721-notok/src/gossip-avatar-image.c 2006-07-20 16:27:15.000000000 +0200 @@ -23,9 +23,12 @@ #include <glib/gi18n.h> #include <gdk/gdkkeysyms.h> #include <gdk/gdk.h> -#include <gdk/gdkx.h> #include <gtk/gtk.h> +#ifdef HAVE_GNOME +#include <gdk/gdkx.h> +#endif + #include "gossip-avatar-image.h" #define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \ @@ -117,6 +120,7 @@ G_OBJECT_CLASS (gossip_avatar_image_parent_class)->finalize (object); } +#ifdef HAVE_GNOME static GdkFilterReturn avatar_image_filter_func (GdkXEvent *gdkxevent, GdkEvent *event, @@ -142,10 +146,12 @@ return GDK_FILTER_CONTINUE; } +#endif static void avatar_image_add_filter (GossipAvatarImage *avatar_image) { +#ifdef HAVE_GNOME Window window; GdkWindow *gdkwindow; gint mask; @@ -167,12 +173,15 @@ gdk_error_trap_pop (); gdk_window_add_filter (NULL, avatar_image_filter_func, avatar_image); +#endif } static void avatar_image_remove_filter (GossipAvatarImage *avatar_image) { +#ifdef HAVE_GNOME gdk_window_remove_filter (NULL, avatar_image_filter_func, avatar_image); +#endif } static GdkPixbuf * diff -Nabur gossip-20060720-ok/src/gossip-cell-renderer-text.c gossip-20060721-notok/src/gossip-cell-renderer-text.c --- gossip-20060720-ok/src/gossip-cell-renderer-text.c 2006-06-10 20:40:15.000000000 +0200 +++ gossip-20060721-notok/src/gossip-cell-renderer-text.c 2006-07-20 14:47:53.000000000 +0200 @@ -18,11 +18,8 @@ * Boston, MA 02111-1307, USA. */ -#include <string.h> - #include <config.h> - -#include <glib/gi18n.h> +#include <string.h> #include "gossip-cell-renderer-text.h" @@ -279,8 +276,8 @@ PangoAttribute *attr_color, *attr_style, *attr_size; GtkStyle *style; GdkColor color; + const gchar *status; gchar *str; - gboolean show_status = FALSE; priv = cell->priv; @@ -298,15 +295,6 @@ return; } - if (!priv->is_group && (priv->status && strlen (priv->status) > 0)) { - show_status = TRUE; - } - - str = g_strdup_printf ("%s%s%s", - priv->name, - !show_status ? "" : "\n", - !show_status ? "" : priv->status); - style = gtk_widget_get_style (widget); color = style->text_aa[GTK_STATE_NORMAL]; @@ -325,10 +313,19 @@ } attr_size = pango_attr_size_new (pango_font_description_get_size (style->font_desc) / 1.2); + attr_size->start_index = attr_style->start_index; attr_size->end_index = -1; pango_attr_list_insert (attr_list, attr_size); + if (!priv->status || !priv->status[0]) { + status = ""; + } else { + status = priv->status; + } + + str = g_strdup_printf ("%s\n%s", priv->name, status); + g_object_set (cell, "visible", TRUE, "weight", PANGO_WEIGHT_NORMAL, @@ -336,9 +333,8 @@ "attributes", attr_list, NULL); - pango_attr_list_unref (attr_list); - g_free (str); + pango_attr_list_unref (attr_list); } GtkCellRenderer * diff -Nabur gossip-20060720-ok/src/gossip-chatrooms-window.c gossip-20060721-notok/src/gossip-chatrooms-window.c --- gossip-20060720-ok/src/gossip-chatrooms-window.c 2006-06-21 23:02:58.000000000 +0200 +++ gossip-20060721-notok/src/gossip-chatrooms-window.c 2006-07-20 16:28:03.000000000 +0200 @@ -23,7 +23,6 @@ #include <stdio.h> #include <gtk/gtk.h> #include <glade/glade.h> -#include <libgnome/gnome-config.h> #include <glib.h> #include <glib/gi18n.h> diff -Nabur gossip-20060720-ok/src/gossip-contact-groups.c gossip-20060721-notok/src/gossip-contact-groups.c --- gossip-20060720-ok/src/gossip-contact-groups.c 2006-07-05 23:58:10.000000000 +0200 +++ gossip-20060721-notok/src/gossip-contact-groups.c 2006-07-20 13:41:17.000000000 +0200 @@ -19,12 +19,11 @@ */ #include <config.h> - #include <string.h> - +#include <sys/types.h> +#include <sys/stat.h> #include <glib.h> #include <glib/gi18n.h> -#include <libgnomevfs/gnome-vfs.h> #include <libxml/parser.h> #include <libxml/tree.h> diff -Nabur gossip-20060720-ok/src/gossip-contact-info-dialog.c gossip-20060721-notok/src/gossip-contact-info-dialog.c --- gossip-20060720-ok/src/gossip-contact-info-dialog.c 2006-07-05 17:15:09.000000000 +0200 +++ gossip-20060721-notok/src/gossip-contact-info-dialog.c 2006-07-20 16:12:04.000000000 +0200 @@ -23,13 +23,13 @@ #include <glade/glade.h> #include <gtk/gtk.h> #include <glib/gi18n.h> -#include <libgnomeui/gnome-href.h> #include <libgossip/gossip-contact.h> #include <libgossip/gossip-session.h> #include "gossip-app.h" #include "gossip-avatar-image.h" +#include "gossip-ui-utils.h" #include "gossip-contact-info-dialog.h" typedef struct { @@ -313,8 +313,7 @@ show_personal = TRUE; link = g_strdup_printf ("mailto:%s", str); - - href = gnome_href_new (link, str); + href = gossip_link_button_new (link, str); alignment = gtk_alignment_new (0, 1, 0, 0.5); gtk_container_add (GTK_CONTAINER (alignment), href); @@ -340,7 +339,7 @@ show_personal = TRUE; - href = gnome_href_new (str, str); + href = gossip_link_button_new (str, str); alignment = gtk_alignment_new (0, 1, 0, 0.5); gtk_container_add (GTK_CONTAINER (alignment), href); diff -Nabur gossip-20060720-ok/src/gossip-edit-chatroom-dialog.c gossip-20060721-notok/src/gossip-edit-chatroom-dialog.c --- gossip-20060720-ok/src/gossip-edit-chatroom-dialog.c 2006-06-10 20:53:35.000000000 +0200 +++ gossip-20060721-notok/src/gossip-edit-chatroom-dialog.c 2006-07-20 16:28:45.000000000 +0200 @@ -22,7 +22,6 @@ #include <string.h> #include <stdio.h> #include <glade/glade.h> -#include <libgnome/gnome-config.h> #include <glib.h> #include <glib/gi18n.h> diff -Nabur gossip-20060720-ok/src/gossip-edit-groups-dialog.c gossip-20060721-notok/src/gossip-edit-groups-dialog.c --- gossip-20060720-ok/src/gossip-edit-groups-dialog.c 2006-05-26 19:02:07.000000000 +0200 +++ gossip-20060721-notok/src/gossip-edit-groups-dialog.c 2006-07-20 16:29:30.000000000 +0200 @@ -22,7 +22,6 @@ #include <string.h> #include <gtk/gtk.h> #include <glib/gi18n.h> -#include <loudmouth/loudmouth.h> #include "gossip-app.h" #include "gossip-edit-groups-dialog.h" diff -Nabur gossip-20060720-ok/src/gossip-geometry.c gossip-20060721-notok/src/gossip-geometry.c --- gossip-20060720-ok/src/gossip-geometry.c 2006-07-05 23:58:10.000000000 +0200 +++ gossip-20060721-notok/src/gossip-geometry.c 2006-07-20 13:41:17.000000000 +0200 @@ -19,9 +19,7 @@ */ #include <config.h> - #include <sys/stat.h> - #include <glib.h> #include <libgossip/gossip-chatroom.h> @@ -69,13 +67,10 @@ GError *error = NULL; GKeyFile *key_file; const gchar *id; - gchar *filename; - GdkScreen *screen; gint max_width; gint max_height; - gchar *content; gsize length; gchar *str; @@ -99,12 +94,12 @@ max_width = gdk_screen_get_width (screen); max_height = gdk_screen_get_height (screen); - x = CLAMP (x, 0, max_width); - y = CLAMP (y, 0, max_height); - w = CLAMP (w, 100, max_width); h = CLAMP (h, 100, max_height); + x = CLAMP (x, 0, max_width - w); + y = CLAMP (y, 0, max_height - h); + str = g_strdup_printf (GEOMETRY_FORMAT, x, y, w, h); key_file = g_key_file_new (); @@ -218,13 +213,10 @@ { GError *error = NULL; GKeyFile *key_file; - gchar *filename; - GdkScreen *screen; gint max_width; gint max_height; - gchar *content; gsize length; gchar *str; @@ -236,11 +228,11 @@ max_width = gdk_screen_get_width (screen); max_height = gdk_screen_get_height (screen); - x = CLAMP (x, 0, max_width); - y = CLAMP (y, 0, max_height); + w = CLAMP (w, 0, max_width); + h = CLAMP (h, 0, max_height); - w = CLAMP (w, 100, max_width); - h = CLAMP (h, 100, max_height); + x = CLAMP (x, 0, max_width - w); + y = CLAMP (y, 0, max_height - h); str = g_strdup_printf (GEOMETRY_FORMAT, x, y, w, h); diff -Nabur gossip-20060720-ok/src/gossip-idle.c gossip-20060721-notok/src/gossip-idle.c --- gossip-20060720-ok/src/gossip-idle.c 2004-04-21 02:04:26.000000000 +0200 +++ gossip-20060721-notok/src/gossip-idle.c 2006-07-20 11:25:28.000000000 +0200 @@ -21,10 +21,14 @@ #include <config.h> #include <time.h> #include <stdlib.h> + +#ifdef HAVE_XSS #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/extensions/scrnsaver.h> #include <gdk/gdkx.h> +#endif + #include <gdk/gdk.h> #include "gossip-idle.h" @@ -33,6 +37,7 @@ gint32 gossip_idle_get_seconds (void) { +#ifdef HAVE_XSS static gboolean inited = FALSE; static XScreenSaverInfo *ss_info = NULL; gint event_base; @@ -61,6 +66,10 @@ timestamp = time (NULL); return idle; +#else + /* Pretend we are never idle for now. */ + return 5; +#endif } void diff -Nabur gossip-20060720-ok/src/gossip-image-chooser.c gossip-20060721-notok/src/gossip-image-chooser.c --- gossip-20060720-ok/src/gossip-image-chooser.c 2006-07-05 23:58:10.000000000 +0200 +++ gossip-20060721-notok/src/gossip-image-chooser.c 2006-07-20 16:15:18.000000000 +0200 @@ -22,14 +22,15 @@ */ #include <config.h> - #include <string.h> - #include <glib/gi18n.h> #include <gtk/gtkimage.h> #include <gtk/gtkbutton.h> #include <gtk/gtkdnd.h> + +#ifdef HAVE_GNOME #include <libgnomevfs/gnome-vfs-ops.h> +#endif #include <libgossip/gossip-debug.h> @@ -434,6 +435,7 @@ target_type = gdk_atom_name (selection_data->target); if (!strcmp (target_type, URI_LIST_TYPE)) { +#ifdef HAVE_GNOME GnomeVFSHandle *handle; GnomeVFSResult result; GnomeVFSFileInfo info; @@ -474,10 +476,10 @@ } gnome_vfs_close (handle); - } g_free (uri); +#endif } gtk_drag_finish (context, handled, FALSE, time); diff -Nabur gossip-20060720-ok/src/gossip-log.c gossip-20060721-notok/src/gossip-log.c --- gossip-20060720-ok/src/gossip-log.c 2006-07-18 19:15:26.000000000 +0200 +++ gossip-20060721-notok/src/gossip-log.c 2006-07-20 10:46:54.000000000 +0200 @@ -53,22 +53,14 @@ #include <glib/gi18n.h> #include <glib/gstdio.h> -#ifdef USE_GNOMEVFS_FOR_URL -#include <libgnomevfs/gnome-vfs.h> -#else -#include <libgnome/gnome-url.h> -#endif - -#include <libgnomevfs/gnome-vfs-utils.h> -#include <libxslt/xslt.h> -#include <libxslt/transform.h> -#include <libxslt/xsltutils.h> -#include "libexslt/exslt.h" - #include <libgossip/gossip-debug.h> #include <libgossip/gossip-message.h> #include <libgossip/gossip-utils.h> +#ifdef HAVE_GNOME +#include <libgnomevfs/gnome-vfs-utils.h> +#endif + #include "gossip-app.h" #include "gossip-log.h" @@ -115,6 +107,8 @@ gchar *date; }; +static gchar * log_escape (const gchar *str); +static gchar * log_unescape (const gchar *str); static void log_handlers_notify_foreach (GossipLogMessageFunc func, HandlerData *data, GList **list); @@ -154,6 +148,26 @@ static GHashTable *contact_files = NULL; static GHashTable *message_handlers = NULL; +static gchar * +log_escape (const gchar *str) +{ +#ifdef HAVE_GNOME + return gnome_vfs_escape_host_and_path_string (str); +#else + return g_strdup (str); +#endif +} + +static gchar * +log_unescape (const gchar *str) +{ +#ifdef HAVE_GNOME + return gnome_vfs_unescape_string_for_display (str); +#else + return g_strdup (str); +#endif +} + static void log_handler_free (HandlerData *data) { @@ -637,12 +651,12 @@ } account_id = gossip_account_get_id (account); - account_id_escaped = gnome_vfs_escape_host_and_path_string (account_id); + account_id_escaped = log_escape (account_id); log_check_dir (&log_directory); contact_id = gossip_contact_get_id (contact); - contact_id_escaped = gnome_vfs_escape_host_and_path_string (contact_id); + contact_id_escaped = log_escape (contact_id); basename = g_strconcat (date, LOG_FILENAME_SUFFIX, NULL); filename = g_build_filename (log_directory, @@ -703,12 +717,12 @@ } account_id = gossip_account_get_id (account); - account_id_escaped = gnome_vfs_escape_host_and_path_string (account_id); + account_id_escaped = log_escape (account_id); log_check_dir (&log_directory); chatroom_id = gossip_chatroom_get_id_str (chatroom); - chatroom_id_escaped = gnome_vfs_escape_host_and_path_string (chatroom_id); + chatroom_id_escaped = log_escape (chatroom_id); basename = g_strconcat (date, LOG_FILENAME_SUFFIX, NULL); filename = g_build_filename (log_directory, @@ -765,7 +779,7 @@ gossip_account_get_id (account)); account_id = gossip_account_get_id (account); - account_id_escaped = gnome_vfs_escape_host_and_path_string (account_id); + account_id_escaped = log_escape (account_id); log_check_dir (&log_directory); @@ -951,7 +965,6 @@ return ok; } - GList * gossip_log_get_contacts (GossipAccount *account) { @@ -973,7 +986,7 @@ } account_id = gossip_account_get_id (account); - account_id_escaped = gnome_vfs_escape_host_and_path_string (account_id); + account_id_escaped = log_escape (account_id); directory = g_build_path (G_DIR_SEPARATOR_S, log_directory, @@ -1001,7 +1014,7 @@ continue; } - filename_unescaped = gnome_vfs_unescape_string_for_display (filename); + filename_unescaped = log_unescape (filename); contact = log_get_contact (account, filename_unescaped); g_free (filename_unescaped); @@ -1040,7 +1053,7 @@ } account_id = gossip_account_get_id (account); - account_id_escaped = gnome_vfs_escape_host_and_path_string (account_id); + account_id_escaped = log_escape (account_id); directory = g_build_path (G_DIR_SEPARATOR_S, log_directory, @@ -1071,7 +1084,7 @@ g_free (full); - filename_unescaped = gnome_vfs_unescape_string_for_display (filename); + filename_unescaped = log_unescape (filename); chatroom = log_get_chatroom_from_filename (account, filename_unescaped); g_free (filename_unescaped); @@ -1126,10 +1139,10 @@ } account_id = gossip_account_get_id (account); - account_id_escaped = gnome_vfs_escape_host_and_path_string (account_id); + account_id_escaped = log_escape (account_id); contact_id = gossip_contact_get_id (contact); - contact_id_escaped = gnome_vfs_escape_host_and_path_string (contact_id); + contact_id_escaped = log_escape (contact_id); directory = g_build_path (G_DIR_SEPARATOR_S, log_directory, @@ -1560,10 +1573,10 @@ } account_id = gossip_account_get_id (account); - account_id_escaped = gnome_vfs_escape_host_and_path_string (account_id); + account_id_escaped = log_escape (account_id); chatroom_id = gossip_chatroom_get_id_str (chatroom); - chatroom_id_escaped = gnome_vfs_escape_host_and_path_string (chatroom_id); + chatroom_id_escaped = log_escape (chatroom_id); directory = g_build_path (G_DIR_SEPARATOR_S, log_directory, diff -Nabur gossip-20060720-ok/src/gossip-main.c gossip-20060721-notok/src/gossip-main.c --- gossip-20060720-ok/src/gossip-main.c 2006-07-05 23:19:48.000000000 +0200 +++ gossip-20060721-notok/src/gossip-main.c 2006-07-20 16:50:56.000000000 +0200 @@ -21,15 +21,18 @@ #include <config.h> #include <string.h> #include <stdlib.h> - -#include <gtk/gtkwidget.h> -#include <gtk/gtkwindow.h> -#include <gtk/gtkmain.h> +#include <gtk/gtk.h> +#include <glib.h> #include <glib/gi18n.h> -#include <glib/goption.h> +#ifdef HAVE_GNOME #include <libgnome/gnome-program.h> #include <libgnomeui/gnome-ui-init.h> +#endif + +#include <libgossip/gossip-account-manager.h> +#include <libgossip/gossip-account.h> +#include <libgossip/gossip-session.h> #ifdef HAVE_DBUS #include "gossip-dbus.h" @@ -39,13 +42,8 @@ #include "gossip-galago.h" #endif -#include <libgossip/gossip-account-manager.h> -#include <libgossip/gossip-account.h> -#include <libgossip/gossip-session.h> - #include "gossip-preferences.h" #include "gossip-stock.h" -#include "gossip-dbus.h" #include "gossip-app.h" #define GNOME_PARAM_GOPTION_CONTEXT "goption-context" @@ -58,7 +56,9 @@ int main (int argc, char *argv[]) { +#ifdef HAVE_GNOME GnomeProgram *program; +#endif GossipSession *session; GossipAccountManager *account_manager; GossipAccount *account = NULL; @@ -91,6 +91,9 @@ context = g_option_context_new (_("- Gossip Instant Messenger")); g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE); + g_set_application_name (PACKAGE_NAME); + +#ifdef HAVE_GNOME program = gnome_program_init ("gossip", PACKAGE_VERSION, LIBGNOMEUI_MODULE, argc, argv, @@ -98,9 +101,15 @@ GNOME_PARAM_GOPTION_CONTEXT, context, GNOME_PARAM_HUMAN_READABLE_NAME, PACKAGE_NAME, NULL); +#else + gtk_init_with_args (&argc, &argv, + _("- Gossip Instant Messenger"), + options, + GETTEXT_PACKAGE, + NULL); +#endif - g_set_application_name (PACKAGE_NAME); - gtk_window_set_default_icon_name ("gossip"); + gossip_window_set_default_icon_name ("gossip"); /* Get all accounts. */ account_manager = gossip_account_manager_new (NULL); @@ -187,7 +196,9 @@ gossip_stock_finalize (); +#ifdef HAVE_GNOME g_object_unref (program); +#endif return EXIT_SUCCESS; } diff -Nabur gossip-20060720-ok/src/gossip-new-account-window.c gossip-20060721-notok/src/gossip-new-account-window.c --- gossip-20060720-ok/src/gossip-new-account-window.c 2006-03-18 20:04:10.000000000 +0100 +++ gossip-20060721-notok/src/gossip-new-account-window.c 2006-07-20 15:47:08.000000000 +0200 @@ -21,11 +21,11 @@ #include <config.h> #include <string.h> #include <ctype.h> +#include <glib/gi18n.h> +#ifdef HAVE_GNOME #include <libgnomeui/gnome-druid.h> -#include <libgnome/gnome-config.h> -#include <glib/gi18n.h> -#include <loudmouth/loudmouth.h> +#endif #include <libgossip/gossip-protocol.h> @@ -97,7 +97,7 @@ } GossipNewAccountWindow; - +#ifdef HAVE_GNOME static gboolean new_account_window_progress_pulse_cb (GtkWidget *progressbar); static void new_account_window_register_cb (GossipResult result, GError *error, @@ -652,6 +652,7 @@ g_free (window); } +#endif gboolean gossip_new_account_window_is_needed (void) @@ -683,6 +684,7 @@ void gossip_new_account_window_show (GtkWindow *parent) { +#ifdef HAVE_GNOME GossipNewAccountWindow *window; GossipAccountType type; GladeXML *glade; @@ -814,4 +816,5 @@ window->gtk_main_started = TRUE; gtk_main (); } +#endif } diff -Nabur gossip-20060720-ok/src/gossip-new-chatroom-dialog.c gossip-20060721-notok/src/gossip-new-chatroom-dialog.c --- gossip-20060720-ok/src/gossip-new-chatroom-dialog.c 2006-07-09 15:01:05.000000000 +0200 +++ gossip-20060721-notok/src/gossip-new-chatroom-dialog.c 2006-07-20 16:30:00.000000000 +0200 @@ -23,7 +23,6 @@ #include <stdio.h> #include <gtk/gtk.h> #include <glade/glade.h> -#include <libgnome/gnome-config.h> #include <glib.h> #include <glib/gi18n.h> diff -Nabur gossip-20060720-ok/src/gossip-private-chat.c gossip-20060721-notok/src/gossip-private-chat.c --- gossip-20060720-ok/src/gossip-private-chat.c 2006-07-18 19:15:26.000000000 +0200 +++ gossip-20060721-notok/src/gossip-private-chat.c 2006-07-20 16:33:43.000000000 +0200 @@ -25,7 +25,6 @@ #include <gtk/gtk.h> #include <glade/glade.h> #include <glib/gi18n.h> -#include <libgnomeui/gnome-href.h> #include <libgossip/gossip-debug.h> #include <libgossip/gossip-message.h> diff -Nabur gossip-20060720-ok/src/gossip-sound.c gossip-20060721-notok/src/gossip-sound.c --- gossip-20060720-ok/src/gossip-sound.c 2006-07-18 19:15:26.000000000 +0200 +++ gossip-20060721-notok/src/gossip-sound.c 2006-07-20 10:54:33.000000000 +0200 @@ -19,8 +19,11 @@ */ #include <config.h> + +#ifdef HAVE_GNOME #include <libgnome/gnome-sound.h> #include <libgnome/gnome-triggers.h> +#endif #include <libgossip/gossip-session.h> #include <libgossip/gossip-debug.h> @@ -193,6 +196,7 @@ return; } +#ifdef HAVE_GNOME switch (sound) { case GOSSIP_SOUND_CHAT: gossip_debug (DEBUG_DOMAIN, "Triggering 'Chat' event."); @@ -210,6 +214,7 @@ gossip_debug (DEBUG_DOMAIN, "Unknown sound type."); return; } +#endif } void diff -Nabur gossip-20060720-ok/src/gossip-status-presets.c gossip-20060721-notok/src/gossip-status-presets.c --- gossip-20060720-ok/src/gossip-status-presets.c 2006-06-30 18:06:37.000000000 +0200 +++ gossip-20060721-notok/src/gossip-status-presets.c 2006-07-20 13:34:10.000000000 +0200 @@ -20,12 +20,11 @@ */ #include <config.h> - +#include <sys/types.h> +#include <sys/stat.h> #include <string.h> - #include <glib.h> #include <glib/gi18n.h> -#include <libgnomevfs/gnome-vfs.h> #include <libxml/parser.h> #include <libxml/tree.h> @@ -67,14 +66,11 @@ } dir = g_build_filename (g_get_home_dir (), ".gnome2", PACKAGE_NAME, NULL); - if (!g_file_test (dir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) { g_mkdir_with_parents (dir, S_IRUSR | S_IWUSR | S_IXUSR); - } - file_with_path = g_build_filename (dir, STATUS_PRESETS_XML_FILENAME, NULL); g_free (dir); - if (g_file_test(file_with_path, G_FILE_TEST_EXISTS)) { + if (g_file_test (file_with_path, G_FILE_TEST_EXISTS)) { status_presets_file_parse (file_with_path); } @@ -189,10 +185,7 @@ gint count[4] = { 0, 0, 0, 0}; dir = g_build_filename (g_get_home_dir (), ".gnome2", PACKAGE_NAME, NULL); - if (!g_file_test (dir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) { g_mkdir_with_parents (dir, S_IRUSR | S_IWUSR | S_IXUSR); - } - file = g_build_filename (dir, STATUS_PRESETS_XML_FILENAME, NULL); g_free (dir); diff -Nabur gossip-20060720-ok/src/gossip-subscription-dialog.c gossip-20060721-notok/src/gossip-subscription-dialog.c --- gossip-20060720-ok/src/gossip-subscription-dialog.c 2006-07-05 23:58:10.000000000 +0200 +++ gossip-20060721-notok/src/gossip-subscription-dialog.c 2006-07-20 16:12:04.000000000 +0200 @@ -19,10 +19,8 @@ */ #include <string.h> - #include <gtk/gtk.h> #include <glib/gi18n.h> -#include <libgnomeui/libgnomeui.h> #include <libgossip/gossip-debug.h> #include <libgossip/gossip-protocol.h> @@ -344,7 +342,7 @@ GtkWidget *href; GtkWidget *alignment; - href = gnome_href_new (url, url); + href = gossip_link_button_new (url, url); alignment = gtk_alignment_new (0, 1, 0, 0.5); gtk_container_add (GTK_CONTAINER (alignment), href); diff -Nabur gossip-20060720-ok/src/gossip-theme-manager.c gossip-20060721-notok/src/gossip-theme-manager.c --- gossip-20060720-ok/src/gossip-theme-manager.c 2006-07-18 19:15:26.000000000 +0200 +++ gossip-20060721-notok/src/gossip-theme-manager.c 2006-07-20 10:54:33.000000000 +0200 @@ -614,13 +614,13 @@ tag = theme_manager_init_tag_by_name (table, "fancy-line-top-self"); g_object_set (tag, - "size", 1, + "size", 1 * PANGO_SCALE, "paragraph-background", ELEGANT_LINE, NULL); tag = theme_manager_init_tag_by_name (table, "fancy-line-bottom-self"); g_object_set (tag, - "size", 2, + "size", 1 * PANGO_SCALE, NULL); tag = theme_manager_init_tag_by_name (table, "fancy-action-self"); @@ -653,13 +653,13 @@ tag = theme_manager_init_tag_by_name (table, "fancy-line-top-other"); g_object_set (tag, - "size", 1, + "size", 1 * PANGO_SCALE, "paragraph-background", ELEGANT_LINE, NULL); tag = theme_manager_init_tag_by_name (table, "fancy-line-bottom-other"); g_object_set (tag, - "size", 2, + "size", 1 * PANGO_SCALE, NULL); tag = theme_manager_init_tag_by_name (table, "fancy-action-other"); diff -Nabur gossip-20060720-ok/src/gossip-throbber.c gossip-20060721-notok/src/gossip-throbber.c --- gossip-20060720-ok/src/gossip-throbber.c 2006-07-02 11:52:12.000000000 +0200 +++ gossip-20060721-notok/src/gossip-throbber.c 2006-07-20 13:41:17.000000000 +0200 @@ -21,13 +21,8 @@ #include <config.h> #include <math.h> - #include <gdk-pixbuf/gdk-pixbuf.h> -#include <gtk/gtksignal.h> -#include <glib/gi18n.h> -#include <libgnome/gnome-macros.h> -#include <libgnome/gnome-util.h> -#include <gtk/gtkicontheme.h> +#include <gtk/gtk.h> #include "gossip-throbber.h" @@ -55,7 +50,7 @@ GossipThrobber *throbber); static void gossip_throbber_remove_update_callback (GossipThrobber *throbber); -GNOME_CLASS_BOILERPLATE (GossipThrobber, gossip_throbber, GtkEventBox, GTK_TYPE_EVENT_BOX) +G_DEFINE_TYPE (GossipThrobber, gossip_throbber, GTK_TYPE_EVENT_BOX) static gboolean is_throbbing (GossipThrobber *throbber) @@ -103,7 +98,7 @@ } static void -gossip_throbber_instance_init (GossipThrobber *throbber) +gossip_throbber_init (GossipThrobber *throbber) { GtkWidget *widget = GTK_WIDGET (throbber); @@ -218,7 +213,7 @@ throbber = GOSSIP_THROBBER (widget); - GNOME_CALL_PARENT (GTK_WIDGET_CLASS, map, (widget)); + GTK_WIDGET_CLASS (gossip_throbber_parent_class)->map (widget); throbber->details->ready = TRUE; } @@ -460,7 +455,7 @@ g_free (throbber->details); - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (gossip_throbber_parent_class)->finalize (object); } static void diff -Nabur gossip-20060720-ok/src/gossip-transport-accounts-window.c gossip-20060721-notok/src/gossip-transport-accounts-window.c --- gossip-20060720-ok/src/gossip-transport-accounts-window.c 2006-02-25 01:07:50.000000000 +0100 +++ gossip-20060721-notok/src/gossip-transport-accounts-window.c 2006-07-20 15:47:07.000000000 +0200 @@ -22,7 +22,7 @@ #include <string.h> #include <gtk/gtk.h> #include <glib/gi18n.h> -#include <loudmouth/loudmouth.h> + #include "gossip-app.h" #include "gossip-stock.h" #include "gossip-add-contact.h" diff -Nabur gossip-20060720-ok/src/gossip-transport-add-window.c gossip-20060721-notok/src/gossip-transport-add-window.c --- gossip-20060720-ok/src/gossip-transport-add-window.c 2006-02-25 01:07:50.000000000 +0100 +++ gossip-20060721-notok/src/gossip-transport-add-window.c 2006-07-20 15:47:07.000000000 +0200 @@ -23,7 +23,7 @@ #include <gtk/gtk.h> #include <libgnomeui/gnome-druid.h> #include <glib/gi18n.h> -#include <loudmouth/loudmouth.h> + #include "gossip-utils.h" #include "gossip-app.h" #include "gossip-transport-discover.h" diff -Nabur gossip-20060720-ok/src/gossip-ui-utils.c gossip-20060721-notok/src/gossip-ui-utils.c --- gossip-20060720-ok/src/gossip-ui-utils.c 2006-07-19 12:13:44.000000000 +0200 +++ gossip-20060721-notok/src/gossip-ui-utils.c 2006-07-20 16:50:56.000000000 +0200 @@ -31,6 +31,7 @@ #ifdef HAVE_GNOME #include <libgnome/gnome-url.h> +#include <libgnomeui/gnome-href.h> #elif defined (HAVE_COCOA) #include <Cocoa/Cocoa.h> #endif @@ -1360,3 +1361,33 @@ { } #endif + +/* FIXME: Replace with GtkLinkButton in 2.10. */ +GtkWidget * +gossip_link_button_new (const gchar *url, + const gchar *title) +{ +#ifdef HAVE_GNOME + return gnome_href_new (url, title); +#else + return gtk_label_new (title); +#endif +} + +void +gossip_window_set_default_icon_name (const gchar *name) +{ +#ifdef HAVE_GNOME + gtk_window_set_default_icon_name (name); +#elif defined(HAVE_COCOA) + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + /* FIXME: Do this in a proper way at some point, probably in GTK+? */ + NSImage *image = [[NSImage alloc] initWithContentsOfFile: + @PREFIX"/share/icons/hicolor/48x48/apps/gossip.png"]; + [NSApp setApplicationIconImage: image]; + [image release]; + + [pool release]; +#endif +} diff -Nabur gossip-20060720-ok/src/gossip-ui-utils.h gossip-20060721-notok/src/gossip-ui-utils.h --- gossip-20060720-ok/src/gossip-ui-utils.h 2006-07-19 12:06:46.000000000 +0200 +++ gossip-20060721-notok/src/gossip-ui-utils.h 2006-07-20 16:50:56.000000000 +0200 @@ -104,7 +104,11 @@ /* Windows */ gboolean gossip_window_get_is_visible (GtkWindow *window); void gossip_window_present (GtkWindow *window); +void gossip_window_set_default_icon_name (const gchar *name); void gossip_url_show (const char *url); +GtkWidget *gossip_link_button_new (const gchar *url, + const gchar *title); + #endif /* __GOSSIP_UI_UTILS_H__ */ diff -Nabur gossip-20060720-ok/src/gossip-vcard-dialog.c gossip-20060721-notok/src/gossip-vcard-dialog.c --- gossip-20060720-ok/src/gossip-vcard-dialog.c 2006-07-18 19:15:26.000000000 +0200 +++ gossip-20060721-notok/src/gossip-vcard-dialog.c 2006-07-20 13:12:18.000000000 +0200 @@ -24,10 +24,11 @@ #include <gtk/gtk.h> #include <glade/glade.h> #include <glib/gi18n.h> -#include <libgnomeui/gnome-href.h> + +#ifdef HAVE_GNOME #include <libgnomeui/libgnomeui.h> #include <libgnomevfs/gnome-vfs-mime-utils.h> -#include <loudmouth/loudmouth.h> +#endif #include <libgossip/gossip-debug.h> #include <libgossip/gossip-conf.h> @@ -89,7 +90,9 @@ gint last_account_selected; +#ifdef HAVE_GNOME GnomeThumbnailFactory *thumbs; +#endif } GossipVCardDialog; static void vcard_dialog_avatar_chooser_response_cb (GtkWidget *widget, @@ -223,6 +226,7 @@ gtk_widget_show (chooser_dialog); } +#ifdef HAVE_GNOME static GdkPixbuf * vcard_dialog_scale_down_to_width (GdkPixbuf *pixbuf, gint wanted_width) { @@ -245,11 +249,13 @@ return g_object_ref (pixbuf); } +#endif static void vcard_dialog_avatar_update_preview_cb (GtkFileChooser *chooser, GossipVCardDialog *dialog) { +#ifdef HAVE_GNOME gchar *uri; uri = gtk_file_chooser_get_preview_uri (chooser); @@ -261,7 +267,8 @@ gchar *mime_type; if (!dialog->thumbs) { - dialog->thumbs = gnome_thumbnail_factory_new (GNOME_THUMBNAIL_SIZE_NORMAL); + dialog->thumbs = + gnome_thumbnail_factory_new (GNOME_THUMBNAIL_SIZE_NORMAL); } mime_type = gnome_vfs_get_mime_type (uri); @@ -286,6 +293,7 @@ } gtk_file_chooser_set_preview_widget_active (chooser, TRUE); +#endif } static void