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.226 by ayin, Tue Dec 11 17:42:04 2007 UTC vs.
Revision 1.238 by ayin, Fri Jan 4 17:57:28 2008 UTC

10 * Copyright (c) 1996 Chuck Blake <cblake@BBN.COM> 10 * Copyright (c) 1996 Chuck Blake <cblake@BBN.COM>
11 * Copyright (c) 1997 mj olesen <olesen@me.queensu.ca> 11 * Copyright (c) 1997 mj olesen <olesen@me.queensu.ca>
12 * Copyright (c) 1997,1998 Oezguer Kesim <kesim@math.fu-berlin.de> 12 * Copyright (c) 1997,1998 Oezguer Kesim <kesim@math.fu-berlin.de>
13 * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com> 13 * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com>
14 * - extensive modifications 14 * - extensive modifications
15 * Copyright (c) 1999 D J Hawkey Jr <hawkeyd@visi.com>
16 * - QNX support
17 * Copyright (c) 2003-2006 Marc Lehmann <pcg@goof.com> 15 * Copyright (c) 2003-2007 Marc Lehmann <pcg@goof.com>
18 * 16 *
19 * This program is free software; you can redistribute it and/or modify 17 * This program is free software; you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License as published by 18 * it under the terms of the GNU General Public License as published by
21 * the Free Software Foundation; either version 2 of the License, or 19 * the Free Software Foundation; either version 2 of the License, or
22 * (at your option) any later version. 20 * (at your option) any later version.
280#if OFF_FOCUS_FADING 278#if OFF_FOCUS_FADING
281 "rgb:00/00/00", 279 "rgb:00/00/00",
282#endif 280#endif
283 }; 281 };
284 282
285bool 283void
286rxvt_term::init_vars () 284rxvt_term::init_vars ()
287{ 285{
288 pix_colors = // 286 pix_colors = pix_colors_focused;
289 pix_colors_focused = new rxvt_color [TOTAL_COLORS];
290#ifdef OFF_FOCUS_FADING
291 pix_colors_unfocused = new rxvt_color [TOTAL_COLORS];
292#endif
293
294 287
295 MEvent.time = CurrentTime; 288 MEvent.time = CurrentTime;
296 MEvent.button = AnyButton; 289 MEvent.button = AnyButton;
297 want_refresh = 1; 290 want_refresh = 1;
298 priv_modes = SavedModes = PrivMode_Default; 291 priv_modes = SavedModes = PrivMode_Default;
300 nrow = 24; 293 nrow = 24;
301 int_bwidth = INTERNALBORDERWIDTH; 294 int_bwidth = INTERNALBORDERWIDTH;
302 ext_bwidth = EXTERNALBORDERWIDTH; 295 ext_bwidth = EXTERNALBORDERWIDTH;
303 lineSpace = LINESPACE; 296 lineSpace = LINESPACE;
304 saveLines = SAVELINES; 297 saveLines = SAVELINES;
305 numpix_colors = TOTAL_COLORS;
306 298
307 refresh_type = SLOW_REFRESH; 299 refresh_type = SLOW_REFRESH;
308 300
309 oldcursor.row = oldcursor.col = -1; 301 oldcursor.row = oldcursor.col = -1;
310 last_bot = last_state = -1;
311 302
312 set_option (Opt_scrollBar); 303 set_option (Opt_scrollBar);
313 set_option (Opt_scrollTtyOutput); 304 set_option (Opt_scrollTtyOutput);
314 set_option (Opt_jumpScroll); 305 set_option (Opt_jumpScroll);
315 set_option (Opt_skipScroll); 306 set_option (Opt_skipScroll);
316 set_option (Opt_secondaryScreen); 307 set_option (Opt_secondaryScreen);
317 set_option (Opt_secondaryScroll); 308 set_option (Opt_secondaryScroll);
318 set_option (Opt_pastableTabs); 309 set_option (Opt_pastableTabs);
319 set_option (Opt_intensityStyles); 310 set_option (Opt_intensityStyles);
320 set_option (Opt_iso14755_52); 311 set_option (Opt_iso14755_52);
321
322 return true;
323} 312}
324 313
325void 314void
326rxvt_term::init_secondary () 315rxvt_term::init_secondary ()
327{ 316{
418 if (rs[Rs_depth]) 407 if (rs[Rs_depth])
419 select_visual (strtol (rs[Rs_depth], 0, 0)); 408 select_visual (strtol (rs[Rs_depth], 0, 0));
420#endif 409#endif
421 410
422#ifdef HAVE_AFTERIMAGE 411#ifdef HAVE_AFTERIMAGE
412 set_application_name ((char*)rs[Rs_name]);
413 set_output_threshold (OUTPUT_LEVEL_WARNING);
423 asv = create_asvisual_for_id (dpy, display->screen, depth, XVisualIDFromVisual (visual), cmap, NULL); 414 asv = create_asvisual_for_id (dpy, display->screen, depth, XVisualIDFromVisual (visual), cmap, NULL);
424#endif 415#endif
425 free (r_argv); 416 free (r_argv);
426 417
427 for (int i = NUM_RESOURCES; i--; ) 418 for (int i = NUM_RESOURCES; i--; )
1084 termwin_ev.start (display, top); 1075 termwin_ev.start (display, top);
1085 1076
1086 /* vt cursor: Black-on-White is standard, but this is more popular */ 1077 /* vt cursor: Black-on-White is standard, but this is more popular */
1087 TermWin_cursor = XCreateFontCursor (dpy, XC_xterm); 1078 TermWin_cursor = XCreateFontCursor (dpy, XC_xterm);
1088 1079
1089#ifdef HAVE_SCROLLBARS
1090 /* cursor scrollBar: Black-on-White */
1091 leftptr_cursor = XCreateFontCursor (dpy, XC_left_ptr);
1092#endif
1093
1094 /* the vt window */ 1080 /* the vt window */
1095 vt = XCreateSimpleWindow (dpy, top, 1081 vt = XCreateSimpleWindow (dpy, top,
1096 window_vt_x, window_vt_y, 1082 window_vt_x, window_vt_y,
1097 width, height, 1083 width, height,
1098 0, 1084 0,
1122 GCForeground | GCBackground | GCGraphicsExposures, 1108 GCForeground | GCBackground | GCGraphicsExposures,
1123 &gcvalue); 1109 &gcvalue);
1124 1110
1125 drawable = new rxvt_drawable (this, vt); 1111 drawable = new rxvt_drawable (this, vt);
1126 1112
1127#ifdef RXVT_SCROLLBAR
1128 gcvalue.foreground = pix_colors[Color_topShadow];
1129 topShadowGC = XCreateGC (dpy, vt, GCForeground, &gcvalue);
1130 gcvalue.foreground = pix_colors[Color_bottomShadow];
1131 botShadowGC = XCreateGC (dpy, vt, GCForeground, &gcvalue);
1132 gcvalue.foreground = pix_colors[ (depth <= 2 ? Color_fg : Color_scroll)];
1133 scrollbarGC = XCreateGC (dpy, vt, GCForeground, &gcvalue);
1134#endif
1135
1136#ifdef OFF_FOCUS_FADING 1113#ifdef OFF_FOCUS_FADING
1137 // initially we are in unfocused state 1114 // initially we are in unfocused state
1138 if (rs[Rs_fade]) 1115 if (rs[Rs_fade])
1139 pix_colors = pix_colors_unfocused; 1116 pix_colors = pix_colors_unfocused;
1140#endif 1117#endif
1145 1122
1146/* ------------------------------------------------------------------------- * 1123/* ------------------------------------------------------------------------- *
1147 * GET TTY CURRENT STATE * 1124 * GET TTY CURRENT STATE *
1148 * ------------------------------------------------------------------------- */ 1125 * ------------------------------------------------------------------------- */
1149void 1126void
1150rxvt_get_ttymode (ttymode_t *tio, int erase) 1127rxvt_get_ttymode (struct termios *tio, int erase)
1151{ 1128{
1152 /* 1129 /*
1153 * standard System V termios interface 1130 * standard System V termios interface
1154 */ 1131 */
1155 if (GET_TERMIOS (STDIN_FILENO, tio) < 0) 1132 if (tcgetattr (STDIN_FILENO, tio) < 0)
1156 { 1133 {
1157 // return error - use system defaults, 1134 // return error - use system defaults,
1158 // where possible, and zero elsewhere 1135 // where possible, and zero elsewhere
1159 memset (tio, 0, sizeof (ttymode_t)); 1136 memset (tio, 0, sizeof (struct termios));
1160 1137
1161 tio->c_cc[VINTR] = CINTR; 1138 tio->c_cc[VINTR] = CINTR;
1162 tio->c_cc[VQUIT] = CQUIT; 1139 tio->c_cc[VQUIT] = CQUIT;
1163 tio->c_cc[VERASE] = CERASE; 1140 tio->c_cc[VERASE] = CERASE;
1164#ifdef VERASE2 1141#ifdef VERASE2
1343 else 1320 else
1344#endif 1321#endif
1345 er = -1; 1322 er = -1;
1346 1323
1347 rxvt_get_ttymode (&tio, er); 1324 rxvt_get_ttymode (&tio, er);
1348 SET_TERMIOS (pty->tty, &tio); /* init terminal attributes */ 1325 /* init terminal attributes */
1326 cfsetospeed (&tio, BAUDRATE);
1327 cfsetispeed (&tio, BAUDRATE);
1328 tcsetattr (pty->tty, TCSANOW, &tio);
1349 pty->set_utf8_mode (enc_utf8); 1329 pty->set_utf8_mode (enc_utf8);
1350 1330
1351 /* set initial window size */ 1331 /* set initial window size */
1352 tt_winch (); 1332 tt_winch ();
1353 1333

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines