dwm.h
changeset 1033 a8efbb301ef4
parent 1031 7216ff510041
child 1035 2034efee9702
equal deleted inserted replaced
1032:08bc44d1f985 1033:a8efbb301ef4
     1 /* See LICENSE file for copyright and license details. */
     1 /* See LICENSE file for copyright and license details. */
     2 #include <X11/Xlib.h>
       
     3 
     2 
     4 /* enums */
     3 /* enums */
     5 enum { BarTop, BarBot, BarOff };			/* bar position */
     4 enum { BarTop, BarBot, BarOff };			/* bar position */
     6 enum { CurNormal, CurResize, CurMove, CurLast };	/* cursor */
     5 enum { CurNormal, CurResize, CurMove, CurLast };	/* cursor */
     7 enum { ColBorder, ColFG, ColBG, ColLast };		/* color */
     6 enum { ColBorder, ColFG, ColBG, ColLast };		/* color */
    50 
    49 
    51 typedef struct {
    50 typedef struct {
    52 	const char *symbol;
    51 	const char *symbol;
    53 	void (*arrange)(void);
    52 	void (*arrange)(void);
    54 } Layout;
    53 } Layout;
       
    54 
       
    55 typedef struct {
       
    56 	const char *prop;
       
    57 	const char *tags;
       
    58 	Bool isfloating;
       
    59 } Rule;
       
    60 
       
    61 typedef struct {
       
    62 	regex_t *propregex;
       
    63 	regex_t *tagregex;
       
    64 } Regs;
    55 
    65 
    56 /* functions */
    66 /* functions */
    57 void applyrules(Client *c);
    67 void applyrules(Client *c);
    58 void arrange(void);
    68 void arrange(void);
    59 void attach(Client *c);
    69 void attach(Client *c);
   130 void viewprevtag(const char *arg);	/* views previous selected tags */
   140 void viewprevtag(const char *arg);	/* views previous selected tags */
   131 int xerror(Display *dpy, XErrorEvent *ee);
   141 int xerror(Display *dpy, XErrorEvent *ee);
   132 int xerrordummy(Display *dsply, XErrorEvent *ee);
   142 int xerrordummy(Display *dsply, XErrorEvent *ee);
   133 int xerrorstart(Display *dsply, XErrorEvent *ee);
   143 int xerrorstart(Display *dsply, XErrorEvent *ee);
   134 void zoom(const char *arg);
   144 void zoom(const char *arg);
       
   145 
       
   146 /* variables */
       
   147 char stext[256];
       
   148 double mwfact;
       
   149 int screen, sx, sy, sw, sh, wax, way, waw, wah;
       
   150 int (*xerrorxlib)(Display *, XErrorEvent *);
       
   151 unsigned int bh, bpos;
       
   152 unsigned int blw = 0;
       
   153 unsigned int ltidx = 0; /* default */
       
   154 unsigned int nlayouts = 0;
       
   155 unsigned int nrules = 0;
       
   156 unsigned int numlockmask = 0;
       
   157 void (*handler[LASTEvent]) (XEvent *) = {
       
   158 	[ButtonPress] = buttonpress,
       
   159 	[ConfigureRequest] = configurerequest,
       
   160 	[ConfigureNotify] = configurenotify,
       
   161 	[DestroyNotify] = destroynotify,
       
   162 	[EnterNotify] = enternotify,
       
   163 	[LeaveNotify] = leavenotify,
       
   164 	[Expose] = expose,
       
   165 	[KeyPress] = keypress,
       
   166 	[MappingNotify] = mappingnotify,
       
   167 	[MapRequest] = maprequest,
       
   168 	[PropertyNotify] = propertynotify,
       
   169 	[UnmapNotify] = unmapnotify
       
   170 };
       
   171 Atom wmatom[WMLast], netatom[NetLast];
       
   172 Bool otherwm, readin;
       
   173 Bool running = True;
       
   174 Bool selscreen = True;
       
   175 Client *clients = NULL;
       
   176 Client *sel = NULL;
       
   177 Client *stack = NULL;
       
   178 Cursor cursor[CurLast];
       
   179 Display *dpy;
       
   180 DC dc = {0};
       
   181 Window barwin, root;
       
   182 Regs *regs = NULL;
       
   183 
       
   184 /* configuration, allows nested code to access above variables */
       
   185 #include "config.h"
       
   186 
       
   187 /* Statically define the number of tags. */
       
   188 unsigned int ntags = sizeof tags / sizeof tags[0];
       
   189 Bool seltags[sizeof tags / sizeof tags[0]] = {[0] = True};
       
   190 Bool prevtags[sizeof tags / sizeof tags[0]] = {[0] = True};
       
   191