Update to 20050823.
It seems that the cairo backend is no longer supported. Changes: * Simplification of the configuration subsystem (wmirc, et cetera). * 9rc is now needed to run wmii. https://lists.berlios.de/pipermail/wmi-devel/2005-August/002990.html
This commit is contained in:
parent
af72b0f76e
commit
33893db130
8 changed files with 48 additions and 312 deletions
|
@ -1,7 +1,6 @@
|
|||
window manager improved 2 (wmii) is an improved, modularized and lightweight
|
||||
X11 window manager which supports tabbed, tiled and conventional window
|
||||
management through layouts. If build with cairo support, it also provides
|
||||
anti-aliased font rendering.
|
||||
management through layouts.
|
||||
|
||||
wmii consists of components that are independent processes and communicate
|
||||
via a socket-based virtual filesystem which is oriented on the "everything is a
|
||||
|
@ -11,5 +10,3 @@ The core distribution of wmii contains the window manager itself, a master file
|
|||
system routing utility (wmifs), a generic bar (wmibar), a shortcut handler
|
||||
(wmikeys), and a generic interaction menu (wmimenu) beside several tiny
|
||||
utilities like wmir, wmiplumb, and wmiwarp.
|
||||
|
||||
This package is built with xlib support only.
|
||||
|
|
|
@ -1,29 +1,24 @@
|
|||
# $NetBSD: Makefile.common,v 1.82 2005/07/31 10:03:28 leonardschmidt Exp $
|
||||
# $NetBSD: Makefile.common,v 1.83 2005/08/27 10:00:18 leonardschmidt Exp $
|
||||
#
|
||||
|
||||
DISTNAME= wmii-2
|
||||
DISTNAME= wmii-20050823
|
||||
CATEGORIES= wm x11
|
||||
MASTER_SITES= http://wmi.modprobe.de/download/
|
||||
MASTER_SITES= http://wmi.modprobe.de/snaps/
|
||||
EXTRACT_SUFX= .tar.bz2
|
||||
|
||||
MAINTAINER= lems@gmx.net
|
||||
HOMEPAGE= http://wmi.modprobe.de/
|
||||
COMMENT= Modular and keyboard-friendly window manager
|
||||
|
||||
DISTINFO_FILE= ${.CURDIR}/../../wip/wmii/distinfo
|
||||
PATCHDIR= ${.CURDIR}/../../wip/wmii/patches
|
||||
PLIST_SRC= ${.CURDIR}/../../wip/wmii/PLIST
|
||||
DEPENDS+= 9rc-[0-9]*:../../wip/9rc
|
||||
|
||||
USE_PKGINSTALL= yes
|
||||
NO_CONFIGURE= yes
|
||||
|
||||
MAKE_ENV+= DRAW=xlib
|
||||
|
||||
SUBST_CLASSES+= paths
|
||||
SUBST_STAGE.paths= post-patch
|
||||
SUBST_FILES.paths= base/wmii rc/rc
|
||||
SUBST_FILES.paths= rc/wmii
|
||||
SUBST_SED.paths+= -e 's,SHAREPREFIX,${PREFIX}/share,'
|
||||
SUBST_SED.paths+= -e 's,CONFPREFIX,${PREFIX}/share/examples,'
|
||||
|
||||
.include "../../mk/bsd.prefs.mk"
|
||||
|
||||
|
@ -35,21 +30,15 @@ MAKE_DIRS+= ${PKG_SYSCONFDIR}/action
|
|||
|
||||
PKG_SYSCONFSUBDIR= wmii
|
||||
EGDIR= ${PREFIX}/share/examples/wmii
|
||||
EGFILES= bar keys menu rc rc.conf status.sh wm
|
||||
.for f in ${EGFILES}
|
||||
CONF_FILES= ${EGDIR}/${f} ${PKG_SYSCONFDIR}/${f}
|
||||
.endfor
|
||||
.undef f
|
||||
|
||||
ACFILES= actions attach border clientupdate \
|
||||
EGFILES= actions attach border clientupdate \
|
||||
close cnext cprev detach fnext fprev \
|
||||
fresize ftoggle icons kbare kmove \
|
||||
fresize ftoggle icons kbare kmove \
|
||||
knorm kresize lfloat lgrid lmax lock \
|
||||
ltiled lvsplit max mouse p pager \
|
||||
pageupdate plumbgoogle plumburl pnew \
|
||||
pprev premove presize programs ptoggle \
|
||||
quit scr tab term www zoom
|
||||
.for f in ${ACFILES}
|
||||
ltiled lvsplit max p pager pageupdate \
|
||||
plumbgoogle plumburl pnew pnext pprev \
|
||||
premove presize programs ptoggle quit \
|
||||
scr tab term wmirc wmire www zoom
|
||||
.for f in ${EGFILES}
|
||||
CONF_FILES+= ${EGDIR}/action/${f} ${PKG_SYSCONFDIR}/action/${f}
|
||||
.endfor
|
||||
.undef f
|
||||
|
|
14
wmii/PLIST
14
wmii/PLIST
|
@ -1,4 +1,4 @@
|
|||
@comment $NetBSD: PLIST,v 1.4 2005/07/16 20:04:39 leonardschmidt Exp $
|
||||
@comment $NetBSD: PLIST,v 1.5 2005/08/27 10:00:18 leonardschmidt Exp $
|
||||
bin/wmibar
|
||||
bin/wmifs
|
||||
bin/wmii
|
||||
|
@ -7,7 +7,6 @@ bin/wmikeys
|
|||
bin/wmimenu
|
||||
bin/wmiplumb
|
||||
bin/wmir
|
||||
bin/wmira
|
||||
bin/wmirefcard
|
||||
bin/wmiwarp
|
||||
man/man1/wmibar.1
|
||||
|
@ -41,7 +40,6 @@ share/examples/wmii/action/lock
|
|||
share/examples/wmii/action/ltiled
|
||||
share/examples/wmii/action/lvsplit
|
||||
share/examples/wmii/action/max
|
||||
share/examples/wmii/action/mouse
|
||||
share/examples/wmii/action/p
|
||||
share/examples/wmii/action/pager
|
||||
share/examples/wmii/action/pageupdate
|
||||
|
@ -58,15 +56,11 @@ share/examples/wmii/action/quit
|
|||
share/examples/wmii/action/scr
|
||||
share/examples/wmii/action/tab
|
||||
share/examples/wmii/action/term
|
||||
share/examples/wmii/action/wmirc
|
||||
share/examples/wmii/action/wmire
|
||||
share/examples/wmii/action/www
|
||||
share/examples/wmii/action/zoom
|
||||
share/examples/wmii/bar
|
||||
share/examples/wmii/keys
|
||||
share/examples/wmii/menu
|
||||
share/examples/wmii/rc
|
||||
share/examples/wmii/rc.conf
|
||||
share/examples/wmii/status.sh
|
||||
share/examples/wmii/wm
|
||||
share/examples/wmii/status
|
||||
share/wmii/welcome.txt
|
||||
@dirrm share/wmii
|
||||
@dirrm share/examples/wmii/action
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
- I have to substitute CONFPREFIX with ${PREFIX}/share/examples instead
|
||||
of ${PKG_SYSCONFDIR} since status.sh loses its permissions (755) when
|
||||
getting copied over to ${PREFIX}/etc/wmii.
|
||||
Do not know if that is a big problem, though.
|
|
@ -1,8 +1,7 @@
|
|||
$NetBSD: distinfo,v 1.11 2005/08/12 00:08:04 leonardschmidt Exp $
|
||||
$NetBSD: distinfo,v 1.12 2005/08/27 10:00:18 leonardschmidt Exp $
|
||||
|
||||
SHA1 (wmii-2.tar.bz2) = 76c2bbe0970f57fa160f13c2ae37a009e84bf5b7
|
||||
RMD160 (wmii-2.tar.bz2) = 80aaca41643e9632dc63341b63f80a6c1c92e6d8
|
||||
Size (wmii-2.tar.bz2) = 67004 bytes
|
||||
SHA1 (patch-aa) = de9c6e9286f86780aa41011ea34355a530f41a34
|
||||
SHA1 (patch-ab) = 36f20c6f7264f81aa4d45f312c35b15c9de4cce3
|
||||
SHA1 (patch-ac) = 252528513d79bd987907095b9282b676657cdee9
|
||||
SHA1 (wmii-20050823.tar.bz2) = ee6e92c0f1d78e9419ce1e41e2d776c349363558
|
||||
RMD160 (wmii-20050823.tar.bz2) = cb6aa783fafa54d972a67707a5a79955ee1a8951
|
||||
Size (wmii-20050823.tar.bz2) = 68645 bytes
|
||||
SHA1 (patch-aa) = cfec781e4c6c68b54b62f73c2c40e792a1cbc7f9
|
||||
SHA1 (patch-ab) = ea230e5f4ac4a75735867f5488857b04bbefed1c
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
$NetBSD: patch-aa,v 1.10 2005/07/31 10:03:28 leonardschmidt Exp $
|
||||
$NetBSD: patch-aa,v 1.11 2005/08/27 10:00:19 leonardschmidt Exp $
|
||||
|
||||
--- config.mk.orig 2005-07-30 22:14:00.000000000 +0000
|
||||
--- config.mk.orig 2005-08-23 21:36:08.000000000 +0000
|
||||
+++ config.mk
|
||||
@@ -1,24 +1,24 @@
|
||||
@@ -1,34 +1,34 @@
|
||||
# Customize to fit your system
|
||||
|
||||
# paths
|
||||
|
@ -13,43 +13,38 @@ $NetBSD: patch-aa,v 1.10 2005/07/31 10:03:28 leonardschmidt Exp $
|
|||
+CONFPREFIX = ${PREFIX}/share/examples
|
||||
+MANPREFIX = ${PREFIX}/man
|
||||
SHAREPREFIX = ${PREFIX}/share
|
||||
-9PREFIX = ${PREFIX}/9
|
||||
+9PREFIX = ${PREFIX}
|
||||
|
||||
INCDIR = ${PREFIX}/include
|
||||
LIBDIR = ${PREFIX}/lib
|
||||
-X11DIR = /usr/X11R6
|
||||
+X11DIR = ${X11BASE}
|
||||
-X11INC = /usr/X11R6/include
|
||||
-X11LIB = /usr/X11R6/lib
|
||||
+X11INC = ${X11BASE}/include
|
||||
+X11LIB = ${X11BASE}/lib
|
||||
|
||||
# includes and libs
|
||||
-INCLUDES = -I. -I${INCDIR} -I/usr/include -I${X11DIR}/include
|
||||
-LIBS = -L${LIBDIR} -L/usr/lib -lc -lm -L${X11DIR}/lib -lX11
|
||||
-DRAW = xlib
|
||||
+INCLUDES = -I. -I${INCDIR} -I${PREFIX}/include -I${X11DIR}/include
|
||||
+LIBS = -L${LIBDIR} -L${PREFIX}/lib -lc -lm -L${X11DIR}/lib -lX11
|
||||
+#DRAW = xlib
|
||||
-INCLUDES = -I. -I${INCDIR} -I/usr/include -I${X11INC}
|
||||
-LIBS = -L${LIBDIR} -L/usr/lib -lc -lm -L${X11LIB} -lX11
|
||||
+INCLUDES = -I. -I${INCDIR} -I${PREFIX}/include -I${X11INC}
|
||||
+LIBS = -L${LIBDIR} -L${PREFIX}/lib -lc -lm -L${X11LIB} -lX11
|
||||
RCPREFIX = rc
|
||||
|
||||
# cairo support
|
||||
#DRAW = cairo
|
||||
#CAIROFLAGS = -lcairo
|
||||
-#CAIROINC = -I/usr/include/cairo -I${INCDIR}/cairo
|
||||
+#CAIROINC = -I${PREFIX}/include/cairo -I${INCDIR}/cairo
|
||||
|
||||
# str{l,n}{cat,cpy} support, if you have OpenBSD you can use strl*
|
||||
STRLCPY = strncpy
|
||||
@@ -28,14 +28,14 @@ STRLFLAGS = -DSTRLCPY=${STRLCPY} -DSTR
|
||||
# compiler
|
||||
VERSION = 2
|
||||
#VERSION = 3-current
|
||||
VERSION = 20050823
|
||||
# Note: - under Solaris add -D__EXTENSIONS__ to CFLAGS
|
||||
-CFLAGS = -O0 -g -Wall -pedantic ${INCLUDES} ${STRLFLAGS} -DDRAW=\"${DRAW}\" -DVERSION=\"${VERSION}\"
|
||||
-CFLAGS = -O0 -g -Wall ${INCLUDES} -DVERSION=\"${VERSION}\"
|
||||
-LDFLAGS = -g ${LIBS}
|
||||
+CFLAGS += ${INCLUDES} ${STRLFLAGS} -DDRAW=\"${DRAW}\" -DVERSION=\"${VERSION}\"
|
||||
+CFLAGS += ${INCLUDES} -DVERSION=\"${VERSION}\"
|
||||
+LDFLAGS += ${LIBS}
|
||||
#CFLAGS = -Os ${INCLUDES} ${STRLFLAGS} -DDRAW=\"${DRAW}\" -DVERSION=\"${VERSION}\"
|
||||
#CFLAGS = -Os ${INCLUDES} -DVERSION=\"${VERSION}\"
|
||||
#LDFLAGS = ${LIBS}
|
||||
|
||||
# userland
|
||||
AR = ar cr
|
||||
-CC = cc
|
||||
+#CC = cc
|
||||
YACC = yacc
|
||||
CP = cp -f
|
||||
COMPRESS = bzip2
|
||||
INSTBIN = ${CP}
|
||||
|
|
|
@ -1,39 +1,10 @@
|
|||
$NetBSD: patch-ab,v 1.5 2005/07/16 20:04:40 leonardschmidt Exp $
|
||||
$NetBSD: patch-ab,v 1.6 2005/08/27 10:00:19 leonardschmidt Exp $
|
||||
|
||||
--- Makefile.orig 2005-07-15 10:27:07.000000000 +0000
|
||||
--- Makefile.orig 2005-08-23 21:36:08.000000000 +0000
|
||||
+++ Makefile
|
||||
@@ -13,12 +13,11 @@ DOC = doc/welcome.txt
|
||||
|
||||
BIN = base/wmiiwm util/wmibar util/wmimenu util/wmir \
|
||||
util/wmikeys util/wmifs util/wmiplumb util/wmiwarp \
|
||||
- util/wmira util/wmirefcard
|
||||
|
||||
DEST_BIN = wmii wmiiwm wmibar wmimenu wmir wmira wmifs wmikeys \
|
||||
wmiplumb wmiwarp wmirefcard
|
||||
|
||||
-RC = rc/bar rc/menu rc/keys rc/rc rc/rc.conf rc/status.sh rc/wm
|
||||
+RC = rc/bar rc/menu rc/keys rc/rc rc/rc.conf rc/wm
|
||||
|
||||
SHARE = doc/welcome.txt
|
||||
|
||||
@@ -82,35 +81,23 @@ clean:
|
||||
install_rc:
|
||||
@echo -------------------------------------------------------
|
||||
@echo Installing configuration files to ${DESTDIR}${CONFPREFIX}/wmii
|
||||
- @${MKDIR} -p ${DESTDIR}${CONFPREFIX}/wmii/action
|
||||
- @for i in ${RC}; do \
|
||||
- ${SED} 's|SHAREPREFIX|${SHAREPREFIX}|' <$$i >${DESTDIR}${CONFPREFIX}/wmii/`basename $$i`; \
|
||||
- done
|
||||
- @${CP} rc/action/* ${DESTDIR}${CONFPREFIX}/wmii/action
|
||||
- @${MODBIN} ${DESTDIR}${CONFPREFIX}/wmii/action/*
|
||||
- @${MODBIN} ${DESTDIR}${CONFPREFIX}/wmii/rc
|
||||
- @${MODBIN} ${DESTDIR}${CONFPREFIX}/wmii/status.sh
|
||||
-
|
||||
+ @${BSD_INSTALL_DATA_DIR} ${DESTDIR}${CONFPREFIX}/wmii/action
|
||||
+ @${BSD_INSTALL_SCRIPT} rc/status.sh ${RC} ${DESTDIR}${CONFPREFIX}/wmii
|
||||
+ @${BSD_INSTALL_SCRIPT} rc/action/* ${DESTDIR}${CONFPREFIX}/wmii/action
|
||||
|
||||
install: all install_rc
|
||||
@@ -76,18 +76,14 @@ clean:
|
||||
install: all
|
||||
@cd ${RCPREFIX}; make install
|
||||
@echo Installing doc to ${DESTDIR}${SHAREPREFIX}/wmii
|
||||
- @${MKDIR} -p ${DESTDIR}${SHAREPREFIX}/wmii
|
||||
- @${INSTDATA} ${SHARE} ${DESTDIR}${SHAREPREFIX}/wmii
|
||||
|
@ -42,25 +13,17 @@ $NetBSD: patch-ab,v 1.5 2005/07/16 20:04:40 leonardschmidt Exp $
|
|||
@echo Installing executable files to ${DESTDIR}${PREFIX}/bin
|
||||
- @${MKDIR} -p ${DESTDIR}${PREFIX}/bin
|
||||
- @${INSTBIN} ${BIN} ${DESTDIR}${PREFIX}/bin
|
||||
- @${RM} ${DESTDIR}${PREFIX}/bin/wmii
|
||||
- @${SED} 's|CONFPREFIX|${CONFPREFIX}|' <base/wmii >${DESTDIR}${PREFIX}/bin/wmii
|
||||
- @for i in ${DEST_BIN}; do ${MODBIN} ${DESTDIR}${PREFIX}/bin/$$i; done
|
||||
+ @${BSD_INSTALL_PROGRAM_DIR} ${DESTDIR}${PREFIX}/bin
|
||||
+ @${BSD_INSTALL_PROGRAM} ${BIN} ${DESTDIR}${PREFIX}/bin
|
||||
+ @${BSD_INSTALL_SCRIPT} base/wmii util/wmira util/wmirefcard ${DESTDIR}${PREFIX}/bin
|
||||
@echo Installing manual pages to ${DESTDIR}${MANPREFIX}/man1
|
||||
- @${MKDIR} -p ${DESTDIR}${MANPREFIX}/man1
|
||||
- @${INSTDATA} ${MAN1} ${DESTDIR}${MANPREFIX}/man1
|
||||
- @${MODDATA} ${DESTDIR}${MANPREFIX}/man1/wmii.1
|
||||
- @${MODDATA} ${DESTDIR}${MANPREFIX}/man1/wmir.1
|
||||
- @${MODDATA} ${DESTDIR}${MANPREFIX}/man1/wmibar.1
|
||||
- @${MKDIR} -p ${DESTDIR}${MANPREFIX}/man5
|
||||
- @${INSTDATA} ${MAN5} ${DESTDIR}${MANPREFIX}/man5
|
||||
- @${MODDATA} ${DESTDIR}${MANPREFIX}/man5/wmii.rc.5
|
||||
+ @${BSD_INSTALL_MAN_DIR} ${DESTDIR}${MANPREFIX}/man1
|
||||
+ @${BSD_INSTALL_MAN} ${MAN1} ${DESTDIR}${MANPREFIX}/man1
|
||||
+ @${BSD_INSTALL_MAN_DIR} ${DESTDIR}${MANPREFIX}/man5
|
||||
+ @${BSD_INSTALL_MAN} ${MAN5} ${DESTDIR}${MANPREFIX}/man5
|
||||
@echo "wmii successfully installed"
|
||||
|
||||
uninstall:
|
||||
|
|
|
@ -1,197 +0,0 @@
|
|||
$NetBSD: patch-ac,v 1.1 2005/08/12 00:08:04 leonardschmidt Exp $
|
||||
|
||||
--- liblitz/draw_cairo.c.orig 2005-07-30 22:14:00.000000000 +0000
|
||||
+++ liblitz/draw_cairo.c
|
||||
@@ -14,8 +14,7 @@ static void
|
||||
draw_bg(Display * dpy, cairo_t * cr, Draw * d)
|
||||
{
|
||||
/* draw bg */
|
||||
- cairo_set_rgb_color(cr, d->bg.r, d->bg.g, d->bg.b);
|
||||
- cairo_set_alpha(cr, 1.0);
|
||||
+ cairo_set_source_rgba(cr, d->bg.r, d->bg.g, d->bg.b, 1.0);
|
||||
if(!d->notch) {
|
||||
cairo_rectangle(cr, d->rect.x, d->rect.y, d->rect.width,
|
||||
d->rect.height);
|
||||
@@ -48,27 +47,26 @@ _draw_border(cairo_t * cr, Draw * d)
|
||||
cairo_set_line_join(cr, CAIRO_LINE_JOIN_MITER);
|
||||
/* default */
|
||||
/* NW->SW */
|
||||
- cairo_set_alpha(cr, 1.0);
|
||||
- cairo_set_rgb_color(cr, d->border[3].r, d->border[3].g,
|
||||
- d->border[3].b);
|
||||
+ cairo_set_source_rgba(cr, d->border[3].r, d->border[3].g,
|
||||
+ d->border[3].b, 1.0);
|
||||
cairo_move_to(cr, d->rect.x, d->rect.y);
|
||||
cairo_rel_line_to(cr, 0, d->rect.height);
|
||||
cairo_stroke(cr);
|
||||
/* NW->NE */
|
||||
- cairo_set_rgb_color(cr, d->border[0].r, d->border[0].g,
|
||||
- d->border[0].b);
|
||||
+ cairo_set_source_rgba(cr, d->border[0].r, d->border[0].g,
|
||||
+ d->border[0].b, 1.0);
|
||||
cairo_move_to(cr, d->rect.x, d->rect.y);
|
||||
cairo_rel_line_to(cr, d->rect.width, 0);
|
||||
cairo_stroke(cr);
|
||||
/* SW->SE */
|
||||
- cairo_set_rgb_color(cr, d->border[2].r, d->border[2].g,
|
||||
- d->border[2].b);
|
||||
+ cairo_set_source_rgba(cr, d->border[2].r, d->border[2].g,
|
||||
+ d->border[2].b, 1.0);
|
||||
cairo_move_to(cr, d->rect.x, d->rect.y + d->rect.height);
|
||||
cairo_rel_line_to(cr, d->rect.width, 0);
|
||||
cairo_stroke(cr);
|
||||
/* SE->NE */
|
||||
- cairo_set_rgb_color(cr, d->border[1].r, d->border[1].g,
|
||||
- d->border[1].b);
|
||||
+ cairo_set_source_rgba(cr, d->border[1].r, d->border[1].g,
|
||||
+ d->border[1].b, 1.0);
|
||||
cairo_move_to(cr, d->rect.x + d->rect.width, d->rect.y);
|
||||
cairo_rel_line_to(cr, 0, d->rect.height);
|
||||
cairo_stroke(cr);
|
||||
@@ -90,25 +88,23 @@ draw_text(Display * dpy, cairo_t * cr, D
|
||||
len = strlen(text);
|
||||
|
||||
/* query font */
|
||||
- cairo_select_font(cr, d->fnt.font, CAIRO_FONT_SLANT_NORMAL,
|
||||
- CAIRO_FONT_WEIGHT_NORMAL);
|
||||
- cairo_scale_font(cr, d->fnt.scale);
|
||||
+ cairo_select_font_face(cr, d->fnt.font, CAIRO_FONT_SLANT_NORMAL,
|
||||
+ CAIRO_FONT_WEIGHT_NORMAL);
|
||||
+ cairo_set_font_size(cr, d->fnt.scale);
|
||||
|
||||
/* query text extends */
|
||||
- cairo_current_font_extents(cr, &fext);
|
||||
- cairo_text_extents(cr, (unsigned char *) text, &textext);
|
||||
+ cairo_font_extents(cr, &fext);
|
||||
+ cairo_text_extents(cr, text, &textext);
|
||||
|
||||
/* calculate y offset, should be baseline */
|
||||
- offy = d->rect.y + d->rect.height / 2
|
||||
- + ((d->rect.height - 2) - (fext.ascent + fext.descent)) / 2;
|
||||
+ offy = d->rect.y + ((d->rect.height - 2) / 2) + ((fext.ascent + fext.descent) / 2);
|
||||
/* check if text has to be shrinked */
|
||||
|
||||
-
|
||||
/* shorten text if necessary */
|
||||
for(i = 1; (len - (i * 3) > 0) && (textext.width > d->rect.width); i++) {
|
||||
len -= i * 3;
|
||||
text[len - 1] = '\0';
|
||||
- cairo_text_extents(cr, (unsigned char *) text, &textext);
|
||||
+ cairo_text_extents(cr, text, &textext);
|
||||
shortened = 1;
|
||||
}
|
||||
if(textext.width > d->rect.width)
|
||||
@@ -135,10 +131,9 @@ draw_text(Display * dpy, cairo_t * cr, D
|
||||
}
|
||||
|
||||
/* draw fg text */
|
||||
- cairo_set_alpha(cr, 1.0);
|
||||
- cairo_set_rgb_color(cr, d->fg.r, d->fg.g, d->fg.b);
|
||||
+ cairo_set_source_rgba(cr, d->fg.r, d->fg.g, d->fg.b, 1.0);
|
||||
cairo_move_to(cr, offx, offy);
|
||||
- cairo_show_text(cr, (unsigned char *) text);
|
||||
+ cairo_show_text(cr, text);
|
||||
}
|
||||
|
||||
/* draws meter */
|
||||
@@ -148,14 +143,18 @@ draw_meter(Display * dpy, Draw * d)
|
||||
cairo_t *cr;
|
||||
int w = d->text ? d->rect.height / 2 : d->rect.width - 4;
|
||||
int offy, mh;
|
||||
+ cairo_surface_t *surface;
|
||||
+
|
||||
|
||||
- cr = cairo_create();
|
||||
+ surface = cairo_xlib_surface_create(dpy, d->drawable,
|
||||
+ DefaultVisual(dpy, d->screen_num),
|
||||
+ d->rect.width, d->rect.height);
|
||||
+ cr = cairo_create(surface);
|
||||
if(!cr) {
|
||||
fprintf(stderr, "%s", "wmii: cannot create cairo context");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
- cairo_set_target_drawable(cr, dpy, d->drawable);
|
||||
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
|
||||
draw_bg(dpy, cr, d);
|
||||
_draw_border(cr, d);
|
||||
@@ -163,8 +162,7 @@ draw_meter(Display * dpy, Draw * d)
|
||||
/* draw bg */
|
||||
mh = ((d->rect.height - 4) * d->val) / 100;
|
||||
offy = d->rect.y + d->rect.height - 2 - mh;
|
||||
- cairo_set_rgb_color(cr, d->fill.r, d->fill.g, d->fill.b);
|
||||
- cairo_set_alpha(cr, 1.0);
|
||||
+ cairo_set_source_rgba(cr, d->fill.r, d->fill.g, d->fill.b, 1.0);
|
||||
cairo_rectangle(cr, d->rect.x + 2, offy, w, mh);
|
||||
cairo_fill(cr);
|
||||
|
||||
@@ -179,19 +177,25 @@ draw_meter(Display * dpy, Draw * d)
|
||||
|
||||
/* get rid of the cairo overhead */
|
||||
cairo_destroy(cr);
|
||||
+ cairo_surface_destroy(surface);
|
||||
}
|
||||
|
||||
/* draws label */
|
||||
static void
|
||||
_draw_label(Display * dpy, Draw * d, int border)
|
||||
{
|
||||
- cairo_t *cr = cairo_create();
|
||||
+ cairo_t *cr;
|
||||
+ cairo_surface_t *surface;
|
||||
+
|
||||
+ surface = cairo_xlib_surface_create(dpy, d->drawable,
|
||||
+ DefaultVisual(dpy, d->screen_num),
|
||||
+ d->rect.width, d->rect.height);
|
||||
+ cr = cairo_create(surface);
|
||||
if(!cr) {
|
||||
fprintf(stderr, "%s", "wmii: cannot create cairo context");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
- cairo_set_target_drawable(cr, dpy, d->drawable);
|
||||
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
|
||||
draw_bg(dpy, cr, d);
|
||||
if(border)
|
||||
@@ -200,6 +204,7 @@ _draw_label(Display * dpy, Draw * d, int
|
||||
|
||||
/* get rid of the cairo overhead */
|
||||
cairo_destroy(cr);
|
||||
+ cairo_surface_destroy(surface);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -219,10 +224,13 @@ text_width(Display * dpy, char *font, do
|
||||
{
|
||||
cairo_text_extents_t text;
|
||||
cairo_t *cr;
|
||||
-
|
||||
+ cairo_surface_t *surface;
|
||||
+ int mon = DefaultScreen(dpy);
|
||||
+ surface = cairo_xlib_surface_create(dpy, RootWindow(dpy, mon),
|
||||
+ DefaultVisual(dpy, mon), 10, 10);
|
||||
if(!utf8txt)
|
||||
return 0;
|
||||
- cr = cairo_create();
|
||||
+ cr = cairo_create(surface);
|
||||
|
||||
if(!cr) {
|
||||
fprintf(stderr, "%s", "wmii: cannot create cairo context");
|
||||
@@ -230,12 +238,13 @@ text_width(Display * dpy, char *font, do
|
||||
}
|
||||
|
||||
/* query font */
|
||||
- cairo_select_font(cr, font, CAIRO_FONT_SLANT_NORMAL,
|
||||
- CAIRO_FONT_WEIGHT_NORMAL);
|
||||
- cairo_scale_font(cr, size);
|
||||
+ cairo_select_font_face(cr, font, CAIRO_FONT_SLANT_NORMAL,
|
||||
+ CAIRO_FONT_WEIGHT_NORMAL);
|
||||
+ cairo_set_font_size(cr, size);
|
||||
|
||||
/* query text extends */
|
||||
- cairo_text_extents(cr, utf8txt, &text);
|
||||
+ cairo_text_extents(cr, (char *)utf8txt, &text);
|
||||
cairo_destroy(cr);
|
||||
+ cairo_surface_destroy(surface);
|
||||
return (int) text.width;
|
||||
}
|
Loading…
Reference in a new issue