aewl

annotate dwm.h @ 55:fcbf7213d96f

continued with man page
author Anselm R. Garbe <garbeam@wmii.de>
date Fri, 14 Jul 2006 08:34:38 +0200
parents d18f6dd0cf23
children f005d46462e8
rev   line source
garbeam@0 1 /*
garbeam@0 2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
garbeam@0 3 * See LICENSE file for license details.
garbeam@0 4 */
garbeam@0 5
garbeam@32 6 #include <X11/Xlib.h>
garbeam@2 7
garbeam@32 8 /********** CUSTOMIZE **********/
garbeam@0 9
garbeam@51 10 #define FONT "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*"
garbeam@51 11 #define BGCOLOR "#666699"
garbeam@51 12 #define FGCOLOR "#ffffff"
garbeam@51 13 #define BORDERCOLOR "#9999CC"
garbeam@51 14 #define MASTERW 52 /* percent */
garbeam@51 15 #define WM_PROTOCOL_DELWIN 1
garbeam@13 16
garbeam@32 17 /* tags */
garbeam@32 18 enum { Tscratch, Tdev, Tirc, Twww, Twork, TLast };
garbeam@32 19
garbeam@32 20 /********** CUSTOMIZE **********/
garbeam@32 21
garbeam@51 22 typedef union Arg Arg;
garbeam@34 23 typedef struct DC DC;
garbeam@18 24 typedef struct Client Client;
garbeam@32 25 typedef struct Fnt Fnt;
garbeam@18 26 typedef struct Key Key;
garbeam@51 27 typedef struct Rule Rule;
garbeam@49 28
garbeam@49 29 union Arg {
garbeam@49 30 const char **argv;
garbeam@49 31 int i;
garbeam@49 32 };
garbeam@18 33
garbeam@5 34 /* atoms */
garbeam@13 35 enum { WMProtocols, WMDelete, WMLast };
garbeam@0 36 enum { NetSupported, NetWMName, NetLast };
garbeam@0 37
garbeam@5 38 /* cursor */
garbeam@0 39 enum { CurNormal, CurResize, CurMove, CurInput, CurLast };
garbeam@0 40
garbeam@32 41 struct Fnt {
garbeam@32 42 XFontStruct *xfont;
garbeam@32 43 XFontSet set;
garbeam@32 44 int ascent;
garbeam@32 45 int descent;
garbeam@32 46 int height;
garbeam@32 47 };
garbeam@32 48
garbeam@34 49 struct DC { /* draw context */
garbeam@32 50 GC gc;
garbeam@32 51 Drawable drawable;
garbeam@32 52 int x, y, w, h;
garbeam@32 53 Fnt font;
garbeam@32 54 unsigned long bg;
garbeam@32 55 unsigned long fg;
garbeam@32 56 unsigned long border;
garbeam@32 57 };
garbeam@32 58
garbeam@0 59 struct Client {
garbeam@31 60 char name[256];
garbeam@31 61 char *tags[TLast];
garbeam@13 62 int proto;
garbeam@20 63 int x, y, w, h;
garbeam@22 64 int tx, ty, tw, th;
garbeam@20 65 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
garbeam@29 66 int grav;
garbeam@29 67 unsigned int border;
garbeam@20 68 long flags;
garbeam@53 69 Bool floating;
garbeam@0 70 Window win;
garbeam@0 71 Window title;
garbeam@0 72 Client *next;
garbeam@50 73 Client *revert;
garbeam@0 74 };
garbeam@0 75
garbeam@51 76 struct Rule {
garbeam@51 77 const char *class;
garbeam@51 78 const char *instance;
garbeam@51 79 char *tags[TLast];
garbeam@53 80 Bool floating;
garbeam@51 81 };
garbeam@51 82
garbeam@8 83 struct Key {
garbeam@8 84 unsigned long mod;
garbeam@8 85 KeySym keysym;
garbeam@49 86 void (*func)(Arg *arg);
garbeam@49 87 Arg arg;
garbeam@8 88 };
garbeam@8 89
garbeam@0 90 extern Display *dpy;
garbeam@32 91 extern Window root;
garbeam@13 92 extern Atom wm_atom[WMLast], net_atom[NetLast];
garbeam@0 93 extern Cursor cursor[CurLast];
garbeam@31 94 extern Bool running, issel;
garbeam@53 95 extern void (*handler[LASTEvent])(XEvent *);
garbeam@53 96 extern void (*arrange)(Arg *);
garbeam@0 97
garbeam@51 98 extern int tsel, screen, sx, sy, sw, sh, mw, th;
garbeam@51 99 extern char *tags[TLast];
garbeam@3 100
garbeam@34 101 extern DC dc;
garbeam@50 102 extern Client *clients, *sel;
garbeam@3 103
garbeam@5 104 /* client.c */
garbeam@10 105 extern void manage(Window w, XWindowAttributes *wa);
garbeam@13 106 extern void unmanage(Client *c);
garbeam@13 107 extern Client *getclient(Window w);
garbeam@13 108 extern void focus(Client *c);
garbeam@13 109 extern void update_name(Client *c);
garbeam@16 110 extern void draw_client(Client *c);
garbeam@52 111 extern void resize(Client *c, Bool inc);
garbeam@20 112 extern void update_size(Client *c);
garbeam@23 113 extern Client *gettitle(Window w);
garbeam@32 114 extern void craise(Client *c);
garbeam@26 115 extern void lower(Client *c);
garbeam@49 116 extern void ckill(Arg *arg);
garbeam@49 117 extern void nextc(Arg *arg);
garbeam@49 118 extern void prevc(Arg *arg);
garbeam@49 119 extern void max(Arg *arg);
garbeam@49 120 extern void floating(Arg *arg);
garbeam@49 121 extern void tiling(Arg *arg);
garbeam@53 122 extern void ttrunc(Arg *arg);
garbeam@53 123 extern void tappend(Arg *arg);
garbeam@50 124 extern void view(Arg *arg);
garbeam@50 125 extern void zoom(Arg *arg);
garbeam@29 126 extern void gravitate(Client *c, Bool invert);
garbeam@13 127
garbeam@33 128 /* draw.c */
garbeam@34 129 extern void draw(Bool border, const char *text);
garbeam@43 130 extern unsigned long initcolor(const char *colstr);
garbeam@43 131 extern void initfont(const char *fontstr);
garbeam@43 132 extern unsigned int textnw(char *text, unsigned int len);
garbeam@43 133 extern unsigned int textw(char *text);
garbeam@43 134 extern unsigned int texth(void);
garbeam@33 135
garbeam@13 136 /* event.c */
garbeam@26 137 extern void discard_events(long even_mask);
garbeam@5 138
garbeam@42 139 /* dev.c */
garbeam@33 140 extern void update_keys(void);
garbeam@9 141 extern void keypress(XEvent *e);
garbeam@18 142 extern void mresize(Client *c);
garbeam@18 143 extern void mmove(Client *c);
garbeam@18 144
garbeam@43 145 /* main.c */
garbeam@43 146 extern int error_handler(Display *dsply, XErrorEvent *e);
garbeam@43 147 extern void send_message(Window w, Atom a, long value);
garbeam@43 148 extern int win_proto(Window w);
garbeam@49 149 extern void quit(Arg *arg);
garbeam@43 150
garbeam@32 151 /* util.c */
garbeam@33 152 extern void error(const char *errstr, ...);
garbeam@32 153 extern void *emallocz(unsigned int size);
garbeam@32 154 extern void *emalloc(unsigned int size);
garbeam@32 155 extern void *erealloc(void *ptr, unsigned int size);
garbeam@32 156 extern char *estrdup(const char *str);
garbeam@49 157 extern void spawn(Arg *arg);
garbeam@32 158 extern void swap(void **p1, void **p2);