Documentation of SFML 2.5.1

Warning: this page refers to an old version of SFML. Click here to switch to the latest version.
Cursor.hpp
1 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24 
25 #ifndef SFML_CURSOR_HPP
26 #define SFML_CURSOR_HPP
27 
29 // Headers
31 #include <SFML/Window/Export.hpp>
32 #include <SFML/System/NonCopyable.hpp>
33 #include <SFML/System/Vector2.hpp>
34 
35 namespace sf
36 {
37 namespace priv
38 {
39  class CursorImpl;
40 }
41 
46 class SFML_WINDOW_API Cursor : NonCopyable
47 {
48 public:
49 
76  enum Type
77  {
80  Wait,
81  Text,
82  Hand,
89  Help,
90  NotAllowed
91  };
92 
93 public:
94 
104  Cursor();
105 
113  ~Cursor();
114 
144  bool loadFromPixels(const Uint8* pixels, Vector2u size, Vector2u hotspot);
145 
160  bool loadFromSystem(Type type);
161 
162 private:
163 
164  friend class Window;
165 
175  const priv::CursorImpl& getImpl() const;
176 
177 private:
178 
180  // Member data
182  priv::CursorImpl* m_impl;
183 };
184 
185 } // namespace sf
186 
187 
188 #endif // SFML_CURSOR_HPP
189 
190 
Busy cursor.
Definition: Cursor.hpp:80
Double arrow cursor going from top-left to bottom-right.
Definition: Cursor.hpp:85
Combination of SizeHorizontal and SizeVertical.
Definition: Cursor.hpp:87
Cursor defines the appearance of a system cursor.
Definition: Cursor.hpp:46
Vertical double arrow cursor.
Definition: Cursor.hpp:84
Pointing hand cursor.
Definition: Cursor.hpp:82
Type
Enumeration of the native system cursor types.
Definition: Cursor.hpp:76
Arrow cursor (default)
Definition: Cursor.hpp:78
I-beam, cursor when hovering over a field allowing text entry.
Definition: Cursor.hpp:81
Window that serves as a target for OpenGL rendering.
Horizontal double arrow cursor.
Definition: Cursor.hpp:83
Help cursor.
Definition: Cursor.hpp:89
Utility class that makes any derived class non-copyable.
Definition: NonCopyable.hpp:41
Busy arrow cursor.
Definition: Cursor.hpp:79
Crosshair cursor.
Definition: Cursor.hpp:88
Double arrow cursor going from bottom-left to top-right.
Definition: Cursor.hpp:86