diff options
Diffstat (limited to 'adw/src/enums.cpp')
| -rw-r--r-- | adw/src/enums.cpp | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/adw/src/enums.cpp b/adw/src/enums.cpp deleted file mode 100644 index b93ac3d..0000000 --- a/adw/src/enums.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/** - * @author Felix Morgner (felix.morgner@gmail.com) - * @copyright Copyright (c) 2025 - * SPDX-License-Identifier: LGPL-2.1-or-later - */ - -#include "adwaitamm/enums.hpp" - -#include "adwaitamm/stylemanager.hpp" - -#include <adwaita.h> -#include <glib-object.h> - -#include <type_traits> - -namespace -{ - template<auto Wrapped, auto Unwrapped> - auto constexpr matches = - static_cast<std::underlying_type_t<decltype(Wrapped)>>(Wrapped) == static_cast<std::underlying_type_t<decltype(Unwrapped)>>(Unwrapped); -} // namespace - -namespace Adwaita -{ - - static_assert(matches<AccentColor::Blue, ADW_ACCENT_COLOR_BLUE>); - static_assert(matches<AccentColor::Teal, ADW_ACCENT_COLOR_TEAL>); - static_assert(matches<AccentColor::Green, ADW_ACCENT_COLOR_GREEN>); - static_assert(matches<AccentColor::Yellow, ADW_ACCENT_COLOR_YELLOW>); - static_assert(matches<AccentColor::Orange, ADW_ACCENT_COLOR_ORANGE>); - static_assert(matches<AccentColor::Red, ADW_ACCENT_COLOR_RED>); - static_assert(matches<AccentColor::Pink, ADW_ACCENT_COLOR_PINK>); - static_assert(matches<AccentColor::Purple, ADW_ACCENT_COLOR_PURPLE>); - static_assert(matches<AccentColor::Slate, ADW_ACCENT_COLOR_SLATE>); - - static_assert(matches<ColorScheme::Default, ADW_COLOR_SCHEME_DEFAULT>); - static_assert(matches<ColorScheme::ForceLight, ADW_COLOR_SCHEME_FORCE_LIGHT>); - static_assert(matches<ColorScheme::PreferLight, ADW_COLOR_SCHEME_PREFER_LIGHT>); - static_assert(matches<ColorScheme::PreferDark, ADW_COLOR_SCHEME_PREFER_DARK>); - static_assert(matches<ColorScheme::ForceDark, ADW_COLOR_SCHEME_FORCE_DARK>); - - static_assert(matches<LengthType::MinWidth, ADW_BREAKPOINT_CONDITION_MIN_WIDTH>); - static_assert(matches<LengthType::MaxWidth, ADW_BREAKPOINT_CONDITION_MAX_WIDTH>); - static_assert(matches<LengthType::MinHeight, ADW_BREAKPOINT_CONDITION_MIN_HEIGHT>); - static_assert(matches<LengthType::MaxHeight, ADW_BREAKPOINT_CONDITION_MAX_HEIGHT>); - - static_assert(matches<PresentationMode::Auto, ADW_DIALOG_AUTO>); - static_assert(matches<PresentationMode::Floating, ADW_DIALOG_FLOATING>); - static_assert(matches<PresentationMode::BottomSheet, ADW_DIALOG_BOTTOM_SHEET>); - - static_assert(matches<RatioType::MinAspectRatio, ADW_BREAKPOINT_CONDITION_MIN_ASPECT_RATIO>); - static_assert(matches<RatioType::MaxAspectRatio, ADW_BREAKPOINT_CONDITION_MAX_ASPECT_RATIO>); - - static_assert(matches<ResponseAppearance::Default, ADW_RESPONSE_DEFAULT>); - static_assert(matches<ResponseAppearance::Suggested, ADW_RESPONSE_SUGGESTED>); - static_assert(matches<ResponseAppearance::Destructive, ADW_RESPONSE_DESTRUCTIVE>); - - static_assert(matches<ToastPriority::Normal, ADW_TOAST_PRIORITY_NORMAL>); - static_assert(matches<ToastPriority::High, ADW_TOAST_PRIORITY_HIGH>); - -} // namespace Adwaita - -namespace Glib -{ -#define VALUE_SPECIALIZATION(Enum, AdwEnumName) \ - auto Value<Adwaita::Enum>::value_type() -> GType \ - { \ - return adw_##AdwEnumName##_get_type(); \ - } - - VALUE_SPECIALIZATION(AccentColor, accent_color) - VALUE_SPECIALIZATION(ColorScheme, color_scheme) - VALUE_SPECIALIZATION(LengthType, breakpoint_condition) - VALUE_SPECIALIZATION(PresentationMode, dialog_presentation_mode); - VALUE_SPECIALIZATION(RatioType, breakpoint_condition) - VALUE_SPECIALIZATION(ResponseAppearance, response_appearance) - VALUE_SPECIALIZATION(ToastPriority, toast_priority) - -#undef VALUE_SPECIALIZATION -} // namespace Glib
\ No newline at end of file |
