Upstream version 10.38.222.0
[platform/framework/web/crosswalk.git] / src / ui / ozone / platform / dri / cursor_factory_evdev_dri.h
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.
4
5 #ifndef UI_OZONE_PLATFORM_DRI_CURSOR_FACTORY_EVDEV_DRI_H_
6 #define UI_OZONE_PLATFORM_DRI_CURSOR_FACTORY_EVDEV_DRI_H_
7
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"
14
15 namespace ui {
16
17 class HardwareCursorDelegate;
18
19 class CursorFactoryEvdevDri : public BitmapCursorFactoryOzone,
20                               public CursorDelegateEvdev {
21  public:
22   CursorFactoryEvdevDri(HardwareCursorDelegate* cursor);
23   virtual ~CursorFactoryEvdevDri();
24
25   // BitmapCursorFactoryOzone:
26   virtual gfx::AcceleratedWidget GetCursorWindow() OVERRIDE;
27   virtual void SetBitmapCursor(gfx::AcceleratedWidget widget,
28                                scoped_refptr<BitmapCursorOzone> cursor)
29       OVERRIDE;
30
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;
36
37  private:
38   // The location of the bitmap (the cursor location is the hotspot location).
39   gfx::Point bitmap_location();
40
41   // The DRI implementation for setting the hardware cursor.
42   HardwareCursorDelegate* hardware_;
43
44   // The current cursor bitmap.
45   scoped_refptr<BitmapCursorOzone> cursor_;
46
47   // The window under the cursor.
48   gfx::AcceleratedWidget cursor_window_;
49
50   // The location of the cursor within the window.
51   gfx::PointF cursor_location_;
52 };
53
54 }  // namespace ui
55
56 #endif  // UI_OZONE_PLATFORM_DRI_CURSOR_FACTORY_EVDEV_DRI_H_