beta-0.89.2
[luatex.git] / source / libs / poppler / poppler-src / poppler / Rendition.h
blob75bfeff32c97362c1457a239cf9bef5b273a929d
1 //*********************************************************************************
2 // Rendition.h
3 //---------------------------------------------------------------------------------
4 //
5 //---------------------------------------------------------------------------------
6 // Hugo Mercier <hmercier31[at]gmail.com> (c) 2008
7 // Carlos Garcia Campos <carlosgc@gnome.org> (c) 2010
8 //
9 // This program is free software; you can redistribute it and/or modify
10 // it under the terms of the GNU General Public License as published by
11 // the Free Software Foundation; either version 2 of the License, or
12 // (at your option) any later version.
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 //*********************************************************************************
24 #ifndef _RENDITION_H_
25 #define _RENDITION_H_
27 #include "Object.h"
29 struct MediaWindowParameters {
31 MediaWindowParameters();
32 ~MediaWindowParameters();
34 // parse from a floating window parameters dictionary
35 void parseFWParams(Object* obj);
37 enum MediaWindowType {
38 windowFloating = 0,
39 windowFullscreen,
40 windowHidden,
41 windowEmbedded
44 enum MediaWindowRelativeTo {
45 windowRelativeToDocument = 0,
46 windowRelativeToApplication,
47 windowRelativeToDesktop
51 // DEFAULT VALUE
53 MediaWindowType type; // movieWindowEmbedded
56 int width; // -1
57 int height; // -1
59 // floating window position
60 MediaWindowRelativeTo relativeTo; // windowRelativeToDocument (or to desktop)
61 double XPosition; // 0.5
62 double YPosition; // 0.5
64 GBool hasTitleBar; // true
65 GBool hasCloseButton; // true
66 GBool isResizeable; // true
70 struct MediaParameters {
72 MediaParameters();
73 ~MediaParameters();
75 // parse from a "Media Play Parameters" dictionary
76 void parseMediaPlayParameters(Object* playObj);
77 // parse from a "Media Screen Parameters" dictionary
78 void parseMediaScreenParameters(Object* screenObj);
80 enum MediaFittingPolicy {
81 fittingMeet = 0,
82 fittingSlice,
83 fittingFill,
84 fittingScroll,
85 fittingHidden,
86 fittingUndefined
89 struct Color {
90 double r, g, b;
93 int duration; // 0
95 int volume; // 100
97 // defined in media play parameters, p 770
98 // correspond to 'fit' SMIL's attribute
99 MediaFittingPolicy fittingPolicy; // fittingUndefined
101 GBool autoPlay; // true
103 // repeat count, can be real values, 0 means forever
104 double repeatCount; // 1.0
106 // background color // black = (0.0 0.0 0.0)
107 Color bgColor;
109 // opacity in [0.0 1.0]
110 double opacity; // 1.0
113 GBool showControls; // false
115 MediaWindowParameters windowParams;
118 class MediaRendition {
119 public:
120 MediaRendition(Object *obj);
121 ~MediaRendition();
123 GBool isOk () { return ok; }
125 MediaParameters* getMHParameters() { return &MH; }
126 MediaParameters* getBEParameters() { return &BE; }
128 GooString* getContentType() { return contentType; }
129 GooString* getFileName() { return fileName; }
131 GBool getIsEmbedded() { return isEmbedded; }
132 Stream* getEmbbededStream() { return embeddedStream; }
133 // write embedded stream to file
134 void outputToFile(FILE*);
136 MediaRendition* copy();
138 private:
139 GBool ok;
141 // "Must Honor" parameters
142 MediaParameters MH;
143 // "Best Effort" parameters
144 MediaParameters BE;
146 GBool isEmbedded;
148 GooString* contentType;
150 // if it's embedded
151 Stream* embeddedStream;
153 // if it's not embedded
154 GooString* fileName;
157 #endif /* _RENDITION_H_ */