wmii/liblitz/blitz.h

60 lines
1.6 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_FG_COLOR "#eeeeee"
#define BLITZ_SEL_BG_COLOR "#506070"
#define BLITZ_SEL_BORDER_COLOR "#708090"
#define BLITZ_NORM_FG_COLOR "#bbbbbb"
#define BLITZ_NORM_BG_COLOR "#222222"
#define BLITZ_NORM_BORDER_COLOR "#000000"
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 Draw Draw;
struct Draw {
2005-12-05 01:45:59 +03:00
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;
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);
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);
2005-11-18 18:54:58 +03:00
/* geometry.c */
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
char *blitz_modtostr(unsigned long mod);
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);