author | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
commit | 15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff) | |
tree | c2fa0399a2c47fda8e2cd0092c73a809d17f68eb /core/multimedia/opieplayer/libflash/swf.h | |
download | opie-15318cad33835e4e2dc620d033e43cd930676cdd.zip opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2 |
Initial revision
Diffstat (limited to 'core/multimedia/opieplayer/libflash/swf.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/libflash/swf.h | 229 |
1 files changed, 229 insertions, 0 deletions
diff --git a/core/multimedia/opieplayer/libflash/swf.h b/core/multimedia/opieplayer/libflash/swf.h new file mode 100644 index 0000000..5f5e4f7 --- a/dev/null +++ b/core/multimedia/opieplayer/libflash/swf.h | |||
@@ -0,0 +1,229 @@ | |||
1 | #ifndef _SWF_H_ | ||
2 | #define _SWF_H_ | ||
3 | |||
4 | #include <stdio.h> | ||
5 | #include <stdlib.h> | ||
6 | #include <string.h> | ||
7 | #include <setjmp.h> | ||
8 | #include <assert.h> | ||
9 | #include <limits.h> | ||
10 | |||
11 | #ifdef DUMP | ||
12 | #include "bitstream.h" | ||
13 | #endif | ||
14 | |||
15 | #include "flash.h" | ||
16 | |||
17 | extern int debug; | ||
18 | |||
19 | // Global Types | ||
20 | typedef unsigned long U32, *P_U32, **PP_U32; | ||
21 | typedef signed long S32, *P_S32, **PP_S32; | ||
22 | typedef unsigned short U16, *P_U16, **PP_U16; | ||
23 | typedef signed short S16, *P_S16, **PP_S16; | ||
24 | typedef unsigned char U8, *P_U8, **PP_U8; | ||
25 | typedef signed char S8, *P_S8, **PP_S8; | ||
26 | typedef signed long SFIXED, *P_SFIXED; | ||
27 | typedef signed long SCOORD, *P_SCOORD; | ||
28 | typedef unsigned long BOOL; | ||
29 | |||
30 | #define ZOOM(v,f) ((v)/(f)) | ||
31 | |||
32 | #include "matrix.h" | ||
33 | #include "cxform.h" | ||
34 | #include "rect.h" | ||
35 | |||
36 | #include <sys/time.h> | ||
37 | #define ST struct timeval t1,t2; | ||
38 | #define START gettimeofday(&t1,0) | ||
39 | #define STOP(msg) gettimeofday(&t2,0); printf("%s Delta = %d ms\n", msg, (t2.tv_sec-t1.tv_sec)*1000+(t2.tv_usec-t1.tv_usec)/1000); fflush(stdout); | ||
40 | |||
41 | // Start Sound Flags | ||
42 | enum { | ||
43 | soundHasInPoint = 0x01, | ||
44 | soundHasOutPoint= 0x02, | ||
45 | soundHasLoops = 0x04, | ||
46 | soundHasEnvelope= 0x08 | ||
47 | |||
48 | // the upper 4 bits are reserved for synchronization flags | ||
49 | }; | ||
50 | |||
51 | // Flags for Sound Format | ||
52 | enum SounfFlags { | ||
53 | soundIsStereo = 0x01, | ||
54 | soundIs16bit = 0x02, | ||
55 | soundIsADPCMCompressed= 0x10 | ||
56 | }; | ||
57 | |||
58 | // Flags for defining Button States | ||
59 | enum ButtonState { | ||
60 | stateHitTest = 0x08, | ||
61 | stateDown = 0x04, | ||
62 | stateOver = 0x02, | ||
63 | stateUp = 0x01 | ||
64 | }; | ||
65 | |||
66 | // Actions | ||
67 | enum Action { | ||
68 | // Internal actions | ||
69 | ActionRefresh = 0x00, | ||
70 | ActionPlaySound = 0x01, | ||
71 | // Normal actions | ||
72 | ActionGotoFrame = 0x81, | ||
73 | ActionGetURL = 0x83, | ||
74 | ActionNextFrame = 0x04, | ||
75 | ActionPrevFrame = 0x05, | ||
76 | ActionPlay = 0x06, | ||
77 | ActionStop = 0x07, | ||
78 | ActionToggleQuality= 0x08, | ||
79 | ActionStopSounds= 0x09, | ||
80 | ActionWaitForFrame= 0x8a, | ||
81 | ActionSetTarget = 0x8b, | ||
82 | ActionGoToLabel = 0x8c | ||
83 | }; | ||
84 | |||
85 | class Sound; | ||
86 | |||
87 | struct ActionRecord { | ||
88 | Action action; | ||
89 | |||
90 | // GotoFrame & WaitForFrame | ||
91 | long frameIndex; | ||
92 | |||
93 | // GetURL | ||
94 | char *url; | ||
95 | char *target; | ||
96 | |||
97 | // GotoLabel | ||
98 | char *frameLabel; | ||
99 | |||
100 | // WaitForFrame | ||
101 | long skipCount; | ||
102 | |||
103 | // Sound | ||
104 | Sound *sound; | ||
105 | |||
106 | struct ActionRecord*next; | ||
107 | |||
108 | ActionRecord() { | ||
109 | frameLabel = 0; | ||
110 | url = 0; | ||
111 | target = 0; | ||
112 | sound = 0; | ||
113 | }; | ||
114 | |||
115 | ~ActionRecord() { | ||
116 | if (frameLabel) free(frameLabel); | ||
117 | if (url) free(url); | ||
118 | if (target) free(target); | ||
119 | }; | ||
120 | }; | ||
121 | |||
122 | enum FontFlags { | ||
123 | fontUnicode = 0x20, | ||
124 | fontShiftJIS = 0x10, | ||
125 | fontANSI = 0x08, | ||
126 | fontItalic = 0x04, | ||
127 | fontBold = 0x02, | ||
128 | fontWideCodes = 0x01 | ||
129 | }; | ||
130 | |||
131 | enum TextFlags { | ||
132 | isTextControl = 0x80, | ||
133 | |||
134 | textIsLarge = 0x70, | ||
135 | textHasFont = 0x08, | ||
136 | textHasColor = 0x04, | ||
137 | textHasYOffset= 0x02, | ||
138 | textHasXOffset= 0x01 | ||
139 | }; | ||
140 | |||
141 | #ifndef NULL | ||
142 | #define NULL 0 | ||
143 | #endif | ||
144 | |||
145 | // Tag values that represent actions or data in a Flash script. | ||
146 | enum | ||
147 | { | ||
148 | stagEnd = 0, | ||
149 | stagShowFrame = 1, | ||
150 | stagDefineShape = 2, | ||
151 | stagFreeCharacter = 3, | ||
152 | stagPlaceObject = 4, | ||
153 | stagRemoveObject = 5, | ||
154 | stagDefineBits = 6, | ||
155 | stagDefineButton = 7, | ||
156 | stagJPEGTables = 8, | ||
157 | stagSetBackgroundColor= 9, | ||
158 | stagDefineFont = 10, | ||
159 | stagDefineText = 11, | ||
160 | stagDoAction = 12, | ||
161 | stagDefineFontInfo = 13, | ||
162 | stagDefineSound = 14,// Event sound tags. | ||
163 | stagStartSound = 15, | ||
164 | stagStopSound = 16, | ||
165 | stagDefineButtonSound= 17, | ||
166 | stagSoundStreamHead = 18, | ||
167 | stagSoundStreamBlock= 19, | ||
168 | stagDefineBitsLossless = 20,// A bitmap using lossless zlib compression. | ||
169 | stagDefineBitsJPEG2 = 21,// A bitmap using an internal JPEG compression table. | ||
170 | stagDefineShape2 = 22, | ||
171 | stagDefineButtonCxform= 23, | ||
172 | stagProtect = 24,// This file should not be importable for editing. | ||
173 | |||
174 | // These are the new tags for Flash 3. | ||
175 | stagPlaceObject2 = 26,// The new style place w/ alpha color transform and name. | ||
176 | stagRemoveObject2 = 28,// A more compact remove object that omits the character tag (just depth). | ||
177 | stagDefineShape3 = 32,// A shape V3 includes alpha values. | ||
178 | stagDefineText2 = 33,// A text V2 includes alpha values. | ||
179 | stagDefineButton2 = 34,// A button V2 includes color transform, alpha and multiple actions | ||
180 | stagDefineBitsJPEG3 = 35,// A JPEG bitmap with alpha info. | ||
181 | stagDefineBitsLossless2 = 36,// A lossless bitmap with alpha info. | ||
182 | stagDefineSprite = 39,// Define a sequence of tags that describe the behavior of a sprite. | ||
183 | stagNameCharacter = 40,// Name a character definition, character id and a string, (used for buttons, bitmaps, sprites and sounds). | ||
184 | stagFrameLabel = 43,// A string label for the current frame. | ||
185 | stagSoundStreamHead2 = 45,// For lossless streaming sound, should not have needed this... | ||
186 | stagDefineMorphShape = 46,// A morph shape definition | ||
187 | stagDefineFont2 = 48, | ||
188 | |||
189 | notEnoughData = 0xffff,// Special code | ||
190 | }; | ||
191 | |||
192 | #ifndef false | ||
193 | #define false 0 | ||
194 | #endif | ||
195 | #ifndef true | ||
196 | #define true 1 | ||
197 | #endif | ||
198 | |||
199 | extern int shape_size,shape_nb,shaperecord_size,shaperecord_nb,style_size,style_nb; | ||
200 | |||
201 | typedef void (*ScanLineFunc)(void *id, long y, long start, long end); | ||
202 | |||
203 | class Bitmap; | ||
204 | struct FlashMovie; | ||
205 | |||
206 | extern "C" { | ||
207 | #include "jpeglib.h" | ||
208 | }; | ||
209 | extern "C" { | ||
210 | //#include "zlib.h" | ||
211 | #include "../src/3rdparty/zlib/zlib.h" | ||
212 | }; | ||
213 | |||
214 | #include "graphic.h" | ||
215 | #include "character.h" | ||
216 | #include "bitmap.h" | ||
217 | #include "shape.h" | ||
218 | #include "displaylist.h" | ||
219 | #include "sound.h" | ||
220 | #include "button.h" | ||
221 | #include "font.h" | ||
222 | #include "text.h" | ||
223 | #include "adpcm.h" | ||
224 | #include "program.h" | ||
225 | #include "sprite.h" | ||
226 | #include "script.h" | ||
227 | #include "movie.h" | ||
228 | |||
229 | #endif /* _SWF_H_ */ | ||