aewl

diff util.h @ 2:a79188fe4a40

added new stuff
author Anselm R. Garbe <garbeam@wmii.de>
date Mon, 10 Jul 2006 18:35:39 +0200
parents
children e969f3575b7a
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/util.h	Mon Jul 10 18:35:39 2006 +0200
     1.3 @@ -0,0 +1,41 @@
     1.4 +/*
     1.5 + * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
     1.6 + * See LICENSE file for license details.
     1.7 + */
     1.8 +
     1.9 +#include <X11/Xlib.h>
    1.10 +#include <X11/Xlocale.h>
    1.11 +
    1.12 +typedef struct Brush Brush;
    1.13 +typedef struct Color Color;
    1.14 +typedef struct Fnt Fnt;
    1.15 +
    1.16 +struct Color {
    1.17 +	unsigned long bg;
    1.18 +	unsigned long fg;
    1.19 +	unsigned long border;
    1.20 +};
    1.21 +
    1.22 +struct Fnt {
    1.23 +	XFontStruct *xfont;
    1.24 +	XFontSet set;
    1.25 +	int ascent;
    1.26 +	int descent;
    1.27 +};
    1.28 +
    1.29 +struct Brush {
    1.30 +	GC gc;
    1.31 +	Drawable drawable;
    1.32 +	XRectangle rect;
    1.33 +	Bool border;
    1.34 +	Fnt *font;
    1.35 +	Color color;
    1.36 +	const char *text;
    1.37 +};
    1.38 +
    1.39 +extern void draw(Display *dpy, Brush *b);
    1.40 +extern void loadcolor(Display *dpy, int screen, Color *c,
    1.41 +		const char *bg, const char *fg, const char *bo);
    1.42 +extern unsigned int textwidth_l(Fnt *font, char *text, unsigned int len);
    1.43 +extern unsigned int textwidth(Fnt *font, char *text);
    1.44 +extern void loadfont(Display *dpy, Fnt *font, const char *fontstr);