You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
2.1 KiB

19 years ago
19 years ago
19 years ago
19 years ago
19 years ago
19 years ago
19 years ago
19 years ago
19 years ago
19 years ago
19 years ago
19 years ago
  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. int grav;
  24. unsigned int border;
  25. long flags;
  26. Window win;
  27. Window trans;
  28. Window title;
  29. Client *next;
  30. Client *snext;
  31. };
  32. struct Key {
  33. unsigned long mod;
  34. KeySym keysym;
  35. void (*func)(void *aux);
  36. void *aux;
  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 Bool running, sel_screen, grid;
  43. extern void (*handler[LASTEvent]) (XEvent *);
  44. extern int screen, sx, sy, sw, sh, bx, by, bw, bh;
  45. extern char statustext[1024], tag[256];
  46. extern Brush brush;
  47. extern Client *clients, *stack;
  48. /* bar.c */
  49. extern void draw_bar();
  50. /* client.c */
  51. extern void manage(Window w, XWindowAttributes *wa);
  52. extern void unmanage(Client *c);
  53. extern Client *getclient(Window w);
  54. extern void focus(Client *c);
  55. extern void update_name(Client *c);
  56. extern void draw_client(Client *c);
  57. extern void resize(Client *c);
  58. extern void update_size(Client *c);
  59. extern Client *gettitle(Window w);
  60. extern void raise(Client *c);
  61. extern void lower(Client *c);
  62. extern void kill(void *aux);
  63. extern void sel(void *aux);
  64. extern void max(void *aux);
  65. extern void arrange(void *aux);
  66. extern void gravitate(Client *c, Bool invert);
  67. /* event.c */
  68. extern void discard_events(long even_mask);
  69. /* key.c */
  70. extern void update_keys();
  71. extern void keypress(XEvent *e);
  72. /* mouse.c */
  73. extern void mresize(Client *c);
  74. extern void mmove(Client *c);
  75. /* wm.c */
  76. extern int error_handler(Display *dpy, XErrorEvent *error);
  77. extern void send_message(Window w, Atom a, long value);
  78. extern int win_proto(Window w);
  79. extern void run(void *aux);
  80. extern void quit(void *aux);