summaryrefslogtreecommitdiff
path: root/noncore/unsupported/qpdf/xpdf/Page.h
Unidiff
Diffstat (limited to 'noncore/unsupported/qpdf/xpdf/Page.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/qpdf/xpdf/Page.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/noncore/unsupported/qpdf/xpdf/Page.h b/noncore/unsupported/qpdf/xpdf/Page.h
index 203878f..57e802a 100644
--- a/noncore/unsupported/qpdf/xpdf/Page.h
+++ b/noncore/unsupported/qpdf/xpdf/Page.h
@@ -1,17 +1,17 @@
1//======================================================================== 1//========================================================================
2// 2//
3// Page.h 3// Page.h
4// 4//
5// Copyright 1996 Derek B. Noonburg 5// Copyright 1996-2002 Glyph & Cog, LLC
6// 6//
7//======================================================================== 7//========================================================================
8 8
9#ifndef PAGE_H 9#ifndef PAGE_H
10#define PAGE_H 10#define PAGE_H
11 11
12#ifdef __GNUC__ 12#ifdef __GNUC__
13#pragma interface 13#pragma interface
14#endif 14#endif
15 15
16#include "Object.h" 16#include "Object.h"
17 17
@@ -42,39 +42,59 @@ public:
42 // Destructor. 42 // Destructor.
43 ~PageAttrs(); 43 ~PageAttrs();
44 44
45 // Accessors. 45 // Accessors.
46 PDFRectangle *getBox() { return limitToCropBox ? &cropBox : &mediaBox; } 46 PDFRectangle *getBox() { return limitToCropBox ? &cropBox : &mediaBox; }
47 PDFRectangle *getMediaBox() { return &mediaBox; } 47 PDFRectangle *getMediaBox() { return &mediaBox; }
48 PDFRectangle *getCropBox() { return &cropBox; } 48 PDFRectangle *getCropBox() { return &cropBox; }
49 GBool isCropped() { return haveCropBox; } 49 GBool isCropped() { return haveCropBox; }
50 PDFRectangle *getBleedBox() { return &bleedBox; } 50 PDFRectangle *getBleedBox() { return &bleedBox; }
51 PDFRectangle *getTrimBox() { return &trimBox; } 51 PDFRectangle *getTrimBox() { return &trimBox; }
52 PDFRectangle *getArtBox() { return &artBox; } 52 PDFRectangle *getArtBox() { return &artBox; }
53 int getRotate() { return rotate; } 53 int getRotate() { return rotate; }
54 GString *getLastModified()
55 { return lastModified.isString()
56 ? lastModified.getString() : (GString *)NULL; }
57 Dict *getBoxColorInfo()
58 { return boxColorInfo.isDict() ? boxColorInfo.getDict() : (Dict *)NULL; }
59 Dict *getGroup()
60 { return group.isDict() ? group.getDict() : (Dict *)NULL; }
61 Stream *getMetadata()
62 { return metadata.isStream() ? metadata.getStream() : (Stream *)NULL; }
63 Dict *getPieceInfo()
64 { return pieceInfo.isDict() ? pieceInfo.getDict() : (Dict *)NULL; }
65 Dict *getSeparationInfo()
66 { return separationInfo.isDict()
67 ? separationInfo.getDict() : (Dict *)NULL; }
54 Dict *getResourceDict() 68 Dict *getResourceDict()
55 { return resources.isDict() ? resources.getDict() : (Dict *)NULL; } 69 { return resources.isDict() ? resources.getDict() : (Dict *)NULL; }
56 70
57private: 71private:
58 72
59 GBool readBox(Dict *dict, char *key, PDFRectangle *box); 73 GBool readBox(Dict *dict, char *key, PDFRectangle *box);
60 74
61 PDFRectangle mediaBox; 75 PDFRectangle mediaBox;
62 PDFRectangle cropBox; 76 PDFRectangle cropBox;
63 GBool haveCropBox; 77 GBool haveCropBox;
64 GBool limitToCropBox; 78 GBool limitToCropBox;
65 PDFRectangle bleedBox; 79 PDFRectangle bleedBox;
66 PDFRectangle trimBox; 80 PDFRectangle trimBox;
67 PDFRectangle artBox; 81 PDFRectangle artBox;
68 int rotate; 82 int rotate;
83 Object lastModified;
84 Object boxColorInfo;
85 Object group;
86 Object metadata;
87 Object pieceInfo;
88 Object separationInfo;
69 Object resources; 89 Object resources;
70}; 90};
71 91
72//------------------------------------------------------------------------ 92//------------------------------------------------------------------------
73// Page 93// Page
74//------------------------------------------------------------------------ 94//------------------------------------------------------------------------
75 95
76class Page { 96class Page {
77public: 97public:
78 98
79 // Constructor. 99 // Constructor.
80 Page(XRef *xrefA, int numA, Dict *pageDict, PageAttrs *attrsA, 100 Page(XRef *xrefA, int numA, Dict *pageDict, PageAttrs *attrsA,
@@ -88,24 +108,30 @@ public:
88 108
89 // Get page parameters. 109 // Get page parameters.
90 PDFRectangle *getBox() { return attrs->getBox(); } 110 PDFRectangle *getBox() { return attrs->getBox(); }
91 PDFRectangle *getMediaBox() { return attrs->getMediaBox(); } 111 PDFRectangle *getMediaBox() { return attrs->getMediaBox(); }
92 PDFRectangle *getCropBox() { return attrs->getCropBox(); } 112 PDFRectangle *getCropBox() { return attrs->getCropBox(); }
93 GBool isCropped() { return attrs->isCropped(); } 113 GBool isCropped() { return attrs->isCropped(); }
94 fouble getWidth() { return attrs->getBox()->x2 - attrs->getBox()->x1; } 114 fouble getWidth() { return attrs->getBox()->x2 - attrs->getBox()->x1; }
95 fouble getHeight() { return attrs->getBox()->y2 - attrs->getBox()->y1; } 115 fouble getHeight() { return attrs->getBox()->y2 - attrs->getBox()->y1; }
96 PDFRectangle *getBleedBox() { return attrs->getBleedBox(); } 116 PDFRectangle *getBleedBox() { return attrs->getBleedBox(); }
97 PDFRectangle *getTrimBox() { return attrs->getTrimBox(); } 117 PDFRectangle *getTrimBox() { return attrs->getTrimBox(); }
98 PDFRectangle *getArtBox() { return attrs->getArtBox(); } 118 PDFRectangle *getArtBox() { return attrs->getArtBox(); }
99 int getRotate() { return attrs->getRotate(); } 119 int getRotate() { return attrs->getRotate(); }
120 GString *getLastModified() { return attrs->getLastModified(); }
121 Dict *getBoxColorInfo() { return attrs->getBoxColorInfo(); }
122 Dict *getGroup() { return attrs->getGroup(); }
123 Stream *getMetadata() { return attrs->getMetadata(); }
124 Dict *getPieceInfo() { return attrs->getPieceInfo(); }
125 Dict *getSeparationInfo() { return attrs->getSeparationInfo(); }
100 126
101 // Get resource dictionary. 127 // Get resource dictionary.
102 Dict *getResourceDict() { return attrs->getResourceDict(); } 128 Dict *getResourceDict() { return attrs->getResourceDict(); }
103 129
104 // Get annotations array. 130 // Get annotations array.
105 Object *getAnnots(Object *obj) { return annots.fetch(xref, obj); } 131 Object *getAnnots(Object *obj) { return annots.fetch(xref, obj); }
106 132
107 // Get contents. 133 // Get contents.
108 Object *getContents(Object *obj) { return contents.fetch(xref, obj); } 134 Object *getContents(Object *obj) { return contents.fetch(xref, obj); }
109 135
110 // Display a page. 136 // Display a page.
111 void display(OutputDev *out, fouble dpi, int rotate, 137 void display(OutputDev *out, fouble dpi, int rotate,