enum { WMProtocols, WMDelete, WMName, WMState, WMLast };/* default atoms */
/* typedefs */
+typedef unsigned int uint;
typedef struct Client Client;
struct Client {
char name[256];
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
int minax, maxax, minay, maxay;
long flags;
- unsigned int bw, oldbw;
+ uint bw, oldbw;
Bool isbanned, isfixed, isfloating, isurgent;
- unsigned int tags;
+ uint tags;
Client *next;
Client *prev;
Client *snext;
const char *class;
const char *instance;
const char *title;
- unsigned int tags;
+ uint tags;
Bool isfloating;
} Rule;
void drawbar(void);
void drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]);
void drawtext(const char *text, unsigned long col[ColLast], Bool invert);
-void *emallocz(unsigned int size);
+void *emallocz(uint size);
void enternotify(XEvent *e);
void eprint(const char *errstr, ...);
void expose(XEvent *e);
Client *getclient(Window w);
unsigned long getcolor(const char *colstr);
long getstate(Window w);
-Bool gettextprop(Window w, Atom atom, char *text, unsigned int size);
+Bool gettextprop(Window w, Atom atom, char *text, uint size);
void grabbuttons(Client *c, Bool focused);
void grabkeys(void);
void initfont(const char *fontstr);
-Bool isoccupied(unsigned int t);
+Bool isoccupied(uint t);
Bool isprotodel(Client *c);
-Bool isurgent(unsigned int t);
+Bool isurgent(uint t);
Bool isvisible(Client *c);
void keypress(XEvent *e);
void killclient(const void *arg);
void setup(void);
void spawn(const void *arg);
void tag(const void *arg);
-unsigned int textnw(const char *text, unsigned int len);
-unsigned int textw(const char *text);
+uint textnw(const char *text, uint len);
+uint textw(const char *text);
void tile(void);
void tileresize(Client *c, int x, int y, int w, int h);
void togglebar(const void *arg);
int screen, sx, sy, sw, sh;
int bx, by, bw, bh, blw, wx, wy, ww, wh;
int mx, my, mw, mh, tx, ty, tw, th;
-unsigned int seltags = 0;
+uint seltags = 0;
int (*xerrorxlib)(Display *, XErrorEvent *);
-unsigned int numlockmask = 0;
+uint numlockmask = 0;
void (*handler[LASTEvent]) (XEvent *) = {
[ButtonPress] = buttonpress,
[ConfigureRequest] = configurerequest,
Atom wmatom[WMLast], netatom[NetLast];
Bool otherwm, readin;
Bool running = True;
-unsigned int tagset[] = {1, 1}; /* after start, first tag is selected */
+uint tagset[] = {1, 1}; /* after start, first tag is selected */
Client *clients = NULL;
Client *sel = NULL;
Client *stack = NULL;
/* configuration, allows nested code to access above variables */
#include "config.h"
-/* check if all tags will fit into a unsigned int bitarray. */
+/* check if all tags will fit into a uint bitarray. */
static char tags_is_a_sign_that_your_IQ[sizeof(int) * 8 < LENGTH(tags) ? -1 : 1];
/* function implementations */
void
applyrules(Client *c) {
- unsigned int i;
+ uint i;
Rule *r;
XClassHint ch = { 0 };
void
buttonpress(XEvent *e) {
- unsigned int i, x, mask;
+ uint i, x, mask;
Client *c;
XButtonPressedEvent *ev = &e->xbutton;
void
drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
int x, y, w, h;
- unsigned int len, olen;
+ uint len, olen;
XRectangle r = { dc.x, dc.y, dc.w, dc.h };
char buf[256];
}
void *
-emallocz(unsigned int size) {
+emallocz(uint size) {
void *res = calloc(1, size);
if(!res)
}
Bool
-gettextprop(Window w, Atom atom, char *text, unsigned int size) {
+gettextprop(Window w, Atom atom, char *text, uint size) {
char **list = NULL;
int n;
XTextProperty name;
void
grabbuttons(Client *c, Bool focused) {
int i, j;
- unsigned int buttons[] = { Button1, Button2, Button3 };
- unsigned int modifiers[] = { MODKEY, MODKEY|LockMask, MODKEY|numlockmask,
+ uint buttons[] = { Button1, Button2, Button3 };
+ uint modifiers[] = { MODKEY, MODKEY|LockMask, MODKEY|numlockmask,
MODKEY|numlockmask|LockMask} ;
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
void
grabkeys(void) {
- unsigned int i, j;
+ uint i, j;
KeyCode code;
XModifierKeymap *modmap;
}
Bool
-isoccupied(unsigned int t) {
+isoccupied(uint t) {
Client *c;
for(c = clients; c; c = c->next)
}
Bool
-isurgent(unsigned int t) {
+isurgent(uint t) {
Client *c;
for(c = clients; c; c = c->next)
void
keypress(XEvent *e) {
- unsigned int i;
+ uint i;
KeySym keysym;
XKeyEvent *ev;
void
movemouse(Client *c) {
int x1, y1, ocx, ocy, di, nx, ny;
- unsigned int dui;
+ uint dui;
Window dummy;
XEvent ev;
char sbuf[sizeof stext];
fd_set rd;
int r, xfd;
- unsigned int len, offset;
+ uint len, offset;
XEvent ev;
/* main event loop, also reads status text from stdin */
void
scan(void) {
- unsigned int i, num;
+ uint i, num;
Window *wins, d1, d2;
XWindowAttributes wa;
void
setup(void) {
- unsigned int i, w;
+ uint i, w;
XSetWindowAttributes wa;
/* init screen */
}
}
-unsigned int
-textnw(const char *text, unsigned int len) {
+uint
+textnw(const char *text, uint len) {
XRectangle r;
if(dc.font.set) {
return XTextWidth(dc.font.xfont, text, len);
}
-unsigned int
+uint
textw(const char *text) {
return textnw(text, strlen(text)) + dc.font.height;
}
void
tile(void) {
int x, y, h, w;
- unsigned int i, n;
+ uint i, n;
Client *c;
for(n = 0, c = nextunfloating(clients); c; c = nextunfloating(c->next), n++);
void
togglelayout(const void *arg) {
- unsigned int i;
+ uint i;
if(!arg) {
if(++lt == &layouts[LENGTH(layouts)])