Commit fb4c69d2 authored by Albert Astals Cid's avatar Albert Astals Cid

Remove the Qt4 frontend

parent bb0011b7
......@@ -5,7 +5,6 @@ poppler-cairo.pc
poppler-cpp.pc
poppler-glib.pc
poppler-qt.pc
poppler-qt4.pc
poppler-qt5.pc
poppler-splash.pc
poppler.pc
......@@ -17,7 +16,6 @@ poppler-cairo-uninstalled.pc
poppler-cpp-uninstalled.pc
poppler-glib-uninstalled.pc
poppler-qt-uninstalled.pc
poppler-qt4-uninstalled.pc
poppler-qt5-uninstalled.pc
poppler-splash-uninstalled.pc
poppler-uninstalled.pc
......
......@@ -40,7 +40,6 @@ set (CMAKE_CXX_EXTENSIONS OFF)
# command line switches
option(ENABLE_XPDF_HEADERS "Install unsupported xpdf headers." OFF)
option(BUILD_GTK_TESTS "Whether compile the GTK+ test programs." ON)
option(BUILD_QT4_TESTS "Whether compile the Qt4 test programs." ON)
option(BUILD_QT5_TESTS "Whether compile the Qt5 test programs." ON)
option(BUILD_CPP_TESTS "Whether compile the CPP test programs." ON)
option(ENABLE_SPLASH "Build the Splash graphics backend." ON)
......@@ -48,7 +47,6 @@ option(ENABLE_UTILS "Compile poppler command line utils." ON)
option(ENABLE_CPP "Compile poppler cpp wrapper." ON)
option(ENABLE_GLIB "Compile poppler glib wrapper." ON)
option(ENABLE_GTK_DOC "Whether to generate glib API documentation." OFF)
option(ENABLE_QT4 "Compile poppler qt4 wrapper." ON)
option(ENABLE_QT5 "Compile poppler qt5 wrapper." ON)
set(ENABLE_LIBOPENJPEG "openjpeg2" CACHE STRING "Use libopenjpeg for JPX streams. Possible values: openjpeg2, unmaintained, none. 'unmaintained' gives you the internal unmaintained decoder. Use at your own risk. 'none' compiles no JPX decoder at all. Default: openjpeg2")
set(ENABLE_CMS "lcms2" CACHE STRING "Use color management system. Possible values: lcms2, none. 'none' disables color management system.")
......@@ -114,7 +112,6 @@ set(OPI_SUPPORT ON)
set(TEXTOUT_WORD_LIST ON)
# setting the minimum required versions for some components
set(QT4_MIN_VERSION "4.7.0")
set(CAIRO_VERSION "1.10.0")
set(GLIB_REQUIRED "2.41")
......@@ -144,13 +141,6 @@ else()
message(FATAL_ERROR "Invalid ENABLE_DCTDECODER value.")
endif()
if (ENABLE_QT4)
macro_optional_find_package(Qt4)
if (NOT QT4_FOUND)
set(ENABLE_QT4 OFF)
endif()
endif()
if (ENABLE_QT5)
find_package(Qt5Core)
find_package(Qt5Gui)
......@@ -670,9 +660,6 @@ if(ENABLE_GLIB)
add_subdirectory(glib)
endif()
add_subdirectory(test)
if(ENABLE_QT4)
add_subdirectory(qt4)
endif()
if(ENABLE_QT5)
add_subdirectory(qt5)
endif()
......@@ -697,9 +684,6 @@ poppler_create_install_pkgconfig(poppler.pc ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
if(ENABLE_SPLASH)
poppler_create_install_pkgconfig(poppler-splash.pc ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()
if(ENABLE_QT4)
poppler_create_install_pkgconfig(poppler-qt4.pc ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()
if(ENABLE_QT5)
poppler_create_install_pkgconfig(poppler-qt5.pc ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()
......@@ -721,7 +705,6 @@ if(SPLASH_CMYK)
message(" with CMYK support")
endif()
show_end_message_yesno("cairo output" CAIRO_FOUND)
show_end_message_yesno("qt4 wrapper" ENABLE_QT4)
show_end_message_yesno("qt5 wrapper" ENABLE_QT5)
show_end_message_yesno("glib wrapper" ENABLE_GLIB)
show_end_message_yesno(" introspection" INTROSPECTION_FOUND)
......
This diff is collapsed.
prefix=@CMAKE_INSTALL_PREFIX@
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
Name: poppler-qt4
Description: Qt4 bindings for poppler
Version: @POPPLER_VERSION@
Requires: @PC_REQUIRES@
@PC_REQUIRES_PRIVATE@
Libs: -L${libdir} -lpoppler-qt4
Cflags: -I${includedir}/poppler/qt4
Makefile
Makefile.in
*~
# Qt4 headers are not override clean so disable suggest-override if it's there
string(REPLACE "-Wsuggest-override" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
add_subdirectory(src)
add_subdirectory(tests)
add_subdirectory(demos)
.deps
.libs
*moc
poppler_qt4viewer
add_definitions(${QT4_DEFINITIONS})
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../src
${CMAKE_CURRENT_BINARY_DIR}
${QT4_INCLUDE_DIR}
)
set(poppler_qt4viewer_SRCS
abstractinfodock.cpp
documentobserver.cpp
embeddedfiles.cpp
fonts.cpp
info.cpp
main_viewer.cpp
metadata.cpp
navigationtoolbar.cpp
optcontent.cpp
pageview.cpp
permissions.cpp
thumbnails.cpp
toc.cpp
viewer.cpp
)
qt4_automoc(${poppler_qt4viewer_SRCS})
poppler_add_test(poppler_qt4viewer BUILD_QT4_TESTS ${poppler_qt4viewer_SRCS})
target_link_libraries(poppler_qt4viewer poppler-qt4)
/*
* Copyright (C) 2008, Pino Toscano <pino@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "fonts.h"
AbstractInfoDock::AbstractInfoDock(QWidget *parent)
: QDockWidget(parent), m_filled(false)
{
connect(this, SIGNAL(visibilityChanged(bool)), SLOT(slotVisibilityChanged(bool)));
}
AbstractInfoDock::~AbstractInfoDock()
{
}
void AbstractInfoDock::documentLoaded()
{
if (!isHidden()) {
fillInfo();
m_filled = true;
}
}
void AbstractInfoDock::documentClosed()
{
m_filled = false;
}
void AbstractInfoDock::pageChanged(int page)
{
Q_UNUSED(page)
}
void AbstractInfoDock::slotVisibilityChanged(bool visible)
{
if (visible && document() && !m_filled) {
fillInfo();
m_filled = true;
}
}
#include "abstractinfodock.moc"
/*
* Copyright (C) 2008, Pino Toscano <pino@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef ABSTRACTINFODOCK_H
#define ABSTRACTINFODOCK_H
#include <QtGui/QDockWidget>
#include "documentobserver.h"
class AbstractInfoDock : public QDockWidget, public DocumentObserver
{
Q_OBJECT
public:
AbstractInfoDock(QWidget *parent = 0);
~AbstractInfoDock();
/*virtual*/ void documentLoaded();
/*virtual*/ void documentClosed();
/*virtual*/ void pageChanged(int page);
protected:
virtual void fillInfo() = 0;
private Q_SLOTS:
void slotVisibilityChanged(bool visible);
private:
bool m_filled;
};
#endif
/*
* Copyright (C) 2008, Pino Toscano <pino@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "documentobserver.h"
#include "viewer.h"
DocumentObserver::DocumentObserver()
: m_viewer(0)
{
}
DocumentObserver::~DocumentObserver()
{
}
Poppler::Document* DocumentObserver::document() const
{
return m_viewer->m_doc;
}
void DocumentObserver::setPage(int page)
{
m_viewer->setPage(page);
}
int DocumentObserver::page() const
{
return m_viewer->page();
}
void DocumentObserver::reloadPage()
{
m_viewer->setPage(m_viewer->page());
}
/*
* Copyright (C) 2008, Pino Toscano <pino@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef DOCUMENTOBSERVER_H
#define DOCUMENTOBSERVER_H
class PdfViewer;
namespace Poppler {
class Document;
}
class DocumentObserver
{
friend class PdfViewer;
public:
virtual ~DocumentObserver();
virtual void documentLoaded() = 0;
virtual void documentClosed() = 0;
virtual void pageChanged(int page) = 0;
protected:
DocumentObserver();
Poppler::Document* document() const;
void setPage(int page);
int page() const;
void reloadPage();
private:
PdfViewer *m_viewer;
};
#endif
/*
* Copyright (C) 2008, Pino Toscano <pino@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "embeddedfiles.h"
#include <poppler-qt4.h>
#include <QtGui/QTableWidget>
EmbeddedFilesDock::EmbeddedFilesDock(QWidget *parent)
: AbstractInfoDock(parent)
{
m_table = new QTableWidget(this);
setWidget(m_table);
setWindowTitle(tr("Embedded files"));
m_table->setColumnCount(6);
m_table->setHorizontalHeaderLabels(
QStringList() << tr("Name") << tr("Description") << tr("Size") << tr("Creation date")
<< tr("Modification date") << tr("Checksum"));
m_table->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
}
EmbeddedFilesDock::~EmbeddedFilesDock()
{
}
void EmbeddedFilesDock::fillInfo()
{
m_table->setHorizontalHeaderLabels(
QStringList() << tr("Name") << tr("Description") << tr("Size") << tr("Creation date")
<< tr("Modification date") << tr("Checksum"));
if (!document()->hasEmbeddedFiles()) {
m_table->setItem(0, 0, new QTableWidgetItem(tr("No files")));
return;
}
const QList<Poppler::EmbeddedFile*> files = document()->embeddedFiles();
m_table->setRowCount(files.count());
int i = 0;
Q_FOREACH(Poppler::EmbeddedFile *file, files) {
m_table->setItem(i, 0, new QTableWidgetItem(file->name()));
m_table->setItem(i, 1, new QTableWidgetItem(file->description()));
m_table->setItem(i, 2, new QTableWidgetItem(QString::number(file->size())));
m_table->setItem(i, 3, new QTableWidgetItem(file->createDate().toString(Qt::SystemLocaleDate)));
m_table->setItem(i, 4, new QTableWidgetItem(file->modDate().toString(Qt::SystemLocaleDate)));
const QByteArray checksum = file->checksum();
const QString checksumString = !checksum.isEmpty() ? QString::fromAscii(checksum.toHex()) : QString::fromLatin1("n/a");
m_table->setItem(i, 5, new QTableWidgetItem(checksumString));
++i;
}
}
void EmbeddedFilesDock::documentLoaded()
{
if ( document()->pageMode() == Poppler::Document::UseAttach ) {
show();
}
}
void EmbeddedFilesDock::documentClosed()
{
m_table->clear();
m_table->setRowCount(0);
AbstractInfoDock::documentClosed();
}
#include "embeddedfiles.moc"
/*
* Copyright (C) 2008, Pino Toscano <pino@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef ATTACHMENTS_H
#define ATTACHMENTS_H
#include "abstractinfodock.h"
class QTableWidget;
class EmbeddedFilesDock : public AbstractInfoDock
{
Q_OBJECT
public:
EmbeddedFilesDock(QWidget *parent = 0);
~EmbeddedFilesDock();
virtual void documentLoaded();
/*virtual*/ void documentClosed();
protected:
/*virtual*/ void fillInfo();
private:
QTableWidget *m_table;
};
#endif
/*
* Copyright (C) 2008, Pino Toscano <pino@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "fonts.h"
#include <poppler-qt4.h>
#include <QtGui/QTableWidget>
static QString yesNoStatement(bool value)
{
return value ? QString::fromLatin1("yes") : QString::fromLatin1("no");
}
FontsDock::FontsDock(QWidget *parent)
: AbstractInfoDock(parent)
{
m_table = new QTableWidget(this);
setWidget(m_table);
setWindowTitle(tr("Fonts"));
m_table->setColumnCount(5);
m_table->setHorizontalHeaderLabels(QStringList() << tr("Name") << tr("Type") << tr("Embedded") << tr("Subset") << tr("File"));
m_table->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
}
FontsDock::~FontsDock()
{
}
void FontsDock::fillInfo()
{
const QList<Poppler::FontInfo> fonts = document()->fonts();
m_table->setHorizontalHeaderLabels(QStringList() << tr("Name") << tr("Type") << tr("Embedded") << tr("Subset") << tr("File"));
m_table->setRowCount(fonts.count());
int i = 0;
Q_FOREACH(const Poppler::FontInfo &font, fonts) {
if (font.name().isNull()) {
m_table->setItem(i, 0, new QTableWidgetItem(QString::fromLatin1("[none]")));
} else {
m_table->setItem(i, 0, new QTableWidgetItem(font.name()));
}
m_table->setItem(i, 1, new QTableWidgetItem(font.typeName()));
m_table->setItem(i, 2, new QTableWidgetItem(yesNoStatement(font.isEmbedded())));
m_table->setItem(i, 3, new QTableWidgetItem(yesNoStatement(font.isSubset())));
m_table->setItem(i, 4, new QTableWidgetItem(font.file()));
++i;
}
}
void FontsDock::documentClosed()
{
m_table->clear();
m_table->setRowCount(0);
AbstractInfoDock::documentClosed();
}
#include "fonts.moc"
/*
* Copyright (C) 2008, Pino Toscano <pino@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef FONTS_H
#define FONTS_H
#include "abstractinfodock.h"
class QTableWidget;
class FontsDock : public AbstractInfoDock
{
Q_OBJECT
public:
FontsDock(QWidget *parent = 0);
~FontsDock();
/*virtual*/ void documentClosed();
protected:
/*virtual*/ void fillInfo();
private:
QTableWidget *m_table;
};
#endif
/*
* Copyright (C) 2008, Pino Toscano <pino@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "info.h"
#include <poppler-qt4.h>
#include <QtGui/QTableWidget>
InfoDock::InfoDock(QWidget *parent)
: AbstractInfoDock(parent)
{
m_table = new QTableWidget(this);
setWidget(m_table);
setWindowTitle(tr("Information"));
m_table->setColumnCount(2);
m_table->setHorizontalHeaderLabels(QStringList() << tr("Key") << tr("Value"));
m_table->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
}
InfoDock::~InfoDock()
{
}
void InfoDock::fillInfo()
{
QStringList keys = document()->infoKeys();
m_table->setHorizontalHeaderLabels(QStringList() << tr("Key") << tr("Value"));
m_table->setRowCount(keys.count());
QStringList dateKeys;
dateKeys << QString::fromLatin1("CreationDate");
dateKeys << QString::fromLatin1("ModDate");
int i = 0;
Q_FOREACH(const QString &date, dateKeys) {
const int id = keys.indexOf(date);
if (id != -1) {
m_table->setItem(i, 0, new QTableWidgetItem(date));
m_table->setItem(i, 1, new QTableWidgetItem(document()->date(date).toString(Qt::SystemLocaleDate)));
++i;
keys.removeAt(id);
}
}
Q_FOREACH(const QString &key, keys) {
m_table->setItem(i, 0, new QTableWidgetItem(key));
m_table->setItem(i, 1, new QTableWidgetItem(document()->info(key)));
++i;
}
}
void InfoDock::documentClosed()
{
m_table->clear();
m_table->setRowCount(0);
AbstractInfoDock::documentClosed();
}
#include "info.moc"
/*
* Copyright (C) 2008, Pino Toscano <pino@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef INFO_H
#define INFO_H
#include "abstractinfodock.h"
class QTableWidget;
class InfoDock : public AbstractInfoDock
{
Q_OBJECT
public:
InfoDock(QWidget *parent = 0);
~InfoDock();
/*virtual*/ void documentClosed();
protected:
/*virtual*/ void fillInfo();
private:
QTableWidget *m_table;
};