wm.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. typedef enum Align Align;
  13. enum Align {
  14. NORTH = 0x01,
  15. EAST = 0x02,
  16. SOUTH = 0x04,
  17. WEST = 0x08,
  18. NEAST = NORTH | EAST,
  19. NWEST = NORTH | WEST,
  20. SEAST = SOUTH | EAST,
  21. SWEST = SOUTH | WEST,
  22. CENTER = NEAST | SWEST
  23. };
  24. /* atoms */
  25. enum { WMProtocols, WMDelete, WMLast };
  26. enum { NetSupported, NetWMName, NetLast };
  27. /* cursor */
  28. enum { CurNormal, CurResize, CurMove, CurInput, CurLast };
  29. /* rects */
  30. enum { RFloat, RGrid, RLast };
  31. struct Client {
  32. char name[256];
  33. char tag[256];
  34. unsigned int border;
  35. int proto;
  36. Bool fixedsize;
  37. Window win;
  38. Window trans;
  39. Window title;
  40. XSizeHints size;
  41. XRectangle r[RLast];
  42. Client *next;
  43. Client *snext;
  44. };
  45. struct Key {
  46. unsigned long mod;
  47. KeySym keysym;
  48. void (*func)(void *aux);
  49. void *aux;
  50. };
  51. extern Display *dpy;
  52. extern Window root, barwin;
  53. extern Atom wm_atom[WMLast], net_atom[NetLast];
  54. extern Cursor cursor[CurLast];
  55. extern XRectangle rect, barrect;
  56. extern Bool running, sel_screen, grid;
  57. extern void (*handler[LASTEvent]) (XEvent *);
  58. extern int screen;
  59. extern char statustext[1024], tag[256];
  60. extern Brush brush;
  61. extern Client *clients, *stack;
  62. /* bar.c */
  63. extern void draw_bar();
  64. /* cmd.c */
  65. extern void run(void *aux);
  66. extern void quit(void *aux);
  67. extern void kill(void *aux);
  68. /* client.c */
  69. extern void manage(Window w, XWindowAttributes *wa);
  70. extern void unmanage(Client *c);
  71. extern Client *getclient(Window w);
  72. extern void focus(Client *c);
  73. extern void update_name(Client *c);
  74. extern void draw_client(Client *c);
  75. extern void resize(Client *c);
  76. /* event.c */
  77. extern unsigned int discard_events(long even_mask);
  78. /* key.c */
  79. extern void update_keys();
  80. extern void keypress(XEvent *e);
  81. /* mouse.c */
  82. extern void mresize(Client *c);
  83. extern void mmove(Client *c);
  84. /* wm.c */
  85. extern int error_handler(Display *dpy, XErrorEvent *error);
  86. extern void send_message(Window w, Atom a, long value);
  87. extern int win_proto(Window w);