[graphics/okular] /: Remove plucker generator

Albert Astals Cid null at kde.org
Thu Feb 8 23:37:56 GMT 2024


Git commit 5870b4e3b99efc01845c54ae6ae3655f64e6afd4 by Albert Astals Cid, on behalf of Sune Vuorela.
Committed on 08/02/2024 at 23:32.
Pushed by aacid into branch 'master'.

Remove plucker generator

It is undermaintained, it is hard to find documents for it, no tests,
doesn't look like it has seen any fuzzing test and looks like it trusts
the input is good.

M  +0    -1    doc/index.docbook
M  +0    -4    generators/CMakeLists.txt
D  +0    -25   generators/plucker/CMakeLists.txt
D  +0    -2    generators/plucker/Messages.sh
D  +0    -183  generators/plucker/generator_plucker.cpp
D  +0    -51   generators/plucker/generator_plucker.h
D  +0    -209  generators/plucker/libokularGenerator_plucker.json
D  +0    -257  generators/plucker/okularApplication_plucker.desktop
D  +0    -250  generators/plucker/org.kde.mobile.okular_plucker.desktop
D  +0    -115  generators/plucker/org.kde.okular-plucker.metainfo.xml
D  +0    -342  generators/plucker/unpluck/config.cpp
D  +0    -473  generators/plucker/unpluck/image.cpp
D  +0    -19   generators/plucker/unpluck/image.h
D  +0    -1039 generators/plucker/unpluck/qunpluck.cpp
D  +0    -95   generators/plucker/unpluck/qunpluck.h
D  +0    -956  generators/plucker/unpluck/unpluck.cpp
D  +0    -288  generators/plucker/unpluck/unpluck.h
D  +0    -131  generators/plucker/unpluck/unpluckint.h
D  +0    -213  generators/plucker/unpluck/util.cpp

https://invent.kde.org/graphics/okular/-/commit/5870b4e3b99efc01845c54ae6ae3655f64e6afd4

diff --git a/doc/index.docbook b/doc/index.docbook
index a02960761f..f3ff7fb773 100644
--- a/doc/index.docbook
+++ b/doc/index.docbook
@@ -53,7 +53,6 @@ Context menu actions like Rename Bookmarks etc.)
 			<keyword>fictionbook</keyword>
 			<keyword>markdown</keyword>
 			<keyword>mobipocket</keyword>
-			<keyword>plucker</keyword>
 			<keyword>annotation</keyword>
 		</keywordset>
 	</bookinfo>
diff --git a/generators/CMakeLists.txt b/generators/CMakeLists.txt
index 6f91565081..6f08810dca 100644
--- a/generators/CMakeLists.txt
+++ b/generators/CMakeLists.txt
@@ -43,10 +43,6 @@ add_subdirectory(comicbook)
 
 add_subdirectory(fax)
 
-if(JPEG_FOUND AND ZLIB_FOUND)
-  add_subdirectory(plucker)
-endif(JPEG_FOUND AND ZLIB_FOUND)
-
 if(EPUB_FOUND)
   add_subdirectory(epub)
 endif(EPUB_FOUND)
diff --git a/generators/plucker/CMakeLists.txt b/generators/plucker/CMakeLists.txt
deleted file mode 100644
index b4533a03d8..0000000000
--- a/generators/plucker/CMakeLists.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-remove_definitions(-DTRANSLATION_DOMAIN="okular")
-add_definitions(-DTRANSLATION_DOMAIN="okular_plucker")
-
-set(qunpluck_SRCS
-    unpluck/config.cpp
-    unpluck/image.cpp
-    unpluck/qunpluck.cpp
-    unpluck/unpluck.cpp
-    unpluck/util.cpp
-)
-
-########### next target ###############
-
-set(okularGenerator_plucker_SRCS
-  generator_plucker.cpp
-)
-
-okular_add_generator(okularGenerator_plucker ${okularGenerator_plucker_SRCS} ${qunpluck_SRCS})
-
-target_include_directories(okularGenerator_plucker PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/unpluck)
-target_link_libraries(okularGenerator_plucker okularcore KF6::I18n ${MATH_LIB} JPEG::JPEG ZLIB::ZLIB)
-
-########### install files ###############
-install( PROGRAMS okularApplication_plucker.desktop org.kde.mobile.okular_plucker.desktop  DESTINATION  ${KDE_INSTALL_APPDIR} )
-install( FILES org.kde.okular-plucker.metainfo.xml DESTINATION ${KDE_INSTALL_METAINFODIR} )
diff --git a/generators/plucker/Messages.sh b/generators/plucker/Messages.sh
deleted file mode 100644
index ca538c81b6..0000000000
--- a/generators/plucker/Messages.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-$XGETTEXT $(find . -name "*.cpp" -o -name "*.h") -o $podir/okular_plucker.pot
diff --git a/generators/plucker/generator_plucker.cpp b/generators/plucker/generator_plucker.cpp
deleted file mode 100644
index f5a4a548a7..0000000000
--- a/generators/plucker/generator_plucker.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
-    SPDX-FileCopyrightText: 2007 Tobias Koenig <tokoe at kde.org>
-
-    SPDX-License-Identifier: GPL-2.0-or-later
-*/
-
-#include "generator_plucker.h"
-
-#include <QAbstractTextDocumentLayout>
-#include <QFile>
-#include <QPainter>
-#include <QPrinter>
-#include <QTextDocument>
-
-#include <KAboutData>
-#include <KLocalizedString>
-
-#include <core/page.h>
-
-OKULAR_EXPORT_PLUGIN(PluckerGenerator, "libokularGenerator_plucker.json")
-
-static void calculateBoundingRect(QTextDocument *document, int startPosition, int endPosition, QRectF &rect)
-{
-    const QTextBlock startBlock = document->findBlock(startPosition);
-    const QRectF startBoundingRect = document->documentLayout()->blockBoundingRect(startBlock);
-
-    const QTextBlock endBlock = document->findBlock(endPosition);
-    const QRectF endBoundingRect = document->documentLayout()->blockBoundingRect(endBlock);
-
-    QTextLayout *startLayout = startBlock.layout();
-    QTextLayout *endLayout = endBlock.layout();
-
-    int startPos = startPosition - startBlock.position();
-    int endPos = endPosition - endBlock.position();
-    const QTextLine startLine = startLayout->lineForTextPosition(startPos);
-    const QTextLine endLine = endLayout->lineForTextPosition(endPos);
-
-    double x = startBoundingRect.x() + startLine.cursorToX(startPos);
-    double y = startBoundingRect.y() + startLine.y();
-    double r = endBoundingRect.x() + endLine.cursorToX(endPos);
-    double b = endBoundingRect.y() + endLine.y() + endLine.height();
-
-    const QSizeF size = document->size();
-    rect = QRectF(x / size.width(), y / size.height(), (r - x) / size.width(), (b - y) / size.height());
-}
-
-PluckerGenerator::PluckerGenerator(QObject *parent, const QVariantList &args)
-    : Generator(parent, args)
-{
-}
-
-PluckerGenerator::~PluckerGenerator()
-{
-}
-
-bool PluckerGenerator::loadDocument(const QString &fileName, QVector<Okular::Page *> &pagesVector)
-{
-    QUnpluck unpluck;
-
-    if (!unpluck.open(fileName)) {
-        return false;
-    }
-
-    mPages = unpluck.pages();
-    mLinks = unpluck.links();
-
-    const QMap<QString, QString> infos = unpluck.infos();
-    QMapIterator<QString, QString> it(infos);
-    while (it.hasNext()) {
-        it.next();
-        if (!it.value().isEmpty()) {
-            if (it.key() == QLatin1String("name")) {
-                mDocumentInfo.set(QStringLiteral("name"), it.value(), i18n("Name"));
-            } else if (it.key() == QLatin1String("title")) {
-                mDocumentInfo.set(Okular::DocumentInfo::Title, it.value());
-            } else if (it.key() == QLatin1String("author")) {
-                mDocumentInfo.set(Okular::DocumentInfo::Author, it.value());
-            } else if (it.key() == QLatin1String("time")) {
-                mDocumentInfo.set(Okular::DocumentInfo::CreationDate, it.value());
-            }
-        }
-    }
-
-    pagesVector.resize(mPages.count());
-
-    for (int i = 0; i < mPages.count(); ++i) {
-        QSizeF size = mPages[i]->size();
-        Okular::Page *page = new Okular::Page(i, size.width(), size.height(), Okular::Rotation0);
-        pagesVector[i] = page;
-    }
-
-    return true;
-}
-
-bool PluckerGenerator::doCloseDocument()
-{
-    mLinkAdded.clear();
-    mLinks.clear();
-
-    qDeleteAll(mPages);
-    mPages.clear();
-
-    // do not use clear() for the following, otherwise its type is changed
-    mDocumentInfo = Okular::DocumentInfo();
-
-    return true;
-}
-
-Okular::DocumentInfo PluckerGenerator::generateDocumentInfo(const QSet<Okular::DocumentInfo::Key> & /*keys*/) const
-{
-    return mDocumentInfo;
-}
-
-QImage PluckerGenerator::image(Okular::PixmapRequest *request)
-{
-    const QSizeF size = mPages[request->pageNumber()]->size();
-
-    QImage image(request->width(), request->height(), QImage::Format_ARGB32_Premultiplied);
-    image.fill(Qt::white);
-
-    QPainter p;
-    p.begin(&image);
-
-    qreal width = request->width();
-    qreal height = request->height();
-
-    p.scale(width / (qreal)size.width(), height / (qreal)size.height());
-    mPages[request->pageNumber()]->drawContents(&p);
-    p.end();
-
-    if (!mLinkAdded.contains(request->pageNumber())) {
-        QList<Okular::ObjectRect *> objects;
-        for (int i = 0; i < mLinks.count(); ++i) {
-            if (mLinks[i].page == request->pageNumber()) {
-                QTextDocument *document = mPages[request->pageNumber()];
-
-                QRectF rect;
-                calculateBoundingRect(document, mLinks[i].start, mLinks[i].end, rect);
-
-                objects.append(new Okular::ObjectRect(rect.left(), rect.top(), rect.right(), rect.bottom(), false, Okular::ObjectRect::Action, mLinks[i].link));
-            }
-        }
-
-        if (!objects.isEmpty()) {
-            request->page()->setObjectRects(objects);
-        }
-
-        mLinkAdded.insert(request->pageNumber());
-    }
-
-    return image;
-}
-
-Okular::ExportFormat::List PluckerGenerator::exportFormats() const
-{
-    static Okular::ExportFormat::List formats;
-    if (formats.isEmpty()) {
-        formats.append(Okular::ExportFormat::standardFormat(Okular::ExportFormat::PlainText));
-    }
-
-    return formats;
-}
-
-bool PluckerGenerator::exportTo(const QString &fileName, const Okular::ExportFormat &format)
-{
-    if (format.mimeType().name() == QLatin1String("text/plain")) {
-        QFile file(fileName);
-        if (!file.open(QIODevice::WriteOnly)) {
-            return false;
-        }
-
-        QTextStream out(&file);
-        for (int i = 0; i < mPages.count(); ++i) {
-            out << mPages[i]->toPlainText();
-        }
-
-        return true;
-    }
-
-    return false;
-}
-
-#include "generator_plucker.moc"
diff --git a/generators/plucker/generator_plucker.h b/generators/plucker/generator_plucker.h
deleted file mode 100644
index d32c3568e2..0000000000
--- a/generators/plucker/generator_plucker.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-    SPDX-FileCopyrightText: 2007 Tobias Koenig <tokoe at kde.org>
-
-    SPDX-License-Identifier: GPL-2.0-or-later
-*/
-
-#ifndef _OKULAR_GENERATOR_PLUCKER_H_
-#define _OKULAR_GENERATOR_PLUCKER_H_
-
-#include <core/document.h>
-#include <core/generator.h>
-
-#include <QTextBlock>
-
-#include "qunpluck.h"
-
-class QTextDocument;
-
-class PluckerGenerator : public Okular::Generator
-{
-    Q_OBJECT
-    Q_INTERFACES(Okular::Generator)
-
-public:
-    PluckerGenerator(QObject *parent, const QVariantList &args);
-    ~PluckerGenerator() override;
-
-    // [INHERITED] load a document and fill up the pagesVector
-    bool loadDocument(const QString &fileName, QVector<Okular::Page *> &pagesVector) override;
-
-    // [INHERITED] document information
-    Okular::DocumentInfo generateDocumentInfo(const QSet<Okular::DocumentInfo::Key> &keys) const override;
-
-    // [INHERITED] perform actions on document / pages
-    QImage image(Okular::PixmapRequest *request) override;
-
-    // [INHERITED] text exporting
-    Okular::ExportFormat::List exportFormats() const override;
-    bool exportTo(const QString &fileName, const Okular::ExportFormat &format) override;
-
-protected:
-    bool doCloseDocument() override;
-
-private:
-    QList<QTextDocument *> mPages;
-    QSet<int> mLinkAdded;
-    Link::List mLinks;
-    Okular::DocumentInfo mDocumentInfo;
-};
-
-#endif
diff --git a/generators/plucker/libokularGenerator_plucker.json b/generators/plucker/libokularGenerator_plucker.json
deleted file mode 100644
index ce955bfb4f..0000000000
--- a/generators/plucker/libokularGenerator_plucker.json
+++ /dev/null
@@ -1,209 +0,0 @@
-{
-    "KPlugin": {
-        "Authors": [
-            {
-                "Email": "tokoe at kde.org",
-                "Name": "Tobias Koenig",
-                "Name[ar]": "Tobias Koenig",
-                "Name[az]": "Tobias Koenig",
-                "Name[be]": "Tobias Koenig",
-                "Name[bg]": "Tobias Koenig",
-                "Name[ca at valencia]": "Tobias Koenig",
-                "Name[ca]": "Tobias Koenig",
-                "Name[cs]": "Tobias Koenig",
-                "Name[da]": "Tobias Koenig",
-                "Name[de]": "Tobias Koenig",
-                "Name[el]": "Tobias Koenig",
-                "Name[en_GB]": "Tobias Koenig",
-                "Name[eo]": "Tobias Koenig",
-                "Name[es]": "Tobias Koenig",
-                "Name[et]": "Tobias Koenig",
-                "Name[eu]": "Tobias Koenig",
-                "Name[fi]": "Tobias Koenig",
-                "Name[fr]": "Tobias Koenig",
-                "Name[gl]": "Tobias Koenig",
-                "Name[he]": "טוביאס קוניג",
-                "Name[hu]": "Tobias Koenig",
-                "Name[ia]": "Tobias Koenig",
-                "Name[ie]": "Tobias Koenig",
-                "Name[it]": "Tobias Koenig",
-                "Name[ka]": "Tobias Koenig",
-                "Name[ko]": "Tobias Koenig",
-                "Name[lt]": "Tobias Koenig",
-                "Name[lv]": "Tobias Koenig",
-                "Name[nl]": "Tobias Koenig",
-                "Name[nn]": "Tobias König",
-                "Name[pa]": "Tobias Koenig",
-                "Name[pl]": "Tobias Koenig",
-                "Name[pt]": "Tobias Koenig",
-                "Name[pt_BR]": "Tobias Koenig",
-                "Name[ro]": "Tobias Koenig",
-                "Name[ru]": "Tobias König",
-                "Name[sk]": "Tobias Koenig",
-                "Name[sl]": "Tobias Koenig",
-                "Name[sr at ijekavian]": "Тобијас Кениг",
-                "Name[sr at ijekavianlatin]": "Tobijas Kenig",
-                "Name[sr at latin]": "Tobijas Kenig",
-                "Name[sr]": "Тобијас Кениг",
-                "Name[sv]": "Tobias Koenig",
-                "Name[ta]": "டொபையாசு கோனிகு",
-                "Name[tr]": "Tobias Koenig",
-                "Name[uk]": "Tobias Koenig",
-                "Name[vi]": "Tobias Koenig",
-                "Name[x-test]": "xxTobias Koenigxx",
-                "Name[zh_CN]": "Tobias Koenig",
-                "Name[zh_TW]": "Tobias Koenig"
-            }
-        ],
-        "Copyright": "© 2007-2008 Tobias Koenig",
-        "Copyright[ar]": "© 2007-2008 Tobias Koenig",
-        "Copyright[az]": "© 2007-2008 Tobias Koenig",
-        "Copyright[be]": "© 2007-2008 Tobias Koenig",
-        "Copyright[bg]": "© 2007-2008 Tobias Koenig",
-        "Copyright[ca at valencia]": "© 2007-2008 Tobias Koenig",
-        "Copyright[ca]": "© 2007-2008 Tobias Koenig",
-        "Copyright[cs]": "© 2007-2008 Tobias Koenig",
-        "Copyright[da]": "© 2007-2008 Tobias Koenig",
-        "Copyright[de]": "© 2007-2008 Tobias Koenig",
-        "Copyright[el]": "© 2007-2008 Tobias Koenig",
-        "Copyright[en_GB]": "© 2007-2008 Tobias Koenig",
-        "Copyright[eo]": "© 2007-2008 Tobias Koenig",
-        "Copyright[es]": "© 2007-2008 Tobias Koenig",
-        "Copyright[et]": "© 2007-2008: Tobias Koenig",
-        "Copyright[eu]": "© 2007-2008 Tobias Koenig",
-        "Copyright[fi]": "© 2007–2008 Tobias Koenig",
-        "Copyright[fr]": "© 2007-2008 Tobias Koenig",
-        "Copyright[gl]": "© 2007-2008 Tobias Koenig",
-        "Copyright[he]": "© 2007‏-2008 טוביאס קוניג",
-        "Copyright[hu]": "© Tobias Koenig, 2007-2008.",
-        "Copyright[ia]": "© 2007-2008 Tobias Koenig",
-        "Copyright[ie]": "© 2007-2008 Tobias Koenig",
-        "Copyright[it]": "© 2007-2008 Tobias Koenig",
-        "Copyright[ka]": "© 2007-2008 Tobias Koenig",
-        "Copyright[ko]": "© 2007-2008 Tobias Koenig",
-        "Copyright[lt]": "© 2007-2008 Tobias Koenig",
-        "Copyright[lv]": "© 2007-2008 Tobias Koenig",
-        "Copyright[nl]": "© 2007-2008 Tobias Koenig",
-        "Copyright[nn]": "© 2007–2008 Tobias König",
-        "Copyright[pa]": "© 2007-2008 Tobias Koenig",
-        "Copyright[pl]": "© 2007-2008 Tobias Koenig",
-        "Copyright[pt]": "© 2007-2008 Tobias Koenig",
-        "Copyright[pt_BR]": "© 2007-2008 Tobias Koenig",
-        "Copyright[ro]": "© 2007-2008 Tobias Koenig",
-        "Copyright[ru]": "© Tobias König, 2007-2008",
-        "Copyright[sk]": "© 2007-2008 Tobias Koenig",
-        "Copyright[sl]": "© 2007-2008 Tobias Koenig",
-        "Copyright[sr at ijekavian]": "© 2007–2008, Тобијас Кениг",
-        "Copyright[sr at ijekavianlatin]": "© 2007–2008, Tobijas Kenig",
-        "Copyright[sr at latin]": "© 2007–2008, Tobijas Kenig",
-        "Copyright[sr]": "© 2007–2008, Тобијас Кениг",
-        "Copyright[sv]": "© 2007-2008 Tobias Koenig",
-        "Copyright[tr]": "© 2007-2008 Tobias Koenig",
-        "Copyright[uk]": "© Tobias Koenig, 2007–2008",
-        "Copyright[vi]": "© 2007-2008 Tobias Koenig",
-        "Copyright[x-test]": "xx© 2007-2008 Tobias Koenigxx",
-        "Copyright[zh_CN]": "© 2007-2008 Tobias Koenig",
-        "Copyright[zh_TW]": "© 2007-2008 Tobias Koenig",
-        "Description": "A renderer for Plucker eBooks",
-        "Description[ar]": "عارض كتب الإلكترونية Plucker",
-        "Description[az]": "Plucker eBooks üçün təsvirləmə",
-        "Description[be]": "Сродак візуалізацыі электронных кніг Plucker",
-        "Description[bg]": "Визуализатор на електронни книги на Plucker",
-        "Description[ca at valencia]": "Un renderitzador per a llibres electrònics Plucker",
-        "Description[ca]": "Un renderitzador per a llibres electrònics Plucker",
-        "Description[cs]": "Vykreslovač elektronických knih Plucker",
-        "Description[da]": "En gengiver til Plucker-e-bøger",
-        "Description[de]": "Ein Renderer für Plucker eBooks",
-        "Description[el]": "Πρόγραμμα αποτύπωσης για Plucker eBooks",
-        "Description[en_GB]": "A renderer for Plucker eBooks",
-        "Description[eo]": "Iganto por Plucker-eBooks",
-        "Description[es]": "Un visor de libros electrónicos Plucker",
-        "Description[et]": "Pluckeri e-raamatute renderdaja",
-        "Description[eu]": "Plucker eLiburuentzako errendatzaile bat",
-        "Description[fi]": "Plucker-e-kirjojen hahmonnin",
-        "Description[fr]": "Système de rendu pour les livres électroniques Plucker",
-        "Description[gl]": "Un visor de libros electrónicos Plucker.",
-        "Description[he]": "מעבד לספרים אלקטרוניים מסוג Plucker",
-        "Description[hu]": "Leképező Plucker e-könyvekhez",
-        "Description[ia]": "Un rendition pro eBooks (Libros electronic) de Plucker",
-        "Description[it]": "Un visualizzatore per eBook Plucker",
-        "Description[ka]": "Plucker eBooks-ის რენდერერი",
-        "Description[ko]": "Plucker 전자책 렌더러",
-        "Description[lt]": "Plucker elektroninių knygų atvaizdavimas",
-        "Description[lv]": "Plucker e-grāmatu atveidotājs",
-        "Description[nl]": "Een viewer voor Plucker eBooks",
-        "Description[nn]": "Ein gjengjevar for Plucker-e-bøker",
-        "Description[pl]": "Wyświetlanie e-booków Plucker",
-        "Description[pt]": "Um visualizador de eBooks do Plucker",
-        "Description[pt_BR]": "Um interpretador de eBooks Plucker",
-        "Description[ru]": "Модуль поддержки формата электронных книг Plucker",
-        "Description[sk]": "Vykresľovanie e-kníh Plucker",
-        "Description[sl]": "Izrisovalnik za e-knjige Plucker",
-        "Description[sr at ijekavian]": "Рендерер за Плакерове е‑књиге",
-        "Description[sr at ijekavianlatin]": "Renderer za Pluckerove e‑knjige",
-        "Description[sr at latin]": "Renderer za Pluckerove e‑knjige",
-        "Description[sr]": "Рендерер за Плакерове е‑књиге",
-        "Description[sv]": "Ett återgivningsprogram för Plucker e-böcker",
-        "Description[tr]": "Plucker e-kitapları için bir sunucu",
-        "Description[uk]": "Програма для відображення ел. книг Plucker",
-        "Description[vi]": "Một trình kết xuất cho các sách điện tử Plucker",
-        "Description[x-test]": "xxA renderer for Plucker eBooksxx",
-        "Description[zh_CN]": "Plucker 电子书渲染程序",
-        "Description[zh_TW]": "Plucker 電子書成像器",
-        "License": "GPL",
-        "MimeTypes": [
-            "application/prs.plucker"
-        ],
-        "Name": "Plucker Document Backend",
-        "Name[ar]": "خلفية مستندات Plucker",
-        "Name[az]": "Plucker sənədi modulu",
-        "Name[be]": "Рухавік дакументаў Plucker",
-        "Name[bg]": "Бекенд на Plucker Document",
-        "Name[ca at valencia]": "Dorsal de documents Plucker",
-        "Name[ca]": "Dorsal de documents Plucker",
-        "Name[cs]": "Podpůrná vrstva Plucker Dokumentu",
-        "Name[da]": "Plucker-dokument-backend",
-        "Name[de]": "Anzeigemodul für Plucker-Dokumente",
-        "Name[el]": "Σύστημα υποστήριξης εγγράφων Plucker",
-        "Name[en_GB]": "Plucker Document Backend",
-        "Name[eo]": "Plucker Dokument-Backend",
-        "Name[es]": "Motor para documento de Plucker",
-        "Name[et]": "Pluckeri dokumendi taustaprogramm",
-        "Name[eu]": "Plucker dokumentuen bizkarraldekoa",
-        "Name[fi]": "Plucker-tiedostotaustaosa",
-        "Name[fr]": "Moteur de document Plucker",
-        "Name[gl]": "Motor de documentos Plucker",
-        "Name[he]": "מנגנון מסמכי Plucker",
-        "Name[hu]": "Plucker dokument modul",
-        "Name[ia]": "Un retro-administration de documento Plucker",
-        "Name[ie]": "Infrastructura Plucker",
-        "Name[it]": "Backend per documenti Plucker",
-        "Name[ka]": "Plucker -ის დოკუმენტის უკანაბოლო",
-        "Name[ko]": "Plucker 문서 백엔드",
-        "Name[lt]": "Plucker dokumentų programinė sąsaja",
-        "Name[lv]": "Plucker Document aizmugursistēma",
-        "Name[nl]": "Plucker Document-backend",
-        "Name[nn]": "Plucker-dokumentmotor",
-        "Name[pl]": "Obsługa Plucker",
-        "Name[pt]": "Infra-Estrutura de Documentos do Plucker",
-        "Name[pt_BR]": "Infraestrutura de documentos Plucker",
-        "Name[ru]": "Модуль поддержки формата Plucker",
-        "Name[sk]": "Backend dokumentov Plucker",
-        "Name[sl]": "Zaledje za dokumente Plucker",
-        "Name[sr at ijekavian]": "Позадина за Плакерови документе",
-        "Name[sr at ijekavianlatin]": "Pozadina za Pluckerovi dokumente",
-        "Name[sr at latin]": "Pozadina za Pluckerovi dokumente",
-        "Name[sr]": "Позадина за Плакерови документе",
-        "Name[sv]": "Plucker-dokumentgränssnitt",
-        "Name[tr]": "Plucker Belgesi Arka Ucu",
-        "Name[uk]": "Модуль документів Plucker",
-        "Name[vi]": "Hậu phương tài liệu Plucker",
-        "Name[x-test]": "xxPlucker Document Backendxx",
-        "Name[zh_CN]": "Plucker 文档后端程序",
-        "Name[zh_TW]": "Pluker 文件後端介面",
-        "Version": "0.1.1"
-    },
-    "X-KDE-Priority": 1,
-    "X-KDE-okularAPIVersion": 1,
-    "X-KDE-okularHasInternalSettings": false
-}
diff --git a/generators/plucker/okularApplication_plucker.desktop b/generators/plucker/okularApplication_plucker.desktop
deleted file mode 100755
index 51f8f0a45a..0000000000
--- a/generators/plucker/okularApplication_plucker.desktop
+++ /dev/null
@@ -1,257 +0,0 @@
-[Desktop Entry]
-MimeType=application/prs.plucker;
-Terminal=false
-Name=Okular
-Name[ar]=اوكلار
-Name[az]=Okular
-Name[be]=Okular
-Name[bg]=Okular
-Name[bs]=Okular
-Name[ca]=Okular
-Name[ca at valencia]=Okular
-Name[cs]=Okular
-Name[da]=Okular
-Name[de]=Okular
-Name[el]=Okular
-Name[en_GB]=Okular
-Name[eo]=Okular
-Name[es]=Okular
-Name[et]=Okular
-Name[eu]=Okular
-Name[fi]=Okular
-Name[fr]=Okular
-Name[ga]=Okular
-Name[gl]=Okular
-Name[he]=Okular
-Name[hne]=ओकुलर
-Name[hr]=Okular
-Name[hu]=Okular
-Name[ia]=Okular
-Name[ie]=Okular
-Name[is]=Okular
-Name[it]=Okular
-Name[ja]=Okular
-Name[ka]=Okular
-Name[kk]=Okular
-Name[km]=Okular
-Name[ko]=Okular
-Name[ku]=Okular
-Name[lt]=Okular
-Name[lv]=Okular
-Name[mr]=ओक्युलर
-Name[nb]=Okular
-Name[nds]=Okular
-Name[nl]=Okular
-Name[nn]=Okular
-Name[pa]=ਓਕੁਲਾਰ
-Name[pl]=Okular
-Name[pt]=Okular
-Name[pt_BR]=Okular
-Name[ro]=Okular
-Name[ru]=Okular
-Name[si]=Okular
-Name[sk]=Okular
-Name[sl]=Okular
-Name[sq]=Okular
-Name[sr]=Окулар
-Name[sr at ijekavian]=Окулар
-Name[sr at ijekavianlatin]=Okular
-Name[sr at latin]=Okular
-Name[sv]=Okular
-Name[ta]=ஆக்குலர்
-Name[th]=โอกูลาร์
-Name[tr]=Okular
-Name[ug]=Okular
-Name[uk]=Okular
-Name[vi]=Okular
-Name[x-test]=xxOkularxx
-Name[zh_CN]=Okular 文档查看器
-Name[zh_TW]=Okular
-GenericName=Document Viewer
-GenericName[ar]=عارض المستندات
-GenericName[az]=Sənədə baxış vasitısi
-GenericName[be]=Сродак прагляду дакументаў
-GenericName[bg]=Преглед на документи
-GenericName[bs]=Prikazivač dokumenata
-GenericName[ca]=Visualitzador de documents
-GenericName[ca at valencia]=Visor de documents
-GenericName[cs]=Prohlížeč dokumentů
-GenericName[da]=Dokumentfremviser
-GenericName[de]=Dokumentenbetrachter
-GenericName[el]=Προβολέας εγγράφων
-GenericName[en_GB]=Document Viewer
-GenericName[eo]=Dokumenta rigardilo
-GenericName[es]=Visor de documentos
-GenericName[et]=Dokumendinäitaja
-GenericName[eu]=Dokumentu erakuslea
-GenericName[fa]=مشاهده‌گر سند
-GenericName[fi]=Asiakirjakatselin
-GenericName[fr]=Afficheur de documents
-GenericName[ga]=Amharcán Cáipéisí
-GenericName[gl]=Visor de documentos
-GenericName[he]=מציג מסמכים
-GenericName[hi]=दस्तावेज़ प्रदर्शक
-GenericName[hne]=कागद प्रदर्सक
-GenericName[hr]=Preglednik dokumenata
-GenericName[hu]=Dokumentummegjelenítő
-GenericName[ia]=Visor de documento
-GenericName[ie]=Visor de documentes
-GenericName[is]=Skjalaskoðari
-GenericName[it]=Visore di documenti
-GenericName[ja]=文書ビューア
-GenericName[ka]=დოკუმენტების მნახველი
-GenericName[kk]=Құжатты қарау құралы
-GenericName[km]=កម្មវិធី​មើល​ឯកសារ
-GenericName[ko]=문서 뷰어
-GenericName[ku]=Nîşanderê Belgeyan
-GenericName[lt]=Dokumentų žiūryklė
-GenericName[lv]=Dokumentu skatītājs
-GenericName[mr]=दस्तऐवज प्रदर्शक
-GenericName[nb]=Dokumentviser
-GenericName[nds]=Dokmentkieker
-GenericName[ne]=कागजात दर्शक
-GenericName[nl]=Documentenviewer
-GenericName[nn]=Dokumentvisar
-GenericName[oc]=Visualizaire de documents
-GenericName[pa]=ਡੌਕੂਮੈਂਟ ਦਰਸ਼ਕ
-GenericName[pl]=Przeglądarka dokumentów
-GenericName[pt]=Visualizador de Documentos
-GenericName[pt_BR]=Visualizador de documentos
-GenericName[ro]=Vizualizor de documente
-GenericName[ru]=Просмотр документов
-GenericName[sk]=Prehliadač dokumentov
-GenericName[sl]=Pregledovalnik dokumentov
-GenericName[sq]=Shikues dokumentesh
-GenericName[sr]=Приказивач докумената
-GenericName[sr at ijekavian]=Приказивач докумената
-GenericName[sr at ijekavianlatin]=Prikazivač dokumenata
-GenericName[sr at latin]=Prikazivač dokumenata
-GenericName[sv]=Dokumentvisare
-GenericName[ta]=ஆவணங் காட்டி
-GenericName[th]=เครื่องมือแสดงเอกสาร
-GenericName[tr]=Belge Görüntüleyicisi
-GenericName[ug]=پۈتۈك كۆرگۈ
-GenericName[uk]=Переглядач документів
-GenericName[vi]=Trình xem tài liệu
-GenericName[x-test]=xxDocument Viewerxx
-GenericName[zh_CN]=文档查看器
-GenericName[zh_TW]=文件檢視器
-Comment=Universal document viewer
-Comment[ar]=عارض المستندات عالمي
-Comment[az]=Sənədə universal baxış vasitəsi
-Comment[be]=Універсальны сродак прагляду дакументаў
-Comment[bg]=Универсална програма за преглед на документи
-Comment[ca]=Visualitzador universal de documents
-Comment[ca at valencia]=Visor universal de documents
-Comment[cs]=Univerzální prohlížeč dokumentů
-Comment[da]=Universel dokumentfremviser
-Comment[de]=Universeller Dokumentenbetrachter
-Comment[el]=Καθολικός προβολέας εγγράφων
-Comment[en_GB]=Universal document viewer
-Comment[eo]=Universala dokumenta spektilo
-Comment[es]=Visor de documentos universal
-Comment[et]=Universaalne dokumendinäitaja
-Comment[eu]=Dokumentu erakusle unibertsala
-Comment[fi]=Yleinen asiakirjakatselin
-Comment[fr]=Afficheur de document universel
-Comment[gl]=Visor de documentos universal.
-Comment[he]=מציג מסמכים אוניברסלי
-Comment[hu]=Univerzális dokumentummegjelenítő
-Comment[ia]=Visor de documento universal
-Comment[ie]=Universal visor de documentes
-Comment[is]=Fjölhæfur skjalaskoðari
-Comment[it]=Visore di documenti universale
-Comment[ka]=დოკუმენტების პოპულარული ფორმატების გამხსნელი
-Comment[ko]=만능 문서 뷰어
-Comment[lt]=Universali dokumentų žiūryklė
-Comment[lv]=Universāls dokumentu skatītājs
-Comment[nl]=Universele documentviewer
-Comment[nn]=Dokumentvisar for mange format
-Comment[pa]=ਯੂਨੀਵਰਸਲ ਡੌਕੂਮੈਂਟ ਦਰਸ਼ਕ
-Comment[pl]=Wszechstronna przeglądarka dokumentów
-Comment[pt]=Visualizador de documentos universal
-Comment[pt_BR]=Visualizador de documentos universal
-Comment[ro]=Vizualizor de documente universal
-Comment[ru]=Универсальная программа просмотра документов
-Comment[sk]=Univerzálny prehliadač dokumentov
-Comment[sl]=Vsestranski pregledovalnik dokumentov
-Comment[sq]=Shikues univerzal dokumentesh
-Comment[sr]=Универзални приказивач докумената
-Comment[sr at ijekavian]=Универзални приказивач докумената
-Comment[sr at ijekavianlatin]=Univerzalni prikazivač dokumenata
-Comment[sr at latin]=Univerzalni prikazivač dokumenata
-Comment[sv]=Generell dokumentvisare
-Comment[ta]=அனைத்து ஆவணங்களுக்கான காட்டி
-Comment[tr]=Çok amaçlı belge görüntüleyicisi
-Comment[uk]=Універсальний переглядач документів
-Comment[vi]=Trình xem tài liệu vạn năng
-Comment[x-test]=xxUniversal document viewerxx
-Comment[zh_CN]=通用文档查看器
-Comment[zh_TW]=通用文件檢視器
-Exec=okular %U
-Icon=okular
-Type=Application
-InitialPreference=7
-Categories=Qt;KDE;Graphics;Viewer;
-NoDisplay=true
-X-KDE-Keywords=plucker
-X-KDE-Keywords[ar]=plucker
-X-KDE-Keywords[az]=plucker
-X-KDE-Keywords[be]=plucker
-X-KDE-Keywords[bg]=plucker
-X-KDE-Keywords[bs]=plucker
-X-KDE-Keywords[ca]=plucker
-X-KDE-Keywords[ca at valencia]=plucker
-X-KDE-Keywords[cs]=plucker
-X-KDE-Keywords[da]=plucker
-X-KDE-Keywords[de]=plucker
-X-KDE-Keywords[el]=plucker
-X-KDE-Keywords[en_GB]=plucker
-X-KDE-Keywords[eo]=plucker
-X-KDE-Keywords[es]=plucker
-X-KDE-Keywords[et]=plucker
-X-KDE-Keywords[eu]=plucker
-X-KDE-Keywords[fi]=plucker
-X-KDE-Keywords[fr]=plucker
-X-KDE-Keywords[ga]=plucker
-X-KDE-Keywords[gl]=plucker
-X-KDE-Keywords[he]=plucker
-X-KDE-Keywords[hu]=plucker
-X-KDE-Keywords[ia]=plucker
-X-KDE-Keywords[ie]=plucker
-X-KDE-Keywords[is]=plucker
-X-KDE-Keywords[it]=plucker
-X-KDE-Keywords[ja]=plucker
-X-KDE-Keywords[ka]=plucker
-X-KDE-Keywords[kk]=plucker
-X-KDE-Keywords[km]=plucker
-X-KDE-Keywords[ko]=plucker
-X-KDE-Keywords[lt]=plucker
-X-KDE-Keywords[lv]=plucker
-X-KDE-Keywords[mr]=प्लकर
-X-KDE-Keywords[nb]=plucker
-X-KDE-Keywords[nds]=Plucker
-X-KDE-Keywords[nl]=plucker
-X-KDE-Keywords[nn]=plucker
-X-KDE-Keywords[pa]=ਪਲੱਕਰ
-X-KDE-Keywords[pl]=plucker
-X-KDE-Keywords[pt]=plucker
-X-KDE-Keywords[pt_BR]=plucker
-X-KDE-Keywords[ro]=plucker
-X-KDE-Keywords[ru]=plucker
-X-KDE-Keywords[sk]=plucker
-X-KDE-Keywords[sl]=plucker
-X-KDE-Keywords[sq]=plucker
-X-KDE-Keywords[sr]=plucker,Плакер
-X-KDE-Keywords[sr at ijekavian]=plucker,Плакер
-X-KDE-Keywords[sr at ijekavianlatin]=plucker,Plucker
-X-KDE-Keywords[sr at latin]=plucker,Plucker
-X-KDE-Keywords[sv]=plucker
-X-KDE-Keywords[ta]=plucker
-X-KDE-Keywords[tr]=plucker
-X-KDE-Keywords[uk]=plucker
-X-KDE-Keywords[vi]=plucker
-X-KDE-Keywords[x-test]=xxpluckerxx
-X-KDE-Keywords[zh_CN]=plucker
-X-KDE-Keywords[zh_TW]=plucker
-X-KDE-AliasFor=org.kde.okular.desktop
diff --git a/generators/plucker/org.kde.mobile.okular_plucker.desktop b/generators/plucker/org.kde.mobile.okular_plucker.desktop
deleted file mode 100644
index 42b3d7319e..0000000000
--- a/generators/plucker/org.kde.mobile.okular_plucker.desktop
+++ /dev/null
@@ -1,250 +0,0 @@
-[Desktop Entry]
-MimeType=application/prs.plucker;
-Name=Reader
-Name[ar]=التصيير
-Name[az]=Oxuyucu
-Name[be]=Сродак чытання
-Name[bg]=Четец
-Name[bs]=Čitač
-Name[ca]=Lector
-Name[ca at valencia]=Lector
-Name[cs]=Čtečka
-Name[da]=Læser
-Name[de]=Lesegerät
-Name[el]=Πρόγραμμα ανάγνωσης
-Name[en_GB]=Reader
-Name[eo]=Legilo
-Name[es]=Lector
-Name[et]=Lugeja
-Name[eu]=Irakurlea
-Name[fi]=Lukija
-Name[fr]=Lecteur
-Name[ga]=Léitheoir
-Name[gl]=Lector
-Name[he]=קורא
-Name[hu]=Olvasó
-Name[ia]=Lector
-Name[ie]=Letor
-Name[is]=Lesari
-Name[it]=Lettore
-Name[ka]=მკითხველი
-Name[kk]=Оқу құралы
-Name[ko]=리더
-Name[lt]=Skaitytuvas
-Name[lv]=Lasītājs
-Name[mr]=वाचक
-Name[nb]=Leser
-Name[nds]=Leser
-Name[nl]=Lezer
-Name[nn]=Lesar
-Name[pa]=ਰੀਡਰ
-Name[pl]=Czytnik
-Name[pt]=Leitor
-Name[pt_BR]=Leitor
-Name[ro]=Cititor
-Name[ru]=Просмотрщик
-Name[sk]=Čítačka
-Name[sl]=Bralnik
-Name[sq]=Reader
-Name[sr]=Читач
-Name[sr at ijekavian]=Читач
-Name[sr at ijekavianlatin]=Čitač
-Name[sr at latin]=Čitač
-Name[sv]=Läsprogram
-Name[ta]=காட்டி
-Name[tr]=Okuyucu
-Name[ug]=ئوقۇغۇ
-Name[uk]=Переглядач
-Name[vi]=Trình đọc
-Name[x-test]=xxReaderxx
-Name[zh_CN]=阅读器
-Name[zh_TW]=閱讀器
-GenericName=Document viewer
-GenericName[ar]=عارض المستندات
-GenericName[az]=Sənədə baxış vasitısi
-GenericName[be]=Сродак прагляду дакументаў
-GenericName[bg]=Преглед на документи
-GenericName[bs]=Prikazivač dokumenata
-GenericName[ca]=Visualitzador de documents
-GenericName[ca at valencia]=Visor de documents
-GenericName[cs]=Prohlížeč dokumentů
-GenericName[da]=Dokumentfremviser
-GenericName[de]=Dokumentenbetrachter
-GenericName[el]=Προβολέας εγγράφων
-GenericName[en_GB]=Document Viewer
-GenericName[eo]=Dokumentrigardilo
-GenericName[es]=Visor de documentos
-GenericName[et]=Dokumendinäitaja
-GenericName[eu]=Dokumentu erakuslea
-GenericName[fi]=Asiakirjakatselin
-GenericName[fr]=Afficheur de document
-GenericName[ga]=Amharcán cáipéisí
-GenericName[gl]=Visor de documentos
-GenericName[he]=מציג מסמכים
-GenericName[hi]=दस्तावेज़ प्रदर्शक
-GenericName[hu]=Dokumentummegjelenítő
-GenericName[ia]=Visor de documento
-GenericName[ie]=Visor de documentes
-GenericName[is]=Skjalaskoðari
-GenericName[it]=Visore di documenti
-GenericName[ja]=文書ビューア
-GenericName[ka]=დოკუმენტების მნახველი
-GenericName[kk]=Құжатты қарау құралы
-GenericName[ko]=문서 뷰어
-GenericName[lt]=Dokumentų žiūryklė
-GenericName[lv]=Dokumentu skatītājs
-GenericName[mr]=दस्तऐवज प्रदर्शक
-GenericName[nb]=Dokumentviser
-GenericName[nds]=Dokmentkieker
-GenericName[nl]=Documentenviewer
-GenericName[nn]=Dokumentvisar
-GenericName[pa]=ਡੌਕੂਮੈਂਟ ਦਰਸ਼ਕ
-GenericName[pl]=Przeglądarka dokumentów
-GenericName[pt]=Visualizador de documentos
-GenericName[pt_BR]=Visualizador de documentos
-GenericName[ro]=Vizualizor de documente
-GenericName[ru]=Просмотр документов
-GenericName[sk]=Prehliadač dokumentov
-GenericName[sl]=Pregledovalnik dokumentov
-GenericName[sq]=Shikues dokumentesh
-GenericName[sr]=Приказивач докумената
-GenericName[sr at ijekavian]=Приказивач докумената
-GenericName[sr at ijekavianlatin]=Prikazivač dokumenata
-GenericName[sr at latin]=Prikazivač dokumenata
-GenericName[sv]=Dokumentvisare
-GenericName[ta]=ஆவணங் காட்டி
-GenericName[tr]=Belge görüntüleyicisi
-GenericName[uk]=Переглядач документів
-GenericName[vi]=Trình xem tài liệu
-GenericName[x-test]=xxDocument viewerxx
-GenericName[zh_CN]=文档查看器
-GenericName[zh_TW]=文件檢視器
-Comment=Viewer for various types of documents
-Comment[ar]=عارض للعديد من أنواع المستندات
-Comment[az]=Müxtəlif növlü sənədlər üçün görüntüləyici
-Comment[be]=Сродак прагляду разнастайных тыпаў дакументаў
-Comment[bg]=Преглед на различни видове документи
-Comment[bs]=Pregledač raznih vrsta dokumenata
-Comment[ca]=Visualitzador de diversos tipus de documents
-Comment[ca at valencia]=Visor de diversos tipus de documents
-Comment[cs]=Prohlížeč různých typů dokumentů
-Comment[da]=Fremviser af diverse dokumenttyper
-Comment[de]=Betrachter für verschiedene Arten von Dokumenten
-Comment[el]=Πρόγραμμα προβολής για διάφορους τύπους εγγράφων
-Comment[en_GB]=Viewer for various types of documents
-Comment[eo]=Vidilo por diversaj specoj de dokumentoj
-Comment[es]=Visor de diversos tipos de documentos
-Comment[et]=Eri tüüpi dokumentide näitaja
-Comment[eu]=Hainbat dokumentu moten erakuslea
-Comment[fi]=Monenlaisten asiakirjojen katseluohjelma
-Comment[fr]=Afficheur pour différents types de documents
-Comment[ga]=Amharcán le haghaidh cáipéisí éagsúla
-Comment[gl]=Visor de varios tipos de documentos.
-Comment[he]=מציג למגוון סוגי מסמכים
-Comment[hu]=Megjelenítő különféle típusú dokumentumokhoz
-Comment[ia]=Visor pro varie typos de documento
-Comment[ie]=Visor por varie tipes de documentes
-Comment[is]=Skoðari fyrir ýmsar gerðir skjala
-Comment[it]=Visore per vari tipi di documenti
-Comment[ka]=სხვადასხვა ტიპების დოკუმენტების დათვალიერება
-Comment[kk]=Түрлі құжаттар қарау құралы
-Comment[ko]=여러 형식의 문서 뷰어
-Comment[lt]=Žiūryklė įvairiems dokumentų tipams
-Comment[lv]=Dažādu dokumentu tipu skatītājs
-Comment[mr]=विविध प्रकारच्या दस्तऐवजांचा प्रदर्शक
-Comment[nb]=Framviser for forskjellige dokumenttyper
-Comment[nds]=Kieker för en Reeg Dokmenttypen
-Comment[nl]=Viewer voor verschillende typen documenten
-Comment[nn]=Framvisar for forskjellige dokumenttypar
-Comment[pa]=ਕਈ ਕਿਸਮ ਦੇ ਡੌਕੂਮੈਂਟ ਵੇਖਾਉਣ ਲਈ ਦਰਸ਼ਕ
-Comment[pl]=Przeglądarka dla różnych typów dokumentów
-Comment[pt]=Visualizador de vários tipos de documentos
-Comment[pt_BR]=Visualizador para vários tipos de documentos
-Comment[ro]=Vizualizor pentru diferite tipuri de documente
-Comment[ru]=Программа для просмотра различных типов документов
-Comment[sk]=Prehliadač pre rôzne typy dokumentov
-Comment[sl]=Pregledovalnik raznih vrst dokumentov
-Comment[sq]=Shikues për lloje të ndryshme të dokumentave
-Comment[sr]=Приказивач различитих врста докумената
-Comment[sr at ijekavian]=Приказивач различитих врста докумената
-Comment[sr at ijekavianlatin]=Prikazivač različitih vrsta dokumenata
-Comment[sr at latin]=Prikazivač različitih vrsta dokumenata
-Comment[sv]=Visningsprogram för diverse typer av dokument
-Comment[ta]=பலவகையான ஆவணங்களுக்கான காட்டி
-Comment[tr]=Çeşitli belge türleri için görüntüleyici
-Comment[ug]=ھەر خىل تىپتىكى پۈتۈكلەرنى كۆرىدىغان پروگرامما
-Comment[uk]=Програма для перегляду документів різних типів
-Comment[vi]=Trình xem các kiểu tài liệu khác nhau
-Comment[x-test]=xxViewer for various types of documentsxx
-Comment[zh_CN]=支持查看多种文档类型
-Comment[zh_TW]=多種型態文件的檢視器
-
-TryExec=okularkirigami
-Exec=okularkirigami %u
-Terminal=false
-Icon=okular
-Type=Application
-Categories=Qt;KDE;Graphics;Office;Viewer;
-InitialPreference=2
-NoDisplay=true
-X-KDE-Keywords=plucker
-X-KDE-Keywords[ar]=plucker
-X-KDE-Keywords[az]=plucker
-X-KDE-Keywords[be]=plucker
-X-KDE-Keywords[bg]=plucker
-X-KDE-Keywords[bs]=plucker
-X-KDE-Keywords[ca]=plucker
-X-KDE-Keywords[ca at valencia]=plucker
-X-KDE-Keywords[cs]=plucker
-X-KDE-Keywords[da]=plucker
-X-KDE-Keywords[de]=plucker
-X-KDE-Keywords[el]=plucker
-X-KDE-Keywords[en_GB]=plucker
-X-KDE-Keywords[eo]=plucker
-X-KDE-Keywords[es]=plucker
-X-KDE-Keywords[et]=plucker
-X-KDE-Keywords[eu]=plucker
-X-KDE-Keywords[fi]=plucker
-X-KDE-Keywords[fr]=plucker
-X-KDE-Keywords[ga]=plucker
-X-KDE-Keywords[gl]=plucker
-X-KDE-Keywords[he]=plucker
-X-KDE-Keywords[hu]=plucker
-X-KDE-Keywords[ia]=plucker
-X-KDE-Keywords[ie]=plucker
-X-KDE-Keywords[is]=plucker
-X-KDE-Keywords[it]=plucker
-X-KDE-Keywords[ja]=plucker
-X-KDE-Keywords[ka]=plucker
-X-KDE-Keywords[kk]=plucker
-X-KDE-Keywords[km]=plucker
-X-KDE-Keywords[ko]=plucker
-X-KDE-Keywords[lt]=plucker
-X-KDE-Keywords[lv]=plucker
-X-KDE-Keywords[mr]=प्लकर
-X-KDE-Keywords[nb]=plucker
-X-KDE-Keywords[nds]=Plucker
-X-KDE-Keywords[nl]=plucker
-X-KDE-Keywords[nn]=plucker
-X-KDE-Keywords[pa]=ਪਲੱਕਰ
-X-KDE-Keywords[pl]=plucker
-X-KDE-Keywords[pt]=plucker
-X-KDE-Keywords[pt_BR]=plucker
-X-KDE-Keywords[ro]=plucker
-X-KDE-Keywords[ru]=plucker
-X-KDE-Keywords[sk]=plucker
-X-KDE-Keywords[sl]=plucker
-X-KDE-Keywords[sq]=plucker
-X-KDE-Keywords[sr]=plucker,Плакер
-X-KDE-Keywords[sr at ijekavian]=plucker,Плакер
-X-KDE-Keywords[sr at ijekavianlatin]=plucker,Plucker
-X-KDE-Keywords[sr at latin]=plucker,Plucker
-X-KDE-Keywords[sv]=plucker
-X-KDE-Keywords[ta]=plucker
-X-KDE-Keywords[tr]=plucker
-X-KDE-Keywords[uk]=plucker
-X-KDE-Keywords[vi]=plucker
-X-KDE-Keywords[x-test]=xxpluckerxx
-X-KDE-Keywords[zh_CN]=plucker
-X-KDE-Keywords[zh_TW]=plucker
-X-KDE-AliasFor=org.kde.okular.kirigami.desktop
diff --git a/generators/plucker/org.kde.okular-plucker.metainfo.xml b/generators/plucker/org.kde.okular-plucker.metainfo.xml
deleted file mode 100644
index 5c9552aa06..0000000000
--- a/generators/plucker/org.kde.okular-plucker.metainfo.xml
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<component type="addon">
-  <id>org.kde.okular-plucker</id>
-  <extends>org.kde.okular.desktop</extends>
-  <metadata_license>CC0-1.0</metadata_license>
-  <project_license>GPL-2.0+ and GFDL-1.3</project_license>
-  <name>Plucker</name>
-  <name xml:lang="ar">Plucker</name>
-  <name xml:lang="az">Plucker</name>
-  <name xml:lang="be">Plucker</name>
-  <name xml:lang="bg">Plucker</name>
-  <name xml:lang="ca">Plucker</name>
-  <name xml:lang="ca-valencia">Plucker</name>
-  <name xml:lang="cs">Plucker</name>
-  <name xml:lang="de">Plucker</name>
-  <name xml:lang="el">Plucker</name>
-  <name xml:lang="en-GB">Plucker</name>
-  <name xml:lang="eo">Plucker</name>
-  <name xml:lang="es">Plucker</name>
-  <name xml:lang="et">Plucker</name>
-  <name xml:lang="eu">Plucker</name>
-  <name xml:lang="fi">Plucker</name>
-  <name xml:lang="fr">Plucker</name>
-  <name xml:lang="gl">Plucker</name>
-  <name xml:lang="he">Plucker</name>
-  <name xml:lang="hi">प्लकर</name>
-  <name xml:lang="hu">Plucker</name>
-  <name xml:lang="ia">Plucker</name>
-  <name xml:lang="it">Plucker</name>
-  <name xml:lang="ka">Plucker</name>
-  <name xml:lang="ko">plucker</name>
-  <name xml:lang="lt">Plucker</name>
-  <name xml:lang="lv">Plucker</name>
-  <name xml:lang="ml">പ്ലക്കർ</name>
-  <name xml:lang="nl">Plucker</name>
-  <name xml:lang="nn">Plucker</name>
-  <name xml:lang="pl">Plucker</name>
-  <name xml:lang="pt">Plucker</name>
-  <name xml:lang="pt-BR">Plucker</name>
-  <name xml:lang="ro">Plucker</name>
-  <name xml:lang="ru">Plucker</name>
-  <name xml:lang="sk">Plucker</name>
-  <name xml:lang="sl">Plucker</name>
-  <name xml:lang="sr">Плакер</name>
-  <name xml:lang="sr-Latn">Plucker</name>
-  <name xml:lang="sr-ijekavian">Плакер</name>
-  <name xml:lang="sr-ijekavianlatin">Plucker</name>
-  <name xml:lang="sv">Plucker</name>
-  <name xml:lang="ta">Plucker</name>
-  <name xml:lang="tr">Plucker</name>
-  <name xml:lang="uk">Plucker</name>
-  <name xml:lang="vi">Plucker</name>
-  <name xml:lang="x-test">xxPluckerxx</name>
-  <name xml:lang="zh-CN">Plucker</name>
-  <name xml:lang="zh-TW">Plucker</name>
-  <summary>Adds support for reading Plucker documents</summary>
-  <summary xml:lang="ar">يضيف دعم لقراءة مستندات Plucker</summary>
-  <summary xml:lang="az">Plucker sənədlərini oxumaq üçün dəstək əlavə edir</summary>
-  <summary xml:lang="be">Падтрымка чытання дакументаў Plucker</summary>
-  <summary xml:lang="bg">Добавя поддръжка за четене на Plucker документи</summary>
-  <summary xml:lang="ca">Afegeix la implementació per a llegir documents Plucker</summary>
-  <summary xml:lang="ca-valencia">Afig la implementació per a llegir documents Plucker</summary>
-  <summary xml:lang="cs">Přidává podporu pro čtení dokumentů Plucker</summary>
-  <summary xml:lang="de">Bietet Unterstützung zum Lesen von Plucker-Dokumenten</summary>
-  <summary xml:lang="el">Προσθέτει υποστήριξη για την ανάγνωση εγγράφων Plucker</summary>
-  <summary xml:lang="en-GB">Adds support for reading Plucker documents</summary>
-  <summary xml:lang="eo">Aldonas subtenon por legi Plucker-dokumentojn</summary>
-  <summary xml:lang="es">Permite la lectura de documentos en formato Plucker</summary>
-  <summary xml:lang="et">Pluckeri dokumentide lugemise toetus</summary>
-  <summary xml:lang="eu">Plucker dokumentuak irakurtzeko euskarria gehitzen du</summary>
-  <summary xml:lang="fi">Lisää Plucker-tiedostojen lukutuen</summary>
-  <summary xml:lang="fr">Permet la lecture des documents Plucker</summary>
-  <summary xml:lang="gl">Engade a posibilidade de ler documentos de Plucker.</summary>
-  <summary xml:lang="he">מוסיף תמיכה בקריאת מסמכי Plucker</summary>
-  <summary xml:lang="hi">प्लकर दस्तावेज़ पढ़ने के लिए समर्थन जोड़ता है</summary>
-  <summary xml:lang="hu">Támogatás Plucker dokumentumok olvasásához</summary>
-  <summary xml:lang="ia">Adde supporto per leger documentos Plucker</summary>
-  <summary xml:lang="it">Aggiunge il supporto per la lettura di documenti Plucker</summary>
-  <summary xml:lang="ka">Plucker-ის დოკუმენტების კითხვის მხარდაჭერის დამატება</summary>
-  <summary xml:lang="ko">Plucker 문서 읽기 지원 추가</summary>
-  <summary xml:lang="lt">Prideda palaikymą Plucker dokumentų skaitymui</summary>
-  <summary xml:lang="lv">Pievieno atbalstu „Plucker“ dokumentu lasīšanai</summary>
-  <summary xml:lang="ml">പ്ലക്കർ പ്രമാണങ്ങൾ വായിക്കാൻ പിന്തുണ ചേർക്കുന്നു</summary>
-  <summary xml:lang="nl">Voegt ondersteuning voor lezen van Plucker-documenten toe</summary>
-  <summary xml:lang="nn">Legg til støtte for å lesa Plucker-dokument</summary>
-  <summary xml:lang="pl">Dodaje obsługę dokumentów Plucker</summary>
-  <summary xml:lang="pt">Adiciona o suporte para ler documentos do Plucker</summary>
-  <summary xml:lang="pt-BR">Adiciona o suporte para leitura de documentos do Plucker</summary>
-  <summary xml:lang="ro">Adaugă suport pentru citirea documentelor Plucker</summary>
-  <summary xml:lang="ru">Поддержка чтения документов Plucker</summary>
-  <summary xml:lang="sk">Pridá podporu pre čítanie dokumentov Plucker</summary>
-  <summary xml:lang="sl">Doda podporo za branje dokumentov Plucker</summary>
-  <summary xml:lang="sr">Подршка за читање плакер докумената</summary>
-  <summary xml:lang="sr-Latn">Podrška za čitanje Plucker dokumenata</summary>
-  <summary xml:lang="sr-ijekavian">Подршка за читање плакер докумената</summary>
-  <summary xml:lang="sr-ijekavianlatin">Podrška za čitanje Plucker dokumenata</summary>
-  <summary xml:lang="sv">Lägger till stöd för att läsa Plucker-dokument</summary>
-  <summary xml:lang="ta">Plucker ஆவணங்களைப் படிப்பதற்கான ஆதரவை சேர்க்கும்</summary>
-  <summary xml:lang="tr">Plucker belgelerini okuma desteği ekler</summary>
-  <summary xml:lang="uk">Додає підтримку читання документів Plucker</summary>
-  <summary xml:lang="vi">Thêm hỗ trợ đọc tài liệu Plucker</summary>
-  <summary xml:lang="x-test">xxAdds support for reading Plucker documentsxx</summary>
-  <summary xml:lang="zh-CN">增加对 Plucker 文档的阅读支持</summary>
-  <summary xml:lang="zh-TW">加入讀取 Plucker 文件的支援</summary>
-  <provides>
-    <mediatype>application/prs.plucker</mediatype>
-  </provides>
-  <url type="homepage">https://okular.kde.org</url>
-  <releases>
-    <release version="23.08.4" date="2023-12-07"/>
-    <release version="23.08.3" date="2023-11-09"/>
-    <release version="23.08.2" date="2023-10-12"/>
-    <release version="23.08.1" date="2023-09-14"/>
-  </releases>
-</component>
diff --git a/generators/plucker/unpluck/config.cpp b/generators/plucker/unpluck/config.cpp
deleted file mode 100644
index 7b9065b46f..0000000000
--- a/generators/plucker/unpluck/config.cpp
+++ /dev/null
@@ -1,342 +0,0 @@
-/* -*- mode: c; indent-tabs-mode: nil; -*-
-    $Id: config.c,v 1.3 2003/12/28 20:59:21 chrish Exp $
-
-    config -- read and parse the Plucker config files
-    SPDX-FileCopyrightText: 2002 Bill Janssen
-
-    SPDX-License-Identifier: GPL-2.0-or-later
-
-*/
-
-#if !defined(WIN32)
-#include <unistd.h> /* for lseek, etc. */
-#else
-#include <io.h>
-#endif
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <assert.h>   /* for assert() */
-#include <errno.h>    /* for errno */
-#include <fcntl.h>    /* for O_RDONLY */
-#include <string.h>   /* for strndup() */
-#include <sys/stat.h> /* for fstat() */
-#include <sys/types.h>
-
-#include "unpluck.h"
-#include "unpluckint.h"
-
-#define STRINGIFY(s) STRINGIFY2(s)
-#define STRINGIFY2(s) #s
-
-#define MAX_LINE_SIZE 1023
-
-#define COMMENT_CHARS "#;"
-#define SEGMENT_LEAD_CHAR '['
-#define SEGMENT_END_CHAR ']'
-#define OPTION_SEPARATOR_CHARS "=:"
-
-HashTable *SectionsTable = nullptr;
-
-static HashTable *GetOrCreateSegment(const char *name)
-{
-    HashTable *target;
-
-    if (SectionsTable == nullptr) {
-        SectionsTable = _plkr_NewHashTable(23);
-    }
-
-    if ((target = (HashTable *)_plkr_FindInTable(SectionsTable, name)) == nullptr) {
-        target = _plkr_NewHashTable(53);
-        _plkr_AddToTable(SectionsTable, name, target);
-    }
-
-    return target;
-}
-
-static int ReadConfigFile(const char *filename)
-{
-    HashTable *current_segment = nullptr;
-    FILE *fp = fopen(filename, "r");
-    char *ptr;
-    char *str_end;
-    char *str_begin;
-    char *charptr;
-    char *current_option;
-    char *option_value;
-    char linebuf[MAX_LINE_SIZE + 1];
-    int linelen;
-    int len2;
-    int buf_index;
-    int status;
-    int line_number;
-
-    if (fp == nullptr) {
-        _plkr_message("Can't open config file %s", filename);
-        return 0;
-    }
-
-    current_segment = GetOrCreateSegment("default");
-    current_option = nullptr;
-
-    status = 1; /* optimistic */
-    line_number = 0;
-
-    while (true) {
-        ptr = fgets(linebuf, sizeof(linebuf) - 1, fp);
-        if (ptr == nullptr) {
-            break;
-        }
-
-        line_number += 1;
-        linebuf[strlen(linebuf) - 1] = 0; /* strip newline */
-        if (linebuf[strlen(linebuf) - 1] == '\r') {
-            linebuf[strlen(linebuf) - 1] = 0; /* strip carriage return */
-        }
-
-        /* fprintf (stderr, "%s:%d:  line is '%s'\n", filename, line_number, linebuf); */
-
-        linelen = strlen(linebuf);
-        for (buf_index = 0; linebuf[buf_index] != 0; buf_index++) {
-            if (!isspace(linebuf[buf_index])) {
-                break;
-            }
-        }
-
-        if (linebuf[buf_index] == 0) {
-            /* blank line */
-            continue;
-        }
-
-        if ((strchr(COMMENT_CHARS, linebuf[0]) != nullptr) || (strncmp(linebuf, "rem", 3) == 0) || (strncmp(linebuf, "REM", 3) == 0)) {
-            /* comment */
-            continue;
-        }
-
-        /* At this point we have a valid thing */
-
-        if (linebuf[buf_index] == SEGMENT_LEAD_CHAR) {
-            if ((str_end = strchr(linebuf + buf_index + 1, SEGMENT_END_CHAR)) == nullptr) {
-                /* invalid segment line */
-                _plkr_message("%s:%d:  Invalid segment line '%s'", filename, line_number, linebuf);
-                goto error_exit;
-            }
-            str_begin = linebuf + buf_index + 1;
-            for (charptr = str_begin; charptr < str_end; charptr++) {
-                *charptr = tolower(*charptr);
-            }
-            *str_end = 0;
-            current_segment = GetOrCreateSegment(str_begin);
-            /* fprintf (stderr, "Current segment is now %p (%s)\n", current_segment, str_begin); */
-            if (current_option) {
-                free(current_option);
-            }
-            current_option = nullptr;
-
-        } else if ((linebuf[0] == ' ' || linebuf[0] == '\t') && current_option != nullptr) {
-            /* continuation line */
-            str_begin = (char *)_plkr_RemoveFromTable(current_segment, current_option);
-            for (str_end = linebuf + strlen(linebuf) - 1; str_end > linebuf && isspace(*str_end); str_end--) {
-                ;
-            }
-            charptr = (char *)malloc(strlen(str_begin) + (str_end - (linebuf + buf_index)) + 2);
-            strcpy(charptr, str_begin);
-            len2 = strlen(charptr);
-            charptr[len2] = '\n';
-            strncpy(charptr + len2 + 1, linebuf + buf_index, str_end - (linebuf + buf_index));
-            charptr[len2 + (str_end - (linebuf + buf_index)) + 1] = '\0';
-            _plkr_AddToTable(current_segment, current_option, charptr);
-            free(str_begin);
-
-        } else if ((int)strcspn(linebuf, OPTION_SEPARATOR_CHARS) < linelen) {
-            /* possible option line */
-
-            for (str_begin = linebuf + buf_index, ptr = str_begin; isalnum(*ptr) || (*ptr == '.') || (*ptr == '_') || (*ptr == '-'); ptr++) {
-                ;
-            }
-            if (ptr == str_begin) {
-                _plkr_message("%s:%d:  Invalid option line '%s'", filename, line_number, linebuf);
-                goto error_exit;
-            }
-
-            for (charptr = str_begin; charptr < ptr; charptr++) {
-                *charptr = tolower(*charptr);
-            }
-            str_end = ptr;
-
-            while (isspace(*ptr) && (*ptr != '\0')) {
-                ptr++;
-            }
-
-            if (strchr(OPTION_SEPARATOR_CHARS, *ptr) != nullptr) {
-                ptr++;
-            } else {
-                _plkr_message("%s:%d:  Invalid option line '%s'", filename, line_number, linebuf);
-                goto error_exit;
-            }
-
-            while (isspace(*ptr) && (*ptr != '\0')) {
-                ptr++;
-            }
-
-            if (*ptr == 0) {
-                _plkr_message("%s:%d:  Invalid option line '%s'", filename, line_number, linebuf);
-                goto error_exit;
-            }
-
-            if (current_option) {
-                free(current_option);
-            }
-            current_option = _plkr_strndup(str_begin, str_end - str_begin);
-
-            option_value = _plkr_strndup(ptr, strlen(ptr));
-
-            ptr = (char *)_plkr_RemoveFromTable(current_segment, current_option);
-            if (ptr) {
-                free(ptr);
-            }
-            _plkr_AddToTable(current_segment, current_option, option_value);
-            /* fprintf (stderr, "Added value '%s' for option '%p:%s'\n", option_value, current_segment, current_option); */
-
-        } else {
-            _plkr_message("%s:%d:  Bad line '%s'", filename, line_number, linebuf);
-            goto error_exit;
-        }
-    }
-
-good_exit:
-
-    if (current_option) {
-        free(current_option);
-    }
-    fclose(fp);
-    return status;
-
-error_exit:
-    status = 0;
-    goto good_exit;
-}
-
-static void TryReadConfigFile(const char *dir, const char *name)
-{
-    char *filename;
-
-    if (dir == nullptr || name == nullptr) {
-        return;
-    }
-
-    filename = (char *)malloc(strlen(dir) + strlen(name) + 2);
-    strcpy(filename, dir);
-    strcpy(filename + strlen(filename), STRINGIFY(FILE_SEPARATOR_CHAR_S));
-    strcpy(filename + strlen(filename), name);
-    if (!ReadConfigFile(filename)) {
-        _plkr_message("Error reading config file %s", filename);
-    }
-    free(filename);
-}
-
-static void InitializeConfigInfo()
-{
-    const char *config_dir = STRINGIFY(PLUCKER_CONFIG_DIR);
-    const char *system_config_file_name = STRINGIFY(SYS_CONFIG_FILE_NAME);
-    const char *user_config_filename = STRINGIFY(USER_CONFIG_FILE_NAME);
-    char *home = getenv("HOME"); // clazy:exclude=raw-environment-function
-
-    TryReadConfigFile(config_dir, system_config_file_name);
-    if (home != nullptr) {
-        TryReadConfigFile(home, user_config_filename);
-    }
-}
-
-char *plkr_GetConfigString(const char *section_name, const char *option_name, char *default_value)
-{
-    char *value = nullptr;
-    HashTable *section;
-
-    if (SectionsTable == nullptr) {
-        InitializeConfigInfo();
-    }
-
-    if (SectionsTable == nullptr) {
-        return default_value;
-    }
-
-    if (section_name != nullptr) {
-        if ((section = (HashTable *)_plkr_FindInTable(SectionsTable, section_name)) != nullptr) {
-            value = (char *)_plkr_FindInTable(section, option_name);
-        }
-    }
-    if (value == nullptr && ((section_name == nullptr) || (strcmp(section_name, "default") != 0))) {
-        if ((section = (HashTable *)_plkr_FindInTable(SectionsTable, STRINGIFY(OS_SECTION_NAME))) != nullptr) {
-            value = (char *)_plkr_FindInTable(section, option_name);
-        }
-    }
-    if (value == nullptr && ((section_name == nullptr) || (strcmp(section_name, "default") != 0))) {
-        if ((section = (HashTable *)_plkr_FindInTable(SectionsTable, "default")) != nullptr) {
-            value = (char *)_plkr_FindInTable(section, option_name);
-        }
-    }
-
-    return ((value == nullptr) ? default_value : value);
-}
-
-long int plkr_GetConfigInt(const char *section_name, const char *option_name, long int default_value)
-{
-    char *svalue = plkr_GetConfigString(section_name, option_name, nullptr);
-    char *endptr;
-    long int value;
-
-    if (svalue == nullptr) {
-        return default_value;
-    }
-
-    value = strtol(svalue, &endptr, 0);
-    if (*endptr != 0) {
-        _plkr_message("Bad int value string '%s' for option %s:%s", svalue, (section_name ? section_name : "default"), option_name);
-        return default_value;
-    } else {
-        return value;
-    }
-}
-
-double plkr_GetConfigFloat(const char *section_name, const char *option_name, double default_value)
-{
-    char *svalue = plkr_GetConfigString(section_name, option_name, nullptr);
-    char *endptr;
-    double value;
-
-    if (svalue == nullptr) {
-        return default_value;
-    }
-
-    value = strtod(svalue, &endptr);
-    if (*endptr != 0) {
-        _plkr_message("Bad float value string '%s' for option %s:%s", svalue, (section_name ? section_name : "default"), option_name);
-        return default_value;
-    } else {
-        return value;
-    }
-}
-
-int plkr_GetConfigBoolean(const char *section_name, const char *option_name, int default_value)
-{
-    char *svalue = plkr_GetConfigString(section_name, option_name, nullptr);
-
-    if (svalue == nullptr) {
-        return default_value;
-    }
-
-    if ((strcmp(svalue, "1") == 0) || (strcmp(svalue, "true") == 0) || (strcmp(svalue, "TRUE") == 0) || (strcmp(svalue, "on") == 0) || (strcmp(svalue, "ON") == 0) || (strcmp(svalue, "t") == 0) || (strcmp(svalue, "T") == 0) ||
-        (strcmp(svalue, "True") == 0)) {
-        return 1;
-
-    } else if ((strcmp(svalue, "0") == 0) || (strcmp(svalue, "false") == 0) || (strcmp(svalue, "FALSE") == 0) || (strcmp(svalue, "off") == 0) || (strcmp(svalue, "OFF") == 0) || (strcmp(svalue, "F") == 0) || (strcmp(svalue, "f") == 0) ||
-               (strcmp(svalue, "False") == 0)) {
-        return 0;
-
-    } else {
-        _plkr_message("Bad boolean value string '%s' for option %s:%s", svalue, (section_name ? section_name : "default"), option_name);
-        return default_value;
-    }
-}
diff --git a/generators/plucker/unpluck/image.cpp b/generators/plucker/unpluck/image.cpp
deleted file mode 100644
index 4d3f568195..0000000000
--- a/generators/plucker/unpluck/image.cpp
+++ /dev/null
@@ -1,473 +0,0 @@
-/*
-    SPDX-FileCopyrightText: 2007 Tobias Koenig <tokoe at kde.org>
-
-    Based on code written by Bill Janssen 2002
-
-    SPDX-License-Identifier: GPL-2.0-or-later
-*/
-
-#include <QImage>
-#include <QTemporaryFile>
-
-#include <stdio.h>
-#include <stdlib.h>
-
-/* This code requires the Independent JPEG Group libjpeg library, version 6b or later */
-extern "C" {
-#include "jpeglib.h"
-}
-
-#include "image.h"
-
-#define GET_FUNCTION_CODE_TYPE(x) (((x) >> 3) & 0x1F)
-#define GET_FUNCTION_CODE_DATALEN(x) ((x)&0x7)
-
-#define CELLS(row, col) cells[row * cols + col]
-
-/***********************************************************************/
-/***********************************************************************/
-/*****                                                             *****/
-/*****   Code to decode the Palm image format to JPEG              *****/
-/*****                                                             *****/
-/***********************************************************************/
-/***********************************************************************/
-
-#define READ_BIGENDIAN_SHORT(p) (((p)[0] << 8) | ((p)[1]))
-#define READ_BIGENDIAN_LONG(p) (((p)[0] << 24) | ((p)[1] << 16) | ((p)[2] << 8) | ((p)[3]))
-
-#define PALM_IS_COMPRESSED_FLAG 0x8000
-#define PALM_HAS_COLORMAP_FLAG 0x4000
-#define PALM_HAS_TRANSPARENCY_FLAG 0x2000
-#define PALM_DIRECT_COLOR_FLAG 0x0400
-#define PALM_4_BYTE_FIELD_FLAG 0x0200
-
-#define PALM_COMPRESSION_SCANLINE 0x00
-#define PALM_COMPRESSION_RLE 0x01
-#define PALM_COMPRESSION_PACKBITS 0x02
-#define PALM_COMPRESSION_NONE 0xFF
-
-#define PALM_COLORMAP_SIZE 232
-
-typedef struct {
-    unsigned char red;
-    unsigned char green;
-    unsigned char blue;
-} ColorMapEntry;
-
-static ColorMapEntry Palm8BitColormap[] = {
-    {255, 255, 255}, {255, 204, 255}, {255, 153, 255}, {255, 102, 255}, {255, 51, 255},  {255, 0, 255},   {255, 255, 204}, {255, 204, 204}, {255, 153, 204}, {255, 102, 204}, {255, 51, 204},  {255, 0, 204},   {255, 255, 153},
-    {255, 204, 153}, {255, 153, 153}, {255, 102, 153}, {255, 51, 153},  {255, 0, 153},   {204, 255, 255}, {204, 204, 255}, {204, 153, 255}, {204, 102, 255}, {204, 51, 255},  {204, 0, 255},   {204, 255, 204}, {204, 204, 204},
-    {204, 153, 204}, {204, 102, 204}, {204, 51, 204},  {204, 0, 204},   {204, 255, 153}, {204, 204, 153}, {204, 153, 153}, {204, 102, 153}, {204, 51, 153},  {204, 0, 153},   {153, 255, 255}, {153, 204, 255}, {153, 153, 255},
-    {153, 102, 255}, {153, 51, 255},  {153, 0, 255},   {153, 255, 204}, {153, 204, 204}, {153, 153, 204}, {153, 102, 204}, {153, 51, 204},  {153, 0, 204},   {153, 255, 153}, {153, 204, 153}, {153, 153, 153}, {153, 102, 153},
-    {153, 51, 153},  {153, 0, 153},   {102, 255, 255}, {102, 204, 255}, {102, 153, 255}, {102, 102, 255}, {102, 51, 255},  {102, 0, 255},   {102, 255, 204}, {102, 204, 204}, {102, 153, 204}, {102, 102, 204}, {102, 51, 204},
-    {102, 0, 204},   {102, 255, 153}, {102, 204, 153}, {102, 153, 153}, {102, 102, 153}, {102, 51, 153},  {102, 0, 153},   {51, 255, 255},  {51, 204, 255},  {51, 153, 255},  {51, 102, 255},  {51, 51, 255},   {51, 0, 255},
-    {51, 255, 204},  {51, 204, 204},  {51, 153, 204},  {51, 102, 204},  {51, 51, 204},   {51, 0, 204},    {51, 255, 153},  {51, 204, 153},  {51, 153, 153},  {51, 102, 153},  {51, 51, 153},   {51, 0, 153},    {0, 255, 255},
-    {0, 204, 255},   {0, 153, 255},   {0, 102, 255},   {0, 51, 255},    {0, 0, 255},     {0, 255, 204},   {0, 204, 204},   {0, 153, 204},   {0, 102, 204},   {0, 51, 204},    {0, 0, 204},     {0, 255, 153},   {0, 204, 153},
-    {0, 153, 153},   {0, 102, 153},   {0, 51, 153},    {0, 0, 153},     {255, 255, 102}, {255, 204, 102}, {255, 153, 102}, {255, 102, 102}, {255, 51, 102},  {255, 0, 102},   {255, 255, 51},  {255, 204, 51},  {255, 153, 51},
-    {255, 102, 51},  {255, 51, 51},   {255, 0, 51},    {255, 255, 0},   {255, 204, 0},   {255, 153, 0},   {255, 102, 0},   {255, 51, 0},    {255, 0, 0},     {204, 255, 102}, {204, 204, 102}, {204, 153, 102}, {204, 102, 102},
-    {204, 51, 102},  {204, 0, 102},   {204, 255, 51},  {204, 204, 51},  {204, 153, 51},  {204, 102, 51},  {204, 51, 51},   {204, 0, 51},    {204, 255, 0},   {204, 204, 0},   {204, 153, 0},   {204, 102, 0},   {204, 51, 0},
-    {204, 0, 0},     {153, 255, 102}, {153, 204, 102}, {153, 153, 102}, {153, 102, 102}, {153, 51, 102},  {153, 0, 102},   {153, 255, 51},  {153, 204, 51},  {153, 153, 51},  {153, 102, 51},  {153, 51, 51},   {153, 0, 51},
-    {153, 255, 0},   {153, 204, 0},   {153, 153, 0},   {153, 102, 0},   {153, 51, 0},    {153, 0, 0},     {102, 255, 102}, {102, 204, 102}, {102, 153, 102}, {102, 102, 102}, {102, 51, 102},  {102, 0, 102},   {102, 255, 51},
-    {102, 204, 51},  {102, 153, 51},  {102, 102, 51},  {102, 51, 51},   {102, 0, 51},    {102, 255, 0},   {102, 204, 0},   {102, 153, 0},   {102, 102, 0},   {102, 51, 0},    {102, 0, 0},     {51, 255, 102},  {51, 204, 102},
-    {51, 153, 102},  {51, 102, 102},  {51, 51, 102},   {51, 0, 102},    {51, 255, 51},   {51, 204, 51},   {51, 153, 51},   {51, 102, 51},   {51, 51, 51},    {51, 0, 51},     {51, 255, 0},    {51, 204, 0},    {51, 153, 0},
-    {51, 102, 0},    {51, 51, 0},     {51, 0, 0},      {0, 255, 102},   {0, 204, 102},   {0, 153, 102},   {0, 102, 102},   {0, 51, 102},    {0, 0, 102},     {0, 255, 51},    {0, 204, 51},    {0, 153, 51},    {0, 102, 51},
-    {0, 51, 51},     {0, 0, 51},      {0, 255, 0},     {0, 204, 0},     {0, 153, 0},     {0, 102, 0},     {0, 51, 0},      {17, 17, 17},    {34, 34, 34},    {68, 68, 68},    {85, 85, 85},    {119, 119, 119}, {136, 136, 136},
-    {170, 170, 170}, {187, 187, 187}, {221, 221, 221}, {238, 238, 238}, {192, 192, 192}, {128, 0, 0},     {128, 0, 128},   {0, 128, 0},     {0, 128, 128},   {0, 0, 0},       {0, 0, 0},       {0, 0, 0},       {0, 0, 0},
-    {0, 0, 0},       {0, 0, 0},       {0, 0, 0},       {0, 0, 0},       {0, 0, 0},       {0, 0, 0},       {0, 0, 0},       {0, 0, 0},       {0, 0, 0},       {0, 0, 0},       {0, 0, 0},       {0, 0, 0},       {0, 0, 0},
-    {0, 0, 0},       {0, 0, 0},       {0, 0, 0},       {0, 0, 0},       {0, 0, 0},       {0, 0, 0},       {0, 0, 0},       {0, 0, 0},       {0, 0, 0}};
-
-static ColorMapEntry Palm1BitColormap[] = {{255, 255, 255}, {0, 0, 0}};
-
-static ColorMapEntry Palm2BitColormap[] = {{255, 255, 255}, {192, 192, 192}, {128, 128, 128}, {0, 0, 0}};
-
-static ColorMapEntry Palm4BitColormap[] = {{255, 255, 255},
-                                           {238, 238, 238},
-                                           {221, 221, 221},
-                                           {204, 204, 204},
-                                           {187, 187, 187},
-                                           {170, 170, 170},
-                                           {153, 153, 153},
-                                           {136, 136, 136},
-                                           {119, 119, 119},
-                                           {102, 102, 102},
-                                           {85, 85, 85},
-                                           {68, 68, 68},
-                                           {51, 51, 51},
-                                           {34, 34, 34},
-                                           {17, 17, 17},
-                                           {0, 0, 0}};
-
-bool TranscribePalmImageToJPEG(unsigned char *image_bytes_in, QImage &image)
-{
-    unsigned int width;
-    unsigned int height;
-    unsigned int bytes_per_row;
-    unsigned int flags;
-    //     unsigned int    next_depth_offset;
-    unsigned int bits_per_pixel;
-    //     unsigned int    version;
-    //     unsigned int    transparent_index;
-    unsigned int compression_type;
-    unsigned int i;
-    unsigned int j;
-    unsigned int inval;
-    unsigned int inbit;
-    unsigned int mask;
-    unsigned int incount;
-    unsigned int palm_red_bits = 0;
-    unsigned int palm_green_bits = 0;
-    unsigned int palm_blue_bits = 0;
-    unsigned char *palm_ptr;
-    //     unsigned char*  x_ptr;
-    //     unsigned char*  imagedata = 0;
-    unsigned char *inbyte;
-    unsigned char *rowbuf;
-    unsigned char *lastrow;
-    unsigned char *imagedatastart;
-    unsigned char *palmimage;
-    ColorMapEntry *colormap;
-
-    JSAMPLE *jpeg_row;
-    struct jpeg_compress_struct cinfo;
-    struct jpeg_error_mgr jerr;
-    JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */
-
-    palmimage = image_bytes_in;
-    width = READ_BIGENDIAN_SHORT(palmimage + 0);
-    height = READ_BIGENDIAN_SHORT(palmimage + 2);
-    bytes_per_row = READ_BIGENDIAN_SHORT(palmimage + 4);
-    flags = READ_BIGENDIAN_SHORT(palmimage + 6);
-    bits_per_pixel = palmimage[8];
-    //     version = palmimage[9];
-    //     next_depth_offset = READ_BIGENDIAN_SHORT (palmimage + 10);
-    //     transparent_index = palmimage[12];
-    compression_type = palmimage[13];
-    /* bytes 14 and 15 are reserved by Palm and always 0 */
-
-    if (compression_type == PALM_COMPRESSION_PACKBITS) {
-        return false;
-    } else if ((compression_type != PALM_COMPRESSION_NONE) && (compression_type != PALM_COMPRESSION_RLE) && (compression_type != PALM_COMPRESSION_SCANLINE)) {
-        return false;
-    }
-
-    /* as of PalmOS 4.0, there are 6 different kinds of Palm pixmaps:
-
-       1, 2, or 4 bit grayscale
-       8-bit StaticColor using the Palm standard colormap
-       8-bit PseudoColor using a user-specified colormap
-       16-bit DirectColor using 5 bits for red, 6 for green, and 5 for blue
-
-       Each of these can be compressed with one of four compression schemes,
-       "RLE", "Scanline", "PackBits", or none.
-
-       We begin by constructing the colormap.
-     */
-
-    if (flags & PALM_HAS_COLORMAP_FLAG) {
-        return false;
-    } else if (bits_per_pixel == 1) {
-        colormap = Palm1BitColormap;
-        imagedatastart = palmimage + 16;
-    } else if (bits_per_pixel == 2) {
-        colormap = Palm2BitColormap;
-        imagedatastart = palmimage + 16;
-    } else if (bits_per_pixel == 4) {
-        colormap = Palm4BitColormap;
-        imagedatastart = palmimage + 16;
-    } else if (bits_per_pixel == 8) {
-        colormap = Palm8BitColormap;
-        imagedatastart = palmimage + 16;
-    } else if (bits_per_pixel == 16 && (flags & PALM_DIRECT_COLOR_FLAG)) {
-        colormap = nullptr;
-        palm_red_bits = palmimage[16];
-        palm_green_bits = palmimage[17];
-        palm_blue_bits = palmimage[18];
-        if (palm_blue_bits > 8 || palm_green_bits > 8 || palm_red_bits > 8) {
-            return false;
-        }
-        if (bits_per_pixel > (8 * sizeof(unsigned long))) {
-            return false;
-        }
-        imagedatastart = palmimage + 24;
-    } else {
-        return false;
-    }
-
-    QTemporaryFile tempFile;
-    tempFile.open();
-    FILE *outfile = fopen(QFile::encodeName(tempFile.fileName()).constData(), "w");
-    if (!outfile) {
-        return false;
-    }
-
-    /* now create the JPEG image row buffer */
-    jpeg_row = (JSAMPLE *)malloc(sizeof(JSAMPLE) * (width * 3));
-
-    /* Use standard JPEG error processing */
-    cinfo.err = jpeg_std_error(&jerr);
-    /* Initialize the JPEG compression object. */
-    jpeg_create_compress(&cinfo);
-
-    jpeg_stdio_dest(&cinfo, outfile);
-
-    cinfo.image_width = width; /* image width and height, in pixels */
-    cinfo.image_height = height;
-    cinfo.input_components = 3;     /* # of color components per pixel */
-    cinfo.in_color_space = JCS_RGB; /* colorspace of input image */
-
-    jpeg_set_defaults(&cinfo);
-    jpeg_set_quality(&cinfo, 100, true /* limit to baseline-JPEG values */);
-
-    row_pointer[0] = &jpeg_row[0];
-
-    jpeg_start_compress(&cinfo, true);
-
-    /* row by row, uncompress the Palm image and copy it to the JPEG buffer */
-    rowbuf = (unsigned char *)malloc(bytes_per_row * width);
-    lastrow = (unsigned char *)malloc(bytes_per_row * width);
-    for (i = 0, palm_ptr = imagedatastart /*, x_ptr = imagedata*/; i < height; ++i) {
-        /* first, uncompress the Palm image */
-        if ((flags & PALM_IS_COMPRESSED_FLAG) && (compression_type == PALM_COMPRESSION_RLE)) {
-            for (j = 0; j < bytes_per_row;) {
-                incount = *palm_ptr++;
-                inval = *palm_ptr++;
-                if (incount + j <= bytes_per_row * width) {
-                    memset(rowbuf + j, inval, incount);
-                    j += incount;
-                } else {
-                    free(rowbuf);
-                    free(lastrow);
-                    free(jpeg_row);
-
-                    jpeg_destroy_compress(&cinfo);
-
-                    fclose(outfile);
-
-                    return false;
-                }
-            }
-        } else if ((flags & PALM_IS_COMPRESSED_FLAG) && (compression_type == PALM_COMPRESSION_SCANLINE)) {
-            for (j = 0; j < bytes_per_row; j += 8) {
-                incount = *palm_ptr++;
-                inval = ((bytes_per_row - j) < 8) ? (bytes_per_row - j) : 8;
-                for (inbit = 0; inbit < inval; inbit += 1) {
-                    if (incount & (1 << (7 - inbit))) {
-                        rowbuf[j + inbit] = *palm_ptr++;
-                    } else {
-                        rowbuf[j + inbit] = lastrow[j + inbit];
-                    }
-                }
-            }
-            memcpy(lastrow, rowbuf, bytes_per_row);
-        } else if (((flags & PALM_IS_COMPRESSED_FLAG) && (compression_type == PALM_COMPRESSION_NONE)) || (flags & PALM_IS_COMPRESSED_FLAG) == 0) {
-            memcpy(rowbuf, palm_ptr, bytes_per_row);
-            palm_ptr += bytes_per_row;
-        }
-
-        /* next, write it to the GDK bitmap */
-        if (colormap) {
-            mask = (1 << bits_per_pixel) - 1;
-            for (inbit = 8 - bits_per_pixel, inbyte = rowbuf, j = 0; j < width; ++j) {
-                inval = ((*inbyte) & (mask << inbit)) >> inbit;
-                /* correct for oddity of the 8-bit color Palm pixmap... */
-                if ((bits_per_pixel == 8) && (inval == 0xFF)) {
-                    inval = 231;
-                }
-                /* now lookup the correct color and set the pixel in the GTK bitmap */
-                jpeg_row[(j * 3) + 0] = colormap[inval].red;
-                jpeg_row[(j * 3) + 1] = colormap[inval].green;
-                jpeg_row[(j * 3) + 2] = colormap[inval].blue;
-                if (!inbit) {
-                    ++inbyte;
-                    inbit = 8 - bits_per_pixel;
-                } else {
-                    inbit -= bits_per_pixel;
-                }
-            }
-        } else if (!colormap && bits_per_pixel == 16) {
-            for (inbyte = rowbuf, j = 0; j < width; ++j) {
-                inval = (inbyte[0] << 8) | inbyte[1];
-                jpeg_row[(j * 3) + 0] = (inval >> (bits_per_pixel - palm_red_bits)) & ((1 << palm_red_bits) - 1);
-                jpeg_row[(j * 3) + 1] = (inval >> palm_blue_bits) & ((1 << palm_green_bits) - 1);
-                jpeg_row[(j * 3) + 2] = (inval >> 0) & ((1 << palm_blue_bits) - 1);
-                inbyte += 2;
-            }
-        }
-
-        (void)jpeg_write_scanlines(&cinfo, row_pointer, 1);
-    }
-
-    free(rowbuf);
-    free(lastrow);
-    free(jpeg_row);
-
-    jpeg_finish_compress(&cinfo);
-    jpeg_destroy_compress(&cinfo);
-
-    fclose(outfile);
-
-    return image.load(tempFile.fileName());
-}
-
-typedef struct {
-    unsigned int width;
-    unsigned int height;
-    unsigned int bytes_per_row;
-    unsigned int flags;
-    unsigned int next_depth_offset;
-    unsigned int bits_per_pixel;
-    unsigned int version;
-    unsigned int transparent_index;
-    unsigned int compression_type;
-    unsigned int palm_red_bits;
-    unsigned int palm_green_bits;
-    unsigned int palm_blue_bits;
-    unsigned char *bytes;
-
-} PALMPIX;
-
-bool TranscribeMultiImageRecord(plkr_Document *doc, QImage &image, unsigned char *bytes)
-{
-    unsigned char *pbytes = nullptr;
-    unsigned char *outbytes = nullptr;
-    unsigned char *outptr = nullptr;
-    unsigned char *ptr = &bytes[12];
-    plkr_DataRecordType ptype;
-    PALMPIX *cells = nullptr;
-    PALMPIX *acell = nullptr;
-    unsigned int record_id = 0;
-    int plen = 0;
-    unsigned int x = 0;
-    unsigned int y = 0;
-    unsigned int cols = 0;
-    unsigned int rows = 0;
-    unsigned int width = 0;
-    unsigned int height = 0;
-    unsigned int bytes_per_row = 0;
-    unsigned int flags = 0;
-    unsigned int bits_per_pixel = 0;
-    unsigned int version = 0;
-    unsigned int transparent_index = 0;
-    unsigned int compression_type = 0;
-    unsigned int palm_red_bits = 0;
-    unsigned int palm_green_bits = 0;
-    unsigned int palm_blue_bits = 0;
-    unsigned int outlen = 0;
-    unsigned int offset = 0;
-    bool status = true;
-
-    cols = (bytes[8] << 8) + bytes[9];
-    rows = (bytes[10] << 8) + bytes[11];
-
-    if (cols == 0 || rows == 0) {
-        return false;
-    }
-
-    cells = (PALMPIX *)calloc(cols * rows, sizeof(PALMPIX));
-
-    height = 0;
-    for (y = 0; y < rows; y++) {
-        width = 0;
-        bytes_per_row = 0;
-        for (x = 0; x < cols; x++) {
-            acell = &CELLS(y, x);
-            record_id = (ptr[0] << 8) + ptr[1];
-            ptr += 2;
-            pbytes = plkr_GetRecordBytes(doc, record_id, &plen, &ptype);
-            if (pbytes == nullptr) {
-                free(cells);
-                return false;
-            }
-
-            pbytes += 8;
-            acell->width = READ_BIGENDIAN_SHORT(&pbytes[0]);
-            width += acell->width;
-            acell->height = READ_BIGENDIAN_SHORT(&pbytes[2]);
-            acell->bytes_per_row = READ_BIGENDIAN_SHORT(&pbytes[4]);
-            bytes_per_row += acell->bytes_per_row;
-            acell->flags = READ_BIGENDIAN_SHORT(&pbytes[6]);
-            flags = acell->flags;
-            acell->bits_per_pixel = pbytes[8];
-            bits_per_pixel = acell->bits_per_pixel;
-            acell->version = pbytes[9];
-            version = acell->version;
-            acell->next_depth_offset = READ_BIGENDIAN_SHORT(&pbytes[10]);
-            acell->transparent_index = pbytes[12];
-            transparent_index = acell->transparent_index;
-            acell->compression_type = pbytes[13];
-            compression_type = acell->compression_type;
-
-            if (acell->flags & PALM_HAS_COLORMAP_FLAG) {
-                free(cells);
-                return false;
-            }
-
-            acell->bytes = pbytes + 16;
-            offset = 16;
-            if (acell->bits_per_pixel == 16 && (acell->flags & PALM_DIRECT_COLOR_FLAG)) {
-                acell->palm_red_bits = pbytes[16];
-                palm_red_bits = acell->palm_red_bits;
-                acell->palm_green_bits = pbytes[17];
-                palm_green_bits = acell->palm_green_bits;
-                acell->palm_blue_bits = pbytes[18];
-                palm_blue_bits = acell->palm_blue_bits;
-                acell->bytes = pbytes + 24;
-                offset = 24;
-            }
-        }
-        height += acell->height;
-    }
-
-    outlen = bytes_per_row * height + offset;
-    outbytes = (unsigned char *)malloc(outlen);
-    outptr = outbytes;
-
-    *outptr++ = width >> 8;
-    *outptr++ = width;
-    *outptr++ = height >> 8;
-    *outptr++ = height;
-    *outptr++ = bytes_per_row >> 8;
-    *outptr++ = bytes_per_row;
-    *outptr++ = flags >> 8;
-    *outptr++ = flags;
-    *outptr++ = bits_per_pixel;
-    *outptr++ = version;
-    *outptr++ = 0; /* next_depth_offset */
-    *outptr++ = 0;
-    *outptr++ = transparent_index;
-    *outptr++ = compression_type;
-    *outptr++ = 0;
-    *outptr++ = 0;
-
-    if (acell->bits_per_pixel == 16 && (acell->flags & PALM_DIRECT_COLOR_FLAG)) {
-        *outptr++ = palm_red_bits;
-        *outptr++ = palm_green_bits;
-        *outptr++ = palm_blue_bits;
-        *outptr++ = 0;
-        *outptr++ = 0;
-        *outptr++ = 0;
-        *outptr++ = 0;
-        *outptr++ = 0;
-    }
-
-    for (y = 0; y < rows; y++) {
-        int i, h;
-        acell = &CELLS(y, 0);
-        h = acell->height;
-        for (i = 0; i < h; i++) {
-            for (x = 0; x < cols; x++) {
-                acell = &CELLS(y, x);
-                memcpy(outptr, acell->bytes, acell->bytes_per_row);
-                acell->bytes += acell->bytes_per_row;
-                outptr += acell->bytes_per_row;
-            }
-        }
-    }
-
-    status = TranscribePalmImageToJPEG(outbytes, image);
-
-    free(outbytes);
-    free(cells);
-
-    return status;
-}
diff --git a/generators/plucker/unpluck/image.h b/generators/plucker/unpluck/image.h
deleted file mode 100644
index 7ee0bdc029..0000000000
--- a/generators/plucker/unpluck/image.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
-    SPDX-FileCopyrightText: 2007 Tobias Koenig <tokoe at kde.org>
-
-    Based on code written by Bill Janssen 2002
-
-    SPDX-License-Identifier: GPL-2.0-or-later
-*/
-
-#ifndef IMAGE_H
-#define IMAGE_H
-
-#include "unpluck.h"
-
-class QImage;
-
-bool TranscribePalmImageToJPEG(unsigned char *image_bytes_in, QImage &image);
-bool TranscribeMultiImageRecord(plkr_Document *doc, QImage &image, unsigned char *bytes);
-
-#endif
diff --git a/generators/plucker/unpluck/qunpluck.cpp b/generators/plucker/unpluck/qunpluck.cpp
deleted file mode 100644
index 0e4cb2012e..0000000000
--- a/generators/plucker/unpluck/qunpluck.cpp
+++ /dev/null
@@ -1,1039 +0,0 @@
-/*
-    SPDX-FileCopyrightText: 2007 Tobias Koenig <tokoe at kde.org>
-
-    Based on code written by Bill Janssen 2002
-
-    SPDX-License-Identifier: GPL-2.0-or-later
-*/
-
-#include "qunpluck.h"
-
-#include <QAbstractTextDocumentLayout>
-#include <QDateTime>
-#include <QFile>
-#include <QFont>
-#include <QHash>
-#include <QLabel>
-#include <QStack>
-#include <QString>
-#include <QTextCharFormat>
-#include <QTextCursor>
-#include <QTextDocument>
-#include <QTextFrame>
-#include <QUrl>
-
-#include <core/action.h>
-#include <core/document.h>
-
-#include "image.h"
-
-#define GET_FUNCTION_CODE_TYPE(x) (((x) >> 3) & 0x1F)
-#define GET_FUNCTION_CODE_DATALEN(x) ((x)&0x7)
-
-#define CELLS(row, col) cells[row * cols + col]
-
-#define READ_BIGENDIAN_SHORT(p) (((p)[0] << 8) | ((p)[1]))
-#define READ_BIGENDIAN_LONG(p) (((p)[0] << 24) | ((p)[1] << 16) | ((p)[2] << 8) | ((p)[3]))
-/*
-static void LinkRecords
-    (
-    char*  dir
-    )
-{
-    RecordNode*  ptr;
-    char*        realfilename;
-    char*        linkname;
-
-    realfilename = (char*)malloc (strlen (dir) + 20);
-    linkname = (char*)malloc (strlen (dir) + 20);
-
-    for (ptr = records; ptr != NULL; ptr = ptr->next) {
-        if (ptr->page_id != ptr->index) {
-            sprintf (realfilename, "%s/r%d.html", dir, ptr->page_id);
-            sprintf (linkname, "%s/r%d.html", dir, ptr->index);
-            link (realfilename, linkname);
-        }
-    }
-
-    free (realfilename);
-    free (linkname);
-}
-*/
-
-class Context
-{
-public:
-    int recordId;
-    QTextDocument *document;
-    QTextCursor *cursor;
-    QStack<QTextCharFormat> stack;
-    QList<int> images;
-
-    QString linkUrl;
-    int linkStart;
-    int linkPage;
-};
-
-class RecordNode
-{
-public:
-    int index;
-    int page_id;
-    bool done;
-};
-
-static Okular::DocumentViewport calculateViewport(QTextDocument *document, const QTextBlock &block)
-{
-    if (!block.isValid()) {
-        return Okular::DocumentViewport();
-    }
-
-    const QRectF rect = document->documentLayout()->blockBoundingRect(block);
-    const QSizeF size = document->size();
-
-    int page = qRound(rect.y()) / qRound(size.height());
-
-    Okular::DocumentViewport viewport(page);
-    viewport.rePos.normalizedX = (double)rect.x() / (double)size.width();
-    viewport.rePos.normalizedY = (double)rect.y() / (double)size.height();
-    viewport.rePos.enabled = true;
-    viewport.rePos.pos = Okular::DocumentViewport::Center;
-
-    return viewport;
-}
-
-QUnpluck::QUnpluck()
-    : mDocument(nullptr)
-{
-}
-
-QUnpluck::~QUnpluck()
-{
-    mLinks.clear();
-    mNamedTargets.clear();
-    mPages.clear();
-}
-
-bool QUnpluck::open(const QString &fileName)
-{
-    mLinks.clear();
-    mNamedTargets.clear();
-    mPages.clear();
-
-    mDocument = plkr_OpenDBFile(QFile::encodeName(fileName).data());
-    if (!mDocument) {
-        mErrorString = QObject::tr("Unable to open document");
-        return false;
-    }
-
-    //     bool status = true;
-
-    mInfo.insert(QStringLiteral("name"), QString::fromLocal8Bit(plkr_GetName(mDocument)));
-    mInfo.insert(QStringLiteral("title"), QString::fromLocal8Bit(plkr_GetTitle(mDocument)));
-    mInfo.insert(QStringLiteral("author"), QString::fromLocal8Bit(plkr_GetAuthor(mDocument)));
-    mInfo.insert(QStringLiteral("time"), QDateTime::fromSecsSinceEpoch(plkr_GetPublicationTime(mDocument)).toString());
-
-    AddRecord(plkr_GetHomeRecordID(mDocument));
-
-    int number = GetNextRecordNumber();
-    while (number > 0) {
-        /*status = */ TranscribeRecord(number);
-        number = GetNextRecordNumber();
-    }
-
-    // Iterate over all records again to add those which aren't linked directly
-    for (int i = 1; i < plkr_GetRecordCount(mDocument); ++i) {
-        AddRecord(plkr_GetUidForIndex(mDocument, i));
-    }
-
-    number = GetNextRecordNumber();
-    while (number > 0) {
-        /*status = */ TranscribeRecord(number);
-        number = GetNextRecordNumber();
-    }
-
-    for (int i = 0; i < mRecords.count(); ++i) {
-        delete mRecords[i];
-    }
-
-    mRecords.clear();
-
-    plkr_CloseDoc(mDocument);
-
-    /**
-     * Calculate hash map
-     */
-    QHash<int, int> pageHash;
-    for (int i = 0; i < mContext.count(); ++i) {
-        pageHash.insert(mContext[i]->recordId, i);
-    }
-
-    /**
-     * Convert ids
-     */
-    for (int i = 0; i < mContext.count(); ++i) {
-        Context *context = mContext[i];
-        for (int j = 0; j < context->images.count(); ++j) {
-            int imgNumber = context->images[j];
-            context->document->addResource(QTextDocument::ImageResource, QUrl(QStringLiteral("%1.jpg").arg(imgNumber)), mImages[imgNumber]);
-        }
-
-        mPages.append(context->document);
-    }
-    qDeleteAll(mContext);
-    mContext.clear();
-
-    // convert record_id into page
-    for (int i = 0; i < mLinks.count(); ++i) {
-        mLinks[i].page = pageHash[mLinks[i].page];
-        if (mLinks[i].url.startsWith(QLatin1String("page:"))) {
-            int page = QStringView {mLinks[i].url}.mid(5).toInt();
-            Okular::DocumentViewport viewport(pageHash[page]);
-            viewport.rePos.normalizedX = 0;
-            viewport.rePos.normalizedY = 0;
-            viewport.rePos.enabled = true;
-            viewport.rePos.pos = Okular::DocumentViewport::TopLeft;
-            mLinks[i].link = new Okular::GotoAction(QString(), viewport);
-        } else if (mLinks[i].url.startsWith(QLatin1String("para:"))) {
-            QPair<int, QTextBlock> data = mNamedTargets[mLinks[i].url];
-
-            QTextDocument *document = mPages[mLinks[i].page];
-
-            Okular::DocumentViewport viewport = calculateViewport(document, data.second);
-
-            mLinks[i].link = new Okular::GotoAction(QString(), viewport);
-        } else {
-            mLinks[i].link = new Okular::BrowseAction(QUrl(mLinks[i].url));
-        }
-    }
-
-    return true;
-}
-
-int QUnpluck::GetNextRecordNumber()
-{
-    int index = 0;
-
-    for (int pos = 0; pos < mRecords.count(); ++pos) {
-        if (!mRecords[pos]->done) {
-            index = mRecords[pos]->index;
-            break;
-        }
-    }
-
-    return index;
-}
-
-int QUnpluck::GetPageID(int index)
-{
-    for (int pos = 0; pos < mRecords.count(); ++pos) {
-        if (mRecords[pos]->index == index) {
-            return mRecords[pos]->page_id;
-        }
-    }
-
-    return 0;
-}
-
-void QUnpluck::AddRecord(int index)
-{
-    for (int pos = 0; pos < mRecords.count(); ++pos) {
-        if (mRecords[pos]->index == index) {
-            return;
-        }
-    }
-
-    RecordNode *node = new RecordNode;
-    node->done = false;
-    node->index = index;
-    node->page_id = index;
-
-    mRecords.append(node);
-}
-
-void QUnpluck::MarkRecordDone(int index)
-{
-    for (int pos = 0; pos < mRecords.count(); ++pos) {
-        if (mRecords[pos]->index == index) {
-            mRecords[pos]->done = true;
-            return;
-        }
-    }
-
-    AddRecord(index);
-    MarkRecordDone(index);
-}
-
-void QUnpluck::SetPageID(int index, int page_id)
-{
-    for (int pos = 0; pos < mRecords.count(); ++pos) {
-        if (mRecords[pos]->index == index) {
-            mRecords[pos]->page_id = page_id;
-            return;
-        }
-    }
-
-    AddRecord(index);
-    SetPageID(index, page_id);
-}
-
-QString QUnpluck::MailtoURLFromBytes(unsigned char *record_data)
-{
-    unsigned char *bytes = record_data + 8;
-
-    int to_offset = (bytes[0] << 8) + bytes[1];
-    int cc_offset = (bytes[2] << 8) + bytes[3];
-    int subject_offset = (bytes[4] << 8) + bytes[5];
-    int body_offset = (bytes[6] << 8) + bytes[7];
-
-    QString url(QStringLiteral("mailto:"));
-    if (to_offset != 0) {
-        url += QString::fromLatin1((char *)(bytes + to_offset));
-    }
-
-    if ((cc_offset != 0) || (subject_offset != 0) || (body_offset != 0)) {
-        url += QLatin1String("?");
-    }
-
-    if (cc_offset != 0) {
-        url += QLatin1String("cc=") + QString::fromLatin1((char *)(bytes + cc_offset));
-    }
-
-    if (subject_offset != 0) {
-        url += QLatin1String("subject=") + QString::fromLatin1((char *)(bytes + subject_offset));
-    }
-
-    if (body_offset != 0) {
-        url += QLatin1String("body=") + QString::fromLatin1((char *)(bytes + body_offset));
-    }
-
-    return url;
-}
-
-QImage QUnpluck::TranscribeImageRecord(unsigned char *bytes)
-{
-    QImage image;
-
-    TranscribePalmImageToJPEG(bytes + 8, image);
-
-    return image;
-}
-
-void QUnpluck::DoStyle(Context *context, int style, bool start)
-{
-    if (start) {
-        QTextCharFormat format(context->cursor->charFormat());
-        context->stack.push(format);
-
-        int pointSize = qRound(format.fontPointSize());
-        switch (style) {
-        case 1:
-            format.setFontWeight(QFont::Bold);
-            pointSize += 3;
-            break;
-        case 2:
-            format.setFontWeight(QFont::Bold);
-            pointSize += 2;
-            break;
-        case 3:
-            format.setFontWeight(QFont::Bold);
-            pointSize += 1;
-            break;
-        case 4:
-            format.setFontWeight(QFont::Bold);
-            break;
-        case 5:
-            format.setFontWeight(QFont::Bold);
-            pointSize += -1;
-            break;
-        case 6:
-            format.setFontWeight(QFont::Bold);
-            pointSize += -2;
-            break;
-        case 7:
-            format.setFontWeight(QFont::Bold);
-            break;
-        case 8:
-            format.setFontFamilies({QStringLiteral("Courier New,courier")});
-            break;
-        }
-        format.setFontPointSize(qMax(pointSize, 1));
-        context->cursor->setCharFormat(format);
-    } else {
-        if (!context->stack.isEmpty()) {
-            context->cursor->setCharFormat(context->stack.pop());
-        }
-    }
-}
-
-void QUnpluck::ParseText(plkr_Document *doc, unsigned char *ptr, int text_len, int *font, int *style, Context *context)
-{
-    unsigned char *end;
-    int fctype;
-    int fclen;
-
-    end = ptr + text_len;
-    while (ptr < end) {
-        if (ptr[0]) {
-            context->cursor->insertText(QString::fromLocal8Bit((char *)ptr));
-            ptr += strlen((char *)ptr);
-        } else {
-            fctype = GET_FUNCTION_CODE_TYPE(ptr[1]);
-            fclen = 2 + GET_FUNCTION_CODE_DATALEN(ptr[1]);
-            switch (fctype) {
-            case PLKR_TFC_LINK:
-                switch (fclen) {
-                case 4: /* ANCHOR_BEGIN */
-                {
-                    int record_id = (ptr[2] << 8) + ptr[3];
-
-                    /** TODO:
-                    plkr_DataRecordType   type =
-                        (plkr_DataRecordType)plkr_GetRecordType (doc, record_id);
-                    if (type ==
-                        PLKR_DRTYPE_IMAGE
-                        || type ==
-                        PLKR_DRTYPE_IMAGE_COMPRESSED)
-                        output += QString( "<A HREF=\"r%1.jpg\">" ).arg(record_id);
-                    else
-                        output += QString( "<A HREF=\"r%1.html\">" ).arg(record_id);
-                        */
-                    AddRecord(record_id);
-                } break;
-                case 2: /* ANCHOR_END */
-                    // TODO:  output += QString( "</A>" );
-                    break;
-                }
-                ptr += fclen;
-                break;
-            case PLKR_TFC_FONT:
-                DoStyle(context, *style, false);
-                *style = ptr[2];
-                DoStyle(context, *style, true);
-                ptr += fclen;
-                break;
-            case PLKR_TFC_NEWLINE: {
-                // TODO: remove the setCharFormat when Qt is fixed
-                QTextCharFormat format(context->cursor->charFormat());
-                context->cursor->insertText(QStringLiteral("\n"));
-                context->cursor->setCharFormat(format);
-                ptr += fclen;
-                break;
-            }
-            case PLKR_TFC_BITALIC: {
-                QTextCharFormat format(context->cursor->charFormat());
-                format.setFontItalic(true);
-                context->cursor->setCharFormat(format);
-                ptr += fclen;
-                break;
-            }
-            case PLKR_TFC_EITALIC: {
-                QTextCharFormat format(context->cursor->charFormat());
-                format.setFontItalic(false);
-                context->cursor->setCharFormat(format);
-                ptr += fclen;
-                break;
-            }
-            case PLKR_TFC_COLOR:
-                if (*font) {
-                    (*font)--;
-                    if (!context->stack.isEmpty()) {
-                        context->cursor->setCharFormat(context->stack.pop());
-                    }
-                }
-
-                {
-                    QTextCharFormat format(context->cursor->charFormat());
-                    context->stack.push(format);
-
-                    format.setForeground(QColor((ptr[2] << 16), (ptr[3] << 8), ptr[4]));
-                    context->cursor->setCharFormat(format);
-                }
-
-                (*font)++;
-                ptr += fclen;
-                break;
-            case PLKR_TFC_BULINE: {
-                QTextCharFormat format(context->cursor->charFormat());
-                format.setFontUnderline(true);
-                context->cursor->setCharFormat(format);
-                ptr += fclen;
-            } break;
-            case PLKR_TFC_EULINE: {
-                QTextCharFormat format(context->cursor->charFormat());
-                format.setFontUnderline(false);
-                context->cursor->setCharFormat(format);
-                ptr += fclen;
-            } break;
-            case PLKR_TFC_BSTRIKE: {
-                QTextCharFormat format(context->cursor->charFormat());
-                format.setFontStrikeOut(true);
-                context->cursor->setCharFormat(format);
-                ptr += fclen;
-                break;
-            }
-            case PLKR_TFC_ESTRIKE: {
-                QTextCharFormat format(context->cursor->charFormat());
-                format.setFontStrikeOut(false);
-                context->cursor->setCharFormat(format);
-                ptr += fclen;
-                break;
-            }
-            case PLKR_TFC_TABLE:
-                if (fclen == 4) {
-                    int record_id, datalen;
-                    plkr_DataRecordType type = (plkr_DataRecordType)0;
-                    unsigned char *bytes = nullptr;
-
-                    record_id = (ptr[2] << 8) + ptr[3];
-                    bytes = plkr_GetRecordBytes(doc, record_id, &datalen, &type);
-                    TranscribeTableRecord(doc, context, bytes);
-                }
-                ptr += fclen;
-                break;
-            default:
-                ptr += fclen;
-            }
-        }
-    }
-}
-
-bool QUnpluck::TranscribeTableRecord(plkr_Document *doc, Context *context, unsigned char *bytes)
-{
-    unsigned char *ptr = &bytes[24];
-    unsigned char *end;
-    //    char*           align_names[] = { "left", "right", "center" };
-    //     bool            in_row = false;
-    //     int             cols;
-    int size;
-    //     int             rows;
-    //     int             border;
-    int record_id;
-    //     int             align;
-    int text_len;
-    //     int             colspan;
-    //     int             rowspan;
-    int font = 0;
-    int style = 0;
-    int fctype;
-    int fclen;
-    //     long            border_color;
-    //     long            link_color;
-
-    size = (bytes[8] << 8) + bytes[9];
-    //     cols = (bytes[10] << 8) + bytes[11];
-    //     rows = (bytes[12] << 8) + bytes[13];
-    //     border = bytes[15];
-    //     border_color = (bytes[17] << 16) + (bytes[18] << 8) + (bytes[19] << 8);
-    //     link_color = (bytes[21] << 16) + (bytes[22] << 8) + (bytes[23] << 8);
-
-    end = ptr + size - 1;
-    /**
-        output += QString( "<TABLE border=%1 bordercolor=\"#%2\" "
-                 "linkcolor=\"#%3\">\n" ).arg(border, border_color, link_color);
-    */
-    while (ptr < end) {
-        if (ptr[0] == '\0') {
-            fctype = GET_FUNCTION_CODE_TYPE(ptr[1]);
-            fclen = 2 + GET_FUNCTION_CODE_DATALEN(ptr[1]);
-            switch (fctype) {
-            case PLKR_TFC_TABLE:
-                switch (fclen) {
-                case 2: /* NEW_ROW */
-                    /*
-                        if (in_row)
-                            output += QString( "</TR>\n" );
-                        output += QString( "<TR>\n" );
-                        in_row = true;
-                        */
-                    ptr += fclen;
-                    break;
-                case 9: /* NEW_CELL */
-                    //                             align = ptr[2];
-                    //                             colspan = ptr[5];
-                    //                             rowspan = ptr[6];
-                    /**
-                    output += QString( "<TD align=\"%1\" colspan=%2 "
-                             "rowspan=%3 bordercolor=\"#\">" ).arg(
-                             align_names[align], colspan, rowspan );
-//                                     border_color);
-*/
-                    if ((record_id = READ_BIGENDIAN_SHORT(&ptr[3]))) {
-                        QTextCharFormat format = context->cursor->charFormat();
-                        context->cursor->insertImage(QStringLiteral("%1.jpg").arg(record_id));
-                        context->cursor->setCharFormat(format);
-                        context->images.append(record_id);
-                        AddRecord(record_id);
-                    }
-                    DoStyle(context, style, true);
-                    text_len = READ_BIGENDIAN_SHORT(&ptr[7]);
-                    ptr += fclen;
-                    ParseText(doc, ptr, text_len, &font, &style, context);
-                    ptr += text_len;
-                    DoStyle(context, style, false);
-                    // output += QString( "</TD>\n" );
-                    break;
-                default:
-                    ptr += fclen;
-                }
-                break;
-            default:
-                ptr += fclen;
-            }
-        } else {
-            // output += QString( "</TABLE>\n" );
-            return false;
-        }
-    }
-
-    //    output += QString( "</TABLE>\n" );
-    return true;
-}
-
-typedef struct {
-    int size;
-    int attributes;
-} ParagraphInfo;
-
-static std::vector<ParagraphInfo> ParseParagraphInfo(unsigned char *bytes)
-{
-    std::vector<ParagraphInfo> paragraph_info;
-
-    int n = (bytes[2] << 8) + bytes[3];
-    paragraph_info.reserve(n);
-    for (int j = 0; j < n; j++) {
-        const int size = (bytes[8 + (j * 4) + 0] << 8) + bytes[8 + (j * 4) + 1];
-        const int attributes = (bytes[8 + (j * 4) + 2] << 8) + bytes[8 + (j * 4) + 3];
-        paragraph_info.emplace_back(ParagraphInfo {size, attributes});
-    }
-    return paragraph_info;
-}
-
-bool QUnpluck::TranscribeTextRecord(plkr_Document *doc, int id, Context *context, unsigned char *bytes, plkr_DataRecordType type)
-{
-    unsigned char *ptr;
-    unsigned char *run;
-    unsigned char *para_start;
-    unsigned char *data;
-    unsigned char *start;
-    bool first_record_of_page = true;
-    bool current_link;
-    bool current_italic;
-    bool current_struckthrough;
-    bool current_underline;
-    int fctype;
-    int fclen;
-    size_t para_index;
-    int para_len;
-    int textlen;
-    int data_len;
-    int current_font;
-    int record_index;
-    //     int             current_alignment;
-    //     int             current_left_margin;
-    //     int             current_right_margin;
-    //     long            current_color;
-
-    record_index = id;
-
-    std::vector<ParagraphInfo> paragraphs = ParseParagraphInfo(bytes);
-    start = bytes + 8 + ((bytes[2] << 8) + bytes[3]) * 4;
-
-    for (para_index = 0, ptr = start, run = start; para_index < paragraphs.size(); para_index++) {
-        para_len = paragraphs[para_index].size;
-
-        /* If the paragraph is the last in the record, and it consists
-           of a link to the next record in the logical page, we trim off
-           the paragraph and instead insert the whole page */
-
-        if (((para_index + 1) == paragraphs.size()) && (para_len == (sizeof("Click here for the next part") + 5)) && (*ptr == 0) && (ptr[1] == ((PLKR_TFC_LINK << 3) + 2)) &&
-            (strcmp((char *)(ptr + 4), "Click here for the next part") == 0)) {
-            record_index = (ptr[2] << 8) + ptr[3];
-            if ((data = plkr_GetRecordBytes(doc, record_index, &data_len, &type)) == nullptr) {
-                //                ShowWarning ("Can't open record %d!", record_index);
-                return false;
-            } else if (!(type == PLKR_DRTYPE_TEXT_COMPRESSED || type == PLKR_DRTYPE_TEXT)) {
-                //                ShowWarning ("Bad record type %d in record linked from end of record %d", type, id);
-                return false;
-            }
-            first_record_of_page = false;
-            para_index = 0;
-            ptr = data + 8 + ((data[2] << 8) + data[3]) * 4;
-            run = ptr;
-            paragraphs = ParseParagraphInfo(data);
-            para_len = paragraphs[para_index].size;
-            MarkRecordDone(record_index);
-            SetPageID(record_index, id);
-        }
-
-        if ((para_index == 0) && !first_record_of_page && (*ptr == 0) && (ptr[1] == ((PLKR_TFC_LINK << 3) + 2)) && (strcmp((char *)(ptr + 4), "Click here for the previous part") == 0)) {
-            /* throw away this inserted paragraph */
-            ptr += para_len;
-            run = ptr;
-            continue;
-        }
-
-        QTextCharFormat charFormat(context->cursor->charFormat());
-        QTextBlockFormat blockFormat(context->cursor->blockFormat());
-        blockFormat.setAlignment(Qt::AlignLeft);
-        context->cursor->insertBlock(blockFormat);
-        context->cursor->setCharFormat(charFormat);
-
-        mNamedTargets.insert(QStringLiteral("para:%1-%2").arg(record_index).arg(para_index), QPair<int, QTextBlock>(GetPageID(record_index), context->cursor->block()));
-
-        current_link = false;
-
-        /* at the beginning of a paragraph, we start with a clean graphics context */
-        current_font = 0;
-        //         current_alignment = 0;
-        //         current_color = 0;
-        current_italic = false;
-        current_underline = false;
-        current_struckthrough = false;
-        //         current_left_margin = 0;
-        //         current_right_margin = 0;
-
-        for (para_start = ptr, textlen = 0; (ptr - para_start) < para_len;) {
-            if (*ptr == 0) {
-                /* function code */
-
-                if ((ptr - run) > 0) {
-                    /* write out any pending text */
-                    context->cursor->insertText(QString::fromLatin1((char *)run, ptr - run));
-                    textlen += (ptr - run);
-                }
-
-                ptr++;
-                fctype = GET_FUNCTION_CODE_TYPE(*ptr);
-                fclen = GET_FUNCTION_CODE_DATALEN(*ptr);
-                ptr++;
-
-                if (fctype == PLKR_TFC_NEWLINE) {
-                    // TODO: remove the setCharFormat when Qt is fixed
-                    QTextCharFormat format(context->cursor->charFormat());
-                    context->cursor->insertText(QStringLiteral("\n"));
-                    context->cursor->setCharFormat(format);
-                } else if (fctype == PLKR_TFC_LINK) {
-                    int record_id, real_record_id, datalen;
-                    plkr_DataRecordType type = (plkr_DataRecordType)0;
-                    unsigned char *bytes = nullptr;
-                    char *url = nullptr;
-
-                    if (fclen == 0) {
-                        if (current_link) {
-                            if (!context->stack.isEmpty()) {
-                                context->cursor->setCharFormat(context->stack.pop());
-                            }
-
-                            if (!context->linkUrl.isEmpty()) {
-                                Link link;
-                                link.url = context->linkUrl;
-                                link.start = context->linkStart;
-                                link.end = context->cursor->position();
-                                link.page = GetPageID(id);
-                                mLinks.append(link);
-                            }
-                        }
-                        current_link = false;
-                    } else {
-                        record_id = (ptr[0] << 8) + ptr[1];
-                        bytes = plkr_GetRecordBytes(doc, record_id, &datalen, &type);
-                        if (!bytes) {
-                            url = plkr_GetRecordURL(doc, record_id);
-                        }
-                        if (bytes && (type == PLKR_DRTYPE_MAILTO)) {
-                            context->linkUrl = MailtoURLFromBytes(bytes);
-                            context->linkStart = context->cursor->position();
-
-                            QTextCharFormat format(context->cursor->charFormat());
-                            context->stack.push(format);
-                            format.setForeground(Qt::blue);
-                            format.setUnderlineStyle(QTextCharFormat::SingleUnderline);
-                            context->cursor->setCharFormat(format);
-                            current_link = true;
-                        } else if (!bytes && url) {
-                            context->linkUrl = QString::fromLatin1(url);
-                            context->linkStart = context->cursor->position();
-
-                            QTextCharFormat format(context->cursor->charFormat());
-                            context->stack.push(format);
-                            format.setForeground(Qt::blue);
-                            format.setUnderlineStyle(QTextCharFormat::SingleUnderline);
-                            context->cursor->setCharFormat(format);
-                            current_link = true;
-                        } else if (bytes && (fclen == 2)) {
-                            AddRecord(record_id);
-                            real_record_id = GetPageID(record_id);
-                            if (type == PLKR_DRTYPE_IMAGE || type == PLKR_DRTYPE_IMAGE_COMPRESSED) {
-                                context->linkUrl = QStringLiteral("%1.jpg").arg(record_id);
-                                context->linkStart = context->cursor->position();
-                            } else {
-                                context->linkUrl = QStringLiteral("page:%1").arg(real_record_id);
-                                context->linkStart = context->cursor->position();
-                            }
-                            QTextCharFormat format(context->cursor->charFormat());
-                            context->stack.push(format);
-                            format.setForeground(Qt::blue);
-                            format.setUnderlineStyle(QTextCharFormat::SingleUnderline);
-                            context->cursor->setCharFormat(format);
-                            current_link = true;
-                        } else if (bytes && (fclen == 4)) {
-                            AddRecord(record_id);
-
-                            context->linkUrl = QStringLiteral("para:%1-%2").arg(record_id).arg((ptr[2] << 8) + ptr[3]);
-                            context->linkStart = context->cursor->position();
-
-                            QTextCharFormat format(context->cursor->charFormat());
-                            context->stack.push(format);
-                            format.setForeground(Qt::blue);
-                            format.setUnderlineStyle(QTextCharFormat::SingleUnderline);
-                            context->cursor->setCharFormat(format);
-                            current_link = true;
-                        } else {
-                            //    ShowWarning("odd link found:  record_id=%d, bytes=0x%p, type=%d, url=%s", record_id, bytes, type, (url ? url : "0x0"));
-                        }
-                    }
-
-                } else if (fctype == PLKR_TFC_FONT) {
-                    if (current_font != *ptr) {
-                        if (!context->stack.isEmpty()) {
-                            context->cursor->setCharFormat(context->stack.pop());
-                        }
-
-                        QTextCharFormat format(context->cursor->charFormat());
-                        context->stack.push(format);
-
-                        int pointSize = qRound(format.fontPointSize());
-                        if (*ptr == 1) {
-                            format.setFontWeight(QFont::Bold);
-                            pointSize += 3;
-                        } else if (*ptr == 2) {
-                            format.setFontWeight(QFont::Bold);
-                            pointSize += 2;
-                        } else if (*ptr == 3) {
-                            format.setFontWeight(QFont::Bold);
-                            pointSize += 1;
-                        } else if (*ptr == 4) {
-                            format.setFontWeight(QFont::Bold);
-                        } else if (*ptr == 5) {
-                            format.setFontWeight(QFont::Bold);
-                            pointSize += -1;
-                        } else if (*ptr == 6) {
-                            format.setFontWeight(QFont::Bold);
-                            pointSize += -2;
-                        } else if (*ptr == 7) {
-                            format.setFontWeight(QFont::Bold);
-                        } else if (*ptr == 8) {
-                            format.setFontFamilies({QStringLiteral("Courier New,courier")});
-                        } else if (*ptr == 11) {
-                            format.setVerticalAlignment(QTextCharFormat::AlignSuperScript);
-                        }
-                        format.setFontPointSize(qMax(pointSize, 1));
-
-                        context->cursor->setCharFormat(format);
-
-                        current_font = *ptr;
-                    }
-
-                } else if (fctype == PLKR_TFC_BITALIC) {
-                    QTextCharFormat format(context->cursor->charFormat());
-                    format.setFontItalic(true);
-                    context->cursor->setCharFormat(format);
-
-                    current_italic = true;
-
-                } else if (fctype == PLKR_TFC_EITALIC) {
-                    if (current_italic) {
-                        QTextCharFormat format(context->cursor->charFormat());
-                        format.setFontItalic(false);
-                        context->cursor->setCharFormat(format);
-                        current_italic = false;
-                    }
-
-                } else if (fctype == PLKR_TFC_BULINE) {
-                    QTextCharFormat format(context->cursor->charFormat());
-                    format.setFontUnderline(true);
-                    context->cursor->setCharFormat(format);
-                    current_underline = true;
-
-                } else if (fctype == PLKR_TFC_EULINE) {
-                    if (current_underline) {
-                        QTextCharFormat format(context->cursor->charFormat());
-                        format.setFontUnderline(false);
-                        context->cursor->setCharFormat(format);
-                        current_underline = false;
-                    }
-
-                } else if (fctype == PLKR_TFC_BSTRIKE) {
-                    QTextCharFormat format(context->cursor->charFormat());
-                    format.setFontStrikeOut(true);
-                    context->cursor->setCharFormat(format);
-                    current_struckthrough = true;
-
-                } else if (fctype == PLKR_TFC_ESTRIKE) {
-                    if (current_struckthrough) {
-                        QTextCharFormat format(context->cursor->charFormat());
-                        format.setFontStrikeOut(false);
-                        context->cursor->setCharFormat(format);
-                        current_struckthrough = false;
-                    }
-
-                } else if (fctype == PLKR_TFC_HRULE) {
-                    QTextCharFormat charFormat = context->cursor->charFormat();
-                    QTextBlockFormat oldBlockFormat = context->cursor->blockFormat();
-
-                    QTextBlockFormat blockFormat;
-                    blockFormat.setProperty(QTextFormat::BlockTrailingHorizontalRulerWidth, QStringLiteral("100%"));
-                    context->cursor->insertBlock(blockFormat);
-                    context->cursor->insertBlock(oldBlockFormat);
-                    context->cursor->setCharFormat(charFormat);
-                } else if (fctype == PLKR_TFC_ALIGN) {
-                    //                     current_alignment = 0;
-
-                    if (*ptr < 4) {
-                        QTextBlockFormat format(context->cursor->blockFormat());
-                        if (*ptr == 0) {
-                            format.setAlignment(Qt::AlignLeft);
-                        } else if (*ptr == 1) {
-                            format.setAlignment(Qt::AlignRight);
-                        } else if (*ptr == 2) {
-                            format.setAlignment(Qt::AlignCenter);
-                        } else if (*ptr == 3) {
-                            format.setAlignment(Qt::AlignJustify);
-                        }
-
-                        QTextCharFormat charFormat(context->cursor->charFormat());
-                        context->cursor->insertBlock(format);
-                        context->cursor->setCharFormat(charFormat);
-
-                        //                         current_alignment = (*ptr) + 1;
-                    }
-
-                } else if (fctype == PLKR_TFC_COLOR) {
-                    /* not sure what to do here yet */
-                    /*
-                    fprintf (fp, "<!-- color=\"#%02x%02x%02x\" -->",
-                             ptr[0], ptr[1], ptr[2]);*/
-                    //                     current_color =
-                    //                         (ptr[0] << 16) + (ptr[1] << 8) + ptr[2];
-
-                } else if (fctype == PLKR_TFC_IMAGE || fctype == PLKR_TFC_IMAGE2) {
-                    QTextCharFormat format = context->cursor->charFormat();
-                    context->cursor->insertImage(QStringLiteral("%1.jpg").arg((ptr[0] << 8) + ptr[1]));
-                    context->images.append((ptr[0] << 8) + ptr[1]);
-                    context->cursor->setCharFormat(format);
-                    AddRecord((ptr[0] << 8) + ptr[1]);
-
-                } else if (fctype == PLKR_TFC_TABLE) {
-                    int record_id, datalen;
-                    plkr_DataRecordType type = (plkr_DataRecordType)0;
-                    unsigned char *bytes = nullptr;
-
-                    record_id = (ptr[0] << 8) + ptr[1];
-                    bytes = plkr_GetRecordBytes(doc, record_id, &datalen, &type);
-
-                    TranscribeTableRecord(doc, context, bytes);
-
-                } else if (fctype == PLKR_TFC_UCHAR) {
-                    if (fclen == 3) {
-                        context->cursor->insertText(QChar((ptr[1] << 8) + ptr[2]));
-                    } else if (fclen == 5) {
-                        context->cursor->insertText(QChar((ptr[3] << 8) + ptr[4]));
-                    }
-                    /* skip over alternate text */
-                    ptr += ptr[0];
-                }
-
-                ptr += fclen;
-                run = ptr;
-            } else {
-                ptr++;
-            }
-        }
-
-        if ((ptr - run) > 0) {
-            /* output any pending text at the end of the paragraph */
-            context->cursor->insertText(QString::fromLatin1((char *)run, ptr - run));
-            textlen += (ptr - run);
-            run = ptr;
-        }
-
-        /* clear the graphics state again */
-
-        if (current_font > 0 && current_font < 9) {
-            if (!context->stack.isEmpty()) {
-                context->cursor->setCharFormat(context->stack.pop());
-            }
-        }
-
-        if (current_italic) {
-            QTextCharFormat format(context->cursor->charFormat());
-            format.setFontItalic(false);
-            context->cursor->setCharFormat(format);
-        }
-        if (current_underline) {
-            QTextCharFormat format(context->cursor->charFormat());
-            format.setFontUnderline(false);
-            context->cursor->setCharFormat(format);
-        }
-        if (current_struckthrough) {
-            QTextCharFormat format(context->cursor->charFormat());
-            format.setFontStrikeOut(false);
-            context->cursor->setCharFormat(format);
-        }
-    }
-    return true;
-}
-
-bool QUnpluck::TranscribeRecord(int index)
-{
-    plkr_DataRecordType type;
-    int data_len;
-    bool status = true;
-
-    unsigned char *data = plkr_GetRecordBytes(mDocument, index, &data_len, &type);
-    if (!data) {
-        MarkRecordDone(index);
-        return false;
-    }
-
-    if (type == PLKR_DRTYPE_TEXT_COMPRESSED || type == PLKR_DRTYPE_TEXT) {
-        QTextDocument *document = new QTextDocument;
-
-        QTextFrameFormat format(document->rootFrame()->frameFormat());
-        format.setMargin(20);
-        document->rootFrame()->setFrameFormat(format);
-
-        Context *context = new Context;
-        context->recordId = index;
-        context->document = document;
-        context->cursor = new QTextCursor(document);
-
-        QTextCharFormat charFormat;
-        charFormat.setFontPointSize(10);
-        charFormat.setFontFamilies({QStringLiteral("Helvetica")});
-        context->cursor->setCharFormat(charFormat);
-
-        status = TranscribeTextRecord(mDocument, index, context, data, type);
-        document->setTextWidth(600);
-
-        delete context->cursor;
-        mContext.append(context);
-    } else if (type == PLKR_DRTYPE_IMAGE_COMPRESSED || type == PLKR_DRTYPE_IMAGE) {
-        QImage image = TranscribeImageRecord(data);
-        mImages.insert(index, image);
-    } else if (type == PLKR_DRTYPE_MULTIIMAGE) {
-        QImage image;
-        if (TranscribeMultiImageRecord(mDocument, image, data)) {
-            mImages.insert(index, image);
-        }
-    } else {
-        status = false;
-    }
-
-    // plkr_GetHomeRecordID (doc)))
-
-    MarkRecordDone(index);
-
-    return status;
-}
diff --git a/generators/plucker/unpluck/qunpluck.h b/generators/plucker/unpluck/qunpluck.h
deleted file mode 100644
index 2f3768ae62..0000000000
--- a/generators/plucker/unpluck/qunpluck.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-    SPDX-FileCopyrightText: 2007 Tobias Koenig <tokoe at kde.org>
-
-    Based on code written by Bill Janssen 2002
-
-    SPDX-License-Identifier: GPL-2.0-or-later
-*/
-
-#ifndef QUNPLUCK_H
-#define QUNPLUCK_H
-
-#include <QImage>
-#include <QList>
-#include <QMap>
-#include <QTextBlock>
-
-#include "unpluck.h"
-
-class Context;
-class RecordNode;
-class QTextDocument;
-
-namespace Okular
-{
-class Action;
-}
-
-class Link
-{
-public:
-    Link()
-        : link(nullptr)
-    {
-    }
-
-    typedef QVector<Link> List;
-
-    Okular::Action *link;
-    QString url;
-    int page;
-    int start;
-    int end;
-};
-
-class QUnpluck
-{
-public:
-    QUnpluck();
-    ~QUnpluck();
-
-    QUnpluck(const QUnpluck &) = delete;
-    QUnpluck &operator=(const QUnpluck &) = delete;
-
-    bool open(const QString &fileName);
-
-    QList<QTextDocument *> pages() const
-    {
-        return mPages;
-    }
-    Link::List links() const
-    {
-        return mLinks;
-    }
-    QMap<QString, QString> infos() const
-    {
-        return mInfo;
-    }
-
-private:
-    int GetNextRecordNumber();
-    int GetPageID(int index);
-    void AddRecord(int index);
-    void MarkRecordDone(int index);
-    void SetPageID(int index, int page_id);
-    QString MailtoURLFromBytes(unsigned char *record_data);
-    void DoStyle(Context *context, int style, bool start);
-    bool TranscribeRecord(int index);
-    QImage TranscribeImageRecord(unsigned char *bytes);
-    bool TranscribeTableRecord(plkr_Document *doc, Context *context, unsigned char *bytes);
-    bool TranscribeTextRecord(plkr_Document *doc, int id, Context *context, unsigned char *bytes, plkr_DataRecordType type);
-    void ParseText(plkr_Document *doc, unsigned char *ptr, int text_len, int *font, int *style, Context *context);
-
-    plkr_Document *mDocument;
-    QList<RecordNode *> mRecords;
-
-    QList<Context *> mContext;
-    QList<QTextDocument *> mPages;
-    QMap<QString, QPair<int, QTextBlock>> mNamedTargets;
-    QMap<int, QImage> mImages;
-    QMap<QString, QString> mInfo;
-    QString mErrorString;
-    Link::List mLinks;
-};
-
-#endif
diff --git a/generators/plucker/unpluck/unpluck.cpp b/generators/plucker/unpluck/unpluck.cpp
deleted file mode 100644
index 1bc5f654ac..0000000000
--- a/generators/plucker/unpluck/unpluck.cpp
+++ /dev/null
@@ -1,956 +0,0 @@
-/* -*- mode: c; indent-tabs-mode: nil; -*-
-    $Id: unpluck.c,v 1.12 2003/12/28 20:59:21 chrish Exp $
-
-    unpluck -- a library to read Plucker data files
-    SPDX-FileCopyrightText: 2002 Bill Janssen
-
-    SPDX-License-Identifier: GPL-2.0-or-later
-
-*/
-
-#if !defined(WIN32)
-#include <unistd.h> /* for lseek, etc. */
-#else
-#include <io.h>
-#endif
-#include <assert.h> /* for assert() */
-#include <errno.h>  /* for errno */
-#include <fcntl.h>  /* for O_RDONLY */
-#include <stdlib.h>
-#include <string.h>   /* for strndup() */
-#include <sys/stat.h> /* for fstat() */
-#include <sys/types.h>
-
-#include <zlib.h>
-
-#include "unpluck.h"
-#include "unpluckint.h"
-
-/***********************************************************************/
-/***********************************************************************/
-/*****                                                             *****/
-/*****   Decompression code (taken from the Plucker PalmOS viewer  *****/
-/*****   sources, SPDX-FileCopyrightText: 1998-2002 Mark Ian Lillywhite *****/
-/*****   and Michael Nordstr�m, also under the GPL)                *****/
-/*****                                                             *****/
-/***********************************************************************/
-/***********************************************************************/
-
-/* uncompress DOC compressed document/image */
-static unsigned int UncompressDOC(unsigned char *src,   /* in:  compressed document */
-                                  unsigned int src_len, /* in:  size of compressed document */
-                                  unsigned char *dest,  /* out: buffer to put uncompressed
-                                                           document in */
-                                  unsigned int dest_len /* out: size of buffer to put uncompressed
-                                                             document in */
-)
-{
-    //     unsigned int  offset;
-    unsigned int src_index;
-    unsigned int dest_index;
-
-    assert(src != nullptr && src_len != 0 && dest != nullptr && dest_len != 0);
-
-    //     offset = 0;
-    src_index = 0;
-    dest_index = 0;
-    memset(dest, 0, dest_len);
-
-    while (src_index < src_len) {
-        unsigned int token;
-
-        token = (unsigned int)src[src_index++];
-        if (0 < token && token < 9) {
-            while (token != 0) {
-                dest[dest_index++] = src[src_index++];
-                token--;
-            }
-        } else if (token < 0x80) {
-            dest[dest_index++] = token;
-        } else if (0xc0 <= token) {
-            dest[dest_index++] = ' ';
-            dest[dest_index++] = token ^ 0x80;
-        } else {
-            int m;
-            int n;
-
-            token *= 256;
-            token += src[src_index++];
-
-            m = (token & 0x3fff) / 8;
-            n = token & 7;
-            n += 3;
-            while (n != 0) {
-                dest[dest_index] = dest[dest_index - m];
-                dest_index++;
-                n--;
-            }
-        }
-    }
-    assert(src_index == src_len && dest_index == dest_len);
-
-    return 1;
-}
-
-/* uncompress ZLib compressed document/image */
-static unsigned int UncompressZLib(unsigned char *src,     /* in:  compressed document */
-                                   unsigned int src_len,   /* in:  size of compressed document */
-                                   unsigned char *dest,    /* out: buffer to put uncompressed
-                                                              document in */
-                                   unsigned int dest_len,  /* out: size of buffer to put uncompressed
-                                                              document in */
-                                   unsigned char *owner_id /* in:  owner-id key */
-)
-{
-    z_stream z;
-    unsigned int err;
-    unsigned int keylen;
-    unsigned int i;
-    unsigned char keybuf[OWNER_ID_HASH_LEN];
-
-    assert(src != nullptr && src_len != 0 && dest != nullptr && dest_len != 0);
-
-    keylen = (owner_id == nullptr) ? 0 : MIN(src_len, OWNER_ID_HASH_LEN);
-
-    memset(&z, 0, sizeof z);
-
-    if (owner_id != nullptr) {
-        for (i = 0; i < keylen; i++) {
-            keybuf[i] = src[i] ^ owner_id[i];
-        }
-        z.next_in = keybuf;
-        z.avail_in = keylen;
-
-    } else {
-        z.next_in = src;
-        z.avail_in = src_len;
-    }
-
-    z.next_out = dest;
-    z.avail_out = dest_len;
-
-    err = inflateInit(&z);
-    if (err != Z_OK) {
-        return err;
-    }
-
-    do {
-        if (z.avail_in == 0 && keylen > 0) {
-            z.next_in = src + keylen;
-            z.avail_in = src_len - keylen;
-        }
-
-        err = inflate(&z, Z_SYNC_FLUSH);
-
-    } while (err == Z_OK);
-
-    if (err != Z_STREAM_END) {
-        return err;
-    }
-
-    assert(z.total_out == dest_len);
-
-    return inflateEnd(&z);
-}
-
-/***********************************************************************/
-/***********************************************************************/
-/*****                                                             *****/
-/*****   "Open" the DB (read the headers and parse the various     *****/
-/*****   metadata, like URLs, default categories, charsets, etc.)  *****/
-/*****                                                             *****/
-/***********************************************************************/
-/***********************************************************************/
-
-static void FreePluckerDoc(plkr_Document *doc)
-{
-    if (doc->name != nullptr) {
-        free(doc->name);
-    }
-    if (doc->title != nullptr) {
-        free(doc->title);
-    }
-    if (doc->author != nullptr) {
-        free(doc->author);
-    }
-    if (doc->records != nullptr) {
-        int i;
-        for (i = 0; i < doc->nrecords; i++) {
-            if (doc->records[i].cache != nullptr) {
-                free(doc->records[i].cache);
-            }
-        }
-        free(doc->records);
-    }
-    if (doc->urls != nullptr) {
-        free(doc->urls);
-    }
-    if (doc->handle != nullptr) {
-        doc->handle->free(doc->handle);
-    }
-    free(doc);
-}
-
-static plkr_DataRecord *FindRecordByIndex(plkr_Document *doc, int record_index)
-{
-    int imin;
-    int imax;
-    int itest;
-
-    for (imin = 0, imax = doc->nrecords; imin < imax;) {
-        itest = imin + (imax - imin) / 2;
-        /* _plkr_message("imin = %2d, imax = %2d, itest = %2d (%2d), record_index = %2d",
-           imin, imax, itest, doc->records[itest].uid, record_index); */
-        if (doc->records[itest].uid == record_index) {
-            return &doc->records[itest];
-        } else if (record_index > doc->records[itest].uid) {
-            imin = itest + 1;
-        } else if (record_index < doc->records[itest].uid) {
-            imax = itest;
-        }
-    }
-    return nullptr;
-}
-
-static int
-GetUncompressedRecord(plkr_Document *doc, plkr_DBHandle handle, int record_index, unsigned char *buffer, int buffer_size, plkr_DataRecordType expected_type, unsigned char **buffer_out, int *buffer_size_out, plkr_DataRecord **record_out)
-{
-    /* read whole data record, including header, into buffer.  If some part of the
-       record is compressed, uncompress it.  If "buffer" is NULL, allocate enough
-       bytes to fit.  Returns TRUE if read is successful, and sets "buffer_out" and
-       "buffer_size_out" and "record_out" on successful return. */
-
-    plkr_DataRecord *record;
-    unsigned char *tbuffer = buffer;
-    int size_needed;
-    int blen = buffer_size;
-
-    record = FindRecordByIndex(doc, record_index);
-    if (record == nullptr) {
-        _plkr_message("No record with index %d", record_index);
-        return FALSE;
-    };
-    if (expected_type != PLKR_DRTYPE_NONE && record->type != expected_type) {
-        _plkr_message("Record %d has unexpected type %d; expected %d", record_index, record->type, expected_type);
-        return FALSE;
-    }
-
-    /* figure size needed */
-    size_needed = record->uncompressed_size + 8;
-    if ((record->type == PLKR_DRTYPE_TEXT_COMPRESSED) || (record->type == PLKR_DRTYPE_TEXT)) {
-        size_needed += 4 * record->nparagraphs;
-    }
-
-    if (!buffer) {
-        if (buffer_out == nullptr) {
-            _plkr_message("No output buffer");
-            return FALSE;
-        } else if (record->cache) {
-            tbuffer = record->cache;
-            size_needed = record->cached_size;
-        } else {
-            tbuffer = (unsigned char *)malloc(size_needed);
-            blen = size_needed;
-        }
-    } else {
-        tbuffer = buffer;
-        if (buffer_size < size_needed) {
-            _plkr_message("Buffer too small; needs %d", size_needed);
-            return FALSE;
-        } else if (record->cache) {
-            memcpy(buffer, record->cache, record->cached_size);
-            size_needed = record->cached_size;
-        }
-    }
-
-    if (!record->cache) {
-        if ((record->type == PLKR_DRTYPE_TEXT_COMPRESSED) || (record->type == PLKR_DRTYPE_IMAGE_COMPRESSED) || (record->type == PLKR_DRTYPE_TABLE_COMPRESSED) || (record->type == PLKR_DRTYPE_GLYPHPAGE) ||
-            (record->type == PLKR_DRTYPE_LINKS_COMPRESSED)) {
-            unsigned char *start_of_data, *output_ptr;
-            int len_of_data, buf_to_use;
-            // int buffer_remaining;
-            unsigned char *buf = (unsigned char *)malloc(record->size);
-
-            if (!handle->seek(handle, record->offset) || (handle->read(handle, buf, record->size, record->size) != record->size)) {
-                _plkr_message("Bad read from DBHandle while reading record %d", record->uid);
-                free(buf);
-                if (tbuffer != buffer) {
-                    free(tbuffer);
-                }
-                return FALSE;
-            }
-
-            memcpy(tbuffer, buf, 8);
-            output_ptr = tbuffer + 8;
-            // buffer_remaining = blen - 8;
-            start_of_data = buf + 8;
-            len_of_data = record->size - 8;
-            if (record->type == PLKR_DRTYPE_TEXT_COMPRESSED) {
-                /* skip over the paragraph headers */
-                memcpy(output_ptr, start_of_data, 4 * record->nparagraphs);
-                start_of_data += (4 * record->nparagraphs);
-                len_of_data -= (4 * record->nparagraphs);
-                output_ptr += (4 * record->nparagraphs);
-                // buffer_remaining -= (4 * record->nparagraphs);
-            }
-
-            buf_to_use = size_needed - (start_of_data - buf);
-            if (doc->compression == PLKR_COMPRESSION_ZLIB) {
-                if (UncompressZLib(start_of_data, len_of_data, output_ptr, buf_to_use, (doc->owner_id_required ? doc->owner_id_key : nullptr)) != Z_OK) {
-                    _plkr_message("Bad Zlib uncompress of record %d", record_index);
-                    free(buf);
-                    if (tbuffer != buffer) {
-                        free(tbuffer);
-                    }
-                    return FALSE;
-                };
-            } else if (doc->compression == PLKR_COMPRESSION_DOC) {
-                if (UncompressDOC(start_of_data, len_of_data, output_ptr, buf_to_use) != 1) {
-                    _plkr_message("Bad DOC uncompress of record %d", record_index);
-                    free(buf);
-                    if (tbuffer != buffer) {
-                        free(tbuffer);
-                    }
-                    return FALSE;
-                };
-            }
-            free(buf);
-        } else {
-            /* all the record types which don't use compression */
-            if (!handle->seek(handle, record->offset) || (handle->read(handle, tbuffer, blen, size_needed) != size_needed)) {
-                _plkr_message("Bad read from DBHandle while reading record %d", record->uid);
-                if (tbuffer != buffer) {
-                    free(tbuffer);
-                }
-                return FALSE;
-            }
-        }
-    }
-
-    if (record_out) {
-        *record_out = record;
-    }
-    if (buffer_out) {
-        *buffer_out = tbuffer;
-    }
-    if (buffer_size_out) {
-        *buffer_size_out = size_needed;
-    }
-    return TRUE;
-}
-
-static int ParseCategories(plkr_Document *newdoc, plkr_DBHandle handle)
-{
-    struct _plkr_CategoryName *categories;
-    struct _plkr_CategoryName *newc;
-    plkr_DataRecord *record;
-    unsigned char *buf;
-    unsigned char *ptr;
-    int bufsize;
-
-    if (GetUncompressedRecord(newdoc, handle, newdoc->default_category_record_uid, nullptr, 0, PLKR_DRTYPE_CATEGORY, &buf, &bufsize, &record)) {
-        /* keep the record data, since the list of char * ptrs will point into it */
-        record->cache = buf;
-        record->cached_size = bufsize;
-        categories = nullptr;
-        for (ptr = buf + 8; (ptr - buf) < bufsize;) {
-            newc = (struct _plkr_CategoryName *)malloc(sizeof(struct _plkr_CategoryName));
-            newc->next = categories;
-            categories = newc;
-            newc->name = (char *)ptr;
-            ptr += (strlen((char *)ptr) + 1);
-        }
-        newdoc->default_categories = categories;
-        return TRUE;
-    } else {
-        return FALSE;
-    }
-}
-
-static int ParseMetadata(plkr_Document *newdoc, plkr_DBHandle handle)
-{
-    unsigned char *buf;
-    unsigned char *ptr;
-    int bufsize;
-    int nsubrecords;
-    int typecode;
-    int subrecord_length;
-    int i;
-
-    if (!GetUncompressedRecord(newdoc, handle, newdoc->metadata_record_uid, nullptr, 0, PLKR_DRTYPE_METADATA, &buf, &bufsize, nullptr)) {
-        return FALSE;
-    } else {
-        nsubrecords = (buf[8] << 8) + buf[9];
-        for (i = 0, ptr = buf + 10; i < nsubrecords; i++) {
-            typecode = (ptr[0] << 8) + ptr[1];
-            subrecord_length = ((ptr[2] << 8) + ptr[3]) * 2;
-
-            if (typecode == PLKR_MDTYPE_DEFAULTCHARSET) {
-                newdoc->default_charset_mibenum = (ptr[4] << 8) + ptr[5];
-                ptr += 6;
-
-            } else if (typecode == PLKR_MDTYPE_EXCEPTCHARSETS) {
-                int i, n, record_id, mibenum;
-                plkr_DataRecord *record;
-
-                ptr += 4;
-                for (i = 0, n = subrecord_length / 4; i < n; i++, ptr += 4) {
-                    record_id = (ptr[0] << 8) + ptr[1];
-                    mibenum = (ptr[2] << 8) + ptr[3];
-                    record = FindRecordByIndex(newdoc, record_id);
-                    if (record == nullptr) {
-                        _plkr_message("Can't find record with id %d", record_id);
-                        free(buf);
-                        return FALSE;
-                    }
-                    record->charset_mibenum = mibenum;
-                }
-
-            } else if (typecode == PLKR_MDTYPE_OWNERIDCRC) {
-                newdoc->owner_id_required = TRUE;
-                ptr += 8;
-
-            } else if (typecode == PLKR_MDTYPE_AUTHOR) {
-                newdoc->author = _plkr_strndup((char *)(ptr + 4), subrecord_length);
-                ptr += (4 + subrecord_length);
-
-            } else if (typecode == PLKR_MDTYPE_TITLE) {
-                newdoc->title = _plkr_strndup((char *)(ptr + 4), subrecord_length);
-                ptr += (4 + subrecord_length);
-
-            } else if (typecode == PLKR_MDTYPE_PUBLICATIONTIME) {
-                newdoc->publication_time = READ_BIGENDIAN_LONG(ptr + 4) - PLKR_TIMEADJUST;
-                ptr += 8;
-
-            } else {
-                _plkr_message("Bad metadata typecode %d encountered in metadata record", typecode);
-                free(buf);
-                return FALSE;
-            }
-        }
-        free(buf);
-        return TRUE;
-    }
-}
-
-static int ParseURLs(plkr_Document *newdoc, plkr_DBHandle handle)
-{
-    plkr_DataRecord *record;
-    unsigned char *buf;
-    unsigned char *ptr;
-    char **urls;
-    int id;
-    int i;
-    int n;
-    int count;
-    int nurls;
-    int bufsize;
-
-    struct url_index_record {
-        int last_url_index;
-        int record_id;
-    } * records;
-
-    buf = nullptr;
-    urls = nullptr;
-    records = nullptr;
-
-    if (!GetUncompressedRecord(newdoc, handle, newdoc->urls_index_record_uid, nullptr, 0, PLKR_DRTYPE_LINKS_INDEX, &buf, &bufsize, nullptr)) {
-        return FALSE;
-    } else {
-        n = ((buf[4] << 8) + buf[5]) / 4;
-        records = (struct url_index_record *)malloc(n * sizeof(*records));
-        for (i = 0, nurls = 0; i < n; i++) {
-            ptr = buf + 8 + (i * 4);
-            records[i].last_url_index = (ptr[0] << 8) + ptr[1];
-            records[i].record_id = (ptr[2] << 8) + ptr[3];
-#ifdef DEBUGURLS
-            _plkr_message("index %3d:  last = %d, record_id = %d", i, records[i].last_url_index, records[i].record_id);
-#endif /* def DEBUGURLS */
-            nurls = MAX(nurls, records[i].last_url_index);
-        }
-        free(buf);
-        buf = nullptr;
-    }
-
-    urls = (char **)malloc(nurls * sizeof(char *));
-    memset(urls, 0, nurls * sizeof(char *));
-
-    for (count = 0, i = 0; i < n; i++) {
-        id = records[i].record_id;
-        if (!GetUncompressedRecord(newdoc, handle, id, nullptr, 0, PLKR_DRTYPE_NONE, &buf, &bufsize, &record)) {
-            goto errout4;
-        }
-        if (record->type != PLKR_DRTYPE_LINKS && record->type != PLKR_DRTYPE_LINKS_COMPRESSED) {
-            _plkr_message("Supposed URLs record has bad type %d", record->type);
-            goto errout4;
-        }
-        record->cache = buf;
-        record->cached_size = bufsize;
-        buf = nullptr;
-        for (ptr = record->cache + 8; (ptr - record->cache) < record->cached_size; ptr += (strlen((char *)ptr) + 1)) {
-#ifdef DEBUGURLS
-            _plkr_message("%3d:  %s", count, ptr);
-#endif /* def DEBUGURLS */
-            assert(count < nurls);
-            urls[count++] = (char *)ptr;
-        }
-    }
-    free(records);
-    newdoc->urls = urls;
-    newdoc->nurls = nurls;
-
-    return TRUE;
-
-errout4:
-    if (buf != nullptr) {
-        free(buf);
-    }
-    free(urls);
-    free(records);
-    return FALSE;
-}
-
-plkr_Document *plkr_OpenDoc(plkr_DBHandle handle)
-{
-    ReservedRecordEntry reserved[MAX_RESERVED];
-    plkr_DataRecord *record;
-    plkr_Document *newdoc;
-    unsigned char utilbuf[128];
-    static char id_stamp[9] = "DataPlkr";
-    int i;
-    int nreserved;
-    int records_size;
-    int compression;
-
-    if (!handle->seek(handle, 0) || (handle->read(handle, utilbuf, sizeof(utilbuf), 78) != 78)) {
-        _plkr_message("Bad read of DB header");
-        return nullptr;
-    }
-
-    /* check for type stamp */
-    if (strncmp((char *)(utilbuf + 60), id_stamp, 8) != 0) {
-        _plkr_message("Bad magic number");
-        return nullptr;
-    }
-
-    /* check for version 1 */
-    i = (utilbuf[34] << 8) + utilbuf[35];
-    if (i != 1) {
-        _plkr_message("Not version 1 of Plucker format; version %d", i);
-        return nullptr;
-    }
-
-    /* get the title, creation time, and last modification time from header */
-    newdoc = (plkr_Document *)malloc(sizeof(plkr_Document));
-    memset(newdoc, 0, sizeof(plkr_Document));
-    newdoc->name = (char *)_plkr_strndup((char *)utilbuf, MIN(strlen((char *)utilbuf), 32));
-    newdoc->creation_time = (time_t)((utilbuf[36] << 24) + (utilbuf[37] << 16) + (utilbuf[38] << 8) + utilbuf[39] - PLKR_TIMEADJUST);
-    newdoc->modification_time = (time_t)((utilbuf[40] << 24) + (utilbuf[41] << 16) + (utilbuf[42] << 8) + utilbuf[43] - PLKR_TIMEADJUST);
-    newdoc->nrecords = (utilbuf[76] << 8) + utilbuf[77];
-
-    /* Now read the record-list to find out where the records are */
-    records_size = sizeof(plkr_DataRecord) * newdoc->nrecords;
-    newdoc->records = (plkr_DataRecord *)malloc(records_size);
-    memset(newdoc->records, 0, records_size);
-    for (i = 0; i < newdoc->nrecords; i++) {
-        if (handle->read(handle, utilbuf, sizeof(utilbuf), 8) != 8) {
-            _plkr_message("Bad read of record list");
-            FreePluckerDoc(newdoc);
-            return nullptr;
-        }
-        newdoc->records[i].offset = (utilbuf[0] << 24) + (utilbuf[1] << 16) + (utilbuf[2] << 8) + utilbuf[3];
-    }
-
-    /* process the index record */
-    if (!handle->seek(handle, newdoc->records[0].offset) || (handle->read(handle, utilbuf, sizeof(utilbuf), 6) != 6)) {
-        _plkr_message("Bad read of index record");
-        FreePluckerDoc(newdoc);
-        return nullptr;
-    }
-    if ((utilbuf[0] << 8) + utilbuf[1] != 1) {
-        _plkr_message("index record has bad UID %d", (utilbuf[0] << 8) + utilbuf[1]);
-        FreePluckerDoc(newdoc);
-        return nullptr;
-    }
-    newdoc->records[0].uid = 1;
-    compression = (utilbuf[2] << 8) + utilbuf[3];
-    if (compression == PLKR_COMPRESSION_DOC) {
-        newdoc->compression = PLKR_COMPRESSION_DOC;
-    } else if (compression == PLKR_COMPRESSION_ZLIB) {
-        newdoc->compression = PLKR_COMPRESSION_ZLIB;
-    } else {
-        _plkr_message("Unknown compression type %d", compression);
-        FreePluckerDoc(newdoc);
-        return nullptr;
-    }
-    nreserved = (utilbuf[4] << 8) + utilbuf[5];
-    if (nreserved > MAX_RESERVED) {
-        _plkr_message("Too many reserved records (%d) for software", nreserved);
-        FreePluckerDoc(newdoc);
-        return nullptr;
-    }
-    for (i = 0; i < nreserved; i++) {
-        if (handle->read(handle, utilbuf, sizeof(utilbuf), 4) != 4) {
-            _plkr_message("Bad read of reserved record list");
-            FreePluckerDoc(newdoc);
-            return nullptr;
-        }
-        reserved[i].name = (ReservedRecordName)((utilbuf[0] << 8) + utilbuf[1]);
-        reserved[i].uid = (utilbuf[2] << 8) + utilbuf[3];
-    }
-
-    /* OK, now process the data records */
-    newdoc->max_record_size = 0;
-    for (i = 1; i < newdoc->nrecords; i++) {
-        record = newdoc->records + i;
-        if (!handle->seek(handle, record->offset) || (handle->read(handle, utilbuf, sizeof(utilbuf), 8) != 8)) {
-            _plkr_message("Can't read header of record %d", i);
-            FreePluckerDoc(newdoc);
-            return nullptr;
-        }
-        newdoc->records[i - 1].size = record->offset - newdoc->records[i - 1].offset;
-        record->uid = (utilbuf[0] << 8) + utilbuf[1];
-        record->nparagraphs = (utilbuf[2] << 8) + utilbuf[3];
-        record->uncompressed_size = (utilbuf[4] << 8) + utilbuf[5];
-        record->type = (plkr_DataRecordType)utilbuf[6];
-        newdoc->max_record_size = MAX(newdoc->max_record_size, record->uncompressed_size);
-    }
-    /* To get the size of the last record we subtract its offset from the total size of the DB. */
-    if ((i = handle->size(handle)) == 0) {
-        _plkr_message("Can't obtain size of DB");
-        FreePluckerDoc(newdoc);
-        return nullptr;
-    };
-    record = newdoc->records + (newdoc->nrecords - 1);
-    record->size = i - record->offset;
-    /* make sure the uncompressed size is set, now that we know the record sizes */
-    for (i = 0; i < newdoc->nrecords; i++) {
-        record = newdoc->records + i;
-        if (record->uncompressed_size == 0) {
-            if (record->type == PLKR_DRTYPE_LINKS_COMPRESSED || record->type == PLKR_DRTYPE_TEXT_COMPRESSED || record->type == PLKR_DRTYPE_TABLE_COMPRESSED || record->type == PLKR_DRTYPE_IMAGE_COMPRESSED) {
-                _plkr_message("Bad uncompressed size 0 in record uid %d", record->uid);
-                FreePluckerDoc(newdoc);
-                return nullptr;
-            } else {
-                record->uncompressed_size = record->size - 8;
-            }
-        }
-#ifdef DEBUGOPEN
-        {
-            static char *types[] = {"TEXT", "TEXTC", "IMAGE", "IMAGEC", "MAILTO", "URLINDEX", "URLS", "URLSC", "BOOKMARKS", "CATEGORIES", "METADATA"};
-            _plkr_message("%3d:  type=%10s, offset=%07x, size=%5d, uncompressed_size=%5d", record->uid, types[MIN(record->type, sizeof(types) / sizeof(char *))], record->offset, record->size, record->uncompressed_size);
-        }
-#endif
-    }
-
-    /* find the reserved records */
-
-    /* do metadata first, to find out whether we need an owner_id key */
-    for (i = 0; i < nreserved; i++) {
-        if (reserved[i].name == PLKR_METADATA_NAME) {
-            newdoc->metadata_record_uid = reserved[i].uid;
-            if (!ParseMetadata(newdoc, handle)) {
-                _plkr_message("Error parsing metadata record");
-                FreePluckerDoc(newdoc);
-                return nullptr;
-            }
-        }
-    }
-
-    if (newdoc->owner_id_required) {
-        /* we need to set up the owner-id key before uncompressing
-           any records... */
-
-        char *owner_id = plkr_GetConfigString(nullptr, "owner_id", nullptr);
-
-        if (owner_id != nullptr) {
-            unsigned long crc;
-            int owner_id_len = strlen(owner_id);
-            crc = crc32(0L, nullptr, 0);
-            crc = crc32(crc, (const Bytef *)owner_id, owner_id_len);
-            for (i = 0; i < 10; i++) {
-                crc = crc32(crc, (const Bytef *)owner_id, owner_id_len);
-                newdoc->owner_id_key[(i * 4) + 0] = (unsigned char)((crc >> 24) & 0xFF);
-                newdoc->owner_id_key[(i * 4) + 1] = (unsigned char)((crc >> 16) & 0xFF);
-                newdoc->owner_id_key[(i * 4) + 2] = (unsigned char)((crc >> 8) & 0xFF);
-                newdoc->owner_id_key[(i * 4) + 3] = (unsigned char)(crc & 0xFF);
-            }
-        } else {
-            _plkr_message("Document requires owner-id to open");
-            FreePluckerDoc(newdoc);
-            return nullptr;
-        }
-    }
-
-    /* now do the rest of the reserved records */
-
-    for (i = 0; i < nreserved; i++) {
-        if (reserved[i].name == PLKR_HOME_NAME) {
-            newdoc->home_record_uid = reserved[i].uid;
-        } else if (reserved[i].name == PLKR_DEFAULT_CATEGORY_NAME) {
-            newdoc->default_category_record_uid = reserved[i].uid;
-            if (!ParseCategories(newdoc, handle)) {
-                _plkr_message("Error parsing default-categories record");
-                FreePluckerDoc(newdoc);
-                return nullptr;
-            }
-        } else if (reserved[i].name == PLKR_URLS_INDEX_NAME) {
-            newdoc->urls_index_record_uid = reserved[i].uid;
-            if (!ParseURLs(newdoc, handle)) {
-                _plkr_message("Error parsing URLs records");
-                FreePluckerDoc(newdoc);
-                return nullptr;
-            }
-        }
-    }
-
-    newdoc->handle = handle;
-
-#ifdef DEBUGOPEN
-    /* test the record fetch by fetching them! */
-    for (i = 1; i < newdoc->nrecords; i++) {
-        plkr_DataRecordType type;
-        int n;
-        printf(
-            "==============================================\n"
-            "record %3d (%d bytes)\n",
-            newdoc->records[i].uid,
-            newdoc->records[i].size);
-        (void)plkr_GetRecordBytes(newdoc, newdoc->records[i].uid, &n, &type);
-    }
-#endif
-
-    return newdoc;
-}
-
-int plkr_GetUidForIndex(plkr_Document *doc, int record_index)
-{
-    return doc->records[record_index].uid;
-}
-
-void plkr_CloseDoc(plkr_Document *doc)
-{
-    if (doc == nullptr) {
-        _plkr_message("Attempt to free NULL doc");
-    } else {
-        FreePluckerDoc(doc);
-    }
-}
-
-/***********************************************************************/
-/***********************************************************************/
-/*****                                                             *****/
-/*****         An implementation of a file-based DBHandle          *****/
-/*****                                                             *****/
-/***********************************************************************/
-/***********************************************************************/
-
-static int FpSeek(plkr_DBHandle handle, long offset)
-{
-    long result;
-
-    result = lseek(handle->dbprivate, offset, SEEK_SET);
-    if (result != offset) {
-        _plkr_message("Unable to seek fp %d to offset %lu -- %lu instead\n", handle->dbprivate, offset, result);
-    }
-    return (result == offset);
-}
-
-static int FpRead(plkr_DBHandle handle, unsigned char *buffer, int buffersize, int readsize)
-{
-    int result;
-
-    result = read(handle->dbprivate, buffer, MIN(buffersize, readsize));
-    if (result != readsize) {
-        _plkr_message("Unable to read %d bytes from fp %d -- read %d instead\n", MIN(buffersize, readsize), handle->dbprivate, result);
-    }
-    return (result);
-}
-
-static void FpFree(plkr_DBHandle handle)
-{
-    int fp = handle->dbprivate;
-
-    if (fp > 0) {
-        close(fp);
-    }
-}
-
-static long FpSize(plkr_DBHandle handle)
-{
-    int fp = handle->dbprivate;
-
-    struct stat buf;
-
-    if (fstat(fp, &buf) != 0) {
-        _plkr_message("Can't stat file; errno %d", errno);
-        return 0;
-    };
-    return buf.st_size;
-}
-
-plkr_Document *plkr_OpenDBFile(const char *filename)
-{
-    plkr_DBHandle handle;
-    plkr_Document *doc;
-    int fp;
-
-#if !defined(WIN32)
-    fp = open(filename, O_RDONLY);
-#else
-    fp = open(filename, O_RDONLY | O_BINARY);
-#endif
-    if (fp < 0) {
-        _plkr_message("Can't open file %s", filename);
-        return nullptr;
-    }
-    handle = (plkr_DBHandle)malloc(sizeof(*handle));
-    handle->dbprivate = fp;
-    handle->seek = FpSeek;
-    handle->read = FpRead;
-    handle->free = FpFree;
-    handle->size = FpSize;
-    doc = plkr_OpenDoc(handle);
-    if (doc == nullptr) {
-        close(fp);
-    }
-    return doc;
-}
-
-/***********************************************************************/
-/***********************************************************************/
-/*****                                                             *****/
-/*****   Routines to access individual uncompressed records        *****/
-/*****                                                             *****/
-/***********************************************************************/
-/***********************************************************************/
-
-int plkr_CopyRecordBytes(plkr_Document *doc, int record_index, unsigned char *output_buffer, int output_buffer_size, plkr_DataRecordType *type)
-{
-    plkr_DataRecord *record;
-    int output_size;
-
-    if (!FindRecordByIndex(doc, record_index)) {
-        return 0;
-    }
-
-    if (!GetUncompressedRecord(doc, doc->handle, record_index, output_buffer, output_buffer_size, PLKR_DRTYPE_NONE, nullptr, &output_size, &record)) {
-        return 0;
-    } else {
-        *type = record->type;
-        return output_size;
-    }
-}
-
-unsigned char *plkr_GetRecordBytes(plkr_Document *doc, int record_index, int *size, plkr_DataRecordType *type)
-{
-    plkr_DataRecord *record;
-    unsigned char *buf;
-
-    if (!FindRecordByIndex(doc, record_index)) {
-        return nullptr;
-    }
-
-    if (!GetUncompressedRecord(doc, doc->handle, record_index, nullptr, 0, PLKR_DRTYPE_NONE, &buf, size, &record)) {
-        return nullptr;
-    } else {
-        if (!record->cache) {
-            record->cache = buf;
-            record->cached_size = *size;
-        }
-        *type = record->type;
-        return buf;
-    }
-}
-
-int plkr_GetHomeRecordID(plkr_Document *doc)
-{
-    return doc->home_record_uid;
-}
-
-char *plkr_GetName(plkr_Document *doc)
-{
-    return doc->name;
-}
-
-char *plkr_GetTitle(plkr_Document *doc)
-{
-    return doc->title;
-}
-
-char *plkr_GetAuthor(plkr_Document *doc)
-{
-    return doc->author;
-}
-
-int plkr_GetDefaultCharset(plkr_Document *doc)
-{
-    return doc->default_charset_mibenum;
-}
-
-unsigned long plkr_GetPublicationTime(plkr_Document *doc)
-{
-    if (doc->publication_time) {
-        return (unsigned long)doc->publication_time;
-    } else {
-        return (unsigned long)doc->creation_time;
-    }
-}
-
-plkr_CategoryList plkr_GetDefaultCategories(plkr_Document *doc)
-{
-    return doc->default_categories;
-}
-
-int plkr_GetRecordCount(plkr_Document *doc)
-{
-    return doc->nrecords;
-}
-
-int plkr_GetMaxRecordSize(plkr_Document *doc)
-{
-    return doc->max_record_size;
-}
-
-char *plkr_GetRecordURL(plkr_Document *doc, int record_index)
-{
-    if (record_index < 1 || record_index > doc->nurls) {
-        return nullptr;
-    } else {
-        return (doc->urls[record_index - 1]);
-    }
-}
-
-int plkr_HasRecordWithID(plkr_Document *doc, int record_index)
-{
-    return (FindRecordByIndex(doc, record_index) != nullptr);
-}
-
-int plkr_GetRecordType(plkr_Document *doc, int record_index)
-{
-    plkr_DataRecord *r;
-
-    r = FindRecordByIndex(doc, record_index);
-    if (r) {
-        return r->type;
-    } else {
-        return PLKR_DRTYPE_NONE;
-    }
-}
-
-int plkr_GetRecordCharset(plkr_Document *doc, int record_index)
-{
-    plkr_DataRecord *r;
-
-    r = FindRecordByIndex(doc, record_index);
-    if (r && ((r->type == PLKR_DRTYPE_TEXT_COMPRESSED) || (r->type == PLKR_DRTYPE_TEXT))) {
-        if (r->charset_mibenum == 0) {
-            return doc->default_charset_mibenum;
-        } else {
-            return r->charset_mibenum;
-        }
-    } else {
-        return 0;
-    }
-}
diff --git a/generators/plucker/unpluck/unpluck.h b/generators/plucker/unpluck/unpluck.h
deleted file mode 100644
index 2c50bc7843..0000000000
--- a/generators/plucker/unpluck/unpluck.h
+++ /dev/null
@@ -1,288 +0,0 @@
-/* -*- mode: c; indent-tabs-mode: nil; -*-
-    $Id: unpluck.h,v 1.8 2003/12/28 20:59:21 chrish Exp $
-
-    unpluck -- a library to read Plucker data files
-    SPDX-FileCopyrightText: 2002 Bill Janssen
-
-    SPDX-License-Identifier: GPL-2.0-or-later
-
-*/
-#ifndef UNPLUCK_H
-#define UNPLUCK_H
-/*
- * This header file should be included after an #include of glib.h
- */
-
-/* This represents a raw Palm DB.  It's intended to be an abstraction
-   of a file pointer, so that raw memory can also be used. */
-typedef struct plkr_DBHandle_s *plkr_DBHandle;
-struct plkr_DBHandle_s {
-    int dbprivate;
-
-    /* Call seek to position the DB stream at the "offset" byte from the start of the DB.
-       Returns non-zero if seek has been successfully done, zero otherwise. */
-    int (*seek)(plkr_DBHandle handle, long offset);
-
-    /* Call read to read "readsize" bytes into "buffer", which is at least "buffersize" bytes large.
-       Returns number of bytes read. */
-    int (*read)(plkr_DBHandle handle, unsigned char *buffer, int buffersize, int readsize);
-
-    /* When called will return total size of DB */
-    long (*size)(plkr_DBHandle handle);
-
-    /* Hook that will be called when unpluck finishes with the handle. */
-    void (*free)(plkr_DBHandle handle);
-};
-
-typedef enum {
-    PLKR_DRTYPE_TEXT = 0,
-    PLKR_DRTYPE_TEXT_COMPRESSED = 1,
-    PLKR_DRTYPE_IMAGE = 2,
-    PLKR_DRTYPE_IMAGE_COMPRESSED = 3,
-    PLKR_DRTYPE_MAILTO = 4,
-    PLKR_DRTYPE_LINKS_INDEX = 5,
-    PLKR_DRTYPE_LINKS = 6,
-    PLKR_DRTYPE_LINKS_COMPRESSED = 7,
-    PLKR_DRTYPE_BOOKMARKS = 8,
-    PLKR_DRTYPE_CATEGORY = 9,
-    PLKR_DRTYPE_METADATA = 10,
-    PLKR_DRTYPE_GLYPHPAGE = 11,
-    PLKR_DRTYPE_FONT_PAGE = 12,
-    PLKR_DRTYPE_TABLE = 13,
-    PLKR_DRTYPE_TABLE_COMPRESSED = 14,
-    PLKR_DRTYPE_MULTIIMAGE = 15,
-
-    /* this record type is not used in the Plucker DB */
-    PLKR_DRTYPE_NONE = 0xFFFF
-} plkr_DataRecordType;
-
-#define PLKR_FC_CODE(v) (((v) >> 3) & 0x1F)
-
-typedef enum {
-    PLKR_TFC_LINK = PLKR_FC_CODE(0x0A),    /* page or span link start or end */
-    PLKR_TFC_FONT = PLKR_FC_CODE(0x11),    /* set font */
-    PLKR_TFC_IMAGE = PLKR_FC_CODE(0x1A),   /* embedded image */
-    PLKR_TFC_MARGINS = PLKR_FC_CODE(0x22), /* set left and right margins */
-    PLKR_TFC_ALIGN = PLKR_FC_CODE(0x29),   /* set text alignment */
-    PLKR_TFC_HRULE = PLKR_FC_CODE(0x33),   /* horizontal rule */
-    PLKR_TFC_NEWLINE = PLKR_FC_CODE(0x38), /* start new line */
-    PLKR_TFC_BITALIC = PLKR_FC_CODE(0x40), /* begin italic text */
-    PLKR_TFC_EITALIC = PLKR_FC_CODE(0x48), /* end italic text */
-    PLKR_TFC_COLOR = PLKR_FC_CODE(0x53),   /* set text color */
-    PLKR_TFC_IMAGE2 = PLKR_FC_CODE(0x5C),  /* double embedded image */
-    PLKR_TFC_BULINE = PLKR_FC_CODE(0x60),  /* begin underline text */
-    PLKR_TFC_EULINE = PLKR_FC_CODE(0x68),  /* end underline text */
-    PLKR_TFC_BSTRIKE = PLKR_FC_CODE(0x70), /* begin struck-through text */
-    PLKR_TFC_ESTRIKE = PLKR_FC_CODE(0x78), /* end struck-through text */
-    PLKR_TFC_UCHAR = PLKR_FC_CODE(0x83),   /* 16 or 32 bit Unicode character */
-    PLKR_TFC_GLYPH = PLKR_FC_CODE(0x88),   /* glyph run */
-    PLKR_TFC_TABLE = PLKR_FC_CODE(0x90)    /* table data */
-} plkr_TextFunctionCodes;
-
-typedef enum { PLKR_FONT_REGULAR = 0, PLKR_FONT_H1 = 1, PLKR_FONT_H2 = 2, PLKR_FONT_H3 = 3, PLKR_FONT_H4 = 4, PLKR_FONT_H5 = 5, PLKR_FONT_H6 = 6, PLKR_FONT_REGULARBOLD = 7, PLKR_FONT_FIXEDWIDTH = 8 } plkr_FontStyles;
-
-typedef struct _plkr_CategoryName {
-    char *name;
-    struct _plkr_CategoryName *next;
-} * plkr_CategoryList;
-
-typedef struct plkr_Document_s plkr_Document;
-
-/* ====================================================================== */
-
-/* A number of functions defined in the library */
-
-/* plkr_OpenDBFile
-
-   Opens a Plucker document stored as a file indicated by "filename",
-   and returns a document handle.  A NULL value is returned if some
-   aspect of the open or parse of the document structure fails.
-   This call consumes a file descriptor, which is held till a subsequent
-   call to plkr_CloseDoc.
-*/
-plkr_Document *plkr_OpenDBFile(const char * /* filename */
-);
-
-/* plkr_OpenDoc
-
-   A more general form of open.  The caller can pass in a
-   plkr_DBHandle which might provide access to the bytes of the
-   document in an arbitrary way.  A NULL value is returned if some
-   aspect of the open or parse of the document structure fails.
-*/
-plkr_Document *plkr_OpenDoc(plkr_DBHandle);
-
-/* plkr_CloseDoc
-
-   Closes the document and frees all storage associated with it,
-   including cached record data.  Invokes the "free" method on
-   the plkr_DBHandle used to open the document.  After this call,
-   the plkr_Document pointer is now invalid.
-*/
-void plkr_CloseDoc(plkr_Document *);
-
-/* plkr_CopyRecordBytes
-
-   Copies the uncompressed bytes of the data of the specified record
-   to the user-provided output buffer, and returns the number of bytes
-   copied.  This call does not cache the uncompressed bytes.  The type
-   of the record is returned in the "type" parameter.  Zero bytes
-   will be copied if the output buffer is too small for the record
-   data.  A 64K buffer will always be large enough; a call to
-   plkr_GetMaxRecordSize will return the uncompressed size of the largest
-   record in the document.
-*/
-int plkr_CopyRecordBytes(plkr_Document *, int /* record_index */, unsigned char * /* output_buffer */, int /* output_buffer_size */, plkr_DataRecordType * /* output: type */
-);
-
-/* plkr_GetUidForIndex
-
-   Retrieve the uid of the record with the given index.
-*/
-int plkr_GetUidForIndex(plkr_Document *, int /* record_index */
-);
-
-/* plkr_GetRecordBytes
-
-   Retrieve a static pointer to a buffer containing the uncompressed
-   data of the specified record.  This causes the buffer to be cached
-   by the implementation; do not free() the returned pointer!  The
-   size of the buffer is returned through the "size" parameter; the
-   type of the record is returned through the "type" parameter.
-   May return NULL if the "record_index" value is out-of-range.
-*/
-unsigned char *plkr_GetRecordBytes(plkr_Document *, int /* record_index */, int * /* output: size */, plkr_DataRecordType * /* output: type */
-);
-
-/* plkr_GetRecordURL
-
-   Retrieve a static pointer to the URL string for the specified record.
-   May return NULL if "record_index" is out-of-range, or if no URLs were
-   included in the document.  Fetching the URL for the home page is a good
-   way to test for the latter.
-*/
-char *plkr_GetRecordURL(plkr_Document *, int record_index);
-
-/* plkr_GetHomeRecordID
-
-   Retrieve the record UID for the 'home' page, the root node of the
-   document.
-*/
-int plkr_GetHomeRecordID(plkr_Document *);
-
-/* plkr_GetName
-
-   Retrieve a static pointer to the short name of the document.
-*/
-char *plkr_GetName(plkr_Document *);
-
-/* plkr_GetTitle
-
-   Retrieve a static pointer to the title of the document.  Returns NULL if no title was specified.
-*/
-char *plkr_GetTitle(plkr_Document *);
-
-/* plkr_GetAuthor
-
-   Retrieve a static pointer to the name of the author of the document.  Returns NULL if no author was specified.
-*/
-char *plkr_GetAuthor(plkr_Document *);
-
-/* plkr_GetDefaultCharset
-
-   Returns the IANA mibenum of the default charset used in the document, or 0 if none was specified.
-*/
-int plkr_GetDefaultCharset(plkr_Document *);
-
-/* plkr_GetPublicationTime
-
-   Returns the time of publication of the document as an unsigned integer.  If no explicit
-   publication time was included in the document, returns the creation date, which may be more recent.
-   Time is expressed as seconds past 12:00 am, Jan 1, 1970 -- the UNIX "epoch".
-*/
-unsigned long plkr_GetPublicationTime(plkr_Document *);
-
-/* plkr_GetRecordCount
-
-   Returns the number of records in the document.
-*/
-int plkr_GetRecordCount(plkr_Document *);
-
-/* plkr_GetMaxRecordSize
-
-   Returns the uncompressed data size of the largest record in the document.
-*/
-int plkr_GetMaxRecordSize(plkr_Document *);
-
-/* plkr_GetDefaultCategories
-
-   Retrieve a static GSList of char * values that are the default categories
-   assigned to the document.
-*/
-plkr_CategoryList plkr_GetDefaultCategories(plkr_Document *);
-
-/* plkr_HasRecordWithID
-
-   Returns 1 if the document has a record with the specified ID, 0 otherwise.
-*/
-int plkr_HasRecordWithID(plkr_Document *, int /* ID */
-);
-
-/* plkr_GetRecordType
-
-   Returns type of record, or PLKR_DRTYPE_NONE if record doesn't exist.
-*/
-int plkr_GetRecordType(plkr_Document *, int /* ID */
-);
-
-/* plkr_GetRecordCharset
-
-   Returns the mibenum of the charset of the record, if the record is a text record,
-   or 0 if the record doesn't exist or is not a text record.
-*/
-int plkr_GetRecordCharset(plkr_Document *, int /* ID */
-);
-
-/* plkr_ShowMessages
-
-   Controls whether or not message display is enabled.  Call with 1 for messages
-   to be displayed, 0 for no display.  Initial value is 0.  Returns previous value.
-*/
-int plkr_ShowMessages(int);
-
-/* plkr_GetConfigString
-
-   Returns the string value for the option named "option_name" in section named
-   "section_name", if any, or "default_value" if no setting for that name.
-   If "section_name" is NULL, the default section ("default") is used.  Section
-   names and option names should be all lowercase.
-*/
-char *plkr_GetConfigString(const char *section_name, const char *option_name, char *default_value);
-
-/* plkr_GetConfigInt
-
-   Returns the int value for the option named "option_name" in section named
-   "section_name", if any, or "default_value" if no setting for that name.
-   If "section_name" is NULL, the default section ("default") is used.  Section
-   names and option names should be all lowercase.
-*/
-long int plkr_GetConfigInt(const char *section_name, const char *option_name, long int default_value);
-
-/* plkr_GetConfigFloat
-
-   Returns the double value for the option named "option_name" in section named
-   "section_name", if any, or "default_value" if no setting for that name.
-   If "section_name" is NULL, the default section ("default") is used.  Section
-   names and option names should be all lowercase.
-*/
-double plkr_GetConfigFloat(const char *section_name, const char *option_name, double default_value);
-
-/* plkr_GetConfigBoolean
-
-   Returns the boolean value for the option named "option_name" in section named
-   "section_name", if any, or "default_value" if no setting for that name.
-   If "section_name" is NULL, the default section ("default") is used.  Section
-   names and option names should be all lowercase.
-*/
-int plkr_GetConfigBoolean(const char *section_name, const char *option_name, int default_value);
-#endif
diff --git a/generators/plucker/unpluck/unpluckint.h b/generators/plucker/unpluck/unpluckint.h
deleted file mode 100644
index 1eae492ec8..0000000000
--- a/generators/plucker/unpluck/unpluckint.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/* -*- mode: c; indent-tabs-mode: nil; -*-
-    $Id: unpluckint.h,v 1.5 2003/12/28 20:59:21 chrish Exp $
-
-    unpluck -- a library to read Plucker data files
-    SPDX-FileCopyrightText: 2002 Bill Janssen
-
-    SPDX-License-Identifier: GPL-2.0-or-later
-
-*/
-#ifndef UNPLUGINT_H
-#define UNPLUGINT_H
-/*
- * This header file should be included after an #include of glib.h
- */
-
-#define PLKR_TIMEADJUST                                                                                                                                                                                                                        \
-    2082848400 /* difference in seconds between                                                                                                                                                                                                \
-                  Palm timebase of 12 AM Jan 1, 1904,                                                                                                                                                                                          \
-                  and UNIX timebase of 12 AM Jan 1, 1970 */
-
-#define MAX_RESERVED 8
-
-#define OWNER_ID_HASH_LEN 40
-
-#ifndef MAX
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
-#endif
-
-#ifndef MIN
-#define MIN(a, b) (((a) < (b)) ? (a) : (b))
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#define READ_BIGENDIAN_SHORT(p) (((p)[0] << 8) | ((p)[1]))
-#define READ_BIGENDIAN_LONG(p) (((p)[0] << 24) | ((p)[1] << 16) | ((p)[2] << 8) | ((p)[3]))
-
-typedef enum { PLKR_HOME_NAME = 0, PLKR_URLS_INDEX_NAME = 2, PLKR_DEFAULT_CATEGORY_NAME = 3, PLKR_METADATA_NAME = 4 } ReservedRecordName;
-
-typedef struct {
-    int uid;
-    ReservedRecordName name;
-} ReservedRecordEntry;
-
-typedef enum { PLKR_MDTYPE_DEFAULTCHARSET = 1, PLKR_MDTYPE_EXCEPTCHARSETS = 2, PLKR_MDTYPE_OWNERIDCRC = 3, PLKR_MDTYPE_AUTHOR = 4, PLKR_MDTYPE_TITLE = 5, PLKR_MDTYPE_PUBLICATIONTIME = 6 } MetadataTypecodes;
-
-typedef enum { PLKR_COMPRESSION_DOC = 1, PLKR_COMPRESSION_ZLIB = 2 } plkr_CompressionType;
-
-typedef struct plkr_DataRecord_s plkr_DataRecord;
-
-/* A structure to hold information about each record */
-struct plkr_DataRecord_s {
-    long offset;
-    int size;              /* size in DB */
-    int uncompressed_size; /* size of compressed portion, when uncompressed */
-    int cached_size;       /* size of cached buffer, if cache is non-NULL */
-    int uid;
-    int nparagraphs;
-    plkr_DataRecordType type;
-    unsigned char *cache; /* cache of uncompressed full record */
-    int charset_mibenum;
-};
-
-/* The main data structure for the document */
-struct plkr_Document_s {
-    plkr_DBHandle handle;
-    char *name;              /* short name in header */
-    char *title;             /* title in metadata, if any */
-    char *author;            /* author in metadata, if any */
-    time_t publication_time; /* from metadata, if at all */
-    time_t creation_time;    /* from header */
-    time_t modification_time;
-    plkr_CompressionType compression;
-    int nrecords;
-    plkr_DataRecord *records;
-    int max_record_size;
-    int home_record_uid;
-    int default_category_record_uid;
-    int metadata_record_uid;
-    int urls_index_record_uid;
-    char **urls;
-    int nurls;
-    plkr_CategoryList default_categories;
-    int default_charset_mibenum;
-    int owner_id_required; /* 1 for yes, 0 for no */
-    unsigned char owner_id_key[40];
-};
-
-/***********************************************************************/
-/***********************************************************************/
-/*****                                                             *****/
-/*****   Some simple utility routines so we don't need GLib        *****/
-/*****                                                             *****/
-/***********************************************************************/
-/***********************************************************************/
-
-typedef struct HashTable HashTable;
-
-void _plkr_message(const char *formatSpec, ...)
-#ifdef __GNUC__
-    __attribute__((format(printf, 1, 2)))
-#endif
-    ;
-/* Display the message to stderr */
-
-char *_plkr_strndup(const char *str, int len);
-/* return a freshly-malloced copy of str */
-
-HashTable *_plkr_NewHashTable(int size);
-/* create an instance of a string-keyed hash table and return it.
-   "size" is the number of buckets to start with -- should be prime. */
-
-void *_plkr_FindInTable(HashTable *ht, const char *key);
-/* lookup the specified "key" in the specified "ht". */
-
-void *_plkr_RemoveFromTable(HashTable *ht, const char *key);
-/* remove the entry with "key" from the table, if present, and return
-   the value as the result. */
-
-int _plkr_AddToTable(HashTable *ht, const char *key, void *obj);
-/* Add the specified "obj" to the table with key "key".  Returns
-   0 if key is already in table (and doesn't add "obj"), and returns
-   1 if key was added to table. */
-
-#endif
diff --git a/generators/plucker/unpluck/util.cpp b/generators/plucker/unpluck/util.cpp
deleted file mode 100644
index 4e76c4880b..0000000000
--- a/generators/plucker/unpluck/util.cpp
+++ /dev/null
@@ -1,213 +0,0 @@
-/* -*- mode: c; indent-tabs-mode: nil; -*-
-    $Id: util.c,v 1.3 2003/12/28 20:59:21 chrish Exp $
-
-    util -- Some simple utility routines so we don't need GLib
-    SPDX-FileCopyrightText: 2002 Bill Janssen
-
-    SPDX-License-Identifier: GPL-2.0-or-later
-
-*/
-
-#if !defined(WIN32)
-#include <unistd.h> /* for lseek, etc. */
-#else
-#include <io.h>
-#endif
-#include <assert.h> /* for assert() */
-#include <errno.h>  /* for errno */
-#include <fcntl.h>  /* for O_RDONLY */
-#include <stdarg.h> /* for _plkr_message */
-#include <stdio.h>  /* for stderr */
-#include <stdlib.h>
-#include <string.h>   /* for strndup() */
-#include <sys/stat.h> /* for fstat() */
-#include <sys/types.h>
-
-#include <zlib.h>
-
-#include "unpluck.h"
-#include "unpluckint.h"
-
-/***********************************************************************/
-/***********************************************************************/
-/*****                                                             *****/
-/*****                       Messages                              *****/
-/*****                                                             *****/
-/***********************************************************************/
-/***********************************************************************/
-
-static int ShowMessages = 0;
-
-void _plkr_message(const char *formatSpec, ...)
-{
-    va_list ap;
-
-    va_start(ap, formatSpec);
-
-    if (ShowMessages) {
-        (void)vfprintf(stderr, formatSpec, ap);
-        fprintf(stderr, "\n");
-    }
-
-    va_end(ap);
-}
-
-int plkr_ShowMessages(int val)
-{
-    int oldval = ShowMessages;
-
-    ShowMessages = val;
-    return oldval;
-}
-
-/***********************************************************************/
-/***********************************************************************/
-/*****                                                             *****/
-/*****                   String Utilities                          *****/
-/*****                                                             *****/
-/***********************************************************************/
-/***********************************************************************/
-
-char *_plkr_strndup(const char *str, int len)
-{
-    char *dup;
-
-    dup = (char *)malloc(len + 1);
-    strncpy(dup, str, len);
-    dup[len] = 0;
-    return dup;
-}
-
-/***********************************************************************/
-/***********************************************************************/
-/*****                                                             *****/
-/*****  Simple hash table maps string keys to void * values        *****/
-/*****                                                             *****/
-/***********************************************************************/
-/***********************************************************************/
-
-typedef struct {
-    char *he_key;
-    void *he_data;
-} HashEntry;
-
-typedef struct {
-    int hs_count;
-    int hs_allocated;
-    HashEntry *hs_entries;
-} HashTableSlot;
-
-struct HashTable {
-    int ht_size;
-    int ht_nPairs;
-    HashTableSlot *ht_slots;
-};
-
-#define HASH_INCREMENT_SIZE 5
-
-#define hashtable_slot(ht, index) (&((ht)->ht_slots[index]))
-#define hashtable_hash_index(ht, key) (HashString((key), (ht)->ht_size))
-#define hashtable_compare_keys(ht, key1, key2) (CompareStrings((key1), (key2)))
-
-static int CompareStrings(const char *key1, const char *key2)
-{
-    return (strcmp(key1, key2) == 0);
-}
-
-static int HashString(const char *str, int size)
-{
-    unsigned long crc;
-
-    crc = crc32(0L, nullptr, 0);
-    crc = crc32(crc, (const Bytef *)str, strlen(str));
-    return (crc % size);
-}
-
-void *_plkr_FindInTable(HashTable *ht, const char *key)
-{
-    HashTableSlot *slot;
-    int count;
-
-    if (ht == nullptr) {
-        return (nullptr);
-    }
-    slot = hashtable_slot(ht, hashtable_hash_index(ht, key));
-    for (count = slot->hs_count; count > 0; count -= 1) {
-        if (hashtable_compare_keys(ht, key, slot->hs_entries[count - 1].he_key)) {
-            return (slot->hs_entries[count - 1].he_data);
-        }
-    }
-    return (nullptr);
-}
-
-void *_plkr_RemoveFromTable(HashTable *ht, const char *key)
-{
-    HashTableSlot *slot;
-    int count;
-
-    if (ht == nullptr) {
-        return (nullptr);
-    }
-
-    slot = hashtable_slot(ht, hashtable_hash_index(ht, key));
-    for (count = 0; count < slot->hs_count; count += 1) {
-        if (hashtable_compare_keys(ht, slot->hs_entries[count].he_key, key)) {
-            void *data = slot->hs_entries[count].he_data;
-            free(slot->hs_entries[count].he_key);
-            if ((1 + (unsigned)count) < (unsigned)slot->hs_count) {
-                slot->hs_entries[count] = slot->hs_entries[slot->hs_count - 1];
-            }
-            --ht->ht_nPairs;
-            if (--slot->hs_count <= 0) {
-                free(slot->hs_entries);
-                slot->hs_entries = nullptr;
-                slot->hs_allocated = 0;
-                slot->hs_count = 0;
-            }
-            return (data);
-        }
-    }
-    return (nullptr);
-}
-
-int _plkr_AddToTable(HashTable *ht, const char *key, void *obj)
-{
-    HashTableSlot *slot;
-    int count;
-
-    if (ht == nullptr) {
-        return (0);
-    }
-
-    slot = hashtable_slot(ht, hashtable_hash_index(ht, key));
-
-    for (count = slot->hs_count; count > 0; count -= 1) {
-        if (hashtable_compare_keys(ht, key, slot->hs_entries[count - 1].he_key)) {
-            return (0);
-        }
-    }
-
-    if (slot->hs_allocated == 0) {
-        slot->hs_allocated = HASH_INCREMENT_SIZE;
-        slot->hs_entries = (HashEntry *)malloc(sizeof(HashEntry) * slot->hs_allocated);
-        slot->hs_count = 0;
-    } else if (slot->hs_count >= slot->hs_allocated) {
-        slot->hs_entries = (HashEntry *)realloc(slot->hs_entries, (slot->hs_allocated += HASH_INCREMENT_SIZE) * sizeof(HashEntry));
-    }
-    slot->hs_entries[slot->hs_count].he_key = _plkr_strndup(key, strlen(key));
-    slot->hs_entries[slot->hs_count].he_data = obj;
-    slot->hs_count += 1;
-    ht->ht_nPairs += 1;
-    return (1);
-}
-
-HashTable *_plkr_NewHashTable(int size)
-{
-    HashTable *newHash = (HashTable *)malloc(sizeof(HashTable));
-
-    newHash->ht_size = size;
-    newHash->ht_nPairs = 0;
-    newHash->ht_slots = (HashTableSlot *)malloc(sizeof(HashTableSlot) * size);
-    memset((void *)(newHash->ht_slots), 0, sizeof(HashTableSlot) * size);
-    return (newHash);
-}



More information about the kde-doc-english mailing list