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

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

Issue 9463003: aura-x11: Add custom web cursor support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 10 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
OLDNEW
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 bool IsCustom() const; 63 bool IsCustom() const;
64 64
65 // Returns true if the current cursor object contains the same cursor as the 65 // Returns true if the current cursor object contains the same cursor as the
66 // cursor object passed in. If the current cursor is a custom cursor, we also 66 // cursor object passed in. If the current cursor is a custom cursor, we also
67 // compare the bitmaps to verify whether they are equal. 67 // compare the bitmaps to verify whether they are equal.
68 bool IsEqual(const WebCursor& other) const; 68 bool IsEqual(const WebCursor& other) const;
69 69
70 // Returns a native cursor representing the current WebCursor instance. 70 // Returns a native cursor representing the current WebCursor instance.
71 gfx::NativeCursor GetNativeCursor(); 71 gfx::NativeCursor GetNativeCursor();
72 72
73 #if defined(OS_WIN) && !defined(USE_AURA) 73 #if defined(USE_AURA)
74 const gfx::PlatformCursor& GetPlatformCursor();
75 #elif defined(OS_WIN)
74 // Returns a HCURSOR representing the current WebCursor instance. 76 // Returns a HCURSOR representing the current WebCursor instance.
75 // The ownership of the HCURSOR (does not apply to external cursors) remains 77 // The ownership of the HCURSOR (does not apply to external cursors) remains
76 // with the WebCursor instance. 78 // with the WebCursor instance.
77 HCURSOR GetCursor(HINSTANCE module_handle); 79 HCURSOR GetCursor(HINSTANCE module_handle);
78 80
79 // Initialize this from the given Windows cursor. The caller must ensure that 81 // Initialize this from the given Windows cursor. The caller must ensure that
80 // the HCURSOR remains valid by not invoking the DestroyCursor/DestroyIcon 82 // the HCURSOR remains valid by not invoking the DestroyCursor/DestroyIcon
81 // APIs on it. 83 // APIs on it.
82 void InitFromExternalCursor(HCURSOR handle); 84 void InitFromExternalCursor(HCURSOR handle);
83 85
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // WebCore::PlatformCursor type. 137 // WebCore::PlatformCursor type.
136 int type_; 138 int type_;
137 139
138 gfx::Point hotspot_; 140 gfx::Point hotspot_;
139 141
140 // Custom cursor data, as 32-bit RGBA. 142 // Custom cursor data, as 32-bit RGBA.
141 // Platform-inspecific because it can be serialized. 143 // Platform-inspecific because it can be serialized.
142 gfx::Size custom_size_; 144 gfx::Size custom_size_;
143 std::vector<char> custom_data_; 145 std::vector<char> custom_data_;
144 146
145 #if defined(OS_WIN) 147 #if defined(USE_AURA) && defined(USE_X11)
148 typedef struct _XcursorImage XcursorImage;
darin (slow to review) 2012/02/24 06:32:35 nit: indentation nit: usually forward declaration
sadrul 2012/02/24 17:38:19 Moved the typedef at the top.
149
150 // Only used for custom cursors.
151 gfx::PlatformCursor platform_cursor_;
152 XcursorImage* image_;
153 #elif defined(OS_WIN)
146 // An externally generated HCURSOR. We assume that it remains valid, i.e we 154 // An externally generated HCURSOR. We assume that it remains valid, i.e we
147 // don't attempt to copy the HCURSOR. 155 // don't attempt to copy the HCURSOR.
148 HCURSOR external_cursor_; 156 HCURSOR external_cursor_;
149 // A custom cursor created from custom bitmap data by Webkit. 157 // A custom cursor created from custom bitmap data by Webkit.
150 HCURSOR custom_cursor_; 158 HCURSOR custom_cursor_;
151 #elif defined(TOOLKIT_USES_GTK) 159 #elif defined(TOOLKIT_USES_GTK)
152 // 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.
153 GdkCursor* unref_; 161 GdkCursor* unref_;
154 #endif 162 #endif
155 }; 163 };
156 164
157 #endif // WEBKIT_GLUE_WEBCURSOR_H_ 165 #endif // WEBKIT_GLUE_WEBCURSOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698