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" |
11 #include "ui/gfx/size.h" | 11 #include "ui/gfx/size.h" |
12 #include "webkit/glue/webkit_glue_export.h" | |
13 | 12 |
14 #include <vector> | 13 #include <vector> |
15 | 14 |
16 #if defined(OS_WIN) | 15 #if defined(OS_WIN) |
17 typedef struct HINSTANCE__* HINSTANCE; | 16 typedef struct HINSTANCE__* HINSTANCE; |
18 typedef struct HICON__* HICON; | 17 typedef struct HICON__* HICON; |
19 typedef HICON HCURSOR; | 18 typedef HICON HCURSOR; |
20 #elif defined(TOOLKIT_GTK) | 19 #elif defined(TOOLKIT_GTK) |
21 typedef struct _GdkCursor GdkCursor; | 20 typedef struct _GdkCursor GdkCursor; |
22 #elif defined(OS_MACOSX) | 21 #elif defined(OS_MACOSX) |
23 #ifdef __OBJC__ | 22 #ifdef __OBJC__ |
24 @class NSCursor; | 23 @class NSCursor; |
25 #else | 24 #else |
26 class NSCursor; | 25 class NSCursor; |
27 #endif | 26 #endif |
28 #endif | 27 #endif |
29 | 28 |
30 class Pickle; | 29 class Pickle; |
31 class PickleIterator; | 30 class PickleIterator; |
32 | 31 |
33 namespace WebKit { | 32 namespace WebKit { |
34 class WebImage; | 33 class WebImage; |
35 struct WebCursorInfo; | 34 struct WebCursorInfo; |
36 } | 35 } |
37 | 36 |
38 // This class encapsulates a cross-platform description of a cursor. Platform | 37 // This class encapsulates a cross-platform description of a cursor. Platform |
39 // specific methods are provided to translate the cross-platform cursor into a | 38 // specific methods are provided to translate the cross-platform cursor into a |
40 // platform specific cursor. It is also possible to serialize / de-serialize a | 39 // platform specific cursor. It is also possible to serialize / de-serialize a |
41 // WebCursor. | 40 // WebCursor. |
42 class WEBKIT_GLUE_EXPORT WebCursor { | 41 class WebCursor { |
43 public: | 42 public: |
44 WebCursor(); | 43 WebCursor(); |
45 explicit WebCursor(const WebKit::WebCursorInfo& cursor_info); | 44 explicit WebCursor(const WebKit::WebCursorInfo& cursor_info); |
46 ~WebCursor(); | 45 ~WebCursor(); |
47 | 46 |
48 // Copy constructor/assignment operator combine. | 47 // Copy constructor/assignment operator combine. |
49 WebCursor(const WebCursor& other); | 48 WebCursor(const WebCursor& other); |
50 const WebCursor& operator=(const WebCursor& other); | 49 const WebCursor& operator=(const WebCursor& other); |
51 | 50 |
52 // Conversion from/to WebCursorInfo. | 51 // Conversion from/to WebCursorInfo. |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 #elif defined(OS_WIN) | 155 #elif defined(OS_WIN) |
157 // A custom cursor created from custom bitmap data by Webkit. | 156 // A custom cursor created from custom bitmap data by Webkit. |
158 HCURSOR custom_cursor_; | 157 HCURSOR custom_cursor_; |
159 #elif defined(TOOLKIT_GTK) | 158 #elif defined(TOOLKIT_GTK) |
160 // A custom cursor created that should be unref'ed from the destructor. | 159 // A custom cursor created that should be unref'ed from the destructor. |
161 GdkCursor* unref_; | 160 GdkCursor* unref_; |
162 #endif | 161 #endif |
163 }; | 162 }; |
164 | 163 |
165 #endif // WEBKIT_GLUE_WEBCURSOR_H_ | 164 #endif // WEBKIT_GLUE_WEBCURSOR_H_ |
OLD | NEW |