OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_OZONE_PUBLIC_CURSOR_FACTORY_OZONE_H_ | 5 #ifndef UI_OZONE_PUBLIC_CURSOR_FACTORY_OZONE_H_ |
6 #define UI_OZONE_PUBLIC_CURSOR_FACTORY_OZONE_H_ | 6 #define UI_OZONE_PUBLIC_CURSOR_FACTORY_OZONE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 public: | 22 public: |
23 CursorFactoryOzone(); | 23 CursorFactoryOzone(); |
24 virtual ~CursorFactoryOzone(); | 24 virtual ~CursorFactoryOzone(); |
25 | 25 |
26 // Returns the singleton instance. | 26 // Returns the singleton instance. |
27 static CursorFactoryOzone* GetInstance(); | 27 static CursorFactoryOzone* GetInstance(); |
28 | 28 |
29 // Return the default cursor of the specified type. The types are listed in | 29 // Return the default cursor of the specified type. The types are listed in |
30 // ui/base/cursor/cursor.h. Default cursors are managed by the implementation | 30 // ui/base/cursor/cursor.h. Default cursors are managed by the implementation |
31 // and must live indefinitely; there's no way to know when to free them. | 31 // and must live indefinitely; there's no way to know when to free them. |
32 virtual PlatformCursor GetDefaultCursor(int type); | 32 virtual PlatformCursor GetDefaultCursor(CursorType type); |
33 | 33 |
34 // Return a image cursor from the specified image & hotspot. Image cursors | 34 // Return a image cursor from the specified image & hotspot. Image cursors |
35 // are referenced counted and have an initial refcount of 1. Therefore, each | 35 // are referenced counted and have an initial refcount of 1. Therefore, each |
36 // CreateImageCursor call must be matched with a call to UnrefImageCursor. | 36 // CreateImageCursor call must be matched with a call to UnrefImageCursor. |
37 virtual PlatformCursor CreateImageCursor(const SkBitmap& bitmap, | 37 virtual PlatformCursor CreateImageCursor(const SkBitmap& bitmap, |
38 const gfx::Point& hotspot, | 38 const gfx::Point& hotspot, |
39 float bitmap_dpi); | 39 float bitmap_dpi); |
40 | 40 |
41 // Return a animated cursor from the specified image & hotspot. Animated | 41 // Return a animated cursor from the specified image & hotspot. Animated |
42 // cursors are referenced counted and have an initial refcount of 1. | 42 // cursors are referenced counted and have an initial refcount of 1. |
(...skipping 11 matching lines...) Expand all Loading... |
54 // Decrement platform image cursor refcount. | 54 // Decrement platform image cursor refcount. |
55 virtual void UnrefImageCursor(PlatformCursor cursor); | 55 virtual void UnrefImageCursor(PlatformCursor cursor); |
56 | 56 |
57 private: | 57 private: |
58 static CursorFactoryOzone* impl_; // not owned | 58 static CursorFactoryOzone* impl_; // not owned |
59 }; | 59 }; |
60 | 60 |
61 } // namespace ui | 61 } // namespace ui |
62 | 62 |
63 #endif // UI_OZONE_PUBLIC_CURSOR_FACTORY_OZONE_H_ | 63 #endif // UI_OZONE_PUBLIC_CURSOR_FACTORY_OZONE_H_ |
OLD | NEW |