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