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.339 by sf-exg, Mon Oct 13 17:05:32 2014 UTC vs.
Revision 1.341 by root, Mon Dec 15 00:51:06 2014 UTC

1056 run_command (argv); 1056 run_command (argv);
1057} 1057}
1058 1058
1059/*----------------------------------------------------------------------*/ 1059/*----------------------------------------------------------------------*/
1060void 1060void
1061rxvt_term::get_colours () 1061rxvt_term::get_colors ()
1062{ 1062{
1063 int i; 1063 int i;
1064 1064
1065#ifdef OFF_FOCUS_FADING 1065#ifdef OFF_FOCUS_FADING
1066 pix_colors = pix_colors_focused; 1066 pix_colors = pix_colors_focused;
1067#endif 1067#endif
1068 1068
1069 for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) 1069 for (i = 0; i < NRS_COLORS; i++)
1070 { 1070 {
1071 const char *name = rs[Rs_color + i]; 1071 const char *name = rs[Rs_color + i];
1072 1072
1073 if (!name) 1073 if (!name)
1074 continue; 1074 continue;
1075 1075
1076 rxvt_color xcol;
1077
1078 if (!set_color (xcol, name)) 1076 set_color (pix_colors [i], name);
1079 {
1080#ifndef XTERM_REVERSE_VIDEO
1081 if (i < 2 && option (Opt_reverseVideo))
1082 name = def_colorName [1 - i];
1083 else
1084#endif
1085 name = def_colorName [i];
1086
1087 if (!name)
1088 continue;
1089
1090 if (!set_color (xcol, name))
1091 {
1092 switch (i)
1093 {
1094 case Color_fg:
1095 case Color_bg:
1096 rxvt_warn ("unable to get foreground/background colour, continuing.\n");
1097 name = "";
1098 break;
1099#ifndef NO_CURSORCOLOR
1100 case Color_cursor2:
1101#endif
1102 case Color_pointer_fg:
1103 name = rs[Rs_color + Color_fg];
1104 xcol.set (this, name);
1105 break;
1106 default:
1107 name = rs[Rs_color + Color_bg];
1108 xcol.set (this, name);
1109 break;
1110 }
1111 }
1112 }
1113
1114 pix_colors[i] = xcol;
1115 rs[Rs_color + i] = name;
1116 }
1117
1118 if (depth <= 2)
1119 {
1120 if (!rs[Rs_color + Color_pointer_fg]) alias_color (Color_pointer_fg, Color_fg);
1121 if (!rs[Rs_color + Color_pointer_bg]) alias_color (Color_pointer_bg, Color_bg);
1122 if (!rs[Rs_color + Color_border] ) alias_color (Color_border, Color_fg);
1123 } 1077 }
1124 1078
1125 /* 1079 /*
1126 * get scrollBar shadow colors 1080 * get scrollBar shadow colors
1127 * 1081 *
1128 * The calculations of topShadow/bottomShadow values are adapted 1082 * The calculations of topShadow/bottomShadow values are adapted
1129 * from the fvwm window manager. 1083 * from the fvwm window manager.
1130 */ 1084 */
1131#ifdef RXVT_SCROLLBAR 1085#ifdef RXVT_SCROLLBAR
1132 if (depth <= 2)
1133 {
1134 /* Monochrome */
1135 alias_color (Color_scroll, Color_fg);
1136 alias_color (Color_topShadow, Color_bg);
1137 alias_color (Color_bottomShadow, Color_bg);
1138 }
1139 else
1140 {
1141 pix_colors [Color_scroll].fade (this, 50, pix_colors [Color_bottomShadow]); 1086 pix_colors [Color_scroll].fade (this, 50, pix_colors [Color_bottomShadow]);
1142 1087
1143 rgba cscroll; 1088 rgba cscroll;
1144 pix_colors [Color_scroll].get (cscroll); 1089 pix_colors [Color_scroll].get (cscroll);
1145 1090
1146 /* topShadowColor */ 1091 /* topShadowColor */
1147 if (!pix_colors[Color_topShadow].set (this, 1092 if (!pix_colors[Color_topShadow].set (this,
1148 rgba ( 1093 rgba (
1149 min ((int)rgba::MAX_CC, max (cscroll.r / 5, cscroll.r) * 7 / 5), 1094 min ((int)rgba::MAX_CC, max (cscroll.r / 5, cscroll.r) * 7 / 5),
1150 min ((int)rgba::MAX_CC, max (cscroll.g / 5, cscroll.g) * 7 / 5), 1095 min ((int)rgba::MAX_CC, max (cscroll.g / 5, cscroll.g) * 7 / 5),
1151 min ((int)rgba::MAX_CC, max (cscroll.b / 5, cscroll.b) * 7 / 5), 1096 min ((int)rgba::MAX_CC, max (cscroll.b / 5, cscroll.b) * 7 / 5),
1152 cscroll.a) 1097 cscroll.a)
1153 )) 1098 ))
1154 alias_color (Color_topShadow, Color_White); 1099 alias_color (Color_topShadow, Color_White);
1155 }
1156#endif 1100#endif
1157 1101
1158#ifdef OFF_FOCUS_FADING 1102#ifdef OFF_FOCUS_FADING
1159 for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) 1103 for (i = 0; i < NRS_COLORS; i++)
1160 update_fade_color (i); 1104 update_fade_color (i, true);
1161#endif 1105#endif
1162} 1106}
1163 1107
1164/*----------------------------------------------------------------------*/ 1108/*----------------------------------------------------------------------*/
1165/* color aliases, fg/bg bright-bold */ 1109/* color aliases, fg/bg bright-bold */
1344 Window top, parent; 1288 Window top, parent;
1345 1289
1346 dLocal (Display *, dpy); 1290 dLocal (Display *, dpy);
1347 1291
1348 /* grab colors before netscape does */ 1292 /* grab colors before netscape does */
1349 get_colours (); 1293 get_colors ();
1350 1294
1351 if (!set_fonts ()) 1295 if (!set_fonts ())
1352 rxvt_fatal ("unable to load base fontset, please specify a valid one using -fn, aborting.\n"); 1296 rxvt_fatal ("unable to load base fontset, please specify a valid one using -fn, aborting.\n");
1353 1297
1354 parent = display->root; 1298 parent = display->root;
1507 if (rs[Rs_fade]) 1451 if (rs[Rs_fade])
1508 pix_colors = pix_colors_unfocused; 1452 pix_colors = pix_colors_unfocused;
1509#endif 1453#endif
1510 1454
1511 pointer_unblank (); 1455 pointer_unblank ();
1512 scr_recolour (); 1456 scr_recolor ();
1513} 1457}
1514 1458
1515/*----------------------------------------------------------------------*/ 1459/*----------------------------------------------------------------------*/
1516/* 1460/*
1517 * Run the command in a subprocess and return a file descriptor for the 1461 * Run the command in a subprocess and return a file descriptor for the

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines