summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mupdf/fitz/bidi.h97
-rw-r--r--include/mupdf/fitz/colorspace.h4
-rw-r--r--include/mupdf/fitz/context.h23
-rw-r--r--include/mupdf/fitz/crypt.h20
-rw-r--r--include/mupdf/fitz/device.h19
-rw-r--r--include/mupdf/fitz/document.h12
-rw-r--r--include/mupdf/fitz/font.h23
-rw-r--r--include/mupdf/fitz/function.h4
-rw-r--r--include/mupdf/fitz/glyph-cache.h22
-rw-r--r--include/mupdf/fitz/glyph.h2
-rw-r--r--include/mupdf/fitz/image.h4
-rw-r--r--include/mupdf/fitz/math.h35
-rw-r--r--include/mupdf/fitz/outline.h9
-rw-r--r--include/mupdf/fitz/output.h4
-rw-r--r--include/mupdf/fitz/pixmap.h7
-rw-r--r--include/mupdf/fitz/pool.h13
-rw-r--r--include/mupdf/fitz/shade.h10
-rw-r--r--include/mupdf/fitz/store.h12
-rw-r--r--include/mupdf/fitz/text.h20
-rw-r--r--include/mupdf/fitz/tree.h4
-rw-r--r--platform/win32/libmupdf.vcproj12
-rw-r--r--source/fitz/context.c2
-rw-r--r--source/fitz/device.c2
-rw-r--r--source/fitz/draw-device.c3
-rw-r--r--source/fitz/draw-glyph.c1
-rw-r--r--source/fitz/fitz-imp.h78
-rw-r--r--source/fitz/glyph-cache-imp.h25
-rw-r--r--source/fitz/halftone.c2
-rw-r--r--source/fitz/pool.c14
-rw-r--r--source/fitz/svg-device.c1
30 files changed, 279 insertions, 205 deletions
diff --git a/include/mupdf/fitz/bidi.h b/include/mupdf/fitz/bidi.h
index e5cb87ed..230f6a94 100644
--- a/include/mupdf/fitz/bidi.h
+++ b/include/mupdf/fitz/bidi.h
@@ -1,20 +1,21 @@
/*
- * Bidirectional text processing.
- *
- * Derived from the SmartOffice code, which is itself derived
- * from the example unicode standard code. Original copyright
- * messages follow:
- *
- * Copyright (C) Picsel, 2004-2008. All Rights Reserved.
- *
- * Processes Unicode text by arranging the characters into an order suitable
- * for display. E.g. Hebrew text will be arranged from right-to-left and
- * any English within the text will remain in the left-to-right order.
- *
- * This is an implementation of the Unicode Bidirectional Algorithm which
- * can be found here: http://www.unicode.org/reports/tr9/ and is based
- * on the reference implementation found on Unicode.org.
- */
+ Bidirectional text processing.
+
+ Derived from the SmartOffice code, which is itself derived
+ from the example unicode standard code. Original copyright
+ messages follow:
+
+ Copyright (C) Picsel, 2004-2008. All Rights Reserved.
+
+ Processes Unicode text by arranging the characters into an order
+ suitable for display. E.g. Hebrew text will be arranged from
+ right-to-left and any English within the text will remain in the
+ left-to-right order.
+
+ This is an implementation of the Unicode Bidirectional Algorithm
+ which can be found here: http://www.unicode.org/reports/tr9/ and
+ is based on the reference implementation found on Unicode.org.
+*/
#ifndef FITZ_BIDI_H
#define FITZ_BIDI_H
@@ -36,43 +37,45 @@ typedef enum fz_bidi_flags_e
}
fz_bidi_flags;
-/**
- * Prototype for callback function supplied to fz_bidi_fragment_text.
- *
- * @param fragment first character in fragment
- * @param fragmentLen number of characters in fragment
- * @param bidiLevel The bidirectional level for this text. The bottom bit
- * will be set iff block should concatenate with other
- * blocks as right-to-left
- * @param script the script in use for this fragment (other than common
- * or inherited)
- * @param arg data from caller of Bidi_fragmentText
- */
+/*
+ Prototype for callback function supplied to fz_bidi_fragment_text.
+
+ @param fragment first character in fragment
+ @param fragmentLen number of characters in fragment
+ @param bidiLevel The bidirectional level for this text.
+ The bottom bit will be set iff block
+ should concatenate with other blocks as
+ right-to-left
+ @param script the script in use for this fragment (other
+ than common or inherited)
+ @param arg data from caller of Bidi_fragmentText
+*/
typedef void (fz_bidi_fragment_callback)(const uint32_t *fragment,
size_t fragmentLen,
int bidiLevel,
int script,
void *arg);
-/**
- * Partitions the given Unicode sequence into one or more unidirectional
- * fragments and invokes the given callback function for each fragment.
- *
- * For example, if directionality of text is:
- * 0123456789
- * rrlllrrrrr,
- * we'll invoke callback with:
- * &text[0], length == 2
- * &text[2], length == 3
- * &text[5], length == 5
- *
- * @param[in] text start of Unicode sequence
- * @param[in] textlen number of Unicodes to analyse
- * @param[in] baseDir direction of paragraph (specify FZ_BIDI_NEUTRAL to force auto-detection)
- * @param[in] callback function to be called for each fragment
- * @param[in] arg data to be passed to the callback function
- * @param[in] flags flags to control operation (see fz_bidi_flags above)
- */
+/*
+ Partitions the given Unicode sequence into one or more
+ unidirectional fragments and invokes the given callback
+ function for each fragment.
+
+ For example, if directionality of text is:
+ 0123456789
+ rrlllrrrrr,
+ we'll invoke callback with:
+ &text[0], length == 2
+ &text[2], length == 3
+ &text[5], length == 5
+
+ @param[in] text start of Unicode sequence
+ @param[in] textlen number of Unicodes to analyse
+ @param[in] baseDir direction of paragraph (specify FZ_BIDI_NEUTRAL to force auto-detection)
+ @param[in] callback function to be called for each fragment
+ @param[in] arg data to be passed to the callback function
+ @param[in] flags flags to control operation (see fz_bidi_flags above)
+*/
void fz_bidi_fragment_text(fz_context *ctx,
const uint32_t *text,
size_t textlen,
diff --git a/include/mupdf/fitz/colorspace.h b/include/mupdf/fitz/colorspace.h
index 8eef8df3..398503d1 100644
--- a/include/mupdf/fitz/colorspace.h
+++ b/include/mupdf/fitz/colorspace.h
@@ -89,10 +89,6 @@ const char *fz_colorspace_name(fz_context *ctx, const fz_colorspace *cs);
void fz_convert_color(fz_context *ctx, fz_colorspace *dsts, float *dstv, fz_colorspace *srcs, const float *srcv);
-void fz_new_colorspace_context(fz_context *ctx);
-fz_colorspace_context *fz_keep_colorspace_context(fz_context *ctx);
-void fz_drop_colorspace_context(fz_context *ctx);
-
typedef struct fz_color_converter_s fz_color_converter;
/* This structure is public because it allows us to avoid dynamic allocations.
diff --git a/include/mupdf/fitz/context.h b/include/mupdf/fitz/context.h
index c84629e4..9966b36f 100644
--- a/include/mupdf/fitz/context.h
+++ b/include/mupdf/fitz/context.h
@@ -555,29 +555,6 @@ struct fz_warn_context_s
int count;
};
-fz_context *fz_clone_context_internal(fz_context *ctx);
-
-void fz_new_aa_context(fz_context *ctx);
-void fz_drop_aa_context(fz_context *ctx);
-void fz_copy_aa_context(fz_context *dst, fz_context *src);
-
-void fz_new_document_handler_context(fz_context *ctx);
-void fz_drop_document_handler_context(fz_context *ctx);
-fz_document_handler_context *fz_keep_document_handler_context(fz_context *ctx);
-
-/* Tuning context implementation details */
-struct fz_tuning_context_s
-{
- int refs;
- fz_tune_image_decode_fn *image_decode;
- void *image_decode_arg;
- fz_tune_image_scale_fn *image_scale;
- void *image_scale_arg;
-};
-
-fz_tune_image_decode_fn fz_default_image_decode;
-fz_tune_image_scale_fn fz_default_image_scale;
-
/* Default allocator */
extern fz_alloc_context fz_alloc_default;
diff --git a/include/mupdf/fitz/crypt.h b/include/mupdf/fitz/crypt.h
index 6a6f5a2a..bce16a90 100644
--- a/include/mupdf/fitz/crypt.h
+++ b/include/mupdf/fitz/crypt.h
@@ -13,6 +13,10 @@
typedef struct fz_md5_s fz_md5;
+/*
+ Structure definition is public to enable stack
+ based allocation. Do not access the members directly.
+*/
struct fz_md5_s
{
unsigned int state[4];
@@ -28,6 +32,10 @@ void fz_md5_final(fz_md5 *state, unsigned char digest[16]);
typedef struct fz_sha256_s fz_sha256;
+/*
+ Structure definition is public to enable stack
+ based allocation. Do not access the members directly.
+*/
struct fz_sha256_s
{
unsigned int state[8];
@@ -46,6 +54,10 @@ void fz_sha256_final(fz_sha256 *state, unsigned char digest[32]);
typedef struct fz_sha512_s fz_sha512;
+/*
+ Structure definition is public to enable stack
+ based allocation. Do not access the members directly.
+*/
struct fz_sha512_s
{
uint64_t state[8];
@@ -72,6 +84,10 @@ void fz_sha384_final(fz_sha384 *state, unsigned char digest[64]);
typedef struct fz_arc4_s fz_arc4;
+/*
+ Structure definition is public to enable stack
+ based allocation. Do not access the members directly.
+*/
struct fz_arc4_s
{
unsigned x;
@@ -89,6 +105,10 @@ typedef struct fz_aes_s fz_aes;
#define AES_DECRYPT 0
#define AES_ENCRYPT 1
+/*
+ Structure definition is public to enable stack
+ based allocation. Do not access the members directly.
+*/
struct fz_aes_s
{
int nr; /* number of rounds */
diff --git a/include/mupdf/fitz/device.h b/include/mupdf/fitz/device.h
index 57e61ad0..eab5f3e2 100644
--- a/include/mupdf/fitz/device.h
+++ b/include/mupdf/fitz/device.h
@@ -77,25 +77,6 @@ char *fz_blendmode_name(int blendmode);
typedef struct fz_device_container_stack_s fz_device_container_stack;
-struct fz_device_container_stack_s
-{
- fz_rect scissor;
- int flags;
- int user;
-};
-
-enum
-{
- fz_device_container_stack_is_clip_path = 1,
- fz_device_container_stack_is_clip_stroke_path = 2,
- fz_device_container_stack_is_clip_text = 4,
- fz_device_container_stack_is_clip_stroke_text = 8,
- fz_device_container_stack_is_clip_image_mask = 16,
- fz_device_container_stack_in_mask = 32,
- fz_device_container_stack_is_mask = 64,
- fz_device_container_stack_is_group = 128,
-};
-
struct fz_device_s
{
int refs;
diff --git a/include/mupdf/fitz/document.h b/include/mupdf/fitz/document.h
index 105692e6..754f97df 100644
--- a/include/mupdf/fitz/document.h
+++ b/include/mupdf/fitz/document.h
@@ -55,6 +55,10 @@ typedef fz_annot *(fz_annot_next_fn)(fz_context *ctx, fz_annot *annot);
typedef fz_rect *(fz_annot_bound_fn)(fz_context *ctx, fz_annot *annot, fz_rect *rect);
typedef void (fz_annot_run_fn)(fz_context *ctx, fz_annot *annot, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie);
+/*
+ Structure definition is public so other classes can
+ derive from it. Do not access the members directly.
+*/
struct fz_annot_s
{
int refs;
@@ -64,6 +68,10 @@ struct fz_annot_s
fz_annot_next_fn *next_annot;
};
+/*
+ Structure definition is public so other classes can
+ derive from it. Do not access the members directly.
+*/
struct fz_page_s
{
int refs;
@@ -79,6 +87,10 @@ struct fz_page_s
fz_page_get_separation_fn *get_separation;
};
+/*
+ Structure definition is public so other classes can
+ derive from it. Do not access the members directly.
+*/
struct fz_document_s
{
int refs;
diff --git a/include/mupdf/fitz/font.h b/include/mupdf/fitz/font.h
index 8f6aa902..dd624de1 100644
--- a/include/mupdf/fitz/font.h
+++ b/include/mupdf/fitz/font.h
@@ -136,29 +136,6 @@ const char *fz_font_name(fz_context *ctx, fz_font *font);
fz_rect *fz_font_bbox(fz_context *ctx, fz_font *font);
/*
- fz_new_font_context: Initialise the font context.
-
- For internal use only.
-*/
-void fz_new_font_context(fz_context *ctx);
-
-/*
- fz_keep_font_context: Increment the ref count for
- the current font context.
-
- For internal use only.
-*/
-fz_font_context *fz_keep_font_context(fz_context *ctx);
-
-/*
- fz_drop_font_context: Drop the ref count for the
- current font context.
-
- For internal use only.
-*/
-void fz_drop_font_context(fz_context *ctx);
-
-/*
fz_load_system_font_func: Type for user supplied system
font loading hook.
diff --git a/include/mupdf/fitz/function.h b/include/mupdf/fitz/function.h
index ab49f57a..7fcaecb4 100644
--- a/include/mupdf/fitz/function.h
+++ b/include/mupdf/fitz/function.h
@@ -24,6 +24,10 @@ enum
FZ_FN_MAXM = FZ_MAX_COLORS
};
+/*
+ Structure definition is public so other classes can
+ derive from it. Do not access the members directly.
+*/
struct fz_function_s
{
fz_storable storable;
diff --git a/include/mupdf/fitz/glyph-cache.h b/include/mupdf/fitz/glyph-cache.h
index e3573356..4231a00a 100644
--- a/include/mupdf/fitz/glyph-cache.h
+++ b/include/mupdf/fitz/glyph-cache.h
@@ -1,35 +1,13 @@
#ifndef MUPDF_FITZ_GLYPH_CACHE_H
#define MUPDF_FITZ_GLYPH_CACHE_H
-#include "mupdf/fitz/system.h"
#include "mupdf/fitz/context.h"
#include "mupdf/fitz/math.h"
#include "mupdf/fitz/font.h"
-#include "mupdf/fitz/path.h"
#include "mupdf/fitz/pixmap.h"
-#include "mupdf/fitz/device.h"
-/*
- * Glyph cache
- */
-
-void fz_new_glyph_cache_context(fz_context *ctx);
-fz_glyph_cache *fz_keep_glyph_cache(fz_context *ctx);
-void fz_drop_glyph_cache_context(fz_context *ctx);
void fz_purge_glyph_cache(fz_context *ctx);
-
-fz_path *fz_outline_ft_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm);
-fz_path *fz_outline_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *ctm);
-fz_glyph *fz_render_ft_glyph(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, int aa);
-fz_pixmap *fz_render_ft_glyph_pixmap(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, int aa);
-fz_glyph *fz_render_t3_glyph(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, fz_colorspace *model, const fz_irect *scissor);
-fz_pixmap *fz_render_t3_glyph_pixmap(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, fz_colorspace *model, const fz_irect *scissor);
-fz_glyph *fz_render_ft_stroked_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, const fz_matrix *ctm, const fz_stroke_state *state);
-fz_pixmap *fz_render_ft_stroked_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, const fz_matrix *ctm, const fz_stroke_state *state);
-fz_glyph *fz_render_glyph(fz_context *ctx, fz_font*, int, fz_matrix *, fz_colorspace *model, const fz_irect *scissor, int alpha);
fz_pixmap *fz_render_glyph_pixmap(fz_context *ctx, fz_font*, int, fz_matrix *, const fz_irect *scissor);
-fz_glyph *fz_render_stroked_glyph(fz_context *ctx, fz_font*, int, fz_matrix *, const fz_matrix *, const fz_stroke_state *stroke, const fz_irect *scissor);
-fz_pixmap *fz_render_stroked_glyph_pixmap(fz_context *ctx, fz_font*, int, fz_matrix *, const fz_matrix *, const fz_stroke_state *stroke, const fz_irect *scissor);
void fz_render_t3_glyph_direct(fz_context *ctx, fz_device *dev, fz_font *font, int gid, const fz_matrix *trm, void *gstate, int nestedDepth);
void fz_prepare_t3_glyph(fz_context *ctx, fz_font *font, int gid, int nestedDepth);
void fz_dump_glyph_cache_stats(fz_context *ctx);
diff --git a/include/mupdf/fitz/glyph.h b/include/mupdf/fitz/glyph.h
index e6780bd7..d7e6b3e7 100644
--- a/include/mupdf/fitz/glyph.h
+++ b/include/mupdf/fitz/glyph.h
@@ -122,8 +122,6 @@ struct fz_glyph_s
unsigned char data[1];
};
-static size_t fz_glyph_size(fz_context *ctx, fz_glyph *glyph);
-
fz_irect *fz_glyph_bbox_no_ctx(fz_glyph *src, fz_irect *bbox);
static inline size_t
diff --git a/include/mupdf/fitz/image.h b/include/mupdf/fitz/image.h
index 77f3488b..d7291580 100644
--- a/include/mupdf/fitz/image.h
+++ b/include/mupdf/fitz/image.h
@@ -86,6 +86,10 @@ fz_pixmap *fz_decomp_image_from_stream(fz_context *ctx, fz_stream *stm, fz_compr
fz_pixmap *fz_expand_indexed_pixmap(fz_context *ctx, const fz_pixmap *src, int alpha);
size_t fz_image_size(fz_context *ctx, fz_image *im);
+/*
+ Structure is public to allow other structures to
+ be derived from it. Do not access members directly.
+*/
struct fz_image_s
{
fz_key_storable key_storable;
diff --git a/include/mupdf/fitz/math.h b/include/mupdf/fitz/math.h
index b8954505..8b38b15b 100644
--- a/include/mupdf/fitz/math.h
+++ b/include/mupdf/fitz/math.h
@@ -3,7 +3,9 @@
#include "mupdf/fitz/system.h"
-/* Multiply scaled two integers in the 0..255 range */
+/*
+ Multiply scaled two integers in the 0..255 range
+*/
static inline int fz_mul255(int a, int b)
{
/* see Jim Blinn's book "Dirty Pixels" for how this works */
@@ -12,25 +14,38 @@ static inline int fz_mul255(int a, int b)
return x >> 8;
}
-/* Expand a value A from the 0...255 range to the 0..256 range */
+/*
+ Expand a value A from the 0...255 range to the 0..256 range
+*/
#define FZ_EXPAND(A) ((A)+((A)>>7))
-/* Combine values A (in any range) and B (in the 0..256 range),
- * to give a single value in the same range as A was. */
+/*
+ Combine values A (in any range) and B (in the 0..256 range),
+ to give a single value in the same range as A was.
+*/
#define FZ_COMBINE(A,B) (((A)*(B))>>8)
-/* Combine values A and C (in the same (any) range) and B and D (in the
- * 0..256 range), to give a single value in the same range as A and C were. */
+/*
+ Combine values A and C (in the same (any) range) and B and D (in
+ the 0..256 range), to give a single value in the same range as A
+ and C were.
+*/
#define FZ_COMBINE2(A,B,C,D) (((A) * (B) + (C) * (D))>>8)
-/* Blend SRC and DST (in the same range) together according to
- * AMOUNT (in the 0...256 range). */
+/*
+ Blend SRC and DST (in the same range) together according to
+ AMOUNT (in the 0...256 range).
+*/
#define FZ_BLEND(SRC, DST, AMOUNT) ((((SRC)-(DST))*(AMOUNT) + ((DST)<<8))>>8)
-/* Range checking atof */
+/*
+ Range checking atof
+*/
float fz_atof(const char *s);
-/* atoi that copes with NULL */
+/*
+ atoi that copes with NULL
+*/
int fz_atoi(const char *s);
fz_off_t fz_atoo(const char *s);
diff --git a/include/mupdf/fitz/outline.h b/include/mupdf/fitz/outline.h
index 0223ecfa..44578e87 100644
--- a/include/mupdf/fitz/outline.h
+++ b/include/mupdf/fitz/outline.h
@@ -28,7 +28,6 @@
down: The outline items immediate children in the hierarchy.
May be NULL if no children exist.
*/
-
typedef struct fz_outline_s fz_outline;
struct fz_outline_s
@@ -42,10 +41,14 @@ struct fz_outline_s
int is_open;
};
-/* fz_print_outline_xml: Print an outline to 'out' as XML. */
+/*
+ fz_print_outline_xml: Print an outline to 'out' as XML.
+*/
void fz_print_outline_xml(fz_context *ctx, fz_output *out, fz_outline *outline);
-/* fz_print_outline: Print an outline to 'out' is plain text. */
+/*
+ fz_print_outline: Print an outline to 'out' as plain text.
+*/
void fz_print_outline(fz_context *ctx, fz_output *out, fz_outline *outline);
fz_outline *fz_new_outline(fz_context *ctx);
diff --git a/include/mupdf/fitz/output.h b/include/mupdf/fitz/output.h
index 75dd0a83..cba8e16c 100644
--- a/include/mupdf/fitz/output.h
+++ b/include/mupdf/fitz/output.h
@@ -160,10 +160,6 @@ char *fz_tempfilename(fz_context *ctx, const char *base, const char *hint);
*/
void fz_save_buffer(fz_context *ctx, fz_buffer *buf, const char *filename);
-void fz_new_output_context(fz_context *ctx);
-void fz_drop_output_context(fz_context *ctx);
-fz_output_context *fz_keep_output_context(fz_context *ctx);
-
/*
fz_band_writer
*/
diff --git a/include/mupdf/fitz/pixmap.h b/include/mupdf/fitz/pixmap.h
index 29fe7b00..7a972b62 100644
--- a/include/mupdf/fitz/pixmap.h
+++ b/include/mupdf/fitz/pixmap.h
@@ -30,7 +30,14 @@ int fz_pixmap_width(fz_context *ctx, fz_pixmap *pix);
*/
int fz_pixmap_height(fz_context *ctx, fz_pixmap *pix);
+/*
+ fz_pixmap_x: Return the x value of the pixmap in pixels.
+*/
int fz_pixmap_x(fz_context *ctx, fz_pixmap *pix);
+
+/*
+ fz_pixmap_y: Return the y value of the pixmap in pixels.
+*/
int fz_pixmap_y(fz_context *ctx, fz_pixmap *pix);
/*
diff --git a/include/mupdf/fitz/pool.h b/include/mupdf/fitz/pool.h
index 919b08d0..8cc75407 100644
--- a/include/mupdf/fitz/pool.h
+++ b/include/mupdf/fitz/pool.h
@@ -5,19 +5,6 @@
#include "mupdf/fitz/context.h"
typedef struct fz_pool_s fz_pool;
-typedef struct fz_pool_node_s fz_pool_node;
-
-struct fz_pool_s
-{
- fz_pool_node *head, *tail;
- char *pos, *end;
-};
-
-struct fz_pool_node_s
-{
- fz_pool_node *next;
- char mem[64 << 10]; /* 64k blocks */
-};
fz_pool *fz_new_pool(fz_context *ctx);
void *fz_pool_alloc(fz_context *ctx, fz_pool *pool, size_t size);
diff --git a/include/mupdf/fitz/shade.h b/include/mupdf/fitz/shade.h
index 5358cde2..871a62c7 100644
--- a/include/mupdf/fitz/shade.h
+++ b/include/mupdf/fitz/shade.h
@@ -24,9 +24,11 @@ enum
FZ_MESH_TYPE7 = 7
};
-typedef struct fz_shade_s fz_shade;
-
-struct fz_shade_s
+/*
+ Structure is public to allow derived classes. Do not
+ access the members directly.
+*/
+typedef struct fz_shade_s
{
fz_storable storable;
@@ -70,7 +72,7 @@ struct fz_shade_s
} u;
fz_compressed_buffer *buffer;
-};
+} fz_shade;
/*
fz_keep_shade: Add a reference to an fz_shade.
diff --git a/include/mupdf/fitz/store.h b/include/mupdf/fitz/store.h
index 90c93b5c..876649e3 100644
--- a/include/mupdf/fitz/store.h
+++ b/include/mupdf/fitz/store.h
@@ -110,9 +110,7 @@ void fz_drop_key_storable_key(fz_context *, const fz_key_storable *);
reap passes together, using fz_defer_reap_start/fz_defer_reap_end
to bracket a region in which many may be triggered.
*/
-typedef struct fz_store_hash_s fz_store_hash;
-
-struct fz_store_hash_s
+typedef struct fz_store_hash_s
{
fz_store_drop_fn *drop;
union
@@ -134,11 +132,9 @@ struct fz_store_hash_s
float m[4];
} im;
} u;
-};
+} fz_store_hash;
-typedef struct fz_store_type_s fz_store_type;
-
-struct fz_store_type_s
+typedef struct fz_store_type_s
{
int (*make_hash_key)(fz_context *ctx, fz_store_hash *, void *);
void *(*keep_key)(fz_context *,void *);
@@ -146,7 +142,7 @@ struct fz_store_type_s
int (*cmp_key)(fz_context *ctx, void *, void *);
void (*print)(fz_context *ctx, fz_output *out, void *);
int (*needs_reap)(fz_context *ctx, void *);
-};
+} fz_store_type;
/*
fz_store_new_context: Create a new store inside the context
diff --git a/include/mupdf/fitz/text.h b/include/mupdf/fitz/text.h
index e8efa4db..a0485173 100644
--- a/include/mupdf/fitz/text.h
+++ b/include/mupdf/fitz/text.h
@@ -8,16 +8,16 @@
#include "mupdf/fitz/bidi.h"
/*
- * Text buffer.
- *
- * The trm field contains the a, b, c and d coefficients.
- * The e and f coefficients come from the individual elements,
- * together they form the transform matrix for the glyph.
- *
- * Glyphs are referenced by glyph ID.
- * The Unicode text equivalent is kept in a separate array
- * with indexes into the glyph array.
- */
+ Text buffer.
+
+ The trm field contains the a, b, c and d coefficients.
+ The e and f coefficients come from the individual elements,
+ together they form the transform matrix for the glyph.
+
+ Glyphs are referenced by glyph ID.
+ The Unicode text equivalent is kept in a separate array
+ with indexes into the glyph array.
+*/
typedef struct fz_text_s fz_text;
typedef struct fz_text_span_s fz_text_span;
diff --git a/include/mupdf/fitz/tree.h b/include/mupdf/fitz/tree.h
index 0b299e27..7ce63cc1 100644
--- a/include/mupdf/fitz/tree.h
+++ b/include/mupdf/fitz/tree.h
@@ -4,7 +4,9 @@
#include "mupdf/fitz/system.h"
#include "mupdf/fitz/context.h"
-/* AA-tree to look up things by strings. */
+/*
+ AA-tree to look up things by strings.
+*/
typedef struct fz_tree_s fz_tree;
diff --git a/platform/win32/libmupdf.vcproj b/platform/win32/libmupdf.vcproj
index eeeca45c..26c8eef4 100644
--- a/platform/win32/libmupdf.vcproj
+++ b/platform/win32/libmupdf.vcproj
@@ -1687,6 +1687,10 @@
>
</File>
<File
+ RelativePath="..\..\source\fitz\glyph-cache-imp.h"
+ >
+ </File>
+ <File
RelativePath="..\..\source\fitz\glyph.c"
>
</File>
@@ -2346,10 +2350,6 @@
>
</File>
<File
- RelativePath="..\..\include\mupdf\fitz\meta.h"
- >
- </File>
- <File
RelativePath="..\..\include\mupdf\fitz\outline.h"
>
</File>
@@ -2446,10 +2446,6 @@
>
</File>
<File
- RelativePath="..\..\include\mupdf\fitz\unzip.h"
- >
- </File>
- <File
RelativePath="..\..\include\mupdf\fitz\util.h"
>
</File>
diff --git a/source/fitz/context.c b/source/fitz/context.c
index 808f53ce..3e79bbea 100644
--- a/source/fitz/context.c
+++ b/source/fitz/context.c
@@ -1,4 +1,4 @@
-#include "mupdf/fitz.h"
+#include "fitz-imp.h"
struct fz_id_context_s
{
diff --git a/source/fitz/device.c b/source/fitz/device.c
index 88b658a3..727000e8 100644
--- a/source/fitz/device.c
+++ b/source/fitz/device.c
@@ -1,4 +1,4 @@
-#include "mupdf/fitz.h"
+#include "fitz-imp.h"
void *
fz_new_device(fz_context *ctx, int size)
diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c
index d6d8c38e..28e64839 100644
--- a/source/fitz/draw-device.c
+++ b/source/fitz/draw-device.c
@@ -1,4 +1,5 @@
-#include "mupdf/fitz.h"
+#include "fitz-imp.h"
+#include "glyph-cache-imp.h"
#include "draw-imp.h"
#define STACK_SIZE 96
diff --git a/source/fitz/draw-glyph.c b/source/fitz/draw-glyph.c
index 1eb89093..b3d4cb4c 100644
--- a/source/fitz/draw-glyph.c
+++ b/source/fitz/draw-glyph.c
@@ -1,5 +1,6 @@
#include "mupdf/fitz.h"
#include "draw-imp.h"
+#include "glyph-cache-imp.h"
#define MAX_GLYPH_SIZE 256
#define MAX_CACHE_SIZE (1024*1024)
diff --git a/source/fitz/fitz-imp.h b/source/fitz/fitz-imp.h
index 9441aa9c..169f422e 100644
--- a/source/fitz/fitz-imp.h
+++ b/source/fitz/fitz-imp.h
@@ -12,4 +12,82 @@ struct fz_buffer_s
int shared;
};
+void fz_new_colorspace_context(fz_context *ctx);
+fz_colorspace_context *fz_keep_colorspace_context(fz_context *ctx);
+void fz_drop_colorspace_context(fz_context *ctx);
+
+struct fz_device_container_stack_s
+{
+ fz_rect scissor;
+ int flags;
+ int user;
+};
+
+enum
+{
+ fz_device_container_stack_is_clip_path = 1,
+ fz_device_container_stack_is_clip_stroke_path = 2,
+ fz_device_container_stack_is_clip_text = 4,
+ fz_device_container_stack_is_clip_stroke_text = 8,
+ fz_device_container_stack_is_clip_image_mask = 16,
+ fz_device_container_stack_in_mask = 32,
+ fz_device_container_stack_is_mask = 64,
+ fz_device_container_stack_is_group = 128,
+};
+
+/*
+ fz_new_font_context: Initialise the font context.
+
+ For internal use only.
+*/
+void fz_new_font_context(fz_context *ctx);
+
+/*
+ fz_keep_font_context: Increment the ref count for
+ the current font context.
+
+ For internal use only.
+*/
+fz_font_context *fz_keep_font_context(fz_context *ctx);
+
+/*
+ fz_drop_font_context: Drop the ref count for the
+ current font context.
+
+ For internal use only.
+*/
+void fz_drop_font_context(fz_context *ctx);
+
+/* Tuning context implementation details */
+struct fz_tuning_context_s
+{
+ int refs;
+ fz_tune_image_decode_fn *image_decode;
+ void *image_decode_arg;
+ fz_tune_image_scale_fn *image_scale;
+ void *image_scale_arg;
+};
+
+fz_tune_image_decode_fn fz_default_image_decode;
+fz_tune_image_scale_fn fz_default_image_scale;
+
+fz_context *fz_clone_context_internal(fz_context *ctx);
+
+void fz_new_aa_context(fz_context *ctx);
+void fz_drop_aa_context(fz_context *ctx);
+void fz_copy_aa_context(fz_context *dst, fz_context *src);
+
+void fz_new_glyph_cache_context(fz_context *ctx);
+fz_glyph_cache *fz_keep_glyph_cache(fz_context *ctx);
+void fz_drop_glyph_cache_context(fz_context *ctx);
+
+void fz_new_document_handler_context(fz_context *ctx);
+void fz_drop_document_handler_context(fz_context *ctx);
+fz_document_handler_context *fz_keep_document_handler_context(fz_context *ctx);
+
+void fz_new_output_context(fz_context *ctx);
+void fz_drop_output_context(fz_context *ctx);
+fz_output_context *fz_keep_output_context(fz_context *ctx);
+
+
#endif
diff --git a/source/fitz/glyph-cache-imp.h b/source/fitz/glyph-cache-imp.h
new file mode 100644
index 00000000..e5af15ea
--- /dev/null
+++ b/source/fitz/glyph-cache-imp.h
@@ -0,0 +1,25 @@
+#ifndef MUPDF_FITZ_GLYPH_CACHE_IMP_H
+#define MUPDF_FITZ_GLYPH_CACHE_IMP_H
+
+#include "mupdf/fitz/system.h"
+#include "mupdf/fitz/context.h"
+#include "mupdf/fitz/math.h"
+#include "mupdf/fitz/font.h"
+#include "mupdf/fitz/path.h"
+#include "mupdf/fitz/pixmap.h"
+#include "mupdf/fitz/device.h"
+#include "mupdf/fitz/glyph-cache.h"
+
+fz_path *fz_outline_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *ctm);
+fz_path *fz_outline_ft_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm);
+fz_glyph *fz_render_ft_glyph(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, int aa);
+fz_pixmap *fz_render_ft_glyph_pixmap(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, int aa);
+fz_glyph *fz_render_t3_glyph(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, fz_colorspace *model, const fz_irect *scissor);
+fz_pixmap *fz_render_t3_glyph_pixmap(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, fz_colorspace *model, const fz_irect *scissor);
+fz_glyph *fz_render_ft_stroked_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, const fz_matrix *ctm, const fz_stroke_state *state);
+fz_pixmap *fz_render_ft_stroked_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, const fz_matrix *ctm, const fz_stroke_state *state);
+fz_glyph *fz_render_glyph(fz_context *ctx, fz_font*, int, fz_matrix *, fz_colorspace *model, const fz_irect *scissor, int alpha);
+fz_glyph *fz_render_stroked_glyph(fz_context *ctx, fz_font*, int, fz_matrix *, const fz_matrix *, const fz_stroke_state *stroke, const fz_irect *scissor);
+fz_pixmap *fz_render_stroked_glyph_pixmap(fz_context *ctx, fz_font*, int, fz_matrix *, const fz_matrix *, const fz_stroke_state *stroke, const fz_irect *scissor);
+
+#endif
diff --git a/source/fitz/halftone.c b/source/fitz/halftone.c
index 1a4da0f0..910c2059 100644
--- a/source/fitz/halftone.c
+++ b/source/fitz/halftone.c
@@ -1,4 +1,4 @@
-#include "mupdf/fitz.h"
+#include "fitz-imp.h"
struct fz_halftone_s
{
diff --git a/source/fitz/pool.c b/source/fitz/pool.c
index 90c405dc..59e4a0f2 100644
--- a/source/fitz/pool.c
+++ b/source/fitz/pool.c
@@ -1,5 +1,19 @@
#include "mupdf/fitz.h"
+typedef struct fz_pool_node_s fz_pool_node;
+
+struct fz_pool_s
+{
+ fz_pool_node *head, *tail;
+ char *pos, *end;
+};
+
+struct fz_pool_node_s
+{
+ fz_pool_node *next;
+ char mem[64 << 10]; /* 64k blocks */
+};
+
fz_pool *fz_new_pool(fz_context *ctx)
{
fz_pool *pool = fz_malloc_struct(ctx, fz_pool);
diff --git a/source/fitz/svg-device.c b/source/fitz/svg-device.c
index 5d05d808..16542a7a 100644
--- a/source/fitz/svg-device.c
+++ b/source/fitz/svg-device.c
@@ -1,4 +1,5 @@
#include "fitz-imp.h"
+#include "glyph-cache-imp.h"
typedef struct svg_device_s svg_device;