* renamed USE_FREETYPE to HAVE_FREETYPE\rmp3 support can now be disabled
[swftools.git] / lib / rfxswf.h
index 55ddf2e..07b9ea0 100644 (file)
@@ -39,6 +39,9 @@ extern "C" {
 #include "./drawer.h"
 
 #define DEBUG_RFXSWF
+#ifdef RFXSWF_DISABLESOUND
+#define NO_MP3
+#endif
 
 #ifndef TRUE
 #define TRUE (1)
@@ -345,7 +348,9 @@ SRECT swf_TurnRect(SRECT r, MATRIX* m);
 #define ST_SCRIPTLIMITS                65 /* version 7- u16 maxrecursedepth, u16 scripttimeoutseconds */
 #define ST_SETTABINDEX         66 /* version 7- u16 depth(!), u16 tab order value */
 
+/* custom tags- only valid for swftools */
 #define ST_REFLEX              777 /* to identify generator software */
+#define ST_GLYPHNAMES          778
 
 // Advanced Funtions
 
@@ -502,10 +507,9 @@ typedef struct _SWFFONT
   char **      glyphnames;
 } SWFFONT, * LPSWFFONT;
 
-#define MAX_CHAR_PER_FONT 512
 // does not support wide characters !
 typedef struct _FONTUSAGE
-{ U8 code[MAX_CHAR_PER_FONT];
+{ U8* code;
 } FONTUSAGE, * LPFONTUSAGE;
 
 #define ET_HASTEXT 32768
@@ -547,7 +551,7 @@ int swf_FontIsBold(SWFFONT * f);
 int swf_FontSetID(SWFFONT * f,U16 id);
 int swf_FontReduce(SWFFONT * f,FONTUSAGE * use);
 
-int swf_FontInitUsage(FONTUSAGE * use);
+int swf_FontInitUsage(SWFFONT * f,FONTUSAGE * use);
 int swf_FontUse(FONTUSAGE * use,U8 * s);
 
 int swf_FontSetDefine(TAG * t,SWFFONT * f);
@@ -587,6 +591,7 @@ void swf_DrawText(drawer_t*draw, SWFFONT*font, char*text);
 
 SWFFONT* swf_LoadTrueTypeFont(char*filename);
 SWFFONT* swf_LoadT1Font(char*filename);
+SWFFONT* swf_LoadFont(char*filename);
 
 // swfdump.c
 
@@ -700,18 +705,12 @@ int swf_SetLosslessBits(TAG * t,U16 width,U16 height,void * bitmap,U8 bitmap_fla
 int swf_SetLosslessBitsIndexed(TAG * t,U16 width,U16 height,U8 * bitmap,RGBA * palette,U16 ncolors);
 int swf_SetLosslessBitsGrayscale(TAG * t,U16 width,U16 height,U8 * bitmap);
 
-#ifndef RFXSWF_DISABLESOUND
-
 // swfsound.c
 void swf_SetSoundStreamHead(TAG*tag, int avgnumsamples);
 void swf_SetSoundStreamBlock(TAG*tag, S16*samples, int seek, char first); /* expects 2304 samples */
-
 void swf_SetSoundDefine(TAG*tag, S16*samples, int num);
-
 void swf_SetSoundInfo(TAG*tag, SOUNDINFO*info);
 
-#endif // RFXSWF_DISABLESOUND
-
 // swftools.c
 
 U8 swf_isDefiningTag(TAG * t);
@@ -721,7 +720,7 @@ U16 swf_GetDefineID(TAG * t);
 SRECT swf_GetDefineBBox(TAG * t);
 void swf_SetDefineID(TAG * t, U16 newid);
 U16 swf_GetPlaceID(TAG * t); //PLACEOBJECT, PLACEOBJECT2 (sometimes), REMOVEOBJECT
-U16 swf_GetDepth(TAG * t); //PLACEOBJECT,PLACEOBJECT2,REMOVEOBJECT,REMOVEOBJECT2
+int swf_GetDepth(TAG * t); //PLACEOBJECT,PLACEOBJECT2,REMOVEOBJECT,REMOVEOBJECT2,SETTABINDEX
 char* swf_GetName(TAG * t); //PLACEOBJECT2, FRAMELABEL
 MATRIX * swf_MatrixJoin(MATRIX * d,MATRIX * s1,MATRIX * s2);
 MATRIX * swf_MatrixMapTriangle(MATRIX * m,int dx,int dy,
@@ -729,6 +728,7 @@ MATRIX * swf_MatrixMapTriangle(MATRIX * m,int dx,int dy,
 int swf_GetNumUsedIDs(TAG * t);
 void swf_GetUsedIDs(TAG * t, int * positions);
 void swf_Relocate(SWF*swf, char*bitmap); // bitmap is 65536 bytes, bitmap[a]==0 means id a is free
+void swf_RelocateDepth(SWF*swf, char*bitmap); // bitmap is 65536 bytes, bitmap[d]==0 means depth d is free
 
 // swfcgi.c
 
@@ -761,6 +761,9 @@ void swf_ActionEnumerateURLs(ActionTAG*atag, char*(*callback)(char*));
 void swf_ActionEnumerateTargets(ActionTAG*atag, char*(*callback)(char*));
 void swf_ActionEnumerateStrings(ActionTAG*atag, char*(*callback)(char*));
 
+// using action/actioncompiler.h:
+ActionTAG* swf_ActionCompile(const char* source, int version);
+
 ActionTAG* action_End(ActionTAG*atag);
 ActionTAG* action_NextFrame(ActionTAG*atag);
 ActionTAG* action_PreviousFrame(ActionTAG*atag);