| 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 "SkPdfCMapDictionary_autogen.h" | |
| 9 #include "SkPdfNativeDoc.h" | |
| 10 | |
| 11 SkString SkPdfCMapDictionary::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 required field, assert for known good pdf
s | |
| 16 return SkString(); | |
| 17 } | |
| 18 | |
| 19 bool SkPdfCMapDictionary::has_Type() const { | |
| 20 return get("Type", "") != NULL; | |
| 21 } | |
| 22 | |
| 23 SkString SkPdfCMapDictionary::CMapName(SkPdfNativeDoc* doc) { | |
| 24 SkPdfNativeObject* ret = get("CMapName", ""); | |
| 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 SkPdfCMapDictionary::has_CMapName() const { | |
| 32 return get("CMapName", "") != NULL; | |
| 33 } | |
| 34 | |
| 35 bool SkPdfCMapDictionary::isCIDSystemInfoADictionary(SkPdfNativeDoc* doc) { | |
| 36 SkPdfNativeObject* ret = get("CIDSystemInfo", ""); | |
| 37 if (doc) {ret = doc->resolveReference(ret);} | |
| 38 return ret != NULL && ret->isDictionary(); | |
| 39 } | |
| 40 | |
| 41 SkPdfDictionary* SkPdfCMapDictionary::getCIDSystemInfoAsDictionary(SkPdfNativeDo
c* doc) { | |
| 42 SkPdfNativeObject* ret = get("CIDSystemInfo", ""); | |
| 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 SkPdfCMapDictionary::isCIDSystemInfoAArray(SkPdfNativeDoc* doc) { | |
| 50 SkPdfNativeObject* ret = get("CIDSystemInfo", ""); | |
| 51 if (doc) {ret = doc->resolveReference(ret);} | |
| 52 return ret != NULL && ret->isArray(); | |
| 53 } | |
| 54 | |
| 55 SkPdfArray* SkPdfCMapDictionary::getCIDSystemInfoAsArray(SkPdfNativeDoc* doc) { | |
| 56 SkPdfNativeObject* ret = get("CIDSystemInfo", ""); | |
| 57 if (doc) {ret = doc->resolveReference(ret);} | |
| 58 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR
eference())) return (SkPdfArray*)ret; | |
| 59 // TODO(edisonn): warn about missing required field, assert for known good pdf
s | |
| 60 return NULL; | |
| 61 } | |
| 62 | |
| 63 bool SkPdfCMapDictionary::has_CIDSystemInfo() const { | |
| 64 return get("CIDSystemInfo", "") != NULL; | |
| 65 } | |
| 66 | |
| 67 int64_t SkPdfCMapDictionary::WMode(SkPdfNativeDoc* doc) { | |
| 68 SkPdfNativeObject* ret = get("WMode", ""); | |
| 69 if (doc) {ret = doc->resolveReference(ret);} | |
| 70 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); | |
| 71 // TODO(edisonn): warn about missing default value for optional fields | |
| 72 return 0; | |
| 73 } | |
| 74 | |
| 75 bool SkPdfCMapDictionary::has_WMode() const { | |
| 76 return get("WMode", "") != NULL; | |
| 77 } | |
| 78 | |
| 79 bool SkPdfCMapDictionary::isUseCMapAName(SkPdfNativeDoc* doc) { | |
| 80 SkPdfNativeObject* ret = get("UseCMap", ""); | |
| 81 if (doc) {ret = doc->resolveReference(ret);} | |
| 82 return ret != NULL && ret->isName(); | |
| 83 } | |
| 84 | |
| 85 SkString SkPdfCMapDictionary::getUseCMapAsName(SkPdfNativeDoc* doc) { | |
| 86 SkPdfNativeObject* ret = get("UseCMap", ""); | |
| 87 if (doc) {ret = doc->resolveReference(ret);} | |
| 88 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); | |
| 89 // TODO(edisonn): warn about missing default value for optional fields | |
| 90 return SkString(); | |
| 91 } | |
| 92 | |
| 93 bool SkPdfCMapDictionary::isUseCMapAStream(SkPdfNativeDoc* doc) { | |
| 94 SkPdfNativeObject* ret = get("UseCMap", ""); | |
| 95 if (doc) {ret = doc->resolveReference(ret);} | |
| 96 return ret != NULL && ret->hasStream(); | |
| 97 } | |
| 98 | |
| 99 SkPdfStream* SkPdfCMapDictionary::getUseCMapAsStream(SkPdfNativeDoc* doc) { | |
| 100 SkPdfNativeObject* ret = get("UseCMap", ""); | |
| 101 if (doc) {ret = doc->resolveReference(ret);} | |
| 102 if ((ret != NULL && ret->hasStream()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->getStream(); | |
| 103 // TODO(edisonn): warn about missing default value for optional fields | |
| 104 return NULL; | |
| 105 } | |
| 106 | |
| 107 bool SkPdfCMapDictionary::has_UseCMap() const { | |
| 108 return get("UseCMap", "") != NULL; | |
| 109 } | |
| OLD | NEW |