ScummVM API documentation
Macs2::Events Class Referenceabstract

#include <events.h>

Inheritance diagram for Macs2::Events:
Macs2::UIElement Macs2::Macs2Engine

Public Member Functions

void runGame ()
 
void addView (UIElement *ui)
 
UIElementfocusedView () const
 
Graphics::ScreengetScreen () const
 
void drawElements ()
 
void draw () override
 
bool tick () override
 
- Public Member Functions inherited from Macs2::UIElement
 UIElement (const Common::String &name, UIElement *uiParent)
 
 UIElement (const Common::String &name)
 
void redraw ()
 
Graphics::ManagedSurface getSurface () const
 
virtual UIElementfindView (const Common::String &name)
 

Public Attributes

uint32 currentMillis = 0
 

Protected Member Functions

void processEvent (Common::Event &ev)
 
virtual bool shouldQuit () const =0
 
bool msgAction (const ActionMessage &e) override
 
bool msgFocus (const FocusMessage &e) override
 
bool msgUnfocus (const UnfocusMessage &e) override
 
bool msgKeypress (const KeypressMessage &e) override
 
bool msgMouseDown (const MouseDownMessage &e) override
 
bool msgMouseUp (const MouseUpMessage &e) override
 
- Protected Member Functions inherited from Macs2::UIElement
virtual bool msgMouseMove (const MouseMoveMessage &e)
 

Additional Inherited Members

- Protected Attributes inherited from Macs2::UIElement
Common::Array< UIElement * > _children
 
Common::Rect _innerBounds
 
Bounds _bounds
 
bool _needsRedraw = true
 
Common::String _name
 

Detailed Description

Main events and view manager. This is kept separate from the engine class because the engine may add a lot of globals and bring in other classes. So to save on compilation time, classes that only need to access basic view management methods like addView only need to include events.h rather than the whole engine.

Member Function Documentation

◆ processEvent()

void Macs2::Events::processEvent ( Common::Event ev)
protected

Process an event

◆ shouldQuit()

virtual bool Macs2::Events::shouldQuit ( ) const
protectedpure virtual

Returns true if the game should quit

Implemented in Macs2::Macs2Engine.

◆ runGame()

void Macs2::Events::runGame ( )

Main game loop

◆ addView()

void Macs2::Events::addView ( UIElement ui)

Adds a focused view to the view stack without replacing current one

◆ focusedView()

UIElement* Macs2::Events::focusedView ( ) const
inline

Returns the currently focused view, if any

◆ getScreen()

Graphics::Screen* Macs2::Events::getScreen ( void  ) const
inline

Returns the underlying screen

◆ drawElements()

void Macs2::Events::drawElements ( )
inline

Draws the focused view

◆ draw()

void Macs2::Events::draw ( )
inlineoverridevirtual

Events manager doesn't have any intrinsic drawing

Reimplemented from Macs2::UIElement.

◆ tick()

bool Macs2::Events::tick ( )
inlineoverridevirtual

Called once every game frame

Reimplemented from Macs2::UIElement.

Reimplemented in Macs2::Macs2Engine.


The documentation for this class was generated from the following file: