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_DRI_CURSOR_H_
6 #define UI_OZONE_PLATFORM_DRI_DRI_CURSOR_H_
8 #include "base/memory/ref_counted.h"
9 #include "ui/base/cursor/cursor.h"
10 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h"
11 #include "ui/gfx/native_widget_types.h"
20 class BitmapCursorOzone;
21 class BitmapCursorFactoryOzone;
22 class DriWindowManager;
23 class HardwareCursorDelegate;
25 class DriCursor : public CursorDelegateEvdev {
27 explicit DriCursor(HardwareCursorDelegate* hardware,
28 DriWindowManager* window_manager);
31 void SetCursor(gfx::AcceleratedWidget widget, PlatformCursor platform_cursor);
34 gfx::AcceleratedWidget GetCursorWindow();
36 // CursorDelegateEvdev:
37 virtual void MoveCursorTo(gfx::AcceleratedWidget widget,
38 const gfx::PointF& location) OVERRIDE;
39 virtual void MoveCursor(const gfx::Vector2dF& delta) OVERRIDE;
40 virtual bool IsCursorVisible() OVERRIDE;
41 virtual gfx::PointF location() OVERRIDE;
44 // The location of the bitmap (the cursor location is the hotspot location).
45 gfx::Point bitmap_location();
47 // The DRI implementation for setting the hardware cursor.
48 HardwareCursorDelegate* hardware_;
50 DriWindowManager* window_manager_; // Not owned.
52 // The current cursor bitmap.
53 scoped_refptr<BitmapCursorOzone> cursor_;
55 // The window under the cursor.
56 gfx::AcceleratedWidget cursor_window_;
58 // The location of the cursor within the window.
59 gfx::PointF cursor_location_;
64 #endif // UI_OZONE_PLATFORM_DRI_DRI_CURSOR_H_