include/SDL_mouse.h
changeset 3407 d3baf5ac4e37
parent 2859 99210400e8b9
child 3585 f8816ffa210b
     1.1 --- a/include/SDL_mouse.h	Sun Oct 18 23:21:15 2009 +0000
     1.2 +++ b/include/SDL_mouse.h	Mon Oct 19 13:31:58 2009 +0000
     1.3 @@ -21,9 +21,9 @@
     1.4  */
     1.5  
     1.6  /**
     1.7 - * \file SDL_mouse.h
     1.8 - *
     1.9 - * Include file for SDL mouse event handling
    1.10 + *  \file SDL_mouse.h
    1.11 + *  
    1.12 + *  Include file for SDL mouse event handling.
    1.13   */
    1.14  
    1.15  #ifndef _SDL_mouse_h
    1.16 @@ -46,129 +46,112 @@
    1.17  /* Function prototypes */
    1.18  
    1.19  /**
    1.20 - * \fn int SDL_GetNumMice(void)
    1.21 - *
    1.22 - * \brief Get the number of mouse input devices available.
    1.23 - *
    1.24 - * \sa SDL_SelectMouse()
    1.25 + *  \brief Get the number of mouse input devices available.
    1.26 + *  
    1.27 + *  \sa SDL_SelectMouse()
    1.28   */
    1.29  extern DECLSPEC int SDLCALL SDL_GetNumMice(void);
    1.30  
    1.31  /**
    1.32 - * \fn char* SDL_GetMouseName(int index)
    1.33 - *
    1.34 - * \brief Gets the name of a mouse with the given index.
    1.35 - *
    1.36 - * \param index is the index of the mouse, which name is to be returned.
    1.37 - *
    1.38 - * \return the name of the mouse with the specified index
    1.39 + *  \brief Gets the name of a mouse with the given index.
    1.40 + *  
    1.41 + *  \param index is the index of the mouse, which name is to be returned.
    1.42 + *  
    1.43 + *  \return the name of the mouse with the specified index
    1.44   */
    1.45  extern DECLSPEC char *SDLCALL SDL_GetMouseName(int index);
    1.46  
    1.47  /**
    1.48 - * \fn int SDL_SelectMouse(int index)
    1.49 - *
    1.50 - * \brief Set the index of the currently selected mouse.
    1.51 - *
    1.52 - * \return The index of the previously selected mouse.
    1.53 - *
    1.54 - * \note You can query the currently selected mouse by passing an index of -1.
    1.55 - *
    1.56 - * \sa SDL_GetNumMice()
    1.57 + *  \brief Set the index of the currently selected mouse.
    1.58 + *  
    1.59 + *  \return The index of the previously selected mouse.
    1.60 + *  
    1.61 + *  \note You can query the currently selected mouse by passing an index of -1.
    1.62 + *  
    1.63 + *  \sa SDL_GetNumMice()
    1.64   */
    1.65  extern DECLSPEC int SDLCALL SDL_SelectMouse(int index);
    1.66  
    1.67  /**
    1.68 - * \fn SDL_WindowID SDL_GetMouseFocusWindow(int index)
    1.69 - *
    1.70 - * \brief Get the window which currently has focus for the currently selected mouse.
    1.71 + *  \brief Get the window which currently has focus for the specified mouse.
    1.72   */
    1.73  extern DECLSPEC SDL_WindowID SDLCALL SDL_GetMouseFocusWindow(int index);
    1.74  
    1.75  /**
    1.76 - * \fn int SDL_SetRelativeMouseMode(int index, SDL_bool enabled)
    1.77 - *
    1.78 - * \brief Set relative mouse mode for the currently selected mouse.
    1.79 - *
    1.80 - * \param enabled Whether or not to enable relative mode
    1.81 - *
    1.82 - * \return 0 on success, or -1 if relative mode is not supported.
    1.83 - *
    1.84 - * While the mouse is in relative mode, the cursor is hidden, and the
    1.85 - * driver will try to report continuous motion in the current window.
    1.86 - * Only relative motion events will be delivered, the mouse position
    1.87 - * will not change.
    1.88 - *
    1.89 - * \note This function will flush any pending mouse motion.
    1.90 - *
    1.91 - * \sa SDL_GetRelativeMouseMode()
    1.92 + *  \brief Set relative mouse mode for the specified mouse.
    1.93 + *  
    1.94 + *  \param enabled Whether or not to enable relative mode
    1.95 + *  
    1.96 + *  \return 0 on success, or -1 if relative mode is not supported.
    1.97 + *  
    1.98 + *  While the mouse is in relative mode, the cursor is hidden, and the
    1.99 + *  driver will try to report continuous motion in the current window.
   1.100 + *  Only relative motion events will be delivered, the mouse position
   1.101 + *  will not change.
   1.102 + *  
   1.103 + *  \note This function will flush any pending mouse motion.
   1.104 + *  
   1.105 + *  \sa SDL_GetRelativeMouseMode()
   1.106   */
   1.107  extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(int index,
   1.108                                                       SDL_bool enabled);
   1.109  
   1.110  /**
   1.111 - * \fn SDL_bool SDL_GetRelativeMouseMode(int index)
   1.112 - *
   1.113 - * \brief Query whether relative mouse mode is enabled for the currently selected mouse.
   1.114 - *
   1.115 - * \sa SDL_SetRelativeMouseMode()
   1.116 + *  \brief Query whether relative mouse mode is enabled for the specified mouse.
   1.117 + *  
   1.118 + *  \sa SDL_SetRelativeMouseMode()
   1.119   */
   1.120  extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(int index);
   1.121  
   1.122  /**
   1.123 - * \fn Uint8 SDL_GetMouseState(int index, int *x, int *y)
   1.124 - *
   1.125 - * \brief Retrieve the current state of the currently selected mouse.
   1.126 - *
   1.127 - * The current button state is returned as a button bitmask, which can
   1.128 - * be tested using the SDL_BUTTON(X) macros, and x and y are set to the
   1.129 - * mouse cursor position relative to the focus window for the currently
   1.130 - * selected mouse.  You can pass NULL for either x or y.
   1.131 + *  \brief Retrieve the current state of the specified mouse.
   1.132 + *  
   1.133 + *  The current button state is returned as a button bitmask, which can
   1.134 + *  be tested using the SDL_BUTTON(X) macros, and x and y are set to the
   1.135 + *  mouse cursor position relative to the focus window for the currently
   1.136 + *  selected mouse.  You can pass NULL for either x or y.
   1.137   */
   1.138  extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int index, int *x, int *y);
   1.139  
   1.140  /**
   1.141 - * \fn Uint8 SDL_GetRelativeMouseState(int index, int *x, int *y)
   1.142 + *  \brief Retrieve the state of the specified mouse.
   1.143   *
   1.144 - * \brief Retrieve the state of the currently selected mouse.
   1.145 - *
   1.146 - * The current button state is returned as a button bitmask, which can
   1.147 - * be tested using the SDL_BUTTON(X) macros, and x and y are set to the
   1.148 - * mouse deltas since the last call to SDL_GetRelativeMouseState().
   1.149 + *  The current button state is returned as a button bitmask, which can
   1.150 + *  be tested using the SDL_BUTTON(X) macros, and x and y are set to the
   1.151 + *  mouse deltas since the last call to SDL_GetRelativeMouseState().
   1.152   */
   1.153  extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int index, int *x,
   1.154                                                          int *y);
   1.155  
   1.156  /**
   1.157 - * \fn void SDL_WarpMouseInWindow(SDL_WindowID windowID, int x, int y)
   1.158 - *
   1.159 - * \brief Moves the currently selected mouse to the given position within the window.
   1.160 - *
   1.161 - * \param windowID The window to move the mouse into, or 0 for the current mouse focus
   1.162 - * \param x The x coordinate within the window
   1.163 - * \param y The y coordinate within the window
   1.164 - *
   1.165 - * \note This function generates a mouse motion event
   1.166 + *  \brief Moves the currently selected mouse to the given position within the window.
   1.167 + *  
   1.168 + *  \param windowID The window to move the mouse into, or 0 for the current mouse focus
   1.169 + *  \param x The x coordinate within the window
   1.170 + *  \param y The y coordinate within the window
   1.171 + *  
   1.172 + *  \note This function generates a mouse motion event
   1.173   */
   1.174  extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_WindowID windowID,
   1.175                                                     int x, int y);
   1.176  
   1.177  /**
   1.178 - * \fn SDL_Cursor *SDL_CreateCursor (const Uint8 * data, const Uint8 * mask, int w, int h, int hot_x, int hot_y)
   1.179 - *
   1.180 - * \brief Create a cursor for the currently selected mouse, using the
   1.181 - *        specified bitmap data and mask (in MSB format).
   1.182 - *
   1.183 - * The cursor width must be a multiple of 8 bits.
   1.184 - *
   1.185 - * The cursor is created in black and white according to the following:
   1.186 - * data  mask    resulting pixel on screen
   1.187 - *  0     1       White
   1.188 - *  1     1       Black
   1.189 - *  0     0       Transparent
   1.190 - *  1     0       Inverted color if possible, black if not.
   1.191 - *
   1.192 - * \sa SDL_FreeCursor()
   1.193 + *  \brief Create a cursor for the currently selected mouse, using the
   1.194 + *         specified bitmap data and mask (in MSB format).
   1.195 + *  
   1.196 + *  The cursor width must be a multiple of 8 bits.
   1.197 + *  
   1.198 + *  The cursor is created in black and white according to the following:
   1.199 + *  <table>
   1.200 + *  <tr><td> data </td><td> mask </td><td> resulting pixel on screen </td></tr>
   1.201 + *  <tr><td>  0   </td><td>  1   </td><td> White </td></tr>
   1.202 + *  <tr><td>  1   </td><td>  1   </td><td> Black </td></tr>
   1.203 + *  <tr><td>  0   </td><td>  0   </td><td> Transparent </td></tr>
   1.204 + *  <tr><td>  1   </td><td>  0   </td><td> Inverted color if possible, black 
   1.205 +                                           if not. </td></tr>
   1.206 + *  </table>
   1.207 + *  
   1.208 + *  \sa SDL_FreeCursor()
   1.209   */
   1.210  extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data,
   1.211                                                       const Uint8 * mask,
   1.212 @@ -176,78 +159,73 @@
   1.213                                                       int hot_y);
   1.214  
   1.215  /**
   1.216 - * \fn void SDL_SetCursor(SDL_Cursor * cursor)
   1.217 - *
   1.218 - * \brief Set the active cursor for the currently selected mouse.
   1.219 - *
   1.220 - * \note The cursor must have been created for the selected mouse.
   1.221 + *  \brief Set the active cursor for the currently selected mouse.
   1.222 + *  
   1.223 + *  \note The cursor must have been created for the selected mouse.
   1.224   */
   1.225  extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor);
   1.226  
   1.227  /**
   1.228 - * \fn SDL_Cursor *SDL_GetCursor(void)
   1.229 - *
   1.230 - * \brief Return the active cursor for the currently selected mouse.
   1.231 + *  \brief Return the active cursor for the currently selected mouse.
   1.232   */
   1.233  extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void);
   1.234  
   1.235  /**
   1.236 - * \fn void SDL_FreeCursor(SDL_Cursor * cursor)
   1.237 - *
   1.238 - * \brief Frees a cursor created with SDL_CreateCursor().
   1.239 - *
   1.240 - * \sa SDL_CreateCursor()
   1.241 + *  \brief Frees a cursor created with SDL_CreateCursor().
   1.242 + *  
   1.243 + *  \sa SDL_CreateCursor()
   1.244   */
   1.245  extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor);
   1.246  
   1.247  /**
   1.248 - * \fn int SDL_ShowCursor(int toggle)
   1.249 - *
   1.250 - * \brief Toggle whether or not the cursor is shown for the currently selected mouse.
   1.251 - *
   1.252 - * \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current state.
   1.253 - *
   1.254 - * \return 1 if the cursor is shown, or 0 if the cursor is hidden.
   1.255 + *  \brief Toggle whether or not the cursor is shown for the currently selected 
   1.256 + *         mouse.
   1.257 + *  
   1.258 + *  \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current 
   1.259 + *                state.
   1.260 + *  
   1.261 + *  \return 1 if the cursor is shown, or 0 if the cursor is hidden.
   1.262   */
   1.263  extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
   1.264  
   1.265 -/* Used as a mask when testing buttons in buttonstate
   1.266 -   Button 1:	Left mouse button
   1.267 -   Button 2:	Middle mouse button
   1.268 -   Button 3:	Right mouse button
   1.269 - */
   1.270 -
   1.271  /**
   1.272 - * \fn int SDL_GetCursorsNumber(int index)
   1.273 - *
   1.274 - * \brief Gets the number of cursors a pointing device supports.
   1.275 - * Useful for tablet users. Useful only under Windows.
   1.276 - *
   1.277 - * \param index is the index of the pointing device, which number of cursors we
   1.278 - * want to receive.
   1.279 - *
   1.280 - * \return the number of cursors supported by the pointing device. On Windows
   1.281 - * if a device is a tablet it returns a number >=1. Normal mice always return 1.
   1.282 - * On Linux every device reports one cursor.
   1.283 + *  \brief Gets the number of cursors a pointing device supports.
   1.284 + *  
   1.285 + *  Useful for tablet users. Useful only under Windows.
   1.286 + *  
   1.287 + *  \param index is the index of the pointing device, which number of cursors we
   1.288 + *               want to receive.
   1.289 + *  
   1.290 + *  \return the number of cursors supported by the pointing device. On Windows
   1.291 + *          if a device is a tablet it returns a number >=1. Normal mice always 
   1.292 + *          return 1.
   1.293 + *  
   1.294 + *  On Linux every device reports one cursor.
   1.295   */
   1.296  extern DECLSPEC int SDLCALL SDL_GetCursorsNumber(int index);
   1.297  
   1.298  /**
   1.299 - * \fn int SDL_GetCurrentCursor(int index)
   1.300 - *
   1.301 - * \brief Returns the index of the current cursor used by a specific pointing
   1.302 - * device. Useful only under Windows.
   1.303 - *
   1.304 - * \param index is the index of the pointing device, which cursor index we want
   1.305 - * to receive.
   1.306 - *
   1.307 - * \return the index of the cursor currently used by a specific pointing device.
   1.308 - * Always 0 under Linux. On Windows if the device isn't a tablet it returns 0.
   1.309 - * If the device is the tablet it returns the cursor index.
   1.310 - * 0 - stylus, 1 - eraser, 2 - cursor.
   1.311 + *  \brief Returns the index of the current cursor used by a specific pointing
   1.312 + *         device.
   1.313 + *  
   1.314 + *  Useful only under Windows.
   1.315 + *  
   1.316 + *  \param index is the index of the pointing device, which cursor index we want
   1.317 + *               to receive.
   1.318 + *  
   1.319 + *  \return the index of the cursor currently used by a specific pointing 
   1.320 + *          device.  Always 0 under Linux. On Windows if the device isn't a 
   1.321 + *          tablet it returns 0.  If the device is the tablet it returns the 
   1.322 + *          cursor index.  0 - stylus, 1 - eraser, 2 - cursor.
   1.323   */
   1.324  extern DECLSPEC int SDLCALL SDL_GetCurrentCursor(int index);
   1.325  
   1.326 +/**
   1.327 + *  Used as a mask when testing buttons in buttonstate.
   1.328 + *   - Button 1:  Left mouse button
   1.329 + *   - Button 2:  Middle mouse button
   1.330 + *   - Button 3:  Right mouse button
   1.331 + */
   1.332  #define SDL_BUTTON(X)		(1 << ((X)-1))
   1.333  #define SDL_BUTTON_LEFT		1
   1.334  #define SDL_BUTTON_MIDDLE	2