diff options
author | Brad Hards <bradh@frogmouth.net> | 2005-07-07 11:04:08 +0000 |
---|---|---|
committer | Brad Hards <bradh@frogmouth.net> | 2005-07-07 11:04:08 +0000 |
commit | 8bf787031e7a2e93b4e1202918bd1aee86675082 (patch) | |
tree | b7fa3d97c410e62598669cd8b46717a5dc3d5ed2 /qt4 | |
parent | 695e27fb4d6fcc3466e2c9c95b4f02821b07e823 (diff) |
Update for page mode - new mode from PDF-1.6, API docs fixes
and some tests.
Diffstat (limited to 'qt4')
-rw-r--r-- | qt4/src/poppler-document.cc | 2 | ||||
-rw-r--r-- | qt4/src/poppler-qt4.h | 14 | ||||
-rw-r--r-- | qt4/tests/Makefile.am | 22 | ||||
-rw-r--r-- | qt4/tests/check_pagemode_attach.cpp | 22 | ||||
-rw-r--r-- | qt4/tests/check_pagemode_fullscreen.cpp | 22 | ||||
-rw-r--r-- | qt4/tests/check_pagemode_none.cpp | 22 | ||||
-rw-r--r-- | qt4/tests/check_pagemode_oc.cpp | 22 | ||||
-rw-r--r-- | qt4/tests/check_pagemode_thumbs.cpp | 22 |
8 files changed, 142 insertions, 6 deletions
diff --git a/qt4/src/poppler-document.cc b/qt4/src/poppler-document.cc index 35202036..7a00a2a3 100644 --- a/qt4/src/poppler-document.cc +++ b/qt4/src/poppler-document.cc @@ -105,6 +105,8 @@ namespace Poppler { return FullScreen; case Catalog::pageModeOC: return UseOC; + case Catalog::pageModeAttach: + return UseAttach; default: return UseNone; } diff --git a/qt4/src/poppler-qt4.h b/qt4/src/poppler-qt4.h index 8399c65f..3da1762b 100644 --- a/qt4/src/poppler-qt4.h +++ b/qt4/src/poppler-qt4.h @@ -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; diff --git a/qt4/tests/Makefile.am b/qt4/tests/Makefile.am index 8d790b8e..59361ea0 100644 --- a/qt4/tests/Makefile.am +++ b/qt4/tests/Makefile.am @@ -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) diff --git a/qt4/tests/check_pagemode_attach.cpp b/qt4/tests/check_pagemode_attach.cpp new file mode 100644 index 00000000..eea7cf2a --- /dev/null +++ b/qt4/tests/check_pagemode_attach.cpp @@ -0,0 +1,22 @@ +#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); +} diff --git a/qt4/tests/check_pagemode_fullscreen.cpp b/qt4/tests/check_pagemode_fullscreen.cpp new file mode 100644 index 00000000..75fc8cc2 --- /dev/null +++ b/qt4/tests/check_pagemode_fullscreen.cpp @@ -0,0 +1,22 @@ +#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); +} diff --git a/qt4/tests/check_pagemode_none.cpp b/qt4/tests/check_pagemode_none.cpp new file mode 100644 index 00000000..1c7bbdfc --- /dev/null +++ b/qt4/tests/check_pagemode_none.cpp @@ -0,0 +1,22 @@ +#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); +} diff --git a/qt4/tests/check_pagemode_oc.cpp b/qt4/tests/check_pagemode_oc.cpp new file mode 100644 index 00000000..a772c414 --- /dev/null +++ b/qt4/tests/check_pagemode_oc.cpp @@ -0,0 +1,22 @@ +#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); +} diff --git a/qt4/tests/check_pagemode_thumbs.cpp b/qt4/tests/check_pagemode_thumbs.cpp new file mode 100644 index 00000000..af1f7043 --- /dev/null +++ b/qt4/tests/check_pagemode_thumbs.cpp @@ -0,0 +1,22 @@ +#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); +} |