Commit 76c1e944 authored by Arseniy Lartsev's avatar Arseniy Lartsev Committed by Albert Astals Cid

Support for non-integer transition durations in PDF presentations

REVIEW: 125329
parent 9f0ff21a
......@@ -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")
......
......@@ -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;
}
......
......@@ -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).
......
......@@ -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
......@@ -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:
......
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