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.
This commit is contained in:
Chris Taylor 2016-10-28 13:32:24 +08:00
parent e44013ebcf
commit e442bc6df5
3 changed files with 12 additions and 12 deletions

View file

@ -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
{

View file

@ -19,7 +19,6 @@ void arch_init();
namespace dcx {
class window;
enum class window_event_result : unsigned;
template <typename T>
using window_subfunction = window_event_result (*)(window *menu,const d_event &event, T *userdata);

View file

@ -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