layout.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. #include "client.h"
  9. /* Check lateral direction (if p is Right or Left) */
  10. #define LDIR(P) (P < Top)
  11. /* Reverse position */
  12. #define RPOS(P) (P & 1 ? P - 1 : P + 1)
  13. /* geo comparaison */
  14. #define GEO_CHECK2(g1, g2, p) (LDIR(p) ? ((g1).h == (g2).h) : ((g1).w == (g2).w))
  15. #define GEO_CHECK_ROW(g1, g2, p) \
  16. (LDIR(p) \
  17. ? ((g1).y >= (g2).y && ((g1).y + (g1).h) <= ((g2).y + (g2).h)) \
  18. : ((g1).x >= (g2).x && ((g1).x + (g1).w) <= ((g2).x + (g2).w)))
  19. #define GEO_PARENTROW(g1, g2, p) \
  20. (LDIR(p) \
  21. ? (p == Left ? ((g1).x == (g2).x) : ((g1).x + (g1).w == (g2).x + (g2).w)) \
  22. : (p == Top ? ((g1).y == (g2).y) : ((g1).y + (g1).h == (g2).y + (g2).h)))
  23. /* Debug */
  24. #define DGEO(G) printf(": %d %d %d %d\n", G.x, G.y, G.w, G.h)
  25. void layout_save_set(struct tag *t);
  26. void layout_free_set(struct tag *t);
  27. void layout_split_integrate(struct client *c, struct client *sc);
  28. void layout_split_arrange_closed(struct client *ghost);
  29. void layout_fix_hole(struct client *c);
  30. void layout_client(struct client *c);
  31. void uicb_layout_vmirror(Uicb cmd);
  32. void uicb_layout_hmirror(Uicb cmd);
  33. void uicb_layout_rotate_left(Uicb cmd);
  34. void uicb_layout_rotate_right(Uicb cmd);
  35. void uicb_layout_prev_set(Uicb cmd);
  36. void uicb_layout_next_set(Uicb cmd);
  37. /* Generated */
  38. void uicb_layout_integrate_Left(Uicb);
  39. void uicb_layout_integrate_Right(Uicb);
  40. void uicb_layout_integrate_Top(Uicb);
  41. void uicb_layout_integrate_Bottom(Uicb);
  42. #endif /* LAYOUT_H */