Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(381)

Side by Side Diff: sky/engine/core/css/CSSCursorImageValue.h

Issue 1076623002: Remove our impressive amount of CSS Cursor code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright (C) 2006 Rob Buis <buis@kde.org>
3 * Copyright (C) 2008 Apple Inc. All right reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
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
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21 #ifndef SKY_ENGINE_CORE_CSS_CSSCURSORIMAGEVALUE_H_
22 #define SKY_ENGINE_CORE_CSS_CSSCURSORIMAGEVALUE_H_
23
24 #include "sky/engine/core/css/CSSImageValue.h"
25 #include "sky/engine/platform/geometry/IntPoint.h"
26 #include "sky/engine/wtf/HashSet.h"
27
28 namespace blink {
29
30 class Element;
31
32 class CSSCursorImageValue : public CSSValue {
33 public:
34 static PassRefPtr<CSSCursorImageValue> create(PassRefPtr<CSSValue> imageValu e, bool hasHotSpot, const IntPoint& hotSpot)
35 {
36 return adoptRef(new CSSCursorImageValue(imageValue, hasHotSpot, hotSpot) );
37 }
38
39 ~CSSCursorImageValue();
40
41 bool hasHotSpot() const { return m_hasHotSpot; }
42
43 IntPoint hotSpot() const
44 {
45 if (m_hasHotSpot)
46 return m_hotSpot;
47 return IntPoint(-1, -1);
48 }
49
50 String customCSSText() const;
51
52 StyleImage* cachedImage(ResourceFetcher*, float deviceScaleFactor);
53 StyleImage* cachedOrPendingImage(float deviceScaleFactor);
54
55 bool equals(const CSSCursorImageValue&) const;
56
57 private:
58 CSSCursorImageValue(PassRefPtr<CSSValue> imageValue, bool hasHotSpot, const IntPoint& hotSpot);
59
60 bool isSVGCursor() const;
61 String cachedImageURL();
62 void clearImageResource();
63
64 RefPtr<CSSValue> m_imageValue;
65
66 bool m_hasHotSpot;
67 IntPoint m_hotSpot;
68 RefPtr<StyleImage> m_image;
69 bool m_accessedImage;
70 };
71
72 DEFINE_CSS_VALUE_TYPE_CASTS(CSSCursorImageValue, isCursorImageValue());
73
74 } // namespace blink
75
76 #endif // SKY_ENGINE_CORE_CSS_CSSCURSORIMAGEVALUE_H_
OLDNEW
« no previous file with comments | « sky/engine/core/css/CSSComputedStyleDeclaration.cpp ('k') | sky/engine/core/css/CSSCursorImageValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698