… | |
… | |
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) 2003-2007 Marc Lehmann <pcg@goof.com> |
15 | * Copyright (c) 2003-2008 Marc Lehmann <pcg@goof.com> |
16 | * |
16 | * |
17 | * 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 |
18 | * 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 |
19 | * the Free Software Foundation; either version 2 of the License, or |
19 | * the Free Software Foundation; either version 2 of the License, or |
20 | * (at your option) any later version. |
20 | * (at your option) any later version. |
… | |
… | |
267 | NULL, // Color_underline |
267 | NULL, // Color_underline |
268 | #endif |
268 | #endif |
269 | #ifdef OPTION_HC |
269 | #ifdef OPTION_HC |
270 | NULL, |
270 | NULL, |
271 | #endif |
271 | #endif |
272 | #ifdef KEEP_SCROLLCOLOR |
|
|
273 | COLOR_SCROLLBAR, |
272 | COLOR_SCROLLBAR, |
|
|
273 | #ifdef RXVT_SCROLLBAR |
274 | COLOR_SCROLLTROUGH, |
274 | COLOR_SCROLLTROUGH, |
275 | #endif /* KEEP_SCROLLCOLOR */ |
275 | #endif |
276 | #if ENABLE_TRANSPARENCY |
276 | #if ENABLE_TRANSPARENCY |
277 | NULL, |
277 | NULL, |
278 | #endif |
278 | #endif |
279 | #if OFF_FOCUS_FADING |
279 | #if OFF_FOCUS_FADING |
280 | "rgb:00/00/00", |
280 | "rgb:00/00/00", |
… | |
… | |
308 | set_option (Opt_secondaryScreen); |
308 | set_option (Opt_secondaryScreen); |
309 | set_option (Opt_secondaryScroll); |
309 | set_option (Opt_secondaryScroll); |
310 | set_option (Opt_pastableTabs); |
310 | set_option (Opt_pastableTabs); |
311 | set_option (Opt_intensityStyles); |
311 | set_option (Opt_intensityStyles); |
312 | set_option (Opt_iso14755_52); |
312 | set_option (Opt_iso14755_52); |
|
|
313 | set_option (Opt_buffered); |
313 | } |
314 | } |
314 | |
315 | |
315 | static void |
316 | static void |
316 | init_secondary () |
317 | init_secondary () |
317 | { |
318 | { |
318 | int i; |
319 | int i; |
319 | |
320 | |
320 | /* |
|
|
321 | * Close all unused file descriptors |
|
|
322 | * We don't want them, we don't need them. |
|
|
323 | */ |
|
|
324 | if ((i = open ("/dev/null", O_RDONLY)) < 0) |
321 | if ((i = open ("/dev/null", O_RDONLY)) < 0) |
325 | { |
322 | { |
326 | /* TODO: BOO HISS */ |
|
|
327 | dup2 (STDERR_FILENO, STDIN_FILENO); |
323 | dup2 (STDERR_FILENO, STDIN_FILENO); |
328 | } |
324 | } |
329 | else if (i != STDIN_FILENO) |
325 | else if (i != STDIN_FILENO) |
330 | { |
326 | { |
331 | dup2 (i, STDIN_FILENO); |
327 | dup2 (i, STDIN_FILENO); |
… | |
… | |
489 | # else |
485 | # else |
490 | rs[Rs_delete_key] = "\033[3~"; |
486 | rs[Rs_delete_key] = "\033[3~"; |
491 | # endif |
487 | # endif |
492 | #endif |
488 | #endif |
493 | |
489 | |
494 | #ifdef HAVE_SCROLLBARS |
490 | scrollBar.setup (this); |
495 | setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle], rs[Rs_scrollBar_thickness]); |
|
|
496 | #endif |
|
|
497 | |
491 | |
498 | #ifdef XTERM_REVERSE_VIDEO |
492 | #ifdef XTERM_REVERSE_VIDEO |
499 | /* this is how xterm implements reverseVideo */ |
493 | /* this is how xterm implements reverseVideo */ |
500 | if (option (Opt_reverseVideo)) |
494 | if (option (Opt_reverseVideo)) |
501 | { |
495 | { |
… | |
… | |
557 | |
551 | |
558 | #ifdef KEYSYM_RESOURCE |
552 | #ifdef KEYSYM_RESOURCE |
559 | keyboard->register_done (); |
553 | keyboard->register_done (); |
560 | #endif |
554 | #endif |
561 | |
555 | |
562 | #ifdef HAVE_SCROLLBARS |
|
|
563 | if (option (Opt_scrollBar)) |
556 | if (option (Opt_scrollBar)) |
564 | scrollBar.setIdle (); /* set existence for size calculations */ |
557 | scrollBar.state = STATE_IDLE; /* set existence for size calculations */ |
565 | #endif |
|
|
566 | |
558 | |
567 | pty = ptytty::create (); |
559 | pty = ptytty::create (); |
568 | |
560 | |
569 | create_windows (argc, argv); |
561 | create_windows (argc, argv); |
570 | |
562 | |
… | |
… | |
574 | |
566 | |
575 | #if 0 |
567 | #if 0 |
576 | XSynchronize (dpy, True); |
568 | XSynchronize (dpy, True); |
577 | #endif |
569 | #endif |
578 | |
570 | |
579 | #ifdef HAVE_SCROLLBARS |
|
|
580 | if (option (Opt_scrollBar)) |
571 | if (option (Opt_scrollBar)) |
581 | resize_scrollbar (); /* create and map scrollbar */ |
572 | scrollBar.resize (); /* create and map scrollbar */ |
582 | #endif |
|
|
583 | #ifdef HAVE_BG_PIXMAP |
573 | #ifdef HAVE_BG_PIXMAP |
584 | { |
574 | { |
585 | bgPixmap.set_target (this); |
575 | bgPixmap.set_target (this); |
586 | bgPixmap.invalidate (); |
576 | bgPixmap.invalidate (); |
587 | |
577 | |
… | |
… | |
842 | run_command (argv); |
832 | run_command (argv); |
843 | } |
833 | } |
844 | |
834 | |
845 | /*----------------------------------------------------------------------*/ |
835 | /*----------------------------------------------------------------------*/ |
846 | void |
836 | void |
847 | rxvt_term::Get_Colours () |
837 | rxvt_term::get_colours () |
848 | { |
838 | { |
849 | int i; |
839 | int i; |
850 | |
840 | |
851 | #ifdef OFF_FOCUS_FADING |
841 | #ifdef OFF_FOCUS_FADING |
852 | pix_colors = pix_colors_focused; |
842 | pix_colors = pix_colors_focused; |
… | |
… | |
912 | * get scrollBar shadow colors |
902 | * get scrollBar shadow colors |
913 | * |
903 | * |
914 | * The calculations of topShadow/bottomShadow values are adapted |
904 | * The calculations of topShadow/bottomShadow values are adapted |
915 | * from the fvwm window manager. |
905 | * from the fvwm window manager. |
916 | */ |
906 | */ |
917 | #ifdef KEEP_SCROLLCOLOR |
907 | #ifdef RXVT_SCROLLBAR |
918 | if (depth <= 2) |
908 | if (depth <= 2) |
919 | { |
909 | { |
920 | /* Monochrome */ |
910 | /* Monochrome */ |
921 | alias_color (Color_scroll, Color_fg); |
911 | alias_color (Color_scroll, Color_fg); |
922 | alias_color (Color_topShadow, Color_bg); |
912 | alias_color (Color_topShadow, Color_bg); |
… | |
… | |
937 | min ((int)rgba::MAX_CC, max (cscroll.b / 5, cscroll.b) * 7 / 5), |
927 | min ((int)rgba::MAX_CC, max (cscroll.b / 5, cscroll.b) * 7 / 5), |
938 | cscroll.a) |
928 | cscroll.a) |
939 | )) |
929 | )) |
940 | alias_color (Color_topShadow, Color_White); |
930 | alias_color (Color_topShadow, Color_White); |
941 | } |
931 | } |
942 | #endif /* KEEP_SCROLLCOLOR */ |
932 | #endif |
943 | |
933 | |
944 | #ifdef OFF_FOCUS_FADING |
934 | #ifdef OFF_FOCUS_FADING |
945 | for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) |
935 | for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) |
946 | update_fade_color (i); |
936 | update_fade_color (i); |
947 | #endif |
937 | #endif |
… | |
… | |
1069 | Window top, parent; |
1059 | Window top, parent; |
1070 | |
1060 | |
1071 | dLocal (Display *, dpy); |
1061 | dLocal (Display *, dpy); |
1072 | |
1062 | |
1073 | /* grab colors before netscape does */ |
1063 | /* grab colors before netscape does */ |
1074 | Get_Colours (); |
1064 | get_colours (); |
1075 | |
1065 | |
1076 | if (!set_fonts ()) |
1066 | if (!set_fonts ()) |
1077 | rxvt_fatal ("unable to load base fontset, please specify a valid one using -fn, aborting.\n"); |
1067 | rxvt_fatal ("unable to load base fontset, please specify a valid one using -fn, aborting.\n"); |
1078 | |
1068 | |
1079 | parent = display->root; |
1069 | parent = display->root; |
… | |
… | |
1534 | signal (SIGTSTP, SIG_IGN); |
1524 | signal (SIGTSTP, SIG_IGN); |
1535 | signal (SIGTTIN, SIG_IGN); |
1525 | signal (SIGTTIN, SIG_IGN); |
1536 | signal (SIGTTOU, SIG_IGN); |
1526 | signal (SIGTTOU, SIG_IGN); |
1537 | #endif /* SIGTSTP */ |
1527 | #endif /* SIGTSTP */ |
1538 | |
1528 | |
1539 | // unblock signals (signals are blocked by iom.C |
|
|
1540 | sigset_t ss; |
|
|
1541 | sigemptyset (&ss); |
|
|
1542 | sigprocmask (SIG_SETMASK, &ss, 0); |
|
|
1543 | |
|
|
1544 | /* command interpreter path */ |
1529 | /* command interpreter path */ |
1545 | if (argv) |
1530 | if (argv) |
1546 | { |
1531 | { |
1547 | # ifdef DEBUG_CMD |
1532 | # ifdef DEBUG_CMD |
1548 | int i; |
1533 | int i; |