src/events/SDL_mouse_c.h
branchgsoc2008_manymouse
changeset 3769 fe32943f86ec
parent 3767 abc8acb8e3d7
child 3773 3b5691f85c0d
     1.1 --- a/src/events/SDL_mouse_c.h	Wed Jul 30 16:09:24 2008 +0000
     1.2 +++ b/src/events/SDL_mouse_c.h	Wed Jul 30 16:20:32 2008 +0000
     1.3 @@ -1,131 +1,132 @@
     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 which;
    1.65 -    int x;
    1.66 -    int y;
    1.67 -    int z;/*for future use*/
    1.68 -    int xdelta;
    1.69 -    int ydelta;
    1.70 -    int pressure;
    1.71 -    int pressure_max;
    1.72 -    int pressure_min;
    1.73 -    int tilt;/*for future use*/
    1.74 -    int rotation;/*for future use*/
    1.75 -    char* name;
    1.76 -    Uint8 buttonstate;
    1.77 -    SDL_bool relative_mode;
    1.78 -    SDL_bool proximity;
    1.79 -    SDL_bool flush_motion;
    1.80 -
    1.81 -    SDL_Cursor *cursors;
    1.82 -    SDL_Cursor *def_cursor;
    1.83 -    SDL_Cursor *cur_cursor;
    1.84 -    SDL_bool cursor_shown;
    1.85 -
    1.86 -    void *driverdata;
    1.87 -};
    1.88 -
    1.89 -
    1.90 -/* Initialize the mouse subsystem */
    1.91 -extern int SDL_MouseInit(void);
    1.92 -
    1.93 -/* Get the mouse at an index */
    1.94 -extern SDL_Mouse *SDL_GetMouse(int index);
    1.95 -
    1.96 -/* Add a mouse, possibly reattaching at a particular index (or -1),
    1.97 -   returning the index of the mouse, or -1 if there was an error.
    1.98 - */
    1.99 -extern int SDL_AddMouse(const SDL_Mouse * mouse, int index, char* name, int pressure_max, int pressure_min);
   1.100 -
   1.101 -/* Remove a mouse at an index, clearing the slot for later */
   1.102 -extern void SDL_DelMouse(int index);
   1.103 -
   1.104 -/* Clear the button state of a mouse at an index */
   1.105 -extern void SDL_ResetMouse(int index);
   1.106 -
   1.107 -/* Set the mouse focus window */
   1.108 -extern void SDL_SetMouseFocus(int index, SDL_WindowID windowID);
   1.109 -
   1.110 -/* Send a mouse motion event for a mouse at an index */
   1.111 -extern int SDL_SendMouseMotion(int index, int relative, int x, int y, int z);
   1.112 -
   1.113 -/* Send a mouse button event for a mouse at an index */
   1.114 -extern int SDL_SendMouseButton(int index, Uint8 state, Uint8 button);
   1.115 -
   1.116 -/* Send a mouse wheel event for a mouse at an index */
   1.117 -extern int SDL_SendMouseWheel(int index, int x, int y);
   1.118 -
   1.119 -/* Shutdown the mouse subsystem */
   1.120 -extern void SDL_MouseQuit(void);
   1.121 -
   1.122 -extern int SDL_GetIndexById(int id);
   1.123 -
   1.124 -extern int SDL_SetIndexId(int id, int index);
   1.125 -
   1.126 -extern int SDL_GetNumOfMice(void);
   1.127 -
   1.128 -extern char* SDL_GetMouseName(int index);
   1.129 -
   1.130 -extern void SDL_UpdateCoordinates(int x, int y);
   1.131 -
   1.132 -#endif /* _SDL_mouse_c_h */
   1.133 -
   1.134 -/* vi: set ts=4 sw=4 expandtab: */
   1.135 +/*
   1.136 +    SDL - Simple DirectMedia Layer
   1.137 +    Copyright (C) 1997-2006 Sam Lantinga
   1.138 +
   1.139 +    This library is free software; you can redistribute it and/or
   1.140 +    modify it under the terms of the GNU Lesser General Public
   1.141 +    License as published by the Free Software Foundation; either
   1.142 +    version 2.1 of the License, or (at your option) any later version.
   1.143 +
   1.144 +    This library is distributed in the hope that it will be useful,
   1.145 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   1.146 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   1.147 +    Lesser General Public License for more details.
   1.148 +
   1.149 +    You should have received a copy of the GNU Lesser General Public
   1.150 +    License along with this library; if not, write to the Free Software
   1.151 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   1.152 +
   1.153 +    Sam Lantinga
   1.154 +    slouken@libsdl.org
   1.155 +*/
   1.156 +#include "SDL_config.h"
   1.157 +
   1.158 +#ifndef _SDL_mouse_c_h
   1.159 +#define _SDL_mouse_c_h
   1.160 +
   1.161 +typedef struct SDL_Mouse SDL_Mouse;
   1.162 +
   1.163 +struct SDL_Cursor
   1.164 +{
   1.165 +    SDL_Mouse *mouse;
   1.166 +
   1.167 +    SDL_Cursor *next;
   1.168 +
   1.169 +    void *driverdata;
   1.170 +};
   1.171 +
   1.172 +struct SDL_Mouse
   1.173 +{
   1.174 +    /* Create a cursor from a surface */
   1.175 +    SDL_Cursor *(*CreateCursor) (SDL_Surface * surface, int hot_x, int hot_y);
   1.176 +
   1.177 +    /* Show the specified cursor, or hide if cursor is NULL */
   1.178 +    int (*ShowCursor) (SDL_Cursor * cursor);
   1.179 +
   1.180 +    /* This is called when a mouse motion event occurs */
   1.181 +    void (*MoveCursor) (SDL_Cursor * cursor);
   1.182 +
   1.183 +    /* Free a window manager cursor */
   1.184 +    void (*FreeCursor) (SDL_Cursor * cursor);
   1.185 +
   1.186 +    /* Warp the mouse to (x,y) */
   1.187 +    void (*WarpMouse) (SDL_Mouse * mouse, SDL_WindowID windowID, int x,
   1.188 +                       int y);
   1.189 +
   1.190 +    /* Free the mouse when it's time */
   1.191 +    void (*FreeMouse) (SDL_Mouse * mouse);
   1.192 +
   1.193 +    /* Data common to all mice */
   1.194 +    SDL_WindowID focus;
   1.195 +    int which;
   1.196 +    int x;
   1.197 +    int y;
   1.198 +    int z;/*for future use*/
   1.199 +    int xdelta;
   1.200 +    int ydelta;
   1.201 +    int pressure;
   1.202 +    int pressure_max;
   1.203 +    int pressure_min;
   1.204 +    int tilt;/*for future use*/
   1.205 +    int rotation;/*for future use*/
   1.206 +    char* name;
   1.207 +    Uint8 buttonstate;
   1.208 +    SDL_bool relative_mode;
   1.209 +    SDL_bool proximity;
   1.210 +    SDL_bool flush_motion;
   1.211 +
   1.212 +    SDL_Cursor *cursors;
   1.213 +    SDL_Cursor *def_cursor;
   1.214 +    SDL_Cursor *cur_cursor;
   1.215 +    SDL_bool cursor_shown;
   1.216 +
   1.217 +    void *driverdata;
   1.218 +};
   1.219 +
   1.220 +
   1.221 +/* Initialize the mouse subsystem */
   1.222 +extern int SDL_MouseInit(void);
   1.223 +
   1.224 +/* Get the mouse at an index */
   1.225 +extern SDL_Mouse *SDL_GetMouse(int index);
   1.226 +
   1.227 +/* Add a mouse, possibly reattaching at a particular index (or -1),
   1.228 +   returning the index of the mouse, or -1 if there was an error.
   1.229 + */
   1.230 +extern int SDL_AddMouse(const SDL_Mouse * mouse, int index, char* name, int pressure_max, int pressure_min);
   1.231 +
   1.232 +/* Remove a mouse at an index, clearing the slot for later */
   1.233 +extern void SDL_DelMouse(int index);
   1.234 +
   1.235 +/* Clear the button state of a mouse at an index */
   1.236 +extern void SDL_ResetMouse(int index);
   1.237 +
   1.238 +/* Set the mouse focus window */
   1.239 +extern void SDL_SetMouseFocus(int index, SDL_WindowID windowID);
   1.240 +
   1.241 +/* Send a mouse motion event for a mouse at an index */
   1.242 +extern int SDL_SendMouseMotion(int index, int relative, int x, int y, int z);
   1.243 +
   1.244 +/* Send a mouse button event for a mouse at an index */
   1.245 +extern int SDL_SendMouseButton(int index, Uint8 state, Uint8 button);
   1.246 +
   1.247 +/* Send a mouse wheel event for a mouse at an index */
   1.248 +extern int SDL_SendMouseWheel(int index, int x, int y);
   1.249 +
   1.250 +/* Shutdown the mouse subsystem */
   1.251 +extern void SDL_MouseQuit(void);
   1.252 +
   1.253 +extern int SDL_GetIndexById(int id);
   1.254 +
   1.255 +extern int SDL_SetIndexId(int id, int index);
   1.256 +
   1.257 +extern int SDL_GetNumOfMice(void);
   1.258 +
   1.259 +extern char* SDL_GetMouseName(int index);
   1.260 +
   1.261 +extern void SDL_UpdateCoordinates(int x, int y);
   1.262 +
   1.263 +#endif /* _SDL_mouse_c_h */
   1.264 +
   1.265 +/* vi: set ts=4 sw=4 expandtab: */
   1.266 +