From f2204e2b3ad1f91f320e3a3120f113f5edae6237 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Mon, 4 Mar 2024 14:13:30 -0500 Subject: [PATCH] LibGUI: Define bitwise operations for GUI::MouseButton This type is designed to be use as a flag. Define bitwise operations for convenience. (clang-format-17 caught an east-const conversion here as well). --- Userland/Libraries/LibGUI/Event.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGUI/Event.h b/Userland/Libraries/LibGUI/Event.h index 7b13555eb7..b978daaa07 100644 --- a/Userland/Libraries/LibGUI/Event.h +++ b/Userland/Libraries/LibGUI/Event.h @@ -8,6 +8,7 @@ #pragma once +#include #include #include #include @@ -263,7 +264,7 @@ public: ByteString const& keymap() const { return m_keymap; } private: - const ByteString m_keymap; + ByteString const m_keymap; }; class WMAddToQuickLaunchEvent : public WMEvent { @@ -384,6 +385,8 @@ enum MouseButton : u8 { Forward = 16, }; +AK_ENUM_BITWISE_OPERATORS(MouseButton); + class KeyEvent final : public Event { public: KeyEvent(Type type, KeyCode key, u8 map_entry_index, u8 modifiers, u32 code_point, u32 scancode)