dwm.h
changeset 782 92862ab407d5
parent 780 6dc7578a5107
child 784 74722317b171
equal deleted inserted replaced
781:dde5852bf151 782:92862ab407d5
    22  * creates a small title window, which is resized whenever the (_NET_)WM_NAME
    22  * creates a small title window, which is resized whenever the (_NET_)WM_NAME
    23  * properties are updated or the client is moved/resized.
    23  * properties are updated or the client is moved/resized.
    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  */
    33 
    32 
    34 #include "config.h"
    33 #include "config.h"
    79 	Client *prev;
    78 	Client *prev;
    80 	Client *snext;
    79 	Client *snext;
    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 */
   102 extern void configure(Client *c);		/* send synthetic configure event */
   106 extern void configure(Client *c);		/* send synthetic configure event */
   103 extern void focus(Client *c);			/* focus c, c may be NULL */
   107 extern void focus(Client *c);			/* focus c, c may be NULL */
   122 extern void quit(Arg *arg);			/* quit dwm nicely */
   126 extern void quit(Arg *arg);			/* quit dwm nicely */
   123 extern void sendevent(Window w, Atom a, long value);	/* send synthetic event to w */
   127 extern void sendevent(Window w, Atom a, long value);	/* send synthetic event to w */
   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 */
   141 
   146 
   142 /* util.c */
   147 /* util.c */