annotate lwlib/xlwgauge.h @ 410:de805c49cfc1 r21-2-35

Import from CVS: tag r21-2-35
author cvs
date Mon, 13 Aug 2007 11:19:21 +0200
parents 74fd4e045ea6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
1 /* Gauge Widget for XEmacs.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
2 Copyright (C) 1999 Edward A. Falk
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
3
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
4 This file is part of XEmacs.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
5
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
9 later version.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
10
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
14 for more details.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
15
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
20
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
21 /* Synched up with: Gauge.h 1.1 */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
22
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
23 /*
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
24 * Gauge.h - Gauge widget
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
25 *
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
26 * Author: Edward A. Falk
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
27 * falk@falconer.vip.best.com
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
28 *
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
29 * Date: July 8, 1997
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
30 */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
31
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
32 #ifndef _XawGauge_h
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
33 #define _XawGauge_h
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
34
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
35 /***********************************************************************
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
36 *
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
37 * Gauge Widget
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
38 *
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
39 * The Gauge widget looks something like a thermometer. Application
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
40 * defines the values at the ends of the range and the current value
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
41 * and Gauge draws accordingly. Gauge does not accept input.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
42 *
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
43 ***********************************************************************/
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
44
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
45 #include ATHENA_Label_h_
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
46
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
47 /* Resources:
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
48
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
49 Name Class RepType Default Value
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
50 ---- ----- ------- -------------
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
51 value Value Cardinal 0
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
52 minValue MinValue Cardinal 0
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
53 maxValue MaxValue Cardinal 100
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
54 ntics NTics Cardinal 0 +
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
55 nlabels NLabels Cardinal 0 ++
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
56 labels Labels String * NULL +++
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
57 orientation Orientation XtOrientation horizontal
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
58 autoScaleUp AutoScaleUp Boolean FALSE ++++
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
59 autoScaleDown AutoScaleDown Boolean FALSE ++++
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
60 getValue Callback XtCallbackList NULL +++++
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
61 update Interval int 0 (seconds) = disabled
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
62
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
63 encoding Encoding unsigned char XawTextEncoding8bit
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
64 font Font XFontStruct* XtDefaultFont
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
65 foreground Foreground Pixel XtDefaultForeground
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
66 internalHeight Height Dimension 2
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
67 internalWidth Width Dimension 4
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
68 resize Resize Boolean True
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
69 background Background Pixel XtDefaultBackground
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
70 bitmap Pixmap Pixmap None
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
71 border BorderColor Pixel XtDefaultForeground
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
72 borderWidth BorderWidth Dimension 1
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
73 cursor Cursor Cursor None
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
74 cursorName Cursor String NULL
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
75 destroyCallback Callback XtCallbackList NULL
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
76 height Height Dimension varies
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
77 insensitiveBorder Insensitive Pixmap Gray
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
78 mappedWhenManaged MappedWhenManaged Boolean True
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
79 pointerColor Foreground Pixel XtDefaultForeground
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
80 pointerColorBackground Background Pixel XtDefaultBackground
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
81 sensitive Sensitive Boolean True
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
82 width Width Dimension text width
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
83 x Position Position 0
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
84 y Position Position 0
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
85
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
86 + Ntics sets the number of tic marks next to the gauge. If 0, no
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
87 tic marks will be drawn.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
88 ++ Nlabels sets the number of labels next to the gauge.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
89 +++ Labels is an array of nul-terminated strings to be used as labels.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
90 If this field is NULL but nlabels is > 0, then numeric labels will be
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
91 provided. NOTE: the labels are not copied to any internal memory; they
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
92 must be stored in static memory provided by the appliction.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
93 ++++ AutoScale allows the gauge to set its own value limits. Default is
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
94 False unless upper & lower limits are both 0.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
95
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
96 +++++ The GetValue() callback proc is called with these arguments:
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
97 static void
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
98 myGetValue(gauge, client, rval)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
99 Widget gauge ;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
100 XtPointer client ;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
101 XtPointer rval ;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
102 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
103 *(Cardinal *)rval = value ;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
104 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
105
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
106 */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
107
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
108 /*
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
109 * Resource names not provided in StringDefs.h
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
110 */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
111
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
112 #ifndef XtNvalue
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
113 #define XtNvalue "value"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
114 #define XtCValue "Value"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
115 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
116
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
117 #ifndef XtNorientation
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
118 #define XtNorientation "orientation"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
119 #define XtCOrientation "Orientation"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
120 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
121
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
122 #define XtNntics "ntics"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
123 #define XtCNTics "NTics"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
124
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
125 #ifndef XtNnlabels
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
126 #define XtNnlabels "nlabels"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
127 #define XtCNLabels "NLabels"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
128 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
129 #ifndef XtNlabels
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
130 #define XtNlabels "labels"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
131 #define XtCLabels "Labels"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
132 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
133
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
134 #ifndef XtNminValue
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
135 #define XtNminValue "minValue"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
136 #define XtCMinValue "MinValue"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
137 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
138 #ifndef XtNmaxValue
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
139 #define XtNmaxValue "maxValue"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
140 #define XtCMaxValue "MaxValue"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
141 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
142
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
143 #ifndef XtNautoScaleUp
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
144 #define XtNautoScaleUp "autoScaleUp"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
145 #define XtCAutoScaleUp "AutoScaleUp"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
146 #define XtNautoScaleDown "autoScaleDown"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
147 #define XtCAutoScaleDown "AutoScaleDown"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
148 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
149
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
150 #ifndef XtNupdate
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
151 #define XtNupdate "update"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
152 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
153
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
154 #ifndef XtNgetValue
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
155 #define XtNgetValue "getValue"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
156 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
157
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
158
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
159 /* Class record constants */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
160
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
161 extern WidgetClass gaugeWidgetClass;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
162
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
163 typedef struct _GaugeClassRec *GaugeWidgetClass;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
164 typedef struct _GaugeRec *GaugeWidget;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
165
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
166
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
167 _XFUNCPROTOBEGIN
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
168
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
169 extern void XawGaugeSetValue(
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
170 #if NeedFunctionPrototypes
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
171 Widget gauge,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
172 Cardinal value
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
173 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
174 );
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
175
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
176 extern Cardinal XawGaugeGetValue(
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
177 #if NeedFunctionPrototypes
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
178 Widget gauge
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
179 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
180 );
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
181
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
182 _XFUNCPROTOEND
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
183
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
184 #endif /* _XawGauge_h */