Index: src/pdf/SkPDFDevice.h |
diff --git a/src/pdf/SkPDFDevice.h b/src/pdf/SkPDFDevice.h |
index 32ebebd38ef8c66f693fd4715b747470371ed95f..dc74e6f84fdbc762949d5440866dc16423942754 100644 |
--- a/src/pdf/SkPDFDevice.h |
+++ b/src/pdf/SkPDFDevice.h |
@@ -39,6 +39,7 @@ class SkRRect; |
struct ContentEntry; |
struct GraphicStateEntry; |
struct NamedDestination; |
+struct RectWithData; |
/** \class SkPDFDevice |
@@ -142,6 +143,12 @@ public: |
*/ |
const SkTDArray<SkPDFFont*>& getFontResources() const; |
+ /** Add our annotations (link to urls and destinations) to the supplied |
+ * array. |
+ * @param array Array to add annotations to. |
+ */ |
+ void appendAnnotations(SkPDFArray* array) const; |
+ |
/** Add our named destinations to the supplied dictionary. |
* @param dict Dictionary to add destinations to. |
* @param page The PDF object representing the page for this device. |
@@ -153,10 +160,6 @@ public: |
*/ |
SkPDFArray* copyMediaBox() const; |
- /** Get the annotations from this page, or NULL if there are none. |
- */ |
- SkPDFArray* getAnnotations() const { return fAnnotations; } |
- |
/** Returns a SkStream with the page contents. The caller is responsible |
* for a deleting the returned value. |
*/ |
@@ -197,7 +200,9 @@ private: |
SkMatrix fInitialTransform; |
SkClipStack fExistingClipStack; |
SkRegion fExistingClipRegion; |
- SkPDFArray* fAnnotations; |
+ |
+ SkTDArray<RectWithData*> fLinkToURLs; |
+ SkTDArray<RectWithData*> fLinkToDestinations; |
SkTDArray<NamedDestination*> fNamedDestinations; |
SkTDArray<SkPDFObject*> fGraphicStateResources; |
@@ -292,7 +297,8 @@ private: |
const SkMatrix* prePathMatrix = NULL); |
bool handlePointAnnotation(const SkPoint* points, size_t count, |
const SkMatrix& matrix, SkAnnotation* annot); |
- void addAnnotation(SkPDFDict*); |
+ bool handlePathAnnotation(const SkPath& path, const SkDraw& d, |
+ SkAnnotation* annot); |
typedef SkBaseDevice INHERITED; |