michael@0: michael@0: /* michael@0: * Copyright 2006 The Android Open Source Project michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: michael@0: #include "SkDisplayInput.h" michael@0: michael@0: enum SkInput_Properties { michael@0: SK_PROPERTY(initialized) michael@0: }; michael@0: michael@0: #if SK_USE_CONDENSED_INFO == 0 michael@0: michael@0: const SkMemberInfo SkInput::fInfo[] = { michael@0: SK_MEMBER_ALIAS(float, fFloat, Float), michael@0: SK_MEMBER_PROPERTY(initialized, Boolean), michael@0: SK_MEMBER_ALIAS(int, fInt, Int), michael@0: SK_MEMBER(name, String), michael@0: SK_MEMBER(string, String) michael@0: }; michael@0: michael@0: #endif michael@0: michael@0: DEFINE_GET_MEMBER(SkInput); michael@0: michael@0: SkInput::SkInput() : fInt((int) SK_NaN32), fFloat(SK_ScalarNaN) {} michael@0: michael@0: SkDisplayable* SkInput::contains(const SkString& string) { michael@0: return string.equals(name) ? this : NULL; michael@0: } michael@0: michael@0: bool SkInput::enable(SkAnimateMaker & ) { michael@0: return true; michael@0: } michael@0: michael@0: bool SkInput::getProperty(int index, SkScriptValue* value) const { michael@0: switch (index) { michael@0: case SK_PROPERTY(initialized): michael@0: value->fType = SkType_Boolean; michael@0: value->fOperand.fS32 = fInt != (int) SK_NaN32 || michael@0: SkScalarIsNaN(fFloat) == false || string.size() > 0; michael@0: break; michael@0: default: michael@0: return false; michael@0: } michael@0: return true; michael@0: } michael@0: michael@0: bool SkInput::hasEnable() const { michael@0: return true; michael@0: }