Configuration of dwm for Mac Computers
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.

143 lines
3.4 KiB

18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 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 <X11/Xlib.h>
  6. /********** CUSTOMIZE **********/
  7. #define FONT "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*"
  8. #define BGCOLOR "#666699"
  9. #define FGCOLOR "#ffffff"
  10. #define BORDERCOLOR "#9999CC"
  11. #define STATUSDELAY 10 /* seconds */
  12. #define WM_PROTOCOL_DELWIN 1
  13. /* tags */
  14. enum { Tscratch, Tdev, Tirc, Twww, Twork, TLast };
  15. /********** CUSTOMIZE **********/
  16. typedef struct Brush Brush;
  17. typedef struct Client Client;
  18. typedef struct Fnt Fnt;
  19. typedef struct Key Key;
  20. /* atoms */
  21. enum { WMProtocols, WMDelete, WMLast };
  22. enum { NetSupported, NetWMName, NetLast };
  23. /* cursor */
  24. enum { CurNormal, CurResize, CurMove, CurInput, CurLast };
  25. struct Fnt {
  26. XFontStruct *xfont;
  27. XFontSet set;
  28. int ascent;
  29. int descent;
  30. int height;
  31. };
  32. struct Brush {
  33. GC gc;
  34. Drawable drawable;
  35. int x, y, w, h;
  36. Fnt font;
  37. unsigned long bg;
  38. unsigned long fg;
  39. unsigned long border;
  40. };
  41. struct Client {
  42. char name[256];
  43. char *tags[TLast];
  44. int proto;
  45. int x, y, w, h;
  46. int tx, ty, tw, th;
  47. int basew, baseh, incw, inch, maxw, maxh, minw, minh;
  48. int grav;
  49. unsigned int border;
  50. long flags;
  51. Window win;
  52. Window trans;
  53. Window title;
  54. Client *next;
  55. Client *snext;
  56. };
  57. struct Key {
  58. unsigned long mod;
  59. KeySym keysym;
  60. void (*func)(void *aux);
  61. void *aux;
  62. };
  63. extern Display *dpy;
  64. extern Window root;
  65. extern Atom wm_atom[WMLast], net_atom[NetLast];
  66. extern Cursor cursor[CurLast];
  67. extern Bool running, issel;
  68. extern void (*handler[LASTEvent]) (XEvent *);
  69. extern void (*arrange)(void *aux);
  70. extern int tsel, screen, sx, sy, sw, sh, th;
  71. extern char stext[1024], *tags[TLast];
  72. extern Brush brush;
  73. extern Client *clients, *stack;
  74. /* draw.c */
  75. extern void draw(Display *dpy, Brush *b, Bool border, const char *text);
  76. extern void loadcolors(Display *dpy, int screen, Brush *b,
  77. const char *bg, const char *fg, const char *bo);
  78. extern void loadfont(Display *dpy, Fnt *font, const char *fontstr);
  79. extern unsigned int textnw(Fnt *font, char *text, unsigned int len);
  80. extern unsigned int textw(Fnt *font, char *text);
  81. extern unsigned int texth(Fnt *font);
  82. /* client.c */
  83. extern void manage(Window w, XWindowAttributes *wa);
  84. extern void unmanage(Client *c);
  85. extern Client *getclient(Window w);
  86. extern void focus(Client *c);
  87. extern void update_name(Client *c);
  88. extern void draw_client(Client *c);
  89. extern void resize(Client *c);
  90. extern void update_size(Client *c);
  91. extern Client *gettitle(Window w);
  92. extern void craise(Client *c);
  93. extern void lower(Client *c);
  94. extern void ckill(void *aux);
  95. extern void sel(void *aux);
  96. extern void max(void *aux);
  97. extern void floating(void *aux);
  98. extern void grid(void *aux);
  99. extern void gravitate(Client *c, Bool invert);
  100. /* event.c */
  101. extern void discard_events(long even_mask);
  102. /* key.c */
  103. extern void update_keys();
  104. extern void keypress(XEvent *e);
  105. /* mouse.c */
  106. extern void mresize(Client *c);
  107. extern void mmove(Client *c);
  108. /* util.c */
  109. extern void error(char *errstr, ...);
  110. extern void *emallocz(unsigned int size);
  111. extern void *emalloc(unsigned int size);
  112. extern void *erealloc(void *ptr, unsigned int size);
  113. extern char *estrdup(const char *str);
  114. extern void spawn(Display *dpy, char *argv[]);
  115. extern void swap(void **p1, void **p2);
  116. /* wm.c */
  117. extern int error_handler(Display *dpy, XErrorEvent *error);
  118. extern void send_message(Window w, Atom a, long value);
  119. extern int win_proto(Window w);
  120. extern void run(void *aux);
  121. extern void quit(void *aux);