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.127 by root, Fri Dec 23 14:46:34 2005 UTC vs.
Revision 1.130 by root, Wed Jan 4 04:42:45 2006 UTC

393 pointerBlankDelay = 2; 393 pointerBlankDelay = 2;
394#endif 394#endif
395 395
396 /* no point having a scrollbar without having any scrollback! */ 396 /* no point having a scrollbar without having any scrollback! */
397 if (!saveLines) 397 if (!saveLines)
398 options &= ~Opt_scrollBar; 398 CLR_OPTION (Opt_scrollBar);
399 399
400#ifdef PRINTPIPE 400#ifdef PRINTPIPE
401 if (!rs[Rs_print_pipe]) 401 if (!rs[Rs_print_pipe])
402 rs[Rs_print_pipe] = PRINTPIPE; 402 rs[Rs_print_pipe] = PRINTPIPE;
403#endif 403#endif
446 setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle], rs[Rs_scrollBar_thickness]); 446 setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle], rs[Rs_scrollBar_thickness]);
447#endif 447#endif
448 448
449#ifdef XTERM_REVERSE_VIDEO 449#ifdef XTERM_REVERSE_VIDEO
450 /* this is how xterm implements reverseVideo */ 450 /* this is how xterm implements reverseVideo */
451 if (options & Opt_reverseVideo) 451 if (OPTION (Opt_reverseVideo))
452 { 452 {
453 if (!rs[Rs_color + Color_fg]) 453 if (!rs[Rs_color + Color_fg])
454 rs[Rs_color + Color_fg] = def_colorName[Color_bg]; 454 rs[Rs_color + Color_fg] = def_colorName[Color_bg];
455 if (!rs[Rs_color + Color_bg]) 455 if (!rs[Rs_color + Color_bg])
456 rs[Rs_color + Color_bg] = def_colorName[Color_fg]; 456 rs[Rs_color + Color_bg] = def_colorName[Color_fg];
461 if (!rs[Rs_color + i]) 461 if (!rs[Rs_color + i])
462 rs[Rs_color + i] = def_colorName[i]; 462 rs[Rs_color + i] = def_colorName[i];
463 463
464#ifndef XTERM_REVERSE_VIDEO 464#ifndef XTERM_REVERSE_VIDEO
465 /* this is how we implement reverseVideo */ 465 /* this is how we implement reverseVideo */
466 if (options & Opt_reverseVideo) 466 if (OPTION (Opt_reverseVideo))
467 ::swap (rs[Rs_color + Color_fg], rs[Rs_color + Color_bg]); 467 ::swap (rs[Rs_color + Color_fg], rs[Rs_color + Color_bg]);
468#endif 468#endif
469 469
470 /* convenient aliases for setting fg/bg to colors */ 470 /* convenient aliases for setting fg/bg to colors */
471 color_aliases (Color_fg); 471 color_aliases (Color_fg);
648 * Initialize the command connection. 648 * Initialize the command connection.
649 * This should be called after the X server connection is established. 649 * This should be called after the X server connection is established.
650 */ 650 */
651 651
652#ifdef META8_OPTION 652#ifdef META8_OPTION
653 meta_char = (options & Opt_meta8 ? 0x80 : C0_ESC); 653 meta_char = OPTION (Opt_meta8) ? 0x80 : C0_ESC;
654#endif 654#endif
655 655
656 get_ourmods (); 656 get_ourmods ();
657 657
658 if (!(options & Opt_scrollTtyOutput)) 658 if (!OPTION (Opt_scrollTtyOutput))
659 priv_modes |= PrivMode_TtyOutputInh; 659 priv_modes |= PrivMode_TtyOutputInh;
660 if (options & Opt_scrollTtyKeypress) 660 if (OPTION (Opt_scrollTtyKeypress))
661 priv_modes |= PrivMode_Keypress; 661 priv_modes |= PrivMode_Keypress;
662 if (!(options & Opt_jumpScroll)) 662 if (!OPTION (Opt_jumpScroll))
663 priv_modes |= PrivMode_smoothScroll; 663 priv_modes |= PrivMode_smoothScroll;
664 664
665#ifndef NO_BACKSPACE_KEY 665#ifndef NO_BACKSPACE_KEY
666 if (strcmp (key_backspace, "DEC") == 0) 666 if (strcmp (key_backspace, "DEC") == 0)
667 priv_modes |= PrivMode_HaveBackSpace; 667 priv_modes |= PrivMode_HaveBackSpace;
677 if (menubar_visible ()) 677 if (menubar_visible ())
678 { 678 {
679 priv_modes |= PrivMode_menuBar; 679 priv_modes |= PrivMode_menuBar;
680 SavedModes |= PrivMode_menuBar; 680 SavedModes |= PrivMode_menuBar;
681 } 681 }
682
683#ifdef CURSOR_BLINK
684 if (options & Opt_cursorBlink)
685 (void)gettimeofday (&lastcursorchange, NULL);
686#endif
687 682
688 run_command (argv); 683 run_command (argv);
689} 684}
690 685
691/*----------------------------------------------------------------------*/ 686/*----------------------------------------------------------------------*/
706 continue; 701 continue;
707 702
708 if (!rXParseAllocColor (&xcol, rs[Rs_color + i])) 703 if (!rXParseAllocColor (&xcol, rs[Rs_color + i]))
709 { 704 {
710#ifndef XTERM_REVERSE_VIDEO 705#ifndef XTERM_REVERSE_VIDEO
711 if (i < 2 && (options & Opt_reverseVideo)) 706 if (i < 2 && OPTION (Opt_reverseVideo))
712 rs[Rs_color + i] = def_colorName[!i]; 707 rs[Rs_color + i] = def_colorName[!i];
713 else 708 else
714#endif 709#endif
715 rs[Rs_color + i] = def_colorName[i]; 710 rs[Rs_color + i] = def_colorName[i];
716 711
939#endif 934#endif
940 935
941 assert (sizeof (xa_names) / sizeof (char *) == NUM_XA); 936 assert (sizeof (xa_names) / sizeof (char *) == NUM_XA);
942 XInternAtoms (disp, (char **)xa_names, NUM_XA, False, xa); 937 XInternAtoms (disp, (char **)xa_names, NUM_XA, False, xa);
943 938
944 if (options & Opt_transparent) 939 if (OPTION (Opt_transparent))
945 { 940 {
946 XGetWindowAttributes (disp, RootWindow (disp, display->screen), &gattr); 941 XGetWindowAttributes (disp, RootWindow (disp, display->screen), &gattr);
947 display->depth = gattr.depth; // doh //TODO, per-term not per-display? 942 display->depth = gattr.depth; // doh //TODO, per-term not per-display?
948 } 943 }
949 944
950#if ENABLE_FRILLS 945#if ENABLE_FRILLS
951 if (options & Opt_borderLess) 946 if (OPTION (Opt_borderLess))
952 { 947 {
953 prop = XInternAtom(disp, "_MOTIF_WM_INFO", True); 948 prop = XInternAtom(disp, "_MOTIF_WM_INFO", True);
954 949
955 if (prop == None) 950 if (prop == None)
956 { 951 {
1026 classHint.res_name = (char *)rs[Rs_name]; 1021 classHint.res_name = (char *)rs[Rs_name];
1027 classHint.res_class = (char *)RESCLASS; 1022 classHint.res_class = (char *)RESCLASS;
1028 1023
1029 wmHint.flags = InputHint | StateHint | WindowGroupHint; 1024 wmHint.flags = InputHint | StateHint | WindowGroupHint;
1030 wmHint.input = True; 1025 wmHint.input = True;
1031 wmHint.initial_state = options & Opt_iconic ? IconicState : NormalState; 1026 wmHint.initial_state = OPTION (Opt_iconic) ? IconicState : NormalState;
1032 wmHint.window_group = top; 1027 wmHint.window_group = top;
1033 1028
1034 XmbSetWMProperties (disp, top, NULL, NULL, (char **)argv, argc, 1029 XmbSetWMProperties (disp, top, NULL, NULL, (char **)argv, argc,
1035 &szHint, &wmHint, &classHint); 1030 &szHint, &wmHint, &classHint);
1036 1031
1079 1074
1080 /* the vt window */ 1075 /* the vt window */
1081 vt = XCreateSimpleWindow (disp, top, 1076 vt = XCreateSimpleWindow (disp, top,
1082 window_vt_x, 1077 window_vt_x,
1083 window_vt_y, 1078 window_vt_y,
1084 TermWin_TotalWidth (), 1079 width,
1085 TermWin_TotalHeight (), 1080 height,
1086 0, 1081 0,
1087 pix_colors_focused[Color_fg], 1082 pix_colors_focused[Color_fg],
1088 pix_colors_focused[Color_bg]); 1083 pix_colors_focused[Color_bg]);
1089#ifdef DEBUG_X 1084#ifdef DEBUG_X
1090 XStoreName (disp, vt, "vt window"); 1085 XStoreName (disp, vt, "vt window");
1094 XChangeWindowAttributes (disp, vt, CWBitGravity, &attributes); 1089 XChangeWindowAttributes (disp, vt, CWBitGravity, &attributes);
1095 1090
1096 vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask; 1091 vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask;
1097 1092
1098#ifdef POINTER_BLANK 1093#ifdef POINTER_BLANK
1099 if (options & Opt_pointerBlank) 1094 if (OPTION (Opt_pointerBlank))
1100 vt_emask |= PointerMotionMask; 1095 vt_emask |= PointerMotionMask;
1101 else 1096 else
1102#endif 1097#endif
1103 vt_emask |= Button1MotionMask | Button3MotionMask; 1098 vt_emask |= Button1MotionMask | Button3MotionMask;
1104 1099
1108#if defined(MENUBAR) && (MENUBAR_MAX > 1) 1103#if defined(MENUBAR) && (MENUBAR_MAX > 1)
1109 if (menuBar_height ()) 1104 if (menuBar_height ())
1110 { 1105 {
1111 menuBar.win = XCreateSimpleWindow (disp, top, 1106 menuBar.win = XCreateSimpleWindow (disp, top,
1112 window_vt_x, 0, 1107 window_vt_x, 0,
1113 TermWin_TotalWidth (), 1108 width,
1114 menuBar_TotalHeight (), 1109 menuBar_TotalHeight (),
1115 0, 1110 0,
1116 pix_colors_focused[Color_fg], 1111 pix_colors_focused[Color_fg],
1117 pix_colors_focused[Color_scroll]); 1112 pix_colors_focused[Color_scroll]);
1118 1113
1131 } 1126 }
1132#endif 1127#endif
1133 1128
1134#ifdef XPM_BACKGROUND 1129#ifdef XPM_BACKGROUND
1135 if (rs[Rs_backgroundPixmap] != NULL 1130 if (rs[Rs_backgroundPixmap] != NULL
1136 && ! (options & Opt_transparent)) 1131 && ! OPTION (Opt_transparent))
1137 { 1132 {
1138 const char *p = rs[Rs_backgroundPixmap]; 1133 const char *p = rs[Rs_backgroundPixmap];
1139 1134
1140 if ((p = strchr (p, ';')) != NULL) 1135 if ((p = strchr (p, ';')) != NULL)
1141 { 1136 {
1526{ 1521{
1527 char *login; 1522 char *login;
1528 1523
1529 SET_TTYMODE (STDIN_FILENO, &tio); /* init terminal attributes */ 1524 SET_TTYMODE (STDIN_FILENO, &tio); /* init terminal attributes */
1530 1525
1531 if (options & Opt_console) 1526 if (OPTION (Opt_console))
1532 { /* be virtual console, fail silently */ 1527 { /* be virtual console, fail silently */
1533#ifdef TIOCCONS 1528#ifdef TIOCCONS
1534 unsigned int on = 1; 1529 unsigned int on = 1;
1535 1530
1536 ioctl (STDIN_FILENO, TIOCCONS, &on); 1531 ioctl (STDIN_FILENO, TIOCCONS, &on);
1586 if ((shell = getenv ("SHELL")) == NULL || *shell == '\0') 1581 if ((shell = getenv ("SHELL")) == NULL || *shell == '\0')
1587 shell = "/bin/sh"; 1582 shell = "/bin/sh";
1588 1583
1589 argv0 = (const char *)rxvt_r_basename (shell); 1584 argv0 = (const char *)rxvt_r_basename (shell);
1590 1585
1591 if (options & Opt_loginShell) 1586 if (OPTION (Opt_loginShell))
1592 { 1587 {
1593 login = (char *)rxvt_malloc ((strlen (argv0) + 2) * sizeof (char)); 1588 login = (char *)rxvt_malloc ((strlen (argv0) + 2) * sizeof (char));
1594 1589
1595 login[0] = '-'; 1590 login[0] = '-';
1596 strcpy (&login[1], argv0); 1591 strcpy (&login[1], argv0);
1631 if ((command = getenv ("SHELL")) == NULL || *command == '\0') 1626 if ((command = getenv ("SHELL")) == NULL || *command == '\0')
1632 command = "/bin/sh"; 1627 command = "/bin/sh";
1633 1628
1634 arg_a[0] = my_basename (command); 1629 arg_a[0] = my_basename (command);
1635 1630
1636 if (options & Opt_loginShell) 1631 if (OPTION (Opt_loginShell))
1637 { 1632 {
1638 login = rxvt_malloc ((strlen (arg_a[0]) + 2) * sizeof (char)); 1633 login = rxvt_malloc ((strlen (arg_a[0]) + 2) * sizeof (char));
1639 1634
1640 login[0] = '-'; 1635 login[0] = '-';
1641 strcpy (&login[1], arg_a[0]); 1636 strcpy (&login[1], arg_a[0]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines