aewl
diff util.h @ 3:e969f3575b7a
several new changes, made gridmenu working
author | Anselm R. Garbe <garbeam@wmii.de> |
---|---|
date | Mon, 10 Jul 2006 19:46:24 +0200 |
parents | a79188fe4a40 |
children | e5018cae273f |
line diff
1.1 --- a/util.h Mon Jul 10 18:35:39 2006 +0200 1.2 +++ b/util.h Mon Jul 10 19:46:24 2006 +0200 1.3 @@ -3,39 +3,14 @@ 1.4 * See LICENSE file for license details. 1.5 */ 1.6 1.7 -#include <X11/Xlib.h> 1.8 -#include <X11/Xlocale.h> 1.9 - 1.10 -typedef struct Brush Brush; 1.11 -typedef struct Color Color; 1.12 -typedef struct Fnt Fnt; 1.13 - 1.14 -struct Color { 1.15 - unsigned long bg; 1.16 - unsigned long fg; 1.17 - unsigned long border; 1.18 -}; 1.19 - 1.20 -struct Fnt { 1.21 - XFontStruct *xfont; 1.22 - XFontSet set; 1.23 - int ascent; 1.24 - int descent; 1.25 -}; 1.26 - 1.27 -struct Brush { 1.28 - GC gc; 1.29 - Drawable drawable; 1.30 - XRectangle rect; 1.31 - Bool border; 1.32 - Fnt *font; 1.33 - Color color; 1.34 - const char *text; 1.35 -}; 1.36 - 1.37 -extern void draw(Display *dpy, Brush *b); 1.38 -extern void loadcolor(Display *dpy, int screen, Color *c, 1.39 - const char *bg, const char *fg, const char *bo); 1.40 -extern unsigned int textwidth_l(Fnt *font, char *text, unsigned int len); 1.41 -extern unsigned int textwidth(Fnt *font, char *text); 1.42 -extern void loadfont(Display *dpy, Fnt *font, const char *fontstr); 1.43 +extern void error(char *errstr, ...); 1.44 +extern void *emallocz(unsigned int size); 1.45 +extern void *emalloc(unsigned int size); 1.46 +extern void *erealloc(void *ptr, unsigned int size); 1.47 +extern char *estrdup(const char *str); 1.48 +#define eassert(a) do { \ 1.49 + if(!(a)) \ 1.50 + failed_assert(#a, __FILE__, __LINE__); \ 1.51 + } while (0) 1.52 +void failed_assert(char *a, char *file, int line); 1.53 +void swap(void **p1, void **p2);