aewl

annotate dwm.h @ 51:035617ee18d1

new stuff
author Anselm R. Garbe <garbeam@wmii.de>
date Thu, 13 Jul 2006 19:55:07 +0200
parents 148f25ed0ad7
children d18f6dd0cf23
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@0 69 Window win;
garbeam@0 70 Window trans;
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@51 80 };
garbeam@51 81
garbeam@8 82 struct Key {
garbeam@8 83 unsigned long mod;
garbeam@8 84 KeySym keysym;
garbeam@49 85 void (*func)(Arg *arg);
garbeam@49 86 Arg arg;
garbeam@8 87 };
garbeam@8 88
garbeam@0 89 extern Display *dpy;
garbeam@32 90 extern Window root;
garbeam@13 91 extern Atom wm_atom[WMLast], net_atom[NetLast];
garbeam@0 92 extern Cursor cursor[CurLast];
garbeam@31 93 extern Bool running, issel;
garbeam@5 94 extern void (*handler[LASTEvent]) (XEvent *);
garbeam@0 95
garbeam@51 96 extern int tsel, screen, sx, sy, sw, sh, mw, th;
garbeam@51 97 extern char *tags[TLast];
garbeam@3 98
garbeam@34 99 extern DC dc;
garbeam@50 100 extern Client *clients, *sel;
garbeam@3 101
garbeam@5 102 /* client.c */
garbeam@10 103 extern void manage(Window w, XWindowAttributes *wa);
garbeam@13 104 extern void unmanage(Client *c);
garbeam@13 105 extern Client *getclient(Window w);
garbeam@13 106 extern void focus(Client *c);
garbeam@13 107 extern void update_name(Client *c);
garbeam@16 108 extern void draw_client(Client *c);
garbeam@18 109 extern void resize(Client *c);
garbeam@20 110 extern void update_size(Client *c);
garbeam@23 111 extern Client *gettitle(Window w);
garbeam@32 112 extern void craise(Client *c);
garbeam@26 113 extern void lower(Client *c);
garbeam@49 114 extern void ckill(Arg *arg);
garbeam@49 115 extern void nextc(Arg *arg);
garbeam@49 116 extern void prevc(Arg *arg);
garbeam@49 117 extern void max(Arg *arg);
garbeam@49 118 extern void floating(Arg *arg);
garbeam@49 119 extern void tiling(Arg *arg);
garbeam@50 120 extern void tag(Arg *arg);
garbeam@50 121 extern void view(Arg *arg);
garbeam@50 122 extern void zoom(Arg *arg);
garbeam@29 123 extern void gravitate(Client *c, Bool invert);
garbeam@13 124
garbeam@33 125 /* draw.c */
garbeam@34 126 extern void draw(Bool border, const char *text);
garbeam@43 127 extern unsigned long initcolor(const char *colstr);
garbeam@43 128 extern void initfont(const char *fontstr);
garbeam@43 129 extern unsigned int textnw(char *text, unsigned int len);
garbeam@43 130 extern unsigned int textw(char *text);
garbeam@43 131 extern unsigned int texth(void);
garbeam@33 132
garbeam@13 133 /* event.c */
garbeam@26 134 extern void discard_events(long even_mask);
garbeam@5 135
garbeam@42 136 /* dev.c */
garbeam@33 137 extern void update_keys(void);
garbeam@9 138 extern void keypress(XEvent *e);
garbeam@18 139 extern void mresize(Client *c);
garbeam@18 140 extern void mmove(Client *c);
garbeam@18 141
garbeam@43 142 /* main.c */
garbeam@43 143 extern int error_handler(Display *dsply, XErrorEvent *e);
garbeam@43 144 extern void send_message(Window w, Atom a, long value);
garbeam@43 145 extern int win_proto(Window w);
garbeam@49 146 extern void quit(Arg *arg);
garbeam@43 147
garbeam@32 148 /* util.c */
garbeam@33 149 extern void error(const char *errstr, ...);
garbeam@32 150 extern void *emallocz(unsigned int size);
garbeam@32 151 extern void *emalloc(unsigned int size);
garbeam@32 152 extern void *erealloc(void *ptr, unsigned int size);
garbeam@32 153 extern char *estrdup(const char *str);
garbeam@49 154 extern void spawn(Arg *arg);
garbeam@32 155 extern void swap(void **p1, void **p2);