Просмотр исходного кода

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

Martin Duquesnoy 12 лет назад
Родитель
Сommit
db0f2d27fd
3 измененных файлов с 34 добавлено и 0 удалено
  1. 4 0
      wmfs2/src/config.h
  2. 27 0
      wmfs2/src/layout.c
  3. 3 0
      wmfs2/src/layout.h

+ 4 - 0
wmfs2/src/config.h

@@ -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 },

+ 27 - 0
wmfs2/src/layout.c

@@ -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);
+     }
+}

+ 3 - 0
wmfs2/src/layout.h

@@ -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 */