Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: experimental/PdfViewer/pdfparser/native/pdfapi/SkPdfType3FontDictionary_autogen.cpp

Issue 22900010: pdfviewer: check in pdfapi classes (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #include "SkPdfType3FontDictionary_autogen.h"
2
3
4 #include "SkPdfNativeDoc.h"
5 SkString SkPdfType3FontDictionary::Type(SkPdfNativeDoc* doc) {
6 SkPdfNativeObject* ret = get("Type", "");
7 if (doc) {ret = doc->resolveReference(ret);}
8 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe ference())) return ret->nameValue2();
9 // TODO(edisonn): warn about missing required field, assert for known good pdf s
10 return SkString();
11 }
12
13 bool SkPdfType3FontDictionary::has_Type() const {
14 return get("Type", "") != NULL;
15 }
16
17 SkString SkPdfType3FontDictionary::Subtype(SkPdfNativeDoc* doc) {
18 SkPdfNativeObject* ret = get("Subtype", "");
19 if (doc) {ret = doc->resolveReference(ret);}
20 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe ference())) return ret->nameValue2();
21 // TODO(edisonn): warn about missing required field, assert for known good pdf s
22 return SkString();
23 }
24
25 bool SkPdfType3FontDictionary::has_Subtype() const {
26 return get("Subtype", "") != NULL;
27 }
28
29 SkString SkPdfType3FontDictionary::Name(SkPdfNativeDoc* doc) {
30 SkPdfNativeObject* ret = get("Name", "");
31 if (doc) {ret = doc->resolveReference(ret);}
32 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe ference())) return ret->nameValue2();
33 // TODO(edisonn): warn about missing default value for optional fields
34 return SkString();
35 }
36
37 bool SkPdfType3FontDictionary::has_Name() const {
38 return get("Name", "") != NULL;
39 }
40
41 SkRect SkPdfType3FontDictionary::FontBBox(SkPdfNativeDoc* doc) {
42 SkPdfNativeObject* ret = get("FontBBox", "");
43 if (doc) {ret = doc->resolveReference(ret);}
44 if ((ret != NULL && ret->isRectangle()) || (doc == NULL && ret != NULL && ret- >isReference())) return ret->rectangleValue();
45 // TODO(edisonn): warn about missing required field, assert for known good pdf s
46 return SkRect::MakeEmpty();
47 }
48
49 bool SkPdfType3FontDictionary::has_FontBBox() const {
50 return get("FontBBox", "") != NULL;
51 }
52
53 SkMatrix SkPdfType3FontDictionary::FontMatrix(SkPdfNativeDoc* doc) {
54 SkPdfNativeObject* ret = get("FontMatrix", "");
55 if (doc) {ret = doc->resolveReference(ret);}
56 if ((ret != NULL && ret->isMatrix()) || (doc == NULL && ret != NULL && ret->is Reference())) return ret->matrixValue();
57 // TODO(edisonn): warn about missing required field, assert for known good pdf s
58 return SkMatrix::I();
59 }
60
61 bool SkPdfType3FontDictionary::has_FontMatrix() const {
62 return get("FontMatrix", "") != NULL;
63 }
64
65 SkPdfDictionary* SkPdfType3FontDictionary::CharProcs(SkPdfNativeDoc* doc) {
66 SkPdfNativeObject* ret = get("CharProcs", "");
67 if (doc) {ret = doc->resolveReference(ret);}
68 if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret ->isReference())) return (SkPdfDictionary*)ret;
69 // TODO(edisonn): warn about missing required field, assert for known good pdf s
70 return NULL;
71 }
72
73 bool SkPdfType3FontDictionary::has_CharProcs() const {
74 return get("CharProcs", "") != NULL;
75 }
76
77 bool SkPdfType3FontDictionary::isEncodingAName(SkPdfNativeDoc* doc) {
78 SkPdfNativeObject* ret = get("Encoding", "");
79 if (doc) {ret = doc->resolveReference(ret);}
80 return ret != NULL && ret->isName();
81 }
82
83 SkString SkPdfType3FontDictionary::getEncodingAsName(SkPdfNativeDoc* doc) {
84 SkPdfNativeObject* ret = get("Encoding", "");
85 if (doc) {ret = doc->resolveReference(ret);}
86 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe ference())) return ret->nameValue2();
87 // TODO(edisonn): warn about missing required field, assert for known good pdf s
88 return SkString();
89 }
90
91 bool SkPdfType3FontDictionary::isEncodingAEncodingdictionary(SkPdfNativeDoc* doc ) {
92 SkPdfNativeObject* ret = get("Encoding", "");
93 if (doc) {ret = doc->resolveReference(ret);}
94 return ret != NULL && ret->isDictionary() && ((SkPdfEncodingDictionary*)ret)-> valid();
95 }
96
97 SkPdfEncodingDictionary* SkPdfType3FontDictionary::getEncodingAsEncodingdictiona ry(SkPdfNativeDoc* doc) {
98 SkPdfNativeObject* ret = get("Encoding", "");
99 if (doc) {ret = doc->resolveReference(ret);}
100 if ((ret != NULL && ret->isDictionary() && ((SkPdfEncodingDictionary*)ret)->va lid()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfEncod ingDictionary*)ret;
101 // TODO(edisonn): warn about missing required field, assert for known good pdf s
102 return NULL;
103 }
104
105 bool SkPdfType3FontDictionary::has_Encoding() const {
106 return get("Encoding", "") != NULL;
107 }
108
109 int64_t SkPdfType3FontDictionary::FirstChar(SkPdfNativeDoc* doc) {
110 SkPdfNativeObject* ret = get("FirstChar", "");
111 if (doc) {ret = doc->resolveReference(ret);}
112 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i sReference())) return ret->intValue();
113 // TODO(edisonn): warn about missing required field, assert for known good pdf s
114 return 0;
115 }
116
117 bool SkPdfType3FontDictionary::has_FirstChar() const {
118 return get("FirstChar", "") != NULL;
119 }
120
121 int64_t SkPdfType3FontDictionary::LastChar(SkPdfNativeDoc* doc) {
122 SkPdfNativeObject* ret = get("LastChar", "");
123 if (doc) {ret = doc->resolveReference(ret);}
124 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i sReference())) return ret->intValue();
125 // TODO(edisonn): warn about missing required field, assert for known good pdf s
126 return 0;
127 }
128
129 bool SkPdfType3FontDictionary::has_LastChar() const {
130 return get("LastChar", "") != NULL;
131 }
132
133 SkPdfArray* SkPdfType3FontDictionary::Widths(SkPdfNativeDoc* doc) {
134 SkPdfNativeObject* ret = get("Widths", "");
135 if (doc) {ret = doc->resolveReference(ret);}
136 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR eference())) return (SkPdfArray*)ret;
137 // TODO(edisonn): warn about missing default value for optional fields
138 return NULL;
139 }
140
141 bool SkPdfType3FontDictionary::has_Widths() const {
142 return get("Widths", "") != NULL;
143 }
144
145 SkPdfResourceDictionary* SkPdfType3FontDictionary::Resources(SkPdfNativeDoc* doc ) {
146 SkPdfNativeObject* ret = get("Resources", "");
147 if (doc) {ret = doc->resolveReference(ret);}
148 if ((ret != NULL && ret->isDictionary() && ((SkPdfResourceDictionary*)ret)->va lid()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfResou rceDictionary*)ret;
149 // TODO(edisonn): warn about missing default value for optional fields
150 return NULL;
151 }
152
153 bool SkPdfType3FontDictionary::has_Resources() const {
154 return get("Resources", "") != NULL;
155 }
156
157 SkPdfStream* SkPdfType3FontDictionary::ToUnicode(SkPdfNativeDoc* doc) {
158 SkPdfNativeObject* ret = get("ToUnicode", "");
159 if (doc) {ret = doc->resolveReference(ret);}
160 if ((ret != NULL && ret->hasStream()) || (doc == NULL && ret != NULL && ret->i sReference())) return ret->getStream();
161 // TODO(edisonn): warn about missing default value for optional fields
162 return NULL;
163 }
164
165 bool SkPdfType3FontDictionary::has_ToUnicode() const {
166 return get("ToUnicode", "") != NULL;
167 }
168
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698