xinput/enumerations/
battery_level.rs

1use bytemuck::{Pod, Zeroable};
2use winapi::um::xinput::*;
3
4
5
6/// \[[microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/XInput/ns-xinput-xinput_battery_information)\]
7/// BATTERY_LEVEL_\*
8#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
9#[derive(Pod, Zeroable)]
10#[repr(transparent)] pub struct BatteryLevel(u8);
11
12enumish! { BatteryLevel => u8; default: Empty == 0; Empty, Low, Medium, Full }
13
14#[allow(non_upper_case_globals)] #[allow(missing_docs)] impl BatteryLevel {
15    pub const Empty     : BatteryLevel = BatteryLevel(BATTERY_LEVEL_EMPTY as _);
16    pub const Low       : BatteryLevel = BatteryLevel(BATTERY_LEVEL_LOW as _);
17    pub const Medium    : BatteryLevel = BatteryLevel(BATTERY_LEVEL_MEDIUM as _);
18    pub const Full      : BatteryLevel = BatteryLevel(BATTERY_LEVEL_FULL as _);
19}
20
21//#cpp2rust BATTERY_LEVEL_EMPTY     = xinput::BatteryLevel::Empty
22//#cpp2rust BATTERY_LEVEL_LOW       = xinput::BatteryLevel::Low
23//#cpp2rust BATTERY_LEVEL_MEDIUM    = xinput::BatteryLevel::Medium
24//#cpp2rust BATTERY_LEVEL_FULL      = xinput::BatteryLevel::Full