OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_GLUE_WEBCURSOR_H_ | 5 #ifndef WEBKIT_GLUE_WEBCURSOR_H_ |
6 #define WEBKIT_GLUE_WEBCURSOR_H_ | 6 #define WEBKIT_GLUE_WEBCURSOR_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "gfx/point.h" | 9 #include "gfx/point.h" |
10 #include "gfx/size.h" | 10 #include "gfx/size.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 // Copies platform specific data from the WebCursor instance passed in. | 121 // Copies platform specific data from the WebCursor instance passed in. |
122 void CopyPlatformData(const WebCursor& other); | 122 void CopyPlatformData(const WebCursor& other); |
123 | 123 |
124 // Platform specific cleanup. | 124 // Platform specific cleanup. |
125 void CleanupPlatformData(); | 125 void CleanupPlatformData(); |
126 | 126 |
127 void SetCustomData(const WebKit::WebImage& image); | 127 void SetCustomData(const WebKit::WebImage& image); |
128 void ImageFromCustomData(WebKit::WebImage* image) const; | 128 void ImageFromCustomData(WebKit::WebImage* image) const; |
129 | 129 |
| 130 // Clamp the hotspot to the custom image's bounds, if this is a custom cursor. |
| 131 void ClampHotspot(); |
| 132 |
130 // WebCore::PlatformCursor type. | 133 // WebCore::PlatformCursor type. |
131 int type_; | 134 int type_; |
132 | 135 |
133 gfx::Point hotspot_; | 136 gfx::Point hotspot_; |
134 | 137 |
135 // Custom cursor data, as 32-bit RGBA. | 138 // Custom cursor data, as 32-bit RGBA. |
136 // Platform-inspecific because it can be serialized. | 139 // Platform-inspecific because it can be serialized. |
137 gfx::Size custom_size_; | 140 gfx::Size custom_size_; |
138 std::vector<char> custom_data_; | 141 std::vector<char> custom_data_; |
139 | 142 |
140 #if defined(OS_WIN) | 143 #if defined(OS_WIN) |
141 // An externally generated HCURSOR. We assume that it remains valid, i.e we | 144 // An externally generated HCURSOR. We assume that it remains valid, i.e we |
142 // don't attempt to copy the HCURSOR. | 145 // don't attempt to copy the HCURSOR. |
143 HCURSOR external_cursor_; | 146 HCURSOR external_cursor_; |
144 // A custom cursor created from custom bitmap data by Webkit. | 147 // A custom cursor created from custom bitmap data by Webkit. |
145 HCURSOR custom_cursor_; | 148 HCURSOR custom_cursor_; |
146 #endif // OS_WIN | 149 #endif // OS_WIN |
147 }; | 150 }; |
148 | 151 |
149 #endif // WEBKIT_GLUE_WEBCURSOR_H_ | 152 #endif // WEBKIT_GLUE_WEBCURSOR_H_ |
OLD | NEW |