summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-02-19 17:01:24 +0100
committerTor Andersson <tor.andersson@artifex.com>2016-02-22 14:31:17 +0100
commit8888bd47b3e3cd9089287df2320daccd98852342 (patch)
treea8819965dd28c013b99f0d2433b05e8aab6bc0b2
parentbbc4678dd53e3742b5ce7f96aba03038215bbbc4 (diff)
downloadmupdf-8888bd47b3e3cd9089287df2320daccd98852342.tar.xz
Rename fz_path_processor to fz_path_walker.
-rw-r--r--include/mupdf/fitz/path.h6
-rw-r--r--source/fitz/draw-path.c12
-rw-r--r--source/fitz/path.c46
-rw-r--r--source/fitz/svg-device.c4
-rw-r--r--source/fitz/trace-device.c4
-rw-r--r--source/pdf/pdf-device.c4
6 files changed, 38 insertions, 38 deletions
diff --git a/include/mupdf/fitz/path.h b/include/mupdf/fitz/path.h
index c0dc3cf7..186443a0 100644
--- a/include/mupdf/fitz/path.h
+++ b/include/mupdf/fitz/path.h
@@ -50,15 +50,15 @@ typedef struct
void (*moveto)(fz_context *ctx, void *arg, float x, float y);
void (*lineto)(fz_context *ctx, void *arg, float x, float y);
void (*curveto)(fz_context *ctx, void *arg, float x1, float y1, float x2, float y2, float x3, float y3);
- void (*close)(fz_context *ctx, void *arg);
+ void (*closepath)(fz_context *ctx, void *arg);
/* Optional ones */
void (*quadto)(fz_context *ctx, void *arg, float x1, float y1, float x2, float y2);
void (*curvetov)(fz_context *ctx, void *arg, float x2, float y2, float x3, float y3);
void (*curvetoy)(fz_context *ctx, void *arg, float x1, float y1, float x3, float y3);
void (*rectto)(fz_context *ctx, void *arg, float x1, float y1, float x2, float y2);
-} fz_path_processor;
+} fz_path_walker;
-void fz_process_path(fz_context *ctx, const fz_path_processor *proc, void *arg, const fz_path *path);
+void fz_walk_path(fz_context *ctx, const fz_path *path, const fz_path_walker *walker, void *arg);
fz_path *fz_new_path(fz_context *ctx);
fz_path *fz_keep_path(fz_context *ctx, const fz_path *path);
diff --git a/source/fitz/draw-path.c b/source/fitz/draw-path.c
index 2ba00604..b82fad4f 100644
--- a/source/fitz/draw-path.c
+++ b/source/fitz/draw-path.c
@@ -202,7 +202,7 @@ flatten_rectto(fz_context *ctx, void *arg_, float x0, float y0, float x1, float
}
}
-static const fz_path_processor flatten_proc =
+static const fz_path_walker flatten_proc =
{
flatten_moveto,
flatten_lineto,
@@ -224,7 +224,7 @@ fz_flatten_fill_path(fz_context *ctx, fz_gel *gel, const fz_path *path, const fz
arg.flatness = flatness;
arg.b.x = arg.b.y = arg.c.x = arg.c.y = 0;
- fz_process_path(ctx, &flatten_proc, &arg, path);
+ fz_walk_path(ctx, path, &flatten_proc, &arg);
if (arg.c.x != arg.b.x || arg.c.y != arg.b.y)
line(ctx, gel, ctm, arg.c.x, arg.c.y, arg.b.x, arg.b.y);
}
@@ -832,7 +832,7 @@ stroke_close(fz_context *ctx, void *s_)
fz_stroke_closepath(ctx, s);
}
-static const fz_path_processor stroke_proc =
+static const fz_path_walker stroke_proc =
{
stroke_moveto,
stroke_lineto,
@@ -869,7 +869,7 @@ fz_flatten_stroke_path(fz_context *ctx, fz_gel *gel, const fz_path *path, const
s.cur.x = s.cur.y = 0;
s.stroke = stroke;
- fz_process_path(ctx, &stroke_proc, &s, path);
+ fz_walk_path(ctx, path, &stroke_proc, &s);
fz_stroke_flush(ctx, &s, stroke->start_cap, stroke->end_cap);
}
@@ -1291,7 +1291,7 @@ dash_close(fz_context *ctx, void *s_)
s->cur.y = s->dash_beg.y;
}
-static const fz_path_processor dash_proc =
+static const fz_path_walker dash_proc =
{
dash_moveto,
dash_lineto,
@@ -1351,6 +1351,6 @@ fz_flatten_dash_path(fz_context *ctx, fz_gel *gel, const fz_path *path, const fz
}
s.cur.x = s.cur.y = 0;
- fz_process_path(ctx, &dash_proc, &s, path);
+ fz_walk_path(ctx, path, &dash_proc, &s);
fz_stroke_flush(ctx, &s, s.cap, stroke->end_cap);
}
diff --git a/source/fitz/path.c b/source/fitz/path.c
index c270ce57..815a07b0 100644
--- a/source/fitz/path.c
+++ b/source/fitz/path.c
@@ -580,7 +580,7 @@ static inline fz_rect *bound_expand(fz_rect *r, const fz_point *p)
return r;
}
-void fz_process_path(fz_context *ctx, const fz_path_processor *proc, void *arg, const fz_path *path)
+void fz_walk_path(fz_context *ctx, const fz_path *path, const fz_path_walker *proc, void *arg)
{
int i, k, cmd_len;
float x, y, sx, sy;
@@ -626,8 +626,8 @@ void fz_process_path(fz_context *ctx, const fz_path_processor *proc, void *arg,
k += 6;
if (cmd == FZ_CURVETOCLOSE)
{
- if (proc->close)
- proc->close(ctx, arg);
+ if (proc->closepath)
+ proc->closepath(ctx, arg);
x = sx;
y = sy;
}
@@ -655,8 +655,8 @@ void fz_process_path(fz_context *ctx, const fz_path_processor *proc, void *arg,
k += 4;
if (cmd == FZ_CURVETOVCLOSE)
{
- if (proc->close)
- proc->close(ctx, arg);
+ if (proc->closepath)
+ proc->closepath(ctx, arg);
x = sx;
y = sy;
}
@@ -680,8 +680,8 @@ void fz_process_path(fz_context *ctx, const fz_path_processor *proc, void *arg,
k += 4;
if (cmd == FZ_CURVETOYCLOSE)
{
- if (proc->close)
- proc->close(ctx, arg);
+ if (proc->closepath)
+ proc->closepath(ctx, arg);
x = sx;
y = sy;
}
@@ -716,8 +716,8 @@ void fz_process_path(fz_context *ctx, const fz_path_processor *proc, void *arg,
k += 4;
if (cmd == FZ_QUADTOCLOSE)
{
- if (proc->close)
- proc->close(ctx, arg);
+ if (proc->closepath)
+ proc->closepath(ctx, arg);
x = sx;
y = sy;
}
@@ -732,8 +732,8 @@ void fz_process_path(fz_context *ctx, const fz_path_processor *proc, void *arg,
sy = y;
if (cmd == FZ_MOVETOCLOSE)
{
- if (proc->close)
- proc->close(ctx, arg);
+ if (proc->closepath)
+ proc->closepath(ctx, arg);
x = sx;
y = sy;
}
@@ -746,8 +746,8 @@ void fz_process_path(fz_context *ctx, const fz_path_processor *proc, void *arg,
k += 2;
if (cmd == FZ_LINETOCLOSE)
{
- if (proc->close)
- proc->close(ctx, arg);
+ if (proc->closepath)
+ proc->closepath(ctx, arg);
x = sx;
y = sy;
}
@@ -760,8 +760,8 @@ void fz_process_path(fz_context *ctx, const fz_path_processor *proc, void *arg,
k += 1;
if (cmd == FZ_HORIZTOCLOSE)
{
- if (proc->close)
- proc->close(ctx, arg);
+ if (proc->closepath)
+ proc->closepath(ctx, arg);
x = sx;
y = sy;
}
@@ -774,8 +774,8 @@ void fz_process_path(fz_context *ctx, const fz_path_processor *proc, void *arg,
k += 1;
if (cmd == FZ_VERTTOCLOSE)
{
- if (proc->close)
- proc->close(ctx, arg);
+ if (proc->closepath)
+ proc->closepath(ctx, arg);
x = sx;
y = sy;
}
@@ -787,8 +787,8 @@ void fz_process_path(fz_context *ctx, const fz_path_processor *proc, void *arg,
y);
if (cmd == FZ_DEGENLINETOCLOSE)
{
- if (proc->close)
- proc->close(ctx, arg);
+ if (proc->closepath)
+ proc->closepath(ctx, arg);
x = sx;
y = sy;
}
@@ -816,8 +816,8 @@ void fz_process_path(fz_context *ctx, const fz_path_processor *proc, void *arg,
proc->lineto(ctx, arg,
coords[k],
coords[k+3]);
- if (proc->close)
- proc->close(ctx, arg);
+ if (proc->closepath)
+ proc->closepath(ctx, arg);
}
sx = x;
sy = y;
@@ -902,7 +902,7 @@ bound_curveto(fz_context *ctx, void *arg_, float x1, float y1, float x2, float y
}
}
-static const fz_path_processor bound_path_proc =
+static const fz_path_walker bound_path_walker =
{
bound_moveto,
bound_lineto,
@@ -920,7 +920,7 @@ fz_bound_path(fz_context *ctx, const fz_path *path, const fz_stroke_state *strok
arg.trailing_move = 0;
arg.first = 1;
- fz_process_path(ctx, &bound_path_proc, &arg, path);
+ fz_walk_path(ctx, path, &bound_path_walker, &arg);
if (!arg.first && stroke)
{
diff --git a/source/fitz/svg-device.c b/source/fitz/svg-device.c
index f6e49a8a..e98532f1 100644
--- a/source/fitz/svg-device.c
+++ b/source/fitz/svg-device.c
@@ -119,7 +119,7 @@ svg_path_close(fz_context *ctx, void *arg)
fz_printf(ctx, out, "Z ");
}
-static const fz_path_processor svg_path_proc =
+static const fz_path_walker svg_path_walker =
{
svg_path_moveto,
svg_path_lineto,
@@ -131,7 +131,7 @@ static void
svg_dev_path(fz_context *ctx, svg_device *sdev, const fz_path *path)
{
fz_printf(ctx, sdev->out, " d=\"");
- fz_process_path(ctx, &svg_path_proc, sdev->out, path);
+ fz_walk_path(ctx, path, &svg_path_walker, sdev->out);
fz_printf(ctx, sdev->out, "\"");
}
diff --git a/source/fitz/trace-device.c b/source/fitz/trace-device.c
index 471c71ab..d93906e0 100644
--- a/source/fitz/trace-device.c
+++ b/source/fitz/trace-device.c
@@ -85,7 +85,7 @@ trace_close(fz_context *ctx, void *arg)
fz_printf(ctx, out, "<closepath/>\n");
}
-static const fz_path_processor trace_path_proc =
+static const fz_path_walker trace_path_walker =
{
trace_moveto,
trace_lineto,
@@ -96,7 +96,7 @@ static const fz_path_processor trace_path_proc =
static void
fz_trace_path(fz_context *ctx, fz_output *out, const fz_path *path)
{
- fz_process_path(ctx, &trace_path_proc, out, path);
+ fz_walk_path(ctx, path, &trace_path_walker, out);
}
static void
diff --git a/source/pdf/pdf-device.c b/source/pdf/pdf-device.c
index 186317de..3bc7276b 100644
--- a/source/pdf/pdf-device.c
+++ b/source/pdf/pdf-device.c
@@ -398,7 +398,7 @@ pdf_dev_path_close(fz_context *ctx, void *arg)
fz_buffer_printf(ctx, buf, "h\n");
}
-static const fz_path_processor pdf_dev_path_proc =
+static const fz_path_walker pdf_dev_path_proc =
{
pdf_dev_path_moveto,
pdf_dev_path_lineto,
@@ -411,7 +411,7 @@ pdf_dev_path(fz_context *ctx, pdf_device *pdev, const fz_path *path)
{
gstate *gs = CURRENT_GSTATE(pdev);
- fz_process_path(ctx, &pdf_dev_path_proc, (void *)gs->buf, path);
+ fz_walk_path(ctx, path, &pdf_dev_path_proc, (void *)gs->buf);
}
static void