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 DriWindowManager; |
22 class HardwareCursorDelegate; | 23 class HardwareCursorDelegate; |
23 | 24 |
24 class DriCursor : public CursorDelegateEvdev { | 25 class DriCursor : public CursorDelegateEvdev { |
25 public: | 26 public: |
26 explicit DriCursor(HardwareCursorDelegate* hardware); | 27 explicit DriCursor(HardwareCursorDelegate* hardware, |
| 28 DriWindowManager* window_manager); |
27 virtual ~DriCursor(); | 29 virtual ~DriCursor(); |
28 | 30 |
29 void SetCursor(gfx::AcceleratedWidget widget, PlatformCursor platform_cursor); | 31 void SetCursor(gfx::AcceleratedWidget widget, PlatformCursor platform_cursor); |
30 void ShowCursor(); | 32 void ShowCursor(); |
31 void HideCursor(); | 33 void HideCursor(); |
32 gfx::AcceleratedWidget GetCursorWindow(); | 34 gfx::AcceleratedWidget GetCursorWindow(); |
33 | 35 |
34 // CursorDelegateEvdev: | 36 // CursorDelegateEvdev: |
35 virtual void MoveCursorTo(gfx::AcceleratedWidget widget, | 37 virtual void MoveCursorTo(gfx::AcceleratedWidget widget, |
36 const gfx::PointF& location) OVERRIDE; | 38 const gfx::PointF& location) OVERRIDE; |
37 virtual void MoveCursor(const gfx::Vector2dF& delta) OVERRIDE; | 39 virtual void MoveCursor(const gfx::Vector2dF& delta) OVERRIDE; |
38 virtual bool IsCursorVisible() OVERRIDE; | 40 virtual bool IsCursorVisible() OVERRIDE; |
39 virtual gfx::PointF location() OVERRIDE; | 41 virtual gfx::PointF location() OVERRIDE; |
40 | 42 |
41 private: | 43 private: |
42 // The location of the bitmap (the cursor location is the hotspot location). | 44 // The location of the bitmap (the cursor location is the hotspot location). |
43 gfx::Point bitmap_location(); | 45 gfx::Point bitmap_location(); |
44 | 46 |
45 // The DRI implementation for setting the hardware cursor. | 47 // The DRI implementation for setting the hardware cursor. |
46 HardwareCursorDelegate* hardware_; | 48 HardwareCursorDelegate* hardware_; |
47 | 49 |
| 50 DriWindowManager* window_manager_; // Not owned. |
| 51 |
48 // The current cursor bitmap. | 52 // The current cursor bitmap. |
49 scoped_refptr<BitmapCursorOzone> cursor_; | 53 scoped_refptr<BitmapCursorOzone> cursor_; |
50 | 54 |
51 // The window under the cursor. | 55 // The window under the cursor. |
52 gfx::AcceleratedWidget cursor_window_; | 56 gfx::AcceleratedWidget cursor_window_; |
53 | 57 |
54 // The location of the cursor within the window. | 58 // The location of the cursor within the window. |
55 gfx::PointF cursor_location_; | 59 gfx::PointF cursor_location_; |
56 }; | 60 }; |
57 | 61 |
58 } // namespace ui | 62 } // namespace ui |
59 | 63 |
60 #endif // UI_OZONE_PLATFORM_DRI_DRI_CURSOR_H_ | 64 #endif // UI_OZONE_PLATFORM_DRI_DRI_CURSOR_H_ |
OLD | NEW |