Diffstat (limited to 'core/multimedia/opieplayer/libflash/program.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/libflash/program.h | 185 |
1 files changed, 185 insertions, 0 deletions
diff --git a/core/multimedia/opieplayer/libflash/program.h b/core/multimedia/opieplayer/libflash/program.h new file mode 100644 index 0000000..7672d88 --- a/dev/null +++ b/core/multimedia/opieplayer/libflash/program.h | |||
@@ -0,0 +1,185 @@ | |||
1 | ///////////////////////////////////////////////////////////// | ||
2 | // Flash Plugin and Player | ||
3 | // Copyright (C) 1998 Olivier Debon | ||
4 | // | ||
5 | // This program is free software; you can redistribute it and/or | ||
6 | // modify it under the terms of the GNU General Public License | ||
7 | // as published by the Free Software Foundation; either version 2 | ||
8 | // of the License, or (at your option) any later version. | ||
9 | // | ||
10 | // This program is distributed in the hope that it will be useful, | ||
11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | // GNU General Public License for more details. | ||
14 | // | ||
15 | // You should have received a copy of the GNU General Public License | ||
16 | // along with this program; if not, write to the Free Software | ||
17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
18 | // | ||
19 | /////////////////////////////////////////////////////////////// | ||
20 | #ifndef _PROGRAM_H_ | ||
21 | #define _PROGRAM_H_ | ||
22 | |||
23 | enum ControlType { | ||
24 | ctrlPlaceObject, | ||
25 | ctrlPlaceObject2, | ||
26 | ctrlRemoveObject, | ||
27 | ctrlRemoveObject2, | ||
28 | ctrlDoAction, | ||
29 | ctrlStartSound, | ||
30 | ctrlStopSound, | ||
31 | ctrlBackgroundColor | ||
32 | }; | ||
33 | |||
34 | enum PlaceFlags { | ||
35 | placeIsMove = 0x01, | ||
36 | placeHasCharacter= 0x02, | ||
37 | placeHasMatrix = 0x04, | ||
38 | placeHasColorXform= 0x08, | ||
39 | placeHasRatio = 0x10, | ||
40 | placeHasName = 0x20, | ||
41 | placeHasClip = 0x40 | ||
42 | }; | ||
43 | |||
44 | struct Control { | ||
45 | ControlTypetype; | ||
46 | |||
47 | // Place, Remove, Sound | ||
48 | Character*character; | ||
49 | long depth; | ||
50 | |||
51 | // Place 1&2 | ||
52 | PlaceFlags flags; | ||
53 | Matrix matrix; | ||
54 | Cxform cxform; | ||
55 | long ratio; | ||
56 | long clipDepth; | ||
57 | char *name; | ||
58 | |||
59 | // BackgroundColor | ||
60 | Color color; | ||
61 | |||
62 | // DoAction | ||
63 | ActionRecord*actionRecords; | ||
64 | |||
65 | struct Control *next; | ||
66 | |||
67 | |||
68 | // Methods | ||
69 | |||
70 | void addActionRecord( ActionRecord *ar) | ||
71 | { | ||
72 | ar->next = 0; | ||
73 | |||
74 | if (actionRecords == 0) { | ||
75 | actionRecords = ar; | ||
76 | } else { | ||
77 | ActionRecord *current; | ||
78 | |||
79 | for(current = actionRecords; current->next; current = current->next); | ||
80 | |||
81 | current->next = ar; | ||
82 | } | ||
83 | }; | ||
84 | |||
85 | Control() | ||
86 | { | ||
87 | actionRecords = 0; | ||
88 | cxform.aa = 1.0; cxform.ab = 0; | ||
89 | cxform.ra = 1.0; cxform.rb = 0; | ||
90 | cxform.ga = 1.0; cxform.gb = 0; | ||
91 | cxform.ba = 1.0; cxform.bb = 0; | ||
92 | ratio = 0; | ||
93 | clipDepth = 0; | ||
94 | name = 0; | ||
95 | }; | ||
96 | |||
97 | ~Control() | ||
98 | { | ||
99 | ActionRecord*ar,*del; | ||
100 | for(ar = actionRecords; ar;) | ||
101 | { | ||
102 | del = ar; | ||
103 | ar = ar->next; | ||
104 | delete del; | ||
105 | } | ||
106 | if (name) { | ||
107 | free(name); | ||
108 | } | ||
109 | }; | ||
110 | }; | ||
111 | |||
112 | struct Frame { | ||
113 | char *label; | ||
114 | Control *controls;// Controls for this frame | ||
115 | }; | ||
116 | |||
117 | enum MovieStatus { | ||
118 | MoviePaused, | ||
119 | MoviePlay | ||
120 | }; | ||
121 | |||
122 | struct FlashMovie; | ||
123 | |||
124 | struct Program { | ||
125 | DisplayList*dl; | ||
126 | |||
127 | Frame *frames;// Array | ||
128 | long nbFrames;// Number of valid frames | ||
129 | long currentFrame; | ||
130 | long loadingFrame; | ||
131 | long totalFrames;// Total expected number of frames | ||
132 | long nextFrame; | ||
133 | int movieWait;// If true freeze movie until next loaded frame | ||
134 | MovieStatus movieStatus; | ||
135 | Sound *currentSound; | ||
136 | long settings; | ||
137 | FlashMovie *movie; | ||
138 | long render;// True if needed to be rendered | ||
139 | |||
140 | Program(FlashMovie *movie,long n); | ||
141 | ~Program(); | ||
142 | |||
143 | void rewindMovie(); | ||
144 | void pauseMovie(); | ||
145 | void continueMovie(); | ||
146 | void nextStepMovie(); | ||
147 | void gotoFrame(GraphicDevice *gd, long f); | ||
148 | |||
149 | long processMovie(GraphicDevice *, SoundMixer *); | ||
150 | long nestedMovie(GraphicDevice *, SoundMixer *, Matrix *, Cxform *); | ||
151 | long runFrame(GraphicDevice *, SoundMixer *, long f, long action=1); | ||
152 | long handleEvent(GraphicDevice *, SoundMixer *, FlashEvent *); | ||
153 | long doAction(GraphicDevice *gd, ActionRecord *action, SoundMixer *); | ||
154 | void setCurrentFrameLabel(char *label); | ||
155 | void advanceFrame(); | ||
156 | void addControlInCurrentFrame(Control *ctrl); | ||
157 | void setGetUrlMethod( void (*)(char *, char *, void *), void *); | ||
158 | void modifySettings(long flags); | ||
159 | long searchFrame(GraphicDevice *gd, char *, char *); | ||
160 | void validateLoadingFrame(); | ||
161 | long getCurrentFrame(); | ||
162 | void setCurrentFrame(long); | ||
163 | |||
164 | Frame*getFrames(); | ||
165 | long getNbFrames(); | ||
166 | |||
167 | DisplayList *getDisplayList(); | ||
168 | |||
169 | #ifdef DUMP | ||
170 | void dump(BitStream *bs); | ||
171 | static void dumpActions(BitStream *bs, ActionRecord *actions); | ||
172 | #endif | ||
173 | }; | ||
174 | |||
175 | DisplayListEntry *findFocus(DisplayList *dl); | ||
176 | void setFlashTimer(struct timeval *tv, int time_ms); | ||
177 | int checkFlashTimer(struct timeval *tv); | ||
178 | |||
179 | void loadNewSwf(FlashMovie *movie, char *url, int level); | ||
180 | |||
181 | void computeBBox(FlashMovie *movie, Rect *rect, DisplayListEntry *e); | ||
182 | |||
183 | long processMovie(FlashMovie *movie); | ||
184 | |||
185 | #endif /* _PROGRAM_H_ */ | ||