Commit Graph

28 Commits

Author SHA1 Message Date
Pokechu22 2025763420 Treewide: Adjust order of includes 2021-12-10 14:49:57 -08:00
Pierre Bourdon e149ad4f0a
treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00
Filoppi c238e49119 ControllerInterface: Remove OSX window handle
also make it more thread safe (avoid rare deadlock)
and fix it trying to add devices before the CI has init
2021-06-07 11:07:05 +03:00
Filoppi 81092cf7e4 InputCommon: replace SerialInterface log with ControllerInterface
where appropriate. SerialInterface was a leftover from the past,
and makes no sense to be used on actual/real controllers.
2021-05-05 00:16:08 +03:00
Lioncash a5e1415e74 InputCommon: Migrate logging over to fmt
Continues the migration of the logging calls over to the fmt capable
ones.
2020-10-23 13:16:18 -04:00
JosJuice a2a1e04fc9 StringUtil: Use std::string_view more 2019-07-23 14:49:12 +02:00
Lioncash ec60027f56 InputCommon: Use nested namespace specifiers where applicable 2019-06-17 16:51:41 -04:00
Michael M 7355b5f70d ControllerInterface: invoke callbacks in AddDevice/RemoveDevice
Some backends already cause this to happen, so make it consistent across
systems.
2017-11-10 13:37:41 -08:00
Nick ef95bf26cb Implement GamePAd and MultiAxisController detection 2017-08-24 00:31:59 -04:00
Nick 3abde44641 formatting cleanup 2017-08-23 00:19:34 -04:00
Nick 3cddb62aea keyboard fixes v2 2017-08-22 12:26:44 -04:00
Nick 0df4f7db4f Depreciate old OSX Keyboard and Mouse 2017-08-21 01:44:03 -04:00
Michael Maltese 5298328cb1 Add headless support on macOS 2017-04-15 19:34:42 -07:00
Anthony ffe20705dd Merge pull request #4362 from ligfx/osxhotplug
ControllerInterface: enable hotplugging on macOS
2016-12-01 00:29:56 -06:00
Michael Maltese 7ed8fb95c5 ControllerInterface: enable hotplugging on macOS 2016-11-30 22:27:46 -08:00
Michael Maltese 3e69d066f5 ControllerInterface: replace Reinitialize with RefreshDevices
The SDL backend crashes when you close a joystick after SDL_Quit has
been called. Some backends don't need to be shutdown and
re-initialized everytime, we can just ask to enumerate devices again.
2016-11-30 16:07:55 -08:00
Léo Lam 788e19f54d ControllerInterface: Make the ID assigning code common
This makes the device ID assigning code common to all backends, by
moving it to AddDevice() instead of copy-pasting or replicating
the logic in the backends.

Also, to prepare for hotplugging, instead of relying on a name usage
count, the new ID assigning system always starts from ID 0 and tries
to assign the first ID that is not used.
2016-07-14 10:50:53 +02:00
Scott Mansell e0839a9478 Strip whitespace from Evdev and OSX controller names. 2016-07-12 14:19:07 +12:00
Léo Lam 8678133e87 ControllerInterface: Switch to std::shared_ptr
Small cleanup by using std::shared_ptr and getting rid of
ciface.Devices() which just returned the m_devices (which defeats the
point of making m_devices protected).

Incidentally, this should make the code safer when we have
different threads accessing devices in the future (for hotplug?).

A lot of code use Device references directly so there is
no easy way to remove FindDevice() and make those unique_ptrs.
2016-06-25 21:46:39 +02:00
Léo Lam fd29e5c4cc ControllerInterface: Don't pass m_devices to the backends
Previously, the devices vector would be passed to all backends. They
would then manually push_back to it to add new devices. This was fine
but caused issues when trying to add synchronisation.

Instead, backends now call AddDevice() to fill m_devices so that it is
not accessible from the outside.
2016-06-25 13:46:53 +02:00
Pierre Bourdon 3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
Tillmann Karras cefcb0ace9 Update license headers to GPLv2+ 2015-05-25 13:22:31 +02:00
Lioncash fd39454ad3 Make some OSX-only functions static
Gets rid of function prototype warnings.
2014-10-28 08:41:50 -04:00
Lioncash bc14d6966f InputCommon: Clean up brace placements 2014-08-30 18:06:44 -04:00
Tillmann Karras d802d39281 clang-modernize -use-nullptr
and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine
2014-03-09 21:14:26 +01:00
Lioncash 2afe215271 Convert all includes to relative paths. 2014-02-18 02:19:10 -05:00
lioncash d2038049f5 Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
Jasper St. Pierre 34692ab826 Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00