wm.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. #define WM_PROTOCOL_DELWIN 1
  10. typedef struct Client Client;
  11. typedef struct Key Key;
  12. /* atoms */
  13. enum { WMProtocols, WMDelete, WMLast };
  14. enum { NetSupported, NetWMName, NetLast };
  15. /* cursor */
  16. enum { CurNormal, CurResize, CurMove, CurInput, CurLast };
  17. struct Client {
  18. char name[256];
  19. char *tags[TLast];
  20. int proto;
  21. int x, y, w, h;
  22. int tx, ty, tw, th;
  23. int basew, baseh, incw, inch, maxw, maxh, minw, minh;
  24. int grav;
  25. unsigned int border;
  26. long flags;
  27. Window win;
  28. Window trans;
  29. Window title;
  30. Client *next;
  31. Client *snext;
  32. };
  33. struct Key {
  34. unsigned long mod;
  35. KeySym keysym;
  36. void (*func)(void *aux);
  37. void *aux;
  38. };
  39. extern Display *dpy;
  40. extern Window root, barwin;
  41. extern Atom wm_atom[WMLast], net_atom[NetLast];
  42. extern Cursor cursor[CurLast];
  43. extern Bool running, issel;
  44. extern void (*handler[LASTEvent]) (XEvent *);
  45. extern void (*arrange)(void *aux);
  46. extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh;
  47. extern char stext[1024], *tags[TLast];
  48. extern Brush brush;
  49. extern Client *clients, *stack;
  50. /* bar.c */
  51. extern void draw_bar();
  52. /* client.c */
  53. extern void manage(Window w, XWindowAttributes *wa);
  54. extern void unmanage(Client *c);
  55. extern Client *getclient(Window w);
  56. extern void focus(Client *c);
  57. extern void update_name(Client *c);
  58. extern void draw_client(Client *c);
  59. extern void resize(Client *c);
  60. extern void update_size(Client *c);
  61. extern Client *gettitle(Window w);
  62. extern void raise(Client *c);
  63. extern void lower(Client *c);
  64. extern void kill(void *aux);
  65. extern void sel(void *aux);
  66. extern void max(void *aux);
  67. extern void floating(void *aux);
  68. extern void grid(void *aux);
  69. extern void gravitate(Client *c, Bool invert);
  70. /* event.c */
  71. extern void discard_events(long even_mask);
  72. /* key.c */
  73. extern void update_keys();
  74. extern void keypress(XEvent *e);
  75. /* mouse.c */
  76. extern void mresize(Client *c);
  77. extern void mmove(Client *c);
  78. /* wm.c */
  79. extern int error_handler(Display *dpy, XErrorEvent *error);
  80. extern void send_message(Window w, Atom a, long value);
  81. extern int win_proto(Window w);
  82. extern void run(void *aux);
  83. extern void quit(void *aux);