[poppler] 6 commits - qt4/src
Pino Toscano
pino at kemper.freedesktop.org
Sun Aug 24 10:06:41 PDT 2008
qt4/src/poppler-annotation.cc | 13 +++++++++++++
qt4/src/poppler-annotation.h | 3 +++
qt4/src/poppler-movie.cc | 22 ++++++++++++++++++----
qt4/src/poppler-page.cc | 10 +++++++---
qt4/src/poppler-qt4.h | 31 ++++++++++++++++++++++++++-----
5 files changed, 67 insertions(+), 12 deletions(-)
New commits:
commit 22f6af73961686895f207fe13022a21333455862
Merge: 12a9e42... 6d6913a...
Author: Pino Toscano <pino at kde.org>
Date: Sun Aug 24 19:03:24 2008 +0200
Merge branch 'master' of ssh://pino@git.freedesktop.org/git/poppler/poppler
commit 12a9e427fb487165b1797f81d52d733c27bfa2e1
Author: Pino Toscano <pino at kde.org>
Date: Sun Aug 24 18:57:52 2008 +0200
[Qt4] add showControl and playMode properties of MovieObject's
diff --git a/qt4/src/poppler-movie.cc b/qt4/src/poppler-movie.cc
index 5aa0d49..7279568 100644
--- a/qt4/src/poppler-movie.cc
+++ b/qt4/src/poppler-movie.cc
@@ -39,6 +39,8 @@ public:
Movie *m_movieObj;
QSize m_size;
int m_rotation;
+ MovieObject::PlayMode m_playMode : 3;
+ bool m_showControls : 1;
};
MovieObject::MovieObject( AnnotMovie *ann )
@@ -47,6 +49,8 @@ MovieObject::MovieObject( AnnotMovie *ann )
m_movieData->m_movieObj = ann->getMovie()->copy();
ann->getMovieSize( m_movieData->m_size.rwidth(), m_movieData->m_size.rheight() );
m_movieData->m_rotation = ann->getRotationAngle();
+ m_movieData->m_showControls = ann->getShowControls();
+ m_movieData->m_playMode = (MovieObject::PlayMode)ann->getRepeatMode();
}
MovieObject::~MovieObject()
@@ -70,4 +74,14 @@ int MovieObject::rotation() const
return m_movieData->m_rotation;
}
+bool MovieObject::showControls() const
+{
+ return m_movieData->m_showControls;
+}
+
+MovieObject::PlayMode MovieObject::playMode() const
+{
+ return m_movieData->m_playMode;
+}
+
}
diff --git a/qt4/src/poppler-qt4.h b/qt4/src/poppler-qt4.h
index c67debc..c02414c 100644
--- a/qt4/src/poppler-qt4.h
+++ b/qt4/src/poppler-qt4.h
@@ -1200,6 +1200,16 @@ height = dummy.height();
class POPPLER_QT4_EXPORT MovieObject {
friend class Page;
public:
+ /**
+ The play mode for playing the movie
+ */
+ enum PlayMode {
+ PlayOnce, ///< Play the movie once, closing the movie controls at the end
+ PlayOpen, ///< Like PlayOnce, but leaving the controls open
+ PlayRepeat, ///< Play continuously until stopped
+ PlayPalindrome ///< Play forward, then backward, then again foward and so on until stopped
+ };
+
~MovieObject();
/**
@@ -1217,6 +1227,16 @@ height = dummy.height();
*/
int rotation() const;
+ /**
+ Whether show a bar with movie controls
+ */
+ bool showControls() const;
+
+ /**
+ How to play the movie
+ */
+ PlayMode playMode() const;
+
private:
/// \cond PRIVATE
MovieObject( AnnotMovie *ann );
commit c444c652859b6e52160e5571e84f8eb1292d65f1
Author: Pino Toscano <pino at kde.org>
Date: Sun Aug 24 18:47:58 2008 +0200
[Qt4] make the MovieObject ctor private, with only Page able to use it
diff --git a/qt4/src/poppler-qt4.h b/qt4/src/poppler-qt4.h
index 156bddd..c67debc 100644
--- a/qt4/src/poppler-qt4.h
+++ b/qt4/src/poppler-qt4.h
@@ -1198,11 +1198,8 @@ height = dummy.height();
Container class for a movie object in a PDF document.
*/
class POPPLER_QT4_EXPORT MovieObject {
+ friend class Page;
public:
- /// \cond PRIVATE
- MovieObject( AnnotMovie *ann );
- /// \endcond
-
~MovieObject();
/**
@@ -1221,6 +1218,10 @@ height = dummy.height();
int rotation() const;
private:
+ /// \cond PRIVATE
+ MovieObject( AnnotMovie *ann );
+ /// \endcond
+
Q_DISABLE_COPY(MovieObject)
MovieData *m_movieData;
commit 25bd5967f9f550a32e20eea91cd00cbeff98249e
Author: Pino Toscano <pino at kde.org>
Date: Sun Aug 24 18:45:25 2008 +0200
[Qt4] initialize the MovieObject from an AnnotMovie
the annotation has all the data we need, so just init from that
diff --git a/qt4/src/poppler-movie.cc b/qt4/src/poppler-movie.cc
index c7ebb58..5aa0d49 100644
--- a/qt4/src/poppler-movie.cc
+++ b/qt4/src/poppler-movie.cc
@@ -41,12 +41,12 @@ public:
int m_rotation;
};
-MovieObject::MovieObject( Movie *popplermovie, const QSize &size, int rotation )
+MovieObject::MovieObject( AnnotMovie *ann )
{
m_movieData = new MovieData();
- m_movieData->m_movieObj = popplermovie->copy();
- m_movieData->m_size = size;
- m_movieData->m_rotation = rotation;
+ m_movieData->m_movieObj = ann->getMovie()->copy();
+ ann->getMovieSize( m_movieData->m_size.rwidth(), m_movieData->m_size.rheight() );
+ m_movieData->m_rotation = ann->getRotationAngle();
}
MovieObject::~MovieObject()
diff --git a/qt4/src/poppler-page.cc b/qt4/src/poppler-page.cc
index f8c88eb..4d37199 100644
--- a/qt4/src/poppler-page.cc
+++ b/qt4/src/poppler-page.cc
@@ -899,9 +899,7 @@ QList<Annotation*> Page::annotations() const
annotation = m;
// -> movie
- QSize movieSize;
- movieann->getMovieSize( movieSize.rwidth(), movieSize.rheight() );
- MovieObject *movie = new MovieObject( movieann->getMovie(), movieSize, movieann->getRotationAngle() );
+ MovieObject *movie = new MovieObject( movieann );
m->setMovie( movie );
// -> movieTitle
GooString * movietitle = movieann->getTitle();
diff --git a/qt4/src/poppler-qt4.h b/qt4/src/poppler-qt4.h
index a8e57a1..156bddd 100644
--- a/qt4/src/poppler-qt4.h
+++ b/qt4/src/poppler-qt4.h
@@ -33,7 +33,7 @@
class EmbFile;
class Sound;
-class Movie;
+class AnnotMovie;
/**
The %Poppler Qt4 binding.
@@ -1200,7 +1200,7 @@ height = dummy.height();
class POPPLER_QT4_EXPORT MovieObject {
public:
/// \cond PRIVATE
- MovieObject( Movie *popplermovie, const QSize &size, int rotation );
+ MovieObject( AnnotMovie *ann );
/// \endcond
~MovieObject();
commit 48a73cc709a8bed9d2d0f9cbd2a9d2b6c0dad05b
Author: Pino Toscano <pino at kde.org>
Date: Sat Aug 23 19:26:01 2008 +0200
[Qt4] convert the title of movie annotations
diff --git a/qt4/src/poppler-page.cc b/qt4/src/poppler-page.cc
index 2710ab5..f8c88eb 100644
--- a/qt4/src/poppler-page.cc
+++ b/qt4/src/poppler-page.cc
@@ -903,6 +903,12 @@ QList<Annotation*> Page::annotations() const
movieann->getMovieSize( movieSize.rwidth(), movieSize.rheight() );
MovieObject *movie = new MovieObject( movieann->getMovie(), movieSize, movieann->getRotationAngle() );
m->setMovie( movie );
+ // -> movieTitle
+ GooString * movietitle = movieann->getTitle();
+ if ( movietitle )
+ {
+ m->setMovieTitle( QString::fromLatin1( movietitle->getCString() ) );
+ }
break;
}
commit 419ec15ac825f2e0052b411462f00ac57fed030e
Author: Pino Toscano <pino at kde.org>
Date: Sat Aug 23 19:25:04 2008 +0200
[Qt4] get/set the title for movie annotations
diff --git a/qt4/src/poppler-annotation.cc b/qt4/src/poppler-annotation.cc
index c30edd5..6442f6f 100644
--- a/qt4/src/poppler-annotation.cc
+++ b/qt4/src/poppler-annotation.cc
@@ -1953,6 +1953,7 @@ class MovieAnnotationPrivate : public AnnotationPrivate
// data fields
MovieObject *movie;
+ QString title;
};
MovieAnnotationPrivate::MovieAnnotationPrivate()
@@ -2018,6 +2019,18 @@ void MovieAnnotation::setMovie( MovieObject *movie )
d->movie = movie;
}
+QString MovieAnnotation::movieTitle() const
+{
+ Q_D( const MovieAnnotation );
+ return d->title;
+}
+
+void MovieAnnotation::setMovieTitle( const QString &title )
+{
+ Q_D( MovieAnnotation );
+ d->title = title;
+}
+
//BEGIN utility annotation functions
QColor convertAnnotColor( AnnotColor *color )
{
diff --git a/qt4/src/poppler-annotation.h b/qt4/src/poppler-annotation.h
index b993476..5299dd4 100644
--- a/qt4/src/poppler-annotation.h
+++ b/qt4/src/poppler-annotation.h
@@ -599,6 +599,9 @@ class POPPLER_QT4_EXPORT MovieAnnotation : public Annotation
MovieObject* movie() const;
void setMovie( MovieObject *movie );
+ QString movieTitle() const;
+ void setMovieTitle( const QString &title );
+
private:
Q_DECLARE_PRIVATE( MovieAnnotation )
Q_DISABLE_COPY( MovieAnnotation )
More information about the poppler
mailing list