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.342 by root, Mon Dec 15 02:04:02 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 {
1071 const char *name = rs[Rs_color + i]; 1070 if (const char *name = rs[Rs_color + i])
1072
1073 if (!name)
1074 continue;
1075
1076 rxvt_color xcol;
1077
1078 if (!set_color (xcol, name)) 1071 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 }
1124 1072
1125 /* 1073 /*
1126 * get scrollBar shadow colors 1074 * get scrollBar shadow colors
1127 * 1075 *
1128 * The calculations of topShadow/bottomShadow values are adapted 1076 * The calculations of topShadow/bottomShadow values are adapted
1129 * from the fvwm window manager. 1077 * from the fvwm window manager.
1130 */ 1078 */
1131#ifdef RXVT_SCROLLBAR 1079#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]); 1080 pix_colors [Color_scroll].fade (this, 50, pix_colors [Color_bottomShadow]);
1142 1081
1143 rgba cscroll; 1082 rgba cscroll;
1144 pix_colors [Color_scroll].get (cscroll); 1083 pix_colors [Color_scroll].get (cscroll);
1145 1084
1146 /* topShadowColor */ 1085 /* topShadowColor */
1147 if (!pix_colors[Color_topShadow].set (this, 1086 if (!pix_colors[Color_topShadow].set (this,
1148 rgba ( 1087 rgba (
1149 min ((int)rgba::MAX_CC, max (cscroll.r / 5, cscroll.r) * 7 / 5), 1088 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), 1089 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), 1090 min ((int)rgba::MAX_CC, max (cscroll.b / 5, cscroll.b) * 7 / 5),
1152 cscroll.a) 1091 cscroll.a)
1153 )) 1092 ))
1154 alias_color (Color_topShadow, Color_White); 1093 alias_color (Color_topShadow, Color_White);
1155 }
1156#endif 1094#endif
1157 1095
1158#ifdef OFF_FOCUS_FADING 1096#ifdef OFF_FOCUS_FADING
1159 for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) 1097 for (i = 0; i < NRS_COLORS; i++)
1160 update_fade_color (i); 1098 update_fade_color (i, true);
1161#endif 1099#endif
1162} 1100}
1163 1101
1164/*----------------------------------------------------------------------*/ 1102/*----------------------------------------------------------------------*/
1165/* color aliases, fg/bg bright-bold */ 1103/* color aliases, fg/bg bright-bold */
1344 Window top, parent; 1282 Window top, parent;
1345 1283
1346 dLocal (Display *, dpy); 1284 dLocal (Display *, dpy);
1347 1285
1348 /* grab colors before netscape does */ 1286 /* grab colors before netscape does */
1349 get_colours (); 1287 get_colors ();
1350 1288
1351 if (!set_fonts ()) 1289 if (!set_fonts ())
1352 rxvt_fatal ("unable to load base fontset, please specify a valid one using -fn, aborting.\n"); 1290 rxvt_fatal ("unable to load base fontset, please specify a valid one using -fn, aborting.\n");
1353 1291
1354 parent = display->root; 1292 parent = display->root;
1507 if (rs[Rs_fade]) 1445 if (rs[Rs_fade])
1508 pix_colors = pix_colors_unfocused; 1446 pix_colors = pix_colors_unfocused;
1509#endif 1447#endif
1510 1448
1511 pointer_unblank (); 1449 pointer_unblank ();
1512 scr_recolour (); 1450 scr_recolor ();
1513} 1451}
1514 1452
1515/*----------------------------------------------------------------------*/ 1453/*----------------------------------------------------------------------*/
1516/* 1454/*
1517 * Run the command in a subprocess and return a file descriptor for the 1455 * Run the command in a subprocess and return a file descriptor for the

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines