3#include "di/reflect/enumerator.h"
4#include "di/reflect/field.h"
5#include "di/reflect/prelude.h"
17constexpr auto tag_invoke(di::Tag<di::reflect>, di::InPlaceType<MouseEventType>) {
19 return di::make_enumerators<
"KeyEventType">(di::enumerator<
"Press",
Press>, di::enumerator<
"Move",
Move>,
20 di::enumerator<
"Release",
Release>);
48 constexpr friend auto tag_invoke(di::Tag<di::reflect>, di::InPlaceType<MouseEvent>) {
49 return di::make_fields<
"MouseEvent">(
50 di::field<
"type", &MouseEvent::m_type>, di::field<
"button", &MouseEvent::m_button>,
51 di::field<
"position", &MouseEvent::m_position>, di::field<
"modifers", &MouseEvent::m_modifiers>);
56 MousePosition m_position;
Definition mouse_event.h:23
constexpr MouseEvent(MouseEventType type, MouseButton button, MousePosition const &position={}, Modifiers modifiers=Modifiers::None)
Definition mouse_event.h:30
constexpr auto type() const -> MouseEventType
Definition mouse_event.h:34
constexpr auto is_vertical_scroll() const -> bool
Definition mouse_event.h:39
static constexpr auto press(MouseButton button, MousePosition const &position={}, Modifiers modifiers=Modifiers::None) -> MouseEvent
Definition mouse_event.h:25
constexpr friend auto tag_invoke(di::Tag< di::reflect >, di::InPlaceType< MouseEvent >)
Definition mouse_event.h:48
auto operator==(MouseEvent const &) const -> bool=default
constexpr auto position() const -> MousePosition const &
Definition mouse_event.h:36
constexpr auto modifiers() const -> Modifiers
Definition mouse_event.h:37
constexpr auto button() const -> MouseButton
Definition mouse_event.h:35
constexpr auto translate(MouseCoordinate offset_in_cells, dius::tty::WindowSize const &size) const -> MouseEvent
Definition mouse_event.h:41
Definition cursor_style.h:5
MouseButton
Definition mouse.h:10
@ VerticalScrollButtons
Definition mouse.h:24
@ None
Definition mouse.h:11
Modifiers
Definition modifiers.h:9
@ None
Definition modifiers.h:10
@ Press
Definition key_event.h:13
@ Release
Definition key_event.h:15
constexpr auto tag_invoke(di::Tag< di::reflect >, di::InPlaceType< CursorStyle >)
Definition cursor_style.h:16
MouseEventType
Definition mouse_event.h:11
@ Press
Definition mouse_event.h:12
@ Move
Definition mouse_event.h:13