From e442bc6df583290ae3de37563cc5088bb3115d8d Mon Sep 17 00:00:00 2001 From: Chris Taylor Date: Fri, 28 Oct 2016 13:32:24 +0800 Subject: [PATCH] Move window_event_result definition to event.h The whole event system will need to know about window_event_result, because every event function will return one. --- common/include/event.h | 11 +++++++++++ common/include/fwd-window.h | 1 - common/include/window.h | 12 +----------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/common/include/event.h b/common/include/event.h index 02e385cdb..aceb62f4a 100644 --- a/common/include/event.h +++ b/common/include/event.h @@ -48,6 +48,17 @@ enum event_type : unsigned EVENT_UI_USERBOX_DRAGGED }; +enum class window_event_result : unsigned +{ + // Window ignored event. Bubble up. + ignored, + // Window handled event. + handled, + close, + // Window handler already deleted window (most likely because it was subclassed), don't attempt to re-delete + deleted, +}; + // A vanilla event. Cast to the correct type of event according to 'type'. struct d_event { diff --git a/common/include/fwd-window.h b/common/include/fwd-window.h index ed367239b..08f03455e 100644 --- a/common/include/fwd-window.h +++ b/common/include/fwd-window.h @@ -19,7 +19,6 @@ void arch_init(); namespace dcx { class window; -enum class window_event_result : unsigned; template using window_subfunction = window_event_result (*)(window *menu,const d_event &event, T *userdata); diff --git a/common/include/window.h b/common/include/window.h index 131ee02ee..b644954cf 100644 --- a/common/include/window.h +++ b/common/include/window.h @@ -21,19 +21,9 @@ #ifdef __cplusplus #include "fwd-window.h" +#include "event.h" namespace dcx { -enum class window_event_result : unsigned -{ - // Window ignored event. Bubble up. - ignored, - // Window handled event. - handled, - close, - // Window handler already deleted window (most likely because it was subclassed), don't attempt to re-delete - deleted, -}; - constexpr const unused_window_userdata_t *unused_window_userdata = nullptr; struct embed_window_pointer_t