22 #ifndef MACS2_EVENTS_H 23 #define MACS2_EVENTS_H 25 #include "common/array.h" 26 #include "common/stack.h" 27 #include "graphics/screen.h" 28 #include "macs2/messages.h" 46 operator const Common::Rect &()
const {
return _bounds; }
48 int16 height()
const {
return _bounds.
height(); }
61 bool _needsRedraw =
true;
103 #define MESSAGE(NAME) \ 105 virtual bool msg##NAME(const NAME##Message &e) { \ 106 for (Common::Array<UIElement *>::iterator it = _children.begin(); \ 107 it != _children.end(); ++it) { \ 108 if ((*it)->msg##NAME(e)) \ 145 virtual bool shouldQuit()
const = 0;
150 #define MESSAGE(NAME) \ 151 bool msg##NAME(const NAME##Message &e) override { \ 152 return !_views.empty() ? focusedView()->msg##NAME(e) : false; \ 166 uint32 currentMillis = 0;
182 return _views.empty() ? nullptr : _views.top();
197 focusedView()->drawElements();
209 return !_views.empty() ? focusedView()->tick() :
false;
Definition: managed_surface.h:51
UIElement * focusedView() const
Definition: events.h:181
void draw() override
Definition: events.h:203
T height() const
Definition: rect.h:218
Graphics::Screen * getScreen() const
Definition: events.h:188
void drawElements()
Definition: events.h:195
bool tick() override
Definition: events.h:208
Definition: debugtools.h:25