comparison src/gtkhtml.c @ 481:64afc8f41bcb

[gaim-migrate @ 491] smileys don't cause dropping of font attributes. gtkhtml handles multiple text much better. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 10 Jul 2000 02:53:14 +0000
parents a4df8f1cc61a
children 56399273ed8d
comparison
equal deleted inserted replaced
480:320c2f9c0315 481:64afc8f41bcb
3096 tag[BUF_LONG], 3096 tag[BUF_LONG],
3097 *c, 3097 *c,
3098 *url = NULL; 3098 *url = NULL;
3099 gint intag = 0, 3099 gint intag = 0,
3100 wpos = 0, 3100 wpos = 0,
3101 tpos = 0, 3101 tpos = 0;
3102 colorv, 3102 static gint colorv,
3103 bold = 0, 3103 bold = 0,
3104 italic = 0, 3104 italic = 0,
3105 fixed = 0, 3105 fixed = 0,
3106 uline = 0, 3106 uline = 0,
3107 strike = 0, 3107 strike = 0,
3108 title = 0; 3108 title = 0,
3109 gint height; 3109 height;
3110 struct font_state *current, 3110 static struct font_state *current = NULL,
3111 *tmp; 3111 *tmp;
3112 struct font_state def_state = { 3, 0, 0, "", NULL, NULL, NULL }; 3112 static struct font_state def_state = { 3, 0, 0, "", NULL, NULL, NULL };
3113 3113
3114 current = &def_state; 3114 if (text == NULL) {
3115 while (current->next)
3116 {
3117 if (current->ownbg)
3118 g_free(current->bgcol);
3119 if (current->owncolor)
3120 g_free(current->color);
3121 tmp = current;
3122 current = current->next;
3123 g_free(tmp);
3124 }
3125 return;
3126 }
3127
3128 if (!current) current = &def_state;
3115 map = gdk_window_get_colormap(html->html_area); 3129 map = gdk_window_get_colormap(html->html_area);
3116 cfont = getfont(current->font, bold, italic, fixed, current->size); 3130 cfont = getfont(current->font, bold, italic, fixed, current->size);
3117 c = text; 3131 c = text;
3118 3132
3119 3133
3475 ws[wpos++] = *c; 3489 ws[wpos++] = *c;
3476 } 3490 }
3477 } 3491 }
3478 c++; 3492 c++;
3479 } 3493 }
3480 while (current->next)
3481 {
3482 if (current->ownbg)
3483 g_free(current->bgcol);
3484 if (current->owncolor)
3485 g_free(current->color);
3486 tmp = current;
3487 current = current->next;
3488 g_free(tmp);
3489 }
3490 ws[wpos] = 0; 3494 ws[wpos] = 0;
3491 tag[tpos] = 0; 3495 tag[tpos] = 0;
3492 if (wpos) 3496 if (wpos)
3493 { 3497 {
3494 gtk_html_add_text(html, cfont, current->color, current->bgcol, ws, 3498 gtk_html_add_text(html, cfont, current->color, current->bgcol, ws,
4186 GdkRectangle area; 4190 GdkRectangle area;
4187 4191
4188 g_return_if_fail(html != NULL); 4192 g_return_if_fail(html != NULL);
4189 g_return_if_fail(GTK_IS_HTML(html)); 4193 g_return_if_fail(GTK_IS_HTML(html));
4190 4194
4195 gtk_html_append_text(html, NULL, 0);
4196
4191 html->frozen--; 4197 html->frozen--;
4192 4198
4193 if (html->frozen < 0) 4199 if (html->frozen < 0)
4194 html->frozen = 0; 4200 html->frozen = 0;
4195 4201