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

* configure.ac

        * poppler/Makefile.am
        * qt4/src/Makefile.am
        * qt4/src/poppler-document.cc
        * qt4/src/poppler-link.cc
        * qt4/src/poppler-page.cc
        * qt4/src/poppler-private.h
        * qt4/src/poppler-qt4.h: Make the Qt4 backend compilable even with
        no Splash backend. Patch by Pino Toscano <pino@kde.org>.
parent 457038e9
2007-01-13 Albert Astals Cid <aacid@kde.org>
* configure.ac
* poppler/Makefile.am
* qt4/src/Makefile.am
* qt4/src/poppler-document.cc
* qt4/src/poppler-link.cc
* qt4/src/poppler-page.cc
* qt4/src/poppler-private.h
* qt4/src/poppler-qt4.h: Make the Qt4 backend compilable even with
no Splash backend. Patch by Pino Toscano <pino@kde.org>.
2007-01-13 Albert Astals Cid <aacid@kde.org>
* poppler/Stream.h:
......
......@@ -237,11 +237,6 @@ fi
AC_SUBST(POPPLER_QT4_CXXFLAGS)
AC_SUBST(POPPLER_QT4_LIBS)
if test x$enable_splash_output != xyes; then
if test x$enable_poppler_qt4 = xyes; then
enable_poppler_qt4="no because of disabled splash"
fi
fi
AM_CONDITIONAL(BUILD_POPPLER_QT4, test "x$enable_poppler_qt4" = "xyes")
if test x$enable_poppler_qt4 = xyes; then
......
......@@ -13,8 +13,6 @@ splash_libs = \
$(SPLASH_LIBS) \
$(top_builddir)/splash/libsplash.la
endif
if BUILD_POPPLER_QT4
poppler_arthur = libpoppler-arthur.la
......@@ -31,6 +29,9 @@ arthur_libs = \
endif
endif
if BUILD_CAIRO_OUTPUT
......
......@@ -31,9 +31,13 @@ libpoppler_qt4_la_SOURCES = \
libpoppler_qt4_la_LIBADD = \
$(top_builddir)/poppler/libpoppler.la \
$(top_builddir)/poppler/libpoppler-arthur.la \
$(FONTCONFIG_LIBS) \
$(POPPLER_QT4_LIBS)
if BUILD_SPLASH_OUTPUT
libpoppler_qt4_la_LIBADD += \
$(top_builddir)/poppler/libpoppler-arthur.la
endif
libpoppler_qt4_la_LDFLAGS = -version-info 1:0:0
......@@ -21,6 +21,7 @@
#include "poppler-qt4.h"
#include <config.h>
#include <ErrorCodes.h>
#include <GlobalParams.h>
#include <Outline.h>
......@@ -30,8 +31,6 @@
#include <UGooString.h>
#include <Catalog.h>
#include <splash/SplashBitmap.h>
#include <QtCore/QDebug>
#include <QtCore/QFile>
#include <QtGui/QImage>
......@@ -403,6 +402,9 @@ namespace Poppler {
LinkDestination *Document::linkDestination( const QString &name )
{
if ( m_doc->getOutputDev() == NULL )
return NULL;
UGooString * namedDest = QStringToUGooString( name );
LinkDestinationData ldd(NULL, namedDest, m_doc);
LinkDestination *ld = new LinkDestination(ldd);
......@@ -462,6 +464,16 @@ namespace Poppler {
return m_doc->m_backend;
}
QSet<Document::RenderBackend> Document::availableRenderBackends()
{
QSet<Document::RenderBackend> ret;
#if defined(HAVE_SPLASH)
ret << Document::SplashBackend;
ret << Document::ArthurBackend;
#endif
return ret;
}
QDateTime convertDate( char *dateString )
{
int year;
......
......@@ -69,6 +69,7 @@ namespace Poppler {
int leftAux, topAux, rightAux, bottomAux;
OutputDev *sod = data.doc->getOutputDev();
if (sod == NULL) return;
sod->cvtUserToDev( left, top, &leftAux, &topAux );
sod->cvtUserToDev( right, bottom, &rightAux, &bottomAux );
......
......@@ -22,14 +22,17 @@
#include <QtCore/QMap>
#include <QtGui/QImage>
#include <QtGui/QPainter>
#include <config.h>
#include <GlobalParams.h>
#include <PDFDoc.h>
#include <Catalog.h>
#include <ErrorCodes.h>
#include <ArthurOutputDev.h>
#include <SplashOutputDev.h>
#include <TextOutputDev.h>
#if defined(HAVE_SPLASH)
#include <SplashOutputDev.h>
#include <splash/SplashBitmap.h>
#include <ArthurOutputDev.h>
#endif
#include "poppler-private.h"
#include "poppler-page-transition-private.h"
......@@ -169,6 +172,7 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h,
{
case Poppler::Document::SplashBackend:
{
#if defined(HAVE_SPLASH)
SplashOutputDev *splash_output = static_cast<SplashOutputDev *>(m_page->parentDoc->m_doc->getOutputDev());
m_page->parentDoc->m_doc->doc.displayPageSlice(splash_output, m_page->index + 1, xres, yres,
......@@ -201,10 +205,12 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h,
img = tmpimg.copy();
// unload underlying xpdf bitmap
splash_output->startPage( 0, NULL );
#endif
break;
}
case Poppler::Document::ArthurBackend:
{
#if defined(HAVE_SPLASH)
QSize size = pageSize();
QImage tmpimg(w == -1 ? size.width() : w, h == -1 ? size.height() : h, QImage::Format_ARGB32);
......@@ -231,6 +237,7 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h,
painter.restore();
painter.end();
img = tmpimg;
#endif
break;
}
}
......@@ -455,6 +462,9 @@ void Page::defaultCTM(double *CTM, double dpiX, double dpiY, int rotate, bool up
QList<Link*> Page::links() const
{
QList<Link*> popplerLinks;
OutputDev *output_dev = m_page->parentDoc->m_doc->getOutputDev();
if (output_dev == NULL)
return popplerLinks;
Links *xpdfLinks = m_page->parentDoc->m_doc->doc.takeLinks();
for (int i = 0; i < xpdfLinks->getNumLinks(); ++i)
......@@ -466,7 +476,6 @@ QList<Link*> Page::links() const
xpdfLink->getRect( &left, &top, &right, &bottom );
QRectF linkArea;
OutputDev *output_dev = m_page->parentDoc->m_doc->getOutputDev();
output_dev->cvtUserToDev( left, top, &leftAux, &topAux );
output_dev->cvtUserToDev( right, bottom, &rightAux, &bottomAux );
linkArea.setLeft(leftAux);
......
......@@ -20,14 +20,18 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <config.h>
#include <GfxState.h>
#include <GlobalParams.h>
#include <Link.h>
#include <Outline.h>
#include <PDFDoc.h>
#include <FontInfo.h>
#include <SplashOutputDev.h>
#include <UGooString.h>
#include <OutputDev.h>
#if defined(HAVE_SPLASH)
#include <SplashOutputDev.h>
#endif
......@@ -111,6 +115,7 @@ namespace Poppler {
// create a splash backend even in case of the Arthur Backend
case Document::SplashBackend:
{
#if defined(HAVE_SPLASH)
SplashColor bgColor;
bgColor[0] = paperColor.red();
bgColor[1] = paperColor.green();
......@@ -118,6 +123,7 @@ namespace Poppler {
SplashOutputDev * splashOutputDev = new SplashOutputDev(splashModeRGB8Qt, 4, gFalse, bgColor);
splashOutputDev->startDoc(doc.getXRef());
m_outputDev = splashOutputDev;
#endif
break;
}
}
......
......@@ -24,6 +24,7 @@
#include <QtCore/QByteArray>
#include <QtCore/QDateTime>
#include <QtCore/QSet>
#include <QtCore/QVector>
#include <QtGui/QPixmap>
#include <QtXml/QDomDocument>
......@@ -731,6 +732,11 @@ height = dummy.height();
*/
RenderBackend renderBackend() const;
/**
The available rendering backends.
*/
static QSet<RenderBackend> availableRenderBackends();
~Document();
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment