wm.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 basew, baseh, incw, inch, maxw, maxh, minw, minh;
  22. long flags;
  23. Window win;
  24. Window trans;
  25. Window title;
  26. Client *next;
  27. Client *snext;
  28. };
  29. struct Key {
  30. unsigned long mod;
  31. KeySym keysym;
  32. void (*func)(void *aux);
  33. void *aux;
  34. };
  35. extern Display *dpy;
  36. extern Window root, barwin;
  37. extern Atom wm_atom[WMLast], net_atom[NetLast];
  38. extern Cursor cursor[CurLast];
  39. extern XRectangle rect, barrect;
  40. extern Bool running, sel_screen, grid;
  41. extern void (*handler[LASTEvent]) (XEvent *);
  42. extern int screen;
  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. /* 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. /* event.c */
  62. extern unsigned int discard_events(long even_mask);
  63. /* key.c */
  64. extern void update_keys();
  65. extern void keypress(XEvent *e);
  66. /* mouse.c */
  67. extern void mresize(Client *c);
  68. extern void mmove(Client *c);
  69. /* wm.c */
  70. extern int error_handler(Display *dpy, XErrorEvent *error);
  71. extern void send_message(Window w, Atom a, long value);
  72. extern int win_proto(Window w);