OLD | NEW |
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 UI_BASE_CURSOR_CURSOR_LOADER_H_ | 5 #ifndef UI_BASE_CURSOR_CURSOR_LOADER_H_ |
6 #define UI_BASE_CURSOR_CURSOR_LOADER_H_ | 6 #define UI_BASE_CURSOR_CURSOR_LOADER_H_ |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 float scale() const { | 30 float scale() const { |
31 return scale_; | 31 return scale_; |
32 } | 32 } |
33 | 33 |
34 // Sets the scale of the mouse cursor icon. | 34 // Sets the scale of the mouse cursor icon. |
35 void set_scale(const float scale) { | 35 void set_scale(const float scale) { |
36 scale_ = scale; | 36 scale_ = scale; |
37 } | 37 } |
38 | 38 |
39 // Creates a cursor from an image resource and puts it in the cursor map. | 39 // Creates a cursor from an image resource and puts it in the cursor map. |
40 virtual void LoadImageCursor(int id, | 40 virtual void LoadImageCursor(CursorType id, |
41 int resource_id, | 41 int resource_id, |
42 const gfx::Point& hot) = 0; | 42 const gfx::Point& hot) = 0; |
43 | 43 |
44 // Creates an animated cursor from an image resource and puts it in the | 44 // Creates an animated cursor from an image resource and puts it in the |
45 // cursor map. The image is assumed to be a concatenation of animation frames | 45 // cursor map. The image is assumed to be a concatenation of animation frames |
46 // from left to right. Also, each frame is assumed to be square | 46 // from left to right. Also, each frame is assumed to be square |
47 // (width == height). | 47 // (width == height). |
48 // |frame_delay_ms| is the delay between frames in millisecond. | 48 // |frame_delay_ms| is the delay between frames in millisecond. |
49 virtual void LoadAnimatedCursor(int id, | 49 virtual void LoadAnimatedCursor(CursorType id, |
50 int resource_id, | 50 int resource_id, |
51 const gfx::Point& hot, | 51 const gfx::Point& hot, |
52 int frame_delay_ms) = 0; | 52 int frame_delay_ms) = 0; |
53 | 53 |
54 // Unloads all the cursors. | 54 // Unloads all the cursors. |
55 virtual void UnloadAll() = 0; | 55 virtual void UnloadAll() = 0; |
56 | 56 |
57 // Sets the platform cursor based on the native type of |cursor|. | 57 // Sets the platform cursor based on the native type of |cursor|. |
58 virtual void SetPlatformCursor(gfx::NativeCursor* cursor) = 0; | 58 virtual void SetPlatformCursor(gfx::NativeCursor* cursor) = 0; |
59 | 59 |
60 // Creates a CursorLoader. | 60 // Creates a CursorLoader. |
61 static CursorLoader* Create(); | 61 static CursorLoader* Create(); |
62 | 62 |
63 private: | 63 private: |
64 // The current scale of the mouse cursor icon. | 64 // The current scale of the mouse cursor icon. |
65 float scale_; | 65 float scale_; |
66 | 66 |
67 // The current rotation of the mouse cursor icon. | 67 // The current rotation of the mouse cursor icon. |
68 display::Display::Rotation rotation_; | 68 display::Display::Rotation rotation_; |
69 | 69 |
70 DISALLOW_COPY_AND_ASSIGN(CursorLoader); | 70 DISALLOW_COPY_AND_ASSIGN(CursorLoader); |
71 }; | 71 }; |
72 | 72 |
73 } // namespace ui | 73 } // namespace ui |
74 | 74 |
75 #endif // UI_BASE_CURSOR_CURSOR_LOADER_H_ | 75 #endif // UI_BASE_CURSOR_CURSOR_LOADER_H_ |
OLD | NEW |