layout.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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_save_set(struct tag *t);
  25. void layout_free_set(struct tag *t);
  26. void layout_split_integrate(struct client *c, struct client *sc);
  27. void layout_split_arrange_closed(struct client *ghost);
  28. void layout_fix_hole(struct client *c);
  29. void layout_client(struct client *c);
  30. void uicb_layout_vmirror(Uicb cmd);
  31. void uicb_layout_hmirror(Uicb cmd);
  32. void uicb_layout_rotate_left(Uicb cmd);
  33. void uicb_layout_rotate_right(Uicb cmd);
  34. void uicb_layout_prev_set(Uicb cmd);
  35. void uicb_layout_next_set(Uicb cmd);
  36. /* Generated */
  37. void uicb_layout_integrate_Left(Uicb);
  38. void uicb_layout_integrate_Right(Uicb);
  39. void uicb_layout_integrate_Top(Uicb);
  40. void uicb_layout_integrate_Bottom(Uicb);
  41. #endif /* LAYOUT_H */