From fe21003777718efac8743bf99c5388b3d6477be2 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 4 Apr 2025 19:56:43 +0200 Subject: adw: implement basic StyleManager --- adw/src/enums.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 adw/src/enums.cpp (limited to 'adw/src/enums.cpp') diff --git a/adw/src/enums.cpp b/adw/src/enums.cpp new file mode 100644 index 0000000..02dd74a --- /dev/null +++ b/adw/src/enums.cpp @@ -0,0 +1,49 @@ +#include "adwaitamm/enums.hpp" + +#include + +#include + +#include + +namespace +{ + template + auto constexpr matches = + static_cast>(Wrapped) == static_cast>(Unwrapped); +} // namespace + +namespace Adwaita +{ + + static_assert(matches); + static_assert(matches); + static_assert(matches); + static_assert(matches); + static_assert(matches); + static_assert(matches); + static_assert(matches); + static_assert(matches); + static_assert(matches); + + static_assert(matches); + static_assert(matches); + static_assert(matches); + static_assert(matches); + static_assert(matches); + +} // namespace Adwaita + +namespace Glib +{ +#define VALUE_SPECIALIZATION(Enum, AdwEnumName) \ + auto Value::value_type() -> GType \ + { \ + return adw_##AdwEnumName##_get_type(); \ + } + + VALUE_SPECIALIZATION(AccentColor, accent_color) + VALUE_SPECIALIZATION(ColorScheme, color_scheme) + +#undef VALUE_SPECIALIZATION +} // namespace Glib \ No newline at end of file -- cgit v1.2.3