double config_dumpfonts;
double config_ppmsubpixels;
double config_jpegsubpixels;
+ char hasbuttons;
int config_simpleviewer;
int config_opennewwindow;
int config_ignoredraworder;
i->config_internallinkfunction=0;
i->config_externallinkfunction=0;
i->config_reordertags=1;
- i->config_linknameurl=1;
+ i->config_linknameurl=0;
i->config_linkcolor.r = i->config_linkcolor.g = i->config_linkcolor.b = 255;
i->config_linkcolor.a = 0x40;
i->swf->compressed = 1;
}
- /* Initialize AVM2 if it is a Flash9 file */
- if(i->config_flashversion>=9 && i->config_insertstoptag) {
- AVM2_InsertStops(i->swf);
+ /* Add AVM2 actionscript */
+ if(i->config_flashversion>=9 &&
+ (i->config_insertstoptag || i->hasbuttons)) {
+ swf_AddButtonLinks(i->swf, i->config_insertstoptag,
+ i->config_internallinkfunction||i->config_externallinkfunction);
}
// if(i->config_reordertags)
// swf_Optimize(i->swf);
endshape(dev);
if(i->textid>=0)
endtext(dev);
+
+ /* TODO: escape special characters in url */
- if(i->config_externallinkfunction) {
+ if(i->config_externallinkfunction && i->config_flashversion<=8) {
actions = action_PushString(actions, url); //parameter
actions = action_PushInt(actions, 1); //number of parameters (1)
actions = action_PushString(actions, i->config_externallinkfunction); //function name
if(i->textid>=0)
endtext(dev);
- if(!i->config_internallinkfunction) {
+ if(!i->config_internallinkfunction || i->config_flashversion>=9) {
actions = action_GotoFrame(actions, page-1);
actions = action_End(actions);
} else {
double posy = 0;
int buttonid = getNewID(dev);
gfxbbox_t bbox = gfxline_getbbox(points);
+
+ i->hasbuttons = 1;
/* shape */
myshapeid = getNewID(dev);
swf_ButtonPostProcess(i->tag, 1);
}
}
+ char buf[80];
const char* name = 0;
if(i->config_linknameurl) {
name = url;
+ } else {
+ name = buf;
+ sprintf(buf, "button%d", buttonid);
}
msg("<trace> Placing link ID %d", buttonid);
msg("<error> swf_drawchar called (glyph %d) without font", glyph);
return;
}
+
+ if(i->config_drawonlyshapes) {
+ gfxglyph_t*glyph = &font->glyphs[glyphnr];
+ gfxline_t*line2 = gfxline_clone(glyph->line);
+ gfxline_transform(line2, matrix);
+ draw_line(dev, line2);
+ fill_solid(dev, color);
+ gfxline_free(line2);
+ return;
+ }
+
if(!i->swffont || !i->swffont->name || strcmp((char*)i->swffont->name,font->id)) // not equal to current font
{
/* TODO: remove the need for this (enhance getcharacterbbox so that it can cope