2 Copyright (C) 2004 Nikolas Zimmermann <wildfox@kde.org>
3 2004 Rob Buis <buis@kde.org>
5 This file is part of the KDE project
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.
24 #include <kdom/Shared.h>
26 #include "CSSHelper.h"
27 #include "RGBColorImpl.h"
28 #include "CSSPrimitiveValue.h"
29 #include "CSSPrimitiveValueImpl.h"
31 #include "kdom/data/CSSConstants.h"
32 #include "RGBColor.lut.h"
38 @begin RGBColor::s_hashTable 5
39 red RGBColorConstants::Red DontDelete|ReadOnly
40 green RGBColorConstants::Green DontDelete|ReadOnly
41 blue RGBColorConstants::Blue DontDelete|ReadOnly
45 Value RGBColor::getValueProperty(ExecState *exec, int token) const
49 case RGBColorConstants::Red:
50 return safe_cache<CSSPrimitiveValue>(exec, red());
51 case RGBColorConstants::Blue:
52 return safe_cache<CSSPrimitiveValue>(exec, blue());
53 case RGBColorConstants::Green:
54 return safe_cache<CSSPrimitiveValue>(exec, green());
56 kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
62 RGBColor RGBColor::null;
64 RGBColor::RGBColor() : d(0)
68 RGBColor::RGBColor(RGBColorImpl *i) : d(i)
74 RGBColor::RGBColor(const RGBColor &other) : d(0)
79 KDOM_IMPL_DTOR_ASSIGN_OP(RGBColor)
81 CSSPrimitiveValue RGBColor::red() const
84 return CSSPrimitiveValue::null;
86 return CSSPrimitiveValue(d->red());
89 CSSPrimitiveValue RGBColor::green() const
92 return CSSPrimitiveValue::null;
94 return CSSPrimitiveValue(d->green());
97 CSSPrimitiveValue RGBColor::blue() const
100 return CSSPrimitiveValue::null;
102 return CSSPrimitiveValue(d->blue());