diff options
author | Matthias Kramm <kramm@quiss.org> | 2010-07-21 13:32:05 -0700 |
---|---|---|
committer | Matthias Kramm <kramm@quiss.org> | 2010-07-21 13:32:05 -0700 |
commit | de69deebafa26f41decd89767aa2343e0bd7dddb (patch) | |
tree | b125eaee44cab606a9cdc42a5fb25c0c601d5724 | |
parent | 83afafe6474b895d7330f4e82438899a2616c65d (diff) |
added additional parameter to drawlink()
-rw-r--r-- | lib/devices/bbox.c | 2 | ||||
-rw-r--r-- | lib/devices/dummy.c | 4 | ||||
-rw-r--r-- | lib/devices/file.c | 2 | ||||
-rw-r--r-- | lib/devices/ocr.c | 2 | ||||
-rw-r--r-- | lib/devices/opengl.c | 2 | ||||
-rw-r--r-- | lib/devices/ops.c | 4 | ||||
-rw-r--r-- | lib/devices/pdf.c | 2 | ||||
-rw-r--r-- | lib/devices/polyops.c | 4 | ||||
-rw-r--r-- | lib/devices/record.c | 6 | ||||
-rw-r--r-- | lib/devices/render.c | 2 | ||||
-rw-r--r-- | lib/devices/rescale.c | 4 | ||||
-rw-r--r-- | lib/devices/swf.c | 4 | ||||
-rw-r--r-- | lib/devices/text.c | 2 | ||||
-rw-r--r-- | lib/gfxdevice.h | 2 | ||||
-rw-r--r-- | lib/gfxfilter.c | 10 | ||||
-rw-r--r-- | lib/gfxfilter.h | 2 | ||||
-rw-r--r-- | lib/gfxpoly/test.c | 2 | ||||
-rw-r--r-- | lib/gfxtools.c | 2 | ||||
-rw-r--r-- | lib/pdf/GFXOutputDev.cc | 4 | ||||
-rw-r--r-- | lib/python/gfx3.c | 4 | ||||
-rw-r--r-- | lib/ruby/gfx.c | 5 | ||||
-rw-r--r-- | lib/ruby/test.rb | 4 |
22 files changed, 39 insertions, 36 deletions
diff --git a/lib/devices/bbox.c b/lib/devices/bbox.c index f46b60de..8b729c11 100644 --- a/lib/devices/bbox.c +++ b/lib/devices/bbox.c @@ -127,7 +127,7 @@ void bbox_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyphnr, gfxcolor_t*colo } } -void bbox_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action) +void bbox_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text) { internal_t*i = (internal_t*)dev->internal; } diff --git a/lib/devices/dummy.c b/lib/devices/dummy.c index 0b858182..43ae1983 100644 --- a/lib/devices/dummy.c +++ b/lib/devices/dummy.c @@ -102,11 +102,11 @@ void dummy_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyphnr, gfxcolor_t*col i->out->drawchar(i->out, font, glyphnr, color, matrix); } -void dummy_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action) +void dummy_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text) { internal_t*i = (internal_t*)dev->internal; if(i->out) - i->out->drawlink(i->out, line, action); + i->out->drawlink(i->out, line, action, text); } void dummy_endpage(gfxdevice_t*dev) diff --git a/lib/devices/file.c b/lib/devices/file.c index 553e6422..01263aef 100644 --- a/lib/devices/file.c +++ b/lib/devices/file.c @@ -133,7 +133,7 @@ void file_drawchar(struct _gfxdevice*dev, gfxfont_t*font, int glyph, gfxcolor_t* internal_t*i = (internal_t*)dev->internal; } -void file_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action) +void file_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action, const char*text) { internal_t*i = (internal_t*)dev->internal; fprintf(i->fi, "drawlink %s\n", action); diff --git a/lib/devices/ocr.c b/lib/devices/ocr.c index f5b15925..4326c656 100644 --- a/lib/devices/ocr.c +++ b/lib/devices/ocr.c @@ -73,7 +73,7 @@ void ocr_fillbitmap(gfxdevice_t*dev, gfxline_t*line, gfximage_t*img, gfxmatrix_t void ocr_fillgradient(gfxdevice_t*dev, gfxline_t*line, gfxgradient_t*gradient, gfxgradienttype_t type, gfxmatrix_t*matrix) { ((internal_t*)dev->internal)->render->fillgradient(((internal_t*)dev->internal)->render, line, gradient, type, matrix); } void ocr_addfont(gfxdevice_t*dev, gfxfont_t*font) { ((internal_t*)dev->internal)->render->addfont(((internal_t*)dev->internal)->render, font); } void ocr_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix) { ((internal_t*)dev->internal)->render->drawchar(((internal_t*)dev->internal)->render, font, glyphnr, color, matrix); } -void ocr_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action) { ((internal_t*)dev->internal)->render->drawlink(((internal_t*)dev->internal)->render, line, action); } +void ocr_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text) { ((internal_t*)dev->internal)->render->drawlink(((internal_t*)dev->internal)->render, line, action, text); } void ocr_result_write(gfxresult_t*r, int filedesc) { diff --git a/lib/devices/opengl.c b/lib/devices/opengl.c index fd1b7456..bc0ffeb3 100644 --- a/lib/devices/opengl.c +++ b/lib/devices/opengl.c @@ -536,7 +536,7 @@ void opengl_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyphnr, gfxcolor_t*co -void opengl_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action) +void opengl_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action, const char*text) { dbg("link"); } diff --git a/lib/devices/ops.c b/lib/devices/ops.c index bda47422..c40dac5e 100644 --- a/lib/devices/ops.c +++ b/lib/devices/ops.c @@ -146,10 +146,10 @@ void ops_drawchar(struct _gfxdevice*dev, gfxfont_t*font, int glyphnr, gfxcolor_t i->out->drawchar(i->out, font, glyphnr, color, matrix); } -void ops_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action) +void ops_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action, const char*text) { internal_t*i = (internal_t*)dev->internal; - i->out->drawlink(i->out, line, action); + i->out->drawlink(i->out, line, action, text); } void ops_endpage(struct _gfxdevice*dev) diff --git a/lib/devices/pdf.c b/lib/devices/pdf.c index c1484bb4..2e8d4ae4 100644 --- a/lib/devices/pdf.c +++ b/lib/devices/pdf.c @@ -484,7 +484,7 @@ void pdf_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyphnr, gfxcolor_t*color } } -void pdf_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action) +void pdf_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text) { internal_t*i = (internal_t*)dev->internal; } diff --git a/lib/devices/polyops.c b/lib/devices/polyops.c index de035339..275dc7b0 100644 --- a/lib/devices/polyops.c +++ b/lib/devices/polyops.c @@ -343,11 +343,11 @@ void polyops_drawchar(struct _gfxdevice*dev, gfxfont_t*font, int glyphnr, gfxcol gfxline_free(glyph); } -void polyops_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action) +void polyops_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action, const char*text) { dbg("polyops_drawlink"); internal_t*i = (internal_t*)dev->internal; - if(i->out) i->out->drawlink(i->out, line, action); + if(i->out) i->out->drawlink(i->out, line, action, text); } void polyops_endpage(struct _gfxdevice*dev) diff --git a/lib/devices/record.c b/lib/devices/record.c index 90fbfbf1..d3288fdb 100644 --- a/lib/devices/record.c +++ b/lib/devices/record.c @@ -651,13 +651,14 @@ static void record_endpage(struct _gfxdevice*dev) writer_writeU8(&i->w, OP_ENDPAGE); } -static void record_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action) +static void record_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action, const char*text) { internal_t*i = (internal_t*)dev->internal; msg("<trace> record: %08x DRAWLINK\n", dev); writer_writeU8(&i->w, OP_DRAWLINK); dumpLine(&i->w, &i->state, line); writer_writeString(&i->w, action); + writer_writeString(&i->w, text); } /* ------------------------------- replaying --------------------------------- */ @@ -790,7 +791,8 @@ static void replay(struct _gfxdevice*dev, gfxdevice_t*out, reader_t*r, gfxfontli msg("<trace> replay: DRAWLINK"); gfxline_t* line = readLine(r, &state); char* s = reader_readString(r); - out->drawlink(out,line,s); + char* t = reader_readString(r); + out->drawlink(out,line,s, t); gfxline_free(line); free(s); break; diff --git a/lib/devices/render.c b/lib/devices/render.c index c1c803c9..7eed8c9c 100644 --- a/lib/devices/render.c +++ b/lib/devices/render.c @@ -1041,7 +1041,7 @@ void render_endpage(struct _gfxdevice*dev) i->height2 = 0; } -void render_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action) +void render_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action, const char*text) { /* not supported for this output device */ } diff --git a/lib/devices/rescale.c b/lib/devices/rescale.c index 350dfd2b..413a5429 100644 --- a/lib/devices/rescale.c +++ b/lib/devices/rescale.c @@ -241,11 +241,11 @@ void rescale_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyphnr, gfxcolor_t*c i->out->drawchar(i->out, font, glyphnr, color, &m2); } -void rescale_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action) +void rescale_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text) { internal_t*i = (internal_t*)dev->internal; gfxline_t*line2 = transformgfxline(i, line); - i->out->drawlink(i->out, line2, action); + i->out->drawlink(i->out, line2, action, text); gfxline_free(line2); } diff --git a/lib/devices/swf.c b/lib/devices/swf.c index c833e51f..9b9a9943 100644 --- a/lib/devices/swf.c +++ b/lib/devices/swf.c @@ -219,7 +219,7 @@ static void swf_fill(gfxdevice_t*dev, gfxline_t*line, gfxcolor_t*color); 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); -static void swf_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action); +static void swf_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text); 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); @@ -1669,7 +1669,7 @@ static void swfoutput_linktourl(gfxdevice_t*dev, const char*url, gfxline_t*point dev->drawlink(dev, points, url); }*/ -void swf_drawlink(gfxdevice_t*dev, gfxline_t*points, const char*url) +void swf_drawlink(gfxdevice_t*dev, gfxline_t*points, const char*url, const char*text) { swfoutput_internal*i = (swfoutput_internal*)dev->internal; diff --git a/lib/devices/text.c b/lib/devices/text.c index 4bdcdaf0..ed7f60ce 100644 --- a/lib/devices/text.c +++ b/lib/devices/text.c @@ -133,7 +133,7 @@ void text_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyphnr, gfxcolor_t*colo } } -void text_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action) +void text_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*drawlink) { internal_t*i = (internal_t*)dev->internal; } diff --git a/lib/gfxdevice.h b/lib/gfxdevice.h index c73117db..a2f2524e 100644 --- a/lib/gfxdevice.h +++ b/lib/gfxdevice.h @@ -129,7 +129,7 @@ typedef struct _gfxdevice void (*drawchar)(struct _gfxdevice*dev, gfxfont_t*font, int glyph, gfxcolor_t*color, gfxmatrix_t*matrix); - void (*drawlink)(struct _gfxdevice*dev, gfxline_t*line, const char*action); + void (*drawlink)(struct _gfxdevice*dev, gfxline_t*line, const char*action, const char*text); void (*endpage)(struct _gfxdevice*dev); diff --git a/lib/gfxfilter.c b/lib/gfxfilter.c index a7ee6c46..76a5cef6 100644 --- a/lib/gfxfilter.c +++ b/lib/gfxfilter.c @@ -89,10 +89,10 @@ static void filter_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyphnr, gfxcol internal_t*i = (internal_t*)dev->internal; i->filter->drawchar(i->filter, font, glyphnr, color, matrix, i->out); } -static void filter_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action) +static void filter_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text) { internal_t*i = (internal_t*)dev->internal; - i->filter->drawlink(i->filter, line, action, i->out); + i->filter->drawlink(i->filter, line, action, text, i->out); } static void filter_endpage(gfxdevice_t*dev) { @@ -168,10 +168,10 @@ static void passthrough_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyphnr, g internal_t*i = (internal_t*)dev->internal; i->out->drawchar(i->out, font, glyphnr, color, matrix); } -static void passthrough_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action) +static void passthrough_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text) { internal_t*i = (internal_t*)dev->internal; - i->out->drawlink(i->out, line, action); + i->out->drawlink(i->out, line, text, action); } static void passthrough_endpage(gfxdevice_t*dev) { @@ -210,7 +210,7 @@ static void discard_addfont(gfxdevice_t*dev, gfxfont_t*font) static void discard_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix) { } -static void discard_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action) +static void discard_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text) { } static void discard_endpage(gfxdevice_t*dev) diff --git a/lib/gfxfilter.h b/lib/gfxfilter.h index 0b341f78..9111930d 100644 --- a/lib/gfxfilter.h +++ b/lib/gfxfilter.h @@ -53,7 +53,7 @@ typedef struct _gfxfilter void (*fillgradient)(struct _gfxfilter*in, gfxline_t*line, gfxgradient_t*gradient, gfxgradienttype_t type, gfxmatrix_t*gradcoord2devcoord, struct _gfxdevice*out); //? void (*addfont)(struct _gfxfilter*in, gfxfont_t*font, struct _gfxdevice*out); void (*drawchar)(struct _gfxfilter*in, gfxfont_t*font, int glyph, gfxcolor_t*color, gfxmatrix_t*matrix, struct _gfxdevice*out); - void (*drawlink)(struct _gfxfilter*in, gfxline_t*line, const char*action, struct _gfxdevice*out); + void (*drawlink)(struct _gfxfilter*in, gfxline_t*line, const char*action, const char*text, struct _gfxdevice*out); void (*endpage)(struct _gfxfilter*in, struct _gfxdevice*out); gfxresult_t* (*finish)(struct _gfxfilter*in, struct _gfxdevice*out); diff --git a/lib/gfxpoly/test.c b/lib/gfxpoly/test.c index 28694706..897da14d 100644 --- a/lib/gfxpoly/test.c +++ b/lib/gfxpoly/test.c @@ -591,7 +591,7 @@ void extract_polygons_fillgradient(gfxdevice_t*dev, gfxline_t*line, gfxgradient_ { extract_polygons_fill(dev, line, 0); } -void extract_polygons_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action) +void extract_polygons_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text) { extract_polygons_fill(dev, line, 0); } diff --git a/lib/gfxtools.c b/lib/gfxtools.c index 563c0ba9..0c678136 100644 --- a/lib/gfxtools.c +++ b/lib/gfxtools.c @@ -676,7 +676,7 @@ void gfxbbox_intersect(gfxbbox_t*box1, gfxbbox_t*box2) box1->ymin = box2->ymin; if(box2->xmax < box1->xmax) box1->xmax = box2->xmax; - if(box2->ymax > box1->ymax) + if(box2->ymax < box1->ymax) box1->ymax = box2->ymax; if(box1->xmin > box1->xmax) box1->xmax = box1->xmin; diff --git a/lib/pdf/GFXOutputDev.cc b/lib/pdf/GFXOutputDev.cc index 25db1f80..3ddca204 100644 --- a/lib/pdf/GFXOutputDev.cc +++ b/lib/pdf/GFXOutputDev.cc @@ -1887,11 +1887,11 @@ void GFXOutputDev::processLink(Link *link, Catalog *catalog) char buf[80]; sprintf(buf, "page%d", lpage); - device->drawlink(device, points, buf); + device->drawlink(device, points, buf, 0); } else if(s) { - device->drawlink(device, points, s); + device->drawlink(device, points, s, 0); if(this->config_linkdatafile) { FILE*fi = fopen(config_linkdatafile, "ab+"); fprintf(fi, "%s\n", s); diff --git a/lib/python/gfx3.c b/lib/python/gfx3.c index 1686ba92..9b29dee9 100644 --- a/lib/python/gfx3.c +++ b/lib/python/gfx3.c @@ -646,9 +646,9 @@ static void my_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyphnr, gfxcolor_t return; } } -static void my_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action) +static void my_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text) { - callback_python("drawlink", dev, "ls", line, action); + callback_python("drawlink", dev, "lss", line, action, text); } static void my_endpage(gfxdevice_t*dev) { diff --git a/lib/ruby/gfx.c b/lib/ruby/gfx.c index 7c48a093..edbff151 100644 --- a/lib/ruby/gfx.c +++ b/lib/ruby/gfx.c @@ -622,13 +622,14 @@ void rb_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyphnr, gfxcolor_t*color, volatile VALUE v_matrix = convert_matrix(matrix); forward(v, id_drawchar, 4, f, INT2FIX(glyphnr), v_color, v_matrix); } -void rb_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action) +void rb_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text) { HEAD volatile VALUE v_line = convert_line(line); volatile VALUE v_action = rb_tainted_str_new2(action); + volatile VALUE v_text = rb_tainted_str_new2(text); - forward(v, id_drawlink, 2, v_line, v_action); + forward(v, id_drawlink, 2, v_line, v_action, v_text); } void rb_endpage(gfxdevice_t*dev) { diff --git a/lib/ruby/test.rb b/lib/ruby/test.rb index fa411e28..48e03dcc 100644 --- a/lib/ruby/test.rb +++ b/lib/ruby/test.rb @@ -34,8 +34,8 @@ class TestRender < GFX::Device def drawchar(font, glyph, color, matrix) puts "drawchar(#{font.name}, #{glyph}, #{color.inspect}, #{matrix.inspect})" end - def drawlink(line, action) - puts "drawchar(#{line.inspect}, #{action})" + def drawlink(line, action, text) + puts "drawchar(#{line.inspect}, #{action}, #{text})" end end |