[poppler] poppler/qt4/src: Makefile.am, 1.15,
1.16 poppler-document.cc, 1.28, 1.29 poppler-link.cc, 1.8,
1.9 poppler-page.cc, 1.32, 1.33 poppler-private.h, 1.17,
1.18 poppler-qt4.h, 1.43, 1.44
Albert Astals Cid
aacid at kemper.freedesktop.org
Sat Jan 13 10:29:41 PST 2007
Update of /cvs/poppler/poppler/qt4/src
In directory kemper:/tmp/cvs-serv6726/qt4/src
Modified Files:
Makefile.am poppler-document.cc poppler-link.cc
poppler-page.cc poppler-private.h poppler-qt4.h
Log Message:
* 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 at kde.org>.
Index: Makefile.am
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/Makefile.am,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- Makefile.am 22 Nov 2006 21:55:27 -0000 1.15
+++ Makefile.am 13 Jan 2007 18:29:39 -0000 1.16
@@ -31,9 +31,13 @@
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
Index: poppler-document.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-document.cc,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- poppler-document.cc 13 Jan 2007 17:56:07 -0000 1.28
+++ poppler-document.cc 13 Jan 2007 18:29:39 -0000 1.29
@@ -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 @@
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 @@
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;
Index: poppler-link.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-link.cc,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- poppler-link.cc 6 Jan 2007 21:53:08 -0000 1.8
+++ poppler-link.cc 13 Jan 2007 18:29:39 -0000 1.9
@@ -69,6 +69,7 @@
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 );
Index: poppler-page.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-page.cc,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- poppler-page.cc 6 Jan 2007 21:53:08 -0000 1.32
+++ poppler-page.cc 13 Jan 2007 18:29:39 -0000 1.33
@@ -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 @@
{
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 @@
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 @@
painter.restore();
painter.end();
img = tmpimg;
+#endif
break;
}
}
@@ -455,6 +462,9 @@
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 @@
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);
Index: poppler-private.h
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-private.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- poppler-private.h 13 Jan 2007 17:56:07 -0000 1.17
+++ poppler-private.h 13 Jan 2007 18:29:39 -0000 1.18
@@ -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 @@
// 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 @@
SplashOutputDev * splashOutputDev = new SplashOutputDev(splashModeRGB8Qt, 4, gFalse, bgColor);
splashOutputDev->startDoc(doc.getXRef());
m_outputDev = splashOutputDev;
+#endif
break;
}
}
Index: poppler-qt4.h
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-qt4.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- poppler-qt4.h 13 Jan 2007 17:56:07 -0000 1.43
+++ poppler-qt4.h 13 Jan 2007 18:29:39 -0000 1.44
@@ -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 @@
*/
RenderBackend renderBackend() const;
+ /**
+ The available rendering backends.
+ */
+ static QSet<RenderBackend> availableRenderBackends();
+
~Document();
private:
More information about the poppler
mailing list