4040
4141class GamepadMotion ;
4242
43+ namespace InputClassEnums {
44+ // Keep synced with "DisplayServer::MouseMode" enum.
45+ enum MouseMode : int {
46+ MOUSE_MODE_VISIBLE,
47+ MOUSE_MODE_HIDDEN,
48+ MOUSE_MODE_CAPTURED,
49+ MOUSE_MODE_CONFINED,
50+ MOUSE_MODE_CONFINED_HIDDEN,
51+ MOUSE_MODE_MAX,
52+ };
53+
54+ #undef CursorShape
55+ enum CursorShape : int {
56+ CURSOR_ARROW,
57+ CURSOR_IBEAM,
58+ CURSOR_POINTING_HAND,
59+ CURSOR_CROSS,
60+ CURSOR_WAIT,
61+ CURSOR_BUSY,
62+ CURSOR_DRAG,
63+ CURSOR_CAN_DROP,
64+ CURSOR_FORBIDDEN,
65+ CURSOR_VSIZE,
66+ CURSOR_HSIZE,
67+ CURSOR_BDIAGSIZE,
68+ CURSOR_FDIAGSIZE,
69+ CURSOR_MOVE,
70+ CURSOR_VSPLIT,
71+ CURSOR_HSPLIT,
72+ CURSOR_HELP,
73+ CURSOR_MAX
74+ };
75+ } // namespace InputClassEnums
76+
4377class Input : public Object {
4478 GDCLASS (Input, Object);
4579 _THREAD_SAFE_CLASS_
@@ -49,37 +83,9 @@ class Input : public Object {
4983 static constexpr uint64_t MAX_EVENT = 32 ;
5084
5185public:
52- // Keep synced with "DisplayServer::MouseMode" enum.
53- enum MouseMode {
54- MOUSE_MODE_VISIBLE,
55- MOUSE_MODE_HIDDEN,
56- MOUSE_MODE_CAPTURED,
57- MOUSE_MODE_CONFINED,
58- MOUSE_MODE_CONFINED_HIDDEN,
59- MOUSE_MODE_MAX,
60- };
61-
62- #undef CursorShape
63- enum CursorShape {
64- CURSOR_ARROW,
65- CURSOR_IBEAM,
66- CURSOR_POINTING_HAND,
67- CURSOR_CROSS,
68- CURSOR_WAIT,
69- CURSOR_BUSY,
70- CURSOR_DRAG,
71- CURSOR_CAN_DROP,
72- CURSOR_FORBIDDEN,
73- CURSOR_VSIZE,
74- CURSOR_HSIZE,
75- CURSOR_BDIAGSIZE,
76- CURSOR_FDIAGSIZE,
77- CURSOR_MOVE,
78- CURSOR_VSPLIT,
79- CURSOR_HSPLIT,
80- CURSOR_HELP,
81- CURSOR_MAX
82- };
86+ // TODO: When we migrate to C++20, replace these with "using enum" and skip prefixing MouseMode and CursorShape in other files.
87+ using MouseMode = InputClassEnums::MouseMode;
88+ using CursorShape = InputClassEnums::CursorShape;
8389
8490 class JoypadFeatures {
8591 public:
@@ -217,7 +223,7 @@ class Input : public Object {
217223
218224 int fallback_mapping = -1 ; // Index of the guid in map_db.
219225
220- CursorShape default_shape = CURSOR_ARROW;
226+ CursorShape default_shape = CursorShape:: CURSOR_ARROW;
221227
222228 enum JoyType {
223229 TYPE_BUTTON,
@@ -426,7 +432,7 @@ class Input : public Object {
426432 CursorShape get_default_cursor_shape () const ;
427433 void set_default_cursor_shape (CursorShape p_shape);
428434 CursorShape get_current_cursor_shape () const ;
429- void set_custom_mouse_cursor (const Ref<Resource> &p_cursor, CursorShape p_shape = Input::CURSOR_ARROW, const Vector2 &p_hotspot = Vector2());
435+ void set_custom_mouse_cursor (const Ref<Resource> &p_cursor, CursorShape p_shape = Input::CursorShape:: CURSOR_ARROW, const Vector2 &p_hotspot = Vector2());
430436
431437 void parse_mapping (const String &p_mapping);
432438 void joy_button (int p_device, JoyButton p_button, bool p_pressed);
0 commit comments