History log of /haiku/headers/private/device/joystick_driver.h
Revision Date Author Comments
# f4b42b51 21-Jun-2018 Augustin Cavalier <waddlesplash@gmail.com>

drivers: Deduplify joystick_driver.h.

Now there is only the one copy in headers/private/device.


# 97184c69 20-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

Tiny comment cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42275 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a4aa4541 03-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

* Make it a valid C header again.
* Cleanup of include grouping as pointed out by Axel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41899 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 34f0d87a 03-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

Add initialize[_to_extended_joystick]() methods to variable_joystick. With those
methods the members are populated, the flat data size is calcualted, the data
buffer is allocated and the convenience pointers are set up automatically. With
initialize() an arbitrary configuration can be created, with
initialize_to_extended_joystick() a configuration is created that exactly
matches the data structure of the extended_joystick struct.
Having them here makes it easy to use the structure from a driver as well
without the need to set up everything manually.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41888 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6e0cca2f 03-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

* Remove the JoystickPrivate.h again and move the variable_joystick structure
into joystick_driver.h as it is convenient to have also on the driver side.
* Added comments explaining the data structure and use case of the structure.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41886 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ab176368 03-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

* Replace the fixed size extended_joystick structure with a variably sized one
inside BJoystick.
* Add joystick_module_info flag to communicate support for variably sized reads.
* The variably sized data structure is set up to describe either the actual
amount of data, when variably sized reads are supported by the driver, or it
is set up so that it exactly matches the data layout of the extended_joystick
structure. This allows us to support both as input data, while only needing to
care about a single format inside BJoystick. Convenience pointers allow the
data to be retrieved without additional overhead or extra logic.
* Add some sanity checks and ensure some boundaries when dealing reading data
from the variably sized structure (as there might not be any buttons, hats,
axis at all now).
* Ensure that the extended_joystick structure doesn't change in size due to
padding by making it _PACKED (it wasn't padded though).

This is still supposed to work exactly as before. However, it opens up the
possibility to actually support arbitrary controllers with arbitrary axis, hat
and button counts. It therefore allows to actually deliver what the BJoystick
API was designed to handle all along.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41885 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ef13dbda 30-May-2011 Michael Lotz <mmlr@mlotz.ch>

* Actually implement the relevant parts of BJoystick, i.e. reading the joystick
info and values. Inspired by and in parts based on the patch by caz_haiku in
ticket #7429 (though rewritten completely due to the other changes). Thanks
for the pointers!
* Clean up the mixup of internal joystick info and the one from
joystick_driver.h so that BJoystick and the drivers talk about the same
structures.
* Extensive coding style cleanup, simplifications, NULL checks, early returns,
std::nothrow allocations, include sorting, argument naming, ... that kind of
stuff.
* Added some TODO notes for remaining stuff.
* Automatic (and manual) whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41849 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c3c57468 03-Aug-2008 Fredrik Modeen <fredrik@modeen.se>

and now the files

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26767 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 97184c69652cbbea0f4277ebfcdd584feb470825 20-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

Tiny comment cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42275 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a4aa4541c1d80586568a61bf0e2b467e3da9be0c 03-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

* Make it a valid C header again.
* Cleanup of include grouping as pointed out by Axel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41899 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 34f0d87a9d8f9c9973a4f2749d158f1f6443e534 03-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

Add initialize[_to_extended_joystick]() methods to variable_joystick. With those
methods the members are populated, the flat data size is calcualted, the data
buffer is allocated and the convenience pointers are set up automatically. With
initialize() an arbitrary configuration can be created, with
initialize_to_extended_joystick() a configuration is created that exactly
matches the data structure of the extended_joystick struct.
Having them here makes it easy to use the structure from a driver as well
without the need to set up everything manually.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41888 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6e0cca2f9617670db2935daadcb4ecb28fa67ccb 03-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

* Remove the JoystickPrivate.h again and move the variable_joystick structure
into joystick_driver.h as it is convenient to have also on the driver side.
* Added comments explaining the data structure and use case of the structure.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41886 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ab1763688ff174338630285826b8af0043d0f2e9 03-Jun-2011 Michael Lotz <mmlr@mlotz.ch>

* Replace the fixed size extended_joystick structure with a variably sized one
inside BJoystick.
* Add joystick_module_info flag to communicate support for variably sized reads.
* The variably sized data structure is set up to describe either the actual
amount of data, when variably sized reads are supported by the driver, or it
is set up so that it exactly matches the data layout of the extended_joystick
structure. This allows us to support both as input data, while only needing to
care about a single format inside BJoystick. Convenience pointers allow the
data to be retrieved without additional overhead or extra logic.
* Add some sanity checks and ensure some boundaries when dealing reading data
from the variably sized structure (as there might not be any buttons, hats,
axis at all now).
* Ensure that the extended_joystick structure doesn't change in size due to
padding by making it _PACKED (it wasn't padded though).

This is still supposed to work exactly as before. However, it opens up the
possibility to actually support arbitrary controllers with arbitrary axis, hat
and button counts. It therefore allows to actually deliver what the BJoystick
API was designed to handle all along.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41885 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ef13dbda922b4cf26edc3d0bd5ca665e801c6b9d 30-May-2011 Michael Lotz <mmlr@mlotz.ch>

* Actually implement the relevant parts of BJoystick, i.e. reading the joystick
info and values. Inspired by and in parts based on the patch by caz_haiku in
ticket #7429 (though rewritten completely due to the other changes). Thanks
for the pointers!
* Clean up the mixup of internal joystick info and the one from
joystick_driver.h so that BJoystick and the drivers talk about the same
structures.
* Extensive coding style cleanup, simplifications, NULL checks, early returns,
std::nothrow allocations, include sorting, argument naming, ... that kind of
stuff.
* Added some TODO notes for remaining stuff.
* Automatic (and manual) whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41849 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c3c574689d4cda712dc012adddf78401e2fd09b1 03-Aug-2008 Fredrik Modeen <fredrik@modeen.se>

and now the files

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26767 a95241bf-73f2-0310-859d-f6bbb57e9c96