2005-11-18 18:54:58 +03:00
|
|
|
/*
|
2006-01-20 17:20:24 +03:00
|
|
|
* (C)opyright MMIV-MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
2005-11-18 18:54:58 +03:00
|
|
|
* See LICENSE file for license details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <X11/Xlib.h>
|
2005-12-06 20:58:52 +03:00
|
|
|
#include <cext.h>
|
2005-11-18 18:54:58 +03:00
|
|
|
|
|
|
|
#define BLITZ_FONT "fixed"
|
2006-02-06 10:08:05 +03:00
|
|
|
#define BLITZ_SEL_COLOR "#ffffff #555588 #8888bb"
|
|
|
|
#define BLITZ_NORM_COLOR "#dddddd #666666 #999999"
|
2005-11-18 18:54:58 +03:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
CENTER, WEST, NWEST, NORTH, NEAST, EAST,
|
|
|
|
SEAST, SOUTH, SWEST
|
2005-12-05 01:45:59 +03:00
|
|
|
} Align;
|
2005-11-18 18:54:58 +03:00
|
|
|
|
2006-02-02 18:44:45 +03:00
|
|
|
typedef struct {
|
2005-12-05 01:45:59 +03:00
|
|
|
unsigned long bg;
|
|
|
|
unsigned long fg;
|
|
|
|
unsigned long border;
|
2006-02-02 18:44:45 +03:00
|
|
|
} Color;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
Drawable drawable;
|
|
|
|
GC gc;
|
|
|
|
Color color;
|
2005-12-05 01:45:59 +03:00
|
|
|
XFontStruct *font;
|
|
|
|
XRectangle rect; /* relative rect */
|
|
|
|
XRectangle *notch; /* relative notch rect */
|
|
|
|
char *data;
|
2006-02-02 18:44:45 +03:00
|
|
|
} Draw;
|
2005-11-18 18:54:58 +03:00
|
|
|
|
|
|
|
/* draw.c */
|
2005-12-05 01:45:59 +03:00
|
|
|
XFontStruct *blitz_getfont(Display * dpy, char *fontstr);
|
2006-02-02 18:44:45 +03:00
|
|
|
int blitz_loadcolor(Display *dpy, int mon, char *colstr, Color *c);
|
2005-12-05 01:45:59 +03:00
|
|
|
void blitz_drawlabel(Display * dpy, Draw * r);
|
|
|
|
void blitz_drawmeter(Display * dpy, Draw * r);
|
|
|
|
void blitz_drawlabelnoborder(Display * dpy, Draw * r);
|
2005-11-18 18:54:58 +03:00
|
|
|
|
|
|
|
/* geometry.c */
|
2006-01-27 19:44:05 +03:00
|
|
|
int blitz_strtoalign(Align *result, char *val);
|
2005-12-05 04:25:48 +03:00
|
|
|
int blitz_strtorect(XRectangle * root, XRectangle * r, char *val);
|
2005-12-13 21:45:56 +03:00
|
|
|
Bool blitz_ispointinrect(int x, int y, XRectangle * r);
|
2005-12-05 01:45:59 +03:00
|
|
|
int blitz_distance(XRectangle * origin, XRectangle * target);
|
2005-12-16 04:59:27 +03:00
|
|
|
void blitz_getbasegeometry(unsigned int size, unsigned int *cols, unsigned int *rows);
|
2005-11-18 18:54:58 +03:00
|
|
|
|
|
|
|
/* mouse.c */
|
2005-12-05 01:45:59 +03:00
|
|
|
char *blitz_buttontostr(unsigned int button);
|
|
|
|
unsigned int blitz_strtobutton(char *val);
|
2005-11-18 18:54:58 +03:00
|
|
|
|
|
|
|
/* kb.c */
|
2005-12-05 01:45:59 +03:00
|
|
|
unsigned long blitz_strtomod(char *val);
|
2005-11-18 18:54:58 +03:00
|
|
|
|
|
|
|
/* util.c */
|
2005-12-11 17:47:23 +03:00
|
|
|
long long blitz_strtonum(const char *numstr, long long minval, long long maxval);
|