aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/irrlicht-1.8/include/ICursorControl.h
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/irrlicht-1.8/include/ICursorControl.h')
-rw-r--r--libraries/irrlicht-1.8/include/ICursorControl.h192
1 files changed, 0 insertions, 192 deletions
diff --git a/libraries/irrlicht-1.8/include/ICursorControl.h b/libraries/irrlicht-1.8/include/ICursorControl.h
deleted file mode 100644
index c52f81f..0000000
--- a/libraries/irrlicht-1.8/include/ICursorControl.h
+++ /dev/null
@@ -1,192 +0,0 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#ifndef __I_CURSOR_CONTROL_H_INCLUDED__
6#define __I_CURSOR_CONTROL_H_INCLUDED__
7
8#include "IReferenceCounted.h"
9#include "position2d.h"
10#include "rect.h"
11
12namespace irr
13{
14namespace gui
15{
16
17 class IGUISpriteBank;
18
19 //! Default icons for cursors
20 enum ECURSOR_ICON
21 {
22 // Following cursors might be system specific, or might use an Irrlicht icon-set. No guarantees so far.
23 ECI_NORMAL, // arrow
24 ECI_CROSS, // Crosshair
25 ECI_HAND, // Hand
26 ECI_HELP, // Arrow and question mark
27 ECI_IBEAM, // typical text-selection cursor
28 ECI_NO, // should not click icon
29 ECI_WAIT, // hourclass
30 ECI_SIZEALL, // arrow in all directions
31 ECI_SIZENESW, // resizes in direction north-east or south-west
32 ECI_SIZENWSE, // resizes in direction north-west or south-east
33 ECI_SIZENS, // resizes in direction north or south
34 ECI_SIZEWE, // resizes in direction west or east
35 ECI_UP, // up-arrow
36
37 // Implementer note: Should we add system specific cursors, which use guaranteed the system icons,
38 // then I would recommend using a naming scheme like ECI_W32_CROSS, ECI_X11_CROSSHAIR and adding those
39 // additionally.
40
41 ECI_COUNT // maximal of defined cursors. Note that higher values can be created at runtime
42 };
43
44 //! Names for ECURSOR_ICON
45 const c8* const GUICursorIconNames[ECI_COUNT+1] =
46 {
47 "normal",
48 "cross",
49 "hand",
50 "help",
51 "ibeam",
52 "no",
53 "wait",
54 "sizeall",
55 "sizenesw",
56 "sizenwse",
57 "sizens",
58 "sizewe",
59 "sizeup",
60 0
61 };
62
63 //! structure used to set sprites as cursors.
64 struct SCursorSprite
65 {
66 SCursorSprite()
67 : SpriteBank(0), SpriteId(-1)
68 {
69 }
70
71 SCursorSprite( gui::IGUISpriteBank * spriteBank, s32 spriteId, const core::position2d<s32> &hotspot=core::position2d<s32>(0,0) )
72 : SpriteBank(spriteBank), SpriteId(spriteId), HotSpot(hotspot)
73 {
74 }
75
76 gui::IGUISpriteBank * SpriteBank;
77 s32 SpriteId;
78 core::position2d<s32> HotSpot;
79 };
80
81 //! platform specific behavior flags for the cursor
82 enum ECURSOR_PLATFORM_BEHAVIOR
83 {
84 //! default - no platform specific behavior
85 ECPB_NONE = 0,
86
87 //! On X11 try caching cursor updates as XQueryPointer calls can be expensive.
88 /** Update cursor positions only when the irrlicht timer has been updated or the timer is stopped.
89 This means you usually get one cursor update per device->run() which will be fine in most cases.
90 See this forum-thread for a more detailed explanation:
91 http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=45525
92 */
93 ECPB_X11_CACHE_UPDATES = 1
94 };
95
96 //! Interface to manipulate the mouse cursor.
97 class ICursorControl : public virtual IReferenceCounted
98 {
99 public:
100
101 //! Changes the visible state of the mouse cursor.
102 /** \param visible: The new visible state. If true, the cursor will be visible,
103 if false, it will be invisible. */
104 virtual void setVisible(bool visible) = 0;
105
106 //! Returns if the cursor is currently visible.
107 /** \return True if the cursor is visible, false if not. */
108 virtual bool isVisible() const = 0;
109
110 //! Sets the new position of the cursor.
111 /** The position must be
112 between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is
113 the top left corner and (1.0f, 1.0f) is the bottom right corner of the
114 render window.
115 \param pos New position of the cursor. */
116 virtual void setPosition(const core::position2d<f32> &pos) = 0;
117
118 //! Sets the new position of the cursor.
119 /** The position must be
120 between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is
121 the top left corner and (1.0f, 1.0f) is the bottom right corner of the
122 render window.
123 \param x New x-coord of the cursor.
124 \param y New x-coord of the cursor. */
125 virtual void setPosition(f32 x, f32 y) = 0;
126
127 //! Sets the new position of the cursor.
128 /** \param pos: New position of the cursor. The coordinates are pixel units. */
129 virtual void setPosition(const core::position2d<s32> &pos) = 0;
130
131 //! Sets the new position of the cursor.
132 /** \param x New x-coord of the cursor. The coordinates are pixel units.
133 \param y New y-coord of the cursor. The coordinates are pixel units. */
134 virtual void setPosition(s32 x, s32 y) = 0;
135
136 //! Returns the current position of the mouse cursor.
137 /** \return Returns the current position of the cursor. The returned position
138 is the position of the mouse cursor in pixel units. */
139 virtual const core::position2d<s32>& getPosition() = 0;
140
141 //! Returns the current position of the mouse cursor.
142 /** \return Returns the current position of the cursor. The returned position
143 is a value between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is
144 the top left corner and (1.0f, 1.0f) is the bottom right corner of the
145 render window. */
146 virtual core::position2d<f32> getRelativePosition() = 0;
147
148 //! Sets an absolute reference rect for setting and retrieving the cursor position.
149 /** If this rect is set, the cursor position is not being calculated relative to
150 the rendering window but to this rect. You can set the rect pointer to 0 to disable
151 this feature again. This feature is useful when rendering into parts of foreign windows
152 for example in an editor.
153 \param rect: A pointer to an reference rectangle or 0 to disable the reference rectangle.*/
154 virtual void setReferenceRect(core::rect<s32>* rect=0) = 0;
155
156
157 //! Sets the active cursor icon
158 /** Setting cursor icons is so far only supported on Win32 and Linux */
159 virtual void setActiveIcon(ECURSOR_ICON iconId) {}
160
161 //! Gets the currently active icon
162 virtual ECURSOR_ICON getActiveIcon() const { return gui::ECI_NORMAL; }
163
164 //! Add a custom sprite as cursor icon.
165 /** \return Identification for the icon */
166 virtual ECURSOR_ICON addIcon(const gui::SCursorSprite& icon) { return gui::ECI_NORMAL; }
167
168 //! replace a cursor icon.
169 /** Changing cursor icons is so far only supported on Win32 and Linux
170 Note that this only changes the icons within your application, system cursors outside your
171 application will not be affected.
172 */
173 virtual void changeIcon(ECURSOR_ICON iconId, const gui::SCursorSprite& sprite) {}
174
175 //! Return a system-specific size which is supported for cursors. Larger icons will fail, smaller icons might work.
176 virtual core::dimension2di getSupportedIconSize() const { return core::dimension2di(0,0); }
177
178 //! Set platform specific behavior flags.
179 virtual void setPlatformBehavior(ECURSOR_PLATFORM_BEHAVIOR behavior) {}
180
181 //! Return platform specific behavior.
182 /** \return Behavior set by setPlatformBehavior or ECPB_NONE for platforms not implementing specific behaviors.
183 */
184 virtual ECURSOR_PLATFORM_BEHAVIOR getPlatformBehavior() const { return ECPB_NONE; }
185 };
186
187
188} // end namespace gui
189} // end namespace irr
190
191#endif
192