wmii/liblitz/blitz.h

57 lines
1.5 KiB
C
Raw Normal View History

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>
#include <cext.h>
2005-11-18 18:54:58 +03:00
#define BLITZ_FONT "fixed"
#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
typedef struct {
2005-12-05 01:45:59 +03:00
unsigned long bg;
unsigned long fg;
unsigned long border;
} 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;
} 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);
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);
int blitz_strtorect(XRectangle * root, XRectangle * r, char *val);
Bool blitz_ispointinrect(int x, int y, XRectangle * r);
2005-12-05 01:45:59 +03:00
int blitz_distance(XRectangle * origin, XRectangle * target);
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);