aewl
view dwm.h @ 49:466591c2f967
implemented tagging a client
author | Anselm R. Garbe <garbeam@wmii.de> |
---|---|
date | Thu, 13 Jul 2006 17:09:35 +0200 |
parents | 58307ad56ec1 |
children | 148f25ed0ad7 |
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 "DarkSlateGrey"
12 #define FGCOLOR "LightSteelBlue"
13 #define BORDERCOLOR "SlateGray"
14 #define WM_PROTOCOL_DELWIN 1
16 /* tags */
17 enum { Tscratch, Tdev, Tirc, Twww, Twork, TLast };
19 /********** CUSTOMIZE **********/
21 typedef struct DC DC;
22 typedef struct Client Client;
23 typedef struct Fnt Fnt;
24 typedef struct Key Key;
25 typedef union Arg Arg;
27 union Arg {
28 const char **argv;
29 int i;
30 };
32 /* atoms */
33 enum { WMProtocols, WMDelete, WMLast };
34 enum { NetSupported, NetWMName, NetLast };
36 /* cursor */
37 enum { CurNormal, CurResize, CurMove, CurInput, CurLast };
39 struct Fnt {
40 XFontStruct *xfont;
41 XFontSet set;
42 int ascent;
43 int descent;
44 int height;
45 };
47 struct DC { /* draw context */
48 GC gc;
49 Drawable drawable;
50 int x, y, w, h;
51 Fnt font;
52 unsigned long bg;
53 unsigned long fg;
54 unsigned long border;
55 };
57 struct Client {
58 char name[256];
59 char *tags[TLast];
60 int proto;
61 int x, y, w, h;
62 int tx, ty, tw, th;
63 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
64 int grav;
65 unsigned int border;
66 long flags;
67 Window win;
68 Window trans;
69 Window title;
70 Client *next;
71 Client *prev;
72 };
74 struct Key {
75 unsigned long mod;
76 KeySym keysym;
77 void (*func)(Arg *arg);
78 Arg arg;
79 };
81 extern Display *dpy;
82 extern Window root;
83 extern Atom wm_atom[WMLast], net_atom[NetLast];
84 extern Cursor cursor[CurLast];
85 extern Bool running, issel;
86 extern void (*handler[LASTEvent]) (XEvent *);
88 extern int tsel, screen, sx, sy, sw, sh, th;
89 extern char stext[1024], *tags[TLast];
91 extern DC dc;
92 extern Client *cstart, *cend, *csel;
94 /* client.c */
95 extern void manage(Window w, XWindowAttributes *wa);
96 extern void unmanage(Client *c);
97 extern Client *getclient(Window w);
98 extern void focus(Client *c);
99 extern void update_name(Client *c);
100 extern void draw_client(Client *c);
101 extern void resize(Client *c);
102 extern void update_size(Client *c);
103 extern Client *gettitle(Window w);
104 extern void craise(Client *c);
105 extern void lower(Client *c);
106 extern void ckill(Arg *arg);
107 extern void nextc(Arg *arg);
108 extern void prevc(Arg *arg);
109 extern void max(Arg *arg);
110 extern void floating(Arg *arg);
111 extern void tiling(Arg *arg);
112 void tag(Arg *arg);
113 extern void gravitate(Client *c, Bool invert);
115 /* draw.c */
116 extern void draw(Bool border, const char *text);
117 extern unsigned long initcolor(const char *colstr);
118 extern void initfont(const char *fontstr);
119 extern unsigned int textnw(char *text, unsigned int len);
120 extern unsigned int textw(char *text);
121 extern unsigned int texth(void);
123 /* event.c */
124 extern void discard_events(long even_mask);
126 /* dev.c */
127 extern void update_keys(void);
128 extern void keypress(XEvent *e);
129 extern void mresize(Client *c);
130 extern void mmove(Client *c);
132 /* main.c */
133 extern int error_handler(Display *dsply, XErrorEvent *e);
134 extern void send_message(Window w, Atom a, long value);
135 extern int win_proto(Window w);
136 extern void quit(Arg *arg);
138 /* util.c */
139 extern void error(const char *errstr, ...);
140 extern void *emallocz(unsigned int size);
141 extern void *emalloc(unsigned int size);
142 extern void *erealloc(void *ptr, unsigned int size);
143 extern char *estrdup(const char *str);
144 extern void spawn(Arg *arg);
145 extern void swap(void **p1, void **p2);