Selaa lähdekoodia

remove basic lib & server apis

Ray Lee 5 vuotta sitten
vanhempi
commit
b5bd2c8ba8
98 muutettua tiedostoa jossa 2 lisäystä ja 16126 poistoa
  1. 2 4
      .dockerignore
  2. 0 2
      Dockerfile
  3. 0 9
      README.md
  4. 0 0
      public/pdfs/.keep
  5. 0 0
      public/pdfs/output/.keep
  6. 0 26
      server/api/index.js
  7. 0 0
      server/lib/xfdftool/.keep
  8. BIN
      server/lib/xfdftool/bin/xfdftool
  9. 0 76
      server/lib/xfdftool/include/mupdf/fitz.h
  10. 0 49
      server/lib/xfdftool/include/mupdf/fitz/annotation.h
  11. 0 188
      server/lib/xfdftool/include/mupdf/fitz/archive.h
  12. 0 74
      server/lib/xfdftool/include/mupdf/fitz/band-writer.h
  13. 0 87
      server/lib/xfdftool/include/mupdf/fitz/bidi.h
  14. 0 142
      server/lib/xfdftool/include/mupdf/fitz/bitmap.h
  15. 0 147
      server/lib/xfdftool/include/mupdf/fitz/buffer.h
  16. 0 118
      server/lib/xfdftool/include/mupdf/fitz/colorspace.h
  17. 0 89
      server/lib/xfdftool/include/mupdf/fitz/compressed-buffer.h
  18. 0 156
      server/lib/xfdftool/include/mupdf/fitz/config.h
  19. 0 709
      server/lib/xfdftool/include/mupdf/fitz/context.h
  20. 0 126
      server/lib/xfdftool/include/mupdf/fitz/crypt.h
  21. 0 381
      server/lib/xfdftool/include/mupdf/fitz/device.h
  22. 0 119
      server/lib/xfdftool/include/mupdf/fitz/display-list.h
  23. 0 646
      server/lib/xfdftool/include/mupdf/fitz/document.h
  24. 0 39
      server/lib/xfdftool/include/mupdf/fitz/filter.h
  25. 0 620
      server/lib/xfdftool/include/mupdf/fitz/font.h
  26. 0 41
      server/lib/xfdftool/include/mupdf/fitz/function.h
  27. 0 665
      server/lib/xfdftool/include/mupdf/fitz/geometry.h
  28. 0 20
      server/lib/xfdftool/include/mupdf/fitz/getopt.h
  29. 0 16
      server/lib/xfdftool/include/mupdf/fitz/glyph-cache.h
  30. 0 135
      server/lib/xfdftool/include/mupdf/fitz/glyph.h
  31. 0 33
      server/lib/xfdftool/include/mupdf/fitz/hash.h
  32. 0 312
      server/lib/xfdftool/include/mupdf/fitz/image.h
  33. 0 57
      server/lib/xfdftool/include/mupdf/fitz/link.h
  34. 0 58
      server/lib/xfdftool/include/mupdf/fitz/outline.h
  35. 0 106
      server/lib/xfdftool/include/mupdf/fitz/output-pcl.h
  36. 0 36
      server/lib/xfdftool/include/mupdf/fitz/output-png.h
  37. 0 51
      server/lib/xfdftool/include/mupdf/fitz/output-pnm.h
  38. 0 23
      server/lib/xfdftool/include/mupdf/fitz/output-ps.h
  39. 0 116
      server/lib/xfdftool/include/mupdf/fitz/output-pwg.h
  40. 0 30
      server/lib/xfdftool/include/mupdf/fitz/output-svg.h
  41. 0 37
      server/lib/xfdftool/include/mupdf/fitz/output-tga.h
  42. 0 319
      server/lib/xfdftool/include/mupdf/fitz/output.h
  43. 0 446
      server/lib/xfdftool/include/mupdf/fitz/path.h
  44. 0 379
      server/lib/xfdftool/include/mupdf/fitz/pixmap.h
  45. 0 14
      server/lib/xfdftool/include/mupdf/fitz/pool.h
  46. 0 49
      server/lib/xfdftool/include/mupdf/fitz/separation.h
  47. 0 198
      server/lib/xfdftool/include/mupdf/fitz/shade.h
  48. 0 287
      server/lib/xfdftool/include/mupdf/fitz/store.h
  49. 0 552
      server/lib/xfdftool/include/mupdf/fitz/stream.h
  50. 0 160
      server/lib/xfdftool/include/mupdf/fitz/string-util.h
  51. 0 325
      server/lib/xfdftool/include/mupdf/fitz/structured-text.h
  52. 0 475
      server/lib/xfdftool/include/mupdf/fitz/system.h
  53. 0 189
      server/lib/xfdftool/include/mupdf/fitz/text.h
  54. 0 35
      server/lib/xfdftool/include/mupdf/fitz/track-usage.h
  55. 0 54
      server/lib/xfdftool/include/mupdf/fitz/transition.h
  56. 0 26
      server/lib/xfdftool/include/mupdf/fitz/tree.h
  57. 0 421
      server/lib/xfdftool/include/mupdf/fitz/ucdn.h
  58. 0 64
      server/lib/xfdftool/include/mupdf/fitz/util.h
  59. 0 6
      server/lib/xfdftool/include/mupdf/fitz/version.h
  60. 0 145
      server/lib/xfdftool/include/mupdf/fitz/writer.h
  61. 0 81
      server/lib/xfdftool/include/mupdf/fitz/xml.h
  62. 0 289
      server/lib/xfdftool/include/mupdf/html.h
  63. 0 282
      server/lib/xfdftool/include/mupdf/memento.h
  64. 0 6
      server/lib/xfdftool/include/mupdf/pdf-tools.h
  65. 0 38
      server/lib/xfdftool/include/mupdf/pdf.h
  66. 0 208
      server/lib/xfdftool/include/mupdf/pdf/annot.h
  67. 0 43
      server/lib/xfdftool/include/mupdf/pdf/appearance.h
  68. 0 7
      server/lib/xfdftool/include/mupdf/pdf/clean.h
  69. 0 85
      server/lib/xfdftool/include/mupdf/pdf/cmap.h
  70. 0 62
      server/lib/xfdftool/include/mupdf/pdf/crypt.h
  71. 0 838
      server/lib/xfdftool/include/mupdf/pdf/document.h
  72. 0 216
      server/lib/xfdftool/include/mupdf/pdf/event.h
  73. 0 56
      server/lib/xfdftool/include/mupdf/pdf/field.h
  74. 0 129
      server/lib/xfdftool/include/mupdf/pdf/font.h
  75. 0 167
      server/lib/xfdftool/include/mupdf/pdf/interpret.h
  76. 0 20
      server/lib/xfdftool/include/mupdf/pdf/javascript.h
  77. 0 792
      server/lib/xfdftool/include/mupdf/pdf/name-table.h
  78. 0 154
      server/lib/xfdftool/include/mupdf/pdf/object.h
  79. 0 18
      server/lib/xfdftool/include/mupdf/pdf/output-pdf.h
  80. 0 195
      server/lib/xfdftool/include/mupdf/pdf/page.h
  81. 0 39
      server/lib/xfdftool/include/mupdf/pdf/parse.h
  82. 0 96
      server/lib/xfdftool/include/mupdf/pdf/resource.h
  83. 0 127
      server/lib/xfdftool/include/mupdf/pdf/widget.h
  84. 0 124
      server/lib/xfdftool/include/mupdf/pdf/xref.h
  85. 0 7
      server/lib/xfdftool/include/mupdf/svg.h
  86. BIN
      server/lib/xfdftool/lib/libmupdf.a
  87. BIN
      server/lib/xfdftool/lib/libmupdfthird.a
  88. 0 308
      server/lib/xfdftool/share/doc/mupdf/CHANGES
  89. 0 661
      server/lib/xfdftool/share/doc/mupdf/COPYING
  90. 0 89
      server/lib/xfdftool/share/doc/mupdf/README
  91. 0 32
      server/lib/xfdftool/share/doc/mupdf/naming.txt
  92. 0 290
      server/lib/xfdftool/share/doc/mupdf/overview.txt
  93. 0 281
      server/lib/xfdftool/share/doc/mupdf/progressive.txt
  94. 0 17
      server/lib/xfdftool/share/doc/mupdf/refcount.txt
  95. 0 38
      server/lib/xfdftool/share/doc/mupdf/thirdparty.txt
  96. 0 22
      server/lib/xfdftool/share/doc/mupdf/types.txt
  97. 0 202
      server/lib/xfdftool/share/man/man1/mupdf.1
  98. 0 420
      server/lib/xfdftool/share/man/man1/mutool.1

+ 2 - 4
.dockerignore

@@ -7,7 +7,5 @@ bitbucket-pipelines.yml
 /server/lib/MuPDF/*
 
 # ignore pdf files
-/public/pdfs/input/*
-!/public/pdfs/input/.keep
-/public/pdfs/output/*
-!/public/pdfs/output/.keep
+/public/pdfs/*
+!/public/pdfs/.keep

+ 0 - 2
Dockerfile

@@ -7,8 +7,6 @@ ENV ENV $ENV
 EXPOSE 4000
 
 WORKDIR /app
-# catch basic lib
-ADD ./server/lib/xfdftool ./server/lib/xfdftool
 # catch node modules
 ADD ./node_modules ./node_modules
 ADD . .

+ 0 - 9
README.md

@@ -1,11 +1,2 @@
 # PDF Reader Web
 Web solution to view & highlight PDF Files
-
-# Preparing Environment
-    export PDF_INPUT_FOLDER=/path/to/input/folder
-    export PDF_OUTPUT_FOLDER=/path/to/output/folder
-
-# Service Start
-    docker run -d --restart on-failure --name pdf-reader-web \
-      -v $PDF_INPUT_FOLDER:/app/public/pdfs/input -v $PDF_OUTPUT_FOLDER:/app/public/pdfs/output \
-      -e ENV=production -p 4000:4000 pdf-reader-web

public/pdfs/input/.keep → public/pdfs/.keep


+ 0 - 0
public/pdfs/output/.keep


+ 0 - 26
server/api/index.js

@@ -1,29 +1,3 @@
 import express from 'express';
 const router = express.Router();
-const exec = require('child_process').exec;
-const xfdftoolCmd = './server/lib/xfdftool/bin/xfdftool';
-
-router.post('/hi', (req, res) => {
-  var output_file = "./public/pdfs/processing/big_1.pdf";
-  req.body.original_file = "./public/pdfs/input/big.pdf";
-  req.body.field_type = "signature";
-  req.body.form_attr = "rect=104,270,246,323 page=1 fieldname=kdan-pdf1234 bdcolor=#33bedb bgcolor=#33bedb";
-
-  var command = exec(`${xfdftoolCmd} create -o ${output_file} ${req.body.original_file} ${req.body.field_type} ${req.body.form_attr}`,
-    (error, stdout, stderr) => {
-      if (error !== null) {
-        res.status(500);
-        res.json({
-          error_message: stderr
-        });
-      }
-      else {
-        res.status(200);
-        res.json({
-          data: stdout,
-        });
-      }
-    });
-});
-
 export default router;

+ 0 - 0
server/lib/xfdftool/.keep


BIN
server/lib/xfdftool/bin/xfdftool


+ 0 - 76
server/lib/xfdftool/include/mupdf/fitz.h

@@ -1,76 +0,0 @@
-#ifndef MUDPF_FITZ_H
-#define MUDPF_FITZ_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "mupdf/fitz/version.h"
-#include "mupdf/fitz/config.h"
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-
-#include "mupdf/fitz/crypt.h"
-#include "mupdf/fitz/getopt.h"
-#include "mupdf/fitz/geometry.h"
-#include "mupdf/fitz/hash.h"
-#include "mupdf/fitz/pool.h"
-#include "mupdf/fitz/string-util.h"
-#include "mupdf/fitz/tree.h"
-#include "mupdf/fitz/ucdn.h"
-#include "mupdf/fitz/bidi.h"
-#include "mupdf/fitz/xml.h"
-
-/* I/O */
-#include "mupdf/fitz/buffer.h"
-#include "mupdf/fitz/stream.h"
-#include "mupdf/fitz/compressed-buffer.h"
-#include "mupdf/fitz/filter.h"
-#include "mupdf/fitz/output.h"
-#include "mupdf/fitz/archive.h"
-
-/* Resources */
-#include "mupdf/fitz/store.h"
-#include "mupdf/fitz/colorspace.h"
-#include "mupdf/fitz/pixmap.h"
-#include "mupdf/fitz/glyph.h"
-#include "mupdf/fitz/bitmap.h"
-#include "mupdf/fitz/image.h"
-#include "mupdf/fitz/function.h"
-#include "mupdf/fitz/shade.h"
-#include "mupdf/fitz/font.h"
-#include "mupdf/fitz/path.h"
-#include "mupdf/fitz/text.h"
-#include "mupdf/fitz/separation.h"
-
-#include "mupdf/fitz/device.h"
-#include "mupdf/fitz/display-list.h"
-#include "mupdf/fitz/structured-text.h"
-
-#include "mupdf/fitz/transition.h"
-#include "mupdf/fitz/glyph-cache.h"
-
-/* Document */
-#include "mupdf/fitz/link.h"
-#include "mupdf/fitz/outline.h"
-#include "mupdf/fitz/document.h"
-#include "mupdf/fitz/annotation.h"
-
-#include "mupdf/fitz/util.h"
-
-/* Output formats */
-#include "mupdf/fitz/writer.h"
-#include "mupdf/fitz/band-writer.h"
-#include "mupdf/fitz/output-pnm.h"
-#include "mupdf/fitz/output-png.h"
-#include "mupdf/fitz/output-pwg.h"
-#include "mupdf/fitz/output-pcl.h"
-#include "mupdf/fitz/output-ps.h"
-#include "mupdf/fitz/output-svg.h"
-#include "mupdf/fitz/output-tga.h"
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 49
server/lib/xfdftool/include/mupdf/fitz/annotation.h

@@ -1,49 +0,0 @@
-#ifndef MUPDF_FITZ_ANNOTATION_H
-#define MUPDF_FITZ_ANNOTATION_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/geometry.h"
-#include "mupdf/fitz/document.h"
-
-/*
-	fz_new_annot_of_size: Create and initialize an annotation struct.
-*/
-fz_annot *fz_new_annot_of_size(fz_context *ctx, int size);
-
-#define fz_new_derived_annot(CTX, TYPE) \
-	((TYPE *)Memento_label(fz_new_annot_of_size(CTX,sizeof(TYPE)),#TYPE))
-
-/*
-	fz_keep_annot: Take a new reference to an annotation.
-*/
-fz_annot *fz_keep_annot(fz_context *ctx, fz_annot *annot);
-
-/*
-	fz_drop_annot: Drop a reference to an annotation. If the
-	reference count reaches zero, annot will be destroyed.
-*/
-void fz_drop_annot(fz_context *ctx, fz_annot *annot);
-
-/*
-	fz_first_annot: Return a pointer to the first annotation on a page.
-
-	Does not throw exceptions.
-*/
-fz_annot *fz_first_annot(fz_context *ctx, fz_page *page);
-
-/*
-	fz_next_annot: Return a pointer to the next annotation on a page.
-
-	Does not throw exceptions.
-*/
-fz_annot *fz_next_annot(fz_context *ctx, fz_annot *annot);
-
-/*
-	fz_bound_annot: Return the bounding rectangle of the annotation.
-
-	Does not throw exceptions.
-*/
-fz_rect *fz_bound_annot(fz_context *ctx, fz_annot *annot, fz_rect *rect);
-
-#endif

+ 0 - 188
server/lib/xfdftool/include/mupdf/fitz/archive.h

@@ -1,188 +0,0 @@
-#ifndef MUPDF_FITZ_ARCHIVE_H
-#define MUPDF_FITZ_ARCHIVE_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/buffer.h"
-#include "mupdf/fitz/stream.h"
-
-typedef struct fz_archive_s fz_archive;
-
-struct fz_archive_s
-{
-	fz_stream *file;
-	const char *format;
-
-	void (*drop_archive)(fz_context *ctx, fz_archive *arch);
-	int (*count_entries)(fz_context *ctx, fz_archive *arch);
-	const char *(*list_entry)(fz_context *ctx, fz_archive *arch, int idx);
-	int (*has_entry)(fz_context *ctx, fz_archive *arch, const char *name);
-	fz_buffer *(*read_entry)(fz_context *ctx, fz_archive *arch, const char *name);
-	fz_stream *(*open_entry)(fz_context *ctx, fz_archive *arch, const char *name);
-};
-
-/*
-	fz_new_archive: Create and initialize an archive struct.
-*/
-fz_archive *fz_new_archive_of_size(fz_context *ctx, fz_stream *file, int size);
-
-#define fz_new_derived_archive(C,F,M) \
-	((M*)Memento_label(fz_new_archive_of_size(C, F, sizeof(M)), #M))
-
-/*
-	fz_open_archive: Open a zip or tar archive
-
-	Open a file and identify its archive type based on the archive
-	signature contained inside.
-
-	filename: a path to a file as it would be given to open(2).
-*/
-fz_archive *fz_open_archive(fz_context *ctx, const char *filename);
-
-/*
-	fz_open_archive_with_stream: Open zip or tar archive stream.
-
-	Open an archive using a seekable stream object rather than
-	opening a file or directory on disk.
-*/
-fz_archive *fz_open_archive_with_stream(fz_context *ctx, fz_stream *file);
-
-/*
-	fz_open_directory: Open a directory as if it was an archive.
-
-	A special case where a directory is opened as if it was an
-	archive.
-
-	Note that for directories it is not possible to retrieve the
-	number of entries or list the entries. It is however possible
-	to check if the archive has a particular entry.
-
-	path: a path to a directory as it would be given to opendir(3).
-*/
-fz_archive *fz_open_directory(fz_context *ctx, const char *path);
-
-/*
-	fz_drop_archive: Release an open archive.
-
-	Any allocations for the archive are freed.
-*/
-void fz_drop_archive(fz_context *ctx, fz_archive *arch);
-
-/*
-	fz_archive_format: Returns the name of the archive format.
-*/
-const char *fz_archive_format(fz_context *ctx, fz_archive *arch);
-
-/*
-	fz_count_archive_entries: Number of entries in archive.
-
-	Will always return a value >= 0.
-*/
-int fz_count_archive_entries(fz_context *ctx, fz_archive *arch);
-
-/*
-	fz_list_archive_entry: Get listed name of entry position idx.
-
-	idx: Must be a value >= 0 < return value from
-	fz_count_archive_entries. If not in range NULL will be
-	returned.
-*/
-const char *fz_list_archive_entry(fz_context *ctx, fz_archive *arch, int idx);
-
-/*
-	fz_has_archive_entry: Check if entry by given name exists.
-
-	If named entry does not exist 0 will be returned, if it does
-	exist 1 is returned.
-
-	name: Entry name to look for, this must be an exact match to
-	the entry name in the archive.
-*/
-int fz_has_archive_entry(fz_context *ctx, fz_archive *arch, const char *name);
-
-/*
-	fz_open_archive_entry: Opens an archive entry as a stream.
-
-	name: Entry name to look for, this must be an exact match to
-	the entry name in the archive.
-*/
-fz_stream *fz_open_archive_entry(fz_context *ctx, fz_archive *arch, const char *name);
-
-/*
-	fz_read_archive_entry: Reads all bytes in an archive entry
-	into a buffer.
-
-	name: Entry name to look for, this must be an exact match to
-	the entry name in the archive.
-*/
-
-fz_buffer *fz_read_archive_entry(fz_context *ctx, fz_archive *arch, const char *name);
-
-/*
-	fz_is_tar_archive: Detect if stream object is a tar achieve.
-
-	Assumes that the stream object is seekable.
-*/
-int fz_is_tar_archive(fz_context *ctx, fz_stream *file);
-
-/*
-	fz_open_tar_archive: Open a tar archive file.
-
-	An exception is throw if the file is not a tar archive as
-	indicated by the presence of a tar signature.
-
-	filename: a path to a tar archive file as it would be given to
-	open(2).
-*/
-fz_archive *fz_open_tar_archive(fz_context *ctx, const char *filename);
-
-/*
-	fz_open_tar_archive_with_stream: Open a tar archive stream.
-
-	Open an archive using a seekable stream object rather than
-	opening a file or directory on disk.
-
-	An exception is throw if the stream is not a tar archive as
-	indicated by the presence of a tar signature.
-
-*/
-fz_archive *fz_open_tar_archive_with_stream(fz_context *ctx, fz_stream *file);
-
-/*
-	fz_is_zip_archive: Detect if stream object is a zip archive.
-
-	Assumes that the stream object is seekable.
-*/
-int fz_is_zip_archive(fz_context *ctx, fz_stream *file);
-
-/*
-	fz_open_zip_archive: Open a zip archive file.
-
-	An exception is throw if the file is not a zip archive as
-	indicated by the presence of a zip signature.
-
-	filename: a path to a zip archive file as it would be given to
-	open(2).
-*/
-fz_archive *fz_open_zip_archive(fz_context *ctx, const char *path);
-
-/*
-	fz_open_zip_archive: Open a zip archive stream.
-
-	Open an archive using a seekable stream object rather than
-	opening a file or directory on disk.
-
-	An exception is throw if the stream is not a zip archive as
-	indicated by the presence of a zip signature.
-
-*/
-fz_archive *fz_open_zip_archive_with_stream(fz_context *ctx, fz_stream *file);
-
-typedef struct fz_zip_writer_s fz_zip_writer;
-
-fz_zip_writer *fz_new_zip_writer(fz_context *ctx, const char *filename);
-void fz_write_zip_entry(fz_context *ctx, fz_zip_writer *zip, const char *name, fz_buffer *buf, int compress);
-void fz_close_zip_writer(fz_context *ctx, fz_zip_writer *zip);
-void fz_drop_zip_writer(fz_context *ctx, fz_zip_writer *zip);
-
-#endif

+ 0 - 74
server/lib/xfdftool/include/mupdf/fitz/band-writer.h

@@ -1,74 +0,0 @@
-#ifndef MUPDF_FITZ_BAND_WRITER_H
-#define MUPDF_FITZ_BAND_WRITER_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/output.h"
-
-/*
-	fz_band_writer
-*/
-typedef struct fz_band_writer_s fz_band_writer;
-
-typedef void (fz_write_header_fn)(fz_context *ctx, fz_band_writer *writer);
-typedef void (fz_write_band_fn)(fz_context *ctx, fz_band_writer *writer, int stride, int band_start, int band_height, const unsigned char *samples);
-typedef void (fz_write_trailer_fn)(fz_context *ctx, fz_band_writer *writer);
-typedef void (fz_drop_band_writer_fn)(fz_context *ctx, fz_band_writer *writer);
-
-struct fz_band_writer_s
-{
-	fz_drop_band_writer_fn *drop;
-	fz_write_header_fn *header;
-	fz_write_band_fn *band;
-	fz_write_trailer_fn *trailer;
-	fz_output *out;
-	int w;
-	int h;
-	int n;
-	int alpha;
-	int xres;
-	int yres;
-	int pagenum;
-	int line;
-};
-
-fz_band_writer *fz_new_band_writer_of_size(fz_context *ctx, size_t size, fz_output *out);
-#define fz_new_band_writer(C,M,O) ((M *)Memento_label(fz_new_band_writer_of_size(ctx, sizeof(M), O), #M))
-
-/*
-	fz_write_header: Cause a band writer to write the header for
-	a banded image with the given properties/dimensions etc. This
-	also configures the bandwriter for the format of the data to be
-	passed in future calls.
-
-	w, h: Width and Height of the entire page.
-
-	n: Number of components (including alphas).
-
-	alpha: Number of alpha components.
-
-	xres, yres: X and Y resolutions in dpi.
-
-	pagenum: Page number
-
-	Throws exception if incompatible data format.
-*/
-void fz_write_header(fz_context *ctx, fz_band_writer *writer, int w, int h, int n, int alpha, int xres, int yres, int pagenum);
-
-/*
-	fz_write_band: Cause a band writer to write the next band
-	of data for an image.
-
-	stride: The byte offset from the first byte of the data
-	for a pixel to the first byte of the data for the same pixel
-	on the row below.
-
-	band_height: The number of lines in this band.
-
-	samples: Pointer to first byte of the data.
-*/
-void fz_write_band(fz_context *ctx, fz_band_writer *writer, int stride, int band_height, const unsigned char *samples);
-
-void fz_drop_band_writer(fz_context *ctx, fz_band_writer *writer);
-
-#endif

+ 0 - 87
server/lib/xfdftool/include/mupdf/fitz/bidi.h

@@ -1,87 +0,0 @@
-/*
-	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
-
-#include "mupdf/fitz/system.h"
-
-typedef enum fz_bidi_direction_e
-{
-	FZ_BIDI_LTR = 0,
-	FZ_BIDI_RTL = 1,
-	FZ_BIDI_NEUTRAL = 2
-}
-fz_bidi_direction;
-
-typedef enum fz_bidi_flags_e
-{
-	BIDI_CLASSIFY_WHITE_SPACE = 1,
-	BIDI_REPLACE_TAB = 2
-}
-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
-*/
-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)
-*/
-void fz_bidi_fragment_text(fz_context *ctx,
-			const uint32_t *text,
-			size_t textlen,
-			fz_bidi_direction *baseDir,
-			fz_bidi_fragment_callback *callback,
-			void *arg,
-			int flags);
-
-#endif

+ 0 - 142
server/lib/xfdftool/include/mupdf/fitz/bitmap.h

@@ -1,142 +0,0 @@
-#ifndef MUPDF_FITZ_BITMAP_H
-#define MUPDF_FITZ_BITMAP_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/pixmap.h"
-
-/*
-	Bitmaps have 1 bit per component. Only used for creating halftoned
-	versions of contone buffers, and saving out. Samples are stored msb
-	first, akin to pbms.
-*/
-typedef struct fz_bitmap_s fz_bitmap;
-
-/*
-	fz_keep_bitmap: Take a reference to a bitmap.
-
-	bit: The bitmap to increment the reference for.
-
-	Returns bit. Does not throw exceptions.
-*/
-fz_bitmap *fz_keep_bitmap(fz_context *ctx, fz_bitmap *bit);
-
-/*
-	fz_drop_bitmap: Drop a reference and free a bitmap.
-
-	Decrement the reference count for the bitmap. When no
-	references remain the pixmap will be freed.
-
-	Does not throw exceptions.
-*/
-void fz_drop_bitmap(fz_context *ctx, fz_bitmap *bit);
-
-/*
-	A halftone is a set of threshold tiles, one per component. Each
-	threshold tile is a pixmap, possibly of varying sizes and phases.
-	Currently, we only provide one 'default' halftone tile for operating
-	on 1 component plus alpha pixmaps (where the alpha is ignored). This
-	is signified by a fz_halftone pointer to NULL.
-*/
-typedef struct fz_halftone_s fz_halftone;
-
-/*
-	fz_new_bitmap_from_pixmap: Make a bitmap from a pixmap and a halftone.
-
-	pix: The pixmap to generate from. Currently must be a single color
-	component with no alpha.
-
-	ht: The halftone to use. NULL implies the default halftone.
-
-	Returns the resultant bitmap. Throws exceptions in the case of
-	failure to allocate.
-*/
-fz_bitmap *fz_new_bitmap_from_pixmap(fz_context *ctx, fz_pixmap *pix, fz_halftone *ht);
-
-/*
-	fz_new_bitmap_from_pixmap_band: Make a bitmap from a pixmap and a
-	halftone, allowing for the position of the pixmap within an
-	overall banded rendering.
-
-	pix: The pixmap to generate from. Currently must be a single color
-	component with no alpha.
-
-	ht: The halftone to use. NULL implies the default halftone.
-
-	band_start: Vertical offset within the overall banded rendering
-	(in pixels)
-
-	Returns the resultant bitmap. Throws exceptions in the case of
-	failure to allocate.
-*/
-fz_bitmap *fz_new_bitmap_from_pixmap_band(fz_context *ctx, fz_pixmap *pix, fz_halftone *ht, int band_start);
-
-struct fz_bitmap_s
-{
-	int refs;
-	int w, h, stride, n;
-	int xres, yres;
-	unsigned char *samples;
-};
-
-/*
-	fz_new_bitmap: Create a new bitmap.
-
-	w, h: Width and Height for the bitmap
-
-	n: Number of color components (assumed to be a divisor of 8)
-
-	xres, yres: X and Y resolutions (in pixels per inch).
-
-	Returns pointer to created bitmap structure. The bitmap
-	data is uninitialised.
-*/
-fz_bitmap *fz_new_bitmap(fz_context *ctx, int w, int h, int n, int xres, int yres);
-
-/*
-	fz_bitmap_details: Retrieve details of a given bitmap.
-
-	bitmap: The bitmap to query.
-
-	w: Pointer to storage to retrieve width (or NULL).
-
-	h: Pointer to storage to retrieve height (or NULL).
-
-	n: Pointer to storage to retrieve number of color components (or NULL).
-
-	stride: Pointer to storage to retrieve bitmap stride (or NULL).
-*/
-void fz_bitmap_details(fz_bitmap *bitmap, int *w, int *h, int *n, int *stride);
-
-/*
-	fz_clear_bitmap: Clear a previously created bitmap.
-
-	bit: The bitmap to clear.
-*/
-void fz_clear_bitmap(fz_context *ctx, fz_bitmap *bit);
-
-/*
-	fz_default_halftone: Create a 'default' halftone structure
-	for the given number of components.
-
-	num_comps: The number of components to use.
-
-	Returns a simple default halftone. The default halftone uses
-	the same halftone tile for each plane, which may not be ideal
-	for all purposes.
-*/
-fz_halftone *fz_default_halftone(fz_context *ctx, int num_comps);
-
-/*
-	fz_keep_halftone: Take an additional reference to a
-	halftone.
-*/
-fz_halftone *fz_keep_halftone(fz_context *ctx, fz_halftone *half);
-
-/*
-	fz_drop_halftone: Drop a reference to a halftone. If the
-	reference count reaches zero, ht will be destroyed.
-*/
-void fz_drop_halftone(fz_context *ctx, fz_halftone *ht);
-
-#endif

+ 0 - 147
server/lib/xfdftool/include/mupdf/fitz/buffer.h

@@ -1,147 +0,0 @@
-#ifndef MUPDF_FITZ_BUFFER_H
-#define MUPDF_FITZ_BUFFER_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-
-/*
-	fz_buffer is a wrapper around a dynamically allocated array of bytes.
-
-	Buffers have a capacity (the number of bytes storage immediately
-	available) and a current size.
-*/
-typedef struct fz_buffer_s fz_buffer;
-
-/*
-	fz_keep_buffer: Increment the reference count for a buffer.
-
-	Returns a pointer to the buffer.
-*/
-fz_buffer *fz_keep_buffer(fz_context *ctx, fz_buffer *buf);
-
-/*
-	fz_drop_buffer: Decrement the reference count for a buffer.
-*/
-void fz_drop_buffer(fz_context *ctx, fz_buffer *buf);
-
-/*
-	fz_buffer_storage: Retrieve internal memory of buffer.
-
-	datap: Output parameter that will be pointed to the data.
-
-	Returns the current size of the data in bytes.
-*/
-size_t fz_buffer_storage(fz_context *ctx, fz_buffer *buf, unsigned char **datap);
-
-/*
-	fz_string_from_buffer: Ensure that a buffer's data ends in a
-	0 byte, and return a pointer to it.
-*/
-const char *fz_string_from_buffer(fz_context *ctx, fz_buffer *buf);
-
-/*
-	fz_new_buffer: Create a new buffer.
-
-	capacity: Initial capacity.
-
-	Returns pointer to new buffer.
-*/
-fz_buffer *fz_new_buffer(fz_context *ctx, size_t capacity);
-
-/*
-	fz_new_buffer_from_data: Create a new buffer with existing data.
-
-	data: Pointer to existing data.
-	size: Size of existing data.
-
-	Takes ownership of data. Does not make a copy. Calls fz_free on the
-	data when the buffer is deallocated. Do not use 'data' after passing
-	to this function.
-
-	Returns pointer to new buffer. Throws exception on allocation
-	failure.
-*/
-fz_buffer *fz_new_buffer_from_data(fz_context *ctx, unsigned char *data, size_t size);
-
-/*
-	fz_new_buffer_from_shared_data: Like fz_new_buffer, but does not take ownership.
-*/
-fz_buffer *fz_new_buffer_from_shared_data(fz_context *ctx, const char *data, size_t size);
-
-/*
-	fz_new_buffer_from_base64: Create a new buffer with data decoded from a base64 input string.
-*/
-fz_buffer *fz_new_buffer_from_base64(fz_context *ctx, const char *data, size_t size);
-
-/*
-	fz_resize_buffer: Ensure that a buffer has a given capacity,
-	truncating data if required.
-
-	capacity: The desired capacity for the buffer. If the current size
-	of the buffer contents is smaller than capacity, it is truncated.
-*/
-void fz_resize_buffer(fz_context *ctx, fz_buffer *buf, size_t capacity);
-
-/*
-	fz_grow_buffer: Make some space within a buffer (i.e. ensure that
-	capacity > size).
-*/
-void fz_grow_buffer(fz_context *ctx, fz_buffer *buf);
-
-/*
-	fz_trim_buffer: Trim wasted capacity from a buffer by resizing internal memory.
-*/
-void fz_trim_buffer(fz_context *ctx, fz_buffer *buf);
-
-/*
-	fz_append_buffer: Append the contents of source buffer to destination buffer.
-*/
-void fz_append_buffer(fz_context *ctx, fz_buffer *destination, fz_buffer *source);
-
-/*
-	fz_append_*: Append data to a buffer.
-	fz_append_printf: Format and append data to buffer using printf-like formatting (see fz_vsnprintf).
-	fz_append_pdf_string: Append a string with PDF syntax quotes and escapes.
-	The buffer will automatically grow as required.
-*/
-void fz_append_data(fz_context *ctx, fz_buffer *buf, const void *data, size_t len);
-void fz_append_string(fz_context *ctx, fz_buffer *buf, const char *data);
-void fz_append_byte(fz_context *ctx, fz_buffer *buf, int c);
-void fz_append_rune(fz_context *ctx, fz_buffer *buf, int c);
-void fz_append_int32_le(fz_context *ctx, fz_buffer *buf, int x);
-void fz_append_int16_le(fz_context *ctx, fz_buffer *buf, int x);
-void fz_append_bits(fz_context *ctx, fz_buffer *buf, int value, int count);
-void fz_append_bits_pad(fz_context *ctx, fz_buffer *buf);
-void fz_append_printf(fz_context *ctx, fz_buffer *buffer, const char *fmt, ...);
-void fz_append_vprintf(fz_context *ctx, fz_buffer *buffer, const char *fmt, va_list args);
-void fz_append_pdf_string(fz_context *ctx, fz_buffer *buffer, const char *text);
-
-/*
-	fz_terminate_buffer: Zero-terminate buffer in order to use as a C string.
-
-	This byte is invisible and does not affect the length of the buffer as returned by fz_buffer_storage.
-	The zero byte is written *after* the data, and subsequent writes will overwrite the terminating byte.
-*/
-void fz_terminate_buffer(fz_context *ctx, fz_buffer *buf);
-
-/*
-	fz_md5_buffer: Create MD5 digest of buffer contents.
-*/
-void fz_md5_buffer(fz_context *ctx, fz_buffer *buffer, unsigned char digest[16]);
-
-/*
-	fz_buffer_extract: Take ownership of buffer contents.
-	Performs the same task as fz_buffer_storage, but ownership of
-	the data buffer returns with this call. The buffer is left
-	empty.
-
-	Note: Bad things may happen if this is called on a buffer with
-	multiple references that is being used from multiple threads.
-
-	data: Pointer to place to retrieve data pointer.
-
-	Returns length of stream.
-*/
-size_t fz_buffer_extract(fz_context *ctx, fz_buffer *buf, unsigned char **data);
-
-#endif

+ 0 - 118
server/lib/xfdftool/include/mupdf/fitz/colorspace.h

@@ -1,118 +0,0 @@
-#ifndef MUPDF_FITZ_COLORSPACE_H
-#define MUPDF_FITZ_COLORSPACE_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/store.h"
-
-enum { FZ_MAX_COLORS = 32 };
-
-/*
-	A fz_colorspace object represents an abstract colorspace. While
-	this should be treated as a black box by callers of the library at
-	this stage, know that it encapsulates knowledge of how to convert
-	colors to and from the colorspace, any lookup tables generated, the
-	number of components in the colorspace etc.
-*/
-typedef struct fz_colorspace_s fz_colorspace;
-
-/*
-	fz_colorspace_is_indexed: Return true, iff a given colorspace is
-	indexed.
-*/
-int fz_colorspace_is_indexed(fz_context *ctx, fz_colorspace *cs);
-
-/*
-	fz_colorspace_is_lab: Return true, iff a given colorspace is
-	lab.
-*/
-int fz_colorspace_is_lab(fz_context *ctx, fz_colorspace *cs);
-
-/*
-	fz_colorspace_is_subtractive: Return true if a colorspace is subtractive.
-
-	True for CMYK, Separation and DeviceN colorspaces.
-*/
-int fz_colorspace_is_subtractive(fz_context *ctx, fz_colorspace *pix);
-
-/*
-	fz_device_gray: Get colorspace representing device specific gray.
-*/
-fz_colorspace *fz_device_gray(fz_context *ctx);
-
-/*
-	fz_device_rgb: Get colorspace representing device specific rgb.
-*/
-fz_colorspace *fz_device_rgb(fz_context *ctx);
-
-/*
-	fz_device_bgr: Get colorspace representing device specific bgr.
-*/
-fz_colorspace *fz_device_bgr(fz_context *ctx);
-
-/*
-	fz_device_cmyk: Get colorspace representing device specific CMYK.
-*/
-fz_colorspace *fz_device_cmyk(fz_context *ctx);
-
-/*
-	fz_device_lab: Get colorspace representing device specific LAB.
-*/
-fz_colorspace *fz_device_lab(fz_context *ctx);
-
-/*
-	fz_set_device_gray: Set colorspace representing device specific gray.
-*/
-void fz_set_device_gray(fz_context *ctx, fz_colorspace *cs);
-
-/*
-	fz_set_device_rgb: Set colorspace representing device specific rgb.
-*/
-void fz_set_device_rgb(fz_context *ctx, fz_colorspace *cs);
-
-/*
-	fz_set_device_bgr: Set colorspace representing device specific bgr.
-*/
-void fz_set_device_bgr(fz_context *ctx, fz_colorspace *cs);
-
-/*
-	fz_set_device_cmyk: Set colorspace representing device specific CMYK.
-*/
-void fz_set_device_cmyk(fz_context *ctx, fz_colorspace *cs);
-
-typedef void (fz_colorspace_convert_fn)(fz_context *ctx, fz_colorspace *cs, const float *src, float *dst);
-
-typedef void (fz_colorspace_destruct_fn)(fz_context *ctx, fz_colorspace *cs);
-
-fz_colorspace *fz_new_colorspace(fz_context *ctx, char *name, int n, int is_subtractive, fz_colorspace_convert_fn *to_rgb, fz_colorspace_convert_fn *from_rgb, fz_colorspace_destruct_fn *destruct, void *data, size_t size);
-fz_colorspace *fz_new_indexed_colorspace(fz_context *ctx, fz_colorspace *base, int high, unsigned char *lookup);
-fz_colorspace *fz_keep_colorspace(fz_context *ctx, fz_colorspace *colorspace);
-void fz_drop_colorspace(fz_context *ctx, fz_colorspace *colorspace);
-void fz_drop_colorspace_imp(fz_context *ctx, fz_storable *colorspace);
-
-int fz_colorspace_is(fz_context *ctx, const fz_colorspace *cs, fz_colorspace_convert_fn *to_rgb);
-int fz_colorspace_n(fz_context *ctx, const fz_colorspace *cs);
-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);
-
-typedef struct fz_color_converter_s fz_color_converter;
-
-/* This structure is public because it allows us to avoid dynamic allocations.
- * Callers should only rely on the convert entry - the rest of the structure
- * is subject to change without notice.
- */
-struct fz_color_converter_s
-{
-	void (*convert)(fz_context *, fz_color_converter *, float *, const float *);
-	fz_colorspace *ds;
-	fz_colorspace *ss;
-	void *opaque;
-};
-
-void fz_lookup_color_converter(fz_context *ctx, fz_color_converter *cc, fz_colorspace *ds, fz_colorspace *ss);
-
-void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_colorspace *ds, fz_colorspace *ss);
-void fz_fin_cached_color_converter(fz_context *ctx, fz_color_converter *cc);
-
-#endif

+ 0 - 89
server/lib/xfdftool/include/mupdf/fitz/compressed-buffer.h

@@ -1,89 +0,0 @@
-#ifndef MUPDF_FITZ_COMPRESSED_BUFFER_H
-#define MUPDF_FITZ_COMPRESSED_BUFFER_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/buffer.h"
-#include "mupdf/fitz/stream.h"
-
-typedef struct fz_compression_params_s fz_compression_params;
-
-typedef struct fz_compressed_buffer_s fz_compressed_buffer;
-size_t fz_compressed_buffer_size(fz_compressed_buffer *buffer);
-
-fz_stream *fz_open_compressed_buffer(fz_context *ctx, fz_compressed_buffer *);
-fz_stream *fz_open_image_decomp_stream_from_buffer(fz_context *ctx, fz_compressed_buffer *, int *l2factor);
-fz_stream *fz_open_image_decomp_stream(fz_context *ctx, fz_stream *, fz_compression_params *, int *l2factor);
-
-enum
-{
-	FZ_IMAGE_UNKNOWN = 0,
-
-	/* Uncompressed samples */
-	FZ_IMAGE_RAW,
-
-	/* Compressed samples */
-	FZ_IMAGE_FAX,
-	FZ_IMAGE_FLATE,
-	FZ_IMAGE_LZW,
-	FZ_IMAGE_RLD,
-
-	/* Full image formats */
-	FZ_IMAGE_BMP,
-	FZ_IMAGE_GIF,
-	FZ_IMAGE_JPEG,
-	FZ_IMAGE_JPX,
-	FZ_IMAGE_JXR,
-	FZ_IMAGE_PNG,
-	FZ_IMAGE_PNM,
-	FZ_IMAGE_TIFF,
-};
-
-struct fz_compression_params_s
-{
-	int type;
-	union {
-		struct {
-			int color_transform; /* Use -1 for unset */
-		} jpeg;
-		struct {
-			int smask_in_data;
-		} jpx;
-		struct {
-			int columns;
-			int rows;
-			int k;
-			int end_of_line;
-			int encoded_byte_align;
-			int end_of_block;
-			int black_is_1;
-			int damaged_rows_before_error;
-		} fax;
-		struct
-		{
-			int columns;
-			int colors;
-			int predictor;
-			int bpc;
-		}
-		flate;
-		struct
-		{
-			int columns;
-			int colors;
-			int predictor;
-			int bpc;
-			int early_change;
-		} lzw;
-	} u;
-};
-
-struct fz_compressed_buffer_s
-{
-	fz_compression_params params;
-	fz_buffer *buffer;
-};
-
-void fz_drop_compressed_buffer(fz_context *ctx, fz_compressed_buffer *buf);
-
-#endif

+ 0 - 156
server/lib/xfdftool/include/mupdf/fitz/config.h

@@ -1,156 +0,0 @@
-#ifndef FZ_CONFIG_H
-
-#define FZ_CONFIG_H
-
-/*
-	Choose which plotters we need.
-	By default we build the greyscale, RGB and CMYK plotters in,
-	but omit the arbitrary plotters. To avoid building
-	plotters in that aren't needed, define the unwanted
-	FZ_PLOTTERS_... define to 0.
-*/
-/* #define FZ_PLOTTERS_G 1 */
-/* #define FZ_PLOTTERS_RGB 1 */
-/* #define FZ_PLOTTERS_CMYK 1 */
-/* #define FZ_PLOTTERS_N 0 */
-
-/*
-	Choose which document agents to include.
-	By default all but GPRF are enabled. To avoid building unwanted
-	ones, define FZ_ENABLE_... to 0.
-*/
-/* #define FZ_ENABLE_PDF 1 */
-/* #define FZ_ENABLE_XPS 1 */
-/* #define FZ_ENABLE_SVG 1 */
-/* #define FZ_ENABLE_CBZ 1 */
-/* #define FZ_ENABLE_IMG 1 */
-/* #define FZ_ENABLE_TIFF 1 */
-/* #define FZ_ENABLE_HTML 1 */
-/* #define FZ_ENABLE_EPUB 1 */
-/* #define FZ_ENABLE_GPRF 1 */
-
-/*
-	Choose whether to enable JPEG2000 decoding.
-	By default, it is enabled, but due to frequent security
-	issues with the third party libraries we support disabling
-	it with this flag.
-*/
-/* #define FZ_ENABLE_JPX 1 */
-
-/*
-	Choose whether to enable JavaScript.
-	By default JavaScript is enabled both for mutool and PDF interactivity.
-*/
-/* #define FZ_ENABLE_JS 1 */
-
-/*
-	Choose which fonts to include.
-	By default we include the base 14 PDF fonts,
-	DroidSansFallback from Android for CJK, and
-	Charis SIL from SIL for epub/html.
-	Enable the following defines to AVOID including
-	unwanted fonts.
-*/
-/* To avoid all noto fonts except CJK, enable: */
-/* #define TOFU */
-
-/* To skip the CJK font, enable: (this implicitly enables TOFU_CJK_EXT and TOFU_CJK_LANG) */
-/* #define TOFU_CJK */
-
-/* To skip CJK Extension A, enable: (this implicitly enables TOFU_CJK_LANG) */
-/* #define TOFU_CJK_EXT */
-
-/* To skip CJK language specific fonts, enable: */
-/* #define TOFU_CJK_LANG */
-
-/* To skip the Emoji font, enable: */
-/* #define TOFU_EMOJI */
-
-/* To skip the ancient/historic scripts, enable: */
-/* #define TOFU_HISTORIC */
-
-/* To skip the symbol font, enable: */
-/* #define TOFU_SYMBOL */
-
-/* To skip the SIL fonts, enable: */
-/* #define TOFU_SIL */
-
-/* To skip the Base14 fonts, enable: */
-/* #define TOFU_BASE14 */
-/* (You probably really don't want to do that except for measurement purposes!) */
-
-/* ---------- DO NOT EDIT ANYTHING UNDER THIS LINE ---------- */
-
-#ifndef FZ_PLOTTERS_G
-#define FZ_PLOTTERS_G 1
-#endif /* FZ_PLOTTERS_G */
-
-#ifndef FZ_PLOTTERS_RGB
-#define FZ_PLOTTERS_RGB 1
-#endif /* FZ_PLOTTERS_RGB */
-
-#ifndef FZ_PLOTTERS_CMYK
-#define FZ_PLOTTERS_CMYK 1
-#endif /* FZ_PLOTTERS_CMYK */
-
-#ifndef FZ_PLOTTERS_N
-#define FZ_PLOTTERS_N 0
-#endif /* FZ_PLOTTERS_N */
-
-/* We need at least 1 plotter defined */
-#if FZ_PLOTTERS_G == 0 && FZ_PLOTTERS_RGB == 0 && FZ_PLOTTERS_CMYK == 0
-#undef FZ_PLOTTERS_N
-#define FZ_PLOTTERS_N 1
-#endif
-
-#ifndef FZ_ENABLE_PDF
-#define FZ_ENABLE_PDF 1
-#endif /* FZ_ENABLE_PDF */
-
-#ifndef FZ_ENABLE_XPS
-#define FZ_ENABLE_XPS 1
-#endif /* FZ_ENABLE_XPS */
-
-#ifndef FZ_ENABLE_SVG
-#define FZ_ENABLE_SVG 1
-#endif /* FZ_ENABLE_SVG */
-
-#ifndef FZ_ENABLE_CBZ
-#define FZ_ENABLE_CBZ 1
-#endif /* FZ_ENABLE_CBZ */
-
-#ifndef FZ_ENABLE_IMG
-#define FZ_ENABLE_IMG 1
-#endif /* FZ_ENABLE_IMG */
-
-#ifndef FZ_ENABLE_TIFF
-#define FZ_ENABLE_TIFF 1
-#endif /* FZ_ENABLE_TIFF */
-
-#ifndef FZ_ENABLE_HTML
-#define FZ_ENABLE_HTML 1
-#endif /* FZ_ENABLE_HTML */
-
-#ifndef FZ_ENABLE_EPUB
-#define FZ_ENABLE_EPUB 1
-#endif /* FZ_ENABLE_EPUB */
-
-#ifndef FZ_ENABLE_GPRF
-#define FZ_ENABLE_GPRF 0
-#endif /* FZ_ENABLE_GPRF */
-
-#ifndef FZ_ENABLE_JPX
-#define FZ_ENABLE_JPX 1
-#endif /* FZ_ENABLE_JPX */
-
-#ifndef FZ_ENABLE_JS
-#define FZ_ENABLE_JS 1
-#endif /* FZ_ENABLE_JS */
-
-/* If Epub and HTML are both disabled, disable SIL fonts */
-#if FZ_ENABLE_HTML == 0 && FZ_ENABLE_EPUB == 0
-#undef TOFU_SIL
-#define TOFU_SIL
-#endif
-
-#endif /* FZ_CONFIG_H */

+ 0 - 709
server/lib/xfdftool/include/mupdf/fitz/context.h

@@ -1,709 +0,0 @@
-#ifndef MUPDF_FITZ_CONTEXT_H
-#define MUPDF_FITZ_CONTEXT_H
-
-#include "mupdf/fitz/version.h"
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/geometry.h"
-
-/*
-	Contexts
-*/
-
-typedef struct fz_alloc_context_s fz_alloc_context;
-typedef struct fz_error_context_s fz_error_context;
-typedef struct fz_error_stack_slot_s fz_error_stack_slot;
-typedef struct fz_id_context_s fz_id_context;
-typedef struct fz_warn_context_s fz_warn_context;
-typedef struct fz_font_context_s fz_font_context;
-typedef struct fz_colorspace_context_s fz_colorspace_context;
-typedef struct fz_aa_context_s fz_aa_context;
-typedef struct fz_style_context_s fz_style_context;
-typedef struct fz_locks_context_s fz_locks_context;
-typedef struct fz_tuning_context_s fz_tuning_context;
-typedef struct fz_store_s fz_store;
-typedef struct fz_glyph_cache_s fz_glyph_cache;
-typedef struct fz_document_handler_context_s fz_document_handler_context;
-typedef struct fz_output_context_s fz_output_context;
-typedef struct fz_context_s fz_context;
-
-struct fz_alloc_context_s
-{
-	void *user;
-	void *(*malloc)(void *, size_t);
-	void *(*realloc)(void *, void *, size_t);
-	void (*free)(void *, void *);
-};
-
-struct fz_error_stack_slot_s
-{
-	int code;
-	fz_jmp_buf buffer;
-};
-
-struct fz_error_context_s
-{
-	fz_error_stack_slot *top;
-	fz_error_stack_slot stack[256];
-	int errcode;
-	char message[256];
-};
-
-void fz_var_imp(void *);
-#define fz_var(var) fz_var_imp((void *)&(var))
-
-/*
-	Exception macro definitions. Just treat these as a black box - pay no
-	attention to the man behind the curtain.
-*/
-
-#define fz_try(ctx) \
-	{ \
-		if (fz_push_try(ctx)) { \
-			if (fz_setjmp((ctx)->error->top->buffer) == 0) do \
-
-#define fz_always(ctx) \
-			while (0); \
-		} \
-		if (ctx->error->top->code < 3) { \
-			ctx->error->top->code++; \
-			do \
-
-#define fz_catch(ctx) \
-			while (0); \
-		} \
-	} \
-	if ((ctx->error->top--)->code > 1)
-
-int fz_push_try(fz_context *ctx);
-FZ_NORETURN void fz_vthrow(fz_context *ctx, int errcode, const char *, va_list ap);
-FZ_NORETURN void fz_throw(fz_context *ctx, int errcode, const char *, ...) __printflike(3, 4);
-FZ_NORETURN void fz_rethrow(fz_context *ctx);
-void fz_vwarn(fz_context *ctx, const char *fmt, va_list ap);
-void fz_warn(fz_context *ctx, const char *fmt, ...) __printflike(2, 3);
-const char *fz_caught_message(fz_context *ctx);
-int fz_caught(fz_context *ctx);
-void fz_rethrow_if(fz_context *ctx, int errcode);
-
-enum
-{
-	FZ_ERROR_NONE = 0,
-	FZ_ERROR_MEMORY = 1,
-	FZ_ERROR_GENERIC = 2,
-	FZ_ERROR_SYNTAX = 3,
-	FZ_ERROR_TRYLATER = 4,
-	FZ_ERROR_ABORT = 5,
-	FZ_ERROR_COUNT
-};
-
-/*
-	fz_flush_warnings: Flush any repeated warnings.
-
-	Repeated warnings are buffered, counted and eventually printed
-	along with the number of repetitions. Call fz_flush_warnings
-	to force printing of the latest buffered warning and the
-	number of repetitions, for example to make sure that all
-	warnings are printed before exiting an application.
-
-	Does not throw exceptions.
-*/
-void fz_flush_warnings(fz_context *ctx);
-
-struct fz_context_s
-{
-	void *user;
-	const fz_alloc_context *alloc;
-	const fz_locks_context *locks;
-	fz_id_context *id;
-	fz_error_context *error;
-	fz_warn_context *warn;
-	fz_font_context *font;
-	fz_colorspace_context *colorspace;
-	fz_aa_context *aa;
-	fz_style_context *style;
-	fz_store *store;
-	fz_glyph_cache *glyph_cache;
-	fz_tuning_context *tuning;
-	fz_document_handler_context *handler;
-	fz_output_context *output;
-};
-
-/*
-	Specifies the maximum size in bytes of the resource store in
-	fz_context. Given as argument to fz_new_context.
-
-	FZ_STORE_UNLIMITED: Let resource store grow unbounded.
-
-	FZ_STORE_DEFAULT: A reasonable upper bound on the size, for
-	devices that are not memory constrained.
-*/
-enum {
-	FZ_STORE_UNLIMITED = 0,
-	FZ_STORE_DEFAULT = 256 << 20,
-};
-
-/*
-	fz_new_context: Allocate context containing global state.
-
-	The global state contains an exception stack, resource store,
-	etc. Most functions in MuPDF take a context argument to be
-	able to reference the global state. See fz_drop_context for
-	freeing an allocated context.
-
-	alloc: Supply a custom memory allocator through a set of
-	function pointers. Set to NULL for the standard library
-	allocator. The context will keep the allocator pointer, so the
-	data it points to must not be modified or freed during the
-	lifetime of the context.
-
-	locks: Supply a set of locks and functions to lock/unlock
-	them, intended for multi-threaded applications. Set to NULL
-	when using MuPDF in a single-threaded applications. The
-	context will keep the locks pointer, so the data it points to
-	must not be modified or freed during the lifetime of the
-	context.
-
-	max_store: Maximum size in bytes of the resource store, before
-	it will start evicting cached resources such as fonts and
-	images. FZ_STORE_UNLIMITED can be used if a hard limit is not
-	desired. Use FZ_STORE_DEFAULT to get a reasonable size.
-
-	Does not throw exceptions, but may return NULL.
-*/
-fz_context *fz_new_context_imp(const fz_alloc_context *alloc, const fz_locks_context *locks, size_t max_store, const char *version);
-
-#define fz_new_context(alloc, locks, max_store) fz_new_context_imp(alloc, locks, max_store, FZ_VERSION)
-
-/*
-	fz_clone_context: Make a clone of an existing context.
-
-	This function is meant to be used in multi-threaded
-	applications where each thread requires its own context, yet
-	parts of the global state, for example caching, is shared.
-
-	ctx: Context obtained from fz_new_context to make a copy of.
-	ctx must have had locks and lock/functions setup when created.
-	The two contexts will share the memory allocator, resource
-	store, locks and lock/unlock functions. They will each have
-	their own exception stacks though.
-
-	Does not throw exception, but may return NULL.
-*/
-fz_context *fz_clone_context(fz_context *ctx);
-
-/*
-	fz_drop_context: Free a context and its global state.
-
-	The context and all of its global state is freed, and any
-	buffered warnings are flushed (see fz_flush_warnings). If NULL
-	is passed in nothing will happen.
-
-	Does not throw exceptions.
-*/
-void fz_drop_context(fz_context *ctx);
-
-/*
-	fz_set_user_context: Set the user field in the context.
-
-	NULL initially, this field can be set to any opaque value
-	required by the user. It is copied on clones.
-
-	Does not throw exceptions.
-*/
-void fz_set_user_context(fz_context *ctx, void *user);
-
-/*
-	fz_user_context: Read the user field from the context.
-
-	Does not throw exceptions.
-*/
-void *fz_user_context(fz_context *ctx);
-
-/*
-	In order to tune MuPDF's behaviour, certain functions can
-	(optionally) be provided by callers.
-*/
-
-/*
-	fz_tune_image_decode_fn: Given the width and height of an image,
-	the subsample factor, and the subarea of the image actually
-	required, the caller can decide whether to decode the whole image
-	or just a subarea.
-
-	arg: The caller supplied opaque argument.
-
-	w, h: The width/height of the complete image.
-
-	l2factor: The log2 factor for subsampling (i.e. image will be
-	decoded to (w>>l2factor, h>>l2factor)).
-
-	subarea: The actual subarea required for the current operation.
-	The tuning function is allowed to increase this in size if required.
-*/
-typedef void (fz_tune_image_decode_fn)(void *arg, int w, int h, int l2factor, fz_irect *subarea);
-
-/*
-	fz_tune_image_scale_fn: Given the source width and height of
-	image, together with the actual required width and height,
-	decide whether we should use mitchell scaling.
-
-	arg: The caller supplied opaque argument.
-
-	dst_w, dst_h: The actual width/height required on the target device.
-
-	src_w, src_h: The source width/height of the image.
-
-	Return 0 not to use the Mitchell scaler, 1 to use the Mitchell scaler. All
-	other values reserved.
-*/
-typedef int (fz_tune_image_scale_fn)(void *arg, int dst_w, int dst_h, int src_w, int src_h);
-
-/*
-	fz_tune_image_decode: Set the tuning function to use for
-	image decode.
-
-	image_decode: Function to use.
-
-	arg: Opaque argument to be passed to tuning function.
-*/
-void fz_tune_image_decode(fz_context *ctx, fz_tune_image_decode_fn *image_decode, void *arg);
-
-/*
-	fz_tune_image_scale: Set the tuning function to use for
-	image scaling.
-
-	image_scale: Function to use.
-
-	arg: Opaque argument to be passed to tuning function.
-*/
-void fz_tune_image_scale(fz_context *ctx, fz_tune_image_scale_fn *image_scale, void *arg);
-
-/*
-	fz_aa_level: Get the number of bits of antialiasing we are
-	using (for graphics). Between 0 and 8.
-*/
-int fz_aa_level(fz_context *ctx);
-
-/*
-	fz_set_aa_level: Set the number of bits of antialiasing we should
-	use (for both text and graphics).
-
-	bits: The number of bits of antialiasing to use (values are clamped
-	to within the 0 to 8 range).
-*/
-void fz_set_aa_level(fz_context *ctx, int bits);
-
-/*
-	fz_text_aa_level: Get the number of bits of antialiasing we are
-	using for text. Between 0 and 8.
-*/
-int fz_text_aa_level(fz_context *ctx);
-
-/*
-	fz_set_text_aa_level: Set the number of bits of antialiasing we
-	should use for text.
-
-	bits: The number of bits of antialiasing to use (values are clamped
-	to within the 0 to 8 range).
-*/
-void fz_set_text_aa_level(fz_context *ctx, int bits);
-
-/*
-	fz_graphics_aa_level: Get the number of bits of antialiasing we are
-	using for graphics. Between 0 and 8.
-*/
-int fz_graphics_aa_level(fz_context *ctx);
-
-/*
-	fz_set_graphics_aa_level: Set the number of bits of antialiasing we
-	should use for graphics.
-
-	bits: The number of bits of antialiasing to use (values are clamped
-	to within the 0 to 8 range).
-*/
-void fz_set_graphics_aa_level(fz_context *ctx, int bits);
-
-/*
-	fz_graphics_min_line_width: Get the minimum line width to be
-	used for stroked lines.
-
-	min_line_width: The minimum line width to use (in pixels).
-*/
-float fz_graphics_min_line_width(fz_context *ctx);
-
-/*
-	fz_set_graphics_min_line_width: Set the minimum line width to be
-	used for stroked lines.
-
-	min_line_width: The minimum line width to use (in pixels).
-*/
-void fz_set_graphics_min_line_width(fz_context *ctx, float min_line_width);
-
-/*
-	fz_user_css: Get the user stylesheet source text.
-*/
-const char *fz_user_css(fz_context *ctx);
-
-/*
-	fz_set_user_css: Set the user stylesheet source text for use with HTML and EPUB.
-*/
-void fz_set_user_css(fz_context *ctx, const char *text);
-
-/*
-	fz_use_document_css: Return whether to respect document styles in HTML and EPUB.
-*/
-int fz_use_document_css(fz_context *ctx);
-
-/*
-	fz_set_use_document_css: Toggle whether to respect document styles in HTML and EPUB.
-*/
-void fz_set_use_document_css(fz_context *ctx, int use);
-
-/*
-	Locking functions
-
-	MuPDF is kept deliberately free of any knowledge of particular
-	threading systems. As such, in order for safe multi-threaded
-	operation, we rely on callbacks to client provided functions.
-
-	A client is expected to provide FZ_LOCK_MAX number of mutexes,
-	and a function to lock/unlock each of them. These may be
-	recursive mutexes, but do not have to be.
-
-	If a client does not intend to use multiple threads, then it
-	may pass NULL instead of a lock structure.
-
-	In order to avoid deadlocks, we have one simple rule
-	internally as to how we use locks: We can never take lock n
-	when we already hold any lock i, where 0 <= i <= n. In order
-	to verify this, we have some debugging code, that can be
-	enabled by defining FITZ_DEBUG_LOCKING.
-*/
-
-struct fz_locks_context_s
-{
-	void *user;
-	void (*lock)(void *user, int lock);
-	void (*unlock)(void *user, int lock);
-};
-
-enum {
-	FZ_LOCK_ALLOC = 0,
-	FZ_LOCK_FREETYPE,
-	FZ_LOCK_GLYPHCACHE,
-	FZ_LOCK_MAX
-};
-
-/*
-	Memory Allocation and Scavenging:
-
-	All calls to MuPDF's allocator functions pass through to the
-	underlying allocators passed in when the initial context is
-	created, after locks are taken (using the supplied locking function)
-	to ensure that only one thread at a time calls through.
-
-	If the underlying allocator fails, MuPDF attempts to make room for
-	the allocation by evicting elements from the store, then retrying.
-
-	Any call to allocate may then result in several calls to the underlying
-	allocator, and result in elements that are only referred to by the
-	store being freed.
-*/
-
-/*
-	fz_malloc: Allocate a block of memory (with scavenging)
-
-	size: The number of bytes to allocate.
-
-	Returns a pointer to the allocated block. May return NULL if size is
-	0. Throws exception on failure to allocate.
-*/
-void *fz_malloc(fz_context *ctx, size_t size);
-
-/*
-	fz_calloc: Allocate a zeroed block of memory (with scavenging)
-
-	count: The number of objects to allocate space for.
-
-	size: The size (in bytes) of each object.
-
-	Returns a pointer to the allocated block. May return NULL if size
-	and/or count are 0. Throws exception on failure to allocate.
-*/
-void *fz_calloc(fz_context *ctx, size_t count, size_t size);
-
-/*
-	fz_malloc_struct: Allocate storage for a structure (with scavenging),
-	clear it, and (in Memento builds) tag the pointer as belonging to a
-	struct of this type.
-
-	CTX: The context.
-
-	STRUCT: The structure type.
-
-	Returns a pointer to allocated (and cleared) structure. Throws
-	exception on failure to allocate.
-*/
-#define fz_malloc_struct(CTX, STRUCT) \
-	((STRUCT *)Memento_label(fz_calloc(CTX,1,sizeof(STRUCT)), #STRUCT))
-
-/*
-	fz_malloc_array: Allocate a block of (non zeroed) memory (with
-	scavenging). Equivalent to fz_calloc without the memory clearing.
-
-	count: The number of objects to allocate space for.
-
-	size: The size (in bytes) of each object.
-
-	Returns a pointer to the allocated block. May return NULL if size
-	and/or count are 0. Throws exception on failure to allocate.
-*/
-void *fz_malloc_array(fz_context *ctx, size_t count, size_t size);
-
-/*
-	fz_resize_array: Resize a block of memory (with scavenging).
-
-	p: The existing block to resize
-
-	count: The number of objects to resize to.
-
-	size: The size (in bytes) of each object.
-
-	Returns a pointer to the resized block. May return NULL if size
-	and/or count are 0. Throws exception on failure to resize (original
-	block is left unchanged).
-*/
-void *fz_resize_array(fz_context *ctx, void *p, size_t count, size_t size);
-
-/*
-	fz_strdup: Duplicate a C string (with scavenging)
-
-	s: The string to duplicate.
-
-	Returns a pointer to a duplicated string. Throws exception on failure
-	to allocate.
-*/
-char *fz_strdup(fz_context *ctx, const char *s);
-
-/*
-	fz_free: Frees an allocation.
-
-	Does not throw exceptions.
-*/
-void fz_free(fz_context *ctx, void *p);
-
-/*
-	fz_malloc_no_throw: Allocate a block of memory (with scavenging)
-
-	size: The number of bytes to allocate.
-
-	Returns a pointer to the allocated block. May return NULL if size is
-	0. Returns NULL on failure to allocate.
-*/
-void *fz_malloc_no_throw(fz_context *ctx, size_t size);
-
-/*
-	fz_calloc_no_throw: Allocate a zeroed block of memory (with scavenging)
-
-	count: The number of objects to allocate space for.
-
-	size: The size (in bytes) of each object.
-
-	Returns a pointer to the allocated block. May return NULL if size
-	and/or count are 0. Returns NULL on failure to allocate.
-*/
-void *fz_calloc_no_throw(fz_context *ctx, size_t count, size_t size);
-
-/*
-	fz_malloc_array_no_throw: Allocate a block of (non zeroed) memory
-	(with scavenging). Equivalent to fz_calloc_no_throw without the
-	memory clearing.
-
-	count: The number of objects to allocate space for.
-
-	size: The size (in bytes) of each object.
-
-	Returns a pointer to the allocated block. May return NULL if size
-	and/or count are 0. Returns NULL on failure to allocate.
-*/
-void *fz_malloc_array_no_throw(fz_context *ctx, size_t count, size_t size);
-
-/*
-	fz_resize_array_no_throw: Resize a block of memory (with scavenging).
-
-	p: The existing block to resize
-
-	count: The number of objects to resize to.
-
-	size: The size (in bytes) of each object.
-
-	Returns a pointer to the resized block. May return NULL if size
-	and/or count are 0. Returns NULL on failure to resize (original
-	block is left unchanged).
-*/
-void *fz_resize_array_no_throw(fz_context *ctx, void *p, size_t count, size_t size);
-
-/*
-	fz_strdup_no_throw: Duplicate a C string (with scavenging)
-
-	s: The string to duplicate.
-
-	Returns a pointer to a duplicated string. Returns NULL on failure
-	to allocate.
-*/
-char *fz_strdup_no_throw(fz_context *ctx, const char *s);
-
-/*
-	fz_gen_id: Generate an id (guaranteed unique within this family of
-	contexts).
-*/
-int fz_gen_id(fz_context *ctx);
-
-struct fz_warn_context_s
-{
-	char message[256];
-	int count;
-};
-
-/* Default allocator */
-extern fz_alloc_context fz_alloc_default;
-
-/* Default locks */
-extern fz_locks_context fz_locks_default;
-
-#if defined(MEMENTO) || !defined(NDEBUG)
-#define FITZ_DEBUG_LOCKING
-#endif
-
-#ifdef FITZ_DEBUG_LOCKING
-
-void fz_assert_lock_held(fz_context *ctx, int lock);
-void fz_assert_lock_not_held(fz_context *ctx, int lock);
-void fz_lock_debug_lock(fz_context *ctx, int lock);
-void fz_lock_debug_unlock(fz_context *ctx, int lock);
-
-#else
-
-#define fz_assert_lock_held(A,B) do { } while (0)
-#define fz_assert_lock_not_held(A,B) do { } while (0)
-#define fz_lock_debug_lock(A,B) do { } while (0)
-#define fz_lock_debug_unlock(A,B) do { } while (0)
-
-#endif /* !FITZ_DEBUG_LOCKING */
-
-static inline void
-fz_lock(fz_context *ctx, int lock)
-{
-	fz_lock_debug_lock(ctx, lock);
-	ctx->locks->lock(ctx->locks->user, lock);
-}
-
-static inline void
-fz_unlock(fz_context *ctx, int lock)
-{
-	fz_lock_debug_unlock(ctx, lock);
-	ctx->locks->unlock(ctx->locks->user, lock);
-}
-
-static inline void *
-fz_keep_imp(fz_context *ctx, void *p, int *refs)
-{
-	if (p)
-	{
-		if (*refs > 0)
-			(void)Memento_takeRef(p);
-		fz_lock(ctx, FZ_LOCK_ALLOC);
-		if (*refs > 0)
-			++*refs;
-		fz_unlock(ctx, FZ_LOCK_ALLOC);
-	}
-	return p;
-}
-
-static inline void *
-fz_keep_imp8(fz_context *ctx, void *p, int8_t *refs)
-{
-	if (p)
-	{
-		if (*refs > 0)
-			(void)Memento_takeRef(p);
-		fz_lock(ctx, FZ_LOCK_ALLOC);
-		if (*refs > 0)
-			++*refs;
-		fz_unlock(ctx, FZ_LOCK_ALLOC);
-	}
-	return p;
-}
-
-static inline void *
-fz_keep_imp16(fz_context *ctx, void *p, int16_t *refs)
-{
-	if (p)
-	{
-		if (*refs > 0)
-			(void)Memento_takeRef(p);
-		fz_lock(ctx, FZ_LOCK_ALLOC);
-		if (*refs > 0)
-			++*refs;
-		fz_unlock(ctx, FZ_LOCK_ALLOC);
-	}
-	return p;
-}
-
-static inline int
-fz_drop_imp(fz_context *ctx, void *p, int *refs)
-{
-	if (p)
-	{
-		int drop;
-		if (*refs > 0)
-			(void)Memento_dropRef(p);
-		fz_lock(ctx, FZ_LOCK_ALLOC);
-		if (*refs > 0)
-			drop = --*refs == 0;
-		else
-			drop = 0;
-		fz_unlock(ctx, FZ_LOCK_ALLOC);
-		return drop;
-	}
-	return 0;
-}
-
-static inline int
-fz_drop_imp8(fz_context *ctx, void *p, int8_t *refs)
-{
-	if (p)
-	{
-		int drop;
-		if (*refs > 0)
-			(void)Memento_dropRef(p);
-		fz_lock(ctx, FZ_LOCK_ALLOC);
-		if (*refs > 0)
-			drop = --*refs == 0;
-		else
-			drop = 0;
-		fz_unlock(ctx, FZ_LOCK_ALLOC);
-		return drop;
-	}
-	return 0;
-}
-
-static inline int
-fz_drop_imp16(fz_context *ctx, void *p, int16_t *refs)
-{
-	if (p)
-	{
-		int drop;
-		if (*refs > 0)
-			(void)Memento_dropRef(p);
-		fz_lock(ctx, FZ_LOCK_ALLOC);
-		if (*refs > 0)
-			drop = --*refs == 0;
-		else
-			drop = 0;
-		fz_unlock(ctx, FZ_LOCK_ALLOC);
-		return drop;
-	}
-	return 0;
-}
-
-#endif

+ 0 - 126
server/lib/xfdftool/include/mupdf/fitz/crypt.h

@@ -1,126 +0,0 @@
-#ifndef MUPDF_FITZ_CRYPT_H
-#define MUPDF_FITZ_CRYPT_H
-
-#include "mupdf/fitz/system.h"
-
-/*
- * Basic crypto functions.
- * Independent of the rest of fitz.
- * For further encapsulation in filters, or not.
- */
-
-/* md5 digests */
-
-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];
-	unsigned int count[2];
-	unsigned char buffer[64];
-};
-
-void fz_md5_init(fz_md5 *state);
-void fz_md5_update(fz_md5 *state, const unsigned char *input, size_t inlen);
-void fz_md5_final(fz_md5 *state, unsigned char digest[16]);
-
-/* sha-256 digests */
-
-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];
-	unsigned int count[2];
-	union {
-		unsigned char u8[64];
-		unsigned int u32[16];
-	} buffer;
-};
-
-void fz_sha256_init(fz_sha256 *state);
-void fz_sha256_update(fz_sha256 *state, const unsigned char *input, size_t inlen);
-void fz_sha256_final(fz_sha256 *state, unsigned char digest[32]);
-
-/* sha-512 digests */
-
-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];
-	unsigned int count[2];
-	union {
-		unsigned char u8[128];
-		uint64_t u64[16];
-	} buffer;
-};
-
-void fz_sha512_init(fz_sha512 *state);
-void fz_sha512_update(fz_sha512 *state, const unsigned char *input, size_t inlen);
-void fz_sha512_final(fz_sha512 *state, unsigned char digest[64]);
-
-/* sha-384 digests */
-
-typedef struct fz_sha512_s fz_sha384;
-
-void fz_sha384_init(fz_sha384 *state);
-void fz_sha384_update(fz_sha384 *state, const unsigned char *input, size_t inlen);
-void fz_sha384_final(fz_sha384 *state, unsigned char digest[64]);
-
-/* arc4 crypto */
-
-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;
-	unsigned y;
-	unsigned char state[256];
-};
-
-void fz_arc4_init(fz_arc4 *state, const unsigned char *key, size_t len);
-void fz_arc4_encrypt(fz_arc4 *state, unsigned char *dest, const unsigned char *src, size_t len);
-
-/* AES block cipher implementation from XYSSL */
-
-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 */
-	unsigned long *rk; /* AES round keys */
-	unsigned long buf[68]; /* unaligned data */
-};
-
-int aes_setkey_enc( fz_aes *ctx, const unsigned char *key, int keysize );
-int aes_setkey_dec( fz_aes *ctx, const unsigned char *key, int keysize );
-void aes_crypt_cbc( fz_aes *ctx, int mode, size_t length,
-	unsigned char iv[16],
-	const unsigned char *input,
-	unsigned char *output );
-
-#endif

+ 0 - 381
server/lib/xfdftool/include/mupdf/fitz/device.h

@@ -1,381 +0,0 @@
-#ifndef MUPDF_FITZ_DEVICE_H
-#define MUPDF_FITZ_DEVICE_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/geometry.h"
-#include "mupdf/fitz/colorspace.h"
-#include "mupdf/fitz/image.h"
-#include "mupdf/fitz/shade.h"
-#include "mupdf/fitz/path.h"
-#include "mupdf/fitz/text.h"
-
-/*
-	The different format handlers (pdf, xps etc) interpret pages to a
-	device. These devices can then process the stream of calls they
-	receive in various ways:
-		The trace device outputs debugging information for the calls.
-		The draw device will render them.
-		The list device stores them in a list to play back later.
-		The text device performs text extraction and searching.
-		The bbox device calculates the bounding box for the page.
-	Other devices can (and will) be written in the future.
-*/
-typedef struct fz_device_s fz_device;
-
-enum
-{
-	/* Flags */
-	FZ_DEVFLAG_MASK = 1,
-	FZ_DEVFLAG_COLOR = 2,
-	FZ_DEVFLAG_UNCACHEABLE = 4,
-	FZ_DEVFLAG_FILLCOLOR_UNDEFINED = 8,
-	FZ_DEVFLAG_STROKECOLOR_UNDEFINED = 16,
-	FZ_DEVFLAG_STARTCAP_UNDEFINED = 32,
-	FZ_DEVFLAG_DASHCAP_UNDEFINED = 64,
-	FZ_DEVFLAG_ENDCAP_UNDEFINED = 128,
-	FZ_DEVFLAG_LINEJOIN_UNDEFINED = 256,
-	FZ_DEVFLAG_MITERLIMIT_UNDEFINED = 512,
-	FZ_DEVFLAG_LINEWIDTH_UNDEFINED = 1024,
-	/* Arguably we should have a bit for the dash pattern itself being
-	 * undefined, but that causes problems; do we assume that it should
-	 * always be set to non-dashing at the start of every glyph? */
-	FZ_DEVFLAG_BBOX_DEFINED = 2048,
-	FZ_DEVFLAG_GRIDFIT_AS_TILED = 4096,
-};
-
-enum
-{
-	/* PDF 1.4 -- standard separable */
-	FZ_BLEND_NORMAL,
-	FZ_BLEND_MULTIPLY,
-	FZ_BLEND_SCREEN,
-	FZ_BLEND_OVERLAY,
-	FZ_BLEND_DARKEN,
-	FZ_BLEND_LIGHTEN,
-	FZ_BLEND_COLOR_DODGE,
-	FZ_BLEND_COLOR_BURN,
-	FZ_BLEND_HARD_LIGHT,
-	FZ_BLEND_SOFT_LIGHT,
-	FZ_BLEND_DIFFERENCE,
-	FZ_BLEND_EXCLUSION,
-
-	/* PDF 1.4 -- standard non-separable */
-	FZ_BLEND_HUE,
-	FZ_BLEND_SATURATION,
-	FZ_BLEND_COLOR,
-	FZ_BLEND_LUMINOSITY,
-
-	/* For packing purposes */
-	FZ_BLEND_MODEMASK = 15,
-	FZ_BLEND_ISOLATED = 16,
-	FZ_BLEND_KNOCKOUT = 32
-};
-
-int fz_lookup_blendmode(const char *name);
-char *fz_blendmode_name(int blendmode);
-
-typedef struct fz_device_container_stack_s fz_device_container_stack;
-
-struct fz_device_s
-{
-	int refs;
-	int hints;
-	int flags;
-
-	void (*close_device)(fz_context *, fz_device *);
-	void (*drop_device)(fz_context *, fz_device *);
-
-	void (*fill_path)(fz_context *, fz_device *, const fz_path *, int even_odd, const fz_matrix *, fz_colorspace *, const float *color, float alpha);
-	void (*stroke_path)(fz_context *, fz_device *, const fz_path *, const fz_stroke_state *, const fz_matrix *, fz_colorspace *, const float *color, float alpha);
-	void (*clip_path)(fz_context *, fz_device *, const fz_path *, int even_odd, const fz_matrix *, const fz_rect *scissor);
-	void (*clip_stroke_path)(fz_context *, fz_device *, const fz_path *, const fz_stroke_state *, const fz_matrix *, const fz_rect *scissor);
-
-	void (*fill_text)(fz_context *, fz_device *, const fz_text *, const fz_matrix *, fz_colorspace *, const float *color, float alpha);
-	void (*stroke_text)(fz_context *, fz_device *, const fz_text *, const fz_stroke_state *, const fz_matrix *, fz_colorspace *, const float *color, float alpha);
-	void (*clip_text)(fz_context *, fz_device *, const fz_text *, const fz_matrix *, const fz_rect *scissor);
-	void (*clip_stroke_text)(fz_context *, fz_device *, const fz_text *, const fz_stroke_state *, const fz_matrix *, const fz_rect *scissor);
-	void (*ignore_text)(fz_context *, fz_device *, const fz_text *, const fz_matrix *);
-
-	void (*fill_shade)(fz_context *, fz_device *, fz_shade *shd, const fz_matrix *ctm, float alpha);
-	void (*fill_image)(fz_context *, fz_device *, fz_image *img, const fz_matrix *ctm, float alpha);
-	void (*fill_image_mask)(fz_context *, fz_device *, fz_image *img, const fz_matrix *ctm, fz_colorspace *, const float *color, float alpha);
-	void (*clip_image_mask)(fz_context *, fz_device *, fz_image *img, const fz_matrix *ctm, const fz_rect *scissor);
-
-	void (*pop_clip)(fz_context *, fz_device *);
-
-	void (*begin_mask)(fz_context *, fz_device *, const fz_rect *, int luminosity, fz_colorspace *, const float *bc);
-	void (*end_mask)(fz_context *, fz_device *);
-	void (*begin_group)(fz_context *, fz_device *, const fz_rect *, int isolated, int knockout, int blendmode, float alpha);
-	void (*end_group)(fz_context *, fz_device *);
-
-	int (*begin_tile)(fz_context *, fz_device *, const fz_rect *area, const fz_rect *view, float xstep, float ystep, const fz_matrix *ctm, int id);
-	void (*end_tile)(fz_context *, fz_device *);
-
-	void (*render_flags)(fz_context *, fz_device *, int set, int clear);
-
-	fz_rect d1_rect;
-
-	int error_depth;
-	char errmess[256];
-
-	int container_len;
-	int container_cap;
-	fz_device_container_stack *container;
-};
-
-void fz_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, const fz_matrix *ctm, fz_colorspace *colorspace, const float *color, float alpha);
-void fz_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, const fz_matrix *ctm, fz_colorspace *colorspace, const float *color, float alpha);
-void fz_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, const fz_matrix *ctm, const fz_rect *scissor);
-void fz_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, const fz_matrix *ctm, const fz_rect *scissor);
-void fz_fill_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm, fz_colorspace *colorspace, const float *color, float alpha);
-void fz_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, const fz_matrix *ctm, fz_colorspace *colorspace, const float *color, float alpha);
-void fz_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm, const fz_rect *scissor);
-void fz_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, const fz_matrix *ctm, const fz_rect *scissor);
-void fz_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm);
-void fz_pop_clip(fz_context *ctx, fz_device *dev);
-void fz_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, const fz_matrix *ctm, float alpha);
-void fz_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm, float alpha);
-void fz_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm, fz_colorspace *colorspace, const float *color, float alpha);
-void fz_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, const fz_matrix *ctm, const fz_rect *scissor);
-void fz_begin_mask(fz_context *ctx, fz_device *dev, const fz_rect *area, int luminosity, fz_colorspace *colorspace, const float *bc);
-void fz_end_mask(fz_context *ctx, fz_device *dev);
-void fz_begin_group(fz_context *ctx, fz_device *dev, const fz_rect *area, int isolated, int knockout, int blendmode, float alpha);
-void fz_end_group(fz_context *ctx, fz_device *dev);
-void fz_begin_tile(fz_context *ctx, fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, const fz_matrix *ctm);
-int fz_begin_tile_id(fz_context *ctx, fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, const fz_matrix *ctm, int id);
-void fz_end_tile(fz_context *ctx, fz_device *dev);
-void fz_render_flags(fz_context *ctx, fz_device *dev, int set, int clear);
-
-fz_device *fz_new_device_of_size(fz_context *ctx, int size);
-
-#define fz_new_derived_device(CTX, TYPE) \
-	((TYPE *)Memento_label(fz_new_device_of_size(ctx,sizeof(TYPE)),#TYPE))
-
-/*
-	fz_close_device: Signal the end of input, and flush any buffered output.
-	This is NOT called implicitly on fz_drop_device.
-*/
-void fz_close_device(fz_context *ctx, fz_device *dev);
-
-/*
-	fz_drop_device: Free a device of any type and its resources.
-	Don't forget to call fz_close_device before dropping the device, or you may get incomplete output!
-*/
-void fz_drop_device(fz_context *ctx, fz_device *dev);
-
-fz_device *fz_keep_device(fz_context *ctx, fz_device *dev);
-
-/*
-	fz_enable_device_hints : Enable hints in a device.
-
-	hints: mask of hints to enable.
-
-	For example: By default the draw device renders shadings. For some
-	purposes (perhaps rendering fast low quality thumbnails) you may want
-	to tell it to ignore shadings. For this you would enable the
-	FZ_IGNORE_SHADE hint.
-*/
-void fz_enable_device_hints(fz_context *ctx, fz_device *dev, int hints);
-
-/*
-	fz_disable_device_hints : Disable hints in a device.
-
-	hints: mask of hints to disable.
-
-	For example: By default the text extraction device ignores images.
-	For some purposes however (such as extracting HTML) you may want to
-	enable the capturing of image data too. For this you would disable
-	the FZ_IGNORE_IMAGE hint.
-*/
-void fz_disable_device_hints(fz_context *ctx, fz_device *dev, int hints);
-
-enum
-{
-	/* Hints */
-	FZ_IGNORE_IMAGE = 1,
-	FZ_IGNORE_SHADE = 2,
-	FZ_DONT_INTERPOLATE_IMAGES = 4,
-	FZ_MAINTAIN_CONTAINER_STACK = 8,
-	FZ_NO_CACHE = 16,
-};
-
-/*
-	Cookie support - simple communication channel between app/library.
-*/
-
-typedef struct fz_cookie_s fz_cookie;
-
-/*
-	Provide two-way communication between application and library.
-	Intended for multi-threaded applications where one thread is
-	rendering pages and another thread wants to read progress
-	feedback or abort a job that takes a long time to finish. The
-	communication is unsynchronized without locking.
-
-	abort: The application should set this field to 0 before
-	calling fz_run_page to render a page. At any point when the
-	page is being rendered the application my set this field to 1
-	which will cause the rendering to finish soon. This field is
-	checked periodically when the page is rendered, but exactly
-	when is not known, therefore there is no upper bound on
-	exactly when the rendering will abort. If the application
-	did not provide a set of locks to fz_new_context, it must also
-	await the completion of fz_run_page before issuing another
-	call to fz_run_page. Note that once the application has set
-	this field to 1 after it called fz_run_page it may not change
-	the value again.
-
-	progress: Communicates rendering progress back to the
-	application and is read only. Increments as a page is being
-	rendered. The value starts out at 0 and is limited to less
-	than or equal to progress_max, unless progress_max is -1.
-
-	progress_max: Communicates the known upper bound of rendering
-	back to the application and is read only. The maximum value
-	that the progress field may take. If there is no known upper
-	bound on how long the rendering may take this value is -1 and
-	progress is not limited. Note that the value of progress_max
-	may change from -1 to a positive value once an upper bound is
-	known, so take this into consideration when comparing the
-	value of progress to that of progress_max.
-
-	errors: count of errors during current rendering.
-
-	incomplete_ok: If this is set to 1 by the caller, then TRYLATER
-	errors are swallowed as they occur, setting the 'incomplete' flag.
-	Rendering continues as much as possible ignoring errors. The caller
-	is expected to check the 'incomplete' flag at the end to see if the
-	rendering may be considered final or not.
-
-	incomplete: Initially should be set to 0. Will be set to non-zero
-	if a TRYLATER error is thrown during rendering and the incomplete_ok
-	flag is set.
-*/
-struct fz_cookie_s
-{
-	int abort;
-	int progress;
-	int progress_max; /* -1 for unknown */
-	int errors;
-	int incomplete_ok;
-	int incomplete;
-};
-
-/*
-	fz_new_trace_device: Create a device to print a debug trace of all device calls.
-*/
-fz_device *fz_new_trace_device(fz_context *ctx, fz_output *out);
-
-/*
-	fz_new_bbox_device: Create a device to compute the bounding
-	box of all marks on a page.
-
-	The returned bounding box will be the union of all bounding
-	boxes of all objects on a page.
-*/
-fz_device *fz_new_bbox_device(fz_context *ctx, fz_rect *rectp);
-
-/*
-	fz_new_test_device: Create a device to test for features.
-
-	Currently only tests for the presence of non-grayscale colors.
-
-	is_color: Possible values returned:
-		0: Definitely greyscale
-		1: Probably color (all colors were grey, but there
-		were images or shadings in a non grey colorspace).
-		2: Definitely color
-
-	threshold: The difference from grayscale that will be tolerated.
-	Typical values to use are either 0 (be exact) and 0.02 (allow an
-	imperceptible amount of slop).
-
-	options: A set of bitfield options, from the FZ_TEST_OPT set.
-
-	passthrough: A device to pass all calls through to, or NULL.
-	If set, then the test device can both test and pass through to
-	an underlying device (like, say, the display list device). This
-	means that a display list can be created and at the end we'll
-	know if it's colored or not.
-
-	In the absence of a passthrough device, the device will throw
-	an exception to stop page interpretation when color is found.
-*/
-fz_device *fz_new_test_device(fz_context *ctx, int *is_color, float threshold, int options, fz_device *passthrough);
-
-enum
-{
-	/* If set, test every pixel of images exhaustively.
-	 * If clear, just look at colorspaces for images. */
-	FZ_TEST_OPT_IMAGES = 1,
-
-	/* If set, test every pixel of shadings. */
-	/* If clear, just look at colorspaces for shadings. */
-	FZ_TEST_OPT_SHADINGS = 2
-};
-
-/*
-	fz_new_draw_device: Create a device to draw on a pixmap.
-
-	dest: Target pixmap for the draw device. See fz_new_pixmap*
-	for how to obtain a pixmap. The pixmap is not cleared by the
-	draw device, see fz_clear_pixmap* for how to clear it prior to
-	calling fz_new_draw_device. Free the device by calling
-	fz_drop_device.
-
-	transform: Transform from user space in points to device space in pixels.
-*/
-fz_device *fz_new_draw_device(fz_context *ctx, const fz_matrix *transform, fz_pixmap *dest);
-
-/*
-	fz_new_draw_device_with_bbox: Create a device to draw on a pixmap.
-
-	dest: Target pixmap for the draw device. See fz_new_pixmap*
-	for how to obtain a pixmap. The pixmap is not cleared by the
-	draw device, see fz_clear_pixmap* for how to clear it prior to
-	calling fz_new_draw_device. Free the device by calling
-	fz_drop_device.
-
-	transform: Transform from user space in points to device space in pixels.
-
-	clip: Bounding box to restrict any marking operations of the
-	draw device.
-*/
-fz_device *fz_new_draw_device_with_bbox(fz_context *ctx, const fz_matrix *transform, fz_pixmap *dest, const fz_irect *clip);
-
-fz_device *fz_new_draw_device_type3(fz_context *ctx, const fz_matrix *transform, fz_pixmap *dest);
-
-/*
-	struct fz_draw_options: Options for creating a pixmap and draw device.
-*/
-typedef struct fz_draw_options_s fz_draw_options;
-
-struct fz_draw_options_s
-{
-	int rotate;
-	int x_resolution;
-	int y_resolution;
-	int width;
-	int height;
-	fz_colorspace *colorspace;
-	int alpha;
-};
-
-extern const char *fz_draw_options_usage;
-
-/*
-	fz_parse_draw_options: Parse draw device options from a comma separated key-value string.
-*/
-fz_draw_options *fz_parse_draw_options(fz_context *ctx, fz_draw_options *options, const char *string);
-
-/*
-	fz_new_draw_device_with_options: Create a new pixmap and draw device, using the specified options.
-
-	options: Options to configure the draw device, and choose the resolution and colorspace.
-	mediabox: The bounds of the page in points.
-	pixmap: An out parameter containing the newly created pixmap.
-*/
-fz_device *fz_new_draw_device_with_options(fz_context *ctx, const fz_draw_options *options, const fz_rect *mediabox, fz_pixmap **pixmap);
-
-#endif

+ 0 - 119
server/lib/xfdftool/include/mupdf/fitz/display-list.h

@@ -1,119 +0,0 @@
-#ifndef MUPDF_FITZ_DISPLAY_LIST_H
-#define MUPDF_FITZ_DISPLAY_LIST_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/geometry.h"
-#include "mupdf/fitz/device.h"
-
-/*
-	Display list device -- record and play back device commands.
-*/
-
-/*
-	fz_display_list is a list containing drawing commands (text,
-	images, etc.). The intent is two-fold: as a caching-mechanism
-	to reduce parsing of a page, and to be used as a data
-	structure in multi-threading where one thread parses the page
-	and another renders pages.
-
-	Create a display list with fz_new_display_list, hand it over to
-	fz_new_list_device to have it populated, and later replay the
-	list (once or many times) by calling fz_run_display_list. When
-	the list is no longer needed drop it with fz_drop_display_list.
-*/
-typedef struct fz_display_list_s fz_display_list;
-
-/*
-	fz_new_display_list: Create an empty display list.
-
-	A display list contains drawing commands (text, images, etc.).
-	Use fz_new_list_device for populating the list.
-
-	mediabox: Bounds of the page (in points) represented by the display list.
-*/
-fz_display_list *fz_new_display_list(fz_context *ctx, const fz_rect *mediabox);
-
-/*
-	fz_new_list_device: Create a rendering device for a display list.
-
-	When the device is rendering a page it will populate the
-	display list with drawing commands (text, images, etc.). The
-	display list can later be reused to render a page many times
-	without having to re-interpret the page from the document file
-	for each rendering. Once the device is no longer needed, free
-	it with fz_drop_device.
-
-	list: A display list that the list device takes ownership of.
-*/
-fz_device *fz_new_list_device(fz_context *ctx, fz_display_list *list);
-
-/*
-	fz_run_display_list: (Re)-run a display list through a device.
-
-	list: A display list, created by fz_new_display_list and
-	populated with objects from a page by running fz_run_page on a
-	device obtained from fz_new_list_device.
-
-	dev: Device obtained from fz_new_*_device.
-
-	ctm: Transform to apply to display list contents. May include
-	for example scaling and rotation, see fz_scale, fz_rotate and
-	fz_concat. Set to fz_identity if no transformation is desired.
-
-	area: Only the part of the contents of the display list
-	visible within this area will be considered when the list is
-	run through the device. This does not imply for tile objects
-	contained in the display list.
-
-	cookie: Communication mechanism between caller and library
-	running the page. Intended for multi-threaded applications,
-	while single-threaded applications set cookie to NULL. The
-	caller may abort an ongoing page run. Cookie also communicates
-	progress information back to the caller. The fields inside
-	cookie are continually updated while the page is being run.
-*/
-void fz_run_display_list(fz_context *ctx, fz_display_list *list, fz_device *dev, const fz_matrix *ctm, const fz_rect *area, fz_cookie *cookie);
-
-/*
-	fz_keep_display_list: Keep a reference to a display list.
-
-	Does not throw exceptions.
-*/
-fz_display_list *fz_keep_display_list(fz_context *ctx, fz_display_list *list);
-
-/*
-	fz_drop_display_list: Drop a reference to a display list, freeing it
-	if the reference count reaches zero.
-
-	Does not throw exceptions.
-*/
-void fz_drop_display_list(fz_context *ctx, fz_display_list *list);
-
-/*
-	fz_bound_display_list: Return the bounding box of the page recorded in a display list.
-*/
-fz_rect *fz_bound_display_list(fz_context *ctx, fz_display_list *list, fz_rect *bounds);
-
-/*
-	Create a new image from a display list.
-
-	w, h: The conceptual width/height of the image.
-
-	transform: The matrix that needs to be applied to the given
-	list to make it render to the unit square.
-
-	list: The display list.
-*/
-fz_image *fz_new_image_from_display_list(fz_context *ctx, float w, float h, fz_display_list *list);
-
-/*
-	Check for a display list being empty
-
-	list: The list to check.
-
-	Returns true if empty, false otherwise.
-*/
-int fz_display_list_is_empty(fz_context *ctx, const fz_display_list *list);
-
-#endif

+ 0 - 646
server/lib/xfdftool/include/mupdf/fitz/document.h

@@ -1,646 +0,0 @@
-#ifndef MUPDF_FITZ_DOCUMENT_H
-#define MUPDF_FITZ_DOCUMENT_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/geometry.h"
-#include "mupdf/fitz/device.h"
-#include "mupdf/fitz/transition.h"
-#include "mupdf/fitz/link.h"
-#include "mupdf/fitz/outline.h"
-
-/*
-	Document interface
-*/
-typedef struct fz_document_s fz_document;
-typedef struct fz_document_handler_s fz_document_handler;
-typedef struct fz_page_s fz_page;
-typedef struct fz_annot_s fz_annot;
-typedef intptr_t fz_bookmark;
-
-typedef enum
-{
-	FZ_PERMISSION_PRINT = 'p',
-	FZ_PERMISSION_COPY = 'c',
-	FZ_PERMISSION_EDIT = 'e',
-	FZ_PERMISSION_ANNOTATE = 'n',
-}
-fz_permission;
-
-/*
-	fz_document_drop_fn: Type for a function to be called when
-	the reference count for the fz_document drops to 0. The
-	implementation should release any resources held by the
-	document. The actual document pointer will be freed by the
-	caller.
-*/
-typedef void (fz_document_drop_fn)(fz_context *ctx, fz_document *doc);
-
-/*
-	fz_document_needs_password_fn: Type for a function to be
-	called to enquire whether the document needs a password
-	or not. See fz_needs_password for more information.
-*/
-typedef int (fz_document_needs_password_fn)(fz_context *ctx, fz_document *doc);
-
-/*
-	fz_document_authenticate_password_fn: Type for a function to be
-	called to attempt to authenticate a password. See
-	fz_authenticate_password for more information.
-*/
-typedef int (fz_document_authenticate_password_fn)(fz_context *ctx, fz_document *doc, const char *password);
-
-/*
-	fz_document_has_permission_fn: Type for a function to be
-	called to see if a document grants a certain permission. See
-	fz_document_has_permission for more information.
-*/
-typedef int (fz_document_has_permission_fn)(fz_context *ctx, fz_document *doc, fz_permission permission);
-
-/*
-	fz_document_load_outline_fn: Type for a function to be called to
-	load the outlines for a document. See fz_document_load_outline
-	for more information.
-*/
-typedef fz_outline *(fz_document_load_outline_fn)(fz_context *ctx, fz_document *doc);
-
-/*
-	fz_document_layout_fn: Type for a function to be called to lay
-	out a document. See fz_layout_document for more information.
-*/
-typedef void (fz_document_layout_fn)(fz_context *ctx, fz_document *doc, float w, float h, float em);
-
-/*
-	fz_document_resolve_link_fn: Type for a function to be called to
-	resolve an internal link to a page number. See fz_resolve_link
-	for more information.
-*/
-typedef int (fz_document_resolve_link_fn)(fz_context *ctx, fz_document *doc, const char *uri, float *xp, float *yp);
-
-/*
-	fz_document_count_pages_fn: Type for a function to be called to
-	count the number of pages in a document. See fz_count_pages for
-	more information.
-*/
-typedef int (fz_document_count_pages_fn)(fz_context *ctx, fz_document *doc);
-
-/*
-	fz_document_load_page_fn: Type for a function to load a given
-	page from a document. See fz_load_page for more information.
-*/
-typedef fz_page *(fz_document_load_page_fn)(fz_context *ctx, fz_document *doc, int number);
-
-/*
-	fz_document_lookup_metadata_fn: Type for a function to query
-	a documents metadata. See fz_lookup_metadata for more
-	information.
-*/
-typedef int (fz_document_lookup_metadata_fn)(fz_context *ctx, fz_document *doc, const char *key, char *buf, int size);
-
-/*
-	fz_document_make_bookmark_fn: Type for a function to make
-	a bookmark. See fz_make_bookmark for more information.
-*/
-typedef fz_bookmark (fz_document_make_bookmark_fn)(fz_context *ctx, fz_document *doc, int page);
-
-/*
-	fz_document_lookup_bookmark_fn: Type for a function to lookup
-	a bookmark. See fz_lookup_bookmark for more information.
-*/
-typedef int (fz_document_lookup_bookmark_fn)(fz_context *ctx, fz_document *doc, fz_bookmark mark);
-
-/*
-	fz_page_drop_page_fn: Type for a function to release all the
-	resources held by a page. Called automatically when the
-	reference count for that page reaches zero.
-*/
-typedef void (fz_page_drop_page_fn)(fz_context *ctx, fz_page *page);
-
-/*
-	fz_page_bound_page_fn: Type for a function to return the
-	bounding box of a page. See fz_bound_page for more
-	information.
-*/
-typedef fz_rect *(fz_page_bound_page_fn)(fz_context *ctx, fz_page *page, fz_rect *);
-
-/*
-	fz_page_run_page_contents_fn: Type for a function to run the
-	contents of a page. See fz_run_page_contents for more
-	information.
-*/
-typedef void (fz_page_run_page_contents_fn)(fz_context *ctx, fz_page *page, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie);
-
-/*
-	fz_page_load_links_fn: Type for a function to load the links
-	from a page. See fz_load_links for more information.
-*/
-typedef fz_link *(fz_page_load_links_fn)(fz_context *ctx, fz_page *page);
-
-/*
-	fz_page_first_annot_fn: Type for a function to load the
-	annotations from a page. See fz_first_annot for more
-	information.
-*/
-typedef fz_annot *(fz_page_first_annot_fn)(fz_context *ctx, fz_page *page);
-
-/*
-	fz_page_page_presentation_fn: Type for a function to
-	obtain the details of how this page should be presented when
-	in presentation mode. See fz_page_presentation for more
-	information.
-*/
-typedef fz_transition *(fz_page_page_presentation_fn)(fz_context *ctx, fz_page *page, fz_transition *transition, float *duration);
-
-/*
-	fz_page_control_separation: Type for a function to enable/
-	disable separations on a page. See fz_control_separation for
-	more information.
-*/
-typedef void (fz_page_control_separation_fn)(fz_context *ctx, fz_page *page, int separation, int disable);
-
-/*
-	fz_page_separation_disabled_fn: Type for a function to detect
-	whether a given separation is enabled or disabled on a page.
-	See fz_separation_disabled for more information.
-*/
-typedef int (fz_page_separation_disabled_fn)(fz_context *ctx, fz_page *page, int separation);
-
-/*
-	fz_page_count_separations_fn: Type for a function to count
-	the number of separations on a page. See fz_count_separations
-	for more information.
-*/
-typedef int (fz_page_count_separations_fn)(fz_context *ctx, fz_page *page);
-
-/*
-	fz_page_get_separation_fn: Type for a function to retrieve
-	details of a separation on a page. See fz_get_separation
-	for more information.
-*/
-typedef const char *(fz_page_get_separation_fn)(fz_context *ctx, fz_page *page, int separation, uint32_t *rgb, uint32_t *cmyk);
-
-typedef void (fz_annot_drop_fn)(fz_context *ctx, fz_annot *annot);
-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;
-	fz_annot_drop_fn *drop_annot;
-	fz_annot_bound_fn *bound_annot;
-	fz_annot_run_fn *run_annot;
-	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;
-	fz_page_drop_page_fn *drop_page;
-	fz_page_bound_page_fn *bound_page;
-	fz_page_run_page_contents_fn *run_page_contents;
-	fz_page_load_links_fn *load_links;
-	fz_page_first_annot_fn *first_annot;
-	fz_page_page_presentation_fn *page_presentation;
-	fz_page_control_separation_fn *control_separation;
-	fz_page_separation_disabled_fn *separation_disabled;
-	fz_page_count_separations_fn *count_separations;
-	fz_page_get_separation_fn *get_separation;
-};
-
-/*
-	Structure definition is public so other classes can
-	derive from it. Callers shoud not access the members
-	directly, though implementations will need initialize
-	functions directly.
-*/
-struct fz_document_s
-{
-	int refs;
-	fz_document_drop_fn *drop_document;
-	fz_document_needs_password_fn *needs_password;
-	fz_document_authenticate_password_fn *authenticate_password;
-	fz_document_has_permission_fn *has_permission;
-	fz_document_load_outline_fn *load_outline;
-	fz_document_layout_fn *layout;
-	fz_document_make_bookmark_fn *make_bookmark;
-	fz_document_lookup_bookmark_fn *lookup_bookmark;
-	fz_document_resolve_link_fn *resolve_link;
-	fz_document_count_pages_fn *count_pages;
-	fz_document_load_page_fn *load_page;
-	fz_document_lookup_metadata_fn *lookup_metadata;
-	int did_layout;
-	int is_reflowable;
-};
-
-/*
-	fz_document_open_fn: Function type to open a document from a
-	file.
-
-	filename: file to open
-
-	Pointer to opened document. Throws exception in case of error.
-*/
-typedef fz_document *(fz_document_open_fn)(fz_context *ctx, const char *filename);
-
-/*
-	fz_document_open_with_stream_fn: Function type to open a
-	document from a file.
-
-	stream: fz_stream to read document data from. Must be
-	seekable for formats that require it.
-
-	Pointer to opened document. Throws exception in case of error.
-*/
-typedef fz_document *(fz_document_open_with_stream_fn)(fz_context *ctx, fz_stream *stream);
-
-/*
-	fz_document_recognize_fn: Recognize a document type from
-	a magic string.
-
-	magic: string to recognise - typically a filename or mime
-	type.
-
-	Returns a number between 0 (not recognized) and 100
-	(fully recognized) based on how certain the recognizer
-	is that this is of the required type.
-*/
-typedef int (fz_document_recognize_fn)(fz_context *ctx, const char *magic);
-
-struct fz_document_handler_s
-{
-	fz_document_recognize_fn *recognize;
-	fz_document_open_fn *open;
-	fz_document_open_with_stream_fn *open_with_stream;
-};
-
-/*
-	fz_register_document_handler: Register a handler
-	for a document type.
-
-	handler: The handler to register.
-*/
-void fz_register_document_handler(fz_context *ctx, const fz_document_handler *handler);
-
-/*
-	fz_register_document_handler: Register handlers
-	for all the standard document types supported in
-	this build.
-*/
-void fz_register_document_handlers(fz_context *ctx);
-
-/*
-	fz_open_document: Open a PDF, XPS or CBZ document.
-
-	Open a document file and read its basic structure so pages and
-	objects can be located. MuPDF will try to repair broken
-	documents (without actually changing the file contents).
-
-	The returned fz_document is used when calling most other
-	document related functions.
-
-	filename: a path to a file as it would be given to open(2).
-*/
-fz_document *fz_open_document(fz_context *ctx, const char *filename);
-
-/*
-	fz_open_document_with_stream: Open a PDF, XPS or CBZ document.
-
-	Open a document using the specified stream object rather than
-	opening a file on disk.
-
-	magic: a string used to detect document type; either a file name or mime-type.
-*/
-fz_document *fz_open_document_with_stream(fz_context *ctx, const char *magic, fz_stream *stream);
-
-/*
-	fz_new_document: Create and initialize a document struct.
-*/
-void *fz_new_document_of_size(fz_context *ctx, int size);
-
-#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.
-
-	Does not throw exceptions.
-*/
-fz_document *fz_keep_document(fz_context *ctx, fz_document *doc);
-
-/*
-	fz_drop_document: Release an open document.
-
-	The resource store in the context associated with fz_document
-	is emptied, and any allocations for the document are freed when
-	the last reference is dropped.
-
-	Does not throw exceptions.
-*/
-void fz_drop_document(fz_context *ctx, fz_document *doc);
-
-/*
-	fz_needs_password: Check if a document is encrypted with a
-	non-blank password.
-
-	Does not throw exceptions.
-*/
-int fz_needs_password(fz_context *ctx, fz_document *doc);
-
-/*
-	fz_authenticate_password: Test if the given password can
-	decrypt the document.
-
-	password: The password string to be checked. Some document
-	specifications do not specify any particular text encoding, so
-	neither do we.
-
-	Returns 0 for failure to authenticate, non-zero for success.
-
-	For PDF documents, further information can be given by examining
-	the bits in the return code.
-
-		Bit 0 => No password required
-		Bit 1 => User password authenticated
-		Bit 2 => Owner password authenticated
-
-	Does not throw exceptions.
-*/
-int fz_authenticate_password(fz_context *ctx, fz_document *doc, const char *password);
-
-/*
-	fz_load_outline: Load the hierarchical document outline.
-
-	Should be freed by fz_drop_outline.
-*/
-fz_outline *fz_load_outline(fz_context *ctx, fz_document *doc);
-
-/*
-	fz_is_document_reflowable: Is the document reflowable.
-
-	Returns 1 to indicate reflowable documents, otherwise 0.
-*/
-int fz_is_document_reflowable(fz_context *ctx, fz_document *doc);
-
-/*
-	fz_layout_document: Layout reflowable document types.
-
-	w, h: Page size in points.
-	em: Default font size in points.
-*/
-void fz_layout_document(fz_context *ctx, fz_document *doc, float w, float h, float em);
-
-/*
-	Create a bookmark for the given page, which can be used to find the
-	same location after the document has been laid out with different
-	parameters.
-*/
-fz_bookmark fz_make_bookmark(fz_context *ctx, fz_document *doc, int page);
-
-/*
-	Find a bookmark and return its page number.
-*/
-int fz_lookup_bookmark(fz_context *ctx, fz_document *doc, fz_bookmark mark);
-
-/*
-	fz_count_pages: Return the number of pages in document
-
-	May return 0 for documents with no pages.
-*/
-int fz_count_pages(fz_context *ctx, fz_document *doc);
-
-/*
-	fz_resolve_link: Resolve an internal link to a page number.
-
-	xp, yp: Pointer to store coordinate of destination on the page.
-
-	Returns -1 if the URI cannot be resolved.
-*/
-int fz_resolve_link(fz_context *ctx, fz_document *doc, const char *uri, float *xp, float *yp);
-
-/*
-	fz_load_page: Load a page.
-
-	After fz_load_page is it possible to retrieve the size of the
-	page using fz_bound_page, or to render the page using
-	fz_run_page_*. Free the page by calling fz_drop_page.
-
-	number: page number, 0 is the first page of the document.
-*/
-fz_page *fz_load_page(fz_context *ctx, fz_document *doc, int number);
-
-/*
-	fz_load_links: Load the list of links for a page.
-
-	Returns a linked list of all the links on the page, each with
-	its clickable region and link destination. Each link is
-	reference counted so drop and free the list of links by
-	calling fz_drop_link on the pointer return from fz_load_links.
-
-	page: Page obtained from fz_load_page.
-*/
-fz_link *fz_load_links(fz_context *ctx, fz_page *page);
-
-/*
-	fz_new_page_of_size: Create and initialize a page struct.
-*/
-fz_page *fz_new_page_of_size(fz_context *ctx, int size);
-
-#define fz_new_derived_page(CTX,TYPE) \
-	((TYPE *)Memento_label(fz_new_page_of_size(CTX,sizeof(TYPE)),#TYPE))
-
-/*
-	fz_bound_page: Determine the size of a page at 72 dpi.
-
-	Does not throw exceptions.
-*/
-fz_rect *fz_bound_page(fz_context *ctx, fz_page *page, fz_rect *rect);
-
-/*
-	fz_run_page: Run a page through a device.
-
-	page: Page obtained from fz_load_page.
-
-	dev: Device obtained from fz_new_*_device.
-
-	transform: Transform to apply to page. May include for example
-	scaling and rotation, see fz_scale, fz_rotate and fz_concat.
-	Set to fz_identity if no transformation is desired.
-
-	cookie: Communication mechanism between caller and library
-	rendering the page. Intended for multi-threaded applications,
-	while single-threaded applications set cookie to NULL. The
-	caller may abort an ongoing rendering of a page. Cookie also
-	communicates progress information back to the caller. The
-	fields inside cookie are continually updated while the page is
-	rendering.
-*/
-void fz_run_page(fz_context *ctx, fz_page *page, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie);
-
-/*
-	fz_run_page_contents: Run a page through a device. Just the main
-	page content, without the annotations, if any.
-
-	page: Page obtained from fz_load_page.
-
-	dev: Device obtained from fz_new_*_device.
-
-	transform: Transform to apply to page. May include for example
-	scaling and rotation, see fz_scale, fz_rotate and fz_concat.
-	Set to fz_identity if no transformation is desired.
-
-	cookie: Communication mechanism between caller and library
-	rendering the page. Intended for multi-threaded applications,
-	while single-threaded applications set cookie to NULL. The
-	caller may abort an ongoing rendering of a page. Cookie also
-	communicates progress information back to the caller. The
-	fields inside cookie are continually updated while the page is
-	rendering.
-*/
-void fz_run_page_contents(fz_context *ctx, fz_page *page, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie);
-
-/*
-	fz_run_annot: Run an annotation through a device.
-
-	page: Page obtained from fz_load_page.
-
-	annot: an annotation.
-
-	dev: Device obtained from fz_new_*_device.
-
-	transform: Transform to apply to page. May include for example
-	scaling and rotation, see fz_scale, fz_rotate and fz_concat.
-	Set to fz_identity if no transformation is desired.
-
-	cookie: Communication mechanism between caller and library
-	rendering the page. Intended for multi-threaded applications,
-	while single-threaded applications set cookie to NULL. The
-	caller may abort an ongoing rendering of a page. Cookie also
-	communicates progress information back to the caller. The
-	fields inside cookie are continually updated while the page is
-	rendering.
-*/
-void fz_run_annot(fz_context *ctx, fz_annot *annot, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie);
-
-/*
-	fz_keep_page: Keep a reference to a loaded page.
-
-	Does not throw exceptions.
-*/
-fz_page *fz_keep_page(fz_context *ctx, fz_page *page);
-
-/*
-	fz_drop_page: Free a loaded page.
-
-	Does not throw exceptions.
-*/
-void fz_drop_page(fz_context *ctx, fz_page *page);
-
-/*
-	fz_page_presentation: Get the presentation details for a given page.
-
-	transition: A pointer to a transition struct to fill out.
-
-	duration: A pointer to a place to set the page duration in seconds.
-	Will be set to 0 if no transition is specified for the page.
-
-	Returns: a pointer to the transition structure, or NULL if there is no
-	transition specified for the page.
-*/
-fz_transition *fz_page_presentation(fz_context *ctx, fz_page *page, fz_transition *transition, float *duration);
-
-/*
-	fz_has_permission: Check permission flags on document.
-*/
-int fz_has_permission(fz_context *ctx, fz_document *doc, fz_permission p);
-
-/*
-	fz_lookup_metadata: Retrieve document meta data strings.
-
-	doc: The document to query.
-
-	key: Which meta data key to retrieve...
-
-	Basic information:
-		'format'	-- Document format and version.
-		'encryption'	-- Description of the encryption used.
-
-	From the document information dictionary:
-		'info:Title'
-		'info:Author'
-		'info:Subject'
-		'info:Keywords'
-		'info:Creator'
-		'info:Producer'
-		'info:CreationDate'
-		'info:ModDate'
-
-	buf: The buffer to hold the results (a nul-terminated UTF-8 string).
-
-	size: Size of 'buf'.
-
-	Returns the size of the output string (may be larger than 'size' if
-	the output was truncated), or -1 if the key is not recognized or found.
-*/
-int fz_lookup_metadata(fz_context *ctx, fz_document *doc, const char *key, char *buf, int size);
-
-#define FZ_META_FORMAT "format"
-#define FZ_META_ENCRYPTION "encryption"
-
-#define FZ_META_INFO_AUTHOR "info:Author"
-#define FZ_META_INFO_TITLE "info:Title"
-
-/*
-	Get the number of separations on a page (including CMYK). This will
-	be 0, unless the format specifically supports separations (such as
-	gproof files).
-*/
-int fz_count_separations_on_page(fz_context *ctx, fz_page *page);
-
-/*
-	Enable/Disable a given separation on a given page. This will only
-	affect future renderings of pages from a format that supports
-	separations (such as gproof files).
-*/
-void fz_control_separation_on_page(fz_context *ctx, fz_page *page, int sep, int disable);
-
-/*
-	Returns whether a given separation on a given page is disabled. This will only
-	work from a format that supports separations (such as gproof files).
- */
-int fz_separation_disabled_on_page (fz_context *ctx, fz_page *, int sep);
-
-/*
-	Get the name and equivalent RGBA, CMYK colors of a given separation
-	on a given page. This will only work for formats that support
-	gproof files.
-*/
-const char *fz_get_separation_on_page(fz_context *ctx, fz_page *page, int sep, uint32_t *rgba, uint32_t *cmyk);
-
-/*
-	fz_save_gproof: Given a currently open document, create a
-	gproof skeleton file from that document.
-
-	doc_filename: The name of the currently opened document file.
-
-	doc: The currently opened document.
-
-	filename: The filename of the desired gproof file.
-
-	res: The resolution at which proofing should be done.
-
-	print_profile: The filename of the ICC profile for the printer we are proofing
-
-	display_profile: The filename of the ICC profile for our display device
-*/
-void fz_save_gproof(fz_context *ctx, const char *doc_filename, fz_document *doc, const char *filename, int res,
-	const char *print_profile, const char *display_profile);
-
-#endif

+ 0 - 39
server/lib/xfdftool/include/mupdf/fitz/filter.h

@@ -1,39 +0,0 @@
-#ifndef MUPDF_FITZ_FILTER_H
-#define MUPDF_FITZ_FILTER_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/buffer.h"
-#include "mupdf/fitz/store.h"
-#include "mupdf/fitz/stream.h"
-
-typedef struct fz_jbig2_globals_s fz_jbig2_globals;
-
-fz_stream *fz_open_copy(fz_context *ctx, fz_stream *chain);
-fz_stream *fz_open_null(fz_context *ctx, fz_stream *chain, int len, fz_off_t offset);
-fz_stream *fz_open_concat(fz_context *ctx, int max, int pad);
-void fz_concat_push(fz_context *ctx, fz_stream *concat, fz_stream *chain); /* Ownership of chain is passed in */
-fz_stream *fz_open_arc4(fz_context *ctx, fz_stream *chain, unsigned char *key, unsigned keylen);
-fz_stream *fz_open_aesd(fz_context *ctx, fz_stream *chain, unsigned char *key, unsigned keylen);
-fz_stream *fz_open_a85d(fz_context *ctx, fz_stream *chain);
-fz_stream *fz_open_ahxd(fz_context *ctx, fz_stream *chain);
-fz_stream *fz_open_rld(fz_context *ctx, fz_stream *chain);
-fz_stream *fz_open_dctd(fz_context *ctx, fz_stream *chain, int color_transform, int l2factor, fz_stream *jpegtables);
-fz_stream *fz_open_faxd(fz_context *ctx, fz_stream *chain,
-	int k, int end_of_line, int encoded_byte_align,
-	int columns, int rows, int end_of_block, int black_is_1);
-fz_stream *fz_open_flated(fz_context *ctx, fz_stream *chain, int window_bits);
-fz_stream *fz_open_lzwd(fz_context *ctx, fz_stream *chain, int early_change, int min_bits, int reverse_bits, int old_tiff);
-fz_stream *fz_open_predict(fz_context *ctx, fz_stream *chain, int predictor, int columns, int colors, int bpc);
-fz_stream *fz_open_jbig2d(fz_context *ctx, fz_stream *chain, fz_jbig2_globals *globals);
-
-fz_jbig2_globals *fz_load_jbig2_globals(fz_context *ctx, fz_buffer *buf);
-void fz_drop_jbig2_globals_imp(fz_context *ctx, fz_storable *globals);
-
-/* Extra filters for tiff */
-fz_stream *fz_open_sgilog16(fz_context *ctx, fz_stream *chain, int w);
-fz_stream *fz_open_sgilog24(fz_context *ctx, fz_stream *chain, int w);
-fz_stream *fz_open_sgilog32(fz_context *ctx, fz_stream *chain, int w);
-fz_stream *fz_open_thunder(fz_context *ctx, fz_stream *chain, int w);
-
-#endif

+ 0 - 620
server/lib/xfdftool/include/mupdf/fitz/font.h

@@ -1,620 +0,0 @@
-#ifndef MUPDF_FITZ_FONT_H
-#define MUPDF_FITZ_FONT_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/geometry.h"
-#include "mupdf/fitz/buffer.h"
-
-/* forward declaration for circular dependency */
-struct fz_device_s;
-
-/*
-	An abstract font handle.
-*/
-typedef struct fz_font_s fz_font;
-
-/*
- * Fonts come in two variants:
- *	Regular fonts are handled by FreeType.
- *	Type 3 fonts have callbacks to the interpreter.
- */
-
-/*
-	fz_font_ft_face: Retrieve the FT_Face handle
-	for the font.
-
-	font: The font to query
-
-	Returns the FT_Face handle for the font, or NULL
-	if not a freetype handled font. (Cast to void *
-	to avoid nasty header exposure).
-*/
-void *fz_font_ft_face(fz_context *ctx, fz_font *font);
-
-/*
-	fz_font_t3_procs: Retrieve the Type3 procs
-	for a font.
-
-	font: The font to query
-
-	Returns the t3_procs pointer. Will be NULL for a
-	non type-3 font.
-*/
-fz_buffer **fz_font_t3_procs(fz_context *ctx, fz_font *font);
-
-/*
-	ft_error_string: map an FT error number to a
-	static string.
-
-	err: The error number to lookup.
-
-	Returns a pointer to a static textual representation
-	of a freetype error.
-*/
-const char *ft_error_string(int err);
-
-/* common CJK font collections */
-enum { FZ_ADOBE_CNS_1, FZ_ADOBE_GB_1, FZ_ADOBE_JAPAN_1, FZ_ADOBE_KOREA_1 };
-
-/*
-	fz_font_flags_t: Every fz_font carries a set of flags
-	within it, in a fz_font_flags_t structure.
-*/
-typedef struct
-{
-	unsigned int is_mono : 1;
-	unsigned int is_serif : 1;
-	unsigned int is_bold : 1;
-	unsigned int is_italic : 1;
-	unsigned int ft_substitute : 1; /* use substitute metrics */
-	unsigned int ft_stretch : 1; /* stretch to match PDF metrics */
-
-	unsigned int fake_bold : 1; /* synthesize bold */
-	unsigned int fake_italic : 1; /* synthesize italic */
-	unsigned int force_hinting : 1; /* force hinting for DynaLab fonts */
-	unsigned int has_opentype : 1; /* has opentype shaping tables */
-	unsigned int invalid_bbox : 1;
-	unsigned int use_glyph_bbox : 1;
-} fz_font_flags_t;
-
-/*
-	fz_font_flags: Retrieve a pointer to the font flags
-	for a given font. These can then be updated as required.
-
-	font: The font to query
-
-	Returns a pointer to the flags structure (or NULL, if
-	the font is NULL).
-*/
-fz_font_flags_t *fz_font_flags(fz_font *font);
-
-/*
-	fz_shaper_data_t: In order to shape a given font, we need to
-	declare it to a shaper library (harfbuzz, by default, but others
-	are possible). To avoid redeclaring it every time we need to
-	shape, we hold a shaper handle and the destructor for it within
-	the font itself. The handle is initialised by the caller when
-	first required and the destructor is called when the fz_font is
-	destroyed.
-*/
-typedef struct
-{
-	void *shaper_handle;
-	void (*destroy)(fz_context *ctx, void *); /* Destructor for shape_handle */
-} fz_shaper_data_t;
-
-/*
-	fz_shaper_data_t: Retrieve a pointer to the shaper data
-	structure for the given font.
-
-	font: The font to query.
-
-	Returns a pointer to the shaper data structure (or NULL if
-	font is NULL).
-*/
-fz_shaper_data_t *fz_font_shaper_data(fz_context *ctx, fz_font *font);
-
-/*
-	fz_font_name: Retrieve a pointer to the name of the font.
-
-	font: The font to query.
-
-	Returns a pointer to an internal copy of the font name.
-	Will never be NULL, but may be the empty string.
-*/
-const char *fz_font_name(fz_context *ctx, fz_font *font);
-
-/*
-	fz_font_is_bold: Returns true if the font is bold.
-*/
-int fz_font_is_bold(fz_context *ctx, fz_font *font);
-
-/*
-	fz_font_is_italic: Returns true if the font is italic.
-*/
-int fz_font_is_italic(fz_context *ctx, fz_font *font);
-
-/*
-	fz_font_is_serif: Returns true if the font is serif.
-*/
-int fz_font_is_serif(fz_context *ctx, fz_font *font);
-
-/*
-	fz_font_is_monospaced: Returns true if the font is monospaced.
-*/
-int fz_font_is_monospaced(fz_context *ctx, fz_font *font);
-
-/*
-	fz_font_bbox: Retrieve a pointer to the font bbox.
-
-	font: The font to query.
-
-	Returns a pointer to the font bbox (or NULL if the
-	font is NULL).
-*/
-fz_rect *fz_font_bbox(fz_context *ctx, fz_font *font);
-
-/*
-	fz_load_system_font_fn: Type for user supplied system font loading hook.
-
-	name: The name of the font to load.
-	bold: 1 if a bold font desired, 0 otherwise.
-	italic: 1 if an italic font desired, 0 otherwise.
-	needs_exact_metrics: 1 if an exact metric match is required for the font requested.
-
-	Returns a new font handle, or NULL if no font found (or on error).
-*/
-typedef fz_font *(*fz_load_system_font_fn)(fz_context *ctx, const char *name, int bold, int italic, int needs_exact_metrics);
-
-/*
-	fz_load_system_cjk_font_fn: Type for user supplied cjk font loading hook.
-
-	name: The name of the font to load.
-	ros: The registry from which to load the font (e.g. FZ_ADOBE_KOREA_1)
-	serif: 1 if a serif font is desired, 0 otherwise.
-
-	Returns a new font handle, or NULL if no font found (or on error).
-*/
-typedef fz_font *(*fz_load_system_cjk_font_fn)(fz_context *ctx, const char *name, int ros, int serif);
-
-/*
-	fz_load_system_fallback_font_fn: Type for user supplied fallback font loading hook.
-
-	name: The name of the font to load.
-	script: UCDN script enum.
-	language: FZ_LANG enum.
-	serif, bold, italic: boolean style flags.
-
-	Returns a new font handle, or NULL if no font found (or on error).
-*/
-typedef fz_font *(*fz_load_system_fallback_font_fn)(fz_context *ctx, int script, int language, int serif, int bold, int italic);
-
-/*
-	fz_install_load_system_font_fn: Install functions to allow
-	MuPDF to request fonts from the system.
-
-	Only one set of hooks can be in use at a time.
-*/
-void fz_install_load_system_font_funcs(fz_context *ctx,
-	fz_load_system_font_fn f,
-	fz_load_system_cjk_font_fn f_cjk,
-	fz_load_system_fallback_font_fn f_fallback);
-
-/* fz_load_*_font returns NULL if no font could be loaded (also on error) */
-/*
-	fz_load_system_font: Attempt to load a given font from the
-	system.
-
-	name: The name of the desired font.
-
-	bold: 1 if bold desired, 0 otherwise.
-
-	italic: 1 if italic desired, 0 otherwise.
-
-	needs_exact_metrics: 1 if an exact metrical match is required,
-	0 otherwise.
-
-	Returns a new font handle, or NULL if no matching font was found
-	(or on error).
-*/
-fz_font *fz_load_system_font(fz_context *ctx, const char *name, int bold, int italic, int needs_exact_metrics);
-
-/*
-	fz_load_system_cjk_font: Attempt to load a given font from
-	the system.
-
-	name: The name of the desired font.
-
-	ros: The registry to load the font from (e.g. FZ_ADOBE_KOREA_1)
-
-	serif: 1 if serif desired, 0 otherwise.
-
-	Returns a new font handle, or NULL if no matching font was found
-	(or on error).
-*/
-fz_font *fz_load_system_cjk_font(fz_context *ctx, const char *name, int ros, int serif);
-
-/*
-	fz_lookup_builtin_font: Search the builtin fonts for a match.
-	Whether a given font is present or not will depend on the
-	configuration in which MuPDF is built.
-
-	name: The name of the font desired.
-
-	bold: 1 if bold desired, 0 otherwise.
-
-	italic: 1 if italic desired, 0 otherwise.
-
-	len: Pointer to a place to receive the length of the discovered
-	font buffer.
-
-	Returns a pointer to the font file data, or NULL if not present.
-*/
-const char *fz_lookup_builtin_font(fz_context *ctx, const char *name, int bold, int italic, int *len);
-
-/*
-	fz_lookup_base14_font: Search the builtin base14 fonts for a match.
-	Whether a given font is present or not will depend on the
-	configuration in which MuPDF is built.
-
-	name: The name of the font desired.
-
-	len: Pointer to a place to receive the length of the discovered
-	font buffer.
-
-	Returns a pointer to the font file data, or NULL if not present.
-*/
-const char *fz_lookup_base14_font(fz_context *ctx, const char *name, int *len);
-
-/*
-	fz_lookup_cjk_font: Search the builtin cjk fonts for a match.
-	Whether a font is present or not will depend on the
-	configuration in which MuPDF is built.
-
-	registry: The desired registry to lookup in (e.g.
-	FZ_ADOBE_KOREA_1)
-
-	serif: 1 if serif desired, 0 otherwise.
-
-	wmode: 1 for vertical mode, 0 for horizontal.
-
-	len: Pointer to a place to receive the length of the discovered
-	font buffer.
-
-	index: Pointer to a place to store the index of the discovered
-	font.
-
-	Returns a pointer to the font file data, or NULL if not present.
-*/
-const char *fz_lookup_cjk_font(fz_context *ctx, int registry, int serif, int wmode, int *len, int *index);
-
-/*
-	fz_lookup_noto_font: Search the builtin noto fonts for a match.
-	Whether a font is present or not will depend on the
-	configuration in which MuPDF is built.
-
-	script: The script desired (e.g. UCDN_SCRIPT_KATAKANA)
-
-	lang: The language desired (e.g. FZ_LANG_ja)
-
-	serif: 1 if serif desired, 0 otherwise.
-
-	len: Pointer to a place to receive the length of the discovered
-	font buffer.
-
-	Returns a pointer to the font file data, or NULL if not present.
-*/
-const char *fz_lookup_noto_font(fz_context *ctx, int script, int lang, int serif, int *len);
-
-/*
-	fz_lookup_noto_symbol_font: Search the builtin noto fonts
-	for a symbol font. Whether a font is present or not will
-	depend on the configuration in which MuPDF is built.
-
-	len: Pointer to a place to receive the length of the discovered
-	font buffer.
-
-	Returns a pointer to the font file data, or NULL if not present.
-*/
-const char *fz_lookup_noto_symbol_font(fz_context *ctx, int *len);
-
-/*
-	fz_lookup_noto_emoji_font: Search the builtin noto fonts
-	for an emoji font. Whether a font is present or not will
-	depend on the configuration in which MuPDF is built.
-
-	len: Pointer to a place to receive the length of the discovered
-	font buffer.
-
-	Returns a pointer to the font file data, or NULL if not present.
-*/
-const char *fz_lookup_noto_emoji_font(fz_context *ctx, int *len);
-
-/*
-	fz_load_fallback_font: Try to load a fallback font for the
-	given combination of font attributes. Whether a font is
-	present or not will depend on the configuration in which
-	MuPDF is built.
-
-	script: The script desired (e.g. UCDN_SCRIPT_KATAKANA)
-
-	language: The language desired (e.g. FZ_LANG_ja)
-
-	serif: 1 if serif desired, 0 otherwise.
-
-	bold: 1 if bold desired, 0 otherwise.
-
-	italic: 1 if italic desired, 0 otherwise.
-
-	Returns a new font handle, or NULL if not available.
-*/
-fz_font *fz_load_fallback_font(fz_context *ctx, int script, int language, int serif, int bold, int italic);
-
-/*
-	fz_load_fallback_symbol_font: Try to load a fallback
-	symbol font. Whether a font is present or not will
-	depend on the configuration in which MuPDF is built.
-
-	Returns a new font handle, or NULL if not available.
-*/
-fz_font *fz_load_fallback_symbol_font(fz_context *ctx);
-
-/*
-	fz_load_fallback_emoji_font: Try to load a fallback
-	emoji font. Whether a font is present or not will
-	depend on the configuration in which MuPDF is built.
-
-	Returns a new font handle, or NULL if not available.
-*/
-fz_font *fz_load_fallback_emoji_font(fz_context *ctx);
-
-/*
-	fz_new_type3_font: Create a new (empty) type3 font.
-
-	name: Name of font (or NULL).
-
-	matrix: Font matrix.
-
-	Returns a new font handle, or throws exception on
-	allocation failure.
-*/
-fz_font *fz_new_type3_font(fz_context *ctx, const char *name, const fz_matrix *matrix);
-
-/*
-	fz_new_font_from_memory: Create a new font from a font
-	file in memory.
-
-	name: Name of font (leave NULL to use name from font).
-
-	data: Pointer to the font file data.
-
-	len: Length of the font file data.
-
-	index: Which font from the file to load (0 for default).
-
-	use_glyph_box: 1 if we should use the glyph bbox, 0 otherwise.
-
-	Returns new font handle, or throws exception on error.
-*/
-fz_font *fz_new_font_from_memory(fz_context *ctx, const char *name, const char *data, int len, int index, int use_glyph_bbox);
-
-/*
-	fz_new_font_from_buffer: Create a new font from a font
-	file in a fz_buffer.
-
-	name: Name of font (leave NULL to use name from font).
-
-	buffer: Buffer to load from.
-
-	index: Which font from the file to load (0 for default).
-
-	use_glyph_box: 1 if we should use the glyph bbox, 0 otherwise.
-
-	Returns new font handle, or throws exception on error.
-*/
-fz_font *fz_new_font_from_buffer(fz_context *ctx, const char *name, fz_buffer *buffer, int index, int use_glyph_bbox);
-
-/*
-	fz_new_font_from_file: Create a new font from a font
-	file.
-
-	name: Name of font (leave NULL to use name from font).
-
-	path: File path to load from.
-
-	index: Which font from the file to load (0 for default).
-
-	use_glyph_box: 1 if we should use the glyph bbox, 0 otherwise.
-
-	Returns new font handle, or throws exception on error.
-*/
-fz_font *fz_new_font_from_file(fz_context *ctx, const char *name, const char *path, int index, int use_glyph_bbox);
-
-/*
-	Add a reference to an existing fz_font.
-
-	font: The font to add a reference to.
-
-	Returns the same font.
-*/
-fz_font *fz_keep_font(fz_context *ctx, fz_font *font);
-
-/*
-	Drop a reference to a fz_font, destroying the
-	font when the last reference is dropped.
-
-	font: The font to drop a reference to.
-*/
-void fz_drop_font(fz_context *ctx, fz_font *font);
-
-/*
-	fz_set_font_bbox: Set the font bbox.
-
-	font: The font to set the bbox for.
-
-	xmin, ymin, xmax, ymax: The bounding box.
-*/
-void fz_set_font_bbox(fz_context *ctx, fz_font *font, float xmin, float ymin, float xmax, float ymax);
-
-/*
-	fz_bound_glyph: Return a bbox for a given glyph in a font.
-
-	font: The font to look for the glyph in.
-
-	gid: The glyph to bound.
-
-	trm: The matrix to apply to the glyph before bounding.
-
-	r: Pointer to a fz_rect to use for storage.
-
-	Returns r, after filling it in with the bounds of the given glyph.
-*/
-fz_rect *fz_bound_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, fz_rect *r);
-
-/*
-	fz_glyph_cacheable: Determine if a given glyph in a font
-	is cacheable. Certain glyphs in a type 3 font cannot safely
-	be cached, as their appearance depends on the enclosing
-	graphic state.
-
-	font: The font to look for the glyph in.
-
-	gif: The glyph to query.
-
-	Returns non-zero if cacheable, 0 if not.
-*/
-int fz_glyph_cacheable(fz_context *ctx, fz_font *font, int gid);
-
-/*
-	fz_run_t3_glyph: Run a glyph from a Type3 font to
-	a given device.
-
-	font: The font to find the glyph in.
-
-	gid: The glyph to run.
-
-	trm: The transform to apply.
-
-	dev: The device to render onto.
-*/
-void fz_run_t3_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, struct fz_device_s *dev);
-
-/*
-	fz_decouple_type3_font: Internal function to remove the
-	references to a document held by a Type3 font. This is
-	called during document destruction to ensure that Type3
-	fonts clean up properly.
-
-	Without this call being made, Type3 fonts can be left
-	holding pdf_obj references for the sake of interpretation
-	operations that will never come. These references
-	cannot be freed after the document, hence this function
-	forces them to be freed earlier in the process.
-
-	font: The font to decouple.
-
-	t3doc: The document to which the font may refer.
-*/
-void fz_decouple_type3_font(fz_context *ctx, fz_font *font, void *t3doc);
-
-/*
-	fz_advance_glyph: Return the advance for a given glyph.
-
-	font: The font to look for the glyph in.
-
-	glyph: The glyph to find the advance for.
-
-	wmode: 1 for vertical mode, 0 for horizontal.
-
-	Returns the advance for the glyph.
-*/
-float fz_advance_glyph(fz_context *ctx, fz_font *font, int glyph, int wmode);
-
-/*
-	fz_encode_character: Find the glyph id for a given unicode
-	character within a font.
-
-	font: The font to look for the unicode character in.
-
-	unicode: The unicode character to encode.
-
-	Returns the glyph id for the given unicode value, or 0 if
-	unknown.
-*/
-int fz_encode_character(fz_context *ctx, fz_font *font, int unicode);
-
-/*
-	fz_encode_character_with_fallback: Find the glyph id for
-	a given unicode character within a font, falling back to
-	an alternative if not found.
-
-	font: The font to look for the unicode character in.
-
-	unicode: The unicode character to encode.
-
-	script: The script in use.
-
-	language: The language in use.
-
-	out_font: The font handle in which the given glyph represents
-	the requested unicode character. The caller does not own the
-	reference it is passed, so should call fz_keep_font if it is
-	not simply to be used immediately.
-
-	Returns the glyph id for the given unicode value in the supplied
-	font (and sets *out_font to font) if it is present. Otherwise
-	an alternative fallback font (based on script/language) is
-	searched for. If the glyph is found therein, *out_font is set
-	to this reference, and the glyph reference is returned. If it
-	cannot be found anywhere, the function returns 0.
-*/
-int fz_encode_character_with_fallback(fz_context *ctx, fz_font *font, int unicode, int script, int language, fz_font **out_font);
-
-/*
-	fz_get_glyph_name: Find the name of a glyph
-
-	font: The font to look for the glyph in.
-
-	glyph: The glyph id to look for.
-
-	buf: Pointer to a buffer for the name to be inserted into.
-
-	size: The size of the buffer.
-
-	If a font contains a name table, then the name of the glyph
-	will be returned in the supplied buffer. Otherwise a name
-	is synthesised. The name will be truncated to fit in
-	the buffer.
-*/
-void fz_get_glyph_name(fz_context *ctx, fz_font *font, int glyph, char *buf, int size);
-
-/*
-	fz_print_font: Output textual information about a font
-	to a given output stream.
-
-	out: The output stream to output to.
-
-	font: The font to output details for.
-*/
-void fz_print_font(fz_context *ctx, fz_output *out, fz_font *font);
-
-/*
-	Internal functions for our Harfbuzz integration
-	to work around the lack of thread safety.
-*/
-
-/*
-	hb_lock: Lock against Harfbuzz being called
-	simultaneously in several threads. This reuses
-	FZ_LOCK_FREETYPE.
-*/
-void hb_lock(fz_context *ctx);
-
-/*
-	hb_unlock: Unlock after a Harfbuzz call. This reuses
-	FZ_LOCK_FREETYPE.
-*/
-void hb_unlock(fz_context *ctx);
-
-#endif

+ 0 - 41
server/lib/xfdftool/include/mupdf/fitz/function.h

@@ -1,41 +0,0 @@
-#ifndef MUPDF_FITZ_FUNCTION_H
-#define MUPDF_FITZ_FUNCTION_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/store.h"
-#include "mupdf/fitz/colorspace.h"
-
-/*
- * The generic function support.
- */
-
-typedef struct fz_function_s fz_function;
-
-void fz_eval_function(fz_context *ctx, fz_function *func, const float *in, int inlen, float *out, int outlen);
-fz_function *fz_keep_function(fz_context *ctx, fz_function *func);
-void fz_drop_function(fz_context *ctx, fz_function *func);
-size_t fz_function_size(fz_context *ctx, fz_function *func);
-void fz_print_function(fz_context *ctx, fz_output *out, fz_function *func);
-
-enum
-{
-	FZ_FN_MAXN = FZ_MAX_COLORS,
-	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;
-	size_t size;
-	int m;					/* number of input values */
-	int n;					/* number of output values */
-	void (*evaluate)(fz_context *ctx, fz_function *func, const float *in, float *out);
-	void (*print)(fz_context *ctx, fz_output *out, fz_function *func);
-};
-
-#endif

+ 0 - 665
server/lib/xfdftool/include/mupdf/fitz/geometry.h

@@ -1,665 +0,0 @@
-#ifndef MUPDF_FITZ_MATH_H
-#define MUPDF_FITZ_MATH_H
-
-#include "mupdf/fitz/system.h"
-
-/*
-	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 */
-	int x = a * b + 128;
-	x += x >> 8;
-	return x >> 8;
-}
-
-/*
-	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.
-*/
-#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.
-*/
-#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).
-*/
-#define FZ_BLEND(SRC, DST, AMOUNT) ((((SRC)-(DST))*(AMOUNT) + ((DST)<<8))>>8)
-
-/*
-	Range checking atof
-*/
-float fz_atof(const char *s);
-
-/*
-	atoi that copes with NULL
-*/
-int fz_atoi(const char *s);
-
-fz_off_t fz_atoo(const char *s);
-
-/*
-	Some standard math functions, done as static inlines for speed.
-	People with compilers that do not adequately implement inlines may
-	like to reimplement these using macros.
-*/
-static inline float fz_abs(float f)
-{
-	return (f < 0 ? -f : f);
-}
-
-static inline int fz_absi(int i)
-{
-	return (i < 0 ? -i : i);
-}
-
-static inline float fz_min(float a, float b)
-{
-	return (a < b ? a : b);
-}
-
-static inline int fz_mini(int a, int b)
-{
-	return (a < b ? a : b);
-}
-
-static inline size_t fz_minz(size_t a, size_t b)
-{
-	return (a < b ? a : b);
-}
-
-static inline float fz_max(float a, float b)
-{
-	return (a > b ? a : b);
-}
-
-static inline int fz_maxi(int a, int b)
-{
-	return (a > b ? a : b);
-}
-
-static inline fz_off_t fz_maxo(fz_off_t a, fz_off_t b)
-{
-	return (a > b ? a : b);
-}
-
-static inline float fz_clamp(float f, float min, float max)
-{
-	return (f > min ? (f < max ? f : max) : min);
-}
-
-static inline int fz_clampi(int i, int min, int max)
-{
-	return (i > min ? (i < max ? i : max) : min);
-}
-
-static inline double fz_clampd(double d, double min, double max)
-{
-	return (d > min ? (d < max ? d : max) : min);
-}
-
-static inline void *fz_clampp(void *p, void *min, void *max)
-{
-	return (p > min ? (p < max ? p : max) : min);
-}
-
-#define DIV_BY_ZERO(a, b, min, max) (((a) < 0) ^ ((b) < 0) ? (min) : (max))
-
-/*
-	fz_point is a point in a two-dimensional space.
-*/
-typedef struct fz_point_s fz_point;
-struct fz_point_s
-{
-	float x, y;
-};
-
-/*
-	fz_rect is a rectangle represented by two diagonally opposite
-	corners at arbitrary coordinates.
-
-	Rectangles are always axis-aligned with the X- and Y- axes.
-	The relationship between the coordinates are that x0 <= x1 and
-	y0 <= y1 in all cases except for infinite rectangles. The area
-	of a rectangle is defined as (x1 - x0) * (y1 - y0). If either
-	x0 > x1 or y0 > y1 is true for a given rectangle then it is
-	defined to be infinite.
-
-	To check for empty or infinite rectangles use fz_is_empty_rect
-	and fz_is_infinite_rect.
-
-	x0, y0: The top left corner.
-
-	x1, y1: The bottom right corner.
-*/
-typedef struct fz_rect_s fz_rect;
-struct fz_rect_s
-{
-	float x0, y0;
-	float x1, y1;
-};
-
-/*
-	fz_rect_min: get the minimum point from a rectangle as a fz_point.
-*/
-static inline fz_point *fz_rect_min(fz_rect *f)
-{
-	return (fz_point *)&f->x0;
-}
-
-/*
-	fz_rect_max: get the maximum point from a rectangle as a fz_point.
-*/
-static inline fz_point *fz_rect_max(fz_rect *f)
-{
-	return (fz_point *)&f->x1;
-}
-
-/*
-	fz_irect is a rectangle using integers instead of floats.
-
-	It's used in the draw device and for pixmap dimensions.
-*/
-typedef struct fz_irect_s fz_irect;
-struct fz_irect_s
-{
-	int x0, y0;
-	int x1, y1;
-};
-
-/*
-	A rectangle with sides of length one.
-
-	The bottom left corner is at (0, 0) and the top right corner
-	is at (1, 1).
-*/
-extern const fz_rect fz_unit_rect;
-
-/*
-	An empty rectangle with an area equal to zero.
-
-	Both the top left and bottom right corner are at (0, 0).
-*/
-extern const fz_rect fz_empty_rect;
-extern const fz_irect fz_empty_irect;
-
-/*
-	An infinite rectangle with negative area.
-
-	The corner (x0, y0) is at (1, 1) while the corner (x1, y1) is
-	at (-1, -1).
-*/
-extern const fz_rect fz_infinite_rect;
-extern const fz_irect fz_infinite_irect;
-
-/*
-	fz_is_empty_rect: Check if rectangle is empty.
-
-	An empty rectangle is defined as one whose area is zero.
-*/
-static inline int
-fz_is_empty_rect(const fz_rect *r)
-{
-	return ((r)->x0 == (r)->x1 || (r)->y0 == (r)->y1);
-}
-
-static inline int
-fz_is_empty_irect(const fz_irect *r)
-{
-	return ((r)->x0 == (r)->x1 || (r)->y0 == (r)->y1);
-}
-
-/*
-	fz_is_infinite_rect: Check if rectangle is infinite.
-
-	An infinite rectangle is defined as one where either of the
-	two relationships between corner coordinates are not true.
-*/
-static inline int
-fz_is_infinite_rect(const fz_rect *r)
-{
-	return ((r)->x0 > (r)->x1 || (r)->y0 > (r)->y1);
-}
-
-/*
-	fz_is_infinite_irect: Check if an integer rectangle
-	is infinite.
-
-	An infinite rectangle is defined as one where either of the
-	two relationships between corner coordinates are not true.
-*/
-static inline int
-fz_is_infinite_irect(const fz_irect *r)
-{
-	return ((r)->x0 > (r)->x1 || (r)->y0 > (r)->y1);
-}
-
-/*
-	fz_matrix is a row-major 3x3 matrix used for representing
-	transformations of coordinates throughout MuPDF.
-
-	Since all points reside in a two-dimensional space, one vector
-	is always a constant unit vector; hence only some elements may
-	vary in a matrix. Below is how the elements map between
-	different representations.
-
-	/ a b 0 \
-	| c d 0 | normally represented as [ a b c d e f ].
-	\ e f 1 /
-*/
-typedef struct fz_matrix_s fz_matrix;
-struct fz_matrix_s
-{
-	float a, b, c, d, e, f;
-};
-
-/*
-	fz_identity: Identity transform matrix.
-*/
-extern const fz_matrix fz_identity;
-
-static inline fz_matrix *fz_copy_matrix(fz_matrix *restrict m, const fz_matrix *restrict s)
-{
-	*m = *s;
-	return m;
-}
-
-/*
-	fz_concat: Multiply two matrices.
-
-	The order of the two matrices are important since matrix
-	multiplication is not commutative.
-
-	Returns result.
-
-	Does not throw exceptions.
-*/
-fz_matrix *fz_concat(fz_matrix *result, const fz_matrix *left, const fz_matrix *right);
-
-/*
-	fz_scale: Create a scaling matrix.
-
-	The returned matrix is of the form [ sx 0 0 sy 0 0 ].
-
-	m: Pointer to the matrix to populate
-
-	sx, sy: Scaling factors along the X- and Y-axes. A scaling
-	factor of 1.0 will not cause any scaling along the relevant
-	axis.
-
-	Returns m.
-
-	Does not throw exceptions.
-*/
-fz_matrix *fz_scale(fz_matrix *m, float sx, float sy);
-
-/*
-	fz_pre_scale: Scale a matrix by premultiplication.
-
-	m: Pointer to the matrix to scale
-
-	sx, sy: Scaling factors along the X- and Y-axes. A scaling
-	factor of 1.0 will not cause any scaling along the relevant
-	axis.
-
-	Returns m (updated).
-
-	Does not throw exceptions.
-*/
-fz_matrix *fz_pre_scale(fz_matrix *m, float sx, float sy);
-
-/*
-	fz_post_scale: Scale a matrix by postmultiplication.
-
-	m: Pointer to the matrix to scale
-
-	sx, sy: Scaling factors along the X- and Y-axes. A scaling
-	factor of 1.0 will not cause any scaling along the relevant
-	axis.
-
-	Returns m (updated).
-
-	Does not throw exceptions.
-*/
-fz_matrix *fz_post_scale(fz_matrix *m, float sx, float sy);
-
-/*
-	fz_shear: Create a shearing matrix.
-
-	The returned matrix is of the form [ 1 sy sx 1 0 0 ].
-
-	m: pointer to place to store returned matrix
-
-	sx, sy: Shearing factors. A shearing factor of 0.0 will not
-	cause any shearing along the relevant axis.
-
-	Returns m.
-
-	Does not throw exceptions.
-*/
-fz_matrix *fz_shear(fz_matrix *m, float sx, float sy);
-
-/*
-	fz_pre_shear: Premultiply a matrix with a shearing matrix.
-
-	The shearing matrix is of the form [ 1 sy sx 1 0 0 ].
-
-	m: pointer to matrix to premultiply
-
-	sx, sy: Shearing factors. A shearing factor of 0.0 will not
-	cause any shearing along the relevant axis.
-
-	Returns m (updated).
-
-	Does not throw exceptions.
-*/
-fz_matrix *fz_pre_shear(fz_matrix *m, float sx, float sy);
-
-/*
-	fz_rotate: Create a rotation matrix.
-
-	The returned matrix is of the form
-	[ cos(deg) sin(deg) -sin(deg) cos(deg) 0 0 ].
-
-	m: Pointer to place to store matrix
-
-	degrees: Degrees of counter clockwise rotation. Values less
-	than zero and greater than 360 are handled as expected.
-
-	Returns m.
-
-	Does not throw exceptions.
-*/
-fz_matrix *fz_rotate(fz_matrix *m, float degrees);
-
-/*
-	fz_pre_rotate: Rotate a transformation by premultiplying.
-
-	The premultiplied matrix is of the form
-	[ cos(deg) sin(deg) -sin(deg) cos(deg) 0 0 ].
-
-	m: Pointer to matrix to premultiply.
-
-	degrees: Degrees of counter clockwise rotation. Values less
-	than zero and greater than 360 are handled as expected.
-
-	Returns m (updated).
-
-	Does not throw exceptions.
-*/
-fz_matrix *fz_pre_rotate(fz_matrix *m, float degrees);
-
-/*
-	fz_translate: Create a translation matrix.
-
-	The returned matrix is of the form [ 1 0 0 1 tx ty ].
-
-	m: A place to store the created matrix.
-
-	tx, ty: Translation distances along the X- and Y-axes. A
-	translation of 0 will not cause any translation along the
-	relevant axis.
-
-	Returns m.
-
-	Does not throw exceptions.
-*/
-fz_matrix *fz_translate(fz_matrix *m, float tx, float ty);
-
-/*
-	fz_pre_translate: Translate a matrix by premultiplication.
-
-	m: The matrix to translate
-
-	tx, ty: Translation distances along the X- and Y-axes. A
-	translation of 0 will not cause any translation along the
-	relevant axis.
-
-	Returns m.
-
-	Does not throw exceptions.
-*/
-fz_matrix *fz_pre_translate(fz_matrix *m, float tx, float ty);
-
-/*
-	fz_invert_matrix: Create an inverse matrix.
-
-	inverse: Place to store inverse matrix.
-
-	matrix: Matrix to invert. A degenerate matrix, where the
-	determinant is equal to zero, can not be inverted and the
-	original matrix is returned instead.
-
-	Returns inverse.
-
-	Does not throw exceptions.
-*/
-fz_matrix *fz_invert_matrix(fz_matrix *inverse, const fz_matrix *matrix);
-
-/*
-	fz_try_invert_matrix: Attempt to create an inverse matrix.
-
-	inverse: Place to store inverse matrix.
-
-	matrix: Matrix to invert. A degenerate matrix, where the
-	determinant is equal to zero, can not be inverted.
-
-	Returns 1 if matrix is degenerate (singular), or 0 otherwise.
-
-	Does not throw exceptions.
-*/
- int fz_try_invert_matrix(fz_matrix *inverse, const fz_matrix *matrix);
-
-/*
-	fz_is_rectilinear: Check if a transformation is rectilinear.
-
-	Rectilinear means that no shearing is present and that any
-	rotations present are a multiple of 90 degrees. Usually this
-	is used to make sure that axis-aligned rectangles before the
-	transformation are still axis-aligned rectangles afterwards.
-
-	Does not throw exceptions.
-*/
-int fz_is_rectilinear(const fz_matrix *m);
-
-/*
-	fz_matrix_expansion: Calculate average scaling factor of matrix.
-*/
-float fz_matrix_expansion(const fz_matrix *m); /* sumatrapdf */
-
-/*
-	fz_intersect_rect: Compute intersection of two rectangles.
-
-	Given two rectangles, update the first to be the smallest
-	axis-aligned rectangle that covers the area covered by both
-	given rectangles. If either rectangle is empty then the
-	intersection is also empty. If either rectangle is infinite
-	then the intersection is simply the non-infinite rectangle.
-	Should both rectangles be infinite, then the intersection is
-	also infinite.
-
-	Does not throw exceptions.
-*/
-fz_rect *fz_intersect_rect(fz_rect *restrict a, const fz_rect *restrict b);
-
-/*
-	fz_intersect_irect: Compute intersection of two bounding boxes.
-
-	Similar to fz_intersect_rect but operates on two bounding
-	boxes instead of two rectangles.
-
-	Does not throw exceptions.
-*/
-fz_irect *fz_intersect_irect(fz_irect *restrict a, const fz_irect *restrict b);
-
-/*
-	fz_union_rect: Compute union of two rectangles.
-
-	Given two rectangles, update the first to be the smallest
-	axis-aligned rectangle that encompasses both given rectangles.
-	If either rectangle is infinite then the union is also infinite.
-	If either rectangle is empty then the union is simply the
-	non-empty rectangle. Should both rectangles be empty, then the
-	union is also empty.
-
-	Does not throw exceptions.
-*/
-fz_rect *fz_union_rect(fz_rect *restrict a, const fz_rect *restrict b);
-
-/*
-	fz_irect_from_rect: Convert a rect into the minimal bounding box
-	that covers the rectangle.
-
-	bbox: Place to store the returned bbox.
-
-	rect: The rectangle to convert to a bbox.
-
-	Coordinates in a bounding box are integers, so rounding of the
-	rects coordinates takes place. The top left corner is rounded
-	upwards and left while the bottom right corner is rounded
-	downwards and to the right.
-
-	Returns bbox (updated).
-
-	Does not throw exceptions.
-*/
-
-fz_irect *fz_irect_from_rect(fz_irect *restrict bbox, const fz_rect *restrict rect);
-
-/*
-	fz_round_rect: Round rectangle coordinates.
-
-	Coordinates in a bounding box are integers, so rounding of the
-	rects coordinates takes place. The top left corner is rounded
-	upwards and left while the bottom right corner is rounded
-	downwards and to the right.
-
-	This differs from fz_irect_from_rect, in that fz_irect_from_rect
-	slavishly follows the numbers (i.e any slight over/under calculations
-	can cause whole extra pixels to be added). fz_round_rect
-	allows for a small amount of rounding error when calculating
-	the bbox.
-
-	Does not throw exceptions.
-*/
-fz_irect *fz_round_rect(fz_irect *restrict bbox, const fz_rect *restrict rect);
-
-/*
-	fz_rect_from_irect: Convert a bbox into a rect.
-
-	For our purposes, a rect can represent all the values we meet in
-	a bbox, so nothing can go wrong.
-
-	rect: A place to store the generated rectangle.
-
-	bbox: The bbox to convert.
-
-	Returns rect (updated).
-
-	Does not throw exceptions.
-*/
-fz_rect *fz_rect_from_irect(fz_rect *restrict rect, const fz_irect *restrict bbox);
-
-/*
-	fz_expand_rect: Expand a bbox by a given amount in all directions.
-
-	Does not throw exceptions.
-*/
-fz_rect *fz_expand_rect(fz_rect *b, float expand);
-
-/*
-	fz_include_point_in_rect: Expand a bbox to include a given point.
-	To create a rectangle that encompasses a sequence of points, the
-	rectangle must first be set to be the empty rectangle at one of
-	the points before including the others.
-*/
-fz_rect *fz_include_point_in_rect(fz_rect *r, const fz_point *p);
-
-/*
-	fz_translate_irect: Translate bounding box.
-
-	Translate a bbox by a given x and y offset. Allows for overflow.
-
-	Does not throw exceptions.
-*/
-fz_irect *fz_translate_irect(fz_irect *a, int xoff, int yoff);
-
-/*
-	fz_contains_rect: Test rectangle inclusion.
-
-	Return true if a entirely contains b.
-
-	Does not throw exceptions.
-*/
-int fz_contains_rect(const fz_rect *a, const fz_rect *b);
-
-/*
-	fz_transform_point: Apply a transformation to a point.
-
-	transform: Transformation matrix to apply. See fz_concat,
-	fz_scale, fz_rotate and fz_translate for how to create a
-	matrix.
-
-	point: Pointer to point to update.
-
-	Returns transform (unchanged).
-
-	Does not throw exceptions.
-*/
-fz_point *fz_transform_point(fz_point *restrict point, const fz_matrix *restrict transform);
-fz_point *fz_transform_point_xy(fz_point *restrict point, const fz_matrix *restrict transform, float x, float y);
-
-/*
-	fz_transform_vector: Apply a transformation to a vector.
-
-	transform: Transformation matrix to apply. See fz_concat,
-	fz_scale and fz_rotate for how to create a matrix. Any
-	translation will be ignored.
-
-	vector: Pointer to vector to update.
-
-	Does not throw exceptions.
-*/
-fz_point *fz_transform_vector(fz_point *restrict vector, const fz_matrix *restrict transform);
-
-/*
-	fz_transform_rect: Apply a transform to a rectangle.
-
-	After the four corner points of the axis-aligned rectangle
-	have been transformed it may not longer be axis-aligned. So a
-	new axis-aligned rectangle is created covering at least the
-	area of the transformed rectangle.
-
-	transform: Transformation matrix to apply. See fz_concat,
-	fz_scale and fz_rotate for how to create a matrix.
-
-	rect: Rectangle to be transformed. The two special cases
-	fz_empty_rect and fz_infinite_rect, may be used but are
-	returned unchanged as expected.
-
-	Does not throw exceptions.
-*/
-fz_rect *fz_transform_rect(fz_rect *restrict rect, const fz_matrix *restrict transform);
-
-/*
-	fz_normalize_vector: Normalize a vector to length one.
-*/
-void fz_normalize_vector(fz_point *p);
-
-void fz_gridfit_matrix(int as_tiled, fz_matrix *m);
-
-float fz_matrix_max_expansion(const fz_matrix *m);
-
-#endif

+ 0 - 20
server/lib/xfdftool/include/mupdf/fitz/getopt.h

@@ -1,20 +0,0 @@
-#ifndef MUPDF_FITZ_GETOPT_H
-#define MUPDF_FITZ_GETOPT_H
-
-/*
-	getopt: Simple functions/variables for use in tools.
-*/
-extern int fz_getopt(int nargc, char * const *nargv, const char *ostr);
-extern int fz_optind;
-extern char *fz_optarg;
-
-/*
-	Windows unicode versions.
-*/
-#if defined(_WIN32) || defined(_WIN64)
-extern int fz_getoptw(int nargc, wchar_t * const *nargv, const wchar_t *ostr);
-extern int fz_optindw;
-extern wchar_t *fz_optargw;
-#endif
-
-#endif

+ 0 - 16
server/lib/xfdftool/include/mupdf/fitz/glyph-cache.h

@@ -1,16 +0,0 @@
-#ifndef MUPDF_FITZ_GLYPH_CACHE_H
-#define MUPDF_FITZ_GLYPH_CACHE_H
-
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/geometry.h"
-#include "mupdf/fitz/font.h"
-#include "mupdf/fitz/pixmap.h"
-
-void fz_purge_glyph_cache(fz_context *ctx);
-fz_pixmap *fz_render_glyph_pixmap(fz_context *ctx, fz_font*, int, fz_matrix *, 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);
-float fz_subpixel_adjust(fz_context *ctx, fz_matrix *ctm, fz_matrix *subpix_ctm, unsigned char *qe, unsigned char *qf);
-
-#endif

+ 0 - 135
server/lib/xfdftool/include/mupdf/fitz/glyph.h

@@ -1,135 +0,0 @@
-#ifndef MUPDF_FITZ_GLYPH_H
-#define MUPDF_FITZ_GLYPH_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/geometry.h"
-#include "mupdf/fitz/store.h"
-#include "mupdf/fitz/colorspace.h"
-
-/*
-	Glyphs represent a run length encoded set of pixels for a 2
-	dimensional region of a plane.
-*/
-typedef struct fz_glyph_s fz_glyph;
-
-/*
-	fz_glyph_bbox: Return the bounding box for a glyph.
-*/
-fz_irect *fz_glyph_bbox(fz_context *ctx, fz_glyph *glyph, fz_irect *bbox);
-
-/*
-	fz_glyph_width: Return the width of the glyph in pixels.
-*/
-int fz_glyph_width(fz_context *ctx, fz_glyph *glyph);
-
-/*
-	fz_glyph_height: Return the height of the glyph in pixels.
-*/
-int fz_glyph_height(fz_context *ctx, fz_glyph *glyph);
-
-/*
-	fz_new_glyph_from_pixmap: Create a new glyph from a pixmap
-
-	Returns a pointer to the new glyph. Throws exception on failure to
-	allocate.
-*/
-fz_glyph *fz_new_glyph_from_pixmap(fz_context *ctx, fz_pixmap *pix);
-
-/*
-	fz_new_glyph_from_8bpp_data: Create a new glyph from 8bpp data
-
-	x, y: X and Y position for the glyph
-
-	w, h: Width and Height for the glyph
-
-	sp: Source Pointer to data
-
-	span: Increment from line to line of data
-
-	Returns a pointer to the new glyph. Throws exception on failure to
-	allocate.
-*/
-fz_glyph *fz_new_glyph_from_8bpp_data(fz_context *ctx, int x, int y, int w, int h, unsigned char *sp, int span);
-
-/*
-	fz_new_glyph_from_1bpp_data: Create a new glyph from 1bpp data
-
-	x, y: X and Y position for the glyph
-
-	w, h: Width and Height for the glyph
-
-	sp: Source Pointer to data
-
-	span: Increment from line to line of data
-
-	Returns a pointer to the new glyph. Throws exception on failure to
-	allocate.
-*/
-fz_glyph *fz_new_glyph_from_1bpp_data(fz_context *ctx, int x, int y, int w, int h, unsigned char *sp, int span);
-
-/*
-	fz_keep_glyph: Take a reference to a glyph.
-
-	pix: The glyph to increment the reference for.
-
-	Returns pix. Does not throw exceptions.
-*/
-fz_glyph *fz_keep_glyph(fz_context *ctx, fz_glyph *pix);
-
-/*
-	fz_drop_glyph: Drop a reference and free a glyph.
-
-	Decrement the reference count for the glyph. When no
-	references remain the glyph will be freed.
-
-	Does not throw exceptions.
-*/
-void fz_drop_glyph(fz_context *ctx, fz_glyph *pix);
-
-/*
-	Glyphs represent a set of pixels for a 2 dimensional region of a
-	plane.
-
-	x, y: The minimum x and y coord of the region in pixels.
-
-	w, h: The width and height of the region in pixels.
-
-	samples: The sample data. The sample data is in a compressed format
-	designed to give reasonable compression, and to be fast to plot from.
-
-	The first sizeof(int) * h bytes of the table, when interpreted as
-	ints gives the offset within the data block of that lines data. An
-	offset of 0 indicates that that line is completely blank.
-
-	The data for individual lines is a sequence of bytes:
-	 00000000 = end of lines data
-	 LLLLLL00 = extend the length given in the next run by the 6 L bits
-		given here.
-	 LLLLLL01 = A run of length L+1 transparent pixels.
-	 LLLLLE10 = A run of length L+1 solid pixels. If E then this is the
-		last run on this line.
-	 LLLLLE11 = A run of length L+1 intermediate pixels followed by L+1
-		bytes of literal pixel data. If E then this is the last run
-		on this line.
-*/
-struct fz_glyph_s
-{
-	fz_storable storable;
-	int x, y, w, h;
-	fz_pixmap *pixmap;
-	size_t size;
-	unsigned char data[1];
-};
-
-fz_irect *fz_glyph_bbox_no_ctx(fz_glyph *src, fz_irect *bbox);
-
-static inline size_t
-fz_glyph_size(fz_context *ctx, fz_glyph *glyph)
-{
-	if (glyph == NULL)
-		return 0;
-	return sizeof(fz_glyph) + glyph->size + fz_pixmap_size(ctx, glyph->pixmap);
-}
-
-#endif

+ 0 - 33
server/lib/xfdftool/include/mupdf/fitz/hash.h

@@ -1,33 +0,0 @@
-#ifndef MUPDF_FITZ_HASH_H
-#define MUPDF_FITZ_HASH_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/output.h"
-
-/*
- * Generic hash-table with fixed-length keys.
- *
- * The keys and values are NOT reference counted by the hash table.
- * Callers are responsible for taking care the reference counts are correct.
- * Inserting a duplicate entry will NOT overwrite the old value, and will
- * return the old value.
- *
- * The drop_val callback function is only used to release values when the hash table
- * is destroyed.
- */
-
-typedef struct fz_hash_table_s fz_hash_table;
-typedef void (*fz_hash_table_drop_fn)(fz_context *ctx, void *val);
-
-fz_hash_table *fz_new_hash_table(fz_context *ctx, int initialsize, int keylen, int lock, fz_hash_table_drop_fn drop_val);
-void fz_drop_hash_table(fz_context *ctx, fz_hash_table *table);
-
-void *fz_hash_find(fz_context *ctx, fz_hash_table *table, const void *key);
-void *fz_hash_insert(fz_context *ctx, fz_hash_table *table, const void *key, void *val);
-void fz_hash_remove(fz_context *ctx, fz_hash_table *table, const void *key);
-
-void fz_print_hash(fz_context *ctx, fz_output *out, fz_hash_table *table);
-void fz_print_hash_details(fz_context *ctx, fz_output *out, fz_hash_table *table, void (*details)(fz_context*, fz_output*, void*), int compact);
-
-#endif

+ 0 - 312
server/lib/xfdftool/include/mupdf/fitz/image.h

@@ -1,312 +0,0 @@
-#ifndef MUPDF_FITZ_IMAGE_H
-#define MUPDF_FITZ_IMAGE_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/store.h"
-#include "mupdf/fitz/colorspace.h"
-#include "mupdf/fitz/pixmap.h"
-
-#include "mupdf/fitz/buffer.h"
-#include "mupdf/fitz/stream.h"
-#include "mupdf/fitz/compressed-buffer.h"
-
-/*
-	Images are storable objects from which we can obtain fz_pixmaps.
-	These may be implemented as simple wrappers around a pixmap, or as
-	more complex things that decode at different subsample settings on
-	demand.
-*/
-typedef struct fz_image_s fz_image;
-typedef struct fz_compressed_image_s fz_compressed_image;
-typedef struct fz_pixmap_image_s fz_pixmap_image;
-
-/*
-	fz_get_pixmap_from_image: Called to get a handle to a pixmap from an image.
-
-	image: The image to retrieve a pixmap from.
-
-	subarea: The subarea of the image that we actually care about (or NULL
-	to indicate the whole image).
-
-	trans: Optional, unless subarea is given. If given, then on entry this is
-	the transform that will be applied to the complete image. It should be
-	updated on exit to the transform to apply to the given subarea of the
-	image. This is used to calculate the desired width/height for subsampling.
-
-	w: If non-NULL, a pointer to an int to be updated on exit to the
-	width (in pixels) that the scaled output will cover.
-
-	h: If non-NULL, a pointer to an int to be updated on exit to the
-	height (in pixels) that the scaled output will cover.
-
-	Returns a non NULL pixmap pointer. May throw exceptions.
-*/
-fz_pixmap *fz_get_pixmap_from_image(fz_context *ctx, fz_image *image, const fz_irect *subarea, fz_matrix *trans, int *w, int *h);
-
-/*
-	fz_drop_image: Drop a reference to an image.
-
-	image: The image to drop a reference to.
-*/
-void fz_drop_image(fz_context *ctx, fz_image *image);
-
-/*
-	fz_keep_image: Increment the reference count of an image.
-
-	image: The image to take a reference to.
-
-	Returns a pointer to the image.
-*/
-fz_image *fz_keep_image(fz_context *ctx, fz_image *image);
-
-fz_image *fz_keep_image_store_key(fz_context *ctx, fz_image *image);
-void fz_drop_image_store_key(fz_context *ctx, fz_image *image);
-
-/*
-	fz_drop_image_fn: Function type to destroy an images data
-	when it's reference count reaches zero.
-*/
-typedef void (fz_drop_image_fn)(fz_context *ctx, fz_image *image);
-
-/*
-	fz_get_pixmap_fn: Function type to get a decoded pixmap
-	for an image.
-
-	im: The image to decode.
-
-	subarea: NULL, or the subarea of the image required. Expressed
-	in terms of a rectangle in the original width/height of the
-	image. If non NULL, this should be updated by the function to
-	the actual subarea decoded - which must include the requested
-	area!
-
-	w, h: The actual width and height that the whole image would
-	need to be decoded to.
-
-	l2factor: On entry, the log 2 subsample factor required. If
-	possible the decode process can take care of (all or some) of
-	this subsampling, and must then update the value so the caller
-	knows what remains to be done.
-
-	Returns a reference to a decoded pixmap that satisfies the
-	requirements of the request.
-*/
-typedef fz_pixmap *(fz_image_get_pixmap_fn)(fz_context *ctx, fz_image *im, fz_irect *subarea, int w, int h, int *l2factor);
-
-/*
-	fz_image_get_size_fn: Function type to get the given storage
-	size for an image.
-
-	Returns the size in bytes used for a given image.
-*/
-typedef size_t (fz_image_get_size_fn)(fz_context *, fz_image *);
-
-/*
-	fz_new_image_of_size: Internal function to make a new fz_image structure
-	for a derived class.
-
-	w,h: Width and height of the created image.
-
-	bpc: Bits per component.
-
-	colorspace: The colorspace (determines the number of components,
-	and any color conversions required while decoding).
-
-	xres, yres: The X and Y resolutions respectively.
-
-	interpolate: 1 if interpolation should be used when decoding
-	this image, 0 otherwise.
-
-	imagemask: 1 if this is an imagemask (i.e. transparent), 0
-	otherwise.
-
-	decode: NULL, or a pointer to to a decode array. The default
-	decode array is [0 1] (repeated n times, for n color components).
-
-	colorkey: NULL, or a pointer to a colorkey array. The default
-	colorkey array is [0 255] (repeatd n times, for n color
-	components).
-
-	mask: NULL, or another image to use as a mask for this one.
-	A new reference is taken to this image. Supplying a masked
-	image as a mask to another image is illegal!
-
-	size: The size of the required allocated structure (the size of
-	the derived structure).
-
-	get: The function to be called to obtain a decoded pixmap.
-
-	get_size: The function to be called to return the storage size
-	used by this image.
-
-	drop: The function to be called to dispose of this image once
-	the last reference is dropped.
-
-	Returns a pointer to an allocated structure of the required size,
-	with the first sizeof(fz_image) bytes initialised as appropriate
-	given the supplied parameters, and the other bytes set to zero.
-*/
-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_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))
-
-/*
-	fz_new_image_from_compressed_buffer: Create an image based on
-	the data in the supplied compressed buffer.
-
-	w,h: Width and height of the created image.
-
-	bpc: Bits per component.
-
-	colorspace: The colorspace (determines the number of components,
-	and any color conversions required while decoding).
-
-	xres, yres: The X and Y resolutions respectively.
-
-	interpolate: 1 if interpolation should be used when decoding
-	this image, 0 otherwise.
-
-	imagemask: 1 if this is an imagemask (i.e. transparent), 0
-	otherwise.
-
-	decode: NULL, or a pointer to to a decode array. The default
-	decode array is [0 1] (repeated n times, for n color components).
-
-	colorkey: NULL, or a pointer to a colorkey array. The default
-	colorkey array is [0 255] (repeatd n times, for n color
-	components).
-
-	buffer: Buffer of compressed data and compression parameters.
-	Ownership of this reference is passed in.
-
-	mask: NULL, or another image to use as a mask for this one.
-	A new reference is taken to this image. Supplying a masked
-	image as a mask to another image is illegal!
-*/
-fz_image *fz_new_image_from_compressed_buffer(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_compressed_buffer *buffer, fz_image *mask);
-
-/*
-	fz_new_image_from_pixmap: Create an image from the given
-	pixmap.
-
-	pixmap: The pixmap to base the image upon. A new reference
-	to this is taken.
-
-	mask: NULL, or another image to use as a mask for this one.
-	A new reference is taken to this image. Supplying a masked
-	image as a mask to another image is illegal!
-*/
-fz_image *fz_new_image_from_pixmap(fz_context *ctx, fz_pixmap *pixmap, fz_image *mask);
-
-/*
-	fz_new_image_from_buffer: Create a new image from a
-	buffer of data, inferring its type from the format
-	of the data.
-*/
-fz_image *fz_new_image_from_buffer(fz_context *ctx, fz_buffer *buffer);
-
-/*
-	fz_image_from_file: Create a new image from the contents
-	of a file, inferring its type from the format of the
-	data.
-*/
-fz_image *fz_new_image_from_file(fz_context *ctx, const char *path);
-
-void fz_drop_image_imp(fz_context *ctx, fz_storable *image);
-fz_pixmap *fz_decomp_image_from_stream(fz_context *ctx, fz_stream *stm, fz_compressed_image *image, fz_irect *subarea, int indexed, int l2factor);
-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;
-	int w, h;
-	uint8_t n;
-	uint8_t bpc;
-	unsigned int imagemask:1;
-	unsigned int interpolate:1;
-	unsigned int use_colorkey:1;
-	unsigned int use_decode:1;
-	unsigned int invert_cmyk_jpeg:1;
-	unsigned int decoded:1;
-	unsigned int scalable:1;
-	fz_image *mask;
-	int xres; /* As given in the image, not necessarily as rendered */
-	int yres; /* As given in the image, not necessarily as rendered */
-	fz_colorspace *colorspace;
-	fz_drop_image_fn *drop_image;
-	fz_image_get_pixmap_fn *get_pixmap;
-	fz_image_get_size_fn *get_size;
-	int colorkey[FZ_MAX_COLORS * 2];
-	float decode[FZ_MAX_COLORS * 2];
-};
-
-fz_pixmap *fz_load_jpeg(fz_context *ctx, unsigned char *data, size_t size);
-fz_pixmap *fz_load_jpx(fz_context *ctx, unsigned char *data, size_t size, fz_colorspace *cs);
-fz_pixmap *fz_load_png(fz_context *ctx, unsigned char *data, size_t size);
-fz_pixmap *fz_load_tiff(fz_context *ctx, unsigned char *data, size_t size);
-fz_pixmap *fz_load_jxr(fz_context *ctx, unsigned char *data, size_t size);
-fz_pixmap *fz_load_gif(fz_context *ctx, unsigned char *data, size_t size);
-fz_pixmap *fz_load_bmp(fz_context *ctx, unsigned char *data, size_t size);
-fz_pixmap *fz_load_pnm(fz_context *ctx, unsigned char *data, size_t size);
-
-void fz_load_jpeg_info(fz_context *ctx, unsigned char *data, size_t size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace);
-void fz_load_jpx_info(fz_context *ctx, unsigned char *data, size_t size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace);
-void fz_load_png_info(fz_context *ctx, unsigned char *data, size_t size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace);
-void fz_load_tiff_info(fz_context *ctx, unsigned char *data, size_t size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace);
-void fz_load_jxr_info(fz_context *ctx, unsigned char *data, size_t size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace);
-void fz_load_gif_info(fz_context *ctx, unsigned char *data, size_t size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace);
-void fz_load_bmp_info(fz_context *ctx, unsigned char *data, size_t size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace);
-void fz_load_pnm_info(fz_context *ctx, unsigned char *data, size_t size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace);
-
-int fz_load_tiff_subimage_count(fz_context *ctx, unsigned char *buf, size_t len);
-fz_pixmap *fz_load_tiff_subimage(fz_context *ctx, unsigned char *buf, size_t len, int subimage);
-
-/*
-	fz_image_resolution: Request the natural resolution
-	of an image.
-
-	xres, yres: Pointers to ints to be updated with the
-	natural resolution of an image (or a sensible default
-	if not encoded).
-*/
-void fz_image_resolution(fz_image *image, int *xres, int *yres);
-
-fz_pixmap *fz_compressed_image_tile(fz_context *ctx, fz_compressed_image *cimg);
-void fz_set_compressed_image_tile(fz_context *ctx, fz_compressed_image *cimg, fz_pixmap *pix);
-
-/*
-	fz_compressed_image_buffer: Retrieve the underlying compressed
-	data for an image.
-
-	Returns a pointer to the underlying data buffer for an image,
-	or NULL if this image is not based upon a compressed data
-	buffer.
-
-	This is not a reference counted structure, so no reference is
-	returned. Lifespan is limited to that of the image itself.
-*/
-fz_compressed_buffer *fz_compressed_image_buffer(fz_context *ctx, fz_image *image);
-void fz_set_compressed_image_buffer(fz_context *ctx, fz_compressed_image *cimg, fz_compressed_buffer *buf);
-
-/*
-	fz_pixmap_image_tile: Retried the underlying fz_pixmap
-	for an image.
-
-	Returns a pointer to the underlying fz_pixmap for an image,
-	or NULL if this image is not based upon an fz_pixmap.
-
-	No reference is returned. Lifespan is limited to that of
-	the image itself. If required, use fz_keep_pixmap to take
-	a reference to keep it longer.
-*/
-fz_pixmap *fz_pixmap_image_tile(fz_context *ctx, fz_pixmap_image *cimg);
-void fz_set_pixmap_image_tile(fz_context *ctx, fz_pixmap_image *cimg, fz_pixmap *pix);
-
-#endif

+ 0 - 57
server/lib/xfdftool/include/mupdf/fitz/link.h

@@ -1,57 +0,0 @@
-#ifndef MUPDF_FITZ_LINK_H
-#define MUPDF_FITZ_LINK_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/geometry.h"
-
-/*
-	Links
-*/
-
-typedef struct fz_link_s fz_link;
-
-/*
-	fz_link is a list of interactive links on a page.
-
-	There is no relation between the order of the links in the
-	list and the order they appear on the page. The list of links
-	for a given page can be obtained from fz_load_links.
-
-	A link is reference counted. Dropping a reference to a link is
-	done by calling fz_drop_link.
-
-	rect: The hot zone. The area that can be clicked in
-	untransformed coordinates.
-
-	uri: Link destinations come in two forms: internal and external.
-	Internal links refer to other pages in the same document.
-	External links are URLs to other documents.
-
-	next: A pointer to the next link on the same page.
-*/
-struct fz_link_s
-{
-	int refs;
-	fz_link *next;
-	fz_rect rect;
-	void *doc;
-	char *uri;
-};
-
-fz_link *fz_new_link(fz_context *ctx, const fz_rect *bbox, void *doc, const char *uri);
-fz_link *fz_keep_link(fz_context *ctx, fz_link *link);
-
-/*
-	Checks if a link destination is external or internal.
-*/
-int fz_is_external_link(fz_context *ctx, const char *uri);
-
-/*
-	fz_drop_link: Drop and free a list of links.
-
-	Does not throw exceptions.
-*/
-void fz_drop_link(fz_context *ctx, fz_link *link);
-
-#endif

+ 0 - 58
server/lib/xfdftool/include/mupdf/fitz/outline.h

@@ -1,58 +0,0 @@
-#ifndef MUPDF_FITZ_OUTLINE_H
-#define MUPDF_FITZ_OUTLINE_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/link.h"
-#include "mupdf/fitz/output.h"
-
-/* Outline */
-
-/*
-	fz_outline is a tree of the outline of a document (also known
-	as table of contents).
-
-	title: Title of outline item using UTF-8 encoding. May be NULL
-	if the outline item has no text string.
-
-	uri: Destination in the document to be displayed when this
-	outline item is activated. May be an internal or external
-	link, or NULL if the outline item does not have a destination.
-
-	page: The page number of an internal link, or -1 for external
-	links or links with no destination.
-
-	next: The next outline item at the same level as this outline
-	item. May be NULL if no more outline items exist at this level.
-
-	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
-{
-	int refs;
-	char *title;
-	char *uri;
-	int page;
-	fz_outline *next;
-	fz_outline *down;
-	int is_open;
-};
-
-/*
-	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' as plain text.
-*/
-void fz_print_outline(fz_context *ctx, fz_output *out, fz_outline *outline);
-
-fz_outline *fz_new_outline(fz_context *ctx);
-fz_outline *fz_keep_outline(fz_context *ctx, fz_outline *outline);
-void fz_drop_outline(fz_context *ctx, fz_outline *outline);
-
-#endif

+ 0 - 106
server/lib/xfdftool/include/mupdf/fitz/output-pcl.h

@@ -1,106 +0,0 @@
-#ifndef MUPDF_FITZ_OUTPUT_PCL_H
-#define MUPDF_FITZ_OUTPUT_PCL_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/output.h"
-#include "mupdf/fitz/band-writer.h"
-#include "mupdf/fitz/pixmap.h"
-#include "mupdf/fitz/bitmap.h"
-
-/*
-	PCL output
-*/
-typedef struct fz_pcl_options_s fz_pcl_options;
-
-struct fz_pcl_options_s
-{
-	/* Features of a particular printer */
-	int features;
-	const char *odd_page_init;
-	const char *even_page_init;
-
-	/* Options for this job */
-	int tumble;
-	int duplex_set;
-	int duplex;
-	int paper_size;
-	int manual_feed_set;
-	int manual_feed;
-	int media_position_set;
-	int media_position;
-	int orientation;
-
-	/* Updated as we move through the job */
-	int page_count;
-};
-
-/*
-	 fz_pcl_preset: Retrieve a set of fz_pcl_options suitable for a given
-	 preset.
-
-	 opts: pointer to options structure to populate.
-
-	 preset: Preset to fetch. Currently defined presets include:
-		ljet4	HP DeskJet
-		dj500	HP DeskJet 500
-		fs600	Kyocera FS-600
-		lj	HP LaserJet, HP LaserJet Plus
-		lj2	HP LaserJet IIp, HP LaserJet IId
-		lj3	HP LaserJet III
-		lj3d	HP LaserJet IIId
-		lj4	HP LaserJet 4
-		lj4pl	HP LaserJet 4 PL
-		lj4d	HP LaserJet 4d
-		lp2563b	HP 2563B line printer
-		oce9050	Oce 9050 Line printer
-
-	Throws exception on unknown preset.
-*/
-void fz_pcl_preset(fz_context *ctx, fz_pcl_options *opts, const char *preset);
-
-/*
-	fz_pcl_option: Set a given PCL option to a given value in the supplied
-	options structure.
-
-	opts: The option structure to modify,
-
-	option: The option to change.
-
-	val: The value that the option should be set to. Acceptable ranges of
-	values depend on the option in question.
-
-	Throws an exception on attempt to set an unknown option, or an illegal
-	value.
-
-	Currently defined options/values are as follows:
-
-		spacing,0		No vertical spacing capability
-		spacing,1		PCL 3 spacing (<ESC>*p+<n>Y)
-		spacing,2		PCL 4 spacing (<ESC>*b<n>Y)
-		spacing,3		PCL 5 spacing (<ESC>*b<n>Y and clear seed row)
-		mode2,0 or 1		Disable/Enable mode 2 graphics compression
-		mode3,0 or 1		Disable/Enable mode 3 graphics compression
-		mode3,0 or 1		Disable/Enable mode 3 graphics compression
-		eog_reset,0 or 1	End of graphics (<ESC>*rB) resets all parameters
-		has_duplex,0 or 1	Duplex supported (<ESC>&l<duplex>S)
-		has_papersize,0 or 1	Papersize setting supported (<ESC>&l<sizecode>A)
-		has_copies,0 or 1	Number of copies supported (<ESC>&l<copies>X)
-		is_ljet4pjl,0 or 1	Disable/Enable HP 4PJL model-specific output
-		is_oce9050,0 or 1	Disable/Enable Oce 9050 model-specific output
-*/
-void fz_pcl_option(fz_context *ctx, fz_pcl_options *opts, const char *option, int val);
-
-fz_band_writer *fz_new_mono_pcl_band_writer(fz_context *ctx, fz_output *out, const fz_pcl_options *options);
-
-void fz_write_bitmap_as_pcl(fz_context *ctx, fz_output *out, const fz_bitmap *bitmap, const fz_pcl_options *pcl);
-
-void fz_save_bitmap_as_pcl(fz_context *ctx, fz_bitmap *bitmap, char *filename, int append, const fz_pcl_options *pcl);
-
-fz_band_writer *fz_new_color_pcl_band_writer(fz_context *ctx, fz_output *out, const fz_pcl_options *options);
-
-void fz_write_pixmap_as_pcl(fz_context *ctx, fz_output *out, const fz_pixmap *pixmap, const fz_pcl_options *pcl);
-
-void fz_save_pixmap_as_pcl(fz_context *ctx, fz_pixmap *pixmap, char *filename, int append, const fz_pcl_options *pcl);
-
-#endif

+ 0 - 36
server/lib/xfdftool/include/mupdf/fitz/output-png.h

@@ -1,36 +0,0 @@
-#ifndef MUPDF_FITZ_OUTPUT_PNG_H
-#define MUPDF_FITZ_OUTPUT_PNG_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/output.h"
-#include "mupdf/fitz/band-writer.h"
-#include "mupdf/fitz/pixmap.h"
-#include "mupdf/fitz/bitmap.h"
-
-#include "mupdf/fitz/buffer.h"
-#include "mupdf/fitz/image.h"
-
-/*
-	fz_save_pixmap_as_png: Save a pixmap as a PNG image file.
-*/
-void fz_save_pixmap_as_png(fz_context *ctx, fz_pixmap *pixmap, const char *filename);
-
-/*
-	Write a pixmap to an output stream in PNG format.
-*/
-void fz_write_pixmap_as_png(fz_context *ctx, fz_output *out, const fz_pixmap *pixmap);
-
-/*
-	fz_new_png_band_writer: Obtain a fz_band_writer instance
-	for producing PNG output.
-*/
-fz_band_writer *fz_new_png_band_writer(fz_context *ctx, fz_output *out);
-
-/*
-	Create a new buffer containing the image/pixmap in PNG format.
-*/
-fz_buffer *fz_new_buffer_from_image_as_png(fz_context *ctx, fz_image *image);
-fz_buffer *fz_new_buffer_from_pixmap_as_png(fz_context *ctx, fz_pixmap *pixmap);
-
-#endif

+ 0 - 51
server/lib/xfdftool/include/mupdf/fitz/output-pnm.h

@@ -1,51 +0,0 @@
-#ifndef MUPDF_FITZ_OUTPUT_PNM_H
-#define MUPDF_FITZ_OUTPUT_PNM_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/output.h"
-#include "mupdf/fitz/band-writer.h"
-#include "mupdf/fitz/pixmap.h"
-#include "mupdf/fitz/bitmap.h"
-
-/*
-	fz_save_pixmap_as_pnm: Save a pixmap as a PNM image file.
-*/
-void fz_save_pixmap_as_pnm(fz_context *ctx, fz_pixmap *pixmap, const char *filename);
-
-void fz_write_pixmap_as_pnm(fz_context *ctx, fz_output *out, fz_pixmap *pixmap);
-
-fz_band_writer *fz_new_pnm_band_writer(fz_context *ctx, fz_output *out);
-
-/*
-	fz_save_pixmap_as_pam: Save a pixmap as a PAM image file.
-*/
-void fz_save_pixmap_as_pam(fz_context *ctx, fz_pixmap *pixmap, const char *filename);
-
-void fz_write_pixmap_as_pam(fz_context *ctx, fz_output *out, fz_pixmap *pixmap);
-
-fz_band_writer *fz_new_pam_band_writer(fz_context *ctx, fz_output *out);
-
-/*
-	fz_save_bitmap_as_pbm: Save a bitmap as a PBM image file.
-*/
-void fz_save_bitmap_as_pbm(fz_context *ctx, fz_bitmap *bitmap, const char *filename);
-
-void fz_write_bitmap_as_pbm(fz_context *ctx, fz_output *out, fz_bitmap *bitmap);
-
-fz_band_writer *fz_new_pbm_band_writer(fz_context *ctx, fz_output *out);
-
-void fz_save_pixmap_as_pbm(fz_context *ctx, fz_pixmap *pixmap, const char *filename);
-
-/*
-	fz_save_bitmap_as_pkm: Save a 4bpp cmyk bitmap as a PAM image file.
-*/
-void fz_save_bitmap_as_pkm(fz_context *ctx, fz_bitmap *bitmap, const char *filename);
-
-void fz_write_bitmap_as_pkm(fz_context *ctx, fz_output *out, fz_bitmap *bitmap);
-
-fz_band_writer *fz_new_pkm_band_writer(fz_context *ctx, fz_output *out);
-
-void fz_save_pixmap_as_pkm(fz_context *ctx, fz_pixmap *pixmap, const char *filename);
-
-#endif

+ 0 - 23
server/lib/xfdftool/include/mupdf/fitz/output-ps.h

@@ -1,23 +0,0 @@
-#ifndef MUPDF_FITZ_OUTPUT_PS_H
-#define MUPDF_FITZ_OUTPUT_PS_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/output.h"
-#include "mupdf/fitz/band-writer.h"
-#include "mupdf/fitz/pixmap.h"
-
-/*
-	PS (image) output
-*/
-void fz_write_pixmap_as_ps(fz_context *ctx, fz_output *out, const fz_pixmap *pixmap);
-
-void fz_save_pixmap_as_ps(fz_context *ctx, fz_pixmap *pixmap, char *filename, int append);
-
-void fz_write_ps_file_header(fz_context *ctx, fz_output *out);
-
-fz_band_writer *fz_new_ps_band_writer(fz_context *ctx, fz_output *out);
-
-void fz_write_ps_file_trailer(fz_context *ctx, fz_output *out, int pages);
-
-#endif

+ 0 - 116
server/lib/xfdftool/include/mupdf/fitz/output-pwg.h

@@ -1,116 +0,0 @@
-#ifndef MUPDF_FITZ_OUTPUT_PWG_H
-#define MUPDF_FITZ_OUTPUT_PWG_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/output.h"
-#include "mupdf/fitz/band-writer.h"
-#include "mupdf/fitz/pixmap.h"
-#include "mupdf/fitz/bitmap.h"
-
-typedef struct fz_pwg_options_s fz_pwg_options;
-
-struct fz_pwg_options_s
-{
-	/* These are not interpreted as CStrings by the writing code, but
-	 * are rather copied directly out. */
-	char media_class[64];
-	char media_color[64];
-	char media_type[64];
-	char output_type[64];
-
-	unsigned int advance_distance;
-	int advance_media;
-	int collate;
-	int cut_media;
-	int duplex;
-	int insert_sheet;
-	int jog;
-	int leading_edge;
-	int manual_feed;
-	unsigned int media_position;
-	unsigned int media_weight;
-	int mirror_print;
-	int negative_print;
-	unsigned int num_copies;
-	int orientation;
-	int output_face_up;
-	unsigned int PageSize[2];
-	int separations;
-	int tray_switch;
-	int tumble;
-
-	int media_type_num;
-	int compression;
-	unsigned int row_count;
-	unsigned int row_feed;
-	unsigned int row_step;
-
-	/* These are not interpreted as CStrings by the writing code, but
-	 * are rather copied directly out. */
-	char rendering_intent[64];
-	char page_size_name[64];
-};
-
-/*
-	fz_save_pixmap_as_pwg: Save a pixmap as a pwg
-
-	filename: The filename to save as (including extension).
-
-	append: If non-zero, then append a new page to existing file.
-
-	pwg: NULL, or a pointer to an options structure (initialised to zero
-	before being filled in, for future expansion).
-*/
-void fz_save_pixmap_as_pwg(fz_context *ctx, fz_pixmap *pixmap, char *filename, int append, const fz_pwg_options *pwg);
-
-/*
-	fz_save_bitmap_as_pwg: Save a bitmap as a pwg
-
-	filename: The filename to save as (including extension).
-
-	append: If non-zero, then append a new page to existing file.
-
-	pwg: NULL, or a pointer to an options structure (initialised to zero
-	before being filled in, for future expansion).
-*/
-void fz_save_bitmap_as_pwg(fz_context *ctx, fz_bitmap *bitmap, char *filename, int append, const fz_pwg_options *pwg);
-
-/*
-	Output a pixmap to an output stream as a pwg raster.
-*/
-void fz_write_pixmap_as_pwg(fz_context *ctx, fz_output *out, const fz_pixmap *pixmap, const fz_pwg_options *pwg);
-
-/*
-	Output a bitmap to an output stream as a pwg raster.
-*/
-void fz_write_bitmap_as_pwg(fz_context *ctx, fz_output *out, const fz_bitmap *bitmap, const fz_pwg_options *pwg);
-
-/*
-	Output the file header to a pwg stream, ready for pages to follow it.
-*/
-void fz_write_pwg_file_header(fz_context *ctx, fz_output *out);
-
-/*
-	Output a page to a pwg stream to follow a header, or other pages.
-*/
-void fz_write_pixmap_as_pwg_page(fz_context *ctx, fz_output *out, const fz_pixmap *pixmap, const fz_pwg_options *pwg);
-
-/*
-	Output a bitmap page to a pwg stream to follow a header, or other pages.
-*/
-void fz_write_bitmap_as_pwg_page(fz_context *ctx, fz_output *out, const fz_bitmap *bitmap, const fz_pwg_options *pwg);
-
-/*
-	fz_new_mono_pwg_band_writer: Generate a new band writer for
-	PWG format images.
-*/
-fz_band_writer *fz_new_mono_pwg_band_writer(fz_context *ctx, fz_output *out, const fz_pwg_options *pwg);
-
-/*
-	fz_new_pwg_band_writer: Generate a new band writer for
-	contone PWG format images.
-*/
-fz_band_writer *fz_new_pwg_band_writer(fz_context *ctx, fz_output *out, const fz_pwg_options *pwg);
-
-#endif

+ 0 - 30
server/lib/xfdftool/include/mupdf/fitz/output-svg.h

@@ -1,30 +0,0 @@
-#ifndef MUPDF_FITZ_OUTPUT_SVG_H
-#define MUPDF_FITZ_OUTPUT_SVG_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/device.h"
-#include "mupdf/fitz/output.h"
-
-enum {
-	FZ_SVG_TEXT_AS_PATH = 0,
-	FZ_SVG_TEXT_AS_TEXT = 1,
-};
-
-/*
-	fz_new_svg_device: Create a device that outputs (single page)
-		SVG files to the given output stream.
-
-	output: The output stream to send the constructed SVG page to.
-
-	page_width, page_height: The page dimensions to use (in points).
-
-	text_format: How to emit text. One of the following values:
-		FZ_SVG_TEXT_AS_TEXT: As <text> elements with possible layout errors and mismatching fonts.
-		FZ_SVG_TEXT_AS_PATH: As <path> elements with exact visual appearance.
-
-	reuse_images: Share image resources using <symbol> definitions.
-*/
-fz_device *fz_new_svg_device(fz_context *ctx, fz_output *out, float page_width, float page_height, int text_format, int reuse_images);
-
-#endif

+ 0 - 37
server/lib/xfdftool/include/mupdf/fitz/output-tga.h

@@ -1,37 +0,0 @@
-#ifndef MUPDF_FITZ_OUTPUT_TGA_H
-#define MUPDF_FITZ_OUTPUT_TGA_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/output.h"
-#include "mupdf/fitz/band-writer.h"
-#include "mupdf/fitz/pixmap.h"
-
-/*
-	fz_save_pixmap_as_tga: Save a pixmap as a TGA image file.
-	Can accept RGB, BGR or Grayscale pixmaps, with or without
-	alpha.
-*/
-void fz_save_pixmap_as_tga(fz_context *ctx, fz_pixmap *pixmap, const char *filename);
-
-/*
-	Write a pixmap to an output stream in TGA format.
-	Can accept RGB, BGR or Grayscale pixmaps, with or without
-	alpha.
-*/
-void fz_write_pixmap_as_tga(fz_context *ctx, fz_output *out, fz_pixmap *pixmap);
-
-/*
-	fz_new_tga_band_writer: Generate a new band writer for TGA
-	format images. Note that image must be generated vertically
-	flipped for use with this writer!
-
-	Can accept RGB, BGR or Grayscale pixmaps, with or without
-	alpha.
-
-	is_bgr: True, if the image is generated in bgr format.
-*/
-fz_band_writer *fz_new_tga_band_writer(fz_context *ctx, fz_output *out, int is_bgr);
-
-
-#endif

+ 0 - 319
server/lib/xfdftool/include/mupdf/fitz/output.h

@@ -1,319 +0,0 @@
-#ifndef MUPDF_FITZ_OUTPUT_H
-#define MUPDF_FITZ_OUTPUT_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/buffer.h"
-#include "mupdf/fitz/string-util.h"
-
-/*
-	Generic output streams - generalise between outputting to a file,
-	a buffer, etc.
-*/
-typedef struct fz_output_s fz_output;
-
-/*
-	fz_output_write_fn: A function type for use when implementing
-	fz_outputs. The supplied function of this type is called
-	whenever data is written to the output.
-
-	state: The state for the output stream.
-
-	data: a pointer to a buffer of data to write.
-
-	n: The number of bytes of data to write.
-*/
-typedef void (fz_output_write_fn)(fz_context *ctx, void *state, const void *data, size_t n);
-
-/*
-	fz_output_seek_fn: A function type for use when implementing
-	fz_outputs. The supplied function of this type is called when
-	fz_seek_output is requested.
-
-	state: The output stream state to seek within.
-
-	offset, whence: as defined for fs_seek_output.
-*/
-typedef void (fz_output_seek_fn)(fz_context *ctx, void *state, fz_off_t offset, int whence);
-
-/*
-	fz_output_tell_fn: A function type for use when implementing
-	fz_outputs. The supplied function of this type is called when
-	fz_tell_output is requested.
-
-	state: The output stream state to report on.
-
-	Returns the offset within the output stream.
-*/
-typedef fz_off_t (fz_output_tell_fn)(fz_context *ctx, void *state);
-
-/*
-	fz_output_close_fn: A function type for use when implementing
-	fz_outputs. The supplied function of this type is called
-	when the output stream is closed, to release the stream specific
-	state information.
-
-	state: The output stream state to release.
-*/
-typedef void (fz_output_close_fn)(fz_context *ctx, void *state);
-
-struct fz_output_s
-{
-	void *state;
-	fz_output_write_fn *write;
-	fz_output_seek_fn *seek;
-	fz_output_tell_fn *tell;
-	fz_output_close_fn *close;
-};
-
-/*
-	fz_new_output: Create a new output object with the given
-	internal state and function pointers.
-
-	state: Internal state (opaque to everything but implementation).
-
-	write: Function to output a given buffer.
-
-	close: Cleanup function to destroy state when output closed.
-	May permissibly be null.
-*/
-fz_output *fz_new_output(fz_context *ctx, void *state, fz_output_write_fn *write, fz_output_close_fn *close);
-
-/*
-	fz_new_output_with_file: Open an output stream that writes to a
-	FILE *.
-
-	file: The file to write to.
-
-	close: non-zero if we should close the file when the fz_output
-	is closed.
-*/
-fz_output *fz_new_output_with_file_ptr(fz_context *ctx, FILE *file, int close);
-
-/*
-	fz_new_output_with_path: Open an output stream that writes to a
-	given path.
-
-	filename: The filename to write to (specified in UTF-8).
-
-	append: non-zero if we should append to the file, rather than
-	overwriting it.
-*/
-fz_output *fz_new_output_with_path(fz_context *, const char *filename, int append);
-
-/*
-	fz_new_output_with_buffer: Open an output stream that appends
-	to a buffer.
-
-	buf: The buffer to append to.
-*/
-fz_output *fz_new_output_with_buffer(fz_context *ctx, fz_buffer *buf);
-
-/*
-	fz_stdout: The standard out output stream. By default
-	this stream writes to stdout. This may be overridden
-	using fz_set_stdout.
-*/
-fz_output *fz_stdout(fz_context *ctx);
-
-/*
-	fz_stderr: The standard error output stream. By default
-	this stream writes to stderr. This may be overridden
-	using fz_set_stderr.
-*/
-fz_output *fz_stderr(fz_context *ctx);
-
-/*
-	fz_set_stdout: Replace default standard output stream
-	with a given stream.
-
-	out: The new stream to use.
-*/
-void fz_set_stdout(fz_context *ctx, fz_output *out);
-
-/*
-	fz_set_stderr: Replace default standard error stream
-	with a given stream.
-
-	err: The new stream to use.
-*/
-void fz_set_stderr(fz_context *ctx, fz_output *err);
-
-/*
-	fz_write_printf: Format and write data to an output stream.
-	See fz_vsnprintf for formatting details.
-*/
-void fz_write_printf(fz_context *ctx, fz_output *out, const char *fmt, ...);
-
-/*
-	fz_write_vprintf: va_list version of fz_write_printf.
-*/
-void fz_write_vprintf(fz_context *ctx, fz_output *out, const char *fmt, va_list ap);
-
-/*
-	fz_seek_output: Seek to the specified file position.
-	See fseek for arguments.
-
-	Throw an error on unseekable outputs.
-*/
-void fz_seek_output(fz_context *ctx, fz_output *out, fz_off_t off, int whence);
-
-/*
-	fz_tell_output: Return the current file position.
-
-	Throw an error on untellable outputs.
-*/
-fz_off_t fz_tell_output(fz_context *ctx, fz_output *out);
-
-/*
-	fz_drop_output: Close and free an output stream.
-*/
-void fz_drop_output(fz_context *, fz_output *);
-
-/*
-	fz_write_data: Write data to output.
-
-	data: Pointer to data to write.
-	size: Size of data to write in bytes.
-*/
-static inline void fz_write_data(fz_context *ctx, fz_output *out, const void *data, size_t size)
-{
-	if (out)
-		out->write(ctx, out->state, data, size);
-}
-
-/*
-	fz_write_string: Write a string. Does not write zero terminator.
-*/
-static inline void fz_write_string(fz_context *ctx, fz_output *out, const char *s)
-{
-	if (out)
-		out->write(ctx, out->state, s, strlen(s));
-}
-
-/*
-	fz_write_int32_be: Write a big-endian 32-bit binary integer.
-*/
-static inline void fz_write_int32_be(fz_context *ctx, fz_output *out, int x)
-{
-	char data[4];
-
-	data[0] = x>>24;
-	data[1] = x>>16;
-	data[2] = x>>8;
-	data[3] = x;
-
-	if (out)
-		out->write(ctx, out->state, data, 4);
-}
-
-/*
-	fz_write_int32_le: Write a little-endian 32-bit binary integer.
-*/
-static inline void fz_write_int32_le(fz_context *ctx, fz_output *out, int x)
-{
-	char data[4];
-
-	data[0] = x;
-	data[1] = x>>8;
-	data[2] = x>>16;
-	data[3] = x>>24;
-
-	if (out)
-		out->write(ctx, out->state, data, 4);
-}
-
-/*
-	fz_write_int16_be: Write a big-endian 16-bit binary integer.
-*/
-static inline void fz_write_int16_be(fz_context *ctx, fz_output *out, int x)
-{
-	char data[2];
-
-	data[0] = x>>8;
-	data[1] = x;
-
-	if (out)
-		out->write(ctx, out->state, data, 2);
-}
-
-/*
-	fz_write_int16_le: Write a little-endian 16-bit binary integer.
-*/
-static inline void fz_write_int16_le(fz_context *ctx, fz_output *out, int x)
-{
-	char data[2];
-
-	data[0] = x;
-	data[1] = x>>8;
-
-	if (out)
-		out->write(ctx, out->state, data, 2);
-}
-
-/*
-	fz_write_byte: Write a single byte.
-*/
-static inline void fz_write_byte(fz_context *ctx, fz_output *out, unsigned char x)
-{
-	if (out)
-		out->write(ctx, out->state, &x, 1);
-}
-
-/*
-	fz_write_rune: Write a UTF-8 encoded unicode character.
-*/
-static inline void fz_write_rune(fz_context *ctx, fz_output *out, int rune)
-{
-	char data[10];
-	if (out)
-		out->write(ctx, out->state, data, fz_runetochar(data, rune));
-}
-
-/*
-	fz_format_string: Our customised 'printf'-like string formatter.
-	Takes %c, %d, %o, %s, %u, %x, as usual.
-	Modifiers are not supported except for zero-padding ints (e.g. %02d, %03o, %04x, etc).
-	%g output in "as short as possible hopefully lossless non-exponent" form,
-	see fz_ftoa for specifics.
-	%f and %e output as usual.
-	%C outputs a utf8 encoded int.
-	%M outputs a fz_matrix*. %R outputs a fz_rect*. %P outputs a fz_point*.
-	%q and %( output escaped strings in C/PDF syntax.
-	%ll{d,u,x} indicates that the values are 64bit.
-	%z{d,u,x} indicates that the value is a size_t.
-	%Z{d,u,x} indicates that the value is a fz_off_t.
-
-	user: An opaque pointer that is passed to the emit function.
-	emit: A function pointer called to emit output bytes as the string is being formatted.
-*/
-void
-fz_format_string(fz_context *ctx, void *user, void (*emit)(fz_context *ctx, void *user, int c), const char *fmt, va_list args);
-
-/*
-	fz_vsnprintf: A vsnprintf work-alike, using our custom formatter.
-*/
-size_t fz_vsnprintf(char *buffer, size_t space, const char *fmt, va_list args);
-
-/*
-	fz_snprintf: The non va_list equivalent of fz_vsnprintf.
-*/
-size_t fz_snprintf(char *buffer, size_t space, const char *fmt, ...);
-
-/*
-	fz_tempfilename: Get a temporary filename based upon 'base'.
-
-	'hint' is the path of a file (normally the existing document file)
-	supplied to give the function an idea of what directory to use. This
-	may or may not be used depending on the implementation's whim.
-
-	The returned path must be freed.
-*/
-char *fz_tempfilename(fz_context *ctx, const char *base, const char *hint);
-
-/*
-	fz_save_buffer: Save contents of a buffer to file.
-*/
-void fz_save_buffer(fz_context *ctx, fz_buffer *buf, const char *filename);
-
-#endif

+ 0 - 446
server/lib/xfdftool/include/mupdf/fitz/path.h

@@ -1,446 +0,0 @@
-#ifndef MUPDF_FITZ_PATH_H
-#define MUPDF_FITZ_PATH_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/geometry.h"
-
-/*
- * Vector path buffer.
- * It can be stroked and dashed, or be filled.
- * It has a fill rule (nonzero or even_odd).
- *
- * When rendering, they are flattened, stroked and dashed straight
- * into the Global Edge List.
- */
-
-typedef struct fz_path_s fz_path;
-typedef struct fz_stroke_state_s fz_stroke_state;
-
-typedef enum fz_linecap_e
-{
-	FZ_LINECAP_BUTT = 0,
-	FZ_LINECAP_ROUND = 1,
-	FZ_LINECAP_SQUARE = 2,
-	FZ_LINECAP_TRIANGLE = 3
-} fz_linecap;
-
-typedef enum fz_linejoin_e
-{
-	FZ_LINEJOIN_MITER = 0,
-	FZ_LINEJOIN_ROUND = 1,
-	FZ_LINEJOIN_BEVEL = 2,
-	FZ_LINEJOIN_MITER_XPS = 3
-} fz_linejoin;
-
-struct fz_stroke_state_s
-{
-	int refs;
-	fz_linecap start_cap, dash_cap, end_cap;
-	fz_linejoin linejoin;
-	float linewidth;
-	float miterlimit;
-	float dash_phase;
-	int dash_len;
-	float dash_list[32];
-};
-
-typedef struct
-{
-	/* Compulsory ones */
-	void (*moveto)(fz_context *ctx, void *arg, float x, float y);
-	void (*lineto)(fz_context *ctx, void *arg, float x, float y);
-	void (*curveto)(fz_context *ctx, void *arg, float x1, float y1, float x2, float y2, float x3, float y3);
-	void (*closepath)(fz_context *ctx, void *arg);
-	/* Optional ones */
-	void (*quadto)(fz_context *ctx, void *arg, float x1, float y1, float x2, float y2);
-	void (*curvetov)(fz_context *ctx, void *arg, float x2, float y2, float x3, float y3);
-	void (*curvetoy)(fz_context *ctx, void *arg, float x1, float y1, float x3, float y3);
-	void (*rectto)(fz_context *ctx, void *arg, float x1, float y1, float x2, float y2);
-} fz_path_walker;
-
-/*
-	fz_walk_path: Walk the segments of a path, calling the
-	appropriate callback function from a given set for each
-	segment of the path.
-
-	path: The path to walk.
-
-	walker: The set of callback functions to use. The first
-	4 callback pointers in the set must be non-NULL. The
-	subsequent ones can either be supplied, or can be left
-	as NULL, in which case the top 4 functions will be
-	called as appropriate to simulate them.
-
-	arg: An opaque argument passed in to each callback.
-
-	Exceptions will only be thrown if the underlying callback
-	functions throw them.
-*/
-void fz_walk_path(fz_context *ctx, const fz_path *path, const fz_path_walker *walker, void *arg);
-
-/*
-	fz_new_path: Create an empty path, and return
-	a reference to it.
-
-	Throws exception on failure to allocate.
-*/
-fz_path *fz_new_path(fz_context *ctx);
-
-/*
-	fz_keep_path: Take an additional reference to
-	a path.
-
-	No modifications should be carried out on a path
-	to which more than one reference is held, as
-	this can cause race conditions.
-
-	Never throws exceptions.
-*/
-fz_path *fz_keep_path(fz_context *ctx, const fz_path *path);
-
-/*
-	fz_drop_path: Drop a reference to a path,
-	destroying the path if it is the last
-	reference.
-
-	Never throws exceptions.
-*/
-void fz_drop_path(fz_context *ctx, const fz_path *path);
-
-/*
-	fz_trim_path: Minimise the internal storage
-	used by a path.
-
-	As paths are constructed, the internal buffers
-	grow. To avoid repeated reallocations they
-	grow with some spare space. Once a path has
-	been fully constructed, this call allows the
-	excess space to be trimmed.
-
-	Never throws exceptions.
-*/
-void fz_trim_path(fz_context *ctx, fz_path *path);
-
-/*
-	fz_packed_path_size: Return the number of
-	bytes required to pack a path.
-
-	Never throws exceptions.
-*/
-int fz_packed_path_size(const fz_path *path);
-
-/*
-	fz_pack_path: Pack a path into the given block.
-	To minimise the size of paths, this function allows them to be
-	packed into a buffer with other information. Paths can be used
-	interchangeably regardless of how they are packed.
-
-	pack: Pointer to a block of data to pack the path into. Should
-	be aligned by the caller to the same alignment as required for
-	a fz_path pointer.
-
-	max: The number of bytes available in the block.
-	If max < sizeof(fz_path) then an exception will
-	be thrown. If max >= the value returned by
-	fz_packed_path_size, then this call will never
-	fail, except in low memory situations with large
-	paths.
-
-	path: The path to pack.
-
-	Returns the number of bytes within the block used. Callers can
-	access the packed path data by casting the value of pack on
-	entry to be a fz_path *.
-
-	Throws exceptions on failure to allocate, or if
-	max < sizeof(fz_path).
-
-	Implementation details: Paths can be 'unpacked', 'flat', or
-	'open'. Standard paths, as created are 'unpacked'. Paths that
-	will pack into less than max bytes will be packed as 'flat',
-	unless they are too large (where large indicates that they
-	exceed some private implementation defined limits, currently
-	including having more than 256 coordinates or commands).
-
-	Large paths are 'open' packed as a header into the given block,
-	plus pointers to other data blocks.
-
-	Users should not have to care about whether paths are 'open'
-	or 'flat' packed. Simply pack a path (if required), and then
-	forget about the details.
-*/
-int fz_pack_path(fz_context *ctx, uint8_t *pack, int max, const fz_path *path);
-
-/*
-	fz_clone_path: Clone the data for a path.
-
-	This is used in preference to fz_keep_path when a whole
-	new copy of a path is required, rather than just a shared
-	pointer. This probably indicates that the path is about to
-	be modified.
-
-	path: path to clone.
-
-	Throws exceptions on failure to allocate.
-*/
-fz_path *fz_clone_path(fz_context *ctx, fz_path *path);
-
-/*
-	fz_currentpoint: Return the current point that a path has
-	reached or (0,0) if empty.
-
-	path: path to return the current point of.
-*/
-fz_point fz_currentpoint(fz_context *ctx, fz_path *path);
-
-/*
-	fz_moveto: Append a 'moveto' command to a path.
-	This 'opens' a path.
-
-	path: The path to modify.
-
-	x, y: The coordinate to move to.
-
-	Throws exceptions on failure to allocate.
-*/
-void fz_moveto(fz_context *ctx, fz_path *path, float x, float y);
-
-/*
-	fz_lineto: Append a 'lineto' command to an open path.
-
-	path: The path to modify.
-
-	x, y: The coordinate to line to.
-
-	Throws exceptions on failure to allocate.
-*/
-void fz_lineto(fz_context *ctx, fz_path *path, float x, float y);
-
-/*
-	fz_rectto: Append a 'rectto' command to an open path.
-
-	The rectangle is equivalent to:
-		moveto x0 y0
-		lineto x1 y0
-		lineto x1 y1
-		lineto x0 y1
-		closepath
-
-	path: The path to modify.
-
-	x0, y0: First corner of the rectangle.
-
-	x1, y1: Second corner of the rectangle.
-
-	Throws exceptions on failure to allocate.
-*/
-void fz_rectto(fz_context *ctx, fz_path *path, float x0, float y0, float x1, float y1);
-
-/*
-	fz_quadto: Append a 'quadto' command to an open path. (For a
-	quadratic bezier).
-
-	path: The path to modify.
-
-	x0, y0: The control coordinates for the quadratic curve.
-
-	x1, y1: The end coordinates for the quadratic curve.
-
-	Throws exceptions on failure to allocate.
-*/
-void fz_quadto(fz_context *ctx, fz_path *path, float x0, float y0, float x1, float y1);
-
-/*
-	fz_curveto: Append a 'curveto' command to an open path. (For a
-	cubic bezier).
-
-	path: The path to modify.
-
-	x0, y0: The coordinates of the first control point for the
-	curve.
-
-	x1, y1: The coordinates of the second control point for the
-	curve.
-
-	x2, y2: The end coordinates for the curve.
-
-	Throws exceptions on failure to allocate.
-*/
-void fz_curveto(fz_context *ctx, fz_path *path, float x0, float y0, float x1, float y1, float x2, float y2);
-
-/*
-	fz_curvetov: Append a 'curvetov' command to an open path. (For a
-	cubic bezier with the first control coordinate equal to
-	the start point).
-
-	path: The path to modify.
-
-	x1, y1: The coordinates of the second control point for the
-	curve.
-
-	x2, y2: The end coordinates for the curve.
-
-	Throws exceptions on failure to allocate.
-*/
-void fz_curvetov(fz_context *ctx, fz_path *path, float x1, float y1, float x2, float y2);
-
-/*
-	fz_curvetoy: Append a 'curvetoy' command to an open path. (For a
-	cubic bezier with the second control coordinate equal to
-	the end point).
-
-	path: The path to modify.
-
-	x0, y0: The coordinates of the first control point for the
-	curve.
-
-	x2, y2: The end coordinates for the curve (and the second
-	control coordinate).
-
-	Throws exceptions on failure to allocate.
-*/
-void fz_curvetoy(fz_context *ctx, fz_path *path, float x0, float y0, float x2, float y2);
-
-/*
-	fz_closepath: Close the current subpath.
-
-	path: The path to modify.
-
-	Throws exceptions on failure to allocate, and illegal
-	path closes (i.e. closing a non open path).
-*/
-void fz_closepath(fz_context *ctx, fz_path *path);
-
-/*
-	fz_transform_path: Transform a path by a given
-	matrix.
-
-	path: The path to modify (must not be a packed path).
-
-	transform: The transform to apply.
-
-	Throws exceptions if the path is packed, or on failure
-	to allocate.
-*/
-void fz_transform_path(fz_context *ctx, fz_path *path, const fz_matrix *transform);
-
-/*
-	fz_bound_path: Return a bounding rectangle for a path.
-
-	path: The path to bound.
-
-	stroke: If NULL, the bounding rectangle given is for
-	the filled path. If non-NULL the bounding rectangle
-	given is for the path stroked with the given attributes.
-
-	ctm: The matrix to apply to the path during stroking.
-
-	r: Pointer to a fz_rect which will be used to hold
-	the result.
-
-	Returns r, updated to contain the bounding rectangle.
-*/
-fz_rect *fz_bound_path(fz_context *ctx, const fz_path *path, const fz_stroke_state *stroke, const fz_matrix *ctm, fz_rect *r);
-fz_rect *fz_adjust_rect_for_stroke(fz_context *ctx, fz_rect *r, const fz_stroke_state *stroke, const fz_matrix *ctm);
-
-extern const fz_stroke_state fz_default_stroke_state;
-
-/*
-	fz_new_stroke_state: Create a new (empty) stroke state
-	structure (with no dash data) and return a reference to it.
-
-	Throws exception on failure to allocate.
-*/
-fz_stroke_state *fz_new_stroke_state(fz_context *ctx);
-
-/*
-	fz_new_stroke_state_with_dash_len: Create a new (empty)
-	stroke state structure, with room for dash data of the
-	given length, and return a reference to it.
-
-	len: The number of dash elements to allow room for.
-
-	Throws exception on failure to allocate.
-*/
-fz_stroke_state *fz_new_stroke_state_with_dash_len(fz_context *ctx, int len);
-
-/*
-	fz_keep_stroke_state: Take an additional reference to
-	a stroke state structure.
-
-	No modifications should be carried out on a stroke
-	state to which more than one reference is held, as
-	this can cause race conditions.
-
-	Never throws exceptions.
-*/
-fz_stroke_state *fz_keep_stroke_state(fz_context *ctx, const fz_stroke_state *stroke);
-
-/*
-	fz_drop_stroke_state: Drop a reference to a stroke
-	state structure, destroying the structure if it is
-	the last reference.
-
-	Never throws exceptions.
-*/
-void fz_drop_stroke_state(fz_context *ctx, const fz_stroke_state *stroke);
-
-/*
-	fz_unshare_stroke_state: Given a reference to a
-	(possibly) shared stroke_state structure, return
-	a reference to an equivalent stroke_state structure
-	that is guaranteed to be unshared (i.e. one that can
-	safely be modified).
-
-	shared: The reference to a (possibly) shared structure
-	to unshare. Ownership of this reference is passed in
-	to this function, even in the case of exceptions being
-	thrown.
-
-	Exceptions may be thrown in the event of failure to
-	allocate if required.
-*/
-fz_stroke_state *fz_unshare_stroke_state(fz_context *ctx, fz_stroke_state *shared);
-
-/*
-	fz_unshare_stroke_state_with_dash_len: Given a reference to a
-	(possibly) shared stroke_state structure, return a reference
-	to a stroke_state structure (with room for a given amount of
-	dash data) that is guaranteed to be unshared (i.e. one that
-	can safely be modified).
-
-	shared: The reference to a (possibly) shared structure
-	to unshare. Ownership of this reference is passed in
-	to this function, even in the case of exceptions being
-	thrown.
-
-	Exceptions may be thrown in the event of failure to
-	allocate if required.
-*/
-fz_stroke_state *fz_unshare_stroke_state_with_dash_len(fz_context *ctx, fz_stroke_state *shared, int len);
-
-/*
-	fz_clone_stroke_state: Create an identical stroke_state
-	structure and return a reference to it.
-
-	stroke: The stroke state reference to clone.
-
-	Exceptions may be thrown in the event of a failure to
-	allocate.
-*/
-fz_stroke_state *fz_clone_stroke_state(fz_context *ctx, fz_stroke_state *stroke);
-
-/*
-	fz_print_path: Print a debug representation of a path to
-	a given output stream. Not for use in production builds.
-
-	out: The output stream to print to.
-
-	path: The path to output.
-
-	indent: The amount to indent the output by.
-*/
-void fz_print_path(fz_context *ctx, fz_output *out, fz_path *, int indent);
-
-#endif

+ 0 - 379
server/lib/xfdftool/include/mupdf/fitz/pixmap.h

@@ -1,379 +0,0 @@
-#ifndef MUPDF_FITZ_PIXMAP_H
-#define MUPDF_FITZ_PIXMAP_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/geometry.h"
-#include "mupdf/fitz/store.h"
-#include "mupdf/fitz/colorspace.h"
-
-/*
-	Pixmaps represent a set of pixels for a 2 dimensional region of a
-	plane. Each pixel has n components per pixel, the last of which is
-	always alpha. The data is in premultiplied alpha when rendering, but
-	non-premultiplied for colorspace conversions and rescaling.
-*/
-typedef struct fz_pixmap_s fz_pixmap;
-
-/*
-	fz_pixmap_bbox: Return the bounding box for a pixmap.
-*/
-fz_irect *fz_pixmap_bbox(fz_context *ctx, const fz_pixmap *pix, fz_irect *bbox);
-
-/*
-	fz_pixmap_width: Return the width of the pixmap in pixels.
-*/
-int fz_pixmap_width(fz_context *ctx, fz_pixmap *pix);
-
-/*
-	fz_pixmap_height: Return the height of the pixmap in pixels.
-*/
-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);
-
-/*
-	fz_new_pixmap: Create a new pixmap, with its origin at (0,0)
-
-	cs: The colorspace to use for the pixmap, or NULL for an alpha
-	plane/mask.
-
-	w: The width of the pixmap (in pixels)
-
-	h: The height of the pixmap (in pixels)
-
-	alpha: 0 for no alpha, 1 for alpha.
-
-	Returns a pointer to the new pixmap. Throws exception on failure to
-	allocate.
-*/
-fz_pixmap *fz_new_pixmap(fz_context *ctx, fz_colorspace *cs, int w, int h, int alpha);
-
-/*
-	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
-	where it will be located. The colorspace determines the number
-	of components per pixel. Alpha is always present. Pixmaps are
-	reference counted, so drop references using fz_drop_pixmap.
-
-	colorspace: Colorspace format used for the created pixmap. The
-	pixmap will keep a reference to the colorspace.
-
-	bbox: Bounding box specifying location/size of created pixmap.
-
-	alpha: 0 for no alpha, 1 for alpha.
-
-	Returns a pointer to the new pixmap. Throws exception on failure to
-	allocate.
-*/
-fz_pixmap *fz_new_pixmap_with_bbox(fz_context *ctx, fz_colorspace *colorspace, const fz_irect *bbox, int alpha);
-
-/*
-	fz_new_pixmap_with_data: Create a new pixmap, with its origin at
-	(0,0) using the supplied data block.
-
-	cs: The colorspace to use for the pixmap, or NULL for an alpha
-	plane/mask.
-
-	w: The width of the pixmap (in pixels)
-
-	h: The height of the pixmap (in pixels)
-
-	alpha: 0 for no alpha, 1 for alpha.
-
-	stride: The byte offset from the pixel data in a row to the pixel
-	data in the next row.
-
-	samples: The data block to keep the samples in.
-
-	Returns a pointer to the new pixmap. Throws exception on failure to
-	allocate.
-*/
-fz_pixmap *fz_new_pixmap_with_data(fz_context *ctx, fz_colorspace *colorspace, int w, int h, int alpha, int stride, unsigned char *samples);
-
-/*
-	fz_new_pixmap_with_bbox_and_data: Create a pixmap of a given size,
-	location and pixel format, using the supplied data block.
-
-	The bounding box specifies the size of the created pixmap and
-	where it will be located. The colorspace determines the number
-	of components per pixel. Alpha is always present. Pixmaps are
-	reference counted, so drop references using fz_drop_pixmap.
-
-	colorspace: Colorspace format used for the created pixmap. The
-	pixmap will keep a reference to the colorspace.
-
-	bbox: Bounding box specifying location/size of created pixmap.
-
-	samples: The data block to keep the samples in.
-
-	Returns a pointer to the new pixmap. Throws exception on failure to
-	allocate.
-*/
-fz_pixmap *fz_new_pixmap_with_bbox_and_data(fz_context *ctx, fz_colorspace *colorspace, const fz_irect *rect, int alpha, unsigned char *samples);
-
-/*
-	fz_keep_pixmap: Take a reference to a pixmap.
-
-	pix: The pixmap to increment the reference for.
-
-	Returns pix. Does not throw exceptions.
-*/
-fz_pixmap *fz_keep_pixmap(fz_context *ctx, fz_pixmap *pix);
-
-/*
-	fz_drop_pixmap: Drop a reference and free a pixmap.
-
-	Decrement the reference count for the pixmap. When no
-	references remain the pixmap will be freed.
-
-	Does not throw exceptions.
-*/
-void fz_drop_pixmap(fz_context *ctx, fz_pixmap *pix);
-
-/*
-	fz_pixmap_colorspace: Return the colorspace of a pixmap
-
-	Returns colorspace. Does not throw exceptions.
-*/
-fz_colorspace *fz_pixmap_colorspace(fz_context *ctx, fz_pixmap *pix);
-
-/*
-	fz_pixmap_components: Return the number of components in a pixmap.
-
-	Returns the number of components (including alpha). Does not throw exceptions.
-*/
-int fz_pixmap_components(fz_context *ctx, fz_pixmap *pix);
-
-/*
-	fz_pixmap_components: Return the number of components in a pixmap.
-
-	Returns the number of colorants (components, less any alpha). Does not throw exceptions.
-*/
-int fz_pixmap_colorants(fz_context *ctx, fz_pixmap *pix);
-
-/*
-	fz_pixmap_samples: Returns a pointer to the pixel data of a pixmap.
-
-	Returns the pointer. Does not throw exceptions.
-*/
-unsigned char *fz_pixmap_samples(fz_context *ctx, fz_pixmap *pix);
-
-/*
-	fz_pixmap_stride: Return the number of bytes in a row in the pixmap.
-*/
-int fz_pixmap_stride(fz_context *ctx, fz_pixmap *pix);
-
-/*
-	fz_pixmap_set_resolution: Set the pixels per inch resolution of the pixmap.
-*/
-void fz_set_pixmap_resolution(fz_context *ctx, fz_pixmap *pix, int xres, int yres);
-
-/*
-	fz_clear_pixmap_with_value: Clears a pixmap with the given value.
-
-	pix: The pixmap to clear.
-
-	value: Values in the range 0 to 255 are valid. Each component
-	sample for each pixel in the pixmap will be set to this value,
-	while alpha will always be set to 255 (non-transparent).
-
-	Does not throw exceptions.
-*/
-void fz_clear_pixmap_with_value(fz_context *ctx, fz_pixmap *pix, int value);
-
-/*
-	fz_clear_pixmap_with_value: Clears a subrect of a pixmap with the given value.
-
-	pix: The pixmap to clear.
-
-	value: Values in the range 0 to 255 are valid. Each component
-	sample for each pixel in the pixmap will be set to this value,
-	while alpha will always be set to 255 (non-transparent).
-
-	r: the rectangle.
-
-	Does not throw exceptions.
-*/
-void fz_clear_pixmap_rect_with_value(fz_context *ctx, fz_pixmap *pix, int value, const fz_irect *r);
-
-/*
-	fz_clear_pixmap_with_value: Sets all components (including alpha) of
-	all pixels in a pixmap to 0.
-
-	pix: The pixmap to clear.
-
-	Does not throw exceptions.
-*/
-void fz_clear_pixmap(fz_context *ctx, fz_pixmap *pix);
-
-/*
-	fz_invert_pixmap: Invert all the pixels in a pixmap. All components
-	of all pixels are inverted (except alpha, which is unchanged).
-
-	Does not throw exceptions.
-*/
-void fz_invert_pixmap(fz_context *ctx, fz_pixmap *pix);
-
-/*
-	fz_tint_pixmap: Tint all the pixels in an RGB or Gray pixmap.
-
-	Multiplies all the samples with the input color argument.
-
-	r,g,b: The color to tint with, in 0 to 255 range.
-*/
-void fz_tint_pixmap(fz_context *ctx, fz_pixmap *pix, int r, int g, int b);
-
-/*
-	fz_invert_pixmap: Invert all the pixels in a given rectangle of a
-	pixmap. All components of all pixels in the rectangle are inverted
-	(except alpha, which is unchanged).
-
-	Does not throw exceptions.
-*/
-void fz_invert_pixmap_rect(fz_context *ctx, fz_pixmap *image, const fz_irect *rect);
-
-/*
-	fz_gamma_pixmap: Apply gamma correction to a pixmap. All components
-	of all pixels are modified (except alpha, which is unchanged).
-
-	gamma: The gamma value to apply; 1.0 for no change.
-
-	Does not throw exceptions.
-*/
-void fz_gamma_pixmap(fz_context *ctx, fz_pixmap *pix, float gamma);
-
-/*
-	fz_unmultiply_pixmap: Convert a pixmap from premultiplied to
-	non-premultiplied format.
-
-	Does not throw exceptions.
-*/
-void fz_unmultiply_pixmap(fz_context *ctx, fz_pixmap *pix);
-
-/*
-	fz_ensure_pixmap_is_additive: Convert a pixmap in a subtractive colorspace to an additive colorspace.
-
-	Pixmaps with premultiplied alpha must be in an additive colorspace.
-*/
-fz_pixmap *fz_ensure_pixmap_is_additive(fz_context *ctx, fz_pixmap *pix);
-
-/*
-	fz_convert_pixmap: Convert an existing pixmap to a desired
-	colorspace. Other properties of the pixmap, such as resolution
-	and position are copied to the converted pixmap.
-
-	pix: The pixmap to convert.
-
-	cs: Desired colorspace, may be NULL to denote alpha-only.
-
-	keep_alpha: If 0 any alpha component is removed, otherwise
-	alpha is kept if present in the pixmap.
-*/
-fz_pixmap *fz_convert_pixmap(fz_context *ctx, fz_pixmap *pix, fz_colorspace *src, int keep_alpha);
-
-/*
-	Pixmaps represent a set of pixels for a 2 dimensional region of a
-	plane. Each pixel has n components per pixel, the last of which is
-	always alpha. The data is in premultiplied alpha when rendering, but
-	non-premultiplied for colorspace conversions and rescaling.
-
-	x, y: The minimum x and y coord of the region in pixels.
-
-	w, h: The width and height of the region in pixels.
-
-	n: The number of color components in the image. Includes
-	a separate alpha channel if alpha is set. For mask images
-	n=1, for greyscale (plus alpha) images n=2, for rgb (plus
-	alpha) images n=4.
-
-	stride: The byte offset from the data for any given pixel
-	to the data for the same pixel on the row below.
-
-	alpha: 0 for no alpha, 1 for alpha present.
-
-	interpolate: A boolean flag set to non-zero if the image
-	will be drawn using linear interpolation, or set to zero if
-	image will be using nearest neighbour sampling.
-
-	xres, yres: Image resolution in dpi. Default is 96 dpi.
-
-	colorspace: Pointer to a colorspace object describing the colorspace
-	the pixmap is in. If NULL, the image is a mask.
-
-	samples: A simple block of memory w * h * n bytes of memory in which
-	the components are stored. The first n bytes are components 0 to n-1
-	for the pixel at (x,y). Each successive n bytes gives another pixel
-	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_bbox_and_data.
-	If non-zero the buffer will be freed along with the pixmap.
-*/
-struct fz_pixmap_s
-{
-	fz_storable storable;
-	int x, y, w, h, n;
-	ptrdiff_t stride;
-	int alpha;
-	int interpolate;
-	int xres, yres;
-	fz_colorspace *colorspace;
-	unsigned char *samples;
-	int free_samples;
-};
-
-void fz_drop_pixmap_imp(fz_context *ctx, fz_storable *pix);
-
-void fz_copy_pixmap_rect(fz_context *ctx, fz_pixmap *dest, fz_pixmap *src, const fz_irect *r);
-void fz_premultiply_pixmap(fz_context *ctx, fz_pixmap *pix);
-fz_pixmap *fz_alpha_from_gray(fz_context *ctx, fz_pixmap *gray);
-size_t fz_pixmap_size(fz_context *ctx, fz_pixmap *pix);
-
-fz_pixmap *fz_scale_pixmap(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_irect *clip);
-
-typedef struct fz_scale_cache_s fz_scale_cache;
-
-fz_scale_cache *fz_new_scale_cache(fz_context *ctx);
-void fz_drop_scale_cache(fz_context *ctx, fz_scale_cache *cache);
-fz_pixmap *fz_scale_pixmap_cached(fz_context *ctx, const fz_pixmap *src, float x, float y, float w, float h, const fz_irect *clip, fz_scale_cache *cache_x, fz_scale_cache *cache_y);
-
-void fz_subsample_pixmap(fz_context *ctx, fz_pixmap *tile, int factor);
-
-fz_irect *fz_pixmap_bbox_no_ctx(const fz_pixmap *src, fz_irect *bbox);
-
-void fz_decode_tile(fz_context *ctx, fz_pixmap *pix, const float *decode);
-void fz_decode_indexed_tile(fz_context *ctx, fz_pixmap *pix, const float *decode, int maxval);
-void fz_unpack_tile(fz_context *ctx, fz_pixmap *dst, unsigned char * restrict src, int n, int depth, size_t stride, int scale);
-
-/*
-	fz_lookup_pixmap_converter: Color convert a pixmap.
-*/
-typedef void (fz_pixmap_converter)(fz_context *ctx, fz_pixmap *dp, fz_pixmap *sp);
-fz_pixmap_converter *fz_lookup_pixmap_converter(fz_context *ctx, fz_colorspace *ds, fz_colorspace *ss);
-
-/*
-	fz_md5_pixmap: Return the md5 digest for a pixmap
-*/
-void fz_md5_pixmap(fz_context *ctx, fz_pixmap *pixmap, unsigned char digest[16]);
-
-fz_pixmap *fz_new_pixmap_from_8bpp_data(fz_context *ctx, int x, int y, int w, int h, unsigned char *sp, int span);
-fz_pixmap *fz_new_pixmap_from_1bpp_data(fz_context *ctx, int x, int y, int w, int h, unsigned char *sp, int span);
-
-#ifdef HAVE_VALGRIND
-int fz_valgrind_pixmap(const fz_pixmap *pix);
-#else
-#define fz_valgrind_pixmap(pix) do {} while (0)
-#endif
-
-#endif

+ 0 - 14
server/lib/xfdftool/include/mupdf/fitz/pool.h

@@ -1,14 +0,0 @@
-#ifndef MUPDF_FITZ_POOL_H
-#define MUPDF_FITZ_POOL_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-
-typedef struct fz_pool_s fz_pool;
-
-fz_pool *fz_new_pool(fz_context *ctx);
-void *fz_pool_alloc(fz_context *ctx, fz_pool *pool, size_t size);
-char *fz_pool_strdup(fz_context *ctx, fz_pool *pool, const char *s);
-void fz_drop_pool(fz_context *ctx, fz_pool *pool);
-
-#endif

+ 0 - 49
server/lib/xfdftool/include/mupdf/fitz/separation.h

@@ -1,49 +0,0 @@
-#ifndef MUPDF_FITZ_SEPARATION_H
-#define MUPDF_FITZ_SEPARATION_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-
-/*
-	A fz_separation structure holds details of a set of separations
-	(such as might be used on within a page of the document).
-
-	The app might control the separations by enabling/disabling them,
-	and subsequent renders would take this into account.
-*/
-
-enum
-{
-	FZ_MAX_SEPARATIONS = 64
-};
-
-typedef struct fz_separations_s fz_separations;
-
-/* Create a new separations structure (initially empty) */
-fz_separations *fz_new_separations(fz_context *ctx);
-
-/* Add a reference */
-fz_separations *fz_keep_separations(fz_context *ctx, fz_separations *sep);
-
-/* Drop a reference */
-void fz_drop_separations(fz_context *ctx, fz_separations *sep);
-
-/* Add a separation (RGBA and CYMK equivalents, null terminated name) */
-void fz_add_separation(fz_context *ctx, fz_separations *sep, uint32_t rgba, uint32_t cmyk, char *name);
-
-/* Enable or disable a given separation */
-void fz_control_separation(fz_context *ctx, fz_separations *sep, int separation, int disable);
-
-/* Test for a separation being enabled or disabled */
-int fz_separation_disabled(fz_context *ctx, fz_separations *sep, int separation);
-
-/* Quick test for all separations enabled (the common case) */
-int fz_separations_all_enabled(fz_context *ctx, fz_separations *sep);
-
-/* Read separation details */
-const char *fz_get_separation(fz_context *ctx, fz_separations *sep, int separation, uint32_t *rgb, uint32_t *cmyk);
-
-/* Count the number of separations */
-int fz_count_separations(fz_context *ctx, fz_separations *sep);
-
-#endif

+ 0 - 198
server/lib/xfdftool/include/mupdf/fitz/shade.h

@@ -1,198 +0,0 @@
-#ifndef MUPDF_FITZ_SHADE_H
-#define MUPDF_FITZ_SHADE_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/geometry.h"
-#include "mupdf/fitz/store.h"
-#include "mupdf/fitz/colorspace.h"
-#include "mupdf/fitz/pixmap.h"
-#include "mupdf/fitz/compressed-buffer.h"
-
-/*
- * The shading code uses gouraud shaded triangle meshes.
- */
-
-enum
-{
-	FZ_FUNCTION_BASED = 1,
-	FZ_LINEAR = 2,
-	FZ_RADIAL = 3,
-	FZ_MESH_TYPE4 = 4,
-	FZ_MESH_TYPE5 = 5,
-	FZ_MESH_TYPE6 = 6,
-	FZ_MESH_TYPE7 = 7
-};
-
-/*
-	Structure is public to allow derived classes. Do not
-	access the members directly.
-*/
-typedef struct fz_shade_s
-{
-	fz_storable storable;
-
-	fz_rect bbox;		/* can be fz_infinite_rect */
-	fz_colorspace *colorspace;
-
-	fz_matrix matrix;	/* matrix from pattern dict */
-	int use_background;	/* background color for fills but not 'sh' */
-	float background[FZ_MAX_COLORS];
-
-	int use_function;
-	float function[256][FZ_MAX_COLORS + 1];
-
-	int type; /* function, linear, radial, mesh */
-	union
-	{
-		struct
-		{
-			int extend[2];
-			float coords[2][3]; /* (x,y,r) twice */
-		} l_or_r;
-		struct
-		{
-			int vprow;
-			int bpflag;
-			int bpcoord;
-			int bpcomp;
-			float x0, x1;
-			float y0, y1;
-			float c0[FZ_MAX_COLORS];
-			float c1[FZ_MAX_COLORS];
-		} m;
-		struct
-		{
-			fz_matrix matrix;
-			int xdivs;
-			int ydivs;
-			float domain[2][2];
-			float *fn_vals;
-		} f;
-	} u;
-
-	fz_compressed_buffer *buffer;
-} fz_shade;
-
-/*
-	fz_keep_shade: Add a reference to a fz_shade.
-
-	shade: The reference to keep.
-
-	Returns shade.
-*/
-fz_shade *fz_keep_shade(fz_context *ctx, fz_shade *shade);
-
-/*
-	fz_drop_shade: Drop a reference to a fz_shade.
-
-	shade: The reference to drop. If this is the last
-	reference, shade will be destroyed.
-*/
-void fz_drop_shade(fz_context *ctx, fz_shade *shade);
-
-/*
-	fz_drop_shade_imp: Internal function to destroy a
-	shade. Only exposed for use with the fz_store.
-
-	shade: The reference to destroy.
-*/
-void fz_drop_shade_imp(fz_context *ctx, fz_storable *shade);
-
-/*
-	fz_bound_shade: Bound a given shading.
-
-	shade: The shade to bound.
-
-	ctm: The transform to apply to the shade before bounding.
-
-	r: Pointer to storage to put the bounds in.
-
-	Returns r, updated to contain the bounds for the shading.
-*/
-fz_rect *fz_bound_shade(fz_context *ctx, fz_shade *shade, const fz_matrix *ctm, fz_rect *r);
-
-/*
-	fz_paint_shade: Render a shade to a given pixmap.
-
-	shade: The shade to paint.
-
-	ctm: The transform to apply.
-
-	dest: The pixmap to render into.
-
-	bbox: Pointer to a bounding box to limit the rendering
-	of the shade.
-*/
-void fz_paint_shade(fz_context *ctx, fz_shade *shade, const fz_matrix *ctm, fz_pixmap *dest, const fz_irect *bbox);
-
-/*
- *	Handy routine for processing mesh based shades
- */
-typedef struct fz_vertex_s fz_vertex;
-
-struct fz_vertex_s
-{
-	fz_point p;
-	float c[FZ_MAX_COLORS];
-};
-
-/*
-	fz_shade_prepare_fn: Callback function type for use with
-	fz_process_shade.
-
-	arg: Opaque pointer from fz_process_shade caller.
-
-	v: Pointer to a fz_vertex structure to populate.
-
-	c: Pointer to an array of floats used to populate v.
-*/
-typedef void (fz_shade_prepare_fn)(fz_context *ctx, void *arg, fz_vertex *v, const float *c);
-
-/*
-	fz_shade_process_fn: Callback function type for use with
-	fz_process_shade.
-
-	arg: Opaque pointer from fz_process_shade caller.
-
-	av, bv, cv: Pointers to a fz_vertex structure describing
-	the corner locations and colors of a triangle to be
-	filled.
-*/
-typedef void (fz_shade_process_fn)(fz_context *ctx, void *arg, fz_vertex *av, fz_vertex *bv, fz_vertex *cv);
-
-/*
-	fz_process_shade: Process a shade, using supplied callback
-	functions. This decomposes the shading to a mesh (even ones
-	that are not natively meshes, such as linear or radial
-	shadings), and processes triangles from those meshes.
-
-	shade: The shade to process.
-
-	ctm: The transform to use
-
-	prepare: Callback function to 'prepare' each vertex.
-	This function is passed an array of floats, and populates
-	a fz_vertex structure.
-
-	process: This function is passed 3 pointers to vertex
-	structures, and actually performs the processing (typically
-	filling the area between the vertexes).
-
-	process_arg: An opaque argument passed through from caller
-	to callback functions.
-*/
-void fz_process_shade(fz_context *ctx, fz_shade *shade, const fz_matrix *ctm,
-			fz_shade_prepare_fn *prepare, fz_shade_process_fn *process, void *process_arg);
-
-/*
-	fz_print_shade: Output a textual representation of
-	a shading.
-
-	out: The stream to output to.
-
-	shade: The shade to dump information about.
-*/
-void fz_print_shade(fz_context *ctx, fz_output *out, fz_shade *shade);
-
-#endif

+ 0 - 287
server/lib/xfdftool/include/mupdf/fitz/store.h

@@ -1,287 +0,0 @@
-#ifndef MUPDF_FITZ_STORE_H
-#define MUPDF_FITZ_STORE_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/output.h"
-
-/*
-	Resource store
-
-	MuPDF stores decoded "objects" into a store for potential reuse.
-	If the size of the store gets too big, objects stored within it can
-	be evicted and freed to recover space. When MuPDF comes to decode
-	such an object, it will check to see if a version of this object is
-	already in the store - if it is, it will simply reuse it. If not, it
-	will decode it and place it into the store.
-
-	All objects that can be placed into the store are derived from the
-	fz_storable type (i.e. this should be the first component of the
-	objects structure). This allows for consistent (thread safe)
-	reference counting, and includes a function that will be called to
-	free the object as soon as the reference count reaches zero.
-
-	Most objects offer fz_keep_XXXX/fz_drop_XXXX functions derived
-	from fz_keep_storable/fz_drop_storable. Creation of such objects
-	includes a call to FZ_INIT_STORABLE to set up the fz_storable header.
- */
-
-typedef struct fz_storable_s fz_storable;
-typedef struct fz_key_storable_s fz_key_storable;
-
-typedef void (fz_store_drop_fn)(fz_context *, fz_storable *);
-
-struct fz_storable_s {
-	int refs;
-	fz_store_drop_fn *drop;
-};
-
-struct fz_key_storable_s {
-	fz_storable storable;
-	short store_key_refs;
-};
-
-#define FZ_INIT_STORABLE(S_,RC,DROP) \
-	do { fz_storable *S = &(S_)->storable; S->refs = (RC); \
-	S->drop = (DROP); \
-	} while (0)
-
-#define FZ_INIT_KEY_STORABLE(KS_,RC,DROP) \
-	do { fz_key_storable *KS = &(KS_)->key_storable; KS->store_key_refs = 0;\
-	FZ_INIT_STORABLE(KS,RC,DROP); \
-	} while (0)
-
-void *fz_keep_storable(fz_context *, const fz_storable *);
-void fz_drop_storable(fz_context *, const fz_storable *);
-
-void *fz_keep_key_storable(fz_context *, const fz_key_storable *);
-int fz_drop_key_storable(fz_context *, const fz_key_storable *);
-
-void *fz_keep_key_storable_key(fz_context *, const fz_key_storable *);
-int fz_drop_key_storable_key(fz_context *, const fz_key_storable *);
-
-static inline int fz_key_storable_needs_reaping(fz_context *ctx, const fz_key_storable *ks)
-{
-	return ks == NULL ? 0 : (ks->store_key_refs == ks->storable.refs);
-}
-
-/*
-	The store can be seen as a dictionary that maps keys to fz_storable
-	values. In order to allow keys of different types to be stored, we
-	have a structure full of functions for each key 'type'; this
-	fz_store_type pointer is stored with each key, and tells the store
-	how to perform certain operations (like taking/dropping a reference,
-	comparing two keys, outputting details for debugging etc).
-
-	The store uses a hash table internally for speed where possible. In
-	order for this to work, we need a mechanism for turning a generic
-	'key' into 'a hashable string'. For this purpose the type structure
-	contains a make_hash_key function pointer that maps from a void *
-	to a fz_store_hash structure. If make_hash_key function returns 0,
-	then the key is determined not to be hashable, and the value is
-	not stored in the hash table.
-
-	Some objects can be used both as values within the store, and as a
-	component of keys within the store. We refer to these objects as
-	"key storable" objects. In this case, we need to take additional
-	care to ensure that we do not end up keeping an item within the
-	store, purely because its value is referred to by another key in
-	the store.
-
-	An example of this are fz_images in PDF files. Each fz_image is
-	placed into the	store to enable it to be easily reused. When the
-	image is rendered, a pixmap is generated from the image, and the
-	pixmap is placed into the store so it can be reused on subsequent
-	renders. The image forms part of the key for the pixmap.
-
-	When we close the pdf document (and any associated pages/display
-	lists etc), we drop the images from the store. This may leave us
-	in the position of the images having non-zero reference counts
-	purely because they are used as part of the keys for the pixmaps.
-
-	We therefore use special reference counting functions to keep
-	track of these "key storable" items, and hence store the number of
-	references to these items that are used in keys.
-
-	When the number of references to an object == the number of
-	references to an object from keys in the store, we know that we can
-	remove all the items which have that object as part of the key.
-	This is done by running a pass over the store, 'reaping' those
-	items.
-
-	Reap passes are slower than we would like as they touch every
-	item in the store. We therefore provide a way to 'batch' such
-	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_drop_fn *drop;
-	union
-	{
-		struct
-		{
-			const void *ptr;
-			int i;
-		} pi;
-		struct
-		{
-			const void *ptr;
-			int i;
-			fz_irect r;
-		} pir;
-		struct
-		{
-			int id;
-			float m[4];
-		} im;
-	} u;
-} fz_store_hash;
-
-typedef struct fz_store_type_s
-{
-	int (*make_hash_key)(fz_context *ctx, fz_store_hash *, void *);
-	void *(*keep_key)(fz_context *,void *);
-	void (*drop_key)(fz_context *,void *);
-	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
-
-	max: The maximum size (in bytes) that the store is allowed to grow
-	to. FZ_STORE_UNLIMITED means no limit.
-*/
-void fz_new_store_context(fz_context *ctx, size_t max);
-
-/*
-	fz_drop_store_context: Drop a reference to the store.
-*/
-void fz_drop_store_context(fz_context *ctx);
-
-/*
-	fz_keep_store_context: Take a reference to the store.
-*/
-fz_store *fz_keep_store_context(fz_context *ctx);
-
-/*
-	fz_store_item: Add an item to the store.
-
-	Add an item into the store, returning NULL for success. If an item
-	with the same key is found in the store, then our item will not be
-	inserted, and the function will return a pointer to that value
-	instead. This function takes its own reference to val, as required
-	(i.e. the caller maintains ownership of its own reference).
-
-	key: The key used to index the item.
-
-	val: The value to store.
-
-	itemsize: The size in bytes of the value (as counted towards the
-	store size).
-
-	type: Functions used to manipulate the key.
-*/
-void *fz_store_item(fz_context *ctx, void *key, void *val, size_t itemsize, const fz_store_type *type);
-
-/*
-	fz_find_item: Find an item within the store.
-
-	drop: The function used to free the value (to ensure we get a value
-	of the correct type).
-
-	key: The key used to index the item.
-
-	type: Functions used to manipulate the key.
-
-	Returns NULL for not found, otherwise returns a pointer to the value
-	indexed by key to which a reference has been taken.
-*/
-void *fz_find_item(fz_context *ctx, fz_store_drop_fn *drop, void *key, const fz_store_type *type);
-
-/*
-	fz_remove_item: Remove an item from the store.
-
-	If an item indexed by the given key exists in the store, remove it.
-
-	drop: The function used to free the value (to ensure we get a value
-	of the correct type).
-
-	key: The key used to find the item to remove.
-
-	type: Functions used to manipulate the key.
-*/
-void fz_remove_item(fz_context *ctx, fz_store_drop_fn *drop, void *key, const fz_store_type *type);
-
-/*
-	fz_empty_store: Evict everything from the store.
-*/
-void fz_empty_store(fz_context *ctx);
-
-/*
-	fz_store_scavenge: Internal function used as part of the scavenging
-	allocator; when we fail to allocate memory, before returning a
-	failure to the caller, we try to scavenge space within the store by
-	evicting at least 'size' bytes. The allocator then retries.
-
-	size: The number of bytes we are trying to have free.
-
-	phase: What phase of the scavenge we are in. Updated on exit.
-
-	Returns non zero if we managed to free any memory.
-*/
-int fz_store_scavenge(fz_context *ctx, size_t size, int *phase);
-
-/*
-	fz_shrink_store: Evict items from the store until the total size of
-	the objects in the store is reduced to a given percentage of its
-	current size.
-
-	percent: %age of current size to reduce the store to.
-
-	Returns non zero if we managed to free enough memory, zero otherwise.
-*/
-int fz_shrink_store(fz_context *ctx, unsigned int percent);
-
-typedef int (fz_store_filter_fn)(fz_context *ctx, void *arg, void *key);
-
-void fz_filter_store(fz_context *ctx, fz_store_filter_fn *fn, void *arg, const fz_store_type *type);
-
-/*
-	fz_print_store: Dump the contents of the store for debugging.
-*/
-void fz_print_store(fz_context *ctx, fz_output *out);
-void fz_print_store_locked(fz_context *ctx, fz_output *out);
-
-/*
-	fz_defer_reap_start: Increment the defer reap count.
-
-	No reap operations will take place (except for those
-	triggered by an immediate failed malloc) until the
-	defer reap count returns to 0.
-
-	Call this at the start of a process during which you
-	potentially might drop many reapable objects.
-
-	It is vital that every fz_defer_reap_start is matched
-	by a fz_defer_reap_end call.
-*/
-void fz_defer_reap_start(fz_context *ctx);
-
-/*
-	fz_defer_reap_end: Decrement the defer reap count.
-
-	If the defer reap count returns to 0, and the store
-	has reapable objects in, a reap pass will begin.
-
-	Call this at the end of a process during which you
-	potentially might drop many reapable objects.
-
-	It is vital that every fz_defer_reap_start is matched
-	by a fz_defer_reap_end call.
-*/
-void fz_defer_reap_end(fz_context *ctx);
-
-#endif

+ 0 - 552
server/lib/xfdftool/include/mupdf/fitz/stream.h

@@ -1,552 +0,0 @@
-#ifndef MUPDF_FITZ_STREAM_H
-#define MUPDF_FITZ_STREAM_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/buffer.h"
-
-/*
-	fz_file_exists: Return true if the named file exists and is readable.
-*/
-int fz_file_exists(fz_context *ctx, const char *path);
-
-/*
-	fz_stream is a buffered reader capable of seeking in both
-	directions.
-
-	Streams are reference counted, so references must be dropped
-	by a call to fz_drop_stream.
-
-	Only the data between rp and wp is valid.
-*/
-typedef struct fz_stream_s fz_stream;
-
-/*
-	fz_open_file: Open the named file and wrap it in a stream.
-
-	filename: Path to a file. On non-Windows machines the filename should
-	be exactly as it would be passed to fopen(2). On Windows machines, the
-	path should be UTF-8 encoded so that non-ASCII characters can be
-	represented. Other platforms do the encoding as standard anyway (and
-	in most cases, particularly for MacOS and Linux, the encoding they
-	use is UTF-8 anyway).
-*/
-fz_stream *fz_open_file(fz_context *ctx, const char *filename);
-
-fz_stream *fz_open_file_ptr_progressive(fz_context *ctx, FILE *file, int bps);
-fz_stream *fz_open_file_progressive(fz_context *ctx, const char *filename, int bps);
-
-/*
-	fz_open_file_w: Open the named file and wrap it in a stream.
-
-	This function is only available when compiling for Win32.
-
-	filename: Wide character path to the file as it would be given
-	to _wfopen().
-*/
-fz_stream *fz_open_file_w(fz_context *ctx, const wchar_t *filename);
-
-/*
-	fz_open_file: Wrap an open file descriptor in a stream.
-
-	file: An open file descriptor supporting bidirectional
-	seeking. The stream will take ownership of the file
-	descriptor, so it may not be modified or closed after the call
-	to fz_open_file_ptr. When the stream is closed it will also close
-	the file descriptor.
-*/
-fz_stream *fz_open_file_ptr(fz_context *ctx, FILE *file);
-
-/*
-	fz_open_memory: Open a block of memory as a stream.
-
-	data: Pointer to start of data block. Ownership of the data block is
-	NOT passed in.
-
-	len: Number of bytes in data block.
-
-	Returns pointer to newly created stream. May throw exceptions on
-	failure to allocate.
-*/
-fz_stream *fz_open_memory(fz_context *ctx, unsigned char *data, size_t len);
-
-/*
-	fz_open_buffer: Open a buffer as a stream.
-
-	buf: The buffer to open. Ownership of the buffer is NOT passed in
-	(this function takes its own reference).
-
-	Returns pointer to newly created stream. May throw exceptions on
-	failure to allocate.
-*/
-fz_stream *fz_open_buffer(fz_context *ctx, fz_buffer *buf);
-
-/*
-	fz_open_leecher: Attach a filter to a stream that will store any
-	characters read from the stream into the supplied buffer.
-
-	chain: The underlying stream to leech from.
-
-	buf: The buffer into which the read data should be appended.
-	The buffer will be resized as required.
-
-	Returns pointer to newly created stream. May throw exceptions on
-	failure to allocate.
-*/
-fz_stream *fz_open_leecher(fz_context *ctx, fz_stream *chain, fz_buffer *buf);
-
-/*
-	fz_drop_stream: Close an open stream.
-
-	Drops a reference for the stream. Once no references remain
-	the stream will be closed, as will any file descriptor the
-	stream is using.
-
-	Does not throw exceptions.
-*/
-void fz_drop_stream(fz_context *ctx, fz_stream *stm);
-
-/*
-	fz_tell: return the current reading position within a stream
-*/
-fz_off_t fz_tell(fz_context *ctx, fz_stream *stm);
-
-/*
-	fz_seek: Seek within a stream.
-
-	stm: The stream to seek within.
-
-	offset: The offset to seek to.
-
-	whence: From where the offset is measured (see fseek).
-*/
-void fz_seek(fz_context *ctx, fz_stream *stm, fz_off_t offset, int whence);
-
-/*
-	fz_read: Read from a stream into a given data block.
-
-	stm: The stream to read from.
-
-	data: The data block to read into.
-
-	len: The length of the data block (in bytes).
-
-	Returns the number of bytes read. May throw exceptions.
-*/
-size_t fz_read(fz_context *ctx, fz_stream *stm, unsigned char *data, size_t len);
-
-/*
-	fz_skip: Read from a stream discarding data.
-
-	stm: The stream to read from.
-
-	len: The number of bytes to read.
-
-	Returns the number of bytes read. May throw exceptions.
-*/
-size_t fz_skip(fz_context *ctx, fz_stream *stm, size_t len);
-
-/*
-	fz_read_all: Read all of a stream into a buffer.
-
-	stm: The stream to read from
-
-	initial: Suggested initial size for the buffer.
-
-	Returns a buffer created from reading from the stream. May throw
-	exceptions on failure to allocate.
-*/
-fz_buffer *fz_read_all(fz_context *ctx, fz_stream *stm, size_t initial);
-
-/*
-	fz_read_file: Read all the contents of a file into a buffer.
-*/
-fz_buffer *fz_read_file(fz_context *ctx, const char *filename);
-
-/*
-	fz_read_[u]int(16|24|32|64)(_le)?
-
-	Read a 16/32/64 bit signed/unsigned integer from stream,
-	in big or little-endian byte orders.
-
-	Throws an exception if EOF is encountered.
-*/
-uint16_t fz_read_uint16(fz_context *ctx, fz_stream *stm);
-uint32_t fz_read_uint24(fz_context *ctx, fz_stream *stm);
-uint32_t fz_read_uint32(fz_context *ctx, fz_stream *stm);
-uint64_t fz_read_uint64(fz_context *ctx, fz_stream *stm);
-
-uint16_t fz_read_uint16_le(fz_context *ctx, fz_stream *stm);
-uint32_t fz_read_uint24_le(fz_context *ctx, fz_stream *stm);
-uint32_t fz_read_uint32_le(fz_context *ctx, fz_stream *stm);
-uint64_t fz_read_uint64_le(fz_context *ctx, fz_stream *stm);
-
-int16_t fz_read_int16(fz_context *ctx, fz_stream *stm);
-int32_t fz_read_int32(fz_context *ctx, fz_stream *stm);
-int64_t fz_read_int64(fz_context *ctx, fz_stream *stm);
-
-int16_t fz_read_int16_le(fz_context *ctx, fz_stream *stm);
-int32_t fz_read_int32_le(fz_context *ctx, fz_stream *stm);
-int64_t fz_read_int64_le(fz_context *ctx, fz_stream *stm);
-
-/*
-	fz_read_string: Read a null terminated string from the stream into
-	a buffer of a given length. The buffer will be null terminated.
-	Throws on failure (including the failure to fit the entire string
-	including the terminator into the buffer).
-*/
-void fz_read_string(fz_context *ctx, fz_stream *stm, char *buffer, int len);
-
-enum
-{
-	FZ_STREAM_META_PROGRESSIVE = 1,
-	FZ_STREAM_META_LENGTH = 2
-};
-
-/*
-	fz_stream_meta: Perform a meta call on a stream (typically to
-	request meta information about a stream).
-
-	stm: The stream to query.
-
-	key: The meta request identifier.
-
-	size: Meta request specific parameter - typically the size of
-	the data block pointed to by ptr.
-
-	ptr: Meta request specific parameter - typically a pointer to
-	a block of data to be filled in.
-
-	Returns -1 if this stream does not support this meta operation,
-	or a meta operation specific return value.
-*/
-int fz_stream_meta(fz_context *ctx, fz_stream *stm, int key, int size, void *ptr);
-
-/*
-	fz_stream_next_fn: A function type for use when implementing
-	fz_streams. The supplied function of this type is called
-	whenever data is required, and the current buffer is empty.
-
-	stm: The stream to operate on.
-
-	max: a hint as to the maximum number of bytes that the caller
-	needs to be ready immediately. Can safely be ignored.
-
-	Returns -1 if there is no more data in the stream. Otherwise,
-	the function should find its internal state using stm->state,
-	refill its buffer, update stm->rp and stm->wp to point to the
-	start and end of the new data respectively, and then
-	"return *stm->rp++".
-*/
-typedef int (fz_stream_next_fn)(fz_context *ctx, fz_stream *stm, size_t max);
-
-/*
-	fz_stream_close_fn: A function type for use when implementing
-	fz_streams. The supplied function of this type is called
-	when the stream is closed, to release the stream specific
-	state information.
-
-	state: The stream state to release.
-*/
-typedef void (fz_stream_close_fn)(fz_context *ctx, void *state);
-
-/*
-	fz_stream_seek_fn: A function type for use when implementing
-	fz_streams. The supplied function of this type is called when
-	fz_seek is requested, and the arguments are as defined for
-	fz_seek.
-
-	The stream can find it's private state in stm->state.
-*/
-typedef void (fz_stream_seek_fn)(fz_context *ctx, fz_stream *stm, fz_off_t offset, int whence);
-
-/*
-	fz_stream_meta_fn: A function type for use when implementing
-	fz_streams. The supplied function of this type is called when
-	fz_meta is requested, and the arguments are as defined for
-	fz_meta.
-
-	The stream can find it's private state in stm->state.
-*/
-typedef int (fz_stream_meta_fn)(fz_context *ctx, fz_stream *stm, int key, int size, void *ptr);
-
-struct fz_stream_s
-{
-	int refs;
-	int error;
-	int eof;
-	fz_off_t pos;
-	int avail;
-	int bits;
-	unsigned char *rp, *wp;
-	void *state;
-	fz_stream_next_fn *next;
-	fz_stream_close_fn *close;
-	fz_stream_seek_fn *seek;
-	fz_stream_meta_fn *meta;
-};
-
-/*
-	fz_new_stream: Create a new stream object with the given
-	internal state and function pointers.
-
-	state: Internal state (opaque to everything but implementation).
-
-	next: Should provide the next set of bytes (up to max) of stream
-	data. Return the number of bytes read, or EOF when there is no
-	more data.
-
-	close: Should clean up and free the internal state. May not
-	throw exceptions.
-*/
-fz_stream *fz_new_stream(fz_context *ctx, void *state, fz_stream_next_fn *next, fz_stream_close_fn *close);
-
-fz_stream *fz_keep_stream(fz_context *ctx, fz_stream *stm);
-
-/*
-	fz_read_best: Attempt to read a stream into a buffer. If truncated
-	is NULL behaves as fz_read_all, otherwise does not throw exceptions
-	in the case of failure, but instead sets a truncated flag.
-
-	stm: The stream to read from.
-
-	initial: Suggested initial size for the buffer.
-
-	truncated: Flag to store success/failure indication in.
-
-	Returns a buffer created from reading from the stream.
-*/
-fz_buffer *fz_read_best(fz_context *ctx, fz_stream *stm, size_t initial, int *truncated);
-
-/*
-	fz_read_line: Read a line from stream into the buffer until either a
-	terminating newline or EOF, which it replaces with a null byte ('\0').
-
-	Returns buf on success, and NULL when end of file occurs while no characters
-	have been read.
-*/
-char *fz_read_line(fz_context *ctx, fz_stream *stm, char *buf, size_t max);
-
-/*
-	fz_available: Ask how many bytes are available immediately from
-	a given stream.
-
-	stm: The stream to read from.
-
-	max: A hint for the underlying stream; the maximum number of
-	bytes that we are sure we will want to read. If you do not know
-	this number, give 1.
-
-	Returns the number of bytes immediately available between the
-	read and write pointers. This number is guaranteed only to be 0
-	if we have hit EOF. The number of bytes returned here need have
-	no relation to max (could be larger, could be smaller).
-*/
-static inline size_t fz_available(fz_context *ctx, fz_stream *stm, size_t max)
-{
-	size_t len = stm->wp - stm->rp;
-	int c = EOF;
-
-	if (len)
-		return len;
-	fz_try(ctx)
-	{
-		c = stm->next(ctx, stm, max);
-	}
-	fz_catch(ctx)
-	{
-		fz_rethrow_if(ctx, FZ_ERROR_TRYLATER);
-		fz_warn(ctx, "read error; treating as end of file");
-		stm->error = 1;
-		c = EOF;
-	}
-	if (c == EOF)
-	{
-		stm->eof = 1;
-		return 0;
-	}
-	stm->rp--;
-	return stm->wp - stm->rp;
-}
-
-/*
-	fz_read_byte: Read the next byte from a stream.
-
-	stm: The stream t read from.
-
-	Returns -1 for end of stream, or the next byte. May
-	throw exceptions.
-*/
-static inline int fz_read_byte(fz_context *ctx, fz_stream *stm)
-{
-	int c = EOF;
-
-	if (stm->rp != stm->wp)
-		return *stm->rp++;
-	fz_try(ctx)
-	{
-		c = stm->next(ctx, stm, 1);
-	}
-	fz_catch(ctx)
-	{
-		fz_rethrow_if(ctx, FZ_ERROR_TRYLATER);
-		fz_warn(ctx, "read error; treating as end of file");
-		stm->error = 1;
-		c = EOF;
-	}
-	if (c == EOF)
-		stm->eof = 1;
-	return c;
-}
-
-/*
-	fz_peek_byte: Peek at the next byte in a stream.
-
-	stm: The stream to peek at.
-
-	Returns -1 for EOF, or the next byte that will be read.
-*/
-static inline int fz_peek_byte(fz_context *ctx, fz_stream *stm)
-{
-	int c;
-
-	if (stm->rp != stm->wp)
-		return *stm->rp;
-
-	c = stm->next(ctx, stm, 1);
-	if (c != EOF)
-		stm->rp--;
-	return c;
-}
-
-/*
-	fz_unread_byte: Unread the single last byte successfully
-	read from a stream. Do not call this without having
-	successfully read a byte.
-
-	stm: The stream to operate upon.
-*/
-static inline void fz_unread_byte(fz_context *ctx FZ_UNUSED, fz_stream *stm)
-{
-	stm->rp--;
-}
-
-static inline int fz_is_eof(fz_context *ctx, fz_stream *stm)
-{
-	if (stm->rp == stm->wp)
-	{
-		if (stm->eof)
-			return 1;
-		return fz_peek_byte(ctx, stm) == EOF;
-	}
-	return 0;
-}
-
-/*
-	fz_read_bits: Read the next n bits from a stream (assumed to
-	be packed most significant bit first).
-
-	stm: The stream to read from.
-
-	n: The number of bits to read, between 1 and 8*sizeof(int)
-	inclusive.
-
-	Returns -1 for EOF, or the required number of bits.
-*/
-static inline unsigned int fz_read_bits(fz_context *ctx, fz_stream *stm, int n)
-{
-	int x;
-
-	if (n <= stm->avail)
-	{
-		stm->avail -= n;
-		x = (stm->bits >> stm->avail) & ((1 << n) - 1);
-	}
-	else
-	{
-		x = stm->bits & ((1 << stm->avail) - 1);
-		n -= stm->avail;
-		stm->avail = 0;
-
-		while (n > 8)
-		{
-			x = (x << 8) | fz_read_byte(ctx, stm);
-			n -= 8;
-		}
-
-		if (n > 0)
-		{
-			stm->bits = fz_read_byte(ctx, stm);
-			stm->avail = 8 - n;
-			x = (x << n) | (stm->bits >> stm->avail);
-		}
-	}
-
-	return x;
-}
-
-/*
-	fz_read_rbits: Read the next n bits from a stream (assumed to
-	be packed least significant bit first).
-
-	stm: The stream to read from.
-
-	n: The number of bits to read, between 1 and 8*sizeof(int)
-	inclusive.
-
-	Returns (unsigned int)-1 for EOF, or the required number of bits.
-*/
-static inline unsigned int fz_read_rbits(fz_context *ctx, fz_stream *stm, int n)
-{
-	int x;
-
-	if (n <= stm->avail)
-	{
-		x = stm->bits & ((1 << n) - 1);
-		stm->avail -= n;
-		stm->bits = stm->bits >> n;
-	}
-	else
-	{
-		unsigned int used = 0;
-
-		x = stm->bits & ((1 << stm->avail) - 1);
-		n -= stm->avail;
-		used = stm->avail;
-		stm->avail = 0;
-
-		while (n > 8)
-		{
-			x = (fz_read_byte(ctx, stm) << used) | x;
-			n -= 8;
-			used += 8;
-		}
-
-		if (n > 0)
-		{
-			stm->bits = fz_read_byte(ctx, stm);
-			x = ((stm->bits & ((1 << n) - 1)) << used) | x;
-			stm->avail = 8 - n;
-			stm->bits = stm->bits >> n;
-		}
-	}
-
-	return x;
-}
-
-/*
-	fz_sync_bits: Called after reading bits to tell the stream
-	that we are about to return to reading bytewise. Resyncs
-	the stream to whole byte boundaries.
-*/
-static inline void fz_sync_bits(fz_context *ctx FZ_UNUSED, fz_stream *stm)
-{
-	stm->avail = 0;
-}
-
-static inline int fz_is_eof_bits(fz_context *ctx, fz_stream *stm)
-{
-	return fz_is_eof(ctx, stm) && (stm->avail == 0 || stm->bits == EOF);
-}
-
-#endif

+ 0 - 160
server/lib/xfdftool/include/mupdf/fitz/string-util.h

@@ -1,160 +0,0 @@
-#ifndef MUPDF_FITZ_STRING_H
-#define MUPDF_FITZ_STRING_H
-
-#include "mupdf/fitz/system.h"
-
-/*
-	Safe string functions
-*/
-
-/*
-	fz_strsep: Given a pointer to a C string (or a pointer to NULL) break
-	it at the first occurrence of a delimiter char (from a given set).
-
-	stringp: Pointer to a C string pointer (or NULL). Updated on exit to
-	point to the first char of the string after the delimiter that was
-	found. The string pointed to by stringp will be corrupted by this
-	call (as the found delimiter will be overwritten by 0).
-
-	delim: A C string of acceptable delimiter characters.
-
-	Returns a pointer to a C string containing the chars of stringp up
-	to the first delimiter char (or the end of the string), or NULL.
-*/
-char *fz_strsep(char **stringp, const char *delim);
-
-/*
-	fz_strlcpy: Copy at most n-1 chars of a string into a destination
-	buffer with null termination, returning the real length of the
-	initial string (excluding terminator).
-
-	dst: Destination buffer, at least n bytes long.
-
-	src: C string (non-NULL).
-
-	n: Size of dst buffer in bytes.
-
-	Returns the length (excluding terminator) of src.
-*/
-size_t fz_strlcpy(char *dst, const char *src, size_t n);
-
-/*
-	fz_strlcat: Concatenate 2 strings, with a maximum length.
-
-	dst: pointer to first string in a buffer of n bytes.
-
-	src: pointer to string to concatenate.
-
-	n: Size (in bytes) of buffer that dst is in.
-
-	Returns the real length that a concatenated dst + src would have been
-	(not including terminator).
-*/
-size_t fz_strlcat(char *dst, const char *src, size_t n);
-
-/*
-	fz_dirname: extract the directory component from a path.
-*/
-void fz_dirname(char *dir, const char *path, size_t dirsize);
-
-/*
-	fz_urldecode: decode url escapes.
-*/
-char *fz_urldecode(char *url);
-
-/*
-	fz_format_output_path: create output file name using a template.
-		If the path contains %[0-9]*d, the first such pattern will be replaced
-		with the page number. If the template does not contain such a pattern, the page
-		number will be inserted before the file suffix. If the template does not have
-		a file suffix, the page number will be added to the end.
-*/
-void fz_format_output_path(fz_context *ctx, char *path, size_t size, const char *fmt, int page);
-
-/*
-	fz_cleanname: rewrite path to the shortest string that names the same path.
-
-	Eliminates multiple and trailing slashes, interprets "." and "..".
-	Overwrites the string in place.
-*/
-char *fz_cleanname(char *name);
-
-/*
-	FZ_UTFMAX: Maximum number of bytes in a decoded rune (maximum length returned by fz_chartorune).
-*/
-enum { FZ_UTFMAX = 4 };
-
-/*
-	fz_chartorune: UTF8 decode a single rune from a sequence of chars.
-
-	rune: Pointer to an int to assign the decoded 'rune' to.
-
-	str: Pointer to a UTF8 encoded string.
-
-	Returns the number of bytes consumed. Does not throw exceptions.
-*/
-int fz_chartorune(int *rune, const char *str);
-
-/*
-	fz_runetochar: UTF8 encode a rune to a sequence of chars.
-
-	str: Pointer to a place to put the UTF8 encoded character.
-
-	rune: Pointer to a 'rune'.
-
-	Returns the number of bytes the rune took to output. Does not throw
-	exceptions.
-*/
-int fz_runetochar(char *str, int rune);
-
-/*
-	fz_runelen: Count how many chars are required to represent a rune.
-
-	rune: The rune to encode.
-
-	Returns the number of bytes required to represent this run in UTF8.
-*/
-int fz_runelen(int rune);
-
-/*
-	fz_utflen: Count how many runes the UTF-8 encoded string
-	consists of.
-
-	s: The UTF-8 encoded, NUL-terminated text string.
-
-	Returns the number of runes in the string.
-*/
-int fz_utflen(const char *s);
-
-/*
-	fz_strtod/fz_strtof: Locale-independent decimal to binary
-	conversion. On overflow return (-)INFINITY and set errno to ERANGE. On
-	underflow return 0 and set errno to ERANGE. Special inputs (case
-	insensitive): "NAN", "INF" or "INFINITY".
-*/
-double fz_strtod(const char *s, char **es);
-float fz_strtof(const char *s, char **es);
-
-/*
-	fz_strtof_no_exp: Like fz_strtof, but does not recognize exponent
-	format. So fz_strtof_no_exp("1.5e20", &tail) will return 1.5 and tail
-	will point to "e20".
-*/
-
-float fz_strtof_no_exp(const char *string, char **tailptr);
-/*
-	fz_grisu: Compute decimal integer m, exp such that:
-		f = m * 10^exp
-		m is as short as possible without losing exactness
-	Assumes special cases (0, NaN, +Inf, -Inf) have been handled.
-*/
-int fz_grisu(float f, char *s, int *exp);
-
-/*
-	Check and parse string into page ranges:
-		( ','? ([0-9]+|'N') ( '-' ([0-9]+|N) )? )+
-*/
-int fz_is_page_range(fz_context *ctx, const char *s);
-const char *fz_parse_page_range(fz_context *ctx, const char *s, int *a, int *b, int n);
-
-#endif

+ 0 - 325
server/lib/xfdftool/include/mupdf/fitz/structured-text.h

@@ -1,325 +0,0 @@
-#ifndef MUPDF_FITZ_STRUCTURED_TEXT_H
-#define MUPDF_FITZ_STRUCTURED_TEXT_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/geometry.h"
-#include "mupdf/fitz/font.h"
-#include "mupdf/fitz/colorspace.h"
-#include "mupdf/fitz/image.h"
-#include "mupdf/fitz/output.h"
-#include "mupdf/fitz/device.h"
-
-/*
-	Text extraction device: Used for searching, format conversion etc.
-
-	(In development - Subject to change in future versions)
-*/
-
-typedef struct fz_stext_style_s fz_stext_style;
-typedef struct fz_stext_char_s fz_stext_char;
-typedef struct fz_stext_span_s fz_stext_span;
-typedef struct fz_stext_line_s fz_stext_line;
-typedef struct fz_stext_block_s fz_stext_block;
-typedef struct fz_image_block_s fz_image_block;
-typedef struct fz_page_block_s fz_page_block;
-
-typedef struct fz_stext_sheet_s fz_stext_sheet;
-typedef struct fz_stext_page_s fz_stext_page;
-
-/*
-	FZ_STEXT_PRESERVE_LIGATURES: If this option is activated ligatures
-	are passed through to the application in their original form. If
-	this option is deactivated ligatures are expanded into their
-	constituent parts, e.g. the ligature ffi is expanded into three
-	separate characters f, f and i.
-
-	FZ_STEXT_PRESERVE_WHITESPACE: If this option is activated whitespace
-	is passed through to the application in its original form. If this
-	option is deactivated any type of horizontal whitespace (including
-	horizontal tabs) will be replaced with space characters of variable
-	width.
-*/
-enum
-{
-	FZ_STEXT_PRESERVE_LIGATURES = 1,
-	FZ_STEXT_PRESERVE_WHITESPACE = 2,
-};
-
-/*
-	fz_stext_sheet: A text sheet contains a list of distinct text styles
-	used on a page (or a series of pages).
-*/
-struct fz_stext_sheet_s
-{
-	int maxid;
-	fz_stext_style *style;
-};
-
-/*
-	fz_stext_style: A text style contains details of a distinct text style
-	used on a page.
-*/
-struct fz_stext_style_s
-{
-	fz_stext_style *next;
-	int id;
-	fz_font *font;
-	float size;
-	int wmode;
-	int script;
-	/* Ascender and Descender only have the conventional sense in
-	 * horizontal mode; in vertical mode they are rotated too - they are
-	 * the maximum and minimum bounds respectively. */
-	float ascender;
-	float descender;
-	/* etc... */
-};
-
-/*
-	fz_stext_page: A text page is a list of page blocks, together with
-	an overall bounding box.
-*/
-struct fz_stext_page_s
-{
-	fz_rect mediabox;
-	int len, cap;
-	fz_page_block *blocks;
-	fz_stext_page *next;
-};
-
-/*
-	fz_page_block: A page block is a typed block pointer.
-*/
-struct fz_page_block_s
-{
-	int type;
-	union
-	{
-		fz_stext_block *text;
-		fz_image_block *image;
-	} u;
-};
-
-enum
-{
-	FZ_PAGE_BLOCK_TEXT = 0,
-	FZ_PAGE_BLOCK_IMAGE = 1
-};
-
-/*
-	fz_stext_block: A text block is a list of lines of text. In typical
-	cases this may correspond to a paragraph or a column of text. A
-	collection of blocks makes up a page.
-*/
-struct fz_stext_block_s
-{
-	fz_rect bbox;
-	int len, cap;
-	fz_stext_line *lines;
-};
-
-/*
-	fz_image_block: An image block is an image, together with the  list of lines of text. In typical
-	cases this may correspond to a paragraph or a column of text. A
-	collection of blocks makes up a page.
-*/
-struct fz_image_block_s
-{
-	fz_rect bbox;
-	fz_matrix mat;
-	fz_image *image;
-	fz_colorspace *cspace;
-	float colors[FZ_MAX_COLORS];
-};
-
-/*
-	fz_stext_line: A text line is a list of text spans, with the same
-	baseline. In typical cases this should correspond (as expected) to
-	complete lines of text. A collection of lines makes up a block.
-*/
-struct fz_stext_line_s
-{
-	fz_stext_span *first_span, *last_span;
-
-	/* Cached information */
-	float distance; /* Perpendicular distance from previous line */
-	fz_rect bbox;
-	void *region; /* Opaque value for matching line masks */
-};
-
-/*
-	fz_stext_span: A text span is a list of characters that share a common
-	baseline/transformation. In typical cases a single span may be enough
-	to represent a complete line. In cases where the text has big gaps in
-	it (perhaps as it crosses columns or tables), a line may be represented
-	by multiple spans.
-*/
-struct fz_stext_span_s
-{
-	int len, cap;
-	fz_stext_char *text;
-	fz_point min; /* Device space */
-	fz_point max; /* Device space */
-	int wmode; /* 0 for horizontal, 1 for vertical */
-	fz_matrix transform; /* e and f are always 0 here */
-	/* Ascender_max and Descender_min only have the conventional sense in
-	 * horizontal mode; in vertical mode they are rotated too - they are
-	 * the maximum and minimum bounds respectively. */
-	float ascender_max; /* Document space */
-	float descender_min; /* Document space */
-	fz_rect bbox; /* Device space */
-
-	/* Cached information */
-	float base_offset; /* Perpendicular distance from baseline of line */
-	float spacing; /* Distance along baseline from previous span in this line (or 0 if first) */
-	int column; /* If non zero, the column that it's in */
-	float column_width; /* Percentage */
-	int align; /* 0 = left, 1 = centre, 2 = right */
-	float indent; /* The indent position for this column. */
-
-	fz_stext_span *next;
-};
-
-/*
-	fz_stext_char: A text char is a unicode character, the style in which
-	is appears, and the point at which it is positioned. Transform
-	(and hence bbox) information is given by the enclosing span.
-*/
-struct fz_stext_char_s
-{
-	fz_point p; /* Device space */
-	int c;
-	fz_stext_style *style;
-};
-
-typedef struct fz_char_and_box_s fz_char_and_box;
-
-struct fz_char_and_box_s
-{
-	int c;
-	fz_rect bbox;
-};
-
-extern const char *fz_stext_options_usage;
-
-fz_char_and_box *fz_stext_char_at(fz_context *ctx, fz_char_and_box *cab, fz_stext_page *page, int idx);
-
-/*
-	fz_stext_char_bbox: Return the bbox of a text char. Calculated from
-	the supplied enclosing span.
-
-	bbox: A place to store the bbox
-
-	span: The enclosing span
-
-	idx: The index of the char within the span
-
-	Returns bbox (updated)
-
-	Does not throw exceptions
-*/
-fz_rect *fz_stext_char_bbox(fz_context *ctx, fz_rect *bbox, fz_stext_span *span, int idx);
-
-/*
-	fz_new_stext_sheet: Create an empty style sheet.
-
-	The style sheet is filled out by the text device, creating
-	one style for each unique font, color, size combination that
-	is used.
-*/
-fz_stext_sheet *fz_new_stext_sheet(fz_context *ctx);
-void fz_drop_stext_sheet(fz_context *ctx, fz_stext_sheet *sheet);
-
-/*
-	fz_new_stext_page: Create an empty text page.
-
-	The text page is filled out by the text device to contain the blocks,
-	lines and spans of text on the page.
-
-	mediabox: optional mediabox information.
-*/
-fz_stext_page *fz_new_stext_page(fz_context *ctx, const fz_rect *mediabox);
-void fz_drop_stext_page(fz_context *ctx, fz_stext_page *page);
-
-void fz_analyze_text(fz_context *ctx, fz_stext_sheet *sheet, fz_stext_page *page);
-
-/*
-	fz_print_stext_sheet: Output a text sheet to a file as CSS.
-*/
-void fz_print_stext_sheet(fz_context *ctx, fz_output *out, fz_stext_sheet *sheet);
-
-/*
-	fz_print_stext_page_html: Output a page to a file in HTML format.
-*/
-void fz_print_stext_page_html(fz_context *ctx, fz_output *out, fz_stext_page *page);
-
-/*
-	fz_print_stext_page_xml: Output a page to a file in XML format.
-*/
-void fz_print_stext_page_xml(fz_context *ctx, fz_output *out, fz_stext_page *page);
-
-/*
-	fz_print_stext_page: Output a page to a file in UTF-8 format.
-*/
-void fz_print_stext_page(fz_context *ctx, fz_output *out, fz_stext_page *page);
-
-/*
-	fz_search_stext_page: Search for occurrence of 'needle' in text page.
-
-	Return the number of hits and store hit bboxes in the passed in array.
-
-	NOTE: This is an experimental interface and subject to change without notice.
-*/
-int fz_search_stext_page(fz_context *ctx, fz_stext_page *text, const char *needle, fz_rect *hit_bbox, int hit_max);
-
-/*
-	fz_highlight_selection: Return a list of rectangles to highlight given a selection rectangle.
-
-	NOTE: This is an experimental interface and subject to change without notice.
-*/
-int fz_highlight_selection(fz_context *ctx, fz_stext_page *page, fz_rect rect, fz_rect *hit_bbox, int hit_max);
-
-/*
-	fz_copy_selection: Return a newly allocated UTF-8 string with the text for a given selection rectangle.
-
-	NOTE: This is an experimental interface and subject to change without notice.
-*/
-char *fz_copy_selection(fz_context *ctx, fz_stext_page *page, fz_rect rect);
-
-/*
-	struct fz_stext_options: Options for creating a pixmap and draw device.
-*/
-typedef struct fz_stext_options_s fz_stext_options;
-
-struct fz_stext_options_s
-{
-	int flags;
-};
-/*
-	fz_parse_stext_options: Parse stext device options from a comma separated key-value string.
-*/
-fz_stext_options *fz_parse_stext_options(fz_context *ctx, fz_stext_options *opts, const char *string);
-
-/*
-	fz_new_stext_device: Create a device to extract the text on a page.
-
-	Gather and sort the text on a page into spans of uniform style,
-	arranged into lines and blocks by reading order. The reading order
-	is determined by various heuristics, so may not be accurate.
-
-	sheet: The text sheet to which styles should be added. This can
-	either be a newly created (empty) text sheet, or one containing
-	styles from a previous text device. The same sheet cannot be used
-	in multiple threads simultaneously.
-
-	page: The text page to which content should be added. This will
-	usually be a newly created (empty) text page, but it can be one
-	containing data already (for example when merging multiple pages,
-	or watermarking).
-
-	options: Options to configure the stext device.
-*/
-fz_device *fz_new_stext_device(fz_context *ctx, fz_stext_sheet *sheet, fz_stext_page *page, const fz_stext_options *options);
-
-#endif

+ 0 - 475
server/lib/xfdftool/include/mupdf/fitz/system.h

@@ -1,475 +0,0 @@
-#ifndef MUPDF_FITZ_SYSTEM_H
-#define MUPDF_FITZ_SYSTEM_H
-
-#if _MSC_VER >= 1400 /* MSVC 8 (Visual Studio 2005) or newer */
-#define FZ_LARGEFILE
-#endif
-
-/* The very first decision we need to make is, are we using the 64bit
- * file pointers code. This must happen before the stdio.h include. */
-#ifdef FZ_LARGEFILE
-/* Set _LARGEFILE64_SOURCE so that we know fopen64 et al will be declared. */
-#ifndef _LARGEFILE64_SOURCE
-#define _LARGEFILE64_SOURCE
-#endif
-#endif
-
-/* Turn on valgrind pacification in debug builds. */
-#ifndef NDEBUG
-#ifndef PACIFY_VALGRIND
-#define PACIFY_VALGRIND
-#endif
-#endif
-
-/*
-	Include the standard libc headers.
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <stdarg.h>
-#include <string.h>
-#include <math.h>
-
-#include <assert.h>
-#include <errno.h>
-#include <limits.h> /* INT_MAX & co */
-#include <float.h> /* FLT_EPSILON, FLT_MAX & co */
-#include <fcntl.h> /* O_RDONLY & co */
-#include <time.h>
-
-#include <setjmp.h>
-
-#include "mupdf/memento.h"
-#include "mupdf/fitz/track-usage.h"
-
-#define nelem(x) (sizeof(x)/sizeof((x)[0]))
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-#ifndef M_SQRT2
-#define M_SQRT2 1.41421356237309504880
-#endif
-
-/*
-	Spot architectures where we have optimisations.
-*/
-
-#if defined(__arm__) || defined(__thumb__)
-#ifndef ARCH_ARM
-#define ARCH_ARM
-#endif
-#endif
-
-/*
-	Some differences in libc can be smoothed over
-*/
-
-#ifdef __APPLE__
-#define HAVE_SIGSETJMP
-#elif defined(__unix) && !defined(__NACL__)
-#define HAVE_SIGSETJMP
-#endif
-
-/*
-	Where possible (i.e. on platforms on which they are provided), use
-	sigsetjmp/siglongjmp in preference to setjmp/longjmp. We don't alter
-	signal handlers within mupdf, so there is no need for us to
-	store/restore them - hence we use the non-restoring variants. This
-	makes a large speed difference on MacOSX (and probably other
-	platforms too.
-*/
-#ifdef HAVE_SIGSETJMP
-#define fz_setjmp(BUF) sigsetjmp(BUF, 0)
-#define fz_longjmp(BUF,VAL) siglongjmp(BUF, VAL)
-#define fz_jmp_buf sigjmp_buf
-#else
-#define fz_setjmp(BUF) setjmp(BUF)
-#define fz_longjmp(BUF,VAL) longjmp(BUF,VAL)
-#define fz_jmp_buf jmp_buf
-#endif
-
-#ifndef _MSC_VER
-/* For gettimeofday */
-#include <sys/time.h>
-#endif
-
-#ifdef _MSC_VER /* Microsoft Visual C */
-
-/* MSVC up to VS2012 */
-#if _MSC_VER < 1800
-#define va_copy(a, oa) do { a=oa; } while (0)
-#define va_copy_end(a) do {} while(0)
-
-static __inline int signbit(double x)
-{
-	union
-	{
-		double d;
-		__int64 i;
-	} u;
-	u.d = x;
-	return (int)(u.i>>63);
-}
-
-#else
-#define va_copy_end(a) va_end(a)
-#endif
-
-#ifndef PATH_MAX
-#define PATH_MAX (1024)
-#endif
-
-typedef signed char int8_t;
-typedef short int int16_t;
-typedef int int32_t;
-typedef __int64 int64_t;
-
-typedef unsigned char uint8_t;
-typedef unsigned short int uint16_t;
-typedef unsigned int uint32_t;
-typedef unsigned __int64 uint64_t;
-
-#pragma warning( disable: 4244 ) /* conversion from X to Y, possible loss of data */
-#pragma warning( disable: 4701 ) /* Potentially uninitialized local variable 'name' used */
-#pragma warning( disable: 4996 ) /* 'function': was declared deprecated */
-
-#include <io.h>
-
-struct timeval;
-struct timezone;
-int gettimeofday(struct timeval *tv, struct timezone *tz);
-
-#if _MSC_VER < 1900 /* MSVC 2015 */
-#define snprintf msvc_snprintf
-#define vsnprintf msvc_vsnprintf
-static int msvc_vsnprintf(char *str, size_t size, const char *fmt, va_list ap)
-{
-	int n;
-	n = _vsnprintf(str, size, fmt, ap);
-	str[size-1] = 0;
-	return n;
-}
-static int msvc_snprintf(char *str, size_t size, const char *fmt, ...)
-{
-	int n;
-	va_list ap;
-	va_start(ap, fmt);
-	n = msvc_vsnprintf(str, size, fmt, ap);
-	va_end(ap);
-	return n;
-}
-#endif
-
-#if _MSC_VER <= 1700 /* MSVC 2012 */
-#define isnan(x) _isnan(x)
-#define isinf(x) (!_finite(x))
-#endif
-
-#define hypotf _hypotf
-
-#define fz_fopen fz_fopen_utf8
-#define fz_remove fz_remove_utf8
-
-char *fz_utf8_from_wchar(const wchar_t *s);
-wchar_t *fz_wchar_from_utf8(const char *s);
-
-FILE *fz_fopen_utf8(const char *name, const char *mode);
-int fz_remove_utf8(const char *name);
-
-char **fz_argv_from_wargv(int argc, wchar_t **wargv);
-void fz_free_argv(int argc, char **argv);
-
-#define fseeko64 _fseeki64
-#define ftello64 _ftelli64
-#define atoll _atoi64
-
-#include <sys/stat.h>
-
-#define stat _stat
-
-#else /* Unix or close enough */
-
-#include <stdint.h>
-#include <unistd.h>
-#include <sys/stat.h>
-
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-
-#define va_copy_end(a) va_end(a)
-
-#endif
-
-#ifdef FZ_LARGEFILE
-#ifndef fz_fopen
-#define fz_fopen fopen64
-#endif
-typedef int64_t fz_off_t;
-#define fz_fseek fseeko64
-#define fz_ftell ftello64
-#define fz_atoo_imp atoll
-#define FZ_OFF_MAX 0x7fffffffffffffffLL
-#else
-#ifndef fz_fopen
-#define fz_fopen fopen
-#endif
-#ifndef fz_remove
-#define fz_remove remove
-#endif
-#define fz_fseek fseek
-#define fz_ftell ftell
-typedef int fz_off_t;
-#define FZ_OFF_MAX INT_MAX
-#define fz_atoo_imp atoi
-#endif
-
-/* Portable way to format a size_t */
-#if defined(_WIN64)
-#define FMT_zu "%llu"
-#elif defined(_WIN32)
-#define FMT_zu "%u"
-#else
-#define FMT_zu "%zu"
-#endif
-
-#ifdef __ANDROID__
-#include <android/log.h>
-int fz_android_fprintf(FILE *file, const char *fmt, ...);
-#ifndef NDEBUG
-/* Capture fprintf for stdout/stderr to the android logging
- * stream. Only do this in debug builds as this implies a
- * delay */
-#define fprintf fz_android_fprintf
-#endif
-#endif
-
-/* inline is standard in C++. For some compilers we can enable it within C too. */
-
-#ifndef __cplusplus
-#if __STDC_VERSION__ == 199901L /* C99 */
-#elif _MSC_VER >= 1500 /* MSVC 9 or newer */
-#define inline __inline
-#elif __GNUC__ >= 3 /* GCC 3 or newer */
-#define inline __inline
-#else /* Unknown or ancient */
-#define inline
-#endif
-#endif
-
-/* restrict is standard in C99, but not in all C++ compilers. */
-#if __STDC_VERSION__ == 199901L /* C99 */
-#elif _MSC_VER >= 1500 /* MSVC 9 or newer */
-#define restrict __restrict
-#elif __GNUC__ >= 3 /* GCC 3 or newer */
-#define restrict __restrict
-#else /* Unknown or ancient */
-#define restrict
-#endif
-
-/* noreturn is a GCC extension */
-#ifdef __GNUC__
-#define FZ_NORETURN __attribute__((noreturn))
-#else
-#ifdef _MSC_VER
-#define FZ_NORETURN __declspec(noreturn)
-#else
-#define FZ_NORETURN
-#endif
-#endif
-
-/* Flag unused parameters, for use with 'static inline' functions in headers. */
-#if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7
-#define FZ_UNUSED __attribute__((__unused__))
-#else
-#define FZ_UNUSED
-#endif
-
-/* GCC can do type checking of printf strings */
-#ifndef __printflike
-#if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7
-#define __printflike(fmtarg, firstvararg) \
-	__attribute__((__format__ (__printf__, fmtarg, firstvararg)))
-#else
-#define __printflike(fmtarg, firstvararg)
-#endif
-#endif
-
-/* ARM assembly specific defines */
-
-#ifdef ARCH_ARM
-#ifdef NDK_PROFILER
-extern void __gnu_mcount_nc(void);
-#define ENTER_PG "push {lr}\nbl __gnu_mcount_nc\n"
-#else
-#define ENTER_PG
-#endif
-
-/* If we're compiling as thumb code, then we need to tell the compiler
- * to enter and exit ARM mode around our assembly sections. If we move
- * the ARM functions to a separate file and arrange for it to be compiled
- * without thumb mode, we can save some time on entry.
- */
-/* This is slightly suboptimal; __thumb__ and __thumb2__ become defined
- * and undefined by #pragma arm/#pragma thumb - but we can't define a
- * macro to track that. */
-#if defined(__thumb__) || defined(__thumb2__)
-#define ENTER_ARM ".balign 4\nmov r12,pc\nbx r12\n0:.arm\n" ENTER_PG
-#define ENTER_THUMB "9:.thumb\n" ENTER_PG
-#else
-#define ENTER_ARM
-#define ENTER_THUMB
-#endif
-#endif
-
-#ifdef CLUSTER
-#define LOCAL_TRIG_FNS
-#endif
-
-#ifdef LOCAL_TRIG_FNS
-/*
- * Trig functions
- */
-static float
-my_atan_table[258] =
-{
-0.0000000000f, 0.00390623013f,0.00781234106f,0.0117182136f,
-0.0156237286f, 0.0195287670f, 0.0234332099f, 0.0273369383f,
-0.0312398334f, 0.0351417768f, 0.0390426500f, 0.0429423347f,
-0.0468407129f, 0.0507376669f, 0.0546330792f, 0.0585268326f,
-0.0624188100f, 0.0663088949f, 0.0701969711f, 0.0740829225f,
-0.0779666338f, 0.0818479898f, 0.0857268758f, 0.0896031775f,
-0.0934767812f, 0.0973475735f, 0.1012154420f, 0.1050802730f,
-0.1089419570f, 0.1128003810f, 0.1166554350f, 0.1205070100f,
-0.1243549950f, 0.1281992810f, 0.1320397620f, 0.1358763280f,
-0.1397088740f, 0.1435372940f, 0.1473614810f, 0.1511813320f,
-0.1549967420f, 0.1588076080f, 0.1626138290f, 0.1664153010f,
-0.1702119250f, 0.1740036010f, 0.1777902290f, 0.1815717110f,
-0.1853479500f, 0.1891188490f, 0.1928843120f, 0.1966442450f,
-0.2003985540f, 0.2041471450f, 0.2078899270f, 0.2116268090f,
-0.2153577000f, 0.2190825110f, 0.2228011540f, 0.2265135410f,
-0.2302195870f, 0.2339192060f, 0.2376123140f, 0.2412988270f,
-0.2449786630f, 0.2486517410f, 0.2523179810f, 0.2559773030f,
-0.2596296290f, 0.2632748830f, 0.2669129880f, 0.2705438680f,
-0.2741674510f, 0.2777836630f, 0.2813924330f, 0.2849936890f,
-0.2885873620f, 0.2921733830f, 0.2957516860f, 0.2993222020f,
-0.3028848680f, 0.3064396190f, 0.3099863910f, 0.3135251230f,
-0.3170557530f, 0.3205782220f, 0.3240924700f, 0.3275984410f,
-0.3310960770f, 0.3345853220f, 0.3380661230f, 0.3415384250f,
-0.3450021770f, 0.3484573270f, 0.3519038250f, 0.3553416220f,
-0.3587706700f, 0.3621909220f, 0.3656023320f, 0.3690048540f,
-0.3723984470f, 0.3757830650f, 0.3791586690f, 0.3825252170f,
-0.3858826690f, 0.3892309880f, 0.3925701350f, 0.3959000740f,
-0.3992207700f, 0.4025321870f, 0.4058342930f, 0.4091270550f,
-0.4124104420f, 0.4156844220f, 0.4189489670f, 0.4222040480f,
-0.4254496370f, 0.4286857080f, 0.4319122350f, 0.4351291940f,
-0.4383365600f, 0.4415343100f, 0.4447224240f, 0.4479008790f,
-0.4510696560f, 0.4542287350f, 0.4573780990f, 0.4605177290f,
-0.4636476090f, 0.4667677240f, 0.4698780580f, 0.4729785980f,
-0.4760693300f, 0.4791502430f, 0.4822213240f, 0.4852825630f,
-0.4883339510f, 0.4913754780f, 0.4944071350f, 0.4974289160f,
-0.5004408130f, 0.5034428210f, 0.5064349340f, 0.5094171490f,
-0.5123894600f, 0.5153518660f, 0.5183043630f, 0.5212469510f,
-0.5241796290f, 0.5271023950f, 0.5300152510f, 0.5329181980f,
-0.5358112380f, 0.5386943730f, 0.5415676050f, 0.5444309400f,
-0.5472843810f, 0.5501279330f, 0.5529616020f, 0.5557853940f,
-0.5585993150f, 0.5614033740f, 0.5641975770f, 0.5669819340f,
-0.5697564530f, 0.5725211450f, 0.5752760180f, 0.5780210840f,
-0.5807563530f, 0.5834818390f, 0.5861975510f, 0.5889035040f,
-0.5915997100f, 0.5942861830f, 0.5969629370f, 0.5996299860f,
-0.6022873460f, 0.6049350310f, 0.6075730580f, 0.6102014430f,
-0.6128202020f, 0.6154293530f, 0.6180289120f, 0.6206188990f,
-0.6231993300f, 0.6257702250f, 0.6283316020f, 0.6308834820f,
-0.6334258830f, 0.6359588250f, 0.6384823300f, 0.6409964180f,
-0.6435011090f, 0.6459964250f, 0.6484823880f, 0.6509590190f,
-0.6534263410f, 0.6558843770f, 0.6583331480f, 0.6607726790f,
-0.6632029930f, 0.6656241120f, 0.6680360620f, 0.6704388650f,
-0.6728325470f, 0.6752171330f, 0.6775926450f, 0.6799591110f,
-0.6823165550f, 0.6846650020f, 0.6870044780f, 0.6893350100f,
-0.6916566220f, 0.6939693410f, 0.6962731940f, 0.6985682070f,
-0.7008544080f, 0.7031318220f, 0.7054004770f, 0.7076604000f,
-0.7099116190f, 0.7121541600f, 0.7143880520f, 0.7166133230f,
-0.7188300000f, 0.7210381110f, 0.7232376840f, 0.7254287490f,
-0.7276113330f, 0.7297854640f, 0.7319511710f, 0.7341084830f,
-0.7362574290f, 0.7383980370f, 0.7405303370f, 0.7426543560f,
-0.7447701260f, 0.7468776740f, 0.7489770290f, 0.7510682220f,
-0.7531512810f, 0.7552262360f, 0.7572931160f, 0.7593519510f,
-0.7614027700f, 0.7634456020f, 0.7654804790f, 0.7675074280f,
-0.7695264800f, 0.7715376650f, 0.7735410110f, 0.7755365500f,
-0.7775243100f, 0.7795043220f, 0.7814766150f, 0.7834412190f,
-0.7853981630f, 0.7853981630f /* Extended by 1 for interpolation */
-};
-
-static inline float my_sinf(float x)
-{
-	float x2, xn;
-	int i;
-	/* Map x into the -PI to PI range. We could do this using:
-	 * x = fmodf(x, (float)(2.0 * M_PI));
-	 * but that's C99, and seems to misbehave with negative numbers
-	 * on some platforms. */
-	x -= (float)M_PI;
-	i = x / (float)(2.0f * M_PI);
-	x -= i * (float)(2.0f * M_PI);
-	if (x < 0.0f)
-		x += (float)(2.0f * M_PI);
-	x -= (float)M_PI;
-	if (x <= (float)(-M_PI/2.0))
-		x = -(float)M_PI-x;
-	else if (x >= (float)(M_PI/2.0))
-		x = (float)M_PI-x;
-	x2 = x*x;
-	xn = x*x2/6.0f;
-	x -= xn;
-	xn *= x2/20.0f;
-	x += xn;
-	xn *= x2/42.0f;
-	x -= xn;
-	xn *= x2/72.0f;
-	x += xn;
-	return x;
-}
-
-static inline float my_atan2f(float o, float a)
-{
-	int negate = 0, flip = 0, i;
-	float r, s;
-	if (o == 0.0f)
-	{
-		if (a > 0)
-			return 0.0f;
-		else
-			return (float)M_PI;
-	}
-	if (o < 0)
-		o = -o, negate = 1;
-	if (a < 0)
-		a = -a, flip = 1;
-	if (o < a)
-		i = (int)(65536.0f*o/a + 0.5f);
-	else
-		i = (int)(65536.0f*a/o + 0.5f);
-	r = my_atan_table[i>>8];
-	s = my_atan_table[(i>>8)+1];
-	r += (s-r)*(i&255)/256.0f;
-	if (o >= a)
-		r = (float)(M_PI/2.0f) - r;
-	if (flip)
-		r = (float)M_PI - r;
-	if (negate)
-		r = -r;
-	return r;
-}
-
-#define sinf(x) my_sinf(x)
-#define cosf(x) my_sinf(((float)(M_PI/2.0f)) + (x))
-#define atan2f(x,y) my_atan2f((x),(y))
-#endif
-
-int fz_strcasecmp(const char *a, const char *b);
-
-#endif

+ 0 - 189
server/lib/xfdftool/include/mupdf/fitz/text.h

@@ -1,189 +0,0 @@
-#ifndef MUPDF_FITZ_TEXT_H
-#define MUPDF_FITZ_TEXT_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/font.h"
-#include "mupdf/fitz/path.h"
-#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.
-*/
-
-typedef struct fz_text_s fz_text;
-typedef struct fz_text_span_s fz_text_span;
-typedef struct fz_text_item_s fz_text_item;
-
-struct fz_text_item_s
-{
-	float x, y;
-	int gid; /* -1 for one gid to many ucs mappings */
-	int ucs; /* -1 for one ucs to many gid mappings */
-};
-
-#define FZ_LANG_TAG2(c1,c2) ((c1-'a'+1) + ((c2-'a'+1)*27))
-#define FZ_LANG_TAG3(c1,c2,c3) ((c1-'a'+1) + ((c2-'a'+1)*27) + ((c3-'a'+1)*27*27))
-
-typedef enum fz_text_language_e
-{
-	FZ_LANG_UNSET = 0,
-	FZ_LANG_ur = FZ_LANG_TAG2('u','r'),
-	FZ_LANG_urd = FZ_LANG_TAG3('u','r','d'),
-	FZ_LANG_ko = FZ_LANG_TAG2('k','o'),
-	FZ_LANG_ja = FZ_LANG_TAG2('j','a'),
-	FZ_LANG_zh = FZ_LANG_TAG2('z','h'),
-	FZ_LANG_zh_Hans = FZ_LANG_TAG3('z','h','s'),
-	FZ_LANG_zh_Hant = FZ_LANG_TAG3('z','h','t'),
-} fz_text_language;
-
-struct fz_text_span_s
-{
-	fz_font *font;
-	fz_matrix trm;
-	unsigned wmode : 1;		/* 0 horizontal, 1 vertical */
-	unsigned bidi_level : 7;	/* The bidirectional level of text */
-	unsigned markup_dir : 2;	/* The direction of text as marked in the original document */
-	unsigned language : 15;		/* The language as marked in the original document */
-	int len, cap;
-	fz_text_item *items;
-	fz_text_span *next;
-};
-
-struct fz_text_s
-{
-	int refs;
-	fz_text_span *head, *tail;
-};
-
-/*
-	fz_new_text: Create a new empty fz_text object.
-
-	Throws exception on failure to allocate.
-*/
-fz_text *fz_new_text(fz_context *ctx);
-
-/*
-	fz_keep_text: Add a reference to a fz_text.
-
-	text: text object to keep a reference to.
-
-	Return the same text pointer.
-*/
-fz_text *fz_keep_text(fz_context *ctx, const fz_text *text);
-
-/*
-	fz_drop_text: Drop a reference to the object, freeing
-	if it is the last one.
-
-	text: Object to drop the reference to.
-*/
-void fz_drop_text(fz_context *ctx, const fz_text *text);
-
-/*
-	fz_show_glyph: Add a glyph/unicode value to a text object.
-
-	text: Text object to add to.
-
-	font: The font the glyph should be added in.
-
-	trm: The transform to use for the glyph.
-
-	glyph: The glyph id to add.
-
-	unicode: The unicode character for the glyph.
-
-	wmode: 1 for vertical mode, 0 for horizontal.
-
-	bidi_level: The bidirectional level for this glyph.
-
-	markup_dir: The direction of the text as specified in the
-	markup.
-
-	language: The language in use (if known, 0 otherwise)
-	(e.g. FZ_LANG_zh_Hans).
-
-	Throws exception on failure to allocate.
-*/
-void fz_show_glyph(fz_context *ctx, fz_text *text, fz_font *font, const fz_matrix *trm, int glyph, int unicode, int wmode, int bidi_level, fz_bidi_direction markup_dir, fz_text_language language);
-
-/*
-	fz_show_string: Add a UTF8 string to a text object.
-
-	text: Text object to add to.
-
-	font: The font the string should be added in.
-
-	trm: The transform to use. Will be updated according
-	to the advance of the string on exit.
-
-	s: The utf-8 string to add.
-
-	wmode: 1 for vertical mode, 0 for horizontal.
-
-	bidi_level: The bidirectional level for this glyph.
-
-	markup_dir: The direction of the text as specified in the
-	markup.
-
-	language: The language in use (if known, 0 otherwise)
-	(e.g. FZ_LANG_zh_Hans).
-
-	Throws exception on failure to allocate.
-*/
-void fz_show_string(fz_context *ctx, fz_text *text, fz_font *font, fz_matrix *trm, const char *s, int wmode, int bidi_level, fz_bidi_direction markup_dir, fz_text_language language);
-
-/*
-	fz_bound_text: Find the bounds of a given text object.
-
-	text: The text object to find the bounds of.
-
-	stroke: Pointer to the stroke attributes (for stroked
-	text), or NULL (for filled text).
-
-	ctm: The matrix in use.
-
-	r: pointer to storage for the bounds.
-
-	Returns a pointer to r, which is updated to contain the
-	bounding box for the text object.
-*/
-fz_rect *fz_bound_text(fz_context *ctx, const fz_text *text, const fz_stroke_state *stroke, const fz_matrix *ctm, fz_rect *r);
-
-/*
-	fz_clone_text: Clone a text object.
-
-	text: The text object to clone.
-
-	Throws an exception on allocation failure.
-*/
-fz_text *fz_clone_text(fz_context *ctx, const fz_text *text);
-
-/*
-	Convert ISO 639 (639-{1,2,3,5}) language specification
-	strings losslessly to a 15 bit fz_text_language code.
-
-	No validation is carried out. Obviously invalid (out
-	of spec) codes will be mapped to FZ_LANG_UNSET, but
-	well-formed (but undefined) codes will be blithely
-	accepted.
-*/
-fz_text_language fz_text_language_from_string(const char *str);
-
-/*
-	Recover ISO 639 (639-{1,2,3,5}) language specification
-	strings losslessly from a 15 bit fz_text_language code.
-
-	No validation is carried out. See note above.
-*/
-char *fz_string_from_text_language(char str[8], fz_text_language lang);
-
-#endif

+ 0 - 35
server/lib/xfdftool/include/mupdf/fitz/track-usage.h

@@ -1,35 +0,0 @@
-#ifndef TRACK_USAGE_H
-#define TRACK_USAGE_H
-
-#ifdef TRACK_USAGE
-
-typedef struct track_usage_data_s {
-	int count;
-	const char *function;
-	int line;
-	const char *desc;
-	struct track_usage_data_s *next;
-} track_usage_data_t;
-
-#define TRACK_LABEL(A) \
-	do { \
-		static track_usage_data_t USAGE_DATA = { 0 };\
-		track_usage(&USAGE_DATA, __FILE__, __LINE__, A);\
-	} while (0)
-
-#define TRACK_FN() \
-	do { \
-		static track_usage_data_t USAGE_DATA = { 0 };\
-		track_usage(&USAGE_DATA, __FILE__, __LINE__, __FUNCTION__);\
-	} while (0)
-
-void track_usage(track_usage_data_t *data, const char *function, int line, const char *desc);
-
-#else
-
-#define TRACK_LABEL(A) do { } while (0)
-#define TRACK_FN() do { } while (0)
-
-#endif
-
-#endif

+ 0 - 54
server/lib/xfdftool/include/mupdf/fitz/transition.h

@@ -1,54 +0,0 @@
-#ifndef MUPDF_FITZ_TRANSITION_H
-#define MUPDF_FITZ_TRANSITION_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/pixmap.h"
-
-/* Transition support */
-typedef struct fz_transition_s fz_transition;
-
-enum {
-	FZ_TRANSITION_NONE = 0, /* aka 'R' or 'REPLACE' */
-	FZ_TRANSITION_SPLIT,
-	FZ_TRANSITION_BLINDS,
-	FZ_TRANSITION_BOX,
-	FZ_TRANSITION_WIPE,
-	FZ_TRANSITION_DISSOLVE,
-	FZ_TRANSITION_GLITTER,
-	FZ_TRANSITION_FLY,
-	FZ_TRANSITION_PUSH,
-	FZ_TRANSITION_COVER,
-	FZ_TRANSITION_UNCOVER,
-	FZ_TRANSITION_FADE
-};
-
-struct fz_transition_s
-{
-	int type;
-	float duration; /* Effect duration (seconds) */
-
-	/* Parameters controlling the effect */
-	int vertical; /* 0 or 1 */
-	int outwards; /* 0 or 1 */
-	int direction; /* Degrees */
-	/* Potentially more to come */
-
-	/* State variables for use of the transition code */
-	int state0;
-	int state1;
-};
-
-/*
-	fz_generate_transition: Generate a frame of a transition.
-
-	tpix: Target pixmap
-	opix: Old pixmap
-	npix: New pixmap
-	time: Position within the transition (0 to 256)
-	trans: Transition details
-
-	Returns 1 if successfully generated a frame.
-*/
-int fz_generate_transition(fz_context *ctx, fz_pixmap *tpix, fz_pixmap *opix, fz_pixmap *npix, int time, fz_transition *trans);
-
-#endif

+ 0 - 26
server/lib/xfdftool/include/mupdf/fitz/tree.h

@@ -1,26 +0,0 @@
-#ifndef MUPDF_FITZ_TREE_H
-#define MUPDF_FITZ_TREE_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-
-/*
-	AA-tree to look up things by strings.
-*/
-
-typedef struct fz_tree_s fz_tree;
-
-void *fz_tree_lookup(fz_context *ctx, fz_tree *node, const char *key);
-
-/*
-	Insert a new key/value pair and rebalance the tree.
-	Return the new root of the tree after inserting and rebalancing.
-	May be called with a NULL root to create a new tree.
-*/
-fz_tree *fz_tree_insert(fz_context *ctx, fz_tree *root, const char *key, void *value);
-
-void fz_drop_tree(fz_context *ctx, fz_tree *node, void (*dropfunc)(fz_context *ctx, void *value));
-
-void fz_debug_tree(fz_context *ctx, fz_tree *root);
-
-#endif

+ 0 - 421
server/lib/xfdftool/include/mupdf/fitz/ucdn.h

@@ -1,421 +0,0 @@
-/*
- * Copyright (C) 2012 Grigori Goronzy <greg@kinoho.net>
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef UCDN_H
-#define UCDN_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define UCDN_EAST_ASIAN_F 0
-#define UCDN_EAST_ASIAN_H 1
-#define UCDN_EAST_ASIAN_W 2
-#define UCDN_EAST_ASIAN_NA 3
-#define UCDN_EAST_ASIAN_A 4
-#define UCDN_EAST_ASIAN_N 5
-
-#define UCDN_SCRIPT_COMMON 0
-#define UCDN_SCRIPT_LATIN 1
-#define UCDN_SCRIPT_GREEK 2
-#define UCDN_SCRIPT_CYRILLIC 3
-#define UCDN_SCRIPT_ARMENIAN 4
-#define UCDN_SCRIPT_HEBREW 5
-#define UCDN_SCRIPT_ARABIC 6
-#define UCDN_SCRIPT_SYRIAC 7
-#define UCDN_SCRIPT_THAANA 8
-#define UCDN_SCRIPT_DEVANAGARI 9
-#define UCDN_SCRIPT_BENGALI 10
-#define UCDN_SCRIPT_GURMUKHI 11
-#define UCDN_SCRIPT_GUJARATI 12
-#define UCDN_SCRIPT_ORIYA 13
-#define UCDN_SCRIPT_TAMIL 14
-#define UCDN_SCRIPT_TELUGU 15
-#define UCDN_SCRIPT_KANNADA 16
-#define UCDN_SCRIPT_MALAYALAM 17
-#define UCDN_SCRIPT_SINHALA 18
-#define UCDN_SCRIPT_THAI 19
-#define UCDN_SCRIPT_LAO 20
-#define UCDN_SCRIPT_TIBETAN 21
-#define UCDN_SCRIPT_MYANMAR 22
-#define UCDN_SCRIPT_GEORGIAN 23
-#define UCDN_SCRIPT_HANGUL 24
-#define UCDN_SCRIPT_ETHIOPIC 25
-#define UCDN_SCRIPT_CHEROKEE 26
-#define UCDN_SCRIPT_CANADIAN_ABORIGINAL 27
-#define UCDN_SCRIPT_OGHAM 28
-#define UCDN_SCRIPT_RUNIC 29
-#define UCDN_SCRIPT_KHMER 30
-#define UCDN_SCRIPT_MONGOLIAN 31
-#define UCDN_SCRIPT_HIRAGANA 32
-#define UCDN_SCRIPT_KATAKANA 33
-#define UCDN_SCRIPT_BOPOMOFO 34
-#define UCDN_SCRIPT_HAN 35
-#define UCDN_SCRIPT_YI 36
-#define UCDN_SCRIPT_OLD_ITALIC 37
-#define UCDN_SCRIPT_GOTHIC 38
-#define UCDN_SCRIPT_DESERET 39
-#define UCDN_SCRIPT_INHERITED 40
-#define UCDN_SCRIPT_TAGALOG 41
-#define UCDN_SCRIPT_HANUNOO 42
-#define UCDN_SCRIPT_BUHID 43
-#define UCDN_SCRIPT_TAGBANWA 44
-#define UCDN_SCRIPT_LIMBU 45
-#define UCDN_SCRIPT_TAI_LE 46
-#define UCDN_SCRIPT_LINEAR_B 47
-#define UCDN_SCRIPT_UGARITIC 48
-#define UCDN_SCRIPT_SHAVIAN 49
-#define UCDN_SCRIPT_OSMANYA 50
-#define UCDN_SCRIPT_CYPRIOT 51
-#define UCDN_SCRIPT_BRAILLE 52
-#define UCDN_SCRIPT_BUGINESE 53
-#define UCDN_SCRIPT_COPTIC 54
-#define UCDN_SCRIPT_NEW_TAI_LUE 55
-#define UCDN_SCRIPT_GLAGOLITIC 56
-#define UCDN_SCRIPT_TIFINAGH 57
-#define UCDN_SCRIPT_SYLOTI_NAGRI 58
-#define UCDN_SCRIPT_OLD_PERSIAN 59
-#define UCDN_SCRIPT_KHAROSHTHI 60
-#define UCDN_SCRIPT_BALINESE 61
-#define UCDN_SCRIPT_CUNEIFORM 62
-#define UCDN_SCRIPT_PHOENICIAN 63
-#define UCDN_SCRIPT_PHAGS_PA 64
-#define UCDN_SCRIPT_NKO 65
-#define UCDN_SCRIPT_SUNDANESE 66
-#define UCDN_SCRIPT_LEPCHA 67
-#define UCDN_SCRIPT_OL_CHIKI 68
-#define UCDN_SCRIPT_VAI 69
-#define UCDN_SCRIPT_SAURASHTRA 70
-#define UCDN_SCRIPT_KAYAH_LI 71
-#define UCDN_SCRIPT_REJANG 72
-#define UCDN_SCRIPT_LYCIAN 73
-#define UCDN_SCRIPT_CARIAN 74
-#define UCDN_SCRIPT_LYDIAN 75
-#define UCDN_SCRIPT_CHAM 76
-#define UCDN_SCRIPT_TAI_THAM 77
-#define UCDN_SCRIPT_TAI_VIET 78
-#define UCDN_SCRIPT_AVESTAN 79
-#define UCDN_SCRIPT_EGYPTIAN_HIEROGLYPHS 80
-#define UCDN_SCRIPT_SAMARITAN 81
-#define UCDN_SCRIPT_LISU 82
-#define UCDN_SCRIPT_BAMUM 83
-#define UCDN_SCRIPT_JAVANESE 84
-#define UCDN_SCRIPT_MEETEI_MAYEK 85
-#define UCDN_SCRIPT_IMPERIAL_ARAMAIC 86
-#define UCDN_SCRIPT_OLD_SOUTH_ARABIAN 87
-#define UCDN_SCRIPT_INSCRIPTIONAL_PARTHIAN 88
-#define UCDN_SCRIPT_INSCRIPTIONAL_PAHLAVI 89
-#define UCDN_SCRIPT_OLD_TURKIC 90
-#define UCDN_SCRIPT_KAITHI 91
-#define UCDN_SCRIPT_BATAK 92
-#define UCDN_SCRIPT_BRAHMI 93
-#define UCDN_SCRIPT_MANDAIC 94
-#define UCDN_SCRIPT_CHAKMA 95
-#define UCDN_SCRIPT_MEROITIC_CURSIVE 96
-#define UCDN_SCRIPT_MEROITIC_HIEROGLYPHS 97
-#define UCDN_SCRIPT_MIAO 98
-#define UCDN_SCRIPT_SHARADA 99
-#define UCDN_SCRIPT_SORA_SOMPENG 100
-#define UCDN_SCRIPT_TAKRI 101
-#define UCDN_SCRIPT_UNKNOWN 102
-#define UCDN_SCRIPT_BASSA_VAH 103
-#define UCDN_SCRIPT_CAUCASIAN_ALBANIAN 104
-#define UCDN_SCRIPT_DUPLOYAN 105
-#define UCDN_SCRIPT_ELBASAN 106
-#define UCDN_SCRIPT_GRANTHA 107
-#define UCDN_SCRIPT_KHOJKI 108
-#define UCDN_SCRIPT_KHUDAWADI 109
-#define UCDN_SCRIPT_LINEAR_A 110
-#define UCDN_SCRIPT_MAHAJANI 111
-#define UCDN_SCRIPT_MANICHAEAN 112
-#define UCDN_SCRIPT_MENDE_KIKAKUI 113
-#define UCDN_SCRIPT_MODI 114
-#define UCDN_SCRIPT_MRO 115
-#define UCDN_SCRIPT_NABATAEAN 116
-#define UCDN_SCRIPT_OLD_NORTH_ARABIAN 117
-#define UCDN_SCRIPT_OLD_PERMIC 118
-#define UCDN_SCRIPT_PAHAWH_HMONG 119
-#define UCDN_SCRIPT_PALMYRENE 120
-#define UCDN_SCRIPT_PAU_CIN_HAU 121
-#define UCDN_SCRIPT_PSALTER_PAHLAVI 122
-#define UCDN_SCRIPT_SIDDHAM 123
-#define UCDN_SCRIPT_TIRHUTA 124
-#define UCDN_SCRIPT_WARANG_CITI 125
-#define UCDN_SCRIPT_AHOM 126
-#define UCDN_SCRIPT_ANATOLIAN_HIEROGLYPHS 127
-#define UCDN_SCRIPT_HATRAN 128
-#define UCDN_SCRIPT_MULTANI 129
-#define UCDN_SCRIPT_OLD_HUNGARIAN 130
-#define UCDN_SCRIPT_SIGNWRITING 131
-#define UCDN_SCRIPT_ADLAM 132
-#define UCDN_SCRIPT_BHAIKSUKI 133
-#define UCDN_SCRIPT_MARCHEN 134
-#define UCDN_SCRIPT_NEWA 135
-#define UCDN_SCRIPT_OSAGE 136
-#define UCDN_SCRIPT_TANGUT 137
-#define UCDN_LAST_SCRIPT 137
-
-#define UCDN_LINEBREAK_CLASS_OP 0
-#define UCDN_LINEBREAK_CLASS_CL 1
-#define UCDN_LINEBREAK_CLASS_CP 2
-#define UCDN_LINEBREAK_CLASS_QU 3
-#define UCDN_LINEBREAK_CLASS_GL 4
-#define UCDN_LINEBREAK_CLASS_NS 5
-#define UCDN_LINEBREAK_CLASS_EX 6
-#define UCDN_LINEBREAK_CLASS_SY 7
-#define UCDN_LINEBREAK_CLASS_IS 8
-#define UCDN_LINEBREAK_CLASS_PR 9
-#define UCDN_LINEBREAK_CLASS_PO 10
-#define UCDN_LINEBREAK_CLASS_NU 11
-#define UCDN_LINEBREAK_CLASS_AL 12
-#define UCDN_LINEBREAK_CLASS_HL 13
-#define UCDN_LINEBREAK_CLASS_ID 14
-#define UCDN_LINEBREAK_CLASS_IN 15
-#define UCDN_LINEBREAK_CLASS_HY 16
-#define UCDN_LINEBREAK_CLASS_BA 17
-#define UCDN_LINEBREAK_CLASS_BB 18
-#define UCDN_LINEBREAK_CLASS_B2 19
-#define UCDN_LINEBREAK_CLASS_ZW 20
-#define UCDN_LINEBREAK_CLASS_CM 21
-#define UCDN_LINEBREAK_CLASS_WJ 22
-#define UCDN_LINEBREAK_CLASS_H2 23
-#define UCDN_LINEBREAK_CLASS_H3 24
-#define UCDN_LINEBREAK_CLASS_JL 25
-#define UCDN_LINEBREAK_CLASS_JV 26
-#define UCDN_LINEBREAK_CLASS_JT 27
-#define UCDN_LINEBREAK_CLASS_RI 28
-#define UCDN_LINEBREAK_CLASS_AI 29
-#define UCDN_LINEBREAK_CLASS_BK 30
-#define UCDN_LINEBREAK_CLASS_CB 31
-#define UCDN_LINEBREAK_CLASS_CJ 32
-#define UCDN_LINEBREAK_CLASS_CR 33
-#define UCDN_LINEBREAK_CLASS_LF 34
-#define UCDN_LINEBREAK_CLASS_NL 35
-#define UCDN_LINEBREAK_CLASS_SA 36
-#define UCDN_LINEBREAK_CLASS_SG 37
-#define UCDN_LINEBREAK_CLASS_SP 38
-#define UCDN_LINEBREAK_CLASS_XX 39
-
-#define UCDN_GENERAL_CATEGORY_CC 0
-#define UCDN_GENERAL_CATEGORY_CF 1
-#define UCDN_GENERAL_CATEGORY_CN 2
-#define UCDN_GENERAL_CATEGORY_CO 3
-#define UCDN_GENERAL_CATEGORY_CS 4
-#define UCDN_GENERAL_CATEGORY_LL 5
-#define UCDN_GENERAL_CATEGORY_LM 6
-#define UCDN_GENERAL_CATEGORY_LO 7
-#define UCDN_GENERAL_CATEGORY_LT 8
-#define UCDN_GENERAL_CATEGORY_LU 9
-#define UCDN_GENERAL_CATEGORY_MC 10
-#define UCDN_GENERAL_CATEGORY_ME 11
-#define UCDN_GENERAL_CATEGORY_MN 12
-#define UCDN_GENERAL_CATEGORY_ND 13
-#define UCDN_GENERAL_CATEGORY_NL 14
-#define UCDN_GENERAL_CATEGORY_NO 15
-#define UCDN_GENERAL_CATEGORY_PC 16
-#define UCDN_GENERAL_CATEGORY_PD 17
-#define UCDN_GENERAL_CATEGORY_PE 18
-#define UCDN_GENERAL_CATEGORY_PF 19
-#define UCDN_GENERAL_CATEGORY_PI 20
-#define UCDN_GENERAL_CATEGORY_PO 21
-#define UCDN_GENERAL_CATEGORY_PS 22
-#define UCDN_GENERAL_CATEGORY_SC 23
-#define UCDN_GENERAL_CATEGORY_SK 24
-#define UCDN_GENERAL_CATEGORY_SM 25
-#define UCDN_GENERAL_CATEGORY_SO 26
-#define UCDN_GENERAL_CATEGORY_ZL 27
-#define UCDN_GENERAL_CATEGORY_ZP 28
-#define UCDN_GENERAL_CATEGORY_ZS 29
-
-#define UCDN_BIDI_CLASS_L 0
-#define UCDN_BIDI_CLASS_LRE 1
-#define UCDN_BIDI_CLASS_LRO 2
-#define UCDN_BIDI_CLASS_R 3
-#define UCDN_BIDI_CLASS_AL 4
-#define UCDN_BIDI_CLASS_RLE 5
-#define UCDN_BIDI_CLASS_RLO 6
-#define UCDN_BIDI_CLASS_PDF 7
-#define UCDN_BIDI_CLASS_EN 8
-#define UCDN_BIDI_CLASS_ES 9
-#define UCDN_BIDI_CLASS_ET 10
-#define UCDN_BIDI_CLASS_AN 11
-#define UCDN_BIDI_CLASS_CS 12
-#define UCDN_BIDI_CLASS_NSM 13
-#define UCDN_BIDI_CLASS_BN 14
-#define UCDN_BIDI_CLASS_B 15
-#define UCDN_BIDI_CLASS_S 16
-#define UCDN_BIDI_CLASS_WS 17
-#define UCDN_BIDI_CLASS_ON 18
-#define UCDN_BIDI_CLASS_LRI 19
-#define UCDN_BIDI_CLASS_RLI 20
-#define UCDN_BIDI_CLASS_FSI 21
-#define UCDN_BIDI_CLASS_PDI 22
-
-#define UCDN_BIDI_PAIRED_BRACKET_TYPE_OPEN 0
-#define UCDN_BIDI_PAIRED_BRACKET_TYPE_CLOSE 1
-#define UCDN_BIDI_PAIRED_BRACKET_TYPE_NONE 2
-
-/**
- * Return version of the Unicode database.
- *
- * @return Unicode database version
- */
-const char *ucdn_get_unicode_version(void);
-
-/**
- * Get combining class of a codepoint.
- *
- * @param code Unicode codepoint
- * @return combining class value, as defined in UAX#44
- */
-int ucdn_get_combining_class(uint32_t code);
-
-/**
- * Get east-asian width of a codepoint.
- *
- * @param code Unicode codepoint
- * @return value according to UCDN_EAST_ASIAN_* and as defined in UAX#11.
- */
-int ucdn_get_east_asian_width(uint32_t code);
-
-/**
- * Get general category of a codepoint.
- *
- * @param code Unicode codepoint
- * @return value according to UCDN_GENERAL_CATEGORY_* and as defined in
- * UAX#44.
- */
-int ucdn_get_general_category(uint32_t code);
-
-/**
- * Get bidirectional class of a codepoint.
- *
- * @param code Unicode codepoint
- * @return value according to UCDN_BIDI_CLASS_* and as defined in UAX#44.
- */
-int ucdn_get_bidi_class(uint32_t code);
-
-/**
- * Get script of a codepoint.
- *
- * @param code Unicode codepoint
- * @return value according to UCDN_SCRIPT_* and as defined in UAX#24.
- */
-int ucdn_get_script(uint32_t code);
-
-/**
- * Get unresolved linebreak class of a codepoint. This does not take
- * rule LB1 of UAX#14 into account. See ucdn_get_resolved_linebreak_class()
- * for resolved linebreak classes.
- *
- * @param code Unicode codepoint
- * @return value according to UCDN_LINEBREAK_* and as defined in UAX#14.
- */
-int ucdn_get_linebreak_class(uint32_t code);
-
-/**
- * Get resolved linebreak class of a codepoint. This resolves characters
- * in the AI, SG, XX, SA and CJ classes according to rule LB1 of UAX#14.
- * In addition the CB class is resolved as the equivalent B2 class and
- * the NL class is resolved as the equivalent BK class.
- *
- * @param code Unicode codepoint
- * @return value according to UCDN_LINEBREAK_* and as defined in UAX#14.
- */
-int ucdn_get_resolved_linebreak_class(uint32_t code);
-
-/**
- * Check if codepoint can be mirrored.
- *
- * @param code Unicode codepoint
- * @return 1 if mirrored character exists, otherwise 0
- */
-int ucdn_get_mirrored(uint32_t code);
-
-/**
- * Mirror a codepoint.
- *
- * @param code Unicode codepoint
- * @return mirrored codepoint or the original codepoint if no
- * mirrored character exists
- */
-uint32_t ucdn_mirror(uint32_t code);
-
-/**
- * Get paired bracket for a codepoint.
- *
- * @param code Unicode codepoint
- * @return paired bracket codepoint or the original codepoint if no
- * paired bracket character exists
- */
-uint32_t ucdn_paired_bracket(uint32_t code);
-
-/**
- * Get paired bracket type for a codepoint.
- *
- * @param code Unicode codepoint
- * @return value according to UCDN_BIDI_PAIRED_BRACKET_TYPE_* and as defined
- * in UAX#9.
- *
- */
-int ucdn_paired_bracket_type(uint32_t code);
-
-/**
- * Pairwise canonical decomposition of a codepoint. This includes
- * Hangul Jamo decomposition (see chapter 3.12 of the Unicode core
- * specification).
- *
- * Hangul is decomposed into L and V jamos for LV forms, and an
- * LV precomposed syllable and a T jamo for LVT forms.
- *
- * @param code Unicode codepoint
- * @param a filled with first codepoint of decomposition
- * @param b filled with second codepoint of decomposition, or 0
- * @return success
- */
-int ucdn_decompose(uint32_t code, uint32_t *a, uint32_t *b);
-
-/**
- * Compatibility decomposition of a codepoint.
- *
- * @param code Unicode codepoint
- * @param decomposed filled with decomposition, must be able to hold 18
- * characters
- * @return length of decomposition or 0 in case none exists
- */
-int ucdn_compat_decompose(uint32_t code, uint32_t *decomposed);
-
-/**
- * Pairwise canonical composition of two codepoints. This includes
- * Hangul Jamo composition (see chapter 3.12 of the Unicode core
- * specification).
- *
- * Hangul composition expects either L and V jamos, or an LV
- * precomposed syllable and a T jamo. This is exactly the inverse
- * of pairwise Hangul decomposition.
- *
- * @param code filled with composition
- * @param a first codepoint
- * @param b second codepoint
- * @return success
- */
-int ucdn_compose(uint32_t *code, uint32_t a, uint32_t b);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 64
server/lib/xfdftool/include/mupdf/fitz/util.h

@@ -1,64 +0,0 @@
-#ifndef MUPDF_FITZ_UTIL_H
-#define MUPDF_FITZ_UTIL_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/geometry.h"
-#include "mupdf/fitz/document.h"
-#include "mupdf/fitz/pixmap.h"
-#include "mupdf/fitz/structured-text.h"
-#include "mupdf/fitz/buffer.h"
-
-/*
-	fz_new_display_list_from_page: Create a display list with the contents of a page.
-*/
-fz_display_list *fz_new_display_list_from_page(fz_context *ctx, fz_page *page);
-fz_display_list *fz_new_display_list_from_page_number(fz_context *ctx, fz_document *doc, int number);
-fz_display_list *fz_new_display_list_from_page_contents(fz_context *ctx, fz_page *page);
-fz_display_list *fz_new_display_list_from_annot(fz_context *ctx, fz_annot *annot);
-
-/*
-	fz_new_pixmap_from_page: Render the page to a pixmap using the transform and colorspace.
-*/
-fz_pixmap *fz_new_pixmap_from_display_list(fz_context *ctx, fz_display_list *list, const fz_matrix *ctm, fz_colorspace *cs, int alpha);
-fz_pixmap *fz_new_pixmap_from_page(fz_context *ctx, fz_page *page, const fz_matrix *ctm, fz_colorspace *cs, int alpha);
-fz_pixmap *fz_new_pixmap_from_page_number(fz_context *ctx, fz_document *doc, int number, const fz_matrix *ctm, fz_colorspace *cs, int alpha);
-
-/*
-	fz_new_pixmap_from_page_contents: Render the page contents without annotations.
-*/
-fz_pixmap *fz_new_pixmap_from_page_contents(fz_context *ctx, fz_page *page, const fz_matrix *ctm, fz_colorspace *cs, int alpha);
-
-/*
-	fz_new_pixmap_from_annot: Render an annotation suitable for blending on top of the opaque
-	pixmap returned by fz_new_pixmap_from_page_contents.
-*/
-fz_pixmap *fz_new_pixmap_from_annot(fz_context *ctx, fz_annot *annot, const fz_matrix *ctm, fz_colorspace *cs, int alpha);
-
-/*
-	fz_new_stext_page_from_page: Extract structured text from a page. The sheet must not be NULL.
-*/
-fz_stext_page *fz_new_stext_page_from_page(fz_context *ctx, fz_page *page, fz_stext_sheet *sheet, const fz_stext_options *options);
-fz_stext_page *fz_new_stext_page_from_page_number(fz_context *ctx, fz_document *doc, int number, fz_stext_sheet *sheet, const fz_stext_options *options);
-fz_stext_page *fz_new_stext_page_from_display_list(fz_context *ctx, fz_display_list *list, fz_stext_sheet *sheet, const fz_stext_options *options);
-
-/*
-	fz_new_buffer_from_stext_page: Convert structured text into plain text, cropped by the selection rectangle.
-	Use fz_infinite_rect to extract all the text on the page. If 'crlf' is true, lines are separated by '\r\n',
-	otherwise '\n'.
-*/
-fz_buffer *fz_new_buffer_from_stext_page(fz_context *ctx, fz_stext_page *text, const fz_rect *sel, int crlf);
-fz_buffer *fz_new_buffer_from_page(fz_context *ctx, fz_page *page, const fz_rect *sel, int crlf, const fz_stext_options *options);
-fz_buffer *fz_new_buffer_from_page_number(fz_context *ctx, fz_document *doc, int number, const fz_rect *sel, int crlf, const fz_stext_options *options);
-fz_buffer *fz_new_buffer_from_display_list(fz_context *ctx, fz_display_list *list, const fz_rect *sel, int crlf, const fz_stext_options *options);
-
-/*
-	fz_search_page: Search for the 'needle' text on the page.
-	Record the hits in the hit_bbox array and return the number of hits.
-	Will stop looking once it has filled hit_max rectangles.
-*/
-int fz_search_page(fz_context *ctx, fz_page *page, const char *needle, fz_rect *hit_bbox, int hit_max);
-int fz_search_page_number(fz_context *ctx, fz_document *doc, int number, const char *needle, fz_rect *hit_bbox, int hit_max);
-int fz_search_display_list(fz_context *ctx, fz_display_list *list, const char *needle, fz_rect *hit_bbox, int hit_max);
-
-#endif

+ 0 - 6
server/lib/xfdftool/include/mupdf/fitz/version.h

@@ -1,6 +0,0 @@
-#ifndef MUPDF_FITZ_VERSION_H
-#define MUPDF_FITZ_VERSION_H
-#ifndef FZ_VERSION
-#define FZ_VERSION "1.11"
-#endif
-#endif

+ 0 - 145
server/lib/xfdftool/include/mupdf/fitz/writer.h

@@ -1,145 +0,0 @@
-#ifndef MUPDF_FITZ_WRITER_H
-#define MUPDF_FITZ_WRITER_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-#include "mupdf/fitz/output.h"
-#include "mupdf/fitz/document.h"
-#include "mupdf/fitz/device.h"
-
-typedef struct fz_document_writer_s fz_document_writer;
-
-/*
-	fz_document_writer_begin_page_fn: Function type to start
-	the process of writing a page to a document.
-
-	mediabox: page size rectangle in points.
-
-	Returns a fz_device to write page contents to.
-*/
-typedef fz_device *(fz_document_writer_begin_page_fn)(fz_context *ctx, fz_document_writer *wri, const fz_rect *mediabox);
-
-/*
-	fz_document_writer_end_page_fn: Function type to end the
-	process of writing a page to a document.
-
-	dev: The device created by the begin_page function.
-*/
-typedef void (fz_document_writer_end_page_fn)(fz_context *ctx, fz_document_writer *wri, fz_device *dev);
-
-/*
-	fz_document_writer_close_writer_fn: Function type to end
-	the process of writing pages to a document.
-
-	This writes any file level trailers required. After this
-	completes successfully the file is up to date and complete.
-*/
-typedef void (fz_document_writer_close_writer_fn)(fz_context *ctx, fz_document_writer *wri);
-
-/*
-	fz_document_writer_drop_writer_fn: Function type to discard
-	an fz_document_writer. This may be called at any time during
-	the process to release all the resources owned by the writer.
-
-	Calling drop without having previously called close may leave
-	the file in an inconsistent state.
-*/
-typedef void (fz_document_writer_drop_writer_fn)(fz_context *ctx, fz_document_writer *wri);
-
-/*
-	Structure is public to allow other structures to
-	be derived from it. Do not access members directly.
-*/
-struct fz_document_writer_s
-{
-	fz_document_writer_begin_page_fn *begin_page;
-	fz_document_writer_end_page_fn *end_page;
-	fz_document_writer_close_writer_fn *close_writer;
-	fz_document_writer_drop_writer_fn *drop_writer;
-	fz_device *dev;
-};
-
-/*
-	fz_new_document_writer_of_size: Internal function to allocate a
-	block for a derived document_writer structure, with the base
-	structure's function pointers populated correctly, and the extra
-	space zero initialised.
-*/
-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_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);
-
-/*
-	fz_new_document_writer: Create a new fz_document_writer, for a
-	file of the given type.
-
-	path: The document name to write (or NULL for default)
-
-	format: Which format to write (currently cbz, pdf, pam, pbm,
-	pgm, pkm, png, ppm, pnm, svg, tga)
-
-	options: NULL, or pointer to comma separated string to control
-	file generation.
-*/
-fz_document_writer *fz_new_document_writer(fz_context *ctx, const char *path, const char *format, const char *options);
-
-fz_document_writer *fz_new_cbz_writer(fz_context *ctx, const char *path, const char *options);
-fz_document_writer *fz_new_pdf_writer(fz_context *ctx, const char *path, const char *options);
-fz_document_writer *fz_new_svg_writer(fz_context *ctx, const char *path, const char *options);
-fz_document_writer *fz_new_png_pixmap_writer(fz_context *ctx, const char *path, const char *options);
-fz_document_writer *fz_new_tga_pixmap_writer(fz_context *ctx, const char *path, const char *options);
-fz_document_writer *fz_new_pam_pixmap_writer(fz_context *ctx, const char *path, const char *options);
-fz_document_writer *fz_new_pnm_pixmap_writer(fz_context *ctx, const char *path, const char *options);
-fz_document_writer *fz_new_pgm_pixmap_writer(fz_context *ctx, const char *path, const char *options);
-fz_document_writer *fz_new_ppm_pixmap_writer(fz_context *ctx, const char *path, const char *options);
-fz_document_writer *fz_new_pbm_pixmap_writer(fz_context *ctx, const char *path, const char *options);
-fz_document_writer *fz_new_pkm_pixmap_writer(fz_context *ctx, const char *path, const char *options);
-
-/*
-	fz_begin_page: Called to start the process of writing a page to
-	a document.
-
-	mediabox: page size rectangle in points.
-
-	Returns a fz_device to write page contents to.
-*/
-fz_device *fz_begin_page(fz_context *ctx, fz_document_writer *wri, const fz_rect *mediabox);
-
-/*
-	fz_end_page: Called to end the process of writing a page to a
-	document.
-*/
-void fz_end_page(fz_context *ctx, fz_document_writer *wri);
-
-/*
-	fz_close_document_writer: Called to end the process of writing
-	pages to a document.
-
-	This writes any file level trailers required. After this
-	completes successfully the file is up to date and complete.
-*/
-void fz_close_document_writer(fz_context *ctx, fz_document_writer *wri);
-
-/*
-	fz_drop_document_writer: Called to discard a fz_document_writer.
-	This may be called at any time during the process to release all
-	the resources owned by the writer.
-
-	Calling drop without having previously called close may leave
-	the file in an inconsistent state.
-*/
-void fz_drop_document_writer(fz_context *ctx, fz_document_writer *wri);
-
-fz_document_writer *fz_new_pixmap_writer(fz_context *ctx, const char *path, const char *options, const char *default_path, int n,
-	void (*save)(fz_context *ctx, fz_pixmap *pix, const char *filename));
-
-extern const char *fz_cbz_write_options_usage;
-extern const char *fz_pdf_write_options_usage;
-extern const char *fz_svg_write_options_usage;
-
-#endif

+ 0 - 81
server/lib/xfdftool/include/mupdf/fitz/xml.h

@@ -1,81 +0,0 @@
-#ifndef MUPDF_FITZ_XML_H
-#define MUPDF_FITZ_XML_H
-
-#include "mupdf/fitz/system.h"
-#include "mupdf/fitz/context.h"
-
-/*
-	XML document model
-*/
-
-typedef struct fz_xml_s fz_xml;
-
-/*
-	fz_parse_xml: Parse the contents of buffer into a tree of xml nodes.
-
-	preserve_white: whether to keep or delete all-whitespace nodes.
-*/
-fz_xml *fz_parse_xml(fz_context *ctx, fz_buffer *buf, int preserve_white);
-
-/*
-	fz_xml_prev: Return previous sibling of XML node.
-*/
-fz_xml *fz_xml_prev(fz_xml *item);
-
-/*
-	fz_xml_next: Return next sibling of XML node.
-*/
-fz_xml *fz_xml_next(fz_xml *item);
-
-/*
-	fz_xml_up: Return parent of XML node.
-*/
-fz_xml *fz_xml_up(fz_xml *item);
-
-/*
-	fz_xml_down: Return first child of XML node.
-*/
-fz_xml *fz_xml_down(fz_xml *item);
-
-/*
-	fz_xml_is_tag: Return true if the tag name matches.
-*/
-int fz_xml_is_tag(fz_xml *item, const char *name);
-
-/*
-	fz_xml_tag: Return tag of XML node. Return NULL for text nodes.
-*/
-char *fz_xml_tag(fz_xml *item);
-
-/*
-	fz_xml_att: Return the value of an attribute of an XML node.
-	NULL if the attribute doesn't exist.
-*/
-char *fz_xml_att(fz_xml *item, const char *att);
-
-/*
-	fz_xml_text: Return the text content of an XML node.
-	Return NULL if the node is a tag.
-*/
-char *fz_xml_text(fz_xml *item);
-
-/*
-	fz_drop_xml: Free the XML node and all its children and siblings.
-*/
-void fz_drop_xml(fz_context *doc, fz_xml *item);
-
-/*
-	fz_detach_xml: Detach a node from the tree, unlinking it from its parent.
-*/
-void fz_detach_xml(fz_xml *node);
-
-/*
-	fz_debug_xml: Pretty-print an XML tree to stdout.
-*/
-void fz_debug_xml(fz_xml *item, int level);
-
-fz_xml *fz_xml_find(fz_xml *item, const char *tag);
-fz_xml *fz_xml_find_next(fz_xml *item, const char *tag);
-fz_xml *fz_xml_find_down(fz_xml *item, const char *tag);
-
-#endif

+ 0 - 289
server/lib/xfdftool/include/mupdf/html.h

@@ -1,289 +0,0 @@
-#ifndef MUPDF_HTML_H
-#define MUPDF_HTML_H
-
-#include "mupdf/fitz.h"
-
-typedef struct fz_html_font_face_s fz_html_font_face;
-typedef struct fz_html_font_set_s fz_html_font_set;
-typedef struct fz_html_s fz_html;
-typedef struct fz_html_box_s fz_html_box;
-typedef struct fz_html_flow_s fz_html_flow;
-
-typedef struct fz_css_s fz_css;
-typedef struct fz_css_rule_s fz_css_rule;
-typedef struct fz_css_match_prop_s fz_css_match_prop;
-typedef struct fz_css_match_s fz_css_match;
-typedef struct fz_css_style_s fz_css_style;
-
-typedef struct fz_css_selector_s fz_css_selector;
-typedef struct fz_css_condition_s fz_css_condition;
-typedef struct fz_css_property_s fz_css_property;
-typedef struct fz_css_value_s fz_css_value;
-typedef struct fz_css_number_s fz_css_number;
-typedef struct fz_css_color_s fz_css_color;
-
-struct fz_html_font_face_s
-{
-	char *family;
-	int is_bold;
-	int is_italic;
-	fz_font *font;
-	char *src;
-	fz_html_font_face *next;
-};
-
-struct fz_html_font_set_s
-{
-	fz_font *fonts[12]; /* Times, Helvetica, Courier in R,I,B,BI */
-	fz_html_font_face *custom;
-};
-
-enum
-{
-	CSS_KEYWORD = 256,
-	CSS_HASH,
-	CSS_STRING,
-	CSS_NUMBER,
-	CSS_LENGTH,
-	CSS_PERCENT,
-	CSS_URI,
-};
-
-struct fz_css_s
-{
-	fz_pool *pool;
-	fz_css_rule *rule;
-};
-
-struct fz_css_rule_s
-{
-	fz_css_selector *selector;
-	fz_css_property *declaration;
-	fz_css_rule *next;
-};
-
-struct fz_css_selector_s
-{
-	char *name;
-	int combine;
-	fz_css_condition *cond;
-	fz_css_selector *left;
-	fz_css_selector *right;
-	fz_css_selector *next;
-};
-
-struct fz_css_condition_s
-{
-	int type;
-	char *key;
-	char *val;
-	fz_css_condition *next;
-};
-
-struct fz_css_property_s
-{
-	char *name;
-	fz_css_value *value;
-	short spec;
-	short important;
-	fz_css_property *next;
-};
-
-struct fz_css_value_s
-{
-	int type;
-	char *data;
-	fz_css_value *args; /* function arguments */
-	fz_css_value *next;
-};
-
-struct fz_css_match_prop_s
-{
-	const char *name; /* not owned */
-	fz_css_value *value; /* not owned */
-	int spec;
-};
-
-struct fz_css_match_s
-{
-	fz_css_match *up;
-	int count;
-	fz_css_match_prop prop[64];
-};
-
-enum { DIS_NONE, DIS_BLOCK, DIS_INLINE, DIS_LIST_ITEM, DIS_INLINE_BLOCK };
-enum { POS_STATIC, POS_RELATIVE, POS_ABSOLUTE, POS_FIXED };
-enum { TA_LEFT, TA_RIGHT, TA_CENTER, TA_JUSTIFY };
-enum { VA_BASELINE, VA_SUB, VA_SUPER, VA_TOP, VA_BOTTOM, VA_TEXT_TOP, VA_TEXT_BOTTOM };
-enum { BS_NONE, BS_SOLID };
-enum { V_VISIBLE, V_HIDDEN, V_COLLAPSE };
-enum { PB_AUTO, PB_ALWAYS, PB_AVOID, PB_LEFT, PB_RIGHT };
-
-enum {
-	WS_COLLAPSE = 1,
-	WS_ALLOW_BREAK_SPACE = 2,
-	WS_FORCE_BREAK_NEWLINE = 4,
-	WS_NORMAL = WS_COLLAPSE | WS_ALLOW_BREAK_SPACE,
-	WS_PRE = WS_FORCE_BREAK_NEWLINE,
-	WS_NOWRAP = WS_COLLAPSE,
-	WS_PRE_WRAP = WS_ALLOW_BREAK_SPACE | WS_FORCE_BREAK_NEWLINE,
-	WS_PRE_LINE = WS_COLLAPSE | WS_ALLOW_BREAK_SPACE | WS_FORCE_BREAK_NEWLINE
-};
-
-enum {
-	LST_NONE,
-	LST_DISC, LST_CIRCLE, LST_SQUARE,
-	LST_DECIMAL, LST_DECIMAL_ZERO,
-	LST_LC_ROMAN, LST_UC_ROMAN,
-	LST_LC_GREEK, LST_UC_GREEK,
-	LST_LC_LATIN, LST_UC_LATIN,
-	LST_LC_ALPHA, LST_UC_ALPHA,
-	LST_ARMENIAN, LST_GEORGIAN,
-};
-
-enum { N_NUMBER='u', N_LENGTH='p', N_SCALE='m', N_PERCENT='%', N_AUTO='a' };
-
-struct fz_css_number_s
-{
-	float value;
-	int unit;
-};
-
-struct fz_css_color_s
-{
-	unsigned char r, g, b, a;
-};
-
-struct fz_css_style_s
-{
-	fz_css_number font_size;
-	fz_css_number width, height;
-	fz_css_number margin[4];
-	fz_css_number padding[4];
-	fz_css_number border_width[4];
-	fz_css_number text_indent;
-	unsigned int visibility : 2;
-	unsigned int white_space : 3;
-	unsigned int text_align : 2;
-	unsigned int vertical_align : 3;
-	unsigned int list_style_type : 4;
-	unsigned int page_break_before : 3;
-	unsigned int page_break_after : 3;
-	unsigned int border_style_0 : 1;
-	unsigned int border_style_1 : 1;
-	unsigned int border_style_2 : 1;
-	unsigned int border_style_3 : 1;
-	fz_css_number line_height;
-	fz_css_color background_color;
-	fz_css_color border_color[4];
-	fz_css_color color;
-	fz_font *font;
-};
-
-enum
-{
-	BOX_BLOCK,	/* block-level: contains block, break, and flow boxes */
-	BOX_BREAK,	/* block-level: empty <br> tag boxes */
-	BOX_FLOW,	/* block-level: contains only inline boxes */
-	BOX_INLINE,	/* inline-level: contains only inline boxes */
-};
-
-struct fz_html_s
-{
-	fz_pool *pool; /* pool allocator for this html tree */
-	float page_w, page_h;
-	float page_margin[4];
-	fz_html_box *root;
-};
-
-struct fz_html_box_s
-{
-	unsigned int type : 2;
-	unsigned int is_first_flow : 1; /* for text-indent */
-	unsigned int markup_dir : 2;
-	unsigned int list_item : 27;
-	float x, y, w, h; /* content */
-	float padding[4];
-	float margin[4];
-	float border[4];
-	float em;
-	fz_html_box *up, *down, *last, *next;
-	fz_html_flow *flow_head, **flow_tail;
-	char *id, *href;
-	fz_css_style style;
-};
-
-enum
-{
-	FLOW_WORD = 0,
-	FLOW_SPACE = 1,
-	FLOW_BREAK = 2,
-	FLOW_IMAGE = 3,
-	FLOW_SBREAK = 4,
-	FLOW_SHYPHEN = 5,
-	FLOW_ANCHOR = 6
-};
-
-struct fz_html_flow_s
-{
-	/* What type of node */
-	unsigned int type : 3;
-
-	/* Whether this should expand during justification */
-	unsigned int expand : 1;
-
-	/* Whether this node is currently taken as a line break */
-	unsigned int breaks_line : 1;
-
-	/* Direction setting for text - UAX#9 says 125 is the max */
-	unsigned int bidi_level : 7;
-
-	/* The script detected by the bidi code. */
-	unsigned int script : 8;
-
-	/* Whether the markup specifies a given language. */
-	unsigned int markup_lang : 15;
-
-	float x, y, w, h;
-	fz_html_box *box; /* for style and em */
-	union {
-		char *text;
-		fz_image *image;
-	} content;
-	fz_html_flow *next;
-};
-
-fz_css *fz_new_css(fz_context *ctx);
-void fz_parse_css(fz_context *ctx, fz_css *css, const char *source, const char *file);
-fz_css_property *fz_parse_css_properties(fz_context *ctx, fz_pool *pool, const char *source);
-void fz_drop_css(fz_context *ctx, fz_css *css);
-
-void fz_match_css(fz_context *ctx, fz_css_match *match, fz_css *css, fz_xml *node);
-void fz_match_css_at_page(fz_context *ctx, fz_css_match *match, fz_css *css);
-
-int fz_get_css_match_display(fz_css_match *node);
-void fz_default_css_style(fz_context *ctx, fz_css_style *style);
-void fz_apply_css_style(fz_context *ctx, fz_html_font_set *set, fz_css_style *style, fz_css_match *match);
-
-float fz_from_css_number(fz_css_number, float em, float width);
-float fz_from_css_number_scale(fz_css_number number, float scale, float em, float width);
-
-fz_html_font_set *fz_new_html_font_set(fz_context *ctx);
-void fz_add_html_font_face(fz_context *ctx, fz_html_font_set *set,
-	const char *family, int is_bold, int is_italic, const char *src, fz_font *font);
-fz_font *fz_load_html_font(fz_context *ctx, fz_html_font_set *set, const char *family, int is_bold, int is_italic);
-void fz_drop_html_font_set(fz_context *ctx, fz_html_font_set *htx);
-
-void fz_add_css_font_faces(fz_context *ctx, fz_html_font_set *set, fz_archive *zip, const char *base_uri, fz_css *css);
-
-fz_html *fz_parse_html(fz_context *ctx, fz_html_font_set *htx, fz_archive *zip, const char *base_uri, fz_buffer *buf, const char *user_css);
-void fz_layout_html(fz_context *ctx, fz_html *html, float w, float h, float em);
-void fz_draw_html(fz_context *ctx, fz_device *dev, const fz_matrix *ctm, fz_html *html, int page);
-
-float fz_find_html_target(fz_context *ctx, fz_html *html, const char *id);
-fz_link *fz_load_html_links(fz_context *ctx, fz_html *html, int page, const char *base_uri, void *doc);
-void fz_drop_html(fz_context *ctx, fz_html *html);
-fz_bookmark fz_make_html_bookmark(fz_context *ctx, fz_html *html, int page);
-int fz_lookup_html_bookmark(fz_context *ctx, fz_html *html, fz_bookmark mark);
-
-#endif

+ 0 - 282
server/lib/xfdftool/include/mupdf/memento.h

@@ -1,282 +0,0 @@
-/* Copyright (C) 2009-2017 Artifex Software, Inc.
-   All Rights Reserved.
-
-   This software is provided AS-IS with no warranty, either express or
-   implied.
-
-   This software is distributed under license and may not be copied, modified
-   or distributed except as expressly authorized under the terms of that
-   license. Refer to licensing information at http://www.artifex.com
-   or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
-   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
-*/
-
-/* Memento: A library to aid debugging of memory leaks/heap corruption.
- *
- * Usage (with C):
- *    First, build your project with MEMENTO defined, and include this
- *    header file wherever you use malloc, realloc or free.
- *    This header file will use macros to point malloc, realloc and free to
- *    point to Memento_malloc, Memento_realloc, Memento_free.
- *
- *    Run your program, and all mallocs/frees/reallocs should be redirected
- *    through here. When the program exits, you will get a list of all the
- *    leaked blocks, together with some helpful statistics. You can get the
- *    same list of allocated blocks at any point during program execution by
- *    calling Memento_listBlocks();
- *
- *    Every call to malloc/free/realloc counts as an 'allocation event'.
- *    On each event Memento increments a counter. Every block is tagged with
- *    the current counter on allocation. Every so often during program
- *    execution, the heap is checked for consistency. By default this happens
- *    after 1024 events, then after 2048 events, then after 4096 events, etc.
- *    This can be changed at runtime by using Memento_setParanoia(int level).
- *    0 turns off such checking, 1 sets checking to happen on every event,
- *    any positive number n sets checking to happen once every n events,
- *    and any negative number n sets checking to happen after -n events, then
- *    after -2n events etc.
- *
- *    The default paranoia level is therefore -1024.
- *
- *    Memento keeps blocks around for a while after they have been freed, and
- *    checks them as part of these heap checks to see if they have been
- *    written to (or are freed twice etc).
- *
- *    A given heap block can be checked for consistency (it's 'pre' and
- *    'post' guard blocks are checked to see if they have been written to)
- *    by calling Memento_checkBlock(void *blockAddress);
- *
- *    A check of all the memory can be triggered by calling Memento_check();
- *    (or Memento_checkAllMemory(); if you'd like it to be quieter).
- *
- *    A good place to breakpoint is Memento_breakpoint, as this will then
- *    trigger your debugger if an error is detected. This is done
- *    automatically for debug windows builds.
- *
- *    If a block is found to be corrupt, information will be printed to the
- *    console, including the address of the block, the size of the block,
- *    the type of corruption, the number of the block and the event on which
- *    it last passed a check for correctness.
- *
- *    If you rerun, and call Memento_paranoidAt(int event); with this number
- *    the code will wait until it reaches that event and then start
- *    checking the heap after every allocation event. Assuming it is a
- *    deterministic failure, you should then find out where in your program
- *    the error is occurring (between event x-1 and event x).
- *
- *    Then you can rerun the program again, and call
- *    Memento_breakAt(int event); and the program will call
- *    Memento_Breakpoint() when event x is reached, enabling you to step
- *    through.
- *
- *    Memento_find(address) will tell you what block (if any) the given
- *    address is in.
- *
- * An example:
- *    Suppose we have a gs invocation that crashes with memory corruption.
- *     * Build with -DMEMENTO.
- *     * In your debugger put breakpoints on Memento_inited and
- *       Memento_Breakpoint.
- *     * Run the program. It will stop in Memento_inited.
- *     * Execute Memento_setParanoia(1);  (In VS use Ctrl-Alt-Q). (Note #1)
- *     * Continue execution.
- *     * It will detect the memory corruption on the next allocation event
- *       after it happens, and stop in Memento_breakpoint. The console should
- *       show something like:
- *
- *       Freed blocks:
- *         0x172e610(size=288,num=1415) index 256 (0x172e710) onwards corrupted
- *           Block last checked OK at allocation 1457. Now 1458.
- *
- *     * This means that the block became corrupted between allocation 1457
- *       and 1458 - so if we rerun and stop the program at 1457, we can then
- *       step through, possibly with a data breakpoint at 0x172e710 and see
- *       when it occurs.
- *     * So restart the program from the beginning. When we hit Memento_inited
- *       execute Memento_breakAt(1457); (and maybe Memento_setParanoia(1), or
- *       Memento_setParanoidAt(1457))
- *     * Continue execution until we hit Memento_breakpoint.
- *     * Now you can step through and watch the memory corruption happen.
- *
- *    Note #1: Using Memento_setParanoia(1) can cause your program to run
- *    very slowly. You may instead choose to use Memento_setParanoia(100)
- *    (or some other figure). This will only exhaustively check memory on
- *    every 100th allocation event. This trades speed for the size of the
- *    average allocation event range in which detection of memory corruption
- *    occurs. You may (for example) choose to run once checking every 100
- *    allocations and discover that the corruption happens between events
- *    X and X+100. You can then rerun using Memento_paranoidAt(X), and
- *    it'll only start exhaustively checking when it reaches X.
- *
- * More than one memory allocator?
- *
- *    If you have more than one memory allocator in the system (like for
- *    instance the ghostscript chunk allocator, that builds on top of the
- *    standard malloc and returns chunks itself), then there are some things
- *    to note:
- *
- *    * If the secondary allocator gets its underlying blocks from calling
- *      malloc, then those will be checked by Memento, but 'subblocks' that
- *      are returned to the secondary allocator will not. There is currently
- *      no way to fix this other than trying to bypass the secondary
- *      allocator. One way I have found to do this with the chunk allocator
- *      is to tweak its idea of a 'large block' so that it puts every
- *      allocation in its own chunk. Clearly this negates the point of having
- *      a secondary allocator, and is therefore not recommended for general
- *      use.
- *
- *    * Again, if the secondary allocator gets its underlying blocks from
- *      calling malloc (and hence Memento) leak detection should still work
- *      (but whole blocks will be detected rather than subblocks).
- *
- *    * If on every allocation attempt the secondary allocator calls into
- *      Memento_failThisEvent(), and fails the allocation if it returns true
- *      then more useful features can be used; firstly memory squeezing will
- *      work, and secondly, Memento will have a "finer grained" paranoia
- *      available to it.
- *
- * Usage with C++:
- *
- *    Memento has some experimental code in it to trap new/delete (and
- *    new[]/delete[] if required) calls.
- *
- *    In order for this to work, either:
- *
- *    1) Build memento.c with the c++ compiler.
- *
- *    or
- *
- *    2) Build memento.c as normal with the C compiler, then from any
- *       one of your .cpp files, do:
- *
- *       #define MEMENTO_CPP_EXTRAS_ONLY
- *       #include "memento.c"
- *
- *       In the case where MEMENTO is not defined, this will not do anything.
- *
- *    Both Windows and GCC provide separate new[] and delete[] operators
- *    for arrays. Apparently some systems do not. If this is the case for
- *    your system, define MEMENTO_CPP_NO_ARRAY_CONSTRUCTORS.
- */
-
-#ifndef MEMENTO_H
-
-#include <stdlib.h>
-
-#ifdef __ANDROID__
-#define MEMENTO_ANDROID
-#include <stdio.h>
-#endif
-
-#define MEMENTO_H
-
-#ifndef MEMENTO_UNDERLYING_MALLOC
-#define MEMENTO_UNDERLYING_MALLOC malloc
-#endif
-#ifndef MEMENTO_UNDERLYING_FREE
-#define MEMENTO_UNDERLYING_FREE free
-#endif
-#ifndef MEMENTO_UNDERLYING_REALLOC
-#define MEMENTO_UNDERLYING_REALLOC realloc
-#endif
-#ifndef MEMENTO_UNDERLYING_CALLOC
-#define MEMENTO_UNDERLYING_CALLOC calloc
-#endif
-
-#ifndef MEMENTO_MAXALIGN
-#define MEMENTO_MAXALIGN (sizeof(int))
-#endif
-
-#define MEMENTO_PREFILL   0xa6
-#define MEMENTO_POSTFILL  0xa7
-#define MEMENTO_ALLOCFILL 0xa8
-#define MEMENTO_FREEFILL  0xa9
-
-#define MEMENTO_FREELIST_MAX 0x2000000
-
-int Memento_checkBlock(void *);
-int Memento_checkAllMemory(void);
-int Memento_check(void);
-
-int Memento_setParanoia(int);
-int Memento_paranoidAt(int);
-int Memento_breakAt(int);
-void Memento_breakOnFree(void *a);
-void Memento_breakOnRealloc(void *a);
-int Memento_getBlockNum(void *);
-int Memento_find(void *a);
-void Memento_breakpoint(void);
-int Memento_failAt(int);
-int Memento_failThisEvent(void);
-void Memento_listBlocks(void);
-void Memento_listNewBlocks(void);
-size_t Memento_setMax(size_t);
-void Memento_stats(void);
-void *Memento_label(void *, const char *);
-void Memento_tick(void);
-
-void *Memento_malloc(size_t s);
-void *Memento_realloc(void *, size_t s);
-void  Memento_free(void *);
-void *Memento_calloc(size_t, size_t);
-
-void Memento_info(void *addr);
-void Memento_listBlockInfo(void);
-void *Memento_takeRef(void *blk);
-void *Memento_dropRef(void *blk);
-void *Memento_adjustRef(void *blk, int adjust);
-void *Memento_reference(void *blk);
-
-void Memento_startLeaking(void);
-void Memento_stopLeaking(void);
-
-void Memento_fin(void);
-
-#ifdef MEMENTO
-
-#ifndef COMPILING_MEMENTO_C
-#define malloc  Memento_malloc
-#define free    Memento_free
-#define realloc Memento_realloc
-#define calloc  Memento_calloc
-#endif
-
-#else
-
-#define Memento_malloc  MEMENTO_UNDERLYING_MALLOC
-#define Memento_free    MEMENTO_UNDERLYING_FREE
-#define Memento_realloc MEMENTO_UNDERLYING_REALLOC
-#define Memento_calloc  MEMENTO_UNDERLYING_CALLOC
-
-#define Memento_checkBlock(A)     0
-#define Memento_checkAllMemory()  0
-#define Memento_check()           0
-#define Memento_setParanoia(A)    0
-#define Memento_paranoidAt(A)     0
-#define Memento_breakAt(A)        0
-#define Memento_breakOnFree(A)    0
-#define Memento_breakOnRealloc(A) 0
-#define Memento_getBlockNum(A)    0
-#define Memento_find(A)           0
-#define Memento_breakpoint()      do {} while (0)
-#define Memento_failAt(A)         0
-#define Memento_failThisEvent()   0
-#define Memento_listBlocks()      do {} while (0)
-#define Memento_listNewBlocks()   do {} while (0)
-#define Memento_setMax(A)         0
-#define Memento_stats()           do {} while (0)
-#define Memento_label(A,B)        (A)
-#define Memento_info(A)           do {} while (0)
-#define Memento_listBlockInfo()   do {} while (0)
-#define Memento_takeRef(A)        (A)
-#define Memento_dropRef(A)        (A)
-#define Memento_adjustRef(A,V)    (A)
-#define Memento_reference(A)      (A)
-#define Memento_tick()            do {} while (0)
-#define Memento_startLeaking()    do {} while (0)
-#define Memento_stopLeaking()     do {} while (0)
-#define Memento_fin()             do {} while (0)
-
-#endif /* MEMENTO */
-
-#endif /* MEMENTO_H */

+ 0 - 6
server/lib/xfdftool/include/mupdf/pdf-tools.h

@@ -1,6 +0,0 @@
-#ifndef MUPDF_PDF_TOOLS_PDF_H
-#define MUPDF_PDF_TOOLS_PDF_H
-
-int pdfclean_main(int argc, char **argv);
-
-#endif

+ 0 - 38
server/lib/xfdftool/include/mupdf/pdf.h

@@ -1,38 +0,0 @@
-#ifndef MUPDF_PDF_H
-#define MUPDF_PDF_H
-
-#include "mupdf/fitz.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "mupdf/pdf/name-table.h"
-#include "mupdf/pdf/object.h"
-#include "mupdf/pdf/document.h"
-#include "mupdf/pdf/parse.h"
-#include "mupdf/pdf/xref.h"
-#include "mupdf/pdf/crypt.h"
-
-#include "mupdf/pdf/page.h"
-#include "mupdf/pdf/resource.h"
-#include "mupdf/pdf/cmap.h"
-#include "mupdf/pdf/font.h"
-#include "mupdf/pdf/interpret.h"
-
-#include "mupdf/pdf/annot.h"
-#include "mupdf/pdf/field.h"
-#include "mupdf/pdf/widget.h"
-#include "mupdf/pdf/appearance.h"
-#include "mupdf/pdf/event.h"
-#include "mupdf/pdf/javascript.h"
-
-#include "mupdf/pdf/output-pdf.h"
-
-#include "mupdf/pdf/clean.h"
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 208
server/lib/xfdftool/include/mupdf/pdf/annot.h

@@ -1,208 +0,0 @@
-#ifndef MUPDF_PDF_ANNOT_H
-#define MUPDF_PDF_ANNOT_H
-
-typedef enum
-{
-	PDF_ANNOT_TEXT,
-	PDF_ANNOT_LINK,
-	PDF_ANNOT_FREE_TEXT,
-	PDF_ANNOT_LINE,
-	PDF_ANNOT_SQUARE,
-	PDF_ANNOT_CIRCLE,
-	PDF_ANNOT_POLYGON,
-	PDF_ANNOT_POLY_LINE,
-	PDF_ANNOT_HIGHLIGHT,
-	PDF_ANNOT_UNDERLINE,
-	PDF_ANNOT_SQUIGGLY,
-	PDF_ANNOT_STRIKE_OUT,
-	PDF_ANNOT_STAMP,
-	PDF_ANNOT_CARET,
-	PDF_ANNOT_INK,
-	PDF_ANNOT_POPUP,
-	PDF_ANNOT_FILE_ATTACHMENT,
-	PDF_ANNOT_SOUND,
-	PDF_ANNOT_MOVIE,
-	PDF_ANNOT_WIDGET,
-	PDF_ANNOT_SCREEN,
-	PDF_ANNOT_PRINTER_MARK,
-	PDF_ANNOT_TRAP_NET,
-	PDF_ANNOT_WATERMARK,
-	PDF_ANNOT_3D,
-	PDF_ANNOT_UNKNOWN = -1
-} fz_annot_type;
-
-const char *pdf_string_from_annot_type(fz_annot_type type);
-int pdf_annot_type_from_string(const char *subtype);
-
-enum
-{
-	PDF_ANNOT_IS_INVISIBLE = 1 << (1-1),
-	PDF_ANNOT_IS_HIDDEN = 1 << (2-1),
-	PDF_ANNOT_IS_PRINT = 1 << (3-1),
-	PDF_ANNOT_IS_NO_ZOOM = 1 << (4-1),
-	PDF_ANNOT_IS_NO_ROTATE = 1 << (5-1),
-	PDF_ANNOT_IS_NO_VIEW = 1 << (6-1),
-	PDF_ANNOT_IS_READ_ONLY = 1 << (7-1),
-	PDF_ANNOT_IS_LOCKED = 1 << (8-1),
-	PDF_ANNOT_IS_TOGGLE_NO_VIEW = 1 << (9-1),
-	PDF_ANNOT_IS_LOCKED_CONTENTS = 1 << (10-1)
-};
-
-/*
-	pdf_first_annot: Return the first annotation on a page.
-
-	Does not throw exceptions.
-*/
-pdf_annot *pdf_first_annot(fz_context *ctx, pdf_page *page);
-
-/*
-	pdf_next_annot: Return the next annotation on a page.
-
-	Does not throw exceptions.
-*/
-pdf_annot *pdf_next_annot(fz_context *ctx, pdf_annot *annot);
-
-/*
-	pdf_bound_annot: Return the rectangle for an annotation on a page.
-
-	Does not throw exceptions.
-*/
-fz_rect *pdf_bound_annot(fz_context *ctx, pdf_annot *annot, fz_rect *rect);
-
-/*
-	pdf_annot_type: Return the type of an annotation
-*/
-int pdf_annot_type(fz_context *ctx, pdf_annot *annot);
-
-/*
-	pdf_run_annot: Interpret an annotation and render it on a device.
-
-	page: A page loaded by pdf_load_page.
-
-	annot: an annotation.
-
-	dev: Device used for rendering, obtained from fz_new_*_device.
-
-	ctm: A transformation matrix applied to the objects on the page,
-	e.g. to scale or rotate the page contents as desired.
-*/
-void pdf_run_annot(fz_context *ctx, pdf_annot *annot, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie);
-
-struct pdf_annot_s
-{
-	fz_annot super;
-	pdf_page *page;
-	pdf_obj *obj;
-
-	pdf_xobject *ap;
-
-	int ap_iteration;
-	int changed;
-
-	pdf_annot *next;
-};
-
-char *pdf_parse_file_spec(fz_context *ctx, pdf_document *doc, pdf_obj *file_spec, pdf_obj *dest);
-char *pdf_parse_link_dest(fz_context *ctx, pdf_document *doc, pdf_obj *obj);
-char *pdf_parse_link_action(fz_context *ctx, pdf_document *doc, pdf_obj *obj);
-pdf_obj *pdf_lookup_dest(fz_context *ctx, pdf_document *doc, pdf_obj *needle);
-pdf_obj *pdf_lookup_name(fz_context *ctx, pdf_document *doc, pdf_obj *which, pdf_obj *needle);
-pdf_obj *pdf_load_name_tree(fz_context *ctx, pdf_document *doc, pdf_obj *which);
-
-int pdf_resolve_link(fz_context *ctx, pdf_document *doc, const char *uri, float *xp, float *yp);
-fz_link *pdf_load_link_annots(fz_context *ctx, pdf_document *, pdf_obj *annots, const fz_matrix *page_ctm);
-
-void pdf_annot_transform(fz_context *ctx, pdf_annot *annot, fz_matrix *annot_ctm);
-void pdf_load_annots(fz_context *ctx, pdf_page *page, pdf_obj *annots);
-void pdf_update_annot(fz_context *ctx, pdf_annot *annot);
-void pdf_drop_annots(fz_context *ctx, pdf_annot *annot_list);
-
-/*
-	pdf_create_annot: create a new annotation of the specified type on the
-	specified page. The returned pdf_annot structure is owned by the page
-	and does not need to be freed.
-*/
-pdf_annot *pdf_create_annot(fz_context *ctx, pdf_page *page, fz_annot_type type);
-
-/*
-	pdf_delete_annot: delete an annotation
-*/
-void pdf_delete_annot(fz_context *ctx, pdf_page *page, pdf_annot *annot);
-
-int pdf_annot_flags(fz_context *ctx, pdf_annot *annot);
-void pdf_annot_rect(fz_context *ctx, pdf_annot *annot, fz_rect *rect);
-float pdf_annot_border(fz_context *ctx, pdf_annot *annot);
-void pdf_annot_color(fz_context *ctx, pdf_annot *annot, int *n, float color[4]);
-void pdf_annot_interior_color(fz_context *ctx, pdf_annot *annot, int *n, float color[4]);
-
-int pdf_annot_quad_point_count(fz_context *ctx, pdf_annot *annot);
-void pdf_annot_quad_point(fz_context *ctx, pdf_annot *annot, int i, float qp[8]);
-
-int pdf_annot_ink_list_count(fz_context *ctx, pdf_annot *annot);
-int pdf_annot_ink_list_stroke_count(fz_context *ctx, pdf_annot *annot, int i);
-void pdf_annot_ink_list_stroke_vertex(fz_context *ctx, pdf_annot *annot, int i, int k, float v[2]);
-
-void pdf_set_annot_flags(fz_context *ctx, pdf_annot *annot, int flags);
-void pdf_set_annot_rect(fz_context *ctx, pdf_annot *annot, const fz_rect *rect);
-void pdf_set_annot_border(fz_context *ctx, pdf_annot *annot, float width);
-void pdf_set_annot_color(fz_context *ctx, pdf_annot *annot, int n, const float color[4]);
-void pdf_set_annot_interior_color(fz_context *ctx, pdf_annot *annot, int n, const float color[4]);
-void pdf_set_annot_quad_points(fz_context *ctx, pdf_annot *annot, int n, const float *v);
-void pdf_set_annot_ink_list(fz_context *ctx, pdf_annot *annot, int n, const int *count, const float *v);
-
-void pdf_set_annot_line_ending_styles(fz_context *ctx, pdf_annot *annot, int start_style, int end_style);
-void pdf_set_annot_vertices(fz_context *ctx, pdf_annot *annot, int n, const float *v);
-void pdf_set_annot_icon_name(fz_context *ctx, pdf_annot *annot, const char *name);
-void pdf_set_annot_is_open(fz_context *ctx, pdf_annot *annot, int is_open);
-
-void pdf_annot_line_ending_styles(fz_context *ctx, pdf_annot *annot, int *start_style, int *end_style);
-const char *pdf_annot_icon_name(fz_context *ctx, pdf_annot *annot);
-int pdf_annot_is_open(fz_context *ctx, pdf_annot *annot);
-
-int pdf_annot_vertex_count(fz_context *ctx, pdf_annot *annot);
-void pdf_annot_vertex(fz_context *ctx, pdf_annot *annot, int i, float v[2]);
-
-/*
-	pdf_set_text_annot_position: set the position on page for a text (sticky note) annotation.
-*/
-void pdf_set_text_annot_position(fz_context *ctx, pdf_annot *annot, fz_point pt);
-
-/*
-	pdf_set_annot_contents: set the contents of an annotation.
-*/
-void pdf_set_annot_contents(fz_context *ctx, pdf_annot *annot, const char *text);
-
-/*
-	pdf_annot_contents: return the contents of an annotation.
-*/
-const char *pdf_annot_contents(fz_context *ctx, pdf_annot *annot);
-
-/*
-	pdf_annot_author: return the author of an annotation.
-*/
-const char *pdf_annot_author(fz_context *ctx, pdf_annot *annot);
-
-/*
-	pdf_annot_author: return the date of an annotation.
-*/
-// TODO: creation date
-// TODO: modification date
-const char *pdf_annot_date(fz_context *ctx, pdf_annot *annot);
-
-/*
-	pdf_annot_irt: return the indirect reference that this annotation is in reply to.
-*/
-pdf_obj *pdf_annot_irt(fz_context *ctx, pdf_annot *annot);
-
-/*
-	pdf_set_free_text_details: set the position, text, font and color for a free text annotation.
-	Only base 14 fonts are supported and are specified by name.
-*/
-void pdf_set_free_text_details(fz_context *ctx, pdf_annot *annot, fz_point *pos, char *text, char *font_name, float font_size, float color[3]);
-
-/*
-	pdf_new_annot: Internal function for creating a new pdf annotation.
-*/
-pdf_annot *pdf_new_annot(fz_context *ctx, pdf_page *page);
-
-#endif

+ 0 - 43
server/lib/xfdftool/include/mupdf/pdf/appearance.h

@@ -1,43 +0,0 @@
-#ifndef MUPDF_PDF_APPEARANCE_H
-#define MUPDF_PDF_APPEARANCE_H
-
-typedef struct pdf_da_info_s
-{
-	char *font_name;
-	int font_size;
-	float col[4];
-	int col_size;
-} pdf_da_info;
-
-void pdf_da_info_fin(fz_context *ctx, pdf_da_info *di);
-void pdf_parse_da(fz_context *ctx, char *da, pdf_da_info *di);
-void pdf_fzbuf_print_da(fz_context *ctx, fz_buffer *fzbuf, pdf_da_info *di);
-
-void pdf_update_text_appearance(fz_context *ctx, pdf_document *doc, pdf_obj *obj, char *eventValue);
-void pdf_update_combobox_appearance(fz_context *ctx, pdf_document *doc, pdf_obj *obj);
-void pdf_update_listbox_appearance(fz_context *ctx, pdf_document *doc, pdf_obj *obj);
-void pdf_update_pushbutton_appearance(fz_context *ctx, pdf_document *doc, pdf_obj *obj);
-void pdf_update_text_markup_appearance(fz_context *ctx, pdf_document *doc, pdf_annot *annot, fz_annot_type type);
-void pdf_update_ink_appearance(fz_context *ctx, pdf_document *doc, pdf_annot *annot);
-void pdf_update_text_annot_appearance(fz_context *ctx, pdf_document *doc, pdf_annot *annot);
-/*
-	pdf_update_free_text_annot_appearance: update the appearance stream for a free text
-	annotation, basing it on the annotation's rectangle and contents.
-*/
-void pdf_update_free_text_annot_appearance(fz_context *ctx, pdf_document *doc, pdf_annot *annot);
-
-/*
-	pdf_set_annot_appearance: update the appearance of an annotation based
-	on a display list.
-*/
-void pdf_set_annot_appearance(fz_context *ctx, pdf_document *doc, pdf_annot *annot, fz_rect *rect, fz_display_list *disp_list);
-
-/*
-	fz_set_markup_appearance: set the appearance stream of a text markup annotations, basing it on
-	its QuadPoints array
-*/
-void pdf_set_markup_appearance(fz_context *ctx, pdf_document *doc, pdf_annot *annot, float color[3], float alpha, float line_thickness, float line_height);
-
-void pdf_set_signature_appearance(fz_context *ctx, pdf_document *doc, pdf_annot *annot, char *name, const char *dn, char *date);
-
-#endif

+ 0 - 7
server/lib/xfdftool/include/mupdf/pdf/clean.h

@@ -1,7 +0,0 @@
-#ifndef MUPDF_PDF_CLEAN_H
-#define MUPDF_PDF_CLEAN_H
-
-/* Read infile, and write selected pages to outfile with the given options. */
-void pdf_clean_file(fz_context *ctx, char *infile, char *outfile, char *password, pdf_write_options *opts, char *retainlist[], int retainlen);
-
-#endif

+ 0 - 85
server/lib/xfdftool/include/mupdf/pdf/cmap.h

@@ -1,85 +0,0 @@
-#ifndef MUPDF_PDF_CMAP_H
-#define MUPDF_PDF_CMAP_H
-
-/*
- * CMap
- */
-
-typedef struct pdf_cmap_s pdf_cmap;
-typedef struct pdf_range_s pdf_range;
-typedef struct pdf_xrange_s pdf_xrange;
-typedef struct pdf_mrange_s pdf_mrange;
-
-#define PDF_MRANGE_CAP 8
-
-struct pdf_range_s
-{
-	unsigned short low, high, out;
-};
-
-struct pdf_xrange_s
-{
-	unsigned int low, high, out;
-};
-
-struct pdf_mrange_s
-{
-	unsigned int low, len, out[PDF_MRANGE_CAP];
-};
-
-struct pdf_cmap_s
-{
-	fz_storable storable;
-	char cmap_name[32];
-
-	char usecmap_name[32];
-	pdf_cmap *usecmap;
-
-	int wmode;
-
-	int codespace_len;
-	struct
-	{
-		int n;
-		unsigned int low;
-		unsigned int high;
-	} codespace[40];
-
-	int rlen, rcap;
-	pdf_range *ranges;
-
-	int xlen, xcap;
-	pdf_xrange *xranges;
-
-	int mlen, mcap;
-	pdf_mrange *mranges;
-};
-
-pdf_cmap *pdf_new_cmap(fz_context *ctx);
-pdf_cmap *pdf_keep_cmap(fz_context *ctx, pdf_cmap *cmap);
-void pdf_drop_cmap(fz_context *ctx, pdf_cmap *cmap);
-void pdf_drop_cmap_imp(fz_context *ctx, fz_storable *cmap);
-size_t pdf_cmap_size(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, unsigned int low, unsigned int high, int n);
-void pdf_map_range_to_range(fz_context *ctx, pdf_cmap *cmap, unsigned int srclo, unsigned int srchi, int dstlo);
-void pdf_map_one_to_many(fz_context *ctx, pdf_cmap *cmap, unsigned int one, int *many, int len);
-void pdf_sort_cmap(fz_context *ctx, pdf_cmap *cmap);
-
-int pdf_lookup_cmap(pdf_cmap *cmap, unsigned int cpt);
-int pdf_lookup_cmap_full(pdf_cmap *cmap, unsigned int cpt, int *out);
-int pdf_decode_cmap(pdf_cmap *cmap, unsigned char *s, unsigned char *e, unsigned int *cpt);
-
-pdf_cmap *pdf_new_identity_cmap(fz_context *ctx, int wmode, int bytes);
-pdf_cmap *pdf_load_cmap(fz_context *ctx, fz_stream *file);
-pdf_cmap *pdf_load_system_cmap(fz_context *ctx, const char *name);
-pdf_cmap *pdf_load_builtin_cmap(fz_context *ctx, const char *name);
-pdf_cmap *pdf_load_embedded_cmap(fz_context *ctx, pdf_document *doc, pdf_obj *ref);
-
-void pdf_print_cmap(fz_context *ctx, fz_output *out, pdf_cmap *cmap);
-
-#endif

+ 0 - 62
server/lib/xfdftool/include/mupdf/pdf/crypt.h

@@ -1,62 +0,0 @@
-#ifndef MUPDF_PDF_CRYPT_H
-#define MUPDF_PDF_CRYPT_H
-
-/*
- * Encryption
- */
-
-pdf_crypt *pdf_new_crypt(fz_context *ctx, pdf_obj *enc, pdf_obj *id);
-void pdf_drop_crypt(fz_context *ctx, pdf_crypt *crypt);
-
-void pdf_crypt_obj(fz_context *ctx, pdf_crypt *crypt, pdf_obj *obj, int num, int gen);
-void pdf_crypt_buffer(fz_context *ctx, pdf_crypt *crypt, fz_buffer *buf, int num, int gen);
-fz_stream *pdf_open_crypt(fz_context *ctx, fz_stream *chain, pdf_crypt *crypt, int num, int gen);
-fz_stream *pdf_open_crypt_with_filter(fz_context *ctx, fz_stream *chain, pdf_crypt *crypt, pdf_obj *name, int num, int gen);
-
-int pdf_crypt_version(fz_context *ctx, pdf_document *doc);
-int pdf_crypt_revision(fz_context *ctx, pdf_document *doc);
-char *pdf_crypt_method(fz_context *ctx, pdf_document *doc);
-int pdf_crypt_length(fz_context *ctx, pdf_document *doc);
-unsigned char *pdf_crypt_key(fz_context *ctx, pdf_document *doc);
-
-void pdf_print_crypt(fz_context *ctx, fz_output *out, pdf_crypt *crypt);
-
-typedef struct pdf_designated_name_s
-{
-	char *cn;
-	char *o;
-	char *ou;
-	char *email;
-	char *c;
-}
-pdf_designated_name;
-
-void pdf_drop_designated_name(fz_context *ctx, pdf_designated_name *dn);
-
-pdf_signer *pdf_read_pfx(fz_context *ctx, const char *sigfile, const char *password);
-pdf_signer *pdf_keep_signer(fz_context *ctx, pdf_signer *signer);
-void pdf_drop_signer(fz_context *ctx, pdf_signer *signer);
-pdf_designated_name *pdf_signer_designated_name(fz_context *ctx, pdf_signer *signer);
-void pdf_write_digest(fz_context *ctx, pdf_document *doc, const char *filename, pdf_obj *byte_range, int digest_offset, int digest_length, pdf_signer *signer);
-
-/*
-	pdf_signature_widget_byte_range: retrieve the byte range for a signature widget
-*/
-int pdf_signature_widget_byte_range(fz_context *ctx, pdf_document *doc, pdf_widget *widget, int (*byte_range)[2]);
-
-/*
-	pdf_signature_widget_contents: retrieve the contents for a signature widget
-*/
-int pdf_signature_widget_contents(fz_context *ctx, pdf_document *doc, pdf_widget *widget, char **contents);
-
-/*
-	pdf_check_signature: check a signature's certificate chain and digest
-*/
-int pdf_check_signature(fz_context *ctx, pdf_document *doc, pdf_widget *widget, char *file, char *ebuf, int ebufsize);
-
-/*
-	pdf_sign_signature: sign a signature form field
-*/
-void pdf_sign_signature(fz_context *ctx, pdf_document *doc, pdf_widget *widget, const char *sigfile, const char *password);
-
-#endif

+ 0 - 838
server/lib/xfdftool/include/mupdf/pdf/document.h

@@ -1,838 +0,0 @@
-#ifndef MUPDF_PDF_DOCUMENT_H
-#define MUPDF_PDF_DOCUMENT_H
-
-typedef struct pdf_lexbuf_s pdf_lexbuf;
-typedef struct pdf_lexbuf_large_s pdf_lexbuf_large;
-typedef struct pdf_xref_s pdf_xref;
-typedef struct pdf_crypt_s pdf_crypt;
-typedef struct pdf_ocg_descriptor_s pdf_ocg_descriptor;
-typedef struct pdf_portfolio_s pdf_portfolio;
-
-typedef struct pdf_page_s pdf_page;
-typedef struct pdf_annot_s pdf_annot;
-typedef struct pdf_widget_s pdf_widget;
-typedef struct pdf_hotspot_s pdf_hotspot;
-typedef struct pdf_js_s pdf_js;
-
-enum
-{
-	PDF_LEXBUF_SMALL = 256,
-	PDF_LEXBUF_LARGE = 65536
-};
-
-struct pdf_lexbuf_s
-{
-	int size;
-	int base_size;
-	int len;
-	fz_off_t i;
-	float f;
-	char *scratch;
-	char buffer[PDF_LEXBUF_SMALL];
-};
-
-struct pdf_lexbuf_large_s
-{
-	pdf_lexbuf base;
-	char buffer[PDF_LEXBUF_LARGE - PDF_LEXBUF_SMALL];
-};
-
-struct pdf_hotspot_s
-{
-	int num;
-	int state;
-};
-
-/*
-	Document event structures are mostly opaque to the app. Only the type
-	is visible to the app.
-*/
-typedef struct pdf_doc_event_s pdf_doc_event;
-
-/*
-	pdf_doc_event_cb: the type of function via which the app receives
-	document events.
-*/
-typedef void (pdf_doc_event_cb)(fz_context *ctx, pdf_document *doc, pdf_doc_event *event, void *data);
-
-/*
-	pdf_open_document: Open a PDF document.
-
-	Open a PDF document by reading its cross reference table, so
-	MuPDF can locate PDF objects inside the file. Upon an broken
-	cross reference table or other parse errors MuPDF will restart
-	parsing the file from the beginning to try to rebuild a
-	(hopefully correct) cross reference table to allow further
-	processing of the file.
-
-	The returned pdf_document should be used when calling most
-	other PDF functions. Note that it wraps the context, so those
-	functions implicitly get access to the global state in
-	context.
-
-	filename: a path to a file as it would be given to open(2).
-*/
-pdf_document *pdf_open_document(fz_context *ctx, const char *filename);
-
-/*
-	pdf_open_document_with_stream: Opens a PDF document.
-
-	Same as pdf_open_document, but takes a stream instead of a
-	filename to locate the PDF document to open. Increments the
-	reference count of the stream. See fz_open_file,
-	fz_open_file_w or fz_open_fd for opening a stream, and
-	fz_drop_stream for closing an open stream.
-*/
-pdf_document *pdf_open_document_with_stream(fz_context *ctx, fz_stream *file);
-
-/*
-	pdf_drop_document: Closes and frees an opened PDF document.
-
-	The resource store in the context associated with pdf_document
-	is emptied.
-
-	Does not throw exceptions.
-*/
-void pdf_drop_document(fz_context *ctx, pdf_document *doc);
-
-/*
-	pdf_specifics: down-cast a fz_document to a pdf_document.
-	Returns NULL if underlying document is not PDF
-*/
-pdf_document *pdf_specifics(fz_context *ctx, fz_document *doc);
-
-/*
-	pdf_document_from_fz_document,
-	pdf_page_from_fz_page,
-	pdf_annot_from_fz_annot:
-		Down-cast generic fitz objects into pdf specific variants.
-		Returns NULL if the objects are not from a PDF document.
-*/
-pdf_document *pdf_document_from_fz_document(fz_context *ctx, fz_document *ptr);
-pdf_page *pdf_page_from_fz_page(fz_context *ctx, fz_page *ptr);
-pdf_annot *pdf_annot_from_fz_annot(fz_context *ctx, fz_annot *ptr);
-
-int pdf_needs_password(fz_context *ctx, pdf_document *doc);
-
-/*
-	pdf_authenticate_password: Attempt to authenticate a
-	password.
-
-	Returns 0 for failure, non-zero for success.
-
-	In the non-zero case:
-		bit 0 set => no password required
-		bit 1 set => user password authenticated
-		bit 2 set => owner password authenticated
-*/
-int pdf_authenticate_password(fz_context *ctx, pdf_document *doc, const char *pw);
-
-int pdf_has_permission(fz_context *ctx, pdf_document *doc, fz_permission p);
-int pdf_lookup_metadata(fz_context *ctx, pdf_document *doc, const char *key, char *ptr, int size);
-
-fz_outline *pdf_load_outline(fz_context *ctx, pdf_document *doc);
-
-/*
-	pdf_count_layer_configs: Get the number of layer
-	configurations defined in this document.
-
-	doc: The document in question.
-*/
-int pdf_count_layer_configs(fz_context *ctx, pdf_document *doc);
-
-typedef struct
-{
-	const char *name;
-	const char *creator;
-} pdf_layer_config;
-
-/*
-	pdf_layer_config_info: Fetch the name (and
-	optionally creator) of the given layer config.
-
-	doc: The document in question.
-
-	config_num: A value in the 0..n-1 range, where n is the
-	value returned from pdf_count_layer_configs.
-
-	info: Pointer to structure to fill in. Pointers within
-	this structure may be set to NULL if no information is
-	available.
-*/
-void pdf_layer_config_info(fz_context *ctx, pdf_document *doc, int config_num, pdf_layer_config *info);
-
-/*
-	pdf_select_layer_config: Set the current configuration.
-	This updates the visibility of the optional content groups
-	within the document.
-
-	doc: The document in question.
-
-	config_num: A value in the 0..n-1 range, where n is the
-	value returned from pdf_count_layer_configs.
-*/
-void pdf_select_layer_config(fz_context *ctx, pdf_document *doc, int config_num);
-
-/*
-	pdf_count_layer_config_ui: Returns the number of entries in the
-	'UI' for this layer configuration.
-
-	doc: The document in question.
-*/
-int pdf_count_layer_config_ui(fz_context *ctx, pdf_document *doc);
-
-/*
-	pdf_select_layer_ui: Select a checkbox/radiobox
-	within the 'UI' for this layer configuration.
-
-	Selecting a UI entry that is a radiobox may disable
-	other UI entries.
-
-	doc: The document in question.
-
-	ui: A value in the 0..m-1 range, where m is the value
-	returned by pdf_count_layer_config_ui.
-*/
-void pdf_select_layer_config_ui(fz_context *ctx, pdf_document *doc, int ui);
-
-/*
-	pdf_deselect_layer_ui: Select a checkbox/radiobox
-	within the 'UI' for this layer configuration.
-
-	doc: The document in question.
-
-	ui: A value in the 0..m-1 range, where m is the value
-	returned by pdf_count_layer_config_ui.
-*/
-void pdf_deselect_layer_config_ui(fz_context *ctx, pdf_document *doc, int ui);
-
-/*
-	pdf_toggle_layer_config_ui: Toggle a checkbox/radiobox
-	within the 'UI' for this layer configuration.
-
-	Toggling a UI entry that is a radiobox may disable
-	other UI entries.
-
-	doc: The document in question.
-
-	ui: A value in the 0..m-1 range, where m is the value
-	returned by pdf_count_layer_config_ui.
-*/
-void pdf_toggle_layer_config_ui(fz_context *ctx, pdf_document *doc, int ui);
-
-typedef enum
-{
-	PDF_LAYER_UI_LABEL = 0,
-	PDF_LAYER_UI_CHECKBOX = 1,
-	PDF_LAYER_UI_RADIOBOX = 2
-} pdf_layer_config_ui_type;
-
-typedef struct
-{
-	const char *text;
-	int depth;
-	pdf_layer_config_ui_type type;
-	int selected;
-	int locked;
-} pdf_layer_config_ui;
-
-/*
-	pdf_layer_config_ui_info: Get the info for a given
-	entry in the layer config ui.
-
-	doc: The document in question.
-
-	ui: A value in the 0..m-1 range, where m is the value
-	returned by pdf_count_layer_config_ui.
-
-	info: Pointer to a structure to fill in with information
-	about the requested ui entry.
-*/
-void pdf_layer_config_ui_info(fz_context *ctx, pdf_document *doc, int ui, pdf_layer_config_ui *info);
-
-/*
-	pdf_set_layer_config_as_default: Write the current layer
-	config back into the document as the default state.
-*/
-void pdf_set_layer_config_as_default(fz_context *ctx, pdf_document *doc);
-
-/*
-	PDF portfolios (or collections) are embedded files. They can
-	be thought of as tables of information, with an embedded
-	file per row. For instance a PDF portfolio of an email box might
-	contain:
-
-			From	To	Cc	Date
-	message1.pdf	...	...	...	...
-	message2.pdf	...	...	...	...
-
-	etc. The details of the 'column headings' are known as the Schema.
-	This includes the order to use for the headings.
-
-	Each row in the table is a portfolio (or collection) entry.
-*/
-
-/*
-	pdf_count_portfolio_schema: Get the number of entries in the
-	portfolio schema used in this document.
-
-	doc: The document in question.
-*/
-int pdf_count_portfolio_schema(fz_context *ctx, pdf_document *doc);
-
-typedef enum
-{
-	PDF_SCHEMA_NUMBER,
-	PDF_SCHEMA_SIZE,
-	PDF_SCHEMA_TEXT,
-	PDF_SCHEMA_DATE,
-	PDF_SCHEMA_DESC,
-	PDF_SCHEMA_MODDATE,
-	PDF_SCHEMA_CREATIONDATE,
-	PDF_SCHEMA_FILENAME,
-	PDF_SCHEMA_UNKNOWN
-} pdf_portfolio_schema_type;
-
-typedef struct
-{
-	pdf_portfolio_schema_type type;
-	int visible;
-	int editable;
-	pdf_obj *name;
-} pdf_portfolio_schema;
-
-/*
-	pdf_portfolio_schema_info: Fetch information about a given
-	portfolio schema entry.
-
-	doc: The document in question.
-
-	entry: A value in the 0..n-1 range, where n is the
-	value returned from pdf_count_portfolio_schema.
-
-	info: Pointer to structure to fill in. Pointers within
-	this structure may be set to NULL if no information is
-	available.
-*/
-void pdf_portfolio_schema_info(fz_context *ctx, pdf_document *doc, int entry, pdf_portfolio_schema *info);
-
-/*
-	pdf_reorder_portfolio_schema: Reorder the portfolio schema.
-
-	doc: The document in question.
-
-	entry: A value in the 0..n-1 range, where n is the
-	value returned from pdf_count_portfolio_schema - the
-	position of the entry to move.
-
-	new_pos: A value in the 0..n-1 range, where n is the
-	value returned from pdf_count_portfolio_schema - the
-	position to move the entry to.
-*/
-void pdf_reorder_portfolio_schema(fz_context *ctx, pdf_document *doc, int entry, int new_pos);
-
-/*
-	pdf_rename_portfolio_schema: rename a given portfolio
-	schema entry.
-
-	doc: The document in question.
-
-	entry: The entry to renumber.
-
-	name: The new name for the portfolio schema
-
-	name_len: The byte length of the name.
-*/
-void pdf_rename_portfolio_schema(fz_context *ctx, pdf_document *doc, int entry, const char *name, int name_len);
-
-/*
-	pdf_delete_portfolio_schema: delete a given portfolio
-	schema entry.
-
-	doc: The document in question.
-
-	entry: The entry to delete.
-*/
-void pdf_delete_portfolio_schema(fz_context *ctx, pdf_document *doc, int entry);
-
-/*
-	pdf_add_portfolio_schema: Add a new portfolio schema
-	entry.
-
-	doc: The document in question.
-
-	entry: The point in the ordering at which to insert the new
-	schema entry.
-
-	info: Details of the schema entry.
-*/
-void pdf_add_portfolio_schema(fz_context *ctx, pdf_document *doc, int entry, const pdf_portfolio_schema *info);
-
-/*
-	pdf_count_portfolio_entries: Get the number of portfolio entries
-	in this document.
-
-	doc: The document in question.
-*/
-int pdf_count_portfolio_entries(fz_context *ctx, pdf_document *doc);
-
-/*
-	pdf_portfolio_entry: Create a buffer containing
-	a decoded portfolio entry.
-
-	doc: The document in question.
-
-	entry: A value in the 0..m-1 range, where m is the
-	value returned from pdf_count_portfolio_entries.
-
-	Returns a buffer containing the decoded portfolio
-	entry. Ownership of the buffer passes to the caller.
-*/
-fz_buffer *pdf_portfolio_entry(fz_context *ctx, pdf_document *doc, int entry);
-
-/*
-	pdf_portfolio_entry_obj_name: Retrieve the object and
-	name of a given portfolio entry.
-
-	doc: The document in question.
-
-	entry: A value in the 0..m-1 range, where m is the
-	value returned from pdf_count_portfolio_entries.
-
-	name: Pointer to a place to store the pointer to the
-	object representing the name. This is a borrowed
-	reference - do not drop it.
-
-	Returns a pointer to the pdf_object representing the
-	object. This is a borrowed reference - do not drop
-	it.
-*/
-pdf_obj *pdf_portfolio_entry_obj_name(fz_context *ctx, pdf_document *doc, int entry, pdf_obj **name);
-
-/*
-	pdf_portfolio_entry_obj: Retrieve the object
-	representing a given portfolio entry.
-
-	doc: The document in question.
-
-	entry: A value in the 0..m-1 range, where m is the
-	value returned from pdf_count_portfolio_entries.
-
-	Returns a pointer to the pdf_object representing the
-	object. This is a borrowed reference - do not drop
-	it.
-*/
-pdf_obj *pdf_portfolio_entry_obj(fz_context *ctx, pdf_document *doc, int entry);
-
-/*
-	pdf_portfolio_entry_name: Retrieve the name of
-	a given portfolio entry.
-
-	doc: The document in question.
-
-	entry: A value in the 0..m-1 range, where m is the
-	value returned from pdf_count_portfolio_entries.
-
-	name: Pointer to a place to store the pointer to the
-	object representing the name. This is a borrowed
-	reference - do not drop it.
-
-	Returns a pointer to the pdf_object representing the
-	name of the entry. This is a borrowed reference - do not drop
-	it.
-*/
-pdf_obj *pdf_portfolio_entry_name(fz_context *ctx, pdf_document *doc, int entry);
-
-/*
-	pdf_portfolio_entry_info: Fetch information about a given
-	portfolio entry.
-
-	doc: The document in question.
-
-	entry: A value in the 0..m-1 range, where m is the
-	value returned from pdf_count_portfolio_entries.
-
-	info: Pointer to structure to fill in. Pointers within
-	this structure may be set to NULL if no information is
-	available.
-*/
-pdf_obj *pdf_portfolio_entry_info(fz_context *ctx, pdf_document *doc, int entry, int schema_entry);
-
-/*
-	pdf_add_portfolio_entry: Add a new portfolio entry.
-
-	doc: The document in question.
-
-	name: The name to use for this entry (as used in the
-	PDF name tree for the collection).
-
-	name_len: The byte length of name.
-
-	desc: The description to use for this entry (as used
-	in the 'Desc' entry in the Collection entry).
-
-	desc_len: The byte length of desc.
-
-	filename: The filename to use for this entry (as used
-	in the 'F' entry in the collection entry).
-
-	filename_len: The byte length of filename.
-
-	unifilename: The filename to use for this entry (as used
-	in the 'UF' entry in the collection entry).
-
-	unifilename_len: The byte length of unifilename.
-
-	buf: The buffer containing the embedded file to add.
-
-	Returns the entry number for this new entry.
-*/
-int pdf_add_portfolio_entry(fz_context *ctx, pdf_document *doc,
-				const char *name, int name_len,
-				const char *desc, int desc_len,
-				const char *filename, int filename_len,
-				const char *unifile, int unifile_len, fz_buffer *buf);
-
-/*
-	pdf_set_portfolio_entry_info: Set part of the entry
-	information for a given portfolio entry.
-
-	doc: The document in question.
-
-	entry: The portfolio entry to set information for.
-	In the range 0..m-1, where m is the value returned
-	from pdf_count_portfolio_entries.
-
-	schema_entry: Which schema entry to set (in the
-	range 0..n-1, where n is the value returned from
-	pdf_count_portfolio_schema.
-
-	data: The value to set.
-*/
-void pdf_set_portfolio_entry_info(fz_context *ctx, pdf_document *doc, int entry, int schema_entry, pdf_obj *data);
-
-/*
-	pdf_update_page: update a page for the sake of changes caused by a call
-	to pdf_pass_event. pdf_update_page regenerates any appearance streams that
-	are out of date, checks for cases where different appearance streams
-	should be selected because of state changes, and records internally
-	each annotation that has changed appearance. The list of changed annotations
-	is then available via querying the annot->changed flag. Note that a call to
-	pdf_pass_event for one page may lead to changes on any other, so an app
-	should call pdf_update_page for every page it currently displays. Also
-	it is important that the pdf_page object is the one used to last render
-	the page. If instead the app were to drop the page and reload it then
-	a call to pdf_update_page would not reliably be able to report all changed
-	areas.
-*/
-void pdf_update_page(fz_context *ctx, pdf_page *page);
-
-/*
-	Determine whether changes have been made since the
-	document was opened or last saved.
-*/
-int pdf_has_unsaved_changes(fz_context *ctx, pdf_document *doc);
-
-typedef struct pdf_signer_s pdf_signer;
-
-/* Unsaved signature fields */
-typedef struct pdf_unsaved_sig_s pdf_unsaved_sig;
-
-struct pdf_unsaved_sig_s
-{
-	pdf_obj *field;
-	int byte_range_start;
-	int byte_range_end;
-	int contents_start;
-	int contents_end;
-	pdf_signer *signer;
-	pdf_unsaved_sig *next;
-};
-
-typedef struct pdf_rev_page_map_s pdf_rev_page_map;
-struct pdf_rev_page_map_s
-{
-	int page;
-	int object;
-};
-
-struct pdf_document_s
-{
-	fz_document super;
-
-	fz_stream *file;
-
-	int version;
-	fz_off_t startxref;
-	fz_off_t file_size;
-	pdf_crypt *crypt;
-	pdf_ocg_descriptor *ocg;
-	pdf_portfolio *portfolio;
-	pdf_hotspot hotspot;
-
-	int max_xref_len;
-	int num_xref_sections;
-	int saved_num_xref_sections;
-	int num_incremental_sections;
-	int xref_base;
-	int disallow_new_increments;
-	pdf_xref *xref_sections;
-	pdf_xref *saved_xref_sections;
-	int *xref_index;
-	int freeze_updates;
-	int has_xref_streams;
-
-	int page_count;
-	pdf_rev_page_map *rev_page_map;
-
-	int repair_attempted;
-
-	/* State indicating which file parsing method we are using */
-	int file_reading_linearly;
-	fz_off_t file_length;
-
-	pdf_obj *linear_obj; /* Linearized object (if used) */
-	pdf_obj **linear_page_refs; /* Page objects for linear loading */
-	int linear_page1_obj_num;
-
-	/* The state for the pdf_progressive_advance parser */
-	fz_off_t linear_pos;
-	int linear_page_num;
-
-	int hint_object_offset;
-	int hint_object_length;
-	int hints_loaded; /* Set to 1 after the hints loading has completed,
-			   * whether successful or not! */
-	/* Page n references shared object references:
-	 *   hint_shared_ref[i]
-	 * where
-	 *      i = s to e-1
-	 *	s = hint_page[n]->index
-	 *	e = hint_page[n+1]->index
-	 * Shared object reference r accesses objects:
-	 *   rs to re-1
-	 * where
-	 *   rs = hint_shared[r]->number
-	 *   re = hint_shared[r]->count + rs
-	 * These are guaranteed to lie within the region starting at
-	 * hint_shared[r]->offset of length hint_shared[r]->length
-	 */
-	struct
-	{
-		int number; /* Page object number */
-		fz_off_t offset; /* Offset of page object */
-		fz_off_t index; /* Index into shared hint_shared_ref */
-	} *hint_page;
-	int *hint_shared_ref;
-	struct
-	{
-		int number; /* Object number of first object */
-		fz_off_t offset; /* Offset of first object */
-	} *hint_shared;
-	int hint_obj_offsets_max;
-	fz_off_t *hint_obj_offsets;
-
-	int resources_localised;
-
-	pdf_lexbuf_large lexbuf;
-
-	pdf_annot *focus;
-	pdf_obj *focus_obj;
-
-	pdf_js *js;
-
-	int recalculating;
-	int dirty;
-
-	void (*update_appearance)(fz_context *ctx, pdf_document *doc, pdf_annot *annot);
-
-	pdf_doc_event_cb *event_cb;
-	void *event_cb_data;
-
-	int num_type3_fonts;
-	int max_type3_fonts;
-	fz_font **type3_fonts;
-
-	struct {
-		fz_hash_table *images;
-		fz_hash_table *fonts;
-	} resources;
-
-	int orphans_max;
-	int orphans_count;
-	pdf_obj **orphans;
-};
-
-/*
-	PDF creation
-*/
-
-/*
-	pdf_create_document: Create a blank PDF document
-*/
-pdf_document *pdf_create_document(fz_context *ctx);
-
-/*
-	Deep copy objects between documents.
-*/
-typedef struct pdf_graft_map_s pdf_graft_map;
-
-pdf_graft_map *pdf_new_graft_map(fz_context *ctx, pdf_document *src);
-void pdf_drop_graft_map(fz_context *ctx, pdf_graft_map *map);
-pdf_obj *pdf_graft_object(fz_context *ctx, pdf_document *dst, pdf_document *src, pdf_obj *obj, pdf_graft_map *map);
-
-/*
-	pdf_page_write: Create a device that will record the
-	graphical operations given to it into a sequence of
-	pdf operations, together with a set of resources. This
-	sequence/set pair can then be used as the basis for
-	adding a page to the document (see pdf_add_page).
-
-	doc: The document for which these are intended.
-
-	mediabox: The bbox for the created page.
-
-	presources: Pointer to a place to put the created
-	resources dictionary.
-
-	pcontents: Pointer to a place to put the created
-	contents buffer.
-*/
-fz_device *pdf_page_write(fz_context *ctx, pdf_document *doc, const fz_rect *mediabox, pdf_obj **presources, fz_buffer **pcontents);
-
-/*
-	pdf_add_page: Create a pdf_obj within a document that
-	represents a page, from a previously created resources
-	dictionary and page content stream. This should then be
-	inserted into the document using pdf_insert_page.
-
-	After this call the page exists within the document
-	structure, but is not actually ever displayed as it is
-	not linked into the PDF page tree.
-
-	doc: The document to which to add the page.
-
-	mediabox: The mediabox for the page (should be identical
-	to that used when creating the resources/contents).
-
-	rotate: 0, 90, 180 or 270. The rotation to use for the
-	page.
-
-	resources: The resources dictionary for the new page
-	(typically created by pdf_page_write).
-
-	contents: The page contents for the new page (typically
-	create by pdf_page_write).
-*/
-pdf_obj *pdf_add_page(fz_context *ctx, pdf_document *doc, const fz_rect *mediabox, int rotate, pdf_obj *resources, fz_buffer *contents);
-
-/*
-	pdf_insert_page: Insert a page previously created by
-	pdf_add_page into the pages tree of the document.
-
-	doc: The document to insert into.
-
-	at: The page number to insert at. 0 inserts at the start.
-	negative numbers, or INT_MAX insert at the end. Otherwise
-	n inserts after page n.
-
-	page: The page to insert.
-*/
-void pdf_insert_page(fz_context *ctx, pdf_document *doc, int at, pdf_obj *page);
-
-/*
-	pdf_delete_page: Delete a page from the page tree of
-	a document. This does not remove the page contents
-	or resources from the file.
-
-	doc: The document to operate on.
-
-	number: The page to remove (numbered from 0)
-*/
-void pdf_delete_page(fz_context *ctx, pdf_document *doc, int number);
-
-/*
-	pdf_delete_page_range: Delete a range of pages from the
-	page tree of a document. This does not remove the page
-	contents or resources from the file.
-
-	doc: The document to operate on.
-
-	start, end: The range of pages (numbered from 0)
-	(inclusive, exclusive) to remove. If end is negative or
-	greater than the number of pages in the document, it
-	will be taken to be the end of the document.
-*/
-void pdf_delete_page_range(fz_context *ctx, pdf_document *doc, int start, int end);
-
-/*
-	pdf_finish_edit: Called after any editing operations
-	on a document have completed, this will tidy up
-	the document. For now this is restricted to
-	rebalancing the page tree, but may be extended
-	in the future.
-*/
-void pdf_finish_edit(fz_context *ctx, pdf_document *doc);
-
-int pdf_recognize(fz_context *doc, const char *magic);
-
-typedef struct pdf_write_options_s pdf_write_options;
-
-/*
-	In calls to fz_save_document, the following options structure can be used
-	to control aspects of the writing process. This structure may grow
-	in the future, and should be zero-filled to allow forwards compatibility.
-*/
-struct pdf_write_options_s
-{
-	int do_incremental; /* Write just the changed objects. */
-	int do_pretty; /* Pretty-print dictionaries and arrays. */
-	int do_ascii; /* ASCII hex encode binary streams. */
-	int do_compress; /* Compress streams. */
-	int do_compress_images; /* Compress (or leave compressed) image streams. */
-	int do_compress_fonts; /* Compress (or leave compressed) font streams. */
-	int do_decompress; /* Decompress streams (except when compressing images/fonts). */
-	int do_garbage; /* Garbage collect objects before saving; 1=gc, 2=re-number, 3=de-duplicate. */
-	int do_linear; /* Write linearised. */
-	int do_clean; /* Sanitize content streams. */
-	int continue_on_error; /* If set, errors are (optionally) counted and writing continues. */
-	int *errors; /* Pointer to a place to store a count of errors */
-};
-
-/*
-	Parse option string into a pdf_write_options struct.
-	Matches the command line options to 'mutool clean':
-		g: garbage collect
-		d, i, f: expand all, fonts, images
-		l: linearize
-		a: ascii hex encode
-		z: deflate
-		s: sanitize content streams
-*/
-pdf_write_options *pdf_parse_write_options(fz_context *ctx, pdf_write_options *opts, const char *args);
-
-/*
-	pdf_has_unsaved_sigs: Returns true if there are digital signatures waiting to
-	to updated on save.
-*/
-int pdf_has_unsaved_sigs(fz_context *ctx, pdf_document *doc);
-
-/*
-	pdf_write_document: Write out the document to an output stream with all changes finalised.
-
-	This method will throw an error if pdf_has_unsaved_sigs.
-*/
-void pdf_write_document(fz_context *ctx, pdf_document *doc, fz_output *out, pdf_write_options *opts);
-
-/*
-	pdf_save_document: Write out the document to a file with all changes finalised.
-*/
-void pdf_save_document(fz_context *ctx, pdf_document *doc, const char *filename, pdf_write_options *opts);
-
-/*
-	pdf_can_be_saved_incrementally: Return true if the document can be saved
-	incrementally. (e.g. it has not been repaired, and it is not encrypted)
-*/
-int pdf_can_be_saved_incrementally(fz_context *ctx, pdf_document *doc);
-
-#endif

+ 0 - 216
server/lib/xfdftool/include/mupdf/pdf/event.h

@@ -1,216 +0,0 @@
-#ifndef MUPDF_PDF_EVENT_H
-#define MUPDF_PDF_EVENT_H
-
-enum
-{
-	HOTSPOT_POINTER_DOWN = 0x1,
-	HOTSPOT_POINTER_OVER = 0x2
-};
-
-/* Types of UI event */
-enum
-{
-	PDF_EVENT_TYPE_POINTER,
-};
-
-/* Types of pointer event */
-enum
-{
-	PDF_POINTER_DOWN,
-	PDF_POINTER_UP,
-};
-
-/*
-	UI events that can be passed to an interactive document.
-*/
-typedef struct pdf_ui_event_s
-{
-	int etype;
-	union
-	{
-		struct
-		{
-			int ptype;
-			fz_point pt;
-		} pointer;
-	} event;
-} pdf_ui_event;
-
-/*
-	pdf_init_ui_pointer_event: Set up a pointer event
-*/
-void pdf_init_ui_pointer_event(pdf_ui_event *event, int type, float x, float y);
-
-/*
-	Document events: the objects via which MuPDF informs the calling app
-	of occurrences emanating from the document, possibly from user interaction
-	or javascript execution. MuPDF informs the app of document events via a
-	callback.
-*/
-
-/*
-	pdf_pass_event: Pass a UI event to an interactive
-	document.
-
-	Returns a boolean indication of whether the ui_event was
-	handled. Example of use for the return value: when considering
-	passing the events that make up a drag, if the down event isn't
-	accepted then don't send the move events or the up event.
-*/
-int pdf_pass_event(fz_context *ctx, pdf_document *doc, pdf_page *page, pdf_ui_event *ui_event);
-
-struct pdf_doc_event_s
-{
-	int type;
-};
-
-enum
-{
-	PDF_DOCUMENT_EVENT_ALERT,
-	PDF_DOCUMENT_EVENT_PRINT,
-	PDF_DOCUMENT_EVENT_LAUNCH_URL,
-	PDF_DOCUMENT_EVENT_MAIL_DOC,
-	PDF_DOCUMENT_EVENT_SUBMIT,
-	PDF_DOCUMENT_EVENT_EXEC_MENU_ITEM,
-	PDF_DOCUMENT_EVENT_EXEC_DIALOG
-};
-
-/*
-	pdf_set_doc_event_callback: set the function via which to receive
-	document events.
-*/
-void pdf_set_doc_event_callback(fz_context *ctx, pdf_document *doc, pdf_doc_event_cb *event_cb, void *data);
-
-/*
-	The various types of document events
-*/
-
-/*
-	pdf_alert_event: details of an alert event. In response the app should
-	display an alert dialog with the buttons specified by "button_type_group".
-	If "check_box_message" is non-NULL, a checkbox should be displayed in
-	the lower-left corned along with the message.
-
-	"finally_checked" and "button_pressed" should be set by the app
-	before returning from the callback. "finally_checked" need be set
-	only if "check_box_message" is non-NULL.
-*/
-typedef struct
-{
-	const char *message;
-	int icon_type;
-	int button_group_type;
-	const char *title;
-	const char *check_box_message;
-	int initially_checked;
-	int finally_checked;
-	int button_pressed;
-} pdf_alert_event;
-
-/* Possible values of icon_type */
-enum
-{
-	PDF_ALERT_ICON_ERROR,
-	PDF_ALERT_ICON_WARNING,
-	PDF_ALERT_ICON_QUESTION,
-	PDF_ALERT_ICON_STATUS
-};
-
-/* Possible values of button_group_type */
-enum
-{
-	PDF_ALERT_BUTTON_GROUP_OK,
-	PDF_ALERT_BUTTON_GROUP_OK_CANCEL,
-	PDF_ALERT_BUTTON_GROUP_YES_NO,
-	PDF_ALERT_BUTTON_GROUP_YES_NO_CANCEL
-};
-
-/* Possible values of button_pressed */
-enum
-{
-	PDF_ALERT_BUTTON_NONE,
-	PDF_ALERT_BUTTON_OK,
-	PDF_ALERT_BUTTON_CANCEL,
-	PDF_ALERT_BUTTON_NO,
-	PDF_ALERT_BUTTON_YES
-};
-
-/*
-	pdf_access_alert_event: access the details of an alert event
-	The returned pointer and all the data referred to by the
-	structure are owned by mupdf and need not be freed by the
-	caller.
-*/
-pdf_alert_event *pdf_access_alert_event(fz_context *ctx, pdf_doc_event *event);
-
-/*
-	pdf_access_exec_menu_item_event: access the details of am execMenuItem
-	event, which consists of just the name of the menu item
-*/
-const char *pdf_access_exec_menu_item_event(fz_context *ctx, pdf_doc_event *event);
-
-/*
-	pdf_submit_event: details of a submit event. The app should submit
-	the specified data to the specified url. "get" determines whether
-	to use the GET or POST method.
-*/
-typedef struct
-{
-	char *url;
-	char *data;
-	int data_len;
-	int get;
-} pdf_submit_event;
-
-/*
-	pdf_access_submit_event: access the details of a submit event
-	The returned pointer and all data referred to by the structure are
-	owned by mupdf and need not be freed by the caller.
-*/
-pdf_submit_event *pdf_access_submit_event(fz_context *ctx, pdf_doc_event *event);
-
-/*
-	pdf_launch_url_event: details of a launch-url event. The app should
-	open the url, either in a new frame or in the current window.
-*/
-typedef struct
-{
-	const char *url;
-	int new_frame;
-} pdf_launch_url_event;
-
-/*
-	pdf_access_launch_url_event: access the details of a launch-url
-	event. The returned pointer and all data referred to by the structure
-	are owned by mupdf and need not be freed by the caller.
-*/
-pdf_launch_url_event *pdf_access_launch_url_event(fz_context *ctx, pdf_doc_event *event);
-
-/*
-	pdf_mail_doc_event: details of a mail_doc event. The app should save
-	the current state of the document and email it using the specified
-	parameters.
-*/
-typedef struct
-{
-	int ask_user;
-	const char *to;
-	const char *cc;
-	const char *bcc;
-	const char *subject;
-	const char *message;
-} pdf_mail_doc_event;
-
-/*
-	pdf_access_mail_doc_event: access the details of a mail-doc event.
-*/
-pdf_mail_doc_event *pdf_access_mail_doc_event(fz_context *ctx, pdf_doc_event *event);
-
-void pdf_event_issue_alert(fz_context *ctx, pdf_document *doc, pdf_alert_event *event);
-void pdf_event_issue_print(fz_context *ctx, pdf_document *doc);
-void pdf_event_issue_exec_menu_item(fz_context *ctx, pdf_document *doc, const char *item);
-void pdf_event_issue_exec_dialog(fz_context *ctx, pdf_document *doc);
-void pdf_event_issue_launch_url(fz_context *ctx, pdf_document *doc, const char *url, int new_frame);
-void pdf_event_issue_mail_doc(fz_context *ctx, pdf_document *doc, pdf_mail_doc_event *event);
-
-#endif

+ 0 - 56
server/lib/xfdftool/include/mupdf/pdf/field.h

@@ -1,56 +0,0 @@
-#ifndef MUPDF_PDF_FIELD_H
-#define MUPDF_PDF_FIELD_H
-
-/* Field flags */
-enum
-{
-	/* Common to all field types */
-	Ff_ReadOnly = 1 << (1-1),
-	Ff_Required = 1 << (2-1),
-	Ff_NoExport = 1 << (3-1),
-
-	/* Text fields */
-	Ff_Multiline = 1 << (13-1),
-	Ff_Password = 1 << (14-1),
-
-	Ff_FileSelect = 1 << (21-1),
-	Ff_DoNotSpellCheck = 1 << (23-1),
-	Ff_DoNotScroll = 1 << (24-1),
-	Ff_Comb = 1 << (25-1),
-	Ff_RichText = 1 << (26-1),
-
-	/* Button fields */
-	Ff_NoToggleToOff = 1 << (15-1),
-	Ff_Radio = 1 << (16-1),
-	Ff_Pushbutton = 1 << (17-1),
-	Ff_RadioInUnison = 1 << (26-1),
-
-	/* Choice fields */
-	Ff_Combo = 1 << (18-1),
-	Ff_Edit = 1 << (19-1),
-	Ff_Sort = 1 << (20-1),
-	Ff_MultiSelect = 1 << (22-1),
-	Ff_CommitOnSelCHange = 1 << (27-1),
-};
-
-char *pdf_get_string_or_stream(fz_context *ctx, pdf_document *doc, pdf_obj *obj);
-pdf_obj *pdf_get_inheritable(fz_context *ctx, pdf_document *doc, pdf_obj *obj, pdf_obj *key);
-int pdf_get_field_flags(fz_context *ctx, pdf_document *doc, pdf_obj *obj);
-int pdf_field_type(fz_context *ctx, pdf_document *doc, pdf_obj *field);
-void pdf_set_field_type(fz_context *ctx, pdf_document *doc, pdf_obj *obj, int type);
-char *pdf_field_value(fz_context *ctx, pdf_document *doc, pdf_obj *field);
-int pdf_field_set_value(fz_context *ctx, pdf_document *doc, pdf_obj *field, const char *text);
-char *pdf_field_border_style(fz_context *ctx, pdf_document *doc, pdf_obj *field);
-void pdf_field_set_border_style(fz_context *ctx, pdf_document *doc, pdf_obj *field, const char *text);
-void pdf_field_set_button_caption(fz_context *ctx, pdf_document *doc, pdf_obj *field, const char *text);
-void pdf_field_set_fill_color(fz_context *ctx, pdf_document *doc, pdf_obj *field, pdf_obj *col);
-void pdf_field_set_text_color(fz_context *ctx, pdf_document *doc, pdf_obj *field, pdf_obj *col);
-void pdf_signature_set_value(fz_context *ctx, pdf_document *doc, pdf_obj *field, pdf_signer *signer);
-int pdf_field_display(fz_context *ctx, pdf_document *doc, pdf_obj *field);
-char *pdf_field_name(fz_context *ctx, pdf_document *doc, pdf_obj *field);
-void pdf_field_set_display(fz_context *ctx, pdf_document *doc, pdf_obj *field, int d);
-pdf_obj *pdf_lookup_field(fz_context *ctx, pdf_obj *form, char *name);
-void pdf_field_reset(fz_context *ctx, pdf_document *doc, pdf_obj *field);
-int pdf_signatures_supported(fz_context *ctx);
-
-#endif

+ 0 - 129
server/lib/xfdftool/include/mupdf/pdf/font.h

@@ -1,129 +0,0 @@
-#ifndef MUPDF_PDF_FONT_H
-#define MUPDF_PDF_FONT_H
-
-/*
- * Font
- */
-
-enum
-{
-	PDF_FD_FIXED_PITCH = 1 << 0,
-	PDF_FD_SERIF = 1 << 1,
-	PDF_FD_SYMBOLIC = 1 << 2,
-	PDF_FD_SCRIPT = 1 << 3,
-	PDF_FD_NONSYMBOLIC = 1 << 5,
-	PDF_FD_ITALIC = 1 << 6,
-	PDF_FD_ALL_CAP = 1 << 16,
-	PDF_FD_SMALL_CAP = 1 << 17,
-	PDF_FD_FORCE_BOLD = 1 << 18
-};
-
-void pdf_load_encoding(const char **estrings, char *encoding);
-int pdf_lookup_agl(const char *name);
-const char **pdf_lookup_agl_duplicates(int ucs);
-
-extern const unsigned short pdf_doc_encoding[256];
-extern const char * const pdf_mac_roman[256];
-extern const char * const pdf_mac_expert[256];
-extern const char * const pdf_win_ansi[256];
-extern const char * const pdf_standard[256];
-
-typedef struct pdf_font_desc_s pdf_font_desc;
-typedef struct pdf_hmtx_s pdf_hmtx;
-typedef struct pdf_vmtx_s pdf_vmtx;
-
-struct pdf_hmtx_s
-{
-	unsigned short lo;
-	unsigned short hi;
-	int w;	/* type3 fonts can be big! */
-};
-
-struct pdf_vmtx_s
-{
-	unsigned short lo;
-	unsigned short hi;
-	short x;
-	short y;
-	short w;
-};
-
-struct pdf_font_desc_s
-{
-	fz_storable storable;
-	size_t size;
-
-	fz_font *font;
-
-	/* FontDescriptor */
-	int flags;
-	float italic_angle;
-	float ascent;
-	float descent;
-	float cap_height;
-	float x_height;
-	float missing_width;
-
-	/* Encoding (CMap) */
-	pdf_cmap *encoding;
-	pdf_cmap *to_ttf_cmap;
-	size_t cid_to_gid_len;
-	unsigned short *cid_to_gid;
-
-	/* ToUnicode */
-	pdf_cmap *to_unicode;
-	size_t cid_to_ucs_len;
-	unsigned short *cid_to_ucs;
-
-	/* Metrics (given in the PDF file) */
-	int wmode;
-
-	int hmtx_len, hmtx_cap;
-	pdf_hmtx dhmtx;
-	pdf_hmtx *hmtx;
-
-	int vmtx_len, vmtx_cap;
-	pdf_vmtx dvmtx;
-	pdf_vmtx *vmtx;
-
-	int is_embedded;
-};
-
-void pdf_set_font_wmode(fz_context *ctx, pdf_font_desc *font, int wmode);
-void pdf_set_default_hmtx(fz_context *ctx, pdf_font_desc *font, int w);
-void pdf_set_default_vmtx(fz_context *ctx, pdf_font_desc *font, int y, int w);
-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_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(fz_context *ctx, pdf_document *doc, pdf_font_desc *font, const char **strings, char *collection, pdf_obj *cmapstm);
-
-int pdf_font_cid_to_gid(fz_context *ctx, pdf_font_desc *fontdesc, int cid);
-
-const char *pdf_lookup_substitute_font(fz_context *ctx, int mono, int serif, int bold, int italic, int *len);
-
-pdf_font_desc *pdf_load_type3_font(fz_context *ctx, pdf_document *doc, pdf_obj *rdb, pdf_obj *obj);
-void pdf_load_type3_glyphs(fz_context *ctx, pdf_document *doc, pdf_font_desc *fontdesc, int nestedDepth);
-pdf_font_desc *pdf_load_font(fz_context *ctx, pdf_document *doc, pdf_obj *rdb, pdf_obj *obj, int nestedDepth);
-pdf_font_desc *pdf_load_hail_mary_font(fz_context *ctx, pdf_document *doc);
-
-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_print_font(fz_context *ctx, fz_output *out, pdf_font_desc *fontdesc);
-
-fz_rect *pdf_measure_text(fz_context *ctx, pdf_font_desc *fontdesc, unsigned char *buf, size_t len, fz_rect *rect);
-float pdf_text_stride(fz_context *ctx, pdf_font_desc *fontdesc, float fontsize, unsigned char *buf, size_t len, float room, size_t *count);
-
-void pdf_run_glyph(fz_context *ctx, pdf_document *doc, pdf_obj *resources, fz_buffer *contents, fz_device *dev, const fz_matrix *ctm, void *gstate, int nestedDepth);
-
-pdf_obj *pdf_add_simple_font(fz_context *ctx, pdf_document *doc, fz_font *font);
-pdf_obj *pdf_add_cid_font(fz_context *ctx, pdf_document *doc, fz_font *font);
-
-int pdf_font_writing_supported(fz_font *font);
-
-#endif

+ 0 - 167
server/lib/xfdftool/include/mupdf/pdf/interpret.h

@@ -1,167 +0,0 @@
-#ifndef PDF_INTERPRET_H
-#define PDF_INTERPRET_H
-
-typedef struct pdf_csi_s pdf_csi;
-typedef struct pdf_gstate_s pdf_gstate;
-typedef struct pdf_processor_s pdf_processor;
-
-void *pdf_new_processor(fz_context *ctx, int size);
-void pdf_close_processor(fz_context *ctx, pdf_processor *proc);
-void pdf_drop_processor(fz_context *ctx, pdf_processor *proc);
-
-struct pdf_processor_s
-{
-	void (*close_processor)(fz_context *ctx, pdf_processor *proc);
-	void (*drop_processor)(fz_context *ctx, pdf_processor *proc);
-
-	/* general graphics state */
-	void (*op_w)(fz_context *ctx, pdf_processor *proc, float linewidth);
-	void (*op_j)(fz_context *ctx, pdf_processor *proc, int linejoin);
-	void (*op_J)(fz_context *ctx, pdf_processor *proc, int linecap);
-	void (*op_M)(fz_context *ctx, pdf_processor *proc, float miterlimit);
-	void (*op_d)(fz_context *ctx, pdf_processor *proc, pdf_obj *array, float phase);
-	void (*op_ri)(fz_context *ctx, pdf_processor *proc, const char *intent);
-	void (*op_i)(fz_context *ctx, pdf_processor *proc, float flatness);
-
-	void (*op_gs_begin)(fz_context *ctx, pdf_processor *proc, const char *name, pdf_obj *extgstate);
-	void (*op_gs_BM)(fz_context *ctx, pdf_processor *proc, const char *blendmode);
-	void (*op_gs_ca)(fz_context *ctx, pdf_processor *proc, float alpha);
-	void (*op_gs_CA)(fz_context *ctx, pdf_processor *proc, float alpha);
-	void (*op_gs_SMask)(fz_context *ctx, pdf_processor *proc, pdf_xobject *smask, pdf_obj *page_resources, float *bc, int luminosity);
-	void (*op_gs_end)(fz_context *ctx, pdf_processor *proc);
-
-	/* special graphics state */
-	void (*op_q)(fz_context *ctx, pdf_processor *proc);
-	void (*op_Q)(fz_context *ctx, pdf_processor *proc);
-	void (*op_cm)(fz_context *ctx, pdf_processor *proc, float a, float b, float c, float d, float e, float f);
-
-	/* path construction */
-	void (*op_m)(fz_context *ctx, pdf_processor *proc, float x, float y);
-	void (*op_l)(fz_context *ctx, pdf_processor *proc, float x, float y);
-	void (*op_c)(fz_context *ctx, pdf_processor *proc, float x1, float y1, float x2, float y2, float x3, float y3);
-	void (*op_v)(fz_context *ctx, pdf_processor *proc, float x2, float y2, float x3, float y3);
-	void (*op_y)(fz_context *ctx, pdf_processor *proc, float x1, float y1, float x3, float y3);
-	void (*op_h)(fz_context *ctx, pdf_processor *proc);
-	void (*op_re)(fz_context *ctx, pdf_processor *proc, float x, float y, float w, float h);
-
-	/* path painting */
-	void (*op_S)(fz_context *ctx, pdf_processor *proc);
-	void (*op_s)(fz_context *ctx, pdf_processor *proc);
-	void (*op_F)(fz_context *ctx, pdf_processor *proc);
-	void (*op_f)(fz_context *ctx, pdf_processor *proc);
-	void (*op_fstar)(fz_context *ctx, pdf_processor *proc);
-	void (*op_B)(fz_context *ctx, pdf_processor *proc);
-	void (*op_Bstar)(fz_context *ctx, pdf_processor *proc);
-	void (*op_b)(fz_context *ctx, pdf_processor *proc);
-	void (*op_bstar)(fz_context *ctx, pdf_processor *proc);
-	void (*op_n)(fz_context *ctx, pdf_processor *proc);
-
-	/* clipping paths */
-	void (*op_W)(fz_context *ctx, pdf_processor *proc);
-	void (*op_Wstar)(fz_context *ctx, pdf_processor *proc);
-
-	/* text objects */
-	void (*op_BT)(fz_context *ctx, pdf_processor *proc);
-	void (*op_ET)(fz_context *ctx, pdf_processor *proc);
-
-	/* text state */
-	void (*op_Tc)(fz_context *ctx, pdf_processor *proc, float charspace);
-	void (*op_Tw)(fz_context *ctx, pdf_processor *proc, float wordspace);
-	void (*op_Tz)(fz_context *ctx, pdf_processor *proc, float scale);
-	void (*op_TL)(fz_context *ctx, pdf_processor *proc, float leading);
-	void (*op_Tf)(fz_context *ctx, pdf_processor *proc, const char *name, pdf_font_desc *font, float size);
-	void (*op_Tr)(fz_context *ctx, pdf_processor *proc, int render);
-	void (*op_Ts)(fz_context *ctx, pdf_processor *proc, float rise);
-
-	/* text positioning */
-	void (*op_Td)(fz_context *ctx, pdf_processor *proc, float tx, float ty);
-	void (*op_TD)(fz_context *ctx, pdf_processor *proc, float tx, float ty);
-	void (*op_Tm)(fz_context *ctx, pdf_processor *proc, float a, float b, float c, float d, float e, float f);
-	void (*op_Tstar)(fz_context *ctx, pdf_processor *proc);
-
-	/* text showing */
-	void (*op_TJ)(fz_context *ctx, pdf_processor *proc, pdf_obj *array);
-	void (*op_Tj)(fz_context *ctx, pdf_processor *proc, char *str, int len);
-	void (*op_squote)(fz_context *ctx, pdf_processor *proc, char *str, int len);
-	void (*op_dquote)(fz_context *ctx, pdf_processor *proc, float aw, float ac, char *str, int len);
-
-	/* type 3 fonts */
-	void (*op_d0)(fz_context *ctx, pdf_processor *proc, float wx, float wy);
-	void (*op_d1)(fz_context *ctx, pdf_processor *proc, float wx, float wy, float llx, float lly, float urx, float ury);
-
-	/* color */
-	void (*op_CS)(fz_context *ctx, pdf_processor *proc, const char *name, fz_colorspace *cs);
-	void (*op_cs)(fz_context *ctx, pdf_processor *proc, const char *name, fz_colorspace *cs);
-	void (*op_SC_pattern)(fz_context *ctx, pdf_processor *proc, const char *name, pdf_pattern *pat, int n, float *color);
-	void (*op_sc_pattern)(fz_context *ctx, pdf_processor *proc, const char *name, pdf_pattern *pat, int n, float *color);
-	void (*op_SC_shade)(fz_context *ctx, pdf_processor *proc, const char *name, fz_shade *shade);
-	void (*op_sc_shade)(fz_context *ctx, pdf_processor *proc, const char *name, fz_shade *shade);
-	void (*op_SC_color)(fz_context *ctx, pdf_processor *proc, int n, float *color);
-	void (*op_sc_color)(fz_context *ctx, pdf_processor *proc, int n, float *color);
-
-	void (*op_G)(fz_context *ctx, pdf_processor *proc, float g);
-	void (*op_g)(fz_context *ctx, pdf_processor *proc, float g);
-	void (*op_RG)(fz_context *ctx, pdf_processor *proc, float r, float g, float b);
-	void (*op_rg)(fz_context *ctx, pdf_processor *proc, float r, float g, float b);
-	void (*op_K)(fz_context *ctx, pdf_processor *proc, float c, float m, float y, float k);
-	void (*op_k)(fz_context *ctx, pdf_processor *proc, float c, float m, float y, float k);
-
-	/* shadings, images, xobjects */
-	void (*op_BI)(fz_context *ctx, pdf_processor *proc, fz_image *image);
-	void (*op_sh)(fz_context *ctx, pdf_processor *proc, const char *name, fz_shade *shade);
-	void (*op_Do_image)(fz_context *ctx, pdf_processor *proc, const char *name, fz_image *image);
-	void (*op_Do_form)(fz_context *ctx, pdf_processor *proc, const char *name, pdf_xobject *form, pdf_obj *page_resources);
-
-	/* marked content */
-	void (*op_MP)(fz_context *ctx, pdf_processor *proc, const char *tag);
-	void (*op_DP)(fz_context *ctx, pdf_processor *proc, const char *tag, pdf_obj *raw, pdf_obj *cooked);
-	void (*op_BMC)(fz_context *ctx, pdf_processor *proc, const char *tag);
-	void (*op_BDC)(fz_context *ctx, pdf_processor *proc, const char *tag, pdf_obj *raw, pdf_obj *cooked);
-	void (*op_EMC)(fz_context *ctx, pdf_processor *proc);
-
-	/* compatibility */
-	void (*op_BX)(fz_context *ctx, pdf_processor *proc);
-	void (*op_EX)(fz_context *ctx, pdf_processor *proc);
-
-	/* END is used to signify end of stream (finalise and close down) */
-	void (*op_END)(fz_context *ctx, pdf_processor *proc);
-
-	/* interpreter state that persists across content streams */
-	const char *usage;
-	int hidden;
-};
-
-struct pdf_csi_s
-{
-	/* input */
-	pdf_document *doc;
-	pdf_obj *rdb;
-	pdf_lexbuf *buf;
-	fz_cookie *cookie;
-
-	/* state */
-	int gstate;
-	int xbalance;
-	int in_text;
-	fz_rect d1_rect;
-
-	/* stack */
-	pdf_obj *obj;
-	char name[256];
-	char string[256];
-	int string_len;
-	int top;
-	float stack[32];
-};
-
-/* Functions to set up pdf_process structures */
-pdf_processor *pdf_new_run_processor(fz_context *ctx, fz_device *dev, const fz_matrix *ctm, const char *usage, pdf_gstate *gstate, int nested);
-pdf_processor *pdf_new_buffer_processor(fz_context *ctx, fz_buffer *buffer, int ahxencode);
-pdf_processor *pdf_new_filter_processor(fz_context *ctx, pdf_processor *chain, pdf_document *doc, pdf_obj *old_res, pdf_obj *new_res);
-
-/* Functions to actually process annotations, glyphs and general stream objects */
-void pdf_process_contents(fz_context *ctx, pdf_processor *proc, pdf_document *doc, pdf_obj *obj, pdf_obj *res, fz_cookie *cookie);
-void pdf_process_annot(fz_context *ctx, pdf_processor *proc, pdf_document *doc, pdf_page *page, pdf_annot *annot, fz_cookie *cookie);
-void pdf_process_glyph(fz_context *ctx, pdf_processor *proc, pdf_document *doc, pdf_obj *resources, fz_buffer *contents);
-
-#endif

+ 0 - 20
server/lib/xfdftool/include/mupdf/pdf/javascript.h

@@ -1,20 +0,0 @@
-#ifndef MUPDF_PDF_JAVASCRIPT_H
-#define MUPDF_PDF_JAVASCRIPT_H
-
-typedef struct pdf_js_event_s
-{
-	pdf_obj *target;
-	char *value;
-	int rc;
-} pdf_js_event;
-
-void pdf_enable_js(fz_context *ctx, pdf_document *doc);
-void pdf_disable_js(fz_context *ctx, pdf_document *doc);
-int pdf_js_supported(fz_context *ctx, pdf_document *doc);
-void pdf_drop_js(fz_context *ctx, pdf_js *js);
-
-void pdf_js_setup_event(pdf_js *js, pdf_js_event *e);
-pdf_js_event *pdf_js_get_event(pdf_js *js);
-void pdf_js_execute(pdf_js *js, char *code);
-
-#endif

+ 0 - 792
server/lib/xfdftool/include/mupdf/pdf/name-table.h

@@ -1,792 +0,0 @@
-enum
-{
-	PDF_OBJ_ENUM__DUMMY,
-#define PDF_NAME_3D  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_3D)
-	PDF_OBJ_ENUM_NAME_3D,
-#define PDF_NAME_A  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_A)
-	PDF_OBJ_ENUM_NAME_A,
-#define PDF_NAME_A85  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_A85)
-	PDF_OBJ_ENUM_NAME_A85,
-#define PDF_NAME_AA  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_AA)
-	PDF_OBJ_ENUM_NAME_AA,
-#define PDF_NAME_AESV2  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_AESV2)
-	PDF_OBJ_ENUM_NAME_AESV2,
-#define PDF_NAME_AESV3  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_AESV3)
-	PDF_OBJ_ENUM_NAME_AESV3,
-#define PDF_NAME_AHx  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_AHx)
-	PDF_OBJ_ENUM_NAME_AHx,
-#define PDF_NAME_AP  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_AP)
-	PDF_OBJ_ENUM_NAME_AP,
-#define PDF_NAME_AS  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_AS)
-	PDF_OBJ_ENUM_NAME_AS,
-#define PDF_NAME_ASCII85Decode  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_ASCII85Decode)
-	PDF_OBJ_ENUM_NAME_ASCII85Decode,
-#define PDF_NAME_ASCIIHexDecode  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_ASCIIHexDecode)
-	PDF_OBJ_ENUM_NAME_ASCIIHexDecode,
-#define PDF_NAME_AcroForm  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_AcroForm)
-	PDF_OBJ_ENUM_NAME_AcroForm,
-#define PDF_NAME_Adobe_PPKLite  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Adobe_PPKLite)
-	PDF_OBJ_ENUM_NAME_Adobe_PPKLite,
-#define PDF_NAME_All  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_All)
-	PDF_OBJ_ENUM_NAME_All,
-#define PDF_NAME_AllOff  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_AllOff)
-	PDF_OBJ_ENUM_NAME_AllOff,
-#define PDF_NAME_AllOn  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_AllOn)
-	PDF_OBJ_ENUM_NAME_AllOn,
-#define PDF_NAME_Alpha  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Alpha)
-	PDF_OBJ_ENUM_NAME_Alpha,
-#define PDF_NAME_Alternate  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Alternate)
-	PDF_OBJ_ENUM_NAME_Alternate,
-#define PDF_NAME_Annot  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Annot)
-	PDF_OBJ_ENUM_NAME_Annot,
-#define PDF_NAME_Annots  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Annots)
-	PDF_OBJ_ENUM_NAME_Annots,
-#define PDF_NAME_AnyOff  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_AnyOff)
-	PDF_OBJ_ENUM_NAME_AnyOff,
-#define PDF_NAME_ArtBox  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_ArtBox)
-	PDF_OBJ_ENUM_NAME_ArtBox,
-#define PDF_NAME_Ascent  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Ascent)
-	PDF_OBJ_ENUM_NAME_Ascent,
-#define PDF_NAME_B  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_B)
-	PDF_OBJ_ENUM_NAME_B,
-#define PDF_NAME_BBox  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_BBox)
-	PDF_OBJ_ENUM_NAME_BBox,
-#define PDF_NAME_BC  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_BC)
-	PDF_OBJ_ENUM_NAME_BC,
-#define PDF_NAME_BE  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_BE)
-	PDF_OBJ_ENUM_NAME_BE,
-#define PDF_NAME_BG  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_BG)
-	PDF_OBJ_ENUM_NAME_BG,
-#define PDF_NAME_BM  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_BM)
-	PDF_OBJ_ENUM_NAME_BM,
-#define PDF_NAME_BPC  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_BPC)
-	PDF_OBJ_ENUM_NAME_BPC,
-#define PDF_NAME_BS  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_BS)
-	PDF_OBJ_ENUM_NAME_BS,
-#define PDF_NAME_Background  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Background)
-	PDF_OBJ_ENUM_NAME_Background,
-#define PDF_NAME_BaseEncoding  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_BaseEncoding)
-	PDF_OBJ_ENUM_NAME_BaseEncoding,
-#define PDF_NAME_BaseFont  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_BaseFont)
-	PDF_OBJ_ENUM_NAME_BaseFont,
-#define PDF_NAME_BaseState  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_BaseState)
-	PDF_OBJ_ENUM_NAME_BaseState,
-#define PDF_NAME_BitsPerComponent  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_BitsPerComponent)
-	PDF_OBJ_ENUM_NAME_BitsPerComponent,
-#define PDF_NAME_BitsPerCoordinate  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_BitsPerCoordinate)
-	PDF_OBJ_ENUM_NAME_BitsPerCoordinate,
-#define PDF_NAME_BitsPerFlag  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_BitsPerFlag)
-	PDF_OBJ_ENUM_NAME_BitsPerFlag,
-#define PDF_NAME_BitsPerSample  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_BitsPerSample)
-	PDF_OBJ_ENUM_NAME_BitsPerSample,
-#define PDF_NAME_BlackIs1  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_BlackIs1)
-	PDF_OBJ_ENUM_NAME_BlackIs1,
-#define PDF_NAME_BleedBox  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_BleedBox)
-	PDF_OBJ_ENUM_NAME_BleedBox,
-#define PDF_NAME_Blinds  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Blinds)
-	PDF_OBJ_ENUM_NAME_Blinds,
-#define PDF_NAME_Border  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Border)
-	PDF_OBJ_ENUM_NAME_Border,
-#define PDF_NAME_Bounds  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Bounds)
-	PDF_OBJ_ENUM_NAME_Bounds,
-#define PDF_NAME_Box  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Box)
-	PDF_OBJ_ENUM_NAME_Box,
-#define PDF_NAME_Bt  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Bt)
-	PDF_OBJ_ENUM_NAME_Bt,
-#define PDF_NAME_Btn  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Btn)
-	PDF_OBJ_ENUM_NAME_Btn,
-#define PDF_NAME_ByteRange  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_ByteRange)
-	PDF_OBJ_ENUM_NAME_ByteRange,
-#define PDF_NAME_C  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_C)
-	PDF_OBJ_ENUM_NAME_C,
-#define PDF_NAME_C0  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_C0)
-	PDF_OBJ_ENUM_NAME_C0,
-#define PDF_NAME_C1  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_C1)
-	PDF_OBJ_ENUM_NAME_C1,
-#define PDF_NAME_CA  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_CA)
-	PDF_OBJ_ENUM_NAME_CA,
-#define PDF_NAME_CCF  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_CCF)
-	PDF_OBJ_ENUM_NAME_CCF,
-#define PDF_NAME_CCITTFaxDecode  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_CCITTFaxDecode)
-	PDF_OBJ_ENUM_NAME_CCITTFaxDecode,
-#define PDF_NAME_CF  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_CF)
-	PDF_OBJ_ENUM_NAME_CF,
-#define PDF_NAME_CFM  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_CFM)
-	PDF_OBJ_ENUM_NAME_CFM,
-#define PDF_NAME_CI  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_CI)
-	PDF_OBJ_ENUM_NAME_CI,
-#define PDF_NAME_CIDFontType0  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_CIDFontType0)
-	PDF_OBJ_ENUM_NAME_CIDFontType0,
-#define PDF_NAME_CIDFontType0C  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_CIDFontType0C)
-	PDF_OBJ_ENUM_NAME_CIDFontType0C,
-#define PDF_NAME_CIDFontType2  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_CIDFontType2)
-	PDF_OBJ_ENUM_NAME_CIDFontType2,
-#define PDF_NAME_CIDSystemInfo  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_CIDSystemInfo)
-	PDF_OBJ_ENUM_NAME_CIDSystemInfo,
-#define PDF_NAME_CIDToGIDMap  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_CIDToGIDMap)
-	PDF_OBJ_ENUM_NAME_CIDToGIDMap,
-#define PDF_NAME_CMYK  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_CMYK)
-	PDF_OBJ_ENUM_NAME_CMYK,
-#define PDF_NAME_CS  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_CS)
-	PDF_OBJ_ENUM_NAME_CS,
-#define PDF_NAME_CalCMYK  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_CalCMYK)
-	PDF_OBJ_ENUM_NAME_CalCMYK,
-#define PDF_NAME_CalGray  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_CalGray)
-	PDF_OBJ_ENUM_NAME_CalGray,
-#define PDF_NAME_CalRGB  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_CalRGB)
-	PDF_OBJ_ENUM_NAME_CalRGB,
-#define PDF_NAME_CapHeight  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_CapHeight)
-	PDF_OBJ_ENUM_NAME_CapHeight,
-#define PDF_NAME_Caret  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Caret)
-	PDF_OBJ_ENUM_NAME_Caret,
-#define PDF_NAME_Catalog  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Catalog)
-	PDF_OBJ_ENUM_NAME_Catalog,
-#define PDF_NAME_Ch  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Ch)
-	PDF_OBJ_ENUM_NAME_Ch,
-#define PDF_NAME_CharProcs  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_CharProcs)
-	PDF_OBJ_ENUM_NAME_CharProcs,
-#define PDF_NAME_Circle  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Circle)
-	PDF_OBJ_ENUM_NAME_Circle,
-#define PDF_NAME_Collection  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Collection)
-	PDF_OBJ_ENUM_NAME_Collection,
-#define PDF_NAME_ColorSpace  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_ColorSpace)
-	PDF_OBJ_ENUM_NAME_ColorSpace,
-#define PDF_NAME_ColorTransform  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_ColorTransform)
-	PDF_OBJ_ENUM_NAME_ColorTransform,
-#define PDF_NAME_Colors  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Colors)
-	PDF_OBJ_ENUM_NAME_Colors,
-#define PDF_NAME_Columns  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Columns)
-	PDF_OBJ_ENUM_NAME_Columns,
-#define PDF_NAME_Configs  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Configs)
-	PDF_OBJ_ENUM_NAME_Configs,
-#define PDF_NAME_Contents  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Contents)
-	PDF_OBJ_ENUM_NAME_Contents,
-#define PDF_NAME_Coords  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Coords)
-	PDF_OBJ_ENUM_NAME_Coords,
-#define PDF_NAME_Count  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Count)
-	PDF_OBJ_ENUM_NAME_Count,
-#define PDF_NAME_Cover  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Cover)
-	PDF_OBJ_ENUM_NAME_Cover,
-#define PDF_NAME_CreationDate  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_CreationDate)
-	PDF_OBJ_ENUM_NAME_CreationDate,
-#define PDF_NAME_Creator  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Creator)
-	PDF_OBJ_ENUM_NAME_Creator,
-#define PDF_NAME_CropBox  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_CropBox)
-	PDF_OBJ_ENUM_NAME_CropBox,
-#define PDF_NAME_Crypt  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Crypt)
-	PDF_OBJ_ENUM_NAME_Crypt,
-#define PDF_NAME_D  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_D)
-	PDF_OBJ_ENUM_NAME_D,
-#define PDF_NAME_DA  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_DA)
-	PDF_OBJ_ENUM_NAME_DA,
-#define PDF_NAME_DC  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_DC)
-	PDF_OBJ_ENUM_NAME_DC,
-#define PDF_NAME_DCT  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_DCT)
-	PDF_OBJ_ENUM_NAME_DCT,
-#define PDF_NAME_DCTDecode  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_DCTDecode)
-	PDF_OBJ_ENUM_NAME_DCTDecode,
-#define PDF_NAME_DL  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_DL)
-	PDF_OBJ_ENUM_NAME_DL,
-#define PDF_NAME_DOS  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_DOS)
-	PDF_OBJ_ENUM_NAME_DOS,
-#define PDF_NAME_DP  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_DP)
-	PDF_OBJ_ENUM_NAME_DP,
-#define PDF_NAME_DR  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_DR)
-	PDF_OBJ_ENUM_NAME_DR,
-#define PDF_NAME_DV  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_DV)
-	PDF_OBJ_ENUM_NAME_DV,
-#define PDF_NAME_DW  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_DW)
-	PDF_OBJ_ENUM_NAME_DW,
-#define PDF_NAME_DW2  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_DW2)
-	PDF_OBJ_ENUM_NAME_DW2,
-#define PDF_NAME_DamagedRowsBeforeError  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_DamagedRowsBeforeError)
-	PDF_OBJ_ENUM_NAME_DamagedRowsBeforeError,
-#define PDF_NAME_Decode  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Decode)
-	PDF_OBJ_ENUM_NAME_Decode,
-#define PDF_NAME_DecodeParms  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_DecodeParms)
-	PDF_OBJ_ENUM_NAME_DecodeParms,
-#define PDF_NAME_Default  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Default)
-	PDF_OBJ_ENUM_NAME_Default,
-#define PDF_NAME_Desc  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Desc)
-	PDF_OBJ_ENUM_NAME_Desc,
-#define PDF_NAME_DescendantFonts  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_DescendantFonts)
-	PDF_OBJ_ENUM_NAME_DescendantFonts,
-#define PDF_NAME_Descent  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Descent)
-	PDF_OBJ_ENUM_NAME_Descent,
-#define PDF_NAME_Design  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Design)
-	PDF_OBJ_ENUM_NAME_Design,
-#define PDF_NAME_Dest  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Dest)
-	PDF_OBJ_ENUM_NAME_Dest,
-#define PDF_NAME_Dests  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Dests)
-	PDF_OBJ_ENUM_NAME_Dests,
-#define PDF_NAME_DeviceCMYK  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_DeviceCMYK)
-	PDF_OBJ_ENUM_NAME_DeviceCMYK,
-#define PDF_NAME_DeviceGray  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_DeviceGray)
-	PDF_OBJ_ENUM_NAME_DeviceGray,
-#define PDF_NAME_DeviceN  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_DeviceN)
-	PDF_OBJ_ENUM_NAME_DeviceN,
-#define PDF_NAME_DeviceRGB  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_DeviceRGB)
-	PDF_OBJ_ENUM_NAME_DeviceRGB,
-#define PDF_NAME_Di  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Di)
-	PDF_OBJ_ENUM_NAME_Di,
-#define PDF_NAME_Differences  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Differences)
-	PDF_OBJ_ENUM_NAME_Differences,
-#define PDF_NAME_Dissolve  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Dissolve)
-	PDF_OBJ_ENUM_NAME_Dissolve,
-#define PDF_NAME_Dm  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Dm)
-	PDF_OBJ_ENUM_NAME_Dm,
-#define PDF_NAME_Domain  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Domain)
-	PDF_OBJ_ENUM_NAME_Domain,
-#define PDF_NAME_Dur  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Dur)
-	PDF_OBJ_ENUM_NAME_Dur,
-#define PDF_NAME_E  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_E)
-	PDF_OBJ_ENUM_NAME_E,
-#define PDF_NAME_EF  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_EF)
-	PDF_OBJ_ENUM_NAME_EF,
-#define PDF_NAME_EarlyChange  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_EarlyChange)
-	PDF_OBJ_ENUM_NAME_EarlyChange,
-#define PDF_NAME_EmbeddedFiles  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_EmbeddedFiles)
-	PDF_OBJ_ENUM_NAME_EmbeddedFiles,
-#define PDF_NAME_Encode  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Encode)
-	PDF_OBJ_ENUM_NAME_Encode,
-#define PDF_NAME_EncodedByteAlign  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_EncodedByteAlign)
-	PDF_OBJ_ENUM_NAME_EncodedByteAlign,
-#define PDF_NAME_Encoding  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Encoding)
-	PDF_OBJ_ENUM_NAME_Encoding,
-#define PDF_NAME_Encrypt  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Encrypt)
-	PDF_OBJ_ENUM_NAME_Encrypt,
-#define PDF_NAME_EncryptMetadata  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_EncryptMetadata)
-	PDF_OBJ_ENUM_NAME_EncryptMetadata,
-#define PDF_NAME_EndOfBlock  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_EndOfBlock)
-	PDF_OBJ_ENUM_NAME_EndOfBlock,
-#define PDF_NAME_EndOfLine  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_EndOfLine)
-	PDF_OBJ_ENUM_NAME_EndOfLine,
-#define PDF_NAME_Exclude  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Exclude)
-	PDF_OBJ_ENUM_NAME_Exclude,
-#define PDF_NAME_ExtGState  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_ExtGState)
-	PDF_OBJ_ENUM_NAME_ExtGState,
-#define PDF_NAME_Extend  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Extend)
-	PDF_OBJ_ENUM_NAME_Extend,
-#define PDF_NAME_F  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_F)
-	PDF_OBJ_ENUM_NAME_F,
-#define PDF_NAME_FL  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FL)
-	PDF_OBJ_ENUM_NAME_FL,
-#define PDF_NAME_FRM  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FRM)
-	PDF_OBJ_ENUM_NAME_FRM,
-#define PDF_NAME_FS  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FS)
-	PDF_OBJ_ENUM_NAME_FS,
-#define PDF_NAME_FT  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FT)
-	PDF_OBJ_ENUM_NAME_FT,
-#define PDF_NAME_Fade  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Fade)
-	PDF_OBJ_ENUM_NAME_Fade,
-#define PDF_NAME_Ff  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Ff)
-	PDF_OBJ_ENUM_NAME_Ff,
-#define PDF_NAME_Fields  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Fields)
-	PDF_OBJ_ENUM_NAME_Fields,
-#define PDF_NAME_FileAttachment  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FileAttachment)
-	PDF_OBJ_ENUM_NAME_FileAttachment,
-#define PDF_NAME_Filespec  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Filespec)
-	PDF_OBJ_ENUM_NAME_Filespec,
-#define PDF_NAME_Filter  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Filter)
-	PDF_OBJ_ENUM_NAME_Filter,
-#define PDF_NAME_First  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_First)
-	PDF_OBJ_ENUM_NAME_First,
-#define PDF_NAME_FirstChar  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FirstChar)
-	PDF_OBJ_ENUM_NAME_FirstChar,
-#define PDF_NAME_Fit  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Fit)
-	PDF_OBJ_ENUM_NAME_Fit,
-#define PDF_NAME_FitB  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FitB)
-	PDF_OBJ_ENUM_NAME_FitB,
-#define PDF_NAME_FitBH  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FitBH)
-	PDF_OBJ_ENUM_NAME_FitBH,
-#define PDF_NAME_FitBV  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FitBV)
-	PDF_OBJ_ENUM_NAME_FitBV,
-#define PDF_NAME_FitH  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FitH)
-	PDF_OBJ_ENUM_NAME_FitH,
-#define PDF_NAME_FitR  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FitR)
-	PDF_OBJ_ENUM_NAME_FitR,
-#define PDF_NAME_FitV  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FitV)
-	PDF_OBJ_ENUM_NAME_FitV,
-#define PDF_NAME_Fl  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Fl)
-	PDF_OBJ_ENUM_NAME_Fl,
-#define PDF_NAME_Flags  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Flags)
-	PDF_OBJ_ENUM_NAME_Flags,
-#define PDF_NAME_FlateDecode  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FlateDecode)
-	PDF_OBJ_ENUM_NAME_FlateDecode,
-#define PDF_NAME_Fly  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Fly)
-	PDF_OBJ_ENUM_NAME_Fly,
-#define PDF_NAME_Font  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Font)
-	PDF_OBJ_ENUM_NAME_Font,
-#define PDF_NAME_FontBBox  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FontBBox)
-	PDF_OBJ_ENUM_NAME_FontBBox,
-#define PDF_NAME_FontDescriptor  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FontDescriptor)
-	PDF_OBJ_ENUM_NAME_FontDescriptor,
-#define PDF_NAME_FontFile  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FontFile)
-	PDF_OBJ_ENUM_NAME_FontFile,
-#define PDF_NAME_FontFile2  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FontFile2)
-	PDF_OBJ_ENUM_NAME_FontFile2,
-#define PDF_NAME_FontFile3  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FontFile3)
-	PDF_OBJ_ENUM_NAME_FontFile3,
-#define PDF_NAME_FontMatrix  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FontMatrix)
-	PDF_OBJ_ENUM_NAME_FontMatrix,
-#define PDF_NAME_FontName  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FontName)
-	PDF_OBJ_ENUM_NAME_FontName,
-#define PDF_NAME_Form  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Form)
-	PDF_OBJ_ENUM_NAME_Form,
-#define PDF_NAME_FormType  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FormType)
-	PDF_OBJ_ENUM_NAME_FormType,
-#define PDF_NAME_FreeText  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FreeText)
-	PDF_OBJ_ENUM_NAME_FreeText,
-#define PDF_NAME_Function  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Function)
-	PDF_OBJ_ENUM_NAME_Function,
-#define PDF_NAME_FunctionType  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_FunctionType)
-	PDF_OBJ_ENUM_NAME_FunctionType,
-#define PDF_NAME_Functions  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Functions)
-	PDF_OBJ_ENUM_NAME_Functions,
-#define PDF_NAME_G  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_G)
-	PDF_OBJ_ENUM_NAME_G,
-#define PDF_NAME_Glitter  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Glitter)
-	PDF_OBJ_ENUM_NAME_Glitter,
-#define PDF_NAME_GoTo  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_GoTo)
-	PDF_OBJ_ENUM_NAME_GoTo,
-#define PDF_NAME_GoToR  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_GoToR)
-	PDF_OBJ_ENUM_NAME_GoToR,
-#define PDF_NAME_Group  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Group)
-	PDF_OBJ_ENUM_NAME_Group,
-#define PDF_NAME_H  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_H)
-	PDF_OBJ_ENUM_NAME_H,
-#define PDF_NAME_Height  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Height)
-	PDF_OBJ_ENUM_NAME_Height,
-#define PDF_NAME_Highlight  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Highlight)
-	PDF_OBJ_ENUM_NAME_Highlight,
-#define PDF_NAME_I  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_I)
-	PDF_OBJ_ENUM_NAME_I,
-#define PDF_NAME_IC  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_IC)
-	PDF_OBJ_ENUM_NAME_IC,
-#define PDF_NAME_ICCBased  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_ICCBased)
-	PDF_OBJ_ENUM_NAME_ICCBased,
-#define PDF_NAME_ID  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_ID)
-	PDF_OBJ_ENUM_NAME_ID,
-#define PDF_NAME_IM  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_IM)
-	PDF_OBJ_ENUM_NAME_IM,
-#define PDF_NAME_IRT  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_IRT)
-	PDF_OBJ_ENUM_NAME_IRT,
-#define PDF_NAME_Identity  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Identity)
-	PDF_OBJ_ENUM_NAME_Identity,
-#define PDF_NAME_Identity_H  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Identity_H)
-	PDF_OBJ_ENUM_NAME_Identity_H,
-#define PDF_NAME_Identity_V  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Identity_V)
-	PDF_OBJ_ENUM_NAME_Identity_V,
-#define PDF_NAME_Image  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Image)
-	PDF_OBJ_ENUM_NAME_Image,
-#define PDF_NAME_ImageMask  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_ImageMask)
-	PDF_OBJ_ENUM_NAME_ImageMask,
-#define PDF_NAME_Index  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Index)
-	PDF_OBJ_ENUM_NAME_Index,
-#define PDF_NAME_Indexed  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Indexed)
-	PDF_OBJ_ENUM_NAME_Indexed,
-#define PDF_NAME_Info  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Info)
-	PDF_OBJ_ENUM_NAME_Info,
-#define PDF_NAME_Ink  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Ink)
-	PDF_OBJ_ENUM_NAME_Ink,
-#define PDF_NAME_InkList  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_InkList)
-	PDF_OBJ_ENUM_NAME_InkList,
-#define PDF_NAME_Intent  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Intent)
-	PDF_OBJ_ENUM_NAME_Intent,
-#define PDF_NAME_Interpolate  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Interpolate)
-	PDF_OBJ_ENUM_NAME_Interpolate,
-#define PDF_NAME_IsMap  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_IsMap)
-	PDF_OBJ_ENUM_NAME_IsMap,
-#define PDF_NAME_ItalicAngle  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_ItalicAngle)
-	PDF_OBJ_ENUM_NAME_ItalicAngle,
-#define PDF_NAME_JBIG2Decode  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_JBIG2Decode)
-	PDF_OBJ_ENUM_NAME_JBIG2Decode,
-#define PDF_NAME_JBIG2Globals  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_JBIG2Globals)
-	PDF_OBJ_ENUM_NAME_JBIG2Globals,
-#define PDF_NAME_JPXDecode  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_JPXDecode)
-	PDF_OBJ_ENUM_NAME_JPXDecode,
-#define PDF_NAME_JS  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_JS)
-	PDF_OBJ_ENUM_NAME_JS,
-#define PDF_NAME_JavaScript  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_JavaScript)
-	PDF_OBJ_ENUM_NAME_JavaScript,
-#define PDF_NAME_K  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_K)
-	PDF_OBJ_ENUM_NAME_K,
-#define PDF_NAME_Kids  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Kids)
-	PDF_OBJ_ENUM_NAME_Kids,
-#define PDF_NAME_L  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_L)
-	PDF_OBJ_ENUM_NAME_L,
-#define PDF_NAME_LC  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_LC)
-	PDF_OBJ_ENUM_NAME_LC,
-#define PDF_NAME_LJ  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_LJ)
-	PDF_OBJ_ENUM_NAME_LJ,
-#define PDF_NAME_LW  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_LW)
-	PDF_OBJ_ENUM_NAME_LW,
-#define PDF_NAME_LZ  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_LZ)
-	PDF_OBJ_ENUM_NAME_LZ,
-#define PDF_NAME_LZW  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_LZW)
-	PDF_OBJ_ENUM_NAME_LZW,
-#define PDF_NAME_LZWDecode  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_LZWDecode)
-	PDF_OBJ_ENUM_NAME_LZWDecode,
-#define PDF_NAME_Lab  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Lab)
-	PDF_OBJ_ENUM_NAME_Lab,
-#define PDF_NAME_Last  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Last)
-	PDF_OBJ_ENUM_NAME_Last,
-#define PDF_NAME_LastChar  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_LastChar)
-	PDF_OBJ_ENUM_NAME_LastChar,
-#define PDF_NAME_Launch  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Launch)
-	PDF_OBJ_ENUM_NAME_Launch,
-#define PDF_NAME_Length  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Length)
-	PDF_OBJ_ENUM_NAME_Length,
-#define PDF_NAME_Length1  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Length1)
-	PDF_OBJ_ENUM_NAME_Length1,
-#define PDF_NAME_Length2  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Length2)
-	PDF_OBJ_ENUM_NAME_Length2,
-#define PDF_NAME_Length3  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Length3)
-	PDF_OBJ_ENUM_NAME_Length3,
-#define PDF_NAME_Limits  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Limits)
-	PDF_OBJ_ENUM_NAME_Limits,
-#define PDF_NAME_Line  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Line)
-	PDF_OBJ_ENUM_NAME_Line,
-#define PDF_NAME_Linearized  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Linearized)
-	PDF_OBJ_ENUM_NAME_Linearized,
-#define PDF_NAME_Link  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Link)
-	PDF_OBJ_ENUM_NAME_Link,
-#define PDF_NAME_Locked  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Locked)
-	PDF_OBJ_ENUM_NAME_Locked,
-#define PDF_NAME_Luminosity  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Luminosity)
-	PDF_OBJ_ENUM_NAME_Luminosity,
-#define PDF_NAME_M  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_M)
-	PDF_OBJ_ENUM_NAME_M,
-#define PDF_NAME_MK  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_MK)
-	PDF_OBJ_ENUM_NAME_MK,
-#define PDF_NAME_ML  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_ML)
-	PDF_OBJ_ENUM_NAME_ML,
-#define PDF_NAME_MMType1  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_MMType1)
-	PDF_OBJ_ENUM_NAME_MMType1,
-#define PDF_NAME_Mac  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Mac)
-	PDF_OBJ_ENUM_NAME_Mac,
-#define PDF_NAME_Mask  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Mask)
-	PDF_OBJ_ENUM_NAME_Mask,
-#define PDF_NAME_Matrix  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Matrix)
-	PDF_OBJ_ENUM_NAME_Matrix,
-#define PDF_NAME_Matte  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Matte)
-	PDF_OBJ_ENUM_NAME_Matte,
-#define PDF_NAME_MaxLen  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_MaxLen)
-	PDF_OBJ_ENUM_NAME_MaxLen,
-#define PDF_NAME_MediaBox  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_MediaBox)
-	PDF_OBJ_ENUM_NAME_MediaBox,
-#define PDF_NAME_MissingWidth  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_MissingWidth)
-	PDF_OBJ_ENUM_NAME_MissingWidth,
-#define PDF_NAME_ModDate  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_ModDate)
-	PDF_OBJ_ENUM_NAME_ModDate,
-#define PDF_NAME_Movie  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Movie)
-	PDF_OBJ_ENUM_NAME_Movie,
-#define PDF_NAME_N  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_N)
-	PDF_OBJ_ENUM_NAME_N,
-#define PDF_NAME_Name  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Name)
-	PDF_OBJ_ENUM_NAME_Name,
-#define PDF_NAME_Named  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Named)
-	PDF_OBJ_ENUM_NAME_Named,
-#define PDF_NAME_Names  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Names)
-	PDF_OBJ_ENUM_NAME_Names,
-#define PDF_NAME_NewWindow  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_NewWindow)
-	PDF_OBJ_ENUM_NAME_NewWindow,
-#define PDF_NAME_Next  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Next)
-	PDF_OBJ_ENUM_NAME_Next,
-#define PDF_NAME_None  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_None)
-	PDF_OBJ_ENUM_NAME_None,
-#define PDF_NAME_Normal  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Normal)
-	PDF_OBJ_ENUM_NAME_Normal,
-#define PDF_NAME_O  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_O)
-	PDF_OBJ_ENUM_NAME_O,
-#define PDF_NAME_OC  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_OC)
-	PDF_OBJ_ENUM_NAME_OC,
-#define PDF_NAME_OCG  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_OCG)
-	PDF_OBJ_ENUM_NAME_OCG,
-#define PDF_NAME_OCGs  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_OCGs)
-	PDF_OBJ_ENUM_NAME_OCGs,
-#define PDF_NAME_OCMD  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_OCMD)
-	PDF_OBJ_ENUM_NAME_OCMD,
-#define PDF_NAME_OCProperties  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_OCProperties)
-	PDF_OBJ_ENUM_NAME_OCProperties,
-#define PDF_NAME_OE  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_OE)
-	PDF_OBJ_ENUM_NAME_OE,
-#define PDF_NAME_OFF  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_OFF)
-	PDF_OBJ_ENUM_NAME_OFF,
-#define PDF_NAME_ON  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_ON)
-	PDF_OBJ_ENUM_NAME_ON,
-#define PDF_NAME_ObjStm  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_ObjStm)
-	PDF_OBJ_ENUM_NAME_ObjStm,
-#define PDF_NAME_Of  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Of)
-	PDF_OBJ_ENUM_NAME_Of,
-#define PDF_NAME_Off  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Off)
-	PDF_OBJ_ENUM_NAME_Off,
-#define PDF_NAME_OpenType  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_OpenType)
-	PDF_OBJ_ENUM_NAME_OpenType,
-#define PDF_NAME_Opt  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Opt)
-	PDF_OBJ_ENUM_NAME_Opt,
-#define PDF_NAME_Order  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Order)
-	PDF_OBJ_ENUM_NAME_Order,
-#define PDF_NAME_Ordering  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Ordering)
-	PDF_OBJ_ENUM_NAME_Ordering,
-#define PDF_NAME_Outlines  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Outlines)
-	PDF_OBJ_ENUM_NAME_Outlines,
-#define PDF_NAME_P  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_P)
-	PDF_OBJ_ENUM_NAME_P,
-#define PDF_NAME_PDF  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_PDF)
-	PDF_OBJ_ENUM_NAME_PDF,
-#define PDF_NAME_PS  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_PS)
-	PDF_OBJ_ENUM_NAME_PS,
-#define PDF_NAME_Page  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Page)
-	PDF_OBJ_ENUM_NAME_Page,
-#define PDF_NAME_PageMode  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_PageMode)
-	PDF_OBJ_ENUM_NAME_PageMode,
-#define PDF_NAME_Pages  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Pages)
-	PDF_OBJ_ENUM_NAME_Pages,
-#define PDF_NAME_PaintType  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_PaintType)
-	PDF_OBJ_ENUM_NAME_PaintType,
-#define PDF_NAME_Params  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Params)
-	PDF_OBJ_ENUM_NAME_Params,
-#define PDF_NAME_Parent  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Parent)
-	PDF_OBJ_ENUM_NAME_Parent,
-#define PDF_NAME_Pattern  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Pattern)
-	PDF_OBJ_ENUM_NAME_Pattern,
-#define PDF_NAME_PatternType  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_PatternType)
-	PDF_OBJ_ENUM_NAME_PatternType,
-#define PDF_NAME_PolyLine  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_PolyLine)
-	PDF_OBJ_ENUM_NAME_PolyLine,
-#define PDF_NAME_Polygon  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Polygon)
-	PDF_OBJ_ENUM_NAME_Polygon,
-#define PDF_NAME_Popup  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Popup)
-	PDF_OBJ_ENUM_NAME_Popup,
-#define PDF_NAME_Predictor  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Predictor)
-	PDF_OBJ_ENUM_NAME_Predictor,
-#define PDF_NAME_Prev  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Prev)
-	PDF_OBJ_ENUM_NAME_Prev,
-#define PDF_NAME_Print  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Print)
-	PDF_OBJ_ENUM_NAME_Print,
-#define PDF_NAME_PrinterMark  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_PrinterMark)
-	PDF_OBJ_ENUM_NAME_PrinterMark,
-#define PDF_NAME_ProcSet  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_ProcSet)
-	PDF_OBJ_ENUM_NAME_ProcSet,
-#define PDF_NAME_Producer  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Producer)
-	PDF_OBJ_ENUM_NAME_Producer,
-#define PDF_NAME_Properties  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Properties)
-	PDF_OBJ_ENUM_NAME_Properties,
-#define PDF_NAME_Push  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Push)
-	PDF_OBJ_ENUM_NAME_Push,
-#define PDF_NAME_Q  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Q)
-	PDF_OBJ_ENUM_NAME_Q,
-#define PDF_NAME_QuadPoints  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_QuadPoints)
-	PDF_OBJ_ENUM_NAME_QuadPoints,
-#define PDF_NAME_R  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_R)
-	PDF_OBJ_ENUM_NAME_R,
-#define PDF_NAME_RBGroups  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_RBGroups)
-	PDF_OBJ_ENUM_NAME_RBGroups,
-#define PDF_NAME_RGB  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_RGB)
-	PDF_OBJ_ENUM_NAME_RGB,
-#define PDF_NAME_RI  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_RI)
-	PDF_OBJ_ENUM_NAME_RI,
-#define PDF_NAME_RL  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_RL)
-	PDF_OBJ_ENUM_NAME_RL,
-#define PDF_NAME_Range  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Range)
-	PDF_OBJ_ENUM_NAME_Range,
-#define PDF_NAME_Rect  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Rect)
-	PDF_OBJ_ENUM_NAME_Rect,
-#define PDF_NAME_Ref  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Ref)
-	PDF_OBJ_ENUM_NAME_Ref,
-#define PDF_NAME_Registry  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Registry)
-	PDF_OBJ_ENUM_NAME_Registry,
-#define PDF_NAME_ResetForm  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_ResetForm)
-	PDF_OBJ_ENUM_NAME_ResetForm,
-#define PDF_NAME_Resources  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Resources)
-	PDF_OBJ_ENUM_NAME_Resources,
-#define PDF_NAME_Root  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Root)
-	PDF_OBJ_ENUM_NAME_Root,
-#define PDF_NAME_Rotate  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Rotate)
-	PDF_OBJ_ENUM_NAME_Rotate,
-#define PDF_NAME_Rows  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Rows)
-	PDF_OBJ_ENUM_NAME_Rows,
-#define PDF_NAME_RunLengthDecode  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_RunLengthDecode)
-	PDF_OBJ_ENUM_NAME_RunLengthDecode,
-#define PDF_NAME_S  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_S)
-	PDF_OBJ_ENUM_NAME_S,
-#define PDF_NAME_SMask  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_SMask)
-	PDF_OBJ_ENUM_NAME_SMask,
-#define PDF_NAME_SMaskInData  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_SMaskInData)
-	PDF_OBJ_ENUM_NAME_SMaskInData,
-#define PDF_NAME_Schema  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Schema)
-	PDF_OBJ_ENUM_NAME_Schema,
-#define PDF_NAME_Screen  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Screen)
-	PDF_OBJ_ENUM_NAME_Screen,
-#define PDF_NAME_Separation  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Separation)
-	PDF_OBJ_ENUM_NAME_Separation,
-#define PDF_NAME_Shading  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Shading)
-	PDF_OBJ_ENUM_NAME_Shading,
-#define PDF_NAME_ShadingType  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_ShadingType)
-	PDF_OBJ_ENUM_NAME_ShadingType,
-#define PDF_NAME_Si  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Si)
-	PDF_OBJ_ENUM_NAME_Si,
-#define PDF_NAME_Sig  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Sig)
-	PDF_OBJ_ENUM_NAME_Sig,
-#define PDF_NAME_SigFlags  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_SigFlags)
-	PDF_OBJ_ENUM_NAME_SigFlags,
-#define PDF_NAME_Size  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Size)
-	PDF_OBJ_ENUM_NAME_Size,
-#define PDF_NAME_Sound  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Sound)
-	PDF_OBJ_ENUM_NAME_Sound,
-#define PDF_NAME_Split  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Split)
-	PDF_OBJ_ENUM_NAME_Split,
-#define PDF_NAME_Square  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Square)
-	PDF_OBJ_ENUM_NAME_Square,
-#define PDF_NAME_Squiggly  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Squiggly)
-	PDF_OBJ_ENUM_NAME_Squiggly,
-#define PDF_NAME_Stamp  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Stamp)
-	PDF_OBJ_ENUM_NAME_Stamp,
-#define PDF_NAME_Standard  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Standard)
-	PDF_OBJ_ENUM_NAME_Standard,
-#define PDF_NAME_StdCF  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_StdCF)
-	PDF_OBJ_ENUM_NAME_StdCF,
-#define PDF_NAME_StemV  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_StemV)
-	PDF_OBJ_ENUM_NAME_StemV,
-#define PDF_NAME_StmF  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_StmF)
-	PDF_OBJ_ENUM_NAME_StmF,
-#define PDF_NAME_StrF  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_StrF)
-	PDF_OBJ_ENUM_NAME_StrF,
-#define PDF_NAME_StrikeOut  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_StrikeOut)
-	PDF_OBJ_ENUM_NAME_StrikeOut,
-#define PDF_NAME_SubFilter  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_SubFilter)
-	PDF_OBJ_ENUM_NAME_SubFilter,
-#define PDF_NAME_Subtype  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Subtype)
-	PDF_OBJ_ENUM_NAME_Subtype,
-#define PDF_NAME_Subtype2  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Subtype2)
-	PDF_OBJ_ENUM_NAME_Subtype2,
-#define PDF_NAME_Supplement  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Supplement)
-	PDF_OBJ_ENUM_NAME_Supplement,
-#define PDF_NAME_T  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_T)
-	PDF_OBJ_ENUM_NAME_T,
-#define PDF_NAME_TR  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_TR)
-	PDF_OBJ_ENUM_NAME_TR,
-#define PDF_NAME_TR2  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_TR2)
-	PDF_OBJ_ENUM_NAME_TR2,
-#define PDF_NAME_Text  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Text)
-	PDF_OBJ_ENUM_NAME_Text,
-#define PDF_NAME_TilingType  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_TilingType)
-	PDF_OBJ_ENUM_NAME_TilingType,
-#define PDF_NAME_Title  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Title)
-	PDF_OBJ_ENUM_NAME_Title,
-#define PDF_NAME_ToUnicode  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_ToUnicode)
-	PDF_OBJ_ENUM_NAME_ToUnicode,
-#define PDF_NAME_Trans  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Trans)
-	PDF_OBJ_ENUM_NAME_Trans,
-#define PDF_NAME_Transparency  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Transparency)
-	PDF_OBJ_ENUM_NAME_Transparency,
-#define PDF_NAME_TrapNet  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_TrapNet)
-	PDF_OBJ_ENUM_NAME_TrapNet,
-#define PDF_NAME_TrimBox  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_TrimBox)
-	PDF_OBJ_ENUM_NAME_TrimBox,
-#define PDF_NAME_TrueType  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_TrueType)
-	PDF_OBJ_ENUM_NAME_TrueType,
-#define PDF_NAME_Tx  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Tx)
-	PDF_OBJ_ENUM_NAME_Tx,
-#define PDF_NAME_Type  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Type)
-	PDF_OBJ_ENUM_NAME_Type,
-#define PDF_NAME_Type0  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Type0)
-	PDF_OBJ_ENUM_NAME_Type0,
-#define PDF_NAME_Type1  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Type1)
-	PDF_OBJ_ENUM_NAME_Type1,
-#define PDF_NAME_Type1C  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Type1C)
-	PDF_OBJ_ENUM_NAME_Type1C,
-#define PDF_NAME_Type3  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Type3)
-	PDF_OBJ_ENUM_NAME_Type3,
-#define PDF_NAME_U  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_U)
-	PDF_OBJ_ENUM_NAME_U,
-#define PDF_NAME_UE  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_UE)
-	PDF_OBJ_ENUM_NAME_UE,
-#define PDF_NAME_UF  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_UF)
-	PDF_OBJ_ENUM_NAME_UF,
-#define PDF_NAME_URI  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_URI)
-	PDF_OBJ_ENUM_NAME_URI,
-#define PDF_NAME_URL  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_URL)
-	PDF_OBJ_ENUM_NAME_URL,
-#define PDF_NAME_Unchanged  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Unchanged)
-	PDF_OBJ_ENUM_NAME_Unchanged,
-#define PDF_NAME_Uncover  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Uncover)
-	PDF_OBJ_ENUM_NAME_Uncover,
-#define PDF_NAME_Underline  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Underline)
-	PDF_OBJ_ENUM_NAME_Underline,
-#define PDF_NAME_Unix  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Unix)
-	PDF_OBJ_ENUM_NAME_Unix,
-#define PDF_NAME_Usage  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Usage)
-	PDF_OBJ_ENUM_NAME_Usage,
-#define PDF_NAME_UseCMap  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_UseCMap)
-	PDF_OBJ_ENUM_NAME_UseCMap,
-#define PDF_NAME_UseOutlines  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_UseOutlines)
-	PDF_OBJ_ENUM_NAME_UseOutlines,
-#define PDF_NAME_UserUnit  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_UserUnit)
-	PDF_OBJ_ENUM_NAME_UserUnit,
-#define PDF_NAME_V  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_V)
-	PDF_OBJ_ENUM_NAME_V,
-#define PDF_NAME_V2  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_V2)
-	PDF_OBJ_ENUM_NAME_V2,
-#define PDF_NAME_VE  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_VE)
-	PDF_OBJ_ENUM_NAME_VE,
-#define PDF_NAME_Version  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Version)
-	PDF_OBJ_ENUM_NAME_Version,
-#define PDF_NAME_VerticesPerRow  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_VerticesPerRow)
-	PDF_OBJ_ENUM_NAME_VerticesPerRow,
-#define PDF_NAME_View  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_View)
-	PDF_OBJ_ENUM_NAME_View,
-#define PDF_NAME_W  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_W)
-	PDF_OBJ_ENUM_NAME_W,
-#define PDF_NAME_W2  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_W2)
-	PDF_OBJ_ENUM_NAME_W2,
-#define PDF_NAME_WMode  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_WMode)
-	PDF_OBJ_ENUM_NAME_WMode,
-#define PDF_NAME_Watermark  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Watermark)
-	PDF_OBJ_ENUM_NAME_Watermark,
-#define PDF_NAME_Widget  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Widget)
-	PDF_OBJ_ENUM_NAME_Widget,
-#define PDF_NAME_Width  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Width)
-	PDF_OBJ_ENUM_NAME_Width,
-#define PDF_NAME_Widths  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Widths)
-	PDF_OBJ_ENUM_NAME_Widths,
-#define PDF_NAME_WinAnsiEncoding  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_WinAnsiEncoding)
-	PDF_OBJ_ENUM_NAME_WinAnsiEncoding,
-#define PDF_NAME_Wipe  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_Wipe)
-	PDF_OBJ_ENUM_NAME_Wipe,
-#define PDF_NAME_XHeight  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_XHeight)
-	PDF_OBJ_ENUM_NAME_XHeight,
-#define PDF_NAME_XObject  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_XObject)
-	PDF_OBJ_ENUM_NAME_XObject,
-#define PDF_NAME_XRef  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_XRef)
-	PDF_OBJ_ENUM_NAME_XRef,
-#define PDF_NAME_XRefStm  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_XRefStm)
-	PDF_OBJ_ENUM_NAME_XRefStm,
-#define PDF_NAME_XStep  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_XStep)
-	PDF_OBJ_ENUM_NAME_XStep,
-#define PDF_NAME_XYZ  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_XYZ)
-	PDF_OBJ_ENUM_NAME_XYZ,
-#define PDF_NAME_YStep  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_YStep)
-	PDF_OBJ_ENUM_NAME_YStep,
-#define PDF_NAME_adbe_pkcs7_detached  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_adbe_pkcs7_detached)
-	PDF_OBJ_ENUM_NAME_adbe_pkcs7_detached,
-#define PDF_NAME_ca  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_ca)
-	PDF_OBJ_ENUM_NAME_ca,
-#define PDF_NAME_n0  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_n0)
-	PDF_OBJ_ENUM_NAME_n0,
-#define PDF_NAME_n1  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_n1)
-	PDF_OBJ_ENUM_NAME_n1,
-#define PDF_NAME_n2  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_n2)
-	PDF_OBJ_ENUM_NAME_n2,
-#define PDF_OBJ_NAME__LIMIT ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME__LIMIT)
-	PDF_OBJ_ENUM_NAME__LIMIT,
-#define PDF_OBJ_FALSE ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_BOOL_FALSE)
-	PDF_OBJ_ENUM_BOOL_FALSE = PDF_OBJ_ENUM_NAME__LIMIT,
-#define PDF_OBJ_TRUE ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_BOOL_TRUE)
-	PDF_OBJ_ENUM_BOOL_TRUE,
-#define PDF_OBJ_NULL ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NULL)
-	PDF_OBJ_ENUM_NULL,
-#define PDF_OBJ__LIMIT ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM__LIMIT)
-	PDF_OBJ_ENUM__LIMIT
-};

+ 0 - 154
server/lib/xfdftool/include/mupdf/pdf/object.h

@@ -1,154 +0,0 @@
-#ifndef MUPDF_PDF_OBJECT_H
-#define MUPDF_PDF_OBJECT_H
-
-typedef struct pdf_document_s pdf_document;
-
-/*
- * Dynamic objects.
- * The same type of objects as found in PDF and PostScript.
- * Used by the filters and the mupdf parser.
- */
-
-typedef struct pdf_obj_s pdf_obj;
-
-pdf_obj *pdf_new_null(fz_context *ctx, pdf_document *doc);
-pdf_obj *pdf_new_bool(fz_context *ctx, pdf_document *doc, int b);
-pdf_obj *pdf_new_int(fz_context *ctx, pdf_document *doc, int i);
-pdf_obj *pdf_new_int_offset(fz_context *ctx, pdf_document *doc, fz_off_t off);
-pdf_obj *pdf_new_real(fz_context *ctx, pdf_document *doc, float f);
-pdf_obj *pdf_new_name(fz_context *ctx, pdf_document *doc, const char *str);
-pdf_obj *pdf_new_string(fz_context *ctx, pdf_document *doc, const char *str, size_t len);
-pdf_obj *pdf_new_indirect(fz_context *ctx, pdf_document *doc, int num, int gen);
-pdf_obj *pdf_new_array(fz_context *ctx, pdf_document *doc, int initialcap);
-pdf_obj *pdf_new_dict(fz_context *ctx, pdf_document *doc, int initialcap);
-pdf_obj *pdf_new_rect(fz_context *ctx, pdf_document *doc, const fz_rect *rect);
-pdf_obj *pdf_new_matrix(fz_context *ctx, pdf_document *doc, const fz_matrix *mtx);
-pdf_obj *pdf_copy_array(fz_context *ctx, pdf_obj *array);
-pdf_obj *pdf_copy_dict(fz_context *ctx, pdf_obj *dict);
-pdf_obj *pdf_deep_copy_obj(fz_context *ctx, pdf_obj *obj);
-
-pdf_obj *pdf_new_obj_from_str(fz_context *ctx, pdf_document *doc, const char *src);
-
-pdf_obj *pdf_keep_obj(fz_context *ctx, pdf_obj *obj);
-void pdf_drop_obj(fz_context *ctx, pdf_obj *obj);
-
-/* type queries */
-int pdf_is_null(fz_context *ctx, pdf_obj *obj);
-int pdf_is_bool(fz_context *ctx, pdf_obj *obj);
-int pdf_is_int(fz_context *ctx, pdf_obj *obj);
-int pdf_is_real(fz_context *ctx, pdf_obj *obj);
-int pdf_is_number(fz_context *ctx, pdf_obj *obj);
-int pdf_is_name(fz_context *ctx, pdf_obj *obj);
-int pdf_is_string(fz_context *ctx, pdf_obj *obj);
-int pdf_is_array(fz_context *ctx, pdf_obj *obj);
-int pdf_is_dict(fz_context *ctx, pdf_obj *obj);
-int pdf_is_indirect(fz_context *ctx, pdf_obj *obj);
-int pdf_obj_num_is_stream(fz_context *ctx, pdf_document *doc, int num);
-int pdf_is_stream(fz_context *ctx, pdf_obj *obj);
-pdf_obj *pdf_resolve_obj(fz_context *ctx, pdf_obj *a);
-int pdf_objcmp(fz_context *ctx, pdf_obj *a, pdf_obj *b);
-int pdf_objcmp_resolve(fz_context *ctx, pdf_obj *a, pdf_obj *b);
-
-static inline int pdf_name_eq(fz_context *ctx, pdf_obj *a, pdf_obj *b)
-{
-	if (a == b)
-		return 1;
-	if (a < PDF_OBJ_NAME__LIMIT && b < PDF_OBJ_NAME__LIMIT)
-		return 0;
-	return !pdf_objcmp_resolve(ctx, a, b);
-}
-
-/* obj marking and unmarking functions - to avoid infinite recursions. */
-int pdf_obj_marked(fz_context *ctx, pdf_obj *obj);
-int pdf_mark_obj(fz_context *ctx, pdf_obj *obj);
-void pdf_unmark_obj(fz_context *ctx, pdf_obj *obj);
-
-/* obj memo functions - allows us to secretly remember "a memo" (a bool) in
- * an object, and to read back whether there was a memo, and if so, what it
- * was. */
-void pdf_set_obj_memo(fz_context *ctx, pdf_obj *obj, int memo);
-int pdf_obj_memo(fz_context *ctx, pdf_obj *obj, int *memo);
-
-/* obj dirty bit support. */
-int pdf_obj_is_dirty(fz_context *ctx, pdf_obj *obj);
-void pdf_dirty_obj(fz_context *ctx, pdf_obj *obj);
-void pdf_clean_obj(fz_context *ctx, pdf_obj *obj);
-
-/* safe, silent failure, no error reporting on type mismatches */
-int pdf_to_bool(fz_context *ctx, pdf_obj *obj);
-int pdf_to_int(fz_context *ctx, pdf_obj *obj);
-fz_off_t pdf_to_offset(fz_context *ctx, pdf_obj *obj);
-float pdf_to_real(fz_context *ctx, pdf_obj *obj);
-char *pdf_to_name(fz_context *ctx, pdf_obj *obj);
-char *pdf_to_str_buf(fz_context *ctx, pdf_obj *obj);
-int pdf_to_str_len(fz_context *ctx, pdf_obj *obj);
-int pdf_to_num(fz_context *ctx, pdf_obj *obj);
-int pdf_to_gen(fz_context *ctx, pdf_obj *obj);
-
-int pdf_array_len(fz_context *ctx, pdf_obj *array);
-pdf_obj *pdf_array_get(fz_context *ctx, pdf_obj *array, int i);
-void pdf_array_put(fz_context *ctx, pdf_obj *array, int i, pdf_obj *obj);
-void pdf_array_put_drop(fz_context *ctx, pdf_obj *array, int i, pdf_obj *obj);
-void pdf_array_push(fz_context *ctx, pdf_obj *array, pdf_obj *obj);
-void pdf_array_push_drop(fz_context *ctx, pdf_obj *array, pdf_obj *obj);
-void pdf_array_insert(fz_context *ctx, pdf_obj *array, pdf_obj *obj, int index);
-void pdf_array_insert_drop(fz_context *ctx, pdf_obj *array, pdf_obj *obj, int index);
-void pdf_array_delete(fz_context *ctx, pdf_obj *array, int index);
-int pdf_array_find(fz_context *ctx, pdf_obj *array, pdf_obj *obj);
-int pdf_array_contains(fz_context *ctx, pdf_obj *array, pdf_obj *obj);
-
-int pdf_dict_len(fz_context *ctx, pdf_obj *dict);
-pdf_obj *pdf_dict_get_key(fz_context *ctx, pdf_obj *dict, int idx);
-pdf_obj *pdf_dict_get_val(fz_context *ctx, pdf_obj *dict, int idx);
-pdf_obj *pdf_dict_get(fz_context *ctx, pdf_obj *dict, pdf_obj *key);
-pdf_obj *pdf_dict_getp(fz_context *ctx, pdf_obj *dict, const char *path);
-pdf_obj *pdf_dict_getl(fz_context *ctx, pdf_obj *dict, ...);
-pdf_obj *pdf_dict_geta(fz_context *ctx, pdf_obj *dict, pdf_obj *key, pdf_obj *abbrev);
-pdf_obj *pdf_dict_gets(fz_context *ctx, pdf_obj *dict, const char *key);
-pdf_obj *pdf_dict_getsa(fz_context *ctx, pdf_obj *dict, const char *key, const char *abbrev);
-void pdf_dict_put(fz_context *ctx, pdf_obj *dict, pdf_obj *key, pdf_obj *val);
-void pdf_dict_put_drop(fz_context *ctx, pdf_obj *dict, pdf_obj *key, pdf_obj *val);
-void pdf_dict_get_put_drop(fz_context *ctx, pdf_obj *dict, pdf_obj *key, pdf_obj *val, pdf_obj **old_val);
-void pdf_dict_puts(fz_context *ctx, pdf_obj *dict, const char *key, pdf_obj *val);
-void pdf_dict_puts_drop(fz_context *ctx, pdf_obj *dict, const char *key, pdf_obj *val);
-void pdf_dict_putp(fz_context *ctx, pdf_obj *dict, const char *path, pdf_obj *val);
-void pdf_dict_putp_drop(fz_context *ctx, pdf_obj *dict, const char *path, pdf_obj *val);
-void pdf_dict_putl(fz_context *ctx, pdf_obj *dict, pdf_obj *val, ...);
-void pdf_dict_putl_drop(fz_context *ctx, pdf_obj *dict, pdf_obj *val, ...);
-void pdf_dict_del(fz_context *ctx, pdf_obj *dict, pdf_obj *key);
-void pdf_dict_dels(fz_context *ctx, pdf_obj *dict, const char *key);
-void pdf_sort_dict(fz_context *ctx, pdf_obj *dict);
-
-/*
-	Recurse through the object structure setting the node's parent_num to num.
-	parent_num is used when a subobject is to be changed during a document edit.
-	The whole containing hierarchy is moved to the incremental xref section, so
-	to be later written out as an incremental file update.
-*/
-void pdf_set_obj_parent(fz_context *ctx, pdf_obj *obj, int num);
-
-int pdf_obj_refs(fz_context *ctx, pdf_obj *ref);
-
-int pdf_obj_parent_num(fz_context *ctx, pdf_obj *obj);
-
-int pdf_sprint_obj(fz_context *ctx, char *s, int n, pdf_obj *obj, int tight);
-int pdf_print_obj(fz_context *ctx, fz_output *out, pdf_obj *obj, int tight);
-
-char *pdf_to_utf8(fz_context *ctx, pdf_obj *src);
-char *pdf_load_stream_as_utf8(fz_context *ctx, pdf_obj *src);
-char *pdf_load_stream_or_string_as_utf8(fz_context *ctx, pdf_obj *src);
-unsigned short *pdf_to_ucs2(fz_context *ctx, pdf_obj *src);
-pdf_obj *pdf_to_utf8_name(fz_context *ctx, pdf_document *doc, pdf_obj *src);
-char *pdf_from_ucs2(fz_context *ctx, unsigned short *str);
-void pdf_to_ucs2_buf(fz_context *ctx, unsigned short *buffer, pdf_obj *src);
-
-fz_rect *pdf_to_rect(fz_context *ctx, pdf_obj *array, fz_rect *rect);
-fz_matrix *pdf_to_matrix(fz_context *ctx, pdf_obj *array, fz_matrix *mat);
-
-pdf_document *pdf_get_indirect_document(fz_context *ctx, pdf_obj *obj);
-pdf_document *pdf_get_bound_document(fz_context *ctx, pdf_obj *obj);
-void pdf_set_str_len(fz_context *ctx, pdf_obj *obj, int newlen);
-void pdf_set_int(fz_context *ctx, pdf_obj *obj, int i);
-void pdf_set_int_offset(fz_context *ctx, pdf_obj *obj, fz_off_t i);
-
-#endif

+ 0 - 18
server/lib/xfdftool/include/mupdf/pdf/output-pdf.h

@@ -1,18 +0,0 @@
-#ifndef MUPDF_PDF_OUTPUT_PDF_H
-#define MUPDF_PDF_OUTPUT_PDF_H
-
-/*
-	pdf_new_pdf_device: Create a pdf device. Rendering to the device creates
-	new pdf content. WARNING: this device is work in progress. It doesn't
-	currently support all rendering cases.
-
-	Note that contents must be a stream (dictionary) to be updated (or
-	a reference to a stream). Callers should take care to ensure that it
-	is not an array, and that is it not shared with other objects/pages.
-*/
-fz_device *pdf_new_pdf_device(fz_context *ctx, pdf_document *doc, const fz_matrix *topctm,
-		const fz_rect *mediabox, pdf_obj *resources, fz_buffer *contents);
-
-void pdf_localise_page_resources(fz_context *ctx, pdf_document *doc);
-
-#endif

+ 0 - 195
server/lib/xfdftool/include/mupdf/pdf/page.h

@@ -1,195 +0,0 @@
-#ifndef MUPDF_PDF_PAGE_H
-#define MUPDF_PDF_PAGE_H
-
-int pdf_lookup_page_number(fz_context *ctx, pdf_document *doc, pdf_obj *pageobj);
-int pdf_count_pages(fz_context *ctx, pdf_document *doc);
-pdf_obj *pdf_lookup_page_obj(fz_context *ctx, pdf_document *doc, int needle);
-void pdf_load_page_tree(fz_context *ctx, pdf_document *doc);
-void pdf_drop_page_tree(fz_context *ctx, pdf_document *doc);
-
-/*
-	pdf_lookup_anchor: Find the page number of a named destination.
-
-	For use with looking up the destination page of a fragment
-	identifier in hyperlinks: foo.pdf#bar or foo.pdf#page=5.
-*/
-int pdf_lookup_anchor(fz_context *ctx, pdf_document *doc, const char *name, float *xp, float *yp);
-
-/*
-	pdf_flatten_inheritable_page_items: Make page self sufficient.
-
-	Copy any inheritable page keys into the actual page object, removing
-	any dependencies on the page tree parents.
-*/
-void pdf_flatten_inheritable_page_items(fz_context *ctx, pdf_obj *page);
-
-/*
-	pdf_load_page: Load a page and its resources.
-
-	Locates the page in the PDF document and loads the page and its
-	resources. After pdf_load_page is it possible to retrieve the size
-	of the page using pdf_bound_page, or to render the page using
-	pdf_run_page_*.
-
-	number: page number, where 0 is the first page of the document.
-*/
-pdf_page *pdf_load_page(fz_context *ctx, pdf_document *doc, int number);
-
-void pdf_page_obj_transform(fz_context *ctx, pdf_obj *pageobj, fz_rect *page_mediabox, fz_matrix *page_ctm);
-void pdf_page_transform(fz_context *ctx, pdf_page *page, fz_rect *mediabox, fz_matrix *ctm);
-pdf_obj *pdf_page_resources(fz_context *ctx, pdf_page *page);
-pdf_obj *pdf_page_contents(fz_context *ctx, pdf_page *page);
-
-fz_link *pdf_load_links(fz_context *ctx, pdf_page *page);
-
-/*
-	pdf_bound_page: Determine the size of a page.
-
-	Determine the page size in user space units, taking page rotation
-	into account. The page size is taken to be the crop box if it
-	exists (visible area after cropping), otherwise the media box will
-	be used (possibly including printing marks).
-
-	Does not throw exceptions.
-*/
-fz_rect *pdf_bound_page(fz_context *ctx, pdf_page *page, fz_rect *);
-
-/*
-	pdf_run_page: Interpret a loaded page and render it on a device.
-
-	page: A page loaded by pdf_load_page.
-
-	dev: Device used for rendering, obtained from fz_new_*_device.
-
-	ctm: A transformation matrix applied to the objects on the page,
-	e.g. to scale or rotate the page contents as desired.
-*/
-void pdf_run_page(fz_context *ctx, pdf_page *page, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie);
-
-/*
-	pdf_run_page_with_usage: Interpret a loaded page and render it on a device.
-
-	page: A page loaded by pdf_load_page.
-
-	dev: Device used for rendering, obtained from fz_new_*_device.
-
-	ctm: A transformation matrix applied to the objects on the page,
-	e.g. to scale or rotate the page contents as desired.
-
-	usage: The 'usage' for displaying the file (typically
-	'View', 'Print' or 'Export'). NULL means 'View'.
-
-	cookie: A pointer to an optional fz_cookie structure that can be used
-	to track progress, collect errors etc.
-*/
-void pdf_run_page_with_usage(fz_context *ctx, pdf_document *doc, pdf_page *page, fz_device *dev, const fz_matrix *ctm, const char *usage, fz_cookie *cookie);
-
-/*
-	pdf_run_page_contents: Interpret a loaded page and render it on a device.
-	Just the main page contents without the annotations
-
-	page: A page loaded by pdf_load_page.
-
-	dev: Device used for rendering, obtained from fz_new_*_device.
-
-	ctm: A transformation matrix applied to the objects on the page,
-	e.g. to scale or rotate the page contents as desired.
-*/
-void pdf_run_page_contents(fz_context *ctx, pdf_page *page, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie);
-
-/*
-	pdf_page_contents_process_fn: A function used for processing the
-	cleaned page contents/resources gathered as part of
-	pdf_clean_page_contents.
-
-	buffer: A buffer holding the page contents.
-
-	res: A pdf_obj holding the page resources.
-
-	arg: An opaque arg specific to the particular function.
-*/
-typedef void (pdf_page_contents_process_fn)(fz_context *ctx, fz_buffer *buffer, pdf_obj *res, void *arg);
-
-/*
-	pdf_clean_page_contents: Clean a loaded pages rendering operations,
-	with an optional post processing step.
-
-	Firstly, this filters the PDF operators used to avoid (some cases
-	of) repetition, and leaves the page in a balanced state with an
-	unchanged top level matrix etc. At the same time, the resources
-	used by the page contents are collected.
-
-	Next, the resources themselves are cleaned (as appropriate) in the
-	same way.
-
-	Next, an optional post processing stage is called.
-
-	Finally, the page contents and resources in the documents page tree
-	are replaced by these processed versions.
-
-	Annotations remain unaffected.
-
-	page: A page loaded by pdf_load_page.
-
-	cookie: A pointer to an optional fz_cookie structure that can be used
-	to track progress, collect errors etc.
-*/
-void pdf_clean_page_contents(fz_context *ctx, pdf_document *doc, pdf_page *page, fz_cookie *cookie,
-	pdf_page_contents_process_fn *proc, void *proc_arg, int ascii);
-
-/*
-	pdf_clean_annot_contents: Clean a loaded annotations rendering operations,
-	with an optional post processing step.
-
-	Each appearance stream in the annotation is processed.
-
-	Firstly, this filters the PDF operators used to avoid (some cases
-	of) repetition, and leaves the page in a balanced state with an
-	unchanged top level matrix etc. At the same time, the resources
-	used by the page contents are collected.
-
-	Next, the resources themselves are cleaned (as appropriate) in the
-	same way.
-
-	Next, an optional post processing stage is called.
-
-	Finally, the updated stream of operations is reinserted into the
-	appearance stream.
-
-	annot: An annotation loaded by pdf_load_annot.
-
-	cookie: A pointer to an optional fz_cookie structure that can be used
-	to track progress, collect errors etc.
-*/
-void pdf_clean_annot_contents(fz_context *ctx, pdf_document *doc, pdf_annot *annot, fz_cookie *cookie,
-	pdf_page_contents_process_fn *proc, void *proc_arg, int ascii);
-
-/*
-	Presentation interface.
-*/
-fz_transition *pdf_page_presentation(fz_context *ctx, pdf_page *page, fz_transition *transition, float *duration);
-
-/*
- * Page tree, pages and related objects
- */
-
-struct pdf_page_s
-{
-	fz_page super;
-	pdf_document *doc;
-	pdf_obj *obj;
-
-	int transparency;
-	int incomplete;
-
-	fz_link *links;
-	pdf_annot *annots, **annot_tailp;
-};
-
-enum
-{
-	PDF_PAGE_INCOMPLETE_CONTENTS = 1,
-	PDF_PAGE_INCOMPLETE_ANNOTS = 2
-};
-
-#endif

+ 0 - 39
server/lib/xfdftool/include/mupdf/pdf/parse.h

@@ -1,39 +0,0 @@
-#ifndef MUPDF_PDF_PARSE_H
-#define MUPDF_PDF_PARSE_H
-
-/*
- * tokenizer and low-level object parser
- */
-
-typedef enum
-{
-	PDF_TOK_ERROR, PDF_TOK_EOF,
-	PDF_TOK_OPEN_ARRAY, PDF_TOK_CLOSE_ARRAY,
-	PDF_TOK_OPEN_DICT, PDF_TOK_CLOSE_DICT,
-	PDF_TOK_OPEN_BRACE, PDF_TOK_CLOSE_BRACE,
-	PDF_TOK_NAME, PDF_TOK_INT, PDF_TOK_REAL, PDF_TOK_STRING, PDF_TOK_KEYWORD,
-	PDF_TOK_R, PDF_TOK_TRUE, PDF_TOK_FALSE, PDF_TOK_NULL,
-	PDF_TOK_OBJ, PDF_TOK_ENDOBJ,
-	PDF_TOK_STREAM, PDF_TOK_ENDSTREAM,
-	PDF_TOK_XREF, PDF_TOK_TRAILER, PDF_TOK_STARTXREF,
-	PDF_NUM_TOKENS
-} pdf_token;
-
-void pdf_lexbuf_init(fz_context *ctx, pdf_lexbuf *lexbuf, int size);
-void pdf_lexbuf_fin(fz_context *ctx, pdf_lexbuf *lexbuf);
-ptrdiff_t pdf_lexbuf_grow(fz_context *ctx, pdf_lexbuf *lexbuf);
-
-pdf_token pdf_lex(fz_context *ctx, fz_stream *f, pdf_lexbuf *lexbuf);
-pdf_token pdf_lex_no_string(fz_context *ctx, fz_stream *f, pdf_lexbuf *lexbuf);
-
-pdf_obj *pdf_parse_array(fz_context *ctx, pdf_document *doc, fz_stream *f, pdf_lexbuf *buf);
-pdf_obj *pdf_parse_dict(fz_context *ctx, pdf_document *doc, fz_stream *f, pdf_lexbuf *buf);
-pdf_obj *pdf_parse_stm_obj(fz_context *ctx, pdf_document *doc, fz_stream *f, pdf_lexbuf *buf);
-pdf_obj *pdf_parse_ind_obj(fz_context *ctx, pdf_document *doc, fz_stream *f, pdf_lexbuf *buf, int *num, int *gen, fz_off_t *stm_ofs, int *try_repair);
-
-/*
-	pdf_append_token: print a lexed token to a buffer, growing if necessary
-*/
-void pdf_append_token(fz_context *ctx, fz_buffer *buf, int tok, pdf_lexbuf *lex);
-
-#endif

+ 0 - 96
server/lib/xfdftool/include/mupdf/pdf/resource.h

@@ -1,96 +0,0 @@
-#ifndef MUPDF_PDF_RESOURCE_H
-#define MUPDF_PDF_RESOURCE_H
-
-/*
- * PDF interface to store
- */
-void pdf_store_item(fz_context *ctx, pdf_obj *key, void *val, size_t itemsize);
-void *pdf_find_item(fz_context *ctx, fz_store_drop_fn *drop, pdf_obj *key);
-void pdf_remove_item(fz_context *ctx, fz_store_drop_fn *drop, pdf_obj *key);
-void pdf_empty_store(fz_context *ctx, pdf_document *doc);
-
-/*
- * Structures used for managing resource locations and avoiding multiple
- * occurrences when resources are added to the document. The search for existing
- * resources will be performed when we are first trying to add an item. Object
- * refs are stored in a fz_hash_table structure using a hash of the md5 sum of
- * the data, enabling rapid lookup.
- */
-
-pdf_obj *pdf_find_font_resource(fz_context *ctx, pdf_document *doc, fz_buffer *item, unsigned char md5[16]);
-pdf_obj *pdf_insert_font_resource(fz_context *ctx, pdf_document *doc, unsigned char md5[16], pdf_obj *obj);
-pdf_obj *pdf_find_image_resource(fz_context *ctx, pdf_document *doc, fz_image *item, unsigned char md5[16]);
-pdf_obj *pdf_insert_image_resource(fz_context *ctx, pdf_document *doc, unsigned char md5[16], pdf_obj *obj);
-void pdf_drop_resource_tables(fz_context *ctx, pdf_document *doc);
-
-/*
- * Functions, Colorspaces, Shadings and Images
- */
-
-fz_function *pdf_load_function(fz_context *ctx, pdf_document *doc, pdf_obj *ref, int in, int out);
-
-fz_colorspace *pdf_load_colorspace(fz_context *ctx, pdf_document *doc, pdf_obj *obj);
-int pdf_is_tint_colorspace(fz_context *ctx, fz_colorspace *cs);
-
-fz_shade *pdf_load_shading(fz_context *ctx, pdf_document *doc, pdf_obj *obj);
-
-fz_image *pdf_load_inline_image(fz_context *ctx, pdf_document *doc, pdf_obj *rdb, pdf_obj *dict, fz_stream *file);
-int pdf_is_jpx_image(fz_context *ctx, pdf_obj *dict);
-
-fz_image *pdf_load_image(fz_context *ctx, pdf_document *doc, pdf_obj *obj);
-
-pdf_obj *pdf_add_image(fz_context *ctx, pdf_document *doc, fz_image *image, int mask);
-
-/*
- * Pattern
- */
-
-typedef struct pdf_pattern_s pdf_pattern;
-
-struct pdf_pattern_s
-{
-	fz_storable storable;
-	int ismask;
-	float xstep;
-	float ystep;
-	fz_matrix matrix;
-	fz_rect bbox;
-	pdf_document *document;
-	pdf_obj *resources;
-	pdf_obj *contents;
-};
-
-pdf_pattern *pdf_load_pattern(fz_context *ctx, pdf_document *doc, pdf_obj *obj);
-pdf_pattern *pdf_keep_pattern(fz_context *ctx, pdf_pattern *pat);
-void pdf_drop_pattern(fz_context *ctx, pdf_pattern *pat);
-
-/*
- * XObject
- */
-
-typedef struct pdf_xobject_s pdf_xobject;
-
-struct pdf_xobject_s
-{
-	fz_storable storable;
-	pdf_obj *obj;
-	int iteration;
-};
-
-pdf_xobject *pdf_load_xobject(fz_context *ctx, pdf_document *doc, pdf_obj *obj);
-pdf_obj *pdf_new_xobject(fz_context *ctx, pdf_document *doc, const fz_rect *bbox, const fz_matrix *mat);
-pdf_xobject *pdf_keep_xobject(fz_context *ctx, pdf_xobject *xobj);
-void pdf_drop_xobject(fz_context *ctx, pdf_xobject *xobj);
-void pdf_update_xobject_contents(fz_context *ctx, pdf_document *doc, pdf_xobject *form, fz_buffer *buffer);
-
-void pdf_update_appearance(fz_context *ctx, pdf_document *doc, pdf_annot *annot);
-
-pdf_obj *pdf_xobject_resources(fz_context *ctx, pdf_xobject *xobj);
-fz_rect *pdf_xobject_bbox(fz_context *ctx, pdf_xobject *xobj, fz_rect *bbox);
-fz_matrix *pdf_xobject_matrix(fz_context *ctx, pdf_xobject *xobj, fz_matrix *matrix);
-int pdf_xobject_isolated(fz_context *ctx, pdf_xobject *xobj);
-int pdf_xobject_knockout(fz_context *ctx, pdf_xobject *xobj);
-int pdf_xobject_transparency(fz_context *ctx, pdf_xobject *xobj);
-fz_colorspace *pdf_xobject_colorspace(fz_context *ctx, pdf_xobject *xobj);
-
-#endif

+ 0 - 127
server/lib/xfdftool/include/mupdf/pdf/widget.h

@@ -1,127 +0,0 @@
-#ifndef MUPDF_PDF_WIDGET_H
-#define MUPDF_PDF_WIDGET_H
-
-/* Types of widget */
-enum
-{
-	PDF_WIDGET_TYPE_NOT_WIDGET = -1,
-	PDF_WIDGET_TYPE_PUSHBUTTON,
-	PDF_WIDGET_TYPE_CHECKBOX,
-	PDF_WIDGET_TYPE_RADIOBUTTON,
-	PDF_WIDGET_TYPE_TEXT,
-	PDF_WIDGET_TYPE_LISTBOX,
-	PDF_WIDGET_TYPE_COMBOBOX,
-	PDF_WIDGET_TYPE_SIGNATURE
-};
-
-/* Types of text widget content */
-enum
-{
-	PDF_WIDGET_CONTENT_UNRESTRAINED,
-	PDF_WIDGET_CONTENT_NUMBER,
-	PDF_WIDGET_CONTENT_SPECIAL,
-	PDF_WIDGET_CONTENT_DATE,
-	PDF_WIDGET_CONTENT_TIME
-};
-
-/*
-	Widgets that may appear in PDF forms
-*/
-
-/*
-	pdf_focused_widget: returns the currently focused widget
-
-	Widgets can become focused as a result of passing in ui events.
-	NULL is returned if there is no currently focused widget. An
-	app may wish to create a native representative of the focused
-	widget, e.g., to collect the text for a text widget, rather than
-	routing key strokes through pdf_pass_event.
-*/
-pdf_widget *pdf_focused_widget(fz_context *ctx, pdf_document *doc);
-
-/*
-	pdf_first_widget: get first widget when enumerating
-*/
-pdf_widget *pdf_first_widget(fz_context *ctx, pdf_document *doc, pdf_page *page);
-
-/*
-	pdf_next_widget: get next widget when enumerating
-*/
-pdf_widget *pdf_next_widget(fz_context *ctx, pdf_widget *previous);
-
-/*
-	pdf_create_widget: create a new widget of a specific type
-*/
-pdf_widget *pdf_create_widget(fz_context *ctx, pdf_document *doc, pdf_page *page, int type, char *fieldname);
-
-/*
-	pdf_widget_type: find out the type of a widget.
-
-	The type determines what widget subclass the widget
-	can safely be cast to.
-*/
-int pdf_widget_type(fz_context *ctx, pdf_widget *widget);
-
-/*
-	pdf_bound_widget: get the bounding box of a widget.
-*/
-fz_rect *pdf_bound_widget(fz_context *ctx, pdf_widget *widget, fz_rect *);
-
-/*
-	pdf_text_widget_text: Get the text currently displayed in
-	a text widget.
-*/
-char *pdf_text_widget_text(fz_context *ctx, pdf_document *doc, pdf_widget *tw);
-
-/*
-	pdf_widget_text_max_len: get the maximum number of
-	characters permitted in a text widget
-*/
-int pdf_text_widget_max_len(fz_context *ctx, pdf_document *doc, pdf_widget *tw);
-
-/*
-	pdf_text_widget_content_type: get the type of content
-	required by a text widget
-*/
-int pdf_text_widget_content_type(fz_context *ctx, pdf_document *doc, pdf_widget *tw);
-
-/*
-	pdf_text_widget_set_text: Update the text of a text widget.
-	The text is first validated and accepted only if it passes. The
-	function returns whether validation passed.
-*/
-int pdf_text_widget_set_text(fz_context *ctx, pdf_document *doc, pdf_widget *tw, char *text);
-
-/*
-	pdf_choice_widget_options: get the list of options for a list
-	box or combo box. Returns the number of options and fills in their
-	names within the supplied array. Should first be called with a
-	NULL array to find out how big the array should be.  If exportval
-	is true, then the export values will be returned and not the list
-	values if there are export values present.
-*/
-int pdf_choice_widget_options(fz_context *ctx, pdf_document *doc, pdf_widget *tw, int exportval, char *opts[]);
-
-/*
-	pdf_choice_widget_is_multiselect: returns whether a list box or
-	combo box supports selection of multiple options
-*/
-int pdf_choice_widget_is_multiselect(fz_context *ctx, pdf_document *doc, pdf_widget *tw);
-
-/*
-	pdf_choice_widget_value: get the value of a choice widget.
-	Returns the number of options currently selected and fills in
-	the supplied array with their strings. Should first be called
-	with NULL as the array to find out how big the array need to
-	be. The filled in elements should not be freed by the caller.
-*/
-int pdf_choice_widget_value(fz_context *ctx, pdf_document *doc, pdf_widget *tw, char *opts[]);
-
-/*
-	pdf_widget_set_value: set the value of a choice widget. The
-	caller should pass the number of options selected and an
-	array of their names
-*/
-void pdf_choice_widget_set_value(fz_context *ctx, pdf_document *doc, pdf_widget *tw, int n, char *opts[]);
-
-#endif

+ 0 - 124
server/lib/xfdftool/include/mupdf/pdf/xref.h

@@ -1,124 +0,0 @@
-#ifndef MUPDF_PDF_XREF_H
-#define MUPDF_PDF_XREF_H
-
-/*
-	pdf_create_object: Allocate a slot in the xref table and return a fresh unused object number.
-*/
-int pdf_create_object(fz_context *ctx, pdf_document *doc);
-
-/*
-	pdf_delete_object: Remove object from xref table, marking the slot as free.
-*/
-void pdf_delete_object(fz_context *ctx, pdf_document *doc, int num);
-
-/*
-	pdf_update_object: Replace object in xref table with the passed in object.
-*/
-void pdf_update_object(fz_context *ctx, pdf_document *doc, int num, pdf_obj *obj);
-
-/*
-	pdf_update_stream: Replace stream contents for object in xref table with the passed in buffer.
-
-	The buffer contents must match the /Filter setting if 'compressed' is true.
-	If 'compressed' is false, the /Filter and /DecodeParms entries are deleted.
-	The /Length entry is updated.
-*/
-void pdf_update_stream(fz_context *ctx, pdf_document *doc, pdf_obj *ref, fz_buffer *buf, int compressed);
-
-pdf_obj *pdf_add_object(fz_context *ctx, pdf_document *doc, pdf_obj *obj);
-pdf_obj *pdf_add_object_drop(fz_context *ctx, pdf_document *doc, pdf_obj *obj);
-pdf_obj *pdf_add_stream(fz_context *ctx, pdf_document *doc, fz_buffer *buf, pdf_obj *obj, int compressed);
-
-/*
- * xref and object / stream api
- */
-
-typedef struct pdf_xref_entry_s pdf_xref_entry;
-
-struct pdf_xref_entry_s
-{
-	char type;		/* 0=unset (f)ree i(n)use (o)bjstm */
-	unsigned char flags;	/* bit 0 = marked */
-	unsigned short gen;	/* generation / objstm index */
-	int num;		/* original object number (for decryption after renumbering) */
-	fz_off_t ofs;		/* file offset / objstm object number */
-	fz_off_t stm_ofs;	/* on-disk stream */
-	fz_buffer *stm_buf;	/* in-memory stream (for updated objects) */
-	pdf_obj *obj;		/* stored/cached object */
-};
-
-enum
-{
-	PDF_OBJ_FLAG_MARK = 1,
-};
-
-typedef struct pdf_xref_subsec_s pdf_xref_subsec;
-
-struct pdf_xref_subsec_s
-{
-	pdf_xref_subsec *next;
-	int len;
-	fz_off_t start;
-	pdf_xref_entry *table;
-};
-
-struct pdf_xref_s
-{
-	int num_objects;
-	pdf_xref_subsec *subsec;
-	pdf_obj *trailer;
-	pdf_obj *pre_repair_trailer;
-	pdf_unsaved_sig *unsaved_sigs;
-	pdf_unsaved_sig **unsaved_sigs_end;
-	fz_off_t end_ofs; /* file offset to end of xref */
-};
-
-pdf_xref_entry *pdf_cache_object(fz_context *ctx, pdf_document *doc, int num);
-
-int pdf_count_objects(fz_context *ctx, pdf_document *doc);
-pdf_obj *pdf_resolve_indirect(fz_context *ctx, pdf_obj *ref);
-pdf_obj *pdf_resolve_indirect_chain(fz_context *ctx, pdf_obj *ref);
-pdf_obj *pdf_load_object(fz_context *ctx, pdf_document *doc, int num);
-
-fz_buffer *pdf_load_raw_stream_number(fz_context *ctx, pdf_document *doc, int num);
-fz_buffer *pdf_load_raw_stream(fz_context *ctx, pdf_obj *ref);
-fz_buffer *pdf_load_stream_number(fz_context *ctx, pdf_document *doc, int num);
-fz_buffer *pdf_load_stream(fz_context *ctx, pdf_obj *ref);
-fz_stream *pdf_open_raw_stream_number(fz_context *ctx, pdf_document *doc, int num);
-fz_stream *pdf_open_raw_stream(fz_context *ctx, pdf_obj *ref);
-fz_stream *pdf_open_stream_number(fz_context *ctx, pdf_document *doc, int num);
-fz_stream *pdf_open_stream(fz_context *ctx, pdf_obj *ref);
-
-fz_stream *pdf_open_inline_stream(fz_context *ctx, pdf_document *doc, pdf_obj *stmobj, int length, fz_stream *chain, fz_compression_params *params);
-fz_compressed_buffer *pdf_load_compressed_stream(fz_context *ctx, pdf_document *doc, int num);
-void pdf_load_compressed_inline_image(fz_context *ctx, pdf_document *doc, pdf_obj *dict, int length, fz_stream *cstm, int indexed, fz_compressed_image *image);
-fz_stream *pdf_open_stream_with_offset(fz_context *ctx, pdf_document *doc, int num, pdf_obj *dict, fz_off_t stm_ofs);
-fz_stream *pdf_open_compressed_stream(fz_context *ctx, fz_compressed_buffer *);
-fz_stream *pdf_open_contents_stream(fz_context *ctx, pdf_document *doc, pdf_obj *obj);
-fz_buffer *pdf_load_stream_truncated(fz_context *ctx, pdf_document *doc, int num, int *truncated);
-
-pdf_obj *pdf_trailer(fz_context *ctx, pdf_document *doc);
-void pdf_set_populating_xref_trailer(fz_context *ctx, pdf_document *doc, pdf_obj *trailer);
-int pdf_xref_len(fz_context *ctx, pdf_document *doc);
-pdf_xref_entry *pdf_get_populating_xref_entry(fz_context *ctx, pdf_document *doc, int i);
-pdf_xref_entry *pdf_get_xref_entry(fz_context *ctx, pdf_document *doc, int i);
-void pdf_replace_xref(fz_context *ctx, pdf_document *doc, pdf_xref_entry *entries, int n);
-void pdf_xref_ensure_incremental_object(fz_context *ctx, pdf_document *doc, int num);
-int pdf_xref_is_incremental(fz_context *ctx, pdf_document *doc, int num);
-void pdf_xref_store_unsaved_signature(fz_context *ctx, pdf_document *doc, pdf_obj *field, pdf_signer *signer);
-int pdf_xref_obj_is_unsaved_signature(pdf_document *doc, pdf_obj *obj);
-
-void pdf_repair_xref(fz_context *ctx, pdf_document *doc);
-void pdf_repair_obj_stms(fz_context *ctx, pdf_document *doc);
-void pdf_ensure_solid_xref(fz_context *ctx, pdf_document *doc, int num);
-void pdf_mark_xref(fz_context *ctx, pdf_document *doc);
-void pdf_clear_xref(fz_context *ctx, pdf_document *doc);
-void pdf_clear_xref_to_mark(fz_context *ctx, pdf_document *doc);
-
-int pdf_repair_obj(fz_context *ctx, pdf_document *doc, pdf_lexbuf *buf, fz_off_t *stmofsp, int *stmlenp, pdf_obj **encrypt, pdf_obj **id, pdf_obj **page, fz_off_t *tmpofs, pdf_obj **root);
-
-pdf_obj *pdf_progressive_advance(fz_context *ctx, pdf_document *doc, int pagenum);
-
-void pdf_print_xref(fz_context *ctx, pdf_document *);
-
-#endif

+ 0 - 7
server/lib/xfdftool/include/mupdf/svg.h

@@ -1,7 +0,0 @@
-#ifndef MUPDF_SVG_H
-#define MUPDF_SVG_H
-
-fz_display_list *fz_new_display_list_from_svg(fz_context *ctx, fz_buffer *buf, float *w, float *h);
-fz_image *fz_new_image_from_svg(fz_context *ctx, fz_buffer *buf);
-
-#endif

BIN
server/lib/xfdftool/lib/libmupdf.a


BIN
server/lib/xfdftool/lib/libmupdfthird.a


+ 0 - 308
server/lib/xfdftool/share/doc/mupdf/CHANGES

@@ -1,308 +0,0 @@
-List of changes in MuPDF 1.11
-
-* This is primarily a bug fix release.
-
-* Split Android and iOS viewers into separate projects:
-	* mupdf-viewer-ios.git has the iOS viewer.
-	* mupdf-viewer-android-old.git has the Android viewer.
-	* mupdf-viewer-android-nui.git has a new advanced Android viewer.
-	* mupdf-viewer-android-mini.git has a new minimalist Android viewer.
-
-* PDF portfolio support with command line tool "mutool portfolio".
-* Add callbacks to load fallback fonts from the system.
-* Use system fonts in Android to reduce install size.
-* Flag to disable publisher styles in EPUB layout.
-* Improved SVG output.
-
-List of changes in MuPDF 1.10
-
-* Headline changes:
-	* FictionBook (FB2) e-book support.
-	* Simple SVG parser (a small subset of SVG only).
-	* mutool convert: a new document conversion tool and interface.
-	* Multi-threaded rendering in mudraw.
-	* Luratech decoders for JBIG2 and JPEG2000 (commercial releases only).
-	* Optional JPEG-XR support (not included by default for security reasons).
-	* Updated base 14 fonts from URW.
-	* New CJK font with language specific variants.
-	* Hyperlink support in EPUB.
-
-* Reduced memory use:
-	* New tool muraster: example printer driver with limited RAM usage and automatic banding.
-	* Alpha channel is now optional in pixmaps.
-	* More aggressive purging of cached objects.
-	* Partial image decoding for lower memory use when banding.
-
-* Reduced code size when building with a subset of features:
-	* Reduced default set of built-in CMap tables to the minimum required.
-	* FZ_ENABLE_PDF, _XPS, _JS, to disable features at compile time.
-	* Function level linking.
-
-* Interface changes and cleanups:
-	* Dropped pdf object generation numbers from public interfaces.
-	* Simplified PDF page, xobject, and annotation internals.
-	* Closing and freeing devices and writers are now separate steps.
-	* Improved PDF annotation editing interface (still a work in progress).
-	* Document writer interface.
-	* Banded image writer interface.
-
-* Mobile viewers:
-	* New JNI interfaces to match capabilities of 'mutool run' javascript.
-	* New android and desktop java examples using new JNI interface.
-
-List of changes in MuPDF 1.9
-
-* Headline changes:
-	* New command line tools: create and run.
-	* New low-level Java interface for desktop and android.
-	* Bidirectional layout for Arabic and Hebrew scripts.
-	* Shaping complex scripts for EPUB text layout.
-	* Noto fallback fonts for EPUB layout.
-
-* mutool create
-	Create new PDF files from scratch.
-	Read an annotated content stream in a text file and write a PDF file,
-	automatically embedding font and image resources.
-
-* mutool run
-	Run javascript scripts with MuPDF bindings.
-	The interface is similar to the new Java interface.
-
-* mutool draw
-	Optional multi-threaded operation (Windows and pthreads).
-	Optional low memory mode (primarily for testing).
-
-List of changes in MuPDF 1.8
-
-* Headline changes:
-	* New OpenGL-based barebones desktop viewer.
-	* New URW fonts with greek and cyrillic.
-	* 64-bit file support.
-	* Ghostscript proofing mode (source only; not in shipped binaries).
-
-* EPUB improvements:
-	* User style sheets.
-	* GIF images (also for CBZ).
-	* Table of contents.
-	* CJK text.
-	* Page margins.
-	* Many bug fixes.
-
-* Bug fixes:
-	* Updated FreeType to version 2.6.1.
-	* Various font substitution bug fixes.
-	* Fix setjmp/longjmp behaviour which could cause optimizing compilers to misbehave.
-
-List of changes in MuPDF 1.7a
-
-* Bugfixes
-	* Fixed bug that allocated too much memory when packing paths.
-	* Fixed EPUB font scaling bug.
-	* Fixed EPUB file type handling in viewers.
-	* Improved tolerance for broken and unsupported CSS.
-
-* Features
-	* Added mudraw -z option to compress output streams.
-
-List of changes in MuPDF 1.7
-
-* Headline changes:
-	* New 'Indie dev' licensing options - contact sales@artifex.com for more details.
-	* New HTML layout engine, and (DRM-free) EPUB viewer.
-	* Reduced memory usage - displaylists and internal PDF representation take much less memory, reducing total memory use on some files by over 60%.
-
-* Important API changes:
-	* Bound contexts have been removed; we now pass fz_contexts explicitly.
-	* Reference counting of paths and text structures.
-
-* Features:
-	* Add mutool pages option.
-	* Tweaked rendering to prevent feature dropout in common cases.
-	* Viewer tweaks
-		* Better mouse wheel handling
-		* Shift-space support
-		* Mouse button control of presentation mode
-
-* Internal changes:
-	* Removal of bound contexts; fz_contexts now passed explicitly everywhere.
-	* PDF filter revamp - simpler interface.
-	* Devices use derived structures rather than user pointer.
-	* Sparse PDF xrefs held in more compact form.
-	* New gsview viewer split out to its own repository.
-
-* Bug fixes
-	* Improved handling of broken files.
-	* Fix BBoxes of Type 3 fonts.
-	* Updated fonts (including greek and cyrillic).
-	* Various memory leaks and crashes.
-	* And many more.
-
-
-List of changes in MuPDF 1.6
-
-* Features:
-	* Color detection device (mudraw -T).
-	* Sepia mode full-page color tinting in X11 and win32 viewer (keybinding: shift-C).
-	* Re-implement printf and strtod due to portability issue with locales and number formatting.
-	* Add 'gsview' project: a Windows Modern UI viewer.
-	* Improve XML parser interface.
-* Bug fixes:
-	* CBZ page ordering
-	* ZIP64 support
-	* iOS and Android bug fixes
-	* Miscellaneous minor fixes
-
-
-List of changes in MuPDF 1.5
-
-* Bug fixes.
-
-
-List of changes in MuPDF 1.4
-
-* Headline changes:
-	* CMYK rendering (mudraw PWG and PAM formats)
-	* TIFF viewer (with multi-page support).
-	* Added MuJS Javascript interpreter.
-		* MuJS is the default, V8 and JavaScriptCore are compile time options.
-		* Javascript support has to be explicitly enabled with pdf_enable_js.
-		* All viewers now have JavaScript enabled in the default builds.
-* Viewers:
-	* X11: Horizontal scroll wheel support.
-	* X11: Status bar display with warnings.
-	* Android: Digital signatures.
-	* iOS: Links, form filling, annotation editing, and javascript.
-	* iOS: Reflow mode.
-	* WinRT: Printing.
-	* WinRT: Improved zooming behaviour.
-* Tools:
-	* mudraw: Banded rendering with -B /band-height/.
-	* mudraw: Select output format with -F /format/.
-	* mudraw: Write to stdout if you use '-' as the output file name.
-	* mudraw: Add TGA output format.
-	* mudraw: Improved SVG output.
-	* mutool show: Write output to file instead of stdout with -o /filename/.
-	* mutool clean: Clean content streams with -s option.
-* Annotations:
-	* Improved font handling.
-	* Form fields.
-	* Free text.
-	* Sticky notes.
-* Optimizations:
-	* glyph cache: Partial eviction.
-	* glyph cache: Run-length compressed glyphs.
-	* Smarter handling of subpixel metrics in text rendering.
-	* Optimized blitting functions.
-	* Optimized gradient mesh drawing.
-* API changes and additions:
-	* fz_stream API reworked: replace "read" function with "next".
-	* "Rebind" functions to associate context bound objects with another context:
-		fz_output, fz_stream, fz_device and fz_document.
-	* Introduce "document handlers" to detect and open different file types.
-		* Must now call fz_register_document_handlers() to register the defaults.
-		* May register your own handlers as well to work with fz_open_document.
-	* Hook to load system fonts: fz_install_load_system_font_funcs.
-	* PDF xref cache flushing functions (mark/clear/clear-to-mark).
-	* Add our own "printf" set of functions to format strings and write to fz_output:
-		* Format %f as short as possible while preserving precision.
-		* Has %C for formatting a unicode character as UTF-8.
-		* Has %M to format fz_matrix.
-		* Has %R to format fz_rect.
-		* Has %q and %( to format strings with escaped characters.
-	* PDF process interface: allow PDF interpreter to do more than just draw!
-		* Content stream state cleaning filter.
-		* Content stream rewriting filter.
-	* PDF digital signatures.
-	* Stroke states may now be stored on the stack.
-	* Improved fz_path internals.
-	* Gradient mesh drawing interface has been improved.
-	* Save files with incremental updates.
-
-
-List of changes in MuPDF 1.3
-
- * Windows RT viewer app for MuPDF.
- * Library changes to support progressive loading (display PDF files as
-   they download). Windows/Linux/MacOS viewer supports this using curl.
- * Incremental updates to PDF files are now (optionally) preserved on
-   loading/saving.
- * Prototype support for checking PDF Digital Signatures.
- * Initial annotation support (strike-out, underline, highlight and ink)
-   (library and android builds only).
- * Fix operation on Android API level 8.
- * Android redraw optimisations.
- * Android app now supports Google Cloud Print.
- * Android app translated into many languages.
- * Android support for more architectures.
- * Improvements to store (avoid collisions causing unnecessary evictions).
- * Windows apps use Unicode filenames now.
- * PDF function handling improved; functions can now be passed to devices
-   without 'sampling'.
- * PDF image handling improved; images can now be passed to devices
-   without decompression.
- * Indexed images are no longer uncompressed at load time, saving memory.
- * Caching of rendered tiles for speed.
- * Improved text analysis mode, capable of spotting columns/indents,
-   right-to-left text etc.
- * HTML output mode now includes image output.
- * PDF password encoding handling improved.
- * MuPDF now opens Jpeg, Tiff and PNG files directly.
- * Bug preventing OpenXPS files from being opened fixed.
- * Initial (feature incomplete) SVG and PDF output devices.
- * PWG raster (mono/grey/RGB) and PCL (mono) output devices.
- * Various performance improvements (including tilings and mesh based
-   shadings).
- * Revamped directory structure to reflect recent changes.
- * Various potential SEGV, SoftMask and rendering fixes.
- * Many potential crashes in Jpeg2000 and JBIG2 images fixed.
-
-
-List of changes in MuPDF 1.2
-
- * Important API changes:
-    * fz_bbox is now fz_irect.
-    * APIs (including fz_device) now pass fz_rect/fz_matrix by reference.
-    * fz_device API is now more consistent with regards to use of
-      fz_rect rather than fz_bbox.
- * Add support for Javascript and forms handling.
- * Fix many SEGVs with out of spec files. Many thanks to Mateusz "j00ru"
-   Jurczyk and Gynvael Coldwind of the Google Security team, zeniko,
-   Sebastian Rasmussen and all other contributors.
- * Add fz_open_document_with_stream to allow non-file based operation.
- * Move to using git submodules for third party libraries.
- * Much enhanced Android application. Now on Google Play!
- * Oversized and stroke text clipping implemented.
- * Change shadings to decompose at render times; massive memory savings.
- * Renamed 'mubusy' to 'mutool'.
- * PDF 1.7 Extension Level 8 encryption implemented.
- * Added consts to various parts of the API to help C++ interworking.
- * Prototype transition support.
- * Text searching API moved to fitz.
- * Highlight and copy text selections.
- * Performance enhancements for color conversion and fax decompression.
- * ARM optimisations for color conversion and bitmap scaling.
- * Bitmap subsampling stage introduced, with ARM optimisations.
- * Type 3 fonts; glyphs are now handled as display lists.
- * Scan converter performance improvements.
- * Various rendering fixes.
-
-
-List of changes in MuPDF 1.1
-
- * Rendering bugs fixed (text clipping, stroked text etc).
- * Better handling of 'large' (uncachable) glyphs.
- * Added a delete button to the library view on the iOS port.
- * Minor speed optimisations.
- * Shading bug fixes.
- * Move to using dynamically allocated parsing buffers (more resilient).
- * Support for UserUnits.
- * Fix bugs with image predictors (including with 16 bit images).
- * More resilient to out of spec files.
- * Extract pdf writing capability into the library from pdfclean, and
-   expand on it to allow for linearisation. Bug fixes in the garbage
-   collection of unused objects.
- * Improve pdf writing recognition of images.
- * Improved font matching.
- * Start to move away from macros to inline functions (helpful for
-   applications requiring certification).
- * Many bugs fixed.

+ 0 - 661
server/lib/xfdftool/share/doc/mupdf/COPYING

@@ -1,661 +0,0 @@
-                    GNU AFFERO GENERAL PUBLIC LICENSE
-                       Version 3, 19 November 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The GNU Affero General Public License is a free, copyleft license for
-software and other kinds of works, specifically designed to ensure
-cooperation with the community in the case of network server software.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-our General Public Licenses are intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  Developers that use our General Public Licenses protect your rights
-with two steps: (1) assert copyright on the software, and (2) offer
-you this License which gives you legal permission to copy, distribute
-and/or modify the software.
-
-  A secondary benefit of defending all users' freedom is that
-improvements made in alternate versions of the program, if they
-receive widespread use, become available for other developers to
-incorporate.  Many developers of free software are heartened and
-encouraged by the resulting cooperation.  However, in the case of
-software used on network servers, this result may fail to come about.
-The GNU General Public License permits making a modified version and
-letting the public access it on a server without ever releasing its
-source code to the public.
-
-  The GNU Affero General Public License is designed specifically to
-ensure that, in such cases, the modified source code becomes available
-to the community.  It requires the operator of a network server to
-provide the source code of the modified version running there to the
-users of that server.  Therefore, public use of a modified version, on
-a publicly accessible server, gives the public access to the source
-code of the modified version.
-
-  An older license, called the Affero General Public License and
-published by Affero, was designed to accomplish similar goals.  This is
-a different license, not a version of the Affero GPL, but Affero has
-released a new version of the Affero GPL which permits relicensing under
-this license.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU Affero General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Remote Network Interaction; Use with the GNU General Public License.
-
-  Notwithstanding any other provision of this License, if you modify the
-Program, your modified version must prominently offer all users
-interacting with it remotely through a computer network (if your version
-supports such interaction) an opportunity to receive the Corresponding
-Source of your version by providing access to the Corresponding Source
-from a network server at no charge, through some standard or customary
-means of facilitating copying of software.  This Corresponding Source
-shall include the Corresponding Source for any work covered by version 3
-of the GNU General Public License that is incorporated pursuant to the
-following paragraph.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the work with which it is combined will remain governed by version
-3 of the GNU General Public License.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU Affero General Public License from time to time.  Such new versions
-will be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU Affero General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU Affero General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU Affero General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU Affero General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU Affero General Public License for more details.
-
-    You should have received a copy of the GNU Affero General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If your software can interact with users remotely through a computer
-network, you should also make sure that it provides a way for users to
-get its source.  For example, if your program is a web application, its
-interface could display a "Source" link that leads users to an archive
-of the code.  There are many ways you could offer source, and different
-solutions will be better for different programs; see section 13 for the
-specific requirements.
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU AGPL, see
-<http://www.gnu.org/licenses/>.

+ 0 - 89
server/lib/xfdftool/share/doc/mupdf/README

@@ -1,89 +0,0 @@
-ABOUT
-
-MuPDF is a lightweight PDF, XPS, EPUB and CBZ viewer and parser/rendering
-library.
-
-The renderer in MuPDF is tailored for high quality anti-aliased graphics. It
-renders text with metrics and spacing accurate to within fractions of a pixel
-for the highest fidelity in reproducing the look of a printed page on screen.
-
-MuPDF is also small, fast, and yet complete. We support PDF 1.7 with
-transparency, encryption, hyperlinks, annotations, search and many other bells
-and whistles. MuPDF can also read XPS documents (OpenXPS / ECMA-388),
-EPUB and CBZ (Comic Book archive) files.
-
-MuPDF is written to be both modular and portable; the example applications
-are merely thin layers on top of the functionality offered by the library,
-so custom viewers can be easily built for a wide range of platforms. Example
-viewer applications are supplied for Windows, Linux, MacOS, iOS and Android.
-
-MuPDF is deliberately designed to be threading library agnostic, while still
-supporting multi-threaded operation. In the absence of a thread library
-it will run single-threaded, but by adding one significant benefits in
-rendering speed on multi-core platforms can be obtained.
-
-Interactive features such as form filling, javascript and transitions
-are in development and partially supported by the Android application.
-
-LICENSE
-
-MuPDF is Copyright (c) 2006-2017 Artifex Software, Inc.
-
-This program is free software: you can redistribute it and/or modify it under
-the terms of the GNU Affero General Public License as published by the Free
-Software Foundation, either version 3 of the License, or (at your option) any
-later version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU Affero General Public License along
-with this program. If not, see <http://www.gnu.org/licenses/>.
-
-For commercial licensing, including our "Indie Dev" friendly options,
-please contact sales@artifex.com.
-
-COMPILING
-
-If you are compiling from source you will need several third party libraries:
-freetype2, jbig2dec, libjpeg, openjpeg, and zlib. These libraries are contained
-in the source archive. If you are using git, they are included as git
-submodules.
-
-You will also need the X11 headers and libraries if you're building on Linux.
-These can typically be found in the xorg-dev package. Alternatively, if you
-only want the command line tools, you can build with HAVE_X11=no.
-
-The new OpenGL-based viewer also needs OpenGL headers and libraries. If you're
-building on Linux, install the mesa-common-dev and libgl1-mesa-dev packages.
-You'll also need several X11 development packages: xorg-dev, libxcursor-dev,
-libxrandr-dev, and libxinerama-dev. To skip building the OpenGL viewer, build
-with HAVE_GLFW=no.
-
-DOWNLOAD
-
-The latest development source is available directly from the git repository:
-
-	git clone --recursive git://git.ghostscript.com/mupdf.git
-
-In the mupdf directory, update the third party libraries:
-
-	git submodule update --init
-
-INSTALLING (UNIX)
-
-Typing "make prefix=/usr/local install" will install the binaries, man-pages,
-static libraries and header files on your system.
-
-REPORTING BUGS AND PROBLEMS
-
-The MuPDF developers hang out on IRC in the #ghostscript channel on
-irc.freenode.net.
-
-Report bugs on the ghostscript bugzilla, with MuPDF as the selected component.
-
-	http://bugs.ghostscript.com/
-
-If you are reporting a problem with PDF parsing, please include the problematic
-file as an attachment.

+ 0 - 32
server/lib/xfdftool/share/doc/mupdf/naming.txt

@@ -1,32 +0,0 @@
-Functions should be named according to one of the following schemes:
-
-	verb_noun
-	verb_noun_with_noun
-
-	noun_attribute
-	get_noun_attribute -- when the 'noun_attribute' name conflicts with a type
-	set_noun_attribute
-
-	noun_from_noun -- convert from one type to another (avoid noun_to_noun)
-
-Prefixes are mandatory for exported functions, macros, enums, globals and types.
-
-	fz for common code
-	pdf, xps, etc., for interpreter specific code
-
-Prefixes are optional (but encouraged) for private functions and types.
-
-Avoid using 'get' as this is a meaningless and redundant filler word.
-
-These words are reserved for reference counting schemes:
-
-	new, find, load, open, keep -- return objects that you are responsible for freeing.
-
-	drop -- relinquish ownership of the object passed in.
-
-When searching for an object or value, the name used depends on whether
-returning the value is passing ownership:
-
-	lookup -- return a value or borrowed pointer
-
-	find -- return an object that the caller is responsible for freeing

+ 0 - 290
server/lib/xfdftool/share/doc/mupdf/overview.txt

@@ -1,290 +0,0 @@
-Contents
-========
-
-* Basic MuPDF usage example
-* Common function arguments
-* Error Handling
-* Multi-threading
-* Cloning the context
-* Bound contexts
-
-Basic MuPDF usage example
-=========================
-
-For an example of how to use MuPDF in the most basic way, see
-doc/example.c. To limit the complexity and give an easier introduction
-this code has no error handling at all, but any serious piece of code
-using MuPDF should use the error handling strategies described below.
-
-Common function arguments
-=========================
-
-Most functions in MuPDF's interface take a context argument.
-
-A context contains global state used by MuPDF inside functions when
-parsing or rendering pages of the document. It contains for example:
-
-	an exception stack (see error handling below),
-
-	a memory allocator (allowing for custom allocators)
-
-	a resource store (for caching of images, fonts, etc.)
-
-	a set of locks and (un-)locking functions (for multi-threading)
-
-Without the set of locks and accompanying functions the context and
-its proxies may only be used in a single-threaded application.
-
-Error handling
-==============
-
-MuPDF uses a set of exception handling macros to simplify error return
-and cleanup. Conceptually, they work a lot like C++'s try/catch
-system, but do not require any special compiler support.
-
-The basic formulation is as follows:
-
-	fz_try(ctx)
-	{
-		// Try to perform a task. Never 'return', 'goto' or
-		// 'longjmp' out of here. 'break' may be used to
-		// safely exit (just) the try block scope.
-	}
-	fz_always(ctx)
-	{
-		// Any code here is always executed, regardless of
-		// whether an exception was thrown within the try or
-		// not. Never 'return', 'goto' or longjmp out from
-		// here. 'break' may be used to safely exit (just) the
-		// always block scope.
-	}
-	fz_catch(ctx)
-	{
-		// This code is called (after any always block) only
-		// if something within the fz_try block (including any
-		// functions it called) threw an exception. The code
-		// here is expected to handle the exception (maybe
-		// record/report the error, cleanup any stray state
-		// etc) and can then either exit the block, or pass on
-		// the exception to a higher level (enclosing) fz_try
-		// block (using fz_throw, or fz_rethrow).
-	}
-
-The fz_always block is optional, and can safely be omitted.
-
-The macro based nature of this system has 3 main limitations:
-
-1)	Never return from within try (or 'goto' or longjmp out of it).
-	This upsets the internal housekeeping of the macros and will
-	cause problems later on. The code will detect such things
-	happening, but by then it is too late to give a helpful error
-	report as to where the original infraction occurred.
-
-2)	The fz_try(ctx) { ... } fz_always(ctx) { ... } fz_catch(ctx) { ... }
-	is not one atomic C statement. That is to say, if you do:
-
-		if (condition)
-			fz_try(ctx) { ... }
-			fz_catch(ctx) { ... }
-
-	then you will not get what you want. Use the following instead:
-
-		if (condition) {
-			fz_try(ctx) { ... }
-			fz_catch(ctx) { ... }
-		}
-
-3)	The macros are implemented using setjmp and longjmp, and so
-	the standard C restrictions on the use of those functions
-	apply to fz_try/fz_catch too. In particular, any "truly local"
-	variable that is set between the start of fz_try and something
-	in fz_try throwing an exception may become undefined as part
-	of the process of throwing that exception.
-
-	As a way of mitigating this problem, we provide a fz_var()
-	macro that tells the compiler to ensure that that variable is
-	not unset by the act of throwing the exception.
-
-A model piece of code using these macros then might be:
-
-	house build_house(plans *p)
-	{
-		material m = NULL;
-		walls w = NULL;
-		roof r = NULL;
-		house h = NULL;
-		tiles t = make_tiles();
-
-		fz_var(w);
-		fz_var(r);
-		fz_var(h);
-
-		fz_try(ctx)
-		{
-			fz_try(ctx)
-			{
-				m = make_bricks();
-			}
-			fz_catch(ctx)
-			{
-				// No bricks available, make do with straw?
-				m = make_straw();
-			}
-			w = make_walls(m, p);
-			r = make_roof(m, t);
-			// Note, NOT: return combine(w,r);
-			h = combine(w, r);
-		}
-		fz_always(ctx)
-		{
-			drop_walls(w);
-			drop_roof(r);
-			drop_material(m);
-			drop_tiles(t);
-		}
-		fz_catch(ctx)
-		{
-			fz_throw(ctx, "build_house failed");
-		}
-		return h;
-	}
-
-Things to note about this:
-
-a)	If make_tiles throws an exception, this will immediately be
-	handled by some higher level exception handler. If it
-	succeeds, t will be set before fz_try starts, so there is no
-	need to fz_var(t);
-
-b)	We try first off to make some bricks as our building material.
-	If this fails, we fall back to straw. If this fails, we'll end
-	up in the fz_catch, and the process will fail neatly.
-
-c)	We assume in this code that combine takes new reference to
-	both the walls and the roof it uses, and therefore that w and
-	r need to be cleaned up in all cases.
-
-d)	We assume the standard C convention that it is safe to destroy
-	NULL things.
-
-Multi-threading
-===============
-
-First off, study the basic usage example in doc/example.c and make
-sure you understand how it works as the data structures manipulated
-there will be refered to in this section too.
-
-MuPDF can usefully be built into a multi-threaded application without
-the library needing to know anything threading at all. If the library
-opens a document in one thread, and then sits there as a 'server'
-requesting pages and rendering them for other threads that need them,
-then the library is only ever being called from this one thread.
-
-Other threads can still be used to handle UI requests etc, but as far
-as MuPDF is concerned it is only being used in a single threaded way.
-In this instance, there are no threading issues with MuPDF at all,
-and it can safely be used without any locking, as described in the
-previous sections.
-
-This section will attempt to explain how to use MuPDF in the more
-complex case; where we genuinely want to call the MuPDF library
-concurrently from multiple threads within a single application.
-
-MuPDF can be invoked with a user supplied set of locking functions.
-It uses these to take mutexes around operations that would conflict
-if performed concurrently in multiple threads. By leaving the
-exact implementation of locks to the caller MuPDF remains threading
-library agnostic.
-
-The following simple rules should be followed to ensure that
-multi-threaded operations run smoothly:
-
-1)	"No simultaneous calls to MuPDF in different threads are
-	allowed to use the same context."
-
-	Most of the time it is simplest to just use a different
-	context for every thread; just create a new context at the
-	same time as you create the thread. For more details see
-	"Cloning the context" below.
-
-2)	"No simultaneous calls to MuPDF in different threads are
-	allowed to use the same document."
-
-	Only one thread can be accessing a document at a time, but
-	once display lists are created from that document, multiple
-	threads at a time can operate on them.
-
-	The document can be used from several different threads as
-	long as there are safeguards in place to prevent the usages
-	being simultaneous.
-
-3)	"No simultaneous calls to MuPDF in different threads are
-	allowed to use the same device."
-
-	Calling a device simultaneously from different threads will
-	cause it to get confused and may crash. Calling a device from
-	several different threads is perfectly acceptable as long as
-	there are safeguards in place to prevent the calls being
-	simultaneous.
-
-So, how does a multi-threaded example differ from a non-multithreaded
-one?
-
-Firstly, when we create the first context, we call fz_new_context
-as before, but the second argument should be a pointer to a set
-of locking functions.
-
-The calling code should provide FZ_LOCK_MAX mutexes, which will be
-locked/unlocked by MuPDF calling the lock/unlock function pointers
-in the supplied structure with the user pointer from the structure
-and the lock number, i (0 <= i < FZ_LOCK_MAX). These mutexes can
-safely be recursive or non-recursive as MuPDF only calls in a non-
-recursive style.
-
-To make subsequent contexts, the user should NOT call fz_new_context
-again (as this will fail to share important resources such as the
-store and glyphcache), but should rather call fz_clone_context.
-Each of these cloned contexts can be freed by fz_free_context as
-usual. They will share the important data structures (like store,
-glyph cache etc) with the original context, but will have their
-own exception stacks.
-
-To open a document, call fz_open_document as usual, passing a context
-and a filename. It is important to realise that only one thread at a
-time can be accessing the documents itself.
-
-This means that only one thread at a time can perform operations such
-as fetching a page, or rendering that page to a display list. Once a
-display list has been obtained however, it can be rendered from any
-other thread (or even from several threads simultaneously, giving
-banded rendering).
-
-This means that an implementer has 2 basic choices when constructing
-an application to use MuPDF in multi-threaded mode. Either he can
-construct it so that a single nominated thread opens the document
-and then acts as a 'server' creating display lists for other threads
-to render, or he can add his own mutex around calls to mupdf that
-use the document. The former is likely to be far more efficient in
-the long run.
-
-For an example of how to do multi-threading see doc/multi-threaded.c
-which has a main thread and one rendering thread per page.
-
-Cloning the context
-===================
-
-As described above, every context contains an exception stack which is
-manipulated during the course of nested fz_try/fz_catches. For obvious
-reasons the same exception stack cannot be used from more than one
-thread at a time.
-
-If, however, we simply created a new context (using fz_new_context) for
-every thread, we would end up with separate stores/glyph caches etc,
-which is not (generally) what is desired. MuPDF therefore provides a
-mechanism for "cloning" a context. This creates a new context that
-shares everything with the given context, except for the exception
-stack.
-
-A commonly used general scheme is therefore to create a 'base' context
-at program start up, and to clone this repeatedly to get new contexts
-that can be used on new threads.

+ 0 - 281
server/lib/xfdftool/share/doc/mupdf/progressive.txt

@@ -1,281 +0,0 @@
-How to do progressive loading with MuPDF.
-=========================================
-
-What is progressive loading?
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The idea of progressive loading is that as you download a PDF file
-into a browser, you can display the pages as they appear.
-
-MuPDF can make use of 2 different mechanisms to achieve this. The
-first relies on the file being "linearized", the second relies on
-the caller of MuPDF having fine control over the http fetch and on
-the server supporting byte-range fetches.
-
-For optimum performance a file should be both linearized and be
-available over a byte-range supporting link, but benefits can still
-be had with either one of these alone.
-
-Progressive download using "linearized" files
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Adobe defines "linearized" PDFs as being ones that have both a
-specific layout of objects and a small amount of extra
-information to help avoid seeking within a file. The stated aim
-is to deliver the first page of a document in advance of the whole
-document downloading, whereupon subsequent pages will become
-available. Adobe also refers to these as "Optimized for fast web
-view" or "Web Optimized".
-
-In fact, the standard outlines (poorly) a mechanism by which 'hints'
-can be included that enable the subsequent pages to be found within
-the file too. Unfortunately this is very poorly supported with
-many tools, and so the hints have to be treated with suspicion.
-
-MuPDF will attempt to use hints if they are available, but will also
-use a linear search of the file to discover pages if not. This means
-that the first page will be displayed quickly, and then subsequent
-ones will appear with 'incomplete' renderings that improve over time
-as more and more resources are gradually delivered.
-
-Essentially the file starts with a slightly modified header, and the
-first object in the file is a special one (the linearization object)
-that a) indicates that the file is linearized, and b) gives some
-useful information (like the number of pages in the file etc).
-
-This object is then followed by all the objects required for the
-first page, then the "hint stream", then sets of object for each
-subsequent page in turn, then shared objects required for those
-pages, then various other random things.
-
-[Yes, really. While page 1 is sent with all the objects that it
-uses, shared or otherwise, subsequent pages do not get shared
-resources until after all the unshared page objects have been
-sent.]
-
-The Hint Stream
-~~~~~~~~~~~~~~~
-
-Adobe intended Hint Stream to be useful to facilitate the display
-of subsequent pages, but it has never used it. Consequently you
-can't trust people to write it properly - indeed Adobe outputs
-something that doesn't quite conform to the spec.
-
-Consequently very few people actually use it. MuPDF will use it
-after sanity checking the values, and should cope with illegal/
-incorrect values.
-
-So how does MuPDF handle progressive loading?
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-MuPDF has made various extensions to its mechanisms for handling
-progressive loading.
-
-  + Progressive streams
-
-    At its lowest level MuPDF reads file data from a fz_stream,
-    using the fz_open_document_with_stream call. (fz_open_document
-    is implemented by calling this). We have extended the fz_stream
-    slightly, giving the system a way to ask for meta information
-    (or perform meta operations) on a stream.
-
-    Using this mechanism MuPDF can query:
-
-      + whether a stream is progressive or not (i.e. whether the
-        entire stream is accessible immediately)
-      + what the length of a stream should ultimately be (which an
-        http fetcher should know from the Content-Length header),
-
-    With this information MuPDF can decide whether to use its normal
-    object reading code, or whether to make use of a linearized
-    object. Knowing the length enables us to check with the length
-    value given in the linearized object - if these differ, the
-    assumption is that an incremental save has taken place, thus the
-    file is no longer linearized.
-
-    When data is pulled from a progressive stream, if we attempt to
-    read data that is not currently available, the stream should
-    throw a FZ_ERROR_TRYLATER error. This particular error code
-    will be interpreted by the caller as an indication that it
-    should retry the parsing of the current objects at a later time.
-
-    When a MuPDF call is made on a progressive stream, such as
-    fz_open_document_with_stream, or fz_load_page, the caller should
-    be prepared to handle a FZ_ERROR_TRYLATER error as meaning that
-    more data is required before it can continue. No indication is
-    directly given as to exactly how much more data is required, but
-    as the caller will be implementing the progressive fz_stream
-    that it has passed into MuPDF to start with, it can reasonably
-    be expected to figure out an estimate for itself.
-
-  + Cookie
-
-    Once a page has been loaded, if its contents are to be 'run'
-    as normal (using e.g. fz_run_page) any error (such as failing
-    to read a font, or an image, or even a content stream belonging
-    to the page) will result in a rendering that aborts with an
-    FZ_ERROR_TRYLATER error. The caller can catch this and display
-    a placeholder instead.
-
-    If each pages data was entirely self-contained and sent in
-    sequence this would perhaps be acceptable, with each page
-    appearing one after the other. Unfortunately, the linearization
-    procedure as laid down by Adobe does NOT do this: objects shared
-    between multiple pages (other than the first) are not sent with
-    the pages themselves, but rather AFTER all the pages have been
-    sent.
-
-    This means that a document that has a title page, then contents
-    that share a font used on pages 2 onwards, will not be able to
-    correctly display page 2 until after the font has arrived in
-    the file, which will not be until all the page data has been
-    sent.
-
-    To mitigate against this, MuPDF provides a way whereby callers
-    can indicate that they are prepared to accept an 'incomplete'
-    rendering of the file (perhaps with missing images, or with
-    substitute fonts).
-
-    Callers prepared to tolerate such renderings should set the
-    'incomplete_ok' flag in the cookie, then call fz_run_page etc
-    as normal. If a FZ_ERROR_TRYLATER error is thrown at any point
-    during the page rendering, the error will be swallowed, the
-    'incomplete' field in the cookie will become non-zero and
-    rendering will continue. When control returns to the caller
-    the caller can check the value of the 'incomplete' field and
-    know that the rendering it received is not authoritative.
-
-Progressive loading using byte range requests
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-If the caller has control over the http fetch, then it is possible
-to use byte range requests to fetch the document 'out of order'.
-This enables non-linearized files to be progressively displayed as
-they download, and fetches complete renderings of pages earlier than
-would otherwise be the case. This process requires no changes within
-MuPDF itself, but rather in the way the progressive stream learns
-from the attempts MuPDF makes to fetch data.
-
-Consider for example, an attempt to fetch a hypothetical file from
-a server.
-
- + The initial http request for the document is sent with a "Range:"
-   header to pull down the first (say) 4k of the file.
-
- + As soon as we get the header in from this initial request, we can
-   respond to meta stream operations to give the length, and whether
-   byte requests are accepted.
-
-   - If the header indicates that byte ranges are acceptable the
-     stream proceeds to go into a loop fetching chunks of the file
-     at a time (not necessarily in-order). Otherwise the server
-     will ignore the Range: header, and just serve the whole file.
-
-   - If the header indicates a content-length, the stream returns
-     that.
-
- + MuPDF can then decide how to proceed based upon these flags and
-   whether the file is linearized or not. (If the file contains a
-   linearized object, and the content length matches, then the file
-   is considered to be linear, otherwise it is not).
-
-   If the file is linear:
-
-   - we proceed to read objects out of the file as it downloads.
-     This will provide us the first page and all its resources. It
-     will also enable us to read the hint streams (if present).
-
-   - Once we have read the hint streams, we unpack (and sanity
-     check) them to give us a map of where in the file each object
-     is predicted to live, and which objects are required for each
-     page. If any of these values are out of range, we treat the
-     file as if there were no hint streams.
-
-   - If we have hints, any attempt to load a subsequent page will
-     cause MuPDF to attempt to read exactly the objects required.
-     This will cause a sequence of seeks in the fz_stream followed
-     by reads. If the stream does not have the data to satisfy that
-     request yet, the stream code should remember the location that
-     was fetched (and fetch that block in the background so that
-     future retries will succeed) and should raise an
-     FZ_ERROR_TRYLATER error.
-
-     [Typically therefore when we jump to a page in a linear file
-     on a byte request capable link, we will quickly see a rough
-     rendering, which will improve fairly fast as images and fonts
-     arrive.]
-
-   - Regardless of whether we have hints or byte requests, on every
-     fz_load_page call MuPDF will attempt to process more of the
-     stream (that is assumed to be being downloaded in the
-     background). As linearized files are guaranteed to have pages
-     in order, pages will gradually become available. In the absence
-     of byte requests and hints however, we have no way of getting
-     resources early, so the renderings for these pages will remain
-     incomplete until much more of the file has arrived.
-
-     [Typically therefore when we jump to a page in a linear file
-     on a non byte request capable link, we will see a rough
-     rendering for that page as soon as data arrives for it (which
-     will typically take much longer than would be the case with
-     byte range capable downloads), and that will improve much more
-     slowly as images and fonts may not appear until almost the
-     whole file has arrived.]
-
-   - When the whole file has arrived, then we will attempt to read
-     the outlines for the file.
-
-   For a non-linearized PDF on a byte request capable stream:
-
-   - MuPDF will immediately seek to the end of the file to attempt
-     to read the trailer. This will fail with a FZ_ERROR_TRYLATER
-     due to the data not being here yet, but the stream code should
-     remember that this data is required and it should be prioritized
-     in the background fetch process.
-
-   - Repeated attempts to open the stream should eventually succeed
-     therefore. As MuPDF jumps through the file trying to read first
-     the xrefs, then the page tree objects, then the page contents
-     themselves etc, the background fetching process will be driven
-     by the attempts to read the file in the foreground.
-
-     [Typically therefore the opening of a non-linearized file will
-     be slower than a linearized one, as the xrefs/page trees for a
-     non-linear file can be 20%+ of the file data. Once past this
-     initial point however, pages and data can be pulled from the
-     file almost as fast as with a linearized file.]
-
-   For a non-linearized PDF on a non-byte request capable stream:
-
-   - MuPDF will immediately seek to the end of the file to attempt
-     to read the trailer. This will fail with a FZ_ERROR_TRYLATER
-     due to the data not being here yet. Subsequent retries will
-     continue to fail until the whole file has arrived, whereupon
-     the whole file will be instantly available.
-
-     [This is the worst case situation - nothing at all can be
-     displayed until the entire file has downloaded.]
-
-  A typical structure for a fetcher process (see curl-stream.c in
-  mupdf-curl as an example) might therefore look like this:
-
- + We consider the file as an (initially empty) buffer which we are
-   filling by making requests. In order to ensure that we make
-   maximum use of our download link, we ensure that whenever
-   one request finishes, we immediately launch another. Further, to
-   avoid the overheads for the request/response headers being too
-   large, we may want to divide the file into 'chunks', perhaps 4 or 32k
-   in size.
-
- + We can then have a receiver process that sits there in a loop
-   requesting chunks to fill this buffer. In the absence of
-   any other impetus the receiver should request the next 'chunk'
-   of data from the file that it does not yet have, following the last
-   fill point. Initially we start the fill point at the beginning of
-   the file, but this will move around based on the requests made of
-   the progressive stream.
-
- + Whenever MuPDF attempts to read from the stream, we check to see if
-   we have data for this area of the file already. If we do, we can
-   return it. If not, we remember this as the next "fill point" for our
-   receiver process and throw a FZ_ERROR_TRYLATER error.

+ 0 - 17
server/lib/xfdftool/share/doc/mupdf/refcount.txt

@@ -1,17 +0,0 @@
-Reference counting uses special words in functions to make it easy to remember
-and follow the rules.
-
-Words that take ownership: new, find, load, open, keep.
-
-Words that release ownership: drop, free, close.
-
-If an object is returned by a function with one of the special words that take
-ownership, you are responsible for freeing it by calling "drop" or "free", or
-"close" before you return. You may pass ownership of an owned object by return
-it only if you name the function using one of the special words.
-
-Any objects returned by functions that do not have any of these special words,
-are borrowed and have a limited life time. Do not hold on to them past the
-duration of the current function, or stow them away inside structs. If you need
-to keep the object for longer than that, you have to either "keep" it or make
-your own copy.

+ 0 - 38
server/lib/xfdftool/share/doc/mupdf/thirdparty.txt

@@ -1,38 +0,0 @@
-			Third Party Libraries Used by MuPDF
-			===================================
-
-Library		Version		Function	License			URL
-
-freetype	2.5.5		Font scaling	Freetype		http://www.freetype.org/
-				and rendering	License
-
-glfw		3.1.1		Open GL API	BSD-style		http://www.glfw.org/
-		(with patches)	for UI
-
-harfbuzz	1.2.7		Text shaping	MIT-style		http://www.harfbuzz.org/
-		(with patches)
-
-jpeg		9.0		JPEG decoding	"Free", with
-						acknowledgement		http://www.ijg.org/
-
-openjpeg	2.0.0		JPEG 2000	BSD-style		http://www.openjpeg.org/
-		(with patches)	decoding
-
-zlib		1.2.7		(De)Flate	zlib License		http://www.zlib.net/
-				compression
-
-(Optional)
-
-curl		7.31.0		HTTP data	MIT-style		http://curl.haxx.se/
-				transfer
-
-Luratech JP2			JPEG 2000	commercial		http://www.luratech.com/
-				decoding
-
-Luratech JBIG2			JBIG2		commercial		http://www.luratech.com/
-				decoding
-
-JPEG-XR		1.8		JPEG-XR		special			https://www.itu.int/rec/T-REC-T.835/
-reference	(with patches)	decoding
-
-NOTE: jbig2dec and mujs are included in "thirdparty" but are copyright Artifex Software Inc.

+ 0 - 22
server/lib/xfdftool/share/doc/mupdf/types.txt

@@ -1,22 +0,0 @@
-Various different integer types are used throughout MuPDF.
-
-In general:
-
-  * int is assumed to be 32bit at least.
-
-  * short is assumed to be exactly 16 bits.
-
-  * char is assumed to be exactly 8 bits.
-
-  * array sizes, string lengths, and allocations
-    are measured using size_t. size_t is 32bit in 32bit builds,
-    and 64bit on all 64bit builds.
-
-  * buffers of data use unsigned chars (or uint8_t's).
-
-  * Offsets within files/streams are represented using fz_off_t's.
-    fz_off_t's are 64bits in 64bit builds, or in 32bit builds with
-    FZ_LARGEFILE defined. Otherwise they are a native int (so 32bit
-    in 32bit builds).
-
-In addition, we use floats and doubles, assumed to be IEEE compliant.

+ 0 - 202
server/lib/xfdftool/share/man/man1/mupdf.1

@@ -1,202 +0,0 @@
-.TH MUPDF 1 "January 12, 2016"
-.\" Please adjust this date whenever revising the manpage.
-.\" no hyphenation
-.nh
-.\" adjust left
-.ad l
-
-.SH NAME
-mupdf \- MuPDF is a lightweight PDF viewer written in portable C
-
-.SH SYNOPSIS
-.B mupdf
-.RI [ options ] " file"
-
-.SH DESCRIPTION
-.B MuPDF
-is a document viewer that can show
-.B PDF,
-.B XPS,
-.B EPUB,
-.B XHTML,
-.B CBZ,
-and various image formats such as
-.B PNG,
-.B JPEG,
-.B GIF,
-and
-.B TIFF.
-.PP
-
-.SH OPTIONS
-A description of each of the supported options is included below.
-
-.TP
-.B \-p password
-Uses the given password to open an encrypted PDF file.
-The password is tried both as user and owner password.
-.TP
-.B \-r resolution
-Changes the initial zoom level, specified as the resolution in dpi.
-The default value is 72.
-.TP
-.B \-A bits
-Changes the anti-aliasing quality, specified as a number of bits between 0
-(off) and 8 (best). The default value is 8.
-.TP
-.B \-C RRGGBB
-Sets the full-page tint using hexadecimal color syntax. The default value
-is FFFAF0.
-.TP
-.B \-W width
-Page width in points for EPUB layout.
-.TP
-.B \-H height
-Page height in points for EPUB layout.
-.TP
-.B \-S size
-Font size in points for EPUB layout.
-.TP
-.B \-U CSS-file
-User style sheet for EPUB layout.
-
-.SH MOUSE BEHAVIOR
-
-.TP
-.B Left mouse button click
-A left click on a hyper link follows the link. In presentation mode
-advances to the next page.
-.TP
-.B Right mouse button click
-In presentation mode goes back to the previous page.
-.TP
-.B Left mouse button drag
-Pan the page. Panning beyond the bottom or top
-edge will go to the next or previous page.
-.TP
-.B Right mouse button drag
-Select text in an area. On X11, the selected text
-can be pasted in another application with a middle click.
-Press
-.B Ctrl+C
-to copy the selected text to the clipboard.
-On Windows, the selected text will automatically be copied
-to the clipboard.
-.TP
-.B Scroll wheel
-Pan page up or down. Does not change page
-when reaching the bottom or top edge.
-.TP
-.B Shift + Scroll wheel
-Pan page left or right.
-.TP
-.B Control + Scroll wheel
-Zoom in or out.
-
-.SH KEY BINDINGS
-
-.PP
-Page navigation:
-.TP
-.B . pgdn right space
-Go to the next page.
-.TP
-.B , pgup left b backspace
-Go to the previous page.
-.TP
-.B <, >
-Skip back/forth 10 pages at a time.
-.TP
-.B 123g
-Go to page 123.
-.TP
-.B g, G
-Go to the first or last page.
-.TP
-.B m
-Mark current page for snap back. Up to 256 pages can be marked.
-.TP
-.B t
-Pop back to the latest mark.
-.TP
-.B [0-9]m
-Save the current page number in the numbered register.
-.TP
-.B [0-9]t
-Go to the page saved in the numbered register.
-
-.PP
-Zooming and rotating:
-.TP
-.B \+, \-
-Zoom in or out.
-.TP
-.B W, H
-Zoom page to exactly fit width/height of window.
-.TP
-.B Z
-Zoom page to fit either to width or height of window.
-.TP
-.B L, R
-Rotate page left (counter-clockwise) or right (clockwise).
-.TP
-.B w
-Shrinkwrap window to fit the page.
-.TP
-.B f
-Toggles fullscreen mode.
-
-.PP
-Panning:
-.TP
-.B h, j, k, l
-Pan page left, down, up, or right.
-
-.PP
-Searching:
-.TP
-.B /, ?
-Search for text forwards or backwards.
-.TP
-.B n, N
-Find the next/previous search result.
-
-.PP
-Miscellanous:
-.TP
-.B [, ]
-Increase/decrease EPUB/XHTML font size.
-.TP
-.B r
-Reload file.
-.TP
-.B p
-Toggle presentation mode.
-.TP
-.B c
-Toggle between color and grayscale rendering.
-.TP
-.B C
-Toggle full-page color tinting.
-.TP
-.B i
-Toggle between normal and inverted color rendering.
-.TP
-.B S
-Save updated document file.
-.TP
-.B q
-Quit.
-
-.SH SIGNALS
-
-.TP
-.B SIGHUP
-Sending a \fBSIGHUP\fR signal to the mupdf process will also cause the viewed
-file to be reloaded automatically, for use in e.g. build scripts.
-
-.SH SEE ALSO
-.BR mutool (1).
-
-.SH AUTHOR
-MuPDF is Copyright 2006-2017 Artifex Software, Inc.

+ 0 - 420
server/lib/xfdftool/share/man/man1/mutool.1

@@ -1,420 +0,0 @@
-.TH "MUTOOL" "1" "January 12, 2016"
-.\" Please adjust this date whenever revising the manpage.
-.\" no hyphenation
-.nh
-.\" adjust left
-.ad l
-
-.SH NAME
-mutool \- all purpose tool for dealing with PDF files
-
-.SH SYNOPSIS
-mutool <sub-command> [options]
-
-.SH DESCRIPTION
-mutool is a tool based on MuPDF for dealing with document files in various manners.
-There are several sub commands available, as described below.
-
-.SH DRAW
-mutool draw [options] file [pages]
-.PP
-The draw command will render a document to image files,
-convert to another vector format, or extract the text content.
-.PP
-The supported input document formats are: pdf, xps, cbz, and epub.
-.PP
-The supported output image formats are: pbm, pgm, ppm, pam, png, tga, pwg, pcl and ps.
-The supported output vector formats are: svg, pdf, and debug trace (as xml).
-The supported output text formats are: plain text, html, and structured text (as xml).
-.TP
-.B \-p password
-Use the specified password if the file is encrypted.
-.TP
-.B \-o output
-The output format is inferred from the output filename.
-Embed %d in the name to indicate the page number (for example: "page%d.png").
-Printf modifiers are supported, for example "%03d".
-If no output is specified, the output will go to stdout.
-.TP
-.B \-F format
-Enforce a specific output format. Only necessary when outputting to stdout
-since normally the output filename is used to infer the output format.
-.TP
-.B \-R angle
-Rotate clockwise by given number of degrees.
-.TP
-.B \-r resolution
-Render the page at the specified resolution.
-The default resolution is 72 dpi.
-.TP
-.B \-w width
-Render the page at the specified width (or, if the -r flag is used,
-render with a maximum width).
-.TP
-.B \-h height
-Render the page at the specified height (or, if the -r flag is used,
-render with a maximum height).
-.TP
-.B \-f
-Fit exactly; ignore the aspect ratio when matching specified width/heights.
-.TP
-.B \-B bandheight
-Render in banded mode with each band no taller than the given height. This uses
-less memory during rendering. Only compatible with pam, pgm, ppm, pnm and png
-output formats. Banded rendering and md5 checksumming may not be used at the
-same time.
-.TP
-.B \-W width
-Page width in points for EPUB layout.
-.TP
-.B \-H height
-Page height in points for EPUB layout.
-.TP
-.B \-S size
-Font size in points for EPUB layout.
-.TP
-.B \-U filename
-User CSS stylesheet for EPUB layout.
-.TP
-.B \-c colorspace
-Render in the specified colorspace.
-Supported colorspaces are: mono, gray, grayalpha, rgb, rgbalpha, cmyk, cmykalpha.
-Some abbreviations are allowed: m, g, ga, rgba, cmyka.
-The default is chosen based on the output format.
-.TP
-.B -G gamma
-Apply gamma correction.
-Some typical values are 0.7 or 1.4 to thin or darken text rendering.
-.TP
-.B -I
-Invert colors.
-.TP
-.B \-s [mft5]
-Show various bits of information:
-.B m
-for glyph cache and total memory usage,
-.B f
-for page features such as whether the page is grayscale or color,
-.B t
-for per page rendering times as well statistics, and
-.B 5
-for md5 checksums of rendered images that can be used to check if rendering has
-changed.
-.TP
-.B \-A bits
-Specify how many bits of anti-aliasing to use. The default is 8.
-.TP
-.B \-D
-Disable use of display lists. May cause slowdowns, but should reduce
-the amount of memory used.
-.TP
-.B \-i
-Ignore errors.
-.TP
-.B \-L
-Low memory mode (avoid caching objects by clearing cache after each page).
-.TP
-.B \-P
-Run interpretation and rendering at the smae time.
-.TP
-.B pages
-Comma separated list of page numbers and ranges (for example: 1,5,10-15).
-If no pages are specified, then all pages will be rendered.
-
-.SH CLEAN
-mutool clean [options] input.pdf [output.pdf] [pages]
-.PP
-The clean command pretty prints and rewrites the syntax of a PDF file.
-It can be used to repair broken files, expand compressed streams, filter
-out a range of pages, etc.
-.PP
-If no output file is specified, it will write the cleaned PDF to "out.pdf"
-in the current directory.
-.TP
-.B \-p password
-Use the specified password if the file is encrypted.
-.TP
-.B \-g
-Garbage collect objects that have no references from other objects.
-Give the option twice to renumber all objects and compact the cross reference table.
-Give it three times to merge and reuse duplicate objects.
-.TP
-.B \-s
-Rewrite content streams.
-.TP
-.B \-d
-Decompress streams. This will make the output file larger, but provides
-easy access for reading and editing the contents with a text editor.
-.TP
-.B \-l
-Linearize output. Create a "Web Optimized" output file.
-.TP
-.B \-i
-Toggle decompression of image streams. Use in conjunction with -d to leave
-images compressed.
-.TP
-.B \-f
-Toggle decompression of font streams. Use in conjunction with -d to leave
-fonts compressed.
-.TP
-.B \-a
-ASCII Hex encode binary streams. Use in conjuction with -d and -i or -f to
-ensure that although the images and/or fonts are compressed, the resulting
-file can still be viewed and edited with a text editor.
-.TP
-.B \-z
-Deflate uncompressed streams.
-If combined with -d, any decompressed streams will be recompressed.
-If combined with -a, the streams will also be hex encoded after compression.
-.TP
-.B pages
-Comma separated list of page numbers and ranges to include.
-
-.SH EXTRACT
-mutool extract [options] file.pdf [object numbers]
-.PP
-The extract command can be used to extract images and font files from a PDF.
-If no object numbers are given on the command line, all images and fonts
-will be extracted.
-.TP
-.B \-p password
-Use the specified password if the file is encrypted.
-.TP
-.B \-r
-Convert images to RGB when extracting them.
-
-.SH INFO
-mutool info [options] file.pdf [pages]
-.PP
-The info command lists the resources used on each page in a PDF file.
-The default is to list all resource types, but if one
-or more flags are given, only the flagged types will be shown.
-.TP
-.B \-p password
-Use the specified password if the file is encrypted.
-.TP
-.B -F
-List fonts.
-.TP
-.B -I
-List images.
-.TP
-.B -M
-List page dimensions.
-.TP
-.B -S
-List shadings.
-.TP
-.B -P
-List patterns.
-.TP
-.B -X
-List form and postscript XObjects.
-.TP
-.B pages
-Comma separated list of page numbers and ranges to include.
-
-.SH CREATE
-mutool create [-o output.pdf] [options] page1.txt [page2.txt ...]
-.PP
-The create command creates a new PDF file with the contents created
-from one or more input files containing graphics commands.
-.TP
-.B \-o output
-If no output file is specified, it will write the created PDF to "out.pdf"
-in the current directory.
-.TP
-.B page.txt
-A page is created for each input file, with the contents of the file copied
-into the content stream. Special comments in the input files are parsed to
-define the page dimensions and font and image resources:
-.PP
-%%MediaBox 0 0 500 800
-.br
-%%Rotate 90
-.br
-%%Font Tm Times-Roman
-.br
-%%Font Fn0 path/to/font/file.ttf
-.br
-%%Image Im0 path/to/image.png
-.TP
-.B \-O
-Comma separated list of format specific output options:
-.IP
-.B decompress
-.br
-Decompress all object streams.
-.IP
-.B compress
-.br
-Compress all object streams.
-.IP
-.B compress-fonts
-.br
-Compress object streams for embedded fonts.
-.IP
-.B compress-images
-.br
-Compress object streams for images.
-.IP
-.B ascii
-.br
-Encode object streams using ASCII hex encoding.
-.IP
-.B pretty
-.br
-Pretty-print objects with indentation.
-.IP
-.B linearize
-.br
-Optimize document for progressive loading in viewers.
-.IP
-.B sanitize
-.br
-Clean up graphics command in content streams.
-.IP
-.B garbage[=compact|deduplicate]
-.br
-Garbage collect unused objects. With
-.B compact
-the cross-reference table will also be compacted. With
-.B deduplicate
-duplicate objects will also be recombined.
-
-.SH PAGES
-mutool pages [options] input.pdf [pages ...]
-.PP
-The pages command dumps information about the size and orientation
-of pages within the document.
-.TP
-.B \-p password
-Use the specified password if the file is encrypted.
-.TP
-.B pages
-Comma separated list of page numbers and ranges to include.
-
-.SH POSTER
-mutool poster [options] input.pdf [output.pdf]
-.PP
-The poster command splits each page into tiles, and puts each tile on
-a page of its own. It's useful for printing a large page onto smaller
-pieces of paper that can then be glued together to create a large poster.
-.TP
-.B \-p password
-Use the specified password if the file is encrypted.
-.TP
-.B \-x factor
-Split the page into this many horizontal pieces.
-.TP
-.B \-y factor
-Split the page into this many vertical pieces.
-.PP
-The output will have x times y number of pages for each input page.
-
-.SH SHOW
-mutool show [options] file.pdf [object numbers ...]
-.PP
-The show command will print the specified objects and streams to stdout.
-Streams are decoded and non-printable characters are represented
-with a period by default.
-.TP
-.B \-p password
-Use the specified password if the file is encrypted.
-.TP
-.B \-o file
-Write output to file instead of stdout.
-.TP
-.B \-b
-Print streams as binary data and omit the object header.
-.TP
-.B \-e
-Print streams in their original encoded (or compressed) form.
-.PP
-Specify objects by number, or use one of the following special names:
-.TP
-.B 'xref' or 'x'
-Print the cross reference table.
-.TP
-.B 'trailer' or 't'
-Print the trailer dictionary.
-.TP
-.B 'encrypt' or 'e'
-Print the encryption dictionary.
-.TP
-.B 'pagetree' or 'p'
-List the object numbers for every page.
-.TP
-.B 'grep' or 'g'
-Print all the objects in the file in a compact one-line format suitable for piping to grep.
-.TP
-.B 'outline' or 'o'
-Print the outline (table of contents).
-
-.SH RUN
-mutool run script.js [arguments]
-.PP
-Executes a Javascript program which has access to most of the features of the
-MuPDF library. The command supports ECMAScript 5 syntax in strict mode. All of
-the MuPDF constructors and function live in the global object, and the command
-line arguments are accessible from the global argv object.
-.PP
-If invoke without any arguments, it will drop you into an interactive REPL
-(read-eval-print-loop). On the interactive prompt, if you prefix a line with an
-equal character it will automatically print the results of the line.
-.PP
-See the MuPDF documentation for details about the Javascript interfaces.
-
-.SH CONVERT
-mutool convert [options] file [pages]
-.PP
-The convert commant is used to convert a file from one format to another.
-.TP
-.B \-p password
-Use the specified password if the file is encrypted.
-.TP
-.B \-A bits
-Specify how many bits of anti-aliasing to use. The default is 8.
-.TP
-.B \-W width
-Page width in points for EPUB layout.
-.TP
-.B \-H height
-Page height in points for EPUB layout.
-.TP
-.B \-S size
-Font size in points for EPUB layout.
-.TP
-.B \-U filename
-User CSS stylesheet for EPUB layout.
-.TP
-.B \-o output
-The output format is inferred from the output filename.
-Embed %d in the name to indicate the page number (for example: "page%d.png").
-Printf modifiers are supported, for example "%03d".
-If no output is specified, the output will go to stdout.
-.TP
-.B \-F format
-Enforce a specific output format. Only necessary when outputting to stdout
-since normally the output filename is used to infer the output format.
-.TP
-.B \-O
-Comma separated list of format specific output options:
-
-.SH MERGE
-mutool merge [options] file1 [pages] file2 [pages] ...
-.PP
-The merge command is used to pick out pages from two or more files and merge
-them in order into a new output file.
-.TP
-.B \-o output
-The output filename.
-.TP
-.B \-O
-See mutool create for details on this option.
-
-.SH SEE ALSO
-.BR mupdf (1),
-
-.SH AUTHOR
-MuPDF is Copyright 2006-2017 Artifex Software, Inc.