42 Commits

Author SHA1 Message Date
Ryan C. Gordon
1c1706a00b
fnsince: update \since policy for documentation.
Everything in SDL3 up to the ABI lock is reported as available since 3.1.3.
Everything else will be reported as since 3.2.0 (what will be the first
official release).

Also ran a Perl script over the headers to change everything to 3.1.3 that
wasn't an API function, since fnsince.pl can't manage those. If there's a
macro or datatype that has snuck in that needs to be 3.2.0 instead, we'll
have to manually fix it up, but it shouldn't be a big deal in any case.

Reference PR #11304.
2024-10-23 12:22:43 -04:00
Ryan C. Gordon
b4fcd1f345
pen: Corrected some documentation.
Fixes #10863.
2024-10-01 10:24:17 -04:00
Sam Lantinga
37c9fb490e Changed enums to use XXX_COUNT for the count or number of values
Fixes https://github.com/libsdl-org/SDL/issues/10763
2024-09-11 09:32:17 -07:00
Maia
0da2bd49c8 Remove unused includes. This only removes includes that aren't used at all, not even in comments. 2024-09-08 17:11:23 -07:00
Ryan C. Gordon
4f6e81cf62
include: Fixed up some minor documentation gaps. 2024-09-08 00:17:53 -04:00
Maia
fa892d15b7 include files with required types directly 2024-09-07 08:37:46 -07:00
Sam Lantinga
18c46a3313 Fixed SDL_pen.h for SDL3 bit flag conventions 2024-09-02 17:17:48 -07:00
Ryan C. Gordon
bec701dd04
pen: Add support for tangential pressure axis. 2024-08-11 18:00:13 -04:00
SDL Wiki Bot
a7fa375275 Sync SDL3 wiki -> header 2024-08-10 02:09:54 +00:00
Ryan C. Gordon
a9d70dbacb pen: Rework public API.
This changes the API in various ways, and updates the backends for this.

Overall, this is a massive simplification of the API, as most future backends
can't support the previously-offered API.

This also removes the testautomation pen code (not only did these interfaces
change completely, it also did something no other test did: mock the internal
API), and replaces testpen.c with a different implementation (the existing
code was fine, it was just easier to start from scratch than update it).
2024-08-09 22:09:23 -04:00
Sam Lantinga
4f55271571 Removed temporary memory from the API
It was intended to make the API easier to use, but various automatic garbage collection all had flaws, and making the application periodically clean up temporary memory added cognitive load to using the API, and in many cases was it was difficult to restructure threaded code to handle this.

So, we're largely going back to the original system, where the API returns allocated results and you free them.

In addition, to solve the problems we originally wanted temporary memory for:
* Short strings with a finite count, like device names, get stored in a per-thread string pool.
* Events continue to use temporary memory internally, which is cleaned up on the next event processing cycle.
2024-07-26 20:59:14 -07:00
Sam Lantinga
5e513ecc7f Don't automatically free temporary memory, let the application call SDL_FreeTemporaryMemory() when it's ready.
Also mark up all functions that return temporary memory with SDL_DECLSPEC_TEMP, to help people implementing language bindings.

Fixes https://github.com/libsdl-org/SDL/issues/10378
2024-07-26 10:05:03 -07:00
SDL Wiki Bot
975457cfb6 Sync SDL3 wiki -> header 2024-07-19 19:23:24 +00:00
Sam Lantinga
71a60d4c0e Updated documentation for functions that return temporary memory 2024-07-19 12:22:03 -07:00
Sam Lantinga
637e9700dd Standardize placement of '*' in function declarations
Implemented using these sed commands on the headers:
sed -E -i'' '/SDLCALL|;/ s,([a-z])\* ,\1 *,g' *
sed -E -i'' 's,(\(.*[^\*])\* ([a-z])(.*\)),\1*\2\3,g' *
sed -E -i'' 's,\*const,* const,g' *
sed -E -i'' 's,\*SDLCALL,* SDLCALL,g' *
sed -E -i'' 's,void\(,void (,g' *
git checkout *gl*
2024-07-19 12:22:03 -07:00
Sam Lantinga
217330a7b3 Made return value descriptions more consistent across the API 2024-07-19 12:22:03 -07:00
Sam Lantinga
d73c7311d5 Clarify that the SDL_GetStringRule means that SDL will automatically free the memory later. 2024-07-19 12:22:03 -07:00
Ryan C. Gordon
51902d4ac5
Updated headers with latest wikiheaders tweaks. 2024-06-14 02:09:55 -04:00
Ryan C. Gordon
2ad7c70ac6
documentation: clean up a minor syntax issue. 2024-06-13 18:10:28 -04:00
Ryan C. Gordon
e23257307e Introduce formal policy for APIs that return strings.
This declares that any `const char *` returned from SDL is owned by SDL, and
promises to be valid _at least_ until the next time the event queue runs, or
SDL_Quit() is called, even if the thing that owns the string gets destroyed
or changed before then.

This is noted in the headers as "the SDL_GetStringRule", so this will both be
greppable to find a detailed explaination in docs/README-strings.md and
wikiheaders will automatically turn it into a link we can point at the
appropriate documentation.

Fixes #9902.

(and several FIXMEs, both known and yet-undocumented.)
2024-06-03 14:20:49 -04:00
Ryan C. Gordon
10bbf9d1da Fixed SDL_PenCapabilityFlags from Uint64 to Uint32. 2024-05-26 13:23:21 -04:00
Ryan C. Gordon
0e6db371e8 pen: Make the \since field in SDL_PenCapabilityFlags match everything else. 2024-05-26 13:23:21 -04:00
Ryan C. Gordon
0f0570b060 pen: Change a Uint32 bitfield into a typedef.
Reference Issue #9812.
2024-05-26 13:23:21 -04:00
Sam Lantinga
6f2621438a Renamed DECLSPEC to SDL_DECLSPEC 2024-05-17 17:09:09 -07:00
Ryan C. Gordon
5e6d85b8f0
wikiheaders: bridge wiki Category docs to the headers!
Did an initial cleanup on the headers and wrote a few pieces of documentation,
but this needs more work to fill out the documentation.
2024-05-16 11:48:23 -04:00
SDL Wiki Bot
2f4f1f6923 Sync SDL3 wiki -> header 2024-04-11 17:35:27 +00:00
Ryan C. Gordon
0df988389c
include: Add \since to all documentation that was missing it. 2024-04-11 13:34:29 -04:00
Ryan C. Gordon
e044318a8e
Sync SDL3 wiki -> headers 2024-04-09 00:50:03 -04:00
Ryan C. Gordon
ad090d2444
include: A ton of little documentation tweaks, fixes, and improvements.
This is just stuff I noticed while working on the wikiheaders updates. A
thorough pass over all the docs would not be terrible, and maybe a simple
script to check for consistency (does everything have a `\since` on it? etc)
might be nice, too.
2024-04-09 00:50:02 -04:00
Susko3
c96bc8b1a2 Add missing includes for SDL_MouseID
Missed in f8844d387c2a0e3ccc7f8ce26001fd745e35bfee and d1eb4adb1618bb2685974eb720b10bc63b049b9f.
2024-03-31 16:11:23 -07:00
Sam Lantinga
d1eb4adb16 Be explicit about the event mouse and keyboard ID 2024-03-23 16:31:00 -07:00
Susko3
b90fed094f Standardise header includes
Changes "SDL_*.h" and "SDL3/SDL_*.h" to <SDL3/SDL_*.h>
2024-03-19 13:41:53 -07:00
Sam Lantinga
d8a54cd4f8 Updated "see also" references to be more consistent
Fixes https://github.com/libsdl-org/SDL/issues/9282
2024-03-17 12:28:11 -07:00
Sam Lantinga
33eaddc565 Cleaned up various type conversion issues
This makes sure SDL_PixelFormatEnum flows through the internal code correctly, as well as fixing a number of other minor issues.
2024-03-07 06:58:43 -08:00
Sam Lantinga
95fbbc6f07 Fixed accidental use of tabs 2024-03-05 16:55:26 -08:00
Susko3
e268cdbec6
Use specific types in public headers (#9205)
Uses specific typedef'd types instead of generic integral types where applicable.
2024-03-05 16:52:15 -08:00
Sam Lantinga
5b3ee51c6c Updated copyright for 2024 2024-01-01 13:15:26 -08:00
Ryan C. Gordon
dd8ab67bd9
Sync wiki -> headers. 2023-11-13 15:46:29 -05:00
Ryan C. Gordon
91460fc13d
include: Fixed up documentation in SDL_pen.h 2023-11-13 15:40:55 -05:00
Ryan C. Gordon
8766aa39d6
Sync wiki -> headers. 2023-11-13 13:03:42 -05:00
Ryan C. Gordon
e5ffd6d8eb
include: Removed \link and \endlink Doxygen tags. 2023-11-13 13:01:25 -05:00
Christoph Reichenbach
7c80ac6df7 API for pressure-sensitive pens + XInput2/Wayland
This patch adds an API for querying pressure-
sensitive pens, cf. SDL_pen.h:
- Enumerate all pens
- Get pen capabilities, names, GUIDs
- Distinguishes pens and erasers
- Distinguish attached and detached pens
- Pressure and tilt support
- Rotation, distance, throttle wheel support
  (throttle wheel untested)
- Pen type and meta-information reporting
  (partially tested)

Pen event reporting:
- Three new event structures: PenTip, PenMotion, and
  PenButton
- Report location with sub-pixel precision
- Include axis and button status, is-eraser flag

Internal pen tracker, intended to be independent
of platform APIs, cf. SDL_pen_c.h:
- Track known pens
- Handle pen hotplugging

Automatic test:
- testautomation_pen.c

Other features:
- XInput2 implementation, incl. hotplugging
- Wayland implementation, incl. hotplugging
- Backward compatibility: pen events default to
  emulating pens with mouse ID SDL_PEN_MOUSEID
- Can be toggled via SDL_HINT_PEN_NOT_MOUSE
- Test/demo program (testpen)
- Wacom pen feature identification by pen ID

Acknowledgements:
- Ping Cheng (Wacom) provided extensive feedback
  on Wacom pen features and detection so that
  hopefully untested Wacom devices have a
  realistic chance of working out of the box.
2023-11-12 09:52:02 -08:00