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
3 // found in the LICENSE file.
5 #ifndef UI_OZONE_PLATFORM_DRI_CURSOR_FACTORY_EVDEV_DRI_H_
6 #define UI_OZONE_PLATFORM_DRI_CURSOR_FACTORY_EVDEV_DRI_H_
8 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h"
9 #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"
17 class HardwareCursorDelegate;
19 class CursorFactoryEvdevDri : public BitmapCursorFactoryOzone,
20 public CursorDelegateEvdev {
22 CursorFactoryEvdevDri(HardwareCursorDelegate* cursor);
23 virtual ~CursorFactoryEvdevDri();
25 // BitmapCursorFactoryOzone:
26 virtual gfx::AcceleratedWidget GetCursorWindow() OVERRIDE;
27 virtual void SetBitmapCursor(gfx::AcceleratedWidget widget,
28 scoped_refptr<BitmapCursorOzone> cursor)
31 // CursorDelegateEvdev:
32 virtual void MoveCursorTo(gfx::AcceleratedWidget widget,
33 const gfx::PointF& location) OVERRIDE;
34 virtual void MoveCursor(const gfx::Vector2dF& delta) OVERRIDE;
35 virtual gfx::PointF location() OVERRIDE;
38 // The location of the bitmap (the cursor location is the hotspot location).
39 gfx::Point bitmap_location();
41 // The DRI implementation for setting the hardware cursor.
42 HardwareCursorDelegate* hardware_;
44 // The current cursor bitmap.
45 scoped_refptr<BitmapCursorOzone> cursor_;
47 // The window under the cursor.
48 gfx::AcceleratedWidget cursor_window_;
50 // The location of the cursor within the window.
51 gfx::PointF cursor_location_;
56 #endif // UI_OZONE_PLATFORM_DRI_CURSOR_FACTORY_EVDEV_DRI_H_