src/events/SDL_mouse_c.h
changeset 5371 fc3d3d580777
parent 5262 b530ef003506
child 5376 183ec2d4485c
equal deleted inserted replaced
5370:cb219a294ebf 5371:fc3d3d580777
    22 #include "SDL_config.h"
    22 #include "SDL_config.h"
    23 
    23 
    24 #ifndef _SDL_mouse_c_h
    24 #ifndef _SDL_mouse_c_h
    25 #define _SDL_mouse_c_h
    25 #define _SDL_mouse_c_h
    26 
    26 
       
    27 #include "SDL_mouse.h"
       
    28 
    27 struct SDL_Cursor
    29 struct SDL_Cursor
    28 {
    30 {
    29     struct SDL_Cursor *next;
    31     struct SDL_Cursor *next;
    30     void *driverdata;
    32     void *driverdata;
    31 };
    33 };
    32 
    34 
       
    35 typedef struct
       
    36 {
       
    37     /* Create a cursor from a surface */
       
    38     SDL_Cursor *(*CreateCursor) (SDL_Surface * surface, int hot_x, int hot_y);
       
    39 
       
    40     /* Show the specified cursor, or hide if cursor is NULL */
       
    41     int (*ShowCursor) (SDL_Cursor * cursor);
       
    42 
       
    43     /* This is called when a mouse motion event occurs */
       
    44     void (*MoveCursor) (SDL_Cursor * cursor);
       
    45 
       
    46     /* Free a window manager cursor */
       
    47     void (*FreeCursor) (SDL_Cursor * cursor);
       
    48 
       
    49     /* Warp the mouse to (x,y) */
       
    50     void (*WarpMouse) (SDL_Window * window, int x, int y);
       
    51 
       
    52     /* Data common to all mice */
       
    53     SDL_Window *focus;
       
    54     int x;
       
    55     int y;
       
    56     int xdelta;
       
    57     int ydelta;
       
    58     int last_x, last_y;         /* the last reported x and y coordinates */
       
    59     Uint8 buttonstate;
       
    60     SDL_bool relative_mode;
       
    61 
       
    62     SDL_Cursor *cursors;
       
    63     SDL_Cursor *def_cursor;
       
    64     SDL_Cursor *cur_cursor;
       
    65     SDL_bool cursor_shown;
       
    66 } SDL_Mouse;
       
    67 
       
    68 
    33 /* Initialize the mouse subsystem */
    69 /* Initialize the mouse subsystem */
    34 extern int SDL_MouseInit(void);
    70 extern int SDL_MouseInit(void);
       
    71 
       
    72 /* Get the mouse state structure */
       
    73 SDL_Mouse *SDL_GetMouse(void);
    35 
    74 
    36 /* Clear the mouse state */
    75 /* Clear the mouse state */
    37 extern void SDL_ResetMouse(void);
    76 extern void SDL_ResetMouse(void);
    38 
    77 
    39 /* Set the mouse focus window */
    78 /* Set the mouse focus window */