mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-01-03 17:10:09 +01:00
lib: Add UP_DEVICE_KIND_GAMING_INPUT for gaming devices
Joypads, joysticks, dance mats, paddles, Wiimotes, steering wheels, tractor cabin simulators, pedals, yokes, breathing controllers, and, hmm, etc. https://bugs.freedesktop.org/show_bug.cgi?id=102493
This commit is contained in:
parent
1dc2b96eec
commit
5ccd4fe959
3 changed files with 9 additions and 2 deletions
|
|
@ -307,7 +307,8 @@ up_device_to_text (UpDevice *device)
|
|||
if ((kind == UP_DEVICE_KIND_PHONE ||
|
||||
kind == UP_DEVICE_KIND_BATTERY ||
|
||||
kind == UP_DEVICE_KIND_MOUSE ||
|
||||
kind == UP_DEVICE_KIND_KEYBOARD) &&
|
||||
kind == UP_DEVICE_KIND_KEYBOARD ||
|
||||
kind == UP_DEVICE_KIND_GAMING_INPUT) &&
|
||||
!is_display)
|
||||
g_string_append_printf (string, " rechargeable: %s\n", up_device_bool_to_string (up_exported_device_get_is_rechargeable (priv->proxy_device)));
|
||||
if (kind == UP_DEVICE_KIND_BATTERY ||
|
||||
|
|
@ -359,7 +360,8 @@ up_device_to_text (UpDevice *device)
|
|||
kind == UP_DEVICE_KIND_TABLET ||
|
||||
kind == UP_DEVICE_KIND_COMPUTER ||
|
||||
kind == UP_DEVICE_KIND_MEDIA_PLAYER ||
|
||||
kind == UP_DEVICE_KIND_UPS)
|
||||
kind == UP_DEVICE_KIND_UPS ||
|
||||
kind == UP_DEVICE_KIND_GAMING_INPUT)
|
||||
g_string_append_printf (string, " percentage: %g%%\n", up_exported_device_get_percentage (priv->proxy_device));
|
||||
if (kind == UP_DEVICE_KIND_BATTERY) {
|
||||
if (up_exported_device_get_temperature (priv->proxy_device) > 0)
|
||||
|
|
|
|||
|
|
@ -70,6 +70,8 @@ up_device_kind_to_string (UpDeviceKind type_enum)
|
|||
return "tablet";
|
||||
case UP_DEVICE_KIND_COMPUTER:
|
||||
return "computer";
|
||||
case UP_DEVICE_KIND_GAMING_INPUT:
|
||||
return "gaming-input";
|
||||
default:
|
||||
return "unknown";
|
||||
}
|
||||
|
|
@ -110,6 +112,8 @@ up_device_kind_from_string (const gchar *type)
|
|||
return UP_DEVICE_KIND_MEDIA_PLAYER;
|
||||
if (g_str_equal (type, "tablet"))
|
||||
return UP_DEVICE_KIND_TABLET;
|
||||
if (g_str_equal (type, "gaming-input"))
|
||||
return UP_DEVICE_KIND_GAMING_INPUT;
|
||||
return UP_DEVICE_KIND_UNKNOWN;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ typedef enum {
|
|||
UP_DEVICE_KIND_MEDIA_PLAYER,
|
||||
UP_DEVICE_KIND_TABLET,
|
||||
UP_DEVICE_KIND_COMPUTER,
|
||||
UP_DEVICE_KIND_GAMING_INPUT,
|
||||
UP_DEVICE_KIND_LAST
|
||||
} UpDeviceKind;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue