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

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, 8 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 | « ui/views/controls/textfield/native_textfield_views.cc ('k') | webkit/glue/webcursor_aura.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) 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 bool IsCustom() const; 64 bool IsCustom() const;
65 65
66 // Returns true if the current cursor object contains the same cursor as the 66 // Returns true if the current cursor object contains the same cursor as the
67 // cursor object passed in. If the current cursor is a custom cursor, we also 67 // cursor object passed in. If the current cursor is a custom cursor, we also
68 // compare the bitmaps to verify whether they are equal. 68 // compare the bitmaps to verify whether they are equal.
69 bool IsEqual(const WebCursor& other) const; 69 bool IsEqual(const WebCursor& other) const;
70 70
71 // Returns a native cursor representing the current WebCursor instance. 71 // Returns a native cursor representing the current WebCursor instance.
72 gfx::NativeCursor GetNativeCursor(); 72 gfx::NativeCursor GetNativeCursor();
73 73
74 #if defined(OS_WIN) && !defined(USE_AURA) 74 #if defined(USE_AURA)
75 const ui::PlatformCursor GetPlatformCursor();
76 #elif defined(OS_WIN)
75 // Returns a HCURSOR representing the current WebCursor instance. 77 // Returns a HCURSOR representing the current WebCursor instance.
76 // The ownership of the HCURSOR (does not apply to external cursors) remains 78 // The ownership of the HCURSOR (does not apply to external cursors) remains
77 // with the WebCursor instance. 79 // with the WebCursor instance.
78 HCURSOR GetCursor(HINSTANCE module_handle); 80 HCURSOR GetCursor(HINSTANCE module_handle);
79 81
80 // Initialize this from the given Windows cursor. The caller must ensure that 82 // Initialize this from the given Windows cursor. The caller must ensure that
81 // the HCURSOR remains valid by not invoking the DestroyCursor/DestroyIcon 83 // the HCURSOR remains valid by not invoking the DestroyCursor/DestroyIcon
82 // APIs on it. 84 // APIs on it.
83 void InitFromExternalCursor(HCURSOR handle); 85 void InitFromExternalCursor(HCURSOR handle);
84 86
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // WebCore::PlatformCursor type. 138 // WebCore::PlatformCursor type.
137 int type_; 139 int type_;
138 140
139 gfx::Point hotspot_; 141 gfx::Point hotspot_;
140 142
141 // Custom cursor data, as 32-bit RGBA. 143 // Custom cursor data, as 32-bit RGBA.
142 // Platform-inspecific because it can be serialized. 144 // Platform-inspecific because it can be serialized.
143 gfx::Size custom_size_; 145 gfx::Size custom_size_;
144 std::vector<char> custom_data_; 146 std::vector<char> custom_data_;
145 147
146 #if defined(OS_WIN) 148 #if defined(USE_AURA) && defined(USE_X11)
149 // Only used for custom cursors.
150 ui::PlatformCursor platform_cursor_;
151 #elif defined(OS_WIN)
147 // An externally generated HCURSOR. We assume that it remains valid, i.e we 152 // An externally generated HCURSOR. We assume that it remains valid, i.e we
148 // don't attempt to copy the HCURSOR. 153 // don't attempt to copy the HCURSOR.
149 HCURSOR external_cursor_; 154 HCURSOR external_cursor_;
150 // A custom cursor created from custom bitmap data by Webkit. 155 // A custom cursor created from custom bitmap data by Webkit.
151 HCURSOR custom_cursor_; 156 HCURSOR custom_cursor_;
152 #elif defined(TOOLKIT_USES_GTK) 157 #elif defined(TOOLKIT_USES_GTK)
153 // 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.
154 GdkCursor* unref_; 159 GdkCursor* unref_;
155 #endif 160 #endif
156 }; 161 };
157 162
158 #endif // WEBKIT_GLUE_WEBCURSOR_H_ 163 #endif // WEBKIT_GLUE_WEBCURSOR_H_
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/native_textfield_views.cc ('k') | webkit/glue/webcursor_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698