diff options
author | Aki <please@ignore.pl> | 2022-09-15 00:53:01 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-09-15 00:53:01 +0200 |
commit | ce550f08fa91598612c016ebebc89c4af2e9505e (patch) | |
tree | 46be504b3831acc213b2da7feae38b1f1f6768ed /StarsEx/UIEventDispatch.h | |
parent | 5310ea3564fe98b2940a63b72621b79de9290f77 (diff) | |
download | starshatter-ce550f08fa91598612c016ebebc89c4af2e9505e.zip starshatter-ce550f08fa91598612c016ebebc89c4af2e9505e.tar.gz starshatter-ce550f08fa91598612c016ebebc89c4af2e9505e.tar.bz2 |
Renamed EventDispatch and EventTarget by adding UI prefix
Diffstat (limited to 'StarsEx/UIEventDispatch.h')
-rw-r--r-- | StarsEx/UIEventDispatch.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/StarsEx/UIEventDispatch.h b/StarsEx/UIEventDispatch.h new file mode 100644 index 0000000..442a539 --- /dev/null +++ b/StarsEx/UIEventDispatch.h @@ -0,0 +1,60 @@ +/* Starshatter: The Open Source Project + Copyright (c) 2021-2022, Starshatter: The Open Source Project Contributors + Copyright (c) 2011-2012, Starshatter OpenSource Distribution Contributors + Copyright (c) 1997-2006, Destroyer Studios LLC. + + AUTHOR: John DiCamillo + + + OVERVIEW + ======== + Event Dispatch class +*/ + +#ifndef UIEventDispatch_h +#define UIEventDispatch_h + +#include "List.h" +#include "Types.h" +#include "UIEventTarget.h" + + +class UIEventDispatch +{ +public: + static const char* TYPENAME() { return "UIEventDispatch"; } + + UIEventDispatch(); + virtual ~UIEventDispatch(); + + static void Create(); + static void Close(); + static UIEventDispatch* GetInstance() { return dispatcher; } + + virtual void Dispatch(); + virtual void Register(UIEventTarget* tgt); + virtual void Unregister(UIEventTarget* tgt); + + virtual UIEventTarget* GetCapture(); + virtual int CaptureMouse(UIEventTarget* tgt); + virtual int ReleaseMouse(UIEventTarget* tgt); + + virtual UIEventTarget* GetFocus(); + virtual void SetFocus(UIEventTarget* tgt); + virtual void KillFocus(UIEventTarget* tgt); + + virtual void MouseEnter(UIEventTarget* tgt); + +protected: + int mouse_x, mouse_y, mouse_l, mouse_r; + List<UIEventTarget> clients; + UIEventTarget* capture; + UIEventTarget* current; + UIEventTarget* focus; + UIEventTarget* click_tgt; + + static UIEventDispatch* dispatcher; +}; + + +#endif // UIEventDispatch_h |