Refactoring of annotation drawing

This commit is contained in:
Jakub Melka
2020-05-24 18:42:11 +02:00
parent 81f27e87ac
commit 00e141129a
2 changed files with 257 additions and 139 deletions

View File

@ -1400,6 +1400,59 @@ protected:
QPainter* painter,
QMatrix userSpaceToDeviceSpace) const;
/// Returns true, if given annotation should be drawn
/// \param annotation Annotation
bool isAnnotationDrawEnabled(const PageAnnotation& annotation) const;
/// Returns true, if annotation is drawn by editor (from form widget)
/// \param annotation Annotation
bool isAnnotationDrawnByEditor(const PageAnnotation& annotation) const;
/// Draws annotation
/// \param pageAnnotation Page annotation
/// \param pagePointToDevicePointMatrix Page point to device point matrix
/// \param page Page
/// \param cms Color management system
/// \param isEditorDrawEnabled Is editor draw enabled?
/// \param errors Errors list (where draw errors are stored)
/// \param painter Painter
void drawAnnotation(const PageAnnotation& annotation,
const QMatrix& pagePointToDevicePointMatrix,
const PDFPage* page,
const PDFCMS* cms,
bool isEditorDrawEnabled,
QList<PDFRenderError>& errors,
QPainter* painter) const;
/// Draws annotation by direct drawing, not using annotation's
/// appearance stream.
/// \param pageAnnotation Page annotation
/// \param pagePointToDevicePointMatrix Page point to device point matrix
/// \param page Page
/// \param cms Color management system
/// \param isEditorDrawEnabled Is annotation drawn by form widget editor?
/// \param painter Painter
void drawAnnotationDirect(const PageAnnotation& annotation,
const QMatrix& pagePointToDevicePointMatrix,
const PDFPage* page,
const PDFCMS* cms,
bool isEditorDrawEnabled,
QPainter* painter) const;
/// Draws annotation using annotation's appearance stream.
/// \param pageAnnotation Page annotation
/// \param appearanceStreamObject Object with appearance stream
/// \param pagePointToDevicePointMatrix Page point to device point matrix
/// \param page Page
/// \param cms Color management system
/// \param painter Painter
void drawAnnotationUsingAppearanceStream(const PageAnnotation& annotation,
const PDFObject& appearanceStreamObject,
const QMatrix& pagePointToDevicePointMatrix,
const PDFPage* page,
const PDFCMS* cms,
QPainter* painter) const;
const PDFDocument* m_document;
PDFFontCache* m_fontCache;