dwm-meillo

diff wm.h @ 32:082c75b937b5

removed unnecessary crap
author Anselm R. Garbe <garbeam@wmii.de>
date Thu, 13 Jul 2006 01:30:55 +0200
parents 386649deb651
children e90449e03167
line diff
     1.1 --- a/wm.h	Thu Jul 13 01:04:38 2006 +0200
     1.2 +++ b/wm.h	Thu Jul 13 01:30:55 2006 +0200
     1.3 @@ -3,15 +3,25 @@
     1.4   * See LICENSE file for license details.
     1.5   */
     1.6  
     1.7 -#include "config.h"
     1.8 -#include "draw.h"
     1.9 -#include "util.h"
    1.10 +#include <X11/Xlib.h>
    1.11  
    1.12 -#include <X11/Xutil.h>
    1.13 +/********** CUSTOMIZE **********/
    1.14  
    1.15 +#define FONT		"-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*"
    1.16 +#define BGCOLOR		"#666699"
    1.17 +#define FGCOLOR		"#ffffff"
    1.18 +#define BORDERCOLOR	"#9999CC"
    1.19 +#define STATUSDELAY	10 /* seconds */
    1.20  #define WM_PROTOCOL_DELWIN 1
    1.21  
    1.22 +/* tags */
    1.23 +enum { Tscratch, Tdev, Tirc, Twww, Twork, TLast };
    1.24 +
    1.25 +/********** CUSTOMIZE **********/
    1.26 +
    1.27 +typedef struct Brush Brush;
    1.28  typedef struct Client Client;
    1.29 +typedef struct Fnt Fnt;
    1.30  typedef struct Key Key;
    1.31  
    1.32  /* atoms */
    1.33 @@ -21,6 +31,24 @@
    1.34  /* cursor */
    1.35  enum { CurNormal, CurResize, CurMove, CurInput, CurLast };
    1.36  
    1.37 +struct Fnt {
    1.38 +	XFontStruct *xfont;
    1.39 +	XFontSet set;
    1.40 +	int ascent;
    1.41 +	int descent;
    1.42 +	int height;
    1.43 +};
    1.44 +
    1.45 +struct Brush {
    1.46 +	GC gc;
    1.47 +	Drawable drawable;
    1.48 +	int x, y, w, h;
    1.49 +	Fnt font;
    1.50 +	unsigned long bg;
    1.51 +	unsigned long fg;
    1.52 +	unsigned long border;
    1.53 +};
    1.54 +
    1.55  struct Client {
    1.56  	char name[256];
    1.57  	char *tags[TLast];
    1.58 @@ -46,21 +74,27 @@
    1.59  };
    1.60  
    1.61  extern Display *dpy;
    1.62 -extern Window root, barwin;
    1.63 +extern Window root;
    1.64  extern Atom wm_atom[WMLast], net_atom[NetLast];
    1.65  extern Cursor cursor[CurLast];
    1.66  extern Bool running, issel;
    1.67  extern void (*handler[LASTEvent]) (XEvent *);
    1.68  extern void (*arrange)(void *aux);
    1.69  
    1.70 -extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh;
    1.71 +extern int tsel, screen, sx, sy, sw, sh, th;
    1.72  extern char stext[1024], *tags[TLast];
    1.73  
    1.74  extern Brush brush;
    1.75  extern Client *clients, *stack;
    1.76  
    1.77 -/* bar.c */
    1.78 -extern void draw_bar();
    1.79 +/* draw.c */
    1.80 +extern void draw(Display *dpy, Brush *b, Bool border, const char *text);
    1.81 +extern void loadcolors(Display *dpy, int screen, Brush *b,
    1.82 +		const char *bg, const char *fg, const char *bo);
    1.83 +extern void loadfont(Display *dpy, Fnt *font, const char *fontstr);
    1.84 +extern unsigned int textnw(Fnt *font, char *text, unsigned int len);
    1.85 +extern unsigned int textw(Fnt *font, char *text);
    1.86 +extern unsigned int texth(Fnt *font);
    1.87  
    1.88  /* client.c */
    1.89  extern void manage(Window w, XWindowAttributes *wa);
    1.90 @@ -72,9 +106,9 @@
    1.91  extern void resize(Client *c);
    1.92  extern void update_size(Client *c);
    1.93  extern Client *gettitle(Window w);
    1.94 -extern void raise(Client *c);
    1.95 +extern void craise(Client *c);
    1.96  extern void lower(Client *c);
    1.97 -extern void kill(void *aux);
    1.98 +extern void ckill(void *aux);
    1.99  extern void sel(void *aux);
   1.100  extern void max(void *aux);
   1.101  extern void floating(void *aux);
   1.102 @@ -92,6 +126,15 @@
   1.103  extern void mresize(Client *c);
   1.104  extern void mmove(Client *c);
   1.105  
   1.106 +/* util.c */
   1.107 +extern void error(char *errstr, ...);
   1.108 +extern void *emallocz(unsigned int size);
   1.109 +extern void *emalloc(unsigned int size);
   1.110 +extern void *erealloc(void *ptr, unsigned int size);
   1.111 +extern char *estrdup(const char *str);
   1.112 +extern void spawn(Display *dpy, char *argv[]);
   1.113 +extern void swap(void **p1, void **p2);
   1.114 +
   1.115  /* wm.c */
   1.116  extern int error_handler(Display *dpy, XErrorEvent *error);
   1.117  extern void send_message(Window w, Atom a, long value);