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

Side by Side Diff: webkit/glue/webcursor.h

Issue 155172: Start using WebCursorInfo from the WebKit API. WebCursorInfo is a... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « webkit/glue/plugins/webplugin_delegate_impl_mac.mm ('k') | webkit/glue/webcursor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/gfx/point.h" 9 #include "base/gfx/point.h"
10 #include "base/gfx/size.h" 10 #include "base/gfx/size.h"
(...skipping 12 matching lines...) Expand all
23 #elif defined(OS_MACOSX) 23 #elif defined(OS_MACOSX)
24 #ifdef __OBJC__ 24 #ifdef __OBJC__
25 @class NSCursor; 25 @class NSCursor;
26 #else 26 #else
27 class NSCursor; 27 class NSCursor;
28 #endif 28 #endif
29 #endif 29 #endif
30 30
31 class Pickle; 31 class Pickle;
32 32
33 namespace WebCore { 33 namespace WebKit {
34 class Image; 34 class WebImage;
35 class PlatformCursor; 35 struct WebCursorInfo;
36 } 36 }
37 37
38 // This class encapsulates a cross-platform description of a cursor. Platform 38 // This class encapsulates a cross-platform description of a cursor. Platform
39 // specific methods are provided to translate the cross-platform cursor into a 39 // 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 40 // platform specific cursor. It is also possible to serialize / de-serialize a
41 // WebCursor. 41 // WebCursor.
42 class WebCursor { 42 class WebCursor {
43 public: 43 public:
44 WebCursor(); 44 WebCursor();
45 explicit WebCursor(const WebCore::PlatformCursor& platform_cursor); 45 explicit WebCursor(const WebKit::WebCursorInfo& cursor_info);
46 ~WebCursor(); 46 ~WebCursor();
47 47
48 // Copy constructor/assignment operator combine. 48 // Copy constructor/assignment operator combine.
49 WebCursor(const WebCursor& other); 49 WebCursor(const WebCursor& other);
50 const WebCursor& operator=(const WebCursor& other); 50 const WebCursor& operator=(const WebCursor& other);
51 51
52 // Conversion from/to WebCursorInfo.
53 void InitFromCursorInfo(const WebKit::WebCursorInfo& cursor_info);
54 void GetCursorInfo(WebKit::WebCursorInfo* cursor_info) const;
55
52 // Serialization / De-serialization 56 // Serialization / De-serialization
53 bool Deserialize(const Pickle* pickle, void** iter); 57 bool Deserialize(const Pickle* pickle, void** iter);
54 bool Serialize(Pickle* pickle) const; 58 bool Serialize(Pickle* pickle) const;
55 59
56 // Returns true if GetCustomCursor should be used to allocate a platform 60 // Returns true if GetCustomCursor should be used to allocate a platform
57 // specific cursor object. Otherwise GetCursor should be used. 61 // specific cursor object. Otherwise GetCursor should be used.
58 bool IsCustom() const; 62 bool IsCustom() const;
59 63
60 // Returns true if the current cursor object contains the same cursor as the 64 // Returns true if the current cursor object contains the same cursor as the
61 // cursor object passed in. If the current cursor is a custom cursor, we also 65 // cursor object passed in. If the current cursor is a custom cursor, we also
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // Returns true if the platform data in the current cursor object 107 // Returns true if the platform data in the current cursor object
104 // matches that of the cursor passed in. 108 // matches that of the cursor passed in.
105 bool IsPlatformDataEqual(const WebCursor& other) const ; 109 bool IsPlatformDataEqual(const WebCursor& other) const ;
106 110
107 // Copies platform specific data from the WebCursor instance passed in. 111 // Copies platform specific data from the WebCursor instance passed in.
108 void CopyPlatformData(const WebCursor& other); 112 void CopyPlatformData(const WebCursor& other);
109 113
110 // Platform specific cleanup. 114 // Platform specific cleanup.
111 void CleanupPlatformData(); 115 void CleanupPlatformData();
112 116
113 void SetCustomData(WebCore::Image* image); 117 void SetCustomData(const WebKit::WebImage& image);
118 void ImageFromCustomData(WebKit::WebImage* image) const;
114 119
115 // WebCore::PlatformCursor type. 120 // WebCore::PlatformCursor type.
116 int type_; 121 int type_;
117 122
118 gfx::Point hotspot_; 123 gfx::Point hotspot_;
119 124
120 // Custom cursor data, as 32-bit RGBA. 125 // Custom cursor data, as 32-bit RGBA.
121 // Platform-inspecific because it can be serialized. 126 // Platform-inspecific because it can be serialized.
122 gfx::Size custom_size_; 127 gfx::Size custom_size_;
123 std::vector<char> custom_data_; 128 std::vector<char> custom_data_;
124 129
125 #if defined(OS_WIN) 130 #if defined(OS_WIN)
126 // An externally generated HCURSOR. We assume that it remains valid, i.e we 131 // An externally generated HCURSOR. We assume that it remains valid, i.e we
127 // don't attempt to copy the HCURSOR. 132 // don't attempt to copy the HCURSOR.
128 HCURSOR external_cursor_; 133 HCURSOR external_cursor_;
129 // A custom cursor created from custom bitmap data by Webkit. 134 // A custom cursor created from custom bitmap data by Webkit.
130 HCURSOR custom_cursor_; 135 HCURSOR custom_cursor_;
131 #endif // OS_WIN 136 #endif // OS_WIN
132 }; 137 };
133 138
134 #endif // WEBKIT_GLUE_WEBCURSOR_H_ 139 #endif // WEBKIT_GLUE_WEBCURSOR_H_
OLDNEW
« no previous file with comments | « webkit/glue/plugins/webplugin_delegate_impl_mac.mm ('k') | webkit/glue/webcursor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698