1 /* Tabs Widget for SXEmacs.
2 Copyright (C) 1999 Edward A. Falk
4 This file is part of SXEmacs.
6 SXEmacs is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 SXEmacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 /* Synched up with: Gcs 1.7 */
24 /* Overview of functions provided here:
27 * Given a foreground pixel & a font, return an appropriate GC
30 * Given a widget, return a GC for painting the background color
33 * Given foreground, background, a contrast value & be_nice_to_colormap
34 * flag, return a GC suitable for rendering in an intermediate color,
35 * as determined by contrast. May return a dither pattern or a
36 * solid color, as appropriate.
38 * Contrast 0 = background color, 100 = foreground color. It is legal
39 * for contrast to be more than 100 or less than 0.
42 * Given widget, foreground, font, contrast & be_nice_to_colormap,
43 * return a shade GC (see above) based on foreground and widget
47 * Given widget, contrast & be_nice_to_colormap, return a GC suitable
48 * for rendering the top shadow.
50 * Contrast 0 = use background pixel. Contrast > 0 = use brighter
54 * Given widget, contrast & be_nice_to_colormap, return a GC suitable
55 * for rendering the bottom shadow.
57 * Contrast 0 = use background pixel. Contrast > 0 = use darker
61 * Given widget, contrast & be_nice_to_colormap, return a GC suitable
62 * for rendering the "armed" shadow.
64 * Contrast 0 = use background pixel. Contrast > 0 = use darker
68 * Given a widget & scale factor, allocate & return a color darker
69 * or lighter than the background pixel, as determined by scale.
71 * Scale 100 = use background pixel. Scale > 100 = brighter color,
72 * Scale < 100 = darker color.
75 * Given two pixel values and scale factor, allocate & return a
76 * pixel value between them, according to scale.
78 * Scale == 0: background color
79 * Scale == 100: foreground color
80 * 0<Scale<100: intermediate color
81 * Scale > 100: more foreground
82 * Scale < 0: more background
86 * Given two color values and scale factor, allocate & return a
87 * pixel value between them, according to scale.
89 * Scale == 0: background color
90 * Scale == 100: foreground color
91 * 0<Scale<100: intermediate color
92 * Scale > 100: more foreground
93 * Scale < 0: more background
96 * Given box dimensions, shadow width, top shadow GC & bottom shadow GC,
100 #if NeedFunctionPrototypes
102 extern GC AllocFgGC(Widget w, Pixel fg, Font font);
103 extern GC AllocBackgroundGC(Widget w, Font font);
104 extern GC AllocShadeGC(Widget w, Pixel fg, Pixel bg, Font, int contrast, Bool);
105 extern GC AllocGreyGC(Widget w, Pixel fg, Font, int, Bool);
106 extern GC AllocTopShadowGC(Widget w, int contrast, int);
107 extern GC AllocBotShadowGC(Widget w, int contrast, int);
108 extern GC AllocArmGC(Widget w, int contrast, int);
109 extern Pixel AllocShadowPixel(Widget, int scale);
110 extern Pixel AllocGreyPixel(Widget, Pixel fg, Pixel bg, int scale);
111 extern Pixel AllocGreyPixelC(Widget, XColor * fg, XColor * bg, int scale);
112 extern void Draw3dBox(Widget w, int x, int y, int wid, int hgt, int s,
115 #if XtSpecificationRelease < 5
116 extern GC XtAllocateGC(Widget, int depth, unsigned long mask,
118 unsigned long dynamic, unsigned long dontcare);
123 extern GC AllocFgGC();
124 extern GC AllocBackgroundGC();
125 extern GC AllocShadeGC();
126 extern GC AllocGreyGC();
127 extern GC AllocTopShadowGC();
128 extern GC AllocBotShadowGC();
129 extern GC AllocArmGC();
130 extern Pixel AllocShadowPixel();
131 extern Pixel AllocGreyPixel();
132 extern Pixel AllocGreyPixelC();
133 extern void Draw3dBox();
135 #if XtSpecificationRelease < 5
136 extern GC XtAllocateGC();