Initial git import
[sxemacs] / src / ui / lwlib / xlwgauge.h
1 /* Gauge 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: Gauge.h 1.1 */
20
21 /*
22  * Gauge.h - Gauge widget
23  *
24  * Author: Edward A. Falk
25  *         falk@falconer.vip.best.com
26  *
27  * Date:   July 8, 1997
28  */
29
30 #ifndef _XawGauge_h
31 #define _XawGauge_h
32
33 /***********************************************************************
34  *
35  * Gauge Widget
36  *
37  * The Gauge widget looks something like a thermometer.  Application
38  * defines the values at the ends of the range and the current value
39  * and Gauge draws accordingly.  Gauge does not accept input.
40  *
41  ***********************************************************************/
42
43 #include ATHENA_Label_h_
44
45 /* Resources:
46
47  Name                   Class           RepType         Default Value
48  ----                   -----           -------         -------------
49  value                  Value           Cardinal        0
50  minValue               MinValue        Cardinal        0
51  maxValue               MaxValue        Cardinal        100
52  ntics                  NTics           Cardinal        0       +
53  nlabels                NLabels         Cardinal        0       ++
54  labels                 Labels          String *        NULL    +++
55  orientation            Orientation     XtOrientation   horizontal
56  autoScaleUp            AutoScaleUp     Boolean         FALSE   ++++
57  autoScaleDown          AutoScaleDown   Boolean         FALSE   ++++
58  getValue               Callback        XtCallbackList  NULL    +++++
59  update                 Interval        int             0 (seconds) = disabled
60
61  encoding               Encoding        unsigned char   XawTextEncoding8bit
62  font                   Font            XFontStruct*    XtDefaultFont
63  foreground             Foreground      Pixel           XtDefaultForeground
64  internalHeight         Height          Dimension       2
65  internalWidth          Width           Dimension       4
66  resize                 Resize          Boolean         True
67  background             Background      Pixel           XtDefaultBackground
68  bitmap                 Pixmap          Pixmap          None
69  border                 BorderColor     Pixel           XtDefaultForeground
70  borderWidth            BorderWidth     Dimension       1
71  cursor                 Cursor          Cursor          None
72  cursorName             Cursor          String          NULL
73  destroyCallback        Callback        XtCallbackList  NULL
74  height                 Height          Dimension       varies
75  insensitiveBorder      Insensitive     Pixmap          Gray
76  mappedWhenManaged      MappedWhenManaged Boolean               True
77  pointerColor           Foreground      Pixel           XtDefaultForeground
78  pointerColorBackground Background      Pixel           XtDefaultBackground
79  sensitive              Sensitive       Boolean         True
80  width                  Width           Dimension       text width
81  x                      Position        Position        0
82  y                      Position        Position        0
83
84  +   Ntics sets the number of tic marks next to the gauge.  If 0, no
85      tic marks will be drawn.
86  ++  Nlabels sets the number of labels next to the gauge.
87  +++ Labels is an array of nul-terminated strings to be used as labels.
88      If this field is NULL but nlabels is > 0, then numeric labels will be
89      provided.  NOTE: the labels are not copied to any internal memory; they
90      must be stored in static memory provided by the application.
91  ++++ AutoScale allows the gauge to set its own value limits.  Default is
92       False unless upper & lower limits are both 0.
93
94  +++++ The GetValue() callback proc is called with these arguments:
95         static void
96         myGetValue(gauge, client, rval)
97                 Widget  gauge ;
98                 XtPointer client ;
99                 XtPointer rval ;
100         {
101           *(Cardinal *)rval = value ;
102         }
103
104 */
105
106 /*
107  * Resource names not provided in StringDefs.h
108  */
109
110 #ifndef XtNvalue
111 #define XtNvalue        "value"
112 #define XtCValue        "Value"
113 #endif
114
115 #ifndef XtNorientation
116 #define XtNorientation  "orientation"
117 #define XtCOrientation  "Orientation"
118 #endif
119
120 #define XtNntics        "ntics"
121 #define XtCNTics        "NTics"
122
123 #ifndef XtNnlabels
124 #define XtNnlabels      "nlabels"
125 #define XtCNLabels      "NLabels"
126 #endif
127 #ifndef XtNlabels
128 #define XtNlabels       "labels"
129 #define XtCLabels       "Labels"
130 #endif
131
132 #ifndef XtNminValue
133 #define XtNminValue     "minValue"
134 #define XtCMinValue     "MinValue"
135 #endif
136 #ifndef XtNmaxValue
137 #define XtNmaxValue     "maxValue"
138 #define XtCMaxValue     "MaxValue"
139 #endif
140
141 #ifndef XtNautoScaleUp
142 #define XtNautoScaleUp          "autoScaleUp"
143 #define XtCAutoScaleUp          "AutoScaleUp"
144 #define XtNautoScaleDown        "autoScaleDown"
145 #define XtCAutoScaleDown        "AutoScaleDown"
146 #endif
147
148 #ifndef XtNupdate
149 #define XtNupdate       "update"
150 #endif
151
152 #ifndef XtNgetValue
153 #define XtNgetValue     "getValue"
154 #endif
155
156 /* Class record constants */
157
158 extern WidgetClass gaugeWidgetClass;
159
160 typedef struct _GaugeClassRec *GaugeWidgetClass;
161 typedef struct _GaugeRec *GaugeWidget;
162
163 _XFUNCPROTOBEGIN extern void XawGaugeSetValue(
164 #if NeedFunctionPrototypes
165                                                      Widget gauge,
166                                                      Cardinal value
167 #endif
168     );
169
170 extern Cardinal XawGaugeGetValue(
171 #if NeedFunctionPrototypes
172                                         Widget gauge
173 #endif
174     );
175
176 _XFUNCPROTOEND
177 #endif                          /* _XawGauge_h */