ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/init.C
(Generate patch)

Comparing rxvt-unicode/src/init.C (file contents):
Revision 1.160 by root, Mon Jan 30 19:46:13 2006 UTC vs.
Revision 1.165 by root, Tue Jan 31 19:11:43 2006 UTC

299 if (!(display = displays.get (rs[Rs_display_name]))) 299 if (!(display = displays.get (rs[Rs_display_name])))
300 rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); 300 rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]);
301 301
302 xa = display->xa; 302 xa = display->xa;
303 303
304#if ENABLE_FRILLS 304#if XFT
305 if (rs[Rs_depth]) 305 if (rs[Rs_depth])
306 set (display, strtol (rs[Rs_depth], 0, 0)); 306 set (display, strtol (rs[Rs_depth], 0, 0));
307 else 307 else
308#endif 308#endif
309 set (display); 309 set (display);
421 /* this is how xterm implements reverseVideo */ 421 /* this is how xterm implements reverseVideo */
422 if (OPTION (Opt_reverseVideo)) 422 if (OPTION (Opt_reverseVideo))
423 { 423 {
424 if (!rs[Rs_color + Color_fg]) 424 if (!rs[Rs_color + Color_fg])
425 rs[Rs_color + Color_fg] = def_colorName[Color_bg]; 425 rs[Rs_color + Color_fg] = def_colorName[Color_bg];
426
426 if (!rs[Rs_color + Color_bg]) 427 if (!rs[Rs_color + Color_bg])
427 rs[Rs_color + Color_bg] = def_colorName[Color_fg]; 428 rs[Rs_color + Color_bg] = def_colorName[Color_fg];
428 } 429 }
429#endif 430#endif
430 431
655 pix_colors = pix_colors_focused; 656 pix_colors = pix_colors_focused;
656#endif 657#endif
657 658
658 for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) 659 for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++)
659 { 660 {
661 const char *name = rs[Rs_color + i];
662
663 if (!name)
664 continue;
665
660 rxvt_color xcol; 666 rxvt_color xcol;
661 667
662 if (!rs[Rs_color + i])
663 continue;
664
665 if (!set_color (xcol, rs[Rs_color + i])) 668 if (!set_color (xcol, name))
666 { 669 {
667#ifndef XTERM_REVERSE_VIDEO 670#ifndef XTERM_REVERSE_VIDEO
668 if (i < 2 && OPTION (Opt_reverseVideo)) 671 if (i < 2 && OPTION (Opt_reverseVideo))
669 rs[Rs_color + i] = def_colorName[!i]; 672 name = def_colorName [1 - i];
670 else 673 else
671#endif 674#endif
672 rs[Rs_color + i] = def_colorName[i]; 675 name = def_colorName [i];
673 676
674 if (!rs[Rs_color + i]) 677 if (!name)
675 continue; 678 continue;
676 679
677 if (!set_color (xcol, rs[Rs_color + i])) 680 if (!set_color (xcol, name))
678 { 681 {
679 switch (i) 682 switch (i)
680 { 683 {
681 case Color_fg: 684 case Color_fg:
682 case Color_bg: 685 case Color_bg:
683 /* fatal: need bg/fg color */
684 rxvt_warn ("unable to get foreground/background colour, continuing.\n"); 686 rxvt_warn ("unable to get foreground/background colour, continuing.\n");
687 name = "";
685 break; 688 break;
686#ifndef NO_CURSORCOLOR 689#ifndef NO_CURSORCOLOR
687 case Color_cursor2: 690 case Color_cursor2:
688 xcol = pix_colors[Color_fg]; 691#endif
689 break;
690#endif /* ! NO_CURSORCOLOR */
691 case Color_pointer_fg: 692 case Color_pointer_fg:
693 name = rs[Rs_color + Color_fg];
692 xcol = pix_colors[Color_fg]; 694 xcol = pix_colors[Color_fg];
693 break; 695 break;
694 default: 696 default:
697 name = rs[Rs_color + Color_bg];
695 xcol = pix_colors[Color_bg]; /* None */ 698 xcol = pix_colors[Color_bg];
696 break; 699 break;
697 } 700 }
698 } 701 }
699 } 702 }
700 703
701 pix_colors[i] = xcol; 704 pix_colors[i] = xcol;
702 SET_PIXCOLOR (i); 705 rs[Rs_color + i] = name;
703 } 706 }
704 707
705#ifdef OFF_FOCUS_FADING 708#ifdef OFF_FOCUS_FADING
706 if (rs[Rs_fade]) 709 if (rs[Rs_fade])
707 for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) 710 for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++)
711 {
712 rgba c;
713 pix_colors[Color_fade].get (this, c);
708 pix_colors_unfocused[i] = pix_colors_focused[i].fade (this, atoi (rs[Rs_fade]), pix_colors[Color_fade]); 714 pix_colors_focused[i].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused[i],c);
715 }
709#endif 716#endif
710 717
711 if (depth <= 2) 718 if (depth <= 2)
712 { 719 {
713 if (!rs[Rs_color + Color_pointer_fg]) pix_colors[Color_pointer_fg] = pix_colors[Color_fg]; 720 if (!rs[Rs_color + Color_pointer_fg]) pix_colors[Color_pointer_fg] = pix_colors[Color_fg];
736 /* xcol[0] == white 743 /* xcol[0] == white
737 * xcol[1] == top shadow 744 * xcol[1] == top shadow
738 * xcol[2] == bot shadow */ 745 * xcol[2] == bot shadow */
739 746
740 xcol[1] = pix_colors[Color_scroll]; 747 xcol[1] = pix_colors[Color_scroll];
741 xcol[0].set (this, rxvt_rgba (rxvt_rgba::MAX_CC, rxvt_rgba::MAX_CC, rxvt_rgba::MAX_CC)); 748 xcol[0].set (this, rgba (rgba::MAX_CC, rgba::MAX_CC, rgba::MAX_CC));
742 749
743 rxvt_rgba c0, c1; 750 rgba c0, c1;
744 751
745 xcol[0].get (this, c0); 752 xcol[0].get (this, c0);
746 xcol[1].get (this, c1); 753 xcol[1].get (this, c1);
747 754
748 pix_colors[Color_bottomShadow] = xcol[1].fade (this, 50); 755 xcol[1].fade (this, 50, pix_colors[Color_bottomShadow]);
749 756
750 /* topShadowColor */ 757 /* topShadowColor */
751 if (!xcol[1].set (this, 758 if (!xcol[1].set (this,
752 rxvt_rgba ( 759 rgba (
753 min (c0.r, max (c1.r / 5, c1.r) * 7 / 5), 760 min (c0.r, max (c1.r / 5, c1.r) * 7 / 5),
754 min (c0.g, max (c1.g / 5, c1.g) * 7 / 5), 761 min (c0.g, max (c1.g / 5, c1.g) * 7 / 5),
755 min (c0.b, max (c1.b / 5, c1.b) * 7 / 5), 762 min (c0.b, max (c1.b / 5, c1.b) * 7 / 5),
756 c1.a) // pa1 vs. pa0: arbitrary 763 c1.a) // pa1 vs. pa0: arbitrary
757 )); 764 ));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines