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 0 15 #undef SK_MEMBER 16 #define SK_MEMBER(_member, _type) \ 17 { #_member, SK_OFFSETOF(BASE_CLASS::_A, _member), SkType_##_type, \ 18 sizeof(((BASE_CLASS::_A*) 0)->_member) / sizeof(SkScalar) } 19 #endif 20 21 #if SK_USE_CONDENSED_INFO == 0 22 23 const SkMemberInfo SkInclude::fInfo[] = { 24 SK_MEMBER(src, String) 25 }; 26 27 #endif 28 29 DEFINE_GET_MEMBER(SkInclude); 30 31 //SkInclude::SkInclude() { 32 // src.init(); 33 //} 34 35 //SkInclude::~SkInclude() { 36 // src.unref(); 37 //} 38 enable(SkAnimateMaker &)39bool SkInclude::enable(SkAnimateMaker & ) { 40 return true; 41 } 42 hasEnable() const43bool SkInclude::hasEnable() const { 44 return true; 45 } 46 onEndElement(SkAnimateMaker & maker)47void SkInclude::onEndElement(SkAnimateMaker& maker) { 48 maker.fInInclude = true; 49 if (src.size() == 0 || maker.decodeURI(src.c_str()) == false) { 50 if (maker.getErrorCode() != SkXMLParserError::kNoError || maker.getNativeCode() != -1) { 51 maker.setInnerError(&maker, src); 52 maker.setErrorCode(SkDisplayXMLParserError::kInInclude); 53 } else { 54 maker.setErrorNoun(src); 55 maker.setErrorCode(SkDisplayXMLParserError::kIncludeNameUnknownOrMissing); 56 } 57 } 58 maker.fInInclude = false; 59 } 60