about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
...
* snapshot of project "lynx", label v2-8-9dev_6aThomas E. Dickey2015-05-0912-35/+39
|
* snapshot of project "lynx", label v2-8-9dev_6Thomas E. Dickey2015-05-072-4/+4
|
* snapshot of project "lynx", label v2-8-9dev_5gThomas E. Dickey2015-05-073-6/+18
|
* snapshot of project "lynx", label v2-8-9dev_5fThomas E. Dickey2015-05-062-18/+78
|
* snapshot of project "lynx", label v2-8-9dev_5eThomas E. Dickey2015-05-048-3464/+3546
|
* snapshot of project "lynx", label v2-8-9dev_5dThomas E. Dickey2015-04-253-4052/+4330
|
* snapshot of project "lynx", label v2-8-9dev_5cThomas E. Dickey2015-04-236-4642/+4658
|
* snapshot of project "lynx", label v2-8-9dev_5bThomas E. Dickey2015-04-157-7609/+7680
|
* snapshot of project "lynx", label v2-8-9dev_5aThomas E. Dickey2015-04-1512-2466/+2564
|
* snapshot of project "lynx", label v2-8-9dev_5Thomas E. Dickey2015-04-1312-5564/+6248
|
* snapshot of project "lynx", label v2-8-9dev_4bThomas E. Dickey2015-04-064-2142/+2217
|
* snapshot of project "lynx", label v2-8-9dev_4aThomas E. Dickey2015-03-2215-3689/+3852
|
*
* snapshot of project "lynx", label v2-8-9dev_1bThomas E. Dickey2014-07-2415-4032/+5247
|
* snapshot of project "lynx", label v2-8-9dev_1aThomas E. Dickey2014-06-0611-37/+43
|
* snapshot of project "lynx", label v2-8-9dev_1Thomas E. Dickey2014-03-1211-28/+30
|
* snapshot of project "lynx", label v2-8-8rel_2Thomas E. Dickey2014-03-092-4/+4
|
* snapshot of project "lynx", label v2-8-8rel_1dThomas E. Dickey2014-03-0910-10/+12
|
* snapshot of project "lynx", label v2-8-8rel_1cThomas E. Dickey2014-03-095-9/+12
|
* snapshot of project "lynx", label v2-8-8rel_1bThomas E. Dickey2014-03-092-31/+15
|
* snapshot of project "lynx", label v2-8-8rel_1aThomas E. Dickey2014-02-2111-25/+31
|
* snapshot of project "lynx", label v2-8-8rel_1Thomas E. Dickey2014-02-1411-27/+28
|
* snapshot of project "lynx", label v2-8-8pre_5Thomas E. Dickey2014-02-142-4/+4
|
* snapshot of project "lynx", label v2-8-8pre_4gThomas E. Dickey2014-02-142-3/+5
|
* snapshot of project "lynx", label v2-8-8pre_4fThomas E. Dickey2014-02-133-23/+54
|
* snapshot of project "lynx", label v2-8-8pre_4eThomas E. Dickey2014-02-134-33/+89
|
* snapshot of project "lynx", label v2-8-8pre_4dThomas E. Dickey2014-02-138-21/+30
|
* snapshot of project "lynx", label v2-8-8pre_4cThomas E. Dickey2014-02-137-9/+90
|
* snapshot of project "lynx", label v2-8-8pre_4bThomas E. Dickey2014-02-124-934/+808
|
* snapshot of project "lynx", label v2-8-8pre_4aThomas E. Dickey2014-02-0815-843/+978
|
* snapshot of project "lynx", label v2-8-8pre_4Thomas E. Dickey2014-02-053-5/+5
|
* snapshot of project "lynx", label v2-8-8pre_3cThomas E. Dickey2014-02-047-25/+50
|
* snapshot of project "lynx", label v2-8-8pre_3bThomas E. Dickey2014-02-034-20/+28
|
* snapshot of project "lynx", label v2-8-8pre_3aThomas E. Dickey2014-01-1914-32/+64
|
* snapshot of project "lynx", label v2-8-8pre_3Thomas E. Dickey2014-01-112-4/+4
|
* snapshot of project "lynx", label v2-8-8pre_2bThomas E. Dickey2014-01-1117-2700/+2811
|
* snapshot of project "lynx", label v2-8-8pre_2aThomas E. Dickey2014-01-0942-1916/+2648
|
* snapshot of project "lynx", label v2-8-8pre_2Thomas E. Dickey2013-12-189-59/+65
|
span>b->color.bg; if(b->font->set) { XChangeGC(dpy, b->gc, GCForeground | GCBackground, &gcv); XmbDrawImageString(dpy, b->drawable, b->font->set, b->gc, x, y, buf, len); } else { gcv.font = b->font->xfont->fid; XChangeGC(dpy, b->gc, GCForeground | GCBackground | GCFont, &gcv); XDrawImageString(dpy, b->drawable, b->gc, x, y, buf, len); } } static unsigned long xloadcolor(Display *dpy, Colormap cmap, const char *colstr) { XColor color; XAllocNamedColor(dpy, cmap, colstr, &color, &color); return color.pixel; } void loadcolor(Display *dpy, int screen, Color *c, const char *bg, const char *fg, const char *border) { Colormap cmap = DefaultColormap(dpy, screen); c->bg = xloadcolor(dpy, cmap, bg); c->fg = xloadcolor(dpy, cmap, fg); c->border = xloadcolor(dpy, cmap, border); } unsigned int textwidth_l(Fnt *font, char *text, unsigned int len) { if(font->set) { XRectangle r; XmbTextExtents(font->set, text, len, 0, &r); return r.width; } return XTextWidth(font->xfont, text, len); } unsigned int textwidth(Fnt *font, char *text) { return textwidth_l(font, text, strlen(text)); } void loadfont(Display *dpy, Fnt *font, const char *fontstr) { char **missing, *def; int n; missing = 0; def = "?"; setlocale(LC_ALL, ""); if(font->set) XFreeFontSet(dpy, font->set); font->set = XCreateFontSet(dpy, fontstr, &missing, &n, &def); if(missing) { while(n--) fprintf(stderr, "missing fontset: %s\n", missing[n]); XFreeStringList(missing); if(font->set) { XFreeFontSet(dpy, font->set); font->set = 0; } } if(font->set) { XFontSetExtents *font_extents; XFontStruct **xfonts; char **font_names; unsigned int i; font->ascent = font->descent = 0; font_extents = XExtentsOfFontSet(font->set); n = XFontsOfFontSet(font->set, &xfonts, &font_names); for(i = 0, font->ascent = 0, font->descent = 0; i < n; i++) { if(font->ascent < (*xfonts)->ascent) font->ascent = (*xfonts)->ascent; if(font->descent < (*xfonts)->descent) font->descent = (*xfonts)->descent; xfonts++; } } else { if(font->xfont) XFreeFont(dpy, font->xfont); font->xfont = 0; font->xfont = XLoadQueryFont(dpy, fontstr); if (!font->xfont) font->xfont = XLoadQueryFont(dpy, "fixed"); if (!font->xfont) error("error, cannot load 'fixed' font\n"); font->ascent = font->xfont->ascent; font->descent = font->xfont->descent; } }