wm.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
  3. * See LICENSE file for license details.
  4. */
  5. #include "config.h"
  6. #include "draw.h"
  7. #include "util.h"
  8. #include <X11/Xutil.h>
  9. /* atoms */
  10. enum { WMState, WMProtocols, WMDelete, WMLast };
  11. enum { NetSupported, NetWMName, NetLast };
  12. /* cursor */
  13. enum { CurNormal, CurResize, CurMove, CurInput, CurLast };
  14. /* rects */
  15. enum { RFloat, RGrid, RLast };
  16. typedef struct Client Client;
  17. typedef struct Key Key;
  18. struct Client {
  19. char name[256];
  20. char tag[256];
  21. int proto;
  22. unsigned int border;
  23. Bool fixedsize;
  24. Window win;
  25. Window trans;
  26. Window title;
  27. XSizeHints size;
  28. XRectangle r[RLast];
  29. Client *next;
  30. Client *snext;
  31. };
  32. struct Key {
  33. unsigned long mod;
  34. KeySym keysym;
  35. void (*func)(char *arg);
  36. char *arg;
  37. };
  38. extern Display *dpy;
  39. extern Window root, barwin;
  40. extern Atom wm_atom[WMLast], net_atom[NetLast];
  41. extern Cursor cursor[CurLast];
  42. extern XRectangle rect, barrect;
  43. extern Bool running;
  44. extern Bool grid;
  45. extern void (*handler[LASTEvent]) (XEvent *);
  46. extern int screen, sel_screen;
  47. extern char *bartext, tag[256];
  48. extern Brush brush;
  49. extern Client *client;
  50. /* bar.c */
  51. extern void draw_bar();
  52. /* cmd.c */
  53. extern void run(char *arg);
  54. /* client.c */
  55. extern Client *create_client(Window w, XWindowAttributes *wa);
  56. extern void manage(Client *c);
  57. /* key.c */
  58. extern void update_keys();
  59. /* wm.c */
  60. extern int win_proto(Window w);