mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:27:34 +00:00
LibGfx: Add to_string() functions for MetricRole and PathRole
This commit is contained in:
parent
c885722a94
commit
31ce4d04b6
1 changed files with 32 additions and 0 deletions
|
@ -143,6 +143,22 @@ enum class MetricRole {
|
|||
__Count,
|
||||
};
|
||||
|
||||
inline const char* to_string(MetricRole role)
|
||||
{
|
||||
switch (role) {
|
||||
case MetricRole::NoRole:
|
||||
return "NoRole";
|
||||
#undef __ENUMERATE_METRIC_ROLE
|
||||
#define __ENUMERATE_METRIC_ROLE(role) \
|
||||
case MetricRole::role: \
|
||||
return #role;
|
||||
ENUMERATE_METRIC_ROLES(__ENUMERATE_METRIC_ROLE)
|
||||
#undef __ENUMERATE_METRIC_ROLE
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
enum class PathRole {
|
||||
NoRole,
|
||||
|
||||
|
@ -154,6 +170,22 @@ enum class PathRole {
|
|||
__Count,
|
||||
};
|
||||
|
||||
inline const char* to_string(PathRole role)
|
||||
{
|
||||
switch (role) {
|
||||
case PathRole::NoRole:
|
||||
return "NoRole";
|
||||
#undef __ENUMERATE_PATH_ROLE
|
||||
#define __ENUMERATE_PATH_ROLE(role) \
|
||||
case PathRole::role: \
|
||||
return #role;
|
||||
ENUMERATE_PATH_ROLES(__ENUMERATE_PATH_ROLE)
|
||||
#undef __ENUMERATE_PATH_ROLE
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
struct SystemTheme {
|
||||
RGBA32 color[(int)ColorRole::__Count];
|
||||
int metric[(int)MetricRole::__Count];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue