void setgaps(int oh, int ov, int ih, int iv) { if (oh < 0) oh = 0; if (ov < 0) ov = 0; if (ih < 0) ih = 0; if (iv < 0) iv = 0; selmon->gappoh = oh; selmon->gappov = ov; selmon->gappih = ih; selmon->gappiv = iv; arrange(selmon); } void defaultgaps(const Arg *arg) { setgaps(gappoh, gappov, gappih, gappiv); } void incrgaps(const Arg *arg) { setgaps( selmon->gappoh + arg->i, selmon->gappov + arg->i, selmon->gappih + arg->i, selmon->gappiv + arg->i ); } void incrigaps(const Arg *arg) { setgaps( selmon->gappoh, selmon->gappov, selmon->gappih + arg->i, selmon->gappiv + arg->i ); } void incrogaps(const Arg *arg) { setgaps( selmon->gappoh + arg->i, selmon->gappov + arg->i, selmon->gappih, selmon->gappiv ); } void incrohgaps(const Arg *arg) { setgaps( selmon->gappoh + arg->i, selmon->gappov, selmon->gappih, selmon->gappiv ); } void incrovgaps(const Arg *arg) { setgaps( selmon->gappoh, selmon->gappov + arg->i, selmon->gappih, selmon->gappiv ); } void incrihgaps(const Arg *arg) { setgaps( selmon->gappoh, selmon->gappov, selmon->gappih + arg->i, selmon->gappiv ); } void incrivgaps(const Arg *arg) { setgaps( selmon->gappoh, selmon->gappov, selmon->gappih, selmon->gappiv + arg->i ); } void getgaps(Monitor *m, int *oh, int *ov, int *ih, int *iv, unsigned int *nc) { unsigned int n, oe, ie; Client *c; oe = ie = 1; for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); if (smartgaps && n == 1) { oe = 0; // outer gaps disabled when only one client } *oh = m->gappoh*oe; // outer horizontal gap *ov = m->gappov*oe; // outer vertical gap *ih = m->gappih*ie; // inner horizontal gap *iv = m->gappiv*ie; // inner vertical gap *nc = n; // number of clients } void getfacts(Monitor *m, int msize, int ssize, float *mf, float *sf, int *mr, int *sr) { unsigned int n; float mfacts = 0, sfacts = 0; int mtotal = 0, stotal = 0; Client *c; for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) if (n < m->nmaster) mfacts += c->cfact; else sfacts += c->cfact; for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) if (n < m->nmaster) mtotal += msize * (c->cfact / mfacts); else stotal += ssize * (c->cfact / sfacts); *mf = mfacts; // total factor of master area *sf = sfacts; // total factor of stack area *mr = msize - mtotal; // the remainder (rest) of pixels after a cfacts master split *sr = ssize - stotal; // the remainder (rest) of pixels after a cfacts stack split }