Initial git import
[sxemacs] / src / ui / lwlib / xlwgcs.h
1  /* Tabs Widget for SXEmacs.
2     Copyright (C) 1999 Edward A. Falk
3
4     This file is part of SXEmacs.
5
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.
10
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.
15
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/>. */
18
19  /* Synched up with: Gcs 1.7 */
20
21 #ifndef GCS_H
22 #define GCS_H
23
24 /* Overview of functions provided here:
25  *
26  * AllocFgGC()
27  *      Given a foreground pixel & a font, return an appropriate GC
28  *
29  * AllocBackgroundGC()
30  *      Given a widget, return a GC for painting the background color
31  *
32  * AllocShadeGC()
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.
37  *
38  *      Contrast 0 = background color, 100 = foreground color.  It is legal
39  *      for contrast to be more than 100 or less than 0.
40  *
41  * AllocGreyGC()
42  *      Given widget, foreground, font, contrast & be_nice_to_colormap,
43  *      return a shade GC (see above) based on foreground and widget
44  *      background.
45  *
46  * AllocTopShadowGC()
47  *      Given widget, contrast & be_nice_to_colormap, return a GC suitable
48  *      for rendering the top shadow.
49  *
50  *      Contrast 0 = use background pixel.  Contrast > 0 = use brighter
51  *      colors.
52  *
53  * AllocBotShadowGC()
54  *      Given widget, contrast & be_nice_to_colormap, return a GC suitable
55  *      for rendering the bottom shadow.
56  *
57  *      Contrast 0 = use background pixel.  Contrast > 0 = use darker
58  *      colors.
59  *
60  * AllocArmShadowGC()
61  *      Given widget, contrast & be_nice_to_colormap, return a GC suitable
62  *      for rendering the "armed" shadow.
63  *
64  *      Contrast 0 = use background pixel.  Contrast > 0 = use darker
65  *      colors.
66  *
67  * AllocShadowPixel()
68  *      Given a widget & scale factor, allocate & return a color darker
69  *      or lighter than the background pixel, as determined by scale.
70  *
71  *      Scale 100 = use background pixel.  Scale > 100 = brighter color,
72  *      Scale < 100 = darker color.
73  *
74  * AllocGreyPixel()
75  *      Given two pixel values and scale factor, allocate & return a
76  *      pixel value between them, according to scale.
77  *
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
83  *
84  *
85  * AllocGreyPixelC()
86  *      Given two color values and scale factor, allocate & return a
87  *      pixel value between them, according to scale.
88  *
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
94  *
95  * Draw3dBox()
96  *      Given box dimensions, shadow width, top shadow GC & bottom shadow GC,
97  *      draw a 3-d box.
98  */
99
100 #if     NeedFunctionPrototypes
101
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,
113                       GC topgc, GC botgc);
114
115 #if XtSpecificationRelease < 5
116 extern GC XtAllocateGC(Widget, int depth, unsigned long mask,
117                        XGCValues *,
118                        unsigned long dynamic, unsigned long dontcare);
119 #endif
120
121 #else
122
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();
134
135 #if XtSpecificationRelease < 5
136 extern GC XtAllocateGC();
137 #endif
138
139 #endif
140
141 #endif                          /* GCS_H */