HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
gui_event_variant.hpp
Go to the documentation of this file.
1// Copyright Take Vos 2022.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
9#pragma once
10
11#include "gui_event_type.hpp"
12#include "../macros.hpp"
13
14hi_export_module(hikogui.GUI : gui_event_variant);
15
16hi_export namespace hi { inline namespace v1 {
17
24 other,
25
28 mouse,
29
33
37
41
45
49};
50
54[[nodiscard]] constexpr gui_event_variant to_gui_event_variant(gui_event_type type) noexcept
55{
56 switch (type) {
57 case gui_event_type::mouse_move:
58 case gui_event_type::mouse_drag:
59 case gui_event_type::mouse_down:
60 case gui_event_type::mouse_up:
61 case gui_event_type::mouse_wheel:
62 case gui_event_type::mouse_enter:
63 case gui_event_type::mouse_exit:
64 case gui_event_type::mouse_exit_window:
66
67 case gui_event_type::keyboard_down:
68 case gui_event_type::keyboard_up:
69 case gui_event_type::keyboard_enter:
70 case gui_event_type::keyboard_exit:
72
75
77 case gui_event_type::text_edit_paste:
79
80 case gui_event_type::keyboard_grapheme:
81 case gui_event_type::keyboard_partial_grapheme:
83
86
87 default:
89 }
90}
91
92}} // namespace hi::v1
Definition of GUI event type.
gui_event_type
GUI event type.
Definition gui_event_type.hpp:24
constexpr gui_event_variant to_gui_event_variant(gui_event_type type) noexcept
Convert a gui event type, to an gui event variant.
Definition gui_event_variant.hpp:54
gui_event_variant
A granular gui event type.
Definition gui_event_variant.hpp:21
@ window_redraw
Request that part of the window gets redrawn on the next frame.
@ window_set_keyboard_target
Change the keyboard target widget for this window.
@ window_set_clipboard
Place data on the clipboard.
@ keyboard
The gui_event has keyboard data.
@ mouse
The gui_event has mouse data.
@ keyboard_target
The gui_event has keyboard target data.
@ other
The gui_event does not have associated data.
@ grapheme
The gui_event has grapheme data.
@ rectangle
The gui_event has rectangle data.
@ clipboard_data
The gui_event has clipboard data.
The HikoGUI namespace.
Definition array_generic.hpp:20
DOXYGEN BUG.
Definition algorithm_misc.hpp:20