source: trunk/poppler/mypoppler/poppler/Movie.h @ 250

Last change on this file since 250 was 250, checked in by Eugene Romanenko, 13 years ago

PDF plugin: poppler library updated to version 0.8.3

File size: 4.6 KB
Line 
1//*********************************************************************************
2//                               Movie.h
3//---------------------------------------------------------------------------------
4//
5//---------------------------------------------------------------------------------
6// Hugo Mercier <hmercier31[at]gmail.com> (c) 2008
7//
8// This program is free software; you can redistribute it and/or modify
9// it under the terms of the GNU General Public License as published by
10// the Free Software Foundation; either version 2 of the License, or
11// (at your option) any later version.
12//
13// This program is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16// GNU General Public License for more details.
17//
18// You should have received a copy of the GNU General Public License
19// along with this program; if not, write to the Free Software
20// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21//*********************************************************************************
22
23#ifndef _MOVIE_H_
24#define _MOVIE_H_
25
26#include "Object.h"
27#include "Annot.h"
28
29class GooList;
30
31
32struct MovieWindowParameters {
33
34  MovieWindowParameters();
35  ~MovieWindowParameters();
36
37  // parse from a floating window parameters dictionary
38  void parseFWParams(Object* obj);
39
40  enum MovieWindowType {
41    movieWindowFloating = 0,
42    movieWindowFullscreen,
43    movieWindowHidden,  // ?
44    movieWindowEmbedded
45  };
46
47  enum MovieWindowRelativeTo {
48    windowRelativeToDocument = 0,
49    windowRelativeToApplication,
50    windowRelativeToDesktop
51  };
52
53
54                                         // DEFAULT VALUE
55
56  MovieWindowType type;                  // movieWindowEmbedded
57 
58
59  int width;                             // -1
60  int height;                            // -1
61 
62  // floating window position
63  MovieWindowRelativeTo relativeTo;      // windowRelativeToDocument (or to desktop)
64  double XPosition;                      // 0.5
65  double YPosition;                      // 0.5
66
67  GBool hasTitleBar;                      // true
68  GBool hasCloseButton;                   // true
69  GBool isResizeable;                     // true
70};
71
72
73struct MovieParameters {
74
75  MovieParameters();
76  ~MovieParameters();
77
78  // parse from a "Media Play Parameters" dictionary
79  void parseMediaPlayParameters(Object* playObj);
80  // parse from a "Media Screen Parameters" dictionary
81  void parseMediaScreenParameters(Object* screenObj);
82  // parse from a AnnotMovie object
83  void parseAnnotMovie(AnnotMovie* annot);
84
85  enum MovieFittingPolicy {
86    fittingMeet = 0,
87    fittingSlice,
88    fittingFill,
89    fittingScroll,
90    fittingHidden,
91    fittingUndefined
92  };
93
94  struct MovieTime {
95    MovieTime() { units_per_second = 0; }
96    Gulong units;
97    int units_per_second; // 0 : defined by movie
98  };
99 
100  struct Color {
101    double r, g, b;
102  };
103
104  Gushort rotationAngle;                   // 0
105
106  MovieTime start;                         // 0
107  MovieTime duration;                      // 0
108
109  double rate;                             // 1.0
110
111  int volume;                              // 100
112
113  // defined in media play parameters, p 770
114  // correspond to 'fit' SMIL's attribute
115  MovieFittingPolicy fittingPolicy;        // fittingUndefined
116
117  GBool autoPlay;                          // true
118
119  // repeat count, can be real values, 0 means forever
120  double repeatCount;                      // 1.0
121
122  // background color                      // black = (0.0 0.0 0.0)
123  Color bgColor;
124 
125  // opacity in [0.0 1.0]
126  double opacity;                          // 1.0
127 
128
129  GBool showControls;                      // false
130
131  MovieWindowParameters windowParams;
132};
133
134class Movie {
135 public:
136  Movie();
137  ~Movie();
138
139  void parseAnnotMovie(AnnotMovie* annot);
140  void parseMediaRendition(Object* obj);
141
142  MovieParameters* getMHParameters() { return &MH; }
143  MovieParameters* getBEParameters() { return &BE; }
144
145  GooString* getContentType() { return contentType; }
146  GooString* getFileName() { return fileName; }
147
148  GBool getIsEmbedded() { return isEmbedded; }
149  Stream* getEmbbededStream() { return embeddedStream; }
150  // write embedded stream to file
151  void outputToFile(FILE*);
152
153  Stream* getPosterStream() { return posterStream; }
154
155  Movie* copy();
156
157 private:
158  // "Must Honor" parameters
159  MovieParameters MH;
160  // "Best Effort" parameters
161  MovieParameters BE;
162
163  Stream* posterStream;
164
165  GBool isEmbedded;
166
167  GooString* contentType;
168
169  // if it's embedded
170  Stream* embeddedStream;
171
172  // if it's not embedded
173  GooString* fileName;
174};
175
176#endif
177
Note: See TracBrowser for help on using the repository browser.