changeset: 2430:96ca2f9f1423
user: Kris Maglione <jg_AT_suckless.org>
date: Wed Jan 28 18:31:08 2009 -0500
files: cmd/wmii/_util.c cmd/wmii/area.c cmd/wmii/bar.c cmd/wmii/client.c cmd/wmii/column.c cmd/wmii/div.c cmd/wmii/event.c cmd/wmii/frame.c cmd/wmii/fs.c cmd/wmii/geom.c cmd/wmii/main.c cmd/wmii/mouse.c cmd/wmii/root.c cmd/wmii/view.c cmd/wmii/x11.c
description:
Formatting fixes.
diff -r 621b1245dc16 -r 96ca2f9f1423 cmd/wmii/_util.c
--- a/cmd/wmii/_util.c Sat Jan 10 17:53:19 2009 -0500
+++ b/cmd/wmii/_util.c Wed Jan 28 18:31:08 2009 -0500
@@ -17,13 +17,13 @@
vector_##c##init(Vector_##nam *v) { \
memset(v, 0, sizeof *v); \
} \
- \
+ \
void \
vector_##c##free(Vector_##nam *v) { \
free(v->ary); \
memset(v, 0, sizeof *v); \
} \
- \
+ \
void \
vector_##c##push(Vector_##nam *v, type val) { \
if(v->n == v->size) { \
diff -r 621b1245dc16 -r 96ca2f9f1423 cmd/wmii/area.c
--- a/cmd/wmii/area.c Sat Jan 10 17:53:19 2009 -0500
+++ b/cmd/wmii/area.c Wed Jan 28 18:31:08 2009 -0500
@@ -7,7 +7,7 @@
#include "fns.h"
Client*
-area_selclient(Area *a) {
+area_selclient(Area *a) {
if(a && a->sel)
return a->sel->client;
return nil;
diff -r 621b1245dc16 -r 96ca2f9f1423 cmd/wmii/bar.c
--- a/cmd/wmii/bar.c Sat Jan 10 17:53:19 2009 -0500
+++ b/cmd/wmii/bar.c Wed Jan 28 18:31:08 2009 -0500
@@ -136,7 +136,7 @@
foreach_bar(s, b) {
for(pb=&largest; *pb; pb=&pb[0]->smaller)
if(Dx(pb[0]->r) < Dx(b->r))
- break;
+ break;
b->smaller = *pb;
*pb = b;
}
diff -r 621b1245dc16 -r 96ca2f9f1423 cmd/wmii/client.c
--- a/cmd/wmii/client.c Sat Jan 10 17:53:19 2009 -0500
+++ b/cmd/wmii/client.c Wed Jan 28 18:31:08 2009 -0500
@@ -231,8 +231,9 @@
bool newgroup = !c->group
|| c->group->ref == 1
|| selclient() && (selclient()->group == c->group)
- || group_leader(c->group) && !client_viewframe(group_leader(c->group),
- c->sel->view);
+ || group_leader(c->group)
+ && !client_viewframe(group_leader(c->group),
+ c->sel->view);
f = c->sel;
if(!(c->w.ewmh.type & TypeSplash))
@@ -302,14 +303,14 @@
/* Convenience functions */
Frame*
-client_viewframe(Client *c, View *v) {
+client_viewframe(Client *c, View *v) {
Frame *f;
for(f=c->frame; f; f=f->cnext)
if(f->view == v)
break;
return f;
-}
+}
Client*
selclient(void) {
@@ -378,7 +379,7 @@
bool
client_floats_p(Client *c) {
return c->trans
- || c->floating
+ || c->floating
|| c->fixedsize
|| c->titleless
|| c->borderless
@@ -612,7 +613,8 @@
}
else if(f->oldarea > 0) {
wassel = (f == f->area->sel);
- area_moveto(view_findarea(f->view, f->oldarea, true), f);
+ area_moveto(view_findarea(f->view, f->oldarea, true),
+ f);
if(wassel)
frame_focus(f);
}
@@ -653,7 +655,8 @@
for(ff=a->frame; ff; ff=ff->anext)
if(ff->client->urgent) break;
if(urgent || ff == nil)
- event("%sUrgentTag %s %s\n", cnot, cfrom, f->view->name);
+ event("%sUrgentTag %s %s\n",
+ cnot, cfrom, f->view->name);
}
}
}
@@ -1080,7 +1083,7 @@
}
j = 0;
- while(buf[n] && n < sizeof(buf) && j < 32) {
+ while(buf[n] && n < sizeof(buf) && j < 32) {
/* Check for regex. */
if(buf[n] == '/') {
for(i=n+1; i < sizeof(buf) - 1; i++)
diff -r 621b1245dc16 -r 96ca2f9f1423 cmd/wmii/column.c
--- a/cmd/wmii/column.c Sat Jan 10 17:53:19 2009 -0500
+++ b/cmd/wmii/column.c Wed Jan 28 18:31:08 2009 -0500
@@ -504,7 +504,7 @@
static void
column_squeeze(Area *a) {
- static Vector_ptr fvec;
+ static Vector_ptr fvec;
Frame *f;
int surplus, osurplus, dy, i;
@@ -611,7 +611,8 @@
f->collapsed = (f != a->sel);
break;
default:
- fprint(2, "Dieing: %s: screen: %d a: %p mode: %x floating: %d\n", v->name, a->screen, a, a->mode, a->floating);
+ fprint(2, "Dieing: %s: screen: %d a: %p mode: %x floating: %d\n",
+ v->name, a->screen, a, a->mode, a->floating);
die("not reached");
break;
}
diff -r 621b1245dc16 -r 96ca2f9f1423 cmd/wmii/div.c
--- a/cmd/wmii/div.c Sat Jan 10 17:53:19 2009 -0500
+++ b/cmd/wmii/div.c Wed Jan 28 18:31:08 2009 -0500
@@ -27,7 +27,8 @@
| EnterWindowMask
| ButtonPressMask
| ButtonReleaseMask;
- d->w = createwindow(&scr.root, Rect(0, 0, 1, 1), scr.depth, InputOutput, &wa,
+ d->w = createwindow(&scr.root, Rect(0, 0, 1, 1), scr.depth,
+ InputOutput, &wa,
CWOverrideRedirect
| CWEventMask
| CWCursor);
diff -r 621b1245dc16 -r 96ca2f9f1423 cmd/wmii/event.c
--- a/cmd/wmii/event.c Sat Jan 10 17:53:19 2009 -0500
+++ b/cmd/wmii/event.c Wed Jan 28 18:31:08 2009 -0500
@@ -22,31 +22,31 @@
static int
findtime(Display *d, XEvent *e, XPointer v) {
- Window *w;
+ Window *w;
- w = (Window*)v;
- if(e->type == PropertyNotify && e->xproperty.window == w->w) {
- xtime = e->xproperty.time;
- return true;
- }
- return false;
+ w = (Window*)v;
+ if(e->type == PropertyNotify && e->xproperty.window == w->w) {
+ xtime = e->xproperty.time;
+ return true;
+ }
+ return false;
}
void
xtime_kludge(void) {
/* Round trip. */
- static Window *w;
- WinAttr wa;
- XEvent e;
- long l;
+ static Window *w;
+ WinAttr wa;
+ XEvent e;
+ long l;
if(w == nil) {
w = createwindow(&scr.root, Rect(0, 0, 1, 1), 0, InputOnly, &wa, 0);
selectinput(w, PropertyChangeMask);
}
- changeprop_long(w, "ATOM", "ATOM", &l, 0);
+ changeprop_long(w, "ATOM", "ATOM", &l, 0);
sync();
- XIfEvent(display, &e, findtime, (void*)w);
+ XIfEvent(display, &e, findtime, (void*)w);
}
uint
@@ -154,12 +154,13 @@
Window *w;
Client *c;
- if((w = findwin(ev->window)))
+ if((w = findwin(ev->window)))
handle(w, destroy, ev);
else {
if((c = win2client(ev->window)))
fprint(2, "Badness: Unhandled DestroyNotify: "
- "Client: %p, Window: %W, Name: %s\n", c, &c->w, c->name);
+ "Client: %p, Window: %W, Name: %s\n",
+ c, &c->w, c->name);
}
}
@@ -171,7 +172,7 @@
if(ev->mode != NotifyNormal)
return;
- if((w = findwin(ev->window)))
+ if((w = findwin(ev->window)))
handle(w, enter, ev);
}
@@ -180,7 +181,7 @@
Window *w;
xtime = ev->time;
- if((w = findwin(ev->window)))
+ if((w = findwin(ev->window)))
handle(w, leave, ev);
}
@@ -217,7 +218,7 @@
print_focus("focusin", nil, "<nil>");
disp.focus = nil;
}
- else if((w = findwin(ev->window)))
+ else if((w = findwin(ev->window)))
handle(w, focusin, ev);
else if(ev->mode == NotifyGrab) {
/* Some unmanaged window has grabbed focus */
@@ -247,7 +248,7 @@
if((ev->mode == NotifyGrab)
&& XCheckMaskEvent(display, KeyPressMask, &me))
dispatch_event(&me);
- else if((w = findwin(ev->window)))
+ else if((w = findwin(ev->window)))
handle(w, focusout, ev);
}
@@ -256,7 +257,7 @@
Window *w;
if(ev->count == 0)
- if((w = findwin(ev->window)))
+ if((w = findwin(ev->window)))
handle(w, expose, ev);
}
@@ -265,7 +266,7 @@
Window *w;
xtime = ev->time;
- if((w = findwin(ev->window)))
+ if((w = findwin(ev->window)))
handle(w, kdown, ev);
}
@@ -299,7 +300,7 @@
Window *w;
xtime = ev->time;
- if((w = findwin(ev->window)))
+ if((w = findwin(ev->window)))
handle(w, property, ev);
}
@@ -308,7 +309,7 @@
Window *w;
ignoreenter = ev->serial;
- if((w = findwin(ev->window)))
+ if((w = findwin(ev->window)))
handle(w, map, ev);
}
diff -r 621b1245dc16 -r 96ca2f9f1423 cmd/wmii/frame.c
--- a/cmd/wmii/frame.c Sat Jan 10 17:53:19 2009 -0500
+++ b/cmd/wmii/frame.c Wed Jan 28 18:31:08 2009 -0500
@@ -212,7 +212,8 @@
f = c->sel;
if(disp.focus != c || selclient() != c) {
Dprint(DFocus, "enter_notify(f) => [%C]%s%s\n",
- f->client, f->client->name, ignoreenter == e->serial ? " (ignored)" : "");
+ f->client, f->client->name,
+ ignoreenter == e->serial ? " (ignored)" : "");
if(e->detail != NotifyInferior)
if(e->serial != ignoreenter && (f->area->floating || !f->collapsed))
if(!(c->w.ewmh.type & TypeSplash))
@@ -300,7 +301,7 @@
#define ADJ(PE, ME) \
if(c->fullscreen >= 0) \
return r; \
- \
+ \
if(!floating) { \
r.min.x PE 1; \
r.min.y PE labelh(def.font); \
@@ -344,7 +345,8 @@
int collapsed, dx;
if(btassert("8 full", Dx(r) <= 0 || Dy(r) < 0
- || Dy(r) == 0 && (!f->area->max || resizing) && !f->collapsed)) {
+ || Dy(r) == 0 && (!f->area->max || resizing)
+ && !f->collapsed)) {
fprint(2, "Frame rect: %R\n", r);
r.max.x = min(r.min.x+1, r.max.x);
r.max.y = min(r.min.y+1, r.max.y);
diff -r 621b1245dc16 -r 96ca2f9f1423 cmd/wmii/fs.c
--- a/cmd/wmii/fs.c Sat Jan 10 17:53:19 2009 -0500
+++ b/cmd/wmii/fs.c Wed Jan 28 18:31:08 2009 -0500
@@ -77,7 +77,7 @@
};
/* ad-hoc file tree. Empty names ("") indicate dynamic entries to be filled
- * in by lookup_file
+ * in by lookup_file
*/
static IxpDirtab
dirtab_root[]= {{".", QTDIR, FsRoot, 0500|DMDIR },
@@ -87,10 +87,10 @@
{"client", QTDIR, FsDClients, 0500|DMDIR },
{"tag", QTDIR, FsDTags, 0500|DMDIR },
{"ctl", QTAPPEND, FsFRctl, 0600|DMAPPEND },
- {"colrules", QTFILE, FsFColRules, 0600 },
+ {"colrules", QTFILE, FsFColRules, 0600 },
{"event", QTFILE, FsFEvent, 0600 },
{"keys", QTFILE, FsFKeys, 0600 },
- {"tagrules", QTFILE, FsFTagRules, 0600 },
+ {"tagrules", QTFILE, FsFTagRules, 0600 },
{nil}},
dirtab_clients[]={{".", QTDIR, FsDClients, 0500|DMDIR },
{"", QTDIR, FsDClient, 0500|DMDIR },
@@ -232,11 +232,11 @@
last = &ret;
ret = nil;
for(; dir->name; dir++) {
-# define push_file(nam) \
- file = ixp_srv_getfile(); \
- *last = file; \
- last = &file->next; \
- file->tab = *dir; \
+# define push_file(nam) \
+ file = ixp_srv_getfile(); \
+ *last = file; \
+ last = &file->next; \
+ file->tab = *dir; \
file->tab.name = estrdup(nam)
/* Dynamic dirs */
if(dir->name[0] == '\0') {
@@ -483,7 +483,7 @@
return;
}
}
- /*
+ /*
* This is an assert because this should this should not be called if
* the file is not open for reading.
*/
@@ -521,7 +521,9 @@
return;
case FsFClabel:
ixp_srv_data2cstring(r);
- utfecpy(f->p.client->name, f->p.client->name+sizeof(client->name), r->ifcall.io.data);
+ utfecpy(f->p.client->name,
+ f->p.client->name+sizeof(client->name),
+ r->ifcall.io.data);
frame_draw(f->p.client->sel);
update_class(f->p.client);
r->ofcall.io.count = r->ifcall.io.count;
diff -r 621b1245dc16 -r 96ca2f9f1423 cmd/wmii/geom.c
--- a/cmd/wmii/geom.c Sat Jan 10 17:53:19 2009 -0500
+++ b/cmd/wmii/geom.c Wed Jan 28 18:31:08 2009 -0500
@@ -66,7 +66,7 @@
case SWest: return cursor[CurSWCorner];
case South:
case North: return cursor[CurDVArrow];
- case East:
+ case East:
case West: return cursor[CurDHArrow];
default: return cursor[CurMove];
}
@@ -86,7 +86,7 @@
if(src.min.y != dst.min.y
&& src.max.y == dst.max.y)
corner |= South;
- else
+ else
corner |= North;
return corner;
diff -r 621b1245dc16 -r 96ca2f9f1423 cmd/wmii/main.c
--- a/cmd/wmii/main.c Sat Jan 10 17:53:19 2009 -0500
+++ b/cmd/wmii/main.c Wed Jan 28 18:31:08 2009 -0500
@@ -159,12 +159,12 @@
int i, n, m;
#ifdef notdef
- d.x = Dx(scr.rect) - Dx(screen->r);
- d.y = Dy(scr.rect) - Dy(screen->r);
- for(v=view; v; v=v->next) {
- v->r.max.x += d.x;
- v->r.max.y += d.y;
- }
+ d.x = Dx(scr.rect) - Dx(screen->r);
+ d.y = Dy(scr.rect) - Dy(screen->r);
+ for(v=view; v; v=v->next) {
+ v->r.max.x += d.x;
+ v->r.max.y += d.y;
+ }
#endif
/* Reallocate screens, zero any new ones. */
@@ -215,7 +215,7 @@
static void
cleanup(void) {
- while(client)
+ while(client)
client_destroy(client);
ixp_server_close(&srv);
close(sleeperfd);
diff -r 621b1245dc16 -r 96ca2f9f1423 cmd/wmii/mouse.c
--- a/cmd/wmii/mouse.c Sat Jan 10 17:53:19 2009 -0500
+++ b/cmd/wmii/mouse.c Wed Jan 28 18:31:08 2009 -0500
@@ -99,22 +99,22 @@
/* Yes, yes, macros are evil. So are patterns. */
#define frob(x, y) \
- Rectangle *rp; \
- int i, tx; \
- \
- for(i=0; i < nrect; i++) { \
- rp = &rects[i]; \
- if((rp->min.y <= r->max.y) && (rp->max.y >= r->min.y)) { \
- tx = rp->min.x; \
- if(abs(tx - x) <= abs(dx)) \
- dx = tx - x; \
- \
- tx = rp->max.x; \
- if(abs(tx - x) <= abs(dx)) \
- dx = tx - x; \
- } \
- } \
- return dx \
+ Rectangle *rp; \
+ int i, tx; \
+ \
+ for(i=0; i < nrect; i++) { \
+ rp = &rects[i]; \
+ if((rp->min.y <= r->max.y) && (rp->max.y >= r->min.y)) { \
+ tx = rp->min.x; \
+ if(abs(tx - x) <= abs(dx)) \
+ dx = tx - x; \
+ \
+ tx = rp->max.x; \
+ if(abs(tx - x) <= abs(dx)) \
+ dx = tx - x; \
+ } \
+ } \
+ return dx \
static int
snap_hline(Rectangle *rects, int nrect, int dx, Rectangle *r, int y) {
@@ -598,7 +598,8 @@
if(f->aprev && p.y <= 2
|| f->anext && r.max.y - p.y <= 2) {
cur = cursor[CurDVArrow];
- if(exec) mouse_tempvertresize(f->area, addpt(p, f->r.min));
+ if(exec)
+ mouse_tempvertresize(f->area, addpt(p, f->r.min));
}
}
diff -r 621b1245dc16 -r 96ca2f9f1423 cmd/wmii/root.c
--- a/cmd/wmii/root.c Sat Jan 10 17:53:19 2009 -0500
+++ b/cmd/wmii/root.c Wed Jan 28 18:31:08 2009 -0500
@@ -68,7 +68,7 @@
r = rectsetorigin(Rect(0, 0, 1, 1), Pt(e->x_root, e->y_root));
r2 = constrain(r, 0);
if(!eqrect(r, r2))
- warppointer(r2.min);
+ warppointer(r2.min);
}
static void
diff -r 621b1245dc16 -r 96ca2f9f1423 cmd/wmii/view.c
--- a/cmd/wmii/view.c Sat Jan 10 17:53:19 2009 -0500
+++ b/cmd/wmii/view.c Wed Jan 28 18:31:08 2009 -0500
@@ -362,7 +362,8 @@
* last focused frame didn't float. Important when
* tagging with +foo.
*/
- else if(starting || c->sel && c->sel->area && !c->sel->area->floating)
+ else if(starting
+ || c->sel && c->sel->area && !c->sel->area->floating)
a = v->firstarea;
}
if(!a->floating && view_fullscreen_p(v, a->screen))
@@ -372,11 +373,15 @@
/* TODO: Decide whether to focus this frame */
bool newgroup = !c->group
|| c->group->ref == 1
- || view_selclient(v) && (view_selclient(v)->group == c->group)
- || group_leader(c->group) && !client_viewframe(group_leader(c->group),
- c->sel->view);
+ || view_selclient(v)
+ && view_selclient(v)->group == c->group
+ || group_leader(c->group)
+ && !client_viewframe(group_leader(c->group),
+ c->sel->view);
+
if(!(c->w.ewmh.type & (TypeSplash|TypeDock))) {
- if(newgroup && !(c->tagre.regex && regexec(c->tagre.regc, v->name, nil, 0)))
+ if(newgroup
+ && !(c->tagre.regex && regexec(c->tagre.regc, v->name, nil, 0)))
frame_focus(f);
else if(c->group && f->area->sel->client->group == c->group)
/* XXX: Stack. */
diff -r 621b1245dc16 -r 96ca2f9f1423 cmd/wmii/x11.c
--- a/cmd/wmii/x11.c Sat Jan 10 17:53:19 2009 -0500
+++ b/cmd/wmii/x11.c Wed Jan 28 18:31:08 2009 -0500
@@ -174,7 +174,9 @@
scr.black = BlackPixel(display, scr.screen);
scr.root.w = RootWindow(display, scr.screen);
- scr.root.r = Rect(0, 0, DisplayWidth(display, scr.screen), DisplayHeight(display, scr.screen));
+ scr.root.r = Rect(0, 0,
+ DisplayWidth(display, scr.screen),
+ DisplayHeight(display, scr.screen));
scr.rect = scr.root.r;
scr.root.parent = &scr.root;
@@ -258,7 +260,9 @@
/* Windows */
Window*
-createwindow_visual(Window *parent, Rectangle r, int depth, Visual *vis, uint class, WinAttr *wa, int valmask) {
+createwindow_visual(Window *parent, Rectangle r,
+ int depth, Visual *vis, uint class,
+ WinAttr *wa, int valmask) {
Window *w;
assert(parent->type == WWindow);
@@ -562,7 +566,7 @@
setgccol(dst, col);
if(font->set)
- Xutf8DrawString(display, dst->w,
+ Xutf8DrawString(display, dst->w,
font->set, dst->gc,
x, y,
buf, len);
@@ -740,8 +744,10 @@
}
void
-changeproperty(Window *w, char *prop, char *type, int width, uchar data[], int n) {
- XChangeProperty(display, w->w, xatom(prop), xatom(type), width, PropModeReplace, data, n);
+changeproperty(Window *w, char *prop, char *type,
+ int width, uchar data[], int n) {
+ XChangeProperty(display, w->w, xatom(prop), xatom(type), width,
+ PropModeReplace, data, n);
}
void
@@ -794,7 +800,8 @@
}
static ulong
-getprop(Window *w, char *prop, char *type, Atom *actual, int *format, ulong offset, uchar **ret, ulong length) {
+getprop(Window *w, char *prop, char *type, Atom *actual, int *format,
+ ulong offset, uchar **ret, ulong length) {
Atom typea;
ulong n, extra;
int status;
@@ -817,14 +824,16 @@
}
ulong
-getproperty(Window *w, char *prop, char *type, Atom *actual, ulong offset, uchar **ret, ulong length) {
+getproperty(Window *w, char *prop, char *type, Atom *actual,
+ ulong offset, uchar **ret, ulong length) {
int format;
return getprop(w, prop, type, actual, &format, offset, ret, length);
}
ulong
-getprop_long(Window *w, char *prop, char *type, ulong offset, long **ret, ulong length) {
+getprop_long(Window *w, char *prop, char *type,
+ ulong offset, long **ret, ulong length) {
Atom actual;
ulong n;
int format;
@@ -838,7 +847,8 @@
}
ulong
-getprop_ulong(Window *w, char *prop, char *type, ulong offset, ulong **ret, ulong length) {
+getprop_ulong(Window *w, char *prop, char *type,
+ ulong offset, ulong **ret, ulong length) {
return getprop_long(w, prop, type, offset, (long**)ret, length);
}
@@ -941,7 +951,8 @@
uint ui;
int i;
- return XQueryPointer(display, scr.root.w, &win, &win, &i, &i, &pt.x, &pt.y, &ui);
+ return XQueryPointer(display, scr.root.w, &win, &win, &i, &i,
+ &pt.x, &pt.y, &ui);
}
void
@@ -968,7 +979,8 @@
Point pt;
XWindow w;
- XTranslateCoordinates(display, src->w, dst->w, sp.x, sp.y, &pt.x, &pt.y, &w);
+ XTranslateCoordinates(display, src->w, dst->w, sp.x, sp.y,
+ &pt.x, &pt.y, &w);
return pt;
}
Received on Wed Jan 28 2009 - 23:32:16 UTC
This archive was generated by hypermail 2.2.0 : Wed Jan 28 2009 - 23:36:09 UTC