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

Side by Side Diff: ui/base/cursor/cursor_loader.h

Issue 10919135: Move ash specific cursor code to CursorManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move HideHostCursor to x11_util.{cc,h} Created 8 years, 3 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 (c) 2012 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_CURSOR_LOADER_H_
6 #define UI_BASE_CURSOR_CURSOR_LOADER_H_
7
8 #include "base/logging.h"
9 #include "ui/base/ui_export.h"
10 #include "ui/gfx/native_widget_types.h"
11
12 namespace ui {
13
14 class UI_EXPORT CursorLoader {
15 public:
16 CursorLoader() : device_scale_factor_(0.0f) {}
17 virtual ~CursorLoader() {};
18
19 // Returns the device scale factor used by the loader.
20 float device_scale_factor() const {
21 return device_scale_factor_;
22 }
23
24 // Sets the device scale factor used by the loader.
25 void set_device_scale_factor(float device_scale_factor) {
26 device_scale_factor_ = device_scale_factor;
27 }
28
29 // Creates a cursor from an image resource and puts it in the cursor map.
30 virtual void LoadImageCursor(
31 int id, int resource_id, int hot_x, int hot_y) = 0;
32
33 // Creates an animated cursor from an image resource and puts it in the
34 // cursor map. The image is assumed to be a concatenation of animation frames
35 // from left to right. Also, each frame is assumed to be square
36 // (width == height).
37 // |frame_delay_ms| is the delay between frames in millisecond.
38 virtual void LoadAnimatedCursor(
39 int id, int resource_id, int hot_x, int hot_y, int frame_delay_ms) = 0;
40
41 // Unloads all the cursors.
42 virtual void UnloadAll() = 0;
43
44 // Sets the platform cursor based on the native type of |cursor|.
45 virtual void SetPlatformCursor(gfx::NativeCursor* cursor) = 0;
46
47 // Creates a CursorLoader.
48 static CursorLoader* Create();
49
50 private:
51 // The device scale factor used by the loader.
52 float device_scale_factor_;
53 };
54
55
56 } // namespace ui
57
58 #endif // UI_BASE_CURSOR_CURSOR_LOADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698