Add split_vmirror & split_hmirror layout function: http://ompldr.org/vYWgzZw

This commit is contained in:
Martin Duquesnoy 2011-09-22 08:34:50 +02:00
parent 736b55b6c7
commit db0f2d27fd
3 changed files with 34 additions and 0 deletions

View File

@ -30,6 +30,10 @@ static const struct { char *name; void (*func)(Uicb cmd); } uicb_list[] =
{ "tag_next", uicb_tag_next },
{ "tag_prev", uicb_tag_prev },
/* Layout */
{ "split_vmirror", uicb_layout_split_vmirror },
{ "split_hmirror", uicb_layout_split_hmirror },
/* Client */
{ "client_close", uicb_client_close },
{ "client_resize_right", uicb_client_resize_Right },

View File

@ -168,3 +168,30 @@ layout_split_integrate(struct client *c, struct client *sc)
client_moveresize(c, g);
}
/*
* Really simple functions, don't need static no-uicb backend
* so we evitate if(vertical) .. else
*/
void
uicb_layout_split_vmirror(Uicb cmd)
{
struct client *c;
SLIST_FOREACH(c, &W->screen->seltag->clients, tnext)
{
c->geo.x = W->screen->ugeo.w - (c->geo.x + c->geo.w);
client_moveresize(c, c->geo);
}
}
void
uicb_layout_split_hmirror(Uicb cmd)
{
struct client *c;
SLIST_FOREACH(c, &W->screen->seltag->clients, tnext)
{
c->geo.y = W->screen->ugeo.h - (c->geo.y + c->geo.h);
client_moveresize(c, c->geo);
}
}

View File

@ -31,6 +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);
#endif /* LAYOUT_H */