git.asbjorn.biz
/
swftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
12ac3d4
)
swf_FontEnumerate now passes a self pointer to the callback function.
author
kramm
<kramm>
Tue, 23 Nov 2004 18:42:55 +0000
(18:42 +0000)
committer
kramm
<kramm>
Tue, 23 Nov 2004 18:42:55 +0000
(18:42 +0000)
lib/example/dumpfont.c
patch
|
blob
|
history
lib/modules/swftext.c
patch
|
blob
|
history
lib/rfxswf.h
patch
|
blob
|
history
src/swfbbox.c
patch
|
blob
|
history
src/swfdump.c
patch
|
blob
|
history
diff --git
a/lib/example/dumpfont.c
b/lib/example/dumpfont.c
index
8d38b8e
..
f746238
100644
(file)
--- a/
lib/example/dumpfont.c
+++ b/
lib/example/dumpfont.c
@@
-133,7
+133,7
@@
void DumpGlobal(char * funcname)
}
}
-void fontcallback(U16 id,U8 * name)
+void fontcallback(U16 id,U8 * name,0)
{ SWFFONT * font;
int f;
{ SWFFONT * font;
int f;
@@
-174,7
+174,7
@@
int main(int argc,char ** argv)
sprintf(fn,"fn%04x",getpid()); // avoid name conflicts @ using multiple fonts
printf("#define addGlyph %s\n",fn);
DumpGlobal(fn);
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");
}
swf_FreeTags(&swf);
printf("#undef addGlyph\n");
}
diff --git
a/lib/modules/swftext.c
b/lib/modules/swftext.c
index
06d3eea
..
638be12
100644
(file)
--- a/
lib/modules/swftext.c
+++ b/
lib/modules/swftext.c
@@
-101,7
+101,7
@@
int swf_FontIsBold(SWFFONT * f)
static const int WRITEFONTID = 0x4e46; // font id for WriteFont and ReadFont
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;
{
int n;
TAG *t;
@@
-129,7
+129,7
@@
int swf_FontEnumerate(SWF * swf, void (*FontCallback) (U16, U8 *))
s[l] = 0;
}
s[l] = 0;
}
- (FontCallback) (id, s);
+ (FontCallback) (self, id, s);
swf_RestoreTagPos(t);
}
swf_RestoreTagPos(t);
}
@@
-381,7
+381,7
@@
int swf_FontExtract_DefineFont2(int id, SWFFONT * font, TAG * tag)
static int
swf_FontExtract_DefineTextCallback(int id, SWFFONT * f, TAG * t, int jobs,
void (*callback) (void *self,
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 cid;
SRECT r;
diff --git
a/lib/rfxswf.h
b/lib/rfxswf.h
index
1b40494
..
3888319
100644
(file)
--- a/
lib/rfxswf.h
+++ b/
lib/rfxswf.h
@@
-559,7
+559,7
@@
typedef struct _EditTextLayout
U16 leading;
} EditTextLayout;
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);
// -> void fontcallback(U16 id,U8 * name); returns number of defined fonts
int swf_FontExtract(SWF * swf,int id,SWFFONT ** f);
diff --git
a/src/swfbbox.c
b/src/swfbbox.c
index
bb0322e
..
95ff67a
100644
(file)
--- a/
src/swfbbox.c
+++ b/
src/swfbbox.c
@@
-189,10
+189,10
@@
MATRIX getmatrix(TAG*tag)
static int fontnum = -1;
static SWFFONT**fonts;
static SWF*c_swf;
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++;
}
{ 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]);
{
fonts[fontnum] = 0;
swf_FontExtract(c_swf,id,&fonts[fontnum]);
@@
-296,11
+296,11
@@
static void swf_OptimizeBoundingBoxes(SWF*swf)
if(verbose) printf("Extracting fonts...\n");
c_swf = swf;
fontnum = 0;
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;
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));
}
memset(&bounds, 0, sizeof(bounds));
diff --git
a/src/swfdump.c
b/src/swfdump.c
index
49208ab
..
3940141
100644
(file)
--- a/
src/swfdump.c
+++ b/
src/swfdump.c
@@
-655,11
+655,11
@@
void handleShape(TAG*tag, char*prefix)
printf("%s |\n", prefix);
}
printf("%s |\n", prefix);
}
-void fontcallback1(U16 id,U8 * name)
+void fontcallback1(void*self, U16 id,U8 * name)
{ fontnum++;
}
{ fontnum++;
}
-void fontcallback2(U16 id,U8 * name)
+void fontcallback2(void*self, U16 id,U8 * name)
{
swf_FontExtract(&swf,id,&fonts[fontnum]);
fontnum++;
{
swf_FontExtract(&swf,id,&fonts[fontnum]);
fontnum++;
@@
-869,10
+869,10
@@
int main (int argc,char ** argv)
if(showtext) {
fontnum = 0;
if(showtext) {
fontnum = 0;
- swf_FontEnumerate(&swf,&fontcallback1);
+ swf_FontEnumerate(&swf,&fontcallback1, 0);
fonts = (SWFFONT**)malloc(fontnum*sizeof(SWFFONT*));
fontnum = 0;
fonts = (SWFFONT**)malloc(fontnum*sizeof(SWFFONT*));
fontnum = 0;
- swf_FontEnumerate(&swf,&fontcallback2);
+ swf_FontEnumerate(&swf,&fontcallback2, 0);
}
while(tag) {
}
while(tag) {