src/events/SDL_mouse_c.h
branchSDL-1.3
changeset 1671 89f7510fe17a
parent 1670 eef792d31de8
child 1722 5daa04d862f1
     1.1 --- a/src/events/SDL_mouse_c.h	Wed Jun 07 16:10:28 2006 +0000
     1.2 +++ b/src/events/SDL_mouse_c.h	Fri Jun 09 06:42:42 2006 +0000
     1.3 @@ -24,23 +24,81 @@
     1.4  #ifndef _SDL_mouse_c_h
     1.5  #define _SDL_mouse_c_h
     1.6  
     1.7 -typedef struct
     1.8 +typedef struct SDL_Mouse SDL_Mouse;
     1.9 +
    1.10 +struct SDL_Cursor
    1.11 +{
    1.12 +    SDL_Mouse *mouse;
    1.13 +
    1.14 +    SDL_Cursor *next;
    1.15 +
    1.16 +    void *driverdata;
    1.17 +};
    1.18 +
    1.19 +struct SDL_Mouse
    1.20  {
    1.21 +    /* Create a cursor from a surface */
    1.22 +    SDL_Cursor *(*CreateCursor) (SDL_Surface * surface, int hot_x, int hot_y);
    1.23 +
    1.24 +    /* Show the specified cursor, or hide if cursor is NULL */
    1.25 +    int (*ShowCursor) (SDL_Cursor * cursor);
    1.26 +
    1.27 +    /* This is called when a mouse motion event occurs */
    1.28 +    void (*MoveCursor) (SDL_Cursor * cursor);
    1.29 +
    1.30 +    /* Free a window manager cursor */
    1.31 +    void (*FreeCursor) (SDL_Cursor * cursor);
    1.32 +
    1.33 +    /* Warp the mouse to (x,y) */
    1.34 +    void (*WarpMouse) (SDL_Mouse * mouse, SDL_WindowID windowID, int x,
    1.35 +                       int y);
    1.36 +
    1.37 +    /* Free the mouse when it's time */
    1.38 +    void (*FreeMouse) (SDL_Mouse * mouse);
    1.39 +
    1.40 +    /* Data common to all mice */
    1.41      SDL_WindowID focus;
    1.42      int x;
    1.43      int y;
    1.44      int xdelta;
    1.45      int ydelta;
    1.46      Uint8 buttonstate;
    1.47 -} SDL_Mouse;
    1.48 +
    1.49 +    SDL_Cursor *cursors;
    1.50 +    SDL_Cursor *def_cursor;
    1.51 +    SDL_Cursor *cur_cursor;
    1.52 +    SDL_bool cursor_shown;
    1.53  
    1.54 +    void *driverdata;
    1.55 +};
    1.56 +
    1.57 +
    1.58 +/* Initialize the mouse subsystem */
    1.59  extern int SDL_MouseInit(void);
    1.60 -extern int SDL_AddMouse(SDL_WindowID focus, int x, int y, Uint8 buttonstate);
    1.61 +
    1.62 +/* Get the mouse at an index */
    1.63  extern SDL_Mouse *SDL_GetMouse(int index);
    1.64 +
    1.65 +/* Add a mouse, possibly reattaching at a particular index (or -1),
    1.66 +   returning the index of the mouse, or -1 if there was an error.
    1.67 + */
    1.68 +extern int SDL_AddMouse(const SDL_Mouse * mouse, int index);
    1.69 +
    1.70 +/* Remove a mouse at an index, clearing the slot for later */
    1.71 +extern void SDL_DelMouse(int index);
    1.72 +
    1.73 +/* Clear the button state of a mouse at an index */
    1.74 +extern void SDL_ResetMouse(int index);
    1.75 +
    1.76 +/* Send a mouse motion event for a mouse at an index */
    1.77  extern int SDL_SendMouseMotion(int index, SDL_WindowID windowID, int relative,
    1.78                                 int x, int y);
    1.79 +
    1.80 +/* Send a mouse button event for a mouse at an index */
    1.81  extern int SDL_SendMouseButton(int index, SDL_WindowID windowID, Uint8 state,
    1.82                                 Uint8 button);
    1.83 +
    1.84 +/* Shutdown the mouse subsystem */
    1.85  extern void SDL_MouseQuit(void);
    1.86  
    1.87  #endif /* _SDL_mouse_c_h */