static void swf_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action);
static void swf_startframe(gfxdevice_t*dev, int width, int height);
static void swf_endframe(gfxdevice_t*dev);
+static void swfoutput_namedlink(gfxdevice_t*dev, char*name, gfxline_t*points);
+static void swfoutput_linktopage(gfxdevice_t*dev, int page, gfxline_t*points);
+static void swfoutput_linktourl(gfxdevice_t*dev, const char*url, gfxline_t*points);
+
static gfxresult_t* swf_finish(gfxdevice_t*driver);
static swfoutput_internal* init_internal_struct()
swf_SetU32(i->tag, 0);//sharpness
swf_SetU8(i->tag, 0);//reserved
}
- i->tag = swf_InsertTag(i->tag,ST_PLACEOBJECT2);
if(invisible && i->config_flashversion>=8) {
+ i->tag = swf_InsertTag(i->tag,ST_PLACEOBJECT3);
swf_ObjectPlaceBlend(i->tag,textid,getNewDepth(dev),&i->page_matrix,NULL,NULL,BLENDMODE_MULTIPLY);
} else {
+ i->tag = swf_InsertTag(i->tag,ST_PLACEOBJECT2);
swf_ObjectPlace(i->tag,textid,getNewDepth(dev),&i->page_matrix,NULL,NULL);
}
}
/* Add AVM2 actionscript */
if(i->config_flashversion>=9 &&
- (i->config_insertstoptag || i->hasbuttons)) {
+ (i->config_insertstoptag || i->hasbuttons) && !i->config_linknameurl) {
swf_AddButtonLinks(i->swf, i->config_insertstoptag,
i->config_internallinkfunction||i->config_externallinkfunction);
}
}
-static void drawlink(gfxdevice_t*dev, ActionTAG*,ActionTAG*, gfxline_t*points, char mouseover, const char*url);
+static void drawlink(gfxdevice_t*dev, ActionTAG*,ActionTAG*, gfxline_t*points, char mouseover, char*type, const char*url);
static void swfoutput_namedlink(gfxdevice_t*dev, char*name, gfxline_t*points);
static void swfoutput_linktopage(gfxdevice_t*dev, int page, gfxline_t*points);
static void swfoutput_linktourl(gfxdevice_t*dev, const char*url, gfxline_t*points);
}
actions = action_End(actions);
- drawlink(dev, actions, 0, points, 0, url);
-
+ drawlink(dev, actions, 0, points, 0, "url", url);
+
swf_ActionFree(actions);
}
void swfoutput_linktopage(gfxdevice_t*dev, int page, gfxline_t*points)
char name[80];
sprintf(name, "page%d", page);
- drawlink(dev, actions, 0, points, 0, name);
+ drawlink(dev, actions, 0, points, 0, "page", name);
swf_ActionFree(actions);
}
if(i->textmode)
endtext(dev);
+ char*type = 0;
if(!strncmp(tmp, "call:", 5))
{
char*x = strchr(&tmp[5], ':');
}
actions2 = action_End(0);
mouseover = 0;
+ type = "call";
}
else
{
actions2 = action_PushString(actions2, "");
actions2 = action_SetVariable(actions2);
actions2 = action_End(actions2);
+ type = "subtitle";
}
- drawlink(dev, actions1, actions2, points, mouseover, name);
+ drawlink(dev, actions1, actions2, points, mouseover, type, name);
swf_ActionFree(actions1);
swf_ActionFree(actions2);
}
-static void drawlink(gfxdevice_t*dev, ActionTAG*actions1, ActionTAG*actions2, gfxline_t*points, char mouseover, const char*url)
+static void drawlink(gfxdevice_t*dev, ActionTAG*actions1, ActionTAG*actions2, gfxline_t*points, char mouseover, char*type, const char*url)
{
swfoutput_internal*i = (swfoutput_internal*)dev->internal;
RGBA rgb;
int buttonid = getNewID(dev);
gfxbbox_t bbox = gfxline_getbbox(points);
+ if(i->config_linknameurl) {
+ actions1 = 0;
+ actions2 = 0;
+ }
+
i->hasbuttons = 1;
/* shape */
swf_ButtonPostProcess(i->tag, 1);
}
}
+
char buf[80];
+ char*buf2 = 0;
const char* name = 0;
if(i->config_linknameurl) {
- name = url;
+ buf2 = malloc(strlen(type)+strlen(url)+2);
+ sprintf(buf2, "%s:%s", type, url);
+ name = buf2;
} else {
name = buf;
sprintf(buf, "button%d", buttonid);
} else {
swf_ObjectPlace(i->tag, buttonid, getNewDepth(dev),&i->page_matrix,0,(U8*)name);
}
+
+ if(buf2)
+ free(buf2);
}
glyph, i->swffont->id, x, y, color->r, color->g, color->b, color->a);
if(color->a == 0 && i->config_invisibletexttofront) {
+ RGBA color2 = *(RGBA*)color;
if(i->config_flashversion>=8) {
// use "multiply" blend mode
- color->a = color->r = color->g = color->b = 255;
+ color2.a = color2.r = color2.g = color2.b = 255;
}
- i->topchardata = charbuffer_append(i->topchardata, i->swffont, glyph, x, y, i->current_font_size, *(RGBA*)color, &i->fontmatrix);
+ i->topchardata = charbuffer_append(i->topchardata, i->swffont, glyph, x, y, i->current_font_size, color2, &i->fontmatrix);
} else {
i->chardata = charbuffer_append(i->chardata, i->swffont, glyph, x, y, i->current_font_size, *(RGBA*)color, &i->fontmatrix);
}