From e33e19d0587146859d48a134ec9fd94e7b7ba5cd Mon Sep 17 00:00:00 2001 From: "FWoltermann@gmail.com" Date: Thu, 8 Dec 2011 14:53:40 +0000 Subject: Initial upload --- nGenEx/EventDispatch.h | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 nGenEx/EventDispatch.h (limited to 'nGenEx/EventDispatch.h') diff --git a/nGenEx/EventDispatch.h b/nGenEx/EventDispatch.h new file mode 100644 index 0000000..d2e3150 --- /dev/null +++ b/nGenEx/EventDispatch.h @@ -0,0 +1,62 @@ +/* Project nGenEx + Destroyer Studios LLC + Copyright © 1997-2004. All Rights Reserved. + + SUBSYSTEM: nGenEx.lib + FILE: EventDispatch.h + AUTHOR: John DiCamillo + + + OVERVIEW + ======== + Event Dispatch class +*/ + +#ifndef EventDispatch_h +#define EventDispatch_h + +#include "Types.h" +#include "EventTarget.h" +#include "List.h" + +// +--------------------------------------------------------------------+ + +class EventDispatch +{ +public: + static const char* TYPENAME() { return "EventDispatch"; } + + EventDispatch(); + virtual ~EventDispatch(); + + static void Create(); + static void Close(); + static EventDispatch* GetInstance() { return dispatcher; } + + virtual void Dispatch(); + virtual void Register(EventTarget* tgt); + virtual void Unregister(EventTarget* tgt); + + virtual EventTarget* GetCapture(); + virtual int CaptureMouse(EventTarget* tgt); + virtual int ReleaseMouse(EventTarget* tgt); + + virtual EventTarget* GetFocus(); + virtual void SetFocus(EventTarget* tgt); + virtual void KillFocus(EventTarget* tgt); + + virtual void MouseEnter(EventTarget* tgt); + +protected: + int mouse_x, mouse_y, mouse_l, mouse_r; + List clients; + EventTarget* capture; + EventTarget* current; + EventTarget* focus; + EventTarget* click_tgt; + + static EventDispatch* dispatcher; +}; + +#endif EventDispatch_h + -- cgit v1.1