Mercurial > pidgin
diff src/gtkimhtml.c @ 3382:e9a89676d120
[gaim-migrate @ 3401]
No longer do we build libicq.so -- run make in src/protocols/icq if you
feel you need it for some reason (you don't--use OSCAR)
TOC is no longer compiled statically by default. If you need it for some
reason, you can load the libtoc.so plugin.
Ari Pollak fixed up some #ifdefs to get IM images to work in gtk2, and he
fixed a few gtk font warnings elsewhere.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Wed, 07 Aug 2002 23:25:33 +0000 |
parents | 3cd2fbddf95a |
children | c731327dbc47 |
line wrap: on
line diff
--- a/src/gtkimhtml.c Wed Aug 07 22:37:58 2002 +0000 +++ b/src/gtkimhtml.c Wed Aug 07 23:25:33 2002 +0000 @@ -36,7 +36,7 @@ #include <locale.h> #endif -#if USE_PIXBUF +#if USE_PIXBUF || GTK_CHECK_VERSION(1,3,0) #include <gdk-pixbuf/gdk-pixbuf.h> #include <gdk-pixbuf/gdk-pixbuf-loader.h> #else @@ -274,7 +274,7 @@ gint width,height; GtkIMHtml *imhtml; GtkIMHtmlBit *bit; -#if USE_PIXBUF +#if USE_PIXBUF || GTK_CHECK_VERSION(1,3,0) GdkPixbuf *pb; #endif }; @@ -2673,7 +2673,7 @@ g_free (copy); } else if ((bit->type == TYPE_SMILEY) || (bit->type == TYPE_IMG)) { -#if USE_PIXBUF +#if USE_PIXBUF || GTK_CHECK_VERSION(1,3,0) if (bit->img) { GdkPixbuf *imagepb = bit->img->pb; GdkPixbuf *tmp = NULL; @@ -3405,9 +3405,12 @@ char *tmp, *imagedata, *e; const gchar *alltext; struct im_image *img; -#if USE_PIXBUF +#if USE_PIXBUF || GTK_CHECK_VERSION(1,3,0) GdkPixbufLoader *load; GdkPixbuf *imagepb = NULL; +#if GTK_CHECK_VERSION(1,3,0) + GError *err; +#endif #endif NEW_BIT (NEW_TEXT_BIT); if (!id || !datasize) @@ -3447,16 +3450,22 @@ if (img->len) { img->data = g_malloc(img->len); memcpy(img->data, imagedata, img->len); -#if USE_PIXBUF +#if USE_PIXBUF || GTK_CHECK_VERSION(1,3,0) load = gdk_pixbuf_loader_new(); + +#if GTK_CHECK_VERSION(1,3,0) + if (!gdk_pixbuf_loader_write(load, imagedata, + img->len, &err)) +#else if (!gdk_pixbuf_loader_write(load, imagedata, img->len)) +#endif g_print("IM Image corrupt or unreadable.\n"); else imagepb = gdk_pixbuf_loader_get_pixbuf(load); img->pb = imagepb; #endif } -#if USE_PIXBUF +#if USE_PIXBUF || GTK_CHECK_VERSION(1,3,0) if (imagepb) { bit = g_new0 (GtkIMHtmlBit, 1); bit->type = TYPE_IMG; @@ -3677,7 +3686,7 @@ gdk_pixmap_unref (bit->pm); if (bit->bm) gdk_bitmap_unref (bit->bm); -#if USE_PIXBUF +#if USE_PIXBUF || GTK_CHECK_VERSION(1,3,0) if (bit->img) { g_free(bit->img->filename); g_free(bit->img->data); @@ -3701,7 +3710,7 @@ imhtml->click = g_list_remove (imhtml->click, imhtml->click->data); } -#if USE_PIXBUF +#if USE_PIXBUF || GTK_CHECK_VERSION(1,3,0) while (imhtml->im_images) { imhtml->im_images = g_list_remove(imhtml->im_images, imhtml->im_images->data); } @@ -3733,7 +3742,7 @@ imhtml->scroll_timer = 0; } -#if USE_PIXBUF +#if USE_PIXBUF || GTK_CHECK_VERSION(1,3,0) g_list_free(imhtml->im_images); imhtml->im_images = NULL; #endif