-
Notifications
You must be signed in to change notification settings - Fork 1
/
fancytext.h
42 lines (36 loc) · 1.55 KB
/
fancytext.h
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
//#define TEXTNW(X, N) (drw_font_getexts_width(drw->font, X, N))
#define ALIGN(X, Y, W, H, W2, H2) X + (W / 2) - (W2 / 2), Y + (H / 2) - (H2 / 2), W2, H2
typedef struct {
Pixmap pix;
unsigned int w;
unsigned int h;
} Bitmap;
typedef struct {
Bitmap **items;
int len;
} BitmapSet;
typedef union {
char *s;
int i;
Clr *c;
Bitmap *b;
} ft_data;
typedef struct barItem barItem;
struct barItem {
void (*func)(Drw *drw, int x, int y, unsigned int h, unsigned int fh, barItem *item);
int w;
int len;
char k;
ft_data data[2];
barItem *next;
};
void drw_bitmap(Drw *drw, int tx, int ty, unsigned int w, unsigned int h, int sx, int sy, Bitmap *bm);
void drw_bargraph(Drw *drw, int x, int y, unsigned int w, unsigned int h, Bool horizontal, int val);
void drw_bitmap_bargraph(Drw *drw, int x, int y, unsigned int w, unsigned int h, Bool horizontal, int val, Bitmap *bm);
void ft_set_color(Drw *drw, int x, int y, unsigned int h, unsigned int fh, barItem *item);
void ft_add_bargraph(Drw *drw, int x, int y, unsigned int h, unsigned int fh, barItem *item);
void ft_add_bitmap(Drw *drw, int x, int y, unsigned int h, unsigned int fh, barItem *item);
void ft_add_bitmap_bargraph(Drw *drw, int x, int y, unsigned int h, unsigned int fh, barItem *item);
void ft_add_text(Drw *drw, int x, int y, unsigned int h, unsigned int fh, barItem *item);
void drw_fancytext(Drw *drw, int x, int y, unsigned int w, unsigned int h, barItem *item);
int drw_fancytext_prepare(Drw *drw, BitmapSet *bitmaps, char *text, barItem *item);