mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibGfx: Add to_string() functions for MetricRole and PathRole
This commit is contained in:
parent
c885722a94
commit
31ce4d04b6
Notes:
sideshowbarker
2024-07-18 01:49:58 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/31ce4d04b65 Pull-request: https://github.com/SerenityOS/serenity/pull/10660
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…
Reference in a new issue