summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArseniy Lartsev <[email protected]>2015-10-15 00:16:55 +0200
committerAlbert Astals Cid <[email protected]>2015-10-15 00:16:55 +0200
commit76c1e944a8a0bb44e63962be9e091baf2191597d (patch)
treeb14c476dbb1639092a3a8a980cfe3c4fd8ebb8ab
parent9f0ff21a22cd6618034e42f77d7796169a9db606 (diff)
Support for non-integer transition durations in PDF presentations
REVIEW: 125329
-rw-r--r--cmake/modules/FindPoppler.cmake13
-rw-r--r--core/pagetransition.cpp6
-rw-r--r--core/pagetransition.h4
-rw-r--r--generators/poppler/config-okular-poppler.h.cmake3
-rw-r--r--generators/poppler/generator_pdf.cpp4
5 files changed, 24 insertions, 6 deletions
diff --git a/cmake/modules/FindPoppler.cmake b/cmake/modules/FindPoppler.cmake
index 6389a62..10e1ec7 100644
--- a/cmake/modules/FindPoppler.cmake
+++ b/cmake/modules/FindPoppler.cmake
@@ -135,9 +135,20 @@ int main()
}
" HAVE_POPPLER_0_28)
+check_cxx_source_compiles("
+#include <poppler-qt4.h>
+int main()
+{
+ Poppler::PageTransition *p = 0;
+ return p->durationReal();
+}
+" HAVE_POPPLER_0_37)
+
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_LIBRARIES)
- if (HAVE_POPPLER_0_28)
+ if (HAVE_POPPLER_0_37)
+ set(popplerVersionMessage "0.37")
+ elseif (HAVE_POPPLER_0_28)
set(popplerVersionMessage "0.28")
elseif (HAVE_POPPLER_0_24)
set(popplerVersionMessage "0.24")
diff --git a/core/pagetransition.cpp b/core/pagetransition.cpp
index d57106d..5745221 100644
--- a/core/pagetransition.cpp
+++ b/core/pagetransition.cpp
@@ -29,7 +29,7 @@ class PageTransition::Private
}
Type m_type;
- int m_duration;
+ double m_duration;
Alignment m_alignment;
Direction m_direction;
int m_angle;
@@ -67,7 +67,7 @@ PageTransition::Type PageTransition::type() const
return d->m_type;
}
-int PageTransition::duration() const
+double PageTransition::duration() const
{
return d->m_duration;
}
@@ -102,7 +102,7 @@ void PageTransition::setType( Type type )
d->m_type = type;
}
-void PageTransition::setDuration( int duration )
+void PageTransition::setDuration( double duration )
{
d->m_duration = duration;
}
diff --git a/core/pagetransition.h b/core/pagetransition.h
index 4b6e7f9..f693528 100644
--- a/core/pagetransition.h
+++ b/core/pagetransition.h
@@ -86,7 +86,7 @@ class OKULAR_EXPORT PageTransition
/**
* Returns the duration of the transition in seconds.
*/
- int duration() const;
+ double duration() const;
/**
* Returns the alignment of the transition.
@@ -121,7 +121,7 @@ class OKULAR_EXPORT PageTransition
/**
* Sets the @p duration in seconds for the transition.
*/
- void setDuration( int duration );
+ void setDuration( double duration );
/**
* Sets the @p alignment of the transition (@ref Alignment).
diff --git a/generators/poppler/config-okular-poppler.h.cmake b/generators/poppler/config-okular-poppler.h.cmake
index 1e8ff9e..c3e9b18 100644
--- a/generators/poppler/config-okular-poppler.h.cmake
+++ b/generators/poppler/config-okular-poppler.h.cmake
@@ -15,3 +15,6 @@
/* Defined if we have the 0.28 version of the Poppler library */
#cmakedefine HAVE_POPPLER_0_28 1
+
+/* Defined if we have the 0.37 version of the Poppler library */
+#cmakedefine HAVE_POPPLER_0_37 1
diff --git a/generators/poppler/generator_pdf.cpp b/generators/poppler/generator_pdf.cpp
index ca52296..a65487a 100644
--- a/generators/poppler/generator_pdf.cpp
+++ b/generators/poppler/generator_pdf.cpp
@@ -1515,7 +1515,11 @@ void PDFGenerator::addTransition( Poppler::Page * pdfPage, Okular::Page * page )
break;
}
+#ifdef HAVE_POPPLER_0_37
+ transition->setDuration( pdfTransition->durationReal() );
+#else
transition->setDuration( pdfTransition->duration() );
+#endif
switch ( pdfTransition->alignment() ) {
case Poppler::PageTransition::Horizontal: