X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fdevices%2Fswf.c;h=bb2cf0964c05956706fed601d8c33616833a7e33;hb=3116692a2512f2bfae346a1074d1fdfa00ea9d2c;hp=3be81d52817a460c25bf22df812715dffc9282e9;hpb=006f7afc9efc533175af7eba679998af948adfa3;p=swftools.git diff --git a/lib/devices/swf.c b/lib/devices/swf.c index 3be81d5..bb2cf09 100644 --- a/lib/devices/swf.c +++ b/lib/devices/swf.c @@ -102,6 +102,7 @@ typedef struct _swfoutput_internal int config_storeallcharacters; int config_enablezlib; int config_insertstoptag; + int config_showimages; int config_watermark; int config_noclips; int config_flashversion; @@ -207,14 +208,13 @@ typedef struct _swfoutput_internal static const int NO_FONT3=0; -static void swf_fillbitmap(gfxdevice_t*driver, gfxline_t*line, gfximage_t*img, gfxmatrix_t*move, gfxcxform_t*cxform); +static void swf_fillbitmap(gfxdevice_t*dev, gfxline_t*line, gfximage_t*img, gfxmatrix_t*matrix, gfxcxform_t*cxform); static int swf_setparameter(gfxdevice_t*driver, const char*key, const char*value); static void swf_drawstroke(gfxdevice_t*dev, gfxline_t*line, gfxcoord_t width, gfxcolor_t*color, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit); static void swf_startclip(gfxdevice_t*dev, gfxline_t*line); static void swf_endclip(gfxdevice_t*dev); static void swf_stroke(gfxdevice_t*dev, gfxline_t*line, gfxcoord_t width, gfxcolor_t*color, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit); static void swf_fill(gfxdevice_t*dev, gfxline_t*line, gfxcolor_t*color); -static void swf_fillbitmap(gfxdevice_t*dev, gfxline_t*line, gfximage_t*img, gfxmatrix_t*matrix, gfxcxform_t*cxform); static void swf_fillgradient(gfxdevice_t*dev, gfxline_t*line, gfxgradient_t*gradient, gfxgradienttype_t type, gfxmatrix_t*matrix); static void swf_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyph, gfxcolor_t*color, gfxmatrix_t*matrix); static void swf_addfont(gfxdevice_t*dev, gfxfont_t*font); @@ -955,6 +955,7 @@ static void endpage(gfxdevice_t*dev) swfoutput_internal*i = (swfoutput_internal*)dev->internal; if(i->pagefinished) return; + if(i->shapeid>=0) endshape(dev); if(i->textmode) @@ -1177,7 +1178,6 @@ void gfxdevice_swf_init(gfxdevice_t* dev) dev->startclip = swf_startclip; dev->endclip = swf_endclip; dev->fill = swf_fill; - dev->fillbitmap = swf_fillbitmap; dev->fillgradient = swf_fillgradient; dev->addfont = swf_addfont; dev->drawchar = swf_drawchar; @@ -2120,6 +2120,10 @@ int swf_setparameter(gfxdevice_t*dev, const char*name, const char*value) i->config_dumpfonts = atoi(value); } else if(!strcmp(name, "animate")) { i->config_animate = atoi(value); + } else if(!strcmp(name, "linknameurl")) { + i->config_linknameurl = atoi(value); + } else if(!strcmp(name, "showimages")) { + i->config_showimages = atoi(value); } else if(!strcmp(name, "disablelinks")) { i->config_disablelinks = atoi(value); } else if(!strcmp(name, "simpleviewer")) { @@ -2359,6 +2363,11 @@ static void swf_fillbitmap(gfxdevice_t*dev, gfxline_t*line, gfximage_t*img, gfxm SHAPE*shape; swf_ShapeNew(&shape); int fsid = swf_ShapeAddBitmapFillStyle(shape,&m,bitid,1); + int lsid = 0; + if(i->config_showimages) { + RGBA pink = {255,255,0,255}; + lsid = swf_ShapeAddLineStyle(shape, 20, &pink); + } swf_SetU16(i->tag, myshapeid); SRECT r = gfxline_getSWFbbox(line); r = swf_ClipRect(i->pagebbox, r); @@ -2366,7 +2375,7 @@ static void swf_fillbitmap(gfxdevice_t*dev, gfxline_t*line, gfximage_t*img, gfxm swf_SetShapeStyles(i->tag,shape); swf_ShapeCountBits(shape,NULL,NULL); swf_SetShapeBits(i->tag,shape); - swf_ShapeSetAll(i->tag,shape,UNDEFINED_COORD,UNDEFINED_COORD,0,fsid,0); + swf_ShapeSetAll(i->tag,shape,UNDEFINED_COORD,UNDEFINED_COORD,lsid,fsid,0); i->swflastx = i->swflasty = UNDEFINED_COORD; drawgfxline(dev, line, 1); swf_ShapeSetEnd(i->tag);