summaryrefslogtreecommitdiff
path: root/pdf/pdf_cmap_load.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-02-26 11:15:16 -0800
committerRobin Watts <robin@ghostscript.com>2012-02-26 19:36:30 +0000
commitbbfe635555dce16858403706e2031dd3bfa1a9f1 (patch)
tree6e414005f04f233a83dbeec5607c0665a6d498bc /pdf/pdf_cmap_load.c
parentca578b08dc1243dc6cbb3235272d52d9e2336925 (diff)
downloadmupdf-bbfe635555dce16858403706e2031dd3bfa1a9f1.tar.xz
Move fz_obj to be pdf_obj.
Currently, we are in the slightly strange position of having the PDF specific object types as part of fitz. Here we pull them out into the pdf layer instead. This has been made possible by the recent changes to make the store no longer be tied to having fz_obj's as keys. Most of this work is a simple huge rename; to help customers who may have code that use such functions we have provided a sed script to do the renaming; scripts/rename2.sed. Various other small tweaks are required; the store used to have some debugging code that still required knowledge of fz_obj types - we extract that into a nicer 'type' based function pointer. Also, the type 3 font handling used to have an fz_obj pointer for type 3 resources, and therefore needed to know how to free this; this has become a void * with a function to free it.
Diffstat (limited to 'pdf/pdf_cmap_load.c')
-rw-r--r--pdf/pdf_cmap_load.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/pdf/pdf_cmap_load.c b/pdf/pdf_cmap_load.c
index 9e6b13ce..d4e161c8 100644
--- a/pdf/pdf_cmap_load.c
+++ b/pdf/pdf_cmap_load.c
@@ -16,13 +16,13 @@ pdf_cmap_size(fz_context *ctx, pdf_cmap *cmap)
* Load CMap stream in PDF file
*/
pdf_cmap *
-pdf_load_embedded_cmap(pdf_document *xref, fz_obj *stmobj)
+pdf_load_embedded_cmap(pdf_document *xref, pdf_obj *stmobj)
{
fz_stream *file = NULL;
pdf_cmap *cmap = NULL;
pdf_cmap *usecmap;
- fz_obj *wmode;
- fz_obj *obj = NULL;
+ pdf_obj *wmode;
+ pdf_obj *obj = NULL;
fz_context *ctx = xref->ctx;
int phase = 0;
@@ -38,24 +38,24 @@ pdf_load_embedded_cmap(pdf_document *xref, fz_obj *stmobj)
fz_try(ctx)
{
- file = pdf_open_stream(xref, fz_to_num(stmobj), fz_to_gen(stmobj));
+ file = pdf_open_stream(xref, pdf_to_num(stmobj), pdf_to_gen(stmobj));
phase = 1;
cmap = pdf_load_cmap(ctx, file);
phase = 2;
fz_close(file);
file = NULL;
- wmode = fz_dict_gets(stmobj, "WMode");
- if (fz_is_int(wmode))
- pdf_set_wmode(ctx, cmap, fz_to_int(wmode));
- obj = fz_dict_gets(stmobj, "UseCMap");
- if (fz_is_name(obj))
+ wmode = pdf_dict_gets(stmobj, "WMode");
+ if (pdf_is_int(wmode))
+ pdf_set_wmode(ctx, cmap, pdf_to_int(wmode));
+ obj = pdf_dict_gets(stmobj, "UseCMap");
+ if (pdf_is_name(obj))
{
- usecmap = pdf_load_system_cmap(ctx, fz_to_name(obj));
+ usecmap = pdf_load_system_cmap(ctx, pdf_to_name(obj));
pdf_set_usecmap(ctx, cmap, usecmap);
pdf_drop_cmap(ctx, usecmap);
}
- else if (fz_is_indirect(obj))
+ else if (pdf_is_indirect(obj))
{
phase = 3;
usecmap = pdf_load_embedded_cmap(xref, obj);
@@ -72,13 +72,13 @@ pdf_load_embedded_cmap(pdf_document *xref, fz_obj *stmobj)
if (cmap)
pdf_drop_cmap(ctx, cmap);
if (phase < 1)
- fz_throw(ctx, "cannot open cmap stream (%d %d R)", fz_to_num(stmobj), fz_to_gen(stmobj));
+ fz_throw(ctx, "cannot open cmap stream (%d %d R)", pdf_to_num(stmobj), pdf_to_gen(stmobj));
else if (phase < 2)
- fz_throw(ctx, "cannot parse cmap stream (%d %d R)", fz_to_num(stmobj), fz_to_gen(stmobj));
+ fz_throw(ctx, "cannot parse cmap stream (%d %d R)", pdf_to_num(stmobj), pdf_to_gen(stmobj));
else if (phase < 3)
- fz_throw(ctx, "cannot load system usecmap '%s'", fz_to_name(obj));
+ fz_throw(ctx, "cannot load system usecmap '%s'", pdf_to_name(obj));
else
- fz_throw(ctx, "cannot load embedded usecmap (%d %d R)", fz_to_num(obj), fz_to_gen(obj));
+ fz_throw(ctx, "cannot load embedded usecmap (%d %d R)", pdf_to_num(obj), pdf_to_gen(obj));
}
return cmap;