From a2868e9dda058bc1f470710eedf23a6e15becc36 Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Sat, 13 Sep 2008 12:44:43 +0200 Subject: [PATCH] [ALL] make event.c , replace local.h -> wmfs.h --- CMakeLists.txt | 3 +- config.c | 4 +- event.c | 258 +++++++++++++++++++++++++++++++++++++ wmfs.c | 321 ++++++---------------------------------------- local.h => wmfs.h | 78 +++++++---- 5 files changed, 355 insertions(+), 309 deletions(-) create mode 100644 event.c rename local.h => wmfs.h (84%) diff --git a/CMakeLists.txt b/CMakeLists.txt index f10d26e..a8da82d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,8 @@ project(${PROJECT_NAME} C) # Definition of the wmfs source set(wmfs_src wmfs.c - config.c) + config.c + event.c) # Set the executable from the wmfs_src add_executable(wmfs ${wmfs_src}) diff --git a/config.c b/config.c index 01d40b3..421bb54 100644 --- a/config.c +++ b/config.c @@ -2,7 +2,7 @@ #include #include -#include "local.h" +#include "wmfs.h" #include "config.h" #define FILE_NAME ".wmfsrc" @@ -287,5 +287,3 @@ init_conf(void) { cfg_free(cfg); } - - diff --git a/event.c b/event.c new file mode 100644 index 0000000..29006bc --- /dev/null +++ b/event.c @@ -0,0 +1,258 @@ +#include "wmfs.h" + +/* BUTTONPRESS */ +void +buttonpress(XEvent ev) { + Client *c; + int i, j; + char s[6]; + + /* Tbar'n'Button */ + if(conf.ttbarheight) { + if((c = gettbar(ev.xbutton.window))) { + raiseclient(c); + if(ev.xbutton.button == Button1) + mouseaction(c, ev.xbutton.x_root, ev.xbutton.y_root, Move); /* type 0 for move */ + else if(ev.xbutton.button == Button2) + tile_switch(NULL); + else if(ev.xbutton.button == Button3) + mouseaction(c, ev.xbutton.x_root, ev.xbutton.y_root, Resize); /* type 1 for resize */ + } else if((c = getbutton(ev.xbutton.window))) { + if(ev.xbutton.button == Button1) + killclient(NULL); + else if(ev.xbutton.button == Button3) + togglemax(NULL); + } + } + /* Window */ + if((c = getclient(ev.xbutton.window))) { + raiseclient(c); + if(ev.xbutton.button == Button1) + mouseaction(c, ev.xbutton.x_root, ev.xbutton.y_root, Move); /* type 0 for move */ + else if(ev.xbutton.button == Button2) + togglemax(NULL); + else if(ev.xbutton.button == Button3) + mouseaction(c, ev.xbutton.x_root, ev.xbutton.y_root, Resize); /* type 1 for resize */ + } + /* Bar */ + /* for tag click */ + else if(ev.xbutton.window == bar) { + for(i = 0; i < conf.ntag + 1; ++i) { + if(ev.xbutton.x > taglen[i-1] + && ev.xbutton.x < taglen[i]) { + ITOA(s, i); + if(ev.xbutton.button == Button1) + tag(s); + else if(ev.xbutton.button == Button3) + tagtransfert(s); + } + } + /* tag switch with scroll */ + if(ev.xbutton.x < taglen[conf.ntag]) { + if(ev.xbutton.button == Button4) + tag("+1"); + else if(ev.xbutton.button == Button5) + tag("-1"); + } + /* layout switch */ + if(ev.xbutton.x >= taglen[conf.ntag] + && ev.xbutton.x < taglen[conf.ntag] + + (strlen((getlayoutsym(layout[seltag])))*fonty+3)) { + if(ev.xbutton.button == Button1 + || ev.xbutton.button == Button4) + layoutswitch("+"); + else if(ev.xbutton.button == Button3 + || ev.xbutton.button == Button5) + layoutswitch("-"); + } + } + /* Root */ + /* tag switch */ + else if(ev.xbutton.window == root) { + if(ev.xbutton.button == Button4) + tag("+1"); + else if(ev.xbutton.button == Button5) + tag("-1"); + } + /* Bar Button */ + for(i=0; itile) + return; + wc.x = ev.xconfigurerequest.x; + wc.y = ev.xconfigurerequest.y; + wc.width = ev.xconfigurerequest.width; + wc.height = ev.xconfigurerequest.height; + wc.border_width = ev.xconfigurerequest.border_width; + wc.sibling = ev.xconfigurerequest.above; + wc.stack_mode = ev.xconfigurerequest.detail; + XConfigureWindow(dpy, ev.xconfigurerequest.window, + ev.xconfigurerequest.value_mask, &wc); + if((c = getclient(ev.xconfigurerequest.window))) { + if(wc.y < mw && wc.x < mh) { + c->free = True; + c->max = False; + c->tile = False; + moveresize(c, wc.x, wc.y, wc.width, wc.height, 1); + arrange(); + } + } + return; +} + +/* DESTROYNOTIFY */ +void +destroynotify(XEvent ev) { + Client *c; + if((c = getclient(ev.xdestroywindow.window))) + unmanage(c); +} + +/* ENTERNOTIFY */ +void +enternotify(XEvent ev) { + Client *c; + + if(ev.xcrossing.mode != NotifyNormal + || ev.xcrossing.detail == NotifyInferior) + return; + if((c = getclient(ev.xcrossing.window)) + || (c = gettbar(ev.xcrossing.window))) + if(c->win != bar) + focus(c); + return; +} + +/* FOCUSIN */ +void +focusin(XEvent ev) { + if(sel && ev.xfocus.window != sel->win) + XSetInputFocus(dpy, sel->win, RevertToPointerRoot, CurrentTime); + return; +} + +/* KEYPRESS */ +void +keypress(XEvent ev) { + unsigned int i; + KeySym keysym; + + keysym = XKeycodeToKeysym(dpy, (KeyCode)ev.xkey.keycode, 0); + for(i = 0; i < conf.nkeybind; i++) + if(keysym == keys[i].keysym + && (keys[i].mod & ~(numlockmask | LockMask)) == + (ev.xkey.state & ~(numlockmask | LockMask)) + && keys[i].func) + { + keys[i].func(keys[i].cmd); + updateall(); + } + return; +} + +/* MAPPINGNOTIFY */ +void +mapnotify(XEvent ev) { + if(ev.xmapping.request == MappingKeyboard) + grabkeys(); + return; +} + + +/* MAPREQUEST */ +void +maprequest(XEvent ev) { + XWindowAttributes at; + + if(!XGetWindowAttributes(dpy, ev.xmaprequest.window, &at)) return; + if(at.override_redirect) return; + if(!getclient(ev.xmaprequest.window)) + manage(ev.xmaprequest.window, &at); + return; +} + +/* PROPERTYNOTIFY */ +void +propertynotify(XEvent ev) { + Client *c; + Window trans; + + if(event.xproperty.state == PropertyDelete) + return; + if((c = getclient(event.xproperty.window))) { + switch(event.xproperty.atom) { + default: break; + case XA_WM_TRANSIENT_FOR: + XGetTransientForHint(dpy, c->win, &trans); + if((c->tile || c->max) && (c->hint = (getclient(trans) != NULL))) + arrange(); + break; + case XA_WM_NORMAL_HINTS: + setsizehints(c); + break; + } + if(ev.xproperty.atom == XA_WM_NAME + || ev.xproperty.atom == net_atom[NetWMName]) + updateall(); + } + return; +} + +/* UNMAPNOTIFY */ +void +unmapnotify(XEvent ev) { + Client *c; + + if((c = getclient(ev.xunmap.window))) + if(!c->hide) + unmanage(c); + return; +} + +/* Handle */ +void +getevent(void) { + struct timeval tv; + + if(QLength(dpy) > 0) + XNextEvent(dpy, &event); + else { + XFlush(dpy); + FD_ZERO(&fd); + FD_SET(ConnectionNumber(dpy), &fd); + event.type = LASTEvent; + tv.tv_sec = 60; + tv.tv_usec = 0; + if(select(FD_SETSIZE, &fd, NULL, NULL, &tv) > 0) + XNextEvent(dpy, &event); + } + + switch (event.type) + { + case ButtonPress: buttonpress(event); break; + case ConfigureRequest: configurerequest(event); break; + case DestroyNotify: destroynotify(event); break; + case EnterNotify: enternotify(event); break; + case FocusIn: focusin(event); break; + case KeyPress: keypress(event); break; + case MapRequest: maprequest(event); break; + case MappingNotify: mapnotify(event); break; + case PropertyNotify: propertynotify(event); break; + case UnmapNotify: unmapnotify(event); break; + } + + return; +} diff --git a/wmfs.c b/wmfs.c index e5591aa..2b5a623 100644 --- a/wmfs.c +++ b/wmfs.c @@ -24,10 +24,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "local.h" - -unsigned int numlockmask = 0; -int taglen[MAXTAG] = {3}; +#include "wmfs.h" void arrange(void) { @@ -53,99 +50,6 @@ attach(Client *c) { return; } -/* will be ameliorated (with conf) */ -void -buttonpress(XEvent *event) { - Client *c; - int i, j; - char s[6]; - XButtonPressedEvent *ev = &event->xbutton; - - /* Tbar'n'Button */ - if(conf.ttbarheight) { - if((c = gettbar(ev->window))) { - raiseclient(c); - if(ev->button == Button1) - mouseaction(c, ev->x_root, ev->y_root, Move); /* type 0 for move */ - else if(ev->button == Button2) - tile_switch(NULL); - else if(ev->button == Button3) - mouseaction(c, ev->x_root, ev->y_root, Resize); /* type 1 for resize */ - } else if((c = getbutton(ev->window))) { - if(ev->button == Button1) - killclient(NULL); - else if(ev->button == Button3) - togglemax(NULL); - } - } - /* Window */ - if((c = getclient(ev->window))) { - raiseclient(c); - if(ev->button == Button1) - mouseaction(c, ev->x_root, ev->y_root, Move); /* type 0 for move */ - else if(ev->button == Button2) - togglemax(NULL); - else if(ev->button == Button3) - mouseaction(c, ev->x_root, ev->y_root, Resize); /* type 1 for resize */ - } - /* Bar */ - /* for tag click */ - else if(ev->window == bar) { - for(i = 0; i < conf.ntag + 1; ++i) { - if(ev->x > taglen[i-1] - && ev->x < taglen[i]) { - ITOA(s, i); - if(ev->button == Button1) - tag(s); - else if(ev->button == Button3) - tagtransfert(s); - } - } - /* tag switch with scroll */ - if(ev->x < taglen[conf.ntag]) { - if(ev->button == Button4) - tag("+1"); - else if(ev->button == Button5) - tag("-1"); - } - /* layout switch */ - if(ev->x >= taglen[conf.ntag] - && ev->x < taglen[conf.ntag] + - (strlen((getlayoutsym(layout[seltag])))*fonty+3)) { - if(ev->button == Button1 - || ev->button == Button4) - layoutswitch("+"); - else if(ev->button == Button3 - || ev->button == Button5) - layoutswitch("-"); - } - } - /* Root */ - /* tag switch */ - else if(ev->window == root) { - if(ev->button == Button4) - tag("+1"); - else if(ev->button == Button5) - tag("-1"); - } - /* Bar Button */ - for(i=0; iwindow == conf.barbutton[i].win - && ev->button == conf.barbutton[i].mouse[j]) - if(conf.barbutton[i].func[j]) - conf.barbutton[i].func[j](conf.barbutton[i].cmd[j]); -} - -int -clienthintpertag(int tag) { - Client *c; - int i = 0; - for(c = clients; c; c = c->next) - if(c->tag == tag && c->hint) - ++i; - return i; -} int clientpertag(int tag) { @@ -157,33 +61,6 @@ clientpertag(int tag) { return i; } -void -configurerequest(XEvent event) { - Client *c; - XWindowChanges wc; - if((c = getclient(event.xconfigurerequest.window))) - if(c->tile) - return; - wc.x = event.xconfigurerequest.x; - wc.y = event.xconfigurerequest.y; - wc.width = event.xconfigurerequest.width; - wc.height = event.xconfigurerequest.height; - wc.border_width = event.xconfigurerequest.border_width; - wc.sibling = event.xconfigurerequest.above; - wc.stack_mode = event.xconfigurerequest.detail; - XConfigureWindow(dpy, event.xconfigurerequest.window, - event.xconfigurerequest.value_mask, &wc); - if((c = getclient(event.xconfigurerequest.window))) { - if(wc.y < mw && wc.x < mh) { - c->free = True; - c->max = False; - c->tile = False; - moveresize(c, wc.x, wc.y, wc.width, wc.height, 1); - arrange(); - } - } -} - void detach(Client *c) { if(c->prev) c->prev->next = c->next; @@ -213,6 +90,7 @@ errorhandler(Display *d, XErrorEvent *event) { return(1); } +/* for no-important error */ int errorhandlerdummy(Display *d, XErrorEvent *event) { return 0; @@ -293,21 +171,6 @@ getlayoutsym(int l) { return t; } -void -getstatuscmd(char *cmd, char *buf, size_t bufsize) { - int i; - if(!cmd || !buf || !bufsize) - return; - - FILE *f = popen(cmd, "r"); - fgets(buf, bufsize, f); - for(i = 0; i< bufsize; ++i) - if(buf[i] == '\n') - buf[i] = '\0'; - fclose(f); - return; -} - Client* gettbar(Window w) { Client *c; @@ -315,92 +178,6 @@ gettbar(Window w) { return c; } -void -getevent(void) { - XWindowAttributes at; - Window trans; - Client *c; - - struct timeval tv; - - if(QLength(dpy) > 0) - XNextEvent(dpy, &event); - else { - XFlush(dpy); - FD_ZERO(&fd); - FD_SET(ConnectionNumber(dpy), &fd); - event.type = LASTEvent; - tv.tv_sec = 1; - tv.tv_usec = 0; - if(select(FD_SETSIZE, &fd, NULL, NULL, &tv) > 0) - XNextEvent(dpy, &event); - } - - switch (event.type) { - case EnterNotify: - if(event.xcrossing.mode != NotifyNormal - || event.xcrossing.detail == NotifyInferior) - return; - if((c = getclient(event.xcrossing.window)) - || (c = gettbar(event.xcrossing.window))) - if(c->win != bar) - focus(c); - break; - - case MapRequest: - if(!XGetWindowAttributes(dpy, event.xmaprequest.window, &at)) return; - if(at.override_redirect) return; - if(!getclient(event.xmaprequest.window)) - manage(event.xmaprequest.window, &at); - break; - - case MappingNotify: if(event.xmapping.request == MappingKeyboard) grabkeys(); break; - - case PropertyNotify: - if(event.xproperty.state == PropertyDelete) - return; - if((c = getclient(event.xproperty.window))) { - switch(event.xproperty.atom) { - default: break; - case XA_WM_TRANSIENT_FOR: - XGetTransientForHint(dpy, c->win, &trans); - if((c->tile || c->max) && (c->hint = (getclient(trans) != NULL))) - arrange(); - break; - case XA_WM_NORMAL_HINTS: - setsizehints(c); - break; - } - if(event.xproperty.atom == XA_WM_NAME - || event.xproperty.atom == net_atom[NetWMName]) - updateall(); - } - break; - - case ConfigureRequest: configurerequest(event); break; - - case UnmapNotify: - if((c = getclient(event.xunmap.window))) - if(!c->hide) - unmanage(c); - break; - - case DestroyNotify: - if((c = getclient(event.xdestroywindow.window))) - unmanage(c); - break; - - case FocusIn: - if(sel && event.xfocus.window != sel->win) - XSetInputFocus(dpy, sel->win, RevertToPointerRoot, CurrentTime); - break; - - case KeyPress: keypress(&event); break; - case ButtonPress: buttonpress(&event); break; - } - return; -} - void grabbuttons(Client *c, Bool focused) { int i; @@ -547,7 +324,7 @@ init(void) { at.cursor = cursor[CurNormal]; XChangeWindowAttributes(dpy, root, CWEventMask | CWCursor, &at); - /* INIT BAR */ + /* INIT BAR / BUTTON */ at.override_redirect = 1; at.background_pixmap = ParentRelative; at.event_mask = ButtonPressMask | ExposureMask; @@ -556,7 +333,6 @@ init(void) { CWOverrideRedirect | CWBackPixmap | CWEventMask, &at); XSetWindowBackground(dpy, bar, conf.colors.bar); XMapRaised(dpy, bar); - strncpy(bartext, "WMFS-devel", strlen("WMFS-devel")); updatebar(); updatebutton(0); @@ -577,9 +353,9 @@ ishide(Client *c) { void keymovex(char *cmd) { + int tmp; if(sel && cmd && !ishide(sel) && !sel->max && !sel->tile) { - int tmp; tmp = sel->x + atoi(cmd); moveresize(sel, tmp, sel->y, sel->w, sel->h, 1); } @@ -588,39 +364,21 @@ keymovex(char *cmd) { void keymovey(char *cmd) { + int tmp; if(sel && cmd && !ishide(sel) && !sel->max && !sel->tile) { - int tmp; tmp = sel->y + atoi(cmd); moveresize(sel, sel->x, tmp, sel->w, sel->h, 1); } return; } -void -keypress(XEvent *e) { - unsigned int i; - KeySym keysym; - XKeyEvent *ev; - ev = &e->xkey; - keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); - for(i = 0; i < conf.nkeybind; i++) - if(keysym == keys[i].keysym - && (keys[i].mod & ~(numlockmask | LockMask)) == - (ev->state & ~(numlockmask | LockMask)) - && keys[i].func) - { - keys[i].func(keys[i].cmd); - updateall(); - } - return; -} - void keyresize(char *cmd) { if(sel && !ishide(sel) && !sel->max && !sel->tile) { - int temph = 0, tempw = 0, modh = 0, modw = 0, tmp = 0; + int temph = 0, tempw = 0, + modh = 0, modw = 0, tmp = 0; switch(cmd[1]) { case 'h': tmp = (cmd[0] == '+') ? 5 : -5; modh = tmp; break; @@ -647,7 +405,7 @@ killclient(char *cmd) { return; /* check is the client can be close - correctly, else i kill with XKillClient */ + correctly, else it will be kill with XKillClient */ if(XGetWMProtocols(dpy, sel->win, &a, &n)) for(i = 0; !r && i < n; i++) if(a[i] == wm_atom[WMDelete]) @@ -718,6 +476,7 @@ manage(Window w, XWindowAttributes *wa) { Window trans; Status rettrans; XWindowChanges winc; + XSetWindowAttributes at; c = emallocz(sizeof(Client)); c->win = w; @@ -729,25 +488,24 @@ manage(Window w, XWindowAttributes *wa) { c->tag = seltag; if(conf.ttbarheight) { - c->tbar = - XCreateSimpleWindow(dpy, root, - c->x, - c->y - conf.ttbarheight, - c->w, - conf.ttbarheight, - conf.borderheight, - conf.colors.bordernormal, - conf.colors.bar); - XSelectInput(dpy, c->tbar, ExposureMask | EnterWindowMask); - c->button = - XCreateSimpleWindow(dpy, root, - c->x + c->w - 10, - BUTY(c->y), - 5, - BUTH, - 1, - conf.colors.bordernormal, - conf.colors.borderfocus); + at.override_redirect = 1; + at.background_pixmap = ParentRelative; + at.event_mask = ButtonPressMask | ExposureMask; + + c->tbar = XCreateWindow(dpy, root, c->x, c->y - conf.ttbarheight, + c->w, conf.ttbarheight, 0, DefaultDepth(dpy, screen), + CopyFromParent, DefaultVisual(dpy, screen), + CWOverrideRedirect | CWBackPixmap | CWEventMask, &at); + XSetWindowBackground(dpy, c->tbar, conf.colors.bar); + setborder(c->tbar, conf.colors.bordernormal); + + c->button = XCreateWindow(dpy, root, c->x + c->w - 10, BUTY(c->y), + 5, BUTH, 0, DefaultDepth(dpy, screen), + CopyFromParent, DefaultVisual(dpy, screen), + CWOverrideRedirect | CWBackPixmap | CWEventMask, &at); + XSetWindowBackground(dpy, c->button, conf.colors.borderfocus); + XSetWindowBorder(dpy, c->button, conf.colors.bordernormal); + XSetWindowBorderWidth(dpy, c->button, 1); } XConfigureWindow(dpy, w, CWBorderWidth, &winc); @@ -768,14 +526,13 @@ manage(Window w, XWindowAttributes *wa) { raiseclient(c); attach(c); - moveresize(c, c->x, c->y, c->w, c->h, 1); if(c->free) raiseclient(c); XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); mapclient(c); - arrange(); + layoutfunc[seltag](); return; } @@ -1246,12 +1003,10 @@ updatebar(void) { char buf[conf.ntag][100]; char p[3]; - tm = localtime(<); lt = time(NULL); XClearWindow(dpy, bar); - XSetForeground(dpy, gc, conf.colors.text); for(i=0; i #include "config.h" -/* DEFINE TYPES */ +/* Defines */ #define ButtonMask (ButtonPressMask | ButtonReleaseMask) #define MouseMask (ButtonMask | PointerMotionMask) #define KeyMask (KeyPressMask | KeyReleaseMask) @@ -32,7 +32,10 @@ #define Resize 1 #define MAXTAG 36 #define NBUTTON 5 +#define BUTY(y) (y - conf.ttbarheight + 3 + conf.borderheight-1) +#define BUTH (conf.ttbarheight - 6) +/* Client Structure */ typedef struct Client Client; struct Client { char *title; /* Client title */ @@ -49,11 +52,12 @@ struct Client { Window tbar; /* Titlebar */ Window button; /* Close Button */ Bool max, tile, free; /* Client Info */ - Bool hint, hide; /* Client Info² */ + Bool hint, hide; /* Client Info² */ Client *next; /* Next client */ Client *prev; /* Previous client */ }; +/* Keybind Structure */ typedef struct { unsigned long mod; KeySym keysym; @@ -61,6 +65,7 @@ typedef struct { char *cmd; } Key; +/* Bar Button */ typedef struct { char *text; Window win; @@ -73,6 +78,7 @@ typedef struct { unsigned int mouse[NBUTTON]; } BarButton; +/* Tag Structure */ typedef struct { char *name; float mwfact; @@ -80,6 +86,7 @@ typedef struct { int layout; } Tag; +/* Configuration structure */ typedef struct { char *font; char *buttonfont; @@ -107,18 +114,31 @@ typedef struct { int nbutton; } Conf; +/* Enum */ enum { CurNormal, CurResize, CurMove, CurInput, CurLast }; enum { WMState, WMProtocols, WMName, WMDelete, WMLast }; enum { NetSupported, NetWMName, NetLast }; -enum { Free=0, Tile, Max}; +enum { Free = 0, Tile, Max}; + +/* Functions Prototypes */ + +/* event.c */ +void buttonpress(XEvent ev); +void configurerequest(XEvent ev); +void destroynotify(XEvent ev); +void enternotify(XEvent ev); +void focusin(XEvent ev); +void keypress(XEvent ev); +void mapnotify(XEvent ev); +void maprequest(XEvent ev); +void propertynotify(XEvent ev); +void unmapnotify(XEvent ev); +void getevent(void); /* wmfs.c */ void arrange(void); void attach(Client *c); -void buttonpress(XEvent *event); -int clienthintpertag(int tag); int clientpertag(int tag); -void configurerequest(XEvent event); void detach(Client *c); void *emallocz(unsigned int size); int errorhandler(Display *d, XErrorEvent *event); @@ -130,7 +150,6 @@ Client* getclient(Window w); Client* getnext(Client *c); char* getlayoutsym(int l); Client* gettbar(Window w); -void getevent(void); void grabbuttons(Client *c, Bool focused); void grabkeys(void); void hide(Client *c); @@ -138,7 +157,6 @@ void init(void); Bool ishide(Client *c); void keymovex(char *cmd); void keymovey(char *cmd); -void keypress(XEvent *e); void keyresize(char *cmd); void killclient(char *cmd); void layoutswitch(char *cmd); @@ -170,40 +188,50 @@ void updateall(void); void updatetitle(Client *c); void wswitch(char *cmd); -#define BUTY(y) (y - conf.ttbarheight + 3) -#define BUTH (conf.ttbarheight - 6) +/* Variables */ +/* Principal */ Display *dpy; -GC gc; XEvent event; -XFontStruct *font, *font_b; -Conf conf; -int screen; +GC gc; Window root; Window bar; -fd_set fd; -struct tm *tm; -time_t lt; +int screen; +int mw, mh; +Conf conf; Key keys[512]; + +/* Atoms / Cursors */ Atom wm_atom[WMLast]; Atom net_atom[NetLast]; Cursor cursor[CurLast]; -int mw, mh; -int fonth; -int fonty; + +/* Fonts */ +XFontStruct *font, *font_b; +int fonth, fonty; + +/* Bar / Tags */ +Window bar; int barheight; +char bartext[1024]; int seltag; -Client *clients; /* First Client */ -Client *sel; /* selected client */ +int taglen[MAXTAG]; + +/* Important Client */ +Client *clients; +Client *sel; Client *selbytag[MAXTAG]; -/* layout */ +/* Layout/Tile Important variables */ float mwfact[MAXTAG]; int nmaster[MAXTAG]; int layout[MAXTAG]; void (*layoutfunc[MAXTAG])(void); -/**/ -char bartext[1024]; +/* Other */ +unsigned int numlockmask; +fd_set fd; +struct tm *tm; +time_t lt; #endif /* LOCAL_H */