瀏覽代碼

Rename split_*mirror and begin rotate

Martin Duquesnoy 12 年之前
父節點
當前提交
3902489af5
共有 3 個文件被更改,包括 33 次插入8 次删除
  1. 3 2
      wmfs2/src/config.h
  2. 27 3
      wmfs2/src/layout.c
  3. 3 3
      wmfs2/src/layout.h

+ 3 - 2
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 },

+ 27 - 3
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;
 

+ 3 - 3
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 */