From 80c5ca6a38fdb2d948c9db114ee648af63ef6c67 Mon Sep 17 00:00:00 2001 From: kramm Date: Mon, 28 Oct 2002 07:37:17 +0000 Subject: [PATCH] Flash MX additions --- lib/modules/swfaction.c | 7 +++++-- lib/modules/swftext.c | 13 +++++++++---- lib/modules/swftools.c | 17 +++++++++++++++-- lib/rfxswf.h | 13 +++++++------ 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/lib/modules/swfaction.c b/lib/modules/swfaction.c index 0adf19d..135d026 100644 --- a/lib/modules/swfaction.c +++ b/lib/modules/swfaction.c @@ -127,8 +127,11 @@ r: register (byte) {5,"TypeOf", 0x44,""}, {5,"Add2", 0x47,""}, {5,"Less2", 0x48,""}, -{5/*6?*/,"Less3?", 0x67,""}, -{5/*6?*/,"GetMembers?", 0x55,""} +{6,"Greater", 0x67,""}, +{6,"StringGreater", 0x68,""}, +{6,"Enumerate2", 0x55,""} +{6,"InstanceOf", 0x54,""} +{6,"StrictEquals", 0x66,""} }; static int definedactions = sizeof(actions)/sizeof(struct Action); diff --git a/lib/modules/swftext.c b/lib/modules/swftext.c index dc7aead..7853dd4 100644 --- a/lib/modules/swftext.c +++ b/lib/modules/swftext.c @@ -46,7 +46,7 @@ int swf_FontEnumerate(SWF * swf,void (*FontCallback) (U16,U8*)) n = 0; while (t) - { if (swf_GetTagID(t)==ST_DEFINEFONTINFO || + { if (swf_GetTagID(t)==ST_DEFINEFONTINFO || swf_GetTagID(t)==ST_DEFINEFONTINFO2 || swf_GetTagID(t)==ST_DEFINEFONT2) { n++; if (FontCallback) @@ -114,9 +114,10 @@ int swf_FontExtract_DefineFontInfo(int id,SWFFONT * f,TAG * t) int i; if(f->version>1) { - // DefineFont2 doesn't have FontInfo fields - fprintf(stderr, "fixme: FontInfo field for DefineFont2 encountered\n"); - return -1; + /* Especially with Flash MX, DefineFont2 may have FontInfo fields, + too. However, they only add little information to what's already + inside the DefineFont2 tag */ + return id; } if (l) @@ -143,6 +144,10 @@ int swf_FontExtract_DefineFontInfo(int id,SWFFONT * f,TAG * t) if(flags & 32) f->encoding |= FONT_ENCODING_UNICODE; + if(t->id == ST_DEFINEFONTINFO2) { + f->language = swf_GetU8(); + } + f->glyph2ascii = (U16*)malloc(sizeof(U16)*f->numchars); maxcode = 0; for(i=0; i < f->numchars; i++) { diff --git a/lib/modules/swftools.c b/lib/modules/swftools.c index 2356dfb..0178bf0 100644 --- a/lib/modules/swftools.c +++ b/lib/modules/swftools.c @@ -99,10 +99,12 @@ U16 swf_GetDefineID(TAG * t) case ST_DEFINEFONT: case ST_DEFINEFONT2: case ST_DEFINEFONTINFO: //pseudodefine + case ST_DEFINEFONTINFO2: //pseudodefine case ST_DEFINETEXT: case ST_DEFINETEXT2: case ST_DEFINESOUND: case ST_DEFINESPRITE: + case ST_DEFINEVIDEOSTREAM: case ST_NAMECHARACTER: //pseudodefine id = swf_GetU16(t); break; @@ -162,6 +164,7 @@ static int swf_definingtagids[] = ST_DEFINEBUTTON, ST_DEFINEBUTTON2, ST_DEFINESOUND, + ST_DEFINEVIDEOSTREAM, -1 }; @@ -185,9 +188,11 @@ static int swf_spritetagids[] = static int swf_pseudodefiningtagids[] = { ST_DEFINEFONTINFO, + ST_DEFINEFONTINFO2, ST_DEFINEBUTTONCXFORM, ST_DEFINEBUTTONSOUND, ST_NAMECHARACTER, + ST_DOINITACTION, -1 }; @@ -572,11 +577,19 @@ void enumerateUsedIDs(TAG * tag, int base, void (*callback)(TAG*, int, void*), v break; } case ST_DEFINEFONTINFO: + case ST_DEFINEFONTINFO2: + case ST_VIDEOFRAME: + callback(tag, tag->pos + base, callback_data); + break; + case ST_DEFINEVIDEOSTREAM: + break; + + case ST_DOINITACTION: callback(tag, tag->pos + base, callback_data); break; - case ST_DEFINEMORPHSHAPE: /* disabled for now (doesn't work) */ - case ST_DEFINESHAPE3: // these thingies might have bitmap ids in their fillstyles + case ST_DEFINEMORPHSHAPE: + case ST_DEFINESHAPE3: num++; //fallthrough case ST_DEFINESHAPE2: num++; //fallthrough diff --git a/lib/rfxswf.h b/lib/rfxswf.h index 861e378..af27585 100644 --- a/lib/rfxswf.h +++ b/lib/rfxswf.h @@ -276,10 +276,10 @@ int swf_SetRGBA(TAG * t,RGBA * col); #define ST_EXPORTASSETS 56 #define ST_IMPORTASSETS 57 #define ST_ENABLEDEBUGGER 58 -#define ST_MX0 59 /*(?) Components/InitClip */ -#define ST_MX1 60 /*(?) Sorensen Video*/ -#define ST_MX2 61 /*(?) Sorensen Video*/ -#define ST_MX3 62 /*(?) fontinfo2? */ +#define ST_DOINITACTION 59 +#define ST_DEFINEVIDEOSTREAM 60 +#define ST_VIDEOFRAME 61 +#define ST_DEFINEFONTINFO2 62 #define ST_MX4 63 /*(?) */ #define ST_REFLEX 777 /* to identify generator software */ @@ -425,6 +425,7 @@ typedef struct _SWFFONT U16 * glyph2ascii; int * ascii2glyph; SWFGLYPH * glyph; + U8 language; } SWFFONT, * LPSWFFONT; typedef struct _FONTUSAGE @@ -440,12 +441,12 @@ typedef struct _FONTUSAGE #define ET_HASMAXLENGTH 512 #define ET_HASFONT 256 #define ET_X3 128 -#define ET_X2 64 +#define ET_AUTOSIZE 64 /* MX */ #define ET_HASLAYOUT 32 #define ET_NOSELECT 16 #define ET_BORDER 8 #define ET_X1 4 -#define ET_X0 2 +#define ET_HTML 2 /* MX? */ #define ET_USEOUTLINES 1 typedef struct _EditTextLayout -- 1.7.10.4