OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2006 Rob Buis <buis@kde.org> |
3 * Copyright (C) 2008 Apple Inc. All right reserved. | 3 * Copyright (C) 2008 Apple Inc. All right reserved. |
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, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
19 */ | 19 */ |
20 | 20 |
21 #ifndef CSSCursorImageValue_h | 21 #ifndef CSSCursorImageValue_h |
22 #define CSSCursorImageValue_h | 22 #define CSSCursorImageValue_h |
23 | 23 |
24 #include "core/css/CSSImageValue.h" | 24 #include "core/css/CSSValue.h" |
25 #include "core/svg/SVGCursorElement.h" | |
26 #include "platform/geometry/IntPoint.h" | 25 #include "platform/geometry/IntPoint.h" |
27 #include "wtf/HashSet.h" | |
28 | 26 |
29 namespace blink { | 27 namespace blink { |
30 | 28 |
31 class Element; | |
32 | |
33 class CSSCursorImageValue : public CSSValue { | 29 class CSSCursorImageValue : public CSSValue { |
34 public: | 30 public: |
35 static const CSSCursorImageValue* create(CSSValue* imageValue, | 31 static const CSSCursorImageValue* create(const CSSValue& imageValue, |
36 bool hotSpotSpecified, | 32 bool hotSpotSpecified, |
37 const IntPoint& hotSpot) { | 33 const IntPoint& hotSpot) { |
38 return new CSSCursorImageValue(imageValue, hotSpotSpecified, hotSpot); | 34 return new CSSCursorImageValue(imageValue, hotSpotSpecified, hotSpot); |
39 } | 35 } |
40 | 36 |
41 ~CSSCursorImageValue(); | 37 ~CSSCursorImageValue(); |
42 | 38 |
43 bool hotSpotSpecified() const { return m_hotSpotSpecified; } | 39 bool hotSpotSpecified() const { return m_hotSpotSpecified; } |
44 | 40 const IntPoint& hotSpot() const { return m_hotSpot; } |
45 IntPoint hotSpot() const { return m_hotSpot; } | 41 const CSSValue& imageValue() const { return *m_imageValue; } |
46 | 42 |
47 String customCSSText() const; | 43 String customCSSText() const; |
48 | 44 |
49 SVGCursorElement* getSVGCursorElement(Element*) const; | |
50 | |
51 void clearImageResource() const; | |
52 bool isCachePending(float deviceScaleFactor) const; | |
53 String cachedImageURL() const; | |
54 StyleImage* cachedImage(float deviceScaleFactor) const; | |
55 StyleImage* cacheImage(const Document&, float deviceScaleFactor); | |
56 | |
57 bool equals(const CSSCursorImageValue&) const; | 45 bool equals(const CSSCursorImageValue&) const; |
58 | 46 |
59 DECLARE_TRACE_AFTER_DISPATCH(); | 47 DECLARE_TRACE_AFTER_DISPATCH(); |
60 | 48 |
61 private: | 49 private: |
62 CSSCursorImageValue(CSSValue* imageValue, | 50 CSSCursorImageValue(const CSSValue& imageValue, |
63 bool hotSpotSpecified, | 51 bool hotSpotSpecified, |
64 const IntPoint& hotSpot); | 52 const IntPoint& hotSpot); |
65 | 53 |
66 bool hasFragmentInURL() const; | 54 Member<const CSSValue> m_imageValue; |
67 | 55 IntPoint m_hotSpot; |
68 Member<CSSValue> m_imageValue; | |
69 | |
70 bool m_hotSpotSpecified; | 56 bool m_hotSpotSpecified; |
71 IntPoint m_hotSpot; | |
72 mutable bool m_isCachePending; | |
73 mutable Member<StyleImage> m_cachedImage; | |
74 }; | 57 }; |
75 | 58 |
76 DEFINE_CSS_VALUE_TYPE_CASTS(CSSCursorImageValue, isCursorImageValue()); | 59 DEFINE_CSS_VALUE_TYPE_CASTS(CSSCursorImageValue, isCursorImageValue()); |
77 | 60 |
78 } // namespace blink | 61 } // namespace blink |
79 | 62 |
80 #endif // CSSCursorImageValue_h | 63 #endif // CSSCursorImageValue_h |
OLD | NEW |