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"
16 class DriSurfaceFactory;
21 class CursorFactoryEvdevDri : public BitmapCursorFactoryOzone,
22 public CursorDelegateEvdev {
24 CursorFactoryEvdevDri(DriSurfaceFactory* dri);
25 virtual ~CursorFactoryEvdevDri();
27 // BitmapCursorFactoryOzone:
28 virtual gfx::AcceleratedWidget GetCursorWindow() OVERRIDE;
29 virtual void SetBitmapCursor(gfx::AcceleratedWidget widget,
30 scoped_refptr<BitmapCursorOzone> cursor)
33 // CursorDelegateEvdev:
34 virtual void MoveCursorTo(gfx::AcceleratedWidget widget,
35 const gfx::PointF& location) OVERRIDE;
36 virtual void MoveCursor(const gfx::Vector2dF& delta) OVERRIDE;
37 virtual gfx::PointF location() OVERRIDE;
40 // The location of the bitmap (the cursor location is the hotspot location).
41 gfx::Point bitmap_location();
43 // The DRI implementation for setting the hardware cursor.
44 DriSurfaceFactory* dri_;
46 // The current cursor bitmap.
47 scoped_refptr<BitmapCursorOzone> cursor_;
49 // The window under the cursor.
50 gfx::AcceleratedWidget cursor_window_;
52 // The location of the cursor within the window.
53 gfx::PointF cursor_location_;
58 #endif // UI_OZONE_PLATFORM_DRI_CURSOR_FACTORY_EVDEV_DRI_H_