~cfuhrman/+junk/netbsd-othersrc-trunk

« back to all changes in this revision

Viewing changes to dist/cdk/include/histogram.h

  • Committer: garbled
  • Date: 2001-01-04 19:59:48 UTC
  • Revision ID: svn-v4:288d5a72-fed7-e111-8680-000c29dcf8fe:trunk:174
Initial import of CDK 4.9.9.  The work to port this was performed by
Charles Hannum, and that is the version being imported:
cdk-4.9.9-20000407-myc3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef CDKHISTOGRAM_H
 
2
#define CDKHISTOGRAM_H  1
 
3
 
 
4
#include <cdk.h>
 
5
 
 
6
/*
 
7
 * Description of the widget:
 
8
 *
 
9
 */
 
10
 
 
11
/*
 
12
 * Copyright 1999, Mike Glover
 
13
 * All rights reserved.
 
14
 *
 
15
 * Redistribution and use in source and binary forms, with or without
 
16
 * modification, are permitted provided that the following conditions
 
17
 * are met:
 
18
 * 1. Redistributions of source code must retain the above copyright
 
19
 *    notice, this list of conditions and the following disclaimer.
 
20
 * 2. Redistributions in binary form must reproduce the above copyright
 
21
 *    notice, this list of conditions and the following disclaimer in the
 
22
 *    documentation and/or other materials provided with the distribution.
 
23
 * 3. All advertising materials mentioning features or use of this software
 
24
 *    must display the following acknowledgment:
 
25
 *      This product includes software developed by Mike Glover
 
26
 *      and contributors.
 
27
 * 4. Neither the name of Mike Glover, nor the names of contributors
 
28
 *    may be used to endorse or promote products derived from this software
 
29
 *    without specific prior written permission.
 
30
 *
 
31
 * THIS SOFTWARE IS PROVIDED BY MIKE GLOVER AND CONTRIBUTORS ``AS IS'' AND
 
32
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
33
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 
34
 * ARE DISCLAIMED.  IN NO EVENT SHALL MIKE GLOVER OR CONTRIBUTORS BE LIABLE
 
35
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 
36
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 
37
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 
38
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 
39
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 
40
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 
41
 * SUCH DAMAGE.
 
42
 */
 
43
 
 
44
/*
 
45
 * Declare the histogram structure.
 
46
 */
 
47
struct SHistogram {
 
48
   CDKOBJS                      obj;
 
49
   WINDOW *                     parent;
 
50
   WINDOW *                     win;
 
51
   chtype *                     title[MAX_LINES];
 
52
   int                          titlePos[MAX_LINES];
 
53
   int                          titleLen[MAX_LINES];
 
54
   int                          titleAdj;
 
55
   int                          titleLines;
 
56
   char *                       curString;
 
57
   char *                       lowString;
 
58
   char *                       highString;
 
59
   chtype                       filler;
 
60
   float                        percent;
 
61
   int                          fieldHeight;
 
62
   int                          fieldWidth;
 
63
   int                          barSize;
 
64
   int                          orient;
 
65
   int                          statsPos;
 
66
   chtype                       statsAttr;
 
67
   EHistogramDisplayType        viewType;
 
68
   int                          high;
 
69
   int                          low;
 
70
   int                          value;
 
71
   int                          lowx;
 
72
   int                          lowy;
 
73
   int                          curx;
 
74
   int                          cury;
 
75
   int                          highx;
 
76
   int                          highy;
 
77
   int                          boxWidth;
 
78
   int                          boxHeight;
 
79
   chtype                       ULChar;
 
80
   chtype                       URChar;
 
81
   chtype                       LLChar;
 
82
   chtype                       LRChar;
 
83
   chtype                       VChar;
 
84
   chtype                       HChar;
 
85
   chtype                       BoxAttrib;
 
86
   boolean                      shadow;
 
87
};
 
88
typedef struct SHistogram CDKHISTOGRAM;
 
89
 
 
90
/*
 
91
 * This returns a new pointer to a histogram pointer.
 
92
 */
 
93
CDKHISTOGRAM *newCDKHistogram (
 
94
                CDKSCREEN *     /* cdkscreen */,
 
95
                int             /* xpos */,
 
96
                int             /* ypos */,
 
97
                int             /* height */,
 
98
                int             /* width */,
 
99
                int             /* orient */,
 
100
                char *          /* title */,
 
101
                boolean         /* Box */,
 
102
                boolean         /* shadow */);
 
103
 
 
104
/*
 
105
 * This was added to make the build simpler. All this will
 
106
 * do is call drawCDKHistogram.
 
107
 */
 
108
void activateCDKHistogram (
 
109
                CDKHISTOGRAM *  /* histogram */,
 
110
                chtype *        /* actions */);
 
111
 
 
112
/*
 
113
 * These set specific attributes of the histogram.
 
114
 */
 
115
void setCDKHistogram (
 
116
                CDKHISTOGRAM *  /* histogram */,
 
117
                EHistogramDisplayType   /* viewtype */,
 
118
                int             /* statsPos */,
 
119
                chtype          /* statsAttr */,
 
120
                int             /* low */,
 
121
                int             /* high */,
 
122
                int             /* value */,
 
123
                chtype          /* filler */,
 
124
                boolean         /* Box */);
 
125
 
 
126
/*
 
127
 * This sets the low/high/current value of the histogram.
 
128
 */
 
129
void setCDKHistogramValue (
 
130
                CDKHISTOGRAM *  /* histogram */,
 
131
                int             /* low */,
 
132
                int             /* high */,
 
133
                int             /* value */);
 
134
 
 
135
int getCDKHistogramValue (
 
136
                CDKHISTOGRAM *  /* histogram */);
 
137
 
 
138
int getCDKHistogramLowValue (
 
139
                CDKHISTOGRAM *  /* histogram */);
 
140
 
 
141
int getCDKHistogramHighValue (
 
142
                CDKHISTOGRAM *  /* histogram */);
 
143
 
 
144
/*
 
145
 * This sets the view type of the histogram.
 
146
 */
 
147
void setCDKHistogramDisplayType (
 
148
                CDKHISTOGRAM *  /* histogram */,
 
149
                EHistogramDisplayType   /* viewtype */);
 
150
 
 
151
EHistogramDisplayType getCDKHistogramViewType (
 
152
                CDKHISTOGRAM *  /* histogram */);
 
153
 
 
154
/*
 
155
 * This returns the filler character used to draw the histogram.
 
156
 */
 
157
void setCDKHistogramFillerChar (
 
158
                CDKHISTOGRAM *  /* histogram */,
 
159
                chtype          /* character */);
 
160
 
 
161
chtype getCDKHistogramFillerChar (
 
162
                CDKHISTOGRAM *  /* histogram */);
 
163
 
 
164
/*
 
165
 * This states where the statistics value is to be located on the histogram.
 
166
 */
 
167
void setCDKHistogramStatsPos (
 
168
                CDKHISTOGRAM *  /* histogram */,
 
169
                int             /* statsPos */);
 
170
 
 
171
int getCDKHistogramStatsPos (
 
172
                CDKHISTOGRAM *  /* histogram */);
 
173
 
 
174
/*
 
175
 * This sets the attribute of the statistics.
 
176
 */
 
177
void setCDKHistogramStatsAttr (
 
178
                CDKHISTOGRAM *  /* histogram */,
 
179
                chtype          /* statsAttr */);
 
180
 
 
181
chtype getCDKHistogramStatsAttr (
 
182
                CDKHISTOGRAM *  /* histogram */);
 
183
 
 
184
/*
 
185
 * This sets the box attribute of the widget.
 
186
 */
 
187
void setCDKHistogramBox (
 
188
                CDKHISTOGRAM *  /* histogram */,
 
189
                boolean         /* Box */);
 
190
 
 
191
boolean getCDKHistogramBox (
 
192
                CDKHISTOGRAM *  /* histogram */);
 
193
 
 
194
/*
 
195
 * These functions set the drawing characters of the widget.
 
196
 */
 
197
void setCDKHistogramULChar (
 
198
                CDKHISTOGRAM *  /* histogram */,
 
199
                chtype          /* character */);
 
200
 
 
201
void setCDKHistogramURChar (
 
202
                CDKHISTOGRAM *  /* histogram */,
 
203
                chtype          /* character */);
 
204
 
 
205
void setCDKHistogramLLChar (
 
206
                CDKHISTOGRAM *  /* histogram */,
 
207
                chtype          /* character */);
 
208
 
 
209
void setCDKHistogramLRChar (
 
210
                CDKHISTOGRAM *  /* histogram */,
 
211
                chtype          /* character */);
 
212
 
 
213
void setCDKHistogramVerticalChar (
 
214
                CDKHISTOGRAM *  /* histogram */,
 
215
                chtype          /* character */);
 
216
 
 
217
void setCDKHistogramHorizontalChar (
 
218
                CDKHISTOGRAM *  /* histogram */,
 
219
                chtype          /* character */);
 
220
 
 
221
void setCDKHistogramBoxAttribute (
 
222
                CDKHISTOGRAM *  /* histogram */,
 
223
                chtype          /* character */);
 
224
 
 
225
/*
 
226
 * This sets the background color of the widget.
 
227
 */
 
228
void setCDKHistogramBackgroundColor (
 
229
                CDKHISTOGRAM *  /* histogram */,
 
230
                char *          /* color */);
 
231
 
 
232
/*
 
233
 * This draws the widget on the screen.
 
234
 */
 
235
#define drawCDKHistogram(obj,Box) drawCDKObject(obj,Box)
 
236
 
 
237
/*
 
238
 * This removes the widget from the screen.
 
239
 */
 
240
#define eraseCDKHistogram(obj) eraseCDKObject(obj)
 
241
 
 
242
/*
 
243
 * This moves the widget to the given location.
 
244
 */
 
245
#define moveCDKHistogram(obj,xpos,ypos,relative,refresh) moveCDKObject(obj,xpos,ypos,relative,refresh)
 
246
 
 
247
/*
 
248
 * This allows the user to interactively position the widget on the screen.
 
249
 */
 
250
#define positionCDKHistogram(widget) positionCDKObject(ObjOf(widget),widget->win)
 
251
 
 
252
/*
 
253
 * This destroys the histogram and all related pointers.
 
254
 */
 
255
void destroyCDKHistogram (
 
256
                CDKHISTOGRAM *  /* histogram */);
 
257
 
 
258
#endif /* CDKHISTOGRAM_H */