diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2017-03-23 21:36:57 -0400 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2017-03-23 21:39:07 -0400 |
commit | ea75724276f1efabd5d78595af0d3d35f7cde659 (patch) | |
tree | 5d4ebd5169ba4154109463f7e9bfcf7462737fd6 /include | |
parent | 6979982ba2900f451c801d35bb7e52413a89d26e (diff) | |
download | mupdf-ea75724276f1efabd5d78595af0d3d35f7cde659.tar.xz |
Introduce fz_new_derived_...
Instead of having fz_new_XXXX(ctx, type, ...) macros that call
fz_new_XXXX_of_size etc, use fz_new_derived_...
Clearer naming, and doesn't clash with fz_new_document_writer.
Diffstat (limited to 'include')
-rw-r--r-- | include/mupdf/fitz/document.h | 4 | ||||
-rw-r--r-- | include/mupdf/fitz/image.h | 2 | ||||
-rw-r--r-- | include/mupdf/fitz/writer.h | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/include/mupdf/fitz/document.h b/include/mupdf/fitz/document.h index 8422b379..1f41a517 100644 --- a/include/mupdf/fitz/document.h +++ b/include/mupdf/fitz/document.h @@ -326,7 +326,7 @@ fz_document *fz_open_document_with_stream(fz_context *ctx, const char *magic, fz */ void *fz_new_document_of_size(fz_context *ctx, int size); -#define fz_new_document(C,M) ((M*)Memento_label(fz_new_document_of_size(C, sizeof(M)), #M)) +#define fz_new_derived_document(C,M) ((M*)Memento_label(fz_new_document_of_size(C, sizeof(M)), #M)) /* fz_keep_document: Keep a reference to an open document. @@ -453,7 +453,7 @@ fz_link *fz_load_links(fz_context *ctx, fz_page *page); */ fz_page *fz_new_page_of_size(fz_context *ctx, int size); -#define fz_new_page(CTX,TYPE) \ +#define fz_new_derived_page(CTX,TYPE) \ ((TYPE *)Memento_label(fz_new_page_of_size(CTX,sizeof(TYPE)),#TYPE)) /* diff --git a/include/mupdf/fitz/image.h b/include/mupdf/fitz/image.h index fe68fb31..a853f4ec 100644 --- a/include/mupdf/fitz/image.h +++ b/include/mupdf/fitz/image.h @@ -149,7 +149,7 @@ typedef size_t (fz_image_get_size_fn)(fz_context *, fz_image *); */ fz_image *fz_new_image_of_size(fz_context *ctx, int w, int h, int bpc, fz_colorspace *colorspace, int xres, int yres, int interpolate, int imagemask, float *decode, int *colorkey, fz_image *mask, int size, fz_image_get_pixmap_fn *get, fz_image_get_size_fn *get_size, fz_drop_image_fn *drop); -#define fz_new_image(CTX,W,H,B,CS,X,Y,I,IM,D,C,M,T,G,S,Z) \ +#define fz_new_derived_image(CTX,W,H,B,CS,X,Y,I,IM,D,C,M,T,G,S,Z) \ ((T*)Memento_label(fz_new_image_of_size(CTX,W,H,B,CS,X,Y,I,IM,D,C,M,sizeof(T),G,S,Z),#T)) /* diff --git a/include/mupdf/fitz/writer.h b/include/mupdf/fitz/writer.h index 608850e9..a7039097 100644 --- a/include/mupdf/fitz/writer.h +++ b/include/mupdf/fitz/writer.h @@ -22,11 +22,11 @@ struct fz_document_writer_s fz_document_writer_drop_writer_fn *drop_writer; }; -fz_document_writer *fz_new_writer_of_size(fz_context *ctx, size_t size, fz_document_writer_begin_page_fn *begin_page, +fz_document_writer *fz_new_document_writer_of_size(fz_context *ctx, size_t size, fz_document_writer_begin_page_fn *begin_page, fz_document_writer_end_page_fn *end_page, fz_document_writer_close_writer_fn *close, fz_document_writer_drop_writer_fn *drop); -#define fz_new_writer(CTX,TYPE,BEGIN_PAGE,END_PAGE,CLOSE,DROP) \ - ((TYPE *)Memento_label(fz_new_writer_of_size(CTX,sizeof(TYPE),BEGIN_PAGE,END_PAGE,CLOSE,DROP),#TYPE)) +#define fz_new_derived_document_writer(CTX,TYPE,BEGIN_PAGE,END_PAGE,CLOSE,DROP) \ + ((TYPE *)Memento_label(fz_new_document_writer_of_size(CTX,sizeof(TYPE),BEGIN_PAGE,END_PAGE,CLOSE,DROP),#TYPE)) int fz_has_option(fz_context *ctx, const char *opts, const char *key, const char **val); int fz_option_eq(const char *a, const char *b); |