Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: ui/base/cursor/ozone/cursor_factory_ozone.h

Issue 312393002: ozone: Move the factory interfaces into a common target. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-r278697 Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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_BASE_CURSOR_OZONE_CURSOR_FACTORY_OZONE_H_
6 #define UI_BASE_CURSOR_OZONE_CURSOR_FACTORY_OZONE_H_
7
8 #include "ui/base/cursor/cursor.h"
9 #include "ui/base/ui_base_export.h"
10 #include "ui/gfx/native_widget_types.h"
11
12 namespace ui {
13
14 class UI_BASE_EXPORT CursorFactoryOzone {
15 public:
16 CursorFactoryOzone();
17 virtual ~CursorFactoryOzone();
18
19 // Returns the singleton instance.
20 static CursorFactoryOzone* GetInstance();
21
22 // Return the default cursor of the specified type. The types are listed in
23 // ui/base/cursor/cursor.h. Default cursors are managed by the implementation
24 // and must live indefinitely; there's no way to know when to free them.
25 virtual PlatformCursor GetDefaultCursor(int type);
26
27 // Return a image cursor from the specified image & hotspot. Image cursors
28 // are referenced counted and have an initial refcount of 1. Therefore, each
29 // CreateImageCursor call must be matched with a call to UnrefImageCursor.
30 virtual PlatformCursor CreateImageCursor(const SkBitmap& bitmap,
31 const gfx::Point& hotspot);
32
33 // Increment platform image cursor refcount.
34 virtual void RefImageCursor(PlatformCursor cursor);
35
36 // Decrement platform image cursor refcount.
37 virtual void UnrefImageCursor(PlatformCursor cursor);
38
39 // Change the active cursor for an AcceleratedWidget.
40 // TODO(spang): Move this.
41 virtual void SetCursor(gfx::AcceleratedWidget widget, PlatformCursor cursor);
42
43 // Returns the window on which the cursor is active.
44 // TODO(dnicoara) Move this once the WindowTreeHost refactoring finishes and
45 // WindowTreeHost::CanDispatchEvent() is no longer present.
46 virtual gfx::AcceleratedWidget GetCursorWindow();
47
48 private:
49 static CursorFactoryOzone* impl_; // not owned
50 };
51
52 } // namespace gfx
53
54 #endif // UI_BASE_CURSOR_OZONE_CURSOR_FACTORY_OZONE_H_
OLDNEW
« no previous file with comments | « ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h ('k') | ui/base/cursor/ozone/cursor_factory_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698