1// Copyright 2016-2018 Mateusz Sieczko and other GilRs Developers
2//
3// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
4// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
5// http://opensource.org/licenses/MIT>, at your option. This file may not be
6// copied, modified, or distributed except according to those terms.
78//! Module which exports the platform-specific types.
9//!
10//! Each backend has to provide:
11//!
12//! * A `FfDevice` (a struct which handles force feedback)
13//! * A `Gilrs` context
14//! * A `Gamepad` struct
15//! * A static `str` which specifies the name of the SDL input mapping
16//! * A constant which define whether Y axis of sticks points upwards or downwards
17//! * A module with the platform-specific constants for common gamepad buttons
18//! called `native_ev_codes`
1920#![allow(clippy::module_inception)]
2122pub use self::platform::*;
2324#[cfg(target_os = "linux")]
25#[path = "linux/mod.rs"]
26mod platform;
2728#[cfg(target_os = "macos")]
29#[path = "macos/mod.rs"]
30mod platform;
3132#[cfg(all(not(feature = "xinput"), not(feature = "wgi")))]
33compile_error!(
34"Windows needs one of the features `gilrs/xinput` or `gilrs/wgi` enabled. \nEither don't use \
35 'default-features = false' or add one of the features back."
36);
3738#[cfg(all(feature = "wgi", feature = "xinput"))]
39compile_error!("features `gilrs/xinput` and `gilrs/wgi` are mutually exclusive");
4041#[cfg(all(target_os = "windows", feature = "xinput", not(feature = "wgi")))]
42#[path = "windows_xinput/mod.rs"]
43mod platform;
4445#[cfg(all(target_os = "windows", feature = "wgi"))]
46#[path = "windows_wgi/mod.rs"]
47mod platform;
4849#[cfg(target_arch = "wasm32")]
50#[path = "wasm/mod.rs"]
51mod platform;
5253#[cfg(all(
54 not(any(target_os = "linux")),
55 not(target_os = "macos"),
56 not(target_os = "windows"),
57 not(target_arch = "wasm32")
58))]
59#[path = "default/mod.rs"]
60mod platform;