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

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

Issue 10697082: aura: Scale custom cursors appropriately. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(USE_AURA) 74 #if defined(USE_AURA)
75 const ui::PlatformCursor GetPlatformCursor(); 75 const ui::PlatformCursor GetPlatformCursor();
76
77 void SetScaleFactor(float scale_factor);
76 #elif defined(OS_WIN) 78 #elif defined(OS_WIN)
77 // Returns a HCURSOR representing the current WebCursor instance. 79 // Returns a HCURSOR representing the current WebCursor instance.
78 // The ownership of the HCURSOR (does not apply to external cursors) remains 80 // The ownership of the HCURSOR (does not apply to external cursors) remains
79 // with the WebCursor instance. 81 // with the WebCursor instance.
80 HCURSOR GetCursor(HINSTANCE module_handle); 82 HCURSOR GetCursor(HINSTANCE module_handle);
81 83
82 // Initialize this from the given Windows cursor. The caller must ensure that 84 // Initialize this from the given Windows cursor. The caller must ensure that
83 // the HCURSOR remains valid by not invoking the DestroyCursor/DestroyIcon 85 // the HCURSOR remains valid by not invoking the DestroyCursor/DestroyIcon
84 // APIs on it. 86 // APIs on it.
85 void InitFromExternalCursor(HCURSOR handle); 87 void InitFromExternalCursor(HCURSOR handle);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 gfx::Point hotspot_; 143 gfx::Point hotspot_;
142 144
143 // Custom cursor data, as 32-bit RGBA. 145 // Custom cursor data, as 32-bit RGBA.
144 // Platform-inspecific because it can be serialized. 146 // Platform-inspecific because it can be serialized.
145 gfx::Size custom_size_; 147 gfx::Size custom_size_;
146 std::vector<char> custom_data_; 148 std::vector<char> custom_data_;
147 149
148 #if defined(USE_AURA) && defined(USE_X11) 150 #if defined(USE_AURA) && defined(USE_X11)
149 // Only used for custom cursors. 151 // Only used for custom cursors.
150 ui::PlatformCursor platform_cursor_; 152 ui::PlatformCursor platform_cursor_;
153 float scale_factor_;
151 #elif defined(OS_WIN) 154 #elif defined(OS_WIN)
152 // An externally generated HCURSOR. We assume that it remains valid, i.e we 155 // An externally generated HCURSOR. We assume that it remains valid, i.e we
153 // don't attempt to copy the HCURSOR. 156 // don't attempt to copy the HCURSOR.
154 HCURSOR external_cursor_; 157 HCURSOR external_cursor_;
155 // A custom cursor created from custom bitmap data by Webkit. 158 // A custom cursor created from custom bitmap data by Webkit.
156 HCURSOR custom_cursor_; 159 HCURSOR custom_cursor_;
157 #elif defined(TOOLKIT_GTK) 160 #elif defined(TOOLKIT_GTK)
158 // A custom cursor created that should be unref'ed from the destructor. 161 // A custom cursor created that should be unref'ed from the destructor.
159 GdkCursor* unref_; 162 GdkCursor* unref_;
160 #endif 163 #endif
161 }; 164 };
162 165
163 #endif // WEBKIT_GLUE_WEBCURSOR_H_ 166 #endif // WEBKIT_GLUE_WEBCURSOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698