… | |
… | |
281 | }; |
281 | }; |
282 | |
282 | |
283 | void |
283 | void |
284 | rxvt_term::init_vars () |
284 | rxvt_term::init_vars () |
285 | { |
285 | { |
286 | pix_colors = // |
286 | pix_colors = pix_colors_focused; |
287 | pix_colors_focused = new rxvt_color [TOTAL_COLORS]; |
|
|
288 | #ifdef OFF_FOCUS_FADING |
|
|
289 | pix_colors_unfocused = new rxvt_color [TOTAL_COLORS]; |
|
|
290 | #endif |
|
|
291 | |
287 | |
292 | MEvent.time = CurrentTime; |
288 | MEvent.time = CurrentTime; |
293 | MEvent.button = AnyButton; |
289 | MEvent.button = AnyButton; |
294 | want_refresh = 1; |
290 | want_refresh = 1; |
295 | priv_modes = SavedModes = PrivMode_Default; |
291 | priv_modes = SavedModes = PrivMode_Default; |
… | |
… | |
301 | saveLines = SAVELINES; |
297 | saveLines = SAVELINES; |
302 | |
298 | |
303 | refresh_type = SLOW_REFRESH; |
299 | refresh_type = SLOW_REFRESH; |
304 | |
300 | |
305 | oldcursor.row = oldcursor.col = -1; |
301 | oldcursor.row = oldcursor.col = -1; |
306 | last_bot = last_state = -1; |
|
|
307 | |
302 | |
308 | set_option (Opt_scrollBar); |
303 | set_option (Opt_scrollBar); |
309 | set_option (Opt_scrollTtyOutput); |
304 | set_option (Opt_scrollTtyOutput); |
310 | set_option (Opt_jumpScroll); |
305 | set_option (Opt_jumpScroll); |
311 | set_option (Opt_skipScroll); |
306 | set_option (Opt_skipScroll); |
… | |
… | |
1118 | GCForeground | GCBackground | GCGraphicsExposures, |
1113 | GCForeground | GCBackground | GCGraphicsExposures, |
1119 | &gcvalue); |
1114 | &gcvalue); |
1120 | |
1115 | |
1121 | drawable = new rxvt_drawable (this, vt); |
1116 | drawable = new rxvt_drawable (this, vt); |
1122 | |
1117 | |
1123 | #ifdef RXVT_SCROLLBAR |
|
|
1124 | gcvalue.foreground = pix_colors[Color_topShadow]; |
|
|
1125 | topShadowGC = XCreateGC (dpy, vt, GCForeground, &gcvalue); |
|
|
1126 | gcvalue.foreground = pix_colors[Color_bottomShadow]; |
|
|
1127 | botShadowGC = XCreateGC (dpy, vt, GCForeground, &gcvalue); |
|
|
1128 | gcvalue.foreground = pix_colors[ (depth <= 2 ? Color_fg : Color_scroll)]; |
|
|
1129 | scrollbarGC = XCreateGC (dpy, vt, GCForeground, &gcvalue); |
|
|
1130 | #endif |
|
|
1131 | |
|
|
1132 | #ifdef OFF_FOCUS_FADING |
1118 | #ifdef OFF_FOCUS_FADING |
1133 | // initially we are in unfocused state |
1119 | // initially we are in unfocused state |
1134 | if (rs[Rs_fade]) |
1120 | if (rs[Rs_fade]) |
1135 | pix_colors = pix_colors_unfocused; |
1121 | pix_colors = pix_colors_unfocused; |
1136 | #endif |
1122 | #endif |
… | |
… | |
1141 | |
1127 | |
1142 | /* ------------------------------------------------------------------------- * |
1128 | /* ------------------------------------------------------------------------- * |
1143 | * GET TTY CURRENT STATE * |
1129 | * GET TTY CURRENT STATE * |
1144 | * ------------------------------------------------------------------------- */ |
1130 | * ------------------------------------------------------------------------- */ |
1145 | void |
1131 | void |
1146 | rxvt_get_ttymode (ttymode_t *tio, int erase) |
1132 | rxvt_get_ttymode (struct termios *tio, int erase) |
1147 | { |
1133 | { |
1148 | /* |
1134 | /* |
1149 | * standard System V termios interface |
1135 | * standard System V termios interface |
1150 | */ |
1136 | */ |
1151 | if (GET_TERMIOS (STDIN_FILENO, tio) < 0) |
1137 | if (tcgetattr (STDIN_FILENO, tio) < 0) |
1152 | { |
1138 | { |
1153 | // return error - use system defaults, |
1139 | // return error - use system defaults, |
1154 | // where possible, and zero elsewhere |
1140 | // where possible, and zero elsewhere |
1155 | memset (tio, 0, sizeof (ttymode_t)); |
1141 | memset (tio, 0, sizeof (struct termios)); |
1156 | |
1142 | |
1157 | tio->c_cc[VINTR] = CINTR; |
1143 | tio->c_cc[VINTR] = CINTR; |
1158 | tio->c_cc[VQUIT] = CQUIT; |
1144 | tio->c_cc[VQUIT] = CQUIT; |
1159 | tio->c_cc[VERASE] = CERASE; |
1145 | tio->c_cc[VERASE] = CERASE; |
1160 | #ifdef VERASE2 |
1146 | #ifdef VERASE2 |
… | |
… | |
1339 | else |
1325 | else |
1340 | #endif |
1326 | #endif |
1341 | er = -1; |
1327 | er = -1; |
1342 | |
1328 | |
1343 | rxvt_get_ttymode (&tio, er); |
1329 | rxvt_get_ttymode (&tio, er); |
1344 | SET_TERMIOS (pty->tty, &tio); /* init terminal attributes */ |
1330 | /* init terminal attributes */ |
|
|
1331 | cfsetospeed (&tio, BAUDRATE); |
|
|
1332 | cfsetispeed (&tio, BAUDRATE); |
|
|
1333 | tcsetattr (pty->tty, TCSANOW, &tio); |
1345 | pty->set_utf8_mode (enc_utf8); |
1334 | pty->set_utf8_mode (enc_utf8); |
1346 | |
1335 | |
1347 | /* set initial window size */ |
1336 | /* set initial window size */ |
1348 | tt_winch (); |
1337 | tt_winch (); |
1349 | |
1338 | |