Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-10 10:23:48

0001 //*********************************************************************************
0002 //                               Movie.h
0003 //---------------------------------------------------------------------------------
0004 //
0005 //---------------------------------------------------------------------------------
0006 // Hugo Mercier <hmercier31[at]gmail.com> (c) 2008
0007 // Carlos Garcia Campos <carlosgc@gnome.org> (c) 2010
0008 // Albert Astals Cid <aacid@kde.org> (c) 2017-2019, 2021, 2022
0009 //
0010 // This program is free software; you can redistribute it and/or modify
0011 // it under the terms of the GNU General Public License as published by
0012 // the Free Software Foundation; either version 2 of the License, or
0013 // (at your option) any later version.
0014 //
0015 // This program is distributed in the hope that it will be useful,
0016 // but WITHOUT ANY WARRANTY; without even the implied warranty of
0017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0018 // GNU General Public License for more details.
0019 //
0020 // You should have received a copy of the GNU General Public License
0021 // along with this program; if not, write to the Free Software
0022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
0023 //*********************************************************************************
0024 
0025 #ifndef _MOVIE_H_
0026 #define _MOVIE_H_
0027 
0028 #include "Object.h"
0029 #include "poppler_private_export.h"
0030 
0031 #include <memory>
0032 
0033 struct MovieActivationParameters
0034 {
0035 
0036     MovieActivationParameters();
0037     ~MovieActivationParameters();
0038 
0039     // parse from a "Movie Activation" dictionary
0040     void parseMovieActivation(const Object *aDict);
0041 
0042     enum MovieRepeatMode
0043     {
0044         repeatModeOnce,
0045         repeatModeOpen,
0046         repeatModeRepeat,
0047         repeatModePalindrome
0048     };
0049 
0050     struct MovieTime
0051     {
0052         MovieTime() { units_per_second = 0; }
0053         unsigned long units;
0054         int units_per_second; // 0 : defined by movie
0055     };
0056 
0057     MovieTime start; // 0
0058     MovieTime duration; // 0
0059 
0060     double rate; // 1.0
0061 
0062     int volume; // 100
0063 
0064     bool showControls; // false
0065 
0066     bool synchronousPlay; // false
0067     MovieRepeatMode repeatMode; // repeatModeOnce
0068 
0069     // floating window position
0070     bool floatingWindow;
0071     double xPosition; // 0.5
0072     double yPosition; // 0.5
0073     int znum; // 1
0074     int zdenum; // 1
0075 };
0076 
0077 class POPPLER_PRIVATE_EXPORT Movie
0078 {
0079 public:
0080     Movie(const Object *movieDict, const Object *aDict);
0081     explicit Movie(const Object *movieDict);
0082     Movie(const Movie &other);
0083     ~Movie();
0084     Movie &operator=(const Movie &) = delete;
0085 
0086     bool isOk() const { return ok; }
0087     const MovieActivationParameters *getActivationParameters() const { return &MA; }
0088 
0089     const GooString *getFileName() const { return fileName; }
0090 
0091     unsigned short getRotationAngle() const { return rotationAngle; }
0092     void getAspect(int *widthA, int *heightA) const
0093     {
0094         *widthA = width;
0095         *heightA = height;
0096     }
0097 
0098     Object getPoster() const { return poster.copy(); }
0099     bool getShowPoster() const { return showPoster; }
0100 
0101     bool getUseFloatingWindow() const { return MA.floatingWindow; }
0102     void getFloatingWindowSize(int *width, int *height);
0103 
0104     std::unique_ptr<Movie> copy() const;
0105 
0106 private:
0107     void parseMovie(const Object *movieDict);
0108 
0109     bool ok;
0110 
0111     unsigned short rotationAngle; // 0
0112     int width; // Aspect
0113     int height; // Aspect
0114 
0115     Object poster;
0116     bool showPoster;
0117 
0118     GooString *fileName;
0119 
0120     MovieActivationParameters MA;
0121 };
0122 
0123 #endif