diff options
51 files changed, 237 insertions, 200 deletions
diff --git a/android/jni/mupdf.c b/android/jni/mupdf.c index 3e471355..a7d49974 100644 --- a/android/jni/mupdf.c +++ b/android/jni/mupdf.c @@ -188,7 +188,7 @@ Java_com_artifex_mupdf_MuPDFCore_drawPage(JNIEnv *env, jobject thiz, jobject bit rect.y0 = patchY; rect.x1 = patchX + patchW; rect.y1 = patchY + patchH; - pix = fz_new_pixmap_with_rect_and_data(ctx, colorspace, rect, pixels); + pix = fz_new_pixmap_with_bbox_and_data(ctx, colorspace, rect, pixels); if (currentPageList == NULL) { fz_clear_pixmap_with_value(pix, 0xd0); diff --git a/apps/mudraw.c b/apps/mudraw.c index 31847665..3f0f4ac6 100644 --- a/apps/mudraw.c +++ b/apps/mudraw.c @@ -242,7 +242,7 @@ static void drawpage(fz_context *ctx, fz_document *doc, int pagenum) fz_try(ctx) { - pix = fz_new_pixmap_with_rect(ctx, colorspace, bbox); + pix = fz_new_pixmap_with_bbox(ctx, colorspace, bbox); if (savealpha) fz_clear_pixmap(ctx, pix); @@ -379,9 +379,9 @@ static void drawoutline(fz_context *ctx, fz_document *doc) { fz_outline *outline = fz_load_outline(doc); if (showoutline > 1) - fz_debug_outline_xml(ctx, outline); + fz_print_outline_xml(ctx, outline); else - fz_debug_outline(ctx, outline); + fz_print_outline(ctx, outline); fz_free_outline(ctx, outline); } diff --git a/apps/mupdfextract.c b/apps/mupdfextract.c index e86a7db1..a6a677cd 100644 --- a/apps/mupdfextract.c +++ b/apps/mupdfextract.c @@ -44,7 +44,7 @@ static void saveimage(int num) fz_drop_image(ctx, image); sprintf(name, "img-%04d", num); - fz_save_pixmap(ctx, img, name, dorgb); + fz_write_pixmap(ctx, img, name, dorgb); fz_drop_pixmap(ctx, img); pdf_drop_obj(ref); diff --git a/apps/mupdfinfo.c b/apps/mupdfinfo.c index d567bf8e..e02d8d1a 100644 --- a/apps/mupdfinfo.c +++ b/apps/mupdfinfo.c @@ -176,14 +176,14 @@ showglobalinfo(void) if (obj) { printf("Info object (%d %d R):\n", pdf_to_num(obj), pdf_to_gen(obj)); - pdf_debug_obj(pdf_resolve_indirect(obj)); + pdf_print_obj(pdf_resolve_indirect(obj)); } obj = pdf_dict_gets(xref->trailer, "Encrypt"); if (obj) { printf("\nEncryption object (%d %d R):\n", pdf_to_num(obj), pdf_to_gen(obj)); - pdf_debug_obj(pdf_resolve_indirect(obj)); + pdf_print_obj(pdf_resolve_indirect(obj)); } printf("\nPages: %d\n\n", pagecount); diff --git a/apps/mupdfshow.c b/apps/mupdfshow.c index 94aa90d6..70ca7a62 100644 --- a/apps/mupdfshow.c +++ b/apps/mupdfshow.c @@ -24,7 +24,7 @@ static void showtrailer(void) if (!doc) fz_throw(ctx, "no file specified"); printf("trailer\n"); - pdf_debug_obj(doc->trailer); + pdf_print_obj(doc->trailer); printf("\n"); } @@ -32,7 +32,7 @@ static void showxref(void) { if (!doc) fz_throw(ctx, "no file specified"); - pdf_debug_xref(doc); + pdf_print_xref(doc); printf("\n"); } @@ -122,7 +122,7 @@ static void showobject(int num, int gen) else { printf("%d %d obj\n", num, gen); - pdf_debug_obj(obj); + pdf_print_obj(obj); printf("stream\n"); showstream(num, gen); printf("endstream\n"); @@ -132,7 +132,7 @@ static void showobject(int num, int gen) else { printf("%d %d obj\n", num, gen); - pdf_debug_obj(obj); + pdf_print_obj(obj); printf("endobj\n\n"); } diff --git a/apps/pdfapp.c b/apps/pdfapp.c index 7c64cdbb..59b2f18d 100644 --- a/apps/pdfapp.c +++ b/apps/pdfapp.c @@ -303,7 +303,7 @@ static void pdfapp_showpage(pdfapp_t *app, int loadpage, int drawpage, int repai #else colorspace = fz_device_rgb; #endif - app->image = fz_new_pixmap_with_rect(app->ctx, colorspace, bbox); + app->image = fz_new_pixmap_with_bbox(app->ctx, colorspace, bbox); fz_clear_pixmap_with_value(app->ctx, app->image, 255); idev = fz_new_draw_device(app->ctx, app->image); fz_run_display_list(app->page_list, idev, ctm, bbox, NULL); diff --git a/apps/win_main.c b/apps/win_main.c index b8a18535..bf28c131 100644 --- a/apps/win_main.c +++ b/apps/win_main.c @@ -358,7 +358,7 @@ void winblit() int image_w = fz_pixmap_width(gapp.ctx, gapp.image); int image_h = fz_pixmap_height(gapp.ctx, gapp.image); int image_n = fz_pixmap_components(context, gapp.image); - unsigned char *samples = fz_pixmap_pixels(context, gapp.image); + unsigned char *samples = fz_pixmap_samples(context, gapp.image); int x0 = gapp.panx; int y0 = gapp.pany; int x1 = gapp.panx + image_w; diff --git a/apps/x11_main.c b/apps/x11_main.c index 0d7d6375..6ee76788 100644 --- a/apps/x11_main.c +++ b/apps/x11_main.c @@ -340,7 +340,7 @@ static void winblit(pdfapp_t *app) int image_w = bb.x1 - bb.x0; int image_h = bb.y1 - bb.y0; int image_n = fz_pixmap_components(gapp.ctx, gapp.image); - unsigned char *image_samples = fz_pixmap_pixels(gapp.ctx, gapp.image); + unsigned char *image_samples = fz_pixmap_samples(gapp.ctx, gapp.image); int x0 = gapp.panx; int y0 = gapp.pany; int x1 = gapp.panx + image_w; diff --git a/doc/example.c b/doc/example.c index 4467b32b..31bf68b8 100644 --- a/doc/example.c +++ b/doc/example.c @@ -51,7 +51,7 @@ render(char *filename, int pagenumber, int zoom, int rotation) // space has the origin at the top left corner and the x axis // extends to the right and the y axis extends down. - fz_pixmap *pix = fz_new_pixmap_with_rect(ctx, fz_device_rgb, bbox); + fz_pixmap *pix = fz_new_pixmap_with_bbox(ctx, fz_device_rgb, bbox); fz_clear_pixmap_with_value(ctx, pix, 0xff); // A page consists of a series of objects (text, line art, images, diff --git a/draw/draw_blend.c b/draw/draw_blend.c index 3e81568f..904de768 100644 --- a/draw/draw_blend.c +++ b/draw/draw_blend.c @@ -24,7 +24,7 @@ static const char *fz_blendmode_names[] = "Luminosity", }; -int fz_find_blendmode(char *name) +int fz_lookup_blendmode(char *name) { int i; for (i = 0; i < nelem(fz_blendmode_names); i++) diff --git a/draw/draw_device.c b/draw/draw_device.c index e2c22db1..ec4e2df5 100644 --- a/draw/draw_device.c +++ b/draw/draw_device.c @@ -123,7 +123,7 @@ fz_knockout_begin(fz_draw_device *dev) bbox = fz_bound_pixmap(state->dest); bbox = fz_intersect_bbox(bbox, state->scissor); - dest = fz_new_pixmap_with_rect(dev->ctx, state->dest->colorspace, bbox); + dest = fz_new_pixmap_with_bbox(dev->ctx, state->dest->colorspace, bbox); if (isolated) { @@ -154,7 +154,7 @@ fz_knockout_begin(fz_draw_device *dev) } else { - shape = fz_new_pixmap_with_rect(dev->ctx, NULL, bbox); + shape = fz_new_pixmap_with_bbox(dev->ctx, NULL, bbox); fz_clear_pixmap(dev->ctx, shape); } #ifdef DUMP_GROUP_BLENDS @@ -354,13 +354,13 @@ fz_draw_clip_path(fz_device *devp, fz_path *path, fz_rect *rect, int even_odd, f return; } - state[1].mask = fz_new_pixmap_with_rect(dev->ctx, NULL, bbox); + state[1].mask = fz_new_pixmap_with_bbox(dev->ctx, NULL, bbox); fz_clear_pixmap(dev->ctx, state[1].mask); - state[1].dest = fz_new_pixmap_with_rect(dev->ctx, model, bbox); + state[1].dest = fz_new_pixmap_with_bbox(dev->ctx, model, bbox); fz_clear_pixmap(dev->ctx, state[1].dest); if (state[1].shape) { - state[1].shape = fz_new_pixmap_with_rect(dev->ctx, NULL, bbox); + state[1].shape = fz_new_pixmap_with_bbox(dev->ctx, NULL, bbox); fz_clear_pixmap(dev->ctx, state[1].shape); } @@ -399,13 +399,13 @@ fz_draw_clip_stroke_path(fz_device *devp, fz_path *path, fz_rect *rect, fz_strok if (rect) bbox = fz_intersect_bbox(bbox, fz_round_rect(*rect)); - state[1].mask = fz_new_pixmap_with_rect(dev->ctx, NULL, bbox); + state[1].mask = fz_new_pixmap_with_bbox(dev->ctx, NULL, bbox); fz_clear_pixmap(dev->ctx, state[1].mask); - state[1].dest = fz_new_pixmap_with_rect(dev->ctx, model, bbox); + state[1].dest = fz_new_pixmap_with_bbox(dev->ctx, model, bbox); fz_clear_pixmap(dev->ctx, state[1].dest); if (state->shape) { - state[1].shape = fz_new_pixmap_with_rect(dev->ctx, NULL, bbox); + state[1].shape = fz_new_pixmap_with_bbox(dev->ctx, NULL, bbox); fz_clear_pixmap(dev->ctx, state[1].shape); } @@ -600,13 +600,13 @@ fz_draw_clip_text(fz_device *devp, fz_text *text, fz_matrix ctm, int accumulate) if (accumulate == 0 || accumulate == 1) { - mask = fz_new_pixmap_with_rect(dev->ctx, NULL, bbox); + mask = fz_new_pixmap_with_bbox(dev->ctx, NULL, bbox); fz_clear_pixmap(dev->ctx, mask); - dest = fz_new_pixmap_with_rect(dev->ctx, model, bbox); + dest = fz_new_pixmap_with_bbox(dev->ctx, model, bbox); fz_clear_pixmap(dev->ctx, dest); if (state->shape) { - shape = fz_new_pixmap_with_rect(dev->ctx, NULL, bbox); + shape = fz_new_pixmap_with_bbox(dev->ctx, NULL, bbox); fz_clear_pixmap(dev->ctx, shape); } else @@ -673,13 +673,13 @@ fz_draw_clip_stroke_text(fz_device *devp, fz_text *text, fz_stroke_state *stroke bbox = fz_round_rect(fz_bound_text(dev->ctx, text, ctm)); bbox = fz_intersect_bbox(bbox, state->scissor); - mask = fz_new_pixmap_with_rect(dev->ctx, NULL, bbox); + mask = fz_new_pixmap_with_bbox(dev->ctx, NULL, bbox); fz_clear_pixmap(dev->ctx, mask); - dest = fz_new_pixmap_with_rect(dev->ctx, model, bbox); + dest = fz_new_pixmap_with_bbox(dev->ctx, model, bbox); fz_clear_pixmap(dev->ctx, dest); if (state->shape) { - shape = fz_new_pixmap_with_rect(dev->ctx, NULL, bbox); + shape = fz_new_pixmap_with_bbox(dev->ctx, NULL, bbox); fz_clear_pixmap(dev->ctx, shape); } else @@ -762,11 +762,11 @@ fz_draw_fill_shade(fz_device *devp, fz_shade *shade, fz_matrix ctm, float alpha) if (alpha < 1) { - dest = fz_new_pixmap_with_rect(dev->ctx, state->dest->colorspace, bbox); + dest = fz_new_pixmap_with_bbox(dev->ctx, state->dest->colorspace, bbox); fz_clear_pixmap(dev->ctx, dest); if (shape) { - shape = fz_new_pixmap_with_rect(dev->ctx, NULL, bbox); + shape = fz_new_pixmap_with_bbox(dev->ctx, NULL, bbox); fz_clear_pixmap(dev->ctx, shape); } } @@ -926,7 +926,7 @@ fz_draw_fill_image(fz_device *devp, fz_image *image, fz_matrix ctm, float alpha) if (pixmap->colorspace != model && !after) { - converted = fz_new_pixmap_with_rect(ctx, model, fz_bound_pixmap(pixmap)); + converted = fz_new_pixmap_with_bbox(ctx, model, fz_bound_pixmap(pixmap)); fz_convert_pixmap(ctx, converted, pixmap); pixmap = converted; } @@ -956,7 +956,7 @@ fz_draw_fill_image(fz_device *devp, fz_image *image, fz_matrix ctm, float alpha) } else { - converted = fz_new_pixmap_with_rect(ctx, model, fz_bound_pixmap(pixmap)); + converted = fz_new_pixmap_with_bbox(ctx, model, fz_bound_pixmap(pixmap)); fz_convert_pixmap(ctx, converted, pixmap); pixmap = converted; } @@ -1099,14 +1099,14 @@ fz_draw_clip_image_mask(fz_device *devp, fz_image *image, fz_rect *rect, fz_matr fz_try(ctx) { - mask = fz_new_pixmap_with_rect(dev->ctx, NULL, bbox); + mask = fz_new_pixmap_with_bbox(dev->ctx, NULL, bbox); fz_clear_pixmap(dev->ctx, mask); - dest = fz_new_pixmap_with_rect(dev->ctx, model, bbox); + dest = fz_new_pixmap_with_bbox(dev->ctx, model, bbox); fz_clear_pixmap(dev->ctx, dest); if (state->shape) { - shape = fz_new_pixmap_with_rect(dev->ctx, NULL, bbox); + shape = fz_new_pixmap_with_bbox(dev->ctx, NULL, bbox); fz_clear_pixmap(dev->ctx, shape); } @@ -1211,12 +1211,12 @@ fz_draw_begin_mask(fz_device *devp, fz_rect rect, int luminosity, fz_colorspace bbox = fz_round_rect(rect); bbox = fz_intersect_bbox(bbox, state->scissor); - dest = fz_new_pixmap_with_rect(dev->ctx, fz_device_gray, bbox); + dest = fz_new_pixmap_with_bbox(dev->ctx, fz_device_gray, bbox); if (state->shape) { /* FIXME: If we ever want to support AIS true, then we * probably want to create a shape pixmap here, using: - * shape = fz_new_pixmap_with_rect(NULL, bbox); + * shape = fz_new_pixmap_with_bbox(NULL, bbox); * then, in the end_mask code, we create the mask from this * rather than dest. */ @@ -1285,7 +1285,7 @@ fz_draw_end_mask(fz_device *devp) /* create new dest scratch buffer */ bbox = fz_bound_pixmap(temp); - dest = fz_new_pixmap_with_rect(dev->ctx, state->dest->colorspace, bbox); + dest = fz_new_pixmap_with_bbox(dev->ctx, state->dest->colorspace, bbox); fz_clear_pixmap(dev->ctx, dest); /* push soft mask as clip mask */ @@ -1296,7 +1296,7 @@ fz_draw_end_mask(fz_device *devp) * clip mask when we pop. So create a new shape now. */ if (state[0].shape) { - state[1].shape = fz_new_pixmap_with_rect(dev->ctx, NULL, bbox); + state[1].shape = fz_new_pixmap_with_bbox(dev->ctx, NULL, bbox); fz_clear_pixmap(dev->ctx, state[1].shape); } state[1].scissor = bbox; @@ -1318,7 +1318,7 @@ fz_draw_begin_group(fz_device *devp, fz_rect rect, int isolated, int knockout, i state = push_stack(dev); bbox = fz_round_rect(rect); bbox = fz_intersect_bbox(bbox, state->scissor); - dest = fz_new_pixmap_with_rect(ctx, model, bbox); + dest = fz_new_pixmap_with_bbox(ctx, model, bbox); #ifndef ATTEMPT_KNOCKOUT_AND_ISOLATED knockout = 0; @@ -1344,7 +1344,7 @@ fz_draw_begin_group(fz_device *devp, fz_rect rect, int isolated, int knockout, i { fz_try(ctx) { - shape = fz_new_pixmap_with_rect(ctx, NULL, bbox); + shape = fz_new_pixmap_with_bbox(ctx, NULL, bbox); fz_clear_pixmap(dev->ctx, shape); } fz_catch(ctx) @@ -1451,7 +1451,7 @@ fz_draw_begin_tile(fz_device *devp, fz_rect area, fz_rect view, float xstep, flo * assert(bbox.x0 > state->dest->x || bbox.x1 < state->dest->x + state->dest->w || * bbox.y0 > state->dest->y || bbox.y1 < state->dest->y + state->dest->h); */ - dest = fz_new_pixmap_with_rect(dev->ctx, model, bbox); + dest = fz_new_pixmap_with_bbox(dev->ctx, model, bbox); fz_clear_pixmap(ctx, dest); shape = state[0].shape; if (shape) @@ -1459,7 +1459,7 @@ fz_draw_begin_tile(fz_device *devp, fz_rect area, fz_rect view, float xstep, flo fz_var(shape); fz_try(ctx) { - shape = fz_new_pixmap_with_rect(dev->ctx, NULL, bbox); + shape = fz_new_pixmap_with_bbox(dev->ctx, NULL, bbox); fz_clear_pixmap(ctx, shape); } fz_catch(ctx) diff --git a/draw/draw_edge.c b/draw/draw_edge.c index ad7a413c..12ba72fc 100644 --- a/draw/draw_edge.c +++ b/draw/draw_edge.c @@ -20,7 +20,7 @@ struct fz_aa_context_s int hscale; int vscale; int scale; - int level; + int bits; }; void fz_new_aa_context(fz_context *ctx) @@ -30,12 +30,12 @@ void fz_new_aa_context(fz_context *ctx) ctx->aa->hscale = 17; ctx->aa->vscale = 15; ctx->aa->scale = 256; - ctx->aa->level = 8; + ctx->aa->bits = 8; #define fz_aa_hscale ((ctxaa)->hscale) #define fz_aa_vscale ((ctxaa)->vscale) #define fz_aa_scale ((ctxaa)->scale) -#define fz_aa_level ((ctxaa)->level) +#define fz_aa_bits ((ctxaa)->bits) #define AA_SCALE(x) ((x * fz_aa_scale) >> 8) #endif @@ -61,40 +61,40 @@ void fz_free_aa_context(fz_context *ctx) #define AA_SCALE(x) (x) #define fz_aa_hscale 17 #define fz_aa_vscale 15 -#define fz_aa_level 8 +#define fz_aa_bits 8 #elif AA_BITS > 4 #define AA_SCALE(x) ((x * 255) >> 6) #define fz_aa_hscale 8 #define fz_aa_vscale 8 -#define fz_aa_level 6 +#define fz_aa_bits 6 #elif AA_BITS > 2 #define AA_SCALE(x) (x * 17) #define fz_aa_hscale 5 #define fz_aa_vscale 3 -#define fz_aa_level 4 +#define fz_aa_bits 4 #elif AA_BITS > 0 #define AA_SCALE(x) ((x * 255) >> 2) #define fz_aa_hscale 2 #define fz_aa_vscale 2 -#define fz_aa_level 2 +#define fz_aa_bits 2 #else #define AA_SCALE(x) (x * 255) #define fz_aa_hscale 1 #define fz_aa_vscale 1 -#define fz_aa_level 0 +#define fz_aa_bits 0 #endif #endif int -fz_get_aa_level(fz_context *ctx) +fz_aa_level(fz_context *ctx) { fz_aa_context *ctxaa = ctx->aa; - return fz_aa_level; + return fz_aa_bits; } void @@ -102,37 +102,37 @@ fz_set_aa_level(fz_context *ctx, int level) { fz_aa_context *ctxaa = ctx->aa; #ifdef AA_BITS - fz_warn(ctx, "anti-aliasing was compiled with a fixed precision of %d bits", fz_aa_level); + fz_warn(ctx, "anti-aliasing was compiled with a fixed precision of %d bits", fz_aa_bits); #else if (level > 6) { fz_aa_hscale = 17; fz_aa_vscale = 15; - fz_aa_level = 8; + fz_aa_bits = 8; } else if (level > 4) { fz_aa_hscale = 8; fz_aa_vscale = 8; - fz_aa_level = 6; + fz_aa_bits = 6; } else if (level > 2) { fz_aa_hscale = 5; fz_aa_vscale = 3; - fz_aa_level = 4; + fz_aa_bits = 4; } else if (level > 0) { fz_aa_hscale = 2; fz_aa_vscale = 2; - fz_aa_level = 2; + fz_aa_bits = 2; } else { fz_aa_hscale = 1; fz_aa_vscale = 1; - fz_aa_level = 0; + fz_aa_bits = 0; } fz_aa_scale = 0xFF00 / (fz_aa_hscale * fz_aa_vscale); #endif @@ -798,7 +798,7 @@ fz_scan_convert(fz_gel *gel, int eofill, fz_bbox clip, { fz_aa_context *ctxaa = gel->ctx->aa; - if (fz_aa_level > 0) + if (fz_aa_bits > 0) fz_scan_convert_aa(gel, eofill, clip, dst, color); else fz_scan_convert_sharp(gel, eofill, clip, dst, color); diff --git a/draw/draw_glyph.c b/draw/draw_glyph.c index 0761b8a9..cef9d7fa 100644 --- a/draw/draw_glyph.c +++ b/draw/draw_glyph.c @@ -129,7 +129,7 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix ctm, fz_color key.d = ctm.d * 65536; key.e = (ctm.e - floorf(ctm.e)) * 256; key.f = (ctm.f - floorf(ctm.f)) * 256; - key.aa = fz_get_aa_level(ctx); + key.aa = fz_aa_level(ctx); fz_lock(ctx, FZ_LOCK_GLYPHCACHE); val = fz_hash_find(ctx, cache->hash, &key); diff --git a/draw/draw_mesh.c b/draw/draw_mesh.c index 1d6f1759..7579ad60 100644 --- a/draw/draw_mesh.c +++ b/draw/draw_mesh.c @@ -544,8 +544,8 @@ fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_pixmap *dest, clut[i][k] = color[k] * 255; clut[i][k] = shade->function[i][shade->colorspace->n] * 255; } - conv = fz_new_pixmap_with_rect(ctx, dest->colorspace, bbox); - temp = fz_new_pixmap_with_rect(ctx, fz_device_gray, bbox); + conv = fz_new_pixmap_with_bbox(ctx, dest->colorspace, bbox); + temp = fz_new_pixmap_with_bbox(ctx, fz_device_gray, bbox); fz_clear_pixmap(ctx, temp); } else diff --git a/fitz/base_hash.c b/fitz/base_hash.c index 59ed8872..bf56b9bc 100644 --- a/fitz/base_hash.c +++ b/fitz/base_hash.c @@ -268,7 +268,7 @@ fz_hash_remove(fz_context *ctx, fz_hash_table *table, void *key) } void -fz_debug_hash(fz_context *ctx, fz_hash_table *table) +fz_print_hash(fz_context *ctx, fz_hash_table *table) { int i, k; diff --git a/fitz/dev_text.c b/fitz/dev_text.c index 7a56b56c..b92372a1 100644 --- a/fitz/dev_text.c +++ b/fitz/dev_text.c @@ -42,7 +42,7 @@ fz_free_text_sheet(fz_context *ctx, fz_text_sheet *sheet) } static fz_text_style * -fz_find_text_style_imp(fz_context *ctx, fz_text_sheet *sheet, +fz_lookup_text_style_imp(fz_context *ctx, fz_text_sheet *sheet, float size, fz_font *font, int wmode, int script) { fz_text_style *style; @@ -71,7 +71,7 @@ fz_find_text_style_imp(fz_context *ctx, fz_text_sheet *sheet, } static fz_text_style * -fz_find_text_style(fz_context *ctx, fz_text_sheet *sheet, fz_text *text, fz_matrix *ctm, +fz_lookup_text_style(fz_context *ctx, fz_text_sheet *sheet, fz_text *text, fz_matrix *ctm, fz_colorspace *colorspace, float *color, float alpha, fz_stroke_state *stroke) { float size = 1.0f; @@ -86,7 +86,7 @@ fz_find_text_style(fz_context *ctx, fz_text_sheet *sheet, fz_text *text, fz_matr trm = fz_concat(tm, *ctm); size = fz_matrix_expansion(trm); } - return fz_find_text_style_imp(ctx, sheet, size, font, wmode, 0); + return fz_lookup_text_style_imp(ctx, sheet, size, font, wmode, 0); } fz_text_page * @@ -178,7 +178,7 @@ append_line(fz_context *ctx, fz_text_block *block, fz_text_line *line) } static fz_text_block * -find_block_for_line(fz_context *ctx, fz_text_page *page, fz_text_line *line) +lookup_block_for_line(fz_context *ctx, fz_text_page *page, fz_text_line *line) { float size = line->len > 0 && line->spans[0].len > 0 ? line->spans[0].style->size : 1; int i; @@ -210,7 +210,7 @@ find_block_for_line(fz_context *ctx, fz_text_page *page, fz_text_line *line) static void insert_line(fz_context *ctx, fz_text_page *page, fz_text_line *line) { - append_line(ctx, find_block_for_line(ctx, page, line), line); + append_line(ctx, lookup_block_for_line(ctx, page, line), line); } static fz_rect @@ -447,7 +447,7 @@ fz_text_fill_text(fz_device *dev, fz_text *text, fz_matrix ctm, { fz_text_device *tdev = dev->user; fz_text_style *style; - style = fz_find_text_style(dev->ctx, tdev->sheet, text, &ctm, colorspace, color, alpha, NULL); + style = fz_lookup_text_style(dev->ctx, tdev->sheet, text, &ctm, colorspace, color, alpha, NULL); fz_text_extract(dev->ctx, tdev, text, ctm, style); } @@ -457,7 +457,7 @@ fz_text_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, fz_m { fz_text_device *tdev = dev->user; fz_text_style *style; - style = fz_find_text_style(dev->ctx, tdev->sheet, text, &ctm, colorspace, color, alpha, stroke); + style = fz_lookup_text_style(dev->ctx, tdev->sheet, text, &ctm, colorspace, color, alpha, stroke); fz_text_extract(dev->ctx, tdev, text, ctm, style); } @@ -466,7 +466,7 @@ fz_text_clip_text(fz_device *dev, fz_text *text, fz_matrix ctm, int accumulate) { fz_text_device *tdev = dev->user; fz_text_style *style; - style = fz_find_text_style(dev->ctx, tdev->sheet, text, &ctm, NULL, NULL, 0, NULL); + style = fz_lookup_text_style(dev->ctx, tdev->sheet, text, &ctm, NULL, NULL, 0, NULL); fz_text_extract(dev->ctx, tdev, text, ctm, style); } @@ -475,7 +475,7 @@ fz_text_clip_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, { fz_text_device *tdev = dev->user; fz_text_style *style; - style = fz_find_text_style(dev->ctx, tdev->sheet, text, &ctm, NULL, NULL, 0, stroke); + style = fz_lookup_text_style(dev->ctx, tdev->sheet, text, &ctm, NULL, NULL, 0, stroke); fz_text_extract(dev->ctx, tdev, text, ctm, style); } @@ -484,7 +484,7 @@ fz_text_ignore_text(fz_device *dev, fz_text *text, fz_matrix ctm) { fz_text_device *tdev = dev->user; fz_text_style *style; - style = fz_find_text_style(dev->ctx, tdev->sheet, text, &ctm, NULL, NULL, 0, NULL); + style = fz_lookup_text_style(dev->ctx, tdev->sheet, text, &ctm, NULL, NULL, 0, NULL); fz_text_extract(dev->ctx, tdev, text, ctm, style); } diff --git a/fitz/dev_trace.c b/fitz/dev_trace.c index f75f19d5..33406130 100644 --- a/fitz/dev_trace.c +++ b/fitz/dev_trace.c @@ -145,7 +145,7 @@ fz_trace_fill_text(fz_device *dev, fz_text *text, fz_matrix ctm, fz_trace_matrix(ctm); fz_trace_trm(text->trm); printf(">\n"); - fz_debug_text(dev->ctx, text, 0); + fz_print_text(dev->ctx, text, 0); printf("</fill_text>\n"); } @@ -158,7 +158,7 @@ fz_trace_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, fz_ fz_trace_matrix(ctm); fz_trace_trm(text->trm); printf(">\n"); - fz_debug_text(dev->ctx, text, 0); + fz_print_text(dev->ctx, text, 0); printf("</stroke_text>\n"); } @@ -170,7 +170,7 @@ fz_trace_clip_text(fz_device *dev, fz_text *text, fz_matrix ctm, int accumulate) fz_trace_matrix(ctm); fz_trace_trm(text->trm); printf(">\n"); - fz_debug_text(dev->ctx, text, 0); + fz_print_text(dev->ctx, text, 0); printf("</clip_text>\n"); } @@ -181,7 +181,7 @@ fz_trace_clip_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke fz_trace_matrix(ctm); fz_trace_trm(text->trm); printf(">\n"); - fz_debug_text(dev->ctx, text, 0); + fz_print_text(dev->ctx, text, 0); printf("</clip_stroke_text>\n"); } @@ -192,7 +192,7 @@ fz_trace_ignore_text(fz_device *dev, fz_text *text, fz_matrix ctm) fz_trace_matrix(ctm); fz_trace_trm(text->trm); printf(">\n"); - fz_debug_text(dev->ctx, text, 0); + fz_print_text(dev->ctx, text, 0); printf("</ignore_text>\n"); } diff --git a/fitz/doc_outline.c b/fitz/doc_outline.c index 4847b919..023abd23 100644 --- a/fitz/doc_outline.c +++ b/fitz/doc_outline.c @@ -35,7 +35,7 @@ do_debug_outline_xml(fz_outline *outline, int level) } void -fz_debug_outline_xml(fz_context *ctx, fz_outline *outline) +fz_print_outline_xml(fz_context *ctx, fz_outline *outline) { do_debug_outline_xml(outline, 0); } @@ -56,7 +56,7 @@ do_debug_outline(fz_outline *outline, int level) } void -fz_debug_outline(fz_context *ctx, fz_outline *outline) +fz_print_outline(fz_context *ctx, fz_outline *outline) { do_debug_outline(outline, 0); } diff --git a/fitz/fitz-internal.h b/fitz/fitz-internal.h index 16b65ccd..6d4b292b 100644 --- a/fitz/fitz-internal.h +++ b/fitz/fitz-internal.h @@ -87,7 +87,7 @@ float fz_atof(const char *s); typedef struct fz_hash_table_s fz_hash_table; fz_hash_table *fz_new_hash_table(fz_context *ctx, int initialsize, int keylen, int lock); -void fz_debug_hash(fz_context *ctx, fz_hash_table *table); +void fz_print_hash(fz_context *ctx, fz_hash_table *table); void fz_empty_hash(fz_context *ctx, fz_hash_table *table); void fz_free_hash(fz_context *ctx, fz_hash_table *table); @@ -308,9 +308,9 @@ void fz_drop_store_context(fz_context *ctx); fz_store *fz_keep_store_context(fz_context *ctx); /* - fz_debug_store: Dump the contents of the store for debugging. + fz_print_store: Dump the contents of the store for debugging. */ -void fz_debug_store(fz_context *ctx); +void fz_print_store(fz_context *ctx); /* fz_store_item: Add an item to the store. @@ -558,7 +558,7 @@ fz_stream *fz_open_jbig2d(fz_stream *chain, fz_buffer *global); enum { FZ_MAX_COLORS = 32 }; -int fz_find_blendmode(char *name); +int fz_lookup_blendmode(char *name); char *fz_blendmode_name(int blendmode); struct fz_bitmap_s @@ -603,7 +603,7 @@ void fz_clear_bitmap(fz_context *ctx, fz_bitmap *bit); in scanline order. Subsequent scanlines follow on with no padding. free_samples: Is zero when an application has provided its own - buffer for pixel data through fz_new_pixmap_with_rect_and_data. + buffer for pixel data through fz_new_pixmap_with_bbox_and_data. If not zero the buffer will be freed when fz_drop_pixmap is called for the pixmap. */ @@ -620,7 +620,7 @@ struct fz_pixmap_s fz_pixmap *fz_new_pixmap_with_data(fz_context *ctx, fz_colorspace *colorspace, int w, int h, unsigned char *samples); -fz_pixmap *fz_new_pixmap_with_rect_and_data(fz_context *ctx, fz_colorspace *colorspace, fz_bbox bbox, unsigned char *samples); +fz_pixmap *fz_new_pixmap_with_bbox_and_data(fz_context *ctx, fz_colorspace *colorspace, fz_bbox bbox, unsigned char *samples); void fz_free_pixmap_imp(fz_context *ctx, fz_storable *pix); @@ -654,7 +654,7 @@ struct fz_halftone_s }; fz_halftone *fz_new_halftone(fz_context *ctx, int num_comps); -fz_halftone *fz_get_default_halftone(fz_context *ctx, int num_comps); +fz_halftone *fz_default_halftone(fz_context *ctx, int num_comps); void fz_drop_halftone(fz_context *ctx, fz_halftone *half); fz_halftone *fz_keep_halftone(fz_context *ctx, fz_halftone *half); @@ -734,7 +734,7 @@ fz_font *fz_new_font_from_file(fz_context *ctx, char *path, int index, int use_g fz_font *fz_keep_font(fz_context *ctx, fz_font *font); void fz_drop_font(fz_context *ctx, fz_font *font); -void fz_debug_font(fz_context *ctx, fz_font *font); +void fz_print_font(fz_context *ctx, fz_font *font); void fz_set_font_bbox(fz_context *ctx, fz_font *font, float xmin, float ymin, float xmax, float ymax); fz_rect fz_bound_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm); @@ -816,7 +816,7 @@ void fz_transform_path(fz_context *ctx, fz_path *path, fz_matrix transform); fz_path *fz_clone_path(fz_context *ctx, fz_path *old); fz_rect fz_bound_path(fz_context *ctx, fz_path *path, fz_stroke_state *stroke, fz_matrix ctm); -void fz_debug_path(fz_context *ctx, fz_path *, int indent); +void fz_print_path(fz_context *ctx, fz_path *, int indent); /* * Glyph cache @@ -870,7 +870,7 @@ void fz_add_text(fz_context *ctx, fz_text *text, int gid, int ucs, float x, floa void fz_free_text(fz_context *ctx, fz_text *text); fz_rect fz_bound_text(fz_context *ctx, fz_text *text, fz_matrix ctm); fz_text *fz_clone_text(fz_context *ctx, fz_text *old); -void fz_debug_text(fz_context *ctx, fz_text*, int indent); +void fz_print_text(fz_context *ctx, fz_text*, int indent); /* * The shading code uses gouraud shaded triangle meshes. @@ -910,7 +910,7 @@ struct fz_shade_s fz_shade *fz_keep_shade(fz_context *ctx, fz_shade *shade); void fz_drop_shade(fz_context *ctx, fz_shade *shade); void fz_free_shade_imp(fz_context *ctx, fz_storable *shade); -void fz_debug_shade(fz_context *ctx, fz_shade *shade); +void fz_print_shade(fz_context *ctx, fz_shade *shade); fz_rect fz_bound_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm); void fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_pixmap *dest, fz_bbox bbox); diff --git a/fitz/fitz.h b/fitz/fitz.h index 85e1feea..33379df7 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -274,10 +274,10 @@ fz_context *fz_clone_context(fz_context *ctx); void fz_free_context(fz_context *ctx); /* - fz_get_aa_level: Get the number of bits of antialiasing we are + fz_aa_level: Get the number of bits of antialiasing we are using. Between 0 and 8. */ -int fz_get_aa_level(fz_context *ctx); +int fz_aa_level(fz_context *ctx); /* fz_set_aa_level: Set the number of bits of antialiasing we should use. @@ -1151,7 +1151,7 @@ int fz_pixmap_height(fz_context *ctx, fz_pixmap *pix); fz_pixmap *fz_new_pixmap(fz_context *ctx, fz_colorspace *cs, int w, int h); /* - fz_new_pixmap_with_rect: Create a pixmap of a given size, + fz_new_pixmap_with_bbox: Create a pixmap of a given size, location and pixel format. The bounding box specifies the size of the created pixmap and @@ -1164,7 +1164,7 @@ fz_pixmap *fz_new_pixmap(fz_context *ctx, fz_colorspace *cs, int w, int h); bbox: Bounding box specifying location/size of created pixmap. */ -fz_pixmap *fz_new_pixmap_with_rect(fz_context *ctx, fz_colorspace *colorspace, fz_bbox bbox); +fz_pixmap *fz_new_pixmap_with_bbox(fz_context *ctx, fz_colorspace *colorspace, fz_bbox bbox); /* fz_keep_pixmap: Take a reference to a pixmap. @@ -1200,11 +1200,11 @@ fz_colorspace *fz_pixmap_colorspace(fz_context *ctx, fz_pixmap *pix); int fz_pixmap_components(fz_context *ctx, fz_pixmap *pix); /* - fz_pixmap_pixels: Returns a pointer to the pixel data of a pixmap. + fz_pixmap_samples: Returns a pointer to the pixel data of a pixmap. Returns the pointer. Does not throw exceptions. */ -unsigned char *fz_pixmap_pixels(fz_context *ctx, fz_pixmap *pix); +unsigned char *fz_pixmap_samples(fz_context *ctx, fz_pixmap *pix); /* fz_clear_pixmap_with_value: Clears a pixmap with the given value. @@ -1275,7 +1275,7 @@ void fz_unmultiply_pixmap(fz_context *ctx, fz_pixmap *pix); void fz_convert_pixmap(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src); /* - fz_save_pixmap: Save a pixmap out. + fz_write_pixmap: Save a pixmap out. name: The prefix for the name of the pixmap. The pixmap will be saved as "name.png" if the pixmap is RGB or Greyscale, "name.pam" otherwise. @@ -1283,7 +1283,7 @@ void fz_convert_pixmap(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src); rgb: If non zero, the pixmap is converted to rgb (if possible) before saving. */ -void fz_save_pixmap(fz_context *ctx, fz_pixmap *img, char *name, int rgb); +void fz_write_pixmap(fz_context *ctx, fz_pixmap *img, char *name, int rgb); /* fz_write_pnm: Save a pixmap as a pnm @@ -1815,15 +1815,15 @@ struct fz_outline_s }; /* - fz_debug_outline_xml: Dump the given outlines to stdout as (pseudo) + fz_print_outline_xml: Dump the given outlines to stdout as (pseudo) XML. */ -void fz_debug_outline_xml(fz_context *ctx, fz_outline *outline); +void fz_print_outline_xml(fz_context *ctx, fz_outline *outline); /* - fz_debug_outline: Dump the given outlines to stdout as text. + fz_print_outline: Dump the given outlines to stdout as text. */ -void fz_debug_outline(fz_context *ctx, fz_outline *outline); +void fz_print_outline(fz_context *ctx, fz_outline *outline); /* fz_free_outline: Free hierarchical outline. diff --git a/fitz/image_save.c b/fitz/image_save.c index 29d3e8fc..614d18ce 100644 --- a/fitz/image_save.c +++ b/fitz/image_save.c @@ -1,6 +1,6 @@ #include "fitz-internal.h" -void fz_save_pixmap(fz_context *ctx, fz_pixmap *img, char *file, int rgb) +void fz_write_pixmap(fz_context *ctx, fz_pixmap *img, char *file, int rgb) { char name[1024]; fz_pixmap *converted = NULL; @@ -10,7 +10,7 @@ void fz_save_pixmap(fz_context *ctx, fz_pixmap *img, char *file, int rgb) if (rgb && img->colorspace && img->colorspace != fz_device_rgb) { - converted = fz_new_pixmap_with_rect(ctx, fz_device_rgb, fz_bound_pixmap(img)); + converted = fz_new_pixmap_with_bbox(ctx, fz_device_rgb, fz_bound_pixmap(img)); fz_convert_pixmap(ctx, converted, img); img = converted; } diff --git a/fitz/res_bitmap.c b/fitz/res_bitmap.c index 25e88187..1bd2827d 100644 --- a/fitz/res_bitmap.c +++ b/fitz/res_bitmap.c @@ -89,7 +89,7 @@ int fz_pixmap_components(fz_context *ctx, fz_pixmap *pix) return pix->n; } -unsigned char *fz_pixmap_pixels(fz_context *ctx, fz_pixmap *pix) +unsigned char *fz_pixmap_samples(fz_context *ctx, fz_pixmap *pix) { if (!pix) return NULL; diff --git a/fitz/res_font.c b/fitz/res_font.c index dd4e68da..438d5ba7 100644 --- a/fitz/res_font.c +++ b/fitz/res_font.c @@ -471,7 +471,7 @@ fz_render_ft_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, int a FT_Outline_Translate(&face->glyph->outline, -strength * 32, -strength * 32); } - fterr = FT_Render_Glyph(face->glyph, fz_get_aa_level(ctx) > 0 ? FT_RENDER_MODE_NORMAL : FT_RENDER_MODE_MONO); + fterr = FT_Render_Glyph(face->glyph, fz_aa_level(ctx) > 0 ? FT_RENDER_MODE_NORMAL : FT_RENDER_MODE_MONO); if (fterr) { fz_warn(ctx, "freetype render glyph (gid %d): %s", gid, ft_error_string(fterr)); @@ -575,7 +575,7 @@ fz_render_ft_stroked_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix tr FT_Stroker_Done(stroker); - fterr = FT_Glyph_To_Bitmap(&glyph, fz_get_aa_level(ctx) > 0 ? FT_RENDER_MODE_NORMAL : FT_RENDER_MODE_MONO, 0, 1); + fterr = FT_Glyph_To_Bitmap(&glyph, fz_aa_level(ctx) > 0 ? FT_RENDER_MODE_NORMAL : FT_RENDER_MODE_MONO, 0, 1); if (fterr) { fz_warn(ctx, "FT_Glyph_To_Bitmap: %s", ft_error_string(fterr)); @@ -756,7 +756,7 @@ fz_render_t3_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, fz_co bbox.x1++; bbox.y1++; - glyph = fz_new_pixmap_with_rect(ctx, model ? model : fz_device_gray, bbox); + glyph = fz_new_pixmap_with_bbox(ctx, model ? model : fz_device_gray, bbox); fz_clear_pixmap(ctx, glyph); ctm = fz_concat(font->t3matrix, trm); @@ -808,7 +808,7 @@ fz_render_t3_glyph_direct(fz_context *ctx, fz_device *dev, fz_font *font, int gi } void -fz_debug_font(fz_context *ctx, fz_font *font) +fz_print_font(fz_context *ctx, fz_font *font) { printf("font '%s' {\n", font->name); diff --git a/fitz/res_halftone.c b/fitz/res_halftone.c index ec26571e..daad6e37 100644 --- a/fitz/res_halftone.c +++ b/fitz/res_halftone.c @@ -56,7 +56,7 @@ static unsigned char mono_ht[] = 0xF2, 0x72, 0xD2, 0x52, 0xFA, 0x7A, 0xDA, 0x5A, 0xF0, 0x70, 0xD0, 0x50, 0xF8, 0x78, 0xD8, 0x58 }; -fz_halftone *fz_get_default_halftone(fz_context *ctx, int num_comps) +fz_halftone *fz_default_halftone(fz_context *ctx, int num_comps) { fz_halftone *ht = fz_new_halftone(ctx, num_comps); assert(num_comps == 1); /* Only support 1 component for now */ @@ -172,7 +172,7 @@ fz_bitmap *fz_halftone_pixmap(fz_context *ctx, fz_pixmap *pix, fz_halftone *ht) n = pix->n-1; /* Remove alpha */ if (ht == NULL) { - ht = fz_get_default_halftone(ctx, n); + ht = fz_default_halftone(ctx, n); } ht_line = fz_malloc(ctx, pix->w * n); out = fz_new_bitmap(ctx, pix->w, pix->h, n); diff --git a/fitz/res_path.c b/fitz/res_path.c index 4964a09e..9c2072c1 100644 --- a/fitz/res_path.c +++ b/fitz/res_path.c @@ -316,7 +316,7 @@ fz_transform_path(fz_context *ctx, fz_path *path, fz_matrix ctm) } void -fz_debug_path(fz_context *ctx, fz_path *path, int indent) +fz_print_path(fz_context *ctx, fz_path *path, int indent) { float x, y; int i = 0; diff --git a/fitz/res_pixmap.c b/fitz/res_pixmap.c index 7aaf8ce0..11875ad1 100644 --- a/fitz/res_pixmap.c +++ b/fitz/res_pixmap.c @@ -80,7 +80,7 @@ fz_new_pixmap(fz_context *ctx, fz_colorspace *colorspace, int w, int h) } fz_pixmap * -fz_new_pixmap_with_rect(fz_context *ctx, fz_colorspace *colorspace, fz_bbox r) +fz_new_pixmap_with_bbox(fz_context *ctx, fz_colorspace *colorspace, fz_bbox r) { fz_pixmap *pixmap; pixmap = fz_new_pixmap(ctx, colorspace, r.x1 - r.x0, r.y1 - r.y0); @@ -90,7 +90,7 @@ fz_new_pixmap_with_rect(fz_context *ctx, fz_colorspace *colorspace, fz_bbox r) } fz_pixmap * -fz_new_pixmap_with_rect_and_data(fz_context *ctx, fz_colorspace *colorspace, fz_bbox r, unsigned char *samples) +fz_new_pixmap_with_bbox_and_data(fz_context *ctx, fz_colorspace *colorspace, fz_bbox r, unsigned char *samples) { fz_pixmap *pixmap; pixmap = fz_new_pixmap_with_data(ctx, colorspace, r.x1 - r.x0, r.y1 - r.y0, samples); @@ -261,7 +261,7 @@ fz_alpha_from_gray(fz_context *ctx, fz_pixmap *gray, int luminosity) assert(gray->n == 2); - alpha = fz_new_pixmap_with_rect(ctx, NULL, fz_bound_pixmap(gray)); + alpha = fz_new_pixmap_with_bbox(ctx, NULL, fz_bound_pixmap(gray)); dp = alpha->samples; sp = gray->samples; if (!luminosity) diff --git a/fitz/res_shade.c b/fitz/res_shade.c index f8f11a81..59e3887e 100644 --- a/fitz/res_shade.c +++ b/fitz/res_shade.c @@ -68,7 +68,7 @@ fz_bound_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm) } void -fz_debug_shade(fz_context *ctx, fz_shade *shade) +fz_print_shade(fz_context *ctx, fz_shade *shade) { int i, j, n; float *vertex; diff --git a/fitz/res_store.c b/fitz/res_store.c index e85aead9..1de4f240 100644 --- a/fitz/res_store.c +++ b/fitz/res_store.c @@ -453,7 +453,7 @@ fz_drop_store_context(fz_context *ctx) } void -fz_debug_store(fz_context *ctx) +fz_print_store(fz_context *ctx) { fz_item *item, *next; fz_store *store = ctx->store; @@ -521,7 +521,7 @@ int fz_store_scavenge(fz_context *ctx, unsigned int size, int *phase) #ifdef DEBUG_SCAVENGING printf("Scavenging: store=%d size=%d phase=%d\n", store->size, size, *phase); - fz_debug_store(ctx); + fz_print_store(ctx); Memento_stats(); #endif do @@ -549,7 +549,7 @@ int fz_store_scavenge(fz_context *ctx, unsigned int size, int *phase) { #ifdef DEBUG_SCAVENGING printf("scavenged: store=%d\n", store->size); - fz_debug_store(ctx); + fz_print_store(ctx); Memento_stats(); #endif return 1; @@ -559,7 +559,7 @@ int fz_store_scavenge(fz_context *ctx, unsigned int size, int *phase) #ifdef DEBUG_SCAVENGING printf("scavenging failed\n"); - fz_debug_store(ctx); + fz_print_store(ctx); Memento_listBlocks(); #endif return 0; diff --git a/fitz/res_text.c b/fitz/res_text.c index 433ff8f9..43b4471a 100644 --- a/fitz/res_text.c +++ b/fitz/res_text.c @@ -123,7 +123,7 @@ static int isxmlmeta(int c) return c < 32 || c >= 128 || c == '&' || c == '<' || c == '>' || c == '\'' || c == '"'; } -void fz_debug_text(fz_context *ctx, fz_text *text, int indent) +void fz_print_text(fz_context *ctx, fz_text *text, int indent) { int i, n; for (i = 0; i < text->len; i++) @@ -216,7 +216,7 @@ static UIImage *renderPage(struct document *doc, int number, CGSize screenSize) ctm = fz_scale(scale.width, scale.height); bbox = (fz_bbox){0, 0, pageSize.width * scale.width, pageSize.height * scale.height}; - pix = fz_new_pixmap_with_rect(ctx, fz_device_rgb, bbox); + pix = fz_new_pixmap_with_bbox(ctx, fz_device_rgb, bbox); fz_clear_pixmap_with_value(ctx, pix, 255); dev = fz_new_draw_device(ctx, pix); @@ -253,7 +253,7 @@ static UIImage *renderTile(struct document *doc, int number, CGSize screenSize, rect.y1 = tileRect.origin.y + tileRect.size.height; bbox = fz_round_rect(rect); - pix = fz_new_pixmap_with_rect(ctx, fz_device_rgb, bbox); + pix = fz_new_pixmap_with_bbox(ctx, fz_device_rgb, bbox); fz_clear_pixmap_with_value(ctx, pix, 255); dev = fz_new_draw_device(ctx, pix); diff --git a/pdf/base_object.c b/pdf/base_object.c index 1dc07f1a..460b89f2 100644 --- a/pdf/base_object.c +++ b/pdf/base_object.c @@ -1254,13 +1254,13 @@ pdf_fprint_obj(FILE *fp, pdf_obj *obj, int tight) } void -pdf_debug_obj(pdf_obj *obj) +pdf_print_obj(pdf_obj *obj) { pdf_fprint_obj(stdout, obj, 0); } void -pdf_debug_ref(pdf_obj *ref) +pdf_print_ref(pdf_obj *ref) { - pdf_debug_obj(pdf_resolve_indirect(ref)); + pdf_print_obj(pdf_resolve_indirect(ref)); } diff --git a/pdf/mupdf-internal.h b/pdf/mupdf-internal.h index faec16b5..3e4a4729 100644 --- a/pdf/mupdf-internal.h +++ b/pdf/mupdf-internal.h @@ -201,7 +201,7 @@ fz_stream *pdf_open_image_decomp_stream(fz_context *ctx, fz_buffer *, pdf_image_ void pdf_repair_xref(pdf_document *doc, pdf_lexbuf *buf); void pdf_repair_obj_stms(pdf_document *doc); -void pdf_debug_xref(pdf_document *); +void pdf_print_xref(pdf_document *); void pdf_resize_xref(pdf_document *doc, int newcap); /* @@ -215,12 +215,12 @@ void pdf_crypt_obj(fz_context *ctx, pdf_crypt *crypt, pdf_obj *obj, int num, int fz_stream *pdf_open_crypt(fz_stream *chain, pdf_crypt *crypt, int num, int gen); fz_stream *pdf_open_crypt_with_filter(fz_stream *chain, pdf_crypt *crypt, char *name, int num, int gen); -int pdf_get_crypt_revision(pdf_document *doc); -char *pdf_get_crypt_method(pdf_document *doc); -int pdf_get_crypt_length(pdf_document *doc); -unsigned char *pdf_get_crypt_key(pdf_document *doc); +int pdf_crypt_revision(pdf_document *doc); +char *pdf_crypt_method(pdf_document *doc); +int pdf_crypt_length(pdf_document *doc); +unsigned char *pdf_crypt_key(pdf_document *doc); -void pdf_debug_crypt(pdf_crypt *crypt); +void pdf_print_crypt(pdf_crypt *crypt); /* * Functions, Colorspaces, Shadings and Images @@ -338,9 +338,9 @@ void pdf_drop_cmap(fz_context *ctx, pdf_cmap *cmap); void pdf_free_cmap_imp(fz_context *ctx, fz_storable *cmap); unsigned int pdf_cmap_size(fz_context *ctx, pdf_cmap *cmap); -void pdf_debug_cmap(fz_context *ctx, pdf_cmap *cmap); -int pdf_get_wmode(fz_context *ctx, pdf_cmap *cmap); -void pdf_set_wmode(fz_context *ctx, pdf_cmap *cmap, int wmode); +void pdf_print_cmap(fz_context *ctx, pdf_cmap *cmap); +int pdf_cmap_wmode(fz_context *ctx, pdf_cmap *cmap); +void pdf_set_cmap_wmode(fz_context *ctx, pdf_cmap *cmap, int wmode); void pdf_set_usecmap(fz_context *ctx, pdf_cmap *cmap, pdf_cmap *usecmap); void pdf_add_codespace(fz_context *ctx, pdf_cmap *cmap, int low, int high, int n); @@ -456,16 +456,16 @@ void pdf_add_hmtx(fz_context *ctx, pdf_font_desc *font, int lo, int hi, int w); void pdf_add_vmtx(fz_context *ctx, pdf_font_desc *font, int lo, int hi, int x, int y, int w); void pdf_end_hmtx(fz_context *ctx, pdf_font_desc *font); void pdf_end_vmtx(fz_context *ctx, pdf_font_desc *font); -pdf_hmtx pdf_get_hmtx(fz_context *ctx, pdf_font_desc *font, int cid); -pdf_vmtx pdf_get_vmtx(fz_context *ctx, pdf_font_desc *font, int cid); +pdf_hmtx pdf_lookup_hmtx(fz_context *ctx, pdf_font_desc *font, int cid); +pdf_vmtx pdf_lookup_vmtx(fz_context *ctx, pdf_font_desc *font, int cid); void pdf_load_to_unicode(pdf_document *doc, pdf_font_desc *font, char **strings, char *collection, pdf_obj *cmapstm); int pdf_font_cid_to_gid(fz_context *ctx, pdf_font_desc *fontdesc, int cid); -unsigned char *pdf_find_builtin_font(char *name, unsigned int *len); -unsigned char *pdf_find_substitute_font(int mono, int serif, int bold, int italic, unsigned int *len); -unsigned char *pdf_find_substitute_cjk_font(int ros, int serif, unsigned int *len); +unsigned char *pdf_lookup_builtin_font(char *name, unsigned int *len); +unsigned char *pdf_lookup_substitute_font(int mono, int serif, int bold, int italic, unsigned int *len); +unsigned char *pdf_lookup_substitute_cjk_font(int ros, int serif, unsigned int *len); pdf_font_desc *pdf_load_type3_font(pdf_document *doc, pdf_obj *rdb, pdf_obj *obj); pdf_font_desc *pdf_load_font(pdf_document *doc, pdf_obj *rdb, pdf_obj *obj); @@ -474,7 +474,7 @@ pdf_font_desc *pdf_new_font_desc(fz_context *ctx); pdf_font_desc *pdf_keep_font(fz_context *ctx, pdf_font_desc *fontdesc); void pdf_drop_font(fz_context *ctx, pdf_font_desc *font); -void pdf_debug_font(fz_context *ctx, pdf_font_desc *fontdesc); +void pdf_print_font(fz_context *ctx, pdf_font_desc *fontdesc); /* * Interactive features diff --git a/pdf/mupdf.h b/pdf/mupdf.h index 7566bc36..b88f7423 100644 --- a/pdf/mupdf.h +++ b/pdf/mupdf.h @@ -79,8 +79,8 @@ void pdf_dict_dels(pdf_obj *dict, char *key); void pdf_sort_dict(pdf_obj *dict); int pdf_fprint_obj(FILE *fp, pdf_obj *obj, int tight); -void pdf_debug_obj(pdf_obj *obj); -void pdf_debug_ref(pdf_obj *obj); +void pdf_print_obj(pdf_obj *obj); +void pdf_print_ref(pdf_obj *obj); char *pdf_to_utf8(fz_context *ctx, pdf_obj *src); unsigned short *pdf_to_ucs2(fz_context *ctx, pdf_obj *src); /* sumatrapdf */ @@ -164,7 +164,7 @@ int pdf_has_permission(pdf_document *doc, int p); typedef struct pdf_page_s pdf_page; -int pdf_find_page_number(pdf_document *doc, pdf_obj *pageobj); +int pdf_lookup_page_number(pdf_document *doc, pdf_obj *pageobj); int pdf_count_pages(pdf_document *doc); /* diff --git a/pdf/pdf_annot.c b/pdf/pdf_annot.c index bd0ad808..28300c9b 100644 --- a/pdf/pdf_annot.c +++ b/pdf/pdf_annot.c @@ -60,7 +60,7 @@ pdf_parse_link_dest(pdf_document *xref, pdf_obj *dest) if (pdf_is_int(obj)) ld.ld.gotor.page = pdf_to_int(obj); else - ld.ld.gotor.page = pdf_find_page_number(xref, obj); + ld.ld.gotor.page = pdf_lookup_page_number(xref, obj); ld.kind = FZ_LINK_GOTO; ld.ld.gotor.flags = 0; diff --git a/pdf/pdf_cmap.c b/pdf/pdf_cmap.c index 712ebfe7..3c4d07bc 100644 --- a/pdf/pdf_cmap.c +++ b/pdf/pdf_cmap.c @@ -98,19 +98,19 @@ pdf_set_usecmap(fz_context *ctx, pdf_cmap *cmap, pdf_cmap *usecmap) } int -pdf_get_wmode(fz_context *ctx, pdf_cmap *cmap) +pdf_cmap_wmode(fz_context *ctx, pdf_cmap *cmap) { return cmap->wmode; } void -pdf_set_wmode(fz_context *ctx, pdf_cmap *cmap, int wmode) +pdf_set_cmap_wmode(fz_context *ctx, pdf_cmap *cmap, int wmode) { cmap->wmode = wmode; } void -pdf_debug_cmap(fz_context *ctx, pdf_cmap *cmap) +pdf_print_cmap(fz_context *ctx, pdf_cmap *cmap) { int i, k, n; diff --git a/pdf/pdf_cmap_load.c b/pdf/pdf_cmap_load.c index 6867d845..8ab7e646 100644 --- a/pdf/pdf_cmap_load.c +++ b/pdf/pdf_cmap_load.c @@ -47,7 +47,7 @@ pdf_load_embedded_cmap(pdf_document *xref, pdf_obj *stmobj) wmode = pdf_dict_gets(stmobj, "WMode"); if (pdf_is_int(wmode)) - pdf_set_wmode(ctx, cmap, pdf_to_int(wmode)); + pdf_set_cmap_wmode(ctx, cmap, pdf_to_int(wmode)); obj = pdf_dict_gets(stmobj, "UseCMap"); if (pdf_is_name(obj)) { @@ -97,7 +97,7 @@ pdf_new_identity_cmap(fz_context *ctx, int wmode, int bytes) pdf_add_codespace(ctx, cmap, 0x0000, 0xffff, bytes); pdf_map_range_to_range(ctx, cmap, 0x0000, 0xffff, 0); pdf_sort_cmap(ctx, cmap); - pdf_set_wmode(ctx, cmap, wmode); + pdf_set_cmap_wmode(ctx, cmap, wmode); } fz_catch(ctx) { diff --git a/pdf/pdf_cmap_parse.c b/pdf/pdf_cmap_parse.c index 3396e3ae..93dd97c9 100644 --- a/pdf/pdf_cmap_parse.c +++ b/pdf/pdf_cmap_parse.c @@ -88,7 +88,7 @@ pdf_parse_wmode(fz_context *ctx, pdf_cmap *cmap, fz_stream *file) /* RJW: Lost debugging: "syntaxerror in cmap" */ if (tok == PDF_TOK_INT) - pdf_set_wmode(ctx, cmap, buf.i); + pdf_set_cmap_wmode(ctx, cmap, buf.i); else fz_warn(ctx, "expected integer after WMode in cmap"); } diff --git a/pdf/pdf_colorspace.c b/pdf/pdf_colorspace.c index 5bf84535..f195fa08 100644 --- a/pdf/pdf_colorspace.c +++ b/pdf/pdf_colorspace.c @@ -193,7 +193,7 @@ pdf_expand_indexed_pixmap(fz_context *ctx, fz_pixmap *src) lookup = idx->lookup; n = idx->base->n; - dst = fz_new_pixmap_with_rect(ctx, idx->base, fz_bound_pixmap(src)); + dst = fz_new_pixmap_with_bbox(ctx, idx->base, fz_bound_pixmap(src)); s = src->samples; d = dst->samples; diff --git a/pdf/pdf_crypt.c b/pdf/pdf_crypt.c index 2927527e..b65786d9 100644 --- a/pdf/pdf_crypt.c +++ b/pdf/pdf_crypt.c @@ -618,7 +618,7 @@ pdf_has_permission(pdf_document *xref, int p) } unsigned char * -pdf_get_crypt_key(pdf_document *xref) +pdf_crypt_key(pdf_document *xref) { if (xref->crypt) return xref->crypt->key; @@ -626,7 +626,7 @@ pdf_get_crypt_key(pdf_document *xref) } int -pdf_get_crypt_revision(pdf_document *xref) +pdf_crypt_revision(pdf_document *xref) { if (xref->crypt) return xref->crypt->v; @@ -634,7 +634,7 @@ pdf_get_crypt_revision(pdf_document *xref) } char * -pdf_get_crypt_method(pdf_document *xref) +pdf_crypt_method(pdf_document *xref) { if (xref->crypt) { @@ -651,7 +651,7 @@ pdf_get_crypt_method(pdf_document *xref) } int -pdf_get_crypt_length(pdf_document *xref) +pdf_crypt_length(pdf_document *xref) { if (xref->crypt) return xref->crypt->length; @@ -822,7 +822,7 @@ pdf_open_crypt_with_filter(fz_stream *chain, pdf_crypt *crypt, char *name, int n return chain; } -void pdf_debug_crypt(pdf_crypt *crypt) +void pdf_print_crypt(pdf_crypt *crypt) { int i; diff --git a/pdf/pdf_font.c b/pdf/pdf_font.c index 11c97d37..ab60af72 100644 --- a/pdf/pdf_font.c +++ b/pdf/pdf_font.c @@ -178,7 +178,7 @@ pdf_load_builtin_font(fz_context *ctx, pdf_font_desc *fontdesc, char *fontname) unsigned char *data; unsigned int len; - data = pdf_find_builtin_font(fontname, &len); + data = pdf_lookup_builtin_font(fontname, &len); if (!data) fz_throw(ctx, "cannot find builtin font: '%s'", fontname); @@ -195,7 +195,7 @@ pdf_load_substitute_font(fz_context *ctx, pdf_font_desc *fontdesc, int mono, int unsigned char *data; unsigned int len; - data = pdf_find_substitute_font(mono, serif, bold, italic, &len); + data = pdf_lookup_substitute_font(mono, serif, bold, italic, &len); if (!data) fz_throw(ctx, "cannot find substitute font"); @@ -213,7 +213,7 @@ pdf_load_substitute_cjk_font(fz_context *ctx, pdf_font_desc *fontdesc, int ros, unsigned char *data; unsigned int len; - data = pdf_find_substitute_cjk_font(ros, serif, &len); + data = pdf_lookup_substitute_cjk_font(ros, serif, &len); if (!data) fz_throw(ctx, "cannot find builtin CJK font"); @@ -789,7 +789,7 @@ load_cid_font(pdf_document *xref, pdf_obj *dict, pdf_obj *encoding, pdf_obj *to_ } fontdesc->size += pdf_cmap_size(ctx, fontdesc->encoding); - pdf_set_font_wmode(ctx, fontdesc, pdf_get_wmode(ctx, fontdesc->encoding)); + pdf_set_font_wmode(ctx, fontdesc, pdf_cmap_wmode(ctx, fontdesc->encoding)); if (kind == TRUETYPE) { @@ -881,7 +881,7 @@ load_cid_font(pdf_document *xref, pdf_obj *dict, pdf_obj *encoding, pdf_obj *to_ /* Vertical */ - if (pdf_get_wmode(ctx, fontdesc->encoding) == 1) + if (pdf_cmap_wmode(ctx, fontdesc->encoding) == 1) { int dw2y = 880; int dw2w = -1000; @@ -1127,7 +1127,7 @@ pdf_load_font(pdf_document *xref, pdf_obj *rdb, pdf_obj *dict) } void -pdf_debug_font(fz_context *ctx, pdf_font_desc *fontdesc) +pdf_print_font(fz_context *ctx, pdf_font_desc *fontdesc) { int i; diff --git a/pdf/pdf_fontfile.c b/pdf/pdf_fontfile.c index 4dbbe91c..b67d8a32 100644 --- a/pdf/pdf_fontfile.c +++ b/pdf/pdf_fontfile.c @@ -16,7 +16,7 @@ #endif unsigned char * -pdf_find_builtin_font(char *name, unsigned int *len) +pdf_lookup_builtin_font(char *name, unsigned int *len) { if (!strcmp("Courier", name)) { *len = sizeof pdf_font_NimbusMonL_Regu; @@ -79,32 +79,32 @@ pdf_find_builtin_font(char *name, unsigned int *len) } unsigned char * -pdf_find_substitute_font(int mono, int serif, int bold, int italic, unsigned int *len) +pdf_lookup_substitute_font(int mono, int serif, int bold, int italic, unsigned int *len) { #ifdef NODROIDFONT if (mono) { if (bold) { - if (italic) return pdf_find_builtin_font("Courier-BoldOblique", len); - else return pdf_find_builtin_font("Courier-Bold", len); + if (italic) return pdf_lookup_builtin_font("Courier-BoldOblique", len); + else return pdf_lookup_builtin_font("Courier-Bold", len); } else { - if (italic) return pdf_find_builtin_font("Courier-Oblique", len); - else return pdf_find_builtin_font("Courier", len); + if (italic) return pdf_lookup_builtin_font("Courier-Oblique", len); + else return pdf_lookup_builtin_font("Courier", len); } } else if (serif) { if (bold) { - if (italic) return pdf_find_builtin_font("Times-BoldItalic", len); - else return pdf_find_builtin_font("Times-Bold", len); + if (italic) return pdf_lookup_builtin_font("Times-BoldItalic", len); + else return pdf_lookup_builtin_font("Times-Bold", len); } else { - if (italic) return pdf_find_builtin_font("Times-Italic", len); - else return pdf_find_builtin_font("Times-Roman", len); + if (italic) return pdf_lookup_builtin_font("Times-Italic", len); + else return pdf_lookup_builtin_font("Times-Roman", len); } } else { if (bold) { - if (italic) return pdf_find_builtin_font("Helvetica-BoldOblique", len); - else return pdf_find_builtin_font("Helvetica-Bold", len); + if (italic) return pdf_lookup_builtin_font("Helvetica-BoldOblique", len); + else return pdf_lookup_builtin_font("Helvetica-Bold", len); } else { - if (italic) return pdf_find_builtin_font("Helvetica-Oblique", len); - else return pdf_find_builtin_font("Helvetica", len); + if (italic) return pdf_lookup_builtin_font("Helvetica-Oblique", len); + else return pdf_lookup_builtin_font("Helvetica", len); } } #else @@ -119,7 +119,7 @@ pdf_find_substitute_font(int mono, int serif, int bold, int italic, unsigned int } unsigned char * -pdf_find_substitute_cjk_font(int ros, int serif, unsigned int *len) +pdf_lookup_substitute_cjk_font(int ros, int serif, unsigned int *len) { #ifndef NOCJKFONT *len = sizeof pdf_font_DroidSansFallback; diff --git a/pdf/pdf_interpret.c b/pdf/pdf_interpret.c index 1c2a11f3..3888b35f 100644 --- a/pdf/pdf_interpret.c +++ b/pdf/pdf_interpret.c @@ -709,7 +709,7 @@ pdf_show_char(pdf_csi *csi, int cid) if (fontdesc->wmode == 1) { - v = pdf_get_vmtx(ctx, fontdesc, cid); + v = pdf_lookup_vmtx(ctx, fontdesc, cid); tsm.e -= v.x * gstate->size * 0.001f; tsm.f -= v.y * gstate->size * 0.001f; } @@ -767,7 +767,7 @@ pdf_show_char(pdf_csi *csi, int cid) if (fontdesc->wmode == 0) { - h = pdf_get_hmtx(ctx, fontdesc, cid); + h = pdf_lookup_hmtx(ctx, fontdesc, cid); w0 = h.w * 0.001f; tx = (w0 * gstate->size + gstate->char_space) * gstate->scale; csi->tm = fz_concat(fz_translate(tx, 0), csi->tm); @@ -1527,7 +1527,7 @@ pdf_run_extgstate(pdf_csi *csi, pdf_obj *rdb, pdf_obj *extgstate) { if (pdf_is_array(val)) val = pdf_array_get(val, 0); - gstate->blendmode = fz_find_blendmode(pdf_to_name(val)); + gstate->blendmode = fz_lookup_blendmode(pdf_to_name(val)); } else if (!strcmp(s, "SMask")) diff --git a/pdf/pdf_metrics.c b/pdf/pdf_metrics.c index ae4405ed..888757c0 100644 --- a/pdf/pdf_metrics.c +++ b/pdf/pdf_metrics.c @@ -85,7 +85,7 @@ pdf_end_vmtx(fz_context *ctx, pdf_font_desc *font) } pdf_hmtx -pdf_get_hmtx(fz_context *ctx, pdf_font_desc *font, int cid) +pdf_lookup_hmtx(fz_context *ctx, pdf_font_desc *font, int cid) { int l = 0; int r = font->hmtx_len - 1; @@ -110,7 +110,7 @@ notfound: } pdf_vmtx -pdf_get_vmtx(fz_context *ctx, pdf_font_desc *font, int cid) +pdf_lookup_vmtx(fz_context *ctx, pdf_font_desc *font, int cid) { pdf_hmtx h; pdf_vmtx v; @@ -133,7 +133,7 @@ pdf_get_vmtx(fz_context *ctx, pdf_font_desc *font, int cid) } notfound: - h = pdf_get_hmtx(ctx, font, cid); + h = pdf_lookup_hmtx(ctx, font, cid); v = font->dvmtx; v.x = h.w / 2; return v; diff --git a/pdf/pdf_page.c b/pdf/pdf_page.c index 5b9106d1..c4083d20 100644 --- a/pdf/pdf_page.c +++ b/pdf/pdf_page.c @@ -140,7 +140,7 @@ pdf_count_pages(pdf_document *xref) } int -pdf_find_page_number(pdf_document *xref, pdf_obj *page) +pdf_lookup_page_number(pdf_document *xref, pdf_obj *page) { int i, num = pdf_to_num(page); diff --git a/pdf/pdf_store.c b/pdf/pdf_store.c index ae8eac9a..2a3b8b07 100644 --- a/pdf/pdf_store.c +++ b/pdf/pdf_store.c @@ -40,7 +40,7 @@ pdf_debug_key(void *key_) { printf("(%d %d R) ", pdf_to_num(key), pdf_to_gen(key)); } else - pdf_debug_obj(key); + pdf_print_obj(key); } static fz_store_type pdf_obj_store_type = diff --git a/pdf/pdf_xref.c b/pdf/pdf_xref.c index 9e60955c..e0e9f190 100644 --- a/pdf/pdf_xref.c +++ b/pdf/pdf_xref.c @@ -843,7 +843,7 @@ pdf_close_document(pdf_document *xref) } void -pdf_debug_xref(pdf_document *xref) +pdf_print_xref(pdf_document *xref) { int i; printf("xref\n0 %d\n", xref->len); diff --git a/scripts/rename3.sed b/scripts/rename3.sed new file mode 100644 index 00000000..41868e01 --- /dev/null +++ b/scripts/rename3.sed @@ -0,0 +1,37 @@ +s/\<fz_save_pixmap\>/fz_write_pixmap/g +s/\<fz_debug_hash\>/fz_print_hash/g +s/\<fz_debug_store\>/fz_print_store/g +s/\<fz_debug_font\>/fz_print_font/g +s/\<fz_debug_path\>/fz_print_path/g +s/\<fz_debug_text\>/fz_print_text/g +s/\<fz_debug_shade\>/fz_print_shade/g +s/\<fz_debug_outline_xml\>/fz_print_outline_xml/g +s/\<fz_debug_outline\>/fz_print_outline/g +s/\<pdf_debug_xref\>/pdf_print_xref/g +s/\<pdf_debug_crypt\>/pdf_print_crypt/g +s/\<pdf_debug_cmap\>/pdf_print_cmap/g +s/\<pdf_debug_font\>/pdf_print_font/g +s/\<pdf_debug_obj\>/pdf_print_obj/g +s/\<pdf_debug_ref\>/pdf_print_ref/g +s/\<xps_debug_page_list\>/xps_print_page_list/g +s/\<xps_debug_path\>/xps_print_path/g +s/\<xps_debug_resource_dictionary\>/xps_print_resource_dictionary/g +s/\<fz_get_default_halftone\>/fz_default_halftone/g +s/\<fz_get_aa_level\>/fz_aa_level/g +s/\<fz_pixmap_pixels\>/fz_pixmap_samples/g +s/\<pdf_get_crypt_revision\>/pdf_crypt_revision/g +s/\<pdf_get_crypt_method\>/pdf_crypt_method/g +s/\<pdf_get_crypt_length\>/pdf_crypt_length/g +s/\<pdf_get_crypt_key\>/pdf_crypt_key/g +s/\<pdf_set_wmode\>/pdf_set_cmap_wmode/g +s/\<pdf_get_wmode\>/pdf_cmap_wmode/g +s/\<pdf_get_hmtx\>/pdf_lookup_hmtx/g +s/\<pdf_get_vmtx\>/pdf_lookup_vmtx/g +s/\<fz_find_blendmode\>/fz_lookup_blendmode/g +s/\<pdf_find_page_number\>/pdf_lookup_page_number/g +s/\<xps_find_link_target\>/xps_lookup_link_target/g +s/\<pdf_find_builtin_font\>/pdf_lookup_builtin_font/g +s/\<pdf_find_substitute_font\>/pdf_lookup_substitute_font/g +s/\<pdf_find_substitute_cjk_font\>/pdf_lookup_substitute_cjk_font/g +s/\<fz_new_pixmap_with_rect_and_data\>/fz_new_pixmap_with_bbox_and_data/g +s/\<fz_new_pixmap_with_rect\>/fz_new_pixmap_with_bbox/g diff --git a/xps/muxps-internal.h b/xps/muxps-internal.h index 3084bdfa..20bab4c1 100644 --- a/xps/muxps-internal.h +++ b/xps/muxps-internal.h @@ -86,7 +86,7 @@ struct xps_target_s }; void xps_read_page_list(xps_document *doc); -void xps_debug_page_list(xps_document *doc); +void xps_print_page_list(xps_document *doc); void xps_free_page_list(xps_document *doc); int xps_count_pages(xps_document *doc); @@ -97,7 +97,7 @@ void xps_free_page(xps_document *doc, xps_page *page); fz_outline *xps_load_outline(xps_document *doc); -int xps_find_link_target(xps_document *doc, char *target_uri); +int xps_lookup_link_target(xps_document *doc, char *target_uri); void xps_add_link(xps_document *doc, fz_rect area, char *base_uri, char *target_uri); /* * Images, fonts, and colorspaces. @@ -126,7 +126,7 @@ int xps_encode_font_char(fz_font *font, int key); void xps_measure_font_glyph(xps_document *doc, fz_font *font, int gid, xps_glyph_metrics *mtx); -void xps_debug_path(xps_document *doc); +void xps_print_path(xps_document *doc); void xps_parse_color(xps_document *doc, char *base_uri, char *hexstring, fz_colorspace **csp, float *samples); void xps_set_color(xps_document *doc, fz_colorspace *colorspace, float *samples); @@ -151,7 +151,7 @@ xps_resource * xps_parse_resource_dictionary(xps_document *doc, char *base_uri, void xps_free_resource_dictionary(xps_document *doc, xps_resource *dict); void xps_resolve_resource_reference(xps_document *doc, xps_resource *dict, char **attp, xml_element **tagp, char **urip); -void xps_debug_resource_dictionary(xps_resource *dict); +void xps_print_resource_dictionary(xps_resource *dict); /* * Fixed page/graphics parsing. diff --git a/xps/xps_doc.c b/xps/xps_doc.c index 9988691f..a2665f95 100644 --- a/xps/xps_doc.c +++ b/xps/xps_doc.c @@ -20,7 +20,7 @@ xps_rels_for_part(char *buf, char *name, int buflen) */ void -xps_debug_page_list(xps_document *doc) +xps_print_page_list(xps_document *doc) { xps_fixdoc *fixdoc = doc->first_fixdoc; xps_page *page = doc->first_page; @@ -192,7 +192,7 @@ xps_add_link_target(xps_document *doc, char *name) } int -xps_find_link_target(xps_document *doc, char *target_uri) +xps_lookup_link_target(xps_document *doc, char *target_uri) { xps_target *target; char *needle = strrchr(target_uri, '#'); diff --git a/xps/xps_outline.c b/xps/xps_outline.c index 60e2f779..6bf7fd14 100644 --- a/xps/xps_outline.c +++ b/xps/xps_outline.c @@ -34,7 +34,7 @@ xps_parse_document_outline(xps_document *doc, xml_element *root) entry->title = fz_strdup(doc->ctx, description); entry->dest.kind = FZ_LINK_GOTO; entry->dest.ld.gotor.flags = 0; - entry->dest.ld.gotor.page = xps_find_link_target(doc, target); + entry->dest.ld.gotor.page = xps_lookup_link_target(doc, target); entry->down = NULL; entry->next = NULL; diff --git a/xps/xps_resource.c b/xps/xps_resource.c index 099f378d..aa3cdc75 100644 --- a/xps/xps_resource.c +++ b/xps/xps_resource.c @@ -141,7 +141,7 @@ xps_free_resource_dictionary(xps_document *doc, xps_resource *dict) } void -xps_debug_resource_dictionary(xps_resource *dict) +xps_print_resource_dictionary(xps_resource *dict) { while (dict) { @@ -151,7 +151,7 @@ xps_debug_resource_dictionary(xps_resource *dict) if (dict->parent) { printf("PARENT = {\n"); - xps_debug_resource_dictionary(dict->parent); + xps_print_resource_dictionary(dict->parent); printf("}\n"); } dict = dict->next; |