[poppler] Branch 'poppler-0.8' - 2 commits - qt4/src
Albert Astals Cid
aacid at kemper.freedesktop.org
Fri May 9 13:56:50 PDT 2008
qt4/src/CMakeLists.txt | 4
qt4/src/Makefile.am | 4
qt4/src/poppler-page-transition-private.h | 28 +++++
qt4/src/poppler-page-transition.cc | 95 +++++++++++++++++++
qt4/src/poppler-page-transition.h | 148 ++++++++++++++++++++++++++++++
5 files changed, 275 insertions(+), 4 deletions(-)
New commits:
commit d2958d08f4e49e1b56cfdec6d1a6a2ee219e6692
Author: Albert Astals Cid <tsdgeos at localhost.(none)>
Date: Sat Mar 29 13:25:52 2008 +0100
Add the export macro
diff --git a/qt4/src/poppler-page-transition.h b/qt4/src/poppler-page-transition.h
index 53002ff..e7f39e2 100644
--- a/qt4/src/poppler-page-transition.h
+++ b/qt4/src/poppler-page-transition.h
@@ -20,6 +20,8 @@
#ifndef __PAGETRANSITION_X_H__
#define __PAGETRANSITION_X_H__
+#include "poppler-export.h"
+
namespace Poppler {
class PageTransitionParams;
@@ -39,7 +41,7 @@ class PageTransitionData;
*/
-class PageTransition {
+class POPPLER_QT4_EXPORT PageTransition {
public:
/** \brief transition effect that shall be used
commit b2f1a1ae09fb3c5c1db9e02ccf6cf0b8aca84667
Author: Albert Astals Cid <tsdgeos at localhost.(none)>
Date: Sat Mar 29 00:30:31 2008 +0100
Duplicate page-transition files on qt4
diff --git a/qt4/src/CMakeLists.txt b/qt4/src/CMakeLists.txt
index c77df13..1618cc2 100644
--- a/qt4/src/CMakeLists.txt
+++ b/qt4/src/CMakeLists.txt
@@ -24,7 +24,7 @@ set(poppler_qt4_SRCS
poppler-qiodeviceoutstream.cc
poppler-sound.cc
poppler-textbox.cc
- ${CMAKE_SOURCE_DIR}/qt/poppler-page-transition.cc
+ poppler-page-transition.cc
)
if (ENABLE_SPLASH)
set(poppler_qt4_SRCS ${poppler_qt4_SRCS}
@@ -47,6 +47,6 @@ install(FILES
poppler-form.h
poppler-optcontent.h
poppler-export.h
- ${CMAKE_SOURCE_DIR}/qt/poppler-page-transition.h
+ poppler-page-transition.h
DESTINATION include/poppler/qt4)
diff --git a/qt4/src/Makefile.am b/qt4/src/Makefile.am
index 95e26a6..c449336 100644
--- a/qt4/src/Makefile.am
+++ b/qt4/src/Makefile.am
@@ -16,7 +16,7 @@ poppler_include_HEADERS = \
poppler-form.h \
poppler-optcontent.h \
poppler-export.h \
- ../../qt/poppler-page-transition.h
+ poppler-page-transition.h
lib_LTLIBRARIES = libpoppler-qt4.la
@@ -31,7 +31,7 @@ libpoppler_qt4_la_SOURCES = \
poppler-link-extractor.cc \
poppler-optcontent.cc \
poppler-optcontent.h \
- ../../qt/poppler-page-transition.cc \
+ poppler-page-transition.cc \
poppler-sound.cc \
poppler-form.cc \
poppler-base-converter.cc \
diff --git a/qt4/src/poppler-page-transition-private.h b/qt4/src/poppler-page-transition-private.h
new file mode 100644
index 0000000..63febb0
--- /dev/null
+++ b/qt4/src/poppler-page-transition-private.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2005, Albert Astals Cid
+ *
+ * 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.
+ */
+
+class Object;
+
+namespace Poppler {
+
+class PageTransitionParams {
+ public:
+ Object *dictObj;
+};
+
+}
diff --git a/qt4/src/poppler-page-transition.cc b/qt4/src/poppler-page-transition.cc
new file mode 100644
index 0000000..cde8818
--- /dev/null
+++ b/qt4/src/poppler-page-transition.cc
@@ -0,0 +1,95 @@
+/* PageTransition.cc
+ * Copyright (C) 2005, Net Integration Technologies, Inc.
+ *
+ * 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 "PageTransition.h"
+#include "poppler-page-transition.h"
+#include "poppler-page-transition-private.h"
+
+namespace Poppler {
+
+class PageTransitionData
+{
+ public:
+ PageTransitionData(Object *trans)
+ {
+ pt = new ::PageTransition(trans);
+ }
+
+ PageTransitionData(const PageTransitionData &ptd)
+ {
+ pt = new ::PageTransition(*ptd.pt);
+ }
+
+ ~PageTransitionData()
+ {
+ delete pt;
+ }
+
+ ::PageTransition *pt;
+};
+
+PageTransition::PageTransition(const PageTransitionParams ¶ms)
+{
+ data = new PageTransitionData(params.dictObj);
+}
+
+PageTransition::PageTransition(const PageTransition &pt)
+{
+ data = new PageTransitionData(*pt.data);
+}
+
+PageTransition::~PageTransition()
+{
+ delete data;
+}
+
+PageTransition::Type PageTransition::type() const
+{
+ return (Poppler::PageTransition::Type)data->pt->getType();
+}
+
+int PageTransition::duration() const
+{
+ return data->pt->getDuration();
+}
+
+PageTransition::Alignment PageTransition::alignment() const
+{
+ return (Poppler::PageTransition::Alignment)data->pt->getAlignment();
+}
+
+PageTransition::Direction PageTransition::direction() const
+{
+ return (Poppler::PageTransition::Direction)data->pt->getDirection();
+}
+
+int PageTransition::angle() const
+{
+ return data->pt->getAngle();
+}
+
+double PageTransition::scale() const
+{
+ return data->pt->getScale();
+}
+bool PageTransition::isRectangular() const
+{
+ return data->pt->isRectangular();
+}
+
+}
diff --git a/qt4/src/poppler-page-transition.h b/qt4/src/poppler-page-transition.h
new file mode 100644
index 0000000..53002ff
--- /dev/null
+++ b/qt4/src/poppler-page-transition.h
@@ -0,0 +1,146 @@
+/* PageTransition.h
+ * Copyright (C) 2005, Net Integration Technologies, Inc.
+ * Copyright (C) 2005, Brad Hards <bradh at frogmouth.net>
+ *
+ * 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 __PAGETRANSITION_X_H__
+#define __PAGETRANSITION_X_H__
+
+namespace Poppler {
+
+class PageTransitionParams;
+class PageTransitionData;
+
+/**
+ \brief Describes how a PDF file viewer shall perform the transition
+ from one page to another
+
+ In PDF files there is a way to specify if the viewer shall use
+ certain effects to perform the transition from one page to
+ another. This feature can be used, e.g., in a PDF-based beamer
+ presentation.
+
+ This utility class represents the transition effect, and can be
+ used to extract the information from a PDF object.
+*/
+
+
+class PageTransition {
+ public:
+
+ /** \brief transition effect that shall be used
+ */
+ // if changed remember to keep in sync with PageTransition.h enum
+ enum Type {
+ Replace = 0,
+ Split,
+ Blinds,
+ Box,
+ Wipe,
+ Dissolve,
+ Glitter,
+ Fly,
+ Push,
+ Cover,
+ Uncover,
+ Fade
+ };
+
+ /** \brief alignment of the transition effect that shall be used
+ */
+ // if changed remember to keep in sync with PageTransition.h enum
+ enum Alignment {
+ Horizontal = 0,
+ Vertical
+ };
+
+ /** \brief direction of the transition effect that shall be used
+ */
+ // if changed remember to keep in sync with PageTransition.h enum
+ enum Direction {
+ Inward = 0,
+ Outward
+ };
+
+ /** \brief Construct a new PageTransition object from a page dictionary.
+
+ Users of the library will rarely need to construct a
+ PageTransition object themselves. Instead, the method
+ Poppler::Page::transition() can be used to find out if a certain
+ transition effect is specified.
+
+ @warning In case or error, this method will print an error message to stderr,
+ and construct a default object.
+
+ @param params an object whose dictionary will be read and
+ parsed. This must be a valid object, whose dictionaries are
+ accessed by the constructor. The object is only accessed by this
+ constructor, and may be deleted after the constructor returns.
+ */
+ PageTransition(const PageTransitionParams ¶ms);
+
+ /** \brief copy constructor */
+ PageTransition(const PageTransition &pt);
+
+ /**
+ Destructor
+ */
+ ~PageTransition();
+
+ /**
+ \brief Get type of the transition.
+ */
+ Type type() const;
+
+ /**
+ \brief Get duration of the transition in seconds.
+ */
+ int duration() const;
+
+ /**
+ \brief Get dimension in which the transition effect occurs.
+ */
+ Alignment alignment() const;
+
+ /**
+ \brief Get direction of motion of the transition effect.
+ */
+ Direction direction() const;
+
+ /**
+ \brief Get direction in which the transition effect moves.
+ */
+ int angle() const;
+
+ /**
+ \brief Get starting or ending scale.
+ */
+ double scale() const;
+
+ /**
+ \brief Returns true if the area to be flown is rectangular and
+ opaque.
+ */
+ bool isRectangular() const;
+
+ private:
+ PageTransitionData *data;
+};
+
+}
+
+#endif
More information about the poppler
mailing list