OLD | NEW |
| 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 |
1 #include "SkPdfAlternateImageDictionary_autogen.h" | 8 #include "SkPdfAlternateImageDictionary_autogen.h" |
2 | 9 |
3 | 10 |
4 #include "SkPdfNativeDoc.h" | 11 #include "SkPdfNativeDoc.h" |
5 SkPdfStream* SkPdfAlternateImageDictionary::Image(SkPdfNativeDoc* doc) { | 12 SkPdfStream* SkPdfAlternateImageDictionary::Image(SkPdfNativeDoc* doc) { |
6 SkPdfNativeObject* ret = get("Image", ""); | 13 SkPdfNativeObject* ret = get("Image", ""); |
7 if (doc) {ret = doc->resolveReference(ret);} | 14 if (doc) {ret = doc->resolveReference(ret);} |
8 if ((ret != NULL && ret->hasStream()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->getStream(); | 15 if ((ret != NULL && ret->hasStream()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->getStream(); |
9 // TODO(edisonn): warn about missing required field, assert for known good pdf
s | 16 // TODO(edisonn): warn about missing required field, assert for known good pdf
s |
10 return NULL; | 17 return NULL; |
11 } | 18 } |
12 | 19 |
13 bool SkPdfAlternateImageDictionary::has_Image() const { | 20 bool SkPdfAlternateImageDictionary::has_Image() const { |
14 return get("Image", "") != NULL; | 21 return get("Image", "") != NULL; |
15 } | 22 } |
16 | 23 |
17 bool SkPdfAlternateImageDictionary::DefaultForPrinting(SkPdfNativeDoc* doc) { | 24 bool SkPdfAlternateImageDictionary::DefaultForPrinting(SkPdfNativeDoc* doc) { |
18 SkPdfNativeObject* ret = get("DefaultForPrinting", ""); | 25 SkPdfNativeObject* ret = get("DefaultForPrinting", ""); |
19 if (doc) {ret = doc->resolveReference(ret);} | 26 if (doc) {ret = doc->resolveReference(ret);} |
20 if ((ret != NULL && ret->isBoolean()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->boolValue(); | 27 if ((ret != NULL && ret->isBoolean()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->boolValue(); |
21 // TODO(edisonn): warn about missing default value for optional fields | 28 // TODO(edisonn): warn about missing default value for optional fields |
22 return false; | 29 return false; |
23 } | 30 } |
24 | 31 |
25 bool SkPdfAlternateImageDictionary::has_DefaultForPrinting() const { | 32 bool SkPdfAlternateImageDictionary::has_DefaultForPrinting() const { |
26 return get("DefaultForPrinting", "") != NULL; | 33 return get("DefaultForPrinting", "") != NULL; |
27 } | 34 } |
28 | 35 |
OLD | NEW |