annotate include/SDL_touchscreen.h @ 2675:5e4274591163 gsoc2008_nds

Started minor changes to the coordinate system used by the touchscreen API as discussed on the mailing list. Also beginning to separate the 'Pressed' and 'Moved' event handling on the private level.
author Darren Alton <dalton@stevens.edu>
date Sun, 29 Jun 2008 21:32:31 +0000
parents f1d07ba2e275
children
rev   line source
2674
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
1 /*
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
3 Copyright (C) 1997-2006 Sam Lantinga
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
4
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
6 modify it under the terms of the GNU Lesser General Public
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
8 version 2.1 of the License, or (at your option) any later version.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
9
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
13 Lesser General Public License for more details.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
14
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
15 You should have received a copy of the GNU Lesser General Public
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
16 License along with this library; if not, write to the Free Software
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
18
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
19 Sam Lantinga
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
20 slouken@libsdl.org
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
21 */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
22
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
23 /**
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
24 * \file SDL_touchscreen.h
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
25 *
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
26 * Include file for SDL touchscreen event handling
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
27 */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
28
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
29 #ifndef _SDL_touchscreen_h
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
30 #define _SDL_touchscreen_h
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
31
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
32 #include "SDL_stdinc.h"
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
33 #include "SDL_error.h"
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
34
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
35 #include "begin_code.h"
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
36 /* Set up for C function definitions, even when using C++ */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
37 #ifdef __cplusplus
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
38 /* *INDENT-OFF* */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
39 extern "C" {
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
40 /* *INDENT-ON* */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
41 #endif
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
42
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
43 /* In order to use these functions, SDL_Init() must have been called
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
44 with the SDL_INIT_TOUCHSCREEN flag. This causes SDL to scan the system
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
45 for touchscreens, and load appropriate drivers.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
46 */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
47
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
48 /* The touchscreen structure used to identify an SDL touchscreen */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
49 struct _SDL_Touchscreen;
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
50 typedef struct _SDL_Touchscreen SDL_Touchscreen;
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
51
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
52
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
53 /* Function prototypes */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
54 /*
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
55 * Count the number of touchscreens attached to the system
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
56 */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
57 extern DECLSPEC int SDLCALL SDL_NumTouchscreens(void);
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
58
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
59 /*
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
60 * Get the implementation dependent name of a touchscreen.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
61 * This can be called before any touchscreens are opened.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
62 * If no name can be found, this function returns NULL.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
63 */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
64 extern DECLSPEC const char *SDLCALL SDL_TouchscreenName(int device_index);
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
65
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
66 /*
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
67 * Open a touchscreen for use - the index passed as an argument refers to
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
68 * the N'th touchscreen on the system. This index is the value which will
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
69 * identify this touchscreen in future touchscreen events.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
70 *
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
71 * This function returns a touchscreen identifier, or NULL if an error occurred.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
72 */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
73 extern DECLSPEC SDL_Touchscreen *SDLCALL SDL_TouchscreenOpen(int device_index);
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
74
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
75 /*
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
76 * Returns 1 if the touchscreen has been opened, or 0 if it has not.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
77 */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
78 extern DECLSPEC int SDLCALL SDL_TouchscreenOpened(int device_index);
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
79
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
80 /*
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
81 * Get the device index of an opened touchscreen.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
82 */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
83 extern DECLSPEC int SDLCALL SDL_TouchscreenIndex(SDL_Touchscreen * touchscreen);
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
84
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
85 /*
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
86 * Get the number of points a touchscreen can register at a time
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
87 * (single or multi-touch.)
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
88 */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
89 extern DECLSPEC int SDLCALL SDL_TouchscreenMaxPoints(SDL_Touchscreen * touchscreen);
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
90
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
91 /*
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
92 * Update the current state of the open touchscreens.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
93 * This is called automatically by the event loop if any touchscreen
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
94 * events are enabled.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
95 */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
96 extern DECLSPEC void SDLCALL SDL_TouchscreenUpdate(void);
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
97
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
98 /*
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
99 * Enable/disable touchscreen event polling.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
100 * If touchscreen events are disabled, you must call SDL_TouchscreenUpdate()
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
101 * yourself and check the state of the touchscreen when you want touchscreen
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
102 * information.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
103 * The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
104 */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
105 extern DECLSPEC int SDLCALL SDL_TouchscreenEventState(int state);
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
106
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
107 /*
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
108 * Get the current X,Y position of the indicated point on the touchscreen.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
109 *
2675
5e4274591163 Started minor changes to the coordinate system used by the touchscreen API as discussed on the mailing list. Also beginning to separate the 'Pressed' and 'Moved' event handling on the private level.
Darren Alton <dalton@stevens.edu>
parents: 2674
diff changeset
110 * If not NULL, *x is set to an unsigned integer in the range [1,65535]
5e4274591163 Started minor changes to the coordinate system used by the touchscreen API as discussed on the mailing list. Also beginning to separate the 'Pressed' and 'Moved' event handling on the private level.
Darren Alton <dalton@stevens.edu>
parents: 2674
diff changeset
111 * where 1 is the left edge, 32768 is roughly center, 65535 is right edge.
2674
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
112 * Similarly with *y, for the top, center, and bottom, respectively.
2675
5e4274591163 Started minor changes to the coordinate system used by the touchscreen API as discussed on the mailing list. Also beginning to separate the 'Pressed' and 'Moved' event handling on the private level.
Darren Alton <dalton@stevens.edu>
parents: 2674
diff changeset
113 * The returned value is an unsigned integer in the range [1,65535],
5e4274591163 Started minor changes to the coordinate system used by the touchscreen API as discussed on the mailing list. Also beginning to separate the 'Pressed' and 'Moved' event handling on the private level.
Darren Alton <dalton@stevens.edu>
parents: 2674
diff changeset
114 * which represents the pressure of the touch. This should be 32767 in
5e4274591163 Started minor changes to the coordinate system used by the touchscreen API as discussed on the mailing list. Also beginning to separate the 'Pressed' and 'Moved' event handling on the private level.
Darren Alton <dalton@stevens.edu>
parents: 2674
diff changeset
115 * non-pressure-sensitive driver implementations.
2674
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
116 * If not being touched, 0 is returned and *x and *y are unmodified.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
117 *
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
118 * The touch point indices start at index 0.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
119 * If given a negative value for point, all the X,Y, and pressures
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
120 * for all the currently touched points on a multitouch device
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
121 * should be averaged and used for *x, *y, and the return value.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
122 * If the value of point exceeds the number of points currently touched,
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
123 * 0 should be returned, and *x, *y should be left unmodified.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
124 *
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
125 * On error, -1 is returned.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
126 */
2675
5e4274591163 Started minor changes to the coordinate system used by the touchscreen API as discussed on the mailing list. Also beginning to separate the 'Pressed' and 'Moved' event handling on the private level.
Darren Alton <dalton@stevens.edu>
parents: 2674
diff changeset
127 extern DECLSPEC Uint16 SDLCALL SDL_TouchscreenGetXY(SDL_Touchscreen *touchscreen,
5e4274591163 Started minor changes to the coordinate system used by the touchscreen API as discussed on the mailing list. Also beginning to separate the 'Pressed' and 'Moved' event handling on the private level.
Darren Alton <dalton@stevens.edu>
parents: 2674
diff changeset
128 int point, Uint16 *x, Uint16 *y);
2674
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
129
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
130 /*
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
131 * Get the number of currently touched points on a touchscreen.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
132 * This is either 0 or 1 for a single-touch device.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
133 * On error, -1 is returned.
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
134 */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
135 extern DECLSPEC int SDLCALL SDL_TouchscreenGetPoints(SDL_Touchscreen * touchscreen);
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
136
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
137 /*
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
138 * Close a touchscreen previously opened with SDL_TouchscreenOpen()
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
139 */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
140 extern DECLSPEC void SDLCALL SDL_TouchscreenClose(SDL_Touchscreen * touchscreen);
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
141
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
142
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
143 /* Ends C function definitions when using C++ */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
144 #ifdef __cplusplus
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
145 /* *INDENT-OFF* */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
146 }
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
147 /* *INDENT-ON* */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
148 #endif
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
149 #include "close_code.h"
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
150
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
151 #endif /* _SDL_touchscreen_h */
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
152
f1d07ba2e275 Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
153 /* vi: set ts=4 sw=4 expandtab: */