aewl

view dwm.h @ 157:93012e947eae

renamed WM_PROTOCOL_DELWIN into PROTODELWIN
author arg@10ksloc.org
date Tue, 01 Aug 2006 16:44:23 +0200
parents a26b32ff8911
children 21071ae1fe68
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>
7 #include CONFIG
9 /* mask shorthands, used in event.c and client.c */
10 #define BUTTONMASK (ButtonPressMask | ButtonReleaseMask)
11 #define MOUSEMASK (BUTTONMASK | PointerMotionMask)
12 #define PROTODELWIN 1
14 typedef union Arg Arg;
15 typedef struct Client Client;
16 typedef struct DC DC;
17 typedef struct Fnt Fnt;
19 union Arg {
20 const char **argv;
21 int i;
22 };
24 /* atoms */
25 enum { NetSupported, NetWMName, NetLast };
26 enum { WMProtocols, WMDelete, WMLast };
28 /* cursor */
29 enum { CurNormal, CurResize, CurMove, CurLast };
31 /* windowcorners */
32 typedef enum { TopLeft, TopRight, BotLeft, BotRight } Corner;
34 struct Fnt {
35 int ascent;
36 int descent;
37 int height;
38 XFontSet set;
39 XFontStruct *xfont;
40 };
42 struct DC { /* draw context */
43 int x, y, w, h;
44 unsigned long bg;
45 unsigned long fg;
46 unsigned long border;
47 Drawable drawable;
48 Fnt font;
49 GC gc;
50 };
52 struct Client {
53 char name[256];
54 char *tags[TLast];
55 int proto;
56 int x, y, w, h;
57 int tx, ty, tw, th; /* title */
58 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
59 int grav;
60 unsigned int border;
61 long flags;
62 Bool isfloat;
63 Bool ismax;
64 Client *next;
65 Client *prev;
66 Window win;
67 Window title;
68 };
70 extern char *tags[TLast], stext[1024];
71 extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
72 extern void (*handler[LASTEvent])(XEvent *);
73 extern void (*arrange)(Arg *);
74 extern Atom wmatom[WMLast], netatom[NetLast];
75 extern Bool running, issel;
76 extern Client *clients, *sel;
77 extern Cursor cursor[CurLast];
78 extern DC dc;
79 extern Display *dpy;
80 extern Window root, barwin;
82 /* client.c */
83 extern void ban(Client *c);
84 extern void focus(Client *c);
85 extern void focusnext(Arg *arg);
86 extern void focusprev(Arg *arg);
87 extern Client *getclient(Window w);
88 extern Client *getctitle(Window w);
89 extern void gravitate(Client *c, Bool invert);
90 extern void higher(Client *c);
91 extern void killclient(Arg *arg);
92 extern void lower(Client *c);
93 extern void manage(Window w, XWindowAttributes *wa);
94 extern void resize(Client *c, Bool sizehints, Corner sticky);
95 extern void setsize(Client *c);
96 extern void settitle(Client *c);
97 extern void togglemax(Arg *arg);
98 extern void unmanage(Client *c);
99 extern void zoom(Arg *arg);
101 /* draw.c */
102 extern void drawall();
103 extern void drawstatus();
104 extern void drawtitle(Client *c);
105 extern unsigned long getcolor(const char *colstr);
106 extern void setfont(const char *fontstr);
107 extern unsigned int textw(char *text);
109 /* event.c */
110 extern void grabkeys();
112 /* main.c */
113 extern int getproto(Window w);
114 extern void quit(Arg *arg);
115 extern void sendevent(Window w, Atom a, long value);
116 extern int xerror(Display *dsply, XErrorEvent *ee);
118 /* tag.c */
119 extern void appendtag(Arg *arg);
120 extern void dofloat(Arg *arg);
121 extern void dotile(Arg *arg);
122 extern Client *getnext(Client *c);
123 extern Client *getprev(Client *c);
124 extern void replacetag(Arg *arg);
125 extern void settags(Client *c);
126 extern void togglemode(Arg *arg);
127 extern void view(Arg *arg);
128 extern void viewnext(Arg *arg);
129 extern void viewprev(Arg *arg);
131 /* util.c */
132 extern void *emallocz(unsigned int size);
133 extern void eprint(const char *errstr, ...);
134 extern void spawn(Arg *arg);