comparison src/conversation.c @ 1244:eaa0e2f5ace4

[gaim-migrate @ 1254] Ignore incoming fonts option committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Tue, 12 Dec 2000 23:09:07 +0000
parents a9cf2f61a7b1
children b5783215b245
comparison
equal deleted inserted replaced
1243:6c05af408b71 1244:eaa0e2f5ace4
1176 int i; 1176 int i;
1177 GdkPixmap *face; 1177 GdkPixmap *face;
1178 /* hopefully we can later use this for bgcolors in smileys */ 1178 /* hopefully we can later use this for bgcolors in smileys */
1179 GdkColor *trans = &window->style->base[GTK_STATE_NORMAL]; 1179 GdkColor *trans = &window->style->base[GTK_STATE_NORMAL];
1180 gboolean in_tag = FALSE; 1180 gboolean in_tag = FALSE;
1181 int gtk_font_options = 0;
1182
1183 if (display_options & OPT_DISP_IGNORE_COLOUR)
1184 gtk_font_options = gtk_font_options ^ HTML_OPTION_NO_COLOURS;
1185
1186 if (display_options & OPT_DISP_IGNORE_FONTS)
1187 gtk_font_options = gtk_font_options ^ HTML_OPTION_NO_FONTS;
1181 1188
1182 for (i = 0; i < strlen(what); i++) 1189 for (i = 0; i < strlen(what); i++)
1183 { 1190 {
1184 if (!in_tag) { 1191 if (!in_tag) {
1185 int len; 1192 int len;
1186 if (what[i] == '<') { 1193 if (what[i] == '<') {
1187 buf2[y] = what[i]; 1194 buf2[y] = what[i];
1188 y++; 1195 y++;
1189 in_tag = TRUE; 1196 in_tag = TRUE;
1190 } else if ((face = is_smiley(window, &what[i], &len, trans)) != NULL) { 1197 } else if ((face = is_smiley(window, &what[i], &len, trans)) != NULL) {
1198
1191 buf2[y] = 0; 1199 buf2[y] = 0;
1192 gtk_html_append_text(GTK_HTML(html), buf2, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0); 1200 gtk_html_append_text(GTK_HTML(html), buf2, gtk_font_options);
1193 gtk_html_add_pixmap(GTK_HTML(html), face, 0, 0); 1201 gtk_html_add_pixmap(GTK_HTML(html), face, 0, 0);
1194 y = 0; 1202 y = 0;
1195 i += len - 1; 1203 i += len - 1;
1196 } else { 1204 } else {
1197 buf2[y] = what[i]; 1205 buf2[y] = what[i];
1206 } 1214 }
1207 1215
1208 if (y) 1216 if (y)
1209 { 1217 {
1210 buf2[y] = 0; 1218 buf2[y] = 0;
1211 gtk_html_append_text(GTK_HTML(html), buf2, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0); 1219 gtk_html_append_text(GTK_HTML(html), buf2, gtk_font_options);
1212 } 1220 }
1213 g_free(buf2); 1221 g_free(buf2);
1214 } 1222 }
1215 1223
1216 /* this is going to be interesting since the conversation could either be a 1224 /* this is going to be interesting since the conversation could either be a
1224 char colour[10]; 1232 char colour[10];
1225 int colorv = -1; 1233 int colorv = -1;
1226 char *clr; 1234 char *clr;
1227 char *smiley = g_malloc(7); 1235 char *smiley = g_malloc(7);
1228 struct buddy *b; 1236 struct buddy *b;
1237 int gtk_font_options = 0;
1238
1239 if (display_options & OPT_DISP_IGNORE_COLOUR)
1240 gtk_font_options = gtk_font_options ^ HTML_OPTION_NO_COLOURS;
1241
1242 if (display_options & OPT_DISP_IGNORE_FONTS)
1243 gtk_font_options = gtk_font_options ^ HTML_OPTION_NO_FONTS;
1244
1229 1245
1230 if (!who) { 1246 if (!who) {
1231 if (flags & WFLAG_SEND) { 1247 if (flags & WFLAG_SEND) {
1232 b = find_buddy(c->gc, c->gc->username); 1248 b = find_buddy(c->gc, c->gc->username);
1233 if (b) 1249 if (b)
1328 1344
1329 gtk_html_freeze(GTK_HTML(c->text)); 1345 gtk_html_freeze(GTK_HTML(c->text));
1330 1346
1331 if (colorv != -1) { 1347 if (colorv != -1) {
1332 sprintf(buf2, "<BODY BGCOLOR=\"#%x\">", colorv); 1348 sprintf(buf2, "<BODY BGCOLOR=\"#%x\">", colorv);
1333 gtk_html_append_text(GTK_HTML(c->text), buf2, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0); 1349 gtk_html_append_text(GTK_HTML(c->text), buf2, gtk_font_options);
1334 } 1350 }
1335 1351
1336 gtk_html_append_text(GTK_HTML(c->text), buf, 0); 1352 gtk_html_append_text(GTK_HTML(c->text), buf, 0);
1337 1353
1338 if (display_options & OPT_DISP_SHOW_SMILEY) 1354 if (display_options & OPT_DISP_SHOW_SMILEY)
1339 { 1355 {
1340 write_html_with_smileys(c->window, c->text, what); 1356 write_html_with_smileys(c->window, c->text, what);
1341 } 1357 }
1342 else 1358 else
1343 { 1359 {
1344 gtk_html_append_text(GTK_HTML(c->text), what, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0); 1360 gtk_html_append_text(GTK_HTML(c->text), what, gtk_font_options);
1345 } 1361 }
1346 1362
1347 if (colorv != -1) { 1363 if (colorv != -1) {
1348 gtk_html_append_text(GTK_HTML(c->text), "</BODY>", (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0); 1364 gtk_html_append_text(GTK_HTML(c->text), "</BODY>", gtk_font_options);
1349 } 1365 }
1350 gtk_html_append_text(GTK_HTML(c->text), "<BR>", (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0); 1366 gtk_html_append_text(GTK_HTML(c->text), "<BR>", gtk_font_options);
1351 1367
1352 1368
1353 if ((general_options & OPT_GEN_LOG_ALL) || find_log_info(c->name)) { 1369 if ((general_options & OPT_GEN_LOG_ALL) || find_log_info(c->name)) {
1354 char *t1, *t2; 1370 char *t1, *t2;
1355 char *nm = g_malloc(256); 1371 char *nm = g_malloc(256);