src/events/SDL_mouse_c.h
changeset 1895 c121d94672cb
child 2152 003c1b5b07da
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/events/SDL_mouse_c.h	Mon Jul 10 21:04:37 2006 +0000
     1.3 @@ -0,0 +1,112 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997-2006 Sam Lantinga
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Lesser General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2.1 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Lesser General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Lesser General Public
    1.19 +    License along with this library; if not, write to the Free Software
    1.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1.21 +
    1.22 +    Sam Lantinga
    1.23 +    slouken@libsdl.org
    1.24 +*/
    1.25 +#include "SDL_config.h"
    1.26 +
    1.27 +#ifndef _SDL_mouse_c_h
    1.28 +#define _SDL_mouse_c_h
    1.29 +
    1.30 +typedef struct SDL_Mouse SDL_Mouse;
    1.31 +
    1.32 +struct SDL_Cursor
    1.33 +{
    1.34 +    SDL_Mouse *mouse;
    1.35 +
    1.36 +    SDL_Cursor *next;
    1.37 +
    1.38 +    void *driverdata;
    1.39 +};
    1.40 +
    1.41 +struct SDL_Mouse
    1.42 +{
    1.43 +    /* Create a cursor from a surface */
    1.44 +    SDL_Cursor *(*CreateCursor) (SDL_Surface * surface, int hot_x, int hot_y);
    1.45 +
    1.46 +    /* Show the specified cursor, or hide if cursor is NULL */
    1.47 +    int (*ShowCursor) (SDL_Cursor * cursor);
    1.48 +
    1.49 +    /* This is called when a mouse motion event occurs */
    1.50 +    void (*MoveCursor) (SDL_Cursor * cursor);
    1.51 +
    1.52 +    /* Free a window manager cursor */
    1.53 +    void (*FreeCursor) (SDL_Cursor * cursor);
    1.54 +
    1.55 +    /* Warp the mouse to (x,y) */
    1.56 +    void (*WarpMouse) (SDL_Mouse * mouse, SDL_WindowID windowID, int x,
    1.57 +                       int y);
    1.58 +
    1.59 +    /* Free the mouse when it's time */
    1.60 +    void (*FreeMouse) (SDL_Mouse * mouse);
    1.61 +
    1.62 +    /* Data common to all mice */
    1.63 +    SDL_WindowID focus;
    1.64 +    int x;
    1.65 +    int y;
    1.66 +    int xdelta;
    1.67 +    int ydelta;
    1.68 +    Uint8 buttonstate;
    1.69 +    SDL_bool relative_mode;
    1.70 +    SDL_bool flush_motion;
    1.71 +
    1.72 +    SDL_Cursor *cursors;
    1.73 +    SDL_Cursor *def_cursor;
    1.74 +    SDL_Cursor *cur_cursor;
    1.75 +    SDL_bool cursor_shown;
    1.76 +
    1.77 +    void *driverdata;
    1.78 +};
    1.79 +
    1.80 +
    1.81 +/* Initialize the mouse subsystem */
    1.82 +extern int SDL_MouseInit(void);
    1.83 +
    1.84 +/* Get the mouse at an index */
    1.85 +extern SDL_Mouse *SDL_GetMouse(int index);
    1.86 +
    1.87 +/* Add a mouse, possibly reattaching at a particular index (or -1),
    1.88 +   returning the index of the mouse, or -1 if there was an error.
    1.89 + */
    1.90 +extern int SDL_AddMouse(const SDL_Mouse * mouse, int index);
    1.91 +
    1.92 +/* Remove a mouse at an index, clearing the slot for later */
    1.93 +extern void SDL_DelMouse(int index);
    1.94 +
    1.95 +/* Clear the button state of a mouse at an index */
    1.96 +extern void SDL_ResetMouse(int index);
    1.97 +
    1.98 +/* Set the mouse focus window */
    1.99 +extern void SDL_SetMouseFocus(int index, SDL_WindowID windowID);
   1.100 +
   1.101 +/* Send a mouse motion event for a mouse at an index */
   1.102 +extern int SDL_SendMouseMotion(int index, int relative, int x, int y);
   1.103 +
   1.104 +/* Send a mouse button event for a mouse at an index */
   1.105 +extern int SDL_SendMouseButton(int index, Uint8 state, Uint8 button);
   1.106 +
   1.107 +/* Send a mouse wheel event for a mouse at an index */
   1.108 +extern int SDL_SendMouseWheel(int index, int motion);
   1.109 +
   1.110 +/* Shutdown the mouse subsystem */
   1.111 +extern void SDL_MouseQuit(void);
   1.112 +
   1.113 +#endif /* _SDL_mouse_c_h */
   1.114 +
   1.115 +/* vi: set ts=4 sw=4 expandtab: */