1 | /*--------------------------------*-C-*---------------------------------* |
1 | /*--------------------------------*-C-*---------------------------------* |
2 | * File: init.c |
2 | * File: init.c |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * $Id: init.C,v 1.10 2003/12/08 23:14:40 pcg Exp $ |
4 | * $Id: init.C,v 1.13 2003/12/18 02:07:12 pcg Exp $ |
5 | * |
5 | * |
6 | * All portions of code are copyright by their respective author/s. |
6 | * All portions of code are copyright by their respective author/s. |
7 | * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk> |
7 | * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk> |
8 | * - original version |
8 | * - original version |
9 | * Copyright (c) 1994 Robert Nation <nation@rocket.sanders.lockheed.com> |
9 | * Copyright (c) 1994 Robert Nation <nation@rocket.sanders.lockheed.com> |
… | |
… | |
357 | PixColors = new rxvt_color [TOTAL_COLORS]; |
357 | PixColors = new rxvt_color [TOTAL_COLORS]; |
358 | if (PixColors == NULL) |
358 | if (PixColors == NULL) |
359 | return false; |
359 | return false; |
360 | |
360 | |
361 | #if defined(XPM_BACKGROUND) || defined(TRANSPARENT) |
361 | #if defined(XPM_BACKGROUND) || defined(TRANSPARENT) |
362 | |
|
|
363 | TermWin.pixmap = None; |
362 | TermWin.pixmap = None; |
364 | #endif |
363 | #endif |
365 | #ifdef UTMP_SUPPORT |
364 | #ifdef UTMP_SUPPORT |
366 | |
|
|
367 | next_utmp_action = SAVE; |
365 | next_utmp_action = SAVE; |
368 | #endif |
366 | #endif |
369 | #ifndef NO_SETOWNER_TTYDEV |
367 | #ifndef NO_SETOWNER_TTYDEV |
370 | |
|
|
371 | next_tty_action = SAVE; |
368 | next_tty_action = SAVE; |
372 | #endif |
369 | #endif |
373 | |
370 | |
374 | MEvent.time = CurrentTime; |
371 | MEvent.time = CurrentTime; |
375 | MEvent.button = AnyButton; |
372 | MEvent.button = AnyButton; |
… | |
… | |
458 | R->ttymode = S_IRUSR | S_IWUSR | S_IWGRP | S_IWOTH; |
455 | R->ttymode = S_IRUSR | S_IWUSR | S_IWGRP | S_IWOTH; |
459 | R->ttygid = getgid (); |
456 | R->ttygid = getgid (); |
460 | } |
457 | } |
461 | |
458 | |
462 | #if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) |
459 | #if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) |
463 | R->locale = setlocale (LC_CTYPE, ""); |
460 | R->locale = strdup (setlocale (LC_CTYPE, "")); |
464 | #endif |
461 | #endif |
465 | |
462 | |
466 | /* |
463 | /* |
467 | * Close all unused file descriptors |
464 | * Close all unused file descriptors |
468 | * We don't want them, we don't need them. |
465 | * We don't want them, we don't need them. |
… | |
… | |
1006 | * xcol[1] == top shadow |
1003 | * xcol[1] == top shadow |
1007 | * xcol[2] == bot shadow */ |
1004 | * xcol[2] == bot shadow */ |
1008 | |
1005 | |
1009 | xcol[1] = R->PixColors[Color_scroll]; |
1006 | xcol[1] = R->PixColors[Color_scroll]; |
1010 | # ifdef PREFER_24BIT |
1007 | # ifdef PREFER_24BIT |
1011 | |
1008 | xcol[0].set (R, 65535, 65535, 65535); |
1012 | xcol[0].set (r, -1, -1, -1); |
|
|
1013 | /* XFreeColors(R->Xdisplay, XCMAP, &(xcol[0].pixel), 1, ~0); */ |
1009 | /* XFreeColors(R->Xdisplay, XCMAP, &(xcol[0].pixel), 1, ~0); */ |
1014 | # else |
1010 | # else |
1015 | |
|
|
1016 | xcol[0].set (WhitePixel(R->Xdisplay, Xscreen)); |
1011 | xcol[0].set (WhitePixel(R->Xdisplay, Xscreen)); |
1017 | # endif |
1012 | # endif |
1018 | |
1013 | |
1019 | unsigned short R1, G1, B1, R0, G0, B0; |
1014 | unsigned short pr1, pg1, pb1, pr0, pg0, pb0; |
1020 | |
1015 | |
1021 | xcol[0].get (r, R0, G0, B0); |
1016 | xcol[0].get (R, pr0, pg0, pb0); |
1022 | xcol[1].get (r, R1, G1, B1); |
1017 | xcol[1].get (R, pr1, pg1, pb1); |
1023 | |
1018 | |
1024 | /* bottomShadowColor */ |
1019 | /* bottomShadowColor */ |
1025 | if (!xcol[2].set (aR_ R1 / 2, G1 / 2, B1 / 2)) |
1020 | if (!xcol[2].set (aR_ pr1 / 2, pg1 / 2, pb1 / 2)) |
1026 | xcol[2] = R->PixColors[Color_Black]; |
1021 | xcol[2] = R->PixColors[Color_Black]; |
1027 | |
1022 | |
1028 | R->PixColors[Color_bottomShadow] = xcol[2]; |
1023 | R->PixColors[Color_bottomShadow] = xcol[2]; |
1029 | |
1024 | |
1030 | /* topShadowColor */ |
1025 | /* topShadowColor */ |
1031 | if (!xcol[1].set (aR_ |
1026 | if (!xcol[1].set (aR_ |
1032 | min (R0, max (R0 / 5, R1) * 7 / 5), |
1027 | min (pr0, max (pr0 / 5, pr1) * 7 / 5), |
1033 | min (G0, max (G0 / 5, G1) * 7 / 5), |
1028 | min (pg0, max (pg0 / 5, pg1) * 7 / 5), |
1034 | min (B0, max (B0 / 5, B1) * 7 / 5))) |
1029 | min (pb0, max (pb0 / 5, pb1) * 7 / 5))) |
1035 | xcol[1] = R->PixColors[Color_White]; |
1030 | xcol[1] = R->PixColors[Color_White]; |
1036 | |
1031 | |
1037 | R->PixColors[Color_topShadow] = xcol[1]; |
1032 | R->PixColors[Color_topShadow] = xcol[1]; |
1038 | } |
1033 | } |
1039 | #endif /* KEEP_SCROLLCOLOR */ |
1034 | #endif /* KEEP_SCROLLCOLOR */ |