summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorJane Liu <janeliulwq@google.com>2017-06-27 16:41:14 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-06-27 21:24:47 +0000
commit0646275cd9c19e9fb97eaa023494bb771e47e095 (patch)
treee1bfbfe1d66b4d6aa3b2143d1dd882f417a44b98 /public
parent8e052a65b3072ab83d4472d7ec3657afc14f4008 (diff)
downloadpdfium-0646275cd9c19e9fb97eaa023494bb771e47e095.tar.xz
Made existing annotation APIs to work with APchromium/3143
1. Modified some existing annotation APIs to take into account the effect of annotation's appearance streams. * Added an embedder test testing annotations with APs. This CL is refactored out of https://pdfium-review.googlesource.com/c/6676/. Bug=pdfium:737 Change-Id: I27d5e66dfdb90038d147cab1a26e0bf86b324982 Reviewed-on: https://pdfium-review.googlesource.com/7030 Commit-Queue: Jane Liu <janeliulwq@google.com> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'public')
-rw-r--r--public/fpdf_annot.h29
1 files changed, 21 insertions, 8 deletions
diff --git a/public/fpdf_annot.h b/public/fpdf_annot.h
index 0a1646fd5c..d997927f64 100644
--- a/public/fpdf_annot.h
+++ b/public/fpdf_annot.h
@@ -106,7 +106,9 @@ DLLEXPORT void STDCALL FPDFPage_CloseAnnot(FPDF_ANNOTATION annot);
DLLEXPORT FPDF_ANNOTATION_SUBTYPE STDCALL
FPDFAnnot_GetSubtype(FPDF_ANNOTATION annot);
-// Set the color of an annotation.
+// Set the color of an annotation. Fails when called on annotations with
+// appearance streams already defined; instead use
+// FPDFPath_Set{Stroke|Fill}Color().
//
// annot - handle to an annotation.
// type - type of the color to be set.
@@ -122,7 +124,9 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetColor(FPDF_ANNOTATION annot,
unsigned int A);
// Get the color of an annotation. If no color is specified, default to yellow
-// for highlight annotation, black for all else.
+// for highlight annotation, black for all else. Fails when called on
+// annotations with appearance streams already defined; instead use
+// FPDFPath_Get{Stroke|Fill}Color().
//
// annot - handle to an annotation.
// type - type of the color requested.
@@ -151,16 +155,21 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_GetColor(FPDF_ANNOTATION annot,
DLLEXPORT FPDF_BOOL STDCALL
FPDFAnnot_HasAttachmentPoints(FPDF_ANNOTATION annot);
-// Set the attachment points (i.e. quadpoints) of an annotation.
+// 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.
//
// annot - handle to an annotation.
// quadPoints - the quadpoints to be set.
//
// Returns true if successful, false otherwise.
DLLEXPORT FPDF_BOOL STDCALL
-FPDFAnnot_SetAttachmentPoints(FPDF_ANNOTATION annot, FS_QUADPOINTSF quadPoints);
+FPDFAnnot_SetAttachmentPoints(FPDF_ANNOTATION annot,
+ const FS_QUADPOINTSF* quadPoints);
-// Get the attachment points (i.e. quadpoints) of an annotation.
+// Get 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 return the bounding box it specifies instead.
//
// annot - handle to an annotation.
//
@@ -168,16 +177,20 @@ FPDFAnnot_SetAttachmentPoints(FPDF_ANNOTATION annot, FS_QUADPOINTSF quadPoints);
DLLEXPORT FS_QUADPOINTSF STDCALL
FPDFAnnot_GetAttachmentPoints(FPDF_ANNOTATION annot);
-// Set the annotation rectangle defining the location of the annotation.
+// Set the annotation rectangle defining the location of the annotation. If the
+// annotation's appearance stream is defined and this annotation is of a type
+// without quadpoints, then update the bounding box too.
//
// annot - handle to an annotation.
// rect - the annotation rectangle to be set.
//
// Returns true if successful, false otherwise.
DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetRect(FPDF_ANNOTATION annot,
- FS_RECTF rect);
+ const FS_RECTF* rect);
-// Get the annotation rectangle defining the location of the annotation.
+// Get the annotation rectangle defining the location of the annotation. If the
+// annotation's appearance stream is defined and this annotation is of a type
+// without quadpoints, then return the bounding box it specifies instead.
//
// annot - handle to an annotation.
//