From 1638179e85863b5045fcea2282fd3e0622aeac13 Mon Sep 17 00:00:00 2001 From: Ralf Sippl Date: Thu, 12 Apr 2018 21:20:26 +0000 Subject: Add index parameter to quadpoints getter and setter. This is needed for working with multiline text markup annotations. Based on https://pdfium-review.googlesource.com/12012. Bug: pdfium:1045 Change-Id: Ifb105996b8b950bb2d5fceaf754b4f571155aef4 Reviewed-on: https://pdfium-review.googlesource.com/29150 Commit-Queue: Lei Zhang Reviewed-by: Lei Zhang Reviewed-by: Henrique Nakashima --- public/fpdf_annot.h | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'public/fpdf_annot.h') diff --git a/public/fpdf_annot.h b/public/fpdf_annot.h index a84c4f982a..8e9b93e12d 100644 --- a/public/fpdf_annot.h +++ b/public/fpdf_annot.h @@ -285,7 +285,7 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_GetColor(FPDF_ANNOTATION annot, // Experimental API. // Check if the annotation is of a type that has attachment points -// (i.e. quadpoints). Quadpoints are the vertices of the rectange that +// (i.e. quadpoints). Quadpoints are the vertices of the rectangle that // encompasses the texts affected by the annotation. They provide the // coordinates in the page where the annotation is attached. Only text markup // annotations (i.e. highlight, strikeout, squiggly, and underline) and link @@ -299,19 +299,37 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_HasAttachmentPoints(FPDF_ANNOTATION annot); // Experimental API. -// Set the attachment points (i.e. quadpoints) of an annotation. If the -// annotation's appearance stream is defined and this annotation is of a type -// with quadpoints, then update the bounding box too if the new quadpoints +// Replace the attachment points (i.e. quadpoints) set of an annotation at +// |quad_index|. This index needs to be within the result of +// FPDFAnnot_CountAttachmentPoints(). +// If the annotation's appearance stream is defined and this annotation is of a +// type with quadpoints, then update the bounding box too if the new quadpoints // define a bigger one. // // annot - handle to an annotation. +// quad_index - index of the set of quadpoints. // quad_points - the quadpoints to be set. // // Returns true if successful. FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetAttachmentPoints(FPDF_ANNOTATION annot, + size_t quad_index, const FS_QUADPOINTSF* quad_points); +// Experimental API. +// Append to the list of attachment points (i.e. quadpoints) of an annotation. +// If the annotation's appearance stream is defined and this annotation is of a +// type with quadpoints, then update the bounding box too if the new quadpoints +// define a bigger one. +// +// annot - handle to an annotation. +// quad_points - the quadpoints to be set. +// +// Returns true if successful. +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFAnnot_AppendAttachmentPoints(FPDF_ANNOTATION annot, + const FS_QUADPOINTSF* quad_points); + // Experimental API. // Get the number of sets of quadpoints of an annotation. // @@ -325,11 +343,13 @@ FPDFAnnot_CountAttachmentPoints(FPDF_ANNOTATION annot); // Get the attachment points (i.e. quadpoints) of an annotation. // // annot - handle to an annotation. +// quad_index - index of the set of quadpoints. // quad_points - receives the quadpoints; must not be NULL. // // Returns true if successful. FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_GetAttachmentPoints(FPDF_ANNOTATION annot, + size_t quad_index, FS_QUADPOINTSF* quad_points); // Experimental API. -- cgit v1.2.3