summaryrefslogtreecommitdiffstats
path: root/util.h
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@wmii.de>2006-07-10 19:46:24 +0200
committerAnselm R. Garbe <garbeam@wmii.de>2006-07-10 19:46:24 +0200
commit39677ec76616fe4165ef92afb14db2bef2488e30 (patch)
tree7ea1c021042b7d7da53660aa127af37847273a91 /util.h
parentadded new stuff (diff)
downloaddwm-39677ec76616fe4165ef92afb14db2bef2488e30.tar.gz
dwm-39677ec76616fe4165ef92afb14db2bef2488e30.zip
several new changes, made gridmenu working
Diffstat (limited to '')
-rw-r--r--util.h47
1 files changed, 11 insertions, 36 deletions
diff --git a/util.h b/util.h
index be296e8..8ba444b 100644
--- a/util.h
+++ b/util.h
@@ -3,39 +3,14 @@
3 * See LICENSE file for license details. 3 * See LICENSE file for license details.
4 */ 4 */
5 5
6#include <X11/Xlib.h> 6extern void error(char *errstr, ...);
7#include <X11/Xlocale.h> 7extern void *emallocz(unsigned int size);
8 8extern void *emalloc(unsigned int size);
9typedef struct Brush Brush; 9extern void *erealloc(void *ptr, unsigned int size);
10typedef struct Color Color; 10extern char *estrdup(const char *str);
11typedef struct Fnt Fnt; 11#define eassert(a) do { \
12 12 if(!(a)) \
13struct Color { 13 failed_assert(#a, __FILE__, __LINE__); \
14 unsigned long bg; 14 } while (0)
15 unsigned long fg; 15void failed_assert(char *a, char *file, int line);
16 unsigned long border; 16void swap(void **p1, void **p2);
17};
18
19struct Fnt {
20 XFontStruct *xfont;
21 XFontSet set;
22 int ascent;
23 int descent;
24};
25
26struct Brush {
27 GC gc;
28 Drawable drawable;
29 XRectangle rect;
30 Bool border;
31 Fnt *font;
32 Color color;
33 const char *text;
34};
35
36extern void draw(Display *dpy, Brush *b);
37extern void loadcolor(Display *dpy, int screen, Color *c,
38 const char *bg, const char *fg, const char *bo);
39extern unsigned int textwidth_l(Fnt *font, char *text, unsigned int len);
40extern unsigned int textwidth(Fnt *font, char *text);
41extern void loadfont(Display *dpy, Fnt *font, const char *fontstr);