-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
109 lines (72 loc) · 2.12 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
================================
libxbp, (c) 2013 Matthew Rheaume
================================
A library for creating generic percentage bars for X.
Requirements
------------
In order to build libxpb you need the Xlib header files.
Installation
------------
Enter the following command to build and install libxpb (if necessary as root):
make clean install
API Reference
-------------
xpb_init
--------
int xpb_init(unsigned long mask, struct xpb_attr *attr, struct xpb **bar_out)
Initialize a new xpb struct.
Parameters
----------
mask:
Attribute bitmask. The attribute should be masked if the corresponding
value in the attribute structure has been set.
attr:
Attribute structure. Used to specify certain bar attributes.
bar:
Pointer to an xpb pointer. The xpb pointer will point to the new bar
after initialization.
Return Value
------------
Will return XPB_STATUS_SUCCESS if successful, an error code otherwise.
xpb_draw
--------
int xpb_draw(struct xpb *bar, int current, int max)
Draw the bar to the screen. This function does not flush the output buffer.
Parameters
----------
bar:
Pointer to an initialized xpb struct.
current:
An integer representing how much of the bar should be filled, ie. the
numerator of the fraction.
max:
The max value of current, such that the percentage of the bar filled is
max/current.
Return Value
------------
Will return XPB_STATUS_SUCCESS if success, XPB_STATUS_BAD_PTR if bar is not
an initialized xpb struct.
xpb_cleanup
-----------
int xpb_cleanup(struct xpb *bar)
Cleanup a previously allocated xpb struct.
Parameters
----------
bar:
Pointer to an initialized xpb struct.
Return Value
------------
Will return XPB_STATUS_SUCCESS if success, XPB_STATUS_BAD_PTR if bar is not
an initialized xpb struct.
xpb_status_tostring
-------------------
const char *xpb_status_tostring(int status)
Returns a string representing the status code.
Parameters
----------
status:
A valid status code returned by another API function.
Return Value
------------
Will return a string representing the status if the status code is valid,
NULL otherwise.