include/SDL_mouse.h
branchSDL-1.3
changeset 1670 eef792d31de8
parent 1668 4da1ee79c9af
child 1671 89f7510fe17a
     1.1 --- a/include/SDL_mouse.h	Mon May 29 05:08:33 2006 +0000
     1.2 +++ b/include/SDL_mouse.h	Wed Jun 07 16:10:28 2006 +0000
     1.3 @@ -41,28 +41,53 @@
     1.4  /* *INDENT-ON* */
     1.5  #endif
     1.6  
     1.7 -typedef struct WMcursor WMcursor;       /* Implementation dependent */
     1.8 -typedef struct SDL_Cursor
     1.9 -{
    1.10 -    SDL_Rect area;              /* The area of the mouse cursor */
    1.11 -    Sint16 hot_x, hot_y;        /* The "tip" of the cursor */
    1.12 -    Uint8 *data;                /* B/W cursor data */
    1.13 -    Uint8 *mask;                /* B/W cursor mask */
    1.14 -    Uint8 *save[2];             /* Place to save cursor area */
    1.15 -    WMcursor *wm_cursor;        /* Window-manager cursor */
    1.16 -} SDL_Cursor;
    1.17 +typedef struct SDL_Cursor SDL_Cursor;   /* Implementation dependent */
    1.18  
    1.19  /* Function prototypes */
    1.20 +
    1.21 +/* \fn int SDL_GetNumMice(void)
    1.22 + *
    1.23 + * \brief Get the number of mouse input devices available.
    1.24 + *
    1.25 + * \sa SDL_SelectMouse()
    1.26 + */
    1.27 +extern DECLSPEC int SDLCALL SDL_GetNumMice(void);
    1.28 +
    1.29 +/* \fn int SDL_SelectMouse(int index)
    1.30 + *
    1.31 + * \brief Set the index of the currently selected mouse.
    1.32 + *
    1.33 + * \return The index of the currently selected mouse.
    1.34 + *
    1.35 + * \note You can query the currently selected mouse by passing an index of -1.
    1.36 + *
    1.37 + * \sa SDL_GetNumMice()
    1.38 + */
    1.39 +extern DECLSPEC int SDLCALL SDL_SelectMouse(int index);
    1.40 +
    1.41 +/* \fn SDL_WindowID SDL_GetMouseFocusWindow(void)
    1.42 + *
    1.43 + * \brief Get the window which currently has focus for the currently selected mouse.
    1.44 + */
    1.45 +extern DECLSPEC SDL_WindowID SDLCALL SDL_GetMouseFocusWindow(void);
    1.46 +
    1.47  /*
    1.48 - * Retrieve the current state of the mouse.
    1.49 + * \fn Uint8 SDL_GetMouseState(int *x, int *y)
    1.50 + *
    1.51 + * \brief Retrieve the current state of the mouse.
    1.52 + *
    1.53   * The current button state is returned as a button bitmask, which can
    1.54   * be tested using the SDL_BUTTON(X) macros, and x and y are set to the
    1.55 - * current mouse cursor position.  You can pass NULL for either x or y.
    1.56 + * mouse cursor position relative to the focus window for the currently
    1.57 + * selected mouse.  You can pass NULL for either x or y.
    1.58   */
    1.59  extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y);
    1.60  
    1.61  /*
    1.62 - * Retrieve the current state of the mouse.
    1.63 + * \fn Uint8 SDL_GetRelativeMouseState(int *x, int *y)
    1.64 + *
    1.65 + * \brief Retrieve the current state of the mouse.
    1.66 + *
    1.67   * The current button state is returned as a button bitmask, which can
    1.68   * be tested using the SDL_BUTTON(X) macros, and x and y are set to the
    1.69   * mouse deltas since the last call to SDL_GetRelativeMouseState().
    1.70 @@ -70,9 +95,18 @@
    1.71  extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
    1.72  
    1.73  /*
    1.74 - * Set the position of the mouse cursor (generates a mouse motion event)
    1.75 + * \fn void SDL_WarpMouseInWindow(SDL_WindowID windowID, int x, int y)
    1.76 + *
    1.77 + * \brief Moves the currently selected mouse to the given position within the window.
    1.78 + *
    1.79 + * \param windowID The window to move the mouse into, or 0 for the current mouse focus
    1.80 + * \param x The x coordinate within the window
    1.81 + * \param y The y coordinate within the window
    1.82 + *
    1.83 + * \note This function generates a mouse motion event
    1.84   */
    1.85 -extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);
    1.86 +extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_WindowID windowID,
    1.87 +                                                   int x, int y);
    1.88  
    1.89  /*
    1.90   * Create a cursor using the specified data and mask (in MSB format).