Support for non-integer transition durations in PDF presentations

REVIEW: 125329
remotes/origin/Applications/15.12
Arseniy Lartsev 11 years ago committed by Albert Astals Cid
parent 9f0ff21a22
commit 76c1e944a8
  1. 13
      cmake/modules/FindPoppler.cmake
  2. 6
      core/pagetransition.cpp
  3. 4
      core/pagetransition.h
  4. 3
      generators/poppler/config-okular-poppler.h.cmake
  5. 4
      generators/poppler/generator_pdf.cpp

@ -135,9 +135,20 @@ int main()
} }
" HAVE_POPPLER_0_28) " 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_INCLUDES)
set(CMAKE_REQUIRED_LIBRARIES) 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") set(popplerVersionMessage "0.28")
elseif (HAVE_POPPLER_0_24) elseif (HAVE_POPPLER_0_24)
set(popplerVersionMessage "0.24") set(popplerVersionMessage "0.24")

@ -29,7 +29,7 @@ class PageTransition::Private
} }
Type m_type; Type m_type;
int m_duration; double m_duration;
Alignment m_alignment; Alignment m_alignment;
Direction m_direction; Direction m_direction;
int m_angle; int m_angle;
@ -67,7 +67,7 @@ PageTransition::Type PageTransition::type() const
return d->m_type; return d->m_type;
} }
int PageTransition::duration() const double PageTransition::duration() const
{ {
return d->m_duration; return d->m_duration;
} }
@ -102,7 +102,7 @@ void PageTransition::setType( Type type )
d->m_type = type; d->m_type = type;
} }
void PageTransition::setDuration( int duration ) void PageTransition::setDuration( double duration )
{ {
d->m_duration = duration; d->m_duration = duration;
} }

@ -86,7 +86,7 @@ class OKULAR_EXPORT PageTransition
/** /**
* Returns the duration of the transition in seconds. * Returns the duration of the transition in seconds.
*/ */
int duration() const; double duration() const;
/** /**
* Returns the alignment of the transition. * Returns the alignment of the transition.
@ -121,7 +121,7 @@ class OKULAR_EXPORT PageTransition
/** /**
* Sets the @p duration in seconds for the transition. * 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). * 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 */ /* Defined if we have the 0.28 version of the Poppler library */
#cmakedefine HAVE_POPPLER_0_28 1 #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; break;
} }
#ifdef HAVE_POPPLER_0_37
transition->setDuration( pdfTransition->durationReal() );
#else
transition->setDuration( pdfTransition->duration() ); transition->setDuration( pdfTransition->duration() );
#endif
switch ( pdfTransition->alignment() ) { switch ( pdfTransition->alignment() ) {
case Poppler::PageTransition::Horizontal: case Poppler::PageTransition::Horizontal:

Loading…
Cancel
Save