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
|
/*
* (C)opyright MMIV-MMV Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details.
*/
#include <X11/Xlib.h>
#define DEFAULT_FT_FAM "fixed"
#define DEFAULT_F_TEXT "#eeeeee"
#define DEFAULT_N_TEXT "#bbbbbb"
#define DEFAULT_F_BG "#506070"
#define DEFAULT_N_BG "#222222"
#define DEFAULT_F_BORDER "#708090"
#define DEFAULT_N_BORDER "#000000"
typedef enum {
CENTER, WEST, NWEST, NORTH, NEAST, EAST,
SEAST, SOUTH, SWEST
} Align;
typedef struct Draw Draw;
struct Draw {
Drawable drawable;
GC gc;
unsigned long bg;
unsigned long fg;
unsigned long border;
Align align;
XFontStruct *font;
XRectangle rect; /* relative rect */
XRectangle *notch; /* relative notch rect */
char *data;
};
/* draw.c */
XFontStruct *blitz_getfont(Display * dpy, char *fontstr);
unsigned long blitz_loadcolor(Display * dpy, int mon, char *colstr);
void blitz_drawlabel(Display * dpy, Draw * r);
void blitz_drawmeter(Display * dpy, Draw * r);
void blitz_drawlabelnoborder(Display * dpy, Draw * r);
/* geometry.c */
int blitz_strtorect(XRectangle * root, XRectangle * r, char *val);
int blitz_ispointinrect(int x, int y, XRectangle * r);
int blitz_distance(XRectangle * origin, XRectangle * target);
void
blitz_getbasegeometry(void **items, unsigned int *size,
unsigned int *cols, unsigned int *rows);
/* mouse.c */
char *blitz_buttontostr(unsigned int button);
unsigned int blitz_strtobutton(char *val);
/* kb.c */
char *blitz_modtostr(unsigned long mod);
unsigned long blitz_strtomod(char *val);
/* util.c */
long long
_strtonum(const char *numstr, long long minval,
long long maxval);
|