aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/pdf/SkPDFDevice.h
diff options
context:
space:
mode:
authorGravatar epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-08 09:09:10 +0000
committerGravatar epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-08 09:09:10 +0000
commitb58772f86659cfe0e8d9247fcee878dddd8fdad9 (patch)
tree78c54090d70af79ab206ef5137833c0703874203 /include/pdf/SkPDFDevice.h
parent754a3eb73b796398062f09cc98eae224262a3bc8 (diff)
PDF: add support for named destinations.
Landing patchset 7 from https://codereview.appspot.com/7374052 for dml@google.com Review URL: https://codereview.chromium.org/12533009 git-svn-id: http://skia.googlecode.com/svn/trunk@8034 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/pdf/SkPDFDevice.h')
-rw-r--r--include/pdf/SkPDFDevice.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/include/pdf/SkPDFDevice.h b/include/pdf/SkPDFDevice.h
index a13d6175c7..90379f9f6b 100644
--- a/include/pdf/SkPDFDevice.h
+++ b/include/pdf/SkPDFDevice.h
@@ -17,6 +17,7 @@
#include "SkRect.h"
#include "SkRefCnt.h"
#include "SkStream.h"
+#include "SkTDArray.h"
#include "SkTScopedPtr.h"
class SkPDFArray;
@@ -33,6 +34,7 @@ class SkPDFStream;
// Private classes.
struct ContentEntry;
struct GraphicStateEntry;
+struct NamedDestination;
/** \class SkPDFDevice
@@ -142,6 +144,12 @@ public:
*/
SK_API const SkTDArray<SkPDFFont*>& getFontResources() 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.
+ */
+ void appendDestinations(SkPDFDict* dict, SkPDFObject* page);
+
/** Returns a copy of the media box for this device. The caller is required
* to unref() this when it is finished.
*/
@@ -191,6 +199,7 @@ private:
SkRegion fExistingClipRegion;
SkPDFArray* fAnnotations;
SkPDFDict* fResourceDict;
+ SkTDArray<NamedDestination*> fNamedDestinations;
SkTDArray<SkPDFGraphicState*> fGraphicStateResources;
SkTDArray<SkPDFObject*> fXObjectResources;
@@ -273,8 +282,17 @@ private:
*/
void copyContentEntriesToData(ContentEntry* entry, SkWStream* data) const;
- bool handleAnnotations(const SkRect& r, const SkMatrix& matrix,
- const SkPaint& paint);
+ bool handleRectAnnotation(const SkRect& r, const SkMatrix& matrix,
+ const SkPaint& paint);
+ bool handlePointAnnotation(const SkPoint* points, size_t count,
+ const SkMatrix& matrix, const SkPaint& paint);
+ SkPDFDict* createLinkAnnotation(const SkRect& r, const SkMatrix& matrix);
+ void handleLinkToURL(SkData* urlData, const SkRect& r,
+ const SkMatrix& matrix);
+ void handleLinkToNamedDest(SkData* nameData, const SkRect& r,
+ const SkMatrix& matrix);
+ void defineNamedDestination(SkData* nameData, const SkPoint& point,
+ const SkMatrix& matrix);
typedef SkDevice INHERITED;
};