OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_OZONE_PLATFORM_DRI_DRI_CURSOR_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRI_DRI_CURSOR_H_ |
6 #define UI_OZONE_PLATFORM_DRI_DRI_CURSOR_H_ | 6 #define UI_OZONE_PLATFORM_DRI_DRI_CURSOR_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "ui/base/cursor/cursor.h" | 9 #include "ui/base/cursor/cursor.h" |
10 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" | 10 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" |
11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
12 | 12 |
13 namespace gfx { | 13 namespace gfx { |
14 class PointF; | 14 class PointF; |
15 class Vector2dF; | 15 class Vector2dF; |
16 } | 16 } |
17 | 17 |
18 namespace ui { | 18 namespace ui { |
19 | 19 |
20 class BitmapCursorOzone; | 20 class BitmapCursorOzone; |
21 class BitmapCursorFactoryOzone; | 21 class BitmapCursorFactoryOzone; |
22 class HardwareCursorDelegate; | 22 class HardwareCursorDelegate; |
23 | 23 |
24 class DriCursor : public CursorDelegateEvdev { | 24 class DriCursor : public CursorDelegateEvdev { |
25 public: | 25 public: |
26 explicit DriCursor(HardwareCursorDelegate* hardware); | 26 explicit DriCursor(HardwareCursorDelegate* hardware); |
27 virtual ~DriCursor(); | 27 virtual ~DriCursor(); |
28 | 28 |
29 void SetCursor(gfx::AcceleratedWidget widget, PlatformCursor platform_cursor); | 29 void SetCursor(gfx::AcceleratedWidget widget, PlatformCursor platform_cursor); |
| 30 void ShowCursor(); |
| 31 void HideCursor(); |
30 gfx::AcceleratedWidget GetCursorWindow(); | 32 gfx::AcceleratedWidget GetCursorWindow(); |
31 | 33 |
32 // CursorDelegateEvdev: | 34 // CursorDelegateEvdev: |
33 virtual void MoveCursorTo(gfx::AcceleratedWidget widget, | 35 virtual void MoveCursorTo(gfx::AcceleratedWidget widget, |
34 const gfx::PointF& location) OVERRIDE; | 36 const gfx::PointF& location) OVERRIDE; |
35 virtual void MoveCursor(const gfx::Vector2dF& delta) OVERRIDE; | 37 virtual void MoveCursor(const gfx::Vector2dF& delta) OVERRIDE; |
36 virtual bool IsCursorVisible() OVERRIDE; | 38 virtual bool IsCursorVisible() OVERRIDE; |
37 virtual gfx::PointF location() OVERRIDE; | 39 virtual gfx::PointF location() OVERRIDE; |
38 | 40 |
39 private: | 41 private: |
40 void UnsetCursor(gfx::AcceleratedWidget widget); | |
41 | |
42 // The location of the bitmap (the cursor location is the hotspot location). | 42 // The location of the bitmap (the cursor location is the hotspot location). |
43 gfx::Point bitmap_location(); | 43 gfx::Point bitmap_location(); |
44 | 44 |
45 // The DRI implementation for setting the hardware cursor. | 45 // The DRI implementation for setting the hardware cursor. |
46 HardwareCursorDelegate* hardware_; | 46 HardwareCursorDelegate* hardware_; |
47 | 47 |
48 // The current cursor bitmap. | 48 // The current cursor bitmap. |
49 scoped_refptr<BitmapCursorOzone> cursor_; | 49 scoped_refptr<BitmapCursorOzone> cursor_; |
50 | 50 |
51 // The window under the cursor. | 51 // The window under the cursor. |
52 gfx::AcceleratedWidget cursor_window_; | 52 gfx::AcceleratedWidget cursor_window_; |
53 | 53 |
54 // The location of the cursor within the window. | 54 // The location of the cursor within the window. |
55 gfx::PointF cursor_location_; | 55 gfx::PointF cursor_location_; |
56 }; | 56 }; |
57 | 57 |
58 } // namespace ui | 58 } // namespace ui |
59 | 59 |
60 #endif // UI_OZONE_PLATFORM_DRI_DRI_CURSOR_H_ | 60 #endif // UI_OZONE_PLATFORM_DRI_DRI_CURSOR_H_ |
OLD | NEW |