1 /*
2     Ming, an SWF output library
3     Copyright (C) 2001  Opaque Industries - http://www.opaque.net/
4 
5     This library is free software; you can redistribute it and/or
6     modify it under the terms of the GNU Lesser General Public
7     License as published by the Free Software Foundation; either
8     version 2.1 of the License, or (at your option) any later version.
9 
10     This library 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 GNU
13     Lesser General Public License for more details.
14 
15     You should have received a copy of the GNU Lesser General Public
16     License along with this library; if not, write to the Free Software
17     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 */
19 
20 #ifndef SWF_H_INCLUDED
21 #define SWF_H_INCLUDED
22 
23 #include <stdio.h>
24 
25 #include "blocktypes.h"
26 
27 typedef unsigned char byte;
28 
29 extern void (*SWF_warn)(const char *msg, ...);
30 extern void (*SWF_error)(const char *msg, ...);
31 
32 void setSWFWarnFunction(void (*error)(const char *msg, ...));
33 void setSWFErrorFunction(void (*error)(const char *msg, ...));
34 
35 void SWF_assert(int c);
36 
37 
38   /* a generic output method.  specific instances dump output to file,
39      send to stdout, etc. */
40 
41 typedef void (*SWFByteOutputMethod)(byte b, void *data);
42 
43 void methodWriteUInt16(int i, SWFByteOutputMethod method, void *data);
44 void methodWriteUInt32(int i, SWFByteOutputMethod method, void *data);
45 
46 void fileOutputMethod(byte b, void *data);
47 
48 
49 /* we dig opaque types */
50 
51 
52   /* SWFBlock is the parent for all classes in this directory */
53 
54 typedef struct SWFBlock_s* SWFBlock;
55 
56 int completeSWFBlock(SWFBlock block);
57 void destroySWFBlock(SWFBlock block);
58 int writeSWFBlockToMethod(SWFBlock block,
59 			  SWFByteOutputMethod method, void *data);
60 
61 void SWFBlock_setDefined(SWFBlock block);
62 byte SWFBlock_isDefined(SWFBlock block);
63 
64 SWFBlocktype SWFBlock_getType(SWFBlock block);
65 
66 
67   /* SWFInput */
68 
69 typedef struct SWFInput_s *SWFInput;
70 
71 int SWFInput_length(SWFInput input);
72 void SWFInput_rewind(SWFInput input);
73 int SWFInput_tell(SWFInput input);
74 void SWFInput_seek(SWFInput input, long offset, int whence);
75 int SWFInput_eof(SWFInput input);
76 
77 SWFInput newSWFInput_file(FILE *f);
78 SWFInput newSWFInput_stream(FILE *f);
79 SWFInput newSWFInput_buffer(unsigned char *buffer, int length);
80 SWFInput newSWFInput_allocedBuffer(unsigned char *buffer, int length);
81 
82 
83   /* SWFOutput */
84 
85 typedef struct SWFOutput_s * SWFOutput;
86 
87 SWFOutput newSWFOutput();
88 SWFOutput newSizedSWFOutput(int size);
89 void destroySWFOutput(SWFOutput out);
90 
91 int SWFOutput_length(SWFOutput out);
92 void SWFOutput_byteAlign(SWFOutput out);
93 void SWFOutput_writeUInt16(SWFOutput out, int data);
94 void SWFOutput_writeToMethod(SWFOutput out,
95 			     SWFByteOutputMethod method, void *data);
96 
97 
98   /* SWFRect */
99 
100 typedef struct SWFRect_s * SWFRect;
101 
102 SWFRect newSWFRect(int minX, int maxX, int minY, int maxY);
103 void destroySWFRect(SWFRect rect);
104 void SWFOutput_writeRect(SWFOutput output, SWFRect rect);
105 
106 int SWFRect_getWidth(SWFRect r);
107 int SWFRect_getHeight(SWFRect r);
108 
109 
110   /* SWFCharacter */
111 
112 /* everything with a character ID is an SWFCharacter */
113 
114 typedef struct SWFCharacter_s * SWFCharacter;
115 
116 /* this is a silly hack to track blocks which are dependent on others.
117    Would be nice to have this in the ming layer above instead */
118 
119 void SWFCharacter_addDependency(SWFCharacter character, SWFBlock dependency);
120 SWFBlock *SWFCharacter_getDependencies(SWFCharacter character);
121 int SWFCharacter_getNDependencies(SWFCharacter character);
122 void SWFCharacter_clearDependencies(SWFCharacter character);
123 
124 int SWFCharacter_getScaledWidth(SWFCharacter character);
125 int SWFCharacter_getScaledHeight(SWFCharacter character);
126 
127 int SWFBlock_isCharacter(SWFBlock block);
128 
129 
130   /* SWFBitmap */
131 
132 typedef struct SWFBitmap_s *SWFBitmap;
133 
134 void destroySWFBitmap(SWFBlock block);
135 int SWFBitmap_getWidth(SWFBitmap b);
136 int SWFBitmap_getHeight(SWFBitmap b);
137 
138 SWFBitmap newSWFBitmap_fromInput(SWFInput input);
139 
140 
141   /* SWFDBLBitmap */
142 
143 typedef struct SWFDBLBitmap_s *SWFDBLBitmap;
144 
145 SWFDBLBitmap newSWFDBLBitmap(FILE *f);
146 SWFDBLBitmap newSWFDBLBitmap_fromInput(SWFInput input);
147 
148 
149   /* SWFJpegBitmap */
150 
151 typedef struct SWFJpegBitmap_s *SWFJpegBitmap;
152 typedef struct SWFJpegWithAlpha_s *SWFJpegWithAlpha;
153 
154 SWFJpegBitmap newSWFJpegBitmap(FILE *f);
155 SWFJpegBitmap newSWFJpegBitmap_fromInput(SWFInput input);
156 SWFJpegWithAlpha newSWFJpegWithAlpha(FILE *f, FILE *alpha);
157 SWFJpegWithAlpha newSWFJpegWithAlpha_fromInput(SWFInput input, SWFInput alpha);
158 
159 
160   /* SWFGradient */
161 
162 typedef struct SWFGradient_s *SWFGradient;
163 
164 SWFGradient newSWFGradient();
165 void destroySWFGradient(SWFGradient gradient);
166 void SWFGradient_addEntry(SWFGradient gradient,
167 			  float ratio, byte r, byte g, byte b, byte a);
168 
169 
170   /* SWFMatrix */
171 
172 typedef struct SWFMatrix_s *SWFMatrix;
173 
174 SWFMatrix newSWFMatrix(float a, float b, float c, float d, int x, int y);
175 void destroySWFMatrix(SWFMatrix matrix);
176 
177 SWFMatrix SWFMatrix_set(SWFMatrix m,
178 			float a, float b, float c, float d, int x, int y);
179 void SWFMatrix_clearTranslate(SWFMatrix m);
180 void SWFMatrix_clearTransform(SWFMatrix m);
181 
182 
183   /* SWFFont */
184 
185 typedef struct SWFFont_s *SWFFont;
186 
187 SWFFont newSWFFont();
188 SWFFont loadSWFFontFromFile(FILE *file);
189 void destroySWFFont(SWFBlock block);
190 
191 int SWFFont_getScaledStringWidth(SWFFont font, const unsigned char *string);
192 
193 short SWFFont_getScaledAscent(SWFFont font);
194 short SWFFont_getScaledDescent(SWFFont font);
195 short SWFFont_getScaledLeading(SWFFont font);
196 
197 
198   /* SWFText */
199 
200 typedef struct SWFText_s *SWFText;
201 
202 SWFText newSWFText();
203 SWFText newSWFText2();
204 void destroySWFText(SWFBlock block);
205 
206 void SWFText_setFont(SWFText text, SWFBlock font);
207 void SWFText_setScaledHeight(SWFText text, int height);
208 void SWFText_scaledMoveTo(SWFText text, int x, int y);
209 void SWFText_setColor(SWFText text, byte r, byte g, byte b, byte a);
210 void SWFText_addString(SWFText text, const char *string, int *advance);
211 void SWFText_addUTF8String(SWFText text, const char *string, int *advance);
212 void SWFText_setSpacing(SWFText text, float spacing);
213 
214 int SWFText_getScaledStringWidth(SWFText text, const char *string);
215 int SWFText_getScaledUTF8StringWidth(SWFText text, const char *string);
216 
217 short SWFText_getScaledAscent(SWFText text);
218 short SWFText_getScaledDescent(SWFText text);
219 short SWFText_getScaledLeading(SWFText text);
220 
221 
222 /* deprecated: */
223 #define SWFText_setXY(t,x,y) SWFText_moveTo((t),(x),(y))
224 
225 
226   /* SWFBrowserFont */
227 
228 typedef struct SWFBrowserFont_s *SWFBrowserFont;
229 
230 SWFBrowserFont newSWFBrowserFont(char *name);
231 void destroySWFBrowserFont(SWFBlock block);
232 
233 
234   /* SWFTextField */
235 
236 typedef struct SWFTextField_s *SWFTextField;
237 
238 #define SWFTEXTFIELD_ONMASK  0x2085 /* on bits */
239 #define SWFTEXTFIELD_OFFMASK 0x7BFF /* off bits */
240 
241 #define SWFTEXTFIELD_HASFONT   (1<<0)	/* font and size given */
242 #define SWFTEXTFIELD_HASLENGTH (1<<1)
243 #define SWFTEXTFIELD_HASCOLOR  (1<<2)
244 #define SWFTEXTFIELD_NOEDIT    (1<<3)
245 #define SWFTEXTFIELD_PASSWORD  (1<<4)
246 #define SWFTEXTFIELD_MULTILINE (1<<5)
247 #define SWFTEXTFIELD_WORDWRAP  (1<<6)
248 #define SWFTEXTFIELD_HASTEXT   (1<<7)	/* initial text present */
249 #define SWFTEXTFIELD_USEFONT   (1<<8)
250 #define SWFTEXTFIELD_HTML      (1<<9)
251 #define SWFTEXTFIELD_DRAWBOX   (1<<11)
252 #define SWFTEXTFIELD_NOSELECT  (1<<12)
253 #define SWFTEXTFIELD_HASLAYOUT (1<<13)	/* align, margin, lspace, indent */
254 #define SWFTEXTFIELD_AUTOSIZE  (1<<14)	/* SWF6 */
255 
256 typedef enum
257 {
258   SWFTEXTFIELD_ALIGN_LEFT    = 0,
259   SWFTEXTFIELD_ALIGN_RIGHT   = 1,
260   SWFTEXTFIELD_ALIGN_CENTER  = 2,
261   SWFTEXTFIELD_ALIGN_JUSTIFY = 3
262 } SWFTextFieldAlignment;
263 
264 SWFTextField newSWFTextField();
265 void destroySWFTextField(SWFBlock block);
266 
267 void SWFTextField_setFont(SWFTextField field, SWFBlock font);
268 void SWFTextField_setScaledBounds(SWFTextField field, int width, int height);
269 void SWFTextField_setFlags(SWFTextField field, int flags);
270 void SWFTextField_setColor(SWFTextField field, byte r, byte g, byte b, byte a);
271 void SWFTextField_setVariableName(SWFTextField field, const char *name);
272 void SWFTextField_addString(SWFTextField field, const char *string);
273 void SWFTextField_addUTF8String(SWFTextField field, const char *string);
274 
275 void SWFTextField_setScaledFontHeight(SWFTextField field, int height);
276 void SWFTextField_setScaledFieldHeight(SWFTextField field, int height);
277 void SWFTextField_setScaledLeftMargin(SWFTextField field, int leftMargin);
278 void SWFTextField_setScaledRightMargin(SWFTextField field, int rightMargin);
279 void SWFTextField_setScaledIndentation(SWFTextField field, int indentation);
280 void SWFTextField_setScaledLineSpacing(SWFTextField field, int lineSpacing);
281 void SWFTextField_setScaledpadding(SWFTextField field, int padding);
282 void SWFTextField_setAlignment(SWFTextField field,
283 			       SWFTextFieldAlignment alignment);
284 void SWFTextField_setLength(SWFTextField field, int length);
285 
286 
287   /* SWFFillStyle */
288 
289 typedef void *SWFFillStyle;
290 
291 #define SWFFILL_SOLID		0x00
292 #define SWFFILL_GRADIENT	0x10
293 #define SWFFILL_LINEAR_GRADIENT 0x10
294 #define SWFFILL_RADIAL_GRADIENT 0x12
295 #define SWFFILL_BITMAP		0x40
296 #define SWFFILL_TILED_BITMAP	0x40
297 #define SWFFILL_CLIPPED_BITMAP	0x41
298 
299 SWFFillStyle newSWFSolidFillStyle(byte r, byte g, byte b, byte a);
300 SWFFillStyle newSWFGradientFillStyle(SWFGradient gradient, byte radial);
301 SWFFillStyle newSWFBitmapFillStyle(SWFCharacter bitmap, byte flags);
302 
303 SWFMatrix SWFFillStyle_getMatrix(SWFFillStyle fill);
304 
305 
306   /* SWFLineStyle */
307 
308 typedef void *SWFLineStyle;
309 
310 SWFLineStyle newSWFLineStyle(unsigned short width, byte r, byte g, byte b, byte a);
311 byte SWFLineStyle_equals(SWFLineStyle line, unsigned short width, byte r, byte g, byte b, byte a);
312 
313 
314   /* SWFShape */
315 
316 typedef struct SWFShape_s *SWFShape;
317 
318 SWFShape newSWFShape();
319 void destroySWFShape(SWFBlock block);
320 
321 int SWFShape_getScaledPenX(SWFShape shape);
322 int SWFShape_getScaledPenY(SWFShape shape);
323 
324 void SWFShape_moveScaledPenTo(SWFShape shape, int x, int y);
325 void SWFShape_moveScaledPen(SWFShape shape, int x, int y);
326 
327 void SWFShape_drawScaledLineTo(SWFShape shape, int x, int y);
328 void SWFShape_drawScaledLine(SWFShape shape, int dx, int dy);
329 void SWFShape_drawScaledCurveTo(SWFShape shape, int controlx, int controly,
330 				int anchorx, int anchory);
331 void SWFShape_drawScaledCurve(SWFShape shape, int controldx, int controldy,
332 			      int anchordx, int anchordy);
333 
334 void SWFShape_drawScaledGlyph(SWFShape shape,
335 			      SWFFont font, unsigned short c, int size);
336 
337 
338 /* deprecated: */
339 
340 #define SWFShape_moveTo SWFShape_moveScaledPenTo
341 #define SWFShape_moveToRelative SWFShape_moveScaledPen
342 #define SWFShape_lineTo SWFShape_drawScaledLineTo
343 #define SWFShape_lineToRelative SWFShape_drawScaledLine
344 #define SWFShape_curveTo SWFShape_drawScaledCurveTo
345 #define SWFShape_curveToRelative SWFShape_drawScaledCurve
346 
347 void SWFShape_end(SWFShape shape);
348 
349 int SWFShape_setLineStyle(SWFShape shape, unsigned short width,
350 			  byte r, byte g, byte b, byte a);
351 
352 SWFFillStyle SWFShape_addSolidFillStyle(SWFShape shape,
353 					byte r, byte g, byte b, byte a);
354 
355 SWFFillStyle SWFShape_addGradientFillStyle(SWFShape shape,
356 					   SWFGradient gradient, byte flags);
357 
358 SWFFillStyle SWFShape_addBitmapFillStyle(SWFShape shape,
359 					 SWFBitmap bitmap, byte flags);
360 
361 void SWFShape_setLeftFillStyle(SWFShape shape, SWFFillStyle fill);
362 void SWFShape_setRightFillStyle(SWFShape shape, SWFFillStyle fill);
363 
364 
365   /* SWFMorph */
366 
367 typedef struct SWFMorph_s *SWFMorph;
368 
369 SWFMorph newSWFMorphShape();
370 void destroySWFMorph(SWFBlock block);
371 SWFShape SWFMorph_getShape1(SWFMorph morph);
372 SWFShape SWFMorph_getShape2(SWFMorph morph);
373 
374 
375   /* sound - only mp3 streaming implemented */
376 
377 typedef struct SWFSound_s *SWFSound;
378 
379 #define SWF_SOUND_COMPRESSION      0xf0
380 #define SWF_SOUND_NOT_COMPRESSED   (0<<4)
381 #define SWF_SOUND_ADPCM_COMPRESSED (1<<4)
382 
383 #define SWF_SOUND_RATE             0x0c
384 #define SWF_SOUND_5KHZ             (0<<2)
385 #define SWF_SOUND_11KHZ            (1<<2)
386 #define SWF_SOUND_22KHZ            (2<<2)
387 #define SWF_SOUND_44KHZ            (3<<2)
388 
389 #define SWF_SOUND_BITS             0x02
390 #define SWF_SOUND_8BIT             (0<<1)
391 #define SWF_SOUND_16BIT            (1<<1)
392 
393 #define SWF_SOUND_CHANNELS         0x01
394 #define SWF_SOUND_MONO             (0<<0)
395 #define SWF_SOUND_STEREO           (1<<0)
396 
397 SWFSound newSWFSound(FILE *file);
398 SWFSound newSWFSound_fromInput(SWFInput input);
399 void destroySWFSound(SWFSound sound);
400 
401 SWFBlock SWFSound_getStreamHead(SWFSound sound, float frameRate);
402 SWFBlock SWFSound_getStreamBlock(SWFSound sound);
403 void SWFSound_rewind(SWFSound sound);
404 
405 
406   /* SWFCXform */
407 
408 typedef struct SWFCXform_s *SWFCXform;
409 
410 SWFCXform newSWFCXform(int rAdd, int gAdd, int bAdd, int aAdd,
411 		       float rMult, float gMult, float bMult, float aMult);
412 
413 SWFCXform newSWFAddCXform(int rAdd, int gAdd, int bAdd, int aAdd);
414 
415 SWFCXform newSWFMultCXform(float rMult, float gMult, float bMult, float aMult);
416 
417 void SWFCXform_setColorAdd(SWFCXform cXform,
418 			   int rAdd, int gAdd, int bAdd, int aAdd);
419 
420 void SWFCXform_setColorMult(SWFCXform cXform,
421 			    float rMult, float gMult, float bMult, float aMult);
422 
423 void destroySWFCXform(SWFCXform cXform);
424 
425 
426   /* SWFAction */
427 
428 typedef struct SWFAction_s *SWFAction;
429 
430 SWFAction newSWFAction();
431 SWFAction newSWFAction_fromOutput(SWFOutput out);
432 SWFAction compileSWFActionCode(const char *script);
433 void destroySWFAction(SWFAction action);
434 
435 
436   /* placeobject.h */
437 
438 typedef struct SWFPlaceObject2Block_s *SWFPlaceObject2Block;
439 
440 #define SWF_PLACEACTION_ONLOAD      (1<<0)
441 #define SWF_PLACEACTION_ENTERFRAME  (1<<1)
442 #define SWF_PLACEACTION_UNLOAD      (1<<2)
443 #define SWF_PLACEACTION_MOUSEMOVE   (1<<3)
444 #define SWF_PLACEACTION_MOUSEDOWN   (1<<4)
445 #define SWF_PLACEACTION_MOUSEUP     (1<<5)
446 #define SWF_PLACEACTION_KEYDOWN     (1<<6)
447 #define SWF_PLACEACTION_KEYUP       (1<<7)
448 #define SWF_PLACEACTION_DATA        (1<<8)
449 
450 SWFPlaceObject2Block newSWFPlaceObject2Block(int depth);
451 
452 void SWFPlaceObject2Block_setDepth(SWFPlaceObject2Block block, int depth);
453 void SWFPlaceObject2Block_setName(SWFPlaceObject2Block block,
454 				  const char *name);
455 void SWFPlaceObject2Block_setRatio(SWFPlaceObject2Block block, int ratio);
456 void SWFPlaceObject2Block_setMaskLevel(SWFPlaceObject2Block block,
457 				       int masklevel);
458 void SWFPlaceObject2Block_setCXform(SWFPlaceObject2Block block,
459 				    SWFCXform cXform);
460 void SWFPlaceObject2Block_setColorAdd(SWFPlaceObject2Block block,
461 				      int r, int g, int b, int a);
462 void SWFPlaceObject2Block_setColorMult(SWFPlaceObject2Block block,
463 				       float r, float g, float b, float a);
464 void SWFPlaceObject2Block_setMatrix(SWFPlaceObject2Block block,
465 				    SWFMatrix matrix);
466 void SWFPlaceObject2Block_setCharacter(SWFPlaceObject2Block block,
467 				       SWFCharacter character);
468 void SWFPlaceObject2Block_setMove(SWFPlaceObject2Block block);
469 void SWFPlaceObject2Block_addAction(SWFPlaceObject2Block block,
470 				    SWFAction action, int flags);
471 
472 
473   /* random blocks */
474 
475 typedef struct SWFOutputBlock_s *SWFOutputBlock;
476 typedef struct SWFExports_s *SWFExports;
477 
478 SWFBlock newSWFPlaceObjectBlock(SWFCharacter character, int depth,
479 				SWFMatrix matrix, SWFCXform cXform);
480 
481 SWFOutputBlock newSWFRemoveObjectBlock(SWFCharacter character, int depth);
482 SWFOutputBlock newSWFRemoveObject2Block(int depth);
483 SWFOutputBlock newSWFFrameLabelBlock(const char *string);
484 SWFBlock newSWFSetBackgroundBlock(byte r, byte g, byte b);
485 SWFBlock newSWFShowFrameBlock();
486 SWFBlock newSWFEndBlock();
487 SWFBlock newSWFProtectBlock();
488 SWFOutputBlock newSWFExportBlock(SWFExports exports, int nExports);
489 
490 
491   /* SWFButton */
492 
493 typedef struct SWFButton_s *SWFButton;
494 
495 #define SWFBUTTON_HIT    (1<<3)
496 #define SWFBUTTON_DOWN   (1<<2)
497 #define SWFBUTTON_OVER   (1<<1)
498 #define SWFBUTTON_UP     (1<<0)
499 
500 /* deprecated: */
501 
502   #define SWFBUTTONRECORD_HITSTATE    (1<<3)
503   #define SWFBUTTONRECORD_DOWNSTATE   (1<<2)
504   #define SWFBUTTONRECORD_OVERSTATE   (1<<1)
505   #define SWFBUTTONRECORD_UPSTATE     (1<<0)
506 
507 
508 #define SWFBUTTON_KEYPRESS(c)     (((c)&0x7f)<<9)
509 #define SWFBUTTON_ONKEYPRESS(c)     (((c)&0x7f)<<9)
510 
511 #define SWFBUTTON_OVERDOWNTOIDLE    (1<<8)
512 #define SWFBUTTON_IDLETOOVERDOWN    (1<<7)
513 #define SWFBUTTON_OUTDOWNTOIDLE     (1<<6)
514 #define SWFBUTTON_OUTDOWNTOOVERDOWN (1<<5)
515 #define SWFBUTTON_OVERDOWNTOOUTDOWN (1<<4)
516 #define SWFBUTTON_OVERDOWNTOOVERUP  (1<<3)
517 #define SWFBUTTON_OVERUPTOOVERDOWN  (1<<2)
518 #define SWFBUTTON_OVERUPTOIDLE      (1<<1)
519 #define SWFBUTTON_IDLETOOVERUP      (1<<0)
520 
521 /* easier to remember: */
522 #define SWFBUTTON_MOUSEUPOUTSIDE  SWFBUTTON_OUTDOWNTOIDLE
523 #define SWFBUTTON_DRAGOVER        (SWFBUTTON_OUTDOWNTOOVERDOWN | SWFBUTTON_IDLETOOVERDOWN)
524 #define SWFBUTTON_DRAGOUT         (SWFBUTTON_OVERDOWNTOOUTDOWN | SWFBUTTON_OVERDOWNTOIDLE)
525 #define SWFBUTTON_MOUSEUP         SWFBUTTON_OVERDOWNTOOVERUP
526 #define SWFBUTTON_MOUSEDOWN       SWFBUTTON_OVERUPTOOVERDOWN
527 #define SWFBUTTON_MOUSEOUT        SWFBUTTON_OVERUPTOIDLE
528 #define SWFBUTTON_MOUSEOVER       SWFBUTTON_IDLETOOVERUP
529 
530 
531 SWFButton newSWFButton();
532 void destroySWFButton(SWFBlock block);
533 
534 void SWFButton_addShape(SWFButton button, SWFCharacter character, byte flags);
535 void SWFButton_addAction(SWFButton button, SWFAction action, int flags);
536 void SWFButton_setMenu(SWFButton button, int flag);
537 
538 SWFBlock newSWFButtonCXform(SWFButton button, SWFCXform *cXforms);
539 SWFBlock newSWFButtonSound(SWFButton button, SWFSound sound);
540 
541 
542   /* SWFSprite */
543 
544 typedef struct SWFSprite_s *SWFSprite;
545 
546 SWFSprite newSWFSprite();
547 void destroySWFSprite(SWFBlock block);
548 
549 void SWFSprite_setNumberOfFrames(SWFSprite sprite, int totalFrames);
550 
551 void SWFSprite_setBlocks(SWFSprite sprite, SWFBlock *blocks, int nBlocks);
552 void SWFSprite_addBlock(SWFSprite sprite, SWFBlock block);
553 
554 #endif /* SWF_H_INCLUDED */
555