SFML 2.6.2

- Main Page
- Related Pages
- Topics
- Namespaces
- Classes
- Files

- File List
- File Members

Loading...
Searching...
No Matches
Cursor.hpp
Go to the documentation of this file.
1
2//
3// SFML - Simple and Fast Multimedia Library
4// Copyright (C) 2007-2023 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
86 enum Type
87 {
88 Arrow,
89 ArrowWait,
90 Wait,
91 Text,
92 Hand,
93 SizeHorizontal,
94 SizeVertical,
95 SizeTopLeftBottomRight,
96 SizeBottomLeftTopRight,
97 SizeLeft,
98 SizeRight,
99 SizeTop,
100 SizeBottom,
101 SizeTopLeft,
102 SizeBottomRight,
103 SizeBottomLeft,
104 SizeTopRight,
105 SizeAll,
106 Cross,
107 Help,
108 NotAllowed
109 };
110
111 public:
112
122 Cursor();
123
131 ~Cursor();
132
163 bool loadFromPixels(const Uint8* pixels, Vector2u size, Vector2u hotspot);
164
179 bool loadFromSystem(Type type);
180
181 private:
182
183 friend class WindowBase;
184
194 const priv::CursorImpl& getImpl() const;
195
196 private:
197
199 // Member data
201 priv::CursorImpl* m_impl;
202};
203
204} // namespace sf
205
206
207#endif // SFML_CURSOR_HPP
208
209
NonCopyable.hpp
Vector2.hpp
Export.hpp
SFML_WINDOW_API
#define SFML_WINDOW_API
Definition Window/Export.hpp:43
sf::Cursor
Cursor defines the appearance of a system cursor.
Definition Cursor.hpp:47
sf::Cursor::Cursor
Cursor()
Default constructor.
sf::Cursor::~Cursor
~Cursor()
Destructor.
sf::Cursor::Type
Type
Enumeration of the native system cursor types.
Definition Cursor.hpp:87
sf::Cursor::SizeHorizontal
@ SizeHorizontal
Horizontal double arrow cursor.
Definition Cursor.hpp:93
sf::Cursor::ArrowWait
@ ArrowWait
Busy arrow cursor.
Definition Cursor.hpp:89
sf::Cursor::Text
@ Text
I-beam, cursor when hovering over a field allowing text entry.
Definition Cursor.hpp:91
sf::Cursor::SizeAll
@ SizeAll
Combination of SizeHorizontal and SizeVertical.
Definition Cursor.hpp:105
sf::Cursor::SizeTopLeft
@ SizeTopLeft
Top-left arrow cursor on Linux, same as SizeTopLeftBottomRight on other platforms.
Definition Cursor.hpp:101
sf::Cursor::SizeLeft
@ SizeLeft
Left arrow cursor on Linux, same as SizeHorizontal on other platforms.
Definition Cursor.hpp:97
sf::Cursor::SizeBottomRight
@ SizeBottomRight
Bottom-right arrow cursor on Linux, same as SizeTopLeftBottomRight on other platforms.
Definition Cursor.hpp:102
sf::Cursor::SizeTop
@ SizeTop
Up arrow cursor on Linux, same as SizeVertical on other platforms.
Definition Cursor.hpp:99
sf::Cursor::SizeBottomLeft
@ SizeBottomLeft
Bottom-left arrow cursor on Linux, same as SizeBottomLeftTopRight on other platforms.
Definition Cursor.hpp:103
sf::Cursor::SizeTopRight
@ SizeTopRight
Top-right arrow cursor on Linux, same as SizeBottomLeftTopRight on other platforms.
Definition Cursor.hpp:104
sf::Cursor::Arrow
@ Arrow
Arrow cursor (default)
Definition Cursor.hpp:88
sf::Cursor::SizeTopLeftBottomRight
@ SizeTopLeftBottomRight
Double arrow cursor going from top-left to bottom-right.
Definition Cursor.hpp:95
sf::Cursor::SizeBottom
@ SizeBottom
Down arrow cursor on Linux, same as SizeVertical on other platforms.
Definition Cursor.hpp:100
sf::Cursor::SizeVertical
@ SizeVertical
Vertical double arrow cursor.
Definition Cursor.hpp:94
sf::Cursor::Wait
@ Wait
Busy cursor.
Definition Cursor.hpp:90
sf::Cursor::SizeBottomLeftTopRight
@ SizeBottomLeftTopRight
Double arrow cursor going from bottom-left to top-right.
Definition Cursor.hpp:96
sf::Cursor::Hand
@ Hand
Pointing hand cursor.
Definition Cursor.hpp:92
sf::Cursor::SizeRight
@ SizeRight
Right arrow cursor on Linux, same as SizeHorizontal on other platforms.
Definition Cursor.hpp:98
sf::Cursor::Help
@ Help
Help cursor.
Definition Cursor.hpp:107
sf::Cursor::Cross
@ Cross
Crosshair cursor.
Definition Cursor.hpp:106
sf::Cursor::loadFromPixels
bool loadFromPixels(const Uint8 *pixels, Vector2u size, Vector2u hotspot)
Create a cursor with the provided image.
sf::Cursor::loadFromSystem
bool loadFromSystem(Type type)
Create a native system cursor.
sf::NonCopyable
Utility class that makes any derived class non-copyable.
Definition NonCopyable.hpp:42
sf::Vector2< unsigned int >
sf::WindowBase
Window that serves as a base for other windows.
Definition WindowBase.hpp:57
sf
Definition AlResource.hpp:35
sf::Uint8
unsigned char Uint8
Definition Config.hpp:219