Skip to content

Commit

Permalink
added screen.c, removed layout.c and tag.c
Browse files Browse the repository at this point in the history
  • Loading branch information
garbeam committed Aug 19, 2007
1 parent 96d7fe1 commit 47765f7
Show file tree
Hide file tree
Showing 7 changed files with 215 additions and 228 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

include config.mk

SRC += client.c draw.c event.c layout.c main.c tag.c util.c
SRC += client.c draw.c event.c main.c screen.c util.c
OBJ = ${SRC:.c=.o}

all: options dwm
Expand Down
8 changes: 4 additions & 4 deletions client.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ killclient(const char *arg) {
}

Bool
loadprops(Client *c) {
getprops(Client *c) {
unsigned int i;
Bool result = False;

Expand Down Expand Up @@ -242,11 +242,11 @@ manage(Window w, XWindowAttributes *wa) {
if(t)
for(i = 0; i < ntags; i++)
c->tags[i] = t->tags[i];
if(!loadprops(c))
if(!getprops(c))
applyrules(c);
if(!c->isfloating)
c->isfloating = (rettrans == Success) || c->isfixed;
saveprops(c);
setprops(c);
attach(c);
attachstack(c);
XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); /* some windows require this */
Expand Down Expand Up @@ -318,7 +318,7 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
}

void
saveprops(Client *c) {
setprops(Client *c) {
unsigned int i;

for(i = 0; i < ntags && i < sizeof prop - 1; i++)
Expand Down
4 changes: 2 additions & 2 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ LIBS = -L/usr/lib -lc -L${X11LIB} -lX11
# flags
CFLAGS = -Os ${INCS} -DVERSION=\"${VERSION}\"
LDFLAGS = -s ${LIBS}
CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\"
LDFLAGS = -g ${LIBS}
#CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\"
#LDFLAGS = -g ${LIBS}

# Solaris
#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
Expand Down
35 changes: 16 additions & 19 deletions dwm.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ void configure(Client *c); /* send synthetic configure event */
void detach(Client *c); /* detaches c from global client list */
void focus(Client *c); /* focus c if visible && !NULL, or focus top visible */
void killclient(const char *arg); /* kill sel nicely */
Bool loadprops(Client *c); /* loads client properties */
Bool getprops(Client *c); /* gets client properties */
void manage(Window w, XWindowAttributes *wa); /* manage new client */
void resize(Client *c, int x, int y,
int w, int h, Bool sizehints); /* resize with given coordinates c*/
void saveprops(Client *c); /* saves client properties */
void setprops(Client *c); /* sets client properties */
void unban(Client *c); /* unbans c */
void unmanage(Client *c, long state); /* unmanage c */
void updatesizehints(Client *c); /* update the size hint variables of c */
Expand All @@ -114,35 +114,32 @@ unsigned int textw(const char *text); /* return the width of text in px*/
/* event.c */
void grabkeys(void); /* grab all keys defined in config.h */

/* layout.c */
void arrange(void); /* arranges all windows depending on the layout in use */
void focusnext(const char *arg); /* focuses next visible client */
void focusprev(const char *arg); /* focuses prev visible client */
const char *getsymbol(void); /* returns symbol of enabled layout */
Bool isfloating(void); /* returns True if floating layout is enabled */
Bool isarrange(void (*func)()); /* returns True if func is the layout function in use */
void initlayouts(void); /* initialize layout array */
void loaddwmprops(void); /* loads dwm properties */
Client *nexttiled(Client *c); /* returns tiled successor of c */
void restack(void); /* restores z layers of all clients */
void savedwmprops(void); /* saves dwm properties */
void setlayout(const char *arg); /* sets layout, NULL means next layout */
void togglebar(const char *arg); /* shows/hides the bar */
void togglemax(const char *arg); /* toggles maximization of floating client */

/* main.c */
Bool gettextprop(Window w, Atom atom,
char *text, unsigned int size); /* return text property, UTF-8 compliant */
void updatebarpos(void); /* updates the bar position */
void quit(const char *arg); /* quit dwm nicely */
int xerror(Display *dsply, XErrorEvent *ee); /* dwm's X error handler */

/* tag.c */
/* screen.c */
void applyrules(Client *c); /* applies rules to c */
void arrange(void); /* arranges all windows depending on the layout in use */
void compileregs(void); /* initialize regexps of rules defined in config.h */
void focusnext(const char *arg); /* focuses next visible client */
void focusprev(const char *arg); /* focuses prev visible client */
const char *getsymbol(void); /* returns symbol of enabled layout */
void initlayouts(void); /* initialize layout array */
Bool isarrange(void (*func)()); /* returns True if func is the layout function in use */
Bool isfloating(void); /* returns True if floating layout is enabled */
Bool isvisible(Client *c); /* returns True if client is visible */
void getdwmprops(void); /* gets dwm properties */
Client *nexttiled(Client *c); /* returns tiled successor of c */
void restack(void); /* restores z layers of all clients */
void setlayout(const char *arg); /* sets layout, NULL means next layout */
void tag(const char *arg); /* tags sel with arg's index */
void togglebar(const char *arg); /* shows/hides the bar */
void togglefloating(const char *arg); /* toggles sel between floating/tiled state */
void togglemax(const char *arg); /* toggles maximization of floating client */
void toggletag(const char *arg); /* toggles sel tags with arg's index */
void toggleview(const char *arg); /* toggles the tag with arg's index (in)visible */
void view(const char *arg); /* views the tag with arg's index */
Expand Down
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ setup(void) {
XSetFont(dpy, dc.gc, dc.font.xfont->fid);
/* multihead support */
selscreen = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask);
loaddwmprops();
getdwmprops();
}

/*
Expand Down
Loading

0 comments on commit 47765f7

Please sign in to comment.