context-imp.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // Copyright (C) 2004-2021 Artifex Software, Inc.
  2. //
  3. // This file is part of MuPDF.
  4. //
  5. // MuPDF is free software: you can redistribute it and/or modify it under the
  6. // terms of the GNU Affero General Public License as published by the Free
  7. // Software Foundation, either version 3 of the License, or (at your option)
  8. // any later version.
  9. //
  10. // MuPDF is distributed in the hope that it will be useful, but WITHOUT ANY
  11. // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  12. // FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
  13. // details.
  14. //
  15. // You should have received a copy of the GNU Affero General Public License
  16. // along with MuPDF. If not, see <https://www.gnu.org/licenses/agpl-3.0.en.html>
  17. //
  18. // Alternative licensing terms are available from the licensor.
  19. // For commercial licensing, see <https://www.artifex.com/> or contact
  20. // Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
  21. // CA 94129, USA, for further information.
  22. #ifndef FITZ_CONTEXT_IMP_H
  23. #define FITZ_CONTEXT_IMP_H
  24. #include "mupdf/fitz.h"
  25. extern fz_alloc_context fz_alloc_default;
  26. extern fz_locks_context fz_locks_default;
  27. /* FIXME: Make all these static? */
  28. double fz_drand48(fz_context *ctx);
  29. int32_t fz_lrand48(fz_context *ctx);
  30. int32_t fz_mrand48(fz_context *ctx);
  31. double fz_erand48(fz_context *ctx, uint16_t xsubi[3]);
  32. int32_t fz_jrand48(fz_context *ctx, uint16_t xsubi[3]);
  33. int32_t fz_nrand48(fz_context *ctx, uint16_t xsubi[3]);
  34. void fz_lcong48(fz_context *ctx, uint16_t param[7]);
  35. uint16_t *fz_seed48(fz_context *ctx, uint16_t seed16v[3]);
  36. void fz_srand48(fz_context *ctx, int32_t seedval);
  37. void fz_new_colorspace_context(fz_context *ctx);
  38. fz_colorspace_context *fz_keep_colorspace_context(fz_context *ctx);
  39. void fz_drop_colorspace_context(fz_context *ctx);
  40. void fz_new_font_context(fz_context *ctx);
  41. fz_font_context *fz_keep_font_context(fz_context *ctx);
  42. void fz_drop_font_context(fz_context *ctx);
  43. struct fz_tuning_context
  44. {
  45. int refs;
  46. fz_tune_image_decode_fn *image_decode;
  47. void *image_decode_arg;
  48. fz_tune_image_scale_fn *image_scale;
  49. void *image_scale_arg;
  50. };
  51. void fz_default_image_decode(void *arg, int w, int h, int l2factor, fz_irect *subarea);
  52. int fz_default_image_scale(void *arg, int dst_w, int dst_h, int src_w, int src_h);
  53. void fz_init_aa_context(fz_context *ctx);
  54. void fz_new_glyph_cache_context(fz_context *ctx);
  55. fz_glyph_cache *fz_keep_glyph_cache(fz_context *ctx);
  56. void fz_drop_glyph_cache_context(fz_context *ctx);
  57. void fz_new_document_handler_context(fz_context *ctx);
  58. void fz_drop_document_handler_context(fz_context *ctx);
  59. fz_document_handler_context *fz_keep_document_handler_context(fz_context *ctx);
  60. void fz_new_archive_handler_context(fz_context *ctx);
  61. void fz_drop_archive_handler_context(fz_context *ctx);
  62. fz_archive_handler_context *fz_keep_archive_handler_context(fz_context *ctx);
  63. void fz_log_activity(fz_context *ctx, fz_activity_reason reason, void *arg);
  64. #endif