about summary refs log tree commit diff stats
path: root/dwm.h
Commit message (Expand)AuthorAgeFilesLines
* new color stuff/new rendering stuffAnselm R. Garbe2006-08-251-4/+7
* back to 3 colorsAnselm R. Garbe2006-08-251-2/+3
* 3->4 colorsAnselm R. Garbe2006-08-241-3/+2
* updated man pageAnselm R. Garbe2006-08-231-1/+1
* separated setup stuff into main.c:setup() - this makes main() more readableAnselm R. Garbe2006-08-231-12/+8
* separated several functions into view.cAnselm R. Garbe2006-08-221-10/+12
* changed main event loopAnselm R.Garbe2006-08-151-0/+1
* removed NUMLOCKMASK, added dynamically calculated numlockmask insteadAnselm R.Garbe2006-08-141-1/+1
* changed replacetag into toggletagAnselm R.Garbe2006-08-141-3/+3
* removed ungrabkeys again (because of sander's mail)Anselm R.Garbe2006-08-141-1/+0
* implemented ungrabkeys() which is called in cleanup()Anselm R.Garbe2006-08-141-0/+1
* implemented restack behavior (floats are on top in tiled mode)Anselm R.Garbe2006-08-141-1/+2
* removed viewnext/viewprevAnselm R.Garbe2006-08-141-2/+0
* made shortcuts like proposed by Sander, renamed viewextend to toggleview (mor...Anselm R.Garbe2006-08-131-1/+1
* implemented viewextend and added M-S-C-n shortcuts for extending the current ...Anselm R.Garbe2006-08-111-1/+2
* implement multi-tag selection through button3 click on the specific tagAnselm R.Garbe2006-08-111-2/+3
* readded border color, this sucks leastAnselm R.Garbe2006-08-101-0/+1
* removed unnecessary border colorAnselm R.Garbe2006-08-101-1/+0
* disallow zoom on maximized clientsAnselm R.Garbe2006-08-101-1/+0
* removed NET_ACTIVE_WINDOW handlingAnselm R.Garbe2006-08-081-1/+1
* implemented NET_ACTIVE_WINDOW supportAnselm R.Garbe2006-08-081-1/+1
* switched to regexp matching for Rulesarg@10ksloc.org2006-08-041-0/+1
* using execl now, argv changed, using cmd and const char defs directly in the ...arg@10ksloc.org2006-08-041-1/+1
* removed TLast tag enum, now tags is simple defined as char *[] array, the res...arg@10ksloc.org2006-08-031-2/+3
* changed Client->tags and Rule->tags to be Bool (I'll also try to remove the T...arg@10ksloc.org2006-08-031-3/+4
* removed the CONFIG variable from config.mk, renamed config.h into config.defa...arg@10ksloc.org2006-08-021-1/+1
* made fullscreen apps working fine in floating mode (there is no sane way to m...arg@10ksloc.org2006-08-021-2/+2
* renamed WM_PROTOCOL_DELWIN into PROTODELWINarg@10ksloc.org2006-08-011-1/+1
* cleaned config.*h to prevent some confusionarg@10ksloc.org2006-08-011-2/+3
* uppercasing all define'd values (uppercase-prefixed should only be enum field...arg@10ksloc.org2006-08-011-2/+2
* centralized/externalized configuration to config.harg@10ksloc.org2006-08-011-20/+1
* applied Jukkas prev/next patch with XK_{h,l}arg@10ksloc.org2006-08-011-0/+2
* applied Sanders patchesarg@10ksloc.org2006-08-011-2/+6
* committed a patch which fixes the hints of Jukkaarg@10ksloc.org2006-08-011-1/+1
* sanitization of several clunky stuff, removed heretag (rarely of use), simpli...arg@10ksloc.org2006-07-211-12/+10
* applied sanders no_sizehints for tiled mode patch (thx!)arg@10ksloc.org2006-07-201-1/+1
* using double-linked list in order to get correct prev focus handlingarg@10ksloc.org2006-07-201-1/+2
* cleaned the CUSTOMIZE flagsarg@10ksloc.org2006-07-201-2/+2
* made status bar drawing more robust, implemented togglemax and togglemode, wo...arg@10ksloc.org2006-07-201-1/+3
* removed c->f{x,y,w,h} and c->t{x,y,w,h} in favor for the new rule handling re...arg@10ksloc.org2006-07-201-5/+2
* implemented regexp matching for rulesarg@10ksloc.org2006-07-191-17/+0
* applied Jukka's patch with s/ModKeyMask/MODKEY/garg@10ksloc.org2006-07-191-0/+1
* refactored Sanders code somewhatarg@10ksloc.org2006-07-191-2/+2
* applied Sanders resize patch, fixed lower bugarg@10ksloc.org2006-07-191-1/+4
* implemened distinguishing float/managed geometries of clients (works quite well)Anselm R. Garbe2006-07-181-2/+5
* pop on heretagAnselm R. Garbe2006-07-181-0/+1
* added heretag command which allows to tag a client of a foreign tag with curr...Anselm R. Garbe2006-07-181-1/+2
* ordered variables in structs and source files alphabeticallyAnselm R. Garbe2006-07-171-20/+18
* several additions in mouse handling ;)Anselm R. Garbe2006-07-161-2/+2
* changing XFlush into XSyncAnselm R. Garbe2006-07-151-0/+5
">*text, unsigned int len) { XRectangle r; if(dc.font.set) { XmbTextExtents(dc.font.set, text, len, NULL, &r); return r.width; } return XTextWidth(dc.font.xfont, text, len); } static void drawtext(const char *text, Bool invert, Bool border) { int x, y, w, h; static char buf[256]; unsigned int len; XGCValues gcv; XRectangle r = { dc.x, dc.y, dc.w, dc.h }; XSetForeground(dpy, dc.gc, invert ? dc.fg : dc.bg); XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); w = 0; if(border) drawborder(); if(!text) return; len = strlen(text); if(len >= sizeof(buf)) len = sizeof(buf) - 1; memcpy(buf, text, len); buf[len] = 0; h = dc.font.ascent + dc.font.descent; y = dc.y + (dc.h / 2) - (h / 2) + dc.font.ascent; x = dc.x + (h / 2); /* shorten text if necessary */ while(len && (w = textnw(buf, len)) > dc.w - h) buf[--len] = 0; if(w > dc.w) return; /* too long */ gcv.foreground = invert ? dc.bg : dc.fg; gcv.background = invert ? dc.fg : dc.bg; if(dc.font.set) { XChangeGC(dpy, dc.gc, GCForeground | GCBackground, &gcv); XmbDrawImageString(dpy, dc.drawable, dc.font.set, dc.gc, x, y, buf, len); } else { gcv.font = dc.font.xfont->fid; XChangeGC(dpy, dc.gc, GCForeground | GCBackground | GCFont, &gcv); XDrawImageString(dpy, dc.drawable, dc.gc, x, y, buf, len); } } /* extern */ void drawall() { Client *c; for(c = clients; c; c = getnext(c->next)) drawtitle(c); drawstatus(); } void drawstatus() { int i, x; Bool istile = arrange == dotile; dc.x = dc.y = 0; dc.w = bw; drawtext(NULL, !istile, False); dc.w = 0; for(i = 0; i < TLast; i++) { dc.x += dc.w; dc.w = textw(tags[i]); if(istile) drawtext(tags[i], (i == tsel), True); else drawtext(tags[i], (i != tsel), True); } x = dc.x + dc.w; dc.w = textw(stext); dc.x = bx + bw - dc.w; drawtext(stext, !istile, False); if(sel && ((dc.w = dc.x - x) >= bh)) { dc.x = x; drawtext(sel->name, istile, True); } XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, bw, bh, 0, 0); XSync(dpy, False); } void drawtitle(Client *c) { int i; Bool istile = arrange == dotile; if(c == sel) { drawstatus(); XUnmapWindow(dpy, c->title); XSetWindowBorder(dpy, c->win, dc.fg); return; } XSetWindowBorder(dpy, c->win, dc.bg); XMapWindow(dpy, c->title); dc.x = dc.y = 0; dc.w = 0; for(i = 0; i < TLast; i++) { if(c->tags[i]) { dc.x += dc.w; dc.w = textw(c->tags[i]); drawtext(c->tags[i], !istile, True); } } dc.x += dc.w; dc.w = textw(c->name); drawtext(c->name, !istile, True); XCopyArea(dpy, dc.drawable, c->title, dc.gc, 0, 0, c->tw, c->th, 0, 0); XSync(dpy, False); } unsigned long getcolor(const char *colstr) { Colormap cmap = DefaultColormap(dpy, screen); XColor color; XAllocNamedColor(dpy, cmap, colstr, &color, &color); return color.pixel; } void setfont(const char *fontstr) { char **missing, *def; int i, n; missing = NULL; setlocale(LC_ALL, ""); if(dc.font.set) XFreeFontSet(dpy, dc.font.set); dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def); if(missing) { while(n--) fprintf(stderr, "missing fontset: %s\n", missing[n]); XFreeStringList(missing); if(dc.font.set) { XFreeFontSet(dpy, dc.font.set); dc.font.set = NULL; } } if(dc.font.set) { XFontSetExtents *font_extents; XFontStruct **xfonts; char **font_names; dc.font.ascent = dc.font.descent = 0; font_extents = XExtentsOfFontSet(dc.font.set); n = XFontsOfFontSet(dc.font.set, &xfonts, &font_names); for(i = 0, dc.font.ascent = 0, dc.font.descent = 0; i < n; i++) { if(dc.font.ascent < (*xfonts)->ascent) dc.font.ascent = (*xfonts)->ascent; if(dc.font.descent < (*xfonts)->descent) dc.font.descent = (*xfonts)->descent; xfonts++; } } else { if(dc.font.xfont) XFreeFont(dpy, dc.font.xfont); dc.font.xfont = NULL; dc.font.xfont = XLoadQueryFont(dpy, fontstr); if (!dc.font.xfont) dc.font.xfont = XLoadQueryFont(dpy, "fixed"); if (!dc.font.xfont) eprint("error, cannot init 'fixed' font\n"); dc.font.ascent = dc.font.xfont->ascent; dc.font.descent = dc.font.xfont->descent; } dc.font.height = dc.font.ascent + dc.font.descent; } unsigned int textw(char *text) { return textnw(text, strlen(text)) + dc.font.height; }