Mercurial > sdl-ios-xcode
comparison include/SDL_mouse.h @ 1671:89f7510fe17a SDL-1.3
Moved the cursor handling into the mouse code.
Added support for multiple mice, potentially dynamically added and removed.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Fri, 09 Jun 2006 06:42:42 +0000 |
parents | eef792d31de8 |
children | 624e1412fbba |
comparison
equal
deleted
inserted
replaced
1670:eef792d31de8 | 1671:89f7510fe17a |
---|---|
55 | 55 |
56 /* \fn int SDL_SelectMouse(int index) | 56 /* \fn int SDL_SelectMouse(int index) |
57 * | 57 * |
58 * \brief Set the index of the currently selected mouse. | 58 * \brief Set the index of the currently selected mouse. |
59 * | 59 * |
60 * \return The index of the currently selected mouse. | 60 * \return The index of the previously selected mouse. |
61 * | 61 * |
62 * \note You can query the currently selected mouse by passing an index of -1. | 62 * \note You can query the currently selected mouse by passing an index of -1. |
63 * | 63 * |
64 * \sa SDL_GetNumMice() | 64 * \sa SDL_GetNumMice() |
65 */ | 65 */ |
107 */ | 107 */ |
108 extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_WindowID windowID, | 108 extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_WindowID windowID, |
109 int x, int y); | 109 int x, int y); |
110 | 110 |
111 /* | 111 /* |
112 * Create a cursor using the specified data and mask (in MSB format). | 112 * \fn SDL_Cursor *SDL_CreateCursor (const Uint8 * data, const Uint8 * mask, int w, int h, int hot_x, int hot_y) |
113 * | |
114 * \brief Create a cursor for the currently selected mouse, using the | |
115 * specified bitmap data and mask (in MSB format). | |
116 * | |
113 * The cursor width must be a multiple of 8 bits. | 117 * The cursor width must be a multiple of 8 bits. |
114 * | 118 * |
115 * The cursor is created in black and white according to the following: | 119 * The cursor is created in black and white according to the following: |
116 * data mask resulting pixel on screen | 120 * data mask resulting pixel on screen |
117 * 0 1 White | 121 * 0 1 White |
118 * 1 1 Black | 122 * 1 1 Black |
119 * 0 0 Transparent | 123 * 0 0 Transparent |
120 * 1 0 Inverted color if possible, black if not. | 124 * 1 0 Inverted color if possible, black if not. |
121 * | 125 * |
122 * Cursors created with this function must be freed with SDL_FreeCursor(). | 126 * \sa SDL_FreeCursor() |
123 */ | 127 */ |
124 extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor | 128 extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data, |
125 (Uint8 * data, Uint8 * mask, int w, int h, int hot_x, int hot_y); | 129 const Uint8 * mask, |
130 int w, int h, int hot_x, | |
131 int hot_y); | |
126 | 132 |
127 /* | 133 /* |
128 * Set the currently active cursor to the specified one. | 134 * \fn void SDL_SetCursor(SDL_Cursor * cursor) |
129 * If the cursor is currently visible, the change will be immediately | 135 * |
130 * represented on the display. | 136 * \brief Set the active cursor for the currently selected mouse. |
137 * | |
138 * \note The cursor must have been created for the selected mouse. | |
131 */ | 139 */ |
132 extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor); | 140 extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor); |
133 | 141 |
134 /* | 142 /* |
135 * Returns the currently active cursor. | 143 * \fn SDL_Cursor *SDL_GetCursor(void) |
144 * | |
145 * \brief Return the active cursor for the currently selected mouse. | |
136 */ | 146 */ |
137 extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); | 147 extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); |
138 | 148 |
139 /* | 149 /* |
140 * Deallocates a cursor created with SDL_CreateCursor(). | 150 * \fn void SDL_FreeCursor(SDL_Cursor * cursor) |
151 * | |
152 * \brief Frees a cursor created with SDL_CreateCursor(). | |
153 * | |
154 * \sa SDL_CreateCursor() | |
141 */ | 155 */ |
142 extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor); | 156 extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor); |
143 | 157 |
144 /* | 158 /* |
145 * Toggle whether or not the cursor is shown on the screen. | 159 * \fn int SDL_ShowCursor(int toggle) |
146 * The cursor start off displayed, but can be turned off. | 160 * |
147 * SDL_ShowCursor() returns 1 if the cursor was being displayed | 161 * \brief Toggle whether or not the cursor is shown for the currently selected mouse. |
148 * before the call, or 0 if it was not. You can query the current | 162 * |
149 * state by passing a 'toggle' value of -1. | 163 * \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current state. |
164 * | |
165 * \return 1 if the cursor is shown, or 0 if the cursor is hidden. | |
150 */ | 166 */ |
151 extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); | 167 extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); |
152 | 168 |
153 /* Used as a mask when testing buttons in buttonstate | 169 /* Used as a mask when testing buttons in buttonstate |
154 Button 1: Left mouse button | 170 Button 1: Left mouse button |