wmii/liblitz/blitz.h

47 lines
1.2 KiB
C
Raw Normal View History

2005-11-18 17:54:58 +02:00
/*
2006-01-20 16:20:24 +02:00
* (C)opyright MMIV-MMVI Anselm R. Garbe <garbeam at gmail dot com>
2005-11-18 17:54:58 +02:00
* See LICENSE file for license details.
*/
#include <X11/Xlib.h>
#include <cext.h>
2005-11-18 17:54:58 +02:00
#define BLITZ_FONT "fixed"
#define BLITZ_SELCOLORS "#ffffff #285577 #4c7899"
#define BLITZ_NORMCOLORS "#222222 #eeeeee #666666"
2005-11-18 17:54:58 +02:00
typedef enum {
CENTER, WEST, NWEST, NORTH, NEAST, EAST,
SEAST, SOUTH, SWEST
2005-12-05 00:45:59 +02:00
} Align;
2005-11-18 17:54:58 +02:00
typedef struct {
2005-12-05 00:45:59 +02:00
unsigned long bg;
unsigned long fg;
unsigned long border;
} Color;
typedef struct {
Align align;
Drawable drawable;
GC gc;
Color color;
2005-12-05 00:45:59 +02:00
XFontStruct *font;
XRectangle rect; /* relative rect */
XRectangle *notch; /* relative notch rect */
2005-12-05 00:45:59 +02:00
char *data;
} Draw;
2005-11-18 17:54:58 +02:00
/* draw.c */
XFontStruct *blitz_getfont(Display *dpy, char *fontstr);
int blitz_loadcolor(Display *dpy, int mon, char *colstr, Color *c);
void blitz_drawlabel(Display *dpy, Draw *r);
void blitz_drawborder(Display *dpy, Draw *r);
2005-11-18 17:54:58 +02:00
/* geometry.c */
2006-01-27 18:44:05 +02: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);
int blitz_distance(XRectangle *origin, XRectangle *target);
void blitz_getbasegeometry(unsigned int size, unsigned int *cols, unsigned int *rows);