screen.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * wmfs2 by Martin Duquesnoy <xorg62@gmail.com> { for(i = 2011; i < 2111; ++i) ©(i); }
  3. * For license, see COPYING.
  4. */
  5. #ifndef SCREEN_H
  6. #define SCREEN_H
  7. #include "wmfs.h"
  8. #include "util.h"
  9. static inline struct screen*
  10. screen_gb_id(int id)
  11. {
  12. struct screen *s;
  13. SLIST_FOREACH(s, &W->h.screen, next)
  14. if(s->id == id)
  15. return s;
  16. return SLIST_FIRST(&W->h.screen);
  17. }
  18. static inline struct screen*
  19. screen_gb_geo(int x, int y)
  20. {
  21. struct screen *s;
  22. SLIST_FOREACH(s, &W->h.screen, next)
  23. if(INAREA(x, y, s->geo))
  24. return s;
  25. return SLIST_FIRST(&W->h.screen);
  26. }
  27. static inline struct screen*
  28. screen_gb_mouse(void)
  29. {
  30. Window w;
  31. int d, x, y;
  32. XQueryPointer(W->dpy, W->root, &w, &w, &x, &y, &d, &d, (unsigned int *)&d);
  33. return screen_gb_geo(x, y);
  34. }
  35. void screen_init(void);
  36. struct screen* screen_update_sel(void);
  37. void screen_free(void);
  38. void uicb_screen_next(Uicb cmd);
  39. void uicb_screen_prev(Uicb cmd);
  40. void uicb_screen_move_client_next(Uicb cmd);
  41. void uicb_screen_move_client_prev(Uicb cmd);
  42. #endif /* SCREEN_H */