New patches: [XFT support for DE Clemens Fruhwirth **20061202120618] { hunk ./build/ac/configure.ac 68 +else + _DCF_NO_XINERAMA="-DCF_XINERAMA" hunk ./build/ac/configure.ac 432 +AC_ARG_ENABLE([xft], + [AS_HELP_STRING([--disable-xft], + [Disable XFT Support])]) + +if test "x$enable_xft" != xno; then + XFT_CFLAGS=`xft-config --cflags` + XFT_CFLAGS="${XFT_CFLAGS} -DXFT" + XFT_LIBS=`xft-config --libs` +fi + +AC_SUBST([XFT_CFLAGS]) +AC_SUBST([XFT_LIBS]) hunk ./build/ac/system-ac.mk.in 192 +### XFT Support +CFLAGS+=@XFT_CFLAGS@ +LIBS+=@XFT_LIBS@ + hunk ./de/brush.c 41 +#ifdef XFT + brush->draw=NULL; +#endif /* XFT */ hunk ./de/brush.c 110 +#ifdef XFT + if(brush->draw!=NULL) + XftDrawDestroy(brush->draw); +#endif /* XFT */ hunk ./de/brush.c 124 +#ifdef XFT +XftDraw *debrush_get_draw(DEBrush *brush, Drawable d) +{ + if(brush->draw==NULL) + brush->draw=XftDrawCreate(ioncore_g.dpy, d, + XftDEDefaultVisual(), + DefaultColormap(ioncore_g.dpy, + 0)); + else + XftDrawChange(brush->draw, d); + + return brush->draw; +} +#endif + hunk ./de/brush.h 20 +#ifdef XFT +#include +#endif /* XFT */ hunk ./de/brush.h 40 +#ifdef XFT + XftDraw *draw; +#endif hunk ./de/brush.h 113 +#ifdef XFT +XftDraw *debrush_get_draw(DEBrush *brush, Drawable d); +#endif hunk ./de/colour.c 18 +#ifndef XFT hunk ./de/colour.c 21 +#else /* XFT */ + if(name==NULL) + return FALSE; + return XftColorAllocName( + ioncore_g.dpy, + XftDEDefaultVisual(), + rootwin->default_cmap, + name, + ret); +#endif /* XFT */ hunk ./de/colour.c 32 +#ifndef XFT hunk ./de/colour.c 43 +#endif /* ! XFT */ hunk ./de/colour.c 49 +#ifndef XFT hunk ./de/colour.c 58 +#else /* XFT */ + return XftColorAllocName( + ioncore_g.dpy, + XftDEDefaultVisual(), + rootwin->default_cmap, + &(in.color), + out); +#endif /* XFT */ hunk ./de/colour.c 71 +#ifndef XFT hunk ./de/colour.c 86 +#else /* XFT */ + de_free_colour(rootwin, cg->bg); + de_free_colour(rootwin, cg->fg); + de_free_colour(rootwin, cg->hl); + de_free_colour(rootwin, cg->sh); + de_free_colour(rootwin, cg->pad); +#endif /* XFT */ hunk ./de/colour.c 98 +#ifndef XFT hunk ./de/colour.c 104 +#else /* XFT */ + XftColorFree(ioncore_g.dpy, XftDEDefaultVisual(), rootwin->default_cmap, &col); +#endif /* XFT */ hunk ./de/colour.h 18 +#ifdef XFT +#include +#endif /* XFT */ hunk ./de/colour.h 26 +#ifndef XFT hunk ./de/colour.h 28 +#else /* XFT */ +typedef XftColor DEColour; +#endif /* XFT */ hunk ./de/colour.h 47 +#define XftDEDefaultVisual() DefaultVisual(ioncore_g.dpy, 0) hunk ./de/draw.c 25 +#ifndef XFT +#define PIXEL(x) x +#else /* XFT */ +#define PIXEL(x) x.pixel +#endif /* XFT */ + + + hunk ./de/draw.c 91 - XSetForeground(ioncore_g.dpy, gc, tlc); - + XSetForeground(ioncore_g.dpy, gc, PIXEL(tlc)); hunk ./de/draw.c 108 - hunk ./de/draw.c 109 - XSetForeground(ioncore_g.dpy, gc, brc); + XSetForeground(ioncore_g.dpy, gc, PIXEL(brc)); hunk ./de/draw.c 184 - XSetForeground(ioncore_g.dpy, gc, tlc); + XSetForeground(ioncore_g.dpy, gc, PIXEL(tlc)); hunk ./de/draw.c 188 - XSetForeground(ioncore_g.dpy, gc, tlc); + XSetForeground(ioncore_g.dpy, gc, PIXEL(tlc)); hunk ./de/draw.c 192 - XSetForeground(ioncore_g.dpy, gc, brc); + XSetForeground(ioncore_g.dpy, gc, PIXEL(brc)); hunk ./de/draw.c 196 - XSetForeground(ioncore_g.dpy, gc, brc); + XSetForeground(ioncore_g.dpy, gc, PIXEL(brc)); hunk ./de/draw.c 286 - XSetForeground(ioncore_g.dpy, d->copy_gc, cg->fg); + XSetForeground(ioncore_g.dpy, d->copy_gc, PIXEL(cg->fg)); hunk ./de/draw.c 336 - XSetForeground(ioncore_g.dpy, gc, cg->bg); + XSetForeground(ioncore_g.dpy, gc, PIXEL(cg->bg)); hunk ./de/draw.c 491 - attr.background_pixel=brush->d->cgrp.bg; + attr.background_pixel=brush->d->PIXEL(cgrp.bg); hunk ./de/draw.c 507 - XSetForeground(ioncore_g.dpy, gc, cg->bg); + XSetForeground(ioncore_g.dpy, gc, PIXEL(cg->bg)); hunk ./de/font.c 17 +#ifndef XFT hunk ./de/font.c 19 +#endif /* ! XFT */ hunk ./de/font.c 31 +#ifdef XFT + XftFont *font; +#endif hunk ./de/font.c 48 +#ifndef XFT hunk ./de/font.c 75 +#else /* XFT */ + if(strncmp(fontname, "xft:", 4)==0){ + font=XftFontOpenName(ioncore_g.dpy, DefaultScreen(ioncore_g.dpy), + fontname+4); + }else{ + font=XftFontOpenXlfd(ioncore_g.dpy, DefaultScreen(ioncore_g.dpy), fontname); + } + + if(font==NULL){ + if(strcmp(fontname, CF_FALLBACK_FONT_NAME)!=0){ + warn(TR("Could not load font \"%s\", trying \"%s\""), + fontname, CF_FALLBACK_FONT_NAME); + return de_load_font(CF_FALLBACK_FONT_NAME); + } + return NULL; + } +#endif /* XFT */ hunk ./de/font.c 97 +#ifndef XFT hunk ./de/font.c 100 +#else + fnt->font=font; +#endif hunk ./de/font.c 122 +#ifndef XFT hunk ./de/font.c 128 +#endif /* ! XFT */ hunk ./de/font.c 143 +#ifndef XFT hunk ./de/font.c 149 +#endif /* ! XFT */ hunk ./de/font.c 159 +#ifndef XFT hunk ./de/font.c 164 +#else /* XFT */ + if(font->font!=NULL) + XftFontClose(ioncore_g.dpy, font->font); +#endif /* XFT */ hunk ./de/font.c 195 +#ifndef XFT hunk ./de/font.c 211 - +#else /* XFT */ + if(font->font!=NULL){ + fnte->max_height=font->font->ascent+font->font->descent; + fnte->max_width=font->font->max_advance_width; + fnte->baseline=font->font->ascent; + return; + } +#endif /* XFT */ hunk ./de/font.c 235 +#ifndef XFT hunk ./de/font.c 239 - if(ioncore_g.enc_utf8) - Xutf8TextExtents(font->fontset, text, len, NULL, &lext); - else + if(ioncore_g.enc_utf8) + Xutf8TextExtents(font->fontset, text, len, NULL, &lext); + else hunk ./de/font.c 243 - XmbTextExtents(font->fontset, text, len, NULL, &lext); - return lext.width; + XmbTextExtents(font->fontset, text, len, NULL, &lext); + return lext.width; hunk ./de/font.c 250 +#else /* XFT */ + if(font->font!=NULL){ + XGlyphInfo extents; + if(ioncore_g.enc_utf8) + XftTextExtentsUtf8(ioncore_g.dpy, font->font, (XftChar8 *)text, len, + &extents); + else + XftTextExtents8(ioncore_g.dpy, font->font, (XftChar8 *)text, len, + &extents); + return extents.xOff; + }else{ + return 0; + } +#endif /* XFT */ hunk ./de/font.c 273 +#ifndef XFT hunk ./de/font.c 319 +#else /* XFT */ +void debrush_do_draw_string_default(DEBrush *brush, + int x, int y, const char *str, + int len, bool needfill, + DEColourGroup *colours) +{ + Window win = brush->win; + GC gc=brush->d->normal_gc; + XftDraw *draw; + XftFont *font; + + if(brush->d->font==NULL) + return; + + font=brush->d->font->font; + draw=debrush_get_draw(brush, win); + + if(TRUE/*needfill*/){ + XGlyphInfo extents; + if(ioncore_g.enc_utf8) + XftTextExtentsUtf8(ioncore_g.dpy, font, (XftChar8 *)str, len, + &extents); + else + XftTextExtents8(ioncore_g.dpy, font, (XftChar8 *)str, len, &extents); + XftDrawRect(draw, &(colours->bg), x-extents.x, y-extents.y, + extents.width+10, extents.height); +// extents.xOff, extents.yOff); + // printf("drawing\n"); + } + + if(ioncore_g.enc_utf8) + XftDrawStringUtf8(draw, &(colours->fg), font, x, y, (XftChar8 *)str, + len); + else + XftDrawString8(draw, &(colours->fg), font, x, y, (XftChar8 *)str, len); +} +#endif /* XFT */ hunk ./de/font.h 17 +#ifdef XFT +#include +#endif /* XFT */ hunk ./de/font.h 35 +#ifdef XFT /* XFT */ + XftFont *font; +#endif /* XFT */ hunk ./de/init.c 115 - de_get_colour(rootwin, &(cg->hl), tab, based_on, "highlight_colour", - DE_WHITE(rootwin)); - de_get_colour(rootwin, &(cg->sh), tab, based_on, "shadow_colour", - DE_WHITE(rootwin)); - de_get_colour(rootwin, &(cg->bg), tab, based_on, "background_colour", - DE_BLACK(rootwin)); - de_get_colour(rootwin, &(cg->fg), tab, based_on, "foreground_colour", - DE_WHITE(rootwin)); - de_get_colour(rootwin, &(cg->pad), tab, based_on, "padding_colour", - cg->bg); + DEColour black, white; +#ifdef XFT + de_alloc_colour(rootwin, &black, "black"); + de_alloc_colour(rootwin, &white, "white"); +#else + black=DE_BLACK(rootwin); + white=DE_WHITE(rootwin); +#endif + de_get_colour(rootwin, &(cg->hl), tab, based_on, "highlight_colour", white); + de_get_colour(rootwin, &(cg->sh), tab, based_on, "shadow_colour", white); + de_get_colour(rootwin, &(cg->bg), tab, based_on, "background_colour", black); + de_get_colour(rootwin, &(cg->fg), tab, based_on, "foreground_colour", white); + de_get_colour(rootwin, &(cg->pad), tab, based_on, "padding_colour", cg->bg); hunk ./de/style.c 77 +#ifndef XFT hunk ./de/style.c 82 +#else /* XFT */ +// if(style->font!=NULL){ +// gcv.font=style->font; +// gcvmask|=GCFont; +// } +#endif /* XFT */ hunk ./de/style.c 216 + DEColour black, white; +#ifdef XFT + de_alloc_colour(rootwin, &black, "black"); + de_alloc_colour(rootwin, &white, "white"); +#else + black=DE_BLACK(rootwin); + white=DE_WHITE(rootwin); +#endif /* XFT */ hunk ./de/style.c 247 - style->cgrp.bg=DE_BLACK(rootwin); - style->cgrp.pad=DE_BLACK(rootwin); - style->cgrp.fg=DE_WHITE(rootwin); - style->cgrp.hl=DE_WHITE(rootwin); - style->cgrp.sh=DE_WHITE(rootwin); + style->cgrp.bg=black; + style->cgrp.pad=black; + style->cgrp.fg=white; + style->cgrp.hl=white; + style->cgrp.sh=white; hunk ./de/style.h 79 + int xft_style; hunk ./mod_query/wedln.c 93 - /*if(txw){ + if(txw){ hunk ./mod_query/wedln.c 98 - }*/ + } } [Cleanups to XFT string drawing, I forgot Clemens Fruhwirth **20061202163511] { hunk ./de/font.c 336 - if(TRUE/*needfill*/){ + if(needfill){ hunk ./de/font.c 345 -// extents.xOff, extents.yOff); - // printf("drawing\n"); } Context: [Increased query history size from 256 to 1024 Tuomo Valkonen **20061123221715] [Don't unmanage stdisp when switching to region that can't manage it Tuomo Valkonen **20061119231353] [Changed region_rqgeom parametrisation Tuomo Valkonen **20061112154650 - Gravity can now be passed down to the root relative ("absolute") version, allowing removal of WClientWin specific checks/hacks. ] [Detach tries to keep root-relative geometry unchanged Tuomo Valkonen **20061112124721 (For framed detach, the geometry of the frame is tried to be kept unchanged from the origianl geomery of the detached object.) ] [Detach works on transients now Tuomo Valkonen **20061112123708] [Readjust cursor position for infobox Tuomo Valkonen **20061112122208] [Updated Czech translation Miroslav Kure **20061112103804] [statusd startup timeout tunning Tuomo Valkonen **20061111182013 (incl. typo fix) ] [Updated Finnish translation Tuomo Valkonen **20061111153900] [Menu name translation hack Tuomo Valkonen **20061111153329 (These are hidden in strings in the configuration files.) ] [Added info box for history completion mode into queries Tuomo Valkonen **20061111135250] [Warp in WMPlex.set_hidden Tuomo Valkonen **20061111120131] [Do not duplicate entries already in history when pushing. Tuomo Valkonen **20061109180928 Instead move the first already existing first. ] [strcoll instead of strcmp for completion sorting Tuomo Valkonen **20061109180037] [Complete history in history order instead of character set Tuomo Valkonen **20061109175924] [Clear a few more flags of frame size hints Tuomo Valkonen **20061104145843] [Fixed mod_query.query_attachclient to attach the containing WGroupCW. Tuomo Valkonen **20061103214654 Also, if one does not exist (e.g. when attaching transients), one is created. ] [Made pholder_do_attach return region instead of boolean. Tuomo Valkonen **20061103213553] [Fixed switchto/hidden WMPlex attach parameter interaction. Tuomo Valkonen **20061103075255] [Remanage stdisp when bottom attached to group Tuomo Valkonen **20061101201334] [Fixed coding style Tuomo Valkonen **20061031161950 (Remember the coding style, folks!) ] [Handle mods in submapgrab_handler David Smith **20061031120320] [Doc. fixes Tuomo Valkonen **20061031161915] [tiling_placement_alt fixes Tuomo Valkonen **20061030210733] [Comments about moronic kernels and improved workaround Tuomo Valkonen **20061030210537] [Respect REGION_SKIP_FOCUS more often Tuomo Valkonen **20061029130953] [Oops Tuomo Valkonen **20061029130759] [TAG ion-3ds-20061029 Tuomo Valkonen **20061028231525] Patch bundle hash: 97c24ed59a14f268f205af206bade3c0facbd92b