From 9cb260d091f5a474ee70ddccc6b8ecad825a78dc Mon Sep 17 00:00:00 2001 From: c0bw3b Date: Sat, 4 May 2019 19:52:24 +0200 Subject: [treewide] delete unused patches --- .../audio/freewheeling/am_path_sdl.patch | 40 ---- pkgs/applications/audio/freewheeling/xml.patch | 13 -- pkgs/applications/editors/rstudio/fix-cmake.patch | 15 -- .../networking/browsers/firefox/fix-debug.patch | 77 ------- .../applications/office/libreoffice/xdg-open.patch | 25 --- .../0001-fix-gcc-cmath-namespace-issues.patch | 140 ------------ pkgs/applications/search/recoll/nodeblayout.patch | 12 -- pkgs/applications/search/recoll/versionawk.patch | 12 -- pkgs/applications/window-managers/tabbed/xft.patch | 234 --------------------- 9 files changed, 568 deletions(-) delete mode 100644 pkgs/applications/audio/freewheeling/am_path_sdl.patch delete mode 100644 pkgs/applications/audio/freewheeling/xml.patch delete mode 100644 pkgs/applications/editors/rstudio/fix-cmake.patch delete mode 100644 pkgs/applications/networking/browsers/firefox/fix-debug.patch delete mode 100644 pkgs/applications/office/libreoffice/xdg-open.patch delete mode 100644 pkgs/applications/science/robotics/qgroundcontrol/0001-fix-gcc-cmath-namespace-issues.patch delete mode 100644 pkgs/applications/search/recoll/nodeblayout.patch delete mode 100644 pkgs/applications/search/recoll/versionawk.patch delete mode 100644 pkgs/applications/window-managers/tabbed/xft.patch (limited to 'pkgs/applications') diff --git a/pkgs/applications/audio/freewheeling/am_path_sdl.patch b/pkgs/applications/audio/freewheeling/am_path_sdl.patch deleted file mode 100644 index 2bc3b4f45ac2..000000000000 --- a/pkgs/applications/audio/freewheeling/am_path_sdl.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- code-r100/configure.ac 2014-09-25 23:44:41.059174904 +0200 -+++ code-r100.new/configure.ac 2014-09-26 01:37:18.507017390 +0200 -@@ -44,6 +44,8 @@ - [AC_MSG_ERROR(CONFIG: You need libxml2-dev installed. - http://www.xmlsoft.org/)]) - -+PKG_CHECK_MODULES([libxml], [libxml-2.0]) -+ - AC_CHECK_LIB([m], [sqrt], , [AC_MSG_ERROR(CORE: You need libm installed)]) - AC_CHECK_LIB([pthread], [pthread_self], , [AC_MSG_ERROR(CORE: You need libpthread installed)]) - -@@ -79,12 +81,12 @@ - echo "--- Enabling USB LCD display --"; - fi - --#SDL_VERSION=1.2.4 --#AM_PATH_SDL($SDL_VERSION, --# :, --# AC_MSG_ERROR([VIDEO: *** SDL version $SDL_VERSION not found! --# http://www.libsdl.org/]) --#) -+SDL_VERSION=1.2.4 -+AM_PATH_SDL($SDL_VERSION, -+ :, -+ AC_MSG_ERROR([VIDEO: *** SDL version $SDL_VERSION not found! -+ http://www.libsdl.org/]) -+) - - AC_CHECK_LIB([vorbis], [main], , - [AC_MSG_ERROR(AUDIO: You need libvorbis-dev installed. -@@ -95,6 +97,9 @@ - AC_CHECK_LIB([vorbisenc], [main], , - [AC_MSG_ERROR(AUDIO: You need libvorbis-dev installed. - http://www.xiph.org/ogg/vorbis/)]) -+AC_CHECK_LIB([ogg], [main], , -+ [AC_MSG_ERROR(AUDIO: You need libogg-dev installed. -+ http://www.xiph.org/ogg/)]) - - AC_CHECK_LIB([sndfile], [main], , - [AC_MSG_ERROR(AUDIO: you need libsndfile installed. diff --git a/pkgs/applications/audio/freewheeling/xml.patch b/pkgs/applications/audio/freewheeling/xml.patch deleted file mode 100644 index fd9d4fb39fe4..000000000000 --- a/pkgs/applications/audio/freewheeling/xml.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- code-r100/src/Makefile.am 2014-09-25 23:44:41.043174832 +0200 -+++ code-r100.new/src/Makefile.am 2014-09-26 01:21:03.750015888 +0200 -@@ -24,7 +24,8 @@ - - fweelindir = $(datadir)/fweelin - --FWEELIN_CFLAGS = -I. -g -Wall -Wno-write-strings -Wno-non-virtual-dtor -D_REENTRANT -DPTHREADS -DNDEBUG -DVERSION=\"$(VERSION)\" -DFWEELIN_DATADIR=\"$(fweelindir)\" -DADDON_DIR=\"/usr/local/lib/jack\" -I/usr/include/freetype2 -I/usr/include/libxml2 -funroll-loops -finline-functions -fomit-frame-pointer -ffast-math -fexpensive-optimizations -fstrict-aliasing -falign-loops=2 -falign-jumps=2 -falign-functions=2 -O9 -+XML_CFLAGS = `xml2-config --cflags` -+FWEELIN_CFLAGS = -I. -g -Wall -Wno-write-strings -Wno-non-virtual-dtor -D_REENTRANT -DPTHREADS -DNDEBUG -DVERSION=\"$(VERSION)\" -DFWEELIN_DATADIR=\"$(fweelindir)\" -DADDON_DIR=\"/usr/local/lib/jack\" -I/usr/include/freetype2 $(XML_CFLAGS) -funroll-loops -finline-functions -fomit-frame-pointer -ffast-math -fexpensive-optimizations -fstrict-aliasing -falign-loops=2 -falign-jumps=2 -falign-functions=2 -O9 - - AM_CFLAGS = $(CFLAGS) $(FWEELIN_CFLAGS) --AM_CXXFLAGS = $(CFLAGS) $(CXXFLAGS) $(FWEELIN_CFLAGS) -+AM_CXXFLAGS = $(CFLAGS) $(CXXFLAGS) $(FWEELIN_CFLAGS) ${libxml2_CFLAGS} diff --git a/pkgs/applications/editors/rstudio/fix-cmake.patch b/pkgs/applications/editors/rstudio/fix-cmake.patch deleted file mode 100644 index 3effc0eaa32b..000000000000 --- a/pkgs/applications/editors/rstudio/fix-cmake.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/src/cpp/desktop/CMakeLists.txt b/src/cpp/desktop/CMakeLists.txt -index f5701bf735..27af4148ff 100644 ---- a/src/cpp/desktop/CMakeLists.txt -+++ b/src/cpp/desktop/CMakeLists.txt -@@ -112,6 +112,7 @@ find_package(Qt5WebEngine REQUIRED) - find_package(Qt5WebEngineWidgets REQUIRED) - find_package(Qt5PrintSupport REQUIRED) - find_package(Qt5Quick REQUIRED) -+find_package(Qt5QuickWidgets REQUIRED) - find_package(Qt5Positioning REQUIRED) - find_package(Qt5Sensors REQUIRED) - find_package(Qt5Svg REQUIRED) --- -2.17.1 - diff --git a/pkgs/applications/networking/browsers/firefox/fix-debug.patch b/pkgs/applications/networking/browsers/firefox/fix-debug.patch deleted file mode 100644 index ba92bbc47403..000000000000 --- a/pkgs/applications/networking/browsers/firefox/fix-debug.patch +++ /dev/null @@ -1,77 +0,0 @@ - -# HG changeset patch -# User Michelangelo De Simone -# Date 1479198095 28800 -# Node ID fde6e9ccfc72fbc0fcd93af7a40436b216e7ea1a -# Parent 687eac6845a77d2cac5505da9c8912885c2a9e57 -Bug 1013882 - TestInterfaceJS should be packaged only if it's available. r=glandium, a=jcristau - -MozReview-Commit-ID: IEHesdoU4Sz - -diff --git a/b2g/installer/package-manifest.in b/b2g/installer/package-manifest.in ---- a/b2g/installer/package-manifest.in -+++ b/b2g/installer/package-manifest.in -@@ -570,17 +570,17 @@ - @RESPATH@/components/InputMethod.manifest - #ifdef MOZ_B2G - @RESPATH@/components/inputmethod.xpt - #endif - - @RESPATH@/components/SystemUpdate.manifest - @RESPATH@/components/SystemUpdateManager.js - --#ifdef MOZ_DEBUG -+#if defined(ENABLE_TESTS) && defined(MOZ_DEBUG) - @RESPATH@/components/TestInterfaceJS.js - @RESPATH@/components/TestInterfaceJS.manifest - @RESPATH@/components/TestInterfaceJSMaplike.js - #endif - - ; Modules - @RESPATH@/modules/* - -diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in ---- a/browser/installer/package-manifest.in -+++ b/browser/installer/package-manifest.in -@@ -554,17 +554,17 @@ - @RESPATH@/components/PresentationControlService.js - @RESPATH@/components/PresentationDataChannelSessionTransport.js - @RESPATH@/components/PresentationDataChannelSessionTransport.manifest - - ; InputMethod API - @RESPATH@/components/MozKeyboard.js - @RESPATH@/components/InputMethod.manifest - --#ifdef MOZ_DEBUG -+#if defined(ENABLE_TESTS) && defined(MOZ_DEBUG) - @RESPATH@/components/TestInterfaceJS.js - @RESPATH@/components/TestInterfaceJS.manifest - @RESPATH@/components/TestInterfaceJSMaplike.js - #endif - - ; [Extensions] - @RESPATH@/components/extensions-toolkit.manifest - @RESPATH@/browser/components/extensions-browser.manifest -diff --git a/mobile/android/installer/package-manifest.in b/mobile/android/installer/package-manifest.in ---- a/mobile/android/installer/package-manifest.in -+++ b/mobile/android/installer/package-manifest.in -@@ -381,17 +381,17 @@ - - @BINPATH@/components/CaptivePortalDetectComponents.manifest - @BINPATH@/components/captivedetect.js - - #ifdef MOZ_WEBSPEECH - @BINPATH@/components/dom_webspeechsynth.xpt - #endif - --#ifdef MOZ_DEBUG -+#if defined(ENABLE_TESTS) && defined(MOZ_DEBUG) - @BINPATH@/components/TestInterfaceJS.js - @BINPATH@/components/TestInterfaceJS.manifest - @BINPATH@/components/TestInterfaceJSMaplike.js - #endif - - @BINPATH@/components/nsAsyncShutdown.manifest - @BINPATH@/components/nsAsyncShutdown.js - - diff --git a/pkgs/applications/office/libreoffice/xdg-open.patch b/pkgs/applications/office/libreoffice/xdg-open.patch deleted file mode 100644 index 3ff7e5d80f7a..000000000000 --- a/pkgs/applications/office/libreoffice/xdg-open.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/shell/source/unix/exec/shellexec.cxx b/shell/source/unix/exec/shellexec.cxx ---- a/shell/source/unix/exec/shellexec.cxx -+++ b/shell/source/unix/exec/shellexec.cxx -@@ -150,7 +150,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar - if (std::getenv("LIBO_FLATPAK") != nullptr) { - aBuffer.append("/app/bin/xdg-open"); - } else { -- aBuffer.append("/usr/bin/xdg-open"); -+ aBuffer.append("xdg-open"); - } - #endif - aBuffer.append(" "); -diff --git a/shell/source/unix/misc/senddoc.sh b/shell/source/unix/misc/senddoc.sh -index 4519e01f26e2..8985711a2c01 100755 ---- a/shell/source/unix/misc/senddoc.sh -+++ b/shell/source/unix/misc/senddoc.sh -@@ -393,6 +393,8 @@ case `basename "$MAILER" | sed 's/-.*$//'` in - MAILER=/usr/bin/kde-open - elif [ -x /usr/bin/xdg-open ] ; then - MAILER=/usr/bin/xdg-open -+ elif type -p xdg-open >/dev/null 2>&1 ; then -+ MAILER="$(type -p xdg-open)" - else - echo "Unsupported mail client: `basename $MAILER | sed 's/-.*^//'`" - exit 2 diff --git a/pkgs/applications/science/robotics/qgroundcontrol/0001-fix-gcc-cmath-namespace-issues.patch b/pkgs/applications/science/robotics/qgroundcontrol/0001-fix-gcc-cmath-namespace-issues.patch deleted file mode 100644 index e6c9ca38a989..000000000000 --- a/pkgs/applications/science/robotics/qgroundcontrol/0001-fix-gcc-cmath-namespace-issues.patch +++ /dev/null @@ -1,140 +0,0 @@ -From fffc383c10c7c194e427d78c83802c3b910fa1c2 Mon Sep 17 00:00:00 2001 -From: Patrick Callahan -Date: Thu, 24 Mar 2016 18:17:57 -0700 -Subject: [PATCH] fix gcc cmath namespace issues - ---- - src/Vehicle/Vehicle.cc | 6 +++--- - src/comm/QGCFlightGearLink.cc | 4 ++-- - src/comm/QGCJSBSimLink.cc | 4 ++-- - src/uas/UAS.cc | 8 ++++---- - src/ui/QGCDataPlot2D.cc | 4 ++-- - 5 files changed, 13 insertions(+), 13 deletions(-) - -diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc -index a0d3605..205b1de 100644 ---- a/src/Vehicle/Vehicle.cc -+++ b/src/Vehicle/Vehicle.cc -@@ -638,17 +638,17 @@ void Vehicle::setLongitude(double longitude){ - - void Vehicle::_updateAttitude(UASInterface*, double roll, double pitch, double yaw, quint64) - { -- if (isinf(roll)) { -+ if (std::isinf(roll)) { - _rollFact.setRawValue(0); - } else { - _rollFact.setRawValue(roll * (180.0 / M_PI)); - } -- if (isinf(pitch)) { -+ if (std::isinf(pitch)) { - _pitchFact.setRawValue(0); - } else { - _pitchFact.setRawValue(pitch * (180.0 / M_PI)); - } -- if (isinf(yaw)) { -+ if (std::isinf(yaw)) { - _headingFact.setRawValue(0); - } else { - yaw = yaw * (180.0 / M_PI); -diff --git a/src/comm/QGCFlightGearLink.cc b/src/comm/QGCFlightGearLink.cc -index 2a520fb..886aecf 100644 ---- a/src/comm/QGCFlightGearLink.cc -+++ b/src/comm/QGCFlightGearLink.cc -@@ -230,7 +230,7 @@ void QGCFlightGearLink::updateControls(quint64 time, float rollAilerons, float p - Q_UNUSED(systemMode); - Q_UNUSED(navMode); - -- if(!isnan(rollAilerons) && !isnan(pitchElevator) && !isnan(yawRudder) && !isnan(throttle)) -+ if(!std::isnan(rollAilerons) && !std::isnan(pitchElevator) && !std::isnan(yawRudder) && !std::isnan(throttle)) - { - QString state("%1\t%2\t%3\t%4\t%5\n"); - state = state.arg(rollAilerons).arg(pitchElevator).arg(yawRudder).arg(true).arg(throttle); -@@ -240,7 +240,7 @@ void QGCFlightGearLink::updateControls(quint64 time, float rollAilerons, float p - } - else - { -- qDebug() << "HIL: Got NaN values from the hardware: isnan output: roll: " << isnan(rollAilerons) << ", pitch: " << isnan(pitchElevator) << ", yaw: " << isnan(yawRudder) << ", throttle: " << isnan(throttle); -+ qDebug() << "HIL: Got NaN values from the hardware: std::isnan output: roll: " << std::isnan(rollAilerons) << ", pitch: " << std::isnan(pitchElevator) << ", yaw: " << std::isnan(yawRudder) << ", throttle: " << std::isnan(throttle); - } - } - -diff --git a/src/comm/QGCJSBSimLink.cc b/src/comm/QGCJSBSimLink.cc -index 1210621..89db371 100644 ---- a/src/comm/QGCJSBSimLink.cc -+++ b/src/comm/QGCJSBSimLink.cc -@@ -242,7 +242,7 @@ void QGCJSBSimLink::updateControls(quint64 time, float rollAilerons, float pitch - Q_UNUSED(systemMode); - Q_UNUSED(navMode); - -- if(!isnan(rollAilerons) && !isnan(pitchElevator) && !isnan(yawRudder) && !isnan(throttle)) -+ if(!std::isnan(rollAilerons) && !std::isnan(pitchElevator) && !std::isnan(yawRudder) && !std::isnan(throttle)) - { - QString state("%1\t%2\t%3\t%4\t%5\n"); - state = state.arg(rollAilerons).arg(pitchElevator).arg(yawRudder).arg(true).arg(throttle); -@@ -250,7 +250,7 @@ void QGCJSBSimLink::updateControls(quint64 time, float rollAilerons, float pitch - } - else - { -- qDebug() << "HIL: Got NaN values from the hardware: isnan output: roll: " << isnan(rollAilerons) << ", pitch: " << isnan(pitchElevator) << ", yaw: " << isnan(yawRudder) << ", throttle: " << isnan(throttle); -+ qDebug() << "HIL: Got NaN values from the hardware: isnan output: roll: " << std::isnan(rollAilerons) << ", pitch: " << std::isnan(pitchElevator) << ", yaw: " << std::isnan(yawRudder) << ", throttle: " << std::isnan(throttle); - } - //qDebug() << "Updated controls" << state; - } -diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc -index 4d5c1c2..ac88852 100644 ---- a/src/uas/UAS.cc -+++ b/src/uas/UAS.cc -@@ -558,7 +558,7 @@ void UAS::receiveMessage(mavlink_message_t message) - - setAltitudeAMSL(hud.alt); - setGroundSpeed(hud.groundspeed); -- if (!isnan(hud.airspeed)) -+ if (!std::isnan(hud.airspeed)) - setAirSpeed(hud.airspeed); - speedZ = -hud.climb; - emit altitudeChanged(this, altitudeAMSL, altitudeRelative, -speedZ, time); -@@ -654,7 +654,7 @@ void UAS::receiveMessage(mavlink_message_t message) - - float vel = pos.vel/100.0f; - // Smaller than threshold and not NaN -- if ((vel < 1000000) && !isnan(vel) && !isinf(vel)) { -+ if ((vel < 1000000) && !std::isnan(vel) && !std::isinf(vel)) { - setGroundSpeed(vel); - emit speedChanged(this, groundSpeed, airSpeed, time); - } else { -@@ -1439,8 +1439,8 @@ void UAS::setExternalControlSetpoint(float roll, float pitch, float yaw, float t - if (countSinceLastTransmission++ >= 5) { - sendCommand = true; - countSinceLastTransmission = 0; -- } else if ((!isnan(roll) && roll != manualRollAngle) || (!isnan(pitch) && pitch != manualPitchAngle) || -- (!isnan(yaw) && yaw != manualYawAngle) || (!isnan(thrust) && thrust != manualThrust) || -+ } else if ((!std::isnan(roll) && roll != manualRollAngle) || (!std::isnan(pitch) && pitch != manualPitchAngle) || -+ (!std::isnan(yaw) && yaw != manualYawAngle) || (!std::isnan(thrust) && thrust != manualThrust) || - buttons != manualButtons) { - sendCommand = true; - -diff --git a/src/ui/QGCDataPlot2D.cc b/src/ui/QGCDataPlot2D.cc -index 2e530b2..9d5a774 100644 ---- a/src/ui/QGCDataPlot2D.cc -+++ b/src/ui/QGCDataPlot2D.cc -@@ -535,7 +535,7 @@ void QGCDataPlot2D::loadCsvLog(QString file, QString xAxisName, QString yAxisFil - { - bool okx = true; - x = text.toDouble(&okx); -- if (okx && !isnan(x) && !isinf(x)) -+ if (okx && !std::isnan(x) && !std::isinf(x)) - { - headerfound = true; - } -@@ -561,7 +561,7 @@ void QGCDataPlot2D::loadCsvLog(QString file, QString xAxisName, QString yAxisFil - y = text.toDouble(&oky); - // Only INF is really an issue for the plot - // NaN is fine -- if (oky && !isnan(y) && !isinf(y) && text.length() > 0 && text != " " && text != "\n" && text != "\r" && text != "\t") -+ if (oky && !std::isnan(y) && !std::isinf(y) && text.length() > 0 && text != " " && text != "\n" && text != "\r" && text != "\t") - { - // Only append definitely valid values - xValues.value(curveName)->append(x); --- -2.7.4 - diff --git a/pkgs/applications/search/recoll/nodeblayout.patch b/pkgs/applications/search/recoll/nodeblayout.patch deleted file mode 100644 index 39988423ae1f..000000000000 --- a/pkgs/applications/search/recoll/nodeblayout.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ru recoll-1.21.3-orig/recollinstall.in recoll-1.21.3/recollinstall.in ---- recoll-1.21.3-orig/recollinstall.in 2015-09-28 08:08:42.000000000 +0100 -+++ recoll-1.21.3/recollinstall.in 2015-12-13 22:48:30.361776374 +0000 -@@ -45,9 +45,6 @@ - mandir=$DESTDIR/$mandir - ROOTFORPYTHON="--root=${DESTDIR}" - fi --if test -f /etc/debian_version ; then -- OPTSFORPYTHON=--install-layout=deb --fi - - echo "Installing to $PREFIX" diff --git a/pkgs/applications/search/recoll/versionawk.patch b/pkgs/applications/search/recoll/versionawk.patch deleted file mode 100644 index a03ffbc16df1..000000000000 --- a/pkgs/applications/search/recoll/versionawk.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ru recoll-1.21.3-orig/filters/rclpdf recoll-1.21.3/filters/rclpdf ---- recoll-1.21.3-orig/filters/rclpdf 2015-09-28 08:08:15.000000000 +0100 -+++ recoll-1.21.3/filters/rclpdf 2015-12-14 21:37:01.984945925 +0000 -@@ -129,7 +129,7 @@ - { - # Test poppler version: at some point before 0.24, poppler began - # to properly escape text inside the header (but not the body). -- XYZ=`pdftotext -v 2>&1 | awk '/pdftotext/{print $3}'` -+ XYZ=`pdftotext -v 2>&1 | awk '/version/{print $3}'` - MAJOR=`echo $XYZ | cut -d. -f 1` - MINOR=`echo $XYZ | cut -d. -f 2` - escapeheader=1 diff --git a/pkgs/applications/window-managers/tabbed/xft.patch b/pkgs/applications/window-managers/tabbed/xft.patch deleted file mode 100644 index f4f1e82e7052..000000000000 --- a/pkgs/applications/window-managers/tabbed/xft.patch +++ /dev/null @@ -1,234 +0,0 @@ -diff --git a/config.def.h b/config.def.h -index b3da7f0..ce43686 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -1,7 +1,7 @@ - /* See LICENSE file for copyright and license details. */ - - /* appearance */ --static const char font[] = "-*-*-medium-*-*-*-14-*-*-*-*-*-*-*"; -+static const char font[] = "monospace-9"; - static const char* normbgcolor = "#222222"; - static const char* normfgcolor = "#cccccc"; - static const char* selbgcolor = "#555555"; -diff --git a/config.mk b/config.mk -index dd741e4..ed3a2e9 100644 ---- a/config.mk -+++ b/config.mk -@@ -9,7 +9,7 @@ MANPREFIX = ${PREFIX}/share/man - - # includes and libs - INCS = -I. -I/usr/include --LIBS = -L/usr/lib -lc -lX11 -+LIBS = -L/usr/lib -lc -lXft -lX11 - - # flags - CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE -diff --git a/tabbed.c b/tabbed.c -index b15f9cb..6e50c41 100644 ---- a/tabbed.c -+++ b/tabbed.c -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include - - #include "arg.h" - -@@ -64,17 +65,16 @@ typedef struct { - - typedef struct { - int x, y, w, h; -- unsigned long norm[ColLast]; -- unsigned long sel[ColLast]; -- unsigned long urg[ColLast]; -+ XftColor norm[ColLast]; -+ XftColor sel[ColLast]; -+ XftColor urg[ColLast]; - Drawable drawable; - GC gc; - struct { - int ascent; - int descent; - int height; -- XFontSet set; -- XFontStruct *xfont; -+ XftFont *xfont; - } font; - } DC; /* draw context */ - -@@ -97,7 +97,7 @@ static void unmapnotify(const XEvent *e); - static void destroynotify(const XEvent *e); - static void die(const char *errstr, ...); - static void drawbar(void); --static void drawtext(const char *text, unsigned long col[ColLast]); -+static void drawtext(const char *text, XftColor col[ColLast]); - static void *ecalloc(size_t n, size_t size); - static void *erealloc(void *o, size_t size); - static void expose(const XEvent *e); -@@ -107,7 +107,7 @@ static void focusonce(const Arg *arg); - static void fullscreen(const Arg *arg); - static char* getatom(int a); - static int getclient(Window w); --static unsigned long getcolor(const char *colstr); -+static XftColor getcolor(const char *colstr); - static int getfirsttab(void); - static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size); - static void initfont(const char *fontstr); -@@ -220,12 +220,6 @@ cleanup(void) { - free(clients); - clients = NULL; - -- if(dc.font.set) { -- XFreeFontSet(dpy, dc.font.set); -- } else { -- XFreeFont(dpy, dc.font.xfont); -- } -- - XFreePixmap(dpy, dc.drawable); - XFreeGC(dpy, dc.gc); - XDestroyWindow(dpy, win); -@@ -315,7 +309,7 @@ die(const char *errstr, ...) { - - void - drawbar(void) { -- unsigned long *col; -+ XftColor *col; - int c, cc, fc, width; - char *name = NULL; - -@@ -368,12 +362,13 @@ drawbar(void) { - } - - void --drawtext(const char *text, unsigned long col[ColLast]) { -+drawtext(const char *text, XftColor col[ColLast]) { - int i, x, y, h, len, olen; - char buf[256]; -+ XftDraw *d; - XRectangle r = { dc.x, dc.y, dc.w, dc.h }; - -- XSetForeground(dpy, dc.gc, col[ColBG]); -+ XSetForeground(dpy, dc.gc, col[ColBG].pixel); - XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); - if(!text) - return; -@@ -394,13 +389,12 @@ drawtext(const char *text, unsigned long col[ColLast]) { - for(i = len; i && i > len - 3; buf[--i] = '.'); - } - -- XSetForeground(dpy, dc.gc, col[ColFG]); -- if(dc.font.set) { -- XmbDrawString(dpy, dc.drawable, dc.font.set, -- dc.gc, x, y, buf, len); -- } else { -- XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len); -- } -+ XSetForeground(dpy, dc.gc, col[ColFG].pixel); -+ -+ d = XftDrawCreate(dpy, dc.drawable, DefaultVisual(dpy, screen), DefaultColormap(dpy,screen)); -+ -+ XftDrawStringUtf8(d, &col[ColFG], dc.font.xfont, x, y, (XftChar8 *) buf, len); -+ XftDrawDestroy(d); - } - - void * -@@ -537,15 +531,14 @@ getclient(Window w) { - return -1; - } - --unsigned long -+XftColor - getcolor(const char *colstr) { -- Colormap cmap = DefaultColormap(dpy, screen); -- XColor color; -+ XftColor color; - -- if(!XAllocNamedColor(dpy, cmap, colstr, &color, &color)) -+ if(!XftColorAllocName(dpy, DefaultVisual(dpy, screen), DefaultColormap(dpy, screen), colstr, &color)) - die("tabbed: cannot allocate color '%s'\n", colstr); - -- return color.pixel; -+ return color; - } - - int -@@ -594,41 +587,11 @@ gettextprop(Window w, Atom atom, char *text, unsigned int size) { - - void - initfont(const char *fontstr) { -- char *def, **missing, **font_names; -- int i, n; -- XFontStruct **xfonts; -- -- missing = NULL; -- if(dc.font.set) -- XFreeFontSet(dpy, dc.font.set); -- -- dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def); -- if(missing) { -- while(n--) -- fprintf(stderr, "tabbed: missing fontset: %s\n", missing[n]); -- XFreeStringList(missing); -- } -- -- if(dc.font.set) { -- dc.font.ascent = dc.font.descent = 0; -- n = XFontsOfFontSet(dc.font.set, &xfonts, &font_names); -- for(i = 0, dc.font.ascent = 0, dc.font.descent = 0; i < n; i++) { -- dc.font.ascent = MAX(dc.font.ascent, (*xfonts)->ascent); -- dc.font.descent = MAX(dc.font.descent,(*xfonts)->descent); -- xfonts++; -- } -- } else { -- if(dc.font.xfont) -- XFreeFont(dpy, dc.font.xfont); -- dc.font.xfont = NULL; -- if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr)) -- && !(dc.font.xfont = XLoadQueryFont(dpy, "fixed"))) { -- die("tabbed: cannot load font: '%s'\n", fontstr); -- } -+ if(!(dc.font.xfont = XftFontOpenName(dpy,screen,fontstr)) && !(dc.font.xfont = XftFontOpenName(dpy,screen,"fixed"))) -+ die("error, cannot load font: '%s'\n", fontstr); - -- dc.font.ascent = dc.font.xfont->ascent; -- dc.font.descent = dc.font.xfont->descent; -- } -+ dc.font.ascent = dc.font.xfont->ascent; -+ dc.font.descent = dc.font.xfont->descent; - dc.font.height = dc.font.ascent + dc.font.descent; - } - -@@ -1000,11 +963,9 @@ setup(void) { - dc.drawable = XCreatePixmap(dpy, root, ww, wh, - DefaultDepth(dpy, screen)); - dc.gc = XCreateGC(dpy, root, 0, 0); -- if(!dc.font.set) -- XSetFont(dpy, dc.gc, dc.font.xfont->fid); - - win = XCreateSimpleWindow(dpy, root, wx, wy, ww, wh, 0, -- dc.norm[ColFG], dc.norm[ColBG]); -+ dc.norm[ColFG].pixel, dc.norm[ColBG].pixel); - XMapRaised(dpy, win); - XSelectInput(dpy, win, SubstructureNotifyMask|FocusChangeMask| - ButtonPressMask|ExposureMask|KeyPressMask|PropertyChangeMask| -@@ -1070,15 +1031,9 @@ spawn(const Arg *arg) { - - int - textnw(const char *text, unsigned int len) { -- XRectangle r; -- -- if(dc.font.set) { -- XmbTextExtents(dc.font.set, text, len, NULL, &r); -- -- return r.width; -- } -- -- return XTextWidth(dc.font.xfont, text, len); -+ XGlyphInfo ext; -+ XftTextExtentsUtf8(dpy, dc.font.xfont, (XftChar8 *) text, len, &ext); -+ return ext.xOff; - } - - void -- cgit 1.4.1