summaryrefslogtreecommitdiffstats
path: root/dwm.h
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-02-22 11:42:08 +0100
committerAnselm R. Garbe <arg@suckless.org>2007-02-22 11:42:08 +0100
commit2c477cf66147d369ae8ff17acdce743c6811ee6a (patch)
tree121a031caf30be9f6931e37e26cf2469c8c7acfa /dwm.h
parentre-added xterm to config.default.h (diff)
downloaddwm-2c477cf66147d369ae8ff17acdce743c6811ee6a.tar.gz
dwm-2c477cf66147d369ae8ff17acdce743c6811ee6a.zip
replaced Arg union with const char *arg, seems cleaner to me, even if we need atoi() in some places
Diffstat (limited to 'dwm.h')
-rw-r--r--dwm.h35
1 files changed, 15 insertions, 20 deletions
diff --git a/dwm.h b/dwm.h
index a6af9ba..f2ae53f 100644
--- a/dwm.h
+++ b/dwm.h
@@ -41,11 +41,6 @@ enum { WMProtocols, WMDelete, WMState, WMLast }; /* default atoms */
41enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 41enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
42enum { ColBorder, ColFG, ColBG, ColLast }; /* color */ 42enum { ColBorder, ColFG, ColBG, ColLast }; /* color */
43 43
44typedef union {
45 const char *cmd;
46 int i;
47} Arg; /* argument type */
48
49typedef struct { 44typedef struct {
50 int ascent; 45 int ascent;
51 int descent; 46 int descent;
@@ -106,11 +101,11 @@ extern void attach(Client *c); /* attaches c to global client list */
106extern void configure(Client *c); /* send synthetic configure event */ 101extern void configure(Client *c); /* send synthetic configure event */
107extern void detach(Client *c); /* detaches c from global client list */ 102extern void detach(Client *c); /* detaches c from global client list */
108extern void focus(Client *c); /* focus c, c may be NULL */ 103extern void focus(Client *c); /* focus c, c may be NULL */
109extern void killclient(Arg arg); /* kill c nicely */ 104extern void killclient(const char *arg); /* kill c nicely */
110extern void manage(Window w, XWindowAttributes *wa); /* manage new client */ 105extern void manage(Window w, XWindowAttributes *wa); /* manage new client */
111extern void resize(Client *c, int x, int y, 106extern void resize(Client *c, int x, int y,
112 int w, int h, Bool sizehints); /* resize with given coordinates c*/ 107 int w, int h, Bool sizehints); /* resize with given coordinates c*/
113extern void toggleversatile(Arg arg); /* toggles focused client between versatile/and non-versatile state */ 108extern void toggleversatile(const char *arg); /* toggles focused client between versatile/and non-versatile state */
114extern void updatesizehints(Client *c); /* update the size hint variables of c */ 109extern void updatesizehints(Client *c); /* update the size hint variables of c */
115extern void updatetitle(Client *c); /* update the name of c */ 110extern void updatetitle(Client *c); /* update the name of c */
116extern void unmanage(Client *c); /* destroy c */ 111extern void unmanage(Client *c); /* destroy c */
@@ -125,19 +120,19 @@ extern unsigned int textw(const char *text); /* return the width of text in px*/
125extern void grabkeys(void); /* grab all keys defined in config.h */ 120extern void grabkeys(void); /* grab all keys defined in config.h */
126 121
127/* layout.c */ 122/* layout.c */
128extern void focusnext(Arg arg); /* focuses next visible client, arg is ignored */ 123extern void focusnext(const char *arg); /* focuses next visible client, arg is ignored */
129extern void focusprev(Arg arg); /* focuses previous visible client, arg is ignored */ 124extern void focusprev(const char *arg); /* focuses previous visible client, arg is ignored */
130extern void incmasterw(Arg arg); /* increments the master width with arg's index value */ 125extern void incmasterw(const char *arg); /* increments the master width with arg's index value */
131extern void incnmaster(Arg arg); /* increments nmaster with arg's index value */ 126extern void incnmaster(const char *arg); /* increments nmaster with arg's index value */
132extern void initlayouts(void); /* initialize layout array */ 127extern void initlayouts(void); /* initialize layout array */
133extern Client *nexttiled(Client *c); /* returns tiled successor of c */ 128extern Client *nexttiled(Client *c); /* returns tiled successor of c */
134extern void restack(void); /* restores z layers of all clients */ 129extern void restack(void); /* restores z layers of all clients */
135extern void setlayout(Arg arg); /* sets layout, -1 toggles */ 130extern void setlayout(const char *arg); /* sets layout, -1 toggles */
136extern void togglemax(Arg arg); /* toggles maximization of versatile client */ 131extern void togglemax(const char *arg); /* toggles maximization of versatile client */
137extern void versatile(void); /* arranges all windows versatile */ 132extern void versatile(void); /* arranges all windows versatile */
138 133
139/* main.c */ 134/* main.c */
140extern void quit(Arg arg); /* quit dwm nicely */ 135extern void quit(const char *arg); /* quit dwm nicely */
141extern void sendevent(Window w, Atom a, long value); /* send synthetic event to w */ 136extern void sendevent(Window w, Atom a, long value); /* send synthetic event to w */
142extern int xerror(Display *dsply, XErrorEvent *ee); /* dwm's X error handler */ 137extern int xerror(Display *dsply, XErrorEvent *ee); /* dwm's X error handler */
143 138
@@ -145,14 +140,14 @@ extern int xerror(Display *dsply, XErrorEvent *ee); /* dwm's X error handler */
145extern void compileregs(void); /* initialize regexps of rules defined in config.h */ 140extern void compileregs(void); /* initialize regexps of rules defined in config.h */
146extern Bool isvisible(Client *c); /* returns True if client is visible */ 141extern Bool isvisible(Client *c); /* returns True if client is visible */
147extern void settags(Client *c, Client *trans); /* sets tags of c */ 142extern void settags(Client *c, Client *trans); /* sets tags of c */
148extern void tag(Arg arg); /* tags c with arg's index */ 143extern void tag(const char *arg); /* tags c with arg's index */
149extern void toggletag(Arg arg); /* toggles c tags with arg's index */ 144extern void toggletag(const char *arg); /* toggles c tags with arg's index */
150extern void toggleview(Arg arg); /* toggles the tag with arg's index (in)visible */ 145extern void toggleview(const char *arg); /* toggles the tag with arg's index (in)visible */
151extern void view(Arg arg); /* views the tag with arg's index */ 146extern void view(const char *arg); /* views the tag with arg's index */
152extern void zoom(Arg arg); /* zooms the focused client to master area, arg is ignored */ 147extern void zoom(const char *arg); /* zooms the focused client to master area, arg is ignored */
153 148
154/* util.c */ 149/* util.c */
155extern void *emallocz(unsigned int size); /* allocates zero-initialized memory, exits on error */ 150extern void *emallocz(unsigned int size); /* allocates zero-initialized memory, exits on error */
156extern void eprint(const char *errstr, ...); /* prints errstr and exits with 1 */ 151extern void eprint(const char *errstr, ...); /* prints errstr and exits with 1 */
157extern void spawn(Arg arg); /* forks a new subprocess with arg's cmd */ 152extern void spawn(const char *arg); /* forks a new subprocess with arg's cmd */
158 153