1 | /*--------------------------------*-C-*---------------------------------* |
1 | /*--------------------------------*-C-*---------------------------------* |
2 | * File: init.c |
2 | * File: init.c |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * $Id: init.C,v 1.20 2004/01/31 00:20:21 pcg Exp $ |
4 | * $Id: init.C,v 1.21 2004/01/31 02:14:58 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> |
… | |
… | |
1000 | * xcol[1] == top shadow |
1000 | * xcol[1] == top shadow |
1001 | * xcol[2] == bot shadow */ |
1001 | * xcol[2] == bot shadow */ |
1002 | |
1002 | |
1003 | xcol[1] = PixColors[Color_scroll]; |
1003 | xcol[1] = PixColors[Color_scroll]; |
1004 | # ifdef PREFER_24BIT |
1004 | # ifdef PREFER_24BIT |
1005 | xcol[0].set (R, 65535, 65535, 65535); |
1005 | xcol[0].set (this, 65535, 65535, 65535); |
1006 | /* XFreeColors(Xdisplay, XCMAP, &(xcol[0].pixel), 1, ~0); */ |
1006 | /* XFreeColors(Xdisplay, XCMAP, &(xcol[0].pixel), 1, ~0); */ |
1007 | # else |
1007 | # else |
1008 | xcol[0].set (WhitePixel(Xdisplay, Xscreen)); |
1008 | xcol[0].set (this, WhitePixel (Xdisplay, Xscreen)); |
1009 | # endif |
1009 | # endif |
1010 | |
1010 | |
1011 | unsigned short pr1, pg1, pb1, pr0, pg0, pb0; |
1011 | unsigned short pr1, pg1, pb1, pr0, pg0, pb0; |
1012 | |
1012 | |
1013 | xcol[0].get (R, pr0, pg0, pb0); |
1013 | xcol[0].get (this, pr0, pg0, pb0); |
1014 | xcol[1].get (R, pr1, pg1, pb1); |
1014 | xcol[1].get (this, pr1, pg1, pb1); |
1015 | |
1015 | |
1016 | /* bottomShadowColor */ |
1016 | /* bottomShadowColor */ |
1017 | if (!xcol[2].set (pr1 / 2, pg1 / 2, pb1 / 2)) |
1017 | if (!xcol[2].set (this, pr1 / 2, pg1 / 2, pb1 / 2)) |
1018 | xcol[2] = PixColors[Color_Black]; |
1018 | xcol[2] = PixColors[Color_Black]; |
1019 | |
1019 | |
1020 | PixColors[Color_bottomShadow] = xcol[2]; |
1020 | PixColors[Color_bottomShadow] = xcol[2]; |
1021 | |
1021 | |
1022 | /* topShadowColor */ |
1022 | /* topShadowColor */ |
|
|
1023 | if (!xcol[1].set (this, |
1023 | if (!xcol[1].set ( min (pr0, max (pr0 / 5, pr1) * 7 / 5), |
1024 | min (pr0, max (pr0 / 5, pr1) * 7 / 5), |
1024 | min (pg0, max (pg0 / 5, pg1) * 7 / 5), |
1025 | min (pg0, max (pg0 / 5, pg1) * 7 / 5), |
1025 | min (pb0, max (pb0 / 5, pb1) * 7 / 5))) |
1026 | min (pb0, max (pb0 / 5, pb1) * 7 / 5))) |
1026 | xcol[1] = PixColors[Color_White]; |
1027 | xcol[1] = PixColors[Color_White]; |
1027 | |
1028 | |
1028 | PixColors[Color_topShadow] = xcol[1]; |
1029 | PixColors[Color_topShadow] = xcol[1]; |