}
-void fontcallback(U16 id,U8 * name)
+void fontcallback(U16 id,U8 * name,0)
{ SWFFONT * font;
int f;
sprintf(fn,"fn%04x",getpid()); // avoid name conflicts @ using multiple fonts
printf("#define addGlyph %s\n",fn);
DumpGlobal(fn);
- swf_FontEnumerate(&swf,&fontcallback);
+ swf_FontEnumerate(&swf,&fontcallback,0);
swf_FreeTags(&swf);
printf("#undef addGlyph\n");
}
static const int WRITEFONTID = 0x4e46; // font id for WriteFont and ReadFont
-int swf_FontEnumerate(SWF * swf, void (*FontCallback) (U16, U8 *))
+int swf_FontEnumerate(SWF * swf, void (*FontCallback) (void*, U16, U8 *), void*self)
{
int n;
TAG *t;
s[l] = 0;
}
- (FontCallback) (id, s);
+ (FontCallback) (self, id, s);
swf_RestoreTagPos(t);
}
static int
swf_FontExtract_DefineTextCallback(int id, SWFFONT * f, TAG * t, int jobs,
void (*callback) (void *self,
- int *chars, int *ypos, int nr, int fontid, int fontsize, int xstart, int ystart, RGBA * color), void *self)
+ int *chars, int *xpos, int nr, int fontid, int fontsize, int xstart, int ystart, RGBA * color), void *self)
{
U16 cid;
SRECT r;
U16 leading;
} EditTextLayout;
-int swf_FontEnumerate(SWF * swf,void (*FontCallback) (U16,U8*));
+int swf_FontEnumerate(SWF * swf,void (*FontCallback) (void*,U16,U8*), void*self);
// -> void fontcallback(U16 id,U8 * name); returns number of defined fonts
int swf_FontExtract(SWF * swf,int id,SWFFONT ** f);
static int fontnum = -1;
static SWFFONT**fonts;
static SWF*c_swf;
-static void fontcallback1(U16 id,U8 * name)
+static void fontcallback1(void*self, U16 id,U8 * name)
{ fontnum++;
}
-static void fontcallback2(U16 id,U8 * name)
+static void fontcallback2(void*self, U16 id,U8 * name)
{
fonts[fontnum] = 0;
swf_FontExtract(c_swf,id,&fonts[fontnum]);
if(verbose) printf("Extracting fonts...\n");
c_swf = swf;
fontnum = 0;
- swf_FontEnumerate(swf,&fontcallback1);
+ swf_FontEnumerate(swf,&fontcallback1,0);
fonts = (SWFFONT**)malloc(fontnum*sizeof(SWFFONT*));
memset(fonts, 0, fontnum*sizeof(SWFFONT*));
fontnum = 0;
- swf_FontEnumerate(swf,&fontcallback2);
+ swf_FontEnumerate(swf,&fontcallback2,0);
}
memset(&bounds, 0, sizeof(bounds));
printf("%s |\n", prefix);
}
-void fontcallback1(U16 id,U8 * name)
+void fontcallback1(void*self, U16 id,U8 * name)
{ fontnum++;
}
-void fontcallback2(U16 id,U8 * name)
+void fontcallback2(void*self, U16 id,U8 * name)
{
swf_FontExtract(&swf,id,&fonts[fontnum]);
fontnum++;
if(showtext) {
fontnum = 0;
- swf_FontEnumerate(&swf,&fontcallback1);
+ swf_FontEnumerate(&swf,&fontcallback1, 0);
fonts = (SWFFONT**)malloc(fontnum*sizeof(SWFFONT*));
fontnum = 0;
- swf_FontEnumerate(&swf,&fontcallback2);
+ swf_FontEnumerate(&swf,&fontcallback2, 0);
}
while(tag) {