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_DumpSWF(FILE * f, SWF*swf)
52 TAG* tag = swf->firstTag;
53 fprintf(f, "vvvvvvvvvvvvvvvvvvvvv\n");
55 printf("%8d %s\n", tag->len, swf_TagGetName(tag));
58 fprintf(f, "^^^^^^^^^^^^^^^^^^^^^\n");
61 void swf_DumpFont(SWFFONT * font)
63 printf("ID: %d\n", font->id);
64 printf("Version: %d\n", font->version);
65 printf("name: %s\n", font->name);
66 printf("characters: %d\n", font->numchars);
67 printf("biggest mapped ascii value: %d\n", font->maxascii);
68 printf("layout: %s\n", font->layout?"yes":"no");
71 printf(" ascent:%d\n", font->layout->ascent);
72 printf(" descent:%d\n", font->layout->descent);
73 printf(" leading:%d\n", font->layout->leading);
74 printf(" bounds: (not shown)\n");
75 printf(" kerning records:%d\n", font->layout->kerningcount);
76 printf(" kerning records: (not shown)\n");
78 printf("style: %d\n", font->style);
79 printf("encoding: %d\n", font->encoding);
80 printf("language: %d\n", font->language);
83 void swf_DumpShape(SHAPE2*shape2)
85 SHAPELINE*l = shape2->lines;
87 if(l->type == moveTo) {
88 //printf("fill %d/%d line %d\n", l->fillstyle0, l->fillstyle1, l->linestyle);
89 printf("moveTo %.2f,%.2f\n", l->x/20.0, l->y/20.0);
91 if(l->type == lineTo) {
92 //printf("fill %d/%d line %d\n", l->fillstyle0, l->fillstyle1, l->linestyle);
93 printf("lineTo %.2f,%.2f\n", l->x/20.0, l->y/20.0);
95 if(l->type == splineTo) {
96 //printf("fill %d/%d line %d\n", l->fillstyle0, l->fillstyle1, l->linestyle);
97 printf("splineTo %.2f,%.2f %.2f,%.2f\n", l->sx/20.0, l->sy/20.0, l->x/20.0, l->y/20.0);
103 char* swf_TagGetName(TAG*tag)
112 return "DEFINESHAPE";
113 case ST_FREECHARACTER:
114 return "FREECHARACTER";
116 return "PLACEOBJECT";
117 case ST_REMOVEOBJECT:
118 return "REMOVEOBJECT";
121 case ST_DEFINEBUTTON:
122 return "DEFINEBUTTON";
125 case ST_SETBACKGROUNDCOLOR:
126 return "SETBACKGROUNDCOLOR";
131 case ST_DEFINEEDITTEXT:
132 return "DEFINEEDITTEXT";
135 case ST_DEFINEFONTINFO:
136 return "DEFINEFONTINFO";
138 return "DEFINESOUND";
141 case ST_DEFINEBUTTONSOUND:
142 return "DEFINEBUTTONSOUND";
143 case ST_SOUNDSTREAMHEAD:
144 return "SOUNDSTREAMHEAD";
145 case ST_SOUNDSTREAMBLOCK:
146 return "SOUNDSTREAMBLOCK";
147 case ST_DEFINEBITSLOSSLESS:
148 return "DEFINEBITSLOSSLESS";
149 case ST_DEFINEBITSJPEG2:
150 return "DEFINEBITSJPEG2";
151 case ST_DEFINESHAPE2:
152 return "DEFINESHAPE2";
153 case ST_DEFINEBUTTONCXFORM:
154 return "DEFINEBUTTONCXFORM";
157 case ST_PLACEOBJECT2:
158 return "PLACEOBJECT2";
159 case ST_REMOVEOBJECT2:
160 return "REMOVEOBJECT2";
161 case ST_DEFINESHAPE3:
162 return "DEFINESHAPE3";
164 return "DEFINETEXT2";
165 case ST_DEFINEBUTTON2:
166 return "DEFINEBUTTON2";
167 case ST_DEFINEBITSJPEG3:
168 return "DEFINEBITSJPEG3";
169 case ST_DEFINEBITSLOSSLESS2:
170 return "DEFINEBITSLOSSLESS2";
171 case ST_DEFINESPRITE:
172 return "DEFINESPRITE";
173 case ST_NAMECHARACTER:
174 return "NAMECHARACTER";
175 case ST_SERIALNUMBER:
176 return "SERIALNUMBER";
177 case ST_GENERATORTEXT:
178 return "GENERATORTEXT";
181 case ST_SOUNDSTREAMHEAD2:
182 return "SOUNDSTREAMHEAD2";
183 case ST_DEFINEMORPHSHAPE:
184 return "DEFINEMORPHSHAPE";
186 return "DEFINEFONT2";
187 case ST_TEMPLATECOMMAND:
188 return "TEMPLATECOMMAND";
191 case ST_EXTERNALFONT:
192 return "EXTERNALFONT";
193 case ST_EXPORTASSETS:
194 return "EXPORTASSETS";
195 case ST_IMPORTASSETS:
196 return "IMPORTASSETS";
197 case ST_ENABLEDEBUGGER:
198 return "ENABLEDEBUGGER";
199 case ST_DOINITACTION:
200 return "DOINITACTION";
202 return "DEFINEMOVIE";
203 case ST_DEFINEVIDEOSTREAM:
204 return "DEFINEVIDEOSTREAM";
207 case ST_DEFINEFONTINFO2:
208 return "DEFINEFONTINFO2";
213 case ST_SCRIPTLIMITS:
214 return "SCRIPTLIMITS";
216 return "SETTABINDEX";