OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
10 #include "ui/gfx/point.h" | 10 #include "ui/gfx/point.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 void SetCustomData(const WebKit::WebImage& image); | 128 void SetCustomData(const WebKit::WebImage& image); |
129 void ImageFromCustomData(WebKit::WebImage* image) const; | 129 void ImageFromCustomData(WebKit::WebImage* image) const; |
130 | 130 |
131 // Clamp the hotspot to the custom image's bounds, if this is a custom cursor. | 131 // Clamp the hotspot to the custom image's bounds, if this is a custom cursor. |
132 void ClampHotspot(); | 132 void ClampHotspot(); |
133 | 133 |
134 // WebCore::PlatformCursor type. | 134 // WebCore::PlatformCursor type. |
135 int type_; | 135 int type_; |
136 | 136 |
137 // Hot spot in cursor image in physical image coordinate space. | 137 // Hotspot in cursor image in pixels. |
138 gfx::Point hotspot_; | 138 gfx::Point hotspot_; |
139 | 139 |
140 // Custom cursor data, as 32-bit RGBA. | 140 // Custom cursor data, as 32-bit RGBA. |
141 // Platform-inspecific because it can be serialized. | 141 // Platform-inspecific because it can be serialized. |
142 gfx::Size custom_size_; | 142 gfx::Size custom_size_; // In pixels. |
143 float custom_scale_; | 143 float custom_scale_; |
144 std::vector<char> custom_data_; | 144 std::vector<char> custom_data_; |
145 | 145 |
146 #if defined(OS_WIN) | 146 #if defined(OS_WIN) |
147 // An externally generated HCURSOR. We assume that it remains valid, i.e we | 147 // An externally generated HCURSOR. We assume that it remains valid, i.e we |
148 // don't attempt to copy the HCURSOR. | 148 // don't attempt to copy the HCURSOR. |
149 HCURSOR external_cursor_; | 149 HCURSOR external_cursor_; |
150 #endif | 150 #endif |
151 | 151 |
152 #if defined(USE_AURA) && defined(USE_X11) | 152 #if defined(USE_AURA) && defined(USE_X11) |
153 // Only used for custom cursors. | 153 // Only used for custom cursors. |
154 ui::PlatformCursor platform_cursor_; | 154 ui::PlatformCursor platform_cursor_; |
155 float device_scale_factor_; | 155 float device_scale_factor_; |
156 #elif defined(OS_WIN) | 156 #elif defined(OS_WIN) |
157 // A custom cursor created from custom bitmap data by Webkit. | 157 // A custom cursor created from custom bitmap data by Webkit. |
158 HCURSOR custom_cursor_; | 158 HCURSOR custom_cursor_; |
159 #elif defined(TOOLKIT_GTK) | 159 #elif defined(TOOLKIT_GTK) |
160 // A custom cursor created that should be unref'ed from the destructor. | 160 // A custom cursor created that should be unref'ed from the destructor. |
161 GdkCursor* unref_; | 161 GdkCursor* unref_; |
162 #endif | 162 #endif |
163 }; | 163 }; |
164 | 164 |
165 #endif // WEBKIT_GLUE_WEBCURSOR_H_ | 165 #endif // WEBKIT_GLUE_WEBCURSOR_H_ |
OLD | NEW |