5 Extension module for the rfxswf library.
6 Part of the swftools package.
8 Copyright (c) 2001 Rainer Böhme <rfxswf@reflex-studio.de>
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
24 void swf_DumpHeader(FILE * f,SWF * swf)
26 fprintf(f,"File size\t%u\n",swf->fileSize);
27 fprintf(f,"Movie width\t%u\n",(swf->movieSize.xmax - swf->movieSize.xmin)/20);
28 fprintf(f,"Movie height\t%u\n",(swf->movieSize.ymax - swf->movieSize.ymin)/20);
29 fprintf(f,"Frame rate\t%u.%u\n",swf->frameRate>>8,swf->frameRate&0xff);
30 fprintf(f,"Frame count\t%u\n",swf->frameCount);
33 void swf_DumpMatrix(FILE * f,MATRIX * m)
35 fprintf(f,"[%08x][%08x]\n",m->sx,m->r1);
36 fprintf(f,"[%08x][%08x]\n",m->r0,m->sy);
37 fprintf(f," %08x, %08x\n",m->tx,m->ty);
40 void swf_DumpTag(FILE * f,TAG * t)
43 for (i=0;i<t->len;i++)
44 { if (!(i&15)) fprintf(f,"\n");
45 fprintf(f,"%02x ",t->data[i]);
50 void swf_DumpFont(SWFFONT * font)
52 printf("ID: %d\n", font->id);
53 printf("Version: %d\n", font->version);
54 printf("name: %s\n", font->name);
55 printf("characters: %d\n", font->numchars);
56 printf("biggest mapped ascii value: %d\n", font->maxascii);
57 printf("layout: %s\n", font->layout?"yes":"no");
60 printf(" ascent:%d\n", font->layout->ascent);
61 printf(" descent:%d\n", font->layout->descent);
62 printf(" leading:%d\n", font->layout->leading);
63 printf(" bounds: (not shown)\n");
64 printf(" kerning records:%d\n", font->layout->kerningcount);
65 printf(" kerning records: (not shown)\n");
67 printf("style: %d\n", font->style);
68 printf("encoding: %d\n", font->encoding);
69 printf("language: %d\n", font->language);
72 char* swf_TagGetName(TAG*tag)
82 case ST_FREECHARACTER:
83 return "FREECHARACTER";
87 return "REMOVEOBJECT";
91 return "DEFINEBUTTON";
94 case ST_SETBACKGROUNDCOLOR:
95 return "SETBACKGROUNDCOLOR";
100 case ST_DEFINEEDITTEXT:
101 return "DEFINEEDITTEXT";
104 case ST_DEFINEFONTINFO:
105 return "DEFINEFONTINFO";
107 return "DEFINESOUND";
110 case ST_DEFINEBUTTONSOUND:
111 return "DEFINEBUTTONSOUND";
112 case ST_SOUNDSTREAMHEAD:
113 return "SOUNDSTREAMHEAD";
114 case ST_SOUNDSTREAMBLOCK:
115 return "SOUNDSTREAMBLOCK";
116 case ST_DEFINEBITSLOSSLESS:
117 return "DEFINEBITSLOSSLESS";
118 case ST_DEFINEBITSJPEG2:
119 return "DEFINEBITSJPEG2";
120 case ST_DEFINESHAPE2:
121 return "DEFINESHAPE2";
122 case ST_DEFINEBUTTONCXFORM:
123 return "DEFINEBUTTONCXFORM";
126 case ST_PLACEOBJECT2:
127 return "PLACEOBJECT2";
128 case ST_REMOVEOBJECT2:
129 return "REMOVEOBJECT2";
130 case ST_DEFINESHAPE3:
131 return "DEFINESHAPE3";
133 return "DEFINETEXT2";
134 case ST_DEFINEBUTTON2:
135 return "DEFINEBUTTON2";
136 case ST_DEFINEBITSJPEG3:
137 return "DEFINEBITSJPEG3";
138 case ST_DEFINEBITSLOSSLESS2:
139 return "DEFINEBITSLOSSLESS2";
140 case ST_DEFINESPRITE:
141 return "DEFINESPRITE";
142 case ST_NAMECHARACTER:
143 return "NAMECHARACTER";
144 case ST_SERIALNUMBER:
145 return "SERIALNUMBER";
146 case ST_GENERATORTEXT:
147 return "GENERATORTEXT";
150 case ST_SOUNDSTREAMHEAD2:
151 return "SOUNDSTREAMHEAD2";
152 case ST_DEFINEMORPHSHAPE:
153 return "DEFINEMORPHSHAPE";
155 return "DEFINEFONT2";
156 case ST_TEMPLATECOMMAND:
157 return "TEMPLATECOMMAND";
160 case ST_EXTERNALFONT:
161 return "EXTERNALFONT";
162 case ST_EXPORTASSETS:
163 return "EXPORTASSETS";
164 case ST_IMPORTASSETS:
165 return "IMPORTASSETS";
166 case ST_ENABLEDEBUGGER:
167 return "ENABLEDEBUGGER";
170 case ST_DOINITACTION:
171 return "DOINITACTION";
173 return "DEFINEMOVIE";
174 case ST_DEFINEVIDEOSTREAM:
175 return "DEFINEVIDEOSTREAM";
178 case ST_DEFINEFONTINFO2:
179 return "DEFINEFONTINFO2";