diff options
| author | Anselm R. Garbe <arg@suckless.org> | 2007-02-19 16:40:36 +0100 |
|---|---|---|
| committer | Anselm R. Garbe <arg@suckless.org> | 2007-02-19 16:40:36 +0100 |
| commit | cdbc84b9a87c427b3d0a202475b0f5aae315fb90 (patch) | |
| tree | d0f12930c9aaafb84d359d263601e2136b61ac74 /dwm.h | |
| parent | some more code polishing (diff) | |
| download | dwm-cdbc84b9a87c427b3d0a202475b0f5aae315fb90.tar.gz dwm-cdbc84b9a87c427b3d0a202475b0f5aae315fb90.zip | |
introduced Layout struct
Diffstat (limited to '')
| -rw-r--r-- | dwm.h | 19 |
1 files changed, 12 insertions, 7 deletions
| @@ -24,9 +24,8 @@ | |||
| 24 | * | 24 | * |
| 25 | * Keys and tagging rules are organized as arrays and defined in the config.h | 25 | * Keys and tagging rules are organized as arrays and defined in the config.h |
| 26 | * file. These arrays are kept static in event.o and tag.o respectively, | 26 | * file. These arrays are kept static in event.o and tag.o respectively, |
| 27 | * because no other part of dwm needs access to them. The current mode is | 27 | * because no other part of dwm needs access to them. The current layout is |
| 28 | * represented by the arrange() function pointer, which wether points to | 28 | * represented by the lt pointer. |
| 29 | * dofloat() or dotile(). | ||
| 30 | * | 29 | * |
| 31 | * To understand everything else, start reading main.c:main(). | 30 | * To understand everything else, start reading main.c:main(). |
| 32 | */ | 31 | */ |
| @@ -81,21 +80,26 @@ struct Client { | |||
| 81 | Window win; | 80 | Window win; |
| 82 | }; | 81 | }; |
| 83 | 82 | ||
| 83 | typedef struct { | ||
| 84 | const char *symbol; | ||
| 85 | void (*arrange)(void); | ||
| 86 | } Layout; | ||
| 87 | |||
| 84 | extern const char *tags[]; /* all tags */ | 88 | extern const char *tags[]; /* all tags */ |
| 85 | extern char stext[256]; /* status text */ | 89 | extern char stext[256]; /* status text */ |
| 86 | extern int bh, bmw; /* bar height, bar mode label width */ | ||
| 87 | extern int screen, sx, sy, sw, sh; /* screen geometry */ | 90 | extern int screen, sx, sy, sw, sh; /* screen geometry */ |
| 88 | extern int wax, way, wah, waw; /* windowarea geometry */ | 91 | extern int wax, way, wah, waw; /* windowarea geometry */ |
| 92 | extern unsigned int bh, blw; /* bar height, bar layout label width */ | ||
| 89 | extern unsigned int master, nmaster; /* master percent, number of master clients */ | 93 | extern unsigned int master, nmaster; /* master percent, number of master clients */ |
| 90 | extern unsigned int ntags, numlockmask; /* number of tags, dynamic lock mask */ | 94 | extern unsigned int ntags, numlockmask; /* number of tags, dynamic lock mask */ |
| 91 | extern void (*handler[LASTEvent])(XEvent *); /* event handler */ | 95 | extern void (*handler[LASTEvent])(XEvent *); /* event handler */ |
| 92 | extern void (*arrange)(void); /* arrange function, indicates mode */ | ||
| 93 | extern Atom wmatom[WMLast], netatom[NetLast]; | 96 | extern Atom wmatom[WMLast], netatom[NetLast]; |
| 94 | extern Bool running, selscreen, *seltag; /* seltag is array of Bool */ | 97 | extern Bool running, selscreen, *seltag; /* seltag is array of Bool */ |
| 95 | extern Client *clients, *sel, *stack; /* global client list and stack */ | 98 | extern Client *clients, *sel, *stack; /* global client list and stack */ |
| 96 | extern Cursor cursor[CurLast]; | 99 | extern Cursor cursor[CurLast]; |
| 97 | extern DC dc; /* global draw context */ | 100 | extern DC dc; /* global draw context */ |
| 98 | extern Display *dpy; | 101 | extern Display *dpy; |
| 102 | extern Layout *lt; | ||
| 99 | extern Window root, barwin; | 103 | extern Window root, barwin; |
| 100 | 104 | ||
| 101 | /* client.c */ | 105 | /* client.c */ |
| @@ -124,17 +128,18 @@ extern void sendevent(Window w, Atom a, long value); /* send synthetic event to | |||
| 124 | extern int xerror(Display *dsply, XErrorEvent *ee); /* dwm's X error handler */ | 128 | extern int xerror(Display *dsply, XErrorEvent *ee); /* dwm's X error handler */ |
| 125 | 129 | ||
| 126 | /* screen.c */ | 130 | /* screen.c */ |
| 127 | extern void compileregexps(void); /* initialize regexps of rules defined in config.h */ | 131 | extern void compileregs(void); /* initialize regexps of rules defined in config.h */ |
| 128 | extern void dofloat(void); /* arranges all windows floating */ | 132 | extern void dofloat(void); /* arranges all windows floating */ |
| 129 | extern void dotile(void); /* arranges all windows tiled */ | 133 | extern void dotile(void); /* arranges all windows tiled */ |
| 130 | extern void incnmaster(Arg *arg); /* increments nmaster with arg's index value */ | 134 | extern void incnmaster(Arg *arg); /* increments nmaster with arg's index value */ |
| 135 | extern void initlayouts(void); /* initialize layout array */ | ||
| 131 | extern Bool isvisible(Client *c); /* returns True if client is visible */ | 136 | extern Bool isvisible(Client *c); /* returns True if client is visible */ |
| 132 | extern void resizemaster(Arg *arg); /* resizes the master percent with arg's index value */ | 137 | extern void resizemaster(Arg *arg); /* resizes the master percent with arg's index value */ |
| 133 | extern void restack(void); /* restores z layers of all clients */ | 138 | extern void restack(void); /* restores z layers of all clients */ |
| 134 | extern void settags(Client *c, Client *trans); /* sets tags of c */ | 139 | extern void settags(Client *c, Client *trans); /* sets tags of c */ |
| 135 | extern void tag(Arg *arg); /* tags c with arg's index */ | 140 | extern void tag(Arg *arg); /* tags c with arg's index */ |
| 136 | extern void togglefloat(Arg *arg); /* toggles focusesd client between floating/non-floating state */ | 141 | extern void togglefloat(Arg *arg); /* toggles focusesd client between floating/non-floating state */ |
| 137 | extern void togglemode(Arg *arg); /* toggles global arrange function (dotile/dofloat) */ | 142 | extern void togglelayout(Arg *arg); /* toggles layout */ |
| 138 | extern void toggletag(Arg *arg); /* toggles c tags with arg's index */ | 143 | extern void toggletag(Arg *arg); /* toggles c tags with arg's index */ |
| 139 | extern void toggleview(Arg *arg); /* toggles the tag with arg's index (in)visible */ | 144 | extern void toggleview(Arg *arg); /* toggles the tag with arg's index (in)visible */ |
| 140 | extern void view(Arg *arg); /* views the tag with arg's index */ | 145 | extern void view(Arg *arg); /* views the tag with arg's index */ |
