accel: Add enum to string helper
This commit is contained in:
@@ -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 ();
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user