dwm-meillo

view dwm.h @ 144:e61447a7f249

applied Jukkas prev/next patch with XK_{h,l}
author arg@10ksloc.org
date Tue, 01 Aug 2006 12:39:14 +0200
parents 36cabfe408cd
children f328ce9c558c
line source
1 /*
2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3 * See LICENSE file for license details.
4 */
6 #include <X11/Xlib.h>
8 /* CUSTOMIZE */
10 #define FONT "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*"
11 #define BGCOLOR "#0a2c2d"
12 #define FGCOLOR "#ddeeee"
13 #define BORDERCOLOR "#176164"
14 #define MODKEY Mod1Mask /* Mod4Mask */
15 /*
16 #define BGCOLOR "#666699"
17 #define FGCOLOR "#eeeeee"
18 #define BORDERCOLOR "#9999CC"
19 */
20 #define MASTERW 52 /* percent */
21 #define WM_PROTOCOL_DELWIN 1
23 /* tags */
24 enum { Tfnord, Tdev, Tnet, Twork, Tmisc, TLast };
26 /* END CUSTOMIZE */
28 /* mask shorthands, used in event.c and client.c */
29 #define ButtonMask (ButtonPressMask | ButtonReleaseMask)
30 #define MouseMask (ButtonMask | PointerMotionMask)
32 typedef union Arg Arg;
33 typedef struct Client Client;
34 typedef struct DC DC;
35 typedef struct Fnt Fnt;
37 union Arg {
38 const char **argv;
39 int i;
40 };
42 /* atoms */
43 enum { NetSupported, NetWMName, NetLast };
44 enum { WMProtocols, WMDelete, WMLast };
46 /* cursor */
47 enum { CurNormal, CurResize, CurMove, CurLast };
49 /* windowcorners */
50 typedef enum { TopLeft, TopRight, BotLeft, BotRight } Corner;
52 struct Fnt {
53 int ascent;
54 int descent;
55 int height;
56 XFontSet set;
57 XFontStruct *xfont;
58 };
60 struct DC { /* draw context */
61 int x, y, w, h;
62 unsigned long bg;
63 unsigned long fg;
64 unsigned long border;
65 Drawable drawable;
66 Fnt font;
67 GC gc;
68 };
70 struct Client {
71 char name[256];
72 char *tags[TLast];
73 int proto;
74 int x, y, w, h;
75 int tx, ty, tw, th; /* title */
76 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
77 int grav;
78 unsigned int border;
79 long flags;
80 Bool isfloat;
81 Bool ismax;
82 Client *next;
83 Client *prev;
84 Window win;
85 Window title;
86 };
88 extern char *tags[TLast], stext[1024];
89 extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
90 extern void (*handler[LASTEvent])(XEvent *);
91 extern void (*arrange)(Arg *);
92 extern Atom wmatom[WMLast], netatom[NetLast];
93 extern Bool running, issel;
94 extern Client *clients, *sel;
95 extern Cursor cursor[CurLast];
96 extern DC dc;
97 extern Display *dpy;
98 extern Window root, barwin;
100 /* client.c */
101 extern void ban(Client *c);
102 extern void focus(Client *c);
103 extern void focusnext(Arg *arg);
104 extern void focusprev(Arg *arg);
105 extern Client *getclient(Window w);
106 extern Client *getctitle(Window w);
107 extern void gravitate(Client *c, Bool invert);
108 extern void higher(Client *c);
109 extern void killclient(Arg *arg);
110 extern void lower(Client *c);
111 extern void manage(Window w, XWindowAttributes *wa);
112 extern void resize(Client *c, Bool sizehints, Corner sticky);
113 extern void setsize(Client *c);
114 extern void settitle(Client *c);
115 extern void togglemax(Arg *arg);
116 extern void unmanage(Client *c);
117 extern void zoom(Arg *arg);
119 /* draw.c */
120 extern void drawall();
121 extern void drawstatus();
122 extern void drawtitle(Client *c);
123 extern unsigned long getcolor(const char *colstr);
124 extern void setfont(const char *fontstr);
125 extern unsigned int textw(char *text);
127 /* event.c */
128 extern void grabkeys();
130 /* main.c */
131 extern int getproto(Window w);
132 extern void quit(Arg *arg);
133 extern void sendevent(Window w, Atom a, long value);
134 extern int xerror(Display *dsply, XErrorEvent *ee);
136 /* tag.c */
137 extern void appendtag(Arg *arg);
138 extern void dofloat(Arg *arg);
139 extern void dotile(Arg *arg);
140 extern Client *getnext(Client *c);
141 extern Client *getprev(Client *c);
142 extern void replacetag(Arg *arg);
143 extern void settags(Client *c);
144 extern void togglemode(Arg *arg);
145 extern void view(Arg *arg);
146 extern void viewnext(Arg *arg);
147 extern void viewprev(Arg *arg);
149 /* util.c */
150 extern void *emallocz(unsigned int size);
151 extern void eprint(const char *errstr, ...);
152 extern void spawn(Arg *arg);