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.338 by sf-exg, Mon Oct 6 11:11:19 2014 UTC vs.
Revision 1.342 by root, Mon Dec 15 02:04:02 2014 UTC

612 rxvt_perl.init (this); 612 rxvt_perl.init (this);
613 HOOK_INVOKE ((this, HOOK_INIT, DT_END)); 613 HOOK_INVOKE ((this, HOOK_INIT, DT_END));
614 } 614 }
615#endif 615#endif
616 616
617 // must be called after initialising the perl interpreter as it
618 // may invoke the `on_register_command' hook
617 extract_keysym_resources (); 619 extract_keysym_resources ();
618 620
619 /* 621 /*
620 * set any defaults not already set 622 * set any defaults not already set
621 */ 623 */
1054 run_command (argv); 1056 run_command (argv);
1055} 1057}
1056 1058
1057/*----------------------------------------------------------------------*/ 1059/*----------------------------------------------------------------------*/
1058void 1060void
1059rxvt_term::get_colours () 1061rxvt_term::get_colors ()
1060{ 1062{
1061 int i; 1063 int i;
1062 1064
1063#ifdef OFF_FOCUS_FADING 1065#ifdef OFF_FOCUS_FADING
1064 pix_colors = pix_colors_focused; 1066 pix_colors = pix_colors_focused;
1065#endif 1067#endif
1066 1068
1067 for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) 1069 for (i = 0; i < NRS_COLORS; i++)
1068 {
1069 const char *name = rs[Rs_color + i]; 1070 if (const char *name = rs[Rs_color + i])
1070
1071 if (!name)
1072 continue;
1073
1074 rxvt_color xcol;
1075
1076 if (!set_color (xcol, name)) 1071 set_color (pix_colors [i], name);
1077 {
1078#ifndef XTERM_REVERSE_VIDEO
1079 if (i < 2 && option (Opt_reverseVideo))
1080 name = def_colorName [1 - i];
1081 else
1082#endif
1083 name = def_colorName [i];
1084
1085 if (!name)
1086 continue;
1087
1088 if (!set_color (xcol, name))
1089 {
1090 switch (i)
1091 {
1092 case Color_fg:
1093 case Color_bg:
1094 rxvt_warn ("unable to get foreground/background colour, continuing.\n");
1095 name = "";
1096 break;
1097#ifndef NO_CURSORCOLOR
1098 case Color_cursor2:
1099#endif
1100 case Color_pointer_fg:
1101 name = rs[Rs_color + Color_fg];
1102 xcol.set (this, name);
1103 break;
1104 default:
1105 name = rs[Rs_color + Color_bg];
1106 xcol.set (this, name);
1107 break;
1108 }
1109 }
1110 }
1111
1112 pix_colors[i] = xcol;
1113 rs[Rs_color + i] = name;
1114 }
1115
1116 if (depth <= 2)
1117 {
1118 if (!rs[Rs_color + Color_pointer_fg]) alias_color (Color_pointer_fg, Color_fg);
1119 if (!rs[Rs_color + Color_pointer_bg]) alias_color (Color_pointer_bg, Color_bg);
1120 if (!rs[Rs_color + Color_border] ) alias_color (Color_border, Color_fg);
1121 }
1122 1072
1123 /* 1073 /*
1124 * get scrollBar shadow colors 1074 * get scrollBar shadow colors
1125 * 1075 *
1126 * The calculations of topShadow/bottomShadow values are adapted 1076 * The calculations of topShadow/bottomShadow values are adapted
1127 * from the fvwm window manager. 1077 * from the fvwm window manager.
1128 */ 1078 */
1129#ifdef RXVT_SCROLLBAR 1079#ifdef RXVT_SCROLLBAR
1130 if (depth <= 2)
1131 {
1132 /* Monochrome */
1133 alias_color (Color_scroll, Color_fg);
1134 alias_color (Color_topShadow, Color_bg);
1135 alias_color (Color_bottomShadow, Color_bg);
1136 }
1137 else
1138 {
1139 pix_colors [Color_scroll].fade (this, 50, pix_colors [Color_bottomShadow]); 1080 pix_colors [Color_scroll].fade (this, 50, pix_colors [Color_bottomShadow]);
1140 1081
1141 rgba cscroll; 1082 rgba cscroll;
1142 pix_colors [Color_scroll].get (cscroll); 1083 pix_colors [Color_scroll].get (cscroll);
1143 1084
1144 /* topShadowColor */ 1085 /* topShadowColor */
1145 if (!pix_colors[Color_topShadow].set (this, 1086 if (!pix_colors[Color_topShadow].set (this,
1146 rgba ( 1087 rgba (
1147 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),
1148 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),
1149 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),
1150 cscroll.a) 1091 cscroll.a)
1151 )) 1092 ))
1152 alias_color (Color_topShadow, Color_White); 1093 alias_color (Color_topShadow, Color_White);
1153 }
1154#endif 1094#endif
1155 1095
1156#ifdef OFF_FOCUS_FADING 1096#ifdef OFF_FOCUS_FADING
1157 for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) 1097 for (i = 0; i < NRS_COLORS; i++)
1158 update_fade_color (i); 1098 update_fade_color (i, true);
1159#endif 1099#endif
1160} 1100}
1161 1101
1162/*----------------------------------------------------------------------*/ 1102/*----------------------------------------------------------------------*/
1163/* color aliases, fg/bg bright-bold */ 1103/* color aliases, fg/bg bright-bold */
1342 Window top, parent; 1282 Window top, parent;
1343 1283
1344 dLocal (Display *, dpy); 1284 dLocal (Display *, dpy);
1345 1285
1346 /* grab colors before netscape does */ 1286 /* grab colors before netscape does */
1347 get_colours (); 1287 get_colors ();
1348 1288
1349 if (!set_fonts ()) 1289 if (!set_fonts ())
1350 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");
1351 1291
1352 parent = display->root; 1292 parent = display->root;
1505 if (rs[Rs_fade]) 1445 if (rs[Rs_fade])
1506 pix_colors = pix_colors_unfocused; 1446 pix_colors = pix_colors_unfocused;
1507#endif 1447#endif
1508 1448
1509 pointer_unblank (); 1449 pointer_unblank ();
1510 scr_recolour (); 1450 scr_recolor ();
1511} 1451}
1512 1452
1513/*----------------------------------------------------------------------*/ 1453/*----------------------------------------------------------------------*/
1514/* 1454/*
1515 * 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