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" | 12 #include "webkit/glue/webkit_glue_export.h" |
13 | 13 |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #if defined(OS_WIN) | 16 #if defined(OS_WIN) |
17 typedef struct HINSTANCE__* HINSTANCE; | 17 typedef struct HINSTANCE__* HINSTANCE; |
18 typedef struct HICON__* HICON; | 18 typedef struct HICON__* HICON; |
19 typedef HICON HCURSOR; | 19 typedef HICON HCURSOR; |
20 #elif defined(TOOLKIT_GTK) | 20 #elif defined(TOOLKIT_GTK) |
21 typedef struct _GdkCursor GdkCursor; | 21 typedef struct _GdkCursor GdkCursor; |
22 #elif defined(OS_MACOSX) | 22 #elif defined(OS_MACOSX) |
23 #ifdef __OBJC__ | 23 #ifdef __OBJC__ |
24 @class NSCursor; | 24 @class NSCursor; |
25 #else | 25 #else |
26 class NSCursor; | 26 class NSCursor; |
27 #endif | 27 #endif |
28 typedef UInt32 ThemeCursor; | |
29 typedef struct Cursor Cursor; | |
30 #endif | 28 #endif |
31 | 29 |
32 class Pickle; | 30 class Pickle; |
33 class PickleIterator; | 31 class PickleIterator; |
34 | 32 |
35 namespace WebKit { | 33 namespace WebKit { |
36 class WebImage; | 34 class WebImage; |
37 struct WebCursorInfo; | 35 struct WebCursorInfo; |
38 } | 36 } |
39 | 37 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // Return the stock GdkCursorType for this cursor, or GDK_CURSOR_IS_PIXMAP | 90 // Return the stock GdkCursorType for this cursor, or GDK_CURSOR_IS_PIXMAP |
93 // if it's a custom cursor. Return GDK_LAST_CURSOR to indicate that the cursor | 91 // if it's a custom cursor. Return GDK_LAST_CURSOR to indicate that the cursor |
94 // should be set to the system default. | 92 // should be set to the system default. |
95 // Returns an int so we don't need to include GDK headers in this header file. | 93 // Returns an int so we don't need to include GDK headers in this header file. |
96 int GetCursorType() const; | 94 int GetCursorType() const; |
97 | 95 |
98 // Return a new GdkCursor* for this cursor. Only valid if GetCursorType | 96 // Return a new GdkCursor* for this cursor. Only valid if GetCursorType |
99 // returns GDK_CURSOR_IS_PIXMAP. | 97 // returns GDK_CURSOR_IS_PIXMAP. |
100 GdkCursor* GetCustomCursor(); | 98 GdkCursor* GetCustomCursor(); |
101 #elif defined(OS_MACOSX) | 99 #elif defined(OS_MACOSX) |
102 // Initialize this from the given Carbon ThemeCursor. | |
103 void InitFromThemeCursor(ThemeCursor cursor); | |
104 | |
105 // Initialize this from the given Carbon Cursor. | |
106 void InitFromCursor(const Cursor* cursor); | |
107 | |
108 // Initialize this from the given Cocoa NSCursor. | 100 // Initialize this from the given Cocoa NSCursor. |
109 void InitFromNSCursor(NSCursor* cursor); | 101 void InitFromNSCursor(NSCursor* cursor); |
110 #endif | 102 #endif |
111 | 103 |
112 private: | 104 private: |
113 // Copies the contents of the WebCursor instance passed in. | 105 // Copies the contents of the WebCursor instance passed in. |
114 void Copy(const WebCursor& other); | 106 void Copy(const WebCursor& other); |
115 | 107 |
116 // Cleans up the WebCursor instance. | 108 // Cleans up the WebCursor instance. |
117 void Clear(); | 109 void Clear(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 #elif defined(OS_WIN) | 154 #elif defined(OS_WIN) |
163 // A custom cursor created from custom bitmap data by Webkit. | 155 // A custom cursor created from custom bitmap data by Webkit. |
164 HCURSOR custom_cursor_; | 156 HCURSOR custom_cursor_; |
165 #elif defined(TOOLKIT_GTK) | 157 #elif defined(TOOLKIT_GTK) |
166 // A custom cursor created that should be unref'ed from the destructor. | 158 // A custom cursor created that should be unref'ed from the destructor. |
167 GdkCursor* unref_; | 159 GdkCursor* unref_; |
168 #endif | 160 #endif |
169 }; | 161 }; |
170 | 162 |
171 #endif // WEBKIT_GLUE_WEBCURSOR_H_ | 163 #endif // WEBKIT_GLUE_WEBCURSOR_H_ |
OLD | NEW |