Initial git import
[sxemacs] / src / ui / lwlib / xlwtabs.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 it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation, either version 3 of the License, or (at your
9 option) any later version.
10
11 SXEmacs is distributed in the hope that it will be
12 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 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 /*
20  * This widget manages one or more child widgets, exactly one of which is
21  * visible.  Above the child widgets is a graphic that looks like index
22  * tabs from file folders.  Each tab corresponds to one of the child widgets.
23  * By clicking on a tab, the user can bring the corresponding widget to
24  * the top of the stack.
25  */
26
27 #ifndef _Tabs_h
28 #define _Tabs_h
29
30 #include <X11/Constraint.h>
31
32 /***********************************************************************
33  *
34  * Tabs Widget (subclass of CompositeClass)
35  *
36  ***********************************************************************/
37
38 /* Parameters:
39
40  Name                Class              RepType         Default Value
41  ----                -----              -------         -------------
42  font                Font               XFontStruct*    XtDefaultFont
43  internalWidth       Width              Dimension       4       *1
44  internalHeight      Height             Dimension       2       *1
45  topWidget           TopWidget          Widget                  *2
46  highlightWidget HighlightWidget Widget 4
47  callback            Callback           XtCallbackList  NULL    *3
48  popdownCallback     Callback           XtCallbackList  NULL    *4
49  selectInsensitive   SelectInsensitive  Boolean         True    *5
50  beNiceToColormap    BeNiceToColormap   Boolean         False   *6
51  topShadowContrast   TopShadowContrast  int             20
52  bottomShadowContrast BottomShadowContrast int          40
53  insensitiveContrast InsensitiveContrast int            33      *7
54
55  background          Background         Pixel           XtDefaultBackground
56  border              BorderColor        Pixel           XtDefaultForeground
57  borderWidth         BorderWidth        Dimension       1
58  destroyCallback     Callback           Pointer         NULL
59  hSpace              HSpace             Dimension       4
60  height              Height             Dimension       0
61  mappedWhenManaged   MappedWhenManaged  Boolean         True
62  orientation         Orientation        XtOrientation   vertical
63  vSpace              VSpace             Dimension       4
64  width               Width              Dimension       0
65  x                   Position           Position        0
66  y                   Position           Position        0
67
68  Notes:
69
70  1 internalWidth, internalHeight specify the margins around the text
71    in the tabs.
72  2 topWidget identifies the widget which is currently visible.
73  3 callbacks are called whenever the user selects a tab.  Call_data is
74    the new top widget.
75  4 popdownCallbacks are called whenever the user selects a tab.  Call_data is
76    the old (no longer visible) top widget.  Note that popdownCallbacks
77    are called before callbacks.
78  5 SelectInsensitive determines whether or not insensitive children may
79    be selected anyway.
80  6 BeNiceToColormap causes the Tabs widget to use fewer colors.
81  7 InsensitiveContrast sets the contrast used for labels of insensitive widgets.
82
83 */
84
85 /* Constraint parameters:
86  Name                Class              RepType         Default Value
87  ----                -----              -------         -------------
88  tabLabel            Label              String          widget name
89  tabLeftBitmap       LeftBitmap         Pixmap          None
90  tabForeground       Foreground         Pixel           XtDefaultForeground
91  resizable           Resizable          Boolean         False
92 */
93
94 /* New fields */
95
96 #ifndef XtNtabLabel
97 #define XtNtabLabel             "tabLabel"
98 #define XtNtabForeground        "tabForeground"
99 #endif
100
101 #ifndef XtNtabLeftBitmap
102 #define XtNtabLeftBitmap        "tabLeftBitmap"
103 #endif
104
105 #ifndef XtCLeftBitmap
106 #define XtCLeftBitmap   "LeftBitmap"
107 #endif
108
109 #ifndef XtCResizable
110 #define XtCResizable    "Resizable"
111 #endif
112
113 #ifndef XtNselectInsensitive
114 #define XtNselectInsensitive    "selectInsensitive"
115 #define XtCSelectInsensitive    "SelectInsensitive"
116 #endif
117
118 #ifndef XtNnlabels
119 #define XtNnlabels      "nlabels"
120 #define XtCNLabels      "NLabels"
121 #endif
122 #ifndef XtNlabels
123 #define XtNlabels       "labels"
124 #define XtCLabels       "Labels"
125 #endif
126
127 #ifndef XtNtopWidget
128 #define XtNtopWidget    "topWidget"
129 #define XtCTopWidget    "TopWidget"
130 #endif
131
132 #ifndef XtNhighlightWidget
133 #define XtNhighlightWidget "highlightWidget"
134 #define XtCHighlightWidget "HighlightWidget"
135 #endif
136
137 #ifndef XtNhSpace
138 #define XtNhSpace       "hSpace"
139 #define XtCHSpace       "HSpace"
140 #define XtNvSpace       "vSpace"
141 #define XtCVSpace       "VSpace"
142 #endif
143
144 #ifndef XtNresizable
145 #define XtNresizable    "resizable"
146 #endif
147
148 #ifndef XtNinsensitiveContrast
149 #define XtNinsensitiveContrast  "insensitiveContrast"
150 #define XtCInsensitiveContrast  "InsensitiveContrast"
151 #endif
152
153 #ifndef XtNshadowWidth
154 #define XtNshadowWidth "shadowWidth"
155 #define XtCShadowWidth "ShadowWidth"
156 #define XtNtopShadowPixel "topShadowPixel"
157 #define XtCTopShadowPixel "TopShadowPixel"
158 #define XtNbottomShadowPixel "bottomShadowPixel"
159 #define XtCBottomShadowPixel "BottomShadowPixel"
160 #define XtNtopShadowContrast "topShadowContrast"
161 #define XtCTopShadowContrast "TopShadowContrast"
162 #define XtNbottomShadowContrast "bottomShadowContrast"
163 #define XtCBottomShadowContrast "BottomShadowContrast"
164 #endif
165
166 #ifndef XtNtopShadowPixmap
167 #define XtNtopShadowPixmap      "topShadowPixmap"
168 #define XtCTopShadowPixmap      "TopShadowPixmap"
169 #define XtNbottomShadowPixmap   "bottomShadowPixmap"
170 #define XtCBottomShadowPixmap   "BottomShadowPixmap"
171 #endif
172
173 #ifndef XtNbeNiceToColormap
174 #define XtNbeNiceToColormap "beNiceToColormap"
175 #define XtCBeNiceToColormap "BeNiceToColormap"
176 #define XtNbeNiceToColourmap "beNiceToColormap"
177 #define XtCBeNiceToColourmap "BeNiceToColormap"
178 #endif
179
180 /* Class record constants */
181
182 extern WidgetClass tabsWidgetClass;
183
184 typedef struct _TabsClassRec *TabsWidgetClass;
185 typedef struct _TabsRec *TabsWidget;
186
187 _XFUNCPROTOBEGIN extern void XawTabsSetTop(
188 #if NeedFunctionPrototypes
189                                                   Widget w, Bool callCallbacks
190 #endif
191     );
192
193 extern void XawTabsSetHighlight(
194 #if NeedFunctionPrototypes
195                                        Widget tabs, Widget w
196 #endif
197     );
198
199 _XFUNCPROTOEND
200 #endif                          /* _Tabs_h */