1ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com 2ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com/* 3ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * Copyright 2006 The Android Open Source Project 4ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * 5ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * Use of this source code is governed by a BSD-style license that can be 6ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * found in the LICENSE file. 7ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com */ 8ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com 98a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 108a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkDisplayInclude.h" 118a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkAnimateMaker.h" 128a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkAnimator.h" 138a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 148a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#if SK_USE_CONDENSED_INFO == 0 158a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 168a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comconst SkMemberInfo SkInclude::fInfo[] = { 178a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com SK_MEMBER(src, String) 188a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com}; 198a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 208a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#endif 218a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 228a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comDEFINE_GET_MEMBER(SkInclude); 238a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 248a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com//SkInclude::SkInclude() { 258a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com// src.init(); 268a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com//} 278a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 288a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com//SkInclude::~SkInclude() { 298a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com// src.unref(); 308a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com//} 318a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 328a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.combool SkInclude::enable(SkAnimateMaker & ) { 338a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com return true; 348a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com} 358a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 368a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.combool SkInclude::hasEnable() const { 378a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com return true; 388a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com} 398a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 408a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comvoid SkInclude::onEndElement(SkAnimateMaker& maker) { 418a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com maker.fInInclude = true; 428a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com if (src.size() == 0 || maker.decodeURI(src.c_str()) == false) { 438a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com if (maker.getErrorCode() != SkXMLParserError::kNoError || maker.getNativeCode() != -1) { 448a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com maker.setInnerError(&maker, src); 458a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com maker.setErrorCode(SkDisplayXMLParserError::kInInclude); 468a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com } else { 478a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com maker.setErrorNoun(src); 488a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com maker.setErrorCode(SkDisplayXMLParserError::kIncludeNameUnknownOrMissing); 498a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com } 508a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com } 518a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com maker.fInInclude = false; 528a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com} 53