| 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 "SkPdfSoftMaskDictionary_autogen.h" | |
| 9 #include "SkPdfNativeDoc.h" | |
| 10 | |
| 11 SkString SkPdfSoftMaskDictionary::Type(SkPdfNativeDoc* doc) { | |
| 12 SkPdfNativeObject* ret = get("Type", ""); | |
| 13 if (doc) {ret = doc->resolveReference(ret);} | |
| 14 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); | |
| 15 // TODO(edisonn): warn about missing default value for optional fields | |
| 16 return SkString(); | |
| 17 } | |
| 18 | |
| 19 bool SkPdfSoftMaskDictionary::has_Type() const { | |
| 20 return get("Type", "") != NULL; | |
| 21 } | |
| 22 | |
| 23 SkString SkPdfSoftMaskDictionary::S(SkPdfNativeDoc* doc) { | |
| 24 SkPdfNativeObject* ret = get("S", ""); | |
| 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 SkPdfSoftMaskDictionary::has_S() const { | |
| 32 return get("S", "") != NULL; | |
| 33 } | |
| 34 | |
| 35 SkPdfStream* SkPdfSoftMaskDictionary::G(SkPdfNativeDoc* doc) { | |
| 36 SkPdfNativeObject* ret = get("G", ""); | |
| 37 if (doc) {ret = doc->resolveReference(ret);} | |
| 38 if ((ret != NULL && ret->hasStream()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->getStream(); | |
| 39 // TODO(edisonn): warn about missing required field, assert for known good pdf
s | |
| 40 return NULL; | |
| 41 } | |
| 42 | |
| 43 bool SkPdfSoftMaskDictionary::has_G() const { | |
| 44 return get("G", "") != NULL; | |
| 45 } | |
| 46 | |
| 47 SkPdfArray* SkPdfSoftMaskDictionary::BC(SkPdfNativeDoc* doc) { | |
| 48 SkPdfNativeObject* ret = get("BC", ""); | |
| 49 if (doc) {ret = doc->resolveReference(ret);} | |
| 50 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR
eference())) return (SkPdfArray*)ret; | |
| 51 // TODO(edisonn): warn about missing default value for optional fields | |
| 52 return NULL; | |
| 53 } | |
| 54 | |
| 55 bool SkPdfSoftMaskDictionary::has_BC() const { | |
| 56 return get("BC", "") != NULL; | |
| 57 } | |
| 58 | |
| 59 bool SkPdfSoftMaskDictionary::isTRAFunction(SkPdfNativeDoc* doc) { | |
| 60 SkPdfNativeObject* ret = get("TR", ""); | |
| 61 if (doc) {ret = doc->resolveReference(ret);} | |
| 62 return ret != NULL && ret->isFunction(); | |
| 63 } | |
| 64 | |
| 65 SkPdfFunction SkPdfSoftMaskDictionary::getTRAsFunction(SkPdfNativeDoc* doc) { | |
| 66 SkPdfNativeObject* ret = get("TR", ""); | |
| 67 if (doc) {ret = doc->resolveReference(ret);} | |
| 68 if ((ret != NULL && ret->isFunction()) || (doc == NULL && ret != NULL && ret->
isReference())) return ret->functionValue(); | |
| 69 // TODO(edisonn): warn about missing default value for optional fields | |
| 70 return SkPdfFunction(); | |
| 71 } | |
| 72 | |
| 73 bool SkPdfSoftMaskDictionary::isTRAName(SkPdfNativeDoc* doc) { | |
| 74 SkPdfNativeObject* ret = get("TR", ""); | |
| 75 if (doc) {ret = doc->resolveReference(ret);} | |
| 76 return ret != NULL && ret->isName(); | |
| 77 } | |
| 78 | |
| 79 SkString SkPdfSoftMaskDictionary::getTRAsName(SkPdfNativeDoc* doc) { | |
| 80 SkPdfNativeObject* ret = get("TR", ""); | |
| 81 if (doc) {ret = doc->resolveReference(ret);} | |
| 82 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); | |
| 83 // TODO(edisonn): warn about missing default value for optional fields | |
| 84 return SkString(); | |
| 85 } | |
| 86 | |
| 87 bool SkPdfSoftMaskDictionary::has_TR() const { | |
| 88 return get("TR", "") != NULL; | |
| 89 } | |
| OLD | NEW |