summaryrefslogtreecommitdiff
path: root/xps/muxps.h
diff options
context:
space:
mode:
Diffstat (limited to 'xps/muxps.h')
-rw-r--r--xps/muxps.h98
1 files changed, 49 insertions, 49 deletions
diff --git a/xps/muxps.h b/xps/muxps.h
index bdae3eea..36635331 100644
--- a/xps/muxps.h
+++ b/xps/muxps.h
@@ -11,7 +11,7 @@ typedef unsigned char byte;
* XPS and ZIP constants.
*/
-typedef struct xps_context_s xps_context;
+typedef struct xps_document_s xps_document;
#define REL_START_PART \
"http://schemas.microsoft.com/xps/2005/06/fixedrepresentation"
@@ -38,12 +38,12 @@ void xps_absolute_path(char *output, char *base_uri, char *path, int output_size
typedef struct element xml_element;
-xml_element *xml_parse_document(fz_context *ctx, byte *buf, int len);
+xml_element *xml_parse_document(fz_context *doc, byte *buf, int len);
xml_element *xml_next(xml_element *item);
xml_element *xml_down(xml_element *item);
char *xml_tag(xml_element *item);
char *xml_att(xml_element *item, const char *att);
-void xml_free_element(fz_context *ctx, xml_element *item);
+void xml_free_element(fz_context *doc, xml_element *item);
void xml_print_element(xml_element *item, int level);
/*
@@ -60,21 +60,21 @@ struct xps_part_s
byte *data;
};
-xps_part *xps_new_part(xps_context *ctx, char *name, int size);
-xps_part *xps_read_part(xps_context *ctx, char *partname);
-void xps_free_part(xps_context *ctx, xps_part *part);
+xps_part *xps_new_part(xps_document *doc, char *name, int size);
+xps_part *xps_read_part(xps_document *doc, char *partname);
+void xps_free_part(xps_document *doc, xps_part *part);
/*
* Document structure.
*/
-typedef struct xps_document_s xps_document;
+typedef struct xps_fixdoc_s xps_fixdoc;
typedef struct xps_page_s xps_page;
-struct xps_document_s
+struct xps_fixdoc_s
{
char *name;
- xps_document *next;
+ xps_fixdoc *next;
};
struct xps_page_s
@@ -86,21 +86,21 @@ struct xps_page_s
xps_page *next;
};
-int xps_read_page_list(xps_context *ctx);
-void xps_debug_page_list(xps_context *ctx);
-void xps_free_page_list(xps_context *ctx);
+int xps_read_page_list(xps_document *doc);
+void xps_debug_page_list(xps_document *doc);
+void xps_free_page_list(xps_document *doc);
-int xps_count_pages(xps_context *ctx);
-int xps_load_page(xps_page **page, xps_context *ctx, int number);
-void xps_free_page(xps_context *ctx, xps_page *page);
+int xps_count_pages(xps_document *doc);
+int xps_load_page(xps_page **page, xps_document *doc, int number);
+void xps_free_page(xps_document *doc, xps_page *page);
/*
* Images, fonts, and colorspaces.
*/
-int xps_decode_jpeg(fz_context *ctx, fz_pixmap **imagep, byte *rbuf, int rlen);
-int xps_decode_png(fz_context *ctx, fz_pixmap **imagep, byte *rbuf, int rlen);
-int xps_decode_tiff(fz_context *ctx, fz_pixmap **imagep, byte *rbuf, int rlen);
+int xps_decode_jpeg(fz_context *doc, fz_pixmap **imagep, byte *rbuf, int rlen);
+int xps_decode_png(fz_context *doc, fz_pixmap **imagep, byte *rbuf, int rlen);
+int xps_decode_tiff(fz_context *doc, fz_pixmap **imagep, byte *rbuf, int rlen);
typedef struct xps_font_cache_s xps_font_cache;
@@ -123,12 +123,12 @@ void xps_identify_font_encoding(fz_font *font, int idx, int *pid, int *eid);
void xps_select_font_encoding(fz_font *font, int idx);
int xps_encode_font_char(fz_font *font, int key);
-void xps_measure_font_glyph(xps_context *ctx, fz_font *font, int gid, xps_glyph_metrics *mtx);
+void xps_measure_font_glyph(xps_document *doc, fz_font *font, int gid, xps_glyph_metrics *mtx);
-void xps_debug_path(xps_context *ctx);
+void xps_debug_path(xps_document *doc);
-void xps_parse_color(xps_context *ctx, char *base_uri, char *hexstring, fz_colorspace **csp, float *samples);
-void xps_set_color(xps_context *ctx, fz_colorspace *colorspace, float *samples);
+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);
/*
* Resource dictionaries.
@@ -146,9 +146,9 @@ struct xps_resource_s
xps_resource *parent; /* up to the previous dict in the stack */
};
-int xps_parse_resource_dictionary(xps_context *ctx, xps_resource **dictp, char *base_uri, xml_element *root);
-void xps_free_resource_dictionary(xps_context *ctx, xps_resource *dict);
-void xps_resolve_resource_reference(xps_context *ctx, xps_resource *dict, char **attp, xml_element **tagp, char **urip);
+int xps_parse_resource_dictionary(xps_document *doc, xps_resource **dictp, char *base_uri, xml_element *root);
+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);
@@ -156,29 +156,29 @@ void xps_debug_resource_dictionary(xps_resource *dict);
* Fixed page/graphics parsing.
*/
-void xps_parse_fixed_page(xps_context *ctx, fz_matrix ctm, xps_page *page);
-void xps_parse_canvas(xps_context *ctx, fz_matrix ctm, fz_rect area, char *base_uri, xps_resource *dict, xml_element *node);
-void xps_parse_path(xps_context *ctx, fz_matrix ctm, char *base_uri, xps_resource *dict, xml_element *node);
-void xps_parse_glyphs(xps_context *ctx, fz_matrix ctm, char *base_uri, xps_resource *dict, xml_element *node);
-void xps_parse_solid_color_brush(xps_context *ctx, fz_matrix ctm, char *base_uri, xps_resource *dict, xml_element *node);
-void xps_parse_image_brush(xps_context *ctx, fz_matrix ctm, fz_rect area, char *base_uri, xps_resource *dict, xml_element *node);
-void xps_parse_visual_brush(xps_context *ctx, fz_matrix ctm, fz_rect area, char *base_uri, xps_resource *dict, xml_element *node);
-void xps_parse_linear_gradient_brush(xps_context *ctx, fz_matrix ctm, fz_rect area, char *base_uri, xps_resource *dict, xml_element *node);
-void xps_parse_radial_gradient_brush(xps_context *ctx, fz_matrix ctm, fz_rect area, char *base_uri, xps_resource *dict, xml_element *node);
+void xps_parse_fixed_page(xps_document *doc, fz_matrix ctm, xps_page *page);
+void xps_parse_canvas(xps_document *doc, fz_matrix ctm, fz_rect area, char *base_uri, xps_resource *dict, xml_element *node);
+void xps_parse_path(xps_document *doc, fz_matrix ctm, char *base_uri, xps_resource *dict, xml_element *node);
+void xps_parse_glyphs(xps_document *doc, fz_matrix ctm, char *base_uri, xps_resource *dict, xml_element *node);
+void xps_parse_solid_color_brush(xps_document *doc, fz_matrix ctm, char *base_uri, xps_resource *dict, xml_element *node);
+void xps_parse_image_brush(xps_document *doc, fz_matrix ctm, fz_rect area, char *base_uri, xps_resource *dict, xml_element *node);
+void xps_parse_visual_brush(xps_document *doc, fz_matrix ctm, fz_rect area, char *base_uri, xps_resource *dict, xml_element *node);
+void xps_parse_linear_gradient_brush(xps_document *doc, fz_matrix ctm, fz_rect area, char *base_uri, xps_resource *dict, xml_element *node);
+void xps_parse_radial_gradient_brush(xps_document *doc, fz_matrix ctm, fz_rect area, char *base_uri, xps_resource *dict, xml_element *node);
-void xps_parse_tiling_brush(xps_context *ctx, fz_matrix ctm, fz_rect area, char *base_uri, xps_resource *dict, xml_element *root, void(*func)(xps_context*, fz_matrix, fz_rect, char*, xps_resource*, xml_element*, void*), void *user);
+void xps_parse_tiling_brush(xps_document *doc, fz_matrix ctm, fz_rect area, char *base_uri, xps_resource *dict, xml_element *root, void(*func)(xps_document*, fz_matrix, fz_rect, char*, xps_resource*, xml_element*, void*), void *user);
-void xps_parse_matrix_transform(xps_context *ctx, xml_element *root, fz_matrix *matrix);
-void xps_parse_render_transform(xps_context *ctx, char *text, fz_matrix *matrix);
-void xps_parse_rectangle(xps_context *ctx, char *text, fz_rect *rect);
+void xps_parse_matrix_transform(xps_document *doc, xml_element *root, fz_matrix *matrix);
+void xps_parse_render_transform(xps_document *doc, char *text, fz_matrix *matrix);
+void xps_parse_rectangle(xps_document *doc, char *text, fz_rect *rect);
-void xps_begin_opacity(xps_context *ctx, fz_matrix ctm, fz_rect area, char *base_uri, xps_resource *dict, char *opacity_att, xml_element *opacity_mask_tag);
-void xps_end_opacity(xps_context *ctx, char *base_uri, xps_resource *dict, char *opacity_att, xml_element *opacity_mask_tag);
+void xps_begin_opacity(xps_document *doc, fz_matrix ctm, fz_rect area, char *base_uri, xps_resource *dict, char *opacity_att, xml_element *opacity_mask_tag);
+void xps_end_opacity(xps_document *doc, char *base_uri, xps_resource *dict, char *opacity_att, xml_element *opacity_mask_tag);
-void xps_parse_brush(xps_context *ctx, fz_matrix ctm, fz_rect area, char *base_uri, xps_resource *dict, xml_element *node);
-void xps_parse_element(xps_context *ctx, fz_matrix ctm, fz_rect area, char *base_uri, xps_resource *dict, xml_element *node);
+void xps_parse_brush(xps_document *doc, fz_matrix ctm, fz_rect area, char *base_uri, xps_resource *dict, xml_element *node);
+void xps_parse_element(xps_document *doc, fz_matrix ctm, fz_rect area, char *base_uri, xps_resource *dict, xml_element *node);
-void xps_clip(xps_context *ctx, fz_matrix ctm, xps_resource *dict, char *clip_att, xml_element *clip_tag);
+void xps_clip(xps_document *doc, fz_matrix ctm, xps_resource *dict, char *clip_att, xml_element *clip_tag);
/*
* The interpreter context.
@@ -194,7 +194,7 @@ struct xps_entry_s
int usize;
};
-struct xps_context_s
+struct xps_document_s
{
fz_context *ctx;
char *directory;
@@ -203,8 +203,8 @@ struct xps_context_s
xps_entry *zip_table;
char *start_part; /* fixed document sequence */
- xps_document *first_fixdoc; /* first fixed document */
- xps_document *last_fixdoc; /* last fixed document */
+ xps_fixdoc *first_fixdoc; /* first fixed document */
+ xps_fixdoc *last_fixdoc; /* last fixed document */
xps_page *first_page; /* first page of document */
xps_page *last_page; /* last page of document */
@@ -227,8 +227,8 @@ struct xps_context_s
fz_device *dev;
};
-int xps_open_file(fz_context *ctx, xps_context **ctxp, char *filename);
-int xps_open_stream(xps_context **ctxp, fz_stream *file);
-void xps_free_context(xps_context *ctx);
+int xps_open_file(fz_context *doc, xps_document **ctxp, char *filename);
+int xps_open_stream(xps_document **ctxp, fz_stream *file);
+void xps_free_context(xps_document *doc);
#endif