accel: Add enum to string helper

This commit is contained in:
Bastien Nocera
2022-03-14 12:58:50 +01:00
parent bba4560748
commit 6a07e25826
2 changed files with 14 additions and 0 deletions

View File

@@ -117,3 +117,16 @@ get_accel_scale (GUdevDevice *device,
reset_accel_scale (scale_vec);
return TRUE;
}
const char *
accel_location_to_string (AccelLocation location)
{
switch (location) {
case ACCEL_LOCATION_DISPLAY:
return "display";
case ACCEL_LOCATION_BASE:
return "base";
default:
g_assert_not_reached ();
}
}

View File

@@ -24,5 +24,6 @@ gboolean parse_accel_location (const char *location,
AccelLocation *value);
gboolean parse_accel_label (const char *location,
AccelLocation *value);
const char *accel_location_to_string (AccelLocation location);
gboolean get_accel_scale (GUdevDevice *device, AccelScale *scale_vec);