···
+
diff -ur notion-3-2015061300/de/brush.c notion-3-2015061300-PATCHED/de/brush.c
+
--- notion-3-2015061300/de/brush.c 2015-06-13 10:37:26.000000000 -0400
+
+++ notion-3-2015061300-PATCHED/de/brush.c 2015-07-13 10:37:23.093298917 -0400
+
gr_stylespec_init(&brush->current_attr);
+
if(!grbrush_init(&(brush->grbrush))){
+
destyle_unref(brush->d);
+
+ if(brush->draw!=NULL)
+
+ XftDrawDestroy(brush->draw);
+
gr_stylespec_unalloc(&brush->current_attr);
+
grbrush_deinit(&(brush->grbrush));
+
+XftDraw *debrush_get_draw(DEBrush *brush, Drawable d)
+
+ if(brush->draw==NULL)
+
+ brush->draw=XftDrawCreate(ioncore_g.dpy, d,
+
+ XftDEDefaultVisual(),
+
+ DefaultColormap(ioncore_g.dpy,
+
+ XftDrawChange(brush->draw, d);
+
diff -ur notion-3-2015061300/de/brush.h notion-3-2015061300-PATCHED/de/brush.h
+
--- notion-3-2015061300/de/brush.h 2015-06-13 10:37:26.000000000 -0400
+
+++ notion-3-2015061300-PATCHED/de/brush.h 2015-07-13 10:37:23.096298747 -0400
+
#include <ioncore/gr.h>
+
#include <ioncore/rectangle.h>
+
+#include <X11/Xft/Xft.h>
+
DEBrushExtrasFn *extras_fn;
+
extern void debrush_fill_area(DEBrush *brush, const WRectangle *geom);
+
extern void debrush_clear_area(DEBrush *brush, const WRectangle *geom);
+
+XftDraw *debrush_get_draw(DEBrush *brush, Drawable d);
+
#endif /* ION_DE_BRUSH_H */
+
diff -ur notion-3-2015061300/de/colour.c notion-3-2015061300-PATCHED/de/colour.c
+
--- notion-3-2015061300/de/colour.c 2015-06-13 10:37:26.000000000 -0400
+
+++ notion-3-2015061300-PATCHED/de/colour.c 2015-07-13 10:37:23.098298633 -0400
+
bool de_alloc_colour(WRootWin *rootwin, DEColour *ret, const char *name)
+
+ return XftColorAllocName(
+
+ XftDEDefaultVisual(),
+
+ rootwin->default_cmap,
+
bool de_duplicate_colour(WRootWin *rootwin, DEColour in, DEColour *out)
+
XQueryColor(ioncore_g.dpy, rootwin->default_cmap, &c);
+
+ return XftColorAllocName(
+
+ XftDEDefaultVisual(),
+
+ rootwin->default_cmap,
+
void de_free_colour_group(WRootWin *rootwin, DEColourGroup *cg)
+
XFreeColors(ioncore_g.dpy, rootwin->default_cmap, pixels, 5, 0);
+
gr_stylespec_unalloc(&cg->spec);
+
+ 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);
+
void de_free_colour(WRootWin *rootwin, DEColour col)
+
XFreeColors(ioncore_g.dpy, rootwin->default_cmap, pixels, 1, 0);
+
+ XftColorFree(ioncore_g.dpy, XftDEDefaultVisual(), rootwin->default_cmap, &col);
+
diff -ur notion-3-2015061300/de/colour.h notion-3-2015061300-PATCHED/de/colour.h
+
--- notion-3-2015061300/de/colour.h 2015-06-13 10:37:26.000000000 -0400
+
+++ notion-3-2015061300-PATCHED/de/colour.h 2015-07-13 10:37:23.099298576 -0400
+
#include <ioncore/common.h>
+
#include <ioncore/global.h>
+
#include <ioncore/rootwin.h>
+
+#include <X11/Xft/Xft.h>
+
INTRSTRUCT(DEColourGroup);
+
typedef unsigned long DEColour;
+
+typedef XftColor DEColour;
+
DECLSTRUCT(DEColourGroup){
+
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 -ur notion-3-2015061300/de/draw.c notion-3-2015061300-PATCHED/de/draw.c
+
--- notion-3-2015061300/de/draw.c 2015-06-13 10:37:26.000000000 -0400
+
+++ notion-3-2015061300-PATCHED/de/draw.c 2015-07-13 10:37:23.109298008 -0400
+
#include <X11/extensions/shape.h>
+
+#define PIXEL(x) x.pixel
+
/*{{{ Colour group lookup */
+
- XSetForeground(ioncore_g.dpy, gc, tlc);
+
+ XSetForeground(ioncore_g.dpy, gc, PIXEL(tlc));
+
- XSetForeground(ioncore_g.dpy, gc, brc);
+
+ XSetForeground(ioncore_g.dpy, gc, PIXEL(brc));
+
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);
+
}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);
+
}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);
+
}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);
+
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,
+
GC gc=brush->d->normal_gc;
+
- 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,
+
attr.background_pixmap=ParentRelative;
+
- attr.background_pixel=brush->d->cgrp.bg;
+
+ attr.background_pixel=brush->d->PIXEL(cgrp.bg);
+
XChangeWindowAttributes(ioncore_g.dpy, brush->win, attrflags, &attr);
+
- 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 -ur notion-3-2015061300/de/font.c notion-3-2015061300-PATCHED/de/font.c
+
--- notion-3-2015061300/de/font.c 2015-06-13 10:37:26.000000000 -0400
+
+++ notion-3-2015061300-PATCHED/de/font.c 2015-07-13 10:37:23.118297497 -0400
+
#include <ioncore/common.h>
+
#include <ioncore/log.h>
+
#include "precompose.h"
+
DEFont *de_load_font(const char *fontname)
+
XFontStruct *fontstruct=NULL;
+
if(ioncore_g.use_mb && !(ioncore_g.enc_utf8 && iso10646_font(fontname))){
+
LOG(DEBUG, FONT, "Loading fontset %s", fontname);
+
fontset=de_create_font_set(fontname);
+
+ if(strncmp(fontname, "xft:", 4)==0){
+
+ font=XftFontOpenName(ioncore_g.dpy, DefaultScreen(ioncore_g.dpy),
+
+ font=XftFontOpenXlfd(ioncore_g.dpy, DefaultScreen(ioncore_g.dpy), fontname);
+
+ 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);
+
fnt->fontstruct=fontstruct;
+
fnt->pattern=scopy(fontname);
+
if(style->font->fontstruct!=NULL){
+
XSetFont(ioncore_g.dpy, style->normal_gc,
+
style->font->fontstruct->fid);
+
if(style->font->fontstruct!=NULL){
+
XSetFont(ioncore_g.dpy, style->normal_gc,
+
style->font->fontstruct->fid);
+
if(--font->refcount!=0)
+
if(font->fontset!=NULL)
+
XFreeFontSet(ioncore_g.dpy, font->fontset);
+
if(font->fontstruct!=NULL)
+
XFreeFont(ioncore_g.dpy, font->fontstruct);
+
+ XftFontClose(ioncore_g.dpy, font->font);
+
if(font->pattern!=NULL)
+
void defont_get_font_extents(DEFont *font, GrFontExtents *fnte)
+
if(font->fontset!=NULL){
+
XFontSetExtents *ext=XExtentsOfFontSet(font->fontset);
+
fnte->baseline=fnt->ascent;
+
+ 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;
+
DE_RESET_FONT_EXTENTS(fnte);
+
uint defont_get_text_width(DEFont *font, const char *text, uint len)
+
if(font->fontset!=NULL){
+
+ if(font->font!=NULL){
+
+ if(ioncore_g.enc_utf8)
+
+ XftTextExtentsUtf8(ioncore_g.dpy, font->font, (XftChar8 *)text, len, &extents);
+
+ XftTextExtents8(ioncore_g.dpy, font->font, (XftChar8 *)text, len, &extents);
+
/*{{{ String drawing */
+
void debrush_do_draw_string_default(DEBrush *brush, int x, int y,
+
const char *str, int len, bool needfill,
+
DEColourGroup *colours)
+
+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;
+
+ if(brush->d->font==NULL)
+
+ font=brush->d->font->font;
+
+ draw=debrush_get_draw(brush, win);
+
+ if(ioncore_g.enc_utf8){
+
+ XftTextExtentsUtf8(ioncore_g.dpy, font, (XftChar8 *)str, len,
+
+ 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,
+
+ XftDrawString8(draw, &(colours->fg), font, x, y, (XftChar8 *)str, len);
+
void debrush_do_draw_string(DEBrush *brush, int x, int y,
+
const char *str, int len, bool needfill,
+
diff -ur notion-3-2015061300/de/font.h notion-3-2015061300-PATCHED/de/font.h
+
--- notion-3-2015061300/de/font.h 2015-06-13 10:37:26.000000000 -0400
+
+++ notion-3-2015061300-PATCHED/de/font.h 2015-07-13 10:37:23.119297440 -0400
+
#include <ioncore/common.h>
+
#include <ioncore/gr.h>
+
+#include <X11/Xft/Xft.h>
+
XFontStruct *fontstruct;
+
diff -ur notion-3-2015061300/de/init.c notion-3-2015061300-PATCHED/de/init.c
+
--- notion-3-2015061300/de/init.c 2015-06-13 10:37:26.000000000 -0400
+
+++ notion-3-2015061300-PATCHED/de/init.c 2015-07-13 10:37:23.122297270 -0400
+
+ DEColour black, white;
+
+ de_alloc_colour(rootwin, &black, "black");
+
+ de_alloc_colour(rootwin, &white, "white");
+
+ black=DE_BLACK(rootwin);
+
+ white=DE_WHITE(rootwin);
+
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 -ur notion-3-2015061300/de/style.c notion-3-2015061300-PATCHED/de/style.c
+
--- notion-3-2015061300/de/style.c 2015-06-13 10:37:26.000000000 -0400
+
+++ notion-3-2015061300-PATCHED/de/style.c 2015-07-13 10:37:23.128296929 -0400
+
/*gcv.function=GXclear;*/
+
gcv.stipple=stipple_pixmap;
+
gcvmask=GCFillStyle|GCStipple/*|GCFunction*/;
+
if(style->font!=NULL && style->font->fontstruct!=NULL){
+
gcv.font=style->font->fontstruct->fid;
+
+// if(style->font!=NULL){
+
+// gcv.font=style->font;
+
style->stipple_gc=XCreateGC(dpy, root, gcvmask, &gcv);
+
XCopyGC(dpy, style->normal_gc,
+
bool destyle_init(DEStyle *style, WRootWin *rootwin, const char *name)
+
+ DEColour black, white;
+
+ de_alloc_colour(rootwin, &black, "black");
+
+ de_alloc_colour(rootwin, &white, "white");
+
+ black=DE_BLACK(rootwin);
+
+ white=DE_WHITE(rootwin);
+
if(!gr_stylespec_load(&style->spec, name))
+
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);
+
diff -ur notion-3-2015061300/de/style.h notion-3-2015061300-PATCHED/de/style.h
+
--- notion-3-2015061300/de/style.h 2015-06-13 10:37:26.000000000 -0400
+
+++ notion-3-2015061300-PATCHED/de/style.h 2015-07-13 10:37:23.130296815 -0400
+
diff -ur notion-3-2015061300/system-autodetect.mk notion-3-2015061300-PATCHED/system-autodetect.mk
+
--- notion-3-2015061300/system-autodetect.mk 2015-06-13 10:37:26.000000000 -0400
+
+++ notion-3-2015061300-PATCHED/system-autodetect.mk 2015-07-13 10:38:14.921332013 -0400
+
+EXTRA_INCLUDES += `pkg-config xft --cflags`
+
+EXTRA_LIBS += `pkg-config xft --libs`
+
+DEFINES += -DXFT -DCF_FALLBACK_FONT_NAME=\"Sans\"