barwin.h 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * wmfs2 by Martin Duquesnoy <xorg62@gmail.com> { for(i = 2011; i < 2111; ++i) ©(i); }
  3. * For license, see COPYING.
  4. */
  5. #ifndef BARWIN_H
  6. #define BARWIN_H
  7. #include "wmfs.h"
  8. #define BARWIN_MASK \
  9. (SubstructureRedirectMask | SubstructureNotifyMask \
  10. | ButtonMask | MouseMask | ExposureMask | VisibilityChangeMask \
  11. | StructureNotifyMask | SubstructureRedirectMask)
  12. #define BARWIN_ENTERMASK (EnterWindowMask | LeaveWindowMask | FocusChangeMask)
  13. #define BARWIN_WINCW (CWOverrideRedirect | CWBackPixmap | CWEventMask)
  14. #define barwin_delete_subwin(b) XDestroySubwindows(W->dpy, b->win)
  15. #define barwin_map_subwin(b) XMapSubwindows(W->dpy, b->win)
  16. #define barwin_unmap_subwin(b) XUnmapSubwindows(W->dpy, b->win)
  17. #define barwin_refresh(b) XCopyArea(W->dpy, b->dr, b->win, W->gc, 0, 0, b->geo.w, b->geo.h, 0, 0)
  18. #define barwin_map(b) XMapWindow(W->dpy, b->win);
  19. #define barwin_unmap(b) XUnmapWindow(W->dpy, b->win);
  20. struct barwin* barwin_new(Window parent, int x, int y, int w, int h, Color fg, Color bg, bool entermask);
  21. void barwin_remove(struct barwin *b);
  22. void barwin_resize(struct barwin *b, int w, int h);
  23. void barwin_mousebind_new(struct barwin *b, unsigned int button, bool u, struct geo a, void (*func)(Uicb), Uicb cmd);
  24. void barwin_refresh_color(struct barwin *b);
  25. #endif /* BARWIN_H */