summaryrefslogtreecommitdiff
path: root/xps
diff options
context:
space:
mode:
Diffstat (limited to 'xps')
-rw-r--r--xps/xps_common.c16
-rw-r--r--xps/xps_doc.c2
-rw-r--r--xps/xps_glyphs.c32
-rw-r--r--xps/xps_gradient.c38
-rw-r--r--xps/xps_image.c4
-rw-r--r--xps/xps_jpeg.c12
-rw-r--r--xps/xps_path.c78
-rw-r--r--xps/xps_png.c14
-rw-r--r--xps/xps_tiff.c78
-rw-r--r--xps/xps_tile.c24
-rw-r--r--xps/xps_zip.c14
11 files changed, 156 insertions, 156 deletions
diff --git a/xps/xps_common.c b/xps/xps_common.c
index f4a0dcee..7e7f33e3 100644
--- a/xps/xps_common.c
+++ b/xps/xps_common.c
@@ -75,9 +75,9 @@ xps_begin_opacity(xps_context *ctx, fz_matrix ctm, fz_rect area,
if (opacity_mask_tag)
{
- ctx->dev->beginmask(ctx->dev->user, area, 0, NULL, NULL);
+ ctx->dev->begin_mask(ctx->dev->user, area, 0, NULL, NULL);
xps_parse_brush(ctx, ctm, area, base_uri, dict, opacity_mask_tag);
- ctx->dev->endmask(ctx->dev->user);
+ ctx->dev->end_mask(ctx->dev->user);
}
}
@@ -94,7 +94,7 @@ xps_end_opacity(xps_context *ctx, char *base_uri, xps_resource *dict,
if (opacity_mask_tag)
{
if (strcmp(xml_tag(opacity_mask_tag), "SolidColorBrush"))
- ctx->dev->popclip(ctx->dev->user);
+ ctx->dev->pop_clip(ctx->dev->user);
}
}
@@ -184,7 +184,7 @@ xps_parse_color(xps_context *ctx, char *base_uri, char *string,
char buf[1024];
char *profile;
- *csp = fz_devicergb;
+ *csp = fz_device_rgb;
samples[0] = 1;
samples[1] = 0;
@@ -263,10 +263,10 @@ xps_parse_color(xps_context *ctx, char *base_uri, char *string,
/* TODO: load ICC profile */
switch (n)
{
- case 2: *csp = fz_devicegray; break;
- case 4: *csp = fz_devicergb; break;
- case 5: *csp = fz_devicecmyk; break;
- default: *csp = fz_devicegray; break;
+ case 2: *csp = fz_device_gray; break;
+ case 4: *csp = fz_device_rgb; break;
+ case 5: *csp = fz_device_cmyk; break;
+ default: *csp = fz_device_gray; break;
}
}
}
diff --git a/xps/xps_doc.c b/xps/xps_doc.c
index d600aafb..c3255261 100644
--- a/xps/xps_doc.c
+++ b/xps/xps_doc.c
@@ -328,7 +328,7 @@ xps_load_page(xps_context *ctx, int number)
}
n ++;
}
- return nil;
+ return NULL;
}
void
diff --git a/xps/xps_glyphs.c b/xps/xps_glyphs.c
index a5a98f6a..8ae9155a 100644
--- a/xps/xps_glyphs.c
+++ b/xps/xps_glyphs.c
@@ -21,14 +21,14 @@ static inline int unhex(int a)
int
xps_count_font_encodings(fz_font *font)
{
- FT_Face face = font->ftface;
+ FT_Face face = font->ft_face;
return face->num_charmaps;
}
void
xps_identify_font_encoding(fz_font *font, int idx, int *pid, int *eid)
{
- FT_Face face = font->ftface;
+ FT_Face face = font->ft_face;
*pid = face->charmaps[idx]->platform_id;
*eid = face->charmaps[idx]->encoding_id;
}
@@ -36,14 +36,14 @@ xps_identify_font_encoding(fz_font *font, int idx, int *pid, int *eid)
void
xps_select_font_encoding(fz_font *font, int idx)
{
- FT_Face face = font->ftface;
+ FT_Face face = font->ft_face;
FT_Set_Charmap(face, face->charmaps[idx]);
}
int
xps_encode_font_char(fz_font *font, int code)
{
- FT_Face face = font->ftface;
+ FT_Face face = font->ft_face;
int gid = FT_Get_Char_Index(face, code);
if (gid == 0 && face->charmap->platform_id == 3 && face->charmap->encoding_id == 0)
gid = FT_Get_Char_Index(face, 0xF000 | code);
@@ -54,7 +54,7 @@ void
xps_measure_font_glyph(xps_context *ctx, fz_font *font, int gid, xps_glyph_metrics *mtx)
{
int mask = FT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING | FT_LOAD_IGNORE_TRANSFORM;
- FT_Face face = font->ftface;
+ FT_Face face = font->ft_face;
FT_Fixed hadv, vadv;
FT_Set_Char_Size(face, 64, 64, 72, 72);
@@ -257,7 +257,7 @@ xps_parse_glyphs_imp(xps_context *ctx, fz_matrix ctm, fz_font *font, float size,
else
tm = fz_scale(size, -size);
- text = fz_newtext(font, tm, is_sideways);
+ text = fz_new_text(font, tm, is_sideways);
while ((us && un > 0) || (is && *is))
{
@@ -331,7 +331,7 @@ xps_parse_glyphs_imp(xps_context *ctx, fz_matrix ctm, fz_font *font, float size,
f = y - v_offset;
}
- fz_addtext(text, glyph_index, char_code, e, f);
+ fz_add_text(text, glyph_index, char_code, e, f);
x += advance * 0.01f * size;
}
@@ -472,7 +472,7 @@ xps_parse_glyphs(xps_context *ctx, fz_matrix ctm,
if (strstr(part->name, ".ODTTF"))
xps_deobfuscate_font_resource(ctx, part);
- code = fz_newfontfrombuffer(&font, part->data, part->size, subfontid);
+ code = fz_new_font_from_memory(&font, part->data, part->size, subfontid);
if (code) {
fz_catch(code, "cannot load font resource '%s'", partname);
xps_free_part(ctx, part);
@@ -484,8 +484,8 @@ xps_parse_glyphs(xps_context *ctx, fz_matrix ctm,
xps_hash_insert(ctx->font_table, part->name, font);
/* NOTE: we keep part->name in the hashtable and part->data in the font */
- font->ftdata = part->data;
- font->ftsize = part->size;
+ font->ft_data = part->data;
+ font->ft_size = part->size;
fz_free(part);
}
@@ -512,7 +512,7 @@ xps_parse_glyphs(xps_context *ctx, fz_matrix ctm,
atof(origin_x_att), atof(origin_y_att),
is_sideways, bidi_level, indices_att, unicode_att);
- area = fz_boundtext(text, ctm);
+ area = fz_bound_text(text, ctm);
xps_begin_opacity(ctx, ctm, area, opacity_mask_uri, dict, opacity_att, opacity_mask_tag);
@@ -537,7 +537,7 @@ xps_parse_glyphs(xps_context *ctx, fz_matrix ctm,
samples[0] = atof(fill_opacity_att);
xps_set_color(ctx, colorspace, samples);
- ctx->dev->filltext(ctx->dev->user, text, ctm,
+ ctx->dev->fill_text(ctx->dev->user, text, ctm,
ctx->colorspace, ctx->color, ctx->alpha);
}
@@ -547,15 +547,15 @@ xps_parse_glyphs(xps_context *ctx, fz_matrix ctm,
if (fill_tag)
{
- ctx->dev->cliptext(ctx->dev->user, text, ctm, 0);
+ ctx->dev->clip_text(ctx->dev->user, text, ctm, 0);
xps_parse_brush(ctx, ctm, area, fill_uri, dict, fill_tag);
- ctx->dev->popclip(ctx->dev->user);
+ ctx->dev->pop_clip(ctx->dev->user);
}
xps_end_opacity(ctx, opacity_mask_uri, dict, opacity_att, opacity_mask_tag);
- fz_freetext(text);
+ fz_free_text(text);
if (clip_att || clip_tag)
- ctx->dev->popclip(ctx->dev->user);
+ ctx->dev->pop_clip(ctx->dev->user);
}
diff --git a/xps/xps_gradient.c b/xps/xps_gradient.c
index f03b8f6d..65cb4362 100644
--- a/xps/xps_gradient.c
+++ b/xps/xps_gradient.c
@@ -61,7 +61,7 @@ xps_parse_gradient_stops(xps_context *ctx, char *base_uri, xml_element *node,
xps_parse_color(ctx, base_uri, color, &colorspace, sample);
- fz_convertcolor(colorspace, sample + 1, fz_devicergb, rgb);
+ fz_convert_color(colorspace, sample + 1, fz_device_rgb, rgb);
stops[count].r = rgb[0];
stops[count].g = rgb[1];
@@ -214,20 +214,20 @@ xps_draw_one_radial_gradient(xps_context *ctx, fz_matrix ctm,
/* TODO: this (and the stuff in pdf_shade) should move to res_shade.c */
shade = fz_malloc(sizeof(fz_shade));
shade->refs = 1;
- shade->colorspace = fz_devicergb;
- shade->bbox = fz_infiniterect;
+ shade->colorspace = fz_device_rgb;
+ shade->bbox = fz_infinite_rect;
shade->matrix = fz_identity;
- shade->usebackground = 0;
- shade->usefunction = 1;
+ shade->use_background = 0;
+ shade->use_function = 1;
shade->type = FZ_RADIAL;
shade->extend[0] = extend;
shade->extend[1] = extend;
xps_sample_gradient_stops(shade, stops, count);
- shade->meshlen = 6;
- shade->meshcap = 6;
- shade->mesh = fz_calloc(shade->meshcap, sizeof(float));
+ shade->mesh_len = 6;
+ shade->mesh_cap = 6;
+ shade->mesh = fz_calloc(shade->mesh_cap, sizeof(float));
shade->mesh[0] = x0;
shade->mesh[1] = y0;
shade->mesh[2] = r0;
@@ -235,9 +235,9 @@ xps_draw_one_radial_gradient(xps_context *ctx, fz_matrix ctm,
shade->mesh[4] = y1;
shade->mesh[5] = r1;
- ctx->dev->fillshade(ctx->dev->user, shade, ctm, 1);
+ ctx->dev->fill_shade(ctx->dev->user, shade, ctm, 1);
- fz_dropshade(shade);
+ fz_drop_shade(shade);
}
/*
@@ -255,20 +255,20 @@ xps_draw_one_linear_gradient(xps_context *ctx, fz_matrix ctm,
/* TODO: this (and the stuff in pdf_shade) should move to res_shade.c */
shade = fz_malloc(sizeof(fz_shade));
shade->refs = 1;
- shade->colorspace = fz_devicergb;
- shade->bbox = fz_infiniterect;
+ shade->colorspace = fz_device_rgb;
+ shade->bbox = fz_infinite_rect;
shade->matrix = fz_identity;
- shade->usebackground = 0;
- shade->usefunction = 1;
+ shade->use_background = 0;
+ shade->use_function = 1;
shade->type = FZ_LINEAR;
shade->extend[0] = extend;
shade->extend[1] = extend;
xps_sample_gradient_stops(shade, stops, count);
- shade->meshlen = 6;
- shade->meshcap = 6;
- shade->mesh = fz_calloc(shade->meshcap, sizeof(float));
+ shade->mesh_len = 6;
+ shade->mesh_cap = 6;
+ shade->mesh = fz_calloc(shade->mesh_cap, sizeof(float));
shade->mesh[0] = x0;
shade->mesh[1] = y0;
shade->mesh[2] = 0;
@@ -276,9 +276,9 @@ xps_draw_one_linear_gradient(xps_context *ctx, fz_matrix ctm,
shade->mesh[4] = y1;
shade->mesh[5] = 0;
- ctx->dev->fillshade(ctx->dev->user, shade, ctm, 1);
+ ctx->dev->fill_shade(ctx->dev->user, shade, ctm, 1);
- fz_dropshade(shade);
+ fz_drop_shade(shade);
}
/*
diff --git a/xps/xps_image.c b/xps/xps_image.c
index bc37d2e6..468c6411 100644
--- a/xps/xps_image.c
+++ b/xps/xps_image.c
@@ -47,7 +47,7 @@ xps_paint_image_brush(xps_context *ctx, fz_matrix ctm, fz_rect area, char *base_
fz_matrix im = fz_scale(xs, -ys);
im.f = ys;
ctm = fz_concat(im, ctm);
- ctx->dev->fillimage(ctx->dev->user, pixmap, ctm, ctx->opacity[ctx->opacity_top]);
+ ctx->dev->fill_image(ctx->dev->user, pixmap, ctm, ctx->opacity[ctx->opacity_top]);
}
static xps_part *
@@ -123,6 +123,6 @@ xps_parse_image_brush(xps_context *ctx, fz_matrix ctm, fz_rect area,
xps_parse_tiling_brush(ctx, ctm, area, base_uri, dict, root, xps_paint_image_brush, image);
- fz_droppixmap(image);
+ fz_drop_pixmap(image);
xps_free_part(ctx, part);
}
diff --git a/xps/xps_jpeg.c b/xps/xps_jpeg.c
index c40df1ca..8cf00c20 100644
--- a/xps/xps_jpeg.c
+++ b/xps/xps_jpeg.c
@@ -63,7 +63,7 @@ xps_decode_jpeg(fz_pixmap **imagep, byte *rbuf, int rlen)
if (setjmp(err.env))
{
if (image)
- fz_droppixmap(image);
+ fz_drop_pixmap(image);
return fz_throw("jpeg error: %s", err.msg);
}
@@ -86,15 +86,15 @@ xps_decode_jpeg(fz_pixmap **imagep, byte *rbuf, int rlen)
jpeg_start_decompress(&cinfo);
if (cinfo.output_components == 1)
- colorspace = fz_devicegray;
+ colorspace = fz_device_gray;
else if (cinfo.output_components == 3)
- colorspace = fz_devicergb;
+ colorspace = fz_device_rgb;
else if (cinfo.output_components == 4)
- colorspace = fz_devicecmyk;
+ colorspace = fz_device_cmyk;
else
return fz_throw("bad number of components in jpeg: %d", cinfo.output_components);
- image = fz_newpixmap(colorspace, 0, 0, cinfo.output_width, cinfo.output_height);
+ image = fz_new_pixmap(colorspace, 0, 0, cinfo.output_width, cinfo.output_height);
if (cinfo.density_unit == 1)
{
@@ -107,7 +107,7 @@ xps_decode_jpeg(fz_pixmap **imagep, byte *rbuf, int rlen)
image->yres = cinfo.Y_density * 254 / 100;
}
- fz_clearpixmap(image);
+ fz_clear_pixmap(image);
row[0] = fz_malloc(cinfo.output_components * cinfo.output_width);
dp = image->samples;
diff --git a/xps/xps_path.c b/xps/xps_path.c
index 83059ea1..d89cd068 100644
--- a/xps/xps_path.c
+++ b/xps/xps_path.c
@@ -12,22 +12,22 @@ fz_currentpoint(fz_path *path)
while (i < path->len)
{
- switch (path->els[i++].k)
+ switch (path->items[i++].k)
{
case FZ_MOVETO:
- m.x = c.x = path->els[i++].v;
- m.y = c.y = path->els[i++].v;
+ m.x = c.x = path->items[i++].v;
+ m.y = c.y = path->items[i++].v;
break;
case FZ_LINETO:
- c.x = path->els[i++].v;
- c.y = path->els[i++].v;
+ c.x = path->items[i++].v;
+ c.y = path->items[i++].v;
break;
case FZ_CURVETO:
i += 4;
- c.x = path->els[i++].v;
- c.y = path->els[i++].v;
+ c.x = path->items[i++].v;
+ c.y = path->items[i++].v;
break;
- case FZ_CLOSEPATH:
+ case FZ_CLOSE_PATH:
c = m;
}
}
@@ -55,18 +55,18 @@ xps_draw_arc_segment(fz_path *path, fz_matrix mtx, float th0, float th1, int isc
{
p.x = cosf(th0);
p.y = sinf(th0);
- p = fz_transformpoint(mtx, p);
+ p = fz_transform_point(mtx, p);
fz_lineto(path, p.x, p.y);
for (t = th0; t < th1; t += d)
{
p.x = cosf(t);
p.y = sinf(t);
- p = fz_transformpoint(mtx, p);
+ p = fz_transform_point(mtx, p);
fz_lineto(path, p.x, p.y);
}
p.x = cosf(th1);
p.y = sinf(th1);
- p = fz_transformpoint(mtx, p);
+ p = fz_transform_point(mtx, p);
fz_lineto(path, p.x, p.y);
}
else
@@ -74,18 +74,18 @@ xps_draw_arc_segment(fz_path *path, fz_matrix mtx, float th0, float th1, int isc
th0 += (float)M_PI * 2;
p.x = cosf(th0);
p.y = sinf(th0);
- p = fz_transformpoint(mtx, p);
+ p = fz_transform_point(mtx, p);
fz_lineto(path, p.x, p.y);
for (t = th0; t > th1; t -= d)
{
p.x = cosf(t);
p.y = sinf(t);
- p = fz_transformpoint(mtx, p);
+ p = fz_transform_point(mtx, p);
fz_lineto(path, p.x, p.y);
}
p.x = cosf(th1);
p.y = sinf(th1);
- p = fz_transformpoint(mtx, p);
+ p = fz_transform_point(mtx, p);
fz_lineto(path, p.x, p.y);
}
}
@@ -154,7 +154,7 @@ xps_draw_arc(fz_path *path,
/* F.6.5.1 */
pt.x = (x1 - x2) / 2;
pt.y = (y1 - y2) / 2;
- pt = fz_transformvector(revmat, pt);
+ pt = fz_transform_vector(revmat, pt);
x1t = pt.x;
y1t = pt.y;
@@ -180,7 +180,7 @@ xps_draw_arc(fz_path *path,
/* F.6.5.3 */
pt.x = cxt;
pt.y = cyt;
- pt = fz_transformvector(rotmat, pt);
+ pt = fz_transform_vector(rotmat, pt);
cx = pt.x + (x1 + x2) / 2;
cy = pt.y + (y1 + y2) / 2;
@@ -232,7 +232,7 @@ xps_parse_abbreviated_geometry(xps_context *ctx, char *geom, int *fill_rule)
float smooth_x, smooth_y; /* saved cubic bezier control point for smooth curves */
int reset_smooth;
- path = fz_newpath();
+ path = fz_new_path();
args = fz_calloc(strlen(geom) + 1, sizeof(char*));
pargs = args;
@@ -716,7 +716,7 @@ xps_parse_path_geometry(xps_context *ctx, xps_resource *dict, xml_element *root,
if (figures_att)
path = xps_parse_abbreviated_geometry(ctx, figures_att, fill_rule);
else
- path = fz_newpath();
+ path = fz_new_path();
if (figures_tag)
xps_parse_path_figure(path, figures_tag, stroking);
@@ -728,7 +728,7 @@ xps_parse_path_geometry(xps_context *ctx, xps_resource *dict, xml_element *root,
}
if (transform_att || transform_tag)
- fz_transformpath(path, transform);
+ fz_transform_path(path, transform);
return path;
}
@@ -757,9 +757,9 @@ xps_clip(xps_context *ctx, fz_matrix ctm, xps_resource *dict, char *clip_att, xm
else if (clip_tag)
path = xps_parse_path_geometry(ctx, dict, clip_tag, 0, &fill_rule);
else
- path = fz_newpath();
- ctx->dev->clippath(ctx->dev->user, path, fill_rule == 0, ctm);
- fz_freepath(path);
+ path = fz_new_path();
+ ctx->dev->clip_path(ctx->dev->user, path, fill_rule == 0, ctm);
+ fz_free_path(path);
}
/*
@@ -803,7 +803,7 @@ xps_parse_path(xps_context *ctx, fz_matrix ctm, char *base_uri, xps_resource *di
char *stroke_miter_limit_att;
char *stroke_thickness_att;
- fz_strokestate stroke;
+ fz_stroke_state stroke;
fz_matrix transform;
float samples[32];
fz_colorspace *colorspace;
@@ -900,20 +900,20 @@ xps_parse_path(xps_context *ctx, fz_matrix ctm, char *base_uri, xps_resource *di
if (stroke_thickness_att)
stroke.linewidth = atof(stroke_thickness_att);
- stroke.dashphase = 0;
- stroke.dashlen = 0;
+ stroke.dash_phase = 0;
+ stroke.dash_len = 0;
if (stroke_dash_array_att)
{
char *s = stroke_dash_array_att;
if (stroke_dash_offset_att)
- stroke.dashphase = atof(stroke_dash_offset_att) * stroke.linewidth;
+ stroke.dash_phase = atof(stroke_dash_offset_att) * stroke.linewidth;
- while (*s && stroke.dashlen < nelem(stroke.dashlist))
+ while (*s && stroke.dash_len < nelem(stroke.dash_list))
{
while (*s == ' ')
s++;
- stroke.dashlist[stroke.dashlen++] = atof(s) * stroke.linewidth;
+ stroke.dash_list[stroke.dash_len++] = atof(s) * stroke.linewidth;
while (*s && *s != ' ')
s++;
}
@@ -936,9 +936,9 @@ xps_parse_path(xps_context *ctx, fz_matrix ctm, char *base_uri, xps_resource *di
path = xps_parse_path_geometry(ctx, dict, data_tag, 0, &fill_rule);
if (stroke_att || stroke_tag)
- area = fz_boundpath(path, &stroke, ctm);
+ area = fz_bound_path(path, &stroke, ctm);
else
- area = fz_boundpath(path, NULL, ctm);
+ area = fz_bound_path(path, NULL, ctm);
xps_begin_opacity(ctx, ctm, area, opacity_mask_uri, dict, opacity_att, opacity_mask_tag);
@@ -949,17 +949,17 @@ xps_parse_path(xps_context *ctx, fz_matrix ctm, char *base_uri, xps_resource *di
samples[0] = atof(fill_opacity_att);
xps_set_color(ctx, colorspace, samples);
- ctx->dev->fillpath(ctx->dev->user, path, fill_rule == 0, ctm,
+ ctx->dev->fill_path(ctx->dev->user, path, fill_rule == 0, ctm,
ctx->colorspace, ctx->color, ctx->alpha);
}
if (fill_tag)
{
- area = fz_boundpath(path, NULL, ctm);
+ area = fz_bound_path(path, NULL, ctm);
- ctx->dev->clippath(ctx->dev->user, path, fill_rule == 0, ctm);
+ ctx->dev->clip_path(ctx->dev->user, path, fill_rule == 0, ctm);
xps_parse_brush(ctx, ctm, area, fill_uri, dict, fill_tag);
- ctx->dev->popclip(ctx->dev->user);
+ ctx->dev->pop_clip(ctx->dev->user);
}
if (stroke_att)
@@ -969,22 +969,22 @@ xps_parse_path(xps_context *ctx, fz_matrix ctm, char *base_uri, xps_resource *di
samples[0] = atof(stroke_opacity_att);
xps_set_color(ctx, colorspace, samples);
- ctx->dev->strokepath(ctx->dev->user, path, &stroke, ctm,
+ ctx->dev->stroke_path(ctx->dev->user, path, &stroke, ctm,
ctx->colorspace, ctx->color, ctx->alpha);
}
if (stroke_tag)
{
- ctx->dev->clipstrokepath(ctx->dev->user, path, &stroke, ctm);
+ ctx->dev->clip_stroke_path(ctx->dev->user, path, &stroke, ctm);
xps_parse_brush(ctx, ctm, area, stroke_uri, dict, stroke_tag);
- ctx->dev->popclip(ctx->dev->user);
+ ctx->dev->pop_clip(ctx->dev->user);
}
xps_end_opacity(ctx, opacity_mask_uri, dict, opacity_att, opacity_mask_tag);
- fz_freepath(path);
+ fz_free_path(path);
path = NULL;
if (clip_att || clip_tag)
- ctx->dev->popclip(ctx->dev->user);
+ ctx->dev->pop_clip(ctx->dev->user);
}
diff --git a/xps/xps_png.c b/xps/xps_png.c
index 829bde90..38c9d473 100644
--- a/xps/xps_png.c
+++ b/xps/xps_png.c
@@ -484,7 +484,7 @@ png_read_image(struct info *info, unsigned char *p, int total)
static fz_pixmap *
png_expand_palette(struct info *info, fz_pixmap *src)
{
- fz_pixmap *dst = fz_newpixmap(fz_devicergb, 0, 0, src->w, src->h);
+ fz_pixmap *dst = fz_new_pixmap(fz_device_rgb, 0, 0, src->w, src->h);
unsigned char *sp = src->samples;
unsigned char *dp = dst->samples;
int x, y;
@@ -505,7 +505,7 @@ png_expand_palette(struct info *info, fz_pixmap *src)
}
}
- fz_droppixmap(src);
+ fz_drop_pixmap(src);
return dst;
}
@@ -547,17 +547,17 @@ xps_decode_png(fz_pixmap **imagep, byte *p, int total)
return fz_rethrow(code, "cannot read png image");
if (png.n == 3 || png.n == 4)
- colorspace = fz_devicergb;
+ colorspace = fz_device_rgb;
else
- colorspace = fz_devicegray;
+ colorspace = fz_device_gray;
stride = (png.width * png.n * png.depth + 7) / 8;
- image = fz_newpixmap(colorspace, 0, 0, png.width, png.height);
+ image = fz_new_pixmap(colorspace, 0, 0, png.width, png.height);
image->xres = png.xres;
image->yres = png.yres;
- fz_unpacktile(image, png.samples, png.n, png.depth, stride, png.indexed);
+ fz_unpack_tile(image, png.samples, png.n, png.depth, stride, png.indexed);
if (png.indexed)
image = png_expand_palette(&png, image);
@@ -565,7 +565,7 @@ xps_decode_png(fz_pixmap **imagep, byte *p, int total)
png_mask_transparency(&png, image);
if (png.transparency || png.n == 2 || png.n == 4)
- fz_premultiplypixmap(image);
+ fz_premultiply_pixmap(image);
fz_free(png.samples);
diff --git a/xps/xps_tiff.c b/xps/xps_tiff.c
index 384c4338..3d905130 100644
--- a/xps/xps_tiff.c
+++ b/xps/xps_tiff.c
@@ -146,7 +146,7 @@ xps_decode_tiff_uncompressed(struct tiff *tiff, fz_stream *stm, byte *wp, int wl
static int
xps_decode_tiff_packbits(struct tiff *tiff, fz_stream *chain, byte *wp, int wlen)
{
- fz_stream *stm = fz_openrld(chain);
+ fz_stream *stm = fz_open_rld(chain);
int n = fz_read(stm, wp, wlen);
fz_close(stm);
if (n < 0)
@@ -157,7 +157,7 @@ xps_decode_tiff_packbits(struct tiff *tiff, fz_stream *chain, byte *wp, int wlen
static int
xps_decode_tiff_lzw(struct tiff *tiff, fz_stream *chain, byte *wp, int wlen)
{
- fz_stream *stm = fz_openlzwd(chain, NULL);
+ fz_stream *stm = fz_open_lzwd(chain, NULL);
int n = fz_read(stm, wp, wlen);
fz_close(stm);
if (n < 0)
@@ -167,7 +167,7 @@ xps_decode_tiff_lzw(struct tiff *tiff, fz_stream *chain, byte *wp, int wlen)
static int
xps_decode_tiff_flate(struct tiff *tiff, fz_stream *chain, byte *wp, int wlen)
{
- fz_stream *stm = fz_openflated(chain);
+ fz_stream *stm = fz_open_flated(chain);
int n = fz_read(stm, wp, wlen);
fz_close(stm);
if (n < 0)
@@ -180,32 +180,32 @@ xps_decode_tiff_fax(struct tiff *tiff, int comp, fz_stream *chain, byte *wp, int
{
fz_stream *stm;
fz_obj *params;
- fz_obj *columns, *rows, *blackis1, *k, *encodedbytealign;
+ fz_obj *columns, *rows, *black_is_1, *k, *encoded_byte_align;
int n;
- columns = fz_newint(tiff->imagewidth);
- rows = fz_newint(tiff->imagelength);
- blackis1 = fz_newbool(tiff->photometric == 0);
- k = fz_newint(comp == 4 ? -1 : 0);
- encodedbytealign = fz_newbool(comp == 2);
-
- params = fz_newdict(5);
- fz_dictputs(params, "Columns", columns);
- fz_dictputs(params, "Rows", rows);
- fz_dictputs(params, "BlackIs1", blackis1);
- fz_dictputs(params, "K", k);
- fz_dictputs(params, "EncodedByteAlign", encodedbytealign);
-
- fz_dropobj(columns);
- fz_dropobj(rows);
- fz_dropobj(blackis1);
- fz_dropobj(k);
- fz_dropobj(encodedbytealign);
-
- stm = fz_openfaxd(chain, params);
+ columns = fz_new_int(tiff->imagewidth);
+ rows = fz_new_int(tiff->imagelength);
+ black_is_1 = fz_new_bool(tiff->photometric == 0);
+ k = fz_new_int(comp == 4 ? -1 : 0);
+ encoded_byte_align = fz_new_bool(comp == 2);
+
+ params = fz_new_dict(5);
+ fz_dict_puts(params, "Columns", columns);
+ fz_dict_puts(params, "Rows", rows);
+ fz_dict_puts(params, "BlackIs1", black_is_1);
+ fz_dict_puts(params, "K", k);
+ fz_dict_puts(params, "EncodedByteAlign", encoded_byte_align);
+
+ fz_drop_obj(columns);
+ fz_drop_obj(rows);
+ fz_drop_obj(black_is_1);
+ fz_drop_obj(k);
+ fz_drop_obj(encoded_byte_align);
+
+ stm = fz_open_faxd(chain, params);
n = fz_read(stm, wp, wlen);
fz_close(stm);
- fz_dropobj(params);
+ fz_drop_obj(params);
if (n < 0)
return fz_rethrow(n, "cannot read fax strip");
@@ -215,7 +215,7 @@ xps_decode_tiff_fax(struct tiff *tiff, int comp, fz_stream *chain, byte *wp, int
static int
xps_decode_tiff_jpeg(struct tiff *tiff, fz_stream *chain, byte *wp, int wlen)
{
- fz_stream *stm = fz_opendctd(chain, NULL);
+ fz_stream *stm = fz_open_dctd(chain, NULL);
int n = fz_read(stm, wp, wlen);
fz_close(stm);
if (n < 0)
@@ -386,23 +386,23 @@ xps_decode_tiff_strips(struct tiff *tiff)
switch (tiff->photometric)
{
case 0: /* WhiteIsZero -- inverted */
- tiff->colorspace = fz_devicegray;
+ tiff->colorspace = fz_device_gray;
break;
case 1: /* BlackIsZero */
- tiff->colorspace = fz_devicegray;
+ tiff->colorspace = fz_device_gray;
break;
case 2: /* RGB */
- tiff->colorspace = fz_devicergb;
+ tiff->colorspace = fz_device_rgb;
break;
case 3: /* RGBPal */
- tiff->colorspace = fz_devicergb;
+ tiff->colorspace = fz_device_rgb;
break;
case 5: /* CMYK */
- tiff->colorspace = fz_devicecmyk;
+ tiff->colorspace = fz_device_cmyk;
break;
case 6: /* YCbCr */
/* it's probably a jpeg ... we let jpeg convert to rgb */
- tiff->colorspace = fz_devicergb;
+ tiff->colorspace = fz_device_rgb;
break;
default:
return fz_throw("unknown photometric: %d", tiff->photometric);
@@ -454,7 +454,7 @@ xps_decode_tiff_strips(struct tiff *tiff)
rp[i] = bitrev[rp[i]];
/* the strip decoders will close this */
- stm = fz_openmemory(rp, rlen);
+ stm = fz_open_memory(rp, rlen);
switch (tiff->compression)
{
@@ -824,11 +824,11 @@ xps_decode_tiff(fz_pixmap **imagep, byte *buf, int len)
/* Expand into fz_pixmap struct */
- image = fz_newpixmap(tiff.colorspace, 0, 0, tiff.imagewidth, tiff.imagelength);
+ image = fz_new_pixmap(tiff.colorspace, 0, 0, tiff.imagewidth, tiff.imagelength);
image->xres = tiff.xresolution;
image->yres = tiff.yresolution;
- fz_unpacktile(image, tiff.samples, tiff.samplesperpixel, tiff.bitspersample, tiff.stride, 0);
+ fz_unpack_tile(image, tiff.samples, tiff.samplesperpixel, tiff.bitspersample, tiff.stride, 0);
/* We should only do this on non-pre-multiplied images, but files in the wild are bad */
if (tiff.extrasamples /* == 2 */)
@@ -836,14 +836,14 @@ xps_decode_tiff(fz_pixmap **imagep, byte *buf, int len)
/* CMYK is a subtractive colorspace, we want additive for premul alpha */
if (image->n == 5)
{
- fz_pixmap *rgb = fz_newpixmap(fz_devicergb, 0, 0, image->w, image->h);
- fz_convertpixmap(image, rgb);
+ fz_pixmap *rgb = fz_new_pixmap(fz_device_rgb, 0, 0, image->w, image->h);
+ fz_convert_pixmap(image, rgb);
rgb->xres = image->xres;
rgb->yres = image->yres;
- fz_droppixmap(image);
+ fz_drop_pixmap(image);
image = rgb;
}
- fz_premultiplypixmap(image);
+ fz_premultiply_pixmap(image);
}
/* Clean up scratch memory */
diff --git a/xps/xps_tile.c b/xps/xps_tile.c
index 22444ef2..eb972fad 100644
--- a/xps/xps_tile.c
+++ b/xps/xps_tile.c
@@ -22,16 +22,16 @@ struct closure
static void
xps_paint_tiling_brush_clipped(xps_context *ctx, fz_matrix ctm, fz_rect viewbox, struct closure *c)
{
- fz_path *path = fz_newpath();
+ fz_path *path = fz_new_path();
fz_moveto(path, viewbox.x0, viewbox.y0);
fz_lineto(path, viewbox.x0, viewbox.y1);
fz_lineto(path, viewbox.x1, viewbox.y1);
fz_lineto(path, viewbox.x1, viewbox.y0);
fz_closepath(path);
- ctx->dev->clippath(ctx->dev->user, path, 0, ctm);
- fz_freepath(path);
+ ctx->dev->clip_path(ctx->dev->user, path, 0, ctm);
+ fz_free_path(path);
c->func(ctx, ctm, viewbox, c->base_uri, c->dict, c->root, c->user);
- ctx->dev->popclip(ctx->dev->user);
+ ctx->dev->pop_clip(ctx->dev->user);
}
static void
@@ -119,11 +119,11 @@ xps_parse_tiling_brush(xps_context *ctx, fz_matrix ctm, fz_rect area,
xps_parse_matrix_transform(ctx, transform_tag, &transform);
ctm = fz_concat(transform, ctm);
- viewbox = fz_unitrect;
+ viewbox = fz_unit_rect;
if (viewbox_att)
xps_parse_rectangle(ctx, viewbox_att, &viewbox);
- viewport = fz_unitrect;
+ viewport = fz_unit_rect;
if (viewport_att)
xps_parse_rectangle(ctx, viewport_att, &viewport);
@@ -168,8 +168,8 @@ xps_parse_tiling_brush(xps_context *ctx, fz_matrix ctm, fz_rect area,
if (tile_mode != TILE_NONE)
{
int x0, y0, x1, y1;
- fz_matrix invctm = fz_invertmatrix(ctm);
- area = fz_transformrect(invctm, area);
+ fz_matrix invctm = fz_invert_matrix(ctm);
+ area = fz_transform_rect(invctm, area);
x0 = floorf(area.x0 / xstep);
y0 = floorf(area.y0 / ystep);
x1 = ceilf(area.x1 / xstep);
@@ -182,11 +182,11 @@ xps_parse_tiling_brush(xps_context *ctx, fz_matrix ctm, fz_rect area,
bigview.x1 = bigview.x0 + xstep;
bigview.y1 = bigview.y0 + ystep;
if (n > 1)
- ctx->dev->begintile(ctx->dev->user, area, bigview, xstep, ystep, ctm);
+ ctx->dev->begin_tile(ctx->dev->user, area, bigview, xstep, ystep, ctm);
if (n > 0)
xps_paint_tiling_brush(ctx, ctm, viewbox, tile_mode, &c);
if (n > 1)
- ctx->dev->endtile(ctx->dev->user);
+ ctx->dev->end_tile(ctx->dev->user);
}
#else
{
@@ -316,7 +316,7 @@ xps_parse_canvas(xps_context *ctx, fz_matrix ctm, fz_rect area, char *base_uri,
xps_end_opacity(ctx, opacity_mask_uri, dict, opacity_att, opacity_mask_tag);
if (clip_att || clip_tag)
- ctx->dev->popclip(ctx->dev->user);
+ ctx->dev->pop_clip(ctx->dev->user);
if (new_dict)
xps_free_resource_dictionary(ctx, new_dict);
@@ -345,7 +345,7 @@ xps_parse_fixed_page(xps_context *ctx, fz_matrix ctm, xps_page *page)
if (!page->root)
return;
- area = fz_transformrect(fz_scale(page->width, page->height), fz_unitrect);
+ area = fz_transform_rect(fz_scale(page->width, page->height), fz_unit_rect);
for (node = xml_down(page->root); node; node = xml_next(node))
{
diff --git a/xps/xps_zip.c b/xps/xps_zip.c
index abb78832..e1019ae0 100644
--- a/xps/xps_zip.c
+++ b/xps/xps_zip.c
@@ -221,19 +221,19 @@ xps_read_zip_dir(xps_context *ctx, int start_offset)
static int
xps_find_and_read_zip_dir(xps_context *ctx)
{
- int filesize, back, maxback;
+ int file_size, back, maxback;
int i, n;
char buf[512];
fseek(ctx->file, 0, SEEK_END);
- filesize = ftell(ctx->file);
+ file_size = ftell(ctx->file);
- maxback = MIN(filesize, 0xFFFF + sizeof buf);
+ maxback = MIN(file_size, 0xFFFF + sizeof buf);
back = MIN(maxback, sizeof buf);
while (back < maxback)
{
- fseek(ctx->file, filesize - back, 0);
+ fseek(ctx->file, file_size - back, 0);
n = fread(buf, 1, sizeof buf, ctx->file);
if (n < 0)
@@ -241,7 +241,7 @@ xps_find_and_read_zip_dir(xps_context *ctx)
for (i = n - 4; i > 0; i--)
if (!memcmp(buf + i, "PK\5\6", 4))
- return xps_read_zip_dir(ctx, filesize - back + i);
+ return xps_read_zip_dir(ctx, file_size - back + i);
back += sizeof buf - 4;
}
@@ -448,12 +448,12 @@ static void xps_free_key_func(void *ptr)
static void xps_free_font_func(void *ptr)
{
- fz_dropfont(ptr);
+ fz_drop_font(ptr);
}
static void xps_free_colorspace_func(void *ptr)
{
- fz_dropcolorspace(ptr);
+ fz_drop_colorspace(ptr);
}
int