wm.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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], tag[256];
  19. int proto;
  20. int x, y, w, h;
  21. int tx, ty, tw, th;
  22. int basew, baseh, incw, inch, maxw, maxh, minw, minh;
  23. long flags;
  24. Window win;
  25. Window trans;
  26. Window title;
  27. Client *next;
  28. Client *snext;
  29. };
  30. struct Key {
  31. unsigned long mod;
  32. KeySym keysym;
  33. void (*func)(void *aux);
  34. void *aux;
  35. };
  36. extern Display *dpy;
  37. extern Window root, barwin;
  38. extern Atom wm_atom[WMLast], net_atom[NetLast];
  39. extern Cursor cursor[CurLast];
  40. extern Bool running, sel_screen, grid;
  41. extern void (*handler[LASTEvent]) (XEvent *);
  42. extern int screen, sx, sy, sw, sh, bx, by, bw, bh;
  43. extern char statustext[1024], tag[256];
  44. extern Brush brush;
  45. extern Client *clients, *stack;
  46. /* bar.c */
  47. extern void draw_bar();
  48. /* cmd.c */
  49. extern void run(void *aux);
  50. extern void quit(void *aux);
  51. extern void kill(void *aux);
  52. extern void sel(void *aux);
  53. /* client.c */
  54. extern void manage(Window w, XWindowAttributes *wa);
  55. extern void unmanage(Client *c);
  56. extern Client *getclient(Window w);
  57. extern void focus(Client *c);
  58. extern void update_name(Client *c);
  59. extern void draw_client(Client *c);
  60. extern void resize(Client *c);
  61. extern void update_size(Client *c);
  62. extern Client *gettitle(Window w);
  63. extern void raise(Client *c);
  64. extern void lower(Client *c);
  65. /* event.c */
  66. extern void discard_events(long even_mask);
  67. /* key.c */
  68. extern void update_keys();
  69. extern void keypress(XEvent *e);
  70. /* mouse.c */
  71. extern void mresize(Client *c);
  72. extern void mmove(Client *c);
  73. /* wm.c */
  74. extern int error_handler(Display *dpy, XErrorEvent *error);
  75. extern void send_message(Window w, Atom a, long value);
  76. extern int win_proto(Window w);