Commit 8bf78703 authored by Brad Hards's avatar Brad Hards
Browse files

Update for page mode - new mode from PDF-1.6, API docs fixes

and some tests.
parent 695e27fb
2005-07-07 Brad Hards <bradh@frogmouth.net>
* poppler/Catalog.cc:
* poppler/Catalog.h: update page mode options to PDF 1.6
* qt4/src/poppler-qt4.h:
* qt4/src/poppler-document.cc: add Qt4 bindings for additional
pageMode() value created by change above
* qt4/src/poppler-qt4.h: minor updates to API docs.
* qt4/tests/Makefile.am:
* qt4/tests/check_pagemode_*.cpp: unit tests for Qt4 pageMode() call
and associated enum. This is the initial checkin for these files
2005-07-06 Albert Astals Cid <aacid@kde.org>
* poppler/PDFDoc.[cc|h]: Add checkFooter to check document ends with
......
......@@ -117,6 +117,8 @@ Catalog::Catalog(XRef *xrefA) {
pageMode = pageModeFullScreen;
else if (obj.isName("UseOC"))
pageMode = pageModeOC;
else if (obj.isName("UseAttachments"))
pageMode = pageModeAttach;
}
obj.free();
......
......@@ -105,7 +105,8 @@ public:
pageModeOutlines,
pageModeThumbs,
pageModeFullScreen,
pageModeOC
pageModeOC,
pageModeAttach
};
enum PageLayout {
pageLayoutNone,
......
......@@ -105,6 +105,8 @@ namespace Poppler {
return FullScreen;
case Catalog::pageModeOC:
return UseOC;
case Catalog::pageModeAttach:
return UseAttach;
default:
return UseNone;
}
......
......@@ -179,11 +179,12 @@ namespace Poppler {
The mode
*/
enum PageMode {
UseNone, ///< No mode
UseOutlines, ///< Outline mode
UseThumbs, ///< Thumbnail mode
FullScreen, ///< Fullscreen mode
UseOC ///< OC mode
UseNone, ///< No mode - neither document outline nor thumbnail images are visible
UseOutlines, ///< Document outline visible
UseThumbs, ///< Thumbnail images visible
FullScreen, ///< Fullscreen mode (no menubar, windows controls etc)
UseOC, ///< Optional content group panel visible
UseAttach ///< Attachments panel visible
};
/**
......@@ -273,6 +274,9 @@ namespace Poppler {
/**
Test if the document is linearised
In some cases, this is called "fast web view", since it
is mostly an optimisation for viewing over the Web.
*/
bool isLinearized() const;
......
......@@ -35,7 +35,12 @@ TESTS = \
check_author \
check_orientation \
check_permissions \
check_linearised
check_linearised \
check_pagemode_fullscreen \
check_pagemode_attach \
check_pagemode_none \
check_pagemode_thumbs \
check_pagemode_oc
check_PROGRAMS = $(TESTS)
......@@ -51,3 +56,18 @@ check_author_LDADD = $(LDADDS)
check_permissions_SOURCES = check_permissions.cpp
check_permissions_LDADD = $(LDADDS)
check_pagemode_fullscreen_SOURCES = check_pagemode_fullscreen.cpp
check_pagemode_fullscreen_LDADD = $(LDADDS)
check_pagemode_attach_SOURCES = check_pagemode_attach.cpp
check_pagemode_attach_LDADD = $(LDADDS)
check_pagemode_none_SOURCES = check_pagemode_none.cpp
check_pagemode_none_LDADD = $(LDADDS)
check_pagemode_thumbs_SOURCES = check_pagemode_thumbs.cpp
check_pagemode_thumbs_LDADD = $(LDADDS)
check_pagemode_oc_SOURCES = check_pagemode_oc.cpp
check_pagemode_oc_LDADD = $(LDADDS)
#include <QtCore/QtCore>
#define UNSTABLE_POPPLER_QT4
#include <poppler-qt4.h>
int main( int argc, char **argv )
{
QCoreApplication a( argc, argv ); // QApplication required!
Poppler::Document *doc = Poppler::Document::load("../../../test/unittestcases/UseAttachments.pdf");
if (!doc)
{
exit(1);
}
if ( !(doc->pageMode() == Poppler::Document::UseAttach ) )
{
exit(1);
}
exit(0);
}
#include <QtCore/QtCore>
#define UNSTABLE_POPPLER_QT4
#include <poppler-qt4.h>
int main( int argc, char **argv )
{
QCoreApplication a( argc, argv ); // QApplication required!
Poppler::Document *doc = Poppler::Document::load("../../../test/unittestcases/FullScreen.pdf");
if (!doc)
{
exit(1);
}
if ( !(doc->pageMode() == Poppler::Document::FullScreen ) )
{
exit(1);
}
exit(0);
}
#include <QtCore/QtCore>
#define UNSTABLE_POPPLER_QT4
#include <poppler-qt4.h>
int main( int argc, char **argv )
{
QCoreApplication a( argc, argv ); // QApplication required!
Poppler::Document *doc = Poppler::Document::load("../../../test/unittestcases/UseNone.pdf");
if (!doc)
{
exit(1);
}
if ( !(doc->pageMode() == Poppler::Document::UseNone ) )
{
exit(1);
}
exit(0);
}
#include <QtCore/QtCore>
#define UNSTABLE_POPPLER_QT4
#include <poppler-qt4.h>
int main( int argc, char **argv )
{
QCoreApplication a( argc, argv ); // QApplication required!
Poppler::Document *doc = Poppler::Document::load("../../../test/unittestcases/UseOC.pdf");
if (!doc)
{
exit(1);
}
if ( !(doc->pageMode() == Poppler::Document::UseOC ) )
{
exit(1);
}
exit(0);
}
#include <QtCore/QtCore>
#define UNSTABLE_POPPLER_QT4
#include <poppler-qt4.h>
int main( int argc, char **argv )
{
QCoreApplication a( argc, argv ); // QApplication required!
Poppler::Document *doc = Poppler::Document::load("../../../test/unittestcases/UseThumbs.pdf");
if (!doc)
{
exit(1);
}
if ( !(doc->pageMode() == Poppler::Document::UseThumbs ) )
{
exit(1);
}
exit(0);
}
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