annotation.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef MUPDF_FITZ_ANNOTATION_H
  2. #define MUPDF_FITZ_ANNOTATION_H
  3. #include "mupdf/fitz/system.h"
  4. #include "mupdf/fitz/context.h"
  5. #include "mupdf/fitz/geometry.h"
  6. #include "mupdf/fitz/document.h"
  7. /*
  8. fz_new_annot_of_size: Create and initialize an annotation struct.
  9. */
  10. fz_annot *fz_new_annot_of_size(fz_context *ctx, int size);
  11. #define fz_new_derived_annot(CTX, TYPE) \
  12. ((TYPE *)Memento_label(fz_new_annot_of_size(CTX,sizeof(TYPE)),#TYPE))
  13. /*
  14. fz_keep_annot: Take a new reference to an annotation.
  15. */
  16. fz_annot *fz_keep_annot(fz_context *ctx, fz_annot *annot);
  17. /*
  18. fz_drop_annot: Drop a reference to an annotation. If the
  19. reference count reaches zero, annot will be destroyed.
  20. */
  21. void fz_drop_annot(fz_context *ctx, fz_annot *annot);
  22. /*
  23. fz_first_annot: Return a pointer to the first annotation on a page.
  24. Does not throw exceptions.
  25. */
  26. fz_annot *fz_first_annot(fz_context *ctx, fz_page *page);
  27. /*
  28. fz_next_annot: Return a pointer to the next annotation on a page.
  29. Does not throw exceptions.
  30. */
  31. fz_annot *fz_next_annot(fz_context *ctx, fz_annot *annot);
  32. /*
  33. fz_bound_annot: Return the bounding rectangle of the annotation.
  34. Does not throw exceptions.
  35. */
  36. fz_rect *fz_bound_annot(fz_context *ctx, fz_annot *annot, fz_rect *rect);
  37. #endif