changeset 2994:60018f862a51

[gaim-migrate @ 3007] Compiles without GdkPixbuf again. Sorry about that :-[ - committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sat, 02 Mar 2002 19:40:54 +0000
parents 7239a392486c
children e27517a5c28e
files ChangeLog NEWS configure.ac doc/gaim.1 pixmaps/broken.xpm src/conversation.c src/gtkimhtml.c src/protocols/oscar/oscar.c
diffstat 8 files changed, 243 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Mar 02 04:52:21 2002 +0000
+++ b/ChangeLog	Sat Mar 02 19:40:54 2002 +0000
@@ -1,5 +1,9 @@
 Gaim: The Pimpin' Penguin IM Clone thats good for the soul! 
 
+version 0.54
+	* Compiles without GdkPixbuf again
+	* GtkIMHtml will refresh when you set a new GTK+ theme
+	
 version 0.53 (02/28/2002):
 	* Updated Polish Translation (thanks Przemyslaw Sulek)
 	* Slovak translation added (Thanks Daniel Rezny)
--- a/NEWS	Sat Mar 02 04:52:21 2002 +0000
+++ b/NEWS	Sat Mar 02 19:40:54 2002 +0000
@@ -1,5 +1,7 @@
 -=[ Gaim ]=-  The Pimpin' Penguin AIM Clone That's Good For The Soul!
 
+0.54
+
 0.53 (02/28/2002):
 	Rob: Well, we missed yesterday's release. That's Okay, I head a
 	nasty headache. You can all just deal. ;-)
--- a/configure.ac	Sat Mar 02 04:52:21 2002 +0000
+++ b/configure.ac	Sat Mar 02 19:40:54 2002 +0000
@@ -1,7 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_INIT(src/aim.c)
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE([gaim], [0.53])
+AM_INIT_AUTOMAKE([gaim], [0.54])
 
 AC_PATH_PROG(sedpath, sed)
 
--- a/doc/gaim.1	Sat Mar 02 04:52:21 2002 +0000
+++ b/doc/gaim.1	Sat Mar 02 19:40:54 2002 +0000
@@ -21,7 +21,7 @@
 .\" USA.
 .TH gaim 1
 .SH NAME
-Gaim v0.53 \- Instant Messaging client
+Gaim v0.54 \- Instant Messaging client
 .SH SYNOPSIS
 .TP 5
 \fBgaim \fI[options]\fR
@@ -367,6 +367,8 @@
 .PP
  Rob Flynn <rob@marko.net> \- AIM: RobFlynn
 .br
+ Sean Egan <bj91704@binghamton.edu> \- AIM: SeanEgn
+.br
  Syd Logan
 
 The retired authors of \fBgaim\fR are:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pixmaps/broken.xpm	Sat Mar 02 19:40:54 2002 +0000
@@ -0,0 +1,169 @@
+/* XPM */
+static char * broken_xpm[] = {
+"24 24 142 2",
+"  	c None",
+". 	c #000000",
+"+ 	c #D3D3D3",
+"@ 	c #F6F6F6",
+"# 	c #FFFFFF",
+"$ 	c #F9F9F9",
+"% 	c #DADADA",
+"& 	c #585858",
+"* 	c #C7C7C7",
+"= 	c #D1D1D1",
+"- 	c #D6D6D6",
+"; 	c #B2B2B2",
+"> 	c #D9D9D9",
+", 	c #D8D8D8",
+"' 	c #DDDDDD",
+") 	c #C0C0C0",
+"! 	c #E1E1E1",
+"~ 	c #F0F0F0",
+"{ 	c #9B9B9B",
+"] 	c #D4D4D4",
+"^ 	c #FEFEFE",
+"/ 	c #FDFDFD",
+"( 	c #FCFCFB",
+"_ 	c #FBFBFB",
+": 	c #AFAFAE",
+"< 	c #E9E9E9",
+"[ 	c #DFDFDF",
+"} 	c #8F8F8F",
+"| 	c #FAFAF9",
+"1 	c #F9F9F8",
+"2 	c #A4A4A3",
+"3 	c #F4F4F4",
+"4 	c #CFCFCF",
+"5 	c #A2A2A2",
+"6 	c #D5D5D5",
+"7 	c #F8F8F7",
+"8 	c #F8F7F6",
+"9 	c #9E9E9E",
+"0 	c #F7F6F5",
+"a 	c #F6F6F4",
+"b 	c #F4F3F2",
+"c 	c #DEDDDC",
+"d 	c #D3D2D0",
+"e 	c #B7B7B5",
+"f 	c #9F9E9D",
+"g 	c #706F6F",
+"h 	c #65625A",
+"i 	c #F5F4F3",
+"j 	c #F2F2F0",
+"k 	c #E4E4E2",
+"l 	c #DAD9D7",
+"m 	c #D8D8D6",
+"n 	c #E3E3E1",
+"o 	c #AFAEAC",
+"p 	c #88847B",
+"q 	c #D3D2D1",
+"r 	c #DF421E",
+"s 	c #F3F3F1",
+"t 	c #EEEDEB",
+"u 	c #EDECEA",
+"v 	c #E9E8E6",
+"w 	c #EEEEED",
+"x 	c #C4C3C2",
+"y 	c #8F8A81",
+"z 	c #F6F5F4",
+"A 	c #D0D0CE",
+"B 	c #ECEBE9",
+"C 	c #EAE9E7",
+"D 	c #E5E4E2",
+"E 	c #D2D1CE",
+"F 	c #8D887E",
+"G 	c #CECDCD",
+"H 	c #F0F0EE",
+"I 	c #EFEFED",
+"J 	c #F1F0EE",
+"K 	c #F0EFED",
+"L 	c #EFEEEC",
+"M 	c #E8E7E5",
+"N 	c #E5E4E1",
+"O 	c #E4E3E0",
+"P 	c #E1DFDC",
+"Q 	c #979288",
+"R 	c #A49E93",
+"S 	c #CBCBC9",
+"T 	c #E7E6E3",
+"U 	c #E3E2DF",
+"V 	c #E2E0DD",
+"W 	c #E0DFDB",
+"X 	c #A19C90",
+"Y 	c #EDEDEB",
+"Z 	c #C9C8C7",
+"` 	c #EBEAE8",
+" .	c #E9E8E5",
+"..	c #E6E4E1",
+"+.	c #E3E2DE",
+"@.	c #DFDEDA",
+"#.	c #DDDCD8",
+"$.	c #A19B90",
+"%.	c #C6C5C3",
+"&.	c #E8E7E4",
+"*.	c #E7E5E2",
+"=.	c #E4E3DF",
+"-.	c #DEDDD9",
+";.	c #DCDBD7",
+">.	c #C3C2C0",
+",.	c #E6E5E2",
+"'.	c #E5E4E0",
+").	c #E2E1DD",
+"!.	c #EDECEB",
+"~.	c #D9D7D3",
+"{.	c #9F998D",
+"].	c #C1C0BD",
+"^.	c #E4E2DF",
+"/.	c #E1E0DC",
+"(.	c #DDDBD7",
+"_.	c #DCDAD6",
+":.	c #D8D6D2",
+"<.	c #9E988D",
+"[.	c #EDEDED",
+"}.	c #E1E0DD",
+"|.	c #D6D4D2",
+"1.	c #EBEBE8",
+"2.	c #EAE8E6",
+"3.	c #E6E5E3",
+"4.	c #F1F1EF",
+"5.	c #D7D5D1",
+"6.	c #9D978B",
+"7.	c #E1DFDB",
+"8.	c #E0DEDA",
+"9.	c #DEDCD8",
+"0.	c #D7D6D1",
+"a.	c #D5D3CE",
+"b.	c #9B958A",
+"c.	c #999891",
+"d.	c #A39E92",
+"e.	c #A39D92",
+"f.	c #A39D91",
+"g.	c #A29C90",
+"h.	c #A19B8F",
+"i.	c #9D978C",
+"j.	c #9B968A",
+"k.	c #676359",
+"                                                ",
+"      . . . . . . . . . . . . .                 ",
+"    . + @ # # # # # # # # $ % & .               ",
+"    . @ # # # # # # # # # # * = - .             ",
+"    . # # ; > > > > , > , ' ) ! ~ { .           ",
+"    . # # ] # # ^ / ( / ( _ : < # [ } .         ",
+"    . # # > ^ / ( _ | _ | 1 2 ~ # 3 4 5 .       ",
+"    . # ^ 6 ( _ | 1 7 1 7 8 9 . . . . . . .     ",
+"    . # ( 6 | 1 7 8 0 8 0 a b c d e f g h .     ",
+"    . # | + 7 8 0 a i a i b j k l m n o p .     ",
+"    . # 7 q 0 a i r r b s r r t u v w x y .     ",
+"    . # z A b b s j r r r r t B C D i E F .     ",
+"    . # b G j H I J K r r L B M N O I P Q .     ",
+"    . # b G j H I J r r r r B M N O I P R .     ",
+"    . # H S I L t r r u u r r T U V L W X .     ",
+"    . # Y Z B B B `  .`  . .N ..+.@.Y #.$..     ",
+"    . # ` %.v M &.&.T &.T *.=.+.W -.u ;.$..     ",
+"    . # T >.,.,.N ..'...'.=.).W -.;.!.~.{..     ",
+"    . $ O ].+.^.=.).+.).+././.-.(._.t :.<..     ",
+"    . [.}.|.1.1.u 1.B 1.B ` ` 2. .3.4.5.6..     ",
+"    . = 7.8.@.-.W -.8.-.8.9.9._._.:.0.a.b..     ",
+"    . c.d.R e.f.e.X g.X g.h.$.{.{.i.i.j.k..     ",
+"      . . . . . . . . . . . . . . . . . .       ",
+"                                                "};
--- a/src/conversation.c	Sat Mar 02 04:52:21 2002 +0000
+++ b/src/conversation.c	Sat Mar 02 19:40:54 2002 +0000
@@ -1212,7 +1212,7 @@
 			*buffer_p++ = '\n';
 		} else if ((*temp_p == '<') && (*(temp_p + 1) == '!')) {
 			*buffer_p++ = '&';
-			*buffer_p++ = 'g';
+			*buffer_p++ = 'l';
 			*buffer_p++ = 't';
 			*buffer_p++ = ';';
 		} else
--- a/src/gtkimhtml.c	Sat Mar 02 04:52:21 2002 +0000
+++ b/src/gtkimhtml.c	Sat Mar 02 19:40:54 2002 +0000
@@ -64,6 +64,7 @@
 #include "pixmaps/tongue.xpm"
 #include "pixmaps/wink.xpm"
 #include "pixmaps/yell.xpm"
+#include "pixmaps/broken.xpm"
 
 #define MAX_FONT_SIZE 7
 
@@ -254,28 +255,26 @@
 	imhtml->smiley_data = gtk_smiley_tree_new ();
 }
 
-#if USE_PIXBUF
 struct im_image {
 	gchar *filename;
 	
 	gint len;
 	gpointer data;
-	GdkPixbuf *pb;
-
+	
 	gint x,y;
 	gint width,height;
 	GtkIMHtml *imhtml;
 	GtkIMHtmlBit *bit;
+#if USE_PIXBUF
+	GdkPixbuf *pb;
+#endif
 };
-#endif
 
 struct _GtkIMHtmlBit {
 	gint type;
 
 	gchar *text;
-#if USE_PIXBUF
 	struct im_image *img;
-#endif
 	GdkPixmap *pm;
 	GdkBitmap *bm;
 
@@ -823,6 +822,24 @@
 		return;
 
 	imhtml = GTK_IMHTML (widget);
+	if (imhtml->default_fg_color)
+		gdk_color_free(imhtml->default_fg_color);
+	if (imhtml->default_bg_color)
+		gdk_color_free(imhtml->default_bg_color);
+	if (imhtml->default_hl_color)
+		gdk_color_free(imhtml->default_hl_color);
+	if (imhtml->default_hlfg_color)
+		gdk_color_free(imhtml->default_hlfg_color);
+	imhtml->default_fg_color = gdk_color_copy (&GTK_WIDGET (imhtml)->style->fg [GTK_STATE_NORMAL]);
+	imhtml->default_bg_color = gdk_color_copy (&GTK_WIDGET (imhtml)->style->base [GTK_STATE_NORMAL]);
+	imhtml->default_hl_color = gdk_color_copy (&GTK_WIDGET (imhtml)->style->bg [GTK_STATE_SELECTED]);
+	imhtml->default_hlfg_color=gdk_color_copy (&GTK_WIDGET (imhtml)->style->fg [GTK_STATE_SELECTED]);
+	if (imhtml->default_font)
+		gdk_font_unref (imhtml->default_font);
+	imhtml->default_font = gdk_font_ref (GTK_IMHTML_GET_STYLE_FONT (widget->style));
+	gdk_window_set_background (widget->window, &widget->style->base [GTK_STATE_NORMAL]);
+	gdk_window_set_background (GTK_LAYOUT (imhtml)->bin_window,
+				   &widget->style->base [GTK_STATE_NORMAL]);
 	gtk_imhtml_draw_exposed (imhtml);
 }
 
@@ -1591,7 +1608,6 @@
 	struct im_image *img;
 };
 
-#if USE_PIXBUF
 static void
 save_img (GtkObject *object,
 	  gpointer data)
@@ -1637,7 +1653,6 @@
 
 
 }
-#endif
 
 
 static void
@@ -2085,22 +2100,22 @@
 				newvals [ENCDNG] = "*";
 			}
 			/* right. */
-			if (bold)
-				if (usebold)
-					newvals [WGHT] = "bold";
-				else
-					newvals [WGHT] = "*";
+			if (usebold && bold)
+				newvals [WGHT] = "bold";
+			else if (!usebold)
+				newvals [WGHT] = "*";
+			
 			if (italics)
 				/* We'll try "i" "o" to get italics and then just use "*" */
 				newvals [SLANT] = italicstrings[italicsind];
-			if (fontsize) {
-				if (usesize) {
-					g_snprintf (fs, sizeof (fs), "%d", POINT_SIZE (fontsize));
-					newvals [PTSZ] = fs;
-				} else 
-					newvals [PTSZ] = "*";
-				newvals [PXLSZ] = "*";
-			}
+			
+			if (usesize && fontsize) {
+				g_snprintf (fs, sizeof (fs), "%d", POINT_SIZE (fontsize));
+				newvals [PTSZ] = fs;
+			} else if (!usesize)
+				newvals [PTSZ] = "*";
+			newvals [PXLSZ] = "*";
+			
 			
 			if (name) {
 				/* we got passed a name. it might be a list of names. */
@@ -2146,14 +2161,12 @@
 			tmp = g_strconcat(garbage, ",*", NULL);
 			ret_font = gdk_fontset_load (tmp); 
 		}
-				
 		/* If the font didn't load, we change some of the xlfds one by one
 		 * to get the closest we can.  */
 		if (!ret_font) {
 			if (!useregenc &&
 			    (!italics || italicsind == 2) && 
-			    (!bold || !usebold) && 
-			    (!fontsize || !usesize)) {
+			    !usebold && !usesize) {
 				useregenc = TRUE;
 				usebold = TRUE;
 				italicsind = 0;
@@ -2165,22 +2178,22 @@
 			}	
 			if (useregenc)
 				useregenc = FALSE;
-			else if (italics && italicsind != 2) {
+			else if (usesize) {
+				useregenc = TRUE;        
+				usesize = FALSE;
+			} else if (italics && italicsind != 2) {
 				useregenc = TRUE;
 				italicsind++;
-			}	else if (bold && usebold) {
+			} else if (usebold) {
 				useregenc = TRUE;
 				usebold = FALSE;
-			}	else if (fontsize && usesize)
-			  useregenc = TRUE;        
-			usesize = FALSE;
+			}
 		}
 		g_strfreev (names);
 		names = NULL;
 		g_free(tmp);
 		tmp=NULL;
 	} while (!ret_font); /* Loop with the new options */
-	
 	return ret_font;
 }
 	
@@ -2269,9 +2282,7 @@
 
 	gtk_imhtml_set_adjustments (imhtml, hadj, vadj);
 
-#if USE_PIXBUF
 	imhtml->im_images = NULL;
-#endif
 
 	imhtml->bits = NULL;
 	imhtml->click = NULL;
@@ -2429,7 +2440,6 @@
 			ls = g_list_next (ls);
 		}
 
-#if USE_PIXBUF		
 		ls = imhtml->im_images;
 		while(ls) {
 			img = ls->data;
@@ -2437,7 +2447,6 @@
 				img->y += diff;
 			ls = g_list_next(ls);
 		}
-#endif
 
 		imhtml->llheight = height;
 		if (ascent)
@@ -2506,11 +2515,8 @@
 	li->ascent = 0;
 	li->bit = bit;
 
-#if USE_PIXBUF
+
 	if (bit->url || bit->img) {
-#else
-	if (bit->url) {
-#endif
 		uw = g_new0 (struct clickable, 1);
 		uw->x = imhtml->x;
 		uw->y = imhtml->y;
@@ -3339,16 +3345,14 @@
 					break;
 				
 				if (!imhtml->img && id && datasize) { /* This is an embedded IM image */
-#if USE_PIXBUF
 					char *tmp, *imagedata, *e;
 					const gchar *alltext;
 					struct im_image *img;
+#if USE_PIXBUF
 					GdkPixbufLoader *load;
 					GdkPixbuf *imagepb = NULL;
-					
 #endif
 					NEW_BIT (NEW_TEXT_BIT);
-#if USE_PIXBUF
 					if (!id || !datasize)
 						break;
 					tmp = g_malloc(strlen("<DATA ID=\"\" SIZE=\"\">") + 
@@ -3384,14 +3388,16 @@
 					if (img->len) {
 						img->data = g_malloc(img->len);
 						memcpy(img->data, imagedata, img->len);
-						
+#if USE_PIXBUF
 						load = gdk_pixbuf_loader_new();
 						if (!gdk_pixbuf_loader_write(load, imagedata, img->len))
 							g_print("IM Image corrupt or unreadable.\n");
 						else 
 							imagepb = gdk_pixbuf_loader_get_pixbuf(load);
 						img->pb = imagepb;
+#endif
 					}
+#if USE_PIXBUF
 					if (imagepb) {
 						bit = g_new0 (GtkIMHtmlBit, 1);
 						bit->type = TYPE_IMG;
@@ -3403,14 +3409,25 @@
 					} else {
 						g_free(img->filename);
 						g_free(img->data);
-						gdk_pixbuf_unref(img->pb);
 					}
+#else
+					bit = g_new0 (GtkIMHtmlBit, 1);
+						bit->type = TYPE_IMG;
+						bit->img = img;
+						if (url)
+							bit->url = g_strdup (url);
+						if (!fonts || ((clr = ((FontDetail *) fonts->data)->back) == NULL))
+							clr = (bg != NULL) ? bg : imhtml->default_bg_color;
+						
+						bit->pm = gdk_pixmap_create_from_xpm_d (GTK_WIDGET (imhtml)->window,
+											&bit->bm, clr, broken_xpm);
+						NEW_BIT (bit);
+#endif
 					g_free(imagedata);
 					g_free(e);
 					g_free(id);
 					g_free(datasize);
 
-#endif
 					break;
 				}
 				
--- a/src/protocols/oscar/oscar.c	Sat Mar 02 04:52:21 2002 +0000
+++ b/src/protocols/oscar/oscar.c	Sat Mar 02 19:40:54 2002 +0000
@@ -3141,7 +3141,8 @@
 	percent = va_arg(ap, double);
 	va_end(ap);
 	
-	dim = find_direct_im(od, sn);
+	if (!(dim = find_direct_im(od, sn)))
+		return 1;
 	gaim_input_remove(dim->watcher);   /* Otherwise, the callback will callback */
 	if ((c = find_conversation(sn)))
 		update_progress(c, percent);