OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_BASE_CURSOR_CURSOR_LOADER_H_ | |
6 #define UI_BASE_CURSOR_CURSOR_LOADER_H_ | |
7 | |
8 #include "base/logging.h" | |
9 #include "ui/base/ui_export.h" | |
10 #include "ui/gfx/native_widget_types.h" | |
11 | |
12 namespace ui { | |
13 | |
14 class UI_EXPORT CursorLoader { | |
15 public: | |
16 CursorLoader() : device_scale_factor_(0.0f) {} | |
17 virtual ~CursorLoader() {}; | |
18 | |
19 // Returns the device scale factor used by the loader. | |
20 float device_scale_factor() const { | |
21 return device_scale_factor_; | |
22 } | |
23 | |
24 // Sets the device scale factor used by the loader. | |
25 void set_device_scale_factor(float device_scale_factor) { | |
26 device_scale_factor_ = device_scale_factor; | |
27 } | |
28 | |
29 // Creates a cursor from an image resource and puts it in the cursor map. | |
30 virtual void LoadImageCursor( | |
31 int id, int resource_id, int hot_x, int hot_y) = 0; | |
32 | |
33 // Creates an animated cursor from an image resource and puts it in the | |
34 // cursor map. The image is assumed to be a concatenation of animation frames | |
35 // from left to right. Also, each frame is assumed to be square | |
36 // (width == height). | |
37 // |frame_delay_ms| is the delay between frames in millisecond. | |
38 virtual void LoadAnimatedCursor( | |
39 int id, int resource_id, int hot_x, int hot_y, int frame_delay_ms) = 0; | |
40 | |
41 // Unloads all the cursors. | |
42 virtual void UnloadAll() = 0; | |
43 | |
44 // Sets the platform cursor based on the native type of |cursor|. | |
45 virtual void SetPlatformCursor(gfx::NativeCursor* cursor) = 0; | |
46 | |
47 // Hides the host cursor. | |
48 virtual void HideHostCursor() = 0; | |
Daniel Erat
2012/09/07 04:55:39
Seeing this method in this class is unexpected --
mazda
2012/09/07 19:42:24
Thank you for the suggestion. I moved the function
Daniel Erat
2012/09/07 20:26:07
Thanks, this seems like a better place to me.
| |
49 | |
50 // Creates a CursorLoader. | |
51 static CursorLoader* Create(); | |
52 | |
53 private: | |
54 // The device scale factor used by the loader. | |
55 float device_scale_factor_; | |
56 }; | |
57 | |
58 | |
59 } // namespace ui | |
60 | |
61 #endif // UI_BASE_CURSOR_CURSOR_LOADER_H_ | |
OLD | NEW |