OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright 2013 Google Inc. | |
3 | |
4 * Use of this source code is governed by a BSD-style license that can be | |
5 * found in the LICENSE file. | |
6 */ | |
7 | |
8 #include "SkPdfType2PatternDictionary_autogen.h" | |
9 #include "SkPdfNativeDoc.h" | |
10 | |
11 int64_t SkPdfType2PatternDictionary::Type(SkPdfNativeDoc* doc) { | |
12 SkPdfNativeObject* ret = get("Type", ""); | |
13 if (doc) {ret = doc->resolveReference(ret);} | |
14 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); | |
15 // TODO(edisonn): warn about missing default value for optional fields | |
16 return 0; | |
17 } | |
18 | |
19 bool SkPdfType2PatternDictionary::has_Type() const { | |
20 return get("Type", "") != NULL; | |
21 } | |
22 | |
23 int64_t SkPdfType2PatternDictionary::PatternType(SkPdfNativeDoc* doc) { | |
24 SkPdfNativeObject* ret = get("PatternType", ""); | |
25 if (doc) {ret = doc->resolveReference(ret);} | |
26 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); | |
27 // TODO(edisonn): warn about missing required field, assert for known good pdf
s | |
28 return 0; | |
29 } | |
30 | |
31 bool SkPdfType2PatternDictionary::has_PatternType() const { | |
32 return get("PatternType", "") != NULL; | |
33 } | |
34 | |
35 bool SkPdfType2PatternDictionary::isShadingADictionary(SkPdfNativeDoc* doc) { | |
36 SkPdfNativeObject* ret = get("Shading", ""); | |
37 if (doc) {ret = doc->resolveReference(ret);} | |
38 return ret != NULL && ret->isDictionary(); | |
39 } | |
40 | |
41 SkPdfDictionary* SkPdfType2PatternDictionary::getShadingAsDictionary(SkPdfNative
Doc* doc) { | |
42 SkPdfNativeObject* ret = get("Shading", ""); | |
43 if (doc) {ret = doc->resolveReference(ret);} | |
44 if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret
->isReference())) return (SkPdfDictionary*)ret; | |
45 // TODO(edisonn): warn about missing required field, assert for known good pdf
s | |
46 return NULL; | |
47 } | |
48 | |
49 bool SkPdfType2PatternDictionary::isShadingAStream(SkPdfNativeDoc* doc) { | |
50 SkPdfNativeObject* ret = get("Shading", ""); | |
51 if (doc) {ret = doc->resolveReference(ret);} | |
52 return ret != NULL && ret->hasStream(); | |
53 } | |
54 | |
55 SkPdfStream* SkPdfType2PatternDictionary::getShadingAsStream(SkPdfNativeDoc* doc
) { | |
56 SkPdfNativeObject* ret = get("Shading", ""); | |
57 if (doc) {ret = doc->resolveReference(ret);} | |
58 if ((ret != NULL && ret->hasStream()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->getStream(); | |
59 // TODO(edisonn): warn about missing required field, assert for known good pdf
s | |
60 return NULL; | |
61 } | |
62 | |
63 bool SkPdfType2PatternDictionary::has_Shading() const { | |
64 return get("Shading", "") != NULL; | |
65 } | |
66 | |
67 SkPdfArray* SkPdfType2PatternDictionary::Matrix(SkPdfNativeDoc* doc) { | |
68 SkPdfNativeObject* ret = get("Matrix", ""); | |
69 if (doc) {ret = doc->resolveReference(ret);} | |
70 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR
eference())) return (SkPdfArray*)ret; | |
71 // TODO(edisonn): warn about missing default value for optional fields | |
72 return NULL; | |
73 } | |
74 | |
75 bool SkPdfType2PatternDictionary::has_Matrix() const { | |
76 return get("Matrix", "") != NULL; | |
77 } | |
78 | |
79 SkPdfDictionary* SkPdfType2PatternDictionary::ExtGState(SkPdfNativeDoc* doc) { | |
80 SkPdfNativeObject* ret = get("ExtGState", ""); | |
81 if (doc) {ret = doc->resolveReference(ret);} | |
82 if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret
->isReference())) return (SkPdfDictionary*)ret; | |
83 // TODO(edisonn): warn about missing default value for optional fields | |
84 return NULL; | |
85 } | |
86 | |
87 bool SkPdfType2PatternDictionary::has_ExtGState() const { | |
88 return get("ExtGState", "") != NULL; | |
89 } | |
OLD | NEW |