1 | /*--------------------------------*-C-*---------------------------------* |
1 | /*--------------------------------*-C-*---------------------------------* |
2 | * File: scrollbar-next.c |
2 | * File: scrollbar-next.C |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * |
4 | * |
5 | * Copyright (c) 1997,1998 mj olesen <olesen@me.QueensU.CA> |
5 | * Copyright (c) 1997,1998 mj olesen <olesen@me.QueensU.CA> |
6 | * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org> |
6 | * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org> |
7 | * - N*XTstep like scrollbars |
7 | * - N*XTstep like scrollbars |
8 | * Copyright (c) 1999-2001 Geoff Wing <gcw@pobox.com> |
8 | * Copyright (c) 1999-2001 Geoff Wing <gcw@pobox.com> |
|
|
9 | * Copyright (c) 2004 Marc Lehmann <pcg@goof.com> |
9 | * |
10 | * |
10 | * This program is free software; you can redistribute it and/or modify |
11 | * This program is free software; you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License as published by |
12 | * it under the terms of the GNU General Public License as published by |
12 | * the Free Software Foundation; either version 2 of the License, or |
13 | * the Free Software Foundation; either version 2 of the License, or |
13 | * (at your option) any later version. |
14 | * (at your option) any later version. |
… | |
… | |
22 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
23 | *----------------------------------------------------------------------*/ |
24 | *----------------------------------------------------------------------*/ |
24 | |
25 | |
25 | #include "../config.h" /* NECESSARY */ |
26 | #include "../config.h" /* NECESSARY */ |
26 | #include "rxvt.h" /* NECESSARY */ |
27 | #include "rxvt.h" /* NECESSARY */ |
27 | #include "scrollbar-next.intpro" /* PROTOS for internal routines */ |
|
|
28 | |
28 | |
29 | /*----------------------------------------------------------------------*/ |
29 | /*----------------------------------------------------------------------*/ |
30 | #if defined(NEXT_SCROLLBAR) |
30 | #if defined(NEXT_SCROLLBAR) |
31 | |
31 | |
32 | #define n_stp_width 8 |
32 | #define n_stp_width 8 |
… | |
… | |
121 | char a; |
121 | char a; |
122 | int x, y; |
122 | int x, y; |
123 | Pixmap d; |
123 | Pixmap d; |
124 | GC pointcolour; |
124 | GC pointcolour; |
125 | |
125 | |
126 | d = XCreatePixmap (display->display, scrollBar.win, width, height, XDEPTH); |
126 | d = XCreatePixmap (display->display, scrollBar.win, width, height, display->depth); |
127 | |
127 | |
128 | for (y = 0; y < height; y++) |
128 | for (y = 0; y < height; y++) |
129 | { |
129 | { |
130 | for (x = 0; x < width; x++) |
130 | for (x = 0; x < width; x++) |
131 | { |
131 | { |
… | |
… | |
151 | Pixmap stipple; |
151 | Pixmap stipple; |
152 | unsigned long light, dark; |
152 | unsigned long light, dark; |
153 | |
153 | |
154 | gcvalue.graphics_exposures = False; |
154 | gcvalue.graphics_exposures = False; |
155 | |
155 | |
156 | gcvalue.foreground = PixColors[Color_Black]; |
156 | gcvalue.foreground = pix_colors[Color_Black]; |
157 | blackGC = XCreateGC (display->display, scrollBar.win, |
157 | blackGC = XCreateGC (display->display, scrollBar.win, |
158 | GCForeground | GCGraphicsExposures, &gcvalue); |
158 | GCForeground | GCGraphicsExposures, &gcvalue); |
159 | |
159 | |
160 | gcvalue.foreground = PixColors[Color_White]; |
160 | gcvalue.foreground = pix_colors[Color_White]; |
161 | whiteGC = XCreateGC (display->display, scrollBar.win, |
161 | whiteGC = XCreateGC (display->display, scrollBar.win, |
162 | GCForeground | GCGraphicsExposures, &gcvalue); |
162 | GCForeground | GCGraphicsExposures, &gcvalue); |
163 | |
163 | |
164 | xcol.red = 0xaeba; |
164 | xcol.red = 0xaeba; |
165 | xcol.green = 0xaaaa; |
165 | xcol.green = 0xaaaa; |
166 | xcol.blue = 0xaeba; |
166 | xcol.blue = 0xaeba; |
167 | //if (!rXAllocColor (&xcol, "light gray"))//TODO//D// |
167 | //if (!rXAllocColor (&xcol, "light gray"))//TODO//D// |
168 | xcol.pixel = PixColors[Color_AntiqueWhite]; |
168 | xcol.pixel = pix_colors[Color_AntiqueWhite]; |
169 | light = gcvalue.foreground = xcol.pixel; |
169 | light = gcvalue.foreground = xcol.pixel; |
170 | grayGC = XCreateGC (display->display, scrollBar.win, |
170 | grayGC = XCreateGC (display->display, scrollBar.win, |
171 | GCForeground | GCGraphicsExposures, &gcvalue); |
171 | GCForeground | GCGraphicsExposures, &gcvalue); |
172 | |
172 | |
173 | xcol.red = 0x51aa; |
173 | xcol.red = 0x51aa; |
174 | xcol.green = 0x5555; |
174 | xcol.green = 0x5555; |
175 | xcol.blue = 0x5144; |
175 | xcol.blue = 0x5144; |
176 | //if (!rXAllocColor (&xcol, "dark gray"))//TODO//D// |
176 | //if (!rXAllocColor (&xcol, "dark gray"))//TODO//D// |
177 | xcol.pixel = PixColors[Color_Grey25]; |
177 | xcol.pixel = pix_colors[Color_Grey25]; |
178 | dark = gcvalue.foreground = xcol.pixel; |
178 | dark = gcvalue.foreground = xcol.pixel; |
179 | darkGC = XCreateGC (display->display, scrollBar.win, |
179 | darkGC = XCreateGC (display->display, scrollBar.win, |
180 | GCForeground | GCGraphicsExposures, &gcvalue); |
180 | GCForeground | GCGraphicsExposures, &gcvalue); |
181 | |
181 | |
182 | stipple = XCreateBitmapFromData (display->display, scrollBar.win, |
182 | stipple = XCreateBitmapFromData (display->display, scrollBar.win, |
… | |
… | |
186 | gcvalue.foreground = dark; |
186 | gcvalue.foreground = dark; |
187 | gcvalue.background = light; |
187 | gcvalue.background = light; |
188 | gcvalue.fill_style = FillOpaqueStippled; |
188 | gcvalue.fill_style = FillOpaqueStippled; |
189 | gcvalue.stipple = stipple; |
189 | gcvalue.stipple = stipple; |
190 | |
190 | |
191 | /* XSetWindowBackground (display->display, scrollBar.win, PixColors[Color_Red]); */ |
191 | /* XSetWindowBackground (display->display, scrollBar.win, pix_colors[Color_Red]); */ |
192 | |
192 | |
193 | stippleGC = XCreateGC (display->display, scrollBar.win, |
193 | stippleGC = XCreateGC (display->display, scrollBar.win, |
194 | GCForeground | GCBackground | GCStipple |
194 | GCForeground | GCBackground | GCStipple |
195 | | GCFillStyle | GCGraphicsExposures, &gcvalue); |
195 | | GCFillStyle | GCGraphicsExposures, &gcvalue); |
196 | |
196 | |