comparison console/libgnt/gntmain.c @ 14626:d1935057d82c

[gaim-migrate @ 17358] The html-dumps should be a little better now. There's no way of knowing the rgb-contents of the default colors (-1), so gnt is going to make an assumption for the colors and use that. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 26 Sep 2006 18:54:12 +0000
parents 62bb53609a36
children 134f4d999ff0
comparison
equal deleted inserted replaced
14625:3e193cf68660 14626:d1935057d82c
472 472
473 CHECK(A_BOLD, "<b>", "</b>"); 473 CHECK(A_BOLD, "<b>", "</b>");
474 CHECK(A_UNDERLINE, "<u>", "</u>"); 474 CHECK(A_UNDERLINE, "<u>", "</u>");
475 CHECK(A_BLINK, "<blink>", "</blink>"); 475 CHECK(A_BLINK, "<blink>", "</blink>");
476 476
477 if ((now & A_COLOR) != (old & A_COLOR)) 477 if ((now & A_COLOR) != (old & A_COLOR) ||
478 (now & A_REVERSE) != (old & A_REVERSE))
478 { 479 {
479 int ret; 480 int ret;
480 short fgp, bgp, r, g, b; 481 short fgp, bgp, r, g, b;
481 struct 482 struct
482 { 483 {
483 int r, g, b; 484 int r, g, b;
484 } fg, bg; 485 } fg, bg;
485 486
486 ret = pair_content(PAIR_NUMBER(now & A_COLOR), &fgp, &bgp); 487 ret = pair_content(PAIR_NUMBER(now & A_COLOR), &fgp, &bgp);
488 if (fgp == -1)
489 fgp = COLOR_BLACK;
490 if (bgp == -1)
491 bgp = COLOR_WHITE;
492 if (now & A_REVERSE)
493 fgp ^= bgp ^= fgp ^= bgp; /* *wink* */
487 ret = color_content(fgp, &r, &g, &b); 494 ret = color_content(fgp, &r, &g, &b);
488 fg.r = r; fg.b = b; fg.g = g; 495 fg.r = r; fg.b = b; fg.g = g;
489 ret = color_content(bgp, &r, &g, &b); 496 ret = color_content(bgp, &r, &g, &b);
490 bg.r = r; bg.b = b; bg.g = g; 497 bg.r = r; bg.b = b; bg.g = g;
491 #define ADJUST(x) (x = x * 255 / 1000) 498 #define ADJUST(x) (x = x * 255 / 1000)