1cf2cfa174ca878c144e17e9fc60ca8e9070d7dededisonn@google.com/* 2cf2cfa174ca878c144e17e9fc60ca8e9070d7dededisonn@google.com * Copyright 2013 Google Inc. 38cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com 4cf2cfa174ca878c144e17e9fc60ca8e9070d7dededisonn@google.com * Use of this source code is governed by a BSD-style license that can be 5cf2cfa174ca878c144e17e9fc60ca8e9070d7dededisonn@google.com * found in the LICENSE file. 6cf2cfa174ca878c144e17e9fc60ca8e9070d7dededisonn@google.com */ 78cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com 8cf2cfa174ca878c144e17e9fc60ca8e9070d7dededisonn@google.com#include "SkPdfResourceDictionary_autogen.h" 98cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com#include "SkPdfNativeDoc.h" 10cf2cfa174ca878c144e17e9fc60ca8e9070d7dededisonn@google.com 118cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.comSkPdfDictionary* SkPdfResourceDictionary::ExtGState(SkPdfNativeDoc* doc) { 128cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com SkPdfNativeObject* ret = get("ExtGState", ""); 138cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com if (doc) {ret = doc->resolveReference(ret);} 148cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfDictionary*)ret; 158cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com // TODO(edisonn): warn about missing default value for optional fields 168cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com return NULL; 178cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com} 188cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com 198cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.combool SkPdfResourceDictionary::has_ExtGState() const { 208cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com return get("ExtGState", "") != NULL; 218cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com} 228cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com 238cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.comSkPdfDictionary* SkPdfResourceDictionary::ColorSpace(SkPdfNativeDoc* doc) { 248cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com SkPdfNativeObject* ret = get("ColorSpace", ""); 258cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com if (doc) {ret = doc->resolveReference(ret);} 268cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfDictionary*)ret; 278cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com // TODO(edisonn): warn about missing default value for optional fields 288cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com return NULL; 298cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com} 308cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com 318cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.combool SkPdfResourceDictionary::has_ColorSpace() const { 328cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com return get("ColorSpace", "") != NULL; 338cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com} 348cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com 358cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.comSkPdfDictionary* SkPdfResourceDictionary::Pattern(SkPdfNativeDoc* doc) { 368cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com SkPdfNativeObject* ret = get("Pattern", ""); 378cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com if (doc) {ret = doc->resolveReference(ret);} 388cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfDictionary*)ret; 398cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com // TODO(edisonn): warn about missing default value for optional fields 408cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com return NULL; 418cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com} 428cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com 438cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.combool SkPdfResourceDictionary::has_Pattern() const { 448cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com return get("Pattern", "") != NULL; 458cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com} 468cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com 478cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.comSkPdfDictionary* SkPdfResourceDictionary::Shading(SkPdfNativeDoc* doc) { 488cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com SkPdfNativeObject* ret = get("Shading", ""); 498cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com if (doc) {ret = doc->resolveReference(ret);} 508cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfDictionary*)ret; 518cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com // TODO(edisonn): warn about missing default value for optional fields 528cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com return NULL; 538cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com} 548cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com 558cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.combool SkPdfResourceDictionary::has_Shading() const { 568cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com return get("Shading", "") != NULL; 578cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com} 588cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com 598cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.comSkPdfDictionary* SkPdfResourceDictionary::XObject(SkPdfNativeDoc* doc) { 608cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com SkPdfNativeObject* ret = get("XObject", ""); 618cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com if (doc) {ret = doc->resolveReference(ret);} 628cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfDictionary*)ret; 638cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com // TODO(edisonn): warn about missing default value for optional fields 648cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com return NULL; 658cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com} 668cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com 678cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.combool SkPdfResourceDictionary::has_XObject() const { 688cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com return get("XObject", "") != NULL; 698cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com} 708cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com 718cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.comSkPdfDictionary* SkPdfResourceDictionary::Font(SkPdfNativeDoc* doc) { 728cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com SkPdfNativeObject* ret = get("Font", ""); 738cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com if (doc) {ret = doc->resolveReference(ret);} 748cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfDictionary*)ret; 758cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com // TODO(edisonn): warn about missing default value for optional fields 768cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com return NULL; 778cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com} 788cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com 798cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.combool SkPdfResourceDictionary::has_Font() const { 808cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com return get("Font", "") != NULL; 818cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com} 828cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com 838cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.comSkPdfArray* SkPdfResourceDictionary::ProcSet(SkPdfNativeDoc* doc) { 848cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com SkPdfNativeObject* ret = get("ProcSet", ""); 858cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com if (doc) {ret = doc->resolveReference(ret);} 868cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfArray*)ret; 878cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com // TODO(edisonn): warn about missing default value for optional fields 888cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com return NULL; 898cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com} 908cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com 918cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.combool SkPdfResourceDictionary::has_ProcSet() const { 928cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com return get("ProcSet", "") != NULL; 938cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com} 948cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com 958cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.comSkPdfDictionary* SkPdfResourceDictionary::Properties(SkPdfNativeDoc* doc) { 968cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com SkPdfNativeObject* ret = get("Properties", ""); 978cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com if (doc) {ret = doc->resolveReference(ret);} 988cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfDictionary*)ret; 998cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com // TODO(edisonn): warn about missing default value for optional fields 1008cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com return NULL; 1018cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com} 1028cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com 1038cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.combool SkPdfResourceDictionary::has_Properties() const { 1048cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com return get("Properties", "") != NULL; 1058cee797901763ab0922eb9ef484cfdcbc94bee54edisonn@google.com} 106