Configuration file for DWM on MacBook Air
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.

142 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
  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 <X11/Xlib.h>
  7. /* mask shorthands, used in event.c and client.c */
  8. #define BUTTONMASK (ButtonPressMask | ButtonReleaseMask)
  9. #define MOUSEMASK (BUTTONMASK | PointerMotionMask)
  10. #define PROTODELWIN 1
  11. typedef union {
  12. const char *cmd;
  13. int i;
  14. } Arg;
  15. /* atoms */
  16. enum { NetSupported, NetWMName, NetLast };
  17. enum { WMProtocols, WMDelete, WMLast };
  18. /* cursor */
  19. enum { CurNormal, CurResize, CurMove, CurLast };
  20. /* color */
  21. enum { ColFG, ColBG, ColLast };
  22. /* window corners */
  23. typedef enum { TopLeft, TopRight, BotLeft, BotRight } Corner;
  24. typedef struct {
  25. int ascent;
  26. int descent;
  27. int height;
  28. XFontSet set;
  29. XFontStruct *xfont;
  30. } Fnt;
  31. typedef struct { /* draw context */
  32. int x, y, w, h;
  33. unsigned long norm[ColLast];
  34. unsigned long sel[ColLast];
  35. unsigned long status[ColLast];
  36. Drawable drawable;
  37. Fnt font;
  38. GC gc;
  39. } DC;
  40. typedef struct Client Client;
  41. struct Client {
  42. char name[256];
  43. int proto;
  44. int x, y, w, h;
  45. int tx, ty, tw, th; /* title */
  46. int basew, baseh, incw, inch, maxw, maxh, minw, minh;
  47. int grav;
  48. long flags;
  49. unsigned int border, weight;
  50. Bool isfloat;
  51. Bool *tags;
  52. Client *next;
  53. Client *prev;
  54. Client *snext;
  55. Window win;
  56. Window twin;
  57. };
  58. extern const char *tags[];
  59. extern char stext[1024];
  60. extern int bx, by, bw, bh, bmw, mw, screen, sx, sy, sw, sh;
  61. extern unsigned int ntags, numlockmask;
  62. extern void (*handler[LASTEvent])(XEvent *);
  63. extern void (*arrange)(Arg *);
  64. extern Atom wmatom[WMLast], netatom[NetLast];
  65. extern Bool running, issel, maximized, *seltag;
  66. extern Client *clients, *sel, *stack;
  67. extern Cursor cursor[CurLast];
  68. extern DC dc;
  69. extern Display *dpy;
  70. extern Window root, barwin;
  71. /* client.c */
  72. extern void ban(Client *c);
  73. extern void focus(Client *c);
  74. extern Client *getclient(Window w);
  75. extern Client *getctitle(Window w);
  76. extern void gravitate(Client *c, Bool invert);
  77. extern void killclient(Arg *arg);
  78. extern void manage(Window w, XWindowAttributes *wa);
  79. extern void resize(Client *c, Bool sizehints, Corner sticky);
  80. extern void setsize(Client *c);
  81. extern void settitle(Client *c);
  82. extern void togglemax(Arg *arg);
  83. extern void unmanage(Client *c);
  84. /* draw.c */
  85. extern void drawall();
  86. extern void drawstatus();
  87. extern void drawtitle(Client *c);
  88. extern unsigned long getcolor(const char *colstr);
  89. extern void setfont(const char *fontstr);
  90. extern unsigned int textw(const char *text);
  91. /* event.c */
  92. extern void grabkeys();
  93. extern void procevent();
  94. /* main.c */
  95. extern int getproto(Window w);
  96. extern void quit(Arg *arg);
  97. extern void sendevent(Window w, Atom a, long value);
  98. extern int xerror(Display *dsply, XErrorEvent *ee);
  99. /* tag.c */
  100. extern void initrregs();
  101. extern Client *getnext(Client *c);
  102. extern Client *getprev(Client *c);
  103. extern void settags(Client *c, Client *trans);
  104. extern void tag(Arg *arg);
  105. extern void toggletag(Arg *arg);
  106. /* util.c */
  107. extern void *emallocz(unsigned int size);
  108. extern void eprint(const char *errstr, ...);
  109. extern void *erealloc(void *ptr, unsigned int size);
  110. extern void spawn(Arg *arg);
  111. /* view.c */
  112. extern void detach(Client *c);
  113. extern void dofloat(Arg *arg);
  114. extern void dotile(Arg *arg);
  115. extern void focusnext(Arg *arg);
  116. extern void focusprev(Arg *arg);
  117. extern Bool isvisible(Client *c);
  118. extern void resizecol(Arg *arg);
  119. extern void restack();
  120. extern void togglemode(Arg *arg);
  121. extern void toggleview(Arg *arg);
  122. extern void view(Arg *arg);
  123. extern void viewall(Arg *arg);
  124. extern void zoom(Arg *arg);