ScummVM API documentation
cursor.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef STARK_UI_CURSOR_H
23 #define STARK_UI_CURSOR_H
24 
25 #include "common/rect.h"
26 #include "common/str.h"
27 #include "common/scummsys.h"
28 
29 namespace Stark {
30 
31 class VisualImageXMG;
32 class VisualText;
33 
34 namespace Gfx {
35 class Driver;
36 }
37 
38 namespace Resources {
39 class Sound;
40 }
41 
45 class Cursor {
46 public:
47  explicit Cursor(Gfx::Driver *gfx);
48  ~Cursor();
49 
51  void render();
52 
54  void setMousePosition(const Common::Point &pos);
55 
57  void setItemActive(bool fading);
58 
60  void onScreenChanged();
61 
62  Common::Point getMousePosition(bool unscaled = false) const;
63 
65  Common::Rect getHotRectangle() const;
66 
67  enum CursorType {
68  kImage = -1,
69  kDefault = 0,
70  kActive = 3,
71  kPassive = 9,
72  kEye = 10,
73  kHand = 11,
74  kMouth = 12
75  };
76 
77  void setCursorType(CursorType type);
78  void setCursorImage(VisualImageXMG *image);
79  void setMouseHint(const Common::String &hint);
80 private:
81  void updateFadeLevel();
82  void updateHintDelay();
83 
84  Gfx::Driver *_gfx;
85 
86  Common::String _currentHint;
87  int32 _hintDisplayDelay;
88 
89  Common::Point _mousePos;
90  VisualImageXMG *_cursorImage;
91  VisualText *_mouseText;
92  CursorType _currentCursorType;
93 
94  Resources::Sound *_actionHoverSound;
95 
96  bool _itemActive;
97  float _fadeLevel;
98  bool _fadeLevelIncreasing;
99  static const float _fadeValueMax;
100 };
101 
102 } // End of namespace Stark
103 
104 #endif // STARK_UI_CURSOR_H
Definition: str.h:59
Definition: sound.h:47
Definition: rect.h:144
Definition: driver.h:44
Definition: cursor.h:45
Definition: text.h:44
Definition: console.h:27
Definition: rect.h:45
Definition: image.h:45