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
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
be retrieved. I think the fixed layout will actually make it impossible to see
anything beyond the 9th button however... The coding style of this app is,
different, to say the least and I didn't really bother fixing it up right now,
so the changes just mimic what's there.
* Some automatic whitespace cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41883 a95241bf-73f2-0310-859d-f6bbb57e9c96
Get*Values() functions but retrieves an arbitrary amount of button states using
a boolean array. This overcomes the 32 button limitation on the API side. Right
now the function does simply set the first 32 states from the button bitmap, as
the BJoystick to driver interface hasn't been adapted yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41882 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added an arch_debug_gdb_get_registers() interface that is supposed to provide
the register values in the format expected by gdb and implemented it for x86.
* Reimplemented gdb_regreply() to use that. Also made it buffer overflow safe.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41880 a95241bf-73f2-0310-859d-f6bbb57e9c96
already anyway (as compared to the original BeOS ones) this won't introduce any
missing symbols.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41879 a95241bf-73f2-0310-859d-f6bbb57e9c96
declarations to group them more logically. No functional changes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41878 a95241bf-73f2-0310-859d-f6bbb57e9c96
documented in the BeBook. Sadly the success return is specified as "a positive
integer", so I didn't change it to B_OK.
* We actually want non-blocking mode, so don't reset the O_NONBLOCK flag. It was
ignored before anyway though, so this doesn't change anything.
* The legacy buttons 1 and 2 are in the pressed state when false, so initialize
them to true instead.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41876 a95241bf-73f2-0310-859d-f6bbb57e9c96
(which is uint32), but the legacy BJoystick axis values are just the same int16
as the ones in extended mode, so nothing has to be done besides assigning them.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41875 a95241bf-73f2-0310-859d-f6bbb57e9c96
Fixed some coding style and a few sanity checks where it make sense.
This driver code is not in a good shape and needs a wide cleanup.
unfortunatly, I still don't have any device to test with, so I can't do that anytime soon.
Intead of letting his patch collecting dust since 3 months (my bad),
I think it's better the multi-port support gets at least more exposure than
just Pete's hardware.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41874 a95241bf-73f2-0310-859d-f6bbb57e9c96
to be updated with newly plugged in devices without the need to recreate a
BJoystick object.
* Do an initial (re-)scan on object creation instead of always scanning in
CountDevices() and by extension GetDeviceName().
* This makes CountDevices() and GetDeviceName() stable with regards to the
device list, so that an enumerating application doesn't suddenly get more/less
devices than it might expect.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41870 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Include sorting, header style, macro naming, variable naming, spacing, ...
* Some simplifications, early returns and the like.
* The device name list items were allocated with new but deleted with free. The
whole private BJoystick list being modified by a friend class is dubious
though and should be reworked. Ideally node monitoring would be implemented
so that the list can be re-populated on demand instead of scanning through
every time.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41868 a95241bf-73f2-0310-859d-f6bbb57e9c96
with the BJoystick requirements:
* Make the Read() non-blocking. This is required as BJoystick is a polling
interface. A single current state is used that is updated by a separate thread
on report arrival. The thread is spawned as soon as the ProtocolHandler is
opened for the first time (and quit at the first wait return after the
ProtocolHandler is closed). With this we can simply return the current state
on read.
* Remove the ring buffer as it was not needed in the first place. This also
happens to solve the problem of sharing a JoystickProtocolHandler. Before,
concurrent reads would queue up the same result multiple times in the ring
buffer and then return stale data on the next update.
Solves most of #7629.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41865 a95241bf-73f2-0310-859d-f6bbb57e9c96
ever wait for reports on demand, there's no need for buffering at all.
This removes some unnecessary copying and ring buffer overhead, the ring buffer
will now in fact not be created at all.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41864 a95241bf-73f2-0310-859d-f6bbb57e9c96
the BJoystick API and joystick drivers.
* Also fix a few warnings in the code that were caused by using NULL instead of
0 for BWindow/BView flags.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41852 a95241bf-73f2-0310-859d-f6bbb57e9c96
This includes input scaling, so the resulting input ranges should always match
the ones of the BJoystick data (hence no calibration should be required).
* It supports joysticks, gamepads and multi-axis controllers. I've only tested
it with a Microsoft SideWinder Gamepad Pro so far, which now works as expected
with stickit.
* Fixes#7429.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41851 a95241bf-73f2-0310-859d-f6bbb57e9c96
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
is loaded. SMTP and POP still have this problem! TODO: use the ServerConnection class in these add-ons too.
This would also remove a lot of #ifdef SSL form these add-ons. Will not do it in the near future, feel free to fix it
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41840 a95241bf-73f2-0310-859d-f6bbb57e9c96
when mimset didn't run yet. This obviously cleans up after a change that I
did, thanks a lot!
* This closes bug #7595.
* Also took the opportunity to clean up a bit more in this regard, and fixed a
few coding style violations.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41837 a95241bf-73f2-0310-859d-f6bbb57e9c96
of returning B_ERROR to the ProtocolHandler base class. Not used yet, but will
be used for the BJoystick <-> JoystickProtocolHandler.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41835 a95241bf-73f2-0310-859d-f6bbb57e9c96
* move all the isw... functions from wchar.h to wctype.h (just following version 7
of the POSIX base specs)
* remove all declarations from wchar.h that are in wctype.h, too
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41832 a95241bf-73f2-0310-859d-f6bbb57e9c96
option string: FreeBSD's stat command line don't use %s format specifier for
file size. Instead, %s specifier is unused at all and they goes with %z.
For file Zize, I guess...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41830 a95241bf-73f2-0310-859d-f6bbb57e9c96