added swf_ExpandRect3() method.
[swftools.git] / lib / rfxswf.h
index 2ed41e0..6e5cbd6 100644 (file)
@@ -151,6 +151,9 @@ typedef struct _TAG             // NEVER access a Tag-Struct directly !
   
 } TAG, * LPTAG;
 
+#define swf_ResetReadBits(tag)   if (tag->readBit)  { tag->pos++; tag->readBit = 0; }
+#define swf_ResetWriteBits(tag)  if (tag->writeBit) { tag->writeBit = 0; }
+
 typedef struct _SOUNDINFO 
 {
     U8 stop;
@@ -264,6 +267,7 @@ int   swf_VerifyPassword(TAG * t, const char * password);
 
 void swf_ExpandRect(SRECT*src, SPOINT add);
 void swf_ExpandRect2(SRECT*src, SRECT*add);
+void swf_ExpandRect3(SRECT*src, SPOINT center, int radius);
 SPOINT swf_TurnPoint(SPOINT p, MATRIX* m);
 SRECT swf_TurnRect(SRECT r, MATRIX* m);
 
@@ -451,6 +455,10 @@ void           swf_SetShape2(TAG*tag, SHAPE2*shape);
 void      swf_Shape2Free(SHAPE2 * s);
 void   swf_DumpShape(SHAPE2*shape2);
 
+void swf_ParseDefineShape(TAG*tag, SHAPE2*shape);
+void swf_Shape2ToShape(SHAPE2*shape2, SHAPE*shape);
+void swf_SetShape2(TAG*tag, SHAPE2*shape2);
+
 // swfdraw.c
 
 void swf_Shape10DrawerInit(drawer_t*draw, TAG*tag);
@@ -484,6 +492,11 @@ typedef struct
   SHAPE *     shape;
 } SWFGLYPH;
 
+typedef struct _FONTUSAGE
+{ int* chars;
+  char is_reduced;
+} FONTUSAGE, * LPFONTUSAGE;
+
 #define FONT_STYLE_BOLD 1
 #define FONT_STYLE_ITALIC 2
 #define FONT_ENCODING_UNICODE 1
@@ -506,12 +519,11 @@ typedef struct _SWFFONT
   SWFGLYPH *   glyph;
   U8           language;
   char **      glyphnames;
+
+  FONTUSAGE *   use;
+
 } SWFFONT, * LPSWFFONT;
 
-// does not support wide characters !
-typedef struct _FONTUSAGE
-{ U8* code;
-} FONTUSAGE, * LPFONTUSAGE;
 
 #define ET_HASTEXT 32768
 #define ET_WORDWRAP 16384
@@ -550,10 +562,11 @@ int swf_FontIsItalic(SWFFONT * f);
 int swf_FontIsBold(SWFFONT * f);
 
 int swf_FontSetID(SWFFONT * f,U16 id);
-int swf_FontReduce(SWFFONT * f,FONTUSAGE * use);
+int swf_FontReduce(SWFFONT * f);
 
-int swf_FontInitUsage(SWFFONT * f,FONTUSAGE * use);
-int swf_FontUse(FONTUSAGE * use,U8 * s);
+int swf_FontInitUsage(SWFFONT * f);
+int swf_FontUseGlyph(SWFFONT * f, int glyph);
+int swf_FontUse(SWFFONT* f,U8 * s);
 
 int swf_FontSetDefine(TAG * t,SWFFONT * f);
 int swf_FontSetDefine2(TAG * t,SWFFONT * f);
@@ -579,13 +592,15 @@ int swf_TextSetCharRecord(TAG * t,SWFFONT * font,U8 * s,int scale,U8 gbits,U8 ab
 int swf_TextPrintDefineText(TAG * t,SWFFONT * f);
 // Prints text defined in tag t with font f to stdout
 
-/* notice: if you set the fontid, make sure the corresponding font has layout information */
+void swf_FontPrepareForEditText(SWFFONT * f);
+
+/* notice: if you set the fontid, make sure you call swf_FontPrepareForEditText() for the font first */
 void swf_SetEditText(TAG*tag, U16 flags, SRECT r, char*text, RGBA*color, 
        int maxlength, U16 font, U16 height, EditTextLayout*layout, char*variable);
 
 SRECT swf_SetDefineText(TAG*tag, SWFFONT*font, RGBA*rgb, char*text, int scale);
 
-void swf_DrawText(drawer_t*draw, SWFFONT*font, char*text);
+void swf_DrawText(drawer_t*draw, SWFFONT*font, int size, char*text);
 
 // swffont.c
 
@@ -593,6 +608,8 @@ SWFFONT* swf_LoadTrueTypeFont(char*filename);
 SWFFONT* swf_LoadT1Font(char*filename);
 SWFFONT* swf_LoadFont(char*filename);
 
+void swf_SetLoadFontParameters(int scale, int skip_unused, int full_unicode);
+
 // swfdump.c
 
 void swf_DumpHeader(FILE * f,SWF * swf);
@@ -914,6 +931,7 @@ typedef struct _VIDEOSTREAM
 void swf_SetVideoStreamDefine(TAG*tag, VIDEOSTREAM*stream, U16 frames, U16 width, U16 height);
 void swf_SetVideoStreamIFrame(TAG*tag, VIDEOSTREAM*s, RGBA*pic, int quant/* 1-31, 1=best quality, 31=best compression*/);
 void swf_SetVideoStreamPFrame(TAG*tag, VIDEOSTREAM*s, RGBA*pic, int quant/* 1-31, 1=best quality, 31=best compression*/);
+void swf_SetVideoStreamMover(TAG*tag, VIDEOSTREAM*s, signed char* movex, signed char* movey, int quant);
 void swf_VideoStreamClear(VIDEOSTREAM*stream);
 
 #ifdef __cplusplus