Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | pmbaty | 1 | /* |
2 | * This file is part of the DXX-Rebirth project <https://www.dxx-rebirth.com/>. |
||
3 | * It is copyright by its individual contributors, as recorded in the |
||
4 | * project's Git history. See COPYING.txt at the top level for license |
||
5 | * terms and a link to the Git history. |
||
6 | */ |
||
7 | |||
8 | #pragma once |
||
9 | |||
10 | #include <cstdint> |
||
11 | #include "dxxsconf.h" |
||
12 | |||
13 | namespace dcx { |
||
14 | |||
15 | struct d_event; |
||
16 | struct d_create_event; |
||
17 | struct d_change_event; |
||
18 | struct d_select_event; |
||
19 | |||
20 | enum event_type : unsigned; |
||
21 | enum class window_event_result : uint8_t; |
||
22 | |||
23 | int event_init(); |
||
24 | |||
25 | // Sends input events to event handlers |
||
26 | window_event_result event_poll(); |
||
27 | void event_flush(); |
||
28 | |||
29 | // Set and call the default event handler |
||
30 | window_event_result call_default_handler(const d_event &event); |
||
31 | |||
32 | // Send an event to the front window as first priority, then to the windows behind if it's not modal (editor), then the default handler |
||
33 | window_event_result event_send(const d_event &event); |
||
34 | |||
35 | // Sends input, idle and draw events to event handlers |
||
36 | window_event_result event_process(); |
||
37 | |||
38 | void event_enable_focus(); |
||
39 | void event_disable_focus(); |
||
40 | static inline void event_toggle_focus(int activate_focus) |
||
41 | { |
||
42 | if (activate_focus) |
||
43 | event_enable_focus(); |
||
44 | else |
||
45 | event_disable_focus(); |
||
46 | } |
||
47 | |||
48 | #if DXX_USE_EDITOR |
||
49 | // See how long we were idle for |
||
50 | void event_reset_idle_seconds(); |
||
51 | #endif |
||
52 | |||
53 | } |