Explicitly add python-numpy dependency to install-build-deps.
[chromium-blink-merge.git] / ui / ozone / platform / dri / dri_cursor.h
blob177ad9c33f06523e917c323cdc58dd67cea8e936
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"
13 namespace gfx {
14 class PointF;
15 class Vector2dF;
16 class Rect;
19 namespace ui {
21 class BitmapCursorOzone;
22 class BitmapCursorFactoryOzone;
23 class DriWindowManager;
24 class HardwareCursorDelegate;
26 class DriCursor : public CursorDelegateEvdev {
27 public:
28 explicit DriCursor(HardwareCursorDelegate* hardware,
29 DriWindowManager* window_manager);
30 ~DriCursor() override;
32 // Set's platform_cursor for widget. SetCursor is not responsible for showing
33 // the cursor. ShowCursor needs to be explicitly called to make the cursor
34 // visible.
35 void SetCursor(gfx::AcceleratedWidget widget, PlatformCursor platform_cursor);
36 void ShowCursor();
37 void HideCursor();
38 gfx::AcceleratedWidget GetCursorWindow();
40 // CursorDelegateEvdev:
41 void MoveCursorTo(gfx::AcceleratedWidget widget,
42 const gfx::PointF& location) override;
43 void MoveCursorTo(const gfx::PointF& location) override;
44 void MoveCursor(const gfx::Vector2dF& delta) override;
45 bool IsCursorVisible() override;
46 gfx::PointF location() override;
47 gfx::Rect GetCursorDisplayBounds() override;
49 private:
50 // The location of the bitmap (the cursor location is the hotspot location).
51 gfx::Point bitmap_location();
53 // The DRI implementation for setting the hardware cursor.
54 HardwareCursorDelegate* hardware_;
56 DriWindowManager* window_manager_; // Not owned.
58 // The current cursor bitmap.
59 scoped_refptr<BitmapCursorOzone> cursor_;
61 // The window under the cursor.
62 gfx::AcceleratedWidget cursor_window_;
64 // The location of the cursor within the window.
65 gfx::PointF cursor_location_;
68 } // namespace ui
70 #endif // UI_OZONE_PLATFORM_DRI_DRI_CURSOR_H_