"Fossies" - the Fresh Open Source Software Archive

Member "poppler-0.82.0/qt5/src/poppler-movie.cc" (25 Oct 2019, 2763 Bytes) of package /linux/misc/poppler-0.82.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "poppler-movie.cc" see the Fossies "Dox" file reference documentation.

    1 /* poppler-sound.cc: qt interface to poppler
    2  * Copyright (C) 2008, 2010, Pino Toscano <pino@kde.org>
    3  * Copyright (C) 2008, 2018, Albert Astals Cid <aacid@kde.org>
    4  * Copyright (C) 2010, Carlos Garcia Campos <carlosgc@gnome.org>
    5  * Copyright (C) 2012, Tobias Koenig <tobias.koenig@kdab.com>
    6  *
    7  * This program is free software; you can redistribute it and/or modify
    8  * it under the terms of the GNU General Public License as published by
    9  * the Free Software Foundation; either version 2, or (at your option)
   10  * any later version.
   11  *
   12  * This program is distributed in the hope that it will be useful,
   13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15  * GNU General Public License for more details.
   16  *
   17  * You should have received a copy of the GNU General Public License
   18  * along with this program; if not, write to the Free Software
   19  * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
   20  */
   21 
   22 #include "poppler-qt5.h"
   23 
   24 #include "Object.h"
   25 #include "Annot.h"
   26 #include "Movie.h"
   27 
   28 #include <QtGui/QImage>
   29 
   30 namespace Poppler
   31 {
   32 
   33 class MovieData
   34 {
   35 public:
   36     MovieData()
   37       : m_movieObj( nullptr )
   38     {
   39     }
   40 
   41     ~MovieData()
   42     {
   43         delete m_movieObj;
   44     }
   45 
   46     MovieData(const MovieData &) = delete;
   47     MovieData& operator=(const MovieData &) = delete;
   48 
   49     Movie *m_movieObj;
   50     QSize m_size;
   51     int m_rotation;
   52     QImage m_posterImage;
   53     MovieObject::PlayMode m_playMode : 3;
   54     bool m_showControls : 1;
   55 };
   56 
   57 MovieObject::MovieObject( AnnotMovie *ann )
   58 {
   59     m_movieData = new MovieData();
   60     m_movieData->m_movieObj = ann->getMovie()->copy();
   61     //TODO: copy poster image
   62 
   63     const MovieActivationParameters *mp = m_movieData->m_movieObj->getActivationParameters();
   64     int width, height;
   65     m_movieData->m_movieObj->getFloatingWindowSize(&width, &height);
   66     m_movieData->m_size = QSize(width, height);
   67     m_movieData->m_rotation = m_movieData->m_movieObj->getRotationAngle();
   68     m_movieData->m_showControls = mp->showControls;
   69     m_movieData->m_playMode = (MovieObject::PlayMode)mp->repeatMode;
   70 }
   71 
   72 MovieObject::~MovieObject()
   73 {
   74     delete m_movieData;
   75 }
   76 
   77 QString MovieObject::url() const
   78 {
   79     const GooString * goo = m_movieData->m_movieObj->getFileName();
   80     return goo ? QString( goo->c_str() ) : QString();
   81 }
   82 
   83 QSize MovieObject::size() const
   84 {
   85     return m_movieData->m_size;
   86 }
   87 
   88 int MovieObject::rotation() const
   89 {
   90     return m_movieData->m_rotation;
   91 }
   92 
   93 bool MovieObject::showControls() const
   94 {
   95     return m_movieData->m_showControls;
   96 }
   97 
   98 MovieObject::PlayMode MovieObject::playMode() const
   99 {
  100     return m_movieData->m_playMode;
  101 }
  102 
  103 bool MovieObject::showPosterImage() const
  104 {
  105     return (m_movieData->m_movieObj->getShowPoster() == true);
  106 }
  107 
  108 QImage MovieObject::posterImage() const
  109 {
  110     return m_movieData->m_posterImage;
  111 }
  112 
  113 }