layout.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * wmfs2 by Martin Duquesnoy <xorg62@gmail.com> { for(i = 2011; i < 2111; ++i) ©(i); }
  3. * For license, see COPYING.
  4. */
  5. #ifndef LAYOUT_H
  6. #define LAYOUT_H
  7. #include "wmfs.h"
  8. /* Check lateral direction (if p is Right or Left) */
  9. #define LDIR(P) (P < Top)
  10. /* Reverse position */
  11. #define RPOS(P) (P & 1 ? P - 1 : P + 1)
  12. /* geo comparaison */
  13. #define GEO_CHECK2(g1, g2, p) (LDIR(p) ? ((g1).h == (g2).h) : ((g1).w == (g2).w))
  14. #define GEO_CHECK_ROW(g1, g2, p) \
  15. (LDIR(p) \
  16. ? ((g1).y >= (g2).y && ((g1).y + (g1).h) <= ((g2).y + (g2).h)) \
  17. : ((g1).x >= (g2).x && ((g1).x + (g1).w) <= ((g2).x + (g2).w)))
  18. #define GEO_PARENTROW(g1, g2, p) \
  19. (LDIR(p) \
  20. ? (p == Left ? ((g1).x == (g2).x) : ((g1).x + (g1).w == (g2).x + (g2).w)) \
  21. : (p == Top ? ((g1).y == (g2).y) : ((g1).y + (g1).h == (g2).y + (g2).h)))
  22. /* Debug */
  23. #define DGEO(G) printf(": %d %d %d %d\n", G.x, G.y, G.w, G.h)
  24. void layout_split_integrate(struct client *c, struct client *sc);
  25. void layout_split_arrange_closed(struct client *ghost);
  26. void uicb_layout_vmirror(Uicb cmd);
  27. void uicb_layout_hmirror(Uicb cmd);
  28. void uicb_layout_rotate_left(Uicb cmd);
  29. void uicb_layout_rotate_right(Uicb cmd);
  30. #endif /* LAYOUT_H */