| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 supportedAttributes.add(SVGNames::interceptAttr); | 73 supportedAttributes.add(SVGNames::interceptAttr); |
| 74 supportedAttributes.add(SVGNames::amplitudeAttr); | 74 supportedAttributes.add(SVGNames::amplitudeAttr); |
| 75 supportedAttributes.add(SVGNames::exponentAttr); | 75 supportedAttributes.add(SVGNames::exponentAttr); |
| 76 supportedAttributes.add(SVGNames::offsetAttr); | 76 supportedAttributes.add(SVGNames::offsetAttr); |
| 77 } | 77 } |
| 78 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 78 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void SVGComponentTransferFunctionElement::parseAttribute(const QualifiedName& na
me, const AtomicString& value) | 81 void SVGComponentTransferFunctionElement::parseAttribute(const QualifiedName& na
me, const AtomicString& value) |
| 82 { | 82 { |
| 83 if (!isSupportedAttribute(name)) { | 83 parseAttributeNew(name, value); |
| 84 SVGElement::parseAttribute(name, value); | |
| 85 return; | |
| 86 } | |
| 87 | |
| 88 SVGParsingError parseError = NoError; | |
| 89 | |
| 90 if (name == SVGNames::tableValuesAttr) | |
| 91 m_tableValues->setBaseValueAsString(value, parseError); | |
| 92 else if (name == SVGNames::typeAttr) | |
| 93 m_type->setBaseValueAsString(value, parseError); | |
| 94 else if (name == SVGNames::slopeAttr) | |
| 95 m_slope->setBaseValueAsString(value, parseError); | |
| 96 else if (name == SVGNames::interceptAttr) | |
| 97 m_intercept->setBaseValueAsString(value, parseError); | |
| 98 else if (name == SVGNames::amplitudeAttr) | |
| 99 m_amplitude->setBaseValueAsString(value, parseError); | |
| 100 else if (name == SVGNames::exponentAttr) | |
| 101 m_exponent->setBaseValueAsString(value, parseError); | |
| 102 else if (name == SVGNames::offsetAttr) | |
| 103 m_offset->setBaseValueAsString(value, parseError); | |
| 104 | |
| 105 reportAttributeParsingError(parseError, name, value); | |
| 106 } | 84 } |
| 107 | 85 |
| 108 void SVGComponentTransferFunctionElement::svgAttributeChanged(const QualifiedNam
e& attrName) | 86 void SVGComponentTransferFunctionElement::svgAttributeChanged(const QualifiedNam
e& attrName) |
| 109 { | 87 { |
| 110 if (!isSupportedAttribute(attrName)) { | 88 if (!isSupportedAttribute(attrName)) { |
| 111 SVGElement::svgAttributeChanged(attrName); | 89 SVGElement::svgAttributeChanged(attrName); |
| 112 return; | 90 return; |
| 113 } | 91 } |
| 114 | 92 |
| 115 SVGElement::InvalidationGuard invalidationGuard(this); | 93 SVGElement::InvalidationGuard invalidationGuard(this); |
| 116 | 94 |
| 117 invalidateFilterPrimitiveParent(this); | 95 invalidateFilterPrimitiveParent(this); |
| 118 } | 96 } |
| 119 | 97 |
| 120 ComponentTransferFunction SVGComponentTransferFunctionElement::transferFunction(
) const | 98 ComponentTransferFunction SVGComponentTransferFunctionElement::transferFunction(
) const |
| 121 { | 99 { |
| 122 ComponentTransferFunction func; | 100 ComponentTransferFunction func; |
| 123 func.type = m_type->currentValue()->enumValue(); | 101 func.type = m_type->currentValue()->enumValue(); |
| 124 func.slope = m_slope->currentValue()->value(); | 102 func.slope = m_slope->currentValue()->value(); |
| 125 func.intercept = m_intercept->currentValue()->value(); | 103 func.intercept = m_intercept->currentValue()->value(); |
| 126 func.amplitude = m_amplitude->currentValue()->value(); | 104 func.amplitude = m_amplitude->currentValue()->value(); |
| 127 func.exponent = m_exponent->currentValue()->value(); | 105 func.exponent = m_exponent->currentValue()->value(); |
| 128 func.offset = m_offset->currentValue()->value(); | 106 func.offset = m_offset->currentValue()->value(); |
| 129 func.tableValues = m_tableValues->currentValue()->toFloatVector(); | 107 func.tableValues = m_tableValues->currentValue()->toFloatVector(); |
| 130 return func; | 108 return func; |
| 131 } | 109 } |
| 132 | 110 |
| 133 } | 111 } |
| OLD | NEW |