diff --git a/wmfs2/src/config.h b/wmfs2/src/config.h index edb24ac..4538af9 100644 --- a/wmfs2/src/config.h +++ b/wmfs2/src/config.h @@ -31,8 +31,9 @@ static const struct { char *name; void (*func)(Uicb cmd); } uicb_list[] = { "tag_prev", uicb_tag_prev }, /* Layout */ - { "split_vmirror", uicb_layout_split_vmirror }, - { "split_hmirror", uicb_layout_split_hmirror }, + { "layout_vmirror", uicb_layout_vmirror }, + { "layout_hmirror", uicb_layout_hmirror }, + { "layout_rotate", uicb_layout_rotate }, /* Client */ { "client_close", uicb_client_close }, diff --git a/wmfs2/src/layout.c b/wmfs2/src/layout.c index 470894b..99a705e 100644 --- a/wmfs2/src/layout.c +++ b/wmfs2/src/layout.c @@ -168,12 +168,36 @@ layout_split_integrate(struct client *c, struct client *sc) client_moveresize(c, g); } +void +layout_rotate(struct tag *t, bool left) +{ + struct client *c; + struct geo g; + + SLIST_FOREACH(c, &t->clients, tnext) + { + /* g = c->geo; + c->geo.x = g.y; + c->geo.y = g.x; + c->geo.w = g.h; + c->geo.h = g.w;*/ + + client_moveresize(c, c->geo); + } +} + +void +uicb_layout_rotate(Uicb cmd) +{ + layout_rotate(W->screen->seltag, false); +} + /* * Really simple functions, don't need static no-uicb backend - * so we evitate if(vertical) .. else + * so we avoid the use of if(vertical) .. else */ void -uicb_layout_split_vmirror(Uicb cmd) +uicb_layout_vmirror(Uicb cmd) { struct client *c; @@ -185,7 +209,7 @@ uicb_layout_split_vmirror(Uicb cmd) } void -uicb_layout_split_hmirror(Uicb cmd) +uicb_layout_hmirror(Uicb cmd) { struct client *c; diff --git a/wmfs2/src/layout.h b/wmfs2/src/layout.h index 61e5b3b..6e16285 100644 --- a/wmfs2/src/layout.h +++ b/wmfs2/src/layout.h @@ -31,9 +31,9 @@ void layout_split_integrate(struct client *c, struct client *sc); void layout_split_arrange_closed(struct client *ghost); -void uicb_layout_split_vmirror(Uicb cmd); -void uicb_layout_split_hmirror(Uicb cmd); - +void uicb_layout_vmirror(Uicb cmd); +void uicb_layout_hmirror(Uicb cmd); +void uicb_layout_rotate(Uicb cmd); #endif /* LAYOUT_H */