1cdk_histogram(3) Library Functions Manual cdk_histogram(3)
2
3
4
6 cdk_histogram - curses histogram widget
7
9 cc [ flag ... ] file ... -lcdk [ library ... ]
10
11 #include <cdk.h>
12
13 void activateCDKHistogram (
14 CDKHISTOGRAM *histogram,
15 chtype unused);
16
17 void destroyCDKHistogram (
18 CDKHISTOGRAM *histogram);
19
20 void drawCDKHistogram (
21 CDKHISTOGRAM *histogram,
22 boolean box);
23
24 void eraseCDKHistogram (
25 CDKHISTOGRAM *histogram);
26
27 boolean getCDKHistogramBox (
28 CDKHISTOGRAM *histogram);
29
30 chtype getCDKHistogramFillerChar (
31 CDKHISTOGRAM *histogram);
32
33 int getCDKHistogramHighValue (
34 CDKHISTOGRAM *histogram);
35
36 int getCDKHistogramLowValue (
37 CDKHISTOGRAM *histogram);
38
39 chtype getCDKHistogramStatsAttr (
40 CDKHISTOGRAM *histogram);
41
42 int getCDKHistogramStatsPos (
43 CDKHISTOGRAM *histogram);
44
45 int getCDKHistogramValue (
46 CDKHISTOGRAM *histogram);
47
48 EHistogramDisplayType getCDKHistogramViewType (
49 CDKHISTOGRAM *histogram);
50
51 void moveCDKHistogram (
52 CDKHISTOGRAM *histogram,
53 int xpos,
54 int ypos,
55 boolean relative,
56 boolean refresh);
57
58 CDKHISTOGRAM *newCDKHistogram (
59 CDKSCREEN *cdkscreen,
60 int xpos,
61 int ypos,
62 int height,
63 int width,
64 int orient,
65 const char *title,
66 boolean box,
67 boolean shadow);
68
69 void positionCDKHistogram (
70 CDKHISTOGRAM *histogram);
71
72 void setCDKHistogram (
73 CDKHISTOGRAM *histogram,
74 EHistogramDisplayType viewType,
75 int statsPos,
76 chtype statsAttribute,
77 int lowValue,
78 int highValue,
79 int currentValue,
80 chtype fillerCharacter,
81 boolean box);
82
83 void setCDKHistogramBackgroundAttrib (
84 CDKHISTOGRAM *histogram,
85 chtype attribute);
86
87 void setCDKHistogramBackgroundColor (
88 CDKHISTOGRAM *histogram,
89 const char * color);
90
91 void setCDKHistogramBox (
92 CDKHISTOGRAM *histogram,
93 boolean box);
94
95 void setCDKHistogramBoxAttribute (
96 CDKHISTOGRAM *histogram,
97 chtype character);
98
99 void setCDKHistogramDisplayType (
100 CDKHISTOGRAM *histogram,
101 EHistogramDisplayType viewtype);
102
103 void setCDKHistogramFillerChar (
104 CDKHISTOGRAM *histogram,
105 chtype fillerCharacter);
106
107 void setCDKHistogramHorizontalChar (
108 CDKHISTOGRAM *histogram,
109 chtype character);
110
111 void setCDKHistogramLLChar (
112 CDKHISTOGRAM *histogram,
113 chtype character);
114
115 void setCDKHistogramLRChar (
116 CDKHISTOGRAM *histogram,
117 chtype character);
118
119 void setCDKHistogramStatsAttr (
120 CDKHISTOGRAM *histogram,
121 chtype statsAttribute);
122
123 void setCDKHistogramStatsPos (
124 CDKHISTOGRAM *histogram,
125 int statsPosition);
126
127 void setCDKHistogramULChar (
128 CDKHISTOGRAM *histogram,
129 chtype character);
130
131 void setCDKHistogramURChar (
132 CDKHISTOGRAM *histogram,
133 chtype character);
134
135 void setCDKHistogramValue (
136 CDKHISTOGRAM *histogram,
137 int lowValue,
138 int highValue,
139 int currentValue);
140
141 void setCDKHistogramVerticalChar (
142 CDKHISTOGRAM *histogram,
143 chtype character);
144
145 void setCDKHistogramViewType (
146 CDKHISTOGRAM *histogram,
147 EHistogramDisplayType viewType);
148
150 The Cdk histogram widget creates a histogram widget. This widget can
151 draw a vertical or horizontal histogram. The functions create or
152 manipulate the Cdk histogram box widget.
153
155 activateCDKHistogram
156 obsolete entrypoint which calls drawCDKHistogram.
157
158 destroyCDKHistogram
159 removes the widget from the screen and frees memory the object
160 used.
161
162 drawCDKHistogram
163 draws the histogram widget on the screen. If the box parameter is
164 true, the widget is drawn with a box.
165
166 eraseCDKHistogram
167 removes the widget from the screen. This does NOT destroy the
168 widget.
169
170 getCDKHistogramBox
171 returns true if the widget will be drawn with a box around it.
172
173 getCDKHistogramFillerChar
174 returns the character being used to draw the histogram bar.
175
176 getCDKHistogramHighValue
177 returns the high value of the histogram.
178
179 getCDKHistogramLowValue
180 returns the low value of the histogram.
181
182 getCDKHistogramStatsAttr
183 returns the attribute of the statistics of the histogram.
184
185 getCDKHistogramStatsPos
186 returns where the histogram will draw the statistics.
187
188 getCDKHistogramValue
189 returns the current value of the histogram.
190
191 getCDKHistogramViewType
192 returns the view type of the histogram widget.
193
194 moveCDKHistogram
195 moves the given widget to the given position. The parameters xpos
196 and ypos are the new position of the widget. The parameter xpos
197 may be an integer or one of the pre-defined values TOP, BOTTOM,
198 and CENTER. The parameter ypos can be an integer or one of the
199 pre-defined values LEFT, RIGHT, and CENTER. The parameter rela‐
200 tive states whether the xpos/ypos pair is a relative move or an
201 absolute move. For example if xpos = 1 and ypos = 2 and relative
202 = TRUE, then the widget would move one row down and two columns
203 right. If the value of relative was FALSE then the widget would
204 move to the position (1,2). Do not use the values TOP, BOTTOM,
205 LEFT, RIGHT, or CENTER when relative = TRUE. (weird things may
206 happen). The final parameter refresh is a boolean value which
207 states whether the widget will get refreshed after the move.
208
209 newCDKHistogram
210 creates a histogram widget and returns a pointer to it. Parame‐
211 ters:
212
213 screen
214 is the screen you wish this widget to be placed in.
215
216 xpos controls the placement of the object along the horizontal
217 axis. It may be an integer or one of the pre-defined values
218 LEFT, RIGHT, and CENTER.
219
220 ypos controls the placement of the object along the vertical axis.
221 It may be an integer or one of the pre-defined values TOP,
222 BOTTOM, and CENTER.
223
224 title
225 is the string which will be displayed at the top of the wid‐
226 get. The title can be more than one line; just provide a
227 carriage return character at the line break.
228
229 height and
230
231 width
232 control the height and width of the widget. If you provide a
233 value of zero for either of the height or the width, the wid‐
234 get will be created with the full width and height of the
235 screen. If you provide a negative value, the widget will be
236 created the full height or width minus the value provided.
237
238 orient
239 specifies the orientation of the histogram. It is one of
240 these pre-defined values: VERTICAL and HORIZONTAL.
241
242 label
243 is the string to use as the label of the histogram.
244
245 box is true if the widget should be drawn with a box around it.
246
247 shadow
248 turns the shadow on or off around this widget.
249
250 If the widget could not be created then a NULL pointer is
251 returned.
252
253 positionCDKHistogram
254 allows the user to move the widget around the screen via the cur‐
255 sor/keypad keys. See cdk_position (3) for key bindings.
256
257 setCDKHistogram
258 lets the programmer set the specific values of the histogram wid‐
259 get. The parameter viewType specifies the type of histogram to
260 draw. The following table lists the valid values and the results.
261
262 ┌────────────────┬────────────────────────────────┐
263 │Display_Type │ Result │
264 ├────────────────┼────────────────────────────────┤
265 │vNONE │ Displays no information about │
266 │ │ the current values. │
267 ├────────────────┼────────────────────────────────┤
268 │vPERCENT │ Displays the current value as │
269 │ │ a percentage. │
270 ├────────────────┼────────────────────────────────┤
271 │vFRACTION │ Displays the current value as │
272 │ │ a fraction. │
273 ├────────────────┼────────────────────────────────┤
274 │vREAL │ Displays the current value. │
275 └────────────────┴────────────────────────────────┘
276
277 The statsPosition parameter states where the statistics will be
278 displayed. It accepts TOP, BOTTOM, and CENTER.
279
280 The parameter statsAttribute sets the attributes of the statis‐
281 tics.
282
283 The parameters lowValue, highValue, and currentValue are the low,
284 high, and current values respectively.
285
286 The filler character is the character to use in the unused space
287 in the histogram.
288
289 If the box parameter is true, the widget is drawn with a box.
290
291 setCDKHistogramBackgroundAttrib
292 the background color attribute the widget. The parameter
293 attribute is a curses attribute, e.g., A_BOLD.
294
295 setCDKHistogramBackgroundColor
296 the background color of the widget. The parameter color is in the
297 format of the Cdk format strings. See cdk_display (3).
298
299 setCDKHistogramBox
300 sets whether the widget will be drawn with a box around it.
301
302 setCDKHistogramBoxAttribute
303 sets the attribute of the box.
304
305 setCDKHistogramDisplayType
306 sets the display type (see getCDKHistogramViewType).
307
308 setCDKHistogramFillerChar
309 sets the character to use when drawing the histogram bar.
310
311 setCDKHistogramHorizontalChar
312 sets the horizontal drawing character for the box to the given
313 character.
314
315 setCDKHistogramLLChar
316 sets the lower left hand corner of the widget's box to the given
317 character.
318
319 setCDKHistogramLRChar
320 sets the lower right hand corner of the widget's box to the given
321 character.
322
323 setCDKHistogramStatsAttr
324 sets the attribute to use when drawing the histogram statistics.
325
326 setCDKHistogramStatsPos
327 sets where the statistics will be drawn on the widget. See the
328 setCDKHistogram description for more details.
329
330 setCDKHistogramULChar
331 sets the upper left hand corner of the widget's box to the given
332 character.
333
334 setCDKHistogramURChar
335 sets the upper right hand corner of the widget's box to the given
336 character.
337
338 setCDKHistogramValue
339 sets the low, high, and current value of the histogram.
340
341 setCDKHistogramVerticalChar
342 sets the vertical drawing character for the box to the given char‐
343 acter.
344
345 setCDKHistogramViewType
346 sets the view type of the histogram. Look at the setCDKHistogram
347 description for more details.
348
350 cdk(3), cdk_binding(3), cdk_display(3), cdk_position(3), cdk_screen(3)
351
352
353
354 cdk_histogram(3)