OLD | NEW |
(Empty) | |
| 1 #include "SkPdfShadingDictionary_autogen.h" |
| 2 |
| 3 |
| 4 #include "SkPdfNativeDoc.h" |
| 5 int64_t SkPdfShadingDictionary::ShadingType(SkPdfNativeDoc* doc) { |
| 6 SkPdfNativeObject* ret = get("ShadingType", ""); |
| 7 if (doc) {ret = doc->resolveReference(ret);} |
| 8 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); |
| 9 // TODO(edisonn): warn about missing required field, assert for known good pdf
s |
| 10 return 0; |
| 11 } |
| 12 |
| 13 bool SkPdfShadingDictionary::has_ShadingType() const { |
| 14 return get("ShadingType", "") != NULL; |
| 15 } |
| 16 |
| 17 bool SkPdfShadingDictionary::isColorSpaceAName(SkPdfNativeDoc* doc) { |
| 18 SkPdfNativeObject* ret = get("ColorSpace", ""); |
| 19 if (doc) {ret = doc->resolveReference(ret);} |
| 20 return ret != NULL && ret->isName(); |
| 21 } |
| 22 |
| 23 SkString SkPdfShadingDictionary::getColorSpaceAsName(SkPdfNativeDoc* doc) { |
| 24 SkPdfNativeObject* ret = get("ColorSpace", ""); |
| 25 if (doc) {ret = doc->resolveReference(ret);} |
| 26 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); |
| 27 // TODO(edisonn): warn about missing required field, assert for known good pdf
s |
| 28 return SkString(); |
| 29 } |
| 30 |
| 31 bool SkPdfShadingDictionary::isColorSpaceAArray(SkPdfNativeDoc* doc) { |
| 32 SkPdfNativeObject* ret = get("ColorSpace", ""); |
| 33 if (doc) {ret = doc->resolveReference(ret);} |
| 34 return ret != NULL && ret->isArray(); |
| 35 } |
| 36 |
| 37 SkPdfArray* SkPdfShadingDictionary::getColorSpaceAsArray(SkPdfNativeDoc* doc) { |
| 38 SkPdfNativeObject* ret = get("ColorSpace", ""); |
| 39 if (doc) {ret = doc->resolveReference(ret);} |
| 40 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR
eference())) return (SkPdfArray*)ret; |
| 41 // TODO(edisonn): warn about missing required field, assert for known good pdf
s |
| 42 return NULL; |
| 43 } |
| 44 |
| 45 bool SkPdfShadingDictionary::has_ColorSpace() const { |
| 46 return get("ColorSpace", "") != NULL; |
| 47 } |
| 48 |
| 49 SkPdfArray* SkPdfShadingDictionary::Background(SkPdfNativeDoc* doc) { |
| 50 SkPdfNativeObject* ret = get("Background", ""); |
| 51 if (doc) {ret = doc->resolveReference(ret);} |
| 52 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR
eference())) return (SkPdfArray*)ret; |
| 53 // TODO(edisonn): warn about missing default value for optional fields |
| 54 return NULL; |
| 55 } |
| 56 |
| 57 bool SkPdfShadingDictionary::has_Background() const { |
| 58 return get("Background", "") != NULL; |
| 59 } |
| 60 |
| 61 SkRect SkPdfShadingDictionary::BBox(SkPdfNativeDoc* doc) { |
| 62 SkPdfNativeObject* ret = get("BBox", ""); |
| 63 if (doc) {ret = doc->resolveReference(ret);} |
| 64 if ((ret != NULL && ret->isRectangle()) || (doc == NULL && ret != NULL && ret-
>isReference())) return ret->rectangleValue(); |
| 65 // TODO(edisonn): warn about missing default value for optional fields |
| 66 return SkRect::MakeEmpty(); |
| 67 } |
| 68 |
| 69 bool SkPdfShadingDictionary::has_BBox() const { |
| 70 return get("BBox", "") != NULL; |
| 71 } |
| 72 |
| 73 bool SkPdfShadingDictionary::AntiAlias(SkPdfNativeDoc* doc) { |
| 74 SkPdfNativeObject* ret = get("AntiAlias", ""); |
| 75 if (doc) {ret = doc->resolveReference(ret);} |
| 76 if ((ret != NULL && ret->isBoolean()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->boolValue(); |
| 77 // TODO(edisonn): warn about missing default value for optional fields |
| 78 return false; |
| 79 } |
| 80 |
| 81 bool SkPdfShadingDictionary::has_AntiAlias() const { |
| 82 return get("AntiAlias", "") != NULL; |
| 83 } |
| 84 |
OLD | NEW |