cdk_histogram(3)
π cdk_histogram(3) π
library calls β¨ bestie, this is the whole vibe of the Cdk histogram widget, and yes we're doing the long version because you deserve the full tea π«
πΈ NAME πΈ
cdk_histogram</purlle> β the Cdk histogram widget π
β¨ SYNOPSIS β¨
okay so first things first, you link against the library like this:
cc [ flag ... ] file ... -lcdk [ library ... ]
and you grab the header, obviously:
#include <cdk.h>
then here's every single function the widget hands you, no cap, all of them, in order:
void activateCDKHistogram (
CDKHISTOGRAM *histogram,
chtype unused);
void destroyCDKHistogram (
CDKHISTOGRAM *histogram);
void drawCDKHistogram (
CDKHISTOGRAM *histogram,
boolean box);
void eraseCDKHistogram (
CDKHISTOGRAM *histogram);
boolean getCDKHistogramBox (
CDKHISTOGRAM *histogram);
chtype getCDKHistogramFillerChar (
CDKHISTOGRAM *histogram);
int getCDKHistogramHighValue (
CDKHISTOGRAM *histogram);
int getCDKHistogramLowValue (
CDKHISTOGRAM *histogram);
chtype getCDKHistogramStatsAttr (
CDKHISTOGRAM *histogram);
int getCDKHistogramStatsPos (
CDKHISTOGRAM *histogram);
int getCDKHistogramValue (
CDKHISTOGRAM *histogram);
EHistogramDisplayType getCDKHistogramViewType (
CDKHISTOGRAM *histogram);
void moveCDKHistogram (
CDKHISTOGRAM *histogram,
int xpos,
int ypos,
boolean relative,
boolean refresh);
CDKHISTOGRAM *newCDKHistogram (
CDKSCREEN *cdkscreen,
int xpos,
int ypos,
int height,
int width,
int orient,
const char *title,
boolean box,
boolean shadow);
void positionCDKHistogram (
CDKHISTOGRAM *histogram);
void setCDKHistogram (
CDKHISTOGRAM *histogram,
EHistogramDisplayType viewType,
int statsPos,
chtype statsAttribute,
int lowValue,
int highValue,
int currentValue,
chtype fillerCharacter,
boolean box);
void setCDKHistogramBackgroundAttrib (
CDKHISTOGRAM *histogram,
chtype attribute);
void setCDKHistogramBackgroundColor (
CDKHISTOGRAM *histogram,
const char * color);
void setCDKHistogramBox (
CDKHISTOGRAM *histogram,
boolean box);
void setCDKHistogramBoxAttribute (
CDKHISTOGRAM *histogram,
chtype character);
void setCDKHistogramDisplayType (
CDKHISTOGRAM *histogram,
EHistogramDisplayType viewtype);
void setCDKHistogramFillerChar (
CDKHISTOGRAM *histogram,
chtype fillerCharacter);
void setCDKHistogramHorizontalChar (
CDKHISTOGRAM *histogram,
chtype character);
void setCDKHistogramLLChar (
CDKHISTOGRAM *histogram,
chtype character);
void setCDKHistogramLRChar (
CDKHISTOGRAM *histogram,
chtype character);
void setCDKHistogramStatsAttr (
CDKHISTOGRAM *histogram,
chtype statsAttribute);
void setCDKHistogramStatsPos (
CDKHISTOGRAM *histogram,
int statsPosition);
void setCDKHistogramULChar (
CDKHISTOGRAM *histogram,
chtype character);
void setCDKHistogramURChar (
CDKHISTOGRAM *histogram,
chtype character);
void setCDKHistogramValue (
CDKHISTOGRAM *histogram,
int lowValue,
int highValue,
int currentValue);
void setCDKHistogramVerticalChar (
CDKHISTOGRAM *histogram,
chtype character);
void setCDKHistogramViewType (
CDKHISTOGRAM *histogram,
EHistogramDisplayType viewType);
like, look at that list. it's giving organized. π
π¦ DESCRIPTION π¦
so the Cdk histogram widget does exactly what it says on the tin β it creates a histogram widget. groundbreaking, i know, but stay with me π
this widget can draw a vertical histogram or a horizontal histogram, your call, no wrong answers. pick whichever one fits the aesthetic of your terminal bestie π
and all those functions up in the synopsis? they create or manipulate the Cdk histogram box widget. that's the whole job. that's the assignment. and it ate, honestly π
heads up β this is only part 1, so hold that thought, there's more coming and you're gonna wanna keep reading π«Ά
β¨ AVAILABLE FUNCTIONS β¨
okay bestie, this is the part where we meet the whole squad π every single function, no skips, no cuts. let's go.
activateCDKHistogramβ obsolete entrypoint, and when I say obsolete I mean it π it literally just callsdrawCDKHistogram. that's it. that's the whole function.destroyCDKHistogramβ takes the widget off your screen AND frees up the memory it was using. full cleanup, no crumbs left behind π§ΉdrawCDKHistogramβ draws the histogram widget on the screen. if the box parameter is true, it gets drawn with a box around it πeraseCDKHistogramβ removes the widget from the screen. but NOT destroy it!! like, it's gone from view but it very much still exists, okay? do not confuse these two πgetCDKHistogramBoxβ returns true if the widget is gonna be drawn with a box around it.getCDKHistogramFillerCharβ hands you back the character being used to draw the histogram bar.getCDKHistogramHighValueβ returns the high value of the histogram.getCDKHistogramLowValueβ returns the low value of the histogram.getCDKHistogramStatsAttrβ returns the attribute of the statistics of the histogram.getCDKHistogramStatsPosβ tells you where the histogram is gonna draw the statistics.getCDKHistogramValueβ returns the current value of the histogram.getCDKHistogramViewTypeβ returns the view type of the histogram widget.
π« moveCDKHistogram
moves the given widget to the given position. iconic behavior honestly.
- the parameters
xposandyposare the new position of the widget. - the parameter
xposmay be an integer or one of the pre-defined valuesTOP,BOTTOM, andCENTER. - the parameter
yposcan be an integer or one of the pre-defined valuesLEFT,RIGHT, andCENTER. - the parameter
relativestates whether thexpos/ypospair is a relative move or an absolute move.
for example if xpos = 1 and ypos = 2 and relative = TRUE, then the widget would move one row down and two columns right. if the value of relative was FALSE, then the widget would move to the position (1,2).
do NOT use the valuesTOP,BOTTOM,LEFT,RIGHT, orCENTERwhenrelative = TRUE. (weird things may happen). bestie I am begging you π
- the final parameter
refreshis a boolean value which states whether the widget will get refreshed after the move.
π newCDKHistogram
creates a histogram widget and returns a pointer to it. brand new widget, fresh out the box π
Parameters:
screenβ is the screen you wish this widget to be placed in.xposβ controls the placement of the object along the horizontal axis. it may be an integer or one of the pre-defined valuesLEFT,RIGHT, andCENTER.yposβ controls the placement of the object along the vertical axis. it may be an integer or one of the pre-defined valuesTOP,BOTTOM, andCENTER.titleβ is the string which will be displayed at the top of the widget. the title can be more than one line; just provide a carriage return character at the line break. multi-line title? she contains multitudes πheightandwidthβ control the height and width of the widget. if you provide a value of zero for either of theheightor thewidth, the widget will be created with the full width and height of the screen. if you provide a negative value, the widget will be created the full height or width minus the value provided.orientβ specifies the orientation of the histogram. it is one of these pre-defined values:VERTICALandHORIZONTAL.labelβ is the string to use as the label of the histogram.boxβ is true if the widget should be drawn with a box around it.shadowβ turns the shadow on or off around this widget.
if the widget could not be created then a NULL pointer is returned. no widget, no vibe π
π¦ positionCDKHistogram
allows the user to move the widget around the screen via the cursor/keypad keys. see cdk_position (3) for key bindings. drag her around like a little sticker, she doesn't mind π
π setCDKHistogram
lets the programmer set the specific values of the histogram widget. this is the main character of the whole page tbh.
- the parameter
viewTypespecifies the type of histogram to draw. the following table lists the valid values and the results.vNONEβ displays no information about the current values.vPERCENTβ displays the current value as a percentage.vFRACTIONβ displays the current value as a fraction.vREALβ displays the current value.
- the
statsPositionparameter states where the statistics will be displayed. it acceptsTOP,BOTTOM, andCENTER. - the parameter
statsAttributesets the attributes of the statistics. - the parameters
lowValue,highValue, andcurrentValueare the low, high, and current values respectively. - the filler character is the character to use in the unused space in the histogram.
- if the
boxparameter is true, the widget is drawn with a box.
π the setters, aka the glow-up crew
setCDKHistogramBackgroundAttribβ sets the background color attribute of the widget. the parameterattributeis a curses attribute, e.g.,A_BOLD.setCDKHistogramBackgroundColorβ sets the background color of the widget. the parametercoloris in the format of the Cdk format strings. seecdk_display (3).setCDKHistogramBoxβ sets whether the widget will be drawn with a box around it.setCDKHistogramBoxAttributeβ sets the attribute of the box.setCDKHistogramDisplayTypeβ sets the display type (seegetCDKHistogramViewType).setCDKHistogramFillerCharβ sets the character to use when drawing the histogram bar.setCDKHistogramHorizontalCharβ sets the horizontal drawing character for the box to the given character.setCDKHistogramLLCharβ sets the lower left hand corner of the widget's box to the given character.setCDKHistogramLRCharβ sets the lower right hand corner of the widget's box to the given character.setCDKHistogramStatsAttrβ sets the attribute to use when drawing the histogram statistics.setCDKHistogramStatsPosβ sets where the statistics will be drawn on the widget. see thesetCDKHistogramdescription for more details.setCDKHistogramULCharβ sets the upper left hand corner of the widget's box to the given character.setCDKHistogramURCharβ sets the upper right hand corner of the widget's box to the given character.setCDKHistogramValueβ sets the low, high, and current value of the histogram.setCDKHistogramVerticalCharβ sets the vertical drawing character for the box to the given character.setCDKHistogramViewTypeβ sets the view type of the histogram. look at thesetCDKHistogramdescription for more details.
πΈ SEE ALSO πΈ
cdk(3), cdk_binding(3), cdk_display(3), cdk_position(3), cdk_screen(3)
and that's a wrap on part 2, bestie π«Ά this page is from the cdk_histogram(3) manual, dated 2024-03-28 β go forth and draw those bars, you're literally gonna slay β¨π
π¦ where this page comes from
- debian trixie: libcdk5-dev 5.0.20250116-1 Β· BSD-4-Clause
- fedora 43: cdk 5.0.20240619-4.fc43 Β· LicenseRef-Callaway-BSD-with-advertising
- fedora 43: cdk 5.0.20240619-4.fc43 Β· LicenseRef-Callaway-BSD-with-advertising
- fedora 43: cdk 5.0.20251014-1.fc43 Β· X11-distribute-modifications-variant
- fedora 43: cdk 5.0.20251014-1.fc43 Β· X11-distribute-modifications-variant
- fedora 44: cdk 5.0.20251014-3.fc44 Β· X11-distribute-modifications-variant
- fedora 44: cdk 5.0.20251014-3.fc44 Β· X11-distribute-modifications-variant
- nixos 26.05: cdk 5.0-20260119
- nixpkgs unstable: cdk 5.0-20260119
- ubuntu questing: libcdk5-dev 5.0.20250116-1
- ubuntu resolute: libcdk5-dev 5.0.20251014-1 Β· BSD-4-Clause
- ubuntu stonking: libcdk5-dev 5.0.20260119-1 Β· BSD-4-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms