1 2 /* 3 * Copyright 2006 The Android Open Source Project 4 * 5 * Use of this source code is governed by a BSD-style license that can be 6 * found in the LICENSE file. 7 */ 8 9 10 #include "SkDisplayInclude.h" 11 #include "SkAnimateMaker.h" 12 #include "SkAnimator.h" 13 14 #if SK_USE_CONDENSED_INFO == 0 15 16 const SkMemberInfo SkInclude::fInfo[] = { 17 SK_MEMBER(src, String) 18 }; 19 20 #endif 21 22 DEFINE_GET_MEMBER(SkInclude); 23 24 //SkInclude::SkInclude() { 25 // src.init(); 26 //} 27 28 //SkInclude::~SkInclude() { 29 // src.unref(); 30 //} 31 enable(SkAnimateMaker &)32bool SkInclude::enable(SkAnimateMaker & ) { 33 return true; 34 } 35 hasEnable() const36bool SkInclude::hasEnable() const { 37 return true; 38 } 39 onEndElement(SkAnimateMaker & maker)40void SkInclude::onEndElement(SkAnimateMaker& maker) { 41 maker.fInInclude = true; 42 if (src.size() == 0 || maker.decodeURI(src.c_str()) == false) { 43 if (maker.getErrorCode() != SkXMLParserError::kNoError || maker.getNativeCode() != -1) { 44 maker.setInnerError(&maker, src); 45 maker.setErrorCode(SkDisplayXMLParserError::kInInclude); 46 } else { 47 maker.setErrorNoun(src); 48 maker.setErrorCode(SkDisplayXMLParserError::kIncludeNameUnknownOrMissing); 49 } 50 } 51 maker.fInInclude = false; 52 } 53