annotate include/SDL_touch.h @ 4677:31607094315c

Added Iphone project. Iphone multi-touch is now functional.
author jimtla
date Sat, 31 Jul 2010 01:24:50 +0400
parents 99b4560b7aa1
children f8431f66613d
rev   line source
4646
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
1 /*
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
3 Copyright (C) 1997-2010 Sam Lantinga
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
4
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
6 modify it under the terms of the GNU Lesser General Public
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
8 version 2.1 of the License, or (at your option) any later version.
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
9
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
13 Lesser General Public License for more details.
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
14
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
15 You should have received a copy of the GNU Lesser General Public
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
16 License along with this library; if not, write to the Free Software
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
18
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
19 Sam Lantinga
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
20 slouken@libsdl.org
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
21 */
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
22
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
23 /**
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
24 * \file SDL_touch.h
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
25 *
4659
063b9455bd1a Added some files I had previosuly missed
Jim Grandpre <jim.tla@gmail.com>
parents: 4655
diff changeset
26 * Include file for SDL touch event handling.
4646
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
27 */
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
28
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
29 #ifndef _SDL_touch_h
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
30 #define _SDL_touch_h
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
31
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
32 #include "SDL_stdinc.h"
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
33 #include "SDL_error.h"
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
34 #include "SDL_video.h"
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
35
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
36 #include "begin_code.h"
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
37 /* Set up for C function definitions, even when using C++ */
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
38 #ifdef __cplusplus
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
39 /* *INDENT-OFF* */
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
40 extern "C" {
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
41 /* *INDENT-ON* */
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
42 #endif
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
43
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
44
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
45 struct SDL_Finger {
4676
99b4560b7aa1 Upgraded touchId/fingerId to long. Changed position variables to floats.
jimtla
parents: 4659
diff changeset
46 long id;
99b4560b7aa1 Upgraded touchId/fingerId to long. Changed position variables to floats.
jimtla
parents: 4659
diff changeset
47 float x;
99b4560b7aa1 Upgraded touchId/fingerId to long. Changed position variables to floats.
jimtla
parents: 4659
diff changeset
48 float y;
99b4560b7aa1 Upgraded touchId/fingerId to long. Changed position variables to floats.
jimtla
parents: 4659
diff changeset
49 float xdelta;
99b4560b7aa1 Upgraded touchId/fingerId to long. Changed position variables to floats.
jimtla
parents: 4659
diff changeset
50 float ydelta;
99b4560b7aa1 Upgraded touchId/fingerId to long. Changed position variables to floats.
jimtla
parents: 4659
diff changeset
51 float last_x, last_y,last_pressure; /* the last reported coordinates */
4655
4c94f2023d62 Fixed bugs in input, cleaned up $1
Jim Grandpre <jim.tla@gmail.com>
parents: 4649
diff changeset
52 SDL_bool down;
4676
99b4560b7aa1 Upgraded touchId/fingerId to long. Changed position variables to floats.
jimtla
parents: 4659
diff changeset
53 float pressure;
4646
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
54 };
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
55
4649
35a80b0791aa Addition of VC project for touchTest.c
jimtla
parents: 4646
diff changeset
56 typedef struct SDL_Touch SDL_Touch;
35a80b0791aa Addition of VC project for touchTest.c
jimtla
parents: 4646
diff changeset
57 typedef struct SDL_Finger SDL_Finger;
4646
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
58
4649
35a80b0791aa Addition of VC project for touchTest.c
jimtla
parents: 4646
diff changeset
59
35a80b0791aa Addition of VC project for touchTest.c
jimtla
parents: 4646
diff changeset
60 struct SDL_Touch {
4646
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
61
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
62 /* Free the touch when it's time */
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
63 void (*FreeTouch) (SDL_Touch * touch);
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
64
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
65 /* data common for tablets */
4676
99b4560b7aa1 Upgraded touchId/fingerId to long. Changed position variables to floats.
jimtla
parents: 4659
diff changeset
66 float pressure_max, pressure_min;
99b4560b7aa1 Upgraded touchId/fingerId to long. Changed position variables to floats.
jimtla
parents: 4659
diff changeset
67 float x_max,x_min;
99b4560b7aa1 Upgraded touchId/fingerId to long. Changed position variables to floats.
jimtla
parents: 4659
diff changeset
68 float y_max,y_min;
99b4560b7aa1 Upgraded touchId/fingerId to long. Changed position variables to floats.
jimtla
parents: 4659
diff changeset
69 float xres,yres,pressureres;
99b4560b7aa1 Upgraded touchId/fingerId to long. Changed position variables to floats.
jimtla
parents: 4659
diff changeset
70 float tilt; /* for future use */
99b4560b7aa1 Upgraded touchId/fingerId to long. Changed position variables to floats.
jimtla
parents: 4659
diff changeset
71 float rotation; /* for future use */
4646
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
72
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
73 /* Data common to all touch */
4676
99b4560b7aa1 Upgraded touchId/fingerId to long. Changed position variables to floats.
jimtla
parents: 4659
diff changeset
74 long id;
4646
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
75 SDL_Window *focus;
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
76
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
77 char *name;
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
78 Uint8 buttonstate;
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
79 SDL_bool relative_mode;
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
80 SDL_bool flush_motion;
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
81
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
82 int num_fingers;
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
83 int max_fingers;
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
84 SDL_Finger** fingers;
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
85
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
86 void *driverdata;
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
87 };
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
88
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
89
4649
35a80b0791aa Addition of VC project for touchTest.c
jimtla
parents: 4646
diff changeset
90
4646
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
91 /* Function prototypes */
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
92
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
93 /**
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
94 * \brief Get the touch object at the given id.
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
95 *
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
96 *
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
97 */
4676
99b4560b7aa1 Upgraded touchId/fingerId to long. Changed position variables to floats.
jimtla
parents: 4659
diff changeset
98 extern DECLSPEC SDL_Touch* SDLCALL SDL_GetTouch(long id);
4646
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
99
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
100
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
101
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
102 /**
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
103 * \brief Get the finger object of the given touch, at the given id.
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
104 *
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
105 *
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
106 */
4676
99b4560b7aa1 Upgraded touchId/fingerId to long. Changed position variables to floats.
jimtla
parents: 4659
diff changeset
107 extern DECLSPEC SDL_Finger* SDLCALL SDL_GetFinger(SDL_Touch *touch, long id);
4646
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
108
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
109 /* Ends C function definitions when using C++ */
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
110 #ifdef __cplusplus
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
111 /* *INDENT-OFF* */
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
112 }
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
113 /* *INDENT-ON* */
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
114 #endif
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
115 #include "close_code.h"
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
116
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
117 #endif /* _SDL_mouse_h */
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
118
eea1bf53effa Added include/touch.h Now reading in resolution of touch pad.
Jim Grandpre <jim.tla@gmail.com>
parents:
diff changeset
119 /* vi: set ts=4 sw=4 expandtab: */