Extend glib API for rendition actions

Cimbali requested to merge Cimbali/poppler:master into master

As requested in #1318.

Many things basically just mirror the qt5/qt6 APIs, most particularly:

  • ScreenAnnotation::additionalAction(AdditionalActionType type)
  • LinkRendition::isReferencedAnnotation(const ScreenAnnotation *annotation)

I’ve tried my best to reuse existing code patterns, such as pointers to created actions in the _PopplerAnnotScreen struct as found in form fields, and private struct fields store in a private PopplerActionRenditionExtended (ABI-compatible with PopplerActionRendition) as found in PopplerRectangleExtended.

Additional notes:

  • I haven’t found cleanup code for additional actions in form fields, but seeing the cleanup for main actions I assume that was an oversight? I’ve added cleanup code for additional actions both in form fields and in screen annotations.
  • I’ve reused the PopplerAdditionalActionType enum but moved it to a header that is visible from both form fields and annotations
  • I’ve changed the PopplerActionRendition.op from an int to an ABI-compatible enum (i.e. preserving numerical values), as the values were defined from poppler’s LinkRendition::RenditionOperation enum which is not publicly available in the GLib API, and those values differed from the PDF standard ones (e.g. 1 means play in this enum, but stop in the PDF op integer field of rendition actions).

Please let me know you find these changes are desirable, and what modifications (if any) would be needed to get this merged.

Edited by Cimbali

Merge request reports