diff options
author | Matti Bickel <mabi@gentoo.org> | 2007-06-02 20:25:18 +0000 |
---|---|---|
committer | Matti Bickel <mabi@gentoo.org> | 2007-06-02 20:25:18 +0000 |
commit | 442cab3848481c762f02921cdaacd4e571cbb823 (patch) | |
tree | 4085ade9671ac6508b30c580cd8525a2680a30a2 /x11-wm | |
parent | s:xfce:maintainer-needed: (diff) | |
download | historical-442cab3848481c762f02921cdaacd4e571cbb823.tar.gz historical-442cab3848481c762f02921cdaacd4e571cbb823.tar.bz2 historical-442cab3848481c762f02921cdaacd4e571cbb823.zip |
Added missing xft-ion3-20070506.patch (bug #180491)
Package-Manager: portage-2.1.2.9
Diffstat (limited to 'x11-wm')
-rw-r--r-- | x11-wm/ion3/ChangeLog | 6 | ||||
-rw-r--r-- | x11-wm/ion3/Manifest | 18 | ||||
-rw-r--r-- | x11-wm/ion3/files/xft-ion3-20070506.patch | 669 |
3 files changed, 685 insertions, 8 deletions
diff --git a/x11-wm/ion3/ChangeLog b/x11-wm/ion3/ChangeLog index e064f302dd04..578ebe89fc94 100644 --- a/x11-wm/ion3/ChangeLog +++ b/x11-wm/ion3/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for x11-wm/ion3 # Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/x11-wm/ion3/ChangeLog,v 1.51 2007/06/01 22:55:01 mabi Exp $ +# $Header: /var/cvsroot/gentoo-x86/x11-wm/ion3/ChangeLog,v 1.52 2007/06/02 20:25:18 mabi Exp $ + + 02 Jun 2007; Matti Bickel <mabi@gentoo.org> + +files/xft-ion3-20070506.patch: + Added missing xft-ion3-20070506.patch (bug #180491) *ion3-20070506-r1 (01 Jun 2007) diff --git a/x11-wm/ion3/Manifest b/x11-wm/ion3/Manifest index 98b8020bc8b7..78a821619de1 100644 --- a/x11-wm/ion3/Manifest +++ b/x11-wm/ion3/Manifest @@ -93,6 +93,10 @@ AUX xft-ion3-20070318.patch 19100 RMD160 7d0d01e42d65961655046f6485011425311e872 MD5 319a7254cf4093a9e84993515b9462ec files/xft-ion3-20070318.patch 19100 RMD160 7d0d01e42d65961655046f6485011425311e8723 files/xft-ion3-20070318.patch 19100 SHA256 d5e57e91185ae5c508ed036d689b5ea58e7322b633705503cfaa5ac18ff9f936 files/xft-ion3-20070318.patch 19100 +AUX xft-ion3-20070506.patch 18375 RMD160 2510ae25502346f0347eafce8a313aac4db2a36c SHA1 ae75b297d6cf8c3f5dfd3793c22d754369f982bb SHA256 1db26c1db08b9a87530ef29ad2538cf191bc5d08630cc776f1dbd61940eff21f +MD5 68f3da20b45ec583347b5325d9062e19 files/xft-ion3-20070506.patch 18375 +RMD160 2510ae25502346f0347eafce8a313aac4db2a36c files/xft-ion3-20070506.patch 18375 +SHA256 1db26c1db08b9a87530ef29ad2538cf191bc5d08630cc776f1dbd61940eff21f files/xft-ion3-20070506.patch 18375 DIST ion-3ds-20060326.tar.gz 617533 RMD160 147e6ad20c69ca8fe5a80dcd57ce6002a2b3cde1 SHA1 5202322198071f7cee2aefc2bcc8bd0b3a08a490 SHA256 9f3c96c961e47c61e9c10b57de820b608b9d9fdaa43a893e63499b3f17231124 DIST ion-3ds-20061223.tar.gz 649463 RMD160 dc61a012354a30f1a83b8b0970b8c09724ea4c9c SHA1 8bccf120ce27b26feb67a916ba61748e85e69733 SHA256 0970fef74de659de45813471560ebe2f97b893de7a238ea00755fcaeb9b7d89e DIST ion-3ds-20070318.tar.gz 657282 RMD160 a7cc9baea3624b0ed840fdc82fc5db2ac1018d9a SHA1 f352a1c7f6f465478141d538b2a4c3f3e81a4f30 SHA256 712da027fb12774f67d933d95a95452d98a5658617fc5515011ca79b6035258a @@ -124,10 +128,10 @@ EBUILD ion3-20070506-r1.ebuild 4938 RMD160 144afaa870cdb2f7752eb2f9abfbafbf14131 MD5 c0089976a54980ac5b3986eb74ab6897 ion3-20070506-r1.ebuild 4938 RMD160 144afaa870cdb2f7752eb2f9abfbafbf141317e2 ion3-20070506-r1.ebuild 4938 SHA256 42bbfab90164ba52ab9b69e341096d97c9f70fa892c5f6c1fa2926f94a0a6748 ion3-20070506-r1.ebuild 4938 -MISC ChangeLog 8750 RMD160 68d23145d88374e4a5105bce1b38e73c1b401dfa SHA1 e0b095788df30048dce8b9352ee415bd204e3b01 SHA256 4860ec2c7d72da020b1943b4d6a23d7ecf48b80c1f5a59f47911ce87eb88fb4c -MD5 9d6b981046e3cd83c4df99e339364d66 ChangeLog 8750 -RMD160 68d23145d88374e4a5105bce1b38e73c1b401dfa ChangeLog 8750 -SHA256 4860ec2c7d72da020b1943b4d6a23d7ecf48b80c1f5a59f47911ce87eb88fb4c ChangeLog 8750 +MISC ChangeLog 8885 RMD160 e2c2da58f72c7efdf8c950dab98b3cb0c1ffc2bd SHA1 5cf52be7bf7d0c4148a2a92de1ad7db48a0b1759 SHA256 679c355a8dfc4fff7b17a973ee44ac3299aa5953be187ffd64a1ac02ff9d840f +MD5 334fe0eb626aefdb4f2a1aaa4c57491c ChangeLog 8885 +RMD160 e2c2da58f72c7efdf8c950dab98b3cb0c1ffc2bd ChangeLog 8885 +SHA256 679c355a8dfc4fff7b17a973ee44ac3299aa5953be187ffd64a1ac02ff9d840f ChangeLog 8885 MISC metadata.xml 244 RMD160 10fcb6c60f0d88174ff99fd391d0da3a75bdf89d SHA1 bee870f83b6bd74feedef2b9ff8da8f4820cc19f SHA256 c7b6d3457d4746a2b281c4ac598bcf78b8e1553d8d63f2523b4cd0f4eaa422b1 MD5 d992d28bec4a3bfd72b441145091a58e metadata.xml 244 RMD160 10fcb6c60f0d88174ff99fd391d0da3a75bdf89d metadata.xml 244 @@ -147,7 +151,7 @@ SHA256 f2b7c50a3bf973359aa6e899f99fede7ebdd3698b2e93918d9f5e1306ef6ae19 files/di -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) -iD8DBQFGYKMrfNMcoUhJ7GwRAqg2AKCsrpzzOqM2fHgeVKsTB1PNjSySmACeMD7j -WbuvZdLCWozF2us04f9d6cg= -=1b15 +iD8DBQFGYdHPfNMcoUhJ7GwRAl8IAKCFx5lKU/b/w/1cm7X95jBHUyw1HACfc4Mj +Rb5sJ/9REfD9xdxXE9U2D1c= +=fouC -----END PGP SIGNATURE----- diff --git a/x11-wm/ion3/files/xft-ion3-20070506.patch b/x11-wm/ion3/files/xft-ion3-20070506.patch new file mode 100644 index 000000000000..0cff5581a191 --- /dev/null +++ b/x11-wm/ion3/files/xft-ion3-20070506.patch @@ -0,0 +1,669 @@ +diff -Naur ../work/ion-3/de/brush.c ion-3ds-20070203/de/brush.c +--- ../work/ion-3/de/brush.c 2007-02-03 17:50:52.000000000 +0300 ++++ ion-3ds-20070203/de/brush.c 2007-02-21 13:11:57.000000000 +0300 +@@ -47,6 +47,9 @@ + + gr_stylespec_init(&brush->current_attr); + ++#ifdef XFT ++ brush->draw=NULL; ++#endif /* XFT */ + style->usecount++; + + if(!grbrush_init(&(brush->grbrush))){ +@@ -127,6 +130,10 @@ + { + destyle_unref(brush->d); + brush->d=NULL; ++#ifdef XFT ++ if(brush->draw!=NULL) ++ XftDrawDestroy(brush->draw); ++#endif /* XFT */ + gr_stylespec_unalloc(&brush->current_attr); + grbrush_deinit(&(brush->grbrush)); + } +@@ -138,6 +145,21 @@ + } + + ++#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 ++ + /*}}}*/ + + +diff -Naur ../work/ion-3/de/brush.h ion-3ds-20070203/de/brush.h +--- ../work/ion-3/de/brush.h 2007-02-03 17:50:52.000000000 +0300 ++++ ion-3ds-20070203/de/brush.h 2007-02-21 13:11:57.000000000 +0300 +@@ -17,6 +17,9 @@ + #include <ioncore/common.h> + #include <ioncore/gr.h> + #include <ioncore/rectangle.h> ++#ifdef XFT ++#include <X11/Xft/Xft.h> ++#endif /* XFT */ + + INTRCLASS(DEBrush); + +@@ -36,6 +39,9 @@ + DECLCLASS(DEBrush){ + GrBrush grbrush; + DEStyle *d; ++#ifdef XFT ++ XftDraw *draw; ++#endif + DEBrushExtrasFn *extras_fn; + int indicator_w; + Window win; +@@ -111,5 +117,8 @@ + extern void debrush_fill_area(DEBrush *brush, const WRectangle *geom); + extern void debrush_clear_area(DEBrush *brush, const WRectangle *geom); + ++#ifdef XFT ++XftDraw *debrush_get_draw(DEBrush *brush, Drawable d); ++#endif + + #endif /* ION_DE_BRUSH_H */ +diff -Naur ../work/ion-3/de/colour.c ion-3ds-20070203/de/colour.c +--- ../work/ion-3/de/colour.c 2007-02-03 17:50:52.000000000 +0300 ++++ ion-3ds-20070203/de/colour.c 2007-02-21 13:11:57.000000000 +0300 +@@ -15,9 +15,21 @@ + + bool de_alloc_colour(WRootWin *rootwin, DEColour *ret, const char *name) + { ++#ifndef XFT + XColor c; + bool ok=FALSE; ++#else /* XFT */ ++ if(name==NULL) ++ return FALSE; ++ return XftColorAllocName( ++ ioncore_g.dpy, ++ XftDEDefaultVisual(), ++ rootwin->default_cmap, ++ name, ++ ret); ++#endif /* XFT */ + ++#ifndef XFT + if(name==NULL) + return FALSE; + +@@ -28,11 +40,13 @@ + } + + return ok; ++#endif /* ! XFT */ + } + + + bool de_duplicate_colour(WRootWin *rootwin, DEColour in, DEColour *out) + { ++#ifndef XFT + XColor c; + c.pixel=in; + XQueryColor(ioncore_g.dpy, rootwin->default_cmap, &c); +@@ -41,11 +55,20 @@ + return TRUE; + } + return FALSE; ++#else /* XFT */ ++ return XftColorAllocName( ++ ioncore_g.dpy, ++ XftDEDefaultVisual(), ++ rootwin->default_cmap, ++ &(in.color), ++ out); ++#endif /* XFT */ + } + + + void de_free_colour_group(WRootWin *rootwin, DEColourGroup *cg) + { ++#ifndef XFT + DEColour pixels[5]; + + pixels[0]=cg->bg; +@@ -57,15 +80,26 @@ + XFreeColors(ioncore_g.dpy, rootwin->default_cmap, pixels, 5, 0); + + gr_stylespec_unalloc(&cg->spec); ++#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 */ + } + + + void de_free_colour(WRootWin *rootwin, DEColour col) + { ++#ifndef XFT + DEColour pixels[1]; + + pixels[0]=col; + + XFreeColors(ioncore_g.dpy, rootwin->default_cmap, pixels, 1, 0); ++#else /* XFT */ ++ XftColorFree(ioncore_g.dpy, XftDEDefaultVisual(), rootwin->default_cmap, &col); ++#endif /* XFT */ + } + +diff -Naur ../work/ion-3/de/colour.h ion-3ds-20070203/de/colour.h +--- ../work/ion-3/de/colour.h 2007-02-03 17:50:52.000000000 +0300 ++++ ion-3ds-20070203/de/colour.h 2007-02-21 13:11:57.000000000 +0300 +@@ -15,12 +15,19 @@ + #include <ioncore/common.h> + #include <ioncore/global.h> + #include <ioncore/rootwin.h> ++#ifdef XFT ++#include <X11/Xft/Xft.h> ++#endif /* XFT */ + + + INTRSTRUCT(DEColourGroup); + + ++#ifndef XFT + typedef unsigned long DEColour; ++#else /* XFT */ ++typedef XftColor DEColour; ++#endif /* XFT */ + + + DECLSTRUCT(DEColourGroup){ +@@ -37,5 +44,6 @@ + bool de_duplicate_colour(WRootWin *rootwin, DEColour in, DEColour *out); + void de_free_colour_group(WRootWin *rootwin, DEColourGroup *cg); + void de_free_colour(WRootWin *rootwin, DEColour col); ++#define XftDEDefaultVisual() DefaultVisual(ioncore_g.dpy, 0) + + #endif /* ION_DE_COLOUR_H */ +diff -Naur ../work/ion-3/de/draw.c ion-3ds-20070203/de/draw.c +--- ../work/ion-3/de/draw.c 2007-02-03 17:50:52.000000000 +0300 ++++ ion-3ds-20070203/de/draw.c 2007-02-21 13:11:57.000000000 +0300 +@@ -22,6 +22,14 @@ + #include <X11/extensions/shape.h> + + ++#ifndef XFT ++#define PIXEL(x) x ++#else /* XFT */ ++#define PIXEL(x) x.pixel ++#endif /* XFT */ ++ ++ ++ + /*{{{ Colour group lookup */ + + +@@ -86,8 +94,7 @@ + w--; + h--; + +- XSetForeground(ioncore_g.dpy, gc, tlc); +- ++ XSetForeground(ioncore_g.dpy, gc, PIXEL(tlc)); + + a=(br!=0); + b=0; +@@ -104,9 +111,8 @@ + + XDrawLines(ioncore_g.dpy, win, gc, points, 3, CoordModeOrigin); + } +- + +- XSetForeground(ioncore_g.dpy, gc, brc); ++ XSetForeground(ioncore_g.dpy, gc, PIXEL(brc)); + + a=(tl!=0); + b=0; +@@ -143,23 +143,23 @@ + GrBorderLine line) + { + if(line==GR_BORDERLINE_LEFT && geom->h>0 && tl>0){ +- XSetForeground(ioncore_g.dpy, gc, tlc); +- XSetBackground(ioncore_g.dpy, gc, tlc); ++ XSetForeground(ioncore_g.dpy, gc, PIXEL(tlc)); ++ XSetBackground(ioncore_g.dpy, gc, PIXEL(tlc)); + XFillRectangle(ioncore_g.dpy, win, gc, geom->x, geom->y, tl, geom->h); + geom->x+=tl; + }else if(line==GR_BORDERLINE_TOP && geom->w>0 && tl>0){ +- XSetForeground(ioncore_g.dpy, gc, tlc); +- XSetBackground(ioncore_g.dpy, gc, tlc); ++ XSetForeground(ioncore_g.dpy, gc, PIXEL(tlc)); ++ XSetBackground(ioncore_g.dpy, gc, PIXEL(tlc)); + XFillRectangle(ioncore_g.dpy, win, gc, geom->x, geom->y, geom->w, tl); + geom->y+=tl; + }else if(line==GR_BORDERLINE_RIGHT && geom->h>0 && br>0){ +- XSetForeground(ioncore_g.dpy, gc, brc); +- XSetBackground(ioncore_g.dpy, gc, brc); ++ XSetForeground(ioncore_g.dpy, gc, PIXEL(brc)); ++ XSetBackground(ioncore_g.dpy, gc, PIXEL(brc)); + XFillRectangle(ioncore_g.dpy, win, gc, geom->x+geom->w-br, geom->y, br, geom->h); + geom->w-=br; + }else if(line==GR_BORDERLINE_BOTTOM && geom->w>0 && br>0){ +- XSetForeground(ioncore_g.dpy, gc, brc); +- XSetBackground(ioncore_g.dpy, gc, brc); ++ XSetForeground(ioncore_g.dpy, gc, PIXEL(brc)); ++ XSetBackground(ioncore_g.dpy, gc, PIXEL(brc)); + XFillRectangle(ioncore_g.dpy, win, gc, geom->x, geom->y+geom->h-br, geom->w, br); + geom->h-=br; + } +@@ -293,7 +299,7 @@ + } + + if(ISSET(a2, GR_ATTR(tagged)) || ISSET(a1, GR_ATTR(tagged))){ +- XSetForeground(ioncore_g.dpy, d->copy_gc, cg->fg); ++ XSetForeground(ioncore_g.dpy, d->copy_gc, PIXEL(cg->fg)); + + copy_masked(brush, d->tag_pixmap, brush->win, 0, 0, + d->tag_pixmap_w, d->tag_pixmap_h, +@@ -348,7 +354,7 @@ + GC gc=brush->d->normal_gc; + + if(TRUE/*needfill*/){ +- XSetForeground(ioncore_g.dpy, gc, cg->bg); ++ XSetForeground(ioncore_g.dpy, gc, PIXEL(cg->bg)); + XFillRectangle(ioncore_g.dpy, brush->win, gc, geom->x, geom->y, + geom->w, geom->h); + } +@@ -513,7 +519,7 @@ + attr.background_pixmap=ParentRelative; + }else{ + attrflags=CWBackPixel; +- attr.background_pixel=brush->d->cgrp.bg; ++ attr.background_pixel=brush->d->PIXEL(cgrp.bg); + } + + XChangeWindowAttributes(ioncore_g.dpy, brush->win, attrflags, &attr); +@@ -529,7 +535,7 @@ + if(cg==NULL) + return; + +- XSetForeground(ioncore_g.dpy, gc, cg->bg); ++ XSetForeground(ioncore_g.dpy, gc, PIXEL(cg->bg)); + XFillRectangle(ioncore_g.dpy, brush->win, gc, + geom->x, geom->y, geom->w, geom->h); + } +diff -Naur ../work/ion-3/de/font.c ion-3ds-20070203/de/font.c +--- ../work/ion-3/de/font.c 2007-02-03 17:50:52.000000000 +0300 ++++ ion-3ds-20070203/de/font.c 2007-02-21 13:11:57.000000000 +0300 +@@ -14,7 +14,9 @@ + #include <libtu/objp.h> + #include <ioncore/common.h> + #include "font.h" ++#ifndef XFT + #include "fontset.h" ++#endif /* ! XFT */ + #include "brush.h" + + +@@ -26,6 +28,9 @@ + + DEFont *de_load_font(const char *fontname) + { ++#ifdef XFT ++ XftFont *font; ++#endif + DEFont *fnt; + XFontSet fontset=NULL; + XFontStruct *fontstruct=NULL; +@@ -40,6 +45,7 @@ + } + } + ++#ifndef XFT + if(ioncore_g.use_mb){ + fontset=de_create_font_set(fontname); + if(fontset!=NULL){ +@@ -66,13 +72,34 @@ + return NULL; + } + ++#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 */ + fnt=ALLOC(DEFont); + + if(fnt==NULL) + return NULL; + ++#ifndef XFT + fnt->fontset=fontset; + fnt->fontstruct=fontstruct; ++#else ++ fnt->font=font; ++#endif + fnt->pattern=scopy(fontname); + fnt->next=NULL; + fnt->prev=NULL; +@@ -92,11 +119,13 @@ + style->font=font; + font->refcount++; + ++#ifndef XFT + if(style->font->fontstruct!=NULL){ + XSetFont(ioncore_g.dpy, style->normal_gc, + style->font->fontstruct->fid); + } + ++#endif /* ! XFT */ + return TRUE; + } + +@@ -111,11 +140,13 @@ + if(style->font==NULL) + return FALSE; + ++#ifndef XFT + if(style->font->fontstruct!=NULL){ + XSetFont(ioncore_g.dpy, style->normal_gc, + style->font->fontstruct->fid); + } + ++#endif /* ! XFT */ + return TRUE; + } + +@@ -125,10 +156,15 @@ + if(--font->refcount!=0) + return; + ++#ifndef XFT + if(font->fontset!=NULL) + XFreeFontSet(ioncore_g.dpy, font->fontset); + if(font->fontstruct!=NULL) + XFreeFont(ioncore_g.dpy, font->fontstruct); ++#else /* XFT */ ++ if(font->font!=NULL) ++ XftFontClose(ioncore_g.dpy, font->font); ++#endif /* XFT */ + if(font->pattern!=NULL) + free(font->pattern); + +@@ -156,6 +192,7 @@ + + void defont_get_font_extents(DEFont *font, GrFontExtents *fnte) + { ++#ifndef XFT + if(font->fontset!=NULL){ + XFontSetExtents *ext=XExtentsOfFontSet(font->fontset); + if(ext==NULL) +@@ -171,7 +208,14 @@ + fnte->baseline=fnt->ascent; + return; + } +- ++#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 */ + fail: + DE_RESET_FONT_EXTENTS(fnte); + } +@@ -188,20 +232,35 @@ + + uint defont_get_text_width(DEFont *font, const char *text, uint len) + { ++#ifndef XFT + if(font->fontset!=NULL){ + XRectangle lext; + #ifdef CF_DE_USE_XUTF8 +- 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 + #endif +- XmbTextExtents(font->fontset, text, len, NULL, &lext); +- return lext.width; ++ XmbTextExtents(font->fontset, text, len, NULL, &lext); ++ return lext.width; + }else if(font->fontstruct!=NULL){ + return XTextWidth(font->fontstruct, text, len); + }else{ + return 0; + } ++#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 */ + } + + +@@ -211,6 +270,7 @@ + /*{{{ String drawing */ + + ++#ifndef XFT + void debrush_do_draw_string_default(DEBrush *brush, int x, int y, + const char *str, int len, bool needfill, + DEColourGroup *colours) +@@ -256,6 +316,41 @@ + } + } + ++#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(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); ++ } ++ ++ 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 */ + + void debrush_do_draw_string(DEBrush *brush, int x, int y, + const char *str, int len, bool needfill, +diff -Naur ../work/ion-3/de/font.h ion-3ds-20070203/de/font.h +--- ../work/ion-3/de/font.h 2007-02-03 17:50:52.000000000 +0300 ++++ ion-3ds-20070203/de/font.h 2007-02-21 13:11:57.000000000 +0300 +@@ -14,6 +14,9 @@ + + #include <ioncore/common.h> + #include <ioncore/gr.h> ++#ifdef XFT ++#include <X11/Xft/Xft.h> ++#endif /* XFT */ + + INTRSTRUCT(DEFont); + +@@ -29,6 +32,9 @@ + int refcount; + XFontSet fontset; + XFontStruct *fontstruct; ++#ifdef XFT /* XFT */ ++ XftFont *font; ++#endif /* XFT */ + DEFont *next, *prev; + }; + +diff -Naur ../work/ion-3/de/init.c ion-3ds-20070203/de/init.c +--- ../work/ion-3/de/init.c 2007-02-03 17:50:52.000000000 +0300 ++++ ion-3ds-20070203/de/init.c 2007-02-21 13:11:57.000000000 +0300 +@@ -165,17 +165,26 @@ + { + bool bgset; + DEColour padinh; +- ++ 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, "highlight_colour", +- (based_on ? based_on->cgrp.hl : DE_WHITE(rootwin))); ++ (based_on ? based_on->cgrp.hl : white)); + de_get_colour(rootwin, &(cg->sh), tab, "shadow_colour", +- (based_on ? based_on->cgrp.sh : DE_WHITE(rootwin))); ++ (based_on ? based_on->cgrp.sh : white)); + de_get_colour(rootwin, &(cg->fg), tab, "foreground_colour", +- (based_on ? based_on->cgrp.fg : DE_WHITE(rootwin))); ++ (based_on ? based_on->cgrp.fg : white)); + bgset=de_get_colour(rootwin, &(cg->bg), tab, "background_colour", +- (based_on ? based_on->cgrp.bg : DE_BLACK(rootwin))); ++ (based_on ? based_on->cgrp.bg : black)); + +- padinh=(based_on ? based_on->cgrp.pad : DE_WHITE(rootwin)); ++ padinh=(based_on ? based_on->cgrp.pad : white); + + de_get_colour_(rootwin, &(cg->pad), tab, "padding_colour", + (bgset ? cg->bg : padinh), padinh); +diff -Naur ../work/ion-3/de/style.c ion-3ds-20070203/de/style.c +--- ../work/ion-3/de/style.c 2007-02-03 17:50:52.000000000 +0300 ++++ ion-3ds-20070203/de/style.c 2007-02-21 13:11:57.000000000 +0300 +@@ -74,10 +74,17 @@ + /*gcv.function=GXclear;*/ + gcv.stipple=stipple_pixmap; + gcvmask=GCFillStyle|GCStipple/*|GCFunction*/; ++#ifndef XFT + if(style->font!=NULL && style->font->fontstruct!=NULL){ + gcv.font=style->font->fontstruct->fid; + gcvmask|=GCFont; + } ++#else /* XFT */ ++// if(style->font!=NULL){ ++// gcv.font=style->font; ++// gcvmask|=GCFont; ++// } ++#endif /* XFT */ + + style->stipple_gc=XCreateGC(dpy, root, gcvmask, &gcv); + XCopyGC(dpy, style->normal_gc, +@@ -205,6 +212,14 @@ + + bool destyle_init(DEStyle *style, WRootWin *rootwin, const char *name) + { ++ 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 */ + if(!gr_stylespec_load(&style->spec, name)) + return FALSE; + +@@ -226,11 +241,11 @@ + style->textalign=DEALIGN_CENTER; + + style->cgrp_alloced=FALSE; +- 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; + gr_stylespec_init(&style->cgrp.spec); + + style->font=NULL; +diff -Naur ../work/ion-3/de/style.h ion-3ds-20070203/de/style.h +--- ../work/ion-3/de/style.h 2007-02-03 17:50:52.000000000 +0300 ++++ ion-3ds-20070203/de/style.h 2007-02-21 13:11:57.000000000 +0300 +@@ -76,6 +76,7 @@ + Pixmap tag_pixmap; + int tag_pixmap_w; + int tag_pixmap_h; ++ int xft_style; + + DEStyle *next, *prev; + }; +--- ../work/ion-3/system.mk 2007-05-10 22:45:16.000000000 +0400 ++++ ion-3ds-20070203/system.mk 2007-05-10 22:45:07.000000000 +0400 +@@ -115,6 +115,16 @@ + #EXTRA_LIBS += -lintl + #EXTRA_INCLUDES += + ++## ++## Xft support ++## ++ ++#USE_XFT=1 ++ ++ifeq ($(USE_XFT),1) ++EXTRA_INCLUDES += `xft-config --cflags` -DXFT ++EXTRA_LIBS += `xft-config --libs` ++endif + + ## + ## C compiler |